Sunday, December 24, 2017

Fiddling with old Time Capsule 1st gen and linux


So I got my hands on an old Apple Time Capsule (1st generation) just to see what it would do.

I wanted to see if it would mount under ubuntu 17.10 with cifs, and the instructions here were pretty useful.

http://blog.martinshouse.com/2014/09/mounting-apple-time-capsule-share-from.html


There was a little snag: It kept giving me Error 112 Host is down.

sudo mount.cifs //1.2.3.4/data -opassword=mypassword,sec=ntlm /mnt/mymountpoint
mount error(112): Host is down


Looking at the dmesg output:
dmesg

[716567.498354] No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3 (or SMB2.1) specify vers=1.0 on mount.
[716567.500002] CIFS VFS: SMB response too short (35 bytes)
[716567.500038] CIFS VFS: cifs_mount failed w/return code = -112


I needed to specify the SMB version as 1.0 for mount.cifs or it wouldn't work.


sudo mount.cifs //1.2.3.4/data -opassword=mypassword,sec=ntlm,vers=1.0 /mnt/mymountpoint



=============================================


and interestingly, smbclient won't display the actual share until you tell it not to use ntlmv2.

It will connect but it won't display the Disk.

smbclient -L //1.2.3.4
WARNING: The "syslog" option is deprecated
Server does not support EXTENDED_SECURITY but 'client use spnego = yes' and 'client ntlmv2 auth = yes' is set
Anonymous login successful
Domain=[WORKGROUP] OS=[Apple Base Station] Server=[CIFS 4.32]
Enter WORKGROUP\me's password:

Sharename Type Comment
--------- ---- -------
IPC$ IPC


But if we give it an option of 'client ntlmv2 auth=no', then we can see it.


smbclient -L //1.2.3.4 --option='client ntlmv2 auth=no' -U example

smbclient -L //1.2.3.4 --option='client ntlmv2 auth=no' -U example
WARNING: The "syslog" option is deprecated
Enter WORKGROUP\example's password:
Domain=[WORKGROUP] OS=[Apple Base Station] Server=[CIFS 4.32]

Sharename Type Comment
--------- ---- -------
IPC$ IPC
data Disk


And we can see "data".

Wednesday, December 20, 2017

Huge mouse cursors with Ubuntu 17.10

I couldn't find my mouse cursor easily, so why not make it as big as possible.

First, get the dconf editor and then go to

org / gnome / desktop / interface

and set the cursor-size to 64.

You can set it to larger than 64 but it doesn't get any bigger than 64. I wish I could make it even bigger.

It takes a little getting used to but it's so much easier to see on my 50" tv screen.


You can do it from the command line too:

dconf write /org/gnome/desktop/interface/cursor-size 24
dconf write /org/gnome/desktop/interface/cursor-size 64


https://askubuntu.com/questions/126491/how-do-i-change-the-cursor-and-its-size

Sunday, December 17, 2017

So many tabs and finding the one where you just were

I open a LOT of tabs in firefox. Sometimes it gets confusing to find the tab you were just using. Where is it? Where did it go?

For example, I click on new tab and my new tab opens on the far right of all of my tabs, and the one I was just using scrolls off the visible screen.

It'd be really slick to have a way to find your most recently used tabs, like under the history menu where you've got Recently Closed Tabs menu, just have a Recently Used Tabs menu.

Or a right+click on the List All Tabs button would give you the tabs sorted in order of last use.

Maybe an "about:recent" page.

ALT+TAB will get you to your most recently used window, but CTRL+TAB in firefox goes to the next tab, CTRL+SHIFT+TAB previous tab, not the most recently used tab.


I'm lost in the forest without a trail of breadcrumbs...

===============

A couple of other things that would be useful:

The mini-history in the back button (right click on the back arrow button) only shows you 15 entries, why not give me the option of displaying as many entries as will display on my screen by clicking on a down arrow or something. Scrollable, perhaps.


Also, a quick way to find out which windows are playing videos/sounds would be nice. "About:videos" with maybe an option to stop them all. Or just a menu option "Stop all videos".

================

The latest version of firefox have been auto-repeating my typing when the cpu gets hung up. So I get a lot of exxxxxxxxxxxxxxxtraaaaaaa characters sometimes while typing in the location box.

==================


My latest firefox discovery: The about:about page.

Saturday, December 16, 2017

Ti99 game Rock Runner

I was looking at a page about boulder dash and different variants and wondered if there was a boulder dash clone for the ti99.

I read about this ti99 game rock runner which is a boulder dash clone so I had to give it a go.


There's the author's web page at:

http://www.lafortune.eu/rockrunner/index.html

Rock Runner Info

8-way scrolling game for the TI-99/4A.
Goal: collecting diamonds in a 2D world.
Simple physics: gravity, lava, bombs, butterflies,...
Written in TMS-9900 assembler.
Development tools: line-by-line assembler, hex editor, Mini Memory module, tape recorder.
Used a novel undocumented half-bitmap graphics mode of the TMS-9918A Video Display Processor.
Program code fitted in 4K of memory.
Distributed by Asgard Software.

and I was able to find a disk image on the net.

I've never used a ti99 before so it was difficult to get things set up:

Requirements: Editor/Assembler cartridge, 32K RAM, disk drive, joysticks.
Executable to run: ROCK (E/A Option 5)



./mame64 ti99_4a -cart1 editass -rompath 'mame190roms' -window -screen screen1 -resolution 640x480 -verbose -ioport peb -ioport:peb:slot8 hfdc -ioport:peb:slot2 32kmem -flop1 ../../Rockrun.dsk


I finally realized what E/A option 5 means:

Load the editor/assembler by pressing 2:



Press option 5 to load:



Then type DSK1.ROCK and ENTER (I think it needs to be caps-lock uppercase)








It's pretty challenging to finish the first level in the time limit.

Friday, December 15, 2017

Why does firefox keep eating my memory on Ubuntu 17.10?

Yes, I've got a lot of tabs open. But after firefox opens it only loads the frontmost tabs in the window.

So why does it keep gobbling memory. I've got 8GB but it slowly keeps allocating memory as I browse until it gets into the swapfile and beyond. And then my system goes unresponsive.

I sure wish I could get firefox to put a cap on how much memory it uses. Or a menu option to flush all of its buffers or something.

I just have to watch it closely with system-monitor and when it gets too big just close it and reopen it. Often when it makes a huge swapfile, when you close firefox it tells you that it crashed, probably because it took too long to shut itself down.

As much time as I've wasted I think I'll be boosting up my memory.

Ubuntu 17.10 and losing my EDID on a vga splitter


So I got a new 50 inch tv and I thought it'd be great to use it as a monitor. Getting a VGA splitter device allows me to hook up my 24 inch monitor and pipe the output into the TV's VGA input.

It looks great, but after rebooting, I discovered that I had lost the ability to read the monitor's EDID info so ubuntu gives me a 1024x768 display instead of the 1920x1080 display.

After reading a whole bunch of pages with suggestions and tips, here's what worked for me:

First get the read-edid with "sudo apt-get install read-edid"


I read the EDID info with just my original hannsg 24 connected and wrote that to a file.

sudo get-edid -b 1 > hannsg.bin

The -b is the bus number. As I have dual monitors, I had to figure out which bus it was on. One of my missteps was getting the edid for my other monitor (which tops out at 1280x1024) accidentally, hence manually specifying the bus number.

To make sure you've got the right monitor, pipe it to parse-edid:

cat hannsg.bin | parse-edid

and that should tell you that you've got the right monitor.

now you want to copy that file into /lib/firmware/edid

sudo mkdir /lib/firmware/edid
sudo cp hannsg.bin /lib/firwmare/edid/hannsg.bin


now I edit my ubuntu grub booting configuration:

sudo nano /etc/default/grub



There are built-in edid for common resolutions but this will only get you that one specific resolution:
You can try specifying a specific resolution like so:

GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin"
GRUB_CMDLINE_LINUX="drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin"


