Archive

Archive for September, 2008

Halloween Games

September 29th, 2008

The Make: Blog linked to a series of excellent posts on Halloween games by Defective Yeti. I’ve played a couple of these, but my list of games to try has just increased after reading these.

  1. Halloween Gaming, Part I: Zombies
  2. Halloween Gaming, Part II: Vampires and Witches
  3. Halloween Gaming, Part III: Miscellaneous Malevolence

Board games, and to a lesser extent card games, are two things my wife and I really enjoy playing together. When they get a little out there in the realm of the fantastic she tends to get a little turned off, but I may need to pick up a zombie or vampire game and see how we like it.

Entertainment, Holiday , , , ,

The Zombies Are Back!

September 26th, 2008

I wrote a post back in March about a couple zombie books I had read. I figure it is time for more zombies, especially since we are getting close to the Halloween season. That, and I watched Night of the Living Dead on my iPhone this week while eating lunch over the course of a few days.

Night of the Living Dead is of course the classic Zombie film. You really need to watch this movie in order to judge all the others. I don’t want to go into the plot too much if anyone would read this post and then want to see the movie. The real brief synopsis is there is a small group of people trapped in a farmhouse that is surrounded by zombies. In zombie films it’s important to keep things simple. Too often filmmakers try to get fancy and come up with a good reason why there would be zombies running around. There are zombies running around, or more often shambling around, you really don’t need to spend time on coming up with a great reason for it. Night of the Living Dead used the excuse of a spacecraft that brought back some weird radiation from Venus. There was some good news footage to establish that, but otherwise it was left alone. Night of the Living Dead is a classic, you should really take the time to view it.

After watching Night of the Living Dead to get a little history on zombie films, there are a couple recent films I can recommend that will probably scare you a bit more. I’m actually kind of a big baby when it comes to scary movies, my wife can confirm that for you. For some reason I still watch the damn things though. If you are like me make sure you have someone’s shoulder to bury your head into for these next two.

Dawn of the Dead is a remake of a 1970’s film of the same name. I’ve actually never seen the original, but this was a good movie. It got going really quick and didn’t really let up. The big change in this movie, and something that seems to be happening in recent films, is that the zombies didn’t shamble around. They ran. That alone made things really edgy at times. Dawn of the Dead is a great movie to watch late at night with the lights out so your imagination can take you away. Watch Night of the Living Dead before this so you can pick up on the homage to the original zombie movie.

28 Days Later is another pretty good zombie-like flick. I say zombie-like, because the zombies aren’t really zombies. In this movie England sees an outbreak of a “rage” virus. People are infected by coming in contact with infected blood or saliva. It’s a pretty scary premise. The infected aren’t seen very much, but when they are there is definitely tension. The movie opens with a bike messenger waking after being unconscious in the hospital for a month. He has no idea what has happened, and all he sees is an abandoned city of London. He has his first run in with the infected in a church, and luckily for him, is saved by a couple other survivors. This was another pretty good zombie flick. There is a sequel, 28 Weeks Later, which I have not yet seen. It is on my list though.

I would be remiss if I didn’t mention a couple more light-hearted takes on the zombie movie phenomenon. Shaun of the Dead is a wonderfully campy take on the zombie movie. They do a wonderful job of making a zombie apocalypse funny. Shaun is a bit of a slacker who can’t seem to do much right, but when the dead rise up he sees his chance to turn his life around.

Another great comic zombie movie is Fido. It seems there was a great war fought after the zombies rose up, and now we all live in wonderful 1950’s era communities surrounded by scorched landscape crawling with the dead. Thanks to the people at ZomCom the upwardly mobile family can have a zombie of their own. The movie chronicles the story of Fido, one such zombie. It’s a great boy and his dog type movie, except it’s about a boy and his zombie.

That’s it for my second zombie post. I’ll have to read some more zombie books or watch some more movies if I’m going to keep this up. If you have any suggestions feel free to leave a comment.

Entertainment , , ,

Automatic Web Site Deployment with SVN and Ruby

September 18th, 2008

I was setting up a new test server and production server for our web sites at work. I had finally persuaded my manager that we needed to mandate the use of a SCM system for the site source. I wanted to make deploying the sites drop dead simple as well. The last thing I wanted was to force people to check changes into Subversion, then have them upload those changes to the test server, then when the changes are approved, upload them to the production server. Too much shifting, and too much opportunity for files to get out of sync.
I created a couple Ruby scripts that sit on the test server and production server. On the test server the script checks out the latest revision of the test web sites. The script is run via a cron job, so very shortly after changes are checked in to the repository they are exported out to the version of the site running on the test server.

