Using the AWS Ruby SDK to launch and tag AWS EC2 Spot Requests

Amazon Web Services provide a number of SDKs that support the various scripting languages. Because we love to automate manual repetitive tasks, we utilized the Ruby AWS SDK to develop a script that: –

1. Creates a specified number of spot instance requests with associated launch parameters
2. Spreads the launch requests over a specified number range of launch zones
3. Waits for the instances to be fulfilled and informs you
4. Tags the instances with your tagname so they appear with a visible description in the web portal name

This is a working version but feel free to enhance to parameterise obvious variables
Continue reading

Using Ruby to connect to DB2 and extract data to a CSV

Well the young boys keep raving about Ruby. I still think Python has a lot more library support via eggs because it has been around longer. Anyhow I gave Ruby a crack for this trivial task and, yes, the same as Python, it does’nt take too much code to automate a painful manual task.

This little script, runs on windows. It will connect to a remote IBM DB2 database, execute a query, then output the result set to a CSV file. You will need some prerequisites before you can do this. Before you continue for this you will need a DB2 client installed, although not the full DB2 client is needed you can download and install the appropriate IBM Data Server Driver for ODBC/JDBC and CLI from here IBM DataServer drivers. If you already have DB2 client software installed then dont worry about this.

Continue reading