January 2009 Archives

I have a workstation at my office, drewble, that has a non-routable IP address. Our network is setup such that, even from the VPN, I can't access that machine directly — I have to go through one of our dev servers to get to it. Obviously, having to hop from one machine to another is a bit cumbersome, but as with many thing, this can be alleviated with some simple Unix magic. A simple alias in my .bashrc makes the bouncing simple:

alias drewble="ssh -f -N dev1 -L 9999:drewble.genius.local:22; ssh -D7070 -p 9999 drew@localhost"

The first SSH command in this alias goes to the dev server, dev1, setting up a forward of the local port 9999 to the SSH port, 22, on my workstation, drewble, found via its zeroconf hostname. The -f options causes SSH to background after logging in and -N means that SSH won't run any commands after loggging in; I only care about forwarding ports. The second command utilizes the tunnel setup on port 9999 to get me to the workstation, setting up a dynamic tunnel on port 7070 which can be used as a SOCKS proxy by things like my web browser.

Mac::iTunes::Library

| 2 Comments | 1 TrackBack

Though I use Last.fm it's not a perfect representation of my listening habits. Between the occasional server downtime, not uncommon in the Audioscrobbler days, I wanted to be able to get some accurate statistics about my music library. It's easy to create smart playlists to find the number of songs you have of each genre or by each artist in your library, but much more interesting is to see what you actually listen to the most. There are a number of artist whom I only have a limited collection of, but enjoy quite a lot. DJ Miko being a great example - 10th by number of tracks, but a strong 3rd by playcount. I just can't get enough of those Eurodance beats. Conversely, Scooter is a prolific producer, but a long way from my favorite artist.

Genre-wise, I've got a lot of trance, but apparently end up listening to Ska more. Is that really true? Well, it is by playcount, but I should probably to a listing based upon playcount times song length; Trance tracks tend to be lengthy, especially if you count the numerous DJ mixes I have. By this same token, I'd venture a guess that the average song length of my library, 5 minutes 13 seconds is on the longer end of the spectrum. Finally, the ratio of songs to artists is a quite reflection of whether a library is represented by an encyclopedic collection for each artist (high ratio) or a schizophrenic mix of singles (lower ratio). I have no idea what an absolute scale for this number is, but I'd love to hear results from others.

Also, my library has grown quite a bit:

Number of tracks: 10737
Total size: 85605.68 MB         Average size: 7.97 MB
Total time: 38d 23h 3m 0s       Average time: 5m13s
Ratio of songs/artists: 4.576726342711

Most popular artists, by number of tracks:
        137     ATB
        118     Scooter
        116     blink-182
        115     Armin van Buuren
        111     Paul van Dyk

Most popular artists, by playcount:
        1585    blink-182
        1279    Goldfinger
        873     DJ Miko & Mini Me
        837     Less Than Jake
        753     Big D and the Kids Table

Most popular genres, by number of tracks:
        1627    Trance
        1219    Dance
        1073    Ska
        628     Rock
        583     Vocal Trance

Most popular genres, by playcount:
        8448    Ska
        6334    Dance
        5328    Trance
        2846    Punk
        2723    Rock

It's certainly been a while since I started this project and the module that I spun off of it has been around for a good while. I've compiled the script into a PAR that should run without needing Perl or any modules on any 64 bit Mac OS X machine. From a terminal:

wget http://dinomite.net/2009/01/itunesstats
chmod +x itunesstats
./itunesstats ~/Music/iTunes/iTunes\ Music\ Library.xml 5

If that doesn't work for you, you can simply install Mac::iTunes::Library with CPAN; CPAN might require configuration but, except for mirror selection, the defaults will work:

$ sudo -H cpan -i Mac::iTunes::Library

With the module installed, you can download and run the example script.

Details on the code: The module allows you to parse the iTunes XML library which is generated by iTunes every time the library changes. iTunes itself uses a binary file to manage your music and the XML is only generated as a courtesy. Thus, my module can represent a library and the items within it in full, but I only have a parser for the XML and provide no way of emitting a new XML library. brian d foy has a module that is able to parse the binary iTunes - as long as it's version 4.5. For the uninformed, we're on iTunes 8 these days. Updating that module might be my next project.

For the first time a few months ago I traveled by plane and brought lock picks in my carry on luggage. After having read this article about sneaking lock picks in the extension tubes of rolling luggage, I wondered what would really be required to just sneak picks through. Though flying with lock picks isn't illegal the TSA agents are not known for their accurate knowledge of the rules concerning air travel. I really wanted to have picks at my destination so that I could do a seminar on picking; I didn't want them to be taken away by an overzealous agent.

Lock picks don't have that much mass so I figured if I removed all of normal metal, including my belt, that I'd get through the metal detector OK with the picks in my pocket. I tried this tactic on the trip to my destination and was successful. After removing my belt, I just put my four picks & three torque wrenches in my shirt pocket and waltzed through the metal detector to no notice of the TSA agent. That was easy.

The return trip was equally uneventful, though I used a different method - I simply put my picks into the bag that I put through the X-ray. Again, this was of no interest to the TSA; either they didn't notice or they know what picks are and that it's OK to carry them. I'll assume the former.

Long story short: you can easily sneak a few picks through in your pocket if you have no other metal on your person. Odds are you can get some through the X-ray machine without any hassle, as well.

Pages

About this Archive

This page is an archive of entries from January 2009 listed from newest to oldest.

December 2008 is the previous archive.

February 2009 is the next archive.

Find recent content on the main index or look in the archives to find all content.