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
varnishtest "Test issue #28" | |
server s1 { | |
rxreq | |
txresp | |
} -repeat 40 -start | |
varnish v1 -vcl+backend { | |
import cookie from "${vmod_topbuild}/src/.libs/libvmod_cookie.so"; |
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 | |
from time import time | |
from threading import Lock | |
class RateLimiter: | |
""" | |
An implementation of rate limiter based on token bucket algorithm. | |
Original implementation: |
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 | |
REPO="[email protected]:lgelo/demo.git" | |
BRANCH="master" | |
TARGET="/srv/app/demo" | |
PRESERVE=( settings.py ) | |
STAGING=$(mktemp -d) | |
CWD=${PWD} |
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 bash | |
abort() { echo -e "\nERROR: $1" >&2; exit 1; } | |
usage() { echo -e "\nUsage:\n$0 [-h] | [-s on|off] [-a <adapter>]\n"; exit 0; } | |
if [ "$(whoami)" != root ] ; then | |
abort 'Please run this script as root.' | |
fi | |
MEGACLI=$(which megacli) || abort 'megacli not found in the path.' |
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 | |
""" | |
Linux disk drive information: model, serial, firmare version | |
""" | |
import sys, os, fcntl, struct, glob | |
def list_devices(pattern = 'sd*'): | |
return [os.path.basename(d) for d in glob.glob('/sys/block/' + pattern)] |