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 "+%Y/%m/%d %M:%H:%S") | |
AMO_PYTHON_ROOT=/data/amo_python | |
cd $AMO_PYTHON_ROOT; | |
pushd src/preview/zamboni | |
git pull -q origin master |
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 | |
$wgExtensionFunctions[] = 'efVideoSetUp'; | |
function videoCreateAttrs($args) { | |
$attrs = array(); | |
foreach($args as $key => $value) { | |
$attrs[] = sprintf('%s="%s"', $key, htmlspecialchars($value)); | |
} | |
return implode(" ", $attrs); |
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
name = 'fxfeeds' | |
port = 50000 | |
ip = '63.245.209.124' | |
public_port = '443' | |
config = """probe tcp %(name)s-probe | |
port %(port)s | |
interval 3 |
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 sys | |
from urllib import quote | |
from urllib2 import urlopen | |
SMS_URL = "http://host/sendmsg" | |
SMS_PASSWD = "" | |
SMS_USER = "" |
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 | |
from urllib2 import urlopen, URLError | |
metrics = ['ReqPerSec', 'BytesPerSec', 'BytesPerReq', 'BusyWorkers', 'IdleWorkers'] | |
def get_metrics(): | |
try: | |
u = urlopen('http://localhost/server-status?auto') | |
except: |
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 | |
from optparse import OptionParser | |
import multicommandlib | |
if __name__ == "__main__": | |
parser = OptionParser() | |
parser.add_option("-l", "--list", | |
action="store_true", | |
help="list systems in group") | |
parser.add_option("-g", "--list-groups", |
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 | |
# | |
# chkconfig: 35 68 38 | |
# description: Starts celeryd | |
# | |
# @author Jeremy Orem <[email protected]> | |
# @author Dave Dash <[email protected]> | |
# | |
DJANGO_PROJECT_DIR=/data/amo_python/www/preview/zamboni |
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 fuzzy_group_by(keys, items, key, dist=None): | |
"""Returns a dictionary with all items mapped to dates | |
keys: list of items that can be used as keys in dict | |
items: items which will be mapped to a key | |
key: a function computing a key value for each element in items | |
dist: returns distance between objects (default: lambda x, y: abs(x - y)) | |
""" | |
if not dist: | |
dist = lambda x, y: abs(x - y) |
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 | |
# [03/Jun/2010:21:58:08 -0700] "GET /ja/thunderbird/downloads/file/75384/xpi/lightning-1.0b1-tb+sm-win.xpi?src=category HTTP/1.1" 200 9 | |
def avg(l): | |
return sum(l) / len(l) |
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 socket | |
import time | |
class MemcacheStats: | |
CACHE_TIME = 4 | |
def __init__(self): | |
self.cache = () |