Double the Fist

The excellent show Double the Fist is being rerun on ABC on Thursday nights at 11:15pm.

Even though the show won an AFI award last year, it was pretty easy to miss because it was initially shown on ABC 2 (the digital-only channel, which only a fraction of the population can tune into) and then late at night on the main channel.

I’ve been wanting to see the rest of the series ever since catching it part way through when it was shown last.

OpenSSH support in bzr

I updated my bzr openssh plugin to be a proper patch against bzr.dev, and got it merged. So if you have bzr-openssh-sftp.py in your ~/.bazaar/plugins directory, you should remove it when upgrading.

Unfortunately there was a small problem resolving a conflict when merging it, which causes the path to get mangled a little inside _sftp_connect(). Once this is resolved, the mainline bzr should fully follow settings in ~/.ssh/config, because it will be running the same ssh binary as you normally use.

One thing I learnt when adding the support code was a quirk in the SFTP URI spec‘s interpretation of paths, which differs to gnome-vfs’s interpretation. The uri sftp://remotehost/directory is interpreted as /directory on remotehost by gnome-vfs, while the spec says that it should be interpreted as ~/directory.

To refer to /directory on remotehost, the spec says you should use sftp://remotehost/%2Fdirectory. I filed this as bug 322394.

PSP

On my way to UBZ, I bought a PlayStation Portable at the airport duty free store. It was being sold as the value pack and Ridge Racer game together, which came out at roughly the retail price of the two individual items minus 10% GST.

As well as playing games it can be used as a portable audio or video player and photo viewer, using memory stick duos as storage. As the device doesn’t come with any computer software, the manual provides all the details about what formats to use for audio/video and where to put the files on the memory stick. This is quite useful for people using minority operating systems like Linux 🙂.

I wrote a little FDI file for the PSP to expose the portable_audio_player capability via HAL, but there doesn’t seem to be any standard properties to expose the other capabilities.

One of the more annoying aspects of the PSP is text entry. It seems as if they looked at the text entry used by consoles and mobile phones and combined the worst aspects of both:

  • There is a grid of buttons, each of which corresponds to 3 or 4 letters which can be selected by pressing the button multiple times.
  • You use the direction pad to select the button to press.
  • No predictive text input or similar.

For games this isn’t that big a problem, since they don’t generally require much text entry. It is more of a problem for the web browser where it is a lot more important. Something like Dasher might have been a much more useful text entry system, but I guess they decided to go with a more conventional approach.

Using OpenSSH with bzr

One of the transports available in bzr is sftp. This is implemented using the Paramiko SSH and SFTP library. Unfortunately there are a few issues I experienced with the code:

  • Since it is an independent implementation of SSH, none of my OpenSSH settings in ~/.ssh/config were recognised. The particular options I rely on include:
    1. User: when the remote username doesn’t match my local one. One less thing to remember when connecting to a remote machine.
    2. IdentityFile: use different keys to access different machines.
    3. ProxyCommand: access work machines that are behind the firewall.
  • Paramiko does not currently support SSH compression. This is a real pain for larger trees.

The easiest way to fix all these problems would be to use OpenSSH directly, so wrote a small plugin to do so. I decided to follow the model used to do this in gnome-vfs and Bazaar 1.x: communicate with an ssh subprocess via pipes and implement the SFTP protocol internally.

Since SFTP is layered fairly cleanly on top of SSH, and the paramiko code was also quite modular, it was possible to use the paramiko SFTP implementation with openssh. The result is a small plugin that monkey-patches the existing SFTP transport:

http://people.ubuntu.com/~jamesh/bzr-openssh-plugin/

Just copy openssh-sftp.py into the ~/.bazaar/plugins directory, and use bzr as normal. The compression seems to make a noticable difference to performance, but it should be possible to improve things further with a pipelined SFTP client implementation.

Of course, the biggest performance optimisation will probably come from the smart server, when that is implemented.