Skip to content

Instantly share code, notes, and snippets.

Avatar

Sönke J. Peters speters

View GitHub Profile
View .travis-ci.sh
#!/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 / uid.ino
Last active Feb 16, 2021
Arduino atmega328p unique id/serial number
View uid.ino
#include <avr/boot.h>
void print_val(char *msg, uint8_t val)
{
Serial.print(msg);
Serial.println(val, HEX);
}
void setup(void)
{
@speters
speters / eclipse.ini
Created Jan 31, 2017
Eclipse Neon INI file
View eclipse.ini
-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
View Makefile
DPDtables.sql:
xsltproc xsdtosql.xsl ~/tmp/vitosoft/DPDefinitions.xsd | sed -e '/^\s*$$/d;s/^\s*CREATE/CREATE/g' > $@
all: clean DPDtables.sql
clean:
rm -f DPDtables.sql
@speters
speters / getvitoxml.sh
Last active Nov 22, 2016
Extracts XML files containing datapoint descriptions from Vitosoft300WithoutDocs.iso
View getvitoxml.sh
#!/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 / bitorderchange.py
Created Oct 12, 2016
changes bit order in strings representing binary numbers (e.g. 0b001 --> 0b100)
View bitorderchange.py
#!/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)
View arm-linux-versionchange.sh
#!/bin/bash
SUFFIX="-6"
if ([ "$1" = "-f" ]) ; then
NOP=''
else
NOP='echo'
fi
@speters
speters / smsdmailforward.py
Last active Mar 14, 2016
SMS to email forwarding handler for SMStools
View smsdmailforward.py
#! /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'):
@speters
speters / pwl_serstream.py
Last active Mar 13, 2019
Simulate serial RS232 data to use as a PWL file for LTspice
View pwl_serstream.py
#!/usr/bin/python
data = "asdfg";
bps = 115200; #9600;
num_databits=8;
parity = 'n';
num_stopbits = 1;
lvl_0 = 3.3;
lvl_1 = 0.0;