This file contains 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
# vim: syntax=apache | |
WSGISocketPrefix /var/run/wsgi | |
<VirtualHost *:80 *:81> | |
ServerName addons.mozilla.org | |
ServerAlias addons.update.mozilla.org addons-nl.stage.mozilla.com addons-cdn.mozilla.net | |
DocumentRoot /data/www/addons.mozilla.org-remora/site/app/webroot | |
SetEnv HTTPS on | |
Alias /media /data/amo_python/www/prod/zamboni/media |
This file contains 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/sh | |
# Usage: `git url` or `git url <commitish>` | |
# | |
# * copies the commit's github url to your clipboard | |
# * prints out the log message | |
# * opens the bugzilla page if it found a bug number | |
# | |
# Set up the github url with `git config github.url <url>`. | |
# Only for the Mac. |
This file contains 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=/usr/local/bin/git | |
DATE=$(date "+%Y/%m/%d %H:%M:%S") | |
AMO_PYTHON_ROOT=/data/amo_python | |
function update_previews { | |
DIR=$1 | |
BRANCH=$2 |
This file contains 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 collections | |
import json | |
import locale | |
import sys | |
import jingo | |
from babel.support import Format | |
KEY = 'Views' |
This file contains 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 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
"""SMTP email backend class.""" | |
from django.core.mail.backends import smtp | |
class EmailBackend(smtp.EmailBackend): | |
""" | |
A wrapper that manages the SMTP network connection. | |
""" |
This file contains 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 | |
def main(): | |
server = socket.socket() | |
server.bind(('localhost', 9999)) | |
server.listen(1) | |
print 'listening on :9999' | |
client = server.accept()[0] | |
while 1: |
This file contains 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
""" | |
A server that accepts a connection and then hangs. Pass a number to bind to a | |
specific port. | |
You need socket.settimeout. | |
""" | |
import socket | |
import sys | |
This file contains 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 | |
# Sets ~site_packages and tries to `cd ~/dev/<virtualenv`. | |
site_packages=$(virtualenvwrapper_get_site_packages_dir) | |
PROJECT=`basename $VIRTUAL_ENV` | |
DIR="$HOME/dev/$PROJECT" | |
if [ -d $DIR ]; then |
This file contains 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/env python | |
""" | |
./crush.py [host:port] | |
Runs a bunch of SADD and DELETE commands against Redis to see how it handles | |
high load. Do `./crush.py &` a bunch of times to generate a lot of | |
connections. | |
""" | |
import hashlib | |
import random |