Goodbye Ubuntu, Hello Debian

Friday 19 June 2009

I bought a MicroClient Senior for my son to use as a desktop machine.  Nothing really fancy: just enough to read his e-mail, browse the web, play some games, edit files with OpenOffice, listen to music or watch movies.  The best part of it is that he can leave the machine on forever as it uses even less energy than the light on his desk.

In order to make things easy for him to use, I initially chose to go with Ubuntu (Intrepid) and go straight to the default Gnome desktop to avoid as many hassles as possible. Took me a while to put things together as it initially came without network, sound or video. Welcome back to 1995!

Wi-Fi: the dongle is claimed by a driver (rtl8187) that handles things great (with WPA encryption) for about 5 minutes and then crashes without warning. ndiswrapper does a fine job but you need to install the very latest version and locate the correct Windows drivers. Total: a couple of evenings spent trying to get the native driver to work, then another hour to locate a decent Windows driver.

Sound: Not correctly handled by ALSA, you need to download OSS directly from the 4-Front web site and then perform a global re-configuration of all sound-needing apps. Total: one evening spent tweaking ALSA in vain, followed by OSS download/install.

Video: the OpenChrome driver is not activated by default and the screen resolution is set to something weird. You need to hunt for a correct xorg.conf and tweak it to your needs. Total: one evening spent trying various openchrome drivers (including manually compiling stuff) and xorg.conf files.

Once I had everything stabilized and running, I still had to do some maintenance every now and then, in general whenever a newer kernel version is installed.

Last week I decided to upgrade the OS to Ubuntu Jaunty and it turned out to be a disaster. After the upgrade reported having performed successfully, the machine woke up again with no sound, no video and no network. No matter how I tweaked the options and configuration files, it remained in an unstable state, unable to even get to an ‘apt-get update’ because of the lack of network support. I finally gave up after spending two more evenings trying to get the situation back in control, and finished by installing a new Debian (Lenny) from scratch.

Now the machine is back on its feet. It showed the same symptoms as usual (no network, sound or video) but this time I applied the usual fixes and everything was back to normal in no time. Funnily enough, the rtl8187 driver worked perfectly fine until the first kernel update, after which it went back to an Ubuntu-like behaviour: 5 mins of network then crash.  ndiswrapper saves the day again. Not saying Ubuntu is bad but every time they break something and I have to find new ways of bringing it back to life. Debian is also buggy but at least it is easily corrected.

It is now the third machine from which I had to delete Ubuntu because it just did not work. The other ones were a Dell laptop (almost no hardware worked) and an AMD-64 desktop.


Bugs? What bugs?

Friday 22 August 2008

The following story happened to me some years ago in a company I will not disclose to protect the innocent.

I was part of a group of users and we had been given a budget to spend on computer-related issues like getting new laptops, RAM or extra software. The group would meet every 3 months to discuss how to spend the budget. During one of these meetings, the guy in charge asked around:
“So all accounted for, we have about a thousand left. Any other ideas for potential purchases?”
A girl raised her hand and said:

“Yes. I happen to be programming a lot in Fortran and I am having a hell of a time debugging because there we have no decent Fortran debugger available here. There is one available though, and it would cost about a thousand. Would that be something you would be willing to purchase?”

To which the guy promptly answered:
“Debugger? To remove bugs?”
“Well… yes.”
“No way. The easiest way is to do just like I do. Do not put bugs in your programs, that’s all.”

A long silence followed, glances were exchanged across the room and nobody knew if he was kidding us.

Apparently not, because he decided to close the session and waved off the Fortran debugger request with a sigh.

We later laughed our asses off about that one. Maybe we should have sent the guy around the world to teach how to make software that never has bugs, planes and cars that do not crash, food that is always tasty, you name it.

The story has more depth than this, though. One of the main principles in engineering is to steer away from all possible problems and defects when you design a system. So yes, putting less bugs in your software is definitely a trick of the trade. The only point he missed was that bug-free software simply does not exist, neither do crash-free planes or eternally tasty food. Go get a debugger.


Tomato vs OpenWRT

Monday 9 June 2008

If you really are into home computing, you probably have one or more WRT54G-type routers hanging around, taking care of your home network. These tiny jewels do everything a Cisco router does and more for a fraction of the price. Interestingly, the company who initially produced these poor man’s Cisco boxes (Linksys) was later bought by Cisco. A better description can be found on e.g. Wikipedia: Wikipedia page about WRT54G

The key selling point for these boxes is that you can upgrade the native firmware to alternative versions produced by a vibrant community of Linux users. I tried several firmware versions: DD-WRT, HyperWRT, OpenWRT and finally Tomato. While DD-WRT and HyperWRT concentrate on providing a better firmware than the one initially distributed on the box, I found they tend to only touch on the surface of what can be achieved.

Out of all alternative firmwares, OpenWRT really stands out as the geek-favoured one. This firmware is actually a tiny Debian-like Linux distribution provided with a complete development environment, allowing you to port existing software or even program your own if you feel so inclined. It is pretty easy to run a Web server, a print server, mount external storage through sshfs or handle syslogs from all machines on the local network.

I run two of these boxes, one on each side of my house, distributing a WiFi signal everywhere I might want to connect something wirelessly. One box is the main router attached to my ISP’s Internet box, the other one is enslaved by WDS. Each of these has been used as host for various kinds of services in the past, mostly as toy servers for me to learn more about firewall rules, VLAN configurations, WiFi hotspot setting and related security issues. I have played with OpenWRT for a while, compiling all sorts of stuff and installing tons of new software at regular intervals. A great time-eater but the trip was worthwhile, I learned quite a few things about Linux networking by doing so.

Today these boxes have been obsoleted on my home network by MicroClient units. These tiny Linux boxes are much easier to program: they behave like regular PCs, run Debian directly and do not need specific porting skills or compilation environment. And they have their own hard disks or Compact Flash memory, in addition to USB support!

End of the road for WRT54G? Not at all. ‘Tomato’ was recommended to me as yet another alternative firmware and since I tried it I cannot get back to OpenWRT. Where the latter is rich in potential, Tomato is rich in achievements. If you want to setup a basic service with OpenWRT you have to skim through pages and pages of (well-written) documentation to understand all the details of what you are trying to do, then absorb all needed knowledge to configure that stuff, and then several full evenings of experimentation to get things straight. And even then performance might be poor or you may get into dark corners not covered by any documentation and then your only hope lies in some IRC channels. Nice but tiresome.

Tomato is the straight thing: it does not offer as many options as OpenWRT but everything it covers is user-friendly, works immediately as described, and does not need countless hours of painful experimentations. Overall network performance also seems to be better with Tomato but I did not try to benchmark the whole thing. Judging by what I have seen over the last two weeks, my bandwidth seems to have increased by 15-20% on average.

Relevant pages: