Linuxy

I’ve been trying out a few new Linux features lately. First, kernel 2.6.20 is shipping with kvm which includes support for the new virtualization instructions on recent processors. This is great because I can use the kvm-modified version of qemu to boot other Linux or Windows XP images while in Linux. Emulating Linux is nice for debugging those kernel bugs that lockup the box, while Windows could theoretically be useful for reverse engineering drivers. Qemu also sets up a NAT transparently so you can easily use the network once you’re in the guest OS. No news to anyone that’s used vmware, but this is free, and a heckuva lot faster than all-software emulation. Pictured is my little XP-under-Linux test:

Also, I’m playing with Xgl a bit. This is the X server that’s built on top of OpenGL, providing window managers the ability to add eye candy to mundane things like dragging windows around. My laptop JustWorked with the builtin i945 graphics chip, which is interesting because glx still claims to be using the software renderer. Coupled with beryl, all of your virtual desktops get mapped to faces of a cube, so when you Ctrl-Alt-(left/right/mouse) you can rotate the cube to find the appropriate workspace. The window manager has active corners like OSX which default to exposé-like features. When you drag around windows under this thing, they have a cute little warping animation, and when you bring something to the front, the other windows become transparent. It’s still a little buggy and I’m not sure that I won’t find the eye-candy ridiculously annoying at some point, but for now it’s a cool toy. A screenshot wouldn’t do it justice, so visit youtube for demos of it by unaccountably shirtless dudes.

keelhaul handlin’ of OEM flags

Most of the pirate stuff annoys the heck out of me on talk like a pirate day (that was yesterday by the way, yarr and so forth). But Linus’ kernel announcement yesterday was priceless, though he could stand to work on his piratese.

My next kernel contribution should ship with 2.6.19, w00t.

Bug

Philly didn’t happen, again because of rain. I saw on their website that the game went on anyway. Bah.

My ubuntu install is doing a bit better after a week of various customizations. Now the Fn key and all of the special laptop keys do things (more than I ever had working on my Dell), and tap-to-click is going on the touchpad. I’m still having a strange problem with HAL, however, and negotiating its maze of XML config files isn’t the best. While looking for help, I saw this: Ubuntu bug #1. Silly, but I like the feedback, especially the “it’s a feature!” post.

procced mail

I’ve been meaning to do something about my spam situation, which rather sucks at the moment. Now that my email address appears occasionally on the linux kernel mailing list and elsewhere, I’ve not suprisingly got a signal-to-noise ratio of something like 200:1. I’ve had spam assassin in the loop for a while, but the Bayesian analysis always invokes the OOM killer on my memory poor firewall so it’s not running with full effectiveness. Thus I took a little time out to add a whitelist to the front end to make things go better: if you’re in the whitelist, it skips all the filters. Meanwhile SA will get the threshold cranked up to consider practically everything spam, and I’ll be more likely to insert one-off regexps that trash certain spams that I get over and over again.


To make the whitelist, I went to my existing mail folders (in mbox format, of course). This was easy enough:

#! /bin/sh

for i in `/bin/ls | grep -v junk`; do
formail -s formail -zx "From: " -zx "To: " < $i |
sed -e "s/^.*<(.*)>.*$/1/g" >> whitelist.uns
done
cat whitelist.uns | sort | uniq > whitelist
rm whitelist.uns

Then, it took a while to figure out how to make the proper procmail recipe to use it, but I eventually came up with this:

MAILDIR=Mail
FGREP=/bin/fgrep

:0:
* !^List-Id:.*
* ? formail -zx "From:" | ${FGREP} -F -v -i -w -f whitelist
{
:0fw
* <100000
| spamassassin 

:0:
* ^X-Spam-Status: Yes
junk

:0:
* ^Subject:.*Corel Draw.*
junk

:0:
* ^Subject: *[^ ]* new(s)?$
junk

:0D:
* ^Subject:.*(O|0)EM *
junk

:0D:
* ^Subject:.*[A-Z]+[a-z][a-z][a-z][A-Z]+
junk
}

:0Ecf
| formail -A"X-Whitelist-Passed: OK"

# kill html email
:0
* ^Content-type: text/html
{
:0bfw
| (echo "[html stripped]"; lynx -dump -force_html -stdin)

:0ahfw
| formail -i"Content-type: text/plain"
}

Geekery

What do you do when your college plays at 2pm and you are stuck at work with no TV around? You write a CGI to grab screenshots from your TV so you can watch it on a webpage, of course.

#! /bin/sh
echo Content-type: image/jpeg
echo

mplayer -frames 1 -vo jpeg -nosound /dev/video >/dev/null 2>&1
cat 00000001.jpg