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
| def manage(management_command, args=[]): | |
| with cd(REMOTE_PROJECT_DIR): | |
| with prefix('source /path/to/virtualenv/bin/activate'): | |
| run('python manage.py %s %s' % (management_command, ' '.join(args)) |
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 local,run, sudo, cd, prefix, env, put, settings, show | |
| env.hosts = ['33.33.33.10'] | |
| env.user = 'vagrant' | |
| def first(): | |
| run('ifconfig eth1') | |
| def second(): | |
| with settings( |
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 | |
| from __future__ import with_statement | |
| import os | |
| import re | |
| import shutil | |
| import subprocess | |
| import sys | |
| import tempfile |
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
| def sshagent_run(cmd): | |
| """ | |
| Helper function. | |
| Runs a command with SSH agent forwarding enabled. | |
| Note:: Fabric (and paramiko) can't forward your SSH agent. | |
| This helper uses your system's ssh to do so. | |
| """ | |
| host = api.env.host_string | |
| result = api.local('ssh -A %s "%s"' % (host, cmd)) | |
| print result |
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
| def test(): | |
| print 'this is a test' |
NewerOlder