Diary of a geek

July 2009
Mon Tue Wed Thu Fri Sat Sun
    3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

My ugly mug

Where's Andrew?

Categories

Other people's blogs

Subscribe

RSS feed

Contact me

JavaScript required


Sunday, 28 June 2009

Moon

At some point in the past I read a plot summary for Moon and it immediately tickled my fancy. I added it to our Netflix queue and promptly forgot about it until Nigel was raving about it at work on Friday.

I watched the trailer and was immediately sold on it.

I caught it today with Matt. Absolutely fantastic. I don't want to try and describe it very much because I'll just give too much away. A definite must see if you like Sci Fi of the Kubrick variety. I have no idea why this film is having such a limited release.

[17:29] [life] [permalink]

Saturday, 27 June 2009

Every day's a school day

Courtesy of a wonky prerm script in a package I'm working on, I just learned that when you dpkg-reconfigure a package, it runs more than just the package's config script. I guess subconsciously, I'd always expected it to run the postinst again as well, but I did not realise the prerm script was also run.

So having now peeked at the innards of dpkg-reconfigure, it runs the prerm with upgrade version, the config with reconfigure version and the postinst with configure version, in that order.

[10:53] [debian] [permalink]

Monday, 22 June 2009

Yay for GeoDNS

I'm very excited that Debian is dabbling with GeoDNS.

I look forward to the day when one can point at their sources.list at ftp.debian.org (or the generic equivalent) regardless of their location and get a fast local mirror. One less question to answer when installing Debian.

[22:59] [debian] [permalink]

Thursday, 18 June 2009

Shout out to SiliconDust

I bought a HDHomeRun at some point in the past. It works ridiculously well with MythTV and helps add to the distributed network that is our home.

Recently, the power supply seemed to give up the ghost. The little red light on it was flickering on and off, and the unit became unresponsive. On the weekend, I finally got around to filing a ticket with SiliconDust to enquire if I could purchase a replacement, because I figured the entire unit was out of warranty by now (I said as much in the ticket).

To my surprise, I received a reply telling me that based on my device ID, I had a known-bad power supply, and I was directed to fill out an online form to get a replacement one shipped to me at no cost to me.

Nicely handled, even if the website was littered with spelling mistakes.

[23:01] [tech] [permalink]

Saturday, 13 June 2009

The Lenovo T400

My new laptop that I ordered a while ago finally arrived on Tuesday.

I wasted no time excising Windows Vista Basic that came with it and installed Debian 5.0 (Lenny)

The installation went fine, and the laptop is running well.

I'm running the 2.6.29 kernel from backports.org, because without it the WiFi doesn't work. The in-kernel HDAPS support doesn't seem to work with this kernel, and I'm having some problems building the tp-smapi kernel module, which I haven't looked into too much yet. The fingerprint reader is currently unsupported, so no biometric shenanigans just yet.

The biggest annoyance is that I didn't actually compare the resolution of the display with the resolution of my old laptop (the D610). The display is only 900 pixels high, compared with 1050, so I can't get a 2 x 2 tiling of Gnome Terminal windows at the default font size, which is somewhat irritating, as that's how I'm used to working. Maybe the solution is to start using more virtual desktops. Or use Alt+Tab more. I'm pretty sure the X301 had the same display resolution, so I'm feeling somewhat vindicated in my decision to not spend twice as much money on the X301, as that would have just made me even more annoyed with myself.

The default minimalist X.org configuration file was having X default to using the VESA driver instead of the Intel one. This was producing only a 16-bit colour depth, and resuming from suspending to RAM wouldn't turn the backlight back on. It took me a few days to figure out that the VESA driver was in use, and as soon as I swapped to the Intel driver, the backlight problems went away as well, so that was a win. I haven't bothered to try and get Compiz working yet.

Aside from that, everything's working well. The camera worked out of the box. It resumes from being suspended to RAM ridiculously quickly. The hard drive is super quiet. I've nearly finished moving out of the D610. Oh, and most importantly, it runs so much cooler than the D610.

Because this laptop is now the gruntiest machine in the house, I'm going to stop doing all my package builds on caesar and do them on this laptop instead, so I've set up pbuilder and schroot and whatnot. The CPU has the VMX extensions, so I can have a play with KVM as well.

[11:18] [tech] [permalink]

Friday, 05 June 2009

Oh noes, my first cavity!

I've always prided myself in the fact that I didn't have any fillings. That's about to change, sadly.

One of the teeth at the back, top right of my mouth has a deep valley, which makes it hard to get at with a toothbrush, and there's a small cavity at the bottom of that.

Dentist trips for me have always just involved the cleaning and scaling and an exam. Aside from having my wisdom teeth out (which I had done under general anaesthesia) I've never had a dental procedure before. Eeek.

[08:28] [life] [permalink]

Thursday, 04 June 2009

Software controlling the power to USB Woot! lights

I've had a few enquiries from my blog post about trying to control dumb USB-powered lights.

I thought I'd just write something up to save myself replying to any more emails.

Yes, it's doable. Finding a USB hub that will do it is another story. From my own research, I found someone else who was doing something with USB-powered devices (I can't remember what now), and he had been using a what is now a Linksys ProConnect USB 4-Port Hub USB 2.0

I'd first tried a couple of random cheap hubs from Fry's with no success (fortunately I was able to return them) before I determined that the Linksys one would definitely work. The downside of the Linksys hub is it requires external power. It was also one of the more expensive USB hubs on the market.

One of my co-workers, who is an Electrical Engineer by education, said that the USB spec requires the functionality that I wanted, but most chip manufacturers had cut a corner in the interests of cost saving. The Linksys hub uses an NEC chipset. Every other hub that I could get my hands on had a Genesys Logic chipset, and did not work. You can tell if you've got a winner by the output of lsusb -v. If the hub characteristics include "Per-port power switching", you're in business.

To do the actual port powering on and off, I'm using a setuid-root hub-ctrl, wrapped with a small shell script, which has the USB ID of the hub and the port number the lights are plugged into hard-coded in it.

In my searching, I found also that it may be possible to do with Python, but I did not invest the time trying to find out.

[23:20] [tech] [permalink]

Saturday, 30 May 2009

On obtaining an E-3 visa from the US Consulate in Vancouver

I've already had one enquiry, so I guess I'd better get writing.

Despite the lawyers being really down on using this Consulate, I have to say that from my experience, it's been the easiest so far. Or I'm just getting used to the rigmarole.

The one screw up was I didn't read the instructions thoroughly enough, and we rocked up to the Scotia Bank branch to deposit the visa application fee in their bank account, and I thought the fee was quoted in Canadian dollars. Turns out, it was quoted in US dollars. It wasn't the end of the world that we didn't have cash, they could sell us US dollars on a credit card, except the bank would only accept Visa card, not Mastercard. I haven't had to deal with such bullshit since the great Cabcharge/Visa card war in Australia in the late 90's.

Moral of that story: read the instructions multiple times. Carry one of each flavour of credit card when traveling internationally, just in case.

That minor transactional hiccup aside, everything went fine. The Consulate itself does all of the pre-interview shenanigans on one floor (the bulk of the waiting around, the fingerprinting and photographing) and then they shoot you up to another floor for the "interview". Annoyingly, they run you through the metal detectors again on the higher floor.

The interview was basically "So you work for Google? How about the food?" and then he told us to come back the next day to pick up the passports. I think we were in and out in about three, three and a half hours.

I have to say, the ability to collect the passports from the Consulate later is a real boon. When you're in a foreign country, the last thing you want to deal with is any glitches in the postal system, or trying to get mail delivered to a hotel. This alone makes me like the Vancouver Consulate the best.

