Skip to content

Instantly share code, notes, and snippets.

@kogakure
kogakure / fabfile.py
Created October 17, 2009 15:15 — forked from jefftriplett/fabfile.py for django
Python: Deployment for Django with Fabric
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
fabfile for Django
------------------
see http://morethanseven.net/2009/07/27/fabric-django-git-apache-mod_wsgi-virtualenv-and-p/
modified for fabric 0.9/1.0 by Hraban (fiëé visuëlle)
several additions, corrections and customizations, too
@onyxfish
onyxfish / fabfile.py
Created February 9, 2010 23:05
Chicago Tribune News Applications fabric deployment script
from fabric.api import *
"""
Base configuration
"""
env.project_name = '$(project)'
env.database_password = '$(db_password)'
env.site_media_prefix = "site_media"
env.admin_media_prefix = "admin_media"
env.newsapps_media_prefix = "na_media"
@alexdong
alexdong / punch_card_visualizing_chi.html
Created November 16, 2010 13:53
Django template for visualizing Customer Happiness Index
{% load usage %}
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Trunkly · Punch Chart</title>
<style>
body { margin: 30px auto; width: 800px; background-color:#333; }
div { background-color: green; }
a { color: #eee; font-size:11px; text-decoration:none; }
</style>
@ticean
ticean / convertMkv
Created December 10, 2010 04:22
sabnzbd/sickbeard post-process script that runs both sabToSickBeard and mkv conversion for XBox360, using handbrake.
#!/bin/bash
############################################################
# Recursively peruses a directory and converts MKV files
# to MP4 for streaming to Xbox360.
#
# @author: Ticean Bennett
# @url: http://ticean.com
# @see: http://trac.handbrake.fr/wiki/CLIGuide#options
#
# @param file The complete file path.
@hirose31
hirose31 / gist:1000270
Created May 31, 2011 10:21
bash completion for Kyoto Cabinet/Tycoon (kchashmgr, ktremotemgr)
# Kyoto Cabinet
_kchashmgr() {
local cur prev
local commands="create inform set remove get list import copy dump load defrag setbulk removebulk getbulk check version" # not include: clear
COMPREPLY=()
cur=${COMP_WORDS[COMP_CWORD]}
prev=${COMP_WORDS[COMP_CWORD-1]}
arg1=${COMP_WORDS[1]}
if [ $COMP_CWORD -eq 1 ]; then
@JoshuaEstes
JoshuaEstes / 000-Cheat-Sheets.md
Last active May 1, 2024 04:03
Developer Cheat Sheets for bash, git, gpg, irssi, mutt, tmux, and vim. See my dotfiles repository for extra info.
@kennethreitz
kennethreitz / pr.md
Created September 12, 2012 20:56 — forked from piscisaureus/pr.md
Checkout github pull requests locally

Locate the section for your github remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@github.com:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@sheerun
sheerun / proxy
Last active January 25, 2024 01:11
Automatic SOCKS proxy setup through SSH connection on Mac OS X
# Script for automatic setup of SOCKS proxy through SSH connection.
# It automatically teardowns SOCKS configuration before stopping.
# It's supposed to work on Mac OS X 10.6+
#
# Author: Adam Stankiewicz (@sheerun)
#
[[ -n "$1" ]] || { echo "Usage: proxy user@example.com"; exit 1; }
# get service GUID and NAME (like Wi-Fi) to set SOCKS proxy
@jpetazzo
jpetazzo / README.md
Last active August 21, 2019 17:55
Give network superpowers to docker

Unionize: network superpowers for your docker containers

Unionize lets you connect together docker containers in arbitrarily complex scenarios.

Note: I recommend to use https://github.com/jpetazzo/pipework instead.

  • pipework is a better name than unionize
  • it's hosted on a "real" github repo instead of a small gist :-)

Now if you want Unionize, it's still here. Just check those examples.

@jpetazzo
jpetazzo / README.md
Last active September 30, 2022 05:36
Share a directory with a docker container

Rectifier

The diode bridge is the simplest rectifier I know.

Rectifier lets you share a directory with a docker container (just like $yourvm shared folders).

You don't have to install anything in your containers, and you only need to install diod in the host. diod is packaged on Ubuntu/Debian distros, and will automatically be apt-get install-ed if needed.

Since it uses diod to make a bridge, I called it rectifier. Yeah, that sucks, so if you have a better name, I'll steal it!