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 multiprocessing | |
# The socket to bind. | |
bind = "127.0.0.1:8080" | |
# The maximum number of pending connections. | |
backlog = 2024 | |
# The number of worker process for handling requests | |
workers = multiprocessing.cpu_count() * 2 + 1 | |
# The type of workers to use. (sync|eventlet|gevent|tornado) | |
worker_class = 'gevent' |
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 string | |
import sys | |
class LeastRecentlyUsedMatrix(object): | |
""" | |
Output matrix in table format | |
Return least recently used references | |
""" | |
MAX_MATRIX_SIZE = 70 |
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 os | |
import sys | |
import subprocess | |
import time | |
def file_is_modified(filename): | |
""" Accepts & returns filename if it has been modified """ | |
previous_st_mtime = 0 | |
while True: | |
st_mtime = os.stat(filename)[8] |
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
-- Standard awesome library | |
require("awful") | |
require("awful.autofocus") | |
require("awful.rules") | |
-- Theme handling library | |
require("beautiful") | |
-- Notification library | |
require("naughty") | |
require("vicious") | |
-- Load Debian menu entries |
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
from string import ascii_uppercase as uc, ascii_lowercase as lc, maketrans | |
def rot_func(text, encode=True, rotate=13): | |
letters = uc + lc | |
rot = "".join((x[:rotate][::-1] + x[rotate:][::-1])[::-1] for x in (uc,lc)) | |
src, trg = (letters, rot) if encode else (rot, letters) | |
trans = maketrans(src, trg) | |
return text.translate(trans) |
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
# This file has been auto-generated by i3-config-wizard(1). | |
# It will not be overwritten, so edit it as you like. | |
# | |
# Should you change your keyboard layout somewhen, delete | |
# this file and re-run i3-config-wizard(1). | |
# | |
# i3 config file (v4) | |
# | |
# Please see http://i3wm.org/docs/userguide.html for a complete reference! |
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 | |
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD) | |
if [ -n "$BRANCH_NAME" ] && [ "$BRANCH_NAME" != "master" ]; then | |
echo "[$BRANCH_NAME] $(cat $1)" > $1 | |
fi |
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
" filetype plugin on | |
" filetype indent on | |
" Pathogen load | |
filetype off | |
call pathogen#infect() | |
call pathogen#helptags() | |
filetype plugin indent on | |
syntax on |
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
# UTF-8 | |
export LC_ALL=en_GB.UTF-8 | |
export LANG=en_GB.UTF-8 | |
export LANGUAGE=en_GB.UTF-8 | |
export EDITOR=/usr/bin/vim | |
# tailoring 'less' | |
####################################################### | |
alias more='less' |
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
export SSH_AUTH_SOCK=/home/simon/.ssh-socket | |
ssh-add -l >/dev/null 2>&1 | |
if [ $? = 2 ]; then | |
# No ssh-agent running | |
rm -rf $SSH_AUTH_SOCK | |
# >| allows output redirection to over-write files if no clobber is set | |
ssh-agent -a $SSH_AUTH_SOCK >| /tmp/.ssh-script | |
source /tmp/.ssh-script | |
echo $SSH_AGENT_PID >| ~/.ssh-agent-pid |
OlderNewer