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/python2.6 | |
from datetime import datetime | |
from optparse import OptionParser | |
import os | |
from subprocess import PIPE, Popen | |
import urllib2 | |
def check_modwsgi(app_dir): | |
find_ = Popen("find %s -name '*.py'" % app_dir, stdout=PIPE, shell=True).communicate()[0] |
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 re | |
import sys | |
logs = {} | |
regex = re.compile('z.timer:INFO (?P<method>\w+) "(?P<url>[^"]+)" ' | |
'\((?P<code>\d+)\) (?P<time>[\d.]+) :') |
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 glob import glob | |
import os | |
import re | |
import time | |
def newest_file(file_glob): | |
files = ((os.stat(f).st_mtime, f) for f in glob(file_glob)) | |
f = max(files)[1] | |
return f |
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
<?php | |
$sizes = array("small", "medium", "large"); | |
$periods = array("hour", "day", "week", "month", "year"); | |
if(in_array($_GET['size'], $sizes)) { | |
$size = $_GET['size']; | |
} else { | |
$size = "medium"; | |
} | |
if(in_array($_GET['period'], $periods)) { | |
$period = $_GET['period']; |
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 | |
GIT=$(which git) | |
PYTHON=$(which python2.6) | |
usage() { | |
cat << EOF | |
usage: $0 options django_dir |
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 | |
ZAMBONI_DIR=$1 | |
TAG=$2 | |
VENDOR=$3 | |
if [[ ! -d $ZAMBONI_DIR ]] | |
then |
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
<?php | |
/* Pass in by reference! */ | |
function graph_amo_rabbit_prod_report ( &$rrdtool_graph ) { | |
global $context, | |
$hostname, | |
$mem_shared_color, | |
$mem_cached_color, | |
$mem_buffered_color, |
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 | |
VALUE=$(ps axo etime,args | grep celeryd-prod | sort -nr | /usr/local/bin/ps_time_converter.py) | |
/usr/bin/gmetric -t uint32 -u "seconds" -n "celeryd-prod process age" -v $VALUE |
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 | |
. $(dirname $0)/git_functions.sh | |
GIT=/usr/bin/git | |
DATE=$(date "+%Y/%m/%d %H:%M:%S") | |
AMO_PYTHON_ROOT=/data/amo_python | |
function update_previews { |
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 | |
import getopt | |
from subprocess import Popen, PIPE | |
import sys | |
OK, WARN, CRIT, UNKNOWN = 0, 1, 2, 3 | |
def run(cmd, shell=False): |