Friday, January 09, 2009

ssh login and key file permissions

If your key files are not being used when trying to ssh into a server, set the following permissions on your server account:
> chmod 711 /home
> chmod 700 /home/.ssh
> chmod 600 /home/.ssh/*

Easy git documentation install

I constantly forget where to get the latest git docs from. 
xmlblog gist'd a simple function that does the work for you.

Tuesday, January 06, 2009

How to recursively list the total size of select files in a linux directory

The command below will list the total size of all jpg's in the foo directory.
$foo> find . -name *.jpg | xargs du -hc

Friday, December 19, 2008

Hoptoad Notifier environment filter

Hoptoad is a great tool for collecting error information from your rails app, however, don't forget to filter any environment variables or parameters that contain sensitive information. This is done by adding the following lines to the config/initializers/hoptoad.rb:

config.params_filters << 'my_sensitive_param'
config.environment_filters << 'my_sensitive_env'

Replace the merged values accordingly.

Also take note that as of 11/25 proxy support has been added to the HoptoadNotifier thanks to xmlblog.

Thursday, December 11, 2008

Rails multi-param attribute processing for dates

If you're manually handling date parameters built using rails date select helper be careful with Date.new since invalid dates (02/31/2008) will raise an exception. Others have blogged about this but I haven't come across a post mentioning how to deal with invalid dates the rails way just yet.

If you let rails do the work, it will try to convert the invalid date to a valid date for you. Using that code as inspiration, you can do the following:
@birthdate = Time.local(params['birthdate(1i)'].to_i, params['birthdate(2i)'].to_i, params['birthdate(3i)'].to_i).to_date


Thursday, December 04, 2008

CouchDB Peepcode

I just downloaded the CouchDB PeepCode and was following the CouchDB installation instructions when I ran into a problem. At the time the screencast was published the erlang macport install supposedly worked, however I ran into a Bus error that has apparently been out there for sometime. Fortunately, there is a simple work around until the fix is released sometime this month (hopefully).

Tuesday, November 11, 2008

I just got back from rubyconf a few days ago. There were some great talks and I had a great time. I think I enjoyed myself more this time around as well. There is nothing like a great conference to replenish my energy level!

Wednesday, June 18, 2008

Sometimes, it's the small things that make me happy. Today I found out that the cafe located on the first floor of my client's building started offering free wifi. This is a big deal because it provides myself and the rest of the dev team more flexibility in work location. Unfortunately, our current space is less than adequate, particularly since we have loud neighbors. Although we have tried, we have not been able to procure a more suitable work area.

Anyways, it's little things like this that can improve team morale. I know mine has!