Announcing Blackbird, a Twitter client for BlackBerry phones!

Blackbird logo

About a week ago, I mentioned on Twitter that I was working on a Twitter client for BlackBerry smartphones called Blackbird.

After an initial limited release to a few people, I think it’s ready for general use. I’ve already stopped using TwitterBerry and TinyTwitter, now exclusively using Blackbird and I don’t miss a thing.

If you have a BlackBerry and are a Twitter user, I’d love it if you’d go and install Blackbird and let me know what you think! It’s still fairly new and it’s my first BlackBerry application, so I’m sure there’s lots of ways I can improve it.

Tags: , ,

Migrating from VirtualBox to VMware

As part of the Gnash buildbot farm, I run several virtual machines as build slaves. I started with VirtualBox because it is free software and I prefer to support free software, but it’s still a bit too fragile and it still lacks x86_64 guest support.

When I discovered that VMware Server is now available for free–well, free as in beer, anyway–I happily installed it and set up some new VMs on it. Best of all, it supports x86_64 guests! Of course, now I have the problem of migrating those VirtualBox guest VMs over to VMware.

VMware uses its own VMDK format for storing virtual disk images, while VirtualBox uses its own VDI format. The first step is getting a copy of vditool, VirtualBox’s command line program for manipulating VDI files.

The host OS I used to run VirtualBox is Ubuntu‘s 8.04 Hardy Heron on AMD64. The VirtualBox 1.6.0 .deb package didn’t include vditool, for some reason. Fortunately, the VirtualBox package in Debian’s “lenny” release includes it, so lets just grab it from there.

$ wget http://http.us.debian.org/debian/pool/main/v/virtualbox-ose/virtualbox-ose_1.5.6-dfsg-6_amd64.deb
$ dpkg -x virtualbox-ose_1.5.6-dfsg-6_amd64.deb vbox-1.5.6
$ sudo cp vbox-1.5.6/usr/lib/virtualbox/vditool /usr/lib/virtualbox/vditool
$ sudo ln -sf /usr/lib/virtualbox/vditool /usr/bin/vditool

There, now we have vditool installed. Next, we use it to export our old VirtualBox VDI back to raw disk data. However, if you used VirtualBox’s “Snapshots” with differencing VDI’s, you need to discard all snapshots before the one you want to write out as the raw disk: only the “base” data gets written out, not the “Current State”.

$ cd ~/.VirtualBox/VDI
$ vditool copydd win2000-i386-32gb.vdi win2000-i386-32gb.dd
vditool    Copyright (c) 2004-2008 innotek GmbH.

Copying VDI image file="win2000-i386-32gb.vdi" to DD file="win2000-i386-32gb.dd"...
The operation completed successfully!

Be careful, this could consume a lot of disk space, if you were using compacted VDI’s instead of fixed size as the raw image will be the full size of the disk image, which in my case was 32 GB even though the VDI only took ~6.5 GB on disk.

Once we have the raw data, we can create the VMDK metadata for our DD image. We compute the size of the raw data in sectors by dividing its size in bytes by 512:

$ stat --printf="%s 512/p" win2000-i386-32gb.dd | dc
67108864

We also need to compute the CHS geometry of the virtual disk. I used the assumption of 255 heads and 63 sectors:

$ stat --printf="%s 512/255/63/p" win2000-i386-32gb.dd | dc
4177

Once we have that information, we go ahead and create the VMDK metadata. Change the elements highlighted in blue as appropriate for your system:

$ cat >win2000-i386-32gb-flat.vmdk <<-__EOF__
# Disk DescriptorFile
version=1
CID=4dd210c6
parentCID=ffffffff
createType="monolithicFlat"

# Extent description
RW 67108864 FLAT "win2000-i386-32gb.dd" 0

# The Disk Data Base
#DDB

ddb.virtualHWVersion = "4"
ddb.geometry.cylinders = "4177"
ddb.geometry.heads = "255"
ddb.geometry.sectors = "63"
ddb.adapterType = "buslogic"
__EOF__

There, we now have a VMDK suitable for use in VMware! But, it takes up all 32 GB of space on the disk while only ~6.5 GB is actually in use. Lets use vmware-vdiskmanager to create another VMDK that is growable, instead:

$ vmware-vdiskmanager -r win2000-i386-32gb-flat.vmdk -t 0 win2000-i386-32gb.vmdk
Using log file /tmp/vmware-dossy/vdiskmanager.log
Creating a monolithic growable disk 'win2000-i386-32gb.vmdk'
  Convert: 100% done.
