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
| from fabric.api import * | |
| env.hosts = ['host.name.com'] | |
| env.user = 'user' | |
| env.key_filename = '/path/to/keyfile.pem' | |
| def local_uname(): | |
| local('uname -a') | |
| def remote_uname(): |
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
| # docker build -t="rails" . | |
| FROM ubuntu:12.04 | |
| RUN apt-get update | |
| ## MYSQL | |
| RUN apt-get install -y -q mysql-client libmysqlclient-dev | |
| ## RUBY |
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
| sudo apt-get install unzip; | |
| wget -O /tmp/chromedriver.zip http://chromedriver.googlecode.com/files/chromedriver_linux64_19.0.1068.0.zip && sudo unzip /tmp/chromedriver.zip chromedriver -d /usr/local/bin/; |
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
| import paramiko | |
| k = paramiko.RSAKey.from_private_key_file("/Users/whatever/Downloads/mykey.pem") | |
| c = paramiko.SSHClient() | |
| c.set_missing_host_key_policy(paramiko.AutoAddPolicy()) | |
| print "connecting" | |
| c.connect( hostname = "www.acme.com", username = "ubuntu", pkey = k ) | |
| print "connected" | |
| commands = [ "/home/ubuntu/firstscript.sh", "/home/ubuntu/secondscript.sh" ] | |
| for command in commands: | |
| print "Executing {}".format( command ) |