Skip to content

Instantly share code, notes, and snippets.

Lasse Karstensen lkarsten

Block or report user

Report or block lkarsten

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View gist:94061ea8f40f4788643a19ade8b09fe9
#!/bin/bash
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux;
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It
# only accepts ESC backslash for ST.
function print_osc() {
if [[ $TERM == screen* ]] ; then
printf "\033Ptmux;\033\033]"
else
printf "\033]"
View gist:0ca6d4bc4a6f01465da68b18b64503f1
From ebc04e28ee9aeff26e913c9c3982a4662bfe908e Mon Sep 17 00:00:00 2001
From: Lasse Karstensen <lasse.karstensen@gmail.com>
Date: Tue, 11 Dec 2018 16:17:43 +0100
Subject: [PATCH] WIP
---
src/configuration.c | 9 ++++++++-
src/configuration.h | 1 +
src/hitch.c | 22 +++++++++++++++++++---
3 files changed, 28 insertions(+), 4 deletions(-)
View peetbros-arduino.ino
/*
Peet Bros. (PRO) anemometer interface.
Read the wind speed and direction interrupts from two input pins, do some math,
and output this over Serial as NMEA0183.
The anemometer itself is designed so that the two inputs does not signal
at the same time. We can use simple non-interruptable interrupts and still
be pretty sure not to lose any events.
View splitax.py
#!/usr/bin/env python3
"""
Split Airmar .ax files consisting of multiple SREC blocks into separate files,
so srec_cat/objcopy can read them.
Author: Lasse Karstensen <lasse.karstensen@gmail.com>, July 2017.
"""
from sys import argv
from os.path import basename
View gist:8fbd1a92a97da049ac180b620137b38e
varnish> vcl.inline test <<'__EOF__'
106
Message from VCC-compiler:
Syntax error at
('<vcl.inline>' Line 1 Pos 3)
<<'__EOF__'
--#--------
Running VCC-compiler failed, exited with 2
VCL compilation failed
View gist:a2cdaf19a6dc74fdd201
diff --git a/man/Makefile.am b/man/Makefile.am
index 35a8c52..0c93e1b 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -17,7 +17,7 @@ dist_man_MANS = \
vmod_directors.3 \
vmod_std.3
-MAINTAINERCLEANFILES = $(dist_man_MANS)
+CLEANFILES = $(dist_man_MANS)
View 0001-Handle-missing-waiting-list-gracefully.patch
From a1d9d3122e780bb7d4c384eb668398089ced5df3 Mon Sep 17 00:00:00 2001
From: Lasse Karstensen <lasse.karstensen@gmail.com>
Date: Sat, 16 Jan 2016 15:32:16 +0100
Subject: [PATCH] Handle missing waiting list gracefully.
In 5c8268062bf06a2700dd27331c29c48d650c9197 the checks are relaxed,
but this commit (or part of) was not brought into 4.1.
---
bin/varnishd/cache/cache_hash.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
View sessioncount-cookie.vcl
View sticky-ip.vcl
vcl 4.0;
import std;
import directors;
backend a1 { .host = "192.0.2.11"; }
backend b1 { .host = "192.0.2.11"; }
sub vcl_init {
new hdir = directors.hash();
You can’t perform that action at this time.