When DNS Fails

Tonight I needed to do a bit of work as we’re coming up to a deadline and as usual things are running a bit behind. Normally I just VPN into work and use remote desktop to drive my desktop. Unfortunately when I went to do this tonight I wasn’t able to connect to my workstation via remote desktop.

A quick NSLookup query turned up the problem – it seems the DNS server at work had been reset and the DHCP lease for my workstation had not expired yet.  This means that the DNS server had no idea what IP my machine is using, but my workstation is under the assumption it has the rights to that IP address still.

Jim happened to be one of the few online, so I chatted with him a bit to see if he had any ideas how to resolve the problem.  He mentioned that this had happened to him a couple of times and his solution ended up being to drive back into work, I figured that would be my backup plan.

Jim then suggested using arp on a machine I had recently ssh‘d into from my workstation.  While I hadn’t actually used ssh to connect to any of our lab machines, it  got me thinking about our CVS server – as I was running Eclipse on my workstation and did have in theory an active connection.  From my laptop I was able to ssh into the CVS server, then using netstat I got a full list of the active connections.  Looking through the list turned up a few which were numeric (clearly where DNS had failed to provide a reverse name mapping).  From there it was a simple matter to remote desktop to the “right” numeric address to reach my workstation – I got lucky on my 1st try.

Deleting Channels From MythTV

MythTV is a DIY digital video recorder.  Building a box to do this isn’t much beyond putting together a PC and installing Linux, but its not something I’d expect a non-geek to dive into.  Geek or not – everyone should have some form of digital video recorder, it completely changes how you watch TV.

Of course, since my MythBox is using a capture card to grab video from my sattellite receiver it has no idea what channel has which show.  When I started with MythTV, there was a free service offered by Zap2It.com that offered up listing information in an easy to consume format.  The listings provide MythTV with guide information so it knows what is on, and when.  Today there is SchedulesDirect which is well run and inexpensive at $20 USD a year.

Over time, channels change and this is reflected by changes in the listing data.  MythTV detects these changes, and will add new channels automatically – it won’t remove channels that we listing information is no longer being delivered for.  I’m on an older version (0.20) but suspect there is a design decision here.

Using the UI to remove channels is pretty clunky.  The MythTV site has instructions on accomplishing this via the command line, and while I’m comfortable with the command line – it is a multi-step process which I dreaded doing.  So over a few months, more and more bogus channels that I didn’t actually have would get added.  For example – a new pay per view (PPV) channel would appear, new guide data would become available and I’d start seeing it as an available channel… grr

Of course, you still need to connect to SchedulesDirect and remove the unwanted channels from your subscription otherwise MythTV will just keep adding the ‘new’ channels back.  Tonight I wrote up a quick Perl script to automate the multi-step process – this makes removing unwanted channels quick and easy.

Usage: remove_channel.pl <channel number>


#!/usr/bin/perl

use Mysql;

# MYSQL CONFIG VARIABLES
$host = "localhost";
$database = "mythconverg";
$user = "root";
$pw = "";

# PERL MYSQL CONNECT()
$connect = Mysql->connect($host, $database, $user, $pw);

# SELECT DB
$connect->selectdb($database);

# DEFINE some MySQL queries
$findchan = "SELECT chanid FROM channel where channum = ".$ARGV[0];
$delchannel = "DELETE FROM channel where chanid = ";
$delprogram = "DELETE FROM program where chanid = ";

# EXECUTE THE QUERY
$execute = $connect->query($findchan);

while (@results = $execute->fetchrow()) {
print "chanid ".$results[0]."\n";
$connect->query($delchannel.$results[0]);
$connect->query($delprogram.$results[0]);
}

Nintendo DS Lite (NDS)

Gaming is what got me into computers, I was facinated by the idea that it was possible to create your own games.  I started out with the Commodore-64 which let me play lots of games, but also gave me a chance to learn a lot of programming.  My next computer was a PC (386sx) and by this time I was more focused on programming than gaming.  Later on after university I picked up a Nintendo 64, which in its day was a ground breaking console.  This was also around the time that id Software was reinventing the PC gaming market with Doom and later Quake – this resulted in many late nights sessions at work where we’d setup a network game after hours.

Having met some seriously fanatical gamers, I can’t call myself one.  I like to play from time to time, but the constant hardware upgrades and time investment keep me from being very serious.  In late 2004 I picked up a GameBoy Advance SP – it was a great way to kill time in an airport.  Ken had purchased a few MovieAdvance carts, which let me play some homebrew and movies (poor quality, but this is a 16MHz ARM chip!).  For my birthday in 2006 Jenn got me Nintendo DS Lite, and it is so much more than just a simple game machine..

When I got a copy of Super Mario 64 for the NDS, it completely blew my socks off.  Here is a game that in 1996 was one of the coolest looking (and fun) games I’d ever played – and now 10 years later its running on a handheld.  Of course there is also the well known side scrolling New Super Mario Bros and of course The Legend of Zelda: Phantom Hourglass which are must have games on the NDS.  Moving a bit away from games, the BrainAge series are very addictive – and the web browser gets regular use by me.

In my opinion a must have is one of the many flash cartridges for the NDS.  I bought an R4DS from consolesource.com back in early 2007.  The flash cart world is a bit odd, there is a very strong homebrew scene – but an even stronger pirate community.  The flash carts themselves live in a gray area, and are illegal to sell in some countries.  Some of companies making these products tend to seem a little shady as well, often creating cheap knock-offs so there is an element of buyer beware.

The R4DS takes a microSD card, which is almost hilariously small.  Let’s take a quick look at some of the software I have loaded on mine today.

There is plenty of other stuff as well, but those are a few highlights – every one is worth the time to download and install.

I also use the NDS as a reading light – so while I don’t play games every day, I do use it almost every night.  The new DSi looks very tempting, but I suspect I’ll wait until the price comes down a bit – and we start to see more software which is unique to the DSi.  I can’t wait to see what the homebrew community cooks up for it.