Stefano Rivera (tumbleweed)'s Website, Blog, collected bits of code, cruft and other stuff.

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 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, 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      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.

Syndicate content