I’ve just come across a rather scary, and worryingly old launchpad bug, which talks about real hardware damage. There is more on the problem here. But basically, by default, Linux is far too optimistic with spinning laptop hard drives down, and you can reach number of spin-up/downs that your drive is rated for over it’s entire life-time, in a few months.
My laptop (3 months old), is already at 160000 Load/Unloads: Around half it’s rated life.
The easy solution is
Or, the following in /etc/hdparm.conf
Lets hope that this gets resolved soon, or the problem isn’t as bad as it appears.
I see that Matthew Garrett (the Ubuntu Laptop Tzar) is subscribed to this bug, but doesn’t seem to have commented on it. I find that a little odd, considering its seriousness.
I was lucky enough to win a Nokia N800 at LugRadio Live 2007, because I’d come from South Africa. I’ve had it for 3 months now, and the successor was announced last week, so I think it’s time to blog about it, properly.
The hardware is pretty decent. The screen is very bright and vivid (great for photos), and just big enough to read websites comfortably. There are enough buttons to fulfil the basic tasks without reaching for the stylus, but you generally work it with the stylus (or a finger). It has quite a few hardware features:
The battery life is comperable to my cellphone (about a week of non-use, or a day or two of use), and I’m happy with most of the hardware, but I do have a few issues:
The power button isn’t sufficiently recessed for it’s soft carrying case. This means that I can’t carry it off in my bag, it’ll turn itself on eventually, and run it’s battery flat from spurious touch-screen clicks. The solution is to always leave it on, and screen-locked (it supports an auto-lock). For a cellphone manufacturer, I’d have thought they’d get this right.
The webcam’s position at the far left means it gets a good view of the left side of your face. This can be a little disconcerting.
The USB port is (without some serious hackery) only in peripheral mode. I’d really like to be able to plug a USB keyboard into this device (bluetooth keyboards are way too expensive).
There’s a bottleneck in the system (processor presumably), that stops it playing youtube videos at full framerate. Mplayer seems to just be able to handle QVGA video at 24fps, but nothing more.
The software stack of the N800 is everything I could desire. It runs a Debian derivative of Linux, Maemo. Maemo uses proper Debian package management, the GTK widget set (with addons), Telepathy for IM, and Gstreamer for media. This makes it a doddle to port existing X applications to the N800.
When you first turn on the N800, after unboxing (or reflashing), you go through an install wizard. It sets the hostname, timezone, and pairs with your bluetooth cellphone. The bluetooth phone pairing is well thought out, and beats anything I’ve ever come across on any platform. Unfortunately it suffers from the same problem as Windows - it doesn’t set your Home Town, etc. based on the time-zone.
The default web browser is Opera-based, but a Gecko engine is available, and a WebKit one remoured to be on the way. It has a (proprietary) flash plugin, so you can watch YouTube, and the CACert.org root certificate is pre-installed :-)
The device has 4 input modes:
I find the input fine, although slow, for everything except passwords. Multi-case, symbol-laden passwords really bring out the worst of all the input systems.
The default software selection is passable, but not great. The device really ships with “internet tablet” software, with a few decent games thrown in. The major problems are the media player doesn’t play oggs or video, and the e-Mail program’s IMAP support, which is a joke, at best (It uses IMAP as if it was POP).
But I enabled a few extra repositories and soon my N800 became a really cool device:
My repositories:
http://catalogue.tableteer.nokia.com/certified/ bora user
http://catalogue.tableteer.nokia.com/non-certified/ bora user
http://repository.maemo.org/ bora free non-free
http://repository.maemo.org/extras/ bora free non-free
http://www.claws-mail.org/maemo/ bora user
http://maemo-hackers.org/apt bora main
It’s a cool device for a geek to own, no doubt, but what’s the actual point of it?
I can answer that in a few ways:
But in the end, all that matters is that it runs Linux , and has Python dammit, so it’s a piece of cake to write any software for it that I want to. I think that reason on it’s own makes it a device worth owning.
I’ve just implemented shared mailboxes in dovecot (which rocks, btw). It isn’t difficult, but I don’t think it’s very well documented…
The preferred way to do this is with IMAP Namespaces. My natural approach would be to create something like a Maildir tree /srv/mail/shared
, and make this the “public” namespace. Then set filesystem permissions on subtrees of that, to define who can see what. Unfortunately, dovecot uses strict Maildir++, and won’t let you create mailboxes inside each other (on the filesystem) /Foo/Bar
is stored as a Maildir called .Foo.Bar
, so subtrees don’t exist, so this isn’t an option. The up-comming dbox format should allow something like this, but it isn’t usable yet.
My solution was to create multiple namespaces. One for each shared mailbox. Users are given permission to use them via file-system permissions (i.e. group membership), example:
Setting CONTROL
and INDEX
mean that dovecot’s metadata is stored in the user’s personal Maildir, so users who don’t have permission to see the shared mailbox don’t get errors.
The permissions of the mailbox should be done as follows:
If you want a common subscription list, you have to manually symlink:
Seems to work well. (at least with thunderbird)
Finally, it’s got easy to install the codecs we can legally use in this country:
Medibuntu now has a non-free-codecs
package, an all-in-one virtual package.
Nice job!
Personally, I’m still in favour having them there by default, and the installer removes them if you select a patent-encumbered country as your time-zone, but I can see why people are wary of that approach….
Update: Debian/Ubuntu version
I've finally jumped onto the local only DSL bandwagon. If you haven't done it yet, it's a great way to save some bucks. The idea is that you get a local only account like this, which costs a fraction per GiB compared to normal account. Then you get your router to connect to both simultaneously, and route intelligently between them.
Most ADSL routers won't let you connect 2 concurrent ADSL connections on the same ATM circuit. The solution is to use a separate modem and router. I'm using a basic Billion modem, in bridged mode, and a WRT54GL, running OpenWRT/kamikaze, as the router.
OpenWRT doesn't support 2 PPPoE connections out of the box, but I've found the problems, and got a few changes committed upstream, that solve them:
The firewall (/etc/init.d/firewall
) needs to be modified with "WAN=ppp+" somewhere near the top, so that it masquerades all the ppp connections. This was a hack, apparently the firewall is being re-written soon.
There is also a bug that resets existing PPPoE connections on a ethernet interface when you fire up a new connection. This will apparently be fixed by the future interface aliasing support. For now, I just hacked around it in /lib/network/config.sh
:
and /sbin/ifdown
:
I got my local routes list from cocooncrash's site (he gets them from local-route-server.is.co.za
, aggregates them, and publishes every 6 hours). OpenWRT already has a static routing configuration system, but it's very verbose. So I wrote my own, adding the new configuration option routefile
. I used these hotplug scripts to set up routing and source routing, with the help of iproute2:
You'll probably want to update that route file regularly. I don't run cron on my WRT54GL, so I do it manually. Up to you.
/etc/config/network
:
/etc/iproute2/rt_tables
:
/etc/hotplug.d/iface/20-split-routes
:
/etc/hotplug.d/net/20-split-routes
:
Now, lastly, it won't bring up both interfaces by default. That will be fixed by aliasing in the future, but for now:
/etc/init.d/network-multiwan
:
That's it, and it's working beautifully :-)
What is source routing, people ask? The problem is that your router now has 2 WAN IP addresses. IP1 is used for local traffic, and IP2 for international. So if somebody in ZA tries to connect to IP2, the reply (local destination) will go out of Interface 1. The ISP on the other end of Interface 1 will drop this reply, because it's not coming from IP1.
Source routing tells the router that replies must go out of the same interface that the request came in on. I'm doing it by creating separate routing tables for traffic origionating from each WAN interface.