So far, the “service machine” in my house was Power G5 running Ubuntu. 24*7. The main functions (beside being a desktop) was http proxying (squid + dansguardian) and X10 service (heyu).
Trying to save on my energy bills, and to make something useful of nice green OLPC laptop, I’ve decided to move these services to OLPC – that way, I could afford shutting down the Mac, at least sometimes (it just eats the energy).
So, yesterday I “yum install”ed dansguardian and tinyproxy (instead of squid) – and tried to make a transparent proxy of it. Unfortunately, the transparent proxying is disabled in Fedora’s build of the tinyproxy. So, I had to rebuild it. It was some kind of a challenge – the only machines I got was Mac (Power G5, as I said) and another laptop (Ubuntu x86_64). How would you build 32-bit x86 app in that world? Immediately I found that 64-bit Ubuntu cannot build 32-bit apps. At least I could not find the way. Well, “gcc -m32″ works somehow – but some headers (like stub-32.h) and gcc libs and obj files are missing. Installing ia32-libs does not help (and they do not provide -dev package). But I was really lucky to have … some wreckage of (!!!) Maemo SDK (which I did not manage to enable under 64-bit OS BTW). Which includes, among other things, 32-bit gcc with all the necessary stuff. So … chrooting to that environment allowed me to build tinyproxy binary with transparent proxying support (even though I had to patch it a bit – there is an issue with binding). Now, this all is up and running.
Next thing would be to build heyu utility for x86 – I am going to do it the same way, using Maemo SDK. My X10 will be hosted on OLPC as well.
So, a bit of numbers. It is claimed that OLPC consumes about 3W of energy. According to Apple, Power G5 uses 140W (idle) to 604W (fully loaded). Actually, Ubuntu can not control CPU speed (constantly shows 2.0GHz) – so I guess even idle, my Mac eats around 200W. I do not even mention the 24″ monitor…
I want to make proxy work faster, so I guess I’ll get some cheap USB Ethernet adapter – in order not to use humble wireless abilities of OLPC. Recommendations are welcome.
If you participated in G1G1 program last year (or thinking about doing it this year) – you can do something similar with that nice little piece of hardware. It is much more than just a sexy toy.