Skip to content

Instantly share code, notes, and snippets.


Sönke J. Peters speters

View GitHub Profile
speters / pramod.ranade.c
Last active Dec 22, 2015 — forked from tmpvar/pramod.ranade.c
See "Linear motion control without the math" by Pramod Ranade in (Embedded System Design Vol 22, #4, April 2009) and
View pramod.ranade.c
Program to verify new algorithm for linear acceleration.
Author: Pramod Ranade <>
#include <stdio.h>
#if defined(_WIN32) || defined(_WIN64)
#include <io.h>
speters / hd44780sim.serialwombat.c
Last active Dec 23, 2015
jbroadwell tried to simulate an hd44780 lcd in This is the indented code posted therein.
View hd44780sim.serialwombat.c
* hd44780 simulator
* from
* 2/2007 by jbroadwell
#define FIRST_NIBBLE 0
#define DDRAM_SIZE 128
typedef struct hd44780_n
speters /
Created Sep 25, 2013
ihex crc recalculator Calculates the checksums of lines in an ihex/intel hex file. Useful for patching a hex file.
#!/usr/bin/env python
# Intel HEX file CRC recalculator
# See
# for a more elaborate version
from array import array
from binascii import hexlify, unhexlify
speters / Digital_Feed_2e.ino
Last active Dec 28, 2015
Elektronische Leitspindel für eine Drehmaschine mit dem Arduino Mega2560.Version 1a von Urspungsthema in
View Digital_Feed_2e.ino
#include <avr/pgmspace.h>
// ***** LCD *****
#include <LiquidCrystal.h>
LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
char LCD_Row_1[17];
char LCD_Row_2[17];
speters /
Created Dec 19, 2013
Proof of concept for a now closed bug
USER_AGENT="Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:25.0) Gecko/20100101 Firefox/25.0"
wget -U "${USER_AGENT}" --spider -S --keep-session-cookies --save-cookies=$COOKIEFILE $ENTRYURL
COOKIEHEADER=`awk -v ORS='' 'BEGIN {print "Cookie: "} /stayfriends/{print $6"="$7"; " } ' < $COOKIEFILE `
# local test against nc -l 8080
speters / screenshot.js
Created Dec 19, 2013
Simple PhantomJS screenshot script
View screenshot.js
var page = require('webpage').create();
var system = require('system');
var t, address;
if (system.args.length === 1) {
console.log('Usage: screenshot.js <some URL>');
speters /
Last active Mar 14, 2016
A simple utility to forward temporary mailboxes via SMTP
#! /usr/bin/env python
import urllib2
from xml.dom import minidom, Node
from sys import argv
import smtplib
import ConfigParser, os
config = ConfigParser.SafeConfigParser({'smtphost': 'localhost', 'smtpuser':'', 'smtppass':'', 'forwardto':''})['/etc/smtpclient.ini', os.path.expanduser('~/.smtpclient.ini')])

Keybase proof

I hereby claim:

  • I am speters on github.
  • I am soenke ( on keybase.
  • I have a public key whose fingerprint is D33D 153A A5D3 937E 8D99 907F EFC4 178C F358 FDCA

To claim this, I am signing this object:

speters / post-commit
Created Sep 10, 2015
git post-commit hook script to copy a subdirectory of the repo to another folder
View post-commit
# copy a subdirectory of a repository to another location after commit
# subdirectory in repo to copy:
mkdir /tmp/bla
speters / xfiles.h
Created Sep 17, 2015
C macro to for binary file inclusion
View xfiles.h
/* Copyright (c) 2008 Carlos Lamas
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above copyright