Archive for April, 2008

Virtualizing the Security Layer

Wednesday, April 9th, 2008

I was in the City the other day, listening to a somewhat interesting talk on computer security. For my readers who are not from the area, let me explain. When we NJ dwellers say “The City” (in capitals), we mean a certain nearby city of York. This of course means skyscrapers, smog, hellish traffic, crowds, noise and dirt. I love big cities, they remind me of home. The are the only places where you can see the stark juxtaposition of a sharply dressed businessman in Armani suit stepping over a homeless bum sleeping on the sidewalk as he is hailing a cab. These places pulsate with life, and purpose and have this strange intensity. You can almost feel the weight of the accumulated human experience all around you. If the stone walls of the skyscrapers could talk, they would sing us a moving story about love, commitment, betrayal, hate, strife, happiness, sorrow - about hearts and dreams being broken or fulfilled every day on the busy streets. That said, I totally don’t mind living in the quiet and lazy suburbia.

The whole shindig was targeted more at the managerial types so it was sort of dumbed down out of necessity. You see, when you do a presentation of IT people or programmers you talk about technology. You throw it out there, say what it does, why is it good, and then you dive in and show how it works, how it can be broken, and how to hack it into submission. That’s what excites us. When you do a presentation for the decision makers, you briefly describe the technology, then you talk about “business scenarios”, costs, benefits, risks and tell “industry stories” and then try to sell them “solutions”. Abridged transcript would be as follows: “blah blah blah, interesting stuff, money money money money, risk, money money, opportunity, money money, buy buy buy!”

Still, the gist of the talk was interesting and I was able to sneak in one or two technical questions at the end so it was not a total loss. In fact I found it worth sharing here.

There are pretty much 2 ways to secure your machines. On the small scale you simply run a client antivirus, and software firewall on each desktop. On a large scale, you put trusted machines behind a big bad firewall, or perhaps build tiered architecture with firewalls between each tier. Both methods have flaws. The big scale method, ironically doesn’t scale well because large companies tend to have dynamic network architectures due to growth, mergers and work is more and more often done from beyond the firewall due to mobility of the workforce. So your firewall infrastructure end up looking like swiss cheese full of holes, exceptions, and strange rules no one remembers creating.

The small scale approach is similarly vulnerable. Your security applications are running in the context of the operating system so if the OS gets compromised by a new zero day exploit that installs a root kit you are dead. If you can’t trust your OS, how can you ever be sure every little piece of malicious code was removed? How can you even attempt to remove that stuff if the malware is actively killing all the anti-virus threads it can find? There are many cases when the best thing to do when it you get compromised is to reformat and start from scratch.

The new idea the talk tried to introduce was to run your security software in a virtual machine. This virtual machine would be a minimalistic, stripped down OS, which would act as your internet gateway, firewall, IPS and anti-mallware scanner. The idea is to divorce your security software from the host OS to make it less susceptible to attacks on that system. Instead of running a big static OS installation with many services, applications and points of attack, you are now exposing only a small, hardened, special force OS that provides no services to the outside network. It poses a much smaller target, and it is easier to aggressively patch and upgrade virtual machines than full blown operating systems that perform mission critical tasks. Furthermore a compromised virtual security layer can be easily switched odd, and “rolled back” to a “clean” state at any time. This is naturally not foolproof, but it does seem to offer slightly higher degree of protection than the traditional approach.

