Created
November 8, 2011 21:39
-
-
Save forforf/1349333 to your computer and use it in GitHub Desktop.
Client side script for getting the address for an EC2 Instance
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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