In a word: Moof




Eccentric Dogcows, Astronomy, and Breakfast Foods

Minituæ

23 November 2006

Quote of the week:

“I think we should name the turkey Jubilation T. Corn-pone”

Folk etymology of the week:

The term “Joe” for coffee originated in the navy, after an administrator named Joe banned wine aboard ships. Therefore, coffee was the strongest drink available (how exactly is coffee “strong” in the same way as wine?), and sailors hence referred to it by the name of wine-banning administrator Joe. The AHD4 provides a slightly more convincing etymology:
Short for (old black) joe, military slang for coffee, from the title of a song by Stephen Foster.

On Ruby, with an application to the Medialink problem

22 November 2006

In yet another example of the compulsive buying habits of my roommates and I, we recently obtained an ADS Medialink off off woot.com. This device was designed exactly for students at Case. The Medialink plugs into your TV, connects to the wireless network (using 802.11g no less), and allows you to view movies and listen to mp3’s from any other computer on the network. The video plays remarkably well for being streamed over wireless, and it plays every divx or xvid movie that I’ve tried. This device could not be better designed for the needs of college students. Now there’s no need to haul a laptop out to the common room and hook up cables to the TV just to watch a downloaded movie, and no Ipod required to listen to music in the common room either. And it doesn’t even need an ethernet cable!

The biggest problem with the Medialink (other than the extremely buggy software on the device) is the software that runs on the computers serving media files. Of course the device didn’t come with any software for Linux, so I had to explore the Windows software to devise a solution for Linux. When I first looked at it, I was amazed at how simple the software was. It just started a web server, and the Medialink receiver used a web browser to connect to it. The entire user interface was done in HTML. Even more surprising was that the server software was just a Apache Tomcat with a mess of Java server pages. It’s a simple, and not entirely bad idea. So I figured I could duplicate it pretty easily.

My first attempt to create some solution for Linux was to install tomcat on my laptop, and copy the jsp code over directly from the windows version. This resulted in failure, since I quickly became tired of tomcat crashing on startup without any clear error message. I removed Tomcat, and tried just using straight Apache. This also was not successful, since I could not customize the directory listing pages as easily as I liked. I didn’t want to resort to PHP for this project, and that seemed to be the only solution on apache.

So I looked elsewhere. The best solution I found was the WEBrick server built-in to Ruby. It was amazingly simple make it serve mp3 files, and only slightly more complex to subclass the server and create custom directory listings. The result is under 100 lines of code, and it is faster and more reliable than the software that comes with the device. Here is the code. I still need to figure out how to stream video files to the Medialink box, but that shouldn’t be significantly different than music. Other than that, it’s quite usable.

 

You have confused the true and the real.
—George Stanley

Colin Slater kiltedtaco@gmail.com

This hCard created with the hCard creator.