Tuesday, July 10, 2012

WGET to Keep New Rails Site in Memory

A Ruby on Rails web application can be really fast in production.  However, for a site that receives less traffic the application can be very, very slow on the first request after it has gone dormant.

One way to make sure that your site is always fast and never goes dormant is to setup an automatic process to periodically fetches the home page.

On an Linux, FreeBSD, or Mac OS X system it is easy to setup an automatic fetch using cron and wget.

Simple type "crontab -e" at your terminal and enter a line like this for each Rails website you want to keep alive by pinging every 15 minutes.
*/15 * * * * wget -O /dev/null -q http://www.rietta.com/ > /dev/null 2>&1

For those not familiar, /dev/null is a special file in Unix that goes nowhere.  By using it as the place that the output file is written and any messages are written, this command will be completely silent.

This also works to keep Heroku images alive.  You simply need to run the crontab on a Unix-based machine of yours that is on all of the time.  The requesting box doesn't have to be a full-blown server.  Any desktop will do.  A laptop is probably not the best choice since when you have it offline it won't be able to keep your sites alive.

Saturday, July 07, 2012

Thoughts on Creating Better Web Videos

Andrew Warner with Mixergy released an interesting interview with Andrew Lock on How to create a Web TV show even if you’re not a pro.

Now, I am not personally planning on creating a web TV show.  However, I am starting to create a series of tutorials and instructional videos for Atlanta Ruby Developer and a couple of other properties we operate.  I loved some of the ideas in this interview about how to capture high quality footage using a halogen light from Lowe's or Home Depot.

In my experiments, the camera on my Android phone is completely high quality enough for web video purposes.  Snapz Pro is wonderful for capturing events on the screen.  Now, I just need to find a local teenager to tutor me how to use iMovie on Mac OS X.  I'm a coder, not a video producer after all :-)