Skip to content

Instantly share code, notes, and snippets.

@billhathaway
Created April 23, 2014 16:40
Show Gist options
  • Save billhathaway/11222817 to your computer and use it in GitHub Desktop.
Save billhathaway/11222817 to your computer and use it in GitHub Desktop.
shell function to SSH to an EC2 hostname
ec2ssh() {
# ec2-54-187-110-140.us-west-2.compute.amazonaws.com -> 54-187-110-140
hostname=`echo $1 | perl -pe 's/\..*//; s/ec2-//; s/-/./g'`
ssh $hostname
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment