Tuesday, October 23, 2007

Covenience of the Modern Age

I just have to send a shout-out to the convenience this networked world has just provided me...

I need a new set of tires for my WRX. It's currently riding on a set of Cooper Zeon 2XSs that have about 1/64" of tread left. So, online I go, to look up a good set of tires...

http://forums.nasioc.com

http://www.tirerack.com
http://www.tires-easy.com
http://www.gotodobbs.com

And within 15 minutes, I know exactly what I want: Goodyear Assurance TripleTred 205/55 R16 89H. They are a very highly rated all-season tire that looks great, and comes with an 80,000 mile tread warranty. I also have two quotes, from Tirerack and Tires-Easy, including shipping. So, off I go to Dobbs (which is about 100 yds away from my office), to negotiate a price. 10 minutes later, I have signed an outstanding deal that essentially amounts to $150/tire, mounted, aligned, balanced, and fully insured. The car will be ready by the time I'm ready to go home.

Within 30 minutes of making the decision to get a new set of tires, I've fully researched my options, and my car is on the rack, getting exactly what I want, for a reasonable price. Throw in an extra 5 minutes to blog about it.

Thursday, October 18, 2007

Resi's Visit to STL

When Resi Stiegler came to St. Louis last week, she took some time to stop by Northwest Coffee in Clayton and visit w/the Hidden Valley Ski Team. She was a totally cool, very down to earth person. She had no trouble fitting right in, actually. Aside from the fact that she had an entourage, she was just one of us racers!

The World Cup opener at Solden is coming up at the end of the month, so she's getting ready to start the new season. She's only 21 years old (turns 22 in Nov.), and she's already collected top 10 finishes in three World Championships, and two top 15 finishes at the 2006 Olympics. She has several top 10 finishes on the World Cup ciruit, last year nearly cracking the top 3 with a 4th place finish at the super combined in Altenmarkt-Zauchensee. This could be the year!

Man, just look at me... I'm such a nerd with my stupid pager poking her in the side. Well, you can tell she's a person of the people. She didn't even complain. If you want to see the rest of the pictures, I've posted them here.

Good luck this year, Tiger!

How to batch resize images from the command line

I just discovered this little gem of information... If you have the Imagemagick tools installed, you can use the mogrify tool to resize a bunch of images at once. For instance:

# mogrify -resize 70% *.jpg

This tip adapted from the original tip found here.

Thursday, October 11, 2007

Woodworking Lesson Learned

Over the past few months, I have come to the following conclusion about woodworking...

Rule 1: Creating parts with straight, flush angles is 50% of the craft. If you can not cut boards with precision, you cannot create quality work.

You must be able to cut a board's length square to its width, while keeping the side square to the face. Likewise, you must be able to cut a board's width square to its length, and make its faces square to its sides, etc. This all sounds quite trivial, until you try to do it. If your tools are of poor quality, you will find it is nearly impossible to keep the tool calibrated long enough to make a clean, square, or correctly angled, cut.

If you cannot calibrate your tools to the proper levels of precision, or it takes you 10... 20... 30 minutes to do so, you will probably never find pleasure in this art, because you will be wasting all of your time trying to make proper cuts, and wasting wood, instead of actually building something.

Tuesday, October 09, 2007

Iraqi Civilian Deaths

Have you ever noticed that most articles about the war in Iraq never fail to mention the number of American deaths due to the war, but they never report the number of Iraqi deaths?

The most sickening part is that the number of Iraqi civilian deaths is wildly disproportionate (on the high side) to the number of military/security forces deaths.

For example (just the three most recent CNN articles):

http://www.cnn.com/2007/WORLD/meast/09/07/iraq.main/index.html
http://www.cnn.com/2007/WORLD/meast/09/05/iraq.main/index.html
http://www.cnn.com/2007/WORLD/meast/08/22/iraq.main/index.html


I did find a website that is tracking the number of reported civilian deaths, which is at least something: http://www.iraqbodycount.org/.

The numbers are staggering. Below is an embedded Javascript counter that has the current totals.



Note we're just talking about Iraqi civilians here. Regular people in their cars, at their desks, in their houses, on the sidewalk. These are the people that are taken out by suicide bombers, snipers, insurgent gangs, and, of course, by collateral damage due to war. According to this article, that last cause may be more significant that you would think.

Note also that the current upper number (81,556) is about 27 times the number of people we lost in 9-11. Twenty Seven. As if what happened on 9-11 happened 27 times.

Before the age of mass communications, mass media, and relatively cheap and abundant international air fares, it may have been easier to dismiss some distant country's civilian population as "the enemy". However, to think that way today would take some kind of horrific, evil arrogance, and to boot some kind of effort in blinding oneself from the incontrovertible evidence that all humans on this Earth are in fact people.

