Skip to content

Instantly share code, notes, and snippets.


T. Meissner tmeissner

View GitHub Profile
tmeissner / raspiTemp.js
Last active Dec 20, 2015
draw a nice chart of measured temperatures with the help of highchart.js
View raspiTemp.js
// variable to en-/disable debug
// set to 1 to enable debug log
if (DEBUG === undefined) {
var DEBUG = 0;
// wrap all in anonymous function to get out of global scope
(function () {
tmeissner /
Created Jul 21, 2013
Take a foto with the camera board and save it under name with date in it
raspistill -t 100 -vf -hf -q 50 -o $(date +%Y-%m-%d-%T).jpg
tmeissner /
Last active Dec 19, 2015
Spam yourself with eMails containing the temperature measured by your 1wire temperature sensor ;)
read -r BLA
TEMP=$(echo $BLA | sed "s/.*\([0-9][0-9].[0-9][0-9][0-9]\)/\1/")
echo $TEMP | mail -s "Temperatur" $1
tmeissner /
Last active Jun 1, 2020
Bash script to read out the DS18B20 1wire temp sensor. You have to modprobe the w1-gpio and w1-therm modules before using it.
THERM=$(cat $1)
CPU=$(cat /sys/class/thermal/thermal_zone0/temp)
tmeissner / avr_fifo.c
Last active Dec 19, 2015
Fifo implementation for AVR 8-bit controller
View avr_fifo.c
struct fifo {
uint8_t size; /* size of buffer in bytes */
uint8_t read; /* read pointer */
uint8_t write; /* write pointer */
unsigned char buffer[]; /* fifo ring buffer */
/* define a FIFO type for 'size' bytes */
#define MK_FIFO(size) \
struct fifo_ ## size { \
tmeissner /
Created Dec 16, 2012
Yet another template engine: a collection of simple functions to generate HTML content (taken from 'Head first Python' and expanded)
def start_response(resp="text/html"):
return('Content-type: ' + resp + '\n\n')
def html_header(title="default"):
<meta charset="utf-8" />
<title>""" + title + """</title>
View file_upload.html
<!DOCTYPE html>
<title>File upload</title>
<h1>File upload</h1>
tmeissner /
Created Dec 16, 2012
Python file upload
import yate
import cgi
import os
form = cgi.FieldStorage()
item = form["filename"]
message = 'File uploaded'
tmeissner / gist:4246604
Created Dec 9, 2012
Generic function to send commands over the SPI interface of an AVR uC
View gist:4246604
// defines for all commands and the max length of spi messages
#define CHIPERASE "\xc7\x94\x80\x9a"
#define SPILENGTH 32
// array to receive data
unsigned char spi_rxdata[SPILENGTH];
// transfer a byte on spi
static unsigned char spi_transfer (unsigned char c) {
SPDR = c;
You can’t perform that action at this time.