Select your site

 

F-Secure Linux weblog is proudly powered by WordPress
Entries (RSS)

Archive for April, 2007

The Other Linux Team Weblog

Thursday, April 19th, 2007

This weblog isn’t the first weblog started by Linux team. As mentioned in previous entry, our build system has had her own blog almost right from the start. Python is pretty popular programming language in our company and even though most of the build system is based on shell scripts and makefiles, there is a python script to send build announcements. Once when I had some extra time, I installed Wordpress to a virtual machine and found a python module for posting weblog entries. Then I added code to generate HTML versions of build announcements and post them to the weblog.

Now we have build history in easily navigated form. To find builds made on certain month or day, you can use monthly archives and calendar widget. There is also search box that lets you find builds based on any information contained in build announcements turned into blog entries. For example, you can enter bug tracking identifier to find out which build had fix for the bug or just enter build number to find out when build was made and what changes it has. Of course, there is also RSS feed.

Since build blog contains confidential information of products under development, it is strictly company internal blog.

Information Radiation in the Linux Team

Sunday, April 15th, 2007

LED sign

Almost exacly one year ago, a day when I was working late here in our Helsinki headquarters, I suddenly took the subway downtown to Clas Ohlson, a store for “DIY products for house and home, technology and hobbies” as they present themselves. There I picked up a LED sign and promptly carried it back to the office. The only thing I knew about it was that it was “computer controllable” somehow - the product specs at the store didn’t say exactly how you could interface with it. Turns out it comes with a Windows program which you can use to program it, and the control commands are then sent over a serial wire to the sign. I didn’t quite know why I wanted it, but I had this feeling that it could be a really neat information radiator for our team. Of course, being a Linux team, we couldn’t depend on a Windows computer to run the display, so I started to observe how the Windows program worked. I configured my VMware virtual machine to redirect the serial I/O to a regular file, and then started the bundled Windows program and used it to send messages and watched the bytes come into the file instead of being sent through the wire to the LED sign. I could then attempt to change a couple of bytes and pass it on to the actual serial port and see what happened. When I entered the string “Text message entered” into the Windows application, what it sent down the serial wire was:

<ID00><L1><PA><FE><MA><WC><FE>Text message entered4B<E>

You eagle-eyed people have no doubt already spotted the last two characters appended to the string I wrote - 4B - and figured out that it’s a simple checksum of some sorts. So I went on sending some more messages to try to make some sense out of how that checksum was calculated.

The string “A” gave 35, while “AA” gave 74. “AAA” -> 35 again. Now we’re spotting a pattern. Around this time my colleague Juha had started peering over my shoulder and joined in on the thinking. He soon figured out that it was a simple XOR of the ASCII values of each character in the string, but with a starting value of 0×74. Later we would also learn the meaning of some, but not all, of the different command tags seen in the message packets too - for example, the device has several “memory pages” where you can store different messages in each page and then use a command to switch between pages. I wrote a small Perl script to construct the basic variant of these messages; something along this way:

sub toled {
    my $page = shift;
    my $str = shift;

    # calculate checksum
    my $checksum = 0x74;
    for (0..length($str)-1) {
        my $c = ord(substr($str,$_));
        $checksum = $checksum ^ $c;
    }
    # construct basic "display this on page $page" message
    my $ledcode = sprintf("<ID00><L1><P%s><FE><MA><WC><FE>%s%02X<E>",
                          uc($page), $str, $checksum);
    # send to serial device /dev/ttyS0
    open SERIAL, ">/dev/ttyS0";
    print SERIAL $ledcode;
    close SERIAL;
}

And suddenly I could control our gadget from Perl, which of course was awesome. This spawned a flurry of activity, and soon enough I had written a simple RSS parser that could feed titles from an RSS feed to the LED sign. We have an internal blog with announcements from our automatic build system, so I hooked my Perl script to our “build blog”’s RSS feed and voilà - the LED sign now served a useful purpose of always displaying the latest build information, including letting us now if any of the build had failed.

The next few days we scrambled to find a place to hang it where it would be visible not just to us but also to people walking by our team room, and a computer that could run it more or less permanently. We had an old 100 MHz Pentium II laptop that did an excellent job of running our little LED sign control script silently and surprisingly reliably, running a minimal Slackware installation. As an extra perk, we connected external loudspeakers to the laptop, and I modified the script to play a sound sample each time the word “failed” was mentioned by the LED sign. This results in a crashing sound being played whenever any of our continuous builds fail, immediately bringing it to the team’s attention.

Of course, I couldn’t stop there. I wanted to build generic interfaces so that the other people in the team could send their own messages the LED sign. I started out with an IRC interface - I made the script into a simplistic IRC bot that could receive commands from our internal IRC network. In the process, I also made it send all messages it displayed to its own IRC channel, so that people that didn’t have the sign in clear view could see the messages on IRC instead. Furthermore, I created a “drop directory” on an NFS server where people could drop files that would be read by the script and displayed. Now, one year later, quite many parts of our development and testing environment hooks into this little script: we get notification of tests currently in progress, test results, when builds are started and completed (or failed), test system load and so on.

In conclusion, while it may not be the end-all-be-all information radiator equipment - only being able to display some 250 characters per message being just one of many limiting factors here - this has anyway been one of the most fun applications of “information radiation” that I’ve seen. :-)

Suspending a laptop with running virtual machines

Friday, April 13th, 2007

All of us have both desktops and laptops and we run VMware. Some of us have noticed that a laptop can be suspended and woken up with no ill effects to running virtual machines. Some of us see various problems in virtual machines after emerging from suspend.

VMware has in it’s Help menu a command called Tip of the day. One of the tips says:

On a laptop computer, suspend the virtual machine before you suspend or hibernate the host computer

VMware’s manual and Google have nothing else to add. Does anyone else have any further information on the problem?

Also, wouldn’t it be nice if VMware would automatically suspend running virtual machines when the host is suspended?

Virus Bulletin VB100 Comparative Review April

Friday, April 13th, 2007

VB100 April logo

Today I was told that our main product Linux Server Security achieved the VB100 award, with “superb detection rates” and “a more professional feel than many, with some serious and thorough documentation”. That’s some warming words indeed. Sweet! Given the thorough scanning tests we put our products through every day (on tens of different Linux platforms), this is more of a reassuring confirmation that our testing is sound. Still, getting a neat little badge to display on the blog is always fun. :-)

F-Secure Linux weblog is proudly powered by WordPress
Entries (RSS)