Every modern country has their working class, their bourgeois, and their upper-class. Some countries may be run by a psychotic villain, and others by seemingly incompetent nincompoops, but regardless of the "leadership" that somehow found power, the people that live in other countries around the world are workaday folks, just like you and me. I don't see how anyone could turn their backs on such a flagrant atrocity as what's going on in Iraq today.

President Bush and his minions should be tried in an international court for crimes against humanity. I'm sickened that so many innocents are dying, and my country's image is being dragged through the shit because of these despicable, greedy, self-righteous warmongers.

That's right, the whole premise for going to Iraq is bullshit. Weapons of Mass Destruction. Whatever. It was about Oil. It was about using Iraq as a rallying point for terrorist activity to keep it off of our own soil. It was about killing Saddam Hussein. It was about showing off American military power (kind of fucked that one up). What else?

Under Clear, Cool Skies

Sometimes when it's clear at night, and there's only a delicate, scattered veil of cirrus clouds that stars shine brightly through, I wonder how anyone could think it isn't the creation of God. And with so much horror in the world today, how could anyone in their right mind not be desperate for peace?

Friday, October 05, 2007

How to Migrate rootvg from EVMS to LVM2

I have been using EVMS to manage my Gentoo Linux box for the past few years, primarily because its LVM and RAID features were integrated, but now that it appears EVMS is not going to be accepted by the community at large, and mdadm has emerged (dramatically improving the manageability of Linux software RAID), and LVM2 has seen significant improvements in functionality, I'm ready to migrate to a more standard configuration: LVM2 VGs on Software RAID partitions.

This procedure is what I used to upgrade from a single 36GB SCSI drive that hosted my /boot, swap, and root VG via EVMS to twin mirrored 36 GB SCSI drives using LVM2 and Software RAID...

The original 36 GB drive in this procedure started as /dev/sda,...

0) Shutdown
1) Install the new pair of disks as sdb and sdc
2) Boot (ideally into single user mode, so your file systems will not be trafficked while you're copying data from the old ones to the new ones)
3) Partition sdb and sdc to the following:

Disk /dev/sdb: 36.4 GB, 36420075008 bytes
255 heads, 63 sectors/track, 4427 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 8 64228+ fd Linux raid autodetect
/dev/sdb2 9 73 522112+ 82 Linux swap / Solaris
/dev/sdb3 74 4427 34973505 fd Linux raid autodetect

4) # mkswap /dev/sdb2
# mkswap /dev/sdc2

5) You may need to create md devices first before this creating the arrays with this next step, depending on how old your version of mdadm is, but in later versions it automatically creates them for you. If you do need to, mknod /dev/md0 b 9 1; mknod /dev/md1 b 9 2

# mdadm --create /dev/md0 --level=1 --raid-devices=2 /dev/sdb1 /dev/sdc1
# mdadm --create /dev/md1 --level=1 --raid-devices=2 /dev/sdb3 /dev/sdc3

6) The name rootvg is already in use by my original root VG, so I named the new one rootvg2. The name can be changed later, so it doesn't really matter what you call it.
# vgcreate rootvg2 /dev/md1

7) # lvcreate -L 1GB -n root_lv rootvg2
# lvcreate -L 1GB -n tmp_lv rootvg2
# lvcreate -L 2GB -n var_lv rootvg2
# lvcreate -L 10GB -n usr_lv rootvg2
# lvcreate -L 11GB -n games_lv rootvg2
# lvcreate -l 2138 -n foo_lv rootvg2 # <<-- notice 2138 is the total remaining extents in the VG

8) # mkfs.ext3 /dev/rootvg2/root_lv
# mkfs.ext3 /dev/rootvg2/tmp_lv
# mkfs.ext3 /dev/rootvg2/var_lv
# mkfs.ext3 /dev/rootvg2/usr_lv
# mkfs.ext3 /dev/rootvg2/games_lv
# mkfs.ext3 /dev/rootvg2/foo_lv

9) Mount the new file systems and copy over the current rootvg's data to the new FSs
# mount /dev/rootvg2/root_lv /mnt
# mount /dev/md0 /mnt/boot
# mount /dev/rootvg2/usr_lv /mnt/usr
# mount /dev/rootvg2/var_lv /mnt/var
# mount /dev/rootvg2/tmp_lv /mnt/tmp
# mount /dev/rootvg2/games_lv /mnt/usr/games
# mount /dev/rootvg2/foo_lv /mnt/foo
# cd /
# tar -clvf - . |(cd /mnt; tar -xf -)
# mount /boot
# cd /boot
# tar -clvf - . |(cd /mnt/boot; tar -xf -)
# cd /usr
# tar -clvf - . |(cd /mnt/usr; tar -xf -)
# cd /var ... (etc.)

