Skip to content

Instantly share code, notes, and snippets.

View svdgraaf's full-sized avatar
🎱
¯\_(ツ)_/¯

Sander van de Graaf svdgraaf

🎱
¯\_(ツ)_/¯
View GitHub Profile
@svdgraaf
svdgraaf / gist:6078982
Last active December 20, 2015 05:29
CENTOS 6 with Varnish 3.03 and VMOD support (geoip example)
# varnish
sudo yum remove varnish*
sudo rpm --nosignature -i http://repo.varnish-cache.org/redhat/varnish-3.0/el6/noarch/varnish-release-3.0-1.el6.noarch.rpm
sudo yum install varnish-3.0.3
sudo yum install pcre-devel libedit libedit-devel
# varnish source
wget http://repo.varnish-cache.org/source/varnish-3.0.3.tar.gz
tar -zxvf varnish-3.0.3.tar.gz
./configure
{
"environments": [],
"name": "focus",
"repository": {
"location": "git@github.com:hub-nl/nl.focusmedia.git",
"name": "foo",
"variant": "git"
},
"variant": "python"
}
@svdgraaf
svdgraaf / gist:1218812
Created September 15, 2011 08:19
Running Django on Heroku
# create a dir
mkdir foobar
cd foobar
# instantiate a virtual environment
virtualenv --no-site-packages .
# start your virtualenv
source bin/activate
@svdgraaf
svdgraaf / bitmovr.lua
Created October 4, 2010 14:41
nginx+lua+mod_cache+mod_proxy+RANGE
--
-- bitmovr.lua
-- simple lua webserver which starts to listen on a socket, and
-- forwards all GET calls it receives to a backend server
-- this is extremely lightweight, as it will move the bits from one
-- socket to another, without any disk i/o
--
-- Depends on md5, io, LuaSockets and Memcached.lua
--
-- Application flow:
@svdgraaf
svdgraaf / Ponies.py
Created September 24, 2010 12:26
Embedding V8 in Python is awesome
# import PyV8, duh!
import PyV8
# define a class which methods should be available in Javascript
class epicClass(PyV8.JSClass):
def ponies(self):
return "Ponies!"
def doubletime(self, what, amount):
for i in range(0, amount):
@svdgraaf
svdgraaf / nginx byte range on proxy request
Created September 20, 2010 07:36
nginx byte request on proxied file
server {
listen *:80;
location = /crossdomain.xml {
root /var/www/html/;
}
location = /test.html {
root /var/www/html/;
}
@svdgraaf
svdgraaf / build
Created September 20, 2010 05:59
nginx + geo ip + secure download
$ ./configure --add-module=/home/svdgraaf/tmp/nginx/ngx_http_bytes_filter_module-57365655ee44 --with-http_geoip_module --add-module=/home/svdgraaf/tmp/nginx/ngx_secure_download