Altoids Lamp V2 attempt 1

My first attempt at the Altoids Puck light. The switch is inside the can and you just twist the two halves to toggle power.

I'm not completely satisfied with this one. It's a bit sloppy and I need to find a better way to make the holes. The metal bends too easy, maybe a thin coat of a metal epoxy would help before drilling. It uses 3 AAAs for power, and with a 68 ohm resistor drops the voltage to 3.3 at the LEDs.

I'm ordering 100 LEDs (21,000 mcd) from Hong Kong. I don't have an immediate need for 100 of them, so I might sell half off on eBay to offset the cost.

Shuffle a Playlist onto CD-Rs

I gave you a taste of the shuffle function a few posts ago, here's the finished script. Well, finished enough to work. There could be more error checking and it could write the songs to a list so you know what's on the CD, but for my purposes it works great.

To start with I choose some music that I want to shuffle, or if I'm feeling adventurous I'll just use my full playlist. To make a quick playlist from your mp3 collection try something like the following command.

# find /mnt/mp3/P.O.D. -name '*mp3' -size +1024k > pod.m3u

This should find all the mp3s in the P.O.D. directory greater than 1MB. I usually set a minimum file size to prevent things like greetings, hidden empty tracks that often get ripped, and very short songs.

I'm not going to try quoting the script here because it's rather long and I'm finding some problems with the way characters are being displayed on some browser. It's commented quite well and should be easy to read. If you have any questions, email me or post comments here. My email address is anton at lr2 dot com.

coming soon

I'm working on a script randomly grab mp3s from a playlist and fill a CD with shuffled songs.

I'll be using bash's built-in random number generator which I believe is available in all versions.

Here's the shuffle function for those interested:

# Usage: shuffle <filename>
function shuffle () {

   cat "${@}"|grep -v "^#" | \
   while read mp3 ; do
      echo "$RANDOM $mp3"
   done | sort | cut -d" " -f2-

Requirements will be mpg321 and cdrecord.

new pages

I've added some new pages to the right. Namely an update podcast script page and some better links to the past articles. I'll follow this same format for future scripts when they are developed.

Nothing new tonight, except a pointer to a WordPress plugin contest. I'll be working on a couple ideas for the community plugin, both of which will be available at after the contest. is tossing in a $500 prize:

WebLogToolsCollection has a wiki up for the competition now.