Skip to content

Instantly share code, notes, and snippets.

@larsimmisch
larsimmisch / mISDNcapid.service
Created Dec 3, 2016
systemd service definition for mISDNcapid
View mISDNcapid.service
[Unit]
Description=mISDN capi daemon
After=network.target
[Service]
ExecStartPre=/bin/mkdir -p /var/run/mISDNcapid
ExecStart=/usr/local/sbin/mISDNcapid -f
Restart=always
[Install]
@larsimmisch
larsimmisch / wp_merge_comments.py
Created Dec 2, 2015
Python script to merge comments from one wordpress instance to another
View wp_merge_comments.py
#!/usr/bin/env python
# I recently had to merge the comments from an old instance of wordpress to
# a new one (long and boring story).
# The posts had already been manually merged, but not the comments.
# So I wrote this script to merge the comments
# Warning: while this has worked (once) this may not be a good way to do it.
# Also, it is slow, so, for repeated operation, it creates a stats.json so it doesn't
View clicktest_workaround.py
import os
import click
def prompt_and_invoke(ctx, fn):
# This is a workaround for a bug in click.
# See https://github.com/mitsuhiko/click/issues/429
# This isn't perfect - we are probably ignoring some information
kw = {}
View clicktest.py
import os
import click
@click.command()
@click.option('--site-title',
default="Notizen",
prompt='Enter site title.')
@click.option('--user-backend',
default="db",
type=click.Choice(['db', 'ldap']),
View gist:61ac89e861dedbad60cf
opam install eliom
The following actions will be performed:
∗ install uutf 0.9.4 [required by tyxml]
∗ install calendar 2.03.2 [required by eliom]
∗ install dbm 1.0 [required by ocsigenserver]
∗ install conf-pkg-config 1.0 [required by conf-libpcre]
∗ install cryptokit 1.10 [required by ocsigenserver]
∗ install lwt 2.4.6 [required by js_of_ocaml, ocsigenserver]
∗ install reactiveData 0.1 [required by eliom]
∗ install optcomp 1.6 [required by deriving]
View keybase.md

Keybase proof

I hereby claim:

  • I am larsimmisch on github.
  • I am la23ng (https://keybase.io/la23ng) on keybase.
  • I have a public key whose fingerprint is 4402 1BF1 DC65 327C 125B 62B1 A588 987B 7B75 CAB2

To claim this, I am signing this object:

@larsimmisch
larsimmisch / crc64.py
Created Apr 1, 2014
crc64 implementation in Python (slow)
View crc64.py
from __future__ import print_function
# Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
# (Any use permitted, subject to terms of PostgreSQL license; see.)
# If we have a 64-bit integer type, then a 64-bit CRC looks just like the
# usual sort of implementation. (See Ross Williams' excellent introduction
# A PAINLESS GUIDE TO CRC ERROR DETECTION ALGORITHMS, available from
# ftp://ftp.rocksoft.com/papers/crc_v3.txt or several other net sites.)
@larsimmisch
larsimmisch / ringbuffer.h
Created Mar 15, 2014
C++ implementation of a ringbuffer from @mrdk
View ringbuffer.h
// ringbuffer.h
// Author: Markus Redeker
#pragma warning(disable:4786)
#ifndef __RINGBUFFER_H__
#define __RINGBUFFER_H__
// Use:
// ringbuffer r;
View avr-binutils-size.patch
AVR only; support -C for AVR memory usage
Source: http://git.makehackvoid.com/cgi-bin/gitweb.cgi?p=mhvavrtools.git;a=blob_plain;f=mhvavrtools/patches/binutils-001-avr-size.patch;h=e80d28eae46217551d996a2253256c97d10aa4b5;hb=refs/heads/master
===========================================================
--- binutils/size.c 2007-08-06 13:56:14.000000000 -0600
+++ binutils/size.c 2007-09-13 09:13:10.281250000 -0600
@@ -36,10 +36,31 @@
#include "getopt.h"
#include "bucomm.h"