Putty alias

Here's a quick code post from my Powershell profile. I keep copying this around every time I set up a new system, so maybe it will be useful to others. And to me, since I can copy it off the web in the future rather than having to dig it up or recreate it.

Being an old-school UNIX guy, I get used to just typing ssh hostname to access my servers. So the Putty syntax of loading a profile annoys me. To that end, I wrote a few little functions to add to my Powershell $profile to address this. They just let me load a session by typing the familiar commands and don't require me to change syntax when using a profile versus connecting directly to a hostname.


# Suppress the assembly loading output
[System.Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null

function _puttyHasProfile {
   $profile_name = $args[0].ToLower()
   $profiles = Get-ChildItem HKCU:\Software\SimonTatham\PuTTY\Sessions\
   foreach ($p in $profiles) {
      $name = [System.IO.Path]::GetFileName($p.Name)
      # Putty stores spaces and other special characters URL encoded.
      $name = [System.Web.HttpUtility]::UrlDecode($name).ToLower()
      if ($name -eq $profile_name) {
         return 1
      }
   }
   return 0
}

function ssh {
   $profile_name = $args[0]
   if (_puttyHasProfile($profile_name)) {
      putty -load $profile_name
   } else {
      putty $args
   }
}

function sftp {
   $profile_name = $args[0]
   if (_puttyHasProfile($profile_name)) {
      psftp -load $profile_name
   } else {
      psftp $args
   }
}

Early birthday

I got an early birthday present today. My birthday isn't until Monday, but my sister-in-law was over tonight, so she gave me my present.

Remember how I mentioned last week that I have a bit of a weakness for "vintage" games? Well, she got me a Logitech Extreme 3D Pro joystick. You rock, Theresa!

And what did I want such a joystick for? You guessed it - to play Wing Commander! I absolutely love the Wing Commander series, and have since I was in high school. I think I owned most, if not all, of the games. In fact, I think I still have copies of all of them, though the ones that were on floppies have long since died (I still have the files on my hard drive, though). I enjoyed pretty much every game in the series, though the original and the Privateer spin-off were probably my favorites.

So here I am, with a brand-new 12-button joystick, playing a 20-year-old video game in a little emulated DOS window. It's amazing the entertainment/time-wasting possibilities technology opens to us!

Post-vacation unhappiness

On the heels of the things that make me happy, here's something that makes me not so happy: when half your team quits while you're on vacation!

I spent the last week of July in Cape Cod, staying in a cabin by the beach. It was very nice. We relaxed a bit, saw some sites, did some shopping (they have a kick-ass used book store on Main St. in Hyannis), and generally enjoyed it a great deal. It was nice to unplug for a while - I only used my laptop on twice all week, both times for less than an hour.

And what do I discover when I get back? Our engineering team is deserting me. We only had three software engineers (including me), one Flash designer, and one QA person. Turns out both of the other engineers gave their notice while I was gone. So now it's just me. Sigh....

I don't blame them - you've got to look out for your own career - but it leaves us in a really bad place. Plus I'll miss having them around the office to talk to. But on the up side, it won't be hard to stay in touch - they're both going to the same company, which is located in the same office park we're in now.

Making my games work

Despite not considering myself a "gamer" (with the exception of Battle for Wesnoth), I do have a bit of a weakness for "vintage" games, by which I mean the ones I played when I was in high-school and college. While I don't have much time for games anymore, what with full-time employment and home ownership, I still like to come back to those old every now and then.

Well, when I tried to fire up my PlayStation emulator, ePSXe, to mess around with my old copy of Final Fantasy Tactics, I ran into a problem - I no longer have GTK+ 1.2 installed! Apparently it was removed when I upgraded to Ubuntu 10.04 (or possibly even 9.10, I'm not sure). However, according to this LaunchPad bug, this particular issue is by design and will not be fixed. That kind of stinks, because I have several old closed-source Linux-based games that depend in some way on GTK+ 1.2 (often for the Loki installer).

This sort of thing is a little bit of a sore spot for me, and has been for some time. On the one hand, I can understand te Ubuntu team's position: GTK+ 1.2 is really old and has not been supported for some time. You really shouldn't be using it anyway, so there's not much reason for them to expend any effort on it.

On the other hand, how much effort is it to maintain a package that's no longer being updated? Why not at least make it available for those who need it? This is the sort of user-hostile thinking that's always bothered me about the open-source community. There's hardly any compatibility between anything. Binary compatibility between library version is sketchy, as is package compatibility between distributions. Even source compatibility breaks every few years as build tools and libraries evolve. Ever try to compile a 10-year-old program with a non-trivial build process? Good luck.

And that seems to be the attitude - "Good luck! You're on your own." It's open-source, so you can always go out and fix it yourself, if you're a programmer, or hire someone to do it for you otherwise. And while it's absolutely great that you can do that, should that really be an excuse for not giving users what they want or need? Should the community have to do it themselves when it's something that would be relatively easy for the project maintainers to set up?

Not that I can blame them. As frustrating as decisions like this can be, you can't look a gift horse in the mouth. The Ubuntu team is providing a high-quality product at no cost and with no strings attached. They don't owe me a thing. Which, I suppose, is why it's so great that members of the community can fix things themselves. The circle is complete!

But anyhow, that's enough venting. That LaunchPad thread had several posts describing how to install GTK+ 1.2 on 10.04. I chose to use a PPA repository.

sudo apt-add-repository ppa:adamkoczur/gtk1.2
sudo apt-get update
sudo apt-get install gtk+1.2

Ta-da! I'm now back at the point I was at a year or so ago when all of my old games actually worked.