Category Archives: Lifehacks

Lifehacks

How to Cook a Server (Sunny Side Up?)

Last night, just as I was falling asleep, I heard my phone ring out a text message tone. (Incidentally, it’s this sound, a customized version of one found on the Monty Python website. It can be startling.)

I leaned over to look at it. The head node from the cluster was checking in to let me know it was feeling a little warm (80 degrees F). The temperature in our server room keeps creeping up. Today it was blamed on a campus-wide chilled-water problem. The cluster is only using about 1/4 of the cooling capacity in the server room, and is almost the only machine in there. We should not be having these problems.

I use the IPMI capabilities of the head node to check the internal sensor every ten minutes, and it emails and texts me if the temperature exceeds some threshold. It is hard, though, to get a good idea of what’s going on from a single temperature at a single time. Has the temp been slowly rising? Has it jumped from 77 to 95 in ten minutes?

To make this easier to check, I wrote a little script that generates a plot based on the last 24 hours of my temperature log. You can see the results below. The image below is pulled straight from the cluster, so it should be up to date regardless of when you’re viewing this post. If you’re looking at it pretty shortly after this is posted, you can still see the spike that woke me up and the sharper one that got me worried this morning.

temperature plot over the last 24 hours

The temperature is of course not jumping like that — the precision of the sensor is limited. The rightmost edge is “now”, if that’s not clear. I used xmgrace to produce this plot from the command line / script. If you’d like any of the code for this let me know.

Command Line Tricks – Using mdfind and mdls in Mac OS X

Beginning with version 10.4 (“Tiger”), Mac OS X has had a powerful indexing and search engine built in. This can be used from the graphical interface, which is how most mac users interact with it. However, a command-line interface allows for some powerful searching and scripting.

This article by Andy Lester goes through the basic usage of the mdfind and mdls utilities, and gives examples of how to use them with UNIX pipes and in shell scripts.

Just as an example, to find text in any file on the system with find and grep, you’d have to do something like:
find / | xargs grep "my search string"

This would run grep on every file in the system, which is horribly inefficient and will take forever. With mdfind, you’d simply type:
mdfind "my search string"
This will use the existing search database to find the appropriate documents.

(N.B. – Spotlight cannot actually do a “phrase” search like the find/grep example above. See this story for more detail and some work-arounds.)

Updates to Google Notebook Make It Even Better As a Lab Notebook

In October of ’07, I posted about my move to Google Notebook as my primary lab notebook. It has not only continued to serve me well since then, but now serves me even better with the addition of a few features:

  • Auto-dated notes: I’d be happier if I could opt for auto-timestamps as well, but Google now adds the date a note was created (not sure if it updates it when edited but I don’t think so) to the upper right-hand corner. Now instead of putting the date and location at the top of each note, I just put the location.
  • Sharing: It’s now easy to share with others. I’ve shared my notebook with my advisor so that she can follow along if she likes. I used to do this on our lab wiki as well. It would also be possible to have a shared notebook between all of the people on a project, almost like a private blog. I think this latter use has a lot of potential
  • Labels: Google has added labels (in practice the same thing as ‘tags’), making it possible to tag each entry with the projects to which it is related. Pulling up all of the notes on a project is then as simple as selecting the appropriate label.

It keeps getting better. Hopefully, they will add those automatic time stamps at some point.

My Wallet (Or Lack Thereof)

I’ve gotten a lot of strange looks over the last two or three years because of how I carry my cards and cash. I abandoned wallets of any kind because they either (a) more than double the volume of what I’m carrying or (b) they have too much stuff in them. That is, if there’s enough in them that they don’t double the volume, it’s too much and sits funny in my pocket.

Luckily, I found the solution with cheap and plentiful office supplies. (Please note, I will show you that the Money Band and its cousins are both unnecessary and way overpriced. They are akin to pet rocks.) All you need are a thick rubber band of a certain length, and a paperclip. Any size paperclip will do, but the larger ones work better.

Observe:
wallet

Money Bands: $0.60 each
Rubber Bands: $0.016 each
Jumbo Paper Clips: $0.006

Or, look at it this way:

Money Band: 1-year supply for $3.00
Paper Clips / Rubber Bands: Lifetime supply for you and all of your friends for $10.30

I think the choice is clear. The way of wrapping the rubber band that I use is also superior. It’s also nice not to have to take out everything at once — just the money or the cards. The two don’t really fit together properly, even with a Money Band.