Latest Publications

Back from OSD

The OpenSourceDays conference is through now (has been since Sunday, actually, but work has been keeping me very busy) and a quick reflection tells me that it was great to be there. Some of the highlights:

  • A good presentation from Signal Digital about ding.TING: a new open source frontend for libraries in Denmark, using Drupal
  • Part of a presentation of Groovy on Grails – it definitely piqued my interest (I only got part because the presenter was taken ill half-way through)
  • Meeting Typo3 people: Christian Jul Jensen from MOC Systems, Stig Kjeldsen from OpenGate, and Søren Malling from DKM
  • Helping out a bit in transforming the site of the Danish Typo3 user group. It currently looks like an ad for washing powder and that’s going to end.
  • Meeting a guy with an idea for a site project and agreeing that we should make this happen sometime soon.

So, overall, it was very enjoyable and a bit of an eye-opener (it was my first IT conference). There’s a big chance I’ll be going again next year, that’s for sure – the helping out bit was actually rather fun, especially the second part.

However, this means that the Typo3 Multimedia Cookbook review I’ve mentioned has been moved back about a week or so – it needs a bit of time for reading and fairness.

  • Google Reader
  • Delicious
  • Digg
  • Blogger Post
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Twitter
  • WordPress
  • Share/Bookmark

Ubuntu and swap partitions

This is a note to self and any others that may find themselves in a similar situation. Should you happen to one day start your computer, wait for your linux distro to boot up and then see the following message

swap: waiting for UUID=xxxxxxxx-xxxx-xxxx

without anything else happening, then don’t panic! At least not yet. Before you start pulling hair out of your head, try the following:

  • boot into recovery mode, using grub, a live-cd or the excellent system rescue cd
  • check which UUIDs your disks actually use (and by now, you should have an idea of where this is going)
    • easiest is: ls /dev/disk/by-uuid/ – however, if you have many disks then the output will be unwieldy
    • easy as well: sudo blkid – this will list all disks with extra info
  • mount your linux boot partition, then check the fstab file on it
    • if you mounted it on /mnt/disk then do vim /mnt/disk/etc/fstab or nano /mnt/disk/etc/fstab
  • check the partition that’s marked as swap – compare the UUID it’s loading by against the list obtained above
  • if the UUID matches, go ahead, panic. If the UUID in the fstab file doesn’t match then change the fstab file (either to load the partition by /dev/sda-something or the proper UUID) and then try rebooting.

As I didn’t have access to the above list when this happened, I panicked (after the third or fourth reboot with the same result). Luckily I had access to another computer and could google for solutions – and came across this in a forum which I figured needed to be spread some more.

Why did the UUID of the swap partition suddenly change? I have no idea. Perhaps it wasn’t even the UUID changing, it was something else in the system that suddenly started caring about the mismatch (that’s rather farfetched, but so is the whole situation). My best bet is that it was down to a bootup to Windows and some work there – perhaps trusty old WinXP decided to play nasty and change stuff at random. No matter what, though … the relief when I finally got the thing working was massive (among other things, I have some webdev work to hand in soon).

  • Google Reader
  • Delicious
  • Digg
  • Blogger Post
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Twitter
  • WordPress
  • Share/Bookmark

Open Source Days

One thing I’ve completely forgotten to mention here is the fact that I’ll be going to the Open Source Days conference in Copenhagen the 5th and 6th. The schedule looks nice with Friday probably being more along the line of my immediate interests – although the Development aid & eGov activities on Saturdays schedule also look interesting as do the various tutorials.

I’ll be missing out on some stuff, though, as I’ll be working at the conference: my ticket is paid for by two stints in the wardrobe/handing out T-shirts. It’s not going to take away too much, though, especially as part of my goal is to meet some other people at the conference, do a bit of networking if possible (“here’s you jacket, sir, and my card“).

  • Google Reader
  • Delicious
  • Digg
  • Blogger Post
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Twitter
  • WordPress
  • Share/Bookmark

Criminal design

At the end of my recent holiday stay at Gran Canaria, my fiancee and I came across a machine that was designed so poorly, it bordered on the criminal. The machine in question was a small money-changer, placed right next to vending machines (both of which are operated by the company AMFM). The combination of vending machine plus money-changer is a very nice combo for tourists (and pretty much anyone, really) especially in the environment we found it: the airport on Gran Canaria, after going through security. Imagine being in the “secured zone”, with a ten euro note and no small change, needing a bottle of water – a money-changing machine suddenly becomes your best friend (sorry Fido).

How does one turn this scenario from great to awful? One way, of course, is by having an “out of order” sign on the money-changing machine. However, while this would make you somewhat bitter, it’s what can happen – not enough to make you really angry. No, what’s needed for that is that the machine steals your money.