The point they were really trying to sell to us was the impact this has on large scale network architectures. They juxtaposed it against more traditional data center philosophy of putting physical firewalls between different parts of your infrastructure (ie. forward facing web servers are kept on a separate network from application and database servers. Using vitualization is like giving each machine it’s own dedicated hardware firewall and ips shielding it from everything else. The products they are selling are supposed to make it easier to organize machines into dynamic server pools, which can be reorganized on the fly using global policies, and the like.

There is a downside to this - running a security VM on each box is expensive in terms of performance. However, in the day and age of ubiquitous quad-core processors it is may not be such a huge concern. If you dedicate a single core and say 512 MB of RAM to run the VM you still have a 3-core powerhouse with 3GB of RAM on your hands. At least for now. I’m sure that the next version of Windows will probably need all 4 cores, and all your RAM to actually draw windows on the screen, but that’s a whole different story.

From the Teachers Mailbox

Tuesday, April 8th, 2008

Here are few literary gems from my inbox. These emails were sent to me by some of my students over the few last semesters. I will preface this by saying that the strange linguistic constructs you will see below were produced mostly by A or B students, native speakers of English - who at other times sent me much more coherent and understandable correspondence. Names were naturally removed to protect the innocent.

First one is from my “Subject field does not have spellcheck” category:

Subject: ques tion reguarding hwk

Reguarding kinda reminds me of havening. It’s kinda my new favorite word. Then again, maybe it was a honest typo. I have done much worse in the past (and on this very blog). Still, I can’t help but thing I had the famous George in my class and I didn’t even know it.

Some of my students apparently subscribe to the “punctuation inhibits communication” school of thought:

hello quick question for the hw 2 is it due next class

Careful analysis, tells me that this would have made perfect sense as an IM or a text message. Think about it for a second and the places where one would hit enter will become obvious. It seems that the art of writing email is slowly forgotten by the generation of people who use IM exclusively.

Then again, I wish all the letters I get were this coherent. For example, look at this one (reproduced complete with the weird spacing and etc..):

Hi prof on may 7 at 23:45 after the class I send my hw thru d
        But today today i checked my grades and i didn’t any grades for     it then I check m the file which i
      i send it to u It didn’t’ say that u received it the file.( i don’t know maybe i could submit it rite way or?
   well anyways i am resending it.

I’m not sure what was going on in there, but I guess the gist of this message is that the person is re-submitting their homework because they didn’t see their grade listed in the LMS. It took me a while to figure this out, but the last sentence is the key.

Btw, there is a lesson I have learned over time - if I add a new assignment in the online grade book but do not put the grades right away, I get students trying to re-submit their work thinking it didn’t go through or that I somehow missed it. It’s even better when I add a project that I didn’t assign yet in there. I get few dozen emails with people begging me to email them the instructions because they never got the handout them in class. These days I don’t add anything to the online grade book until I have graded it. P

Sometimes I just can’t tell what an email is about. I found one like this in my mailbox last semester and I could not figure out how to respond:

Hello, professor….I completed lab was an able to do so at home because i do did not windows 2007. So i completed in the comp. lab on campus.

Did he complete the lab? I think my response went something among the lines of “Thats ok. Let me know if you can’t submit it before the deadline”.

Also, Windows 2007 FTW. When I ask them on the test whether MS Office 2007 is an Operating system, or if Windows XP is Application Software most of them get it right. But they still use Office and Windows interchangeably in common speech.

I actually don’t I mind the odd punctuation, innovative spelling and fragmented sentences. As long as I can make sense of it, I will try to reply to it, or grade it to the best of my ability. Sometimes I wonder how professors with degrees in English cope with this sort of things. P

KOTOR 2: Lightsaber Combat

Monday, April 7th, 2008

I have either one or two more KOTOR 2 related posts in the queue. Sorry if this is a deathly boring subject to you, by now. Sadly since I have been having fun playing this game instead of doing bigger and better things, this is what I want to talk about now. So I can either continue blogging my KOTOR experience or grasp at straws talking about subjects that I haven’t spent much time researching, or getting to know. And no, you don’t get to pick which one of these things I will be writing about. P

I’m actually nearly done with the game. I suspect that I have less than an hour of actual game play left - at judging from the way story is unfolding. Then again this game tends to do a lot of tension breaker like stuff, when it makes you play as one of the secondary characters for a while just as your main team is about to confront the big bad guy. This probably means I will finish the game before the week is over - all I have to do is to find 2-3 hours of spare time one of these days. Once I’m done I plan to talk about the story and the characters at length. I’m holding back on this because nearly every single character on board of Ebon Hawk seems to have some hidden agenda, or some sort of secret and I have not uncovered all of them yet. When I started this game I really didn’t expect much from these folks. Now they grew into a rather interesting bunch. They do seem to have minds of their own, and when you are not looking they are plotting, scheming and doing things that may hinder your progress. Once the game is finished I will know where each of them stands a little bit better as there are several things up in the air at the moment.

Today I wanted to discuss something else - the lightsaber combat as depicted in the game. I will be nitpicking here, but please keep in mind that I’m actually immensely enjoying this game for it’s story, and dialogs. While the mechanics is really easy and intuitive, I think that close combat is a far cry from what you would expect from a Star Wars game.

k2_00031.jpg

The combat is real time, but dice based. While the urgency and excitement is usually a factor in every important confrontation there is no twitch based hacking and slashing in this game. There are still loosely defined “rounds” in this game, as there is a set amount of time that must elapse between each action. You can queue them up - usually 5 at a time, specifying whether the character should make a standard attack, a power attack, or perhaps use a medkit or a force power instead. This is a perfectly valid and serviceable system and I don’t mind that at all - especially since you can pause the game to give orders to all your characters (and the game auto-pauses when you encounter an enemy). Or you can let them fend for themselves. I found out that the friendly AI is actually pretty decent. You can assign your team mates specific roles (eg, ranged, aggressive, use force powers, etc..) and they act as expected. Characters with jedi support role for example will keep healing you when your HP are low, and keep casting buffs throughout the fight. Low level Jedi end to burn through all their force points before the fight is over, but that issue goes away with time as they gain more FP each level.

In addition to roles game also gives you the so called “lightsaber forms” which are distinct combat styles that give you bonuses in certain situations. There is one form that makes you better at deflecting blaster bolts, one that is good for fighting many enemies, one that is best against other Jedi and few that either make you regenerate your FP faster or which make your force powers better. All in all it is a decent range of styles - there is one problem with them. They all seem to look the same, and the bonuses they offer so small that it makes them largely irrelevant. For example I was able to defeat a major Sith lord who was supposed to be totally bad ass dude, without ever switching out of the standard Shii-Cho style which is said to be an anti-mob technique that is not supposed to work well against other Jedi. So while they are a nice touch, and they do use proper names from the SW expanded universe lore, they really don’t do much in game terms.

k2_00040.jpg

This is what the combat looks like. My biggest problem with it - the thing that irked me the most was the lightsaber combat itself looked a little bit like this:

  1. you encounter a mob of low level bad guys, and the game auto pauses
  2. you select the closest enemy with your Jedi character and fill up the queue with attack orders
  3. you un-pause the game and watch your jedi Jedi run up to the opponent
  4. *whack* *whack* *whack*
  5. The enemy just got 3 direct hits with a lightsaber but his HP is only slightly below 50%. You will need to score 3 or 4 more hits to actually kill him.

In other words, the most deadly weapon in the SW universe seems to have been reduced to nothing more than a glowing night stick. Anyone who has watched Star Wars movies, and saw lightsabers in action will agree that this goes against everything that we know about these weapons. I won’t say it’s unrealistic, since the concept of lightsaber itself is a bit far fetched. Nevertheless they are depicted as being able to cut through steel like a knife cuts through butter. Getting hit by a lightsaber is usually either fatal, crippling or instantly incapacitating. KOTOR however treats it like a glowing club with a respectable but not deadly damage attribute. In effect you whack a low level, poorly armored opponent 5-6 times to actually kill him. A boss level opponent can easily take 20 or more direct hits like that without even flinching.

k2_00082.jpg

I know why this is done. It is a HP based combat system - which means you roll to hit, then you roll for damage, adjust for armor value and subtract that value from opponent’s HP. It’s the staple D20 mechanic, and we all know it very well from tabletop games. Someone somewhere sat down, and calculated exactly how many hit points an average dude should have, and what should be the damage potential of each weapon to make combat interesting. Introducing one-hit-kill weapon would make this system very unbalanced. The player would effortlessly cut through hordes of bad guys who would no longer pose any challenge making regular combat almost an inconvenient chore. Conversely boss level fights would become incredibly frustrating as a single unfavorable roll could instantly end the game (since we are trying to be true to the movies, lightsaber should be equally deadly for both sides). This would surely ruin the fun for most players - or at least those who are not fast enough with the quick save button.

Shamus Young of Twenty Sided Tale already wrote a great post about an alternative dueling mechanic which would result in much more realistic looking combat that does not rely on the old HP concept. I think it is a great idea, albeit quite complicated one - and applying it to a game such as KOTOR would require a complete overhaul of the gaming mechanic.

k2_00083.jpg

I thought about it for a while, and I believe that few small tweaks could achieve a similar desired cinematic effect without totally throwing out the HP system. First let’s make the lightsabers and vibroblades lethal. A lightsaber should instantly kill a human sized enemy ignoring any or all armor. Vibroblades should have similar effect on unarmored enemies, but have a tougher time against heavy armored opponents. Big beasts and droids may still require 3-4 lightsaber hits since they will likely have more HP than your average Jedi (they should at least). Yes, I know - I totally unbalanced the game just now and did exactly what I said would spoil all the fun. Bear with me though, I’m not done yet. Next we throw away the HP bar in close combat. Instead we replace it with a focus meter as per Shamus’ dueling rules. The focus meter is a stand-in for HP. Each time you parry a blow, it goes down. If it drains down to zero, you fail to defend yourself and die. The focus should be recovered slowly at pace similar to your FP regeneration and force buffs such as Battle Meditation or Force Valor should give you an instant focus boost or speed up it’s regeneration. We could even add a dedicated focus recovery powers. There are tons of various combat drugs and stims in this game, so we would make some of them boost up your focus as well, making them extremely useful and sought after.

We don’t really have to implement other ideas in Shamus’ article like stamina, saber locks and etc. The focus concept is both simple, and brilliant. We are essentially using the exact same gaming mechanic but lightsaber combat now looks true to the films. No need to muck up the working system with any more rules. It’s a simple change but it makes a world of difference. Though, if we wanted to do more mucking around, we could look at the Lightsaber forms.

I mentioned them above for a reason. I never found much use for them, but we could make them vastly more important. Instead of offering minor buffs in certain situations they could be made into something that is absolutely crucial to victory. We would redefine all the styles, and make them into a sort of rock-paper-scissors matching game. To increase your chances of winning you would have to use the right style.

k2_00073.jpg

For example the Soresu form hailed as the ultimate defensive style for example would minimize the amount of focus you could lose. So your opponent would have to break a sweat and go all out on flurries and power attacks to actually make a dent. As a downside, it would severely limit your offensive capability making your blows having similarly small impact on your enemy’s focus bar.

The beginner Shii-Cho style would be great for fighting many opponents at the same time (sweeping blows damaging everyone in range) but useless in duels against someone using the Makashi form designed to drain maximum amount of focus per blow against lightsaber armed opponents, but totally useless fighting mobs, or deflecting blaster bolts.

The Ataru form (most recognizable as the crazy ass style which Yoda uses in the prequels) would employ acrobatic attacks from all angles would make you hard to hit (thus preventing the enemy from draining your focus with a barrage of blows) but would drain your FP as you jump around all over the place.

The Niman form also known as diplomats form would let you substitute your focus with FP to allow Jedi Consulars and scholars to fare well against combat oriented opponents. The Vaapad form would make your attacks devastating, but leave you open to attacks doubling the focus damage you suffer.

And so on - I guess you can catch the drift here. Instead of minor bonus to certain rolls, you make it a crucial element of your strategy. To be successful you would have to train your characters in the right styles, and then apply right combinations for a given opponent.

This is really what I was thinking when fighting all these opponents in the game. How much better it would be if the designers could have read that Twenty Sided post before releasing the KOTOR games. But I think they would need a time machine to do that, as these games seem to be what brought about that article. P

Anyways, while I’m nitpicking, I must show you this:

k2_00060.jpg

How do you prevent bunch of armed Jedi from getting onto your property? It’s easy, you make a knee high barrier out of big stone slabs with huge gaps in it. It’s full proof against force jumps and lightsabers that can easily melt through rock. It seems that towards the end of the game, designers were getting lazier. Dantoine is so full of insurmountable waist high fences that it’s not even funny. This game mechanic was not so evident in places such as Narr Shadda (with it’s bottomless pits and high walls), Isis (natural city scape) or Korriban (ruins everywhere). Dantoine however is supposed to have these large open areas and spanning vistas - so the level designers opted for the easy way out.

Next KOTOR post will be about the story which is excellent, and the characters who despite my initial comments turned out to be very interesting. I think I said enough negative things about this game for now. )

Machine Empathy

Friday, April 4th, 2008

A lot of people I meet tell me that they are not good with computers/technology when they hear what I do. I often wondered why do they do that. It seems like a silly self deprecation. In this day and age it is kinda shameful thing to say - almost as bad as for example publicly admitting you dropped out of high school. I used to think that not being able to deal with technology was an intellectual or developmental problem - that these people simply had a low IQ and probably also struggled with math, science, and basic logic concepts. I really had a low, opinion about people like that. There were exceptions - for example I didn’t expect certain age groups or professions to have a lot of exposure to computers, and thus didn’t hold it against them. For example my dad never really had to use a computer in his life, so I fully expect him to struggle with it. However some of the young kids who spend their lives on myspace, or professionals whose job revolves around sitting in front of a computer have no excuse.

Over time however I notice that a lot of these people who should not have any excuses are actually fairly bright. Many of them were good students, or diligent professionals considered to be very good at their job. They were able to excel in certain fields, and actually understood basic math and science. I realized that this is not an intellectual problem, but rather an attitude issue. They were unable to deal with technology not because of stupidity, but because they simply didn’t want to deal with it.

The main difference between me and most of my coworkers is that when I encounter a computer issue, I don’t go into a panic mode, but rather try to troubleshoot or work around it. Someone from the peanut gallery will say it’s because of my education, but let me shoot that concept down right away. It’s bullshit. I never had any training in IT. My degrees are in computer science, which, despite popular belief has nothing to do with tech support. When I landed my first tech support job, my only prior experience was actually owning a PC or two. Everything I know about tech support I found on Google. And that’s precisely what I’m getting at - doing rudimentary tech support stuff simply requires essential problem solving and online research skills.

On a daily basis I see very smart people who can go into a random company, dig through cooked books and all kinds of financial shams, uncover fraud and unmask all the shady shenanigans based on numerical discrepancies in the documentation they can get their hands on. These people are great at problem solving - this is what they do! But if they hit a technology issue at some point, all of a sudden they drop everything and turn into bumbling fools who can’t even read the error message from the screen back to me. Why is that?

The difference between us and them seems to be the fact that we have this weird intangible “good with computers” thing going on. I dubbed this trait as “machine empathy” because I believe it is more about understanding technology and being able to relate to it. It’s fairly simple if you think about it. If you want to work with animals you need to learn how to read them, know what they are capable of, and how to interact with them to get desired responses. Same with people - if you want to be a good motivator, or counselor of some sort you need to figure out how people work, and how to push the right buttons.

If you want to work with technology, you need to familiarize yourself with how machines work, and how to interact with them. I believe this is a skill that can be learned over time and through practice - just as the people skills. Only machines are much easier because they do not have mood swings, bad days, pms or just plain old bad attitude. They do not get angry and they do not hold grudges. They are always consistent, and for the most part reliable. It’s really not that difficult to figure out how to approach them, and how to make them cooperate. In comparison handling people (or animals) is much more difficult task.

I believe there are two major factors that contribute to the popper attitude towards technology:

“I’m bad with computers” is a self fulfilling prophecy

The very notion that someone can be bad with technology (or for that matter bad with anything) is deeply ingrained in our culture. But it is such a defeatist, self deprecating approach. If I ever have kids, I will do my best to try to root out this kind of thinking in them as early as possible. The major problem is that if you truly believe you are not good at something you will never actually get better. People simply go “I don’t seem to have the natural inborn talent for this thing, so I’m not even going to bother trying to improve this skill” which is absolute bullshit. While you may not have interest in particular subject, and others may actually be able to progress faster, if you apply yourself, practice and make a real effort you will eventually get better - it is inevitable.

People who consider themselves “bad with computers” simply refuse to learn about their machines. They use this excuse because it is easier to claim one is genetically incapable of learning technology, than it is to actually put some effort into figuring the inns and outs of the machine they use on a daily basis to do their job. Sadly, there is no “technology” gene. No one is born with the knowledge how to operate a computer. Each of us has to learn it at some point. Some people may learn faster than others, but every single human being has the capacity to learn how to use technology properly.

Fear is the mind killer

The second big issue for many people is fear. They are literally afraid to break their computers by doing the wrong thing. Fear is a show stopper - someone who is constantly worried about breaking something will never experiment, and never deviate from a beaten path - and thus will not learn new things. Fear must be extinguished - and the only way to do it, is by facing it head on.

I must not fear.
Fear is the mind-killer.
Fear is the little-death that brings total obliteration.
I will face my fear.
I will permit it to pass over me and through me.
And when it has gone past I will turn the inner eye to see its path.
Where the fear has gone there will be nothing.
Only I will remain.

My attitude is this: so what if it breaks? Hardware can be replaced. Software can be reinstalled. Data can be restored from backup (you remembered to back it up before you started tinkering, didn’t you?). The only way you could actually suffer material or monetary loss is if you hose your hardware, which is very difficult to do if all you are doing is messing around with the software. So really, the worst case scenario is reinstalling the operating system if you really fuck things up. In fact, I know people who change their OS the way some women change hand bags - they get 3 or 4 new ones each season. I can pretty much install Windows and/or Ubuntu in my sleep, so the worst case scenario is really not so bad. As long as you have backups of your data, you are fine. Once you realize that, the fear will go away, and you will be on your way to become the local computer guru.

These are the two show stoppers. Once you remove these roadblocks I believe a person will become much more receptive and attuned to technology - assuming they will make an effort to actually learn something new about it. I refuse to believe that there is a single person on this planet who would be physically or psychologically incapable of developing this sense of machine empathy. It is all about the desire to learn. And once you get it - once you figure out what you can expect from your machine, you can do anything with it. Google is your firend. )