We went back at the 2:15pm allotted "passport pick up time", and they came down to the security checkpoint on the ground floor and you show your receipt and they give you your passports back. They tell you to step outside and check it, and come back if there's any problems, so I presume you can at least talk to a human at that point if there are any problems.

This is my third E-3 visa. They did not ask to see any of my supporting paperwork showing ties with Australia or anything else that I had in my giant wad of paperwork, just the approved Labor Condition Application, which they kept and returned with the passport the next day.

[00:45] [life] [permalink]

Saturday, 16 May 2009

Deciding between the Lenovo T400 and X301

I'm in the market for a new laptop. I've got almost 4 years out of my Dell D610 (which I've been despising from not long after purchasing) and decided that I'll never buy from Dell again.

I used to be very down on ThinkPads because of the placement of the Escape key, but since I've been using one at work for the last 3.5 years, I've gotten used to the Escape key location, and found the laptops themselves to otherwise be very solid and well supported by Linux.

So Lenovo it is.

Next question: T400 or X301? I've seen both, and the X301 is very sexy in terms of thickness, weight, and having all the latest bells and whistles, but boy, is it expensive.

I did a side-by-side comparison between a T400 decked out the way I wanted, and an X301 decked out the best I could choose, and I've opted for the T400.

The main problems I had with the X301 were that there was no choice of processor, and the processor available seemed significantly slower than what I could get in the T400, and of course the cost. I seemed to be paying nearly $1000 more for a slower processor, just to get something extra thin and light, with LED backlighting and an SSD disk.

What finally swayed me to spending less money and getting an arguably "better" laptop was if I paid less now, I'd be more comfortable possibly getting something in less than 4 years time down the track. So if it came down to the X301 for 4 years or the T400 for 2 years, the T400 seemed like a better deal.

What will hopefully end up happening is I'll end up using the T400 for four years and not end up hating it by the end of that time.

Here's what I ended up going with:

  • Intel® Core™ 2 Duo Processor P8600 (2.40GHz 1066MHz 3MBL2) 25W
  • 14.1 WXGA+ TFT, w/ CCFL Backlight, Camera
  • Intel Graphics Media Accelerator 4500MHD with vPro
  • 2 GB PC3-8500 DDR3 SDRAM 1067MHz SODIMM Memory (2 DIMM)
  • UltraNav (TrackPoint and TouchPad) with Fingerprint Reader
  • 160 GB Hard Disk Drive, 7200rpm
  • DVD Recordable 8x Max Dual Layer, Ultrabay Slim (Serial ATA)
  • Intel WiFi Link 5100 (AGN) with My WiFi Technology
  • 9 cell Li-Ion Battery

All of that plus a 2 year warranty and an additional 90W AC adapter came out at $1,240 (they have a 15% off discount code thing running until tomorrow, which brought the price down a bit)

I'm particularly excited about not having a proprietary graphics chipset. I'm particularly unexcited about it including Windows Vista Home Basic.

Drat, enumerating all of the options made me just realise that I seem to have omitted the 5-in-1 media reader from the final order. Oh well. That was largely just a nice-to-have anyway. Sarah tends to do all of the photo management on her laptop.

I doubt this will get to me before Thursday, so I should have it waiting for me by the time I get back from Barcelona.

[12:41] [tech] [permalink]

Friday, 08 May 2009

A few days in British Columbia

We got back from our brief visit to Canada last night. We had a great time, Vancouver and Victoria were both very nice.

YVR (Vancouver Airport)

This airport has to win the award for nicest airport I've seen. Clearly they pulled out all the stops in preparation for the Winter Olympics next year. The airport is very bright, airy and open. Before you even hit the immigration line, you pass through a couple of water features, some indigenous art, all of that jazz. Immigration is done in the open in a huge hall, instead of in the dark bowels of the airport, which was a pleasant change from the usual US airport immigration experience. (That said, Houston airport had a pretty nice immigration experience). Oh, and it was blanketed with free WiFi, which was a nice touch.

Ferry to Victoria

The brief geography lesson I got was that Victoria is on Vancouver Island, and Vancouver (the city) is not on Vancouver (the island). Go figure. Getting to Victoria from the airport via BC Ferries was a very seamless experience. You board a bus from the side of the airport terminal, and it drives to Tsawwassen, drives onto the ferry, and then you get off the bus and go sit on one of the passenger levels of the ferry.

BC Ferries

BC Ferries deserves special mention. The ferry itself is huge - 7 decks (three of them for vehicles). It's a veritable shopping mall on water. It's got some stores, buffets, exclusive $10 entry lounges, video arcades, cellular payphones, the works.

The trip to Victoria

The ferry ride took about 1.5 hours, and was very scenic. We passed by a few smaller islands, and I had an instant flashback to the TV show The Beachcombers that I used to watch as a kid, particularly the opening sequence.

Victoria

Victoria is a beautiful city. It's the capital of the province of British Columbia, and I likened it to Canberra in a lot of ways. It had more modern conveniences than a town with a population of its size would otherwise normally have. It was a government and university town. Nice houses, very green in general, and being an island, there was water everywhere. It seemed to have lots of bays, and harbours and rivers. It was very nice.

Flight back to Vancouver

We took a Harbour Air seaplane back to Vancouver on Sunday afternoon. That was fun. I've never been on a seaplane before. It took about 35 minutes.

Vancouver

First order of business in Vancouver was the purpose of the whole trip: renewing our visas. That went fine, I'll write a separate post about the process. Afterwards, we bought tickets for the Big Bus, and toured the city for the remainder of Monday and Tuesday.

Drive to Whistler

For Wednesday and Thursday, we hired a car, and went a bit further afield. On Wednesday, we drove up to Whistler to check it out. The drive up took about 5 hours, because we stopped at every scenic spot we came by. Waterfalls abounded. There was a lot of work being done on the roads between Vancouver and Whistler, upgrading them for the Olympics. Whistler itself was pretty spectacular. Some crazy looking ski runs. The village looked like Squaw Village on steroids. The drive back only took about 2 hours.

Cleveland Dam, Lynn Canyon suspension bridge

For the last day, we drove to Cleveland Dam, where there was a salmon hatchery, and checked out the dam, hatchery and surrounding area. It was lovely and green. After that, we drove to Lynn Canyon to check out the suspension bridge there (unlike the Capilano Suspension Bridge, which costs $26 a pop, the Lynn Canyon one is free).

That was all we had time for really. The weather wasn't fantastic during our stay, but it didn't really prevent us from doing anything either. I'd have liked to have checked out Stanley Park if we had more time, and Sarah wanted to go to Grouse Mountain.

We had a near-100% success rate at being picked as Australians, unlike when we're in the US, where more often than not, people ask us if we're British. Apparently this is mainly attributed to the fact that Australians run all of the ski lifts at Whistler. We certainly heard a lot of Australian accents while we were getting around.

I'd also never seen such a saturation of Starbucks before. In Vancouver, there were literally Starbucks across the road from Starbucks, and around the corner from another one. Whistler village had two.

The Canadian accent is cute. They really do tack "eh?" on the end of everything, although it's phonetically more like "ay?". "House" and "about" are also pronounced distinctively differently.

Overall, Vancouver wasn't what I'd call bursting at the seams with tourist attractions, but seemed like a nice city. It was fairly flat. The beggars were well dressed. Everyone was very friendly. A lot of the taxis were Priuses. It seemed pretty clean. I could handle living there. Not sure how bad it gets in winter.

[23:56] [life] [permalink]

Monday, 04 May 2009

Analog cable's days numbered?

Apparently Comcast is planning on axing its analog cables at some undetermined point in the future.

That will make my MythTV setup more complicated, and no doubt require a more expensive cable plan and yet more equipment. My setup is already a tad ridiculous.

[18:30] [tech] [permalink]

Saturday, 02 May 2009

In Vancouver

It's time for the obligatory two-year E-3 visa renewal (well reapplication, technically), and this time we thought we'd stay local and do it in Vancouver.

We flew up this morning, and we're going to get a ferry to Victoria and stay the night with my cousin and meet his wife and kids, then take a seaplane back to Vancouver on Sunday night.

We've got an appointment at the US Embassy on Monday morning. If everything goes to plan, we'll fly back on Thursday evening.

I'm looking forward to a bit of down time. The timing is unfortunate, given this H1N1 flu outbreak, but our visas expire at the end of the month, and consular appointments aren't particularly easy to come by (or flexible).

[14:53] [life] [permalink]

Sunday, 12 April 2009

Queensland Rail to get WiFi

I just read that they plan to put WiFi on the trains in Brisbane.

I had one of my crazy business ideas to try and do this years ago. I think it'd be great for public transport adoption. Imagine being able to be on top of your email by the time you arrive at your desk?

Of course, with mobile broadband becoming more and more ubiquitous, you don't really need WiFi on the train, so it may be too late...

[22:32] [tech] [permalink]

Saturday, 11 April 2009

Grappling with Git, episode 1

At work, we have a bit of a vested interest in the Puppet and Facter packages that are in Debian, because we ultimately consume them in Ubuntu.

We noticed that what was in Debian unstable was lagging a bit behind what was released upstream, and when one of my co-workers tried getting in contact with the Debian developers that were maintaining the Puppet package and got no response, I got involved.

I got in touch with Micah Anderson and got myself and Nigel Kersten added to the Alioth project for Puppet.

Despite Jamie Wilkinson being listed as the maintainer of the facter package in Debian, he claimed this was news to him, and Matt Palmer, who was listed as an uploader, didn't really claim much knowledge of maintaining the package either, so we took that as blessing to take over that package as well.

This is where the fun begins.

I've been meaning to try out Git ever since Debconf 7, where all the cool kids were using it and raving about it.

I've been meaning to make the Debian DHCP package collaboratively-maintained, and use Git for the revision control, but I haven't quite gotten off my good intentions and done it yet. Part of the problem is not knowing exactly what workflow I should use, and suffering from paralysis by analysis, reluctant to experiment, because I don't want to go down the wrong path.

Anyway, this is about Puppet, not DHCP. The Puppet package, as it turns out, is already maintained in Git on Alioth, so the problem here was more one of figuring out what the current workflow was, and trying to follow it.

This is where Nigel came in. Conveniently, the upstream Puppet development is done in Git also, and Nigel is a contributor to Puppet upstream, so he had some Git-fu. So between the instructions on how to get started with Git on Alioth and what he knew, we could start fumbling around.

It seems like the Alioth Git repository was also tracking the upstream Puppet repository, as there were commits in the Alioth one by Luke Kanies, and we didn't really imagine that he was doing Debian-specific stuff.

Here's what we ended up doing to try and get what was in the Alioth repository up to the upstream version 0.24.8 of Puppet:

git clone ssh://apollock@git.debian.org/git/pkg-puppet/puppet.git

This part was fairly straight forward. Clone what's in Alioth locally.

git remote add reductive git://reductivelabs.com/puppet
git remote update
git fetch --tags reductive

Next, we added a remote branch that tracked upstream. We called it "reductive", and we updated it. The bit that took some fiddling with was fetching the tags. Nigel later figured out that tags are inherently private to a repository, and normally stay that way. So if I have a local clone of say the upstream Puppet repository, I can tag it to my heart's content, and normally those tags would stay in my local repository, because they're probably only meaningful to me.

git checkout -b upstream/0.24.8 0.24.8

This bit took a bit of work to arrive at as well. What we wanted to do was create a new branch called upstream/0.24.8, which was at what was tagged 0.24.8 in the reductive repository. Nigel pondered what would happen if you already had a tag or a branch called "0.24.8" before you added the remote repository. This is also why we had to fetch the tags from the remote repository, so we had something to check out.

git checkout master
git merge upstream/0.24.8

Next, we switched back to the master branch and merged the contents of our local upstream/0.24.8 branch that we just created. This now got the Puppet source in the master branch up to what was released as version 0.24.8. (and this is better than just running uupdate?)

We did some fiddling with the debian/control file and debian/changelog and fixed up a few things that Lintian was bitching about, and were done.

I'd set up a sid chroot with cowdancer previously, and had to do some faffing around with git-buildpackage to convince it to use pbuilder. I ended up using

git-buildpackage --git-builder="pdebuild --debbuildopts '-i\.git -I.git' --basepath /var/cache/pbuilder/base-unstable.cow"

So now we've got most of what we want to ship checked into Git on Alioth. I have no idea if we've done it "right", I suspect we may have done something wrong by operating on the master branch. Looking at the revision history in the Git repository on Alioth, it looks like previously things have been done a few different ways. I certainly want to write up a definitive workflow once we've figured one out.

We haven't uploaded the new package to unstable yet, because we're still trying to give it a modicum of testing, and we'd like to sort out the Facter package as well.

The Facter package was a more greenfield exercise, as while there was already a Git repository on Alioth for it, it was empty. So Nigel had to do some futzing around to get it checked in the right way to make git-buildpackage want to build it. He did this by himself, so I'm not sure exactly what he did. I've since discovered that it's probably lacking some dependencies it needs, so that'll need to get fixed before it gets uploaded.

I look forward to reading blog posts from the smart people who actually know how to use Git properly, telling me how we should have done it.

I'm still very interested in coming up with a proper workflow for preparing packages and committing the changes, and for doing code review.

[18:30] [debian] [permalink]

Sunday, 05 April 2009

DHCP package futures, the braindump

Now that Lenny is released, I've got some time to go to town on the ISC DHCP packages.

The first thing I want to do is get DHCP 4.1 uploaded. Unfortunately, this first requires a bunch of transition work, and the associated coordination that goes with it. This post is an attempt to marshal the stream of consciousness and come up with a plan...

Problem #1: everything has 3 in it

The packages themselves need to lose the 3 everywhere. The source package is dhcp3. That seems kinda retarded if its DHCP 4.1.0. The binary packages all need to loose the 3 as well.

apt-cache rdepends dhcp3-client tells me I'll need to reach out to the maintainers of the following packages:

avahi-autoipd
wifi-radar
synce-hal
rutilt
rootstrap
resolvconf
nfsboot
lxnm
laptop-net
ifupdown
education-desktop-other
dhcdbd
bpalogin
avahi-autoipd

Obviously I can keep the old packages around for a while for transitionary reasons.

The 3's also persist in various directories provided by the packages: /etc/dhcp3, /var/lib/dhcp3

apt-file search /etc/dhcp3 tells me I need to reach out to the maintainers of the following packages:

avahi-autoipd
debian-edu-config
debian-installer
dhcdbd
fai-doc
fai-nfsroot
ntp
ntpdate
resolvconf
samba-common
sendmail-base
whereami

Obviously I can keep some compatibility symlinks around for a transition period.

Problem #2: the names themselves

Is it right to monopolise the name "dhcp-client" or "dhcp-server"? I tend to think not. So should I rename the source package to "isc-dhcp" and prefix all of the binary packages with "isc-"? I think this would cleanly address #520842 and the fact that there's apparently supposed to be a "dhcp-client" virtual package.

Problem #3: dhclient-script is old and crufty

This is less pressing, and less packaging related, but the dhclient-script we ship now is Debian-specific. There is room for optimisation, and there are better ways to implement the script so it's more externally customisable. I'd also dearly love to switch over to using iproute for everything possible.

This brings us to the game plan, which I think I'll write in a future post after I've meditated on the problem a bit, now that I've finally written it all down...

[00:10] [debian] [permalink]

Saturday, 04 April 2009

It's not just me

Neil put me onto this guy who is also doing monitoring of his cat water bowl. Unlike my way of doing it, he seems to be doing it without any probes in the water, which would make refilling the water bowl a lot less fiddly, although adds the requirement to have a rig above the bowl.

This ultrasonic sensor thing sounds very interesting.

I foresee the soldering iron making a reappearance in the near future...

[12:06] [tech] [permalink]

Asterisk Gateway Interface 1.4 and 1.6 Programming

Asterisk Gateway Interface 1.4 and 1.6 Programming

I received an email out of the blue recently from someone related to Packt Publishing, the publisher of Asterisk Gateway Interface 1.4 and 1.6 Programming, asking me if I'd like a review copy of the book.

This is the second unsolicited book review request I've received now. I just wish I had more time/mental energy to read books!

I'm going to make a concerted effort to read this one and write a review of it, because AGI is something I'm moderately interested in. AGI is what makes a lot of computer-telephony integration really possible with Asterisk, and CTI done right is something I'm particularly interested in.

I was also given some sample content and encouraged to post it. Based on this sample content, the book sounds like it should be good.

[10:47] [tech] [permalink]

Tuesday, 31 March 2009

Rollerblading to work

I've moved buildings again, and am now the closest to home physically possible, which makes self-powered commuting less of a drag.

Sarah's restarting her Certified Nursing Assistant course, in an accelerated mode this time, and started clinicals this week, which is at a skilled nursing facility in the opposite direction to work, so I rollerbladed to work today and yesterday.

I managed to convince my phone to get a GPS lock today, so I used the very cool Android app, GPS Tracker, which when enabled, will report to InstaMapper's website as well as record a track.

Here is today's commute in.

GPS tracking powered by InstaMapper.com

[21:21] [life] [permalink]

Monday, 23 February 2009

Upgrading MythTV to Debian 5.0 (Lenny)

I've been dying to upgrade my MythTV setup to use Lenny for ages, ever since I got a HD HomeRun and discovered my primary MythTV front end couldn't play back the HD recordings for some reason (I just got a blue box and the audio, and a lot of errors in the X server log).

I figured it was either the kernel or X, and I hadn't been able to get the lirc kernel module to build against anything newer than Etch's 2.6.18 kernel (as I discovered today, that was because of some contamination in module-assistant's build directory, so I could have tried a newer kernel ages ago - drat), so I was unable to determine if it was the kernel or X.org itself.

An added bonus of upgrading X was it talks to the TV better. I've got the PC hooked up to the TV's VGA input, and previously, the best I could do was get it to talk 1024x768, with the TV set to a 4:3 aspect ratio. When I initially upgraded, for whatever reason, the TV was very unhappy with what it was receiving on the VGA input and wouldn't display anything, so in desperation, I tried ditching the xorg.conf entirely, and then everything just worked. X came up with a 1280x768 resolution, I think despite the TV thinking it's getting 1024x768, so now we can have the TV in 16:9 mode, and things don't look all stretched, even when the playback is only 4:3.

And HD, oh it looks glorious. We just watched the Oscars, and it completely filled the TV and looked absolutely fantastic. Playing back HD content seems to really peg the CPU though. The playback was unbearably choppy until we paused the commercial flagging job that was madly trying to flag commercials in the same recording we were currently watching (i.e. the Oscars).

The only thing that seems to be acting a bit weird is notification pop ups from the D-Bus notification daemon. I've got a Griffin PowerMate that runs a home-grown script to re-pair the Bluetooth keyboard and mouse, and that uses the D-Bus notification system to provide feedback while it's running. It seems that while the MythTV front end is running, those pop ups aren't displaying correctly. I haven't gotten to the bottom that one yet.

I also had some problems with a couple of init scripts and splashy causing bootup to hang, but I'm not sure that's completely reproducible (I don't reboot this machine all that often) so it may have been operator error.

Overall, very happy with the outcome. The upgrade was fairly smooth, and I've got the additional functionality I've been waiting for.

[00:01] [tech] [permalink]

Thursday, 19 February 2009

Oh the irony

The website for Tourism Queensland's extremely popular promotion to find someone to be paid $150,000 to be an island caretaker for 6 months is hosted by a Canberra company on a server in Canberra.

So much for supporting local business.

(Small world, one of the Executive Directors was briefly my manager at CyberTrust, but that's the Canberra IT scene for you)

[00:06] [opinion] [permalink]

Saturday, 07 February 2009

Climate change, anyone?

[23:43] [life] [permalink]

Thursday, 05 February 2009

Taken

Sarah and I caught Taken this evening, along with Steve and Emily.

Wow, this was a good watch. Maggie Grace played a very convincing 17 year old. I had to double check it really was the same actor that played Shannon in Lost, because she seemed so much older in Lost.

If you like your action fast, furious and relentless, this is a must see.

[22:54] [life] [permalink]

Wednesday, 04 February 2009

PlayOn. Coming soon to the Wii, but you need Windows?

I just learned about PlayOn, which allows you to watch Netflix and Hulu content on various game consoles, with support for the Wii coming in early 2009.

This all sounded good, but it seems that it relies on a Windows PC to stream the crap to the game console, it doesn't allow the game console to do it all itself. As I don't have a Windows PC in the house (at least not one that's always running Windows, Sarah can reboot her Mac into Windows if the need arises) this is of little use to me. No sale.

[22:34] [tech] [permalink]

Finding security update notices

Me, I'd go to security.ubuntu.com, because I think I can (successfully) go to security.debian.org to get the functional equivalent. But no, that gives me nothing useful. Apparently one has to go to the less intuitively named www.ubuntu.com/usn

I'll have to see if I can get the former to redirect to the latter.

Update

www.ubuntu.com/security is slightly more intuitive and does what you'd expect.

[10:11] [ubuntu] [permalink]

Saturday, 31 January 2009

Oh the irony

Content analysis details:   (5.9 points, 3.8 required)                          
                                                                                
 pts rule name              description                                         
---- ---------------------- --------------------------------------------------  
 1.0 NO_REAL_NAME           From: does not include a real name                  
 1.0 HTML_MESSAGE           BODY: HTML included in message                      
 0.0 BAYES_50               BODY: Bayesian spam probability is 40 to 60%        
                            [score: 0.4956]                                     
 1.4 HTML_10_20             BODY: Message is 10% to 20% HTML                    
 1.5 MIME_HTML_ONLY         BODY: Message only has text/html MIME parts         
 1.1 HTML_MIME_NO_HTML_TAG  HTML-only message, but there is no HTML tag         

That's the registration verification email from the National Do Not Call Registry.

[18:42] [tech] [permalink]

Wednesday, 28 January 2009

And in other news...

We're now the proud owners of a Wii.

[22:44] [life] [permalink]

And she's discharged

Sarah was discharged today. I decided to scrap trying to go to work, as I'd just have to leave at some point to pick her up. The hospital had to ensure that the nurse from Critical Care Systems was able to come to our home before they could discharge her, so that the IV antibiotics could be continued.

We left the hospital at about 11:30am, and he got to our place just after 1pm.

He whizzed through the whole process, as she was due for more antibiotics at midday and he wanted to get the IV started. She's on a four hourly course. Fortunately, that doesn't mean we have to change the IV every four hours.

The way it works is the bag has enough antibiotics in a (presumably saline) solution to last six infusions on a four hourly frequency, and it's hooked up to a pump (that'll cost us $5000 if we don't give it back at the end), which takes care of everything.

So once a day at around noon, Sarah has to disconnect the old bag, flush the line with saline, do something with some Heparin to prevent clots in the line, and hook up a new bag. The bag and the pump fit into a carry bag that can be worn like a bum bag or slung from her shoulder and looped through a belt. It'll be her permanent companion for the next (hopefully only) two weeks.

The PICC has two ports (and I don't think that's the correct term) on it, and the IV is only hooked up to one, so the other one should be flushed and "Heparinised" regularly as well. The nurse comes back in a week with more supplies and to do some maintenance on site where the PICC line enters her arm.

Critical Care Systems seems pretty impressive. They provide all the gear, fill the prescription, and bring it all out to you (by a nurse). They provide a 24 hour hotline to call if there's any problems, questions or concerns, and can dispatch somebody to us if necessary. We've got syringes preloaded with saline and Heparinised saline, more alcohol swabs than you can poke a stick at, and the fridge is full of IV bags.

It's awesome that medical technology has progressed to this point, where Sarah can go about her business almost as normal, instead of being stuck in a hospital for another two weeks just because she has to have a tube in her arm.

To prove this, the little trooper was back at her CNA course this evening, and starts clinical training tomorrow night.

[22:43] [life] [permalink]

Tuesday, 27 January 2009

Today's excitement

It's been a somewhat long day...

I got up at 6:30am for a 7am ankle physical therapy session.

I went to the hospital after that. When I got there, a sonographer was doing the echocardiogram on her heart to check the valves. I missed the doctors. Sarah didn't feel any more knowledgeable about her condition even though they'd been through.

The patient Sarah was sharing with had a bad night, caused her to have a bad night's sleep also, and she always deals with all of this crap much worse when she's got a sleep debt.

Dinner stayed down, but breakfast did not.

The sonographer seemed fairly confident about her heart condition. Usually they don't make any comments on what they're seeing and leave that to the doctors, so we took some comfort from that.

I managed to corner the physician's assistant who had been following Sarah in her office, and quizzed her on what was going on.

It turns out a PICC line had been ordered, and they get installed by specalised PICC nurses and that's all they do all day. The PA implied that it might not happen until tomorrow. The gall stones were definitely unrelated, and something to follow up with her primary care physician. Incidentally, Wikipedia has some wicked pictures of gall stones. Talk about freaky.

I think I hung around until 10am, and then headed into the office to try and get some work done, with the intent to come back after work.

Not long after, Sarah called me up all beside herself about the PICC line (she doesn't deal well with the idea of getting jabbed at the best of times, and being tired put her over the edge), so I scrapped work, and went back to the hospital for the remainder of the day.

I decided to hunt down her cardiologist to see if the PICC line was absolutely necessary, and I managed to get the exact low down on her condition.

  • the infection is staphylococcus aureus, not one of the other staph strains that I can't remember, which are considered less serious. The one Sarah has/had is the "bad enough" one, a.k.a. "golden staph". Fortunately it's sensitive to antibiotics, unlike MRSA, which is the really bad news one to have. So my heart skipped a beat when he said it was aureus, but I recovered when he said it was sensitive. I could have sworn the staph infection she had last year wasn't aureus, but he seemed to think that it was.
  • when she presented at the ER on I guess Sunday morning, this staph was found in the blood sample they took. What is unclear is whether this is because of contamination from the skin when they took the sample (staph is present on the skin, it's only a problem when it gets internal), or it was indeed in her blood, whereas with the infection she had last year, it was never present in her blood.
  • because of her aortic root replacement/graft and the risk of endocarditis destroying her heart valves, they didn't want to take any chances. Hence the PICC line and the two weeks of intravenous antibiotics. Two weeks is really a compromise. He said if they'd wanted to get all paranoid on her, it'd be a six week course, and they'd have done a transesophageal echocardiogram to boot.

So armed with the facts, I headed back to tell Sarah the news that she really should have the PICC line installed, and that she was getting off fairly lightly, relatively speaking.

The PICC nurse had a cancellation, so she was able to do the installation today. It was totally less traumatic than I think either of us were expecting.

It took about 45 minutes to install, and it was done at her bedside. Sarah was very brave and I don't think it really hurt her all that much. I watched the whole thing, and it was very interesting. It was particularly interesting because there was another nurse observing, so the PICC nurse was explaining everything as she went. She was also really nice and good at what she did (she'd been doing it for 14 years) so I think all of that helped.

So Sarah's now got two IV ports strapped to the inside of her upper left arm (attached to the PICC line), and no other IV lines in. She should get discharged tomorrow after they sort out whether she's going to receive IV antibiotics on a 4 or 8 hourly schedule at home, and exactly how all of that's going to work. I think they send someone out to our place to give us some training, and someone comes out once a week to do a bit of maintenance on the PICC line itself. I presume I'll be her personal nurse again. All it involves is a bit of plumbing.

Her cardiologist seems to think she should be able to still do her CNA clinical training with the PICC line in. She may just have some problems with lifting duties. I guess we'll just see how all of that pans out.

So that was the excitement for today. Sarah had her appetite back at dinner time, and was generally in much better spirits when I left her this evening than she was this morning. I could go into much more detail about the ins and outs of the PICC line installation, but I don't really have the energy.

[21:51] [life] [permalink]

It never ends...

And I thought the recovery from original heart surgery was a bit rocky...

Let me try and gather my thoughts...

Yes, Sarah's got gall stones, no, they're not the problem.

Yes, she's definitely got a staph infection, no, it's apparently (again, fortunately) not the bad type, but unlike last time, it is in the blood.

Apparently that makes endocarditis a bigger concern, the consequences of which are rather scary to put it mildly. I'm guessing this is why they're pumping her full of IV antibiotics.

The doctor(s) that is/are looking after her only do their rounds in the morning, so we've only got all of this information out of band from the cardiologist who popped in to see her this afternoon and sneaked a peek at her chart. So the exact course of action is unclear. He mentioned the possibility of getting a PICC line, which can stay in for up to a month, so they can continue giving her IV antibiotics for a while. We don't know if that means they could or would then discharge her. They want to do an ultrasound of her heart tomorrow to make sure everything's still okay there.

Pain-wise, she's doing better. She hasn't had any more IV pain medication since this morning (just oral stuff), but she hasn't got much of an appetite since throwing up last night. She did eat some dinner though. Nausea has been coming and going throughout the day.

Despite all of this, she's in fairly good spirits and is fairly mobile.

I'm going back to the hospital tomorrow morning to try and catch the doctor(s) when they do their morning rounds.

Somewhat ironically, this hospitalisation is now buggering up her attendance at the Certified Nursing Assistant course she's doing in the evenings. She was due to start clinical training this week. Somehow, even if she were to be discharged tomorrow, I don't see how working in an aged care facility with a PICC line, an open (albeit packed and covered) chest wound and a staph infection is going to be a good idea for anyone involved.

[00:04] [life] [permalink]

Sunday, 25 January 2009

Too much deja vu

Seriously, every time Sarah has surgery, it all goes pear shaped.

The bottom (last time it was towards the top) of Sarah's incision from her recent wire removal surgery was looking a bit red, swollen and hard on Friday, so she went in to the clinic at got them to take a look at it.

They decided that a knot in the sutures was trying to work its way out, and causing inflammation or something, so just like last time, they decided to reopen the incision a bit. They did that, and cut the knot out, and rather than packing with gauze, they just taped the small opening closed with some steristrips and covered it with gauze and sent her on her way.

Somewhat fortunately (for me) Sarah went into the clinic during the day while I was at work, so I missed participating in the fun and games. They didn't use any local anaesthetic, but Sarah said it didn't hurt too much.

That night, though, she was in a reasonable amount of pain, again, similar to last time, except it was a band across her upper abdomen, below her breasts, instead of chest pain.

Mindful of the staph infection disaster from last time, we trotted off to the ER on Saturday afternoon, hoping to nip this in the bud. They did some blood work, which came back clear, and gave her some IV pain medication, which didn't seem to do much, and were generally scratching their heads as to the cause of the pain.

Fortunately, one of the surgeons involved with Sarah's wire removal from 2.5 weeks previously happened to be on call, so he got called in. He had a bit of a poke around the opening with a long cotton bud, and declared that it was possibly infected, because there was a bit of cloudy fluid discharged when he poked it in. Oh, and the cotton bud disappeared a good centimetre or more under the skin further up the incision, which indicated an abscess was forming.

So, for the second time, I got to watch my wife being cut open with a scalpel. I think the local anaesthetic injections were the most painful part for her. He opened the incision up a bit further, and packed it with some Betadine-soaked gauze, and we got sent home with the same instructions as last time this happened: I had to repack the wound with saline-soaked gauze two to three times a day and let it heal from the bottom up. She was also prescribed some antibiotics. She's got about a 2cm incision just below her breasts. It looks a lot deeper than the hole from last year's incision.

So we got home about 6pm last night, and went to bed around 11pm. Sarah lasted a couple of hours before she woke up in even more pain than before. She called up the hospital and had the same surgeon paged, and he advised her to come in to the ER again. So at I think about 2am, we headed back.

They took some more blood, did a CT scan, which came back clear, and decided to admit her. They're giving her IV antibiotics and pain medication. Initially she didn't want to have any more IV pain medication because it didn't seem to be working, and it tends to make her nauseous. She wasn't keen on dealing with throwing up with the amount of pain she was having. It hurt to move as it was.

With a mixture of IV anti-nausea drugs and the IV pain medication, the pain has finally come under control though. She did have one bought of vomiting this evening, which didn't seem to cause her too much discomfort, and she's getting in and out of bed more comfortably. They're going to keep her in overnight. She has a post-operative followup tomorrow in the clinic, so I expect they'll keep her in the hospital until at least then, depending on how things go.

Her cardiologist, intimately familiar with last year's debacle, dropped in this afternoon. He's wondering, given how this has happened twice now, if Sarah has some sort of allergy to the type of absorbable suture they've used. Apparently there are different types of sutures, so if she ever has any other surgery, we'll have to get them to try a different type

It'll be interesting to see how she goes tonight, as the pain seems to get worse overnight. She hasn't had any IV pain medication since about 1pm, and she wanted to see how she goes without it, because if she gets discharged tomorrow, she'll have to rely on oral stuff anyway.

I think it definitely gets harder for her to manage her pain when the pain is causing her to lose sleep. She can only deal with having a couple of night's worth of bad sleep before it all gets too much. So I'm really hoping she gets a good night's sleep tonight. Not that hospitals are renowned for that...

[21:13] [life] [permalink]

Sunday, 18 January 2009

A small mention in the press

The project that I'm responsible for got a very tiny mention in this bio of Mark Shuttleworth in the New York Times.

[10:34] [work] [permalink]

Saturday, 17 January 2009

USB power switch, part 2

Continuing with my mission to control the power to some dumb USB-powered lights...

Dann Frazier confirmed my theory that a USB hub would indeed do the job. I'd already found the hub-ctrl.c program he mentioned, but couldn't get it to work with my built-in USB ports of my laptop.

It seems it all depends on whether the hub will support per-port power switching or not. (lsusb -v will tell you).

So off to the mighty institution that is Fry's Electronics I went.

The first two attempts failed, as did a borrowed hub. It seems most (at least the cheap one) use a Genesys Logic chipset, which does not support per-port power control. Fortunately I chose products that weren't in blister packs, so I was able to return them to Fry's in as-new condition and try again.

Now that I knew USB hubs would do the trick, I did some more targeted searching, and found this thread where someone had been messing around with hubs to do what sounded like what I wanted. (Incidentally, this email in the thread also provided a nice looking Python program. I'm going to look at refitting it to use the "real" Python USB module.)

I emailed the poster to ask him what brand of hub he was using. The answer was the Linksys 4-port hub

So I managed to track down one of them last night. Yes, it works, but the downside is the hub itself requires external power, which is a bit unfortunate. Not only do I need to use a hub to make these lights software controllable, I have to plug the hub into a power outlet. Bleh.

[12:21] [tech] [permalink]

Thursday, 15 January 2009

On filesystem layouts

Wouter's post prompted me to write this...

I find it particularly strange to have a single filesystem for everything, especially so on a laptop. I worked with a guy once who had the single filesystem (I think it was ext2 or ext3), and his laptop crashed, and the filesystem was trashed so badly from the crash (I remember: it was a PowerBook, so I don't know if that had anything to do with it) that it was a write-off.

One of the reasons I use multiple filesystems apply just as much to a laptop as to anywhere else: loss/damage compartmentalisation. If one of my filesystems decides to eat itself, odds are I can still get the others back.

Wherever I go, I tend to have a root filesystem, one for /usr, one for /var, one for /tmp and one for /home. If it's a server, I may have a separate one for /srv as well. I always use LVM, and with ext3 supporting online resizing these days (well online enlarging at least), it's not a big problem to leave some logical extents unallocated, and just grow whichever filesystem needs it as it needs it.

[22:29] [tech] [permalink]

Saturday, 10 January 2009

Out with the old, in with the new

My old hackergotchiMy new hackergotchi

It's a new year, so why not a new hackergotchi I say?

Brandon and Robin came around on Thursday night, and where there's Brandon, there's his camera, so he got a decent enough mugshot to convert into a less crap hackergotchi (after I spent a few hours fighting with the GIMP today)

[15:05] [geek] [permalink]

The Story of Stuff

Sarah brought The Story of Stuff to my attention today. It's well worth 20 minutes of your time, irrespective of where you live.

[14:34] [life/americania] [permalink]

One year and five days later...

...and there was a distinct feeling of deja vu. At least the procedure itself was nowhere near as long (under 2 hours).

On Thursday, Sarah had some day-surgery to have her sternal wires removed. The top one was causing her some discomfort because the skin there was the thinnest (whether that in itself was related to any of the previous incision complications remains uncertain).

The surgical team popped in to pre-op to autograph their work (seriously, they initialled her chest) before they started, and asked if she wanted just the top wire removed, or all of them. We consulted the Magic Eight Ball application on my phone, and it gave a resoundingly affirmative response, so she got them all removed.

Despite removing them all being a bit more surgically invasive, I think this is for the best. It means none of the other wires can cause any problems down the track requiring yet another trip to the operating room.

They also did some scar revision on the top part of the scar, where it was a bit stretched (from the previous complications), so incisionally speaking, she's had almost as much incision work done as the original heart surgery.

Ironically, this made the plastic surgery (laser treatment and steroid injections) she had late last year largely redundant.

She took the dressing off the incision this morning, and we had our first look at it. It certainly looks a lot better than before, so fingers crossed it won't get infected this time, and the overall long-term result will look better.

[14:31] [life] [permalink]

Tuesday, 06 January 2009

On trying to use a Sansa e260 on Linux

I received a SanDisk Sansa e260 (v2) for my birthday. It was one of those presents that acquired for myself on behalf of someone else because it worked out easier that way. I bought it for cheap from Woot!

I thought I'd use it to play podcasts while I'm at the gym. We've been listening to NPR for a while now, and there's lots of excellent programming, and it's all available in download for as well. Since I don't spend all that much time in the car, I'm not listening to much of it.

The first mission was to upgrade the firmware. Getting the player into MSC (instead of MTP) mode with the original firmware was a little tricky, but I got there in the end. Then I had to locate the firmware in a Linux-installable format. I think I ended up resorted to using Windows, but I later found the raw firmware image without needing an installer.

I'm using Rhythmbox at the moment to download the podcasts. I thought I'd try out its MTP support, just because it actually had it, but either Linux 2.6.26 has a problem with MTP, or the player is particularly flaky doing it with Linux, because I just seemed to get a pile of USB errors when connecting the device in this mode, so I'm sticking with MSC for now.

Oh, and I had to put a .is_audio_player file in the root of the device to make it show up in Rhythmbox. I later discovered that it worked most optimally if I put

audio_folders=MUSIC/
folder_depth=2

in the file.

I'm still trying to come up with an optimal way of managing the audio I want to listen to. It seems somewhat tedious to drag and drop all of the podcasts from Rhythmbox to the device. I kind of want some sort of plug and play auto-sync method. It seems I can't use a connection-triggered rsync, because some of the podcasts seem to get downloaded with non-FAT-filesystem-friendly filenames. Rhythmbox seems to take care of this by doing some sort of automagical renaming at transfer time. That said, not everything is showing up in the music list with sane names. There's a few things that have an unknown artist I think. That may be a deficiency in the ID3 tags of the MP3s themselves though...

What I really want some way of getting home, hooking up the player and just getting what's new, without expending too much effort (at the time of hooking up the player, anyway. I'm happy to expend some effort getting to that point)

The next weird thing is that the device wants to talk USB 1.1. I'm not sure what is at fault here, but I can, allegedly at least, make the device reconnect at USB 2.0 by removing and reloading the ehci-hcd module after connecting it.

Here we have the device initially attached:

apollock@icarus:~$ lsusb -t
Bus#  5
`-Dev#   1 Vendor 0x1d6b Product 0x0002
Bus#  4
`-Dev#   1 Vendor 0x1d6b Product 0x0001
Bus#  3
`-Dev#   1 Vendor 0x1d6b Product 0x0001
  `-Dev#   9 Vendor 0x0781 Product 0x7423
Bus#  2
`-Dev#   1 Vendor 0x1d6b Product 0x0001
  `-Dev#   6 Vendor 0x413c Product 0x8103
Bus#  1
`-Dev#   1 Vendor 0x1d6b Product 0x0001

lsusb says that bus #3 is ID 1d6b:0001 Linux Foundation 1.1 root hub

Then if I do a spot of presto-changeo...

apollock@icarus:~$ sudo modprobe -r ehci-hcd
apollock@icarus:~$ sudo modprobe ehci-hcd
apollock@icarus:~$ lsusb -t
Bus#  5
`-Dev#   1 Vendor 0x1d6b Product 0x0002
  `-Dev#   3 Vendor 0x0781 Product 0x7423
Bus#  4
`-Dev#   1 Vendor 0x1d6b Product 0x0001
Bus#  3
`-Dev#   1 Vendor 0x1d6b Product 0x0001
Bus#  2
`-Dev#   1 Vendor 0x1d6b Product 0x0001
  `-Dev#   7 Vendor 0x413c Product 0x8103
Bus#  1
`-Dev#   1 Vendor 0x1d6b Product 0x0001

Bam! It's moved over to bus #5, which lsusb says is 1d6b:0002 Linux Foundation 2.0 root hub

Weird.

I wonder if I should try running Rockbox on it? Seems not, it's only for v1 players. Oh well.

[22:48] [tech] [permalink]

Sunday, 04 January 2009

Feed breakage, Blosxom's shiteful RSS 0.91 implementation

(or echo "blosxom hold" | sudo dpkg --set-selections)

A few people had pointed out to me that my blog was appearing weirdly in Google Reader. I myself read my blog via Planet Debian and Planet Linux Australia, where it appears fine, so I hadn't noticed the problem first hand.

I did some digging tonight with the Feed Validator, and I think I've figured it out.

Funnily enough, it all started with a previous session with the Feed Validator...

I wanted my blog to be UTF-8, with it being the new hotness and all. Blosxom was spitting it out as ISO-8859-1. I've just learned from this evening's debugging, that this is the behaviour of CGI.pm's header() function if not provided with the -charset parameter.

I'd previously worked around this by defining my own content_type for the RSS and HTML flavours. In this file, I just put text/xml; charset=utf-8and text/html; charset=utf-8, respectively.

Unfortunately, this then breaks Blosxom's internal HTML-escaping-for-RSS-feed code, which is conditional on the content type being XML:

if ($content_type =~ m{\Wxml$}) {
        # Escape <, >, and &amp;, and to produce valid RSS
        my %escape = ('<'=>'&lt;', '>'=>'&gt;', '&'=&gt;'&', '"'=>'&quot;');  
        my $escape_re  = join '|' => keys %escape;
        $title =~ s/($escape_re)/$escape{$1}/g;
        $body =~ s/($escape_re)/$escape{$1}/g;
      }

This block of code was being ignored because the regex was anchored. "text/xml; charset=utf-8" didn't match "\Wxml$". Whenever I last had an attempt to make my blog's feed pass the Feed Validator, I must have edited the Blosxom source code to make this regex not be anchored.

Then on November 11, 2008, I updated my Blosxom package to 2.0-14+etch1, to address CVE-2008-2236 (incidentally, there doesn't appear to be a Debian Security Advisory for this?), and my local modification got clobbered. That'll teach me to make local modifications and not put the package on hold. Blah.

It seems I'm screwed, there's no way to have a well-formed UTF-8 RSS feed without requiring a source-code modification to Blosxom. I've either got to change the way the header() function is being called, or I've got to change the regex to allow me to specify a charset in the flavour file, and not disable HTML escaping.

Speaking of screwed, Blosxom seems incapable of making a well-formed RSS 0.91 feed anyway. It wants to put the <pubDate> tag inside an <item>, which is a violation of the DTD. There's supposed to be one for the whole <channel>, not one per item (or "story" in Blosxom-flavour-speak). You can't just move that from the story flavour file to the head flavour file, because a pile of variables that you'd otherwise use seem to only get set on a per-story basis. Double blah.

I'm starting to feel like Blosxom is outliving its usefulness, but I really do not feel like embarking on a wholesale move to a new blogging platform, I'm fairly entrenched.

[22:35] [tech] [permalink]

Mixing electricity and water: monitoring the cat water bowl with Nagios

(this is something I've had "in production" for many months now, I just haven't had the time or energy to do a proper write up about what I did)

We have a cat water bowl, it looks like this:

The cat water bowl

Under "normal" circumstances, it usually lasts about seven days. So when our weekly routine is happening, we'll refill it on a Saturday whilst doing house chores, and it'll last until the following Saturday when it gets refilled.

Unfortunately, sometimes our routine gets disrupted, and we forget. Sometimes, we travel and have a house-sitter, who may not pay as close attention to such things as ourselves.

Once, one of our cats was licking the condensation off a chilled bottle of soft drink that was on the kitchen counter one evening, before we realised the water bowl needed refilling. Naturally, we felt like terrible pet owners.

So I think it was some time around the 2008 Maker Faire, that I hatched the idea of having some sort of water sensor on the cat bowl, which would communicate to one of the various computers in house. At the Maker Faire, I bought a copy of Making things talk, and an Arduino starter kit, which consisted of a Diecimila board and a make-it-yourself proto shield. I also bought a little electronics starter kit, which consisted of a breadboard and various components, and a USB-TTL cable.

I decided to use Bluetooth to communicate with the board, as I already had my MythTV setup using a Bluetooth keyboard and mouse, and it was within range of the water bowl. I decided against using Zigbee, because I didn't know anything about it, and I didn't want to add (or learn about) yet another wireless infrastructure just for this project.

I should point out that I know very little about electronics. I'd never owned (or really used) a soldering iron until I embarked on this project. I took a basic soldering class at the Tech Shop, but I'd already assembled the proto shield by the time I took the class, so I'd pretty much figured it out.

I had a very naive vision that I could just basically shove two wires in some water and it'd close a circuit and that would be my water sensor. Of course this didn't work, so I started hunting around on the Internet for a circuit that would do this. I happened upon a circuit (I don't seem to have retained the URL, so I can't link to it), which just consisted of a couple of transistors and some resistors. So I headed off to Fry's to try and buy the transistors I needed.

I quickly discovered that I didn't have sufficient information to identify the transistors that I wanted, but I did happen to stumble upon a cheap assemble-it-yourself water alarm. It consisted of a PCB, and a transistor and some resistors and a buzzer. I bought a couple of these instead.

Between studying the PCB and the circuit diagram that came with the alarm, I was able to reproduce it on my breadboard instead of on the PCB. Sure enough, placing the two probes in water closed the circuit. I replaced the buzzer with an LED so I could see what was going on.

I attached the circuit to the Arduino proto shield, and had it feed into one of the digital I/O ports. I wrote some quick and dirty Wiring code so that when water not present (i.e. the circuit was open and no current was detected on that I/O port) the LED was switched on. Really at this point, I didn't need a microcontroller, I could have presumably achieved the same thing with a NOT gate.

At this point, I wanted to make the sensor remotely queryable. I bought a BlueSMiRF Silver Bluetooth modem, which I attached to the TX and RX lines of the board (I first configured it by attaching the USB-TTL cable to it and using Minicom on my laptop). I extended the Wiring code to provide a rudimentary prompt, and accept a command to check if water was present.

I think around this time it also dawned on me that I could use the digital I/O pins as a switch. When they're "high" they provide power. So rather than constantly running a current through the water, I only needed to briefly power up the water detection circuit, see if the circuit closed or not, and then report if water was present if it did.

I much preferred this, as at the time, I was endeavouring to power the whole sensor off a 9 volt battery. I figured I'd get much better battery life if I wasn't running a current through the water the entire time. I should point out that I did some "tongue tests" in a glass of water while the circuit was powered up, and couldn't detect a difference between when the circuit was on or off. The last thing I wanted to be doing was zapping the cats!

At this point, the Wiring and Arduino work was pretty much complete. I setup ser2net on the MythTV server, so that I could just connect to port 4000, and be connected to the water sensor.

apollock@icarus:~$ telnet teevee 4000
Trying 172.16.0.9...
Connected to teevee.andrew.net.au.
Escape character is '^]'.

ser2net port 4000 device /dev/rfcomm0 [9600 N81] (Debian GNU/Linux)


waterbowl> s
Water is present
waterbowl>
telnet> q
Connection closed.
apollock@icarus:~$

The Wiring code running on the Arduino board is checked in here.

Next, I wanted to monitor this with Nagios. One thing I found with the Bluetooth connection was that it wasn't all that reliable. Not every connection to port 4000 resulted in a connection with the water sensor. I elected to write some standalone code that submitted results to Nagios by way of a passive check, rather than having Nagios try to actively monitor it. Again, trying to conserve energy, I decided to only check the sensor once every 8 hours.

So I wrote a Python daemon, which tried to be as robust as possible. If at first it doesn't make a connection on its 8 hourly schedule, it keeps trying until it does. Nagios itself has some freshness detection for this monitor, so if no passive result is submitted within 8 hours and one minute, Nagios alerts that something is possibly wrong with the sensor itself. (The original intent was to deal with the situation where the battery went flat)

This is the Nagios service definition I've got. Some of it may be unnecessary or redundant:

define service {
        host_name                       teevee
        service_description             Cat water bowl
        check_command                   check_stale!2!"Check water bowl monitor is on and reachable"
        normal_check_interval           480
        notification_interval           240
        active_checks_enabled           0
        check_freshness                 1
        freshness_threshold             28860
        max_check_attempts              1
        check_period                    24x7
        use                             generic-service
        stalking_options                o,w,c
        contact_groups                  everyone
}

The code for the Python daemon is checked in here.

So everything was going swimmingly, apart from I couldn't get even 24 hours of monitoring on my conservative 3 times a day schedule, and the Bluetooth modem configured for all of its power saving options, and the water sensor itself only being powered on when it was performing a check. There wasn't much more I could do to try and reduce power consumption, at least with my limited electronics knowledge. Perhaps using Zigbee instead of Bluetooth would have helped, but I still think I'd have been going through 9 volt batteries more quickly than I'd have liked.

I also had a brief foray into solar powering the board. I thought maybe the lighting in the house would be sufficient to power the board. Of course this didn't work out. I'd also have needed to make the code running on the board more self-sufficient, and have it just provide a water status indication whenever it had enough power to do so, instead of being a fairly dumb device like it currently is. This all felt a whole level more complicated, and out of my league, and I wasn't interested in attempting this sort of remote-sensing exercise at this time.

The Arduino board can also be powered by USB, so as I already had some long USB type A to type B cables (that had funky lights in them to boot), I decided to just get a wall wart that had a USB type A receptacle, and powered the Arduino board that way. So much for being completely "wireless". (I could have also gotten a general purpose DC power supply that was capable of spitting out 9 volts, but I doubted I'd get one with a sufficiently long cable, which is why I went for the USB-powered option, as I already had a cable long enough)

Speaking of wires, the most challenging part was the probes for the water sensor. As they were going to be permanently in the cats' drinking water, I didn't want to contaminate the water with them. I figured plain untinned copper wire would be okay, since water pipes are copper. Finding untinned, unstranded copper wire was a real challenge. I started out using some FM antenna cable, but that was stranded, and the shielding was a nightmare to strip. It was also reasonably difficult to make go where I wanted it.

What I really wanted was something more solid, that would flex and stay where I put it. I cannibalised a spare IEC power cable, but it was also stranded copper wire. I finally managed to obtain some solid-core CAT-5 cable from a hardware store, and this has worked exactly as I wanted.

I haven't done any further work on the setup since getting the CAT-5 cable for the probe. Further improvements that I'd like to do at some point:

  • transfer the circuitry from the breadboard to a breadboardless proto shield, and generally try to house the sensor better
  • find a better way of connecting the probe wires to the circuit, so it's easier to remove the monitor when refilling the water tank (currently the CAT-5 wires are just shoved into the breadboard). The whole thing is barely spouse-approved as it currently is, let alone being easy enough for an untrained house-sitter to try and negotiate
  • integrate with Asterisk so a house-sitter gets a telephone call when the water bowl needs refilling

The finished product

I had a lot of fun with this project. I had a real sense of achievement, being able to go from concept to completion, and learn a few things about electronics along the way. I'm normally not a fan of messing around with hardware.

Some photos of the project are here.

[16:55] [tech] [permalink]

Friday, 02 January 2009

Online dependency maps for Debian packages

This is pretty cool.

I think the craziest dependency map for a package I maintain is the one for argus-server.

(Discovered via LWN)

[10:56] [debian] [permalink]