Coding Horror Knocked Down: A Tale of Back-ups

Some time today an issue at Coding Horror’s web host took the site down. It appears it might have been due to the loss of the database, and it also appears that while the hosting company said they were making data back-ups, in fact they weren’t. That’s brutal.

I feel for Jeff Atwood et al. in that, if only because I know from experience how much that sucks. When we were first launching DreamBank an issue at our host took out our entire production database as well. Heroic recovery efforts on the part of one of our developers recovered the lost data, with absolutely no help from the web host.

We promptly switched hosts because, in our instance, it was a case of professional negligence and stupidity rather than just run-of-the-mill incompetence, but that’s not the take-away from these events. That kind of thing can happen anywhere, for a thousand different reasons.

The take-away is this: we only own the data that we physically have possession of. Whether it’s back-ups of your website’s source, your database tables, or all the information you’re storing out there on “the cloud” in Google docs and Gmail, if you don’t have a current copy of it you don’t really own it. You’re just renting on someone else’s good graces.

We at DreamBank learned that the hard way. Jeff’s learning that the hard way today. Ma.gnolia learned that the hard way too (though it’s probably more accurate to say we all re-learned it). But maybe you don’t have to. Learn from our mistakes . Back up your data yourself, today.

And on that note I’m going to go back up my laptop, which hasn’t been backed up in three days, and dump the database powering this blog.

698 views | Comment? »

By chris on December 11th 2009 in /dev/random

GeekTool and iCal

I use GeekTool to display quite a few items on my desktop, it’s a fantastic utility. For fun I’ve put together a Ruby script for use with GeekTool that displays iCal events: GeekCal.

Download the script, make it executable, set it up as a shell script in GeekTool et voila. Calendar events on the desktop.

869 views | Comment? »

By chris on December 4th 2009 in /dev/ruby

Redfin on VC Questions

Frankly, in years of reading TechCrunch (and much of that against my better judgement), this is the best post TC has ever posted: Good Question! The Eight Best Questions We Got While Raising Venture Capital.

VCs are good at asking questions. They are unimplicated in your dumb decisions, unmoved by your original sense of mission and far less concerned than you that a blunder could bankrupt you. They re-imagine your business in terms of all the other businesses they’ve seen, pulling the arms off one doll and the head off another to create a perfect money-making Frankenstein. And since the stakes are high, the whole philosophical exercise tends to result in action.

Here are the questions VCs asked Redfin that changed how we think about our business.

I love question #1.

682 views | Comment? »

By chris on November 18th 2009 in /dev/random

Fix for uGallery

On a current project I’m working on, we’re using uGallery to implement an image carousel. Despite the JS code being a bit rough it’s very easy to integrate and the output is quite elegant. I like it a lot.

Unfortunately the current version of uGallery (1.1) has a minor bug. If you’re displaying fewer thumbnails whose width will exceed the interior of the thumbnail viewport, the horizontal scrolling goes wonky. This wee patch fixes that issue.

In uGallery.js wrap the margin calculation and style assignment in this conditional:

    // Only bother to scroll the content if its area is greater than the viewport
    if ( contentWidth > viewWidth ) {
        var margin = -Math.round( ( e.clientX / viewWidth ) * movableWidth ) + 20;
        thumbs.css( {"margin-left": margin+"px"} );
    }

790 views | Comment? »

By chris on September 23rd 2009 in /dev/random

Handy DataMapper uninstall script

gem list '\A(?:(?:d[mo])[_-]|data_?(?:mapper|objects)|extlib)' --no-versions | xargs sudo gem uninstall -aIx

(Via Dan Kubb and gist: 31187.

919 views | Comment? »

By chris on September 2nd 2009 in /dev/random

TextMate, ImageMagick and “Command not found”

Two days ago I did a clean install of Snow Leopard, TextMate and all the associated goodies. All was going well until I tried running my spec’s that referenced Rmagick from within TextMate. They started returning the following error:

sh: convert: command not found

This was fixed by opening TextMate’s preferences, Advanced -> Shell Variables and adding a new variable:

Variable: PATH
Value: see below.

For the curious, my $PATH is currently:

/usr/local/bin:/usr/local/sbin:/usr/bin:/opt/local/bin:/usr/local/mysql/bin:/opt/local/sbin:/bin:/usr/sbin:/sbin:/usr/X11/bin

936 views | Comment? »

By chris on September 2nd 2009 in /dev/random

Rcov, NaN, and Fatal Crashes

Seems its possible to crash the current version of rcov hard under certain circumstances (version as of this writing: rcov (0.8.1.2.0)). If you find it crashing with:

ruby(17057,0xa0124720) malloc: *** error for object 0×5b1a602: Non-aligned pointer being freed
*** set a breakpoint in malloc_error_break to debug
/opt/local/lib/ruby/1.8/rss/rss.rb:274: [BUG] Segmentation fault
ruby 1.8.7 (2008-08-11 patchlevel 72) [i686-darwin9]

rake aborted!
NaN

Check to see if you have any empty helper files that don’t have any coverage. I had a couple that resembled the following. Removing them removed the “divide by zero” issue that causes the crash:

module ProductHelper
end

Update
Scratch that, it doesn’t entirely fix the issue. I’ve also implemented Stew Welbourne’s hack for round_to_tenths(decimal) in MetricFu but that too does not seem to be a complete solution. The seg fault still happens, though intermittently (sometimes it runs through the complete test suite, sometimes it doesn’t).

The search continues.

1,015 views | Comment? »

By chris on August 27th 2009 in /dev/rails, /dev/ruby

Rails, date_select and “index out of string”

If you’re working in Rails and using date_select() or datetime_select() (and presumably select_date() and select_datetime()) and you find yourself up against an error like the following:

index 3873 out of string

Check that your :default parameter is either nil or an actual Date/Time/DateTime instance and not a String. Passing in a string as :default really messes things up.

1,281 views | Comment? »

By chris on August 11th 2009 in /dev/rails

Merb, merb_datamapper gem, and “was no found”

I just killed a bunch of time tracking down the cause of this issue that was occurring while trying to run a merb app:

FATAL: The gem merb_datamapper (>= 0, runtime), [] was not found

This message is in fact incorrect. Merb can find the gem just fine, as running with –verbose indicates, it just can’t load it.

After much mucking about it turns out the problem was the Addressable gem being updated to v2.1. Removing addressable-2.1.0 fixed everything.

(If you run into similar issues and think this might help, please note the date on this post. Version numbers may have changed significantly since this writing.)

1,232 views | Comment? »

By chris on June 19th 2009 in /dev/random

How To Make Fake Mars Dust

It amuses me to no end that not only has NASA figured out how to create fake Mars dust (aka: dust on Earth that has the same consistency and texture as the stuff on Mars), but that they actually have a legitimate need to do so:

But now Spirit faces a new and tricky challenge—its wheels have partly sunk into a patch of soft soil. The rover’s controllers have put a halt to driving operations while they try to figure out how to get it unstuck.

“Spirit is in a very difficult situation,” John Callas, project manager for the rovers at the NASA Jet Propulsion Laboratory (JPL) in Pasadena, Calif., said in a statement yesterday. “We are proceeding methodically and cautiously. It may be weeks before we try moving Spirit again.” A JPL spokesperson said today that the rover’s condition had not changed.

Incidentally, the recipe via MarsRovers:

Recipe for rover sandbox testing (to duplicate Spirit’s sandtrap): 1part Diatomaceous Earth + 1part Fire Clay (used for pottery)

1,208 views | Comment? »

By chris on June 15th 2009 in /dev/random