text stringlengths 0 1.05M | meta dict |
|---|---|
from fabric.api import *
master = 'ns-dev.nws.oregonstate.edu'
slaves = ['ns4jr.nws.oregonstate.edu']
env.hosts = slaves
maintain_dir = "/data/maintain"
def uname():
run('uname -a')
def build():
pass
def deploy_maintain_named_conf():
local_conf = maintain_dir + "/staging/named.conf.maintain"
for sl... | {
"repo_name": "ngokevin/cyder",
"path": "cyder/maintain2cyder/deploy_configs.py",
"copies": "1",
"size": "2623",
"license": "bsd-3-clause",
"hash": -1898641711919561200,
"line_mean": 28.1444444444,
"line_max": 109,
"alpha_frac": 0.6172321769,
"autogenerated": false,
"ratio": 3.358514724711908,
... |
from fabric.api import *
"""
Define the server environments that this app will be deployed to.
Ensure that you have SSH access to the servers for the scripts in 'fabfile.py' to work.
"""
def staging():
"""
Env parameters for the staging environment.
"""
env.hosts = ["user@server:port"]
env.proje... | {
"repo_name": "Code4SA/pa-hotness",
"path": "fabdefs.py",
"copies": "1",
"size": "1270",
"license": "apache-2.0",
"hash": -3317578601075528700,
"line_mean": 38.6875,
"line_max": 117,
"alpha_frac": 0.6921259843,
"autogenerated": false,
"ratio": 3.691860465116279,
"config_test": true,
"has_no_k... |
from fabric.api import *
env.project_name = 'manabi'
env.hosts = ['alex@manabi.org']
env.home = '/home/alex/'
env.path = env.home + 'manabi'
env.virtualenv_path = '/home/alex/virtualenvs/manabi'
def upload_settings():
put('settings.py', env.path)
def python(cmd, *args, **kwargs):
return run('{0}/bin/python... | {
"repo_name": "aehlke/manabi",
"path": "manabi/fabfile.py",
"copies": "1",
"size": "1484",
"license": "mit",
"hash": 8537237376339656000,
"line_mean": 22.1875,
"line_max": 84,
"alpha_frac": 0.6273584906,
"autogenerated": false,
"ratio": 2.997979797979798,
"config_test": false,
"has_no_keyword... |
from fabric.api import *
# Hosts
def tools():
env.hosts = ['tools.scilifelab.se']
# Obs! nonstandard port!
def tools_dev():
env.hosts = ['tools-dev.scilifelab.se']
# Commands
def stop():
""" Stops the genomics-status webapp server.
"""
sudo("kill $(ps aux | grep '[s]tatus_app.py' | awk '{... | {
"repo_name": "ewels/genomics-status",
"path": "fabfile.py",
"copies": "5",
"size": "1239",
"license": "mit",
"hash": 2031505342763159300,
"line_mean": 24.8125,
"line_max": 91,
"alpha_frac": 0.606133979,
"autogenerated": false,
"ratio": 3.304,
"config_test": false,
"has_no_keywords": false,
... |
from fabric.api import *
# Restart services
# yes, || exit 0 is weird, but apparently necessary as run()
# (or Jenkins) evaluates the possibility of running the 'false'
# action even if it's not going to return false.. stupid
@task
def clear_varnish_cache():
with settings(hide('warnings', 'stderr'), warn_only=True... | {
"repo_name": "codeenigma/deployments",
"path": "common/Services.py",
"copies": "1",
"size": "1979",
"license": "mit",
"hash": 7811671503140357000,
"line_mean": 37.0769230769,
"line_max": 117,
"alpha_frac": 0.618494189,
"autogenerated": false,
"ratio": 3.146263910969793,
"config_test": false,
... |
from fabric.api import *
root_dir = '/srv/http'
# the user to use for the remote commands
env.user = 'www-data'
# the servers where the commands are executed
env.hosts = ['c-hans.de']
def pack():
# create a new source distribution as tarball
local('python setup.py sdist --formats=gztar', capture=False)
def ... | {
"repo_name": "christianhans/mensafeed",
"path": "fabfile.py",
"copies": "1",
"size": "1237",
"license": "mit",
"hash": -8157692142686924000,
"line_mean": 33.3611111111,
"line_max": 71,
"alpha_frac": 0.6645109135,
"autogenerated": false,
"ratio": 3.389041095890411,
"config_test": false,
"has_... |
from fabric.api import *
@task
def deploykeys():
'''Deploys keys for root'''
@task
def deployuserkeys():
'''deploys user keys'''
out = run('ls -a ~/')
if not ('.ssh' in out):
run('mkdir ~/.ssh/')
put('/home/johann/.ssh/authorized_keys', '~/.ssh/authorize_keys', mode=0700)
... | {
"repo_name": "romeroj1/potential-batman",
"path": "FabricHome/common.py",
"copies": "1",
"size": "2281",
"license": "apache-2.0",
"hash": 9045022907359662000,
"line_mean": 26.1666666667,
"line_max": 104,
"alpha_frac": 0.5984217448,
"autogenerated": false,
"ratio": 3.50384024577573,
"config_tes... |
from fabric.api import *
@task
def simple():
"""Install latest (security) updates"""
import vars
vars = vars.Vars()
sudo(vars.os.package_refresh_cmd)
sudo(vars.os.package_upgrade_cmd)
@parallel
def get_update_status():
"""Return update information for a node"""
security_updates = sudo("fac... | {
"repo_name": "mattock/fabric",
"path": "upgrade.py",
"copies": "2",
"size": "3804",
"license": "bsd-2-clause",
"hash": -2821240495242354000,
"line_mean": 35.2285714286,
"line_max": 106,
"alpha_frac": 0.5538906414,
"autogenerated": false,
"ratio": 4.143790849673203,
"config_test": false,
"has... |
from fabric.api import *
@task
def stop_all():
execute(stop_bla6)
@hosts('bla6.gbif.org')
def stop_bla6():
sudo('cd /home/crap/bin && /home/crap/bin/stop-all.sh', user='crap')
@hosts('bla6.gbif.org')
def clean_storage_bla6():
sudo('sh -c "rm -rf /home/crap/storage/{xml,dwca,results}/*"', user='crap')
@task
... | {
"repo_name": "omeyn/fabric",
"path": "fabfile/crawler/__init__.py",
"copies": "1",
"size": "2114",
"license": "apache-2.0",
"hash": -8921929382622550000,
"line_mean": 30.5671641791,
"line_max": 165,
"alpha_frac": 0.6816461684,
"autogenerated": false,
"ratio": 2.9566433566433568,
"config_test":... |
from fabric.api import *
@task
def stop_and_clean():
execute(stop_all)
execute(clean_storage)
clean_zk()
purge_rabbitmq()
truncate_hbase()
truncate_solr()
@task
def stop_all():
execute(stop_crawler)
@task
def clean_storage():
execute(clean_storage_crawler)
@hosts('crawler.gbif-uat.org')
def stop_c... | {
"repo_name": "omeyn/fabric",
"path": "fabfile/crawleruat/__init__.py",
"copies": "1",
"size": "2400",
"license": "apache-2.0",
"hash": 5410491116485818000,
"line_mean": 30.1818181818,
"line_max": 174,
"alpha_frac": 0.6841666667,
"autogenerated": false,
"ratio": 2.92326431181486,
"config_test":... |
from fabric.api import *
@task
def stop_and_clean():
execute(stop_all)
execute(clean_storage)
clean_zk()
purge_rabbitmq()
truncate_hbase()
truncate_solr()
@task
@hosts('crawler.gbif-dev.org')
def stop_all():
sudo('cd /home/crap/bin && /home/crap/bin/stop-all.sh', user='crap')
sudo('sh -c "rm -rf /home... | {
"repo_name": "omeyn/fabric",
"path": "fabfile/crawlerdev/__init__.py",
"copies": "1",
"size": "2262",
"license": "apache-2.0",
"hash": 9090449949389809000,
"line_mean": 32.2647058824,
"line_max": 175,
"alpha_frac": 0.682581786,
"autogenerated": false,
"ratio": 2.8962868117797695,
"config_test"... |
from fabric.api import *
@task
def vagrant(boot=True, destroy=False):
if destroy: local('vagrant destroy')
if boot: local('vagrant up')
# change from the default user to 'vagrant'
env.user = 'vagrant'
# connect to the port-forwarded ssh
env.hosts = ['127.0.0.1:2222']
# Disable cached hos... | {
"repo_name": "cleer73/houseguest",
"path": "fabfile.py",
"copies": "1",
"size": "3105",
"license": "bsd-2-clause",
"hash": 3236828976735402000,
"line_mean": 28.8557692308,
"line_max": 122,
"alpha_frac": 0.6331723027,
"autogenerated": false,
"ratio": 3.37867247007617,
"config_test": false,
"h... |
from fabric.api import *
# the user to use for the remote commands
#env.user = 'appuser'
# the servers where the commands are executed
#env.hosts = ['server1.example.com', 'server2.example.com']
import time
import datetime
from fabric.colors import green, blue, red
import json
def deploy(app, git):
ts = int(time.tim... | {
"repo_name": "alex-min/fabric-deploy",
"path": "fabfile.py",
"copies": "1",
"size": "3271",
"license": "unlicense",
"hash": 3217164953142252000,
"line_mean": 33.7978723404,
"line_max": 109,
"alpha_frac": 0.6401712015,
"autogenerated": false,
"ratio": 2.85178727114211,
"config_test": false,
"... |
from fabric.api import *
# the user to use for the remote commands
env.user = 'root'
# the servers where the commands are executed
env.hosts = ['192.241.196.189']
def pack():
# create a new source distribution as tarball
local('python setup.py sdist --formats=gztar', capture=False)
def deploy():
pack()
... | {
"repo_name": "ufo22940268/Python-RMS",
"path": "fabfile.py",
"copies": "1",
"size": "2227",
"license": "bsd-3-clause",
"hash": 4469491013229866500,
"line_mean": 38.0701754386,
"line_max": 117,
"alpha_frac": 0.6138302649,
"autogenerated": false,
"ratio": 3.294378698224852,
"config_test": false,... |
from fabric.api import *
# the user to use for the remote commands
env.user = 'vagrant'
env.key_filename = '~/.ssh/id_rsa'
# the servers where the commands are executed
# env.hosts = ['foodbeazt.in']
env.hosts = ['192.168.33.10']
def pack():
# create a new source distribution as tarball
local('python setup.... | {
"repo_name": "cackharot/fbeazt",
"path": "src/fabfile.py",
"copies": "1",
"size": "2033",
"license": "apache-2.0",
"hash": 903395495404321500,
"line_mean": 34.0517241379,
"line_max": 102,
"alpha_frac": 0.6522380718,
"autogenerated": false,
"ratio": 2.9001426533523538,
"config_test": false,
"... |
from fabric.api import *
user = "aregee"
#Provide the username you used while setting up the project.
key = "269eab44987203289aceec32a72b524b5b030e58"
#Add the api_key that you createdd in the admin
def setup():
local("python manage.py syncdb --noinput")
local("python manage.py migrate")
def update_searc... | {
"repo_name": "aregee/moksaya",
"path": "fabfile.py",
"copies": "1",
"size": "16427",
"license": "mit",
"hash": -6252259039253564000,
"line_mean": 60.5243445693,
"line_max": 353,
"alpha_frac": 0.6451573629,
"autogenerated": false,
"ratio": 2.8469670710571924,
"config_test": true,
"has_no_keyw... |
from fabric.api import *
vars = {
'app_dir': '/usr/local/apps/land_owner_tools/lot',
'venv': '/usr/local/venv/lot',
'sitename': 'localhost:8080',
'branch': 'master'
}
env.forward_agent = True
env.key_filename = '~/.vagrant.d/insecure_private_key'
try:
from fab_vars import *
fab_vars_exists =... | {
"repo_name": "Ecotrust/forestplanner",
"path": "fabfile.py",
"copies": "1",
"size": "8656",
"license": "bsd-3-clause",
"hash": -7830066093971871000,
"line_mean": 30.3623188406,
"line_max": 134,
"alpha_frac": 0.5693160813,
"autogenerated": false,
"ratio": 3.63392107472712,
"config_test": false,... |
from fabric.api import * # noqa
env.hosts = [
'104.131.30.135',
]
env.user = "root"
env.directory = "/home/django/api.freemusic.ninja"
env.deploy_path = "/home/django/django_project"
def deploy():
with cd(env.directory):
run("git fetch")
run("git reset --hard origin/master")
sudo("p... | {
"repo_name": "FreeMusicNinja/api.freemusic.ninja",
"path": "fabfile.py",
"copies": "1",
"size": "1154",
"license": "bsd-3-clause",
"hash": -7279384652269599000,
"line_mean": 25.8372093023,
"line_max": 70,
"alpha_frac": 0.6317157712,
"autogenerated": false,
"ratio": 3.539877300613497,
"config_t... |
from fabric.api import put, run, settings, task
from fabric.contrib.files import exists, sed
from StringIO import StringIO
from . import apt
@task
def ensure(server=None):
with settings(user='root'):
apt.add_repository('ppa:certbot/certbot')
apt.ensure('certbot')
if exists('/etc/letsencryp... | {
"repo_name": "btmorex/fabric_ubuntu",
"path": "fabric_ubuntu/letsencrypt.py",
"copies": "1",
"size": "1090",
"license": "mit",
"hash": 1657735132283190800,
"line_mean": 30.1428571429,
"line_max": 82,
"alpha_frac": 0.5486238532,
"autogenerated": false,
"ratio": 3.797909407665505,
"config_test":... |
from fabric.api import puts, sudo
from fabtools.require.files import directory as require_directory
def test_list_partitions():
"""
List disk partitions
"""
from fabtools.disk import partitions
partitions = partitions()
for pname, ptype in list(partitions.items()):
puts("%s is %s" %... | {
"repo_name": "wagigi/fabtools-python",
"path": "fabtools/tests/functional_tests/test_disk.py",
"copies": "3",
"size": "1186",
"license": "bsd-2-clause",
"hash": 5349166176882003000,
"line_mean": 24.2340425532,
"line_max": 65,
"alpha_frac": 0.6121416526,
"autogenerated": false,
"ratio": 3.70625,
... |
from fabric.api import put, sudo
from os import walk, remove
from os.path import relpath, join
from mimetypes import guess_type
from tempfile import NamedTemporaryFile
from boto.utils import compute_md5
import logging
#: Map of strings to loglevels (for the logging module)
loglevel_stringmap = {'DEBUG': logging.DEBUG... | {
"repo_name": "jneves/awsfabrictasks",
"path": "awsfabrictasks/utils.py",
"copies": "2",
"size": "8454",
"license": "bsd-3-clause",
"hash": -7405680793470263000,
"line_mean": 32.2834645669,
"line_max": 94,
"alpha_frac": 0.6237284126,
"autogenerated": false,
"ratio": 3.877981651376147,
"config_t... |
from fabric.api import *
from fabric.contrib import files
from playback import common
from playback.templates.galera_list import (conf_galera_list_trusty,
conf_galera_list_xenial)
class MysqlInstallation(common.Common):
"""
Install Galera Cluster for MySQ... | {
"repo_name": "nofdev/playback",
"path": "playback/mysql_installation.py",
"copies": "2",
"size": "2572",
"license": "mit",
"hash": 9006906468642907000,
"line_mean": 34.7428571429,
"line_max": 188,
"alpha_frac": 0.5913685848,
"autogenerated": false,
"ratio": 3.987596899224806,
"config_test": fa... |
from fabric.api import *
import time
import random
# env.use_ssh_config = True
env.user = 'steven.pecht'
# Remote hosts
# env.hosts = ['146.148.78.230',
# '146.148.89.88',
# '146.148.45.143'] #,
# '130.211.122.241']
env.roledefs.update({
'master': ['130.211.122.241'],
'slaves': ['108.... | {
"repo_name": "swpecht/EECS-587-term-project",
"path": "fabfile.py",
"copies": "1",
"size": "2190",
"license": "mit",
"hash": -8683588442126217000,
"line_mean": 25.037037037,
"line_max": 127,
"alpha_frac": 0.5118721461,
"autogenerated": false,
"ratio": 3.062937062937063,
"config_test": true,
... |
from fabric.api import *
vars = {
'app_dir': '/usr/local/apps/locus/locus',
'venv': '/usr/local/venv/locus'
}
env.forward_agent = True
env.key_filename = '~/.vagrant.d/insecure_private_key'
def dev():
""" Use development server settings """
servers = ['vagrant@127.0.0.1:2222']
env.... | {
"repo_name": "Ecotrust/locus",
"path": "fabfile.py",
"copies": "1",
"size": "2605",
"license": "bsd-3-clause",
"hash": -3621807744698640000,
"line_mean": 28.6470588235,
"line_max": 104,
"alpha_frac": 0.573512476,
"autogenerated": false,
"ratio": 3.432147562582345,
"config_test": false,
"has_... |
from fabric.api import run, cd, env, local
env.hosts = ['webcampzg.org']
env.user = 'webcamp'
PROJECT_HOME = '/home/webcamp/web/conference-web'
DUMP_FILE = "/tmp/conference-web-$(date +%Y-%m-%d).sql"
REMOTE_BIN = "/home/webcamp/.virtualenvs/conference-web/bin/"
def deploy():
local("git push")
with cd(PROJEC... | {
"repo_name": "WebCampZg/conference-web",
"path": "fabfile.py",
"copies": "1",
"size": "1521",
"license": "bsd-3-clause",
"hash": -4135256018971993600,
"line_mean": 27.6981132075,
"line_max": 69,
"alpha_frac": 0.6160420776,
"autogenerated": false,
"ratio": 3.175365344467641,
"config_test": fals... |
from fabric.api import run, cd, env, put, prefix, sudo
env.deploy_dir = '/home/ubuntu/ateoto.com'
env.default_deploy_ref = 'origin/master'
env.virtualenv = 'ateoto.com'
env.hosts = ['ubuntu@ateoto.com']
def deploy():
update_code()
install_requirements()
collect_static()
#apache('reload')
def update... | {
"repo_name": "ateoto/ateoto.com_old",
"path": "fabfile.py",
"copies": "1",
"size": "1316",
"license": "bsd-3-clause",
"hash": 7618472167751988000,
"line_mean": 26.4166666667,
"line_max": 103,
"alpha_frac": 0.6314589666,
"autogenerated": false,
"ratio": 3.400516795865633,
"config_test": false,
... |
from fabric.api import (run, cd, local, env)
env.user = 'target'
env.hosts = ['178.62.249.236']
def startCelery():
run('celery -A app.celery worker --loglevel=INFO --concurrency=10 &')
def supervisor():
run('kill -9 `pgrep gunicorn`')
run('kill -9 `pgrep supervisor`')
run('kill -9 `pgrep celery`')
... | {
"repo_name": "ianjuma/target",
"path": "fabfile.py",
"copies": "1",
"size": "1136",
"license": "apache-2.0",
"hash": 403838040946771100,
"line_mean": 24.2444444444,
"line_max": 73,
"alpha_frac": 0.6029929577,
"autogenerated": false,
"ratio": 3.4114114114114114,
"config_test": false,
"has_no_... |
from fabric.api import run,cd,parallel,serial
from fabric.contrib.files import exists
counter = 0
@parallel
def cmt_init():
if not exists('/data/mdindex/yilu'):
run('mkdir /data/mdindex/yilu')
with cd('/data/mdindex/yilu'):
run('git clone https://github.com/luyi0619/cmt-dbgen.git')
with cd... | {
"repo_name": "mitdbg/AdaptDB",
"path": "scripts/fabfile/cmt_datagen.py",
"copies": "1",
"size": "3045",
"license": "mit",
"hash": -7608598588775781000,
"line_mean": 39.0657894737,
"line_max": 112,
"alpha_frac": 0.619047619,
"autogenerated": false,
"ratio": 2.7531645569620253,
"config_test": fa... |
from fabric.api import run,cd,parallel,serial
from fabric.contrib.files import exists
counter = 0
@parallel
def tpch_init():
if not exists('/data/mdindex/yilu'):
run('mkdir /data/mdindex/yilu')
with cd('/data/mdindex/yilu'):
run('git clone https://github.com/electrum/tpch-dbgen.git')
with ... | {
"repo_name": "mitdbg/mdindex",
"path": "scripts/fabfile/tpch_datagen.py",
"copies": "2",
"size": "7092",
"license": "mit",
"hash": 7367394626103716000,
"line_mean": 36.3263157895,
"line_max": 111,
"alpha_frac": 0.5927805979,
"autogenerated": false,
"ratio": 2.8829268292682926,
"config_test": f... |
from fabric.api import run,cd,parallel,serial
from fabric.contrib.files import exists
counter = 0
@parallel
def tpch_remove():
if exists('/data/mdindex/'):
run('rm -rf /data/mdindex/')
@parallel
def download_tpch_dbgen():
if not exists('/data/mdindex/'):
run('mkdir /data/mdindex/')
if not... | {
"repo_name": "mitdbg/amoeba",
"path": "scripts/fabfile/datagen.py",
"copies": "2",
"size": "7319",
"license": "mit",
"hash": 4057650288565947000,
"line_mean": 34.019138756,
"line_max": 163,
"alpha_frac": 0.6084164503,
"autogenerated": false,
"ratio": 2.8182518290335,
"config_test": false,
"h... |
from fabric.api import run, cd, sudo, roles, runs_once, env
from fabric.contrib.files import first
# add a local_fab_settings.py file,
# so that you can access your servers
# but please, don't commit it to git.
try:
from local_fab_settings import *
except ImportError as e:
pass
env.venv_roots = ['/oknesset_w... | {
"repo_name": "antin/Open-Knesset",
"path": "fabfile.py",
"copies": "11",
"size": "3568",
"license": "bsd-3-clause",
"hash": -1471443326784855600,
"line_mean": 22.6291390728,
"line_max": 118,
"alpha_frac": 0.6328475336,
"autogenerated": false,
"ratio": 3.3129062209842153,
"config_test": false,
... |
from fabric.api import run, env, cd, prefix, task, sudo, warn_only
import json
import subprocess
import requests
class Slack(object):
web_hook_url = 'https://hooks.slack.com/services/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'
server_update_template = '''```Staging server updated by {author_name}```'''
... | {
"repo_name": "stepanovsh/project_template",
"path": "{{cookiecutter.repo_name}}/fabfile.py",
"copies": "1",
"size": "2299",
"license": "bsd-3-clause",
"hash": 4590086419030333000,
"line_mean": 21.3203883495,
"line_max": 108,
"alpha_frac": 0.6420182688,
"autogenerated": false,
"ratio": 3.39085545... |
from fabric.api import run, env, cd, put, get, execute, require, sudo, local, lcd, settings
from fabric.decorators import runs_once, roles, parallel
import sys
import time
import re
import boto3
ec2 = boto3.resource('ec2')
running_filter = [{'Name': 'instance-state-name', 'Values': ['running']}, {"Name":"tag:deploy_... | {
"repo_name": "gdanezis/rousseau-chain",
"path": "kafka-deploy/fabfile.py",
"copies": "1",
"size": "5017",
"license": "bsd-2-clause",
"hash": -6063956921032834000,
"line_mean": 28.6863905325,
"line_max": 149,
"alpha_frac": 0.6220849113,
"autogenerated": false,
"ratio": 3.3671140939597315,
"conf... |
from fabric.api import run, env, cd, put, get, execute, require, sudo, local, lcd, settings
from fabric.decorators import runs_once, roles, parallel
from base64 import b64encode, b64decode
import rscoin
import sys
sys.path += [ "." ]
import re
import boto3
ec2 = boto3.resource('ec2')
env.key_filename = "/home/xiao... | {
"repo_name": "lengxiao1993/SecureLogging",
"path": "fabfile.py",
"copies": "1",
"size": "14504",
"license": "bsd-2-clause",
"hash": -6990995472115425000,
"line_mean": 26.785440613,
"line_max": 149,
"alpha_frac": 0.584666299,
"autogenerated": false,
"ratio": 3.401500938086304,
"config_test": fa... |
from fabric.api import run, env, hosts, sudo, cd, task, local
from fabric.tasks import Task
env.hosts = ['newdocker', ]
env.use_ssh_config = True
@task
def rebuild_docker():
local("docker-compose build django")
local("docker-compose -f dev.yml build django")
local("docker push registry.creativeit.biz/drk... | {
"repo_name": "Ameriks/drklauns",
"path": "fabfile.py",
"copies": "1",
"size": "2595",
"license": "mit",
"hash": 3688204665721713000,
"line_mean": 30.265060241,
"line_max": 89,
"alpha_frac": 0.6289017341,
"autogenerated": false,
"ratio": 3.5694635488308117,
"config_test": false,
"has_no_keywo... |
from fabric.api import run, env, local, cd
from fabric.contrib.files import exists
# Include the Dropbox SDK
from dropbox.files import WriteMode
from dropbox.exceptions import ApiError, AuthError
import sys
import dropbox
###############################################################################################... | {
"repo_name": "tuanquanghpvn/fabric-zip-and-upload-to-dropbox",
"path": "fabfile.py",
"copies": "1",
"size": "4105",
"license": "mit",
"hash": 5736960037556231000,
"line_mean": 37.7264150943,
"line_max": 115,
"alpha_frac": 0.4789281364,
"autogenerated": false,
"ratio": 4.452277657266811,
"confi... |
from fabric.api import run, env
from time import sleep
from boto.exception import EC2ResponseError
from .util import eval_template
def attach_volumes(vm_launcher, options, format=False):
"""
"""
volumes = options.get("volumes", [])
if not volumes:
return
boto_connection = vm_launcher.boto_... | {
"repo_name": "lpantano/cloudbiolinux",
"path": "cloudbio/deploy/volume.py",
"copies": "9",
"size": "8759",
"license": "mit",
"hash": -8625276009614586000,
"line_mean": 38.99543379,
"line_max": 129,
"alpha_frac": 0.6250713552,
"autogenerated": false,
"ratio": 3.759227467811159,
"config_test": f... |
from fabric.api import run, env, parallel, settings, local, hosts, task
from fabric.tasks import execute
from fabric.operations import put
from fabric.context_managers import cd, prefix
env.linewise = True #for parallel execution
path = '~/rtmp_load' #TODO hardcode
@task
@hosts('')
def pack ():
local('tar --exc... | {
"repo_name": "fillest/rtmp_load",
"path": "fabfile.py",
"copies": "1",
"size": "1416",
"license": "mit",
"hash": -8099617366591852000,
"line_mean": 24.3035714286,
"line_max": 178,
"alpha_frac": 0.6518361582,
"autogenerated": false,
"ratio": 2.8780487804878048,
"config_test": false,
"has_no_k... |
from fabric.api import run, env, prefix, sudo, cd, settings
from cuisine import *
masterIPFile = "master.ip"
def mesos():
package_ensure('mesos')
package_ensure('mesosphere')
masterIP = getMasterIP()
with mode_sudo():
file_write("/etc/mesos/zk", "zk://%s:2181/mesos\n" % masterIP)
if "m... | {
"repo_name": "greenify/hadoop-auto-conf",
"path": "mesos.py",
"copies": "1",
"size": "1630",
"license": "mit",
"hash": -60740006941316696,
"line_mean": 37.8095238095,
"line_max": 86,
"alpha_frac": 0.5576687117,
"autogenerated": false,
"ratio": 3.319755600814664,
"config_test": false,
"has_no... |
from fabric.api import run, env, prompt, execute, sudo, open_shell, put
from fabric.contrib.project import rsync_project
from fabric.contrib.files import exists
import boto.ec2
import time
import os
env.aws_region = 'us-west-2'
env.hosts = ['localhost', ]
env.key_filename = '~/.ssh/pk-ins.pem'
env.myhost = 'ec2-54-1... | {
"repo_name": "ezPy-co/ezpy",
"path": "installer/fabfile.py",
"copies": "1",
"size": "6494",
"license": "mit",
"hash": -3136583635722039000,
"line_mean": 27.6123348018,
"line_max": 91,
"alpha_frac": 0.6165691407,
"autogenerated": false,
"ratio": 3.7711962833914052,
"config_test": true,
"has_n... |
from fabric.api import run, env, prompt, execute, sudo, put
from fabric.contrib.files import append
from fabric.contrib import files
import boto.ec2
import time
# these env variables are available throughout
env.hosts = ['localhost', ]
env.aws_region = 'us-west-2'
env.key_filename = '/home/meslater/.ssh/pk-aws.pem'
g... | {
"repo_name": "meslater1030/taste-buddies",
"path": "fabfile.py",
"copies": "2",
"size": "7972",
"license": "mit",
"hash": -1231680953782960600,
"line_mean": 29.196969697,
"line_max": 77,
"alpha_frac": 0.5963371801,
"autogenerated": false,
"ratio": 3.5541685242978156,
"config_test": false,
"h... |
#from fabric.api import run, env, put, sudo, local, hosts
# source https://phab-riaps.isis.vanderbilt.edu/source/riaps-pycom/browse/ISORC/fab_src/
from fabric.api import *
import time
import socket
env.hosts = ['bbb-eb18.local']
env.password = 'riapspwd'
env.user = 'riaps'
env.sudo_password = 'riapspwd'
env.roledefs ... | {
"repo_name": "dcpssc/chariot",
"path": "scripts/fab/fabfile.py",
"copies": "2",
"size": "2551",
"license": "mit",
"hash": -6704665469810228000,
"line_mean": 33.9452054795,
"line_max": 182,
"alpha_frac": 0.7012936103,
"autogenerated": false,
"ratio": 3.0332936979785967,
"config_test": false,
... |
from fabric.api import run, env, settings, sudo
from celery import task
from gameq import gameq
import json
with open('../data/config.json') as cfg:
config = json.load(cfg)
STAGES = {'pc': config['pc'], 'nas': config['nas']}
def stage_set(stage_name='pc'):
env.stage = stage_name
for option, value in STAG... | {
"repo_name": "Au1st3in/au1st3in.net",
"path": "app/fabfile.py",
"copies": "1",
"size": "1384",
"license": "mit",
"hash": 1574409718590133500,
"line_mean": 30.4545454545,
"line_max": 132,
"alpha_frac": 0.5946531792,
"autogenerated": false,
"ratio": 3.351089588377724,
"config_test": false,
"ha... |
from fabric.api import run, env, settings, task
from fabric.tasks import execute as fabric_execute
from fabric.contrib import files
from nose.tools import assert_true
from configuration import PUPPET_MASTER_USERNAME, PUPPET_MASTER_PWD, PUPPET_WRAPPER_IP
from constants import PUPPET_MASTER_SPECIFIC_MANIFEST, PUPPET_MAST... | {
"repo_name": "telefonicaid/fiware-puppetwrapper",
"path": "acceptance_tests/commons/fabric_utils.py",
"copies": "1",
"size": "3172",
"license": "apache-2.0",
"hash": 3306067461316947000,
"line_mean": 30.72,
"line_max": 120,
"alpha_frac": 0.7323455233,
"autogenerated": false,
"ratio": 3.236734693... |
from fabric.api import run, env, task, cd, sudo
from fabric.operations import get
import time
"""
pip install fabric
how to run:
fab deploy -i ~/.ssh/egallardojedutils.pem -H ubuntu@dental.jedutils.com
fab deploy -i ~/.ssh/egallardojedutils.pem -H ubuntu@52.16.31.196
"""
ENV_NAME = 'dental'
PORT = 8006
def gen_u... | {
"repo_name": "edilio/dental",
"path": "fabfile.py",
"copies": "1",
"size": "1299",
"license": "mit",
"hash": 5330651798714544000,
"line_mean": 27.2391304348,
"line_max": 112,
"alpha_frac": 0.5727482679,
"autogenerated": false,
"ratio": 3.2475,
"config_test": false,
"has_no_keywords": false,
... |
from fabric.api import run, env, task, settings
from fabric.colors import green
def create_database():
"""
Create the MySQL Mayan EDMS database
"""
run('echo "CREATE DATABASE %(database_name)s CHARACTER SET utf8;" | mysql -u root --password=%(database_manager_admin_password)s' % env)
def create_use... | {
"repo_name": "rogeriofalcone/mayan-fabric",
"path": "fabfile/databases/mysql.py",
"copies": "1",
"size": "1370",
"license": "isc",
"hash": 3688179573260074000,
"line_mean": 37.0555555556,
"line_max": 201,
"alpha_frac": 0.6532846715,
"autogenerated": false,
"ratio": 3.399503722084367,
"config_t... |
from fabric.api import run, execute, task, settings, sudo, cd, prefix, env
from fabric.operations import put
from fabric.contrib import files
import sys, getopt, os
import argparse
def deploy():
with settings():
sudo('apt-get update -qq')
# mysql or mariadb?
sudo('apt-get install --force-yes -y -qq lxc haprox... | {
"repo_name": "nl5887/upscale",
"path": "bin/bootstrap.py",
"copies": "1",
"size": "2704",
"license": "apache-2.0",
"hash": -5387666859045993000,
"line_mean": 29.3820224719,
"line_max": 134,
"alpha_frac": 0.6934171598,
"autogenerated": false,
"ratio": 3.144186046511628,
"config_test": false,
... |
from fabric.api import run, hide, task, env
@task
def load():
"""
Prints the current load values.
Example usage:
$ fab stage load
$ fab prod load
"""
def _set_color(load):
"""
Sets the terminal color for an load average value depending on how
high it is.
... | {
"repo_name": "pastpages/wordpress-memento-plugin",
"path": "fabfile/load.py",
"copies": "1",
"size": "1385",
"license": "mit",
"hash": 1682689996580521700,
"line_mean": 27.8541666667,
"line_max": 77,
"alpha_frac": 0.5465703971,
"autogenerated": false,
"ratio": 4.06158357771261,
"config_test": ... |
from fabric.api import run, local, cd, lcd, put
from fabric.contrib.files import append
import os
import sys
cwd = os.path.dirname(os.path.abspath(__file__))
test_dir = '/home/vagrant/test'
def _create_vagrant_file():
content = '''
# -*- mode: ruby -*-
# vi: set ft=ruby :
ENV["VAGRANT_DEFAULT_PROVIDER"] = "lxc... | {
"repo_name": "AlphaStaxLLC/scalr",
"path": "app/python/tests/fabfile.py",
"copies": "2",
"size": "5999",
"license": "apache-2.0",
"hash": -6969605867250384000,
"line_mean": 31.781420765,
"line_max": 108,
"alpha_frac": 0.5045840973,
"autogenerated": false,
"ratio": 3.3217054263565893,
"config_t... |
from fabric.api import run
from fabric.api import env, local
import boto.ec2
import time
from fabric.api import prompt, execute
from fabric.api import sudo
from fabric.contrib.project import rsync_project
from fabric.contrib.files import upload_template
env.hosts = ['localhost', ]
env.aws_region = 'us-west-2'
env.key_... | {
"repo_name": "DryTuna/lowr",
"path": "lowr_aws_deploy/fabfile.py",
"copies": "1",
"size": "4962",
"license": "mit",
"hash": 264303962775753400,
"line_mean": 31.0129032258,
"line_max": 132,
"alpha_frac": 0.6553808948,
"autogenerated": false,
"ratio": 3.479663394109397,
"config_test": false,
"... |
from fabric.api import run
from fabric.api import env
from fabric.api import prompt
from fabric.api import execute
from fabric.api import sudo
from fabric.api import cd
from fabric.api import put
import boto.ec2
import time
import os
env.hosts = ['*', ]
env['region'] = 'us-west-2'
env['user'] = 'ubuntu'
import creden... | {
"repo_name": "charlieRode/django-imagr",
"path": "fabfile.py",
"copies": "1",
"size": "8877",
"license": "mit",
"hash": -2695163616300101000,
"line_mean": 28.9898648649,
"line_max": 123,
"alpha_frac": 0.6205925425,
"autogenerated": false,
"ratio": 3.644088669950739,
"config_test": false,
"ha... |
from fabric.api import run
from fabric.api import env
from fabric.api import prompt
from fabric.api import execute
from fabric.api import sudo
from fabric.contrib.project import rsync_project
import boto.ec2
import time
env.hosts = ['localhost', ]
env.aws_region = 'us-west-2'
def host_type():
run('uname -s')
d... | {
"repo_name": "markcharyk/django-photos",
"path": "fabfile.py",
"copies": "1",
"size": "4234",
"license": "mit",
"hash": -4435676109540669000,
"line_mean": 27.8027210884,
"line_max": 80,
"alpha_frac": 0.6060462919,
"autogenerated": false,
"ratio": 3.793906810035842,
"config_test": false,
"has... |
from fabric.api import run
from fabric.api import env
from fabric.api import prompt
from fabric.api import execute
from fabric.api import sudo
from fabric import contrib
from fabric.contrib.project import rsync_project
import boto.ec2
import time
import boto
env.hosts = ['localhost', ]
env.aws_region = 'us-west-2'
d... | {
"repo_name": "corinnelhh/chatbot",
"path": "fabfile.py",
"copies": "1",
"size": "6271",
"license": "mit",
"hash": 5646531174761052000,
"line_mean": 26.8711111111,
"line_max": 84,
"alpha_frac": 0.6180832403,
"autogenerated": false,
"ratio": 3.6480511925538104,
"config_test": true,
"has_no_key... |
from fabric.api import run
from fabric.api import env
from fabric.api import prompt
from fabric.api import execute
from fabric.api import sudo
import boto.ec2
import time
env.hosts = ['localhost', ]
env.aws_region = 'us-west-2'
def host_type():
run('uname -s')
def get_ec2_connection():
if 'ec2' not in env:
... | {
"repo_name": "DryTuna/fabrictests",
"path": "fabfile.py",
"copies": "1",
"size": "3955",
"license": "mit",
"hash": -6397341409266334000,
"line_mean": 30.9032258065,
"line_max": 80,
"alpha_frac": 0.603034134,
"autogenerated": false,
"ratio": 3.7883141762452106,
"config_test": false,
"has_no_k... |
from fabric.api import run
from fabric.api import env
from fabric.api import prompt
from fabric.api import execute
from fabric.api import sudo
import boto.ec2
import time
env.hosts = ['localhost', ]
env.aws_region = 'us-west-2'
env.key_filename = '~/.ssh/pk-aws.pem'
def host_type():
run('uname -s')
def get_ec... | {
"repo_name": "jonathanstallings/fabrictests",
"path": "fabfile.py",
"copies": "1",
"size": "5274",
"license": "mit",
"hash": 3776725764087423500,
"line_mean": 29.4855491329,
"line_max": 80,
"alpha_frac": 0.5786879029,
"autogenerated": false,
"ratio": 3.974378296910324,
"config_test": false,
... |
from fabric.api import run
from fabric.api import env
import boto.ec2
import time
from fabric.api import prompt
from fabric.api import execute
from fabric.api import sudo
from fabric.contrib.files import sed
from fabric.contrib.project import upload_project
import os
env.hosts = ['localhost', ]
env.aws_region = 'us-we... | {
"repo_name": "bm5w/fabrictests",
"path": "fabfile.py",
"copies": "1",
"size": "5809",
"license": "mit",
"hash": -7338988909800980000,
"line_mean": 29.2552083333,
"line_max": 84,
"alpha_frac": 0.6186951282,
"autogenerated": false,
"ratio": 3.730892742453436,
"config_test": true,
"has_no_keywo... |
from fabric.api import run
from fabric.api import env
import boto.ec2
import time
from fabric.api import prompt
from fabric.api import execute
from fabric.api import sudo
env.hosts = ['localhost',]
env.aws_region = 'us-west-2'
def host_type():
run('uname -s')
def get_ec2_connection():
if 'ec2' not in env:
... | {
"repo_name": "caderache2014/fabrictests",
"path": "fabfile.py",
"copies": "1",
"size": "4253",
"license": "mit",
"hash": 4497264582933931500,
"line_mean": 32.4881889764,
"line_max": 84,
"alpha_frac": 0.5673642135,
"autogenerated": false,
"ratio": 3.9971804511278197,
"config_test": false,
"ha... |
from fabric.api import run
from fabric.colors import red
from fabric.contrib.files import exists, cd, upload_template, sed, append, contains
from fabric.contrib.project import rsync_project
from fabric.operations import sudo, local
pg_hba_fname = "/etc/postgresql/9.3/main/pg_hba.conf"
def service(service, command):
... | {
"repo_name": "Crashfreak/maproulette",
"path": "fabfile.py",
"copies": "1",
"size": "10862",
"license": "apache-2.0",
"hash": 8675830554127470000,
"line_mean": 32.4215384615,
"line_max": 117,
"alpha_frac": 0.6097403793,
"autogenerated": false,
"ratio": 3.476952624839949,
"config_test": false,
... |
from fabric.api import run
from fabric.operations import prompt
import json
import os
import random
def backdrop():
config = {}
project_name = prompt('Project name: ', default='{{ project_name }}')
config['DEBUG'] = True
secret_key = prompt('Secret key: ', default=_random_string(50))
config['SE... | {
"repo_name": "alexei/django-project",
"path": "fabfile.py",
"copies": "1",
"size": "2088",
"license": "bsd-3-clause",
"hash": -5166248376538141000,
"line_mean": 36.2857142857,
"line_max": 194,
"alpha_frac": 0.5962643678,
"autogenerated": false,
"ratio": 3.9101123595505616,
"config_test": false... |
from fabric.api import run
from cbagent.collectors.libstats.remotestats import (
RemoteStats, multi_node_task)
class PSStats(RemoteStats):
METRICS = (
("rss", 1024), # kB -> B
("vsize", 1024),
)
def __init__(self, hosts, user, password):
super(PSStats, self).__init__(host... | {
"repo_name": "vmx/cbagent",
"path": "cbagent/collectors/libstats/psstats.py",
"copies": "2",
"size": "1188",
"license": "apache-2.0",
"hash": -3363685399386027500,
"line_mean": 32,
"line_max": 77,
"alpha_frac": 0.5345117845,
"autogenerated": false,
"ratio": 3.6553846153846155,
"config_test": f... |
from fabric.api import run
from cbagent.collectors.libstats.remotestats import (
RemoteStats, multi_node_task)
class TPStats(RemoteStats):
METRICS = (
("rss", 1), # already in bytes
)
def __init__(self, hosts, user, password):
super(TPStats, self).__init__(hosts, user, password)
... | {
"repo_name": "vmx/cbagent",
"path": "cbagent/collectors/libstats/typeperfstats.py",
"copies": "1",
"size": "1142",
"license": "apache-2.0",
"hash": -4655647887087965000,
"line_mean": 30.7222222222,
"line_max": 88,
"alpha_frac": 0.5350262697,
"autogenerated": false,
"ratio": 3.7940199335548175,
... |
from fabric.api import run
from cbagent.collectors.libstats.remotestats import (
RemoteStats, multi_node_task)
class IOstat(RemoteStats):
METRICS = (
("rps", "r/s", 1),
("wps", "w/s", 1),
("rbps", "rkB/s", 1024), # kB -> B
("wbps", "wkB/s", 1024), # kB -> B
("avgqu... | {
"repo_name": "pavel-paulau/cbagent",
"path": "cbagent/collectors/libstats/iostat.py",
"copies": "2",
"size": "1472",
"license": "apache-2.0",
"hash": -5048082855538459000,
"line_mean": 29.6666666667,
"line_max": 73,
"alpha_frac": 0.5149456522,
"autogenerated": false,
"ratio": 3.634567901234568,
... |
from fabric.api import run,put,cd,env,local
import shutil,os
import py_compile
__author__ = 'Joseph'
UpxEXE = os.path.join(os.getcwd(),"usr/bin/upx.exe")
SevenZipEXE = os.path.join(os.getcwd(),"usr/bin/7z.exe")
dist_dir = os.path.join(os.getcwd(),"dist")
pro_dir = os.getcwd()
def unzip(zip_file,out_dir):
local(S... | {
"repo_name": "ptphp/PyLib",
"path": "src/tmp/fabfile.py",
"copies": "1",
"size": "2398",
"license": "apache-2.0",
"hash": -3914654885816762000,
"line_mean": 26.25,
"line_max": 69,
"alpha_frac": 0.6071726439,
"autogenerated": false,
"ratio": 2.811254396248535,
"config_test": false,
"has_no_ke... |
from fabric.api import run,put,cd,parallel,roles,serial,local,runs_once
from env_setup import *
counter = 0
"""
Used to measure the time taken to simply upload
data into HDFS.
"""
@parallel
def hdfs_upload_test():
global conf
with cd(env.conf['HADOOPBIN']):
cmd = './hadoop fs -copyFromLocal' + \
... | {
"repo_name": "mitdbg/mdindex",
"path": "scripts/fabfile/upfront.py",
"copies": "2",
"size": "6505",
"license": "mit",
"hash": 2802034327737646600,
"line_mean": 29.1157407407,
"line_max": 133,
"alpha_frac": 0.5022290546,
"autogenerated": false,
"ratio": 3.2787298387096775,
"config_test": false,... |
from fabric.api import run,put,cd,parallel,roles,serial,local,runs_once
from env_setup import *
counter = 0
@roles('master')
def create_table_info():
global conf
with cd(env.conf['HADOOPBIN']):
run('./hadoop fs -mkdir -p %s/%s' % (env.conf['HDFSDIR'], env.conf['TABLENAME']))
cmd = './hadoop ja... | {
"repo_name": "mitdbg/AdaptDB",
"path": "scripts/fabfile/upfront.py",
"copies": "1",
"size": "3595",
"license": "mit",
"hash": -2632607192750828500,
"line_mean": 30.2608695652,
"line_max": 89,
"alpha_frac": 0.4945757997,
"autogenerated": false,
"ratio": 3.3287037037037037,
"config_test": false,... |
from fabric.api import run,put,cd,parallel,roles,serial,local,runs_once
from env_setup import *
@roles('master')
def simulator_adapt(c='4'):
global conf
with cd(env.conf['HADOOPBIN']):
cmd = './hadoop jar $JAR perf.tools.RunSimulator' + \
' --conf $CONF' + \
' --tableName $TABLE... | {
"repo_name": "mitdbg/mdindex",
"path": "scripts/fabfile/simulator.py",
"copies": "2",
"size": "1441",
"license": "mit",
"hash": 8675580333919744000,
"line_mean": 29.6595744681,
"line_max": 71,
"alpha_frac": 0.4691186676,
"autogenerated": false,
"ratio": 3.260180995475113,
"config_test": false,... |
from fabric.api import run, quiet
from braid import succeeds, cacheInEnvironment
@cacheInEnvironment
def distroName():
"""
Get the name of the distro.
"""
with quiet():
lsb = run('/usr/bin/lsb_release --id --short', warn_only=True)
if lsb.succeeded:
return lsb.lower()
... | {
"repo_name": "alex/braid",
"path": "braid/info.py",
"copies": "1",
"size": "1389",
"license": "mit",
"hash": -4057447946180981000,
"line_mean": 21.7704918033,
"line_max": 70,
"alpha_frac": 0.5327573794,
"autogenerated": false,
"ratio": 3.9913793103448274,
"config_test": false,
"has_no_keywor... |
from fabric.api import run, settings, env
from cloudferrylib.base.action import action
from cloudferrylib.utils import forward_agent
from cloudferrylib.utils import utils as utl
INSTANCES = 'instances'
DIFF = 'diff'
EPHEMERAL = 'ephemeral'
DIFF_OLD = 'diff_old'
EPHEMERAL_OLD = 'ephemeral_old'
PATH_DST = 'path_dst'
HOS... | {
"repo_name": "toha10/CloudFerry",
"path": "cloudferrylib/os/actions/load_compute_image_to_file.py",
"copies": "4",
"size": "1565",
"license": "apache-2.0",
"hash": 373253471299036200,
"line_mean": 39.1538461538,
"line_max": 99,
"alpha_frac": 0.5539936102,
"autogenerated": false,
"ratio": 3.49330... |
from fabric.api import run, settings, env
from cloudferrylib.base.action import action
from cloudferrylib.utils import utils as utl
INSTANCES = 'instances'
class MergeBaseDiff(action.Action):
def run(self, info=None, **kwargs):
cfg = self.cloud.cloud_config.cloud
for instance_id, instance in info... | {
"repo_name": "mgrygoriev/CloudFerry",
"path": "cloudferrylib/os/actions/merge_base_and_diff.py",
"copies": "1",
"size": "1117",
"license": "apache-2.0",
"hash": 2061005905650352000,
"line_mean": 38.8928571429,
"line_max": 74,
"alpha_frac": 0.623992838,
"autogenerated": false,
"ratio": 3.40548780... |
from fabric.api import run, settings, env
from cloudferrylib.base.action import action
from cloudferrylib.utils.utils import forward_agent
from cloudferrylib.utils import utils as utl
INSTANCES = 'instances'
class ConvertFile(action.Action):
def run(self, info=None, **kwargs):
cfg = self.cloud.cloud_conf... | {
"repo_name": "mgrygoriev/CloudFerry",
"path": "cloudferrylib/os/actions/convert_file.py",
"copies": "1",
"size": "1465",
"license": "apache-2.0",
"hash": 6846327910113820000,
"line_mean": 43.3939393939,
"line_max": 78,
"alpha_frac": 0.6122866894,
"autogenerated": false,
"ratio": 3.53012048192771... |
from fabric.api import run, settings, sudo, open_shell, cd, env, local
from fabric.operations import put, prompt, get
def gethostip(hostname):
"get ip of hostname"
output = run('gethostip ' + hostname, true)
parts = output.split(' ')
return parts[1]
def run_daemon_cmd(name, command):
"run a daemon... | {
"repo_name": "dustinlacewell/loom",
"path": "loom/system.py",
"copies": "1",
"size": "1864",
"license": "mit",
"hash": -2859233683230947300,
"line_mean": 32.2857142857,
"line_max": 128,
"alpha_frac": 0.5649141631,
"autogenerated": false,
"ratio": 3.8592132505175982,
"config_test": false,
"ha... |
from fabric.api import runs_once, settings, task
from fabric.tasks import execute
from .. import hosts as cluster_hosts, util as cluster_util
from ... import etherpad, puppet
__all__ = ["reboot", "upgrade", "upgrade_host"]
@runs_once
@task
def reboot():
"""Reboot all the etherpad servers."""
cluster_util.ens... | {
"repo_name": "oaeproject/oae-fabric",
"path": "fabfile/cluster/etherpad/__init__.py",
"copies": "1",
"size": "2476",
"license": "apache-2.0",
"hash": -8739973286166959000,
"line_mean": 30.3417721519,
"line_max": 76,
"alpha_frac": 0.6506462036,
"autogenerated": false,
"ratio": 4.092561983471074,
... |
from fabric.api import run, sudo, env, task, local, put, parallel
from fabric.context_managers import cd
from fabric.contrib.console import confirm
import logging
from fabtools import require
import requests
import time
logging.basicConfig(format='[%(asctime)s](%(filename)s#%(lineno)d)%(levelname)-7s %(message)s',
... | {
"repo_name": "meizhoubao/hackersome",
"path": "fabfile.py",
"copies": "1",
"size": "7302",
"license": "epl-1.0",
"hash": -7208320057444119000,
"line_mean": 26.558490566,
"line_max": 118,
"alpha_frac": 0.6291427006,
"autogenerated": false,
"ratio": 3.319090909090909,
"config_test": false,
"ha... |
from fabric.api import run, sudo, env, task, local, put, parallel
from fabric.context_managers import cd
import logging
from fabtools import require
# env.user = 'root'
env.use_ssh_config = True
PACKAGES = ['openjdk-7-jre-headless','python-pip','dstat','htop','supervisor',
'libjna-java', 'libopts25','ntp'... | {
"repo_name": "bcambel/star-track",
"path": "fabfile.py",
"copies": "1",
"size": "1746",
"license": "mit",
"hash": 4652907618033867000,
"line_mean": 25.4696969697,
"line_max": 109,
"alpha_frac": 0.6758304696,
"autogenerated": false,
"ratio": 2.890728476821192,
"config_test": false,
"has_no_ke... |
from fabric.api import run, sudo
from fabric.contrib.files import append
from fab_deploy2.base import servers as base_servers
from fab_deploy2 import functions
from . import platform as base_platform
class JoyentMixin(object):
platform = base_platform
def _set_profile(self):
pass
def _ssh_resta... | {
"repo_name": "ff0000/red-fab-deploy2",
"path": "fab_deploy2/operating_systems/smartos/servers.py",
"copies": "1",
"size": "1382",
"license": "mit",
"hash": -4521792550821372400,
"line_mean": 25.5769230769,
"line_max": 62,
"alpha_frac": 0.6794500724,
"autogenerated": false,
"ratio": 3.41234567901... |
from fabric.api import run, sudo
from fabric.contrib.files import append
from fab_deploy.base import setup as base_setup
class JoyentMixin(object):
def _set_profile(self):
append('/etc/profile', 'CC="gcc -m64"; export CC', use_sudo=True)
append('/etc/profile', 'LDSHARED="gcc -m64 -G"; export LDS... | {
"repo_name": "ff0000/red-fab-deploy",
"path": "fab_deploy/joyent/setup.py",
"copies": "1",
"size": "1136",
"license": "mit",
"hash": -7905421628032401000,
"line_mean": 24.2444444444,
"line_max": 88,
"alpha_frac": 0.6672535211,
"autogenerated": false,
"ratio": 3.1731843575418996,
"config_test":... |
from fabric.api import run, sudo
from github import GithubException
from .oauth_flow import get_api
from .fabric_commands import get_keyfile
def list_repo_keys(repo_full_name):
api = get_api()
repo = api.get_repo(repo_full_name)
deploy_keys = repo.get_keys()
try:
for key in depl... | {
"repo_name": "kbarnes3/FabricGHDeployKeys",
"path": "python/fabricghdeploykeys/repo_keys.py",
"copies": "1",
"size": "1072",
"license": "bsd-2-clause",
"hash": 3620110389610289700,
"line_mean": 28.6285714286,
"line_max": 84,
"alpha_frac": 0.6399253731,
"autogenerated": false,
"ratio": 3.59731543... |
from fabric.api import run, sudo, task, get, put, open_shell
from fabric.context_managers import cd, hide
from datetime import date
import os
import tempfile
import random
# TODO: parse lxc config to get path
LXC_PATH = '/var/lib/lxc'
LXC_IP_LINK = 'https://gist.github.com/ehazlett/5274446/raw/070f8a77f7f5738ee2d855a1... | {
"repo_name": "ehazlett/fabric-maestro",
"path": "maestro/crate/management.py",
"copies": "1",
"size": "6214",
"license": "apache-2.0",
"hash": 5517111293044045000,
"line_mean": 27.3744292237,
"line_max": 115,
"alpha_frac": 0.6062117799,
"autogenerated": false,
"ratio": 3.431253451131971,
"conf... |
from fabric.api import run, sudo, task
from fabric.context_managers import settings
def status(name):
with settings(ok_ret_codes=[0,3]):
# Note: We need to set pty=False.
# See http://docs.fabfile.org/en/1.7/faq.html#init-scripts-don-t-work
out = sudo('/sbin/service %s status' % name, pty=F... | {
"repo_name": "hnakamur/my-fabfiles",
"path": "fabfile/centos/lib/service.py",
"copies": "1",
"size": "1390",
"license": "mit",
"hash": -3402558106199887400,
"line_mean": 27.9583333333,
"line_max": 77,
"alpha_frac": 0.6467625899,
"autogenerated": false,
"ratio": 3.1096196868008947,
"config_test... |
from fabric.api import run, task
import tools.ods2json
import ftplib
import netrc
input_ods = 'woordenlijst.ods'
output_json = 'woordenlijst.json'
FTP_SETTINGS = {
'host': 'ftp.millibyte.nl',
'remote_directory': '/flashcard',
'files': [
'index.html',
'woordenlijst.json',
'vocabulary... | {
"repo_name": "mjdemilliano/vocabularydrill",
"path": "fabfile.py",
"copies": "1",
"size": "1346",
"license": "mit",
"hash": -42966671035180370,
"line_mean": 28.2608695652,
"line_max": 100,
"alpha_frac": 0.6493313522,
"autogenerated": false,
"ratio": 3.433673469387755,
"config_test": false,
"... |
from fabric.api import settings, hide, run, cd
from fabric.contrib.files import exists, append, sed
def ensure_link(target, source):
if exists(target):
run('rm -rf ' + target)
run('ln -sf %s %s' % (source, target))
def ensure_dir(directory):
if not exists(directory):
run('mkdir -p ' + directory)
def ensure_f... | {
"repo_name": "yejianye/toolbox",
"path": "fablibs/files.py",
"copies": "2",
"size": "1117",
"license": "apache-2.0",
"hash": -6124220515211216000,
"line_mean": 29.1891891892,
"line_max": 77,
"alpha_frac": 0.6410026858,
"autogenerated": false,
"ratio": 3.01078167115903,
"config_test": false,
... |
from fabric.api import settings, lcd, task
from fabric.context_managers import prefix
from fabric.operations import local as lrun, run
from fabric.state import env
home_path = '/home/vagrant/'
project_path = '/vagrant/project/'
project_client_path = '{}client/'.format(project_path)
project_server_path = '{}server/'.fo... | {
"repo_name": "zubairalam/selfrecruiter",
"path": "project/settings/fabfile.py",
"copies": "1",
"size": "5248",
"license": "apache-2.0",
"hash": -5370953726669207000,
"line_mean": 23.6384976526,
"line_max": 119,
"alpha_frac": 0.5413490854,
"autogenerated": false,
"ratio": 3.7485714285714287,
"c... |
from fabric.api import settings, run, env, sudo, cd, local, lcd, get, put, prompt, prefix, task
def empty_db():
""" Empty all tables of a given DB """
db_name = prompt("Enter DB name to empty:")
cmd = """
(echo 'SET foreign_key_checks = 0;';
(mysqldump -u%s -p%s --add-drop-table --no-data %s |
... | {
"repo_name": "writefaruq/supervised-ipython-nbserver",
"path": "deploy/db_utils.py",
"copies": "1",
"size": "1153",
"license": "mit",
"hash": -833113711940824800,
"line_mean": 37.4333333333,
"line_max": 99,
"alpha_frac": 0.5559410234,
"autogenerated": false,
"ratio": 3.158904109589041,
"config... |
from fabric.api import sudo, cd, path, shell_env
from fabric.operations import reboot
from fabric.contrib.files import exists, append
import sys
PREFIX = "/opt/caffe"
def _add_bashrc(path):
with open("/etc/bash.bashrc", "a") as fp:
fp.write("export PATH={0}:$PATH\n".format(path))
def _install_depends()... | {
"repo_name": "AlpacaDB/caffe_image",
"path": "fabfile.py",
"copies": "1",
"size": "6335",
"license": "mit",
"hash": -5234893322740135000,
"line_mean": 30.8341708543,
"line_max": 122,
"alpha_frac": 0.6115232833,
"autogenerated": false,
"ratio": 3.3046426708398537,
"config_test": false,
"has_n... |
from fabric.api import sudo, env
def _server_base():
sudo("pacman -Syy")
sudo("pacman -Syu")
sudo("pacman -S base-devel")
sudo("pacman -S rsync git-core swig htop") # TODO: configurable settings for base packages
def _server_check_python_symlink():
"""
Check if python2 symlink to /usr/loca... | {
"repo_name": "fabric-colors/fabric-colors",
"path": "fabric_colors/distro/arch/__init__.py",
"copies": "1",
"size": "2021",
"license": "bsd-2-clause",
"hash": -7403951602421132000,
"line_mean": 39.42,
"line_max": 282,
"alpha_frac": 0.6749134092,
"autogenerated": false,
"ratio": 3.514782608695652... |
from fabric.api import sudo, hide, task, env, run, settings
from braid import package, utils
from pipes import quote
def install():
package.install(['postgresql-9.1', 'postgresql-server-dev-9.1'])
def _runQuery(query, database=None):
with hide('running', 'output'):
database = '--dbname={}'.format(da... | {
"repo_name": "alex/braid",
"path": "braid/postgres.py",
"copies": "1",
"size": "4187",
"license": "mit",
"hash": -5700389653826617000,
"line_mean": 29.5620437956,
"line_max": 87,
"alpha_frac": 0.6252686888,
"autogenerated": false,
"ratio": 3.9537299338999055,
"config_test": false,
"has_no_ke... |
from fabric.api import sudo, local, env
from fabric.context_managers import settings
from db import DBTypeBase
from utils import generate_password, add_os_package
PGSQL_USER = 'postgres'
POSTGRESQL_EXECUTABLE_PATH = '/usr/bin/psql'
class DBType(DBTypeBase):
def __init__(self, *args, **kwargs):
self.engi... | {
"repo_name": "IlianIliev/ubuntu-fabric-and-django",
"path": "db/postgresql.py",
"copies": "1",
"size": "1872",
"license": "bsd-3-clause",
"hash": -4310577763787037000,
"line_mean": 35.0192307692,
"line_max": 93,
"alpha_frac": 0.5961538462,
"autogenerated": false,
"ratio": 4.206741573033708,
"c... |
from fabric.api import sudo, local, env
from fabric.context_managers import settings
from fabutil import DBTypeBase
from utils import generate_password, add_os_package
PGSQL_USER = 'postgres'
POSTGRESQL_EXECUTABLE_PATH = '/usr/bin/psql'
class DBType(DBTypeBase):
def __init__(self, *args, **kwargs):
self... | {
"repo_name": "pyarun/djfabconfig",
"path": "fabutil/postgresql.py",
"copies": "1",
"size": "1927",
"license": "bsd-3-clause",
"hash": 4814540632472739000,
"line_mean": 36.0769230769,
"line_max": 93,
"alpha_frac": 0.6024909185,
"autogenerated": false,
"ratio": 4.225877192982456,
"config_test": ... |
from fabric.api import sudo
from fabric.api import run
from fabric.api import local
from fabric.api import env
from fabric.api import get
def _record(cmd, dump_file):
"""The real hard worker. Executes the given command and transfers the output
file to the local directory.
"""
cmd_str = cmd % dump_file
... | {
"repo_name": "badmetacoder/fabric-examples",
"path": "server-inventory.py",
"copies": "1",
"size": "2676",
"license": "mit",
"hash": -3794147455082262500,
"line_mean": 25.76,
"line_max": 112,
"alpha_frac": 0.5799701046,
"autogenerated": false,
"ratio": 3.1152502910360886,
"config_test": false,... |
from fabric.api import sudo
from shuttle.hooks import hook
class Service(object):
def __init__(self, *args, **kwargs):
self.settings = {}
for settings_dict in args:
self.settings.update(settings_dict)
self.settings.update(kwargs)
def copy(self, **kwargs):
c = sel... | {
"repo_name": "mvx24/fabric-shuttle",
"path": "shuttle/services/service.py",
"copies": "1",
"size": "1414",
"license": "mit",
"hash": -6148426010834910000,
"line_mean": 22.9661016949,
"line_max": 67,
"alpha_frac": 0.5636492221,
"autogenerated": false,
"ratio": 4.017045454545454,
"config_test": ... |
from fabric.api import sudo
class PackageBase(object):
def update(self):
raise Exception('Not Implemented')
def upgrade():
raise Exception('Not Implemented')
def install():
raise Exception('Not Implemented')
class PackageOpenBSD(PackageBase):
pass
class PackageYum(Package... | {
"repo_name": "laprice/ducttape",
"path": "ducttape/package.py",
"copies": "1",
"size": "1233",
"license": "isc",
"hash": -7792383946054784000,
"line_mean": 22.2641509434,
"line_max": 62,
"alpha_frac": 0.5652879157,
"autogenerated": false,
"ratio": 4.003246753246753,
"config_test": false,
"ha... |
from fabric.api import sudo, prefix
from fabric.contrib import files
from seamstress import core
def installation():
core.package("python-software-properties")
core.package("python-setuptools")
core.package("python-dev")
core.package_repository("ppa:fkrull/deadsnakes")
core.package("python2.7")
... | {
"repo_name": "kyleconroy/seamstress",
"path": "seamstress/python.py",
"copies": "1",
"size": "1387",
"license": "mit",
"hash": 7621735122028852000,
"line_mean": 29.152173913,
"line_max": 67,
"alpha_frac": 0.6575342466,
"autogenerated": false,
"ratio": 3.6596306068601585,
"config_test": false,
... |
from fabric.api import sudo, run, env
from fabric.tasks import Task
from fab_deploy.base import setup
class CeleryControl(setup.Control):
name = 'celeryd'
def start(self):
run('svcadm enable %s' % self.name)
def stop(self):
run('svcadm disable %s' % self.name)
def restart(self):
... | {
"repo_name": "ff0000/red-fab-deploy",
"path": "fab_deploy/joyent/celery.py",
"copies": "1",
"size": "1034",
"license": "mit",
"hash": -8649307695811994000,
"line_mean": 24.243902439,
"line_max": 72,
"alpha_frac": 0.5889748549,
"autogenerated": false,
"ratio": 3.541095890410959,
"config_test": ... |
from fabric.api import sudo, run
from .containers import conf
from .task import Task
from .utils import home_path, upload_config_template
from . import system
__all__ = ['install_pip', 'install', 'push_config']
class InstallPip(Task):
def do(self):
system.package_install.run(packages='python-pip')
... | {
"repo_name": "vmihailenco/fabdeploy",
"path": "fabdeploy/pip.py",
"copies": "1",
"size": "1698",
"license": "bsd-3-clause",
"hash": 6304853667024598000,
"line_mean": 25.53125,
"line_max": 73,
"alpha_frac": 0.574204947,
"autogenerated": false,
"ratio": 3.574736842105263,
"config_test": true,
... |
from fabric.api import sudo, settings
from . import system
from .containers import conf
from .task import Task
from .utils import upload_config_template
__all__ = [
'install',
'restart',
'reload',
]
class AddPpa(Task):
def do(self):
sudo('add-apt-repository ppa:nginx/stable')
system... | {
"repo_name": "vmihailenco/fabdeploy",
"path": "fabdeploy/nginx.py",
"copies": "1",
"size": "1426",
"license": "bsd-3-clause",
"hash": 7929478312826375000,
"line_mean": 19.3714285714,
"line_max": 75,
"alpha_frac": 0.6297335203,
"autogenerated": false,
"ratio": 3.4611650485436893,
"config_test":... |
from fabric.api import task, cd, env, run, execute, put
from fabric.operations import sudo
import os, os.path
import fab_git as git
@task
def initial_setup():
with cd(env.releases_path):
run('mkdir -p releases')
run('mkdir -p shared/settings')
run('mkdir -p shared/partner_media')
r... | {
"repo_name": "mozilla/make.mozilla.org",
"path": "fabric/release.py",
"copies": "1",
"size": "2761",
"license": "bsd-3-clause",
"hash": 7222560064901962000,
"line_mean": 24.8037383178,
"line_max": 87,
"alpha_frac": 0.6425208258,
"autogenerated": false,
"ratio": 3.2869047619047618,
"config_test... |
from fabric.api import task, cd, env, run, local, cd, lcd, put, settings, execute
from fabric.operations import sudo
import uuid, StringIO
from release import local_settings_path
@task
def setup():
with settings(user=env.puppet_user):
sudo('apt-get update')
sudo('apt-get install puppet')
execu... | {
"repo_name": "mozilla/make.mozilla.org",
"path": "fabric/puppet.py",
"copies": "1",
"size": "1808",
"license": "bsd-3-clause",
"hash": 8926320757247750000,
"line_mean": 28.6393442623,
"line_max": 81,
"alpha_frac": 0.5896017699,
"autogenerated": false,
"ratio": 3.188712522045855,
"config_test":... |
from fabric.api import task, cd, run, env, prompt, execute, sudo
from fabric.api import open_shell, settings, put, local
import os
import boto.ec2
import time
# IMPORTANT: This fabfile requires a credentials.py file to be imported
# from its current directory, since turning a repo for a Django app into
# a package is... | {
"repo_name": "defzzd/django-imagr",
"path": "fabfile.py",
"copies": "1",
"size": "27501",
"license": "mit",
"hash": -5359420811372159000,
"line_mean": 38.5129310345,
"line_max": 250,
"alpha_frac": 0.680484346,
"autogenerated": false,
"ratio": 3.836099874459478,
"config_test": false,
"has_no_... |
from fabric.api import task, cd, run, env, prompt, execute, sudo
from fabric.api import open_shell, settings, put, local
import os
import boto.ec2
import time
#
#
# TO DEPLOY THE APPLICATION:
#
#
# fab run_complete_setup
# fab create_superuser
#
#
#
# do not check credentials into a public repo, or proba... | {
"repo_name": "CharlesGust/django-imagr",
"path": "fabfile.py",
"copies": "1",
"size": "19428",
"license": "mit",
"hash": -6629970188392387000,
"line_mean": 36.5057915058,
"line_max": 80,
"alpha_frac": 0.6780934733,
"autogenerated": false,
"ratio": 3.758560650029019,
"config_test": false,
"ha... |
from fabric.api import task, cd, run, env, prompt, execute, sudo, open_shell
from fabric.api import settings, put
import fabric.contrib
import time
import os
# import io
import boto
import boto.ec2
env.hosts = ['localhost', ]
env["user"] = "ubuntu"
env["key_filename"] = "~/.ssh/fabric.pem" # Update to user
env.aws_re... | {
"repo_name": "miracode/django-imagr",
"path": "fabfile.py",
"copies": "1",
"size": "9738",
"license": "mit",
"hash": -226015067089765760,
"line_mean": 29.526645768,
"line_max": 79,
"alpha_frac": 0.6079277059,
"autogenerated": false,
"ratio": 3.585419734904271,
"config_test": false,
"has_no_k... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.