Skip to content

Instantly share code, notes, and snippets.

View lkarsten's full-sized avatar

Lasse Karstensen lkarsten

View GitHub Profile
#!/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]"
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(-)
/*
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.
@lkarsten
lkarsten / splitax.py
Created July 9, 2017 12:09
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
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
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)
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(-)
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();