tpot (at) frungy . org
|
Tue, 27 Sep 2005More Unix Secrets of Billionaires mbp mentions a neat notification trick for reducing turnaround time when running jobs that take more than a couple of tens of seconds. Here's my modified version. It plays a different sound based on the success or failure of the command, and also preserves the exit code. #!/bin/sh "$@" rc=$? if [ $rc = 0 ]; then snd=/usr/share/games/neverdata/snd/success.ogg else snd=/usr/share/games/neverdata/snd/over.ogg fi ogg123 -q $snd exit $rc I used to have a script that played the sound of some glass breaking when the job failed, but the noise was too jarring and would often make me jump when it happened unexpectedly. The sounds from neverball are a bit less frightening. (From the neverball FAQ: "My computer does not meet the stated minimum system requirements, and yet I insist on trying to play it anyway and blaming you, rlk, for writing a crappy game. WTF?"). posted at: 10:55 | path: /software | permanent link to this entryI watched a friend use the TMPGEnc MPEG Editor to remove commercials from a MPEG file recorded on his Topfield the other day and was duly impressed. I was curious whether this can be done under Linux or not, as I tried and failed to get the TMPGEnc editor running under Wine. As usual, there are many half-assed programs on sourceforge that don't work very well or haven't been updated in ages, but GOPchop sounded like it would do the trick. It's not available in Debian, and the prebuilt deb on the site had various dependency problems, but it wasn't too hard to build by hand. I removed some leading and trailing junk from some TV I recorded last night in a couple of minutes. The only slow bit was waiting for the MPEG file to be loaded and scanned, and then writing out the MPEG file containing the cuts. I guess this isn't really "editing" in the professional sense of the word, but removing commercials and trimming MPEG2 files is really all I need to do at the moment. Next step of my PVR is to have a slightly better interface than running dvbstream in an xterm and hitting Ctrl-C when the program has finished. posted at: 10:19 | path: /pvr | permanent link to this entryFri, 23 Sep 2005Once upon a time I had a funky script that would run the find(1) command on all the C and C++ files in the current directory. It was called findch. Now you might think that this was a bit pointless, but it is actually a big timesaver, especially since searching all C files for a particular pattern is usually part of a larger task so a couple of seconds saved reduces the probability of your flow being interrupted. Here's the latest version of my findch script: #!/bin/sh [ -n "$1" ] && base="$1" && shift || base="." find $base -name '*.[ch]' -or -name '*.cpp' -or -name '*.hpp' "$@" Now that newer version control programs (for example Subversion and bzr) store file contents in their metadata directories, a naive find . -type f | xargs grep foo command will generate a large number of false matches against the metadata files. Here's a similar script that runs find but ignores all the VC metadata: #!/bin/sh [ -n "$1" ] && base="$1" && shift || base="." find $base \( -name .svn -o -name CVS -name .bzr \) -prune -o -print "$@" I can never remember the syntax for the -prune option. posted at: 12:00 | path: /computers/programming | permanent link to this entrySun, 18 Sep 2005I've finally figured out why I haven't been able to get both tuners streaming mpeg2 simultaneously. Predictably enough, it wasn't a bug in the FusionHDTV drivers, but rather in my script to tune and transmit a DVB transport stream using tzap and dvbstream. Running two copies of the tuner script use about 22% of my 800MHz CPU which leaves plenty of cycles available for running a media server and other things. I can think of a couple of good ideas for implementing a live tv type of arrangement on the Z400 using some tricks in the media server. I still need to fix up the existing Python media server code and upload it somewhere, then to get video files playing. posted at: 21:10 | path: /pvr | permanent link to this entryThu, 08 Sep 2005On the Subject of Jive-Ass Slippers From everything2: "The Shoes of the Fisherman's Wife Are Some Jive Ass Slippers" is an amazing composition by Charles Mingus for his big band. The orchestration was done by Sy Johnson. Mingus has a penchant for creative titles; some other great titles are "Slop", "Pithecanthropus Erectus", "Gunslinging Bird", "E's Flat, Ah's Flat Too", and "New Now Know How". Of course the main point is that "Shoes of the Fisherman's Wife" is a brilliant composition, as Mingus was a brilliant composer. My favourite recording of the abovementioned song is by two blues/folk guitarists, Stefan Grossman and John Renbourne, from their album Stefan Grossman & John Renbourn Live In Concert. Now I could have called my blog "Prepare me a ship of which the half-rotten timbers shall be painted black, let the sails be in rags, and the sailors infirm and sickly", but that's just silly. posted at: 10:56 | path: /blogs | permanent link to this entryI found another tutorial on Twisted Python. It is slides from an OSCON 2003 talk by Itamar Shtull-Trauring, one of the Twisted authors. posted at: 10:51 | path: /software | permanent link to this entryTue, 06 Sep 2005Woot! After yet another hiatus I have been doing some more poking around on the Python UPnP Media Server. Mainly this was because of some particularly bad analog reception the other day resulting in unwatchable stuff on the tivo. I do actually have two DVB-T PCI cards sitting in my desktop machine but without a Linux media server there is no way to watch any of the recorded data without the family huddling around a computer screen or laptop. Anyway, in my previous coding session I was able to construct replies sufficient to browse a directory heirachy on the Z400 but it wouldn't actually play any media. It turns out that the Z400 refuses to play any media files that are present at the very top level of the directory heirachy. I made a dummy folder and then stuck a DIDL object.item.audioItem.musicTrack in it, and it works! I am now listening to a really old mp3 podcast of an interview with Severed Heads that was played on Radio National months ago through my own media server. In the bad news department, the hard drive on my laptop was making some odd noises this morning when restoring a suspended VMware image. There were a whole bunch of the dreaded UncorrectableError messages in the log file. The hard disk is probably going to crash sometime soon. I'd better check in my changes before it does. posted at: 18:49 | path: /pvr | permanent link to this entrySun, 04 Sep 2005Here's a map of my favourite run around Black Mountain in Canberra using the very cool Google Pedometer. I had a feeling it was about 15km. Google says it's 15.3km so I was pretty close. Unfortunately satellite maps don't give much of an indication of height as the bike path around the north side of the mountain is about a 3km climb. posted at: 09:40 | path: /triathlon | permanent link to this entry | ||||||||||||||||