After discovering the awesomeness that is last.fm I became annoyed at it indexing the misrepresentative contents of my local iTunes library. This gave the false impression that I spend most of my time listening to Kanye West’s Gold Digger (catchy though it is).
I play most of my music using iTunes Shared Libraries and an mt-daapd server running on a Debian NSLU2. If there’s a way to make last.fm scrobble music iTunes accesses from a DAAP server, I couldn’t find it. Then there’s all the music I listen to with players that lack audioscrobbler plugins. Why wait for last.fm to work out what my tastes are? I needed a way to let audioscrobbler catch up with me: manual scrobbling.
Fortunately audioscrobbler provides documentation of the Audioscrobbler Realtime Submission Protocol. From this, I hacked together a ruby script to scrobble my music directories: scroball.rb. It does do a little bit of subterfuge: it backdates and calculates the start times to avoid collisions that audioscrobbler would pick up in sanity checking. This can legitimately be used to retroactively scrobble a listening session.
ruby ~/scroball.rb p00ya `/bin/date -d 'last wednesday' +%s` .
yay! Hopefully the last.fm folks like it; it’s not intended for abuse.
For those of us with dynamic IP addresses at home (assigned via IPCP/PPP/ADSL) it’s nice to have a stable host name for remote access. My previous solution was to use dyndns, which uses an HTTP-based protocol to update a subdomain of one of dyndns’s domains. However, I preferred to use my own domain.
As I try to use cool crypto wherever possible, the public-key based SIG(0) from RFC2931 seemed like a nifty protocol to use. The usual tool for generating keys is
dnssec-keygen, and for performing updates it’s
nsupdate, both part of ISC’s BIND. I set this up and tested it from my MacBook Pro, where it worked fine.
However, since a WRT54GL router running OpenWRT controls my PPP connection, and thus knows when my IP address changes, the logical place to be running
nsupdate was on this router. Unfortunately OpenWRT’s nsupdate (packaged as
bind-client) is relatively large at 439186 octects; add to this libopenssl and bind-libs, and I’d run out of room on my JFFS2 partition. If you have the room, it’ll work for TSIGs: Ignace Mouzannar describes how to do it. However, even when I got it installed, I couldn’t make it sign a SIG(0) request. Chip Rosenthal has also noticed problems, and came up with an HTTP-based solution to get another host to run nsupdate, called web-nsupdate.
My solution? Write my own client in C, that can read the “dnssec-keygen“ key files. Presenting dudders: my lightweight DNS UPDATE client. It even comes as an OpenWRT ipkg. It still needs a crypto library, but it can use libgcrypt which (even after dependencies) still weighs in lighter than libopenssl.
PKCS#1 and OpenPGP switch the order of the private exponents. This makes for confusing times when you’re expecting the equivalence of libraries based on these standards (OpenSSL and libgcrypt respectively). So much so, I thought it was a gcrypt bug.