Saturday, December 24, 2011

Ubuntu 11.10 - Riak Installation

The beta version of the book Seven Databases in Seven Weeks was updated from using Riak 0.14.1 to 1.0.2. Getting everything set up correctly on Ubuntu was a bit of a pain at first. This was until I realized that the version of Erlang referenced in the book incorrect. The book references that R13B04 was needed , but in fact R14B03 is needed.

Another big problem that I encountered was installing Riak from the source archive. After decompressing and running make all I was getting an error referring to git. Not too sure why make was expecting to be run in an initialized repository. In case others have had installation problems below are the steps to set up Riak 1.0.2 on Ubuntu 11.04.


Installing Erlang
sudo apt-get install curl build-essential libncurses5-dev openssl libssl-dev fop xsltproc
curl -O https://raw.github.com/spawngrid/kerl/master/kerl
chmod a+x kerl
./kerl build R14B03 r14b03
sudo ./kerl install r14b03 /opt/erlang/r14b03 . /opt/erlang/r14b03/activate


Installing Riak
sudo apt-get install build-essential libc6-dev-i386
git clone https://github.com/basho/riak.git riak
cd riak
git checkout riak-1.0.2
make all
make devrel

Sunday, December 11, 2011

PostgreSQL 9.1: Installation Of Cube Extension

So I started working through Seven Databases In Seven Weeks. The first database introduced is PostgreSQL. With having zero experience with setting up or configuring PostgreSQL it took me a while to finally figure out how to install all of the modules/extensions that the tutorial requires. Below are the commands used to install the required modules PostgreSQL.


psql book -c "CREATE EXTENSION tablefunc"
psql book -c "CREATE EXTENSION dict_xsyn"
psql book -c "CREATE EXTENSION fuzzystrmatch"
psql book -c "CREATE EXTENSION pg_trgm"
psql book -c "CREATE EXTENSION cube"


After that you should be good to go in working through the chapter.

Wednesday, December 7, 2011

CodeSmith Generator Download Archive

For those of you who still haven't upgraded to CodeSmith 6 you might be surprise that CodeSmith no longer has links to the previous version. Yes, the previous version is still hosted on the website, but without knowing the exact url you would never find it. The links that I found all point to the generic download page, which only contains the downloads for the latest version of CodeSmith Generator.

To help facilitate the need for a download archive below are the links to both the Standard and Professional version of CodeSmith Generator.

CodeSmith Generator 5.3.4.12823 Professional
CodeSmith Generator 5.3.4.12823 Standard
CodeSmith Generator 6.0 (Thanks to Anonymous' comment below)

Sunday, October 9, 2011

Prepare Ubuntu 11.04 For Google AppEngine Development

1) Install Python 2.5
The AppEngine SDK requires Python 2.5 but sadly Ubuntu 11.04 has 2.7.1 installed by default. The easiest way to get Python 2.5 installed on your machine is to do the following.

  • Open a terminal and and type the following commands.
    sudo add-apt-repository ppa:fkrull/deadsnakes sudo apt-get update
    sudo apt-get install python2.5 


2) Install AppEngine SDK

  • Download the current version of the AppEngine Python SDK (1.5.4)
  • Extract the archive to your desired location. I just installed extracted the archive to my $HOME directory.
3) Edit the SDK Scripts
Unfortunately, since the SDK will only work for Python 2.5 we need to edit each of the SDK scripts to ensure that Python 2.5 is used when running the scripts. Remember, the default version of Python on Ubuntu 11.04 is 2.7.1. If we don't edit the scripts to use Python 2.5 the scripts will be run using the default Python interpreter.
  • Open each of the following files.
    • /$HOME/google_appengine/appcfg.py
    • /$HOME/google_appengine/bulkload_client.py
    • /$HOME/google_appengine/bulkloader.py
    • /$HOME/google_appengine/dev_appserver.py
    • /$HOME/google_appengine/gen_protorpc.py
    • /$HOME/google_appengine/remote_api_shell.py
  • Replace the first line of each of the files that reads #!/usr/bin/env python with one that reads #!/usr/bin/env python2.5


4) Add SDK To The $Path Environment Variable
You want to add the SDK directory to the $PATH environment variable to make executing the SDK scripts much easier. As opposed to having to type in the full path of the SDK script, $HOME/google_appengine/dev_appserver.py, you will only have to type dev_appserver.py.

  • Open your $HOME/.bashrc file and scroll to the very bottom.
  • Add the following lines of code
    # set PATH so it includes the Google AppEngine SDK
    if [ -d "$HOME/google_appengine" ] ; then
    PATH="$HOME/google_appengine:$PATH"
    fi
That's pretty much it.

Thursday, August 11, 2011

Taking Another Sip of Ruby

It's been about 5 years since I've touched Ruby. I've always had an interest in the language, but never haven't ever been really seriously motivated to seriously learn.

So last night I decided to try and pick it up again. This time though, actually learn to breathe Ruby.

Installation couldn't have been easier if it tried. The first step was obvious:

USER$ sudo apt-get install ruby

This command installed Ruby 1.8.

Step number one down, about a million to go.