Matthew Hutchinson

about

Matt is a web developer from N. Ireland. He currently runs Hiddenloop and works in Dublin. Want to find out just a little bit more ?

An audio feed is available for the latest articles at matthewhutchinson.net, find it here.

Handy Aliases (3)

posted 2 months ago

Working on the rails day in and out now, I’ve found the following aliases to come in handy;


# General Commands
alias ls='ls -al'

# TextMate, mate all of current dir and crucial rails folders only
alias et='mate . &'
alias ett='mate app config lib db public test vendor/plugins &'

# RAILS,  (run these from your rails folder)

# rails scripts
alias ss='./script/server'
alias sc='./script/console'
alias sg='./script/generate'
alias sp='./script/plugin'
alias mr='mongrel_rails start'

# rails testing 
alias att='autotest'
alias tu='rake test:units'
alias tf='rake test:functionals'    

# tail logs
alias tl='tail -f ./log/development.log'
alias tt='tail -f ./log/test.log'      

# clean the logs
alias ctl='cp /dev/null ./log/test.log'
alias cdl='cp /dev/null ./log/development.log'

I should credit Peep Code for the idea. To use, (e.g. in OSX) place the above in a ~/.bash_aliases file and in ~/.bash_profile, load it in with this command;

if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases ; fi

Also, (and before I forget it myself) – here’s a quick session cleaner command to put in your cron, (for day old, mysql session clearage action); rather than build a rake task, or extra controller to clean them out.


#!/bin/bash

cd /u/apps/matthewhutchinson.net/current
echo "<== CRON TASK ==> clear day old sessions data on matthewhutchinson.net" 
ruby script/runner -e production "ActiveRecord::Base.connection.delete(\"DELETE FROM sessions WHERE updated_at < NOW() - INTERVAL 1 DAY\")" 

3 comments, post another

Rails Royal Rumble (1)

posted 2 months ago

  • #cabal
  • [12:37] @davidjrice: here, before you do that! Rails Rumble http://railsrumble.com/
  • [12:37] @davidjrice: we needs ta register today cause there have been 101 of 150 applications
  • [12:38] @matt: I have no time for the rumble, unless there is wrestling involved)
  • [12:38] @matt: like, a royal rumble
  • [12:38] @matt:* matt dons cape, mask and goes to summon his Eagle Powers – [link]

1 comment, post another

Lip Dub

posted 3 months ago

Lip Dub - Flagpole Sitta by Harvey Danger