Archive for December, 2007

Selling my trusty PowerBook G4

Sunday, December 30th, 2007

I have a 15″ Powerbook G4, 1.25GHz with 1GB of RAM and an 80GB hard drive. Also known as the “Aluminum” PowerBooks. I recently got a Mac Book Pro for work and am going to be getting a new iMac for home, so its time to sell the notebook that was my primary computer. Looking to get $725 for it. Located in Issaquah, WA.

Apple PowerBook G4 15-inch w/ SuperDrive $725
Model M8981LL/A
1.25GHz PowerPC G4
512MB PC2700 (333MHz) DDR SDRAM
80GB Ultra ATA/100 Hard Drive
15.2-inch (diagonal), 1280×854 resolution, TFT widescreen
ATI Mobility Radeon 9600 with 64MB of DDR SDRAM videocard
SuperDrive (DVD-R/CD-RW)
Built-in 10/100/1000BASE-T Gigabit Network Card
Built-in Bluetooth
Built-in 54-Mbps AirPort Extreme (802.11 / WiFi)
Built-in 56K V.92 modem
Keyboard is full size, illuminated with ambient light sensor

Comes with original software, manuals and boxes. Includes power adapter with the long power cord and the S-Video to Composite video adapter.

Includes a Targus notebook case. I’m trying to find an extra 512MB of RAM around here somewhere. Everything on it works.

Comes with a fresh install of Mac OS X Tiger–boots up just like a brand new mac, ready for your personalization information.

There is only one issue with this machine: it has some “screen blotches”, which are bright spots on the screen that occurred shortly after I bought it brand new from Apple. It was recalled, but I couldn’t spare the machine long enough to have the screen replaced. They are now refusing to replace it under the recall, so I’m having to sell it as it is. Selling it at a bit of a discount for this reason.

I am selling because I have a new Mac Book Pro.

Please only serious buyers. Cash or PayPal only (no foreign cashiers checks, money orders, etc.).

Interested? Email me.

Woot! Can Bite Me

Wednesday, December 26th, 2007

For those of you unfamiliar with Woot!, they basically sell a semi-limited quanity of one thing per day, and it is usually a pretty good deal. The listings get updated at Midnight central time (10pm Pacific), and can sometimes sell out immediately. Typically the proprieters have a good sense of humor and they’ve done a great job building a community around their business.

So last year Woot! did their “Bag-O-Crap” thing on Christmas. Bag-O-Crap / BOC / Blinged Out Cabbage, etc. sort-of a customer appreciation event, where you buy a bag of random crap for $5, and you usually get some pretty good stuff. Normally it sells out very quickly.

I figure if they did it last year, they probably would do it this year as well. So I set my iPhone to alert me 5 minutes to 10, so I can have a shot at getting a BOC (which I’ve never been able to do).

10 pm rolls around–and sure enough, the BOC is up.

I try logging in, realize I forgot my password (I only order maybe 4 times a year from them). After I remember my password, it logs me in and tells me it is sold out. Bear in mind this whole process took at most 90 seconds.

Turns out they sold 4500 bags of crap in 1:15. Not one hour and fifteen minutes, but 75 seconds. I realize the site is very popular, but I find it somewhat hard to believe that is possible. I can’t help but believe that at least some of that was done by bots.

So I missed out. Again.

Wonder if it is time to implement a CAPTCHA system?

Generating Encoded Values for Google’s Charts

Tuesday, December 25th, 2007

Been working on some new ways of displaying various metrics. I’ve used JpGraph and PHP/SWF Charts in the past, but thought that I might invstigate some newcomers. While Sparkline PHP and Chart API / WebFX for DHTML both were interesting, I wasn’t quite able to get the libraries to do exactly what I was going for.

Google, on the other hand was able to make pretty good mix of design, customizability, flexibility and ease-of-use in their dynamic image-based Chart API.

There is one pretty big difference between Google’s Chart API and most of the other tools on the market: it won’t take raw data and automatically scale the Y-Axis to fit your data and provide labels. It instead works on a relative scale, and it is up to the developer to encode the data relatively. The library is there to help you draw your data, not actually manipulate it.

To get an idea of what I’m talking about, imagine you’re trying to build a line graph of Google’s stock price for the last five days: 689.96, 669.23, 673.35, 677.37, 689.89. Google’s Chart API has no idea what to do with these numbers–it wants to know what those numbers are relative to each other, on a scale of 0-100 (using text encoding, probably the best of the supported encoding methods).

Scaled ValuesAt first glance, I suppose you could simply divide by ten in order to get a set of numbers that fits within the 0.0-100.0 space: 68.9, 66.9, 67.3, 67.7, 68.9. Problem is because the changes are relatively small between the points, you’ll end up with essentially a straight line like the graph on the right.

