Oops

I’ve mentioned before that in order to help defray the costs of putting my stuff on a colo box, I partitioned the box in 3 Xen virtual machines, and rent two of them out. Well, yesterday one of the renters, Terry, asked for a bit of help with his Apache set up. Not knowing his root password, I mounted his hard drive in the “dom0” Xen controller, using “mount /dev/xen-space/xen2-disk /mnt” and started poking around. Well, evidently that managed to confuse ext2 because a few hours later he emailed me to say that his disk had gone “read-only”, and when he tried to reboot it didn’t come up.

Looking at my munin graphs, it appears that when he rebooted, it took down the whole box. I had to email the owner of the rack to power cycle my box, which he can do remotely. When it came back, 2 of the 3 virtual machines came up fine, but Terry’s was asking for a root password to run fsck. I shut down his virtual machine and did a fsck from within the dom0, and it found several things out of whack. But after those were fixed, I was able to restart Terry’s virtual machine.

So lesson learned. I’m not sure if things would have been happier if I’d mounted it read-only, but in the future if I need to mount one of the partitions in /dev/xen-space I’ll shut down the xen virtual machine instance first.

You can never be too rich, too thin, or have too much screen real-estate

Below the cut is a highly illegal picture of my 17″ Powerbook G4 (1440×900 screen resolution) at work, connected up to my 24″ SGI/Sony GDM-90W11 CRT monitor (1600×1200 screen resolution), with the big screen being used for Eclipse, and the small screen showing my web browser open to Sun’s Java API documents, as well as a couple of convenient Terminal windows including one dedicated to pgsql.

The Safetype keyboard and mouse are also plugged into the Powerbook. All I really need now to make my work environment complete is a KVM so I can actually switch over to Linux and check my Lotus Notes and build in the dynamic vob.

So this is what I do now – I bring my laptop into work, hook it into the corporate network, and rsync my laptop’s /vob to my snapshot view on the Linux box. I run clearviewupdate on the snapshot view to get everything I’ve changed overnight checked into the vob, and then rsync it back so that everything that got checked in gets turned back to read-only. At that point, I’m good to go and I can plug the keyboard, video and mouse into the laptop and work. When I’m ready to leave at night, I unplug the laptop from the monitor and put the keyboard and mouse back on the Linux box, and run the same procedure all over again.

I also have a dynamic view of the same development stream, so I can build the bits of code that are actually working. (I can’t build in the snapshot view because you can’t make a snapshot view anchored at /vob, and far too many Makefiles have hard coded full paths instead of relative paths).

It’s all pretty sweet so far.

Continue reading “You can never be too rich, too thin, or have too much screen real-estate”

WTF?

I’m busy re-writing vast swaths of my low-level code in order to support a new database schema. One of the classes that I wrote that got used all over the place is called “Playlist”, and its various subclasses. Playlist has an abstract clone() method. I almost never write clone() methods, so somebody must have asked for it. And I think I know who now.

As part of this re-write, I using Eclipse’s “Find References” function a lot to see if some method needs to be re-written or can just be deleted. While doing that, I found an interesting bit of code in an obscure part of the system that I’ve never looked at before:


private Playlist doClonePlaylist(Playlist playlist) {
Playlist clonePlaylist = null;
 
// need a special clone
// as the playlist cone function
// doesn't copy the playlist
// external id which we really need
if (playlist != null) {
clonePlaylist = (Playlist)playlist.clone();
clonePlaylist.setExternalID(playlist.getExternalID());
}
 
return clonePlaylist;
}

If the guy who’d written this bit of cruft still worked here, I’d want to ask him why the fuck he didn’t just tell me that I’d left one parameter out of my clone() method, or even better, fix it himself? Ideally, I’d want to ask him while dangling him over the edge of a multistory building, but that isn’t going to happen.

That’s me in spades

I just finished reading How To Recognize A Good Programmer, and kept thinking “hey, that’s me” for every point. So why did my last two job interviews not go so well? I’m a good programmer, I know I’m damn good actually, and according to this, everybody else should think I am too.

Oh well, I’ve got 6 months left on this contract. Maybe I should get some paper qualifications to impress the people who aren’t smart enough to read that article.