Skip to content

Instantly share code, notes, and snippets.

Avatar

Lasse Karstensen lkarsten

  • Isokron AS
  • Oslo, Norway
View GitHub Profile
View iterative-join.py
#!/usr/bin/python
"""
Multicast group scanner.
Author: Lasse Karstensen <lasse.karstensen@gmail.com>, November 2014
"""
import gevent
from gevent import monkey
monkey.patch_all()
View log_active_groups.py
#!/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
@lkarsten
lkarsten / default.vcl
Last active April 23, 2021 18:32
varnish vcl for ghost blogging platform
View default.vcl
#
# 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.
#
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.
@lkarsten
lkarsten / splitax.py
Created July 9, 2017 12:09
splitax.py
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
@lkarsten
lkarsten / hitch
Created July 23, 2015 12:13
hitch init script for debian
View hitch
#! /bin/sh
### BEGIN INIT INFO
# Provides: hitch
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $local_fs $remote_fs $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: The Scalable TLS Unwrapping Daemon
# Description: The Scalable TLS Unwrapping Daemon
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