Do advances in computing technology tend to show up in the consumer space first, or in a corporate environment? Or is there simply no correlation? I guess there are probably all sorts of measurement/range bias issues that render this an academically uninteresting line of inquiry, and perhaps even my bilateral classification system is naive and unrealistic (for example, perhaps I should be considering academia as a third distinct grouping).

I find it intriguing - and somewhat unsettling, since perhaps it indicates a personal rather than a communal shortcoming - that when I try to categorize a few big trends, I can’t definitively state or really even recall where some of them showed up first:

  • Web Access - did more people first start browsing regularly at home, or in their offices?
  • E-mail - Ok I’m fairly certain that this was much more prevalent in the workplace before making it into the home.
  • Mobile messaging and Push E-mail - Were BlackBerry devices already prevalent in the enterprise before the SMS explosion? I would have guessed the former, but according to Wikipedia the average mobile user was sending 35 messages a month in 2000, while the first BlackBerry smartphone was released only in 2002 (though their original device was released in 1997. The NPT lawsuit debacle originated in 2000, which gels with my reollection, in that I’d heard of BlackBerry before graduating college, so I believe the pre-smartphone devices were already quite popular. Wikipedia does confirm that BlackBerry was the first major push e-mail service in the U.S. and it seems quite reasonable to use the BlackBerry as the barometer for the advent of this era in the corporate sector.
  • Online video - I’m very uninformed about the use of digital video in business; I feel like it’s increasingly commonplace but I have no idea how mainstream it is - and I’m guessing that my work environment is quite atypical and therefore not a useful indicator. Nonetheless, I’m reasonably certain that movie piracy was the leading-edge of the trend, and that by and large, unidirectional streaming video is still largely a consumer-driven thing. Video conferencing meanwhile seems to be more evenly distributed, though it feels like it’s still a year or two away from being truly widespread.

Ok, so the reason I’m rambling about this is because it occurs to me that even assuming that the centralized SaaS-form of VDI makes any kind of sense as a way of doing computing, it’s still a toss-up as to whether it takes off at home or in the workplace first. Will VDI become mainstream before this Midori Cloud Computing platform from Microsoft shows up on a Dell machine?

I suppose an alternative outcome might be the emergence of a stable partition between consumer and business computing models, reflecting a fundamentally distinct ordering of priorities and acceptable tradeoffs between user experience, security, reliability and flexibility in these two domains - but I wouldn’t bet on it.

I wish I had found this years ago:

http://www.pitchforkmedia.com/rss/best_new_music

When I get bored or motivated enough I’m planning on writing a little RSS transformer that transforms this feed into one that sources Mininova. Actually I think that’s exactly what Yahoo! Pipes is supposed to be for…

Update: Holy fuck, that was easy. I’m impressed. This link works in uTorrent.

I recently switched out my BlackBerry yet again; I traded in the 8830 that I used for just under a month in exchange for the new 8130 Pearl on Sprint. I loved my old 8100 Pearl despite the fact that it only lasted a year of abuse at my hands (I doubt any other phone would have lasted a month), and the exchange was part of the game plan all along. I had read somewhere that the 8130 would be released before the end of the month, and so I bought an 8830 betting that the 8130 would come out before my 30 day trial expired. Shockingly, this crazy plan actually worked.

The Sprint 8130 is really sweet: GPS, EVDO, Bluetooth DUN, camera with video, external SD card slot, and standard 1/8″ headphone jack.

Anyway, the first thing I do with a BlackBerry (I can say that now that I’m on my third one) is to unlock the vendor themes via the standard “delete Vendor.xml and edit BlackBerry.alx” trick described on the BlackBerry forums. This gets me access to the sweet Vodafone theme that everybody likes.

Unfortunately, the unlock trick also resets BES activation status. I have already set/reset my status three times in the last month: once when I first got the 8830, next after I did the unlock trick for the 8830, and then again when I got the 8130. I was too ashamed to file yet another ticket when the new 8130 OS finally became available (access to the OS install package is a prerequisite for performing the unlock).

Fortunately, I figured out a way to install the Vodafone theme OTA without requiring an OS update or re-install of any kind:

  1. Install the new OS package.
  2. Navigate to %PROGRAMFILES%\Common Files\Research In Motion\Shared\Loader Files\<release>\Java.
  3. Find the theme you want. They’re named according to type and vendor ID. The Vodafone vendor ID is 120, and the theme I wanted is named net_rim_theme_120_today_240×260_b.cod.
  4. Copy the .cod file to a web server, and follow these instructions to create a .jad file to wrap the .cod for OTA installation.
  5. Add the .htaccess file, then point your BlackBerry browser at the .jad URL.

So, without further adieu, here’s a link to install the Vodafone theme for the 8130 Pearl OTA:

[WARNING: Don't try this on anything other than an 8130; the .jad is not well formed and you might screw up your phone. I will not be held responsible for any damage you might do to your phone or anything else that happens in your life after you install this thing.]

BlackBerry 8130 (Pearl) Vodafone Today

Better aterm transparency

For the past several years, I’ve been using aterm as my terminal emulator. The main reason I keep coming back to it is the off-focus fading support (it dims all the terminal content anytime the main window frame loses focus). It’s possible to implement off-focus fading for any window or class of windows using a Compiz plugin, but it’s a much bigger PITA than just setting the aterm*fading resource in ~/.Xdefaults.

Unfortunately, aterm has a couple of limitations. One is that it doesn’t handle XK_ISO_Left_Tab, which is incredibly annoying since it means you can’t back up in e.g. a bash or VIM completion list. I think this has something to do with changes in when and how XK_ISO_Left_Tab gets sent versus a simple shifted-Tab, and I think the whole thing is as usual the fault of motherfucking i18n which I hate. I sent a patch to fix this problem to the aterm maintainer but I never got a response. Perhaps I should try pushing it through Ubuntu instead. Anyway, I digress.

Another limitation, which is the subject of this post, is that aterm’s transparency is of the cheap hack form where it just reads the window background and blits it to the terminal window. After giving up on gnome-terminal for like the twentieth time this morning, I went back and hacked in slightly better transparency support using the _NET_WM_WINDOW_OPACITY hint. Support for this hint in the EWMH spec was proposed like three years ago, and for some reason it’s still not there, but it works in the window managers I care about (compiz, xfwm4, and metacity w/ xcompmgr).

So, my new hacked aterm can read a new commandline argument of the form -tp %, where % is the transparency value (greater than 0 and less than 100). It can also read the same value from a new resource, aterm*transparency. It takes this value, converts it into a fractional multiple of the opaque value (0xffffffff), and then sets the _NET_WM_WINDOW_OPACITY property accordingly (I just copied the code from xcompmgr).

I’m uploading an AMD64 binary that runs on Ubuntu Gutsy. If you’re running 32-bit, go fuck yourself. No seriously, perhaps if I get more motivated I will build a 32-bit version, and upload packages as well. In the meantime, I’ll upload the patch too - it’s quite simple and it’s pretty easy to see how you could do this for any program. I’m also including a gratuitous screenshot that probably contains confidential information that I shouldn’t be posting on the intarweb.

The main remaining limitation is that this makes the entire aterm window, frame, text, and all, transparent according to the specified percentage. The right thing to do is to use an ARGB visual when creating the background window, so that the text and frame remain opaque. This is what Keith Packard’s hacked transparent xterm does. I may give that a shot if I get bored/annoyed by this in the future.

…as promised. I used tbench, which is available in the Debian package archive:

$ sudo apt-get install dbench

My ‘test’ was to run a loopback tbench run with three clients. Make sure your VM isn’t doing anything intensive, then issue:

$ tbench_srv &
$ tbench 3

This will run a tbench test with three clients connected to the server, for 10 minutes with 2 minutes of warmup time. The comparison between VMI and non-VMI kernels on my machine was quite favorable: I got almost a 2X speedup when running with the VMI-enabled kernel! The numbers were 55MB/s before, and 95MB/s after.

I suspect this is some kind of pathological worst-case for the non-VMI kernel, since most benchmarks aren’t nearly this favorable. But nonetheless, I was happy with the result and so I didn’t question it too much.

More about dbench and tbench, from the manpage:

Netbench is a terrible benchmark, but it’s an “industry standard” and it’s what is used in the press to rate windows fileservers like Samba and WindowsNT. Given the requirements of running netbench (60 and 150 Windows PCs all on switched fast ethernet and a really grunty server, and some way to nurse all those machines along so they will run a very fussy benchmark suite without crashing), these programs were written to open up netbench to the masses.

Both dbench and tbench read a load description file called client.txt that was derived from a network sniffer dump of a real netbench run. client.txt is about 4MB and describes the 90 thousand operations that a netbench client does in a typical netbench run. They parse client.txt and use it to produce the same load without having to buy a huge lab.

dbench produces only the filesystem load. It does all the same IO calls that the smbd server in Samba would produce when confronted with a netbench run. It does no networking calls.

tbench produces only the TCP and process load. It does the same socket calls that smbd would do under a netbench load. It does no filesystem calls. The idea behind tbench is to eliminate smbd from the netbench test, as though the smbd code could be made infinitely fast.

This web site runs on Debian “Lenny”, in a virtual machine, powered by VMware Workstation 6.0 running on my Media Center PC at home. The primary bottleneck in this ghetto setup is definitely Comcast, given that my upstream bandwidth is only about 250-300Kbps. Nevertheless, a faster VM can still improve latency on page loads and given that the whole setup is running on a craptacular P4, I don’t exactly have CPU power to spare.

Enter VMI. If I was creating a new installation, I’d go with Ubuntu Feisty, since the Feisty kernel ships with VMI support enabled. But I didn’t want to go through the hassle of converting my existing machine, especially since apps like Wordpress don’t do a great job of separating their data in a way that would make this operation easy.

So I decided to try building a newer kernel, with VMI support enabled, for my Debian installation. This turned out to be fairly painless. I mostly followed the useful instructions I found here. Here’s the step-by-step process:

  1. Power off your VM, and enable paravirtualized kernel support in the Virtual Machine Settings menu:

    vmi_ws6

  2. Get the kernel package build tools you’ll need:
    $ sudo apt-get install kernel-package ncurses-dev
    Note: It’s possible to do all of these steps without running as root, using fakeroot and sudo, but I found it much easier to just su and get it over with.
  3. Download the 2.6.22-rc3 kernel package from kernel.org. VMI was actually included in 2.6.21, but the menuconfig options are missing in that release for some reason. Anyway, these instructions should apply to the final 2.6.22 release as well.
  4. Extract the tarball into /usr/src:
    $ cd /usr/src && tar jxf /path/to/linux-2.6.22-rc3.tar.bz2
  5. Change to /usr/src/linux-2.6.22-rc3 and issue make menuconfig.
  6. The quickest and simplest thing to do here is to load your existing configuration, then modify it to enable VMI support. Select Load an Alternate Configuration File and enter the path to your existing kernel configuration, which you can find in /boot. In my case, the correct path was /boot/config-2.6.18-4-686.
  7. Now it’s time to actually enable VMI support. You can find the VMI menu option under Processor Type and Features:

    Processor Type and Features

  8. make menuconfig VMI screenshot

    Aside: Notice in the above screenshot that I enabled the Tickless System (Dynamic Ticks) option. You can read more about dynticks here. Note that dynticks and VMI didn’t always play nice together, an issue which caused some fireworks on LKML. Nonetheless, in 2.6.22 these issues appear to have been resolved. Dynticks probably isn’t much of a win since I’m only running a single VM, but given the popularity of this blog, that VM is likely to be doing a whole lot of nothing, so maybe I’ll save a few pennies on my power bill.

  9. You’re now ready to build the kernel package. Just to be safe and explicit, choose the Save to Alternate Configuration File option, then hit enter to accept the default, .config. This will save your new configuration as the active one. Now at the command prompt, you can build the kernel with the following commands:

    $ make-kpkg clean
    $ make-kpkg --revision 1.0.vmi kernel_image

    You can replace 1.0.vmi above with a revision of your choosing. However, your string must have only letters, numbers and the period character. Important: Make sure you don’t skip the make-kpkg clean step or you’ll be hit with obscure and confusing error messages.
  10. The kernel compile will take a while, so go grab a cup of coffee. When it’s done, you’ll have a shiny new Debian kernel package sitting in /usr/src. In my case, the build package was:
    /usr/src/linux-image-2.6.22-rc3_1.0.vmi_i386.deb.
    Install the package:
    dpkg -i /usr/src/linux-image-2.6.22-rc3_1.0.vmi_i386.deb
  11. Hopefully, the package will install cleanly. In my case, I got an error about initramfs, and the initrd image was not created. I resolved this by manually creating the matching initrd with the handy update-initramfs command:
    $ update-initramfs -k 2.6.22-rc3 -c -v
  12. You’re almost there! The last step is to run update-grub to update the list of available kernels to boot. You should see your new kernel enumerated in the list printed out by update-grub.
  13. Now cross your fingers, reboot, and select the new kernel. If all goes well, your VM will boot and you’ll be sitting at a login prompt in noticeably less time than with your old kernel. Just to make sure, you should see some VMI messages printed in the kernel message log:

    $ dmesg | grep VMI
    vmi: registering clock event vmi-timer. mult=11715026 shift=22
    Booting paravirtualized kernel on vmi
    vmi: registering clock source khz=2793080
    Time: vmi-timer clocksource has been installed.

Ok, that does it. Not too hard, was it?

Next: some wildly unscientific VMI benchmarking.

WDaliClock improved

I sent this patch to the maintainers of WDaliClock a long time ago but they never responded. Well anyway, here’s a patched version of WDaliClock which does not appear in the window cycle list (a.k.a. the “Alt-Tab” list) while running. The fix is a one-liner: I simply applied WS_EX_TOOLWINDOW to the window style.

Patched WDaliClock Binary (.exe)
Patched WDaliClock Source Code (.zip)

I really hate the weird purple color that Windows Vista uses by default for menubar backgrounds. Most Vistatized apps, like IE7, WMP11 or Explorer, don’t actually show the menubar until you activate it with e.g. a keyboard combination, so the ugliness is not as noticeable. But plenty of applications do show the menubar, and that purple is just plain nasty:

Notepad in Windows Vista

It’s even worse when using Firefox, since Firefox uses this color not just for the menubar, but also for any and all toolbars:

Firefox Vista Ugliness

I tried out a few of the Firefox 2.0 themes that are floating around (there aren’t very many), but none of them actually tweak the background color. I also found some open bugs in Mozilla’s Bugzilla related to beautification of Firefox on Vista, but there hasn’t been much action on that front.

Fortunately, I found an outlet for my impatience. This simple addition to userChrome.css was good enough to get rid of the ugliness:

menubar, toolbox, toolbar {
   background-color: #eeeeee !important;
}

I don’t think #eeeeee is actually the perfect color, and if I were more motivated I would track down the exact value used on e.g. XP hosts or something, but at any rate it sure as heck beats the default:

Firefox on Vista Improved

EasyTag with AAC support, for Dapper

What a PITA. EasyTag in Dapper can’t edit tag information for .m4a (AAC) files, nor can you easily compile a version that can edit tag info, because the version of libmp4v2 in the repositories is too old. Debian has an easytag-aac package, but you can’t install or use it on Dapper because it’s system library dependencies are too new.

Fortunately, I wasted an hour of my life and resolved this by downloading a new version of the MPEG4 IP package, building the libmp4v2 part, installing it, and then rebuilding easytag with –enable-mp4.

Since libmp4v2 is also used by gstreamer for AAC playback, and I wasn’t convinced that it was sufficiently backward compatible, I hacked up the linking step of easytag’s build so that it statically links libmp4v2. The resulting easytag can run on Dapper, and edit .m4a tag information.

So come and get it:

EasyTag with AAC support for Dapper

So I wanted the ability to map a key combination that would accomplish the following:

        if (Rhythmbox is running) then
                if (Rhythmbox is visible) then
                        hide Rhythmbox
                else
                        show Rhythmbox
                endif
        else
                start Rhythmbox
                show Rhythmbox
        endif

In other words, a Rhythmbox toggle. Rhythmbox already has a show/hide check option in the tray icon UI, and the rhythmbox-client remote control program that comes with the source package exposes a hide option, so I figured it couldn’t be that hard.

Turns out the DBus Python bindings make this very straightforward. But I ran into an previously unfiled bug in the Python bindings; namely that they define the values for some random constants incorrectly.

[Update: The bug has been fixed.]

It’s funny how all these IPC messaging systems - DBus, COM, VMOMI/VMODL - always end up looking pretty much the same. There are no new ideas, or so goes the saying.

Anyway, here’s the code:

#!/usr/bin/python
import dbus

# These are defined incorrectly in dbus.dbus_bindings
DBUS_START_REPLY_SUCCESS = 1
DBUS_START_REPLY_ALREADY_RUNNING = 2

# Get the current session bus
bus = dbus.SessionBus()

# Explicitly try to start Rhythmbox.
(success, status) = bus.start_service_by_name('org.gnome.Rhythmbox')

# If we started it, make sure we explicitly show it
force_visible = (status == DBUS_START_REPLY_SUCCESS)

# Open the Rhythmbox shell object and get its properties
rbshellobj = bus.get_object('org.gnome.Rhythmbox', '/org/gnome/Rhythmbox/Shell')
rbprops = dbus.Interface(rbshellobj, 'org.freedesktop.DBus.Properties')

# Toggle the visibility value from its current setting
is_visible = rbprops.Get('org.gnome.Rhythmbox.Shell', 'visibility')
rbprops.Set('org.gnome.Rhythmbox.Shell', 'visibility', force_visible or (not is_visible))