Skip to content

Instantly share code, notes, and snippets.

@forforf
Created November 8, 2011 21:39
Show Gist options
  • Select an option

  • Save forforf/1349333 to your computer and use it in GitHub Desktop.

Select an option

Save forforf/1349333 to your computer and use it in GitHub Desktop.
Client side script for getting the address for an EC2 Instance
ssh_my_server.rb
require 'open-uri'
#not real names
Server = "MyServer"
bootstrap_data_json = open('http://my_iris.iriscouch.com/bootie/' + Server){|f| f.read}
bootstrap_data_raw = JSON.parse(bootstrap_data_json)
srv_name = bootstrap_data_raw["_id"]
ip_addr = bootstrap_data_raw["ip"]
putty_cmd = "start putty.exe" \
" -i \"C:\\Documents and Settings\\path\\to\\my\\keypair.ppk\" \
" ec2-user@#{ip_addr}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment