To upgrade or not to upgrade?

I have updated a couple of my Ubuntu 8.10 (Intrepid) installations to Ubuntu 9.04 (Jaunty) but not yet my primary laptop. I was about to do that tonight (isn’t starting something at 22:00 a grea idea?) but the upgrade procedure showed me the message below, making me postpone the upgrade and write this blog post instead:

This computer is currently using the AMD ‘fglrx’ graphics driver. No version of this driver is available that works with your hardware in Ubuntu 9.04.

My graphics card (three years old by now) is described by lspci as an ATI Technologies Inc M56GL [Mobility FireGL V5200] and apparently these are no longer supported by the properitary fglrx driver. The Open Source radeon driver is rumoured to be pretty good these days but “never change something that works” is pretty useful on laptop where for example Suspend should work.

Speaking of the graphics card, dual-head with my LG L1510SF touch screen monitor works, but the touch stuff needs some tweaking and I’ll get back to that in another blog post.

SourceForge replaces part of its platform with hosted applications

As project administrator for a couple of SourceForge projects I recently received an e-mail about the upcoming deprecation of multiple applications that are part of the SourceForge platform:

The following applications are due to be deprecated, replaced by
high-quality Open Source applications we have in our Hosted Apps offering:

  • TaskManager will be replaced by TaskFreak!, dotProject and Trac (tickets).
  • DocManager will be replaced by MediaWiki and Trac (wiki).
  • Discussion Forums will be replaced by phpBB.
  • Diary and Notes will be replaced by WordPress.

Touch screen monitor arriving this week

Last summer I outlined the components needed to build a kitchen computer but I never created one. (If you know Swedish you can read my blog post Köksdator?) One of my requirements was a touch screen interface.

Right now an LG L1510SF touch screen monitor is in the mail, heading my way! I actually have two uses for it now, because except for building a kitchen computer I plan to put UltraMixer on the touch screen when I will pretend to be a selector (reggae/dancehall disc jockey) next weekend.

The touch screen functionality is supposed to work properly with the evtouch driver and before next weekend I hope to get the touch screen working as a secondary monitor connected to my laptop.

I will use an old Mini-ITX box to create a prototype of the kitchen computer in order to get a better grasp on the toughest issue: how to make it pass the wife acceptance test.

The kitchen computer will probably mostly run Ubuntu with a web browser for easy access to:

  • Current date and time
  • Weather forecast
  • Train status
  • Calendar

Hopefully I can take some time to evaluate Ubuntu Mobile and see if it is a suitable interface for this purpose.

For a proper implementation I have thought of using a an ALIX-based system (just like for my firewall). It would be really small but probably pretty slow. I’m now thinking of using an Asus Eee Box. It is small, pretty quiet, and has built-in WLAN. I might also get use for its VESA mount feature. The Eee Box would require an DVI to VGA adapter though. Some Eee Box version seem to include a remote control and that could be useful too!

Even with a touch screen a keyboard and a mouse will be needed for some purposes. They should of course be wireless.

So why not get an EeeTop right away as a kitchen computer? Truth to be told, if I knew about it previously I had forgotten when I ordered the touch screen! Maybe it is perfect for UltraMixer too? And maybe it would pass the wife acceptance test with ease? I will probably never know.

The C++ cut is the deepest

When you hear me speaking about C++,  you probably notice the passion. I might expose a similar passion when I pinpoint some of Java’s weaknesses. Maybe I do sound like “Dick” in the article Java is Slow! at The Daily WTF?

From GW-BASIC on my first computer I went through QBasic, QuickBasic, QuickC and Turbo C++ until “reaching” Visual C++ in high school. It is more than 10 years since I wrote CalcEm, the first Open Source emulator for Texas Instruments calculators TI-82 and TI-83. It is hopelessly outdated now, but it was a great achievement for me at the time. (I’m actually sitll proud; the last CalcEm version is ranked as 102 on the all-time top downloads list at ticalc.org with 43556 downloads.)

Maybe C++ entered at a sensitive point of my life? When learning Java at the university it only felt crippled when I already knew C++, so I only used Java when I had to and C++ (as in g++) when I got to choose. Sometimes the choice was bad, but it was about learning after all. I remember that our Kalah C++ implementation ruled the competition!

C++ made me feel in control! I never felt as much in control when using Java, and I still don’t. But I’ve learned not to demand so much control.

My friends may have heard me dreaming of working at Tandberg. I don’t languish for ThoughtWorks so much these days. (They do have Martin Fowler, but they also use Lotus Notes. Go figure.)

This is why I never applied for a job at UIQ. I like C++ so much that I cold not stand the horrible subset of C++ that Symbian has inherited from Psion. Instead I got stuck with a stone-age C++ compiler on Tru64. But I got away and now I’m your Java man!