Next semester I plan to try tackling these two major show-stopping issues in my class in a much broader way. I’m hoping that if I try to change their attitudes (even slightly) I might be more successful in showing raw knowledge down their throats later on. I probably won’t reach everyone (some people simply refuse to learn anything in college on a principle) but it might be worth to try this.

Rails 2.0 on Ubuntu Gutsy

Thursday, April 3rd, 2008

I must confess that Rails makes me feel stupid every time I use it. The accepted truism about the framework is that it boosts your productivity like no other. Unfortunately people forget to tell you that there is second part to this statement that goes something like this: “once you learn to think the Rails way”. It really forces a certain mindset upon you, and deviating from it means that you are actually working against the framework, rather than having it do the work for you. It takes a little while to get used to it, and there are moments when you have a great scaffold thing going on with bunch of interacting tables/entities, but you sit there for 20 minutes trying to figure out how to make a simple pull down menu (aka select statement) which would let you choose the foreign key from the other table. You could do it the hard way, but it turns out that it is astonishingly simple:

<%= collection_select :foo, :bar_id, bar.find(:all), :id, :bar_name %>

This will create a select statement looking something like this:

<select name="foo[bar_id]">
    <option value="1" selected="selected">Bar 1</option>
    <option value="2">Bar 2</option>
    <option value="3">Bar 3</option>