Virtual disk conversion successful.

And there you have it: a growable converted VMDK from VDI:

$ ls -lh win2000-i386-32gb*
-rw------- 1 dossy dossy  32G 2008-05-23 11:26 win2000-i386-32gb.dd
-rw------- 1 dossy dossy  327 2008-05-23 13:40 win2000-i386-32gb-flat.vmdk
-rw------- 1 dossy dossy 6.5G 2008-05-23 14:25 win2000-i386-32gb.vdi
-rw------- 1 dossy dossy 6.3G 2008-05-23 14:20 win2000-i386-32gb.vmdk

From here, I created a new virtual machine under VMware Server, specifying “Custom” and using an existing virtual disk–the one I just created.

Of course, I couldn’t just boot this VM up because the virtualized hardware from VirtualBox differs from the virtualized hardware in VMware, and the particular VM in question is a Microsoft Windows 2000 guest. To fix the Windows install, I performed a “repair installation” of Windows 2000. I guess this is necessary when you change all the hardware out from underneath a Windows machine. After completing the repair installation, the VM booted up! I went ahead and installed VMware Tools, rebooted, and now everything works as expected.

I don’t know how many folks out there want to migrate away from VirtualBox to VMware, but I couldn’t find very much useful information on doing it so hopefully this will help people out who want to do it.

Tags: , ,

TypeRacer, massively multiplayer online typing!

(Okay, perhaps it’s not yet “massively multiplayer” but, it could be!)

My latest distraction is a fun web based “game” called TypeRacer, where you “race” against other typists in realtime who are all typing the same text which is often a quote from a book or song lyrics.

I love typing speed measurement games and TypeRacer’s social software aspect and multi-player nature really sets this apart. I’m also a huge fan of educational online gaming. It would be nice to select passages from educational texts to type against your friends–learn something while having fun typing.

I’ve wondered whether there’s truly a better keyboard layout than QWERTY before and have yet to find any solid scientific proof. If Dvorak was measurably better than QWERTY, I would have expected to see two “bands” of scoring on TypeRacer: one of the varied QWERTY-layout typists, and a “break-away” group with speeds far above the rest who are master Dvorak-layout typists.

Either way, I guess I’m going to take a moment to fluff my ego:

TypeRacer screenshot, 143 WPM!
(Click for full screenshot.)

Yes, that’s for real: 143 WPM. As you can see from the larger screenshot, my average speed over the past 5 races is 127 WPM. I know that over time, the average will regress to between 110-120 WPM, but for now, I’m going to enjoy this while it lasts. :-)

Think you can beat me? Lets set up a type-off and see who’s got the fingers of fury! Bring it on!

Tags: , ,

Marvell SysKonnect Yukon 2 drivers not usable in Ubuntu Hardy

I set out to build myself a new desktop and HTPC. I chose a Ultra Black MicroFly case to put everything in. There are a lot of mATX boards out now, so I decided to try an EVGA e-7100/630i board ($60 at Amazon.com), as I have no experience with them and love to try new stuff.

I typically don’t install removable media (floppy, CD-ROM/DVD-ROM, etc.) in my machines. I use external DVD writers, and everything is networked so I just rip ISOs and access them over the network if need be. So, typically when I set up a new machine, I netboot it to start the OS install. This is where I ran into my first hurdle with the EVGA board–it can’t netboot using the on-board NIC. It supports booting off “Legacy LAN” but I didn’t have a spare PCI ethernet card handy to slap in it. Luckily, it can also boot off USB devices, so I just made a Ubuntu Live USB image of Hardy AMD64 and used that to kickstart the OS install.

After I completed the initial Ubuntu install, I went to pull down any updates using apt-get, and the machine locked up hard. I repeated this a few times and each time, it would lock up requiring a physical reboot. Curious as to what was going on, I looked at lspci to see what hardware was on this board. Sadly, I found this:

03:00.0 Ethernet controller: Marvell Technology Group Ltd. 88E8056 PCI-E Gigabit Ethernet Controller (rev 14)

Aww, crap. Not another Marvell piece of crap. Only recently I dealt with an Intel DP35DPM board that had a Marvell 88SE6101 PATA IDE chip. When I say “support for Marvell chips under Linux is poor,” that’s being very kind. I was able to find this thread on kerneltrap.org where folks complained about the Marvell Yukon support in Linux as far back as September 2006 through April 2008.