Not a very interesting or useful.

What you really need is something that can scale the graph so you can actual see the detail of the information. Because the stocks prices range from 669.23 to 689.96, perhaps it would make sense to make the scale from 660 to 700, which will provide adequate detail.

Scaling and adjusting the numbers relatively between 660 and 700 is a bit harder, but never fear as I wrote a little PHP function that can do it for us:

1
2
3
4
5
6
7
8
9
10
11
12
function googleChartTextEncoding($Values,$Min,$Max) {
    $EncodedValues = array();
    for ($i=0;$i<sizeof($Values);$i++) {
        $EncodedValues[] = round((($Values[$i] - $Min)/ ($Max - $Min)) * 100,1);
    }
    return(implode(",",$EncodedValues));
}
 
$Min = 660;
$Max = 700;
$Values = array(689.96, 669.23, 673.35, 677.37, 689.89);
$Data = googleChartTextEncoding($Values,$Min,$Max);

This function returns values that means nothing to us as humans, but means the world to Google’s Chart API: 74.9, 23.1, 33.4, 43.4, 74.7. When we use these new scaled values, we get a graph that accurately represents the changes over the last week.

The problem is, although we’ve got the graph looking right, Google’s API also doesn’t know what metrics we’ve scaled the data on (660 to 700), so it can’t provide us with meaningful labels for the Y-Axis. Luckily I’ve got another function that can scale the labels as well:

1
2
3
4
5
6
7
8
9
function googleChartLabels($Values,$Ticks=4,$Min,$Max){
    $Spread = $Max - $Min;
    $Ticks = $Ticks-1;
    $Interval = $Spread / $Ticks;
    for ($t=0;$t<=$Ticks;$t++) {
        $Labels[] = round($Min + ($Interval * $t));
    }
    return(implode("|",$Labels));
}

When we put it all together:

1
2
3
4
5
6
7
8
$Min = 660;
$Max = 700;
$Ticks = 4;
$Values = array(689.96, 669.23, 673.35, 677.37, 689.89);
$Data = googleChartTextEncoding($Values,$Min,$Max);
$Labels = googleChartLabels($Values,$Ticks,$Min,$Max);?>
 
<img src="http://chart.apis.google.com/chart?cht=lc&amp;chs=200x100&amp;chd=t:%3C?=$Data?%3E&amp;chxt=x,y&amp;chxl=0:%7C12/14%7C12/15%7C12/16%7C12/17%7C12/18%7C1:%7C%3C?=$YLabels?%3E" />

We get a nice-looking graph that is accurate and usable.

I suspect that Google will eventually extend the API to do all this for you, so you can just give it raw numbers and it will automatically scale the numbers and figure out the axis labels for you, much the way they eventually added GeoCoding to the Google Maps API. Until then this is a good stop-gap solution.

XBox 360’s Rock Band Drum Kit in Apple’s Garage Band

Saturday, December 22nd, 2007


I got Rock Band for XBox 360 last night, and started playing it tonight. Its a lot of fun playing the drum set, but I realized almost immediately that it seems to be missing a ‘freestyle mode’ that would let you just wail.

The drum controller is a wired USB device, so I figured I would try getting it to work on my Mac with Garage Band. Turned out to be pretty easy. To get it working you’ll need:

First step is to leave your drum set unplugged from your Mac (if you plugged it in you’ll realize it is recognized as a Harmonix Drum Kit for Xbox 360). Install the Xbox 360 Controller Driver and Gamepad Companion. The 360 Controller Driver installer will say you need to reboot–but it worked for me without rebooting.

If you launch System Preferences you’ll notice a few new panes at the bottom.

Click on XBox 360 Controllers first. Plug in your drum kit, and it should locate the controller immediately. Go ahead and belt out a few hits to make sure that the buttons are lighting up as they should.

Once satisified, go ahead and click “Show All” to get back to System Preferences. The controller is working and recognized, but we need to map the buttons to keys that Garage Band can recognize. To do that we’re going to click on Gamepad Companion.

The driver maps the buttons like so:

  • Button 1 = Green
  • Button 2 = Red
  • Button 3 = Blue
  • Button 4 = Yellow
  • Button 5 = Kick/Pedal

When we set up the keyboard interface in Garage Band later, certain keys will activate certain instruments. Here is a good key-mapping setup that works for most of the drum kits in Garage Band that features a bass/kick drum, a snare, two toms and a cymbal.

  • Button 1 Map to U
  • Button 2 Map to S
  • Button 3 Map to J
  • Button 4 Map to F
  • Button 5 Map to A

There are tons of other instruments and configurations you can use, but this will get you started. Once you’re done mapping the buttons, go ahead and click “Start” to enable Gamepad Companion.

