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]);
}

Future of Java Embedded VMs

I’m writing about this topic based on a request made by Artur Lojewski back in November last year, it has taken me a while to collect my thoughts on this topic as well as find time to sit down and write a posting.  Artur attended Eclipse Summit Europe where Dave Thomas (Big Dave) gave a talk entitled “Next Generation Embedded Software – The Imperative is Agility!” and asked what my opinion was.

Unfortunately I didn’t attend that Eclipse Summit Europe, so I didn’t hear what Dave had to say.  Talking to some folk that I do know who went – their impression was “Vintage Dave“.  I have made reference to this in the past – but I did work for Object Technology International and my university education was heavily influenced by Dave Thomas – myself and my classmates were some of the first to work our way through learning datastructures etc., in Smalltalk.  So a lot of my opinions of what Dave says are going to be coloured by my past experience (and his influence on the start of my career).

Almost any talk given by Dave will get people to sit back and think – he’s also not afraid to stand in front of an audience full of Java programmers and tell them that they’ve picked the wrong language.  In my experience he always has some good points and is worth listening to, but to interpret his talks as a set of black and white statements (or out of context) is dangerous.  There were two other bloggers that gave some in person accounts of his talk – I’d encourage you to read those.  Another reasonable reference is to read about Dave’s thoughts on JavaScript – and if you go back to what got Java started (the browser plug-in) and where Java is today, it is clear that the language didn’t fulfill the original promise.

There are others who are predicting that embedded java is dead, even James Gosling has suggested that J2ME is done.  However, if we take a look at embedded Java today – you’ll see that the Blu-ray format is a new niche for this technology.  As well, even low cost phones such as the Nokia 2760 support the J2ME profile.  This means that as a platform, there are actually billions of devices out there – how is this not success?

I think it depends on what the original goals were, and the future of the platform.  Among the various J2ME enabled devices, there are differences.  This isn’t really a lot better in the browser / javascript space, but Web2.0 holds the spotlight at the moment.  Probably the biggest threat to the J2ME space is the new generation of smart phones:  iPhone, G1 and Palm Pre – none of these have embraced Java as the path forward.

Looking at embedded hardware, we’re starting to see more and more capable hardware in the palm of your hand.  For example – iPhone is a 400MHz ARM cpu compare this to a hot desktop circa 1998 (PentiumII 400MHz), the very definition of what embedded means is changing.  In the near term J2ME will continue to be an expected feature in cell phones, so there is still a market which will continue for several (5?) years.  As the smart phone market sorts itself out we’ll see which new (or old) technology rises to the top.  It is probably safe to say that J2ME will have an impact on the outcome,  but to bet on it as the winner is probably long odds.

Disclaimer: The postings on this site are my own and don’t necessarily represent IBM’s positions, strategies or opinions.