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.operations import local,put | |
import subprocess | |
import os | |
@task | |
def deploy_small_ec2_instance(): | |
local('/usr/bin/ec2-run-instances ami-6dacf728 --instance-type m1.small --region us-west-1 --key ${EC2_KEYPAIR} --user-data-file user-data.sh --group ${SGROUP}') | |
@task |
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
@task | |
def setup_fs_mongodb_aws(): | |
env.warn_only = True | |
sudo('puppetd --test') | |
env.warn_only = False | |
sudo("for i in `cat /proc/mdstat | grep md | awk '{print $1}'`; do mdadm --stop /dev/$i; done") | |
sudo('mdadm --create --force --assume-clean -R /dev/md0 -l10 --chunk=256 --raid-devices=4 /dev/xvdf /dev/xvdg /dev/xvdh /dev/xvdi') | |
sudo('echo "`mdadm --detail --scan`" | tee -a /etc/mdadm.conf') | |
sudo('blockdev --setra 128 /dev/md0') | |
sudo('blockdev --setra 128 /dev/xvdf') |
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
@task | |
def mongo_perf(): | |
sudo('apt-get install -y tcsh git-core scons g++ libpcre++-dev libboost-dev libreadline-dev libboost-program-options-dev libboost-thread-dev libboost-filesystem-dev libboost-date-time-dev python-pip build-essential python-dev') | |
with cd('/var/tmp'): | |
sudo('wget http://downloads.mongodb.org/cxx-driver/mongodb-linux-x86_64-v2.0-latest.tgz') | |
sudo('tar zxvf mongodb-linux-x86_64-v2.0-latest.tgz') | |
with cd('/var/tmp/mongo-cxx-driver-v2.0'): | |
sudo('scons') | |
sudo('scons install') | |
sudo('git clone https://github.com/mongodb/mongo-perf.git') |
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
#!/bin/bash | |
DATE=`date +"%a"` | |
DVOLNAME=datalv | |
LVOLNAME=journallv | |
VOLGR=datavg | |
DVOLPATH=/dev/$VOLGR/$DVOLNAME | |
LVOLPATH=/dev/$VOLGR/$LVOLNAME | |
DSNAME=`echo ${DVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'` | |
LSNAME=`echo ${LVOLNAME}_ss_${DATE} | tr '[A-Z]' '[a-z]'` |
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
{ | |
"use1a-pri-puppet-01": "\u001b[0;32mInfo\u001b[0m: Retrieving plugin\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /etc/puppet/modules/varnish/lib/facter/varnish_version.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /etc/puppet/modules/stdlib/lib/facter/puppet_vardir.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /etc/puppet/modules/stdlib/lib/facter/root_home.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /etc/puppet/modules/stdlib/lib/facter/facter_dot_d.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /var/lib/puppet/lib/facter/root_home.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /var/lib/puppet/lib/facter/facter_dot_d.rb\r\n\u001b[0;32mInfo\u001b[0m: Loading facts in /var/lib/puppet/lib/facter/varnish_version.rb\r\n\u001b[0;32mInfo\u001b[0m: Caching catalog for use1a-pri-puppet-01.social.local\r\n\u001b[0;32mInfo\u001b[0m: Applying configuration version '1352413667'\r\n/Stage[main]/Base/Ser |
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/python | |
# vim: set expandtab: | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
win_dict = {} | |
page_num = 1 | |
total_pages = 63 |
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/python | |
# vim: set expandtab: | |
import urllib2 | |
from BeautifulSoup import BeautifulSoup | |
from pymongo import Connection | |
host = 'localhost' | |
database = 'lotto' | |
collection = 'mega_millions' |
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/python | |
# vim: set expandtab: | |
import config | |
import requests | |
import json | |
import os | |
import requests | |
def deploy_multi_region_elasticsearch(env): | |
url = config.urls() |
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/python | |
# vim: set expandtab: | |
from flask import Flask, flash, abort, redirect, url_for, request, render_template, make_response, json, Response | |
import os, sys | |
app = Flask(__name__) | |
@app.route('/', methods=['GET', 'POST']) | |
def index(): |
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
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><META http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body> | |
Twentys: {{twentys}}<BR> | |
Tens: {{tens}} | |
</body></html> |