Archive

Archive for March, 2009

Bash Script to Load Common Ruby on Rails Tasks

March 9th, 2009

Awesome time-saving script

Here’s a bash script (sh) that will help you setup your rails session by automatically loading up a terminal with several useful rails tabs. The script below will open the /script/console, development log, sql lite, IRB and the /script/server.

Save the script below to a file in your linux box and run it like this:

sh “file-name.sh” /complete/dir/path/to-your-rails-project/


#!/bin/bash
DIR="${1}"

if [ ! -d "${DIR}" ]; then
echo "Error: Use full directory path:"
  echo "${0} file-name.sh /some/path/to/dir"
  exit 1
fi

gnome-terminal --window --working-directory=${DIR} -t "Server" -e "script/server" \
               --tab --working-directory=${DIR} -t "Console" -e "script/console" \
               --tab --working-directory=${DIR} -t "DBConsole" -e "script/dbconsole" \
               --tab --working-directory=${DIR} -t "IRB" -e "irb" \
               --tab --working-directory=${DIR} -t "Dev Log" -e "tail -f log/development.log" \
               --tab --working-directory=${DIR} -t "Terminal" &

RoR

Dear Lord…

March 1st, 2009

Found this on a friend’s facebook page. Makes sense, so here it is.

Lord, grant me the serenity to accept the things I can not change, the courage to change the things I can, and the wisdom to hide the bodies of those I had to kill because they ticked me off.

Funny