Robot Has No Heart

Xavier Shay blogs here

A robot that does not have a heart

Upload Forerunner 410 to Strava with Garmin Communicator for Ubuntu Linux

I didn’t figure this out, these instructions were kindly emailed to be by Andreas, the author of Linux Garmin Communicator.

1. Install Linux Garmin Communicator
2. Uncompress Forerunner410.tar.gz to ~/forerunner (this was sent to me by Andreas.)
3. Configure your ~/.config/garminplugin/garminplugin.xml thusly, substituting in your own home folder:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<GarminPlugin logfile="/tmp/garminplugin.log" level="ERROR">
    <Devices>
        <Device>
            <Name>Forerunner 410</Name>
            <StoragePath>/home/xavier/forerunner</StoragePath>
            <StorageCommand></StorageCommand>
            <FitnessDataPath></FitnessDataPath>
            <GpxDataPath></GpxDataPath>
        </Device>
    </Devices>
    <Settings>
        <ForerunnerTools enabled="false" />
    </Settings>
</GarminPlugin>

4. Install python-ant-downloader
5. Set tcx_output_dir = ~/forerunner/Garmin/History in ~/.antd/antd.cfg
6. With your watch on, run ant-downloader. It will download raw data from the device and create a TCX file in the above mentioned output directory.
7. At Strava, Upload Activity.

`ant-downloader` also has a daemon mode that automatically downloads files from your watch, but I’m not using it (I don’t like things running when not necessary).

Ubuntu 12.04 dual boot on Macbook Pro

The official instructions are mostly right, but I still needed a bit of black magic to get everything working. Here are my supplementary instructions:

  1. Install rEFIt. Just works.
  2. Use Disk Utility to shrink main disk partition to make space for Ubuntu (leave “free space” in the rest). Failed because my disk has errors.
  3. Restart into single user mode. The internet tells you to hold down option+s as your computer boots. If you have rEFIt installed, this will take you to the rEFIt shell instead. Instead, let rEFIt boot, select OSX, then press F2. An option to boot to single-user mode will be presented.
  4. fsck -fy, as directed by the prompt. Interesting excerpt from OSX fsck manpage: “this should be used with great caution as this is a free license to continue after essentially unlimited trouble has been encountered.” Don’t worry about it, it’s fine.
  5. Reboot back into OSX, try Disk Utility again. Fails with “The partition cannot be resized. Try reducing the amount of change in the size of the partition.” Protip: don’t do that, it won’t help. Instead follow the instructions at this Superuser answer. It may take a few runs through to fix all the problems.
  6. Reboot with the Ubuntu LiveCD (I used ubuntu-12.04-desktop-i386.iso.torrent). rEFIt will present it as a bootable option to you. Select “Try Ubuntu” (not “install”).
  7. Select “Dash Home” icon (top left), find gparted tool. Create 1Gb swap partition, 24Gb, ext4 partition.
  8. Select the “Non-free firmware” icon that shows up in the icons top right and follow the prompts. Without this, your wireless won’t work.
  9. Select “Install Ubuntu” from desktop. Select custom install, change the ext4 partition to mount /, ensure the swap partition is labeled as such, and choose to install the boot loader to ext4 partition, not the main disk. Follow the rest of the prompts.
  10. After install, don’t reboot, instead keep trying Ubuntu. Shutdown (not reboot), then power on again. I tried to select linux, but it froze on the penguin grey screen and never got to linux. Following instructions from this post Hard power off, power on again and hold down option. Ubuntu shows up as “windows” [wtf], boot that, which loads up the grub prompt. Boot into the GUI then shut down again. Now Ubuntu will boot correctly from rEFIt.

To make it feel more like home, switch alt and command keys using this configuration and in the “Mouse and Trackpad” system settings enable two finger scroll and disable clicking with touchpad (otherwise you’ll accidentally click all the time while typing).

Last time I used Ubuntu was around version 6 days, which you can’t even download anymore. It’s a lot slicker. The icons and fonts are actually quite nice. Colemak is a first class citizen, I could select it during install and use it on my login screen, which is awesome.

Gutsy upgrade

Just upgraded Ubuntu from feisty (7.04) to gusty (7.10). Was a bit touch and go for a moment … got a filesystem check failure on reboot. Miamoto_musashi, my knight in shining armour from #roro, saved the day. ls -l /dev/disk/by-id/ revealed that my HDs had been remapped from /dev/hd to /dev/sd. The gutsy upgrade had modified all of the standard partitions to use UUIDs, but had failed to update a custom mount I had (/data -> /dev/hdc1). Changed that over in /etc/fstab, reboot, hooray we have a winner.

