Monthly Archive for September, 2009

Mike’s “Ultimate” Dual-Monitor Rackmount Home Computing Environment

Well folks, It’s been over a year in the making, but my “ultimate” home computing environment is finally done. If you remember my last post on this subject, I was contemplating the idea of (tastefully) integrating a 12U server rack into my living room. I had actually been thinking about this for a long time prior, but I had never heard of anyone else who had done it, so I was really hesitant to go down that road and risk wasting a lot of money and getting stuck with a horrible monstrosity. But then I saw what this guy had done, and I knew I was on the right track all along.

A typical PC mess. I couldn't live like this any longer!

The first thing I needed was a new desk, and since I live right down the road from an Ikea outlet, I started my search there. Now I should mention that I’m normally really skeptical about Ikea furniture because of their apparent love of particle board, but I was pretty impressed by their Galant Series of desks. The tabletop is particle board (of course), but I don’t care, since all the important structural components are made of aluminum. I settled on a 63″ wide Galant desk with the optional filing cabinet.

I also wanted a new chair, but that wasn’t actually part of the original plan for this project. I had pretty much been set on getting a Herman Miller Aeron Chair from the first time I ever sat in one, but since there was nothing wrong with my current chair, I couldn’t justify spending money on a new one. But then in a stoke of sheer luck, I happened across a used one in my local craigslist for $300. Obviously, I couldn’t pass up that deal.

Now that the boring furniture was out of the way, I needed to find a well-built server rack that would actually look good in my living room. As you can imagine, this was not an easy search, but I eventually settled on the Kendall Howard 12U Compact Series SOHO Server Rack. This is a really high-quality rack, and the price reflects that, but with a little patience, I was eventually able to find one on eBay for $300 (with front and rear mesh doors included).

Nice rack!

Next came the need for a couple of well-built rackmount cases that looked good and wouldn’t be as loud as an air conditioner. I considered Antec’s Take 4 Series and iStarUSA’s Silent Rackmount Chassis, but I decided they were both way too expensive for what they were. I settled on a couple of iStarUSA D-400s for about $150 each and iStarUSA 24″ TC-Rails for about $25 each. But I have to say that I was really disappointed with the rails, because they really short you on screws. If you just stick with what they give you, I can almost guarantee that your server will fall out of the rack, and I say this because it happened to me twice while I was racking the empty cases. I ended up just buying more screws at a local hardware store.

Assembling the rack

When I started researching monitors, the big question was “Two or three,” but since I’m not a hardcore computer gamer, I decided pretty quickly that three monitors would just be overkill. I eventually settled on two LG L227WTGs for about $220 each. I’m still contemplating buying a dual monitor stand, but I’m not sure if I would gain anything other than a little bit better cable management.

The rest of what I bought for this project is fairly uninteresting, but I’ll list it here for completeness:

Assembling my workstation and server

The other machine in my rack is a dedicated server that, among other things, hosts the website you’re looking at right now. The specs on this machine are fairly dated, as this is actually my old desktop from 2003, but I’ll list them as well for even more completeness:

The rack fully assembled

Other stuff in my environment (listed for ultimate completeness):

Since cabling was one of my major concerns, I really took my time and made sure all the visible cables were routed as neatly as possible, making liberal use of Velcro straps. And because everything is so tightly packed together inside the rack, I was able to further minimize the cable mess by replacing all the standard 6′ cables (power, network, USB, etc.) with 1′-3′ versions.

The results

As you can see, my new computing environment takes up about the same amount of space as the old one, but it looks way nicer and is much easier to work on (since everything is mounted on sliding rails that can be fully extended when necessary). It’s also semi-portable now, thanks to the casters on the rack itself.

Using Puppet’s Exec Resource to Run Commands Manually

The title of this post may seem confusing. The whole point of Puppet is to promote efficiency by eliminating manual administrative tasks, so why would anyone want to use Puppet to do things manually? Well, one simple example is when you want to install software from source, or from a binary package that is not supported by the package type. Your first instinct may be to use exec to do something like this:

exec { "install-foo":
    command => "curl -s -o /tmp/foo.run http://example.com/foo.run \
                && chmod o+x /tmp/foo.run \
                && /tmp/foo.run ",
    creates => "/usr/local/bin/foo",
}

This is pretty straightforward. The “command” parameter downloads and installs the package, while the “creates” parameter tells Puppet not to execute the command again as long as “/usr/local/bin/foo” exists. This keeps Puppet from unnecessarily downloading and reinstalling the program over and over again, but what happens when there’s a new version of foo.run? How does puppet know when it’s time to upgrade?

There may be better ways of doing this, but here’s a simple approach that has worked well for me:

$serial = "2009092501"
$serialfile = "/var/log/puppet/foo.serial"
exec { "install-foo":
    command => "curl -s -o /tmp/foo.run http://example.com/foo.run \
                && chmod o+x /tmp/foo.run \
                && /tmp/foo.run \
                && echo \"$serial\" > \"$serialfile\"",",
    unless  => "test \"`cat $serialfile 2>/dev/null`\" = \"$serial\"",
}

Notice that after running the command, I echo the value of $serial into the file at $serialfile. Then I use the “unless” parameter to check if the contents of $serialfile equals the value stored in $serial. If the values match, the command will not be executed. But now when I want to upgrade the foo package, all I need to do is update the value of $serial.

Citrix Receiver and SSL Error 61 on Linux

Are you getting an error like this?

You have chosen not to trust “Go Daddy Secure Certificate Authority”, the issuer of the server’s security certificate (SSL error 61).

