The Death of the KVM Switch

Posted: June 23rd, 2010 | Author: | Filed under: Computers | Comments Off

This post is the first in a series tentatively titled “First-World Problems: How I Use Way Too Many Computers”. It’s true, I use and administrate way too many computers. Many times, I’ve had to interact with multiple different computers at a time, whether it’s to download patches or because one machine has specialized hardware for a particular task. It’s sometimes useful for those computers to share a keyboard and mouse, particularly so I don’t have to switch back and forth between two keyboards all the time. Traditionally, people have accomplished this with KVM (Keyboard, Video and Mouse) switches. A KVM switch has two or more input connections and an output connection; simply hook your computers to the inputs and your keyboard, mouse and display to the output and viola, you can share them.

I’m going to assert that KVM switches are awful. There are a couple reasons why:

  1. You have to switch back and forth between machines with a key combo. Often, this combo is not documented anywhere on the switch itself. Almost always, it’s non-modifiable. Always, it’s cumbersome.
  2. KVM switches are stuck in 1997. Most KVM switches use PS/2 and VGA connectors. Getting this to work with computers that use USB and DVI requires a bunch of separate dongles that only nerds like me have in abundance. Good luck finding a native USB/DVI KVM switch for under $150.
  3. More cables. Seriously, I’ve got enough cables cluttering up the back of my desk, I’d rather not introduce more cables if I can avoid it.

Thankfully, there are software solutions that allow you to bypass the need for a KVM switch altogether.

Synergy allows you to use a single keyboard and mouse among an arbitrary collection of computers. Synergy runs a server on the machine with the keyboard and mouse attached and clients on all the other machines. The user specifies how the displays of these multiple machines are arranged with respect to one another; for example, I could say that my laptop’s display is to the left of my workstation’s display. Synergy detects when the mouse hits the edge of a display and “switches” the keyboard and mouse from one computer to another based on the configured arrangement. So when my mouse hits the left edge of my workstation’s display, it is seamlessly transferred to the right edge of my laptop’s display. I’ve used Synergy this way for a while now, and I’ll never even think of buying a KVM just to share a keyboard and mouse again.

Of course, Synergy doesn’t take care of sharing a single display between multiple computers. Most monitors have multiple inputs, and if you’re willing to press the input change button, Synergy might still work, but it’s still cumbersome. Another alternative is to use VNC. VNC is a communications protocol, and is implemented by a ton of different clients for all platforms (Google “VNC” for a list of the big ones). It essentially allows you to view and control another computer remotely. Those of you running Mac OS X Snow Leopard will probably use Screen Sharing for this, but under the covers it’s still VNC.

Both these solutions are cross-platform, pretty easy to set up and have a wide range of graphical helper applications and front-ends. They share the common disadvantage that they send data unencrypted, which means that any enterprising hacker could view your keystrokes as they travel over the network. Thankfully, it’s easy to solve this problem. There are a number of applications that will create a secure tunnel between two computers (Google “SSH tunnel” for more information). Alternative protocols to VNC like NX provide all the functionality of VNC over an encrypted connection. There are a lot of options, and the best part is that almost all of them are free.

So in short, if you’re thinking of buying a KVM, save $100 in cables and dongles and use software instead.


Wolfram Alpha is My Master Now

Posted: June 6th, 2010 | Author: | Filed under: Computers | Comments Off

Part of my research lately has involved asking a lot of questions like “What’s 100 TB / X / (N*D) in MB per second?” and “What’s the amount of time it takes for a 7200 RPM disk to go through half a revolution?” (reasons for this will be revealed later). Google Calculator is great for this. If you’ve never heard of Google Calculator, that’s because it’s built into Google Search. Try going to Google and search for “10 hectares in square parsecs” to get an idea for what I mean. It supports tons of unit conversion formats, but it’s lacking in support for calculations relating to bytes.

Megabytes or Mibibytes?

As a bit of exposition: a common question when buying hard drives is “I just bought a 500 GB drive but it only has 465 GB of capacity when I hook it to my computer. I want my extra space back!” This discrepancy isn’t because hard drive companies want to screw you over (OK, they might be trying to screw you over, but not with this), it has to do with how computer science deals with bytes. In a network setting, measurement is typically done in powers of 10, so a gigabyte is 1000 megabytes. With storage, measurement is typically done in powers of 2, so a gigabyte is 1024 megabytes. So when you buy a 500 GB drive, your computer will tell you it’s a 465.7 GB drive because they gave you the powers-of-10 capacity and the OS displays it in powers-of-two. I know that Snow Leopard no longer does this to avoid confusion, but I’m not sure what Windows 7 does.

In an effort to resolve the confusion, the International Electrotechnical Commission (IEC) instituted a set of units of measurement that used powers of two, and kept powers of ten as the default. So according to IEC, a megabyte is 1000 kilobytes, and a mibibyte is 1000 kibibytes. The ‘-’-bi’ was supposed to invoke the word “binary” in the user’s mind. Personally I think they deliberately did this to make computer scientists sound ridiculous. Once you get up high enough you hit yobibytes, for Pete’s sake; that sounds like something you’d give Scooby Doo’s second-cousin Yobi Doo to make him cooperate.

Google Calculator deals explicitly in IEC units, but doesn’t follow the standard: if you ask it “how many bytes in a yottabyte” and “how many bytes in a yobibyte”, you get the same answer. This is intensely irritating if you care about powers of ten when you’re dealing with bytes.

Enter Wolfram Alpha

Wolfram Alpha is basically a thin veneer on top of Mathematica that allows you to access some of its simpler functionality for free. Mathematica is a mathematical toolbox that is so absurdly sophisticated and full-featured that I’m expecting it to gain sentience any minute. Just to give you an idea, the Mathematica documentation – complete with typesetting and figures – was written entirely in Mathematica. Scary.

I was hunting around for an alternative to Google Calculator’s unit conversion (and considering writing my own, such was my level of desperation) when I decided to ask Alpha. After all, you can ask Alpha “How many roads must a man walk down before you can call him a man?” so it must be able to do unit conversion, right? Turns out it can, and it honors the IEC specification! So if I ask it “how many bytes in a kilobyte”, not only will it give me powers of ten, it will ask me if that’s what I wanted and suggest kibibytes as an alternative!

It can also convert between decimal, binary (twos-compliment and unsigned), hex and octal. Hot damn.