About Scott

I'm a computer guy with a new house and a love of DIY projects. I like ranting, and long drives on your lawn. I don't post everything I do, but when I do, I post it here. Maybe.

Delivering Pre-Compressed (gzip) Javascript with PHP only

There are plenty of results in Google for delivering compressed Javascript files using PHP.  However, most of those techniques involve compressing the JS file(s) on the fly. I was looking for a method that would meet the following criteria: The JS file should be pre-compressed using gzip. The gzip version of the JS file should only be delivered if the client’s browser supports gzip. The code below has some pitfalls: It will not work with a CDN or any external content server that does not support PHP. It is more difficult to maintain than compressing on the fly at the web server level (as you must maintain the compressed version of the JS file. I’ll use my quick and dirty … Continue reading

Using Postfix with MySQL Stored Procedures? (Just Use Functions)

postfix_random

If you’re like me and want to use Postfix with a MySQL backend, you may have also wanted to be able to call stored procedures from Postfix. Unfortunately, MySQL stored procs return multiple resultsets while Postfix’s call to the MySQL C API can only process a single resultset.  I banged my head against the wall for a while until I realized that a function called from a SELECT statement would return a Postfix-friendly single resultset. For example, this would be a perfectly acceptable virtual alias map file: user = mailreader password = somepassword dbname = mail_config query = SELECT retval FROM (SELECT fnPostfixVirtualAliasMapGet(‘%s’) AS retval) t WHERE t.retval IS NOT NULL; hosts = 127.0.0.1 This is useful if, for example, … Continue reading

Quieting Dell PowerEdge 1855/1955 Blade System Chassis Fan Noise: Undocumented DRAC/MC Commands

fan_speed_hex

TL;DR: Skip right to the undocumented commands Background I recently purchased a Dell BMX blade chassis on eBay that came loaded with ten 2x dual-core, 24GB PE1955 blades.   For a system with 40 cores, 240 GB of RAM and two 16-port gigabit switches in a 7U frame, $2500 was too good to pass up.  Especially since shipping cost me a mere 2 hour round-trip to Brooklyn. I didn’t really need ten more servers, so I figured I’d sell off 5 or 6 of them (hopefully breaking even on the entire system — the 4GB FB-DIMMs in 6 of the servers is worth $1450 – $1900 alone).  The remaining servers would be all mine! But I forgot to research the noise!  … Continue reading

Eulogy for the Jeep

Jeep XJ Destroyed - 02

Back when it was en vogue to play music from Compact Discs, the Death and Destruction mixes provided adequate motivation to ruin lawns. Mo once took the Jeep to Florida, and Sag fixed the intermittent wipers in his anger.  Another time nine people took it on a camping trip that ended poorly, with no camping. It went to Pittsburgh twice, getting towed only once.  It had a laptop mount, because that’s important.  We yelled at passers-by with a megaphone until the police made us stop. It got pulled over by the police more times than anyone can remember, and even had its license plates confiscated in the name of gross irresponsibility. Sure, it crashed into some things unintentionally, but that … Continue reading

Chevy Volt Electrical Cost Analysis

Voltec Installation - Meter powered on

I’ve been tracking the electrical usage of our Chevy Volt, Sparky, for the past couple of weeks.   Before we bought Sparky we did some research on the Volt’s electrical consumption and did some off-the-cuff cost projections.  Unfortunately, there was very little real world data available online, mostly because other bloggers weren’t able to monitor their Volt’s actual kWh utilization and were instead using the change in usage pre- and post-Volt. That was my impetus for installing a kWh meter inline with my Level 2 charger,  a project that you can read about here. I’m going to periodically update this post with fresh data as it becomes available, and the numbers below cover the period 6/13/2011 through 6/27/2011. The electric rate … Continue reading

Chevy Volt Counterarguments: Price, Government Subsidies, and Operating Cost

I guess for better or worse, I’ve become a Volt advocate.  I’m no fanatic, however.  Only time will tell whether the Volt is a win or a loss, either for me personally or for the nation at large.  Will the batteries fail as soon as the 8-year/100,000 mile warranty is up?  Will GM still be in business to honor those warranties?  Will this first leap into mass-market electric vehicles (including the Leaf and Tesla) drive technological improvements and economies of scale? I can’t answer those questions. But I do love our Volt.  My wife and I bought it not because it was an electric vehicle, but because it fell into the criteria we set for price range (with rebates), performance, … Continue reading

Sparky: MPG Update

Sparky's Grille

Sparky has a few more miles on her, and so I wanted to give an update on her gas stats.  Why the gas stats, and not the battery?  There are three reasons:  I don’t have any electrical consumption data right now*, I would like to know the cost of a long road trip (which would be mostly gas-miles), and the lack of a clear MPG number just plain annoys me. *Electrical consumption data is now available here. What I mean is that the car itself, and the related OnStar apps will tell you that the vehicle has traveled (for example) “211 Miles Per Gallon“, which is such a misleading statement that I find it offensive.  While the car may have … Continue reading

Installing Our New 240V/Level 2 Voltec Charge Station (Phase II)

This is a follow-up to my previous post, Chevy Volt Metered Charging (Phase I). In the first phase, I ran a new dedicated circuit from the subpanel in my garage to the opposite wall to connect a 120V charging station.  In this phase, I removed the existing receptacle, rewired for 240V, installed the Voltec Level 2 charging station, and wired the kWh meter inline. It’s not my intent to write a full set of instructions for installation here.  The purpose of this post is to illustrate some of the installation steps with real-world pictures, which are somewhat hard to come by online (the pictures are rather small, but you can click on any of them for a larger version). As … Continue reading

Sparky Gets a Gift from Chevrolet (Unboxing)

A weird thing happened today.  There was an unsolicited package waiting on our front porch, labeled with the Volt’s logo. What could possibly be inside of it?  Was it a mistake and we got an extra charger?  The keys to yet another Volt?  Well, there’s not all that much to say about it, so here are some unboxing pics.. Ah!  Some… thing.  Well, it’s very nice cardboard with quality printing (the picture doesn’t do it justice). It looks like a book. Oh, it is a book!  And some other literature.  Wait, what?  Is that a Flip digital video recorder?  Yes, in fact it is a Flip DVR.  How odd.  In the enclosed letter is says something like “[..] record all … Continue reading

Chevy Volt Charge Cord – Hot During Charge

I thought I’d throw this one out there because it seems I’m not the only one observing this problem.  My Volt’s 120V charge cord and the short plug lead are running hot during charging. You can see some other people’s input here, on this archived forum thread (I was not involved in the thread, but it came up first in a related Google search): http://gm-volt.com/forum/archive/index.php/t-6581.html This is my charging setup (still waiting on the 240V Voltec Charging Station): To connect to the Volt, about half the length of the charge cord has to be unwound. I noticed yesterday that the plug (the NEMA 5-15R) was very warm.  The plug lead was warmer still.  I went on to feel the charge … Continue reading