Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View lkarsten's full-sized avatar

Lasse Karstensen lkarsten

View GitHub Profile
even more important text here
#!/usr/bin/python
# mjaff
import re, sys, os, time
from mechanize import Browser
from pysqlite2 import dbapi2 as sqlite
import codecs
z = codecs.lookup("iso8859-1")
def fo(s):
lkarsten@hotel:~/work/gnuradio/gnuradio-examples/python$ diff --unified=1000 usrp/usrp_wfm_rcv.py usrp2/usrp2_wfm_rcv.py
--- usrp/usrp_wfm_rcv.py 2010-09-05 21:53:14.000000000 +0200
+++ usrp2/usrp2_wfm_rcv.py 2010-10-15 22:37:52.000000000 +0200
@@ -1,305 +1,288 @@
#!/usr/bin/env python
#
-# Copyright 2005,2006,2007,2009 Free Software Foundation, Inc.
+# Copyright 2005,2006,2007,2008,2009 Free Software Foundation, Inc.
#
# This file is part of GNU Radio
sub vcl_hash {
hash_data(req.url);
if (req.http.X-newhash) {
hash_data(req.http.X-newhash);
}
if (req.http.host) {
hash_data(req.http.host);
} else {
hash_data(server.ip);
}
ortant {
color: red;
font-weight: bold;
font-size: 110%;
padding: 4px;
width: 80%;
}
.spacedtable {
margin: 10px;
#!/usr/bin/env python
# .- coding: utf-8 -.
import datetime, locale
#locale.setlocale(locale.LC_ALL, "nb_NO.UTF-8")
today = datetime.datetime.now()
then = datetime.datetime(year=2013, month=5, day=16, hour=6, minute=30)
then_baat = datetime.datetime(year=2013, month=5, day=18, hour=12, minute=00)
@lkarsten
lkarsten / default.vcl
Last active April 23, 2021 18:32
varnish vcl for ghost blogging platform
#
# Varnish VCL file for Ghost blogging platform.
# http://ghost.org/
#
# Written for Ghost v0.3.0.
#
# This is a low-hanging-fruit type of VCL. TTL of objects are overridden to 2
# minutes, and everything below /ghost/ is pass()-ed so the user sessions
# work.
#
@lkarsten
lkarsten / gist:8039861
Created December 19, 2013 14:24
Varnish 3.0 to 4.0.
diff --git a/src/vmod_policy.c b/src/vmod_policy.c
index 7f6edd9..d22c1f3 100644
--- a/src/vmod_policy.c
+++ b/src/vmod_policy.c
@@ -7,7 +7,7 @@
#include "vrt.h"
#include "vsb.h"
-#include "bin/varnishd/cache.h"
+#include "cache/cache.h"
From fb3faca3c6c58fa8c8f993e78b76c7206e135437 Mon Sep 17 00:00:00 2001
From: Jason Evans <jasone@canonware.com>
Date: Sun, 5 Oct 2014 13:05:10 -0700
Subject: [PATCH] Fix OOM-related regression in arena_tcache_fill_small().
Fix an OOM-related regression in arena_tcache_fill_small() that caused
cache corruption that would almost certainly expose the application to
undefined behavior, usually in the form of an allocation request
returning an already-allocated region, or somewhat less likely, a freed
region that had already been returned to the arena, thus making it
#!/usr/bin/env python
"""
Logging part of a multicast group scanner.
Needs to be run with capabilities allowing it to read
raw data from the network interface. (usually root)
Author: Lasse Karstensen <lasse.karstensen@gmail.com>, April 2013.
"""
import sys