Unfortunately, the sky2 module that ships with Ubuntu Hardy still doesn’t work completely. In dmesg output, I see:

[   39.437272] sky2 eth0: Link is up at 100 Mbps, full duplex, flow control both
[   43.785585] eth0: no IPv6 routers present
[  430.085997] sky2 eth0: rx error, status 0x740002 length 116
[  430.372344] sky2 eth0: rx error, status 0x780002 length 120
[  430.374110] sky2 eth0: rx error, status 0x760002 length 118
[  430.544242] sky2 eth0: rx error, status 0x760002 length 118
[  431.856916] sky2 eth0: rx error, status 0x700002 length 112
[  431.861653] sky2 eth0: rx error, status 0x740002 length 116
[  432.072037] sky2 eth0: rx error, status 0x520002 length 82
[  437.143385] sky2 eth0: rx error, status 0x4a0002 length 74
[  437.989254] sky2 eth0: rx error, status 0x560002 length 86
[  438.736323] sky2 eth0: rx error, status 0x520002 length 82
[  438.769120] sky2 eth0: rx error, status 0x740002 length 116
...

This results in corrupted packets in user space. It’s probably the cause of the hard lock-ups I had been experiencing: if I avoid using the network, the machine runs just fine and doesn’t hang!

I’m going to pick up another PCI ethernet card and disable the on-board NIC until the Marvell drivers are usable. It’s really a pity to have do it, but the board is essentially unusable with Linux because of the Marvell NIC.

Throughout all of this, I had asked EVGA customer support various questions via their online support web form, and was seriously impressed by their fast response time, usually within minutes! Even though I’m disappointed by the product’s poor on-board NIC, their friendly and responsive support definitely makes it an attractive company to do business with. If you have a problem with an EVGA product, I highly recommend you try contacting their customer support to see if they can help.

Tags: , ,

Show me some Twitter API enhancements, baby

@al3x tweets: I never thought there'd be fapping on Twitter-Development-Talk. I've been proven wrong. Them dudes *really* love some API methods.

Heh.

Tags:

Fedora 8 RPM of character counting plugin for Pidgin

After Callum let me know that the Linux binary of the character counting plugin for Pidgin worked on Fedora 8, I decided to spin a RPM built on Fedora 8 proper. After a bit of reading and hackery, I have produced a x86 RPM for Fedora 8. Here’s the source, which includes the patch and the .spec file, as well as the RPM:

I’ve also spun a new Debian binary, as well:

And, if you’re looking for the Win32 binary, you can still get it off this page.

I’m glad so many of you out there who use Pidgin find this plugin useful. Thanks for all the positive feedback.

Tags: , , , ,

pkg-config and glib, chicken and egg, same thing

I’m setting up a virtual machine using VirtualBox on Ubuntu Gutsy, running Win2000 as the guest OS. I’ve gone and installed Cygwin and MinGW and MSYS in order to build Gnash on Win32. I came across a funny bootstrapping problem trying to install pkg-config: pkg-config 0.22 requires glib 2.x in order to compile. No sweat, I go and download glib 2.13.6 and configure it … and the configure script stops with an error when it can’t find pkg-config installed!

Circular dependencies suck.

Of course, in the README.win32 for pkg-config, Tor Lillqvist acknowledges this at the end of the document:

On Unix, pkg-config is built using its own copy of GLib 1.2.8. On Windows, we use the normal GLib available for Windows (2.0.x). Yes, this does introduce a kind of circular dependency. But, that can be worked around. The circular dependency only appears if one uses the configure mechanism to build GLib. GLib’s configure script checks for pkg-config. pkg-config depends on GLib. Thus, starting from scratch, with no GLib and no pkg-config, using configure, there would indeed be a Catch-22 situation. However, GLib can be built just fine using the manually written makefiles for mingw or MSVC. And if somebody does want to build GLib on Win32 using configure, she can first install a prebuilt pkgconfig.

Unfortunately, as of glib 2.13.6 at least, only the automake files are included–no ordinary makefiles for Win32, either MinGW or MSVC, even. Fortunately, older releases of pkg-config source are still available, and glib 2.13.6 will build with pkg-config 0.14 or newer. pkg-config 0.14 includes glib 1.2.8 and tries to build it as part of its build, so I went ahead and tried to build pkg-config 0.14. Since nothing is ever easy, I ended up having to make a slight change to glib 1.2.8 to get it to compile, adding these lines to the top of glib.h, after the #include <glibconfig.h>:

