Adding Public/Private Key Pairs on Mac OS X and Ubuntu for Passwordless Remote SSH Sessions
On your local machine cd into the .ssh directory in your home "~/" directory. If it doesn't exist you can create it with "mkdir ~/.ssh". Next generate your public/private keys and copy the public key to the remote server.
cd ~/.ssh
ssh-keygen ...
Written by Sean Behan on 06/17/2012
Aliasing Attributes in Ruby on Rails
Alias an attribute with alias_attribute method.
The first argument is the name for the new attribute, while the second argument is to identify the attribute that is already defined.
class User < ActiveRecord::Base
alias_attribute :username, :login
...
Written by Sean Behan on 06/17/2012
Linux Disk Usage Command Recursive
It's short and sweet!
du -hs *
If you run this command it will tell you the sizes of all the files and folder in the current directory.
The `-h` flag is for human readable format and the `-s` will give you the size for each file or directory.
...
Written by Sean Behan on 03/07/2017
Double Click Event Using Prototype Javascript Framework
Super simple to get double click "desktop" like functionality out of Prototype! For some reason, googling it doesn't yield many useful results. http://www.google.com/#hl=en&q=double+click+in+prototype+javascript&aq=f&oq=&aqi=&fp=peEfEjG9pWY :(
Anyway, he...
Written by Sean Behan on 06/17/2012
Rails: Expiring a cached page with namespaces and sweepers
I've got some pages that are cached using their permalinks on the filesystem, such as http://example.com/about-us.html which will need to map to RAILS_ROOT/public/about-us.html ... The issue I have is that I use a namespace for the admin area and the cont...
Written by Sean Behan on 06/17/2012