Skip to content

Instantly share code, notes, and snippets.

vcl 4.0;
import curl;
import cookie;
import std;
backend default {
.host = "127.0.0.1";
.port = "8000";
}
sub vcl_hit {
if (obj.ttl >= 0s) {
# normal hit
return (deliver);
}
# We have no fresh fish. Lets look at the stale ones.
if (std.healthy(req.backend_hint)) {
# Backend is healthy. Limit age to 10s.
if (obj.ttl + 10s > 0s) {
set req.http.grace = "normal(limited)";
Recipe: Sgabuzzino rosso
Brewer: Per Buer
Asst Brewer:
Style: Classic American Pilsner
TYPE: All Grain
Taste: (30.0)
Recipe Specifications
--------------------------
Boil Size: 32.33 l
#!/usr/local/bin/python
import getopt
import threading
import Queue
import time
import glob
import subprocess
import sys
import os
2015-03-08 10:55:21 +0100
./configure
--disable-debug
--disable-dependency-tracking
--prefix=/usr/local/Cellar/dosbox/0.74
--mandir=/usr/local/Cellar/dosbox/0.74/share/man
--disable-sdltest
--enable-core-inline
@perbu
perbu / gist:f492d25448bde3f6de12
Created March 6, 2015 19:03
subprocess is lame
#!/usr/local/bin/python
import subprocess
output = "not set"
try:
output = subprocess.check_output(["ls", "/", "/foo"])
print "success!"
print(output)
except subprocess.CalledProcessError:
print "fail!"
print output # will output "not set"
@perbu
perbu / sessionlog.pl
Created August 22, 2013 11:11
Quick and dirty way to split varnish log stream into separate file.
use IO::File;
while($logline = <>) {
($n) = $logline =~ m/\s+(\d+)/;
unless ($F{$n}) {
print "New FD: $n\n";
$F{$n} = IO::File->new("$n.log", "w")
};
$F{$n}->print($logline);
}