How to configure svn+ssh client for multiple hosts with different keys

I use svn+ssh to access different repositories that are stored on servers on which I am not able to install svn access through the web server. Up to now I have defined a different svn+FOO protocol in my ~/.subversion/config for each repository. It looks something like this
foosh = $FOO_SSH ssh -q -l sidney -i /home/sidney/svnkeys/foosvn
That lets me checkout that repository using a svn+foosh://hostname.example.com URL.
The disadvantage is that I find using all those different protocols ugly.

I have just found out how to configure my client computer so I can continue to use svn+ssh with all the different hosts and automatically ssh to the correct host with the correct key.

The trick is to define a nickname to represent the host that the repository is on. In this example, let’s say that I will call it foo. Then my svn command for a checkout will begin svn co svn+ssh://foo/ and so on. To make that work I place a section in my ~/.ssh/config file that looks something like

Host=foo
User=myusername
hostname=hostname.example.com
port=22
IdentityFile=~/svnkeys/foosvn

This tells ssh that when I do an ssh login to a host name ‘foo’ actually login in to myusername@hostname.example.com and use the private key file specified by the identityFile option.

This is a much simpler setup than I had before. I have found many examples on the web about how to set up the public key on the server in the ~/.ssh/authorized_keys file with the “command” prefix that makes login with that key only run svnserver tunneling as a specific user. But I have not yet found anyone explaining this trick to avoid having to define a different svn+FOO protocol for each such repository.

My chance at a moment of fame

I discovered a few years ago that I had authored an Internet meme when I came across a post to a mailing list with a sig tag line that quoted me by name! I came across the quote again yesterday and was a little disappointed to discover that it is now attributed, if at all, to “Anonymous”, “author unknown”, or “anonymous support person”. In fact, Google now finds only one search hit that still has the sig line that credits me by name, and that one is in a less common variant of the phrase.

In an attempt to gain credit for my authorship for some sort of posterity, I’m posting this with links to references on the Internet archive site that I hope will be a bit less ephemeral than the other references have proven to be. Otherwise, it would be just my word against thousands of places on the Internet that clearly state that the author was Anonymous or Unknown.

Who knows, maybe the next person to repeat the quote will find this blog post and give me credit 🙂

Here it is in the most common variants. I did actually say it both ways:

“The software isn’t finished until the last user is dead”
— Sidney Markowitz

“The last bug is not fixed until the last user is dead”
— Sidney Markowitz

And now some history and links to show that I really did say it.

When I was working at Gold Hill Computers, which despite the name made software, not computers, we partnered with a company named A.I. Architects, co-founded by Richard Soley, who did make computers, or rather an add-in board containing an Intel 386 CPU and memory chips that could be plugged into a peripheral slot of the then more common Intel 286 based PCs to turn them into monster machines running at tens of MHz with multiple of megabytes of RAM.[1]

It was at that time that I expressed the experience of all programmers that there is always one more bug, and if you have users there is always one more feature request or spec change or something that absolutely has to be done next. Which form the saying took depended on whether I was focused more on trying to get some software finished and out the door, or if I was tempted to think “Just this one last bug to fix and then it’s done.”

Richard Soley, who has much more than fifteen minutes of fame and an anonymous meme to his name, was later interviewed by Wired where he used the bug form of the quote, attributing it to “a friend”.

The software form of the saying proved to be much more popular than the bug form. I certainly found it much easier to roll off the tongue. A Google search for “the last user is dead” finds both forms, but adding my name to the search as of today as I type this only gets one hit that remains, a sig line in a post to a mailing list. Both the Wired article and that post are archived on the Internet Archive Wayback Machine here and here in case either of those links goes 404.

[update] The quote has caught on even more widely than I had thought. Slashdot used yet another slight variation as one of the quotes they select at random on the bottom of their pages. Try a search for the following, here posted with my name instead of Anonymous. Google lists 68,000 hits for the phrase!

“The program isn’t debugged until the last user is dead”
— Sidney Markowitz


[1]Stone, J. 1987. The AAAI-86 conference exhibits: new directions for commercial AI. AI Mag. 8, 1 (Mar. 1987), 49-54.[PDF]

WordPress wp-latex plugin without dvipng

I wanted to install the excellent wp-latex plugin for WordPress, which allows the inclusion of LaTeX equations in posts and comments but my ISP did not have dvipng installed, one of its prerequisites, nor some libraries I would need to build my own copy there. I patched the plugin to instead use dvips and convert, which are both part of the standard LaTeX distribution. If anyone in a similar situation needs the plugin and the author doesn’t accept my patch into the official version, you can contact me for it. The patch is only a few lines. [Update: The author has accepted the patch. Until version 1.0 is released you can get the latest svn version.] Most people who have or can get LaTex on their web server should be able to get dvipng installed (and I expect that my ISP will respond to my request to install it), and dvipng is probably a bit faster, but the patch is an alternative for those who need it.

As an example of what wp-latex can do, here is the equation for the protein translation component of my simulation, part of the formula for protein rate of production, not including terms for death and diffusion.

\sum_{i=1}^{N_{G}} \sum_{l=1}^{N_{P}} \prod_{k=1}^{N} p_{l} g_{i} f^{\prime}_{\mathit{RES}}(R(x))\xi_{ikl}^{(1)}f(l,c_{ik},a_{jk})

