Ubuntu 9.10 on Pentium MMX 233MHz (very old PC!)

February 15th, 2010

Among the old computers that end up on my desk is a Pentium MMX 233MHz PC from … I don’t know, the dawn of time, probably. It can’t have been made any later than late 1990s. I use it for testing code behaviour on low-resource systems. It did have Slackware on it, but I found some old PC133 SDRAM and bumped up the memory from 32MB to nearly 400MB (256 + 128 + 8MB) – just to see how Ubuntu (actually Xubuntu – it was what was on the 20GB HDD I had lying around spare) would run on it.

Xubuntu 9.10 on Pentium MMX 233MHz 392MB RAM

Xubuntu 9.10 on Pentium MMX 233MHz 392MB RAM - processor info is at bottom right!

One other thing that I shouldn’t forget, as I had this problem when the old PC was first donated to me, was that it was so old it only had one of those enormous DIN keyboard sockets, for which I don’t have a matching keyboard. Fortunately the motherboard had onboard USB, and the PC shops around where I live are full of great old junk, so it was no problem to find a 2-socket USB plate for the back of the PC. I remember I had to swap the pins around on the USB plate cable to match the motherboard. Tinkerbell would have been proud of me!

If you’re going to attempt a repeat of this, make sure you have plenty of spare time. I gave up trying to install from the CD-ROM (the BIOS was too old for a USB install). It seemed a few other people had similar problems with extremely slow progress, and lots of errors to do with reading from the CD. The one time I managed to actually get as far as Ubiquity, I could see ‘kerneloops’ popping up in the ‘top’ output in a virtual terminal. I think if I had to do this again, I would put the HDD in a faster PC, run the installer there, and then put it back into the old PC. For this job, I updated the Xubuntu install on an old HDD from 9.04 to 9.10 (Intrepid Ibex to Karmic Koala) on the old PC. Downloading the files was no problem, as I use a Squid proxy cache on my home network, but applying the update took hours!

One thing that did catch me out was the old SiS530/620 video adapter. It started in an 832×624 mode, which my monitor displayed slightly off-screen. Looking at /var/log/Xorg.0.log, I could see that Xorg didn’t try higher resolutions because of “insufficient memory”. According to Xorg, the video memory was only 2MB. Going back to the PC’s BIOS, shared memory for video was disabled, so I bumped it up to the maximum offered – 8MB (wow!) – and on reboot I had resolutions available up to 1152×864.

This old PC is exceedingly slow, if you’re used to something more modern (or even a much older operating system on the same kit!). Time to open Firefox is about 1 minute, 10 seconds, open the ‘About Firefox’ dialog is about 8 seconds. Time to open the ‘Settings’ sub-menu from the Applications menu is about 5 seconds (longer the first time). Every little action requires you to wait a while. If you’re a fan of ‘time-to-boot-up’, I forgot to check while it still had keyboard and monitor on it. It takes almost exactly 2 minutes to respond to pings after power-up (it has a wireless network card in it), and I can login via ssh almost as soon as it does.

Video and sound, while the up-to-date Ubuntu distro has plenty of support and does attempt to play media, just doesn’t seem to work on the old MMX hardware. Even sounds played alone were too badly broken up for listening comfort. Surfing websites – which didn’t have too much Flash or javascript on them – worked really quite well. Wikipedia and a few news sites I regularly visited were fine, as was Google search.

If you really wanted to repeat this with your own Pentium MMX, bear in mind that 400MB was a mind-bogglingly large amount of memory to put in PC back in the Pentium MMX days. If you have a ‘lucky’ old PC somewhere, it probably only has a tiny amount of memory in it. If that’s the case, give up (or try a distro specially for old PCs, such as Puppy Linux). Xubuntu on this PC was using over 200MB before starting any applications. It didn’t use swap at all while I was trying various things out, thanks to the old SDRAM I found in my old components treasure-trove. I think if it had started swapping, the minutes-long waits for applications to start or switch would have turned into hours!

It’d be interesting (for me, anyway) to put this PC head-to-head with the next generation of Pentium – the Pentium III. A couple of times while I was wrestling with the CD install, I saw messages referring to video drivers that required SSE in the CPU, a feature first available in Pentium IIIs.

It’s kind of nice that a modern operating system like Ubuntu will still start up and run reasonable well on such elderly hardware. I’ll never use the desktop on this PC after this article – I’ll remove it in a few days’ time and use the PC as a low-resource server again. Maybe I’ll road-test Laughing Lemon on it when it comes out in April.

Looking for a free online currency exchange rate service

February 9th, 2010

There are plenty of webpages where you can get foreign exchange rate information, like XE.com and OANDA, but those are heavyweight pages intended for human use. Those same sites offer real-time exchange rate data, but for fairly hefty charges. What I wanted was a simple feed with just the bare minimum of information to update my e-commerce application’s internal exchange rates. The application itself is not forex dealing, so it doesn’t require up-to-the-minute rates, daily would be good enough.

Xurrency.com

Xurrency.com

The first site I found that actually looked like they were trying to provide what I wanted was Xurrency.com. They have an API for programmers who use SOAP in their applications (not me, I’m a SOAP-dodger!). They also provide an RSS feed (although they use the wrong Content-Type in their headers – it’s served as text/html when it should be application/rss+xml) for specific exchange rate queries. This was almost what I wanted, but still looked a little bit ‘overweight’ – and Xurrency only provide free access for non-commercial use.