10) Because udev won't be active on your new root when you boot, you actually need to populate the new root's /dev directory with some rudimentary devices.
# cd /mnt/dev
# MAKEDEV std consoleonly fd md hda hdb hdc hdd sda sdb sdc sdd

11) If you don't already have one, you need to create an initrd image to boot with that will load both md and LVM2 devices. Either genkernel or lvm2create_initrd should work. I used the "Make your initrd" procedure from the HOWTO Install Gentoo on an LVM2 root partition wiki. Once you've created the images, of course you need to create the new entry in your new /boot's grub.conf. I used the genkernel method, and mine looked like this:

title LVM2 Linux vmlinuz-2.6.16-gentoo-r7deuteronomy
root (hd0,0)
kernel /vmlinuz-2.6.16-gentoo-r7deuteronomy udev dodmraid dolvm2 root=/dev/ram0 init=/linuxrc lvmraid=/dev/md1 real_root=/dev/rootvg2/root_lv ramdisk=8192
initrd /initramfs-genkernel-x86-2.6.16-gentoo-r7genesis

12) Update your /etc/fstab in the new root (/mnt/etc/fstab) to reflect the new device names. Mine looks like this:

/dev/md0 /boot ext3 noauto 1 2
/dev/rootvg2/root_lv / ext3 rw,user_xattr 0 1
/dev/sda2 none swap sw 0 0
/dev/sdb2 none swap sw 0 0
/dev/rootvg2/tmp_lv /tmp ext3 rw,nosuid,user_xattr 0 1
/dev/rootvg2/var_lv /var ext3 rw,suid,user_xattr 0 1
/dev/rootvg2/usr_lv /usr ext3 rw,user_xattr 0 1
/dev/rootvg2/games_lv /usr/games ext3 rw,nosuid,user_xattr 0 1

13) Save your new RAID configuration to /mnt/etc/mdadm.conf. Be sure to anticipate the change in device names (i.e. the current /dev/sdb will be the new /dev/sda, and the current /dev/sdc will be /dev/sdb after our next reboot).
# echo "DEVICE /dev/sda1 /dev/sda3 /dev/sdb1 /dev/sdb3" >> /mnt/etc/mdadm.conf
# mdadm --detail --scan >> /mnt/etc/mdadm.conf

10) Install the new MBRs on your new mirrored root disks (using GRUB)
# device (hd0) /dev/sdb
# root (hd0,0)
# setup (hd0)
# device (hd0) /dev/sdc
# root (hd0,0)
# setup (hd0)

11) Shutdown to power off
12) Reassign SCSI IDs so your two new root disks are the first two (0 and 1, or 0 and 2... whatever you like), and put the old root disk as the last ID.
13) Boot

I think I included all the steps I used here. Sorry if I left anything out!

Monday, October 01, 2007

Cathay Yesterday... Yesteryear

It was one year ago today that I boarded a plane in Shanghai to return home from my Chinese journey. That was certainly one of the most memorable trips of my life. We don't have any trips to China scheduled for now at work, but hopefully I will get to go again. If not for work, I will certainly have to go some day on my own to revisit the friends I made there, and further explore that vast and rich culture.

Since then I've continued to study the Chinese language, but not enough to be proficient. I've actually only studied diligently for the past month or so. In November my friend Zhao Gang came to St. Louis for some training, and he and a friend found time to come to my house for tacos and ice cream, which I know they enjoyed. I wanted to serve something I did not see in China, and Mexican cuisine was not to be found anywhere, even in Shanghai.

Above is a picture of Eric, Li Jian, and me at an outstanding German restaurant called Paulaners in the Pudong New Area in Shanghai on the second night. I think I had the beef knuckle. It was delicious! We ate there on the last night too (after we had been to Wuhan and back).

If you're at all interested in how to interpret Chinese characters, I urge you to read the two sample chapters of Communicating in Chinese (Yale Press) that are provided online. This book teaches you to read Chinese by showing you how the symbols evolved from their primitive beginnings as actual pictures, to the more complex characters they've become.

After the readings, you may feel enough swagger to chance a guess at what some of the symbols on this rock behind Eric and I mean... Well, if you can read it, good one on ya, because even our friend Jarod Li, who took this picture, was having trouble deciphering it. The picture was taken at East Lake in Wuhan. It's evidently a very old script. Pretty fun to try reading it though. If I remember right, it tells the story of why a nearby bridge was finally built as a symbol of peace between two warring clans.

Sorry, but I did leave that picture at its original size, so you can click on it to see the characters at high resolution.

Another great resource, if you're interested in learning Chinese, is the MIT OpenCourseWare sight. They have posted no less than 6 Chinese language courses, plus one Chinese literature class, and a culture class online. I highly recommend you pay them a visit, and if you can, make a donation!

Blog Archive