The solution is to download the appropriate root certificates (Godaddy’s are here) and save them to /usr/lib/ICAClient/keystore/cacerts.

wget -P /usr/lib/ICAClient/keystore/cacerts --no-check-certificate https://certs.godaddy.com/repository/gd-class2-root.crt https://certs.godaddy.com/repository/gd_intermediate.crt https://certs.godaddy.com/repository/gd_cross_intermediate.crt

Edit: One of my co-workers has a script that will do this for you.

Mass File Rename with Linux

When people ask me why I love Linux so much, I tell them it’s the little things; like being able to do very simple mass file renaming on the command line:

rename "s/foo/bar/" *.baz

The first parameter is a Perl expression. The second is a file glob. This command will replace the string foo with the string bar in all filenames ending in .baz.

My RHCE Exam Experience

On September 4th, 2009, I took the new 3.5 hour, single-section RHCE exam. This was my first time taking the exam, and to be perfectly honest, it was nowhere near as challenging as I thought it would be. While I don’t want to downplay the significance of the RHCE certification or give anyone the false impression that the exam is necessarily easy, I do want to emphasize that contrary to popular belief, it is quite possible to self-study your way to a perfect score. Not only was I able to breeze through the entire list of test objectives, I had time to thoroughly check and double-check all of my work with almost an hour to spare. This meant I was done long before anyone else in the room, including those who took the official Red Hat training courses. So how did I accomplish this feat?

The first thing you should know is that I had already been working professionally with Linux for ~10 years before I began studying for the exam. I doubt that so much experience is really necessary, but because the exam measures actual competency on live systems rather than your ability to memorize or “read between the lines,” I think it’s highly unlikely that someone with little or no working knowledge of Linux could successfully cram for this test. So I’d have to say that experience is an important prerequisite, but I’d also have to say that experience alone is almost certainly not enough. Considering the wide range of subject matter, it’s very likely that you’ll be tested on something you’ve never had to touch before.

In my opinion, the hardest thing about self-studying for the RHCE exam is knowing how much you need to know about each study point in the RHCE Prep Guide. In other words, when it says something like “you need to know basic configuration of x,” it’s hard to know exactly what “basic configuration” means. Although I’ve signed an NDA preventing me from revealing any details about the exam itself, I can tell you that nearly all of my study material came from two places:

  1. RHCE Red Hat Certified Engineer Linux Study Guide by Michael Jang
  2. Red Hat Deployment Guide

The rest of my study material came from search engines. I spent a lot of time comparing other people’s study notes to mine and reading anecdotes about the RHCE exam. While the result of this was usually a temporary blow to my confidence (there are a lot of horror stories out there!), I did find a few blogs and forum posts with some helpful information. Usually it was just an alternative way of doing something, but it was also nice to come across the occasional words of encouragement from a self-studied RHCE. Just knowing that other people had done it gave me a slight confidence boost (as I hope this post does for some of you).

The first thing I did was read Michael Jang’s book cover to cover, just trying to absorb what I considered to be the most important information from each chapter (i.e. concepts rather than commands). This took me a week or two. When I was done, I set up a test environment using VirtualBox. Then I decided it would help to have a condensed, single-page study guide to refer to, so I created a “wikified” version of the RHCE Prep Guide which I called my RHCE “cheat sheet”. For the next few weeks, I went through each study point on the “cheat sheet” and used my study material to test and document everything I thought I might need to know.

I found Michael Jang’s book to be a great study guide (the labs and example problems were a huge help), but I wasn’t completely happy with the amount of detail on some topics, as well as how it tends to follow the Red Hat course outlines rather than just sticking to the RHCE Prep Guide. I also found quite a few typos and just plain incorrect information, so that’s where the Red Hat Deployment Guide came in. While I was working on the RHCE “cheat sheet,” I would usually read the appropriate chapter(s) from Michael Jang’s book first, then I would supplement it with the appropriate chapter(s) from the Red Hat Deployment Guide. If I felt particularly weak in a certain area, I would also peruse the man pages and any HOWTOs I could find online. This was a long, arduous process, but it helped ensure that I wasn’t missing any important details.

For the last couple weeks, I tested myself by putting the “cheat sheet” away, doing a minimal install of CentOS in my test environment, and trying to configure everything I could without referring to any documentation whatsoever. Since the test takes place on a live system, I assumed from the beginning that the man pages would be available, but in order to save time, I wanted to make sure I could do everything off the top of my head. As a result, I ended up memorizing almost everything on the “cheat sheet,” which is probably why I was able to complete the exam so quickly.

Since I didn’t have a study partner, preparing for the troubleshooting section of the exam was a bit of a challenge. I did come across an interesting project called Trouble Maker which directly addresses this problem, but unfortunately, it has not been updated in several years and does not work on recent versions of CentOS (Update 2010-08-25: It appears this is no longer the case!). For a while, I actually considered writing my own trouble maker program, but I ultimately decided that this would be too much work. Luckily, I have a few friends who know enough about Linux to make a machine unbootable, so we made a game of it. I would give them my root password and challenge them to do something that would keep me from using my computer, then I would try to fix it as fast as I could.

When it was all said and done, I spent roughly six weeks (studying a few hours each day) to prepare for the RHCE. Considering how easy the exam was for me, I believe that I worked a lot harder than I needed to, but the results were clearly well worth the effort. The best advice I can give to prospective RHCEs is to take your time and practice until you can do everything in the RHCE Prep Guide off the top of your head. If you feel weak in anything, do yourself a favor and postpone the exam.