Tuesday, January 6, 2009

Switching to mpd

I was until recently using xmms2 as a music daemon. I was finding it neat, providing a good command-line (thus scriptable) control over how the music was playing, and I was using xmms2 info to automatically write signature files for my mails. However, I got annoyed by one quite painful thing: on my computer, it can take up to 40% of the processor to play a MP3 file (AMD64 x2 4200+ @2.2GHz)! That is mad. One of the consequences was that the music was jaggy whenever aptitude was upgrading packages... Annoying.

So, I've switched to mpd. It provides a decent command-line client, with possibly a bit less features than xmms2, but it takes only a few percent of the processor's usage... Thanks !

Monday, January 5, 2009

Process substitution is cool !

I've finally found some time to work on ctioga again ! My main problem there is that I keep adding new features without ever bothering to document them... One of my main concerns is therefore to find out about the list of command-line switches that are not documented in the manual page. I've just written a neat shell one-liner that precisely does that:

diff <(man -a -l $HOME/SciYAG/ctioga/doc/ctioga.1 | \
  egrep -o -- '--[a-z0-9-]+' | sort | uniq) \
  <(ctioga --help | egrep -o -- '--[][a-z0-9-]+' | \
  sort | uniq) | colordiff | less -R

(of course, I broke it into lines for clarity). It is based on process substitution, a shell trick that lets you use the output/input of a shell command exactly as a file on command line. Neat ! The trouble is, replacing the colordiff... part by | egrep '^>' | wc tells me there are 65 undocumented features... Lots of work in perspective, and I'm not sure I'll do it all before the 1.9 release...