ECB

European Central Bank

After a little more searching I found that the European Central Bank (ECB) provide daily exchange rates against the Euro from their website. The updates are in several different formats and historical rates are also available. This is perfect for my needs. One small wrinkle is that their simplest format is published as a zipped CSV (Comma-Separated Values) file. I wonder why they do that, as their separator is not a comma (as per the RFC4180 standard), it’s a comma-space pair. The file is only slightly shorter zipped (448 bytes zipped against 465 unzipped), when it would be much shorter if they just omitted the spaces – only 397 bytes. They could save bandwidth and possibly the lives of several ponies worldwide if all the systems that downloaded the file did not have to unzip it.

I’ve written some preliminary code for handling currencies and exchange rates, I’ll try to get a demo online later. The preliminary code is online at spider.my on its Currency Conversion page. There’s also an example of what I’d originally hoped to find: a bare-bones plain-text exchange rate service. Here, for example, is the UK Pounds Sterling (GBP) – US Dollar (USD) rate. The ‘filename’ part of the URL specifies the pair of currencies. The response contains only the raw text that is the exchange rate.

Update 9th February 2010: ECB’s server sends the CSV rates file with a Last-Modified header – which is great – but I’m currently falling foul of caching. I dimly remember something in the HTTP standard which says User-Agents may serve content from their own cache if they ‘expect’ it to have not yet expired. That’s not the clearest explanation of a heuristic ever! If I understand it correctly, my User-Agent may not be fetching this afternoon’s rates if it cached (Last-Modified) yesterday’s rates in a testing session only a few minutes ago: it would consider them ‘fresh’ for a few hours.

My application has built-in safeguards against too-frequent requests from ECB’s server, so I added the “Pragma: no-cache” header line to the request for the rates file. That seems to defeat any local User-Agent’s ‘freshness’ heuristics nicely.

Added ‘Animals’ flashcards to wossis.com

February 1st, 2010
Animals flashcards

Animals flashcards

‘Animals’ is currently a very short flashcard set. The issue of image copyright is bothering me. I used WikiMedia Commons for the images in these flashcards, but it required a bit of brute-force searching to find images that were totally unencumbered by copyright. Most of the images in WikiMedia Commons seems to be under one of the Gnu licences or one of the Creative Commons licences. Wossis.com currently has no means of recording copyright information with the flashcard images, so I feel as though I should only use ‘totally free images’ (with one very obvious exception!).

The more I think about the copyright issue on wossis.com, the more I think ‘public domain’ is the way to go. 200×200 pixels is a fairly restrictive format for images – perhaps contributors to wossis.com will be happy to ‘let go’ of such small images? I must get round to making a page on wossis.com that clarifies the copyright position of images uploaded for cards. One day!

Enjoy the animals!

Added Atom Feed to wossis.com

January 28th, 2010
Feed Icon for Atom/RSS etc

Feed Icon for Atom/RSS etc

It required a bit more work than I was expecting, but wossis.com now has a shiny new Atom feed for updated cardsets. Atom is a format and protocol for providing news (the ‘feed’) about a website. You may have seen the little orange ‘ping’ icon on nearly every blog or news site you’ve ever visited. That’s an Atom or RSS feed.

I’m not going to include the little icon in any of the pages at wossis.com just yet. You can make a feed available from a webpage so that a sufficiently magical browser can discover it itself, and make its presence know to you. All you need to do is to include a link element like this one (taken from wossis.com’s homepage):

<link rel="alternate" type="application/atom+xml" title="Wossis.com CardSet updates" href="/atom.xml?feed=cardset">

and your browser will let you know in its own special way that a feed is available from the site.

Feed Icon in the Firefox URL bar

Feed Icon in the Firefox URL bar

Now when you click on the icon you should be offered the opportunity to ‘subscribe’. Don’t worry – Site Feeds are free (usually)! Subscribing to the feed usually means that you’ll have an easy way of keeping up to date with changes on the site you’re subscribing to. If you subscribe to the cardset updates feed from wossis.com, you’ll be able to see which are the most recently created and updated cardsets. In Firefox you get this neat popup menu:

Live Bookmark Feed menu in Firefox

Live Bookmark Feed menu in Firefox

Added ‘HTTP Status Codes’ to wossis.com

January 27th, 2010
HTTP Status Codes flashcards

HTTP Status Codes flashcards

This isn’t the most exciting of flashcard sets ever! I wanted something to test a lot of work I’d done behind the scenes with Spinneret (the webserver that wossis.com is built on). It was a good test – it broke it! There was some horrendous code in Spinneret that received requests from browsers and broke them down into header fields and form data / posted files. That’s largely re-written now, and seems to be working perfectly when I uploaded the 40-card HTTP Status Codes flashcard set.

If you’re not familiar with HTTP Status Codes, they’re the very first part of the reply from a webserver when your browser makes a request. You won’t know 200 (OK), that’s what the webserver sends whenever it has what you’ve asked it for! You’ll almost certainly know 404 (Not Found) – you see that at some sites when you ask them for something it doesn’t have, perhaps because of a bad URL or the site provided a page or image once, but no longer does. Some websites occasionally break down while you’re using them, and give you a 500 (Internal Server Error).

I’m struggling to think of any more examples! A lot of status codes are invisible because they’re part of a conversation between your browser and the server that you really don’t need to know about. What status codes have you seen from websites?