I have changed the HIDDEN_TIMEOUT to 5 seconds so I have time to hit esc to get the GRUB menu after a reboot and also so you can edit the command line in grub with "e" (and CTRL+X to edit the grub boot editor). It's pretty useful to have the grub boot editor if you just want to test a specific command line settings without making permanent changes).

===============================

GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=5
GRUB_HIDDEN_TIMEOUT_QUIET=false
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
#GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin"
GRUB_CMDLINE_LINUX="drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin"


========================================

the important lines here are the ones with the drm_kms_helper

GRUB_CMDLINE_LINUX_DEFAULT="drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin"
GRUB_CMDLINE_LINUX="drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin"


This is what the original section of /etc/default/grub looked like:

==================================================
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX=""

=======================================================

Once you make your edits and save, then

sudo update-grub


So now after boot I get this when I check my dmesg:


dmesg | grep edid
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-19-generic root=UUID= ro drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-19-generic root=UUID= ro drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin drm_kms_helper.edid_firmware=VGA-1:edid/1920x1080.bin
[ 2.521260] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "VGA-1"
[ 34.742536] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "VGA-1"
[ 57.856240] [drm] Got built-in EDID base block and 0 extensions from "edid/1920x1080.bin" for connector "VGA-1"




dmesg | grep edid
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-19-generic root=UUID= ro drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin
[ 0.000000] Kernel command line: BOOT_IMAGE=/boot/vmlinuz-4.13.0-19-generic root=UUID= ro drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin drm_kms_helper.edid_firmware=VGA-1:edid/hannsg.bin
[ 2.445432] platform VGA-1: Direct firmware load for edid/hannsg.bin failed with error -2
[ 2.445470] [drm:drm_load_edid_firmware [drm_kms_helper]] *ERROR* Requesting EDID firmware "edid/hannsg.bin" failed (err=-2)
[ 33.654278] [drm] Got external EDID base block and 0 extensions from "edid/hannsg.bin" for connector "VGA-1"
[ 63.689153] [drm] Got external EDID base block and 0 extensions from "edid/hannsg.bin" for connector "VGA-1"


And a couple of notes:

I have specified a connector name with "VGA-1:" so it gets that edid for that particular connector.

You can get the connector names by looking at /sys/class/drm

ls /sys/class/drm/
card0 card0-DP-1 card0-HDMI-A-1 card0-VGA-1 renderD128 version

Also I had problems because I didn't put the edid in the correct directory. One webpage I looked at said /usr/lib/firmware/edid which didn't work for me: I had to put it in /lib/firmware/edid. After I did that I was golden.

Before that I was getting these strange error -2 couldn't load the edid/hannsg.bin messages in my dmesg log. I do get an error -2 but it keeps retrying and finds it once it mounts the filesystem I think.

Doing a "dmesg | grep mount" tells me that my file system isn't mounted until 3.1 seconds mark so that's probably what's happening.

[ 3.137360] EXT4-fs (sda1): mounted filesystem with ordered data mode. Opts: (null)
[ 9.739364] EXT4-fs (sda1): re-mounted. Opts: errors=remount-ro



Now I can hook up my vga splitter box and it happily loads the proper edid and everything is right with the world.


I must've rebooted about 20-30 times to get this working. I found this process most difficult so I hope this helps you avoid the same frustration!

It'd be really cool to just have a "choose custom resolution" button in the display settings where you could enter "1920x1080x60" for example when it can't get a proper edid. That would be too easy, I guess 8-)





Another thing you can try is this from a terminal:

echo "VGA-1:edid/hannsg.bin" | sudo tee /sys/module/drm_kms_helper/parameters/edid_firmware

(you need the tee even when you've done the sudo because it's the shell that does the redirection)

echo "VGA-1:edid/hannsg.bin" > /sys/module/drm_kms_helper/parameters/edid_firmware
bash: /sys/module/drm_kms_helper/parameters/edid_firmware: Permission denied


If you have specified a value for this, then you see the value that you've set:

cat /sys/module/drm_kms_helper/parameters/edid_firmware
VGA-1:edid/hannsg.bin