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 ) |
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
| #!/usr/bin/env python | |
| import MySQLdb | |
| import os, sys | |
| import pprint | |
| pp = pprint.PrettyPrinter() | |
| mysql_host = "localhost" | |
| mysql_user = "dbusername" | |
| mysql_pass = "dbpassword" |
NewerOlder