Blogs

Drupal and SourceForge

SourceForge recently changed their site to put their Apache servers behind a "pool" of Nginx reverse proxies (accelerators). This is a good idea, but has negative impact on various Drupal features, like, logs, ACLs etc. I've made a small hack on my http://pysearch.sourceforg.net/ Drupal installation, like this:

--- includes/bootstrap.inc.5.10 2008-09-23 08:53:05.000000000 -0600
+++ includes/bootstrap.inc      2008-09-20 10:14:52.000000000 -0600
@@ -5,6 +5,9 @@
  * @file
  * Functions that need to be loaded on every Drupal request.
  */
+if ($_SERVER['HTTP_X_REMOTE_ADDR']) {
+    $_SERVER['REMOTE_ADDR'] = $_SERVER['HTTP_X_REMOTE_ADDR'];
+}
 
 /**
  * Indicates that the item should never be removed unless explicitly told to

Granted, this needs to be configurable, I'm thinking a general Drupal setting where we can tell which Header to use to replace REMOTE_ADDR.

rpm, yum and broken perl installation

My Fedora Core 7 box recently ended up in some state where my perl installation was seriously messed up. I'd get errors about mismatch in platform architecture, problems with sockets etc. etc. So, I really wanted to have yum reinstall all my perl packages. I couldn't find a way to do that, but I managed to achieve something similar using various commands. Here are the steps I followed:

# rpm -qa --qf '%{NAME}\n' | grep '^perl-' > /tmp/perl.pkgs
# rpm -e --justdb --nodeps perl `cat /tmp/perl.pkgs`
# mv /usr/lib/perl5 /usr/lib/perl5-
# yum install perl `cat /tmp/perl.pkgs`

PLEASE! Be careful with these commands, make sure you know what you're doing, check the /tmp/perl.pkgs file to make sure it seems reasonable etc. Once this is all done and finished, I removed the old perl5 library (perl5-).

As an alternative, you could also do something like

# rpm -q --qf '%{NAME}\n' --whatrequires perl > /tmp/perl.pkgs

but that will reinstall more packages than absolutely necessary, I think.

Emacs for OpenSolaris

I've been fiddling with OpenSolaris lately, and one obviously require package is dearly missed: Emacs. I tried to compile it myself, but couldn't get "configure" to pass, so I decided to look around for alternatives. It turns out SunFreeware has a prebuilt Emacs package, somewhat suitable for OpenSolaris. So, not knowing anything about the IPS system, I fumbled around a bit, until I figured out that the following commands added this repository (or authority I think it's called):

% pfexec pkg image-create -F -a sunfreeware.com=http://pkg.sunfreeware.com:9000 /var/sunfreeware
% pfexec pkg set-authority -O http://pkg.sunfreeware.com:9000 sunfreeware.com
% pfexec pkg refresh --full
# Now I can run
% pfexec pkg search -r emacs
% pfexec pkg install pkg://IPSFWemacs   # Copied from above search results

This version of emacs is a bit old (21.x), and it doesn't seem to work when started with an X11 window. But at least I don't have to suffer with vi any more.

Update: I made an OpenSolaris package with Emacs v22.2 for x86, which has both X11 support (emacs) and a non-X11 version (emacs-nox). The tar ball with the package is available on my FTP site. This might be a usable alternative of Emacs until the official OpenSolaris IPS adds an emacs package.

Yahoo domains ...

To my major disappointment, Yahoo just told me (less than a month before my domain is up for renewal) that they are increasing their prices for domain registration from $9.95/yr (I think) to a whopping $34.95/yr. Fortunately my ISP / hosted server provider (Cari.net) handles domain transfers very nicely, and at a reasonable price ($12/yr). Maybe not the cheapest alternative, but certainly better than $34.95.

KVM/qemu vs VirtualBox

I've been fiddling around with various virtualization systems, including VMWare, Fusion, Xen, Qemu, KVM and now lately, VirtualBox. To my surprise, there's virtually no (pun intended) difference running it natively on FC9, or under either VM (Ubuntu). It's possible Ubuntu is just "faster" than FC9 since some VM tests were actually faster, so maybe I really ought to run this test with an FC9 VM instead. Also, there's very little, if any, difference between VirtualBox and KVM performance (which is good, because I like VirtualBox a heck of a lot more). I ran the VirtualBox benchmarks both with, and without, VT-x support, VT-x seemed marginally faster, although it's probably not statistically "safe".

Here are the numbers:

Native FC9
VirtualBox Ubuntu8
VirtualBox w. VT-x enabled
KVM/qemu Ubuntu8
Integer
54.273
54.730
55.337
54.312
Floating point
43.196
42.843
42.495
43.063

The Bonnie++ I/O benchmarks are equally impressive for VirtualBox, most tests are as fast as the host OS (or faster ...).

On top of being very fast, VirtualBox is also the easiest to use free virtualization software I've tried, so far. It even supports PulseAudio as an audio driver! This feature alone makes it very attractive, since my FC9 host system is completely migrated to PulseAudio, and now my virtual machines now seamlessly supports sound as well.

I'll blog more about PulseAudio as I learn more, but it's a really neat little package. I really hope it'll clear up the Audio mess that is currently in Linux/Gnome/KDE. This could be the sound server to control it all.

HTML to PDF

I like to read various web articles on my laptop while I'm traveling, and often there's no network available (like, in the air..). I found this little service that someone in the UK setup, which lets you convert any HTML page to PDF. The URL is http://www.htm2pdf.co.uk/, and I can highly recommend it, it's an easy to use tool to make sure you have enough reading material available even when you are offline.

And I know, there are other ways of doing this conversion, but the service above is so far the easiest to use that I've found. There are also web service APIs available, which are not free, so I haven't had a chance to try them.

Adobe socket policy file server

I was recently talking to a friend of mine, that had to go through all sorts of hoops setting up a socket policy file server for his Adobe Flash content. This is a weird beast, which does not use HTTP for some unknown reason. Adobe provides some very simple server examples, which they say are not "production quality", and I'd have to say I agree. So, I whipped up a simple Perl server using the POE framework, and with a little help from Rocco, I think it's a pretty decent implementation. It doesn't do any logging or anything fancy like that, but if anyone is interested, I could certainly add that (or anything else that might be useful). The little perl script can be found here ftp://ftp.ogre.com/pub/leif/perl/policy_server.pl .

For more information on this new "protocol", see http://www.adobe.com/devnet/flashplayer/articles/socket_policy_files.html . There are several example implementations there, as well as full explanation on how and why the policy files are important.

Feedback and comments is welcome.

Linux PulseAudio

I upgraded my dev box to Fedora Core 9 yesterday, which mostly worked well (except, it botched the grub boot loader, and failed to upgrade ~4GB's worth of FC6 packages). Most things went well, except the migration to PulseAudio. It ended up starting in a "broken" state, and then Gnome gets really unhappy (including any Gnome apps). Looking in syslog, I'd see

May 18 22:57:05 loki pulseaudio[2733]: main.c: Called SUID root and real-time/high-priority scheduling was
requested in the configuration. However, we lack the necessary priviliges:
May 18 22:57:05 loki pulseaudio[2733]: main.c: We are not in group 'pulse-rt' and PolicyKit refuse to grant us
priviliges. Dropping SUID again.

Adding my user to the pulse-rt group seems to have fixed this particular problem, so things are happy again. Getting Firefox and Flash to work was a whole different story, doing a number of web searches, a few suggestions to use libflashsupport. However, digging deeper, setting the environment variable FIREFOX_DSP also does the trick. E.g. something like this in your firefox startup script:

export FIREFOX_DSP="aoss"

Geeks and their iPhones

Our friend Andy Ihnatko was in town last week, and we met up at the Pancacke House in Boulder. Geeks as they are, Michelle and Andy started taking photos of each other, turned out to be a pretty cool picture:


(picture taken with my iPhone, obviously).