UNIX Toolbox

UNIX-like operating systems are immensely powerful. They give one access to the minutest details of the operating system with command-line utilities. The major downside of command-line interfaces is that it is not readily apparent which commands are available and what they do. One can spend hours poring through man pages looking for related program names, instructions and examples to accomplish a simple task.

One way out of this is to use command references. When I first started using Linux, I bought a boxed edition of Red Hat (version 7, I think), which came with a wrist-rest sticker. This long sticker was designed to be stuck on a plastic keyboard wrist rest and contained some common BASH commands such as ls, cd, and mv, with brief examples. This was very helpful to me as a new Linux/UNIX user.

After 8 years of using and administering Linux and Mac OS X (BSD) machines, I have a pretty good handle on the command line. Nonetheless, I was very happy to find this UNIX toolbox document via nixCraft.

Some highlights that I discovered and will be employing from now on include:

  • fuser -m /home – Find out what programs have files open on the /home (or another) partition.
  • sysctl hw – get extensive hardware information on BSD (including OS X) systems.
  • dmidecode – Get BIOS information. I actually learned about this in the past two weeks. Sometimes it’s necessary to create /dev/mem (sudo mknod /dev/mem c 1 1) before this will work. One handy use for this is to get machine serial numbers without having to visit the datacenter.

These are just the most interesting examples from the first ten pages. Aside from simple commands, the document also includes instructions for complicated and infrequently-used but occasionally-necessary tasks that I never remember how to do off-hand. One could spend half an hour or so reading man
pages and HOW-TOs online to find the right incantation, or just find the precise instructions in this toolbox. Such groan-inducing operations include:

  • Mounting SAMBA partitions.
  • Mounting loopback devices such as CD images.
  • Burning CD images from the command line.
  • Converting between DOS and UNIX text file formats.
  • Basic database administration.

and several others. I plan on printing the booklet version of this PDF at lab tomorrow and keeping it at my desk and in the server room.

For possibly-NSFW (but text-only) entertainment, check out a BASH of another variety.

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.

Infinity and Beyond

My friend Rob has another excellent mathematical post up. It has, in fact, been up since December 14th, but I’m only now catching up with my starred RSS items from last month.

This post is on the nature of infinity and other large numbers, and how we mentally relate to and handle them. Here’s a taste:

[I]f you look at infinity from a size standpoint, infinity is dizzyingly terrifying. Most people don’t have a proper concept of what “large” means, but mathematicians know better:

  • The universe is 13.7 billion years old, or 4.3*10^-17 seconds. Current quantum theory has trouble measuring time below Planck’s time constant, or 1.855×^-43 s. If we treat the idea of time as a discrete number of Planck’s constants, then the age of the universe is 8*10^60 of these constants. Infinity is bigger than this.
  • The number of atoms in the universe is estimated to be around 10^80.
  • The biggest number ever seriously used in mathematics is Graham’s number. The number is an upper bound for some mathematical property. The number is so huge that it cannot be written with scientific notation (the exponent would have more digits than atoms in the universe). Still, infinity is bigger than this number.
  • The Ackermann function is a strange non primitive recursive function:
    ackermann function

    This function generates huge finite numbers. For example, A(5,2) is so large that it cannot be describing it with common math notation would take more letters than there are atoms in the universe (this includes 9^9^9^9^9^9… etc.). Still, infinity is bigger than this number.

Read the whole thing here.