Monday, May 31, 2010

Backing Up Your Blog

After the discussion about creating disk backups I realized that I haven't been terribly diligent about backing up this blog. After all, what if Google should fail? Thousands of words of my deathless prose might be lost. (I know I've written some unforgettable things. Just last week I got three emails telling me how my posts had affected them. Only two mentioned nightmares.)

So how do you back up a Blogger blog?

One way to do it is to download the monthly archive HTML. The advantage to this is that everything in in HTML, and easy to read. But you have to remember to do it. I did, for a while, but haven't done it for some years. Sloth, I know.

But there is a way to download the whole blog:

  1. Log onto your Blogger account.
  2. Go to the Dashboard, if you're not there already.
  3. Click Settings.
  4. Click Export Blog.
  5. Click the orange button.
  6. A big file, ending in .xml, will appear in your download folder.

Note that the xml file is hard to read, but if you're moving your blog from one account to another it's the easy way to go. Also note that this does not save pictures or comments, those linked (the HTML archives don't save the pictures, either). So you'll have to find that stuff yourself.

This doesn't save your blogger template, either. To do that, go back to the dashboard, click Layout, then Edit HTML, and Download Full Template. Important if you have witty sayings embedded in you blog header.

Also note that either the HTML or XML backups are useful for searching your blog, because that Google search box in the upper left doesn't always find everything you've written.

Sunday, May 30, 2010

Return With Us Now to the Thrilling Days of Yesteryear

I'm not very good at doing disk backups.

OK, let's be honest: I'm terrible at doing disk backups. Oh, back in the day, every once in a while I'd copy as much of the disk as I could onto CDs or DVDs. But that takes a lot of time, and, as disks become larger while DVDs don't, requires a lot of picking and choosing to figure out what goes where.

To be fair, I haven't needed to. In all the years I've run computers here at home, I've never had a disk crash that lost data, even after our most serious disk mishap. So not having a backup hasn't been that big a problem. (Insert your favorite ominous foreboding music here.) Anyway, backups are a pain in the neck.

My view of backups has changed, though, primarily because they're so much easier now. Easiest, of course, is Apple's Time Machine. Plug a second disk (USB, Firewire, internal, if you've got such a thing) into your Mac, let it format to Apple's HFS format (or not), and start Time Machine. Tell it which directories you want to back up, and it will do that, every few minutes. Then you can actually scroll back through time (Tardis sounds not included) and pick out a file you might have deleted a year ago — assuming you were running Time Machine back then. It's an extremely neat and easy-to-use utility, and takes the pain out of doing backups, as long as you remember to leave the external disk plugged in, if that's what you've got.

Then, last week, Office Depot ran a sale where you could get a Terabyte Verbatim USB disk for $79.99 + tax. I bought three, one for Hal, one each for the college students.

Now the disk comes with Nero backup software for Windows (taking care of student I), and Apple's got Time Machine (taking care of student II). But what about poor Hal, stuck in Linux?

I called up the Synaptic package manager and typed backup in the search box. That brought up, among other things, a package called backintime, which is a front-end which uses the utilities cron (to schedule backups), diff (to find which files are changed), and rsync (to copy files that have changed to the backup disk). Perfect. I installed the program — actually both backintime-common, the guts, and backintime-gnome, the graphical front end, then went to get the disk.

Problem: Verbatim formatted the disk to the lowest common denominator, FAT32. This is not suitable for low-volume backups, because it does not allow multiple hard links to the same file. What backintime does, you see, is create a copy of your chosen disk directories every time you schedule a backup. The trick is that unchanged files are hard-linked from one backup to the next, taking a minimum of space. Only the changed files are stored in multiple copies. Since the FAT format doesn't do multiple hard links, it can't do the trick, and so we need to reformat the disk to a better file system.

So I installed gparted from Synaptic, launched it (using sudo gparted), and formatted the Verbatim disk to ext3 format.

Second problem: If you just plug a USB disk into a Ubuntu box, it auto-mounts, but is usually only accessible to the user who did the mounting (to be fair, I haven't tried this with a USB ext3 disk). That's unacceptable in a backup system that needs to be accessible to everyone. So we have to set up /etc/fstab. To reflect this. Ideally, we'd add a line which looks something like this:

/dev/sdd /backup ext3 errors=remount-ro 0 2

(Note added after the fact: The last entry on this line should indeed be a 2, not a 1 as previously listed. This this tells fsck to check this file system after any file system with a 1 in the last column. The only file system with 1 there should be the boot partition. Everything else can be a 2, unless you don't want fsck to look at the file, in which case you put in a 0. Got that?)

create a directory entry /backup, and then doing

mount /backup

would load up the disk drive.

However, since you usually have multiple USB ports on your system, there's no guarantee that this disk is going to always get /dev/sdd as its port. The solution is to use the ext3's UUID, which was created when gparted did its thing. You find the UUID with the command:

sudo blkid
[sudo] password for hal:************
/dev/sda1: LABEL="PQSERVICE" UUID="0A72323D72322DB7" TYPE="ntfs" 
/dev/sda2: LABEL="SYSTEM RESERVED" UUID="CCA811C2A811AC48" TYPE="ntfs" 
/dev/sda3: LABEL="Gateway" UUID="7E143E7F143E3A8B" TYPE="ntfs" 
/dev/sda5: UUID="2eec3fff-73d2-419c-8a3c-b92733d46da2" TYPE="swap" 
/dev/sda6: UUID="f3781533-d891-46e1-b9f0-839e8a538d35" TYPE="ext4" 
/dev/sdb1: LABEL="Verbatim" UUID="9deee42d-539b-45c5-8683-e95f889c1792" TYPE="ext3"

Verbtim is how I labeled the disk partition of the USB drive, so that's the UUID we want. Fill out the line in /etc/fstab as:

UUID=9deee42d-539b-45c5-8683-e95f889c1792 /backup ext3 errors=remount-ro 0 1

and we're ready to go. Note that this will automount so that everyone can read it every time the disk drive is plugged in and turned on.

That settled, setting up backintime is easy. You can specify the directories you want to back up, and the file types (say, those ending in ~ or .o) and directories you want to exclude. You can then select a backup time interval: minutes, hours, days, weeks ... Once you have a set of backups, you can use the graphical interface to look through your files of any snapshot, and restore a file that was deleted or moved on your main system, or copy it to another location if you like. It's very nice and easy to use.

You can see your backup schedule using crontab:

crontab -l
@daily nice -n 19 /usr/bin/backintime --backup-job >/dev/null 2>&1

Note the @daily there. That means the backup will start every night at midnight, and it's the only choice backintime gives you if you select a daily backup. This is unsatisfactory for me, as someone is frequently using the computer on and after midnight. So I used crontab -e to edit this entry, changing it to
0 3 * * * nice -n 19 /usr/bin/backintime --backup-job >/dev/null 2>&1
which launches the backup at 3am. backintime accepts this, but note that every time you change your setup it will reset the time to @daily. Just watch it.

Anyway, now I have a disk backup. And since I've never had a major loss of disk data from one disk, having two disks copying the data should mean that it can never, ever, ever happen, right? (Insert even more ominous and foreboding musing here.)

Saturday, May 29, 2010

Rob Pegoraro Talks About Ubuntu

The Washington Post's tech columnist reviews Ubuntu 10.04 in his Sunday column and adds more comments in his blog.

I love the first line:

No Windows viruses. Free. Any questions?

Friday, May 28, 2010


Ubuntu, and most Linuxes, by default come with an empty /etc/hosts.deny file. I'd argue that by default it really should look like this:

$ cat /etc/hosts.deny


  • If you don't know what how the /etc/hosts system works, you shouldn't allow others to access your machine.
  • If you do know how it works, then you know enough to edit the files to do what you want.


Monday, May 24, 2010

Ubuntu 10.04: Things I Forgot

Things I forgot when I was listing my useful programs from Ubuntu 10.04:

  • The gimp: Manipulate images just about anyway you want, without paying Photoshop prices. For example, you can make transparent PNG images.
  • xsane: Scan documents (scanner not included).
  • chromium: the unbranded version of Google Chrome. This is my current browser of choice, and I forgot to list it before because it was the very first thing I installed. Note that it's available in the repository. If you want the branded version, you can get a .deb file directly from Google's site.
    For some reason, Ubuntu only distributes the unbranded version of chromium, but it offers, by default, the branded Firefox browser and an unbranded version, which it calls abrowser.

I'm sure there are more to come, I'll either add them here or start another post. Stay tuned.

Sunday, May 23, 2010

Ubuntu 10.04: Update Notification Icon

One thing that doesn't seem to be present in Ubuntu 10.04 is the little notification icon that shows up on your panel when the update manager has found programs to install. If there is some notification I haven't seen it.

Apparently this has been going on since 9.04, but for that version of Ubuntu I was running IceWM rather than Gnome as my window manager and so missed it. But Watching the Net didn't, and shows the way to restore the Update Icon by turning off the update notifier, whatever that is.

Apparently once the new improved update notifier (which I've never seen in action) is turned off the old style notifier kicks in. This is in the province of gconf, that all-seeing, all-knowing application that tells other programs what your likes, wants, and needs are — sort of like Facebook.

So to turn off the new-improved version and go back to the thing that works, open a terminal window and type (or cut and paste):
gconftool -s --type bool /apps/update-notifier/auto_launch false

Alternatively, launch gconf-editor, click on the + sign next to apps, scroll down to find update-notifier, click on that, and then uncheck the box that says auto_launch.

Either way, you're done, and the old icon will come up the next time you have an update available.

Saturday, May 22, 2010

Ubuntu 10.04: Installing the 64-bit Intel Fortran Compiler

OK, let's get take care of this right up front: Warning: This page discusses the installation of free-as-in-beer, but not free-as-in-speech, software. If you want to keep such software off your system, then don't install this compiler. Also note that the license is pretty restrictive, i.e. Non-commercial means you are not getting compensated in any form for the products and services you develop using these Intel® Software Development Products. However, the installation process should work for the commercial version of this compiler.

I first learned to program in Fortran. I still have my original WATFOR/WATFIV textbook, though I later graduated to Fortran 77 and occasionally write some Fortran 90. I still do a lot of things in Fortran 77, just because I'm comfortable writing code starting in column 7.

Now there is an open-source Fortran 77/90/95 compiler, gfortran. It's reasonably fast, portable, nice — did I mention free? But it has a few quirks. For example, one of my old codes has a subroutine second which measures elapsed time. gfortran assumes that I'm calling the intrinsic function second, and bombs the compile because I don't have a proper calling statement. So I have to go in and declare

      external second

in every subroutine that calls my second.

But Intel makes its Linux Fortran compiler free-as-in-beer for non-commercial development. And the 64-bit version of the code includes Intel's optimized Math Kernel Library (MKL). It's a fairly simple registration, and you don't sign over much of your soul. However, in Ubuntu it's a fairly difficult installation. What's more, it changes every time you install a new version of the compiler.

The installation steps for the current compiler and Ubuntu are straightforward, but there's a lot of fine print, and the 64 bit version has a couple of quirks in the install. So let's go over it step by step. Note that I'm only referring to the 64-bit install in all of this. If you're running in 32-bit mode, your mileage will vary.

  1. Register. It's easy. You'll get a link to the download page an a serial number. Save the email, you'll need it.
  2. Download the appropriate tar file. I used the Genuine Intel® 64 bit version. There's another one called IA64, but I didn't try that.
  3. Now set up your machine to compile code. Run:
    sudo apt-get install build-essential gcc g++ rpm ia32-libs
    and either
    sudo apt-get install sun-java6-jre
    which requires you to accept Sun's Java license, or
    sudo apt-get install openjdk-6-jre-headless.
  4. Now you need a package called libstdc++5 which isn't included in Ubuntu. Worse, if you're on a 64 bit machine, you need to install the 32-bit version as well. So click on these
    the 64-bit code, libstdc++5_3.3.6-18_amd64.deb
    the 32-bit code, libstdc++5_3.3.6-18_i386.deb
  5. Install the 64-bit version:
    $ sudo dpkg -i libstdc++5_3.3.6-18_amd64.deb
    $ dpkg --extract libstdc++5_3.3.6-18_i386.deb ./
    $ cd usr/lib
    $ sudo -i
    # cp /usr/lib32
    # cd /usr/lib32
    # ln -s
    # exit
  7. Now we can do the install. Go back and find your Fortran tarball
    $ tar xvzf l_cprof_p_11.1.072_intel64.tgz
    $ cd l_cprof_p_11.1.072_intel64
    $ sudo -i
    # ./
  8. Take all the defaults, and enter your registration number when asked. Note that you'll get some error statements to the effect that you're running this on an unsupported system (Ubuntu) and the option
    1. Skip missing optional pre-requisites [default]
    take that.
  9. Your compiler is now installed in /opt/intel/Compiler/11.1/072/ (the last number will vary), but you're not quite finished.
  10. If you use the bash shell, add the line
    source /opt/intel/Compiler/11.1/072/bin/ intel64
    to your ~/.bashrc file.
  11. If you use the tcsh shell, add the line
    source /opt/intel/Compiler/11.1/072/bin/ifortvars.csh intel64 to your ~/.cshrc file.
  12. Now you're done. Look at man ifort to see how to use the thing.

My preliminary test indicates that the Intel compiler is about 10% faster than gfortran for a fairly CPU intensive calculation, without the MKL. Not all that much faster, really. If you're not doing a lot of serious computations, installing the Intel compiler might not be worth the trouble.

Thursday, May 20, 2010

Ubuntu 10.04: Remove the Chat and Mail Icons but keep the Volume Control

I don't chat. I can find my email on my own, thanks. But I do like the volume control up on the panel. Thanks to Short IP Recipes for the fix: Remove the indicators from your system:

sudo apt-get remove indicator-me indicator-messages

Log out, log back in, and voilà!

Tuesday, May 18, 2010

Ubuntu 10.04: Getting Started

I thought about putting in installation instructions for 10.04, but someone beat me to it, did a better job, and added a lot more information:

Getting Started with Ubuntu 10.04

Downloads a PDF manual.

Disclaimer: I haven't read it all the way through, it may be chock full of errors. But it's cheaper than going out and buying Ubuntu for Dummies, and covers the current version.

Monday, May 17, 2010

The “Right” way to move buttons in Ubuntu's Gnome

Apparently using gconf-editor or directly editing the file $HOME/.gconf/apps/metacity/general/%gconf.xml to move the control buttons back where they belong is not the Correct Way to Do It and Will Cause Problems in the Future. Or so it says here (see #3).

Despite there always being More than one way to do things, we here at Linux & Things are always willing to show you The One True Way.

So here we go. Apparently, in the New Ubuntu Gnome, only the Ambiance, Radiance and Dust themes have buttons on the left. All the others still have buttons on the right. So if you want a Right-Wing Ambiance, say, you pick a Right-Wing Theme and edit it to Look Like Ambiance. Got that?

That's right. To make Ambiance with buttons on the right, edit, say, the New Wave theme and make it look like Ambiance:

  1. Click System > Preferences > Appearance
  2. Select New Wave and click Customize
  3. Click the tabs Controls and Window Border and select Ambiance for each.
  4. Click Icons and select Ubuntu-Mono-Dark
  5. Close

But don't forget The Other Way to Do It, for use when Ubuntu arbitrarily moves New Wave's buttons to the left.

Sunday, May 16, 2010

Ubuntu 10.04: The Good Stuff

Well, boys and girls, today I was going to talk about installing the Intel Fortran compiler and MKL libraries in Ubuntu 10.04. Unfortunately, the tar files Intel sent me are coming up with archiving errors, so I'll have to wait the track all of that stuff down until later in the week.

So today, let's talk about the good stuff, that is, things you can add to Ubuntu to make your computational life easier, or just more fun.

Start with a little list. Not mine, at first, it belongs to the indexer, who gives us his to-do list after installing 10.04. He gives you categories of program, the Windows equivalent, and the possible Ubuntu variants. There's also a rather complete source list that will allow you to download all of those files.

And then there's my list, which is a little more eclectic. All of these programs can be installed using the indexer's source list and the usual
sudo apt-get install xxxx
from a terminal window command line, where xxxx is the package name. Note that the links go to the program's home page, where I could or cared to find it:

  • alien: Converts other Linux package installers, particularly RPMs, to DEB format.
  • audacity: Record and edit audio files.
  • build-essential: All the tools you need to compile source code and build DEB packages
  • celestia: Planetarium program and space-travel simulator
  • celestia-gnome: Front end of Celestia
  • devilspie: Lets you tell programs where to open their windows on the Gnome desktop
  • emacs23: The One True Text Editor
  • emacs23-el: Extras for Emacs
  • emacs-goodies-el: And even more Emacs stuff
  • extremetuxracer: Get the penguin down the hill, while he collects fish.
  • ffmpeg: audio and video recordings
  • ftncheck: This is a Fortran lint checker, looking for errors in your Fortran code.
  • gfortran: Back aways I said that build-essential had all the tools you needed to compile programs. I lied. If you write in Fortran, you need a compiler. This is the free one.
  • googleearth: Google's mapping program. Note that this is technically non-free, you'll have to accept Google's license to use it.
  • googleearth-data: For use with Google Earth
  • gnumeric: For most applications I like this spreadsheet better than the one in
  • gnuplot: Scientific plotting program. It's script-driven, so you can edit it on the fly.
  • gthumb: Image/Picture viewer. Will import pictures from your camera.
  • gv: Postscript/PDF file viewer. This is really old, folks, but sometimes it works where a more modern program won't.
  • id3v2: Label MP3 file tags from the command line.
  • k3b: Write CDs/DVDs
  • kid3: Graphical MP3 tag editor
  • kdegames: The KDE game package
  • lame: Front end for writing MP3 files. See my SoX entry
  • latex2rtf: Supposedly converts LaTeX files to Microsoft's doc-lite format, aka rtf. I've used this program maybe twice in ten years, but, hey, you never know.
  • libk3b6-extracodecs: Addins to allow k3b to handle MP3 files
  • lynx: Text-based web browser. The original version was written at KU
  • mplayer: Music/video player
  • pdksh: Public-domain Korn shell. Pretty much like bash. I have dome scripts that still use ksh, so I keep this installed.
  • penguin-command: Clone of the Missle Command arcade game for Linux
  • sc: A text-based spreadsheet. I keep it around because I can edit the files with a script.
  • sox: See my Sox Post
  • spider: My favorite double-deck solitare game
  • sunbird: Stand-alone calendar program. If you want your calendar integrated with Thunderbird, see the Lightning plugin
  • ssh: secure shell. Log onto other computers with encryption
  • tcsh: The TENEX C Shell. An extension of the cshell
  • texlive: The default TeX/LaTeX package for Ubuntu
  • texlive-bibtex-extra: Puts your bibliography into a form LaTeX can use
  • texlive-latex-extra: More LaTeX stuff
  • texlive-publishers: Style files for various scientific journals
  • texlive-science: And still more
  • thunderbird: Mozilla's email program. I much prefer this to the default Evolution, especially since I can pass a users files back and forth between Linux and Windows machines
  • ubuntu-restricted-extras: Fun stuff for playing with forbidden files (MP3s, DVDs, etc.)
  • vim: Text-based full-screen file editor. This and Emacs are the first full-screen editors most early techies used.
  • vlc: Watch just about any kind of video
  • xmms2: Yet another music player
  • xpdf: The original PDF file viewer for X windows

Saturday, May 15, 2010

Fixing SoX — Again

June 15, 2011: In Ubuntu 11.04, you can add MP3 support to the Ubuntu supplied version of SoX with the libsox-fmt-mp3 package, so all of this is now unnecessary.

For as long as I remember in my Linux career I've been using Sound eXchange (SoX) to convert audio files from one format to another — in particular, converting to MP3 format so that I could play them on my audio player. As I've noted before, this isn't an easy task. Distributions are understandably reluctant to deal with the licensing and patent issues encumbering MP3 files and so let you figure it out for yourself.

The following seems to be the easiest way to do it. I got the basic process from Inverted Egg, but I'm not going to convert put everything into a .deb file, since it will just get rewritten with the next update.

Here we go:

  1. Download the SoX source tarball. It doesn't matter where you put it, we'll assume it goes to /home/yourname/Downloads.
  2. Open a terminal window and become root:
    $ sudo -i
    You'll get prompted for the password.
  3. Go to a useful directory to unload the source:
    # cd /usr/local/src
  4. Unpack the tarball. Note that the version name will occasionally change:
    # tar xvzf /home/yourname/Downloads/sox-14.3.1.tar.gz
  5. Load Ubuntu's version of SoX into the system, if it's not there already, along with the lame library and header files, which are responsible for mp3 processing:
    # apt-get install sox liblame0 liblame-dev
  6. Find all the packages that Ubuntu's SoX needed to compile, and install those you haven't installed already:
    # apt-get source sox
    That's why you needed to install Ubuntu's SoX in the first place.
  7. Now do the usual installation stuff:
    # cd sox-14.3.1
    # ./configure
    # make
    # make install
  8. Your new version of SoX is in /usr/local/bin/sox. Make sure it works, i.e. it converts files to mp3, and then delete Ubuntu's version of SoX:
    # apt-get purge sox

And you're done. Of course, every once in a while you're going to go back and look for updates, right?

Friday, May 14, 2010

Today's Ubuntu Annoyance: The Buttons are on the Left

In 10.04 using the Gnome desktop, the buttons to minimize, maximize, and close a window moved from the right side of the screen to the left. Being right-handed, it feels unnatural to have the buttons on the left, so I want to move them back. Trevor has the solution:

  1. Open gconf-editor, either from the command line or by pressing Alt-F2 and typing it in the box.
  2. Click on the + sign next to Apps.
  3. Scroll down on the left-hand-side until you find metacity. Click on the + beside it.
  4. Click on the folder labeled general.
  5. On the right-hand-side, find the label button_layout. Double-click it.
  6. In the box that appears, type :minimize,maximize,close. Order is important. The colon divides the left-hand side from the right. So if you wanted the close button on the right and the rest on the left, you'd type minimize,maximize:close.
  7. Click OK and you're done.

If you want to edit things by hand, it looks as though the appropriate place is the file $HOME/.gconf/apps/metacity/general/%gconf.xml, which should look something like this:

<?xml version="1.0"?>
 <entry name="button_layout" mtime="1273837457" type="string">

Although there may be other entries between the gconf lines.

Thursday, May 13, 2010

Ubuntu 10.04: gnome-screensaver and switch user

Bugs. Why does it always have to be bugs?

Anyway, with the advent of New Hal, my wife and I use the same computer. She doesn't do much more than check email, check Snopes to refute emails from the clueless, and make plane and hotel reservations. Things like that, she's not a heavy computer user. It's not likely that she's going to be running a 16 atom Quantum Espresso simulation in the background, unlike some people I know.

So it's OK for both of us to use the same box for most things. The idea way to do this is with the Switch User option, which works really well once you know each other's passwords and know about Ctrl-Alt-F7/Ctrl-Alt-F8. (Don't try this at home unless you have a really strong marriage.) So we both stay logged on, and use Switch User to get back and forth between our accounts.

Except that when you're both logged on all the time, you don't want the monitor running all the while. It wastes power, and it's annoying to walk in to the room and see the thing lit up in the middle of the night.

The default option is to use gnome-screensaver, which seems to be installed automatically with 10.04 and launches when you boot. Just set the options the way you want it and you're good to go.

Except — of course there's an except, why do you think I'd be writing otherwise — there's a bug. Multiple reported bugs, actually. There's 478253, 555870, 546578, 561538, and, lest we forget, 535467. All of them report more or less the same thing: when you use Switch User, sometimes the screen goes black.

A workaround is to run xgamma -gamma 1.0 when the black screen occurs. This is rather difficult because the screen is, in fact, black, and unless you're very lucky you won't be at the right spot on the screen.

So, following a suggestion in the comments to 561538, I ripped gnome-screensaver off the computer and installed xscreensaver. Set it up on both accounts, then went out to work on the lawn.

When I came back, GDM was cheerfully restarting itself every 2-3 seconds, complete with endless be-bop sound every time. I suspect that this is because the two instances of xscreensaver were competing with each other.

I'm not sure that's the case, but I worked under that assumption and killed the screen saver in my account. That fixed the problem, so I've left things at that. Now I just remember to switch the screen to my wife's account when I'm done on the computer.

Tuesday, May 11, 2010

Ubuntu 10.04: Fixing mtrr errors

Ah, so many things, so little time to write about them. I'm going to handle my Ubuntu 10.04 programs piecemeal, and in the order that I have time to write about them. So this one isn't the biggest problem, but I've got all the data available here, and it's a quick fix, so here goes:

I was looking at /var/log/messages to try to figure out why my wife's account logged itself off last night (never did find out), when I saw the message

MTRR allocation failed. Graphics performance may suffer.

Googled it, found this fix, which is to add the kernel boot options:

enable_mtrr_cleanup mtrr_spare_reg_nr=1

to the grub command line.

Uh, OK, how do I do that?

In the Good Old Days there was a file, /boot/grub/menu.lst, which had all the information you needed to get your computer started, including booting up and loading the kernel with the desired options. The problem was that this got rewritten every time you did a kernel update. There were some sections of the file that were supposed to be saved, but that required the update program to remember to save them.

Just to make sure the programmer didn't forget those kind of things, all of the user-specified options were moved to the file /etc/default/grub, and menu.lst has become grub.cfg, which is generated from /etc/default/grub by running update-grub.

Got that? Uh, so you just ... Oh, never mind.

Here's the fix for the mtrr problem:

  1. Run
    $ sudo vi /etc/default/grub
    to edit the grub configuration file.
  2. Look for the line
    and change it to
    GRUB_CMDLINE_LINUX="enable_mtrr_cleanup mtrr_spare_reg_nr=1"
  3. Save and exit
  4. Run
    $ sudo update-grub
  5. Check /boot/grub/grub.cfg to be sure the changes are in there
  6. Reboot
  7. Check /var/log/messages to be sure that the mtrr message has disappeared.

And, of course, I noticed a fantastic improvement in graphic performance — which means none, actually. But hey! I got rid of the error message.

Sunday, May 09, 2010

It's Here!

It's a computer! Have a Cigar.

OK, it's not really that big a deal, but it was a long wait. A month ago I ordered a Gateway SX2840-01 desktop through J&R. After being on backorder for a month, it got here on Monday.

Turns out it's better than advertised. Not only does it have the glowing reviews mentioned in the first post, but Consumer Reports named the top compact desktop, though they said not to buy it because of technical support issues — of course I'm not going to get Linux technical support from HP, either, so that wasn't an issue. The computer also came with 6 GB of memory, more than the 4 originally offered. The only thing it didn't have was a 1 TB disk. The disk actually comes out as 931 GB, but you knew that was going to happen, didn't you?

Of course, it came with Windows 7. I turned it on, booted up 7, said Ooh, shiny!, then went and downloaded the 64 bit version of Ubuntu 10.04. This installed easily, including all the disk partitioning — I left 7 on there, with 100GB of disk, because you never know. I played with the system for a week, and then spent yesterday consolidating all of the files from my old computer and my wife's computer (aka Hal and Hal's formerly evil twin) to the new box. I did have a few minor, and one not-so-minor, problems with the install, which I'll tell you about in the next few days. But, suffice it to say, after a week of using this machine I'm very happy with it.

Saturday, May 08, 2010

Neat LaTeX Tool

For those of you that don't know, LaTeX is the way to write scientific papers. It's set up to produce nice equations, put figures and tables more or less where you want them, collect references in the proper order (with the help of BibTeX), and generally make you look like you know what you're talking about. Publishers can even set up their own style sheets and macros (see the American Physical Society's REVTeX) so that your article looks right for the journal, and it's a minimal amount of effort to translate your work to the format of another journal.

That said, in scientific articles you often need weird characters, e.g. √, &Delta, ∇, etc. Since LaTeX's source is ASCII, you need to know that √ = \sqrt or \textsurd, Δ = \Delta, and ∇ = \nabla. Not to mention hundreds of other characters.

You'll eventually remember that α = \alpha, but will you ever learn that ⊃ = \supset? I won't. You could spend all your time looking up these symbols in tables (as I just did for the HTML), or you can go to the Detexify2 – LaTeX symbol classifier. Just draw in the symbol you want with a mouse, and you get a set of suggested LaTeX commands.

LaTeX and HTML handle formatting non-ASCII characters in similar ways. It would sure be helpful if someone would adapt this to work for HTML characters as well.

Monday, May 03, 2010

The Shortest Doctor Who Episode Ever

Outside a small house in London. The Tardis appears. Wilfred Mott comes out of the house, just as the Doctor comes out of the Tardis.

Wilfred: Doctor? What are you doing here? Donna might see you.

This is an automatic reaction upon seeing the Tardis. As he pauses, Wilfred notices something has changed.

Wilfred: You've changed again, haven't you.

The Doctor: Hello, Wilfred. Yes, I've changed. Some unpleasantness with — well, with something unpleasant.

Wilfred:But why are you here? If Donna sees you, even in this – this – body, she'll start remembering. And then, you said …

The Doctor: Wilfred! I've found a way to cure her!

Wilfred: Are you sure?

The Doctor: Yes, but I have to take her away …

As they are talking, Donna Noble comes out of the front door.

Donna: Gramps? Who's this, then?

Donna starts to look at the Doctor.

Donna: Look, you, whatever it is you're selling, we don't …

Before Donna can get a good look at the Tardis, the Doctor pulls out his screwdriver. There is a faint whining noise, audible only to those under 50. Donna collapses.

The Doctor: Sonic sedative. Come on, help me get her into the Tardis.

The Doctor and Wilfred carry Donna into the Tardis. Wilfred exits, the Doctor shuts the door, and the Tardis vanishes with the usual noises.

The Tardis reappears in what is obviously a library. OK, it's not just a library, it's the Library. It's dark, probably damp, and the books seem to be moving slightly. Maybe it's just the arrival of the Tardis. Or maybe not. Books left open seem to be turning pages themselves. We see the Tardis from the point-of-view of the Librarian. The Doctor emerges from the Tardis, and approaches the desk.

The Doctor: Here we are then. Did you find the book?

The Librarian: Ook!

The Doctor: Good then. Here's what else I need …

As the two talk, the scene shifts back inside the Tardis, where Donna is waking up. She looks around, pulls herself up, and starts out the door. She sees the Doctor and the Librarian at the desk. She still doesn't remember anything, but that will come.

Donna: Hey!

Both turn to look at her. We shift to a point of view behind Donna.

Donna: What's this. Who are you? Why have you grabbed me and took me to this — this — place? And what's with the monkey?

With that, the Librarian explodes. All we see is a large, dark fist striking the camera. There's lots of fur. Sounds of a scuffle. Lots and lots of Ooks. Then black.

The Doctor: What a waste of a perfectly good regeneration.

The End

Thanks to the Doctor Who Wiki and the Discworld & Terry Pratchett Wiki