A blog about skating and cycling, or vice versa

Medium verging on short#

Wed, 18 Jun 2008 22:37:46 +0000

I am having an interesting (in the Chinese proverb sense) time making Debian live-helper do what I want. It's one of those applications where the simple uses are really simple and the marginally more complicated can require all afternoon to figure out why it's not behaving how you want. Yes, actually it is constructed entirely from shell scripts, how did you guess?

The end goal is to get a USBkey-based installation for my old laptop that has everything working correctly for media playback, and I think I'm now most of the way there - though, frankly, everything I've been trying to achieve this evening has been firmly in the hard 10% of the 90-10 rule. A full writeup will follow soon (if for no other reason, because otherwise I'll forget what I did) but in the meantime I wanted to share this marginally-related snippet

 #!/bin/sh 
b=/tmp/$$.`basename $1`
xterm -T minimedia -e ssh  -t -t user@192.168.1.10 echo `base64 -w 0 $1` \| base64 -d \>$b \; mplayer -playlist $b
- a helper app for firefox for m3u files, so that they can be played on the said media box (i.e. through the big speakers) instead of locally (through the crummy speaker on my laptop). And the reason I'm sharing it with you is that I am ridiculously proud of eventually getting something with (1) only uses a single ssh command, (2) copes with multi-item playlists, (3) leaves mplayer with a working tty so that keyboard controls work. Getting the quoting right was the kind of exercise in bloody-mindednesss that in better purer more previous decades would have been the catalyst for a UNIX-HATERS thread.