Convert M4A to WAV in Ubuntu

1
mplayer -ao pcm:file=targetfile.wav sourcefile.m4a

No Audio in Ubuntu

Just a quick one – for some reason my sound stopped working in Ubuntu. To fix, right click volume icon (once you’ve re added it to the panel if it’s not usually there), select “Open Volume Control” and ensure that PCM is not muted.

Also, to allow sounds from multiple sources to play simultaneously, go to System → Preferences → Sound and select ESD for your output device and ensure “Enable Software Sound Mixing (ESD)” is selected. Not sure why this wasn’t working as a default for me.

Passwordless Login

I’ve been typing in SSH passwords for ever now. For some reason I just assumed it was a pain to setup passwordless login. Wrong! It took me about 10 minutes. Ubuntu already has all the tools you need.

1
2
3
ssh-keygen -t rsa -f ~/.ssh/id_rsa -C "xavier@home"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub | ssh xavier@remote_host 'cat - >> ~/.ssh/authorized_keys'

Repeats steps 3 and 4 for each remote host.

It just works. And you know how much I like that.

Reference

RAMDISK: Ran out of compressed data

Getting the above error on boot is fairly scary. Thankfully, it’s not hard to fix. It probably means you have filled up your /boot partition. In my case, I had 4 kernels/configs stored on there and it was right on 100%. Simply clean out the old ones – I keep the latest (obviously) and the one before, assuming it works. Then if you’re on ubuntu, issue:

1
dpkg-reconfigure linux-image-`uname -r`

To regenerate your initrd file, because if /boot was full it was probably corrupt.

Do stupid things...

… stupid things happen.

Like running ubuntu dapper as your primary, despite an explicit, stickied recommendation against the practice on the forums. I just wanted to try out compiz…

So as of 10 o’clock this morning I can’t boot properly. It was working at 7:30 – should never have restarted. I can get in to safe mode (no GUI), but the work I need (Ent .NET) is on my virtual PC. So I need to revert to breezy, reconfigure nvidia drivers, reconfigure vmware, and hope to god nothing ridiculous happens. .NET assignment checkpoint due tomorrow. At the worst I’ve only lost 2 hours of work, hopefully will take a lot less time to recreate. Except I’ll have to do it in the lab. I hate working on any computer that isn’t mine. It’s just not right.

EDIT: We’re back in action now. dist-upgrade to the latest kernel version, had to manually grab the matching linux-restricted-modules since apt-get wasn’t finding it, re-install nvidia-glx, vmware-config.pl. YAY COMPUTER WORKS. In the process I also disabled my network shares in fstab, not sure if this had anything to do with it, but when trying to debug I found I couldn’t ls one of them. I never thought I’d hang ls, but it’s been done. I suspect if I’d left my comp for 5 minutes initially it would have eventually come up. You live, you learn. Although after all that I’m still running Dapper. In another stupid move I put my OS on the same partition as my home dir, so I need to find space on the server to back everything up for a reinstall. Including an 8Gb VM. I am such an idiot.

We’ve now added WSE to our .NET project and it’s starting to look rather fancy.

LDAP Authentication

Spent the better part of the evening setting up LDAP authentication for my boxen. The portage issue I mentioned prior was because I hadn’t updated portage for like 8 months … my bad. Slapd installed without a hitch on my gentoo server, and I was even able to set it up with an SSL certificate. The problems came getting pam_ldap setup on my ubuntu client. I’m not really sure what I did, but part of my problem was installing all the packages a few days ago, and then changing my mind on the configuration today but not reinstalling the packages. As such, I learnt a handy new command, to reconfigure without reinstall:

1
2
dpkg-reconfigure libpam-ldap
dpkg-reconfigure libnss-ldap

I’d also warn against using the libnss-ldap sample nsswitch.conf without a contigency plan – I wasn’t able to execute commands (ls, sudo) after using it, and my machine wouldn’t reboot properly, even in recovery mode. Moral of the story – Always have a LiveCD handy!

I’m at the point now where everything seems to work … except passwd. When changing my password I get “passwd: Authentication information cannot be recovered”. Posted something on the forums, hopefully someone helps me out.

A pretty flower Another pretty flower