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.

Burned by Chrome

Last night I was adding a new wifi device to my home network.  One of the security features I make use of is MAC address filtering (and yes, I know a motivated attacker can spoof a MAC address easily enough, but there are many easier targets in my neighbourhood).  My primary router is a Linksys WRT54GL running DD-WRT.  If you have one of the Linksys WRT54G* routers, my experience is the stock firmware is terrible – you should either run DD-WRT or Tomato and if you insist on staying stock, at least get the latest version from Linksys.

I’ve been playing with Google Chrome a little bit.  The various “run it under Linux” solutions simply don’t work well enough to bother with.  So until Google gets a Linux version going – I’ve been playing with it under Windows.  There are some things I like about Chrome: the ability to tear off a tab and get a new window; the omnibar; and their process per tab is pretty nifty.  On the downside is plug-in stability (Adobe Reader really sucked in the 1st release, better in the update), general stability (I’ve crashed it a few times) and compatibility (some websites don’t recognize it).  I’m not ready to make it my primary browser, but I do use it regularly.

In order to edit the MAC filter list, I need to navigate some of the DD-WRT administration pages to make some changes.  I was surprised to get an error message from Chrome when trying to save my changes, it turns out I was hitting a bug that was only very recently fixed.  So, no worries – I just switched to Firefox and redid the change.  However, to my dismay – it seems that the partial commit from Chrome caused my router to completely clear my nvram (in all honesty I can’t prove this, but the sequence of events makes sense).

DD-WRT has been very stable for me for quite some time.  I was running v23 SP2 and had looked at the newer v24 version since it had some neat bandwidth monitoring features, but had decided to stall as migrating my configuration would be a bunch of work (and risk if I got it wrong).  Lucky for me I had gotten a dump of the nvram by logging into the router via telnet and issuing a “nvram show” command, having this dump gave me a reference to help move my config over.

Faced with the complete loss of my configuration, I figured it was as good a time as any to upgrade to the latest version (v24 SP1).  The upgrade went smoothly, and the new firmware looks really slick.  In a way I’m sort of glad that I finally got around to doing it.