Linux, SwissCenter, and the PopcornHour A-100

So I’ve been using the awesome SwissCenter media streaming server with my PopcornHour A-100 for a while now. Over the weekend, Windows XP decided it didn’t want to run on my file server any longer (yeah, I know… 🙂 ). In it’s place I installed Ubuntu 8.04 “Hardy Heron”. After migrating my SwissCenter settings over to the new Linux install, everything worked, except SwissCenter no longer showed up on the Sources page on the A-100.

After a few hours of searching and a post to the SwissCenter forums, I got a reply from the SwissCenter team pointing me at the broadcast.pl script that comes with SwissCenter. Out of the box, things were promising, as I could see the A-100 talking to the broadcast script, but still no link on the sources screen. After another few hours of testing (and a good nights’ sleep), I found the problem.

You can read more about the script and my fix, and download my broadcast script package over at the SwissCenter UPnP/SSDP Broadcast Script for PopcornHour A-100 page. If you have any questions, please leave a comment either on this post, or on the download page.

Fun With Shell Scripts: autons

Being a freelance web developer, there are many times where I’m moving domains for clients (or more recently, myself), and need to know when the DNS entries change to point at the new version of a site. I could just keep submitting an nslookup request manually, but that requires me to stop whatever it is I’m doing, switch to my terminal app, and execute the command. After doing a few sites this way, I decided that there had to be a better way…and there is. I came up with the following bash script to automate this process.


#! /bin/bash
count=1
while [ 1 ]
do
echo Attempt $count
nslookup $1
sleep $2
count=`expr $count + 1`
done

Yes, it’s just that simple. As you can see, the script takes 2 parameters, the domain name to check, and a time (in seconds) to pause between each check. I don’t know if there’s a rule about the amount of time between requests for nslookup, but I usually don’t use anything lower than 5 minutes (300 seconds).

To use, just paste the code above into a file, save it (I named mine “autons”), and give it execute permissions (“chmod +x autons”). To test a site, use something like the following: “autons yahoo.com 300”. This would check the DNS address for yahoo.com every 5 minutes.