Archive for November, 2006

Going beyond "starter systems"

The MythTV project I discussed in the last entry caused me to think about a couple of systems I have in use at the moment.  These systems are both based on customised “single-use” Linux distros — one is the Trixbox system that runs the home phone system, the other is the new PVR system based on KnoppMyth.  KnoppMyth and Trixbox are examples of what I’m calling “starter systems”; custom-built distros that are designed with a single use in mind, that a newcomer to the field can get working with a minimum of knowledge and effort.  I’ve been really happy with this kind of build for getting a system running quickly (in the KnoppMyth case, it restored my faith in MythTV after having been burned in the past), and with a lot of function, but as someone who is quite beyond being a newbie I’m wondering if that quick startup gives way to trouble…

When I moved the phone system to Trixbox, it was because the previous system was stuck on an older Linux distro (a SUSE 9 that just refused to upgrade) and the Asterisk build was from-source.  I was keen to set a system that Just Worked, as close to out-of-the-box as possible, was upgradeable, and didn’t require that I do a lot of manual work to maintain.  Trixbox certainly gave that in the first instance, and came with a lot of extra function (web-based configuration, head-up display systems, a CRM facility that I was going to use for…  I dunno, but it’s really cool)…  However, I had to do a lot of mucking with it to get ISDN working, and I’ve had to give up the LDAP caller-ID integration I had set up.  Voicemail access is confusing and different to the original system (it’s probably fortunate we don’t get many messages), and because I foolishly decided that I would run VMware Server on the same box, I’ve blown the “single-use” idea.

KnoppMyth looks like it might head the same way.  It has a lot of extra function built in, like the pre-configured MythTv plugins, that normally would be a lot of extra work to integrate.  However, I really want to get this new tuner card working, which looks like I’ll have to build not only MythTV itself but probably the kernel and the DVB support utils from source.  That blows the “stock-built” maintainability of KnoppMyth.  Also, since KnoppMyth uses the Debian repositories, APT reports that there’s nearly 400 packages that are available for updating — but I can’t find anything in KnoppMyth doco that says whether it’s safe to do an “apt-get upgrade” on it. :)

I’m wondering if I might be better off sticking to my distro-of-choice (still Gentoo currently, although running servers on Gentoo can be a bit of a pain and I might be looking to change) and just do the grunt work myself…  I’m arguably competent enough to handle building things myself, so maybe I don’t need the handholding that these built-to-purpose distros provide.

(Thinking outside the box a bit, I wonder if the VMware folk might have to start being a bit careful about how they “market” VMware Appliances, for the same reason.  Folks might download a heap of appliances for different purposes, then some time down the track realise that what VMware has let them do is make dozens of different systems that might not even all be the same OS (there are FreeBSD and OpenSolaris appliances on VMTN as well as Linux) that all need to be maintained in different ways.)

Something to ponder while I wait for my next “emerge -av world” to run…  :)

MythTV

Spurred on by the successes of a couple of guys at work, I’ve been going through the process of setting up a Linux-based PVR.

I’ve had a tuner card for some time, but my first attempts at getting it to work with MythTV under Gentoo a couple of years ago were less than successful.  The final prompter to do something was discovering KnoppMyth, a purpose-built Linux distro based originally on the Knoppix “live-CD” distro.  KnoppMyth has a customised installer that sets up a Linux system with MythTV and a host of other plugins and extensions that take you from zero-to-PVR with a minimum of fuss.

I downloaded the CD of the latest KnoppMyth, threw the tuner card into a PC reclaimed from a defunct project of mine, and sure enough it worked beautifully.

There were a couple of things that didn’t work out-of-the-box though.  I didn’t understand how the setup process configured the “grabber” — MythTV’s name for the process that obtains program listings.  The MythTV setup program runs in its Qt interface, but the configuration of the grabber (at least, the one for Australia) runs in the text-mode window that the Qt program is launched from.  This little misunderstanding cost me some time in getting it set up properly.  Then, for some reason the channels scanned on the tuner card did not match up with the listings obtained by the grabber, so I had to go through each channel entry and manually add the XMLTV URI for the program guide data.  But now that’s done, woo-hoo!  It works a treat.  Even the IR remote control was detected and set up by KnoppMyth.

Buoyed by my success, I went and found a second tuner card for the box (you can’t have a MythTV backend box with just one tuner, you just can’t).  Here, I committed the cardinal sin of Linux — I bought a brand-new piece of kit and expected it to work.  My sole reasonig was “well it’s the same brand as the one I’ve already got, so it must work”.  Idiot. :)

So the KnoppMyth box is the backend (and a frontend), and I’ve found the XBMCMythTV scripts to use XBMC (on the XBox) as a frontend as well.  MythTV’s functionality in this regard is fantastic — although it is frustrating that every MythTV backend and frontend must be running exactly the same version in order to work together.  KnoppMyth is currently based on MythTV 0.19, and Ubuntu Edgy (which I’m running on the laptops) is at 0.20a…  Probably not too much of a drama, as the laptops are only on 802.11b wireless so running a frontend on them probably wouldn’t work well anyway.

