misc thoughts and notes

Page 2

ssh tunnels are magical

After getting the Pi connected upstairs, I figured it would be nice to be able to connect to it when I’m out and about. Now, I don’t have a static IP, and don’t really want to open ports to the Internet anyway, but I do have a shell account on the Oxford linux.ox.ac.uk machine. SSH tunnels to the rescue!

  1. Add linux.ox.ac.uk to the Pi’s ssh config

    ~/.ssh/config on the Pi

    Host ox
        User <me>
        HostName linux.ox.ac.uk
  2. Tell the Pi to autossh to ox on boot, and forward port 3141 there to port 22 here

    /etc/rc.local on the Pi

    su - pi -c 'autossh -f -N -R 3141:localhost:22 <me>@linux.ox.ac.uk'
  3. Add a ProxyCommand on my machine that tells ssh “if you want to ssh to pi, instead of making the TCP connection yourself instead do this.”

    ~/.ssh/config on my machine

    Host pi
        User pi
        ProxyCommand ssh raven nc -q0 localhost 3141

Et voilà, ssh pi on my local machine now connects...

Continue reading →

installing the wireless dongle on the pi

After what I can only describe as an epic, xkcd-style battle with wireless drivers on my recently-revived Pi, it finally connects to the network. For my benefit when I inevitably muck it all up and have to reinstall, here are the steps I followed.

The dongle is some Ralink thing I had lying around. Naturally, lsusb doesn’t give a useful chipset or anything like that, so actually finding the driver was mostly blind luck and a bit of Google Image.

  1. Get linux headers, because you need them to compile the drivers. Of course, these aren’t packaged for the default Raspbian kernel – there’s some complex diplomatic situation whereby the Raspberry Pi Foundation branched Debian and then gave the result to Raspbian… anyway, the default kernel doesn’t have packaged headers. This should be solvable by “just” downloading and configuring them, but after failing at that with some cryptic compile...

Continue reading →