Ubuntu “Hash sum mismatch” when updating repository

When running:

sudo apt-get update

I often get the following on a new 12.04 minimal install.

W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/source/Sources Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/source/Sources Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/source/Sources Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/source/Sources Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/binary-amd64/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/binary-amd64/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/binary-amd64/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/binary-amd64/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/main/binary-i386/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/restricted/binary-i386/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/universe/binary-i386/Packages Hash Sum mismatch
W: Failed to fetch http://us.archive.ubuntu.com/ubuntu/dists/precise/multiverse/binary-i386/Packages Hash Sum mismatch
E: Some index files failed to download. They have been ignored, or old ones used instead.

To fix:

Remove the content of /var/lib/apt/lists directory:

sudo rm -fR /var/lib/apt/lists/*

then run:

sudo apt-get update

Javscript Unit Testing with Eclipse and JS Test Driver

To get started unit testing with Javascript and Eclipse, you’ll need Eclipse installed with the Javascript Development Tools plugin installed.

From the main menu bar click Help > Install New Software…

Click the “Add” button next to the “Work With:” text seleciton box.

Enter “http://js-test-driver.googlecode.com/svn/update/” into the Location field and enter a Name of your choosing or leave it blank to use the default location as the name.

Select the “JS Test Driver” plugin under “JS Test Driver Plugin for Eclipse” and click Next through the dialogs.

Once the plugin is installed, you can bring up the JSTestDriver view by clicking Window > Show View > JsTestDriver from the main menu bar.

You may want to configure the paths to the browsers for the quick open buttons by clicking Window > Preferences from the main menu bar.  Choose JS Test Driver on the left pain and then select the paths to the various browsers.

To start unit testing click the “Start Server” play arrow icon in the JSTestDriver view and click on the button for the web browser of your choosing.