Set Cron Job to Run Every Five Minutes for a Ruby on Rails Rake Task
First off you'll need to edit your cron file. Normally, the cron files are kept under /etc/cron.daily or /etc/cron.hourly but we can just use the command line tool, crontab and pass it the -e flag, so that we can edit the file without any fuss.
sudo cron...
Written by Sean Behan on 06/17/2012
How Many Gigs of RAM Are On My Server?
How much memory is on my linux server? Run the free command
free -g
total used free shared buffers cached
Mem: 2 1 0 0 0 1
-/+ buffers/cache: 0 1
Swap: ...
Written by Sean Behan on 06/17/2012
Rails Send_File in Production Delivers an Empty File
If you're running Rails in production it will by default be configured to let apache or nginx send files for you. If you're handling file downloads yourself with send_file
send_file("path/to/file.txt")
you will notice that the downloaded files are empty...
Written by Sean Behan on 06/17/2012
Email Regex
Regular Expression that Matches Email Addresses:
/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/
Written by Sean Behan on 06/17/2012
When the cloud is a good idea
A buddy of mine is a talented, but paranoid System Administrator for a small web company. He refuses to see the truth and the beauty in the wonderful world made possible by cloud computing services like Amazon's EC2. Amazon is not the only game in town. T...
Written by Sean Behan on 06/17/2012