Just let me do a little PHP, Python, Ruby, Scala or Groovy too! And wouldn’t C++ be great for something? 🙂

Network printer power-on when needed

My FreeBSD server is now equipped with a TellStick for control of 433.92 Mhz wireless remote switches. Our home is not (yet 🙂 fully controlled by remote switches but we have a few of them now. One of the features I wanted was to control some lights but for some reason the TellStick in the server closet does not reach one of the remote switches so I might get an extender for that later on.

Something that seems to work very well is remote control of a 230V fan (actually an old dual-fan PSU, but it’s a temporary solution) in the server closet. The server closet is next to our bedroom so in order to get rid of some noise at night I now use the TellStick to turn off the fan at 22:00 and start it again at 8:00.

The hack that this blog post is about is meant to power-on my networked HP LaserJet 2200 on demand.  We seldom print everyday so it’s rather pointless to have the printer on all the time. I implemented this solution for fun and I’m not sure that I’m going to keep it.

I thought for a while about how to detect when any computer on the network was trying to print, and I decided to try to listen for ARP who-has requests. This is (almost) the script I use:

#!/bin/sh
/usr/sbin/tcpdump -i em0 -q -l -n arp dst host 172.16.0.96 2>/dev/null |
while read line; do
  /home/david/bin/printer.sh 1 > /dev/null 2>&1
done

As you might deduce from the script it will try to turn on the printer for every ARP request for the printer IP address. This will cause more power-on signals to be sent than necessary, but I call that a feature! 🙂

The printer.sh script looks like this:

#!/bin/sh
`dirname $0`/nexa.sh D 2 $1

And this is the nexa.sh script:

#!/bin/sh
/usr/local/bin/sudo `dirname $0`/rfcmd LIBUSB NEXA $1 $2 $3

Rfcmd is a command line tool for interfacing with the TellStick. I run it as root and I use libusb for the USB support.

A future improvement could be to turn off the printer after it’s been unused for a certain time, but now I simply call printer.sh to turn it off at midnight.

I don’t know if it is bad for the printer to cut the power but it already has a serious smear issue so I’ll only keep it until the toner runs out and then buy a new printer. Brand new networked laser printers with duplex start at €200 here in .se so it shouldn’t be too expensive to get one with good Linux support when the time comes.

Moving IMAP accounts from Courier to Google Mail

I ran imapsync on my mail server like this to move a couple of accounts away from my server:

imapsync  –syncinternaldates –host1 localhost –user1 user –password1 secret  –host2 imap.gmail.com –port2 993 –ssl2 –user2 [email protected] –password2 secret  –authmech1 LOGIN –authmech2 LOGIN –split2 100

(WordPress is a bit too clever, so — above means two hyphens. Sorry.)

Parts of the output looks weird but everything seems to work anyway. For example:

Host imap.gmail.com says it has NO CAPABILITY for AUTHENTICATE LOGIN
Success login on [imap.gmail.com] with user [[email protected]] auth [LOGIN]

Looking at Scala and Groovy

When people and companies realize what a dead end Java has gotten into, I want to be prepared for the alternatives. Java will become the dinosaur language like COBOL, but it will not be replaced by a single programming language but with a mix of languages. Several of these languages will, for many reasons, run on the JVM. As I see it, the most promising languages on the JVM today are:

  • Scala
  • Groovy
  • JRuby (Ruby implementation)
  • Jython (Python implementation)
  • Clojure

I have tried some of the LISP-ish Clojure with the aid of a colleague, but it is too esoteric for me. Python and Ruby are nice but “only” new implementations of existing languages. Groovy code can be pretty similar to Java, but it is more “dynamic” and it has closures! (Thanks to the appropriate deity here!)

Scala is described as a “general-purpose, object-oriented, functional language for the JVM”. The hybrid of object-orientation and functional programming is likely to be an advantage for Scala as it is possible for people with little experience with functional programming (like me) to approach it little by little.

In order to give Groovy and Scala a closer look I’ve bought Programming Groovy, by Venkat Subramaniam, and Programming in Scala by Martin Odersky, Lex Spoon, and Bill Venners. The latter book comes from Artima, who also provide Scala articles such as Twitter on Scala, How Scala Changed My Programming Style and The Origins of Scala.

A few months ago I wrote a Groovy script that copied bug reports from Trac to Mantis, using Groovy XMLPC to connect to the Trac XML-RPC Plugin and GroovyWS to connect to the SOAP interface for Mantis. The implementation is a topic for a future blog and the code is a bit crappy as it was both a learning experience and a throwaway tool.

Hopefully some small project will turn up so I can try out Scala soon.