Friday, July 31, 2009

command-line edit foswiki topics

We use foswiki at SDO for our "Local Operating Procedures" (LOPs). These many consist of numbered steps, with some metadata attached.

I recently was tasked to add a document number to the metadata. Easy, except with hundreds of documents, I didn't want to do this manually.

Each Wiki topic is a text document. The text document also stores the metadata (like the document number). Of course, since it's text it is easy to edit and script the edit with perl.

However, each topic text file also has an associated RCS file for versioning information. If you just edit the text file, the web page itself looks fine, but you can't see the change you made in the page's history (unless you make another change using the web interface).

But it turns out to be very easy to record your direct text file edits in RCS. Simply do
rcs -l TextFileName.txt
## now make your changes using whatever method (manual, scripted, etc.), then:
ci -mnone -t-none -wusername -u TextFileName.txt

That's it! Now the edits you made from your terminal are visible in the topic's history.

Sunday, July 26, 2009

WTF: drive-by Jehovah's witnesses?

On my way to work, I stopped to get gas. As I get out, a car pulls up on the other side of the pump, and I see an smiling old lady. She says "hi" or some other greeting and I replied with some meaningless friendly greeting ("morning", perhaps). I then proceeded to start pumping gas.

As I take my hand off the handle, to turn lean on the car to wait for it to finish, the old lady is RIGHT THERE next to me, trying to hand me a brochure of some kind. I looked down at it, and it reads "blah blah Jehovah blah blah" (I don't remember what the other words were).

WTF? Since when to Jehovah's witnesses do fucking drive-bys?

I was instantly angry. It's bad enough knowing these delusional people exist, let alone having them come by your home, and now apparently in public as you try to go about your day, to try to spread their bullshit!

"God does not exist", I said. "Now get away from me!" I glared at her, practically daring her to say anything else to me.

She wasn't a very good Witness, I guess, because she got away.

Thursday, July 16, 2009

Setting up a Linux system with a 3.5TB disk

As mentioned in my last post, I have this remote linux system with 3.5TB of disk, but broken into two LVMs. I want most of the storage to be in one big disk.


Today I had my remote monkey put the RHEL4 WS DVD in the machine and rebooted it. I entered the RAID BIOS (Dell PERC 5/i) to delete the existing virtual disks. I then created two new virtual disks -- one of 250GB for the OS, and one of the remaining 3.4TB for the data.

I booted from the RHEL DVD and entered "rescue" mode, because anaconda does not support making GPT disks. Then I entered
parted /dev/sdb
mklabel gpt
mkpart primary 0 3571900M
quit
Then:
mkfs.ext3 /dev/sdb1
Making the EXT3 FS took about 22 minutes.

That's mostly it! I rebooted and ran anaconda this time, setting up LVM on /dev/sda (except /boot, of course). I left /dev/sdb alone.

Wednesday, July 15, 2009

Want to convert partition table from MBR to GPT

One of the Linux (RHEL4) systems at work has about 3.5 TB of disk in a RAID configuration. Unfortunately, the guy who setup the system (not me) had apparently never heard of GPT before. So, he partitioned the RAID into two portions -- one of 2 TB, and the other 1.5 TB. Each of those partitions is managed by LVM.

Despite hours of searching, I am unable to figure out a way to convert these to one big 3.5 TB partition. The operating system is mostly installed on LVM-managed parts of the disk, so I can't destroy the partitions and redo them without reinstalling the OS.

The best part is that the system is 2,000 miles away. Fortunately, we recently installed a digital KVM switch to the system. We also have someone there that can manage to insert the installation CD. With the KVM I can reconfigure the RAID and reinstall the OS remotely.

By the way, if you are thinking of getting an Avocent KVM switch, and you want to use LDAP authentication -- well, you better have Active Directory, because Avocent's crappy software does not allow you to configure the LDAP authentication query. In addition, their tech support seems to be both clueless and illiterate.

Friday, July 10, 2009

Make the Windows XP Calculator always start in scientific mode


I got very tired of having to select "View..Scientific" every time I started the calculator (calc.exe).

It turns out that if you are a non-administrative user (you're not doing daily work as an admin, are you?), then it doesn't save the last-used state.

To make the calculator start in scientific mode every time, edit C:\WINDOWS\win.ini, and add this:
[SciCalc]
layout=0


If you're using Vista, you can set it in the registry