Much thanks to John Hedditch who worked out the equations and translated them into a numerical simulation during a couple of intense days of collaboration we had at his office in Brisbane recently.

FLAC to Audio CD burning on Linux and Mac OS X

I went through all the work described in the rest of this post, typed it up, then while putting in links found this blog post that explains the same thing and includes a short script for the whole thing. Oh, well.

Some years ago I backed up our music CD collection to disk, settling on what seemed at the time to be the smallest lossless format, one that would keep for a long while and allow restoring the original CDs. I used cdparanoia to make one flac file per cd, with a cue file of track information embedded as metadata. A program called flacenstein made that easy, and with some tweaking made it easy to produce separate ogg, aac, or mp3 files. Fast-forward to now, our CD collection is in storage with most of our furniture as we prepare to build the rest of our house in the bush, the music collection is all on a 60GB ipod and in the flac files on our server, and I finally have a reason to turn one of those carefully saved flac files back into its original audio CD.

It was surprisingly difficult to find out how to use free software to burn the original audio CD from the flac file that is supposed to contain all of the necessary information to do just that. Google searches turned up many proprietary cd burning programs for Windows, information on ripping to flac, and information on converting flac to individual ogg and mp3 files. I even found people talking about the many threads of people asking about how to restore an audio CD fthat had been archived as flac, but most of the answers I found were to use a closed source Windows program named EAC (Exact Audio Copy). Well, looking at EAC, which is free (as in beer), perhaps I should just have fired up a virtual Windows machine in Parallels and used that, but I was stubborn about getting something that I could use on my MacBook, or at least on a linux machine.

Now that I have found out how, I want to document it here where I will find it easily when in a year or three I have to do this again. This is how I burned a single flac file with cue track metadata to an audio CD, on my MacBook, using free tools that are available on typical Linux systems too.

The tools required are FLAC and Cdrdao. Both are available on fink and macports. I use fink and the version of flac there seemed old, so I downloaded the latest sources and built it myself. The first attempt failed, but searching revealed that the flac build has to be configured with the –disable-asm-optimizations on an Intel Mac OS. I chose build it to install in fink’s directories. I downloaded and unpacked the tar file, changed into the directory and:

./configure --prefix=/sw --disable-asm-optimizations
make
make check
sudo make install

FLAC has an extremely extensive test suite run by make check which seems to run for hours. If you want to be absolutely sure that the build properly implements the lossless compression algorithms with no errors, start it up before you go to bed. I don’t really know how long the test takes as I forgot to say ‘time make check’. Maybe it was about to finish before I got tired of waiting.

Installing flac also installs metaflac, which handles the metainformation stored in the flac files.

Cdrdao had a recent version in fink so I just installed it using ‘fink install cdrdao’.

The next steps are to extract the metainformation into a cue file and the audio information into one big wav file. You have to have enough disk space to hold the uncompressed audio cd wav file, which on a full cd is around 700MB.

metaflac --export-cuesheet-to=foo.cue path_to_flac_file.flac
flac -d -o foo.wav path_to_flac_file.flac

Where I wrote foo.cue and foo.wav you can use any name you want. These files will be discarded when you are done. The path_to_flac_file.flac is the flac file which can be in any directory you want as long as you specify it here.

Next edit the cue file to make it refer to the wav file you have just created. The first line will begin withthe keyword FILE followed by the flac file name in quotes and the keyword FLAC. Change that to refer to the wav file in the current directory, like so it says something like

FILE "foo.wav" WAVE

Now you can optionally use cdrdao to look up the CD information in the cddb (freedb) database on their servers, which should make sure that foo.cue contains complete and accurate information.

cdrdao read-cddb foo.cue

Finally, put the blank CD in the drive and use this command to burn the wav file that is listed in the cue file to the CD:

sudo cdrdao write --device IODVDServices --driver generic-mmc foo.cue

You don’t have to use sudo, but burning as root allows cdrdao to use some real time scheduling trick that makes it less likely to get an underrun.

Older Macs that have a drive that doesn’t handle DVDs might use the device IOCDServices.

Artificial Life X Conference paper accepted

I’ve had a paper accepted by the Tenth Artificial Life Conference for publication in the proceedings and for oral presentation! This is my first published paper in my new academic career. Here is the abstract of the version I submitted, before any revisions I’m about to do [updated as per final submission 12 Jan 06]:

Simulation Model of Prebiotic Evolution of Genetic Coding

Sidney Markowitz , Alexei Drummond, Kay Nieselt, and Peter R Wills

Common to all life on Earth are the mechanisms of genetic encoding, in which specific trinucleotide sequences in DNA and RNA map to specific amino acids in synthesized proteins. This paper investigates a novel gene-replicase-translatase (GRT) system to determine whether emergence of genetic encoding from an initially random population of genes and proteins is feasible. The model incorporates gene replication with mutation, error-prone protein translation, and an arbitrary encoding from codons to amino acids. Simulations on the order of 109 event steps demonstrate self-organization to evolutionary stability with distinct phase transitions. The ranges of parameters that lead to an apparent attractor state are consistent with the notion of error threshold as a determinant of stability in error-prone autocatalytic systems.