</select>

It really took me some digging to figure that out - mainly to realize that what I needed was in a ActionView::Helpers::FormOptionsHelper class. A lot of the online tutorials simply gloss over little details like that - for example, the importance of helpers, which I now know are pretty damn convenient.

Then there is that whole Rails 2.x vs. Rails 1.x debacle. The two are not entirely compatibile, and there are significant differences in the way they work. Needless to say, when version 2.0 instantly invalidated every single Rails book on the market by removing the active scaffolding which everyone was using in the initial examples. I already got burned on it once, and now I was hit with it again, only from the other side. When I decided to install rails on Gutsy, I did what any reasonable Ubuntu would do:

sudo aptitude install ruby rails mongrel

Few minutes later I was all set up and ready to go. Or was I? I gently issued a command like this:

script/generate scaffold Foobar foo:string bar:string

I got hit by some cryptic error about unknown string identifier or something among those lines. WTF? It took me few minutes of useless googling, and cursing to realize I simply had the old version of rails installed. I could have went along and simply use the nice active scaffolding for my project, but I figured if I am to learn this damn framework, I should probably use the latest and the greatest version. How to install it on Gutsy though? The answer is - via gems.

First, get rid of the 1.x rails installation if you actually have it on your system:

sudo aptitude remove rails

Next, install the new rails:

sudo gem install rails --include-dependencies

That should do it. I think it’s possible to downgrade back to 1.x if you remove rails via gem and then install it back via apt bur I haven’t tried it.

Also, small caveat - you may or may not need to update your gems package to do that. You can do it by issuing a command:

sudo gem update --system

Be warned that it will actually break the gem command itself. If you try running it, you will get the following error:

/usr/bin/gem:23: uninitialized constant Gem::GemRunner (NameError)

Why is this? Take a look at this:

$ ls -l /usr/bin/ | grep gem
-rwxr-xr-x  1 root   root        701 2007-08-24 01:18 gem
-rwxr-xr-x  1 root   root        785 2008-04-01 11:25 gem1.8
-rwxr-xr-x  1 root   root       3201 2007-08-24 01:18 gemlock
-rwxr-xr-x  1 root   root       1778 2007-08-24 01:18 gem_mirror
-rwxr-xr-x  1 root   root        515 2007-08-24 01:18 gemri
-rwxr-xr-x  1 root   root         70 2007-08-24 01:18 gem_server
-rwxr-xr-x  1 root   root       1813 2007-08-24 01:18 gemwhich
-rwxr-xr-x  1 root   root       7947 2007-08-24 01:18 index_gem_repository

Apparently all the gem_* commands have been deprecated in the 1.x releases of rubygems. The version in gutsy repo is 0.9.4 which means it still uses them. The update command brings you to 1.1.0 release but unfortunately does not remove the old scripts from /usr/bin. So the original gem and gem_ commands are useless. Quick workaround here is:

sudo mv /usr/bin/gem /usr/bin/gem.old
sudo ln -s /usr/bin/gem1.8 /usr/bin/gem

You could probably remove the gem binary, but I simply renamed it, and then created a link to gem1.8 in it’s place. It works well enough, and if you need to do a downgrade later on, all the files are still intact.