-
-
Save rasmusbergpalm/4637937 to your computer and use it in GitHub Desktop.
matlab ec2 setup
This file contains 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
#!/bin/bash | |
export STATUS="`curl -sL -w "%{http_code}" "http://169.254.169.254/latest/user-data" -o /dev/null`" | |
if [ "$STATUS" != "200" ]; then | |
echo "exiting" | |
exit 1 | |
fi | |
echo "running" | |
export EXPERIMENT="`curl http://169.254.169.254/latest/user-data`" | |
s3fs <bucket> /root/s3 | |
octave /root/research/$EXPERIMENT &> /root/s3/results/${EXPERIMENT////-}.log.txt | |
shutdown -h now |
This file contains 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
#!/bin/bash | |
cd /root/research | |
git fetch | |
git reset --hard origin/master | |
./boot |
This file contains 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
#!/bin/sh -e | |
# | |
# rc.local | |
# | |
# This script is executed at the end of each multiuser runlevel. | |
# Make sure that the script will "exit 0" on success or any other | |
# value on error. | |
# | |
# In order to enable or disable this script just change the execution | |
# bits. | |
# | |
# By default this script does nothing. | |
sudo /etc/lll | |
exit 0 |
This file contains 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
#!/bin/bash | |
#Valid values: t1.micro | m1.small | m1.medium | m1.large | m1.xlarge | m3.xlarge | m3.2xlarge | c1.medium | c1.xlarge | m2.xlarge | m2.2xlarge | m2.4xlarge | cr1.8xlarge | hi1.4xlarge | hs1.8xlarge | cc1.4xlarge | cc2.8xlarge | cg1.4xlarge | |
ec2-request-spot-instances ami-7bb82c12 --region us-east-1 --instance-type $1 --user-data $2 --price 0.1 & |
This file contains 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
#!/bin/bash | |
#Valid values: t1.micro | m1.small | m1.medium | m1.large | m1.xlarge | m3.xlarge | m3.2xlarge | c1.medium | c1.xlarge | m2.xlarge | m2.2xlarge | m2.4xlarge | cr1.8xlarge | hi1.4xlarge | hs1.8xlarge | cc1.4xlarge | cc2.8xlarge | cg1.4xlarge | |
ec2-run-instances ami-0c070978 --region eu-west-1 --instance-type $1 --user-data $2 --instance-initiated-shutdown-behavior terminate & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment