Skip to content

Instantly share code, notes, and snippets.

View tspspi's full-sized avatar

tspspi

View GitHub Profile
@tspspi
tspspi / LICENSE.md
Created November 9, 2021 15:20
A simple daemon skeleton for Python 3.x

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 this list of conditions and the following disclaimer.
  • Redistributions in binary form must reproduce this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
  • Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without
@tspspi
tspspi / LICENSE.md
Created September 12, 2021 17:26
Example program for synchronous usage of AD7705 with an ATMega2560

Copyright (c) Thomas Spielauer. 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 notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
@tspspi
tspspi / LICENSE.md
Created July 28, 2021 16:14
Python access to Gamma vacuum QPC ion pump pressure gauge using Ethernet interface

Copyright (c)2021 Thomas Spielauer. 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.

@tspspi
tspspi / ebnf.ebnf
Created February 27, 2021 20:58
ISO EBNF productions describing ISO EBNF without alternative syntax
(*
ISO EBNF Syntax
Removed alternative syntax:
definition separator symbol = ´|´ | ´/´ | ´!´;
start option symbol = ´[´ | ´(/´;
end option symbol = ´]´ | ´/)´;
start repeat symbol = ´{´ | ´(:´;
end repeat symbol = ´}´ | ´:)´;
*)
repetition symbol = ´*´;
@tspspi
tspspi / SimplePiezoBoardTest.cpp
Created October 14, 2019 13:21
3D printer piezo board leveling Arduino test sketch
/*
Simple test program for 3D printer piezo
bed leveling adapter board described at
https://www.tspi.at/2019/09/11/piezobedlevel.html
(using Arduino IDE and libraries).
This does not provide any I2C connectivity, etc.
and just periodically reads analog samples, dumps
them to the serial port and does some moving average
filtering (as well as using a inductive probe as
@tspspi
tspspi / nodered
Created February 29, 2020 13:19
FreeBSD NodeRED rc.d init script
#!/bin/sh
#
# PROVIDE: nodered
# REQUIRE: LOGIN
# KEYWORD: shutdown
# Configuration variables:
#
# Variable Default Description
# ====================================================================================================
@tspspi
tspspi / updateTunnel.sh
Created November 1, 2019 10:22
Hurricane electric IPv6 tunnel endpoint dynamic IP update script
#!/bin/sh
# INTERFACE ... Is the public interface to the internet with assigned public IP
# GIFIF ....... The generic routing encapsulating interface
# POPIP ....... IP address of your assigned point of presence (tunnel endpoint)
# STATEFILE ... File that keeps the current "old" IP address
# LOGFILE ..... Logfile into which updates will be written
# TID ......... Tunnel ID (see tunnel configuration page)
# USERID ...... User ID (as registered)
# UPDATEKEY ... See advanced tab of tunnel configuration page
@tspspi
tspspi / Makefile
Created October 8, 2019 08:12
Simple JPEG image I/O example with libjpeg (nearly no proper error handling)
main: main.c filter_greyscale.c imagefile.c simple_imageio.h
clang -DDEBUG -o main -Wall -ansi -std=c99 -pedantic -Werror main.c filter_greyscale.c imagefile.c -ljpeg
@tspspi
tspspi / howto.md
Last active March 10, 2019 14:22
How to use avr-gcc and avrdude with Arduino Pro-Mini on FreeBSD

How to use AVR-GCC and avrdude with Arduino pro-mini on FreeBSD

Required packages / ports

devel/avr-gcc
devel/avr-binutils
devel/avrdude
@tspspi
tspspi / krb5renew.sh
Created March 8, 2019 10:41
Kerberos ticket renewal for all cache files on a machine
#!/bin/sh
# This script automatically renews renewable tickets
# of all users on a given machine (to prevent timeout
# for long running tasks of logged in users).
# It also removes expires tickets from cache files
: ${RENEWAL_THREASHOLD:=3600}
: ${VERBOSE:=0}
: ${LOGFILE:=/var/log/krb5renew.log}