If you look at the picture on the right, you’ll see a machine that does exactly that. It’s designed in a way that makes it steal money every now and then. It’s not that it consistently short-changes you – that would be too much and would probably get them in the spotlight of authorities. No, what the machine does is completely lack proper feedback mechanisms. It seems that the only bit of feedback incorporated into the machine is “I’ve run out of money to hand out to the customer”. In other words, the machine will hand out as much money as it can, up till the amount you put into it.

How does this amount to stealing? In case you hand it €10 and it only has €4, that’s what you get: €4. And a nice blinking message to tell you that it owes you €6. Which you’re not going to get. In other words, the machine is telling you “Sucks to be you, doesn’t it?”.

This in itself is of course so poor design that people should be spanked. The fact that this machine is located in the secured area of an airport just aggravates things: nobody that I talked to would take any responsibility for the machine not working. Instead, the pointed me to the airport authority … the office of which was located outside the secured area. In other words, you need to go through security twice, to be able to contact them about the problem. And your plane leaves when, exactly?

Solution

What should have been done? What would a proper situation look like? First off, a machine like this should never be allowed to accept money if it cannot hand out the proper change. That amounts to a proper feedback mechanism: when change is inserted into the machine, it should count it, and then it should check available funds against its store, before accepting any notes. Secondly, there should be no refusing of responsibility in airports. As is, people are being treated as second-rate citizens in airports. This is just not the way one should do business: treat your customers properly, listen to them.

  • Google Reader
  • Delicious
  • Digg
  • Blogger Post
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Twitter
  • WordPress
  • Share/Bookmark

Router scripting

Another thing that’s been bugging me for a while on the tech side of things at home is my router. It’s a Zyxel 2602 and while the interface is shiny and the setup is fairly easy, the damn thing has a tendency to atrophy and die after some days of uptime … if there’s been quite a bit of traffic going through it. In the spirit of new energy I wanted to do something about it.

Now, although I’m clearly a geek and like my gadgets, I’m not loaded with money, so buying a new shiny toy is not an option. Apart from that, I have a hard time accepting that it shouldn’t be possible to make the Zyxel do the job properly. Well, maybe not properly – I have no intension of messing with the firmware (apart from updates whenever one’s available/needed).

No, what I had in mind was scripting the router to reboot regularly. As I’ve just moved my company site off the server at home there’s no problem if the router goes down for about a minute a day, in the middle of the night. So the question became one of: how to script it?

Possible Solution 1

I’ve been using Selenium for various projects, testing frontends and general functionality. Selenium allows you to script actions and it’s basically ideal for a task like this: log into the webclient, find the right tab, click the right button, done.

Only problem is that installing this to run headless on my server every night means installing SeleniumRC and various other things … in short, much too much work for just scripting a router reboot. If I already had Selenium installed there, then no problem – but unfortunately I don’t.

Possible Solution 2

Instead of installing Selenium, one could also give wget a try – installing is a simple

sudo apt-get install wget

if the program isn’t already installed, that is. After that, toying with various command line options got me logged into the routers webclient and requesting the reboot … but no dice. For anyone interested, the options you’ll need are

  • –save-cookies file / –load-cookies file
  • –keep-session-cookies
  • –post-data=’blah=blah&moreblah=moreblah’

It didn’t particularly look as if Zyxel actually cares about the cookies, but you never know if they’ll come in handy later.

Possible Solution 3

At this point I started looking for alternative ideas – and that’s when I remembered that Zyxel routers provide quite a few different protocols for access (like most other routers). So I checked out the telnet interface and quickly found myself wondering exactly what was going on … the only help provided is lists of commands. No description, no anything. In my battle to find out how to reset things, this led me among other things to a factory reset of settings … fairly annoying (don’t issue sys default unless you’ve got settings backed up!). However, googling for info on Zyxel routers finally led me to a pdf with some goodies, although for a different model. It was worth a shot though, as the command looked as if it might work – and indeed, the Zyxel 2602 will happily respond to a sys reboot issued over telnet. That meant the task was down to scripting telnet – which turned out quite easy. Here’s the oneliner I ended up with

(cat /path/to/passwordfile; sleep 1; echo sys reboot; sleep 1) | telnet 192.168.1.1

The first bit echoes the details needed for the router – after the pipe there’s the actual connection. The sleep commands are there to allow the router to echo back a response before reacting on it – without them you wouldn’t do anything. To avoid having the password stored in the shell history I use a file for storing it in … not that much more secure, but at least you don’t get surprised by where it moves to.

Done

A little bit of researching, some vim’ing and there: a script to restart my router every night at 5. Only thing left is scheduling the cron job :)

  • Google Reader
  • Delicious
  • Digg
  • Blogger Post
  • LinkedIn
  • Slashdot
  • StumbleUpon
  • Twitter
  • WordPress
  • Share/Bookmark