Apart from getting a frontend on the laptops, and the tuner card that doesn’t yet work, the other remaining concern is that it’s just one more box running in the house.  This can be solved however, with a couple of tricks based on Wake-On-LAN.  The MythTV frontend can already be configured to send the “magic packet” to the backend to wake it up if powered off, and there’s a couple of ways to have a backend system wake up to make a scheduled recording (one involves poking the PC’s BIOS to set the timed power-on function, the other is an ingenious method involving a second PC — ideally a low power device like a Linksys NSLU2 or WRT54 — sending the WOL magic packet at the scheduled time).

Tags:

Nicholas’ visit from Santa

Santa came to Nicholas’ day-care centre today.  All the Junior Kindy kids were very excited about Santa being there — until it was their turn to sit with him!  Nicholas’ reaction was (I have to say, even though it’s terrible to do so) hilarious…  He was joyously watching the other kids getting their presents, but when his name was called it was a different story entirely!  Not a happy boy.  He loves his present from Santa though: Santa gave each child a book, and Nicholas reads his often (seems like a dozen times already).

Safety?

I’m sure you’ve heard people say that they were never concerned about “whatever” until it touched their life in some way.  Our family had a first-hand reminder of that last night — my mum was mugged last night on her way home from work.  I’m sure she would have liked a less violent way to get her 15 minutes of fame (courtesy Channel Nine’s evening news in Brisbane, in this case).

She got rolled by a couple of kids on her way from the railway station to home (she could probably have seen her front door from the spot).  While they didn’t actually attack her so much (rather they grabbed her bag, knocking her for six in the process), she did come out of it a bit banged up and certainly shaken by the experience.

Those unfamiliar with the surroundings would jump to the conclusion that she should have stuck to the better-lit pathways rather than the short-cut she’s taken in safety for the last 10 years or more.  Halali-like, they’d say “she was asking for trouble”.  Not likely.  Like any kind of attack, who knows how many times in the past the perpetrators were ready to strike and were warned or scared off by something at the last minute.  More likely, this was something random, a wrong-place-at-the-wrong-time kind of thing.  Besides, in this case “better-lit” is no more than a dodgy streetlamp at 100-metre intervals.

While it doesn’t help the situation, I’m bloody angry about it.  I’m angry about a company that thinks it’s okay for a female staff-member in her sixties to make her own way home at midnight.  I’m angry at an establishment that sends its police and army overseas to fight in multiple theatres in a fictitious “war on terror” when there is very real terror in our own suburbs.  And, despite what I wrote earlier, I’m angry that she walked in the dark…

Most of all, I’m angry at a son who doesn’t do anything about his mother walking in the dark.  Could I have done anything?  No, but still…

Here’s hoping the little bastards get everything they deserve — and I’m not talking about our piss-weak civil-libertarian-kowtowing give-them-every-chance-under-the-sun-to-rehabilitate-while-they-reoffend-at-taxpayers-expense judicial system…  No, I’m talking about karma.  Good luck in the afterlife guys.

Timezone in PHP

I had a funny problem with my Cacti installation the other day — all the graphs were missing the last hour.  The system was doing updates correctly, but new data was being entered onto the graph at “T-minus-one-hour”.

The first thing I thought of was a problem caused by daylight savings (the state of Queensland doesn’t observe DST, and those Aussie states that do transitioned a week or so ago).  But where?  And why now all of a sudden — I’ve been running Cacti for a few years now.

Strangely, the entries in the cacti log file were timed correctly, except for the entry made by the poller job at completion.  So it seemed that it was just the poller job — which runs from cron — that had a dodgy setting.  I checked for TZ environment variables in apache and cron, and found nothing.

Then I thought of running phpinfo.  If you’ve not done PHP work before, phpinfo() is a built-in function in PHP that dumps a very thorough list of current configuration settings and environment details.  Running phpinfo() through the web server showed that there is a default timezone setting in PHP that was defaulting to “Australia/ACT”!  Changing this to “Australia/Brisbane” in php.ini fixed the PHP code running through Apache, but didn’t change the graphs…  On Gentoo, there is a separate php.ini for CLI PHP — making the same change there fixed the problem.

So why was this not an issue last DST change?  I’ve upgraded to PHP 5 during the last year, and looking through the php.ini from the old PHP 4 installation showed no timezone setting.  So perhaps PHP 4 picked up timezone from the shell environment…

So I now have correct graphs in Cacti, and posts in this blog (Polarblog is PHP-based) show up in correct local time again.  One more for the good guys! :)

Happy Anniversary!

Susan and I celebrated our tenth wedding anniversary yesterday.  Yay for us!