Laptop battery woes

My Acer Ferrari 4005's battery is on it's way out. From around 3hrs when new, it's down to 20 mins, at the lowest screen brightness.

I'm even getting error messages from gnome-power-manager, telling me it doesn't even think my battery's capacity is valid :-)

Gnome-Power-Manager message telling me my battery is not valid :-)

/me is getting tempted to replace it with a MacBook (but don't tell it that)

Conversion with Openoffice

Finally, there is a decent way to use openoffice as a file-converter!

I keep an eye on a (currently dysfunctional) e-mail->fax system. The hard part is converting random incoming files to PDF. Especially nasty proprietary-format ones...

I first used WV, a venerable library, which was capable of getting text out of MS word files and into LaTeX. Great for linux sysadmins, but not so good for people who expect their formatting to survive the transition.

Then I moved on to AbiWord. AbiWord has supposedly taken on the WV torch, but it's given it's fair share of problems too:

  • It's command-line PDF conversion has been broken for a while
  • It's command-line PS conversion was broken for a while, but has since been fixed.
  • Excepting the latest development versions, it requires an X server. I got away with using Xvfb.

Now, I read about unoconv. This looks like exactly what I've been looking for! It'll support all the document types supported by openoffice. Sure the fax server is going to be using a lot more RAM, but this could make it a hell of a lot nicer to work with!

Chip and Pin Woes

I have the pleasure of having a UK money in a bank account and credit card. This is great, because UK cards are the only ones that don't charge exorbitant currency-conversion charges when you use them overseas. I live in Cape Town, so I'm almost always using it overseas.

Chip and Pin, never used to be supported on South African credit card equipment, but these days, it's mandatory in UK, and supported on almost all credit card machines. Back when it wasn't supported people just used to swipe the card. Now, they actually try and read the chip. The procedure is something like this:

  • "Ready"
  • "Insert card"
  • "Swipe card"
  • "Insert card"
  • etc.

At some point, they give up, and ask for another card. The good ones can go between swiping and poking in a fraction of a second, in the belief that the faster they do it, the more likely it is to work. The only real solution seems to be to get the supervisor card out, and override Chip mode....

I thought that was all, until yesterday, when I got an even more interesting error message: "The PAN length does not comply with the min/max length in the BIN file". Does anyone know WTF that means??? :-)

Hardware sucks

I spent a morning trying to debug my LTSP server, which wasn't booting after it's feisty upgrade.

I assume it was something to do with RAID & LVM on the root initially, but after I got through that, it still wouldn't boot.

Aah, but the recovery option worked

Ok, so maybe it's something with usplash, restart and boot without quiet but with splash. Boots.

Eventually I found that it just needed a few extra seconds of spin-time in the grub screen (increase timeout to 10), and now it works.

Bloody hardware!

Sarge -> Etch Upgrade and apache2

Thanks to Debian bug 407171, if you had mod_proxy installed in apache2, and upgrade to etch, it'll also install mod_disk_cache, which means your /var partition is going to fill up quite quickly.

This happened to 2 CLUG servers.

I don't think this is the correct behaviour, and I'm even more suprised to see that it the appearance of the bug is documented in a bug-report.

AVM ISDN drivers and Linux 2.6

I had the pleasure of trying to get an AVM Fritz ISA card working under linux 2.6 this week. While drivers for AVM's premium equipment is in Linux mainline, these drivers are not. The used to be obtained from AVM's ftp site, but these days, if you look there, all that you'll find is old 2.4. drivers, and a notice saying future drivers are available in SuSE.

Before I continue, I wish that all hardware vendors that write linux drivers would get them mainlined. I've begged AVM to do this before.

I tried porting the old driver to a modern 2.6 kernel, but while I could get it to compile, I never actually got it to work :-)

For the record, and for googlers, here's how you build these buggers:

  • You read gentoo's ebuild
  • This points you to somewhere on ftp.suse.com where you can download a 2.6 compatible version of the driver. The URL given didn't work for me, but I poked around with similar URLs, and came up with the goods
  • You'll see a sed command that adds some includes to everything. Run this.
  • You'll also find a whole pile of patches, needed for recent kernels.
  • Really old cards might not be actively patched, but many of the changes in other drivers are applicable to all of them, i.e. in the patch for fritz.pcmcia, the entire atomic_xchg function is removed; this must happen for fritz.classic, too.

I got the fritz.classic driver working with Linux 2.6.21.1, thanks to Gentooers :-)

Lighttpd mod_rewrite

I've migrated my teeny-weenie Xen web/mail server to Debian/etch. It hasn't even been rebooted (it would be a shame to spoil the uptime :-) ):

$ uprecords
     #               Uptime | System                                     Boot up
----------------------------+---------------------------------------------------
->   1   198 days, 06:16:44 | Linux 2.6.16.13-xenU      Thu Oct 12 10:12:51 2006
     2    99 days, 19:25:00 | Linux 2.6.12-xenU         Sun Oct  9 03:58:58 2005

It runs Lighttpd, a small and fast little webserver, popular in the Rails world. Lighttpd with PHP-fastcgi is probably faster than apache, and uses much less RAM.

With etch, I've finally been able to get mod_rewrite to work. So my Zapiro archive has nice URLs now :-)

Lighttpd has a very nice configuration style:

    # No WWW
    $HTTP["host"] =~ "^www\.((.+\.)?rivera\.za\.net)$" {
      url.redirect = ( ".*" => "http://%1$1" )
    }
    # Add WWW:
    $HTTP["host"] =~ "^((foobar|someclient)\.co\.za)$" {
      url.redirect = ( ".*" => "http://www.%1$0" )
    }

    ############################################
    # PHP Apps:
    $HTTP["host"] =~ "^(zapiro\.rivera\.za\.net)$" {
      url.redirect = ( "^/\?/(.*)" => "http://%1/$1" )
      url.rewrite-once = ( "^/(feed)$" => "/index.php?/$1",
                           "^/([0-9]+/[0-9]+/[0-9]+)$" => "/index.php?/$1" )
    }

It's more logical than apache, but you have to watch out for rewrite->redirect->rewrite loops. So if you change to a clean URL syntax, you can't put in rewrites from index.php?/uglurl to /uglyurl because /uglyurl rewrites back to /index.php?/uglyurl, and you get a loop :-)

Cell phone "up"grade

My old (hand-me-down) Sony Ericsson P900 has been dieing for a while. The screen was scratched to death, the stylus missing, and the keypad cracked. (The Top row of buttons didn't work, and the rest occasionally returned the wrong number). Oh, and the phone was crashing a lot.

I don't do spending money on cellphones (because the ones I'd like cost a fortune, and I would never buy something that I don't want), I've upgraded to a "new" hand-me-down SE P910i from my brother :-). It came Orange-branded, and after I firmware-updated it, it Orange-locked, grr.

I wish there was a free way to sort this out, but I couldn't find one, so I paid my £16, and used Total Multi Server. It doesn't require any cables beyond the docking station, and most importantly it worked.

Overall, the P910i is much like the P900, but better. The keypad is sturdier, the phone has more RAM, more applications, and it seems to get better reception.

I "bluetoothed" all my contacts across (because if you do it the syncing route, you loose information when a contact has more than one cell phone number, etc.).

I've installed a few apps, that I like:

  • Opera Mini - the best web browser for a phone
  • GMail - this may come in handy (all my incoming mail gets CCed to GMail)
  • Handy Day 2004 - It makes the phone much more usable as a PIM, and I had a copy lying around.
  • MGMaps - I've tried using maps in opera on my P900, and it was a pain.
  • MidpSSH - Never needed it, but just in case, and anyway, it's cool :-)
  • Mxit - I rarely use it, but it's jabber-peering makes it occasionally nice to have.
  • quirc - Who ever wants to be stuck without IRC?

Finally I got it to synchronise with Google Calendar. The phone only does proprietary (windows) syncs or SyncML over GPRS. But Google Calendar doesn't do SyncML. The OpenSource SyncML server is a Java monster which I wasn't going to install on any of my servers, So I opted for ScheduleWorld as an intermediary. (don't you love their shameless google-style website? :-) ) It works really nicely.

There is also a midp Java program for syncing to Google calendar, gcalsync, but it requires "JSR 75: PDA Optional Packages for the J2ME Platform", which the P910i doesn't have :-(

4 days on the Orange River

I've just got back from a week away, rafting down the Orange river. (Yes it was term time at UCT, I bunked classes :-) )

We went with Gravity, on the recommendation of my sister, who is an ex-guide. If you want to not be going with strangers, you need numbers, so we got a group of friends together, and my brother came down from London especially for it.

It isn't the cheapest way to spend a week (1200kms of petrol and ZAR 2k for the trip), but it was well worth it. Gravity specialise in the Orange river Gorge, and don't have a permanent base on the Richtersveld section of the river, which we requested to do. But they hired a local camp site, and brought the equipment down for us. Our guide, Ant, was very experienced, a good river-cook, and generally good fun. He even persuaded a friend of his, who was about to go home on leave, to come down with us, as a hard-working assistant, "on holiday". The food they produced for us was, while made from simple ingredients, phenomenal. There was always too much, and we had a cooler-box per day for us to bring our own cold beer (and other drinks). The ice just lasted to keep everything cold for 4 days.

The scenery in the Richtersveld is spectacular. The river is a strip of incredibly fertile land, down the middle of a barren desert. You are surrounded by a mountain range of loose, rocky mountains, brimming with Quartz seams. While it feels like the middle of nowhere, there are goats, fisherman, and mining activity around, which is a pity -- when I've been there in the past, it was far more barren. Fortunately, there was no (South African) cell phone reception, and my laptop stayed at home. :-)

I took quite a few photographs (in-between rapids, when my camera had to be packed away in a waterproof container). I didn't expect it's battery to last for the whole trip, but it did, which was great as I don't have a spare :-). Taking panoramas seems to be all the rage these days, so I took quite a few, but I haven't managed to stitch them together yet...

The river is of course the border between South Africa and Namibia, so on our way, we had to go through the border, get stamped into Namibia, then come back (without getting stamped), and go to our base camp on the South African side (while officially being in Nambia). Then, at the end of the trip, we got picked up from the Namibian side and driven back through the border (getting stamped this time). Fortunately, once you get away from the border post and onto the river, no one cares about borders any more :-)

The day is phenomenally hot (even in this calm time of the year), and so you constantly jump into the water for a swim. Or find someone who you can splash, so that you can start a water fight, and end up soaked :-)

There was quite a bit of paddling to do every day (as the water was low), but it was quite relaxing, and not very stressful. We even had a tail wind one day, and could put up kekoi sails. All in all, we covered 75km in 4 days.

The nights weren't too cold (thank god, because I forgot my sleeping bag, and had to borrow a rather thin one from the Felix Unite camp), but clear and dew & mosquito-free. It was new moon, and the stars every night were spectacularly bright and plentiful -- I wish I'd taken a star-map with me.

All in all, I highly recommend that everyone do this trip. Gravity are great, and our guide, Ant, is worth requesting :-)

etch upgrades

I've done etch upgrades in the past (i.e. before etch came out), and they were sometimes quite hairy. Especially the transition from ssh to openssh-server and openssh-client. I had a few broken upgrades...

Since etch has come out, I've been upgraded a few machines, and it's a piece of cake. In fact the CLUG webserver and backup-server have been upgraded.

My servers tend to use custom kernels without initrds, so upgrading is quite simple. The release notes seem to cover it pretty well. There are only a couple of gotchas I've had:

Upgrade vim with an aptitude install vim before you do any dist-upgrading. Personally, I like to use vimdiff for configuration file changes. This means I can keep the configuration file format and comments of the latest package, and my configuration changes from when the machine was originally set up. If vim is half installed, you can't run vimdiff...

When you are done, you might need to purge hotplug:

# aptitude purge hotplug

You can also remove non-US from your sources.list.