#!/usr/bin/env ruby
 
# The path to the directory where your site folders sit
web_root = "/path/to/document/root/"
 
# A hash of sites. Folder name and SVN repository name
websites = { "site_folder" => "repo_name",
  "site2_folder" => "repo2_name"}
 
websites.each do |site, repo|
  # First we check for a file named "revision" in the site
  # folder. If that's not there we quit. This is a just in
  # case safety measure, you have to create the revision
  # file for the script to work. Initially it can be a file
  # with just a single "0" in it (no quotes).
  if File.exist?(web_root + site + "/revision")
    local_revision = File.open(web_root + site + "/revision").gets.chomp
  else
    exit
  end
  # Get the current revision in subversion
  svn_revision = `/usr/bin/svn info http://svn.server.com/#{repo}/ | grep '^Revision' | sed -e 's/Revision: *//'`.chomp
  # The the Subversion revision is greater than the number in the revision file
  # then we need to update the site.
  if svn_revision.to_i > local_revision.to_i then
    `/usr/bin/svn export --revision #{svn_revision} --force --username USERNAME --password PASSWORD http://svn.server.com/#{repo}/trunk #{web_root}#{site}`
    # After the export make sure the update the revision number in the revision file
    `echo "#{svn_revision}" > #{web_root}#{site}/revision`
  end
end

In order to get a site on the test server we need to create a folder for it in the web_root, add the revision file to the empty folder, set up the virtual host, and finally add the information to the websites hash in the script. I have this script running every thirty minutes on the test server. Once the site script runs the site is there. It will always be up to date, and the developer does not have to touch the test server. The most important rule you need if you are going to do things this way is don’t check broken code into Subversion. If you do then your test site will very shortly break as well.

The production server is pretty much the same, except I have a second file called deploy_revision that tells the script exactly what revision to check out. In production we may not always want the freshest code. Other than checking the deploy_revision file, the script on the production site is pretty much the same as the script on the test server.

#!/usr/bin/env ruby
 
# The path to the directory where your site folders sit
web_root = "/path/to/document/root/"
 
# A hash of sites. Folder name and SVN repository name
websites = { "site_folder" => "repo_name",
  "site2_folder" => "repo2_name"}
 
websites.each do |site, repo|
  # If deploy_revision file isn't there just quit.
  if !File.exist?(web_root + site + "/deploy_revision")
    exit
  else
    deploy_revision = File.open(web_root + site + "/deploy_revision").gets.chomp  
    # Check for the revision file, it's okay if it's not there, in that
    # case just set the revision to 0
    if File.exist?(web_root + site + "/revision")
      local_revision = File.open(web_root + site + "/revision").gets.chomp
    else
      local_revision = 0
    end
    # Check the SVN revision
    svn_revision = `/usr/bin/svn info http://svn.server.com/#{repo}/ | grep '^Revision' | sed -e 's/Revision: *//'`.chomp
    # if the SVN revision is less than the deployed revision quite, that's not right...
    if svn_revision.to_i < deploy_revision.to_i
      exit
    else
      # If the deploy_revision is greater than the local then we need to update
      if deploy_revision.to_i > local_revision.to_i then
        `/usr/bin/svn export --revision #{deploy_revision} --force --username USERNAME --password PASSWORD http://svn.server.com/#{repo}/trunk #{web_root}#{site}`
        `echo "#{svn_revision}" > #{web_root}#{site}/revision`
      end
    end
  end
end

I don’t have the production script running under a cron job just because I want to be really careful about what gets deployed. You could easily do that thought.
We’ve only got half a dozen sites getting updated this way right now, but eventually as changes are made to sites they are being added into Subversion and rolled into this setup.

Development , , , , , ,

Dog With a Death Wish

September 3rd, 2008

We think Piper might be suicidal or something. Last week Sarah had her outside with the kids, and she decided then would be a good time to not listen and run across the street. We don’t live on a busy road, but Piper timed it so she was bolting across right as a car came through and she got hit. Luckily she didn’t even get knocked over, and after Sarah checked her out and I called the vet we gave her the all clear.
Then this weekend we went out for a few hours and left Piper at home. When we got back she had eaten around eight Hershey Kisses. I called the vet and they said she would probably be okay, but just to be safe we should “vomit” her, ie. induce vomiting. We had to force down a little hydrogen peroxide and wait. After about ten minutes she vomited, and we figured we were in the clear. Oh no, she was not done. We let her in the house and a few minutes later the Kisses came up in force. There was at least one complete, fully wrapped Kiss. There was also a decent amount of foil. Suffice to say, Piper spent a good portion of the evening out on the deck finishing her business.

Personal , , , , ,