Skip to content

Instantly share code, notes, and snippets.

@jsleetw
jsleetw / gist:4554462
Created January 17, 2013 08:06
python pep8 check pre-commit script
#!/usr/bin/env python
from __future__ import with_statement
import os
import re
import shutil
import subprocess
import sys
import tempfile
@jsleetw
jsleetw / gist:4129994
Created November 22, 2012 08:32
make nginx
./configure --prefix=/opt/nginx --with-debug --with-http_dav_module \
--with-http_addition_module --with-http_geoip_module --with-http_gzip_static_module \
--with-http_image_filter_module --with-http_realip_module --with-http_stub_status_module \
--with-http_ssl_module --with-http_sub_module --with-http_xslt_module \
--with-ipv6 --with-sha1=/usr/include/openssl --with-md5=/usr/include/openssl --with-mail \
--with-mail_ssl_module \
--add-module=/opt/ruby/lib/ruby/gems/1.8/gems/passenger-3.0.11/ext/nginx
-------------------------------------------------------------------------------------
without passenger
@jsleetw
jsleetw / gist:3446852
Created August 24, 2012 06:51
ntpdate over http proxy
date -s "$(wget --no-cache -S -O /dev/null google.com 2>&1 | sed -n -e '/ *Date: */ {' -e s///p -e q -e '}')"
@jsleetw
jsleetw / update
Created December 16, 2011 05:04 — forked from hSATAC/update
git update hook
#!/bin/sh
# place in {repo}/.git/hooks/update
# chmod +x update
name="$1"
old="$2"
new="$3"
user_name=$(git log -1 --pretty=format:%aN $new)
#branch=$(git rev-parse --symbolic --abbrev-ref $1)
branch=${name#refs/heads/}
@jsleetw
jsleetw / fabfile.py
Created December 13, 2011 07:34 — forked from anonymous/gist:156623
fabric example
"""
This fabric file makes setting up and deploying a django application much
easier, but it does make a few assumptions. Namely that you're using Git,
Apache and mod_wsgi and your using Debian or Ubuntu. Also you should have
Django installed on your local machine and SSH installed on both the local
machine and any servers you want to deploy to.
_note that I've used the name project_name throughout this example. Replace
this with whatever your project is called._