#undef G_MAXINT
#define G_MAXINT 0xFFFF
#define SIGCHLD 17
#define g_ascii_strcasecmp(a, b) strcmp(a, b)
#include <fcntl.h>
#include <winsock.h>

I also discovered that gthread.o wouldn’t compile right due to some libtool weirdness, so I had to compile everything somewhat manually with this:

$ cd glib-1.2.8/gthread
$ gcc -I.. -DHAVE_CONFIG_H -DG_OS_WIN32 -o gthread.o -c gthread.c
$ touch gthread.lo
$ cd ..
$ make libglib.la
$ cd ..
$ make CFLAGS="-DG_OS_WIN32" parse.o
$ make pkg-config.exe
$ cp pkg-config.exe /mingw/bin

After all that, I finally had a compiled and installed pkg-config 0.14! I went ahead and used it to build glib 2.13.6 and installed that, then went and built pkg-config 0.22 with it.

So, which came first? The chicken or the egg? :-)

Tags: , , ,

Great progress made on npgnash.dll

getgnash.org logo

What have I been furiously hacking on the last few nights? Gnash, the GNU Flash player. Specifically, I’ve been doing a lot of hacking on support for Win32. More specifically, I’ve been working on npgnash, the plugin that embeds Gnash inside Firefox using the Mozilla NPAPI.

I’m not going to get into the ugly details of what I went through to get as far as I have, but I’ll summarize it as: a hell of a lot harder than it ought to have been. I’ll save my rant for why C++ sucks, so badly, for another day. What you really want to see are screenshots, I know!

First, here’s the entry for npgnash from Firefox’s about:plugins page:

Firefox about:plugins showing npgnash

Okay, big deal, so I can load a DLL. Here’s npgnash playing gravity.swf from the Gnash testsuite, right in the browser:

npgnash playing gravity.swf from the gnash testsuite

Who doesn’t love a big bouncing smiley-face animating across their browser, right? But, the true test is playing my favorite YouTube video … to test with, at least:

npgnash playing a YouTube video

Yup, that’s no joke … it’s a screenshot of npgnash playing a YouTube video inside Firefox 2.0.0.12 on my WinXP machine. It’s using the Anti-Grain Geometry (AGG) rendering engine, along with SDL/ffmpeg for audio … and they both work, albeit not very well, yet.  Still, not bad for three or four days of hacking, right?

Despite all this progress and these screenshots, it’s still not ready for general-purpose use, yet. The underlying Gnash code is still isn’t fully re-entrant/thread-safe and the cleanup code isn’t fully baked so I can’t even load one SWF after another without it crashing. I also haven’t implemented any mouse/keyboard support, so you can’t actually use any of the player buttons you see in the YouTube video, etc., yet.

Still, it’s a great start and hopefully by the time the 0.8.3 release is ready in a few months, there will be a lot more forward progress.

Tags: , , , ,

Adding an “Unsubscribe” button to Google Reader using Greasemonkey

Yesterday, Maki asked on Twitter, “I would love to have a ‘Quick unsubscribe’ button for Google Reader…a greasemonkey script would be terrific. Anyone wanna do one?” Of course, it seems I have a thing for hacking out little web toys for people I know on Twitter, so I gave it a whack.  Here’s the result:

Here’s a screenshot showing what it does:

Google Reader Unsubscribe button screenshot

It’s a pretty simple script. The hardest part was reverse-engineering Google Reader’s packed/minified JavaScript, but that wasn’t too hard.

Do you have a useful idea for a web toy? Perhaps if you run it by me and it interests me, I’ll hack on it for you, too.

Tags: , , ,

Hand-decoding tcpdump’ed SNMPv1 packets

I can’t go into too many details about what I’m working on right now, but it involves processing SNMP requests and generating SNMP responses. The hard part is that I’m writing all my own code to parse and process them, as I can’t use the Net-SNMP library to do it for various reasons. (Trust me, I wish I could.)

What makes this so much fun (not!) is having to debug and troubleshoot my code by hand-decoding the SNMP messages, captured off the network using tcpdump. If you’ve never done this, I’d compare it to performing long division on really large numbers. It’s not particularly hard, but it sure is tedious. Here’s an example of a pair of request/response packets that I’ve hand-annotated:

Screenshot of hand-annotated tcpdump of an SNMP request/response pair

Yeah. This certainly isn’t one of the glorious parts of software development. But, it needs to be done, right?

Tags: ,