This is a quick and dirty script for monitoring for an available on-demand EC2 instance.
This script will generate a EC2 spot instance request bid with auto price discovery. It will look at the current spot price bids, get the maximum and add a 20% buffer to that price. It can get an instance (almost) immediately, and this will lessen the chance of AWS interrupting the EC2 spot instance due to spot pricing changes (can auto-terminate the instance within 2 minutes)