Just to make sure everything is working, I’d recommend opening up TextEdit or some other editor and wail a bit on the drums, to make sure that it is mapping the keys properly. If it is, you should see a bunch of letters typing across the screen. The repeat rate seems like it would be a problem in Garage Band, but it works fine the way it is.


Now it is time to launch Garage Band. Start a new song, which will have a default instrument of “Grand Piano”. Double-click “Grand Piano” to show the Information/Instrument drawer. Browse to “Drum Kit” and then select “Rock Kit”.

We now have to configure the keyboard. Hit Command-K or Window->Keyboard to bring up the keyboard interface. Basically the Mac keyboard is just to small for all the musician’s keys. So we need to select the C1 octave range either by dragging the blue selected keys, or hitting the plus/minus octive buttons (either on-screen or by hitting Z / X). Once you have C1 selected, you’re ready to rock!

Added note: It is possible to get the Rock Band Drums working with software on the Windows Platform as well, and apparently the PS3 controller works in a similar fashion.

How to Securely Recycle / Wipe Many Hard Drives

Friday, December 21st, 2007

At work we recently retired roughly 30 servers from active duty, consolidating all into a single blade chassis. After the discussion of building a Beowulf cluster came to an end, we realized that we really had no practical use for these machines anymore, and they were actually costing us money to store them. It is time to “get rid of them”.

I don’t know if you’ve attempted to dispose of a truck full 10 year old servers before, but it can be more difficult than it sounds. Due to environmental impact issues, you can’t just throw them away.

Recycling becomes another issue: Due to the heavy metals involved you actually have to pay a fair bit to have someone take these off your hands. It was going to cost us several hundred dollars to have the servers disposed of properly.

Then there was more of a principles problem in that these servers were totally functional, and as a geeks we realized that the servers have more value than, well, negative numbers. They are worth something–or at the very least they are worth nothing!

We understood that there are many people that would gladly take these off our hands and re-use (which is better than recycle) these machines.

One of the things going for the servers is that they were each configured with a pair of 9GB 10K RPM SCSI drives attached to a Compaq SmartArray RAID controller. So each server was packed with 2 hard drives filled with confidential “company stuff” and could not be recycled without doing something to destroy the data stored on them. Simply formatting the drives or deleting the data is a simple token gesture–it can still easily be recovered by computer geeks. The question becomes: How do you irrecoverably destroy the data on 60 hard drives?

This question started a very interesting conversation on creative and/or entertaining ways to destory data stored on hard drives. Some select quotes from this conversation:

  • “How much does thermite cost?”
  • “If thermite is affordable, can we legally purchase and/or make it?”
  • “How many platters do you suppose a .223 could go through?”
  • “Would perhaps a .45 ACP be more effective? Slower but bigger?”

Reality set in after discovering that legally disposing of 60 destroyed hard drives a task equal to or harder than that of disposing of 30 complete servers. We also realized that the likelyhood of being able to sell or give these machines away would be greatly improved by including these hard drives as part of the deal.

So the problem then becomes: How do you irrecoverably destroy the data on 60 hard drives without destroying the drives themselves?

We have a pretty cool SCSI drive duplication machine that we use to replicate drives–seemed like it would have been potentially promising tool for wiping drives as well, but turns out there is no real way to make it happen.

Data Terminator

Now if you’re just doing an just a drive or two, there is a lot of software out there that will allow you to “zero” a drive (process of repeatedly writing zeros to every possible position on a disk). The problem is that we need something that can enable us to do some wholesale dustruction of deta–none of this one-sy/two-sy business. I had a stack of roughly 100 drives in total that needed to be wiped, and don’t have time to screw around.

When searching the Internet for enterprise-grade hard drive wipers, there seemed to be one name that kept bubbling to the top: Darik. As in Darik’s Boot and Nuke (DBAN), a self-booting floppy or CD-ROM image that is perfectly suited for destroying data on magnetic media.

The cool thing about DBAN is that it is an equal-opportunity obliterator–it will pick up all drives installed in the system: SCSI, IDE, PATA, SATA, whatever. It has pretty much every SCSI driver under the sun, and immediately picked up our on-board SCSI and PCI RAID card plugged into our data-terminator server.

DBAN supports several different wipe methods, from basic (single-pass zeroing), to paranoid (35 passes of the Gutmann wipe method).

Darik's Boot And Nuke

Wiping our 9GB drives using the zeroing method took about an hour, and using a reasonably secure Department of Defence Short method (3 passes) took about 3 hours. All drives are wiped in parallel, so it really paid to get many drives wiping at once–I was able to get several drive cages/backbones going, wiping about 10 drives at a time.

Over the course of a couple of days, was able to get pretty much all the drives totally wiped and ready to be re-used. Great tool!