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 | |
VENV=$1 | |
if [ -z $VENV ]; then | |
echo "usage: runinenv [virtualenv_path] CMDS" | |
exit 1 | |
fi | |
. ${VENV}/bin/activate | |
shift 1 | |
echo "Executing $@ in ${VENV}" | |
exec "$@" |
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 | |
# Simple script to get both MD5 and SHA1 hash of any file. | |
import sys | |
import hashlib | |
if len(sys.argv) < 2: | |
sys.exit('Usage: %s filename' % sys.argv[0]) |
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
#Rewritten code from /r2/r2/lib/db/_sorts.pyx | |
from datetime import datetime, timedelta | |
from math import log | |
epoch = datetime(1970, 1, 1) | |
def epoch_seconds(date): | |
"""Returns the number of seconds from the epoch to date.""" | |
td = date - epoch |
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 | |
import urllib2 | |
import gzip | |
import os | |
from subprocess import call | |
''' | |
Updates Transmission Blocklist with specified blocklist file. Must be run as root | |
if using default blocklist_path directory. |
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
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
RED="\[\033[0;31m\]" | |
YELLOW="\[\033[0;33m\]" | |
GREEN="\[\033[0;32m\]" | |
NO_COLOUR="\[\033[0m\]" | |
PS1="$GREEN\u@battlestation$NO_COLOUR:\w$YELLOW\$(parse_git_branch)$NO_COLOUR\$ " |
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
[color] | |
branch = auto | |
diff = auto | |
status = auto | |
[color "branch"] | |
current = yellow reverse | |
local = yellow | |
remote = green | |
[color "diff"] | |
meta = yellow bold |
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 | |
""" clean_old_s3_files.py - Purges old files based on date given | |
Author: Alfred Gutierrez (alfg.co) | |
Requires: boto | |
Usage: Configure Date, AWS and Bucket variables below. Then run as 'python clean_old_s3_files.py' |
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 | |
import time | |
import threading | |
import pymongo | |
from pymongo import Connection | |
import redis | |
import boto | |
import pystache |
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
<html> | |
<head> | |
<title>Sample Widget Page</title> | |
</head> | |
<body> | |
<h1>Sample Widget Page</h1> | |
<script type="text/javascript" src="http://localhost:81/widget-bootstrap.js"></script> | |
<div id="widget-container"></div> |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Ping.JS Demo</title> | |
<style> | |
ul span { | |
color: green; | |
} | |
</style> |
OlderNewer