Skip to content

Instantly share code, notes, and snippets.

View speters's full-sized avatar

Sönke J. Peters speters

View GitHub Profile
@speters
speters / mailcatch.py
Last active March 14, 2016 16:05
A simple utility to forward mailcatch.com 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':''})
config.read(['/etc/smtpclient.ini', os.path.expanduser('~/.smtpclient.ini')])
@speters
speters / smsdmailforward.py
Last active March 14, 2016 16:09
SMS to email forwarding handler for SMStools
#! /usr/bin/env python
from sys import argv
import smtplib, email
import ConfigParser, os
config = ConfigParser.SafeConfigParser({'smtphost': 'localhost', 'smtpuser':'', 'smtppass':'', 'forwardto':''})
config.read(['/etc/smtpclient.ini', os.path.expanduser('~/.smtpclient.ini')])
if config.has_section('smsdmailforward'):
#!/bin/bash
SUFFIX="-6"
if ([ "$1" = "-f" ]) ; then
NOP=''
else
NOP='echo'
fi
@speters
speters / bitorderchange.py
Created October 12, 2016 17:39
changes bit order in strings representing binary numbers (e.g. 0b001 --> 0b100)
#!/usr/bin/python
bitstringlen = 8
import sys, re
regex = re.compile('(.*)0b([01]{2,8}),(.*)$');
for line in sys.stdin:
if regex.match(line) is not None:
bitstring = regex.match(line).group(2)
@speters
speters / getvitoxml.sh
Last active November 22, 2016 14:47
Extracts XML files containing datapoint descriptions from Vitosoft300WithoutDocs.iso
#!/bin/bash
VITODIR="${HOME}/tmp/vitosoft/"
VITOSOFTISO_FILE="${VITODIR}/Vitosoft300WithoutDocs.iso" # ${HOME}/Downloads/Vitosoft300WithoutDocs.iso"
###
VITOSOFTISO_URL="https://update-vitosoft.viessmann.com/CurrentVersion/Vitosoft300WithoutDocs.iso"
VITOSOFTISO_FILELEN=2818441216
VITOSOFTISO_LASTMODIFIED="Tue, 15 Dec 2015 15:54:01 GMT"
@speters
speters / eclipse.ini
Created January 31, 2017 09:14
Eclipse Neon INI file
-startup
plugins/org.eclipse.equinox.launcher_1.3.201.v20161025-1711.jar
--launcher.library
plugins/org.eclipse.equinox.launcher.gtk.linux.x86_64_1.1.401.v20161122-1740
-product
org.eclipse.epp.package.cpp.product
--launcher.defaultAction
openFile
-showsplash
org.eclipse.platform
#!/bin/bash
# Based on a test script from avsm/ocaml repo https://github.com/avsm/ocaml
CHROOT_DIR=/tmp/arm-chroot
MIRROR=http://archive.raspbian.org/raspbian
VERSION=wheezy
CHROOT_ARCH=armhf
# Debian package dependencies for the host
HOST_DEPENDENCIES="debootstrap qemu-user-static binfmt-support sbuild"
@speters
speters / Spanner3.fcstd
Last active February 27, 2018 09:03
Anet A6 X-axis belt tensioner
/*
* Einfacher Navtex-Empfaenger
*
* von Martin Kuettner <berry@fmode.de> 03/2016
*
*
* Portierung des 80C51 Assembler Programms aus "A NAVTEX Receiver for the DXer":
*
* Klaus Betke, Am Entengrund 7, D-26160 Bad Zwischenahn, Email: betke@itap.de
* 11-AUG-00 / 01-OCT-00
input_device = "Logitech Gamepad F310"
input_driver = "udev"
input_vendor_id = 1133
input_product_id = 49693
input_a_btn = "1"
input_reset_btn = "1"
input_b_btn = "0"
input_x_btn = "3"
input_y_btn = "2"
input_menu_toggle_btn = "2"