Archive for February, 2009

Reloading reCAPTCHA with error via Javascript

February 20th, 2009

Today I needed to add a captcha to a web form used to send emails. Ordinarily this is pretty simple using the reCAPTCHA service. There was only one problem: the form was validated and submitted via AJAX rather than a regular HTTP post.

The reCAPTCHA client API provides a reload javascript method that will grab a new set of words for the user to decode. It was easy enough to display a small error message above the reCAPTCHA div and call this method when the user responds incorrectly.

In a typical setup, as described in the reCAPTCHA client API, the standard theme can display an error message when the user responds incorrectly. This is done by appending an error URL parameter to the challenge. The error message I was adding via javascript was showing up above the reCAPTCHA module rather than just above the text box. I wanted to display the error message included in the standard reCAPTCHA theme.

Web Applications , ,

Installing Gentoo 2008.0 amd64 on a Linode VPS

February 9th, 2009

Today I signed up for a Linode VPS. Linode appeared to have great reviews and very reasonable prices. I had originally looked at Host Virtual, primarily because they are planning to offer native ipv6 (something I’ve been wanting to play with) later this month.  I ended up with Linode because they have a Dallas datacenter which makes my connections from Austin pretty fast.

One advantage that Host Virtual provided was a more recent Gentoo image.  Linode only offers a Gentoo 2007.0 install, which it doesn’t even list as a current distribution.  No worries, in this post I describe the steps I took to install a fresh Gentoo 2008.0 amd64 image on my new Linode!

Update: On April 4 2009, Linode released a Gentoo 2008.0 x86_64 image, which somewhat obsoletes this post. I haven’t tried it, but if your looking to try 64-bit Gentoo on a Linode, try that image instead of these instructions.

Before we get started, some of the things I wanted on my system:

Gentoo , , ,

My first blog post

February 8th, 2009

I’ve decided to start a blog as an easy way to jot down thoughts and instructions on the various topics I come in to contact with everyday.  Perhaps as a direct result of Google and the vast amount of information available using only a few keystrokes, I’ve become very lazy in documenting the reasons behind some of what I do.  I’ve always been very deliberate in documenting code, but outside of that I write down very little.

Take Gentoo for example.  Gentoo is the best linux distribution for keeping up-to-date and tinkering (as well as anything else geek related).  But we all know the most painful part of Gentoo is setting it up.  The installation docs are great, and it’s relatively simple to get your 2nd Gentoo installation up and running in less than an hour, but the little things are a different story.  How did I get the back/forward buttons on my mouse to work in Firefox?  A year ago, why did I insist that I get a nVidia graphics card for running compiz on two monitors?  Sure I can use Google to search for howtos but the howtos never seem to cover my exact situation.  The loss of Gentoo’s unofficial wiki sure doesn’t help either.

Blog ,