Orange is my favorite color

Life has been nuts the past month or two. Lots of business travel combined with three weeks of being sick and it’s been a flat out race just to keep my head above water. A little good news came in the (e)mail this week though on the racing front:

Team SafeRacer sponsorship

I’ll be flying the SafeRacer banner on the west coast in 2010! I’m really excited to be working with SR as they are a true racer’s company. If you haven’t seen the announcement, they’re sponsoring the entire SCCA Club Racing series. That’s putting your money where your mouth is.

Back to the grind… have about three weeks before the first anticipated test of my new 2010 spec miata. The car has all the running gear and suspension mounted and we should be firing it up and rolling it around this weekend. If we can get the seat and safety gear in, the first shakedown should be right around the corner.

Just a quicky – turns out our logwatch was not giving us enough of an alert when a drive failed in our raid array. Obviously you want to replace a dead drive as quickly as possible to reduce the likelihood of a second or third drive failing and potentially taking your data with it.

For Linux, HP has a tool available called hpacucli for interrogating HP/Compaq array controllers (SmartArray 5i, 6i, whatever) from the command line. I installed this script into /etc/crontab.hourly/raidstatus:

#!/bin/sh
/opt/compaq/hpacucli/bld/hpacucli ctrl all show config | egrep -i (fail|error|offline|rebuild|ignoring|degraded|skipping|nok)"

The command /opt/compaq/hpacucli/bld/hpacucli ctrl all show config normally generates something like this (from our development database server):

Smart Array XXXXXXX in Slot 0      ()

   array A (Parallel SCSI, Unused Space: 0 MB)

      logicaldrive 1 (33.9 GB, RAID 1+0, OK)

      physicaldrive 2:0   (port 2:id 0 , Parallel SCSI, 36.4 GB, OK)
      physicaldrive 2:1   (port 2:id 1 , Parallel SCSI, 36.4 GB, OK)

   array B (Parallel SCSI, Unused Space: 0 MB)

      logicaldrive 2 (67.8 GB, RAID 1+0, OK)

      physicaldrive 2:2   (port 2:id 2 , Parallel SCSI, 36.4 GB, OK)
      physicaldrive 2:3   (port 2:id 3 , Parallel SCSI, 36.4 GB, OK)
      physicaldrive 2:4   (port 2:id 4 , Parallel SCSI, 36.4 GB, OK)
      physicaldrive 2:5   (port 2:id 5 , Parallel SCSI, 36.4 GB, OK)

I believe you can reduce the grep to just “(fail|nok)” but I’m taking the conservative approach here. Change the permissions to 0700 and if you have SELinux running make sure the context is set properly.

If your array and controller are in fine shape, then this command will output nothing. If you have a dead drive, it will generate content which will cause cron to mail the root user about it. Bingo – time to go to the colo!

I have seen other people use “ctrl all show status” which generates:

Smart Array XXXXXXX in Slot 0
   Controller Status: OK
   Cache Status: OK
   Battery Status: OK

I prefer to query the config which looks at individual physical drives in addition to the status of the array. I have seen cases (just last week) where one dead drive in the array still lists the array status as OK (because, technically, it is OK, it’s just not optimal and may be pending major disaster!)

Had a user call in – she accidentally deleted half of her attendees in our web app. She thought she was deleting two but instead hit the “toggle all” and ignored the pop-up confirmation dialog which hosed half of her data the afternoon before she needs to deliver it to her team. Awesome.

What does this have to do with jQuery? Well, while I’m waiting for a database dump in the background to finish downloading so I can extract some data, I whipped up a UI enhancements with a few lines of jQuery that might help someone else:

Highlight table rows with checked checkbox in a column

What if we highlighted the selected rows when the confirmation dialog pops up? It would be one more way of pointing out what is about to happen. Here’s what it looks like now:

batch change demonstration

In conjunction with Dan Switzer’s qForms library…

objForm.onSubmit = function() {
	// only ask for confirmation when they change more than 1
	if (objForm.uid.getValue().indexOf(",") != -1)
	{
		$('input[name="uid"]:checked')
			.parents('tr')
			.css('backgroundColor', '#fc0');
		var res = confirm('You are about to make a batch change in registration status.\n\nAre you sure you want to continue?');
		if (!res)
			$('input[name="uid"]:checked')
				.parents('tr')
				.css('backgroundColor', '#fff');

		return res;
	}
	else
		return true;
};

The checkboxes are all named “uid” so when it’s submitted to the server I get a list of IDs to work with. I’m using jQuery to select all of the checked checkboxes named “uid”, then get their parent <tr> tags and then update their backgrounds to be a bright gold color while the confirmation dialog asks them if they’re really, really, seriously sure they want to do this. If they click cancel, we restore the background back to white.

My download is about done, so time to restore!

Dismantled Spec MiataI am finally back in the garage after the holidays and making some progress on the #12 car. All the body panels and doors are off in preparation for paint. I am trying to cut some corners by not completely stripping the engine bay before painting to reduce what I have to reassemble.

I have gotten in the habit of putting screws and bolts back in their holes after removing things so I don’t have to figure out what goes where. While you could almost dismantle an entire Miata with a 10 and 12mm socket, I am hoping this strategy will keep me from wondering exactly which bolt belongs to each hole.

Grabbing lunch now and then going to yank a few more things before dropping it off the jack stands on to four Harbor Freight moving dollies and then it will be pressure wash time. I am pretty sure I will clean about 10lbs of dirt off the shell!

Almost all of the parts are in (and taking up space waiting installation). The tranny is at Mr. Mazda across the street, diff is off to East Street in Memphis and the motor is being built by Haag Performance in Martinez. Once the shell is clean, it will be painted inside and out a light gray and then everything will be cleaned and we will start bolting parts back on.

First official outing target is the SCCA Double National at Thunderhill in March but I am hoping to get it out a couple of times prior to shake it down. I am focused on Regionals this year so the double will be a good chance to see what kind of overall pace we have. As I search for open track days, I finally have a reason to start using the MotorsportReg.com calendar!