Hosting a static site on an S3 bucket

I love the recent shift from dynamic sites to static sites. This doesn’t work for all sites. But why have a blog that gets dynamically build on each request. It’s Not needed.

Amazon will host static sites on an S3 bucket and its dead simple. Awesome!

  1. Create a bucket and set as public host.
  2. Upload files and make them public.
  3. Profit.



Set default value in rails model

I like to set default values in my models. This is the method I like to use.

def after_initialize
  if new_record?
    self.upper_quantity ||= 0.0
  end
end

Failed to Connect to a Master Node at Localhost:27017

Everytime my server looses power, Mongo has trouble restarting. These commands fixes the problem.

sudo rm /var/lib/mongodb/mongod.lock
sudo -u mongodb mongod -f /etc/mongodb.conf --repair
sudo service mongodb restart
Older Newer