Skip to content

Instantly share code, notes, and snippets.

@dmd

dmd/-

Created September 21, 2015 19:44
Show Gist options
  • Save dmd/ad576724297b1d23d7b4 to your computer and use it in GitHub Desktop.
Save dmd/ad576724297b1d23d7b4 to your computer and use it in GitHub Desktop.
#!/bin/bash
# to use this you need:
# jq https://stedolan.github.io/jq/
# awscli https://aws.amazon.com/cli/
AMI=ami-21146944
MACHINE=g2.2xlarge
KEYPAIR=amazon-gpu
echo starting neural-style instance
INSTANCEID=$(aws ec2 run-instances --image-id $AMI --instance-type $MACHINE --key-name $KEYPAIR | jq '.Instances|.[0].InstanceId' | sed 's/"//g')
echo $INSTANCEID
sleep 5
IPADDR=$(aws ec2 describe-instances --instance-ids $INSTANCEID | jq '.Reservations|.[]|.Instances|.[]|.PublicDnsName'| sed 's/"//g')
echo $IPADDR
@dmd
Copy link
Author

dmd commented Sep 21, 2015

this will start an EC2 machine with https://github.com/jcjohnson/neural-style already installed, and return the IP address.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment