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 _shard_array(inlist, shard_size): | |
| # inlist = 150-element list | |
| # shard_size = 40 | |
| num_shards = len(inlist) / shard_size | |
| # num_shards == 3 | |
| shards = [] | |
| for i in range(num_shards): | |
| # i == 0 | |
| start = shard_size * i # start == 0, then 40, then 80... |
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
| # -*- coding: utf-8 -*- | |
| import os | |
| import time | |
| import settings | |
| from fabric.contrib.console import confirm | |
| from fabric.api import local, settings as fabric_settings, env, cd, run, sudo | |
| env.hosts = ['domain_or_ip'] |
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
| select address from mailer_email into outfile '/home/gileno/emails3.txt'; |
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
| # -*- coding: utf-8 -*- | |
| import os | |
| from django.db import models | |
| from django.utils.translation import ugettext_lazy as _ | |
| from django.contrib.auth.models import User | |
| from django.core.files.storage import FileSystemStorage | |
| from django.conf import 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
| from fabric.api import env | |
| from fabric.state import output | |
| from fabric.api import env, parallel | |
| from fabric.operations import put, run, prompt, local | |
| from fabric.utils import puts, abort | |
| from os import path | |
| # control output |
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 sys | |
| from fabric.colors import green, yellow | |
| from fabric.contrib.console import confirm | |
| from fabric.context_managers import cd, prefix | |
| from fabric.operations import prompt | |
| from fabric.api import run, local, env, sudo | |
| env.user = 'ubuntu' | |
| env.hosts = ['0.0.0.0'] #ip do ec2 | |
| env.app_path = '/home/seu-usuario-do-ec2/bomgusto' |
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 * | |
| from fabric.utils import abort | |
| from fabric.contrib.project import rsync_project | |
| from fabric.contrib.files import exists | |
| env.hosts = ['[email protected]'] | |
| target_dir = '/var/www/igor.io' | |
| backup_dir = target_dir+'-backup' | |
| staging_dir = target_dir+'-staging' |
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 os | |
| from fabric.api import * | |
| env.local_root=os.path.dirname(__file__) | |
| def deploy_github(): | |
| with lcd(env.local_root): | |
| local('git checkout master') | |
| commit = local('git log -1|grep commit', capture=True) |
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 __future__ import with_statement | |
| from fabric.api import local, settings, abort, sudo, cd, env | |
| from fabric.context_managers import prefix | |
| from fabric.contrib.console import confirm | |
| code_dir = '/srv/garbagehost/garbagehost' | |
| virtualenv_name = 'garbagehost' | |
| env.sudo_prefix = "sudo -i -S -p '%(sudo_prompt)s' " % env |
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
| # Template fabric deployment file for deploying Git projects | |
| import datetime | |
| from fabric.api import local, run, sudo, env | |
| from fabric.colors import green, red | |
| from fabric.context_managers import cd, lcd | |
| from fabric.operations import put, prompt | |
| from fabconfig import * |