The blog has moved to http://jessehouse.com/ ... Many google searches point here so I am leaving it operational, but there will be no new posts.

Saturday, May 30, 2009

Secure your Gmail

yeah - you DO want to run gmail over https; I am surprised this is not the default and I am surprised I did not already have this setting turned on.

In gmail click the settings link in the upper right hand corner


Then scroll to the bottom and select 'Always use https' in the Browser connection section
This came up while I was watching a great screen cast 'Security - What rails will and won't do for you', it was from 'Scotland On Rails Presentations', there are 27 different presentations and all downloadable

Saturday, May 9, 2009

PGError: ERROR: duplicate key value violates unique constraint "tablename_pkey"

Using Postgresql I ran into the following error when trying to create a new record through my rails application

  • PGError: ERROR: duplicate key value violates unique constraint "tablename_pkey"

Found this link which had the needed fix;

Dealing with 'duplicate key violates unique constraint' on the primary key

apparently with Postgresql after bulk loading records where the auto incrementing id is specified you then need to update the sequence value

Sunday, May 3, 2009

bash scirpt to launch rails development environment

here is a bash script I put together to launch my rails development environment, i got tired of opening multiple terminal windows and cd to the project dir, this script
  • launches script/server in a terminal window
  • launches a new terminal and cd to the trunk
  • launches firefox at http://localhost:3000 with a specific firefox profile
  • and launches Komodo Edit - go ahead and pick the editor of your choice
this works on Ubuntu, probably on other Linux distro's that use Gnome



I saved this in a file ~/scripts/launch_YOUR_PROJECT.sh
to execute this open a terminal and type ~$ bash ./scripts/launch_YOUR_PROJECT.sh
or create a symlink in your home directory



then execute using ~$ bash launch_YOUR_PROJECT

NOTE: in theory you should not need to even specify bash at the command prompt, when I did not I received the following error "bash: launch_YOUR_PROJECT: command not found"
running 'which bash' returns '/bin/bash' which is specified in the shell script?, something to look into later.