This is a page for "feeding Google." Every so often, I search for something and discover that (gasp!) the information isn't in Google! But Google ought to know everything!

Hence, this page of 'Stuff That Ought To Be In Google'. These are some small nuggets of information that I have found out myself, and which were not (at the time) available on the Web (or were very hard to locate). Hopefully, they will be useful...

Rio Carbon works with Linux

The Rio Carbon (mp3 player) works with Linux. It is a USB Mass-storage device (as /dev/sdX). In Mandrake 10.1, it "just works".

Rio Karma and .m3u playlists refer to parent directory

The Rio Karma (Ogg/mp3 player) handles .m3u (playlist) files badly. The lines in the .m3u file have to point one directory higher than you would expect. Eg a directory called Mozart/ containing files Allegro.ogg, Andante.ogg, Vivace.ogg, and Concerto.m3u would have the following entries in Concerto.m3u:
This applies to the Rio Music Manager Lite (Java) applet.
[Yes, this behaviour is wrong, and the resulting .m3u file won't work in any other program.]

I wrote a script to convert the playlists. Note: you must also have at least version 2004-09-28 of rmmlite.jar; the version (2004-01-15) included on the player will NOT work.
Other than that, the Karma is a fantastic player, with excellent sound quality and interface.

Setting the encryption password for a HomePlug Turbo with Linux

The HomePlug Turbo Powerline Ethernet (Fla85) devices work fine with Linux. However, the supplied configuration utility only runs under MSWindows (not even under wine). Thus, we cannot set the DES-56 encryption password... ...But they have the same chipset as the more-expensive devolo dLAN devices. So we can use devolo's Linux driver :-)

Download it from here, then: untar; ./configure (needs libpcap0-devel); make; make install-cfgtool. Then, for each device, run dlanconfig eth0 (as root), and choose option 1 to set local password.

dlanconfig is actually rather a good tool. You can even monitor network throughput of remote devices with it. It has a well written man page too. On my network, I have measured an average transfer rate of 4 Mbyte/sec for scp (which is respectable, but not nearly the expected 85 Mbit/sec); note that this is significantly reduced by extension leads.

Note: ./dlanconfig won't run directly from the source directory; it has to be installed.

IBM/Lenovo external USB keyboard with Ultranav: disabling page-left/right buttons

I'm a great fan of the IBM trackpoints, to the extent that I use an UltraNav USB keyboard on my main desktop PC, in order to have a trackpoint. (This means I can use the mouse without moving my hands from typing position). BUT, above the arrow keys (in the gap that would normally be present above the "inverted-T"), IBM have fitted page-left and page-right buttons. These map to back/forward in a web-browser, so striking these by accident when trying to scroll can lead to data loss!

On an actual thinkpad, these keys emit unique keycodes, so it's very easy to configure them to be simply ignored. But on the USB UltraNav keyboard, these keys have no unique keycode, but are mapped in hardware to be equivalent to (Left_Alt + Left_Arrow)  or  (Left_Alt + Right_Arrow). This is insane.

The solution is simple. Firstly, lift the key-cap off the keyboard. The easiest way to do this is to hook the fingernails of the left and right index fingers under each side, and pull. This won't break the key. You'll then see a plastic "bubble" which sticks up. This is what transfers the force from the key to the switch. Tear it off. Warning: this will permanently de-activate that switch. Then, press the key-cap back into place: place it in position, aligning the lower side (the one nearest the typist) of the key first. Then a gentle press on the key will click it back. Enjoy your new, typo-proof keyboard.

How to (forcibly) Un-install DriveSentry under Vista

Drive Sentry is, in my view, even more annoying than UAC. A friend's Vista-laptop has become almost unusable as a result, and the nagging is incessant. It's almost impossible to uninstall it. None of the following methods work:

   * Regular uninstallation from the GUI (Add/Remove programs)
   * Deleting DriveSentry.exe from the command-prompt (whether or not this is run as administrator)
   * Deleting DriveSentry.exe from Windows Explorer (whether or not this is run as administrator)
   * Use Ctrl-Alt-Del to bring up Task Manager, kill the Drive Sentry process, then try to repeat the above.

In most cases, Drive Sentry detects you're trying to delete it, and blocks this; otherwise Vista's UAC is responsible. So, what does work? Here's how I did it:

   * Download an Ubuntu live CD. Any modern Linux distribution will do (as long as it has NTFS-write support).
   * Burn the ISO image, then boot the CD.
   * Open a console (gnome-terminal).
   * Become root: sudo su
   * Mount the windows partition: mkdir /tmp/vista; mount /dev/sda1 /tmp/vista (Note: the value of sda1 may vary)
   * Delete DriveSentry.exe: rm "/tmp/vista/Program Files/DriveSentry/DriveSentry.exe" (This deletes the executable)
   * Unmount the windows partition: umount /tmp/vista
   * Shutdown the Ubuntu Live CD, and enjoy slightly less nagging.

Of course, Linux beats Windows any day, but if you really are stuck with Vista, the above makes life a little more bearable.

How to make a KeySonic Illuminated Keyboard work with Linux.

Short answer: Press "Ctrl + Alt + Shift (all on the left-side) + N" to get it out of Gaming mode.

Long answer: (mainly so that Google can index this page, so people can find it)...
Product is a KeySonic "Compact Gaming Keyboard with Backlight" model KSK-6001 UELX (UK)
USB ID is: 060b:2231 (VID = 060b, PID = 2231), lsusb shows: Bus 001 Device 009: ID 060b:2231 Solid Year
dmesg says: generic-usb: probe of 0003:060B:2231.0008 failed with error -22
Details: The helpful answer was provided by this forum post (in French), which explains that the Keyboard defaults to a "Gaming" mode, every time it is powered-on. To make it work properly, the keyboard must be switched back to normal mode, with Ctrl+Alt+Shift+N. (Only the left-hand Ctrl-Alt-Shift keys work.)

How to SCP Photos onto an iPad from Linux (without iTunes), and have them show up in the Photos app.

Apple devote a considerable amount of engineering effort into making their hardware needlessly awkward and expert-hostile.
The iPad 3 does have one wonderful feature: the 2048x1526 4:3 Retina display, which makes it excellent for use as a photo album.
Being a Linux-user (with no way to run iTunes), it's quite hard to get my photos onto the device. Here's what I did with mine:

* Update it to iOS 6.1 (this required a trip to the Apple Store: the inbuilt Software Update feature doesn't seem to do checksums and bricked it - and of course, I only run Linux, so have no iTunes.
* Jailbreak it. Use evasi0n - this works really well under Ubuntu Quantal. The underlying process is complex, but the GUI makes it really simple.
* Use Cydia and install the SSH server. Remember to change the default passwords for the root and mobile accounts.
* Connect to the charger, and disable power-saving: Settings->General->Auto-Lock = Never (otherwise, your SSH connection will die when the screen blanks).
* Then copy your SSH public key: scp ~.ssh/ mobile@ (where is the iPad, or set a DNS entry and DHCP-reservation).
* On the iPad, the normal user account is called mobile, and has the home directory /User/. Photos go into /User/Media/DCIM/100APPLE .

* BUT... if you just put the photo files there, the iPad's Photo App won't "see" them. There's a database and a cache - and only iTunes will update it! Being Apple, there's no alternative album application (it would compete with built in core functionality).
* One way to do this is to put the .jpg files onto the iPad somewhere, then use the iFile file manager ($4.00 on Cydia) to add each file (one at a time!!) to the "Camera Roll". [Aside: iFile also contains a web-server for uploading/downloading files.]

* A better way is to use scp to transfer the photos, and figure out how to make the iPad see them:
* Create the target directory, if necessary: mkdir -p /User/Media/DCIM/100APPLE (it's OK to delete anything in the DCIM directory if you don't want it).
* Back up the PhotoData directory, in case you do something wrong: cp -a /User/Media/PhotoData /User/Media/PhotoData.bak
* Copy your files across: scp *.jpg mobile@
* Delete the Photo database and cache from the iPad. Stop the Photo App if it's running (double-tap home-button). Then delete these 5 files:
   rm /var/mobile/Media/PhotoData/{Photos.sqlite,Photos.sqlite-shm,Photos.sqlite-wal} /var/mobile/Media/PhotoData/MISC/{DCIM_APPLE.plist,PreviewWellImage.tiff}
* Reboot the iPad: ssh root@ "reboot"
* Start the Photos App. It will now slowly tick through "restoring 100 of 750..." as the database and cache is rebuilt. (Sometimes it's necessary to take a photo with the built-in camera to prompt this process).
* Enjoy. At last!

TODO: must we delete all 5 of these files? Is there a way to trigger a "restore" without rebooting? Can we use Rsync?
TODO: is there any way to have synchronised sub-directories for different albums within the camera roll?
TODO: figure out how to get any other OS onto the iPad. If only it ran Android, it would be so much more user-friendly.

How to install Linux on a Lenovo S205 IdeaPad, and have it then successfully recognise and boot from the disk

The Lenovo S205 IdeaPad works very well with Linux, but it is complete nuisance to get the BIOS to recognise and boot the new installation. The usual symptom is that the install from USB key (eg Unetbootin) works perfectly, but then, on rebooting, the BIOS doesn't offer to boot the new OS, indeed it doesn't even list the hard-drive as a bootable device. Rather worse, there is no BIOS error message whatsoever; it simply falls-back to network-boot, then fails. Here's what I found:

* The installer will try to use a UEFI /boot partition. Do not do this. UEFI doesn't work properly on this machine.
* The disk must be partitioned using a Master Boot Record (MBR) rather than the newer default of a GUID Partition Table (GPT). Ubuntu will try to set up a GPT by default, but if you manually partition it (without a separate /boot), it should go for an MBR (or you can convert it later with gdisk).
* In the MBR, the relevant partition must have the bootable flag set. (This is option a in fdisk). Installers don't always set this, and most BIOSes don't care.
* Only the older version of GRUB (0.97, sometimes called "grub-legacy") will work. GRUB 2 (often called "grub-pc") or the GRUB-EFI bootloader will NOT work. Ubuntu will usually install GRUB2, but it's not difficult to change this later: Boot the Live-USB environment, mount the newly installed hard-drive, mount -o bind /dev/, /proc and /sys into place, copy /etc/resolv.conf across, chroot into the new installation, apt-get install grub (and remove grub-pc), then run update-grub and grub-install.
* It may be fussy about certain disks. Most, but not all Solid-State drives are OK. Some, like the "OCZ-VECTOR" don't work, while others, like the "INTEL SSDSA2M160G2GC" are OK. But this inference may be mistaken: there are so many ways to make a disk not boot that this might have been caused by one of the other problems above. I'm not certain.
* Either 64-bit or 32-bit operating systems work. I have Ubuntu Saucy Salamander 64-bit installed with 8GB of RAM.

Good luck using your S205 - it works pretty well after fixing the above!

How to keep a Comtrend NexusLink 5631 from locking up with line-bonding.

I have a Comtrend NexusLink 5631 from Be, used for ADSL Line bonding. As a bonded router, it works well enough, but it's really unstable.

The Symptom: about once a week (but not predictably, and sometimes more often), the router simply fails to route packets. The web-based front end (in the LAN) is still responding normally. Both ADSL lines are still "up", and from the ISP's end, it appears to be working normally. My guess is that there is a memory leak, causing the kernel's routing to hang. A reboot cures it, but this is rather annoying if I'm not at home, especially given that there is a webserver behind it!

The Workaround: even when the router is in the stuck state, the LAN's web interface (and more helpfully, the telnet interface) is still responding. So, I have a monitor script installed on my desktop (Linux) PC that runs from Cron, checking every minute for Internet access; if it fails, the router is rebooted. [Only trigger a reboot at most every 10 minutes: the router takes about 3 to restart and reconnect, and we don't want to be in a never-ending reboot-loop.] So far, this has been reliable for several months, having restarted the router about 20 times in that period. The script I use is here.

P.S. Yes, I've already reflashed the firmware to the latest version, the router is well ventilated (though it still runs warm), and Be have already replaced it twice. There doesn't seem to be an alternative model on the market. I have tried to report the bug to the manufacturer with no avail.

How to get files onto a basic MP3 player, in the right order.

Consider, you have a well defined, nested set of directories of MP3/Ogg files, which you want to transfer to an SD card for playback on an MP3 player. This is a "low-end" player that reads direct from a USB stick, or micro-SD card.

You might expect playback to be according to the playlist (.m3u) files, or in alphabetical order. But no, it's done by inode order! This is useless!

So, how do we get the inodes on a VFAT filesystem to be created in the right order? Here is a way of doing it. Please adjust as needed.

First, change into the relevant source directory.
cd ~/music

Then create a new filesystem on the destination device (choose sdX carefully), so the inode counter restarts. Unmount it first:
umount /dev/sdX1
sudo mkfs.vfat /dev/sdX1 -n MUSIC_SD
Then unplug and replug it.

Remount it sync, so that the inodes increase monotonically
sudo mount -o remount,sync /media/rjn/MUSIC_SD

Copy the files and directories list in order, one at a time, directories first:
find . -type d | sort | xargs -I '{}' mkdir -p '{}' /media/rjn/MUSIC_SD/{}
find . -type f | sort | xargs -I '{}' cp -v '{}' /media/rjn/MUSIC_SD/{}

Hopefully, the device will now playback the files in order! I've observed this problem in many devices in the 2022-era which embed very basic MP3 functionality. For example, toy-car MP3 players, Behringer mixers, and the KLIM CD player with an SD slot.

Note also that many of these devices barf on long filenames: VFAT supports 256 chars, but 64 is safer.

How to level-compress Classical music, for hearing loss.

My great-aunt loves classical music, but has significant hearing impairment. Hearing aids optimise quite well for speech, but do very badly for music, especially Classical, which has a high dynamic-range.

The first thing to do is to compress the levels (this crushes the dynamic-range, making pp ... sffz all sound about mf).
Also, make the music mono, so that headphones are more comfortable, avoiding the "orchestra-playing-inside-the-head" phenomenon, and giving each ear the same signal, so that brain-averaging hopefully improves clarity.

Use Sox's compression (man sox) using their example but changed the last params to -12 (stronger compression), and -10 (less gain).

for infile in $(find . -type f -name '*.mp3'); do
  sox $infile -C 160 $outfile compand 0.3,1 6:-70,-60,-12 -10 -90 0.2 remix -

Now, sync them onto the MP3 player (probably using the above inode trick).

Finally, it's necessary to use the right hardware to play back at a sufficient overall volume without distortion, and to have a multi-band graphical-equaliser to give good frequency compensation for the specific parameters of hearing-loss. You will probably want this to be used instead of the hearing-aids, rather than over the top. I set this up with:
* KLIM CD player with MP3 playback via SD card.
* Behringer 9-band graphic equaliser, model FBQ800.
* Behringer Headphone Amp, model HA400.
* Large high-power comfy headphones: AKG K92.