Skip to content

Instantly share code, notes, and snippets.

View tiefpunkt's full-sized avatar

Severin Schols tiefpunkt

View GitHub Profile
@tiefpunkt
tiefpunkt / decoder.js
Last active November 4, 2021 16:10
Make a TTN v2 payload decoder work with TTI/N v3
function Decoder(bytes, port) {
// Your "old" TTN v2 decoder function
}
// add other functions (Converter, Validator) here if you used them. If you didn't you can just skip them.
function decodeUplink(input) {
var data = input.bytes;
var valid = true;
@tiefpunkt
tiefpunkt / setup.sh
Last active January 10, 2022 19:17
Run Pretix in Docker, incl. DB and Redis
# Run Pretix in Docker, with DB and Redis also as docker containers
# This exposes Pretix on port 8080 without TLS.
# Make sure to provide a reverse proxy for proper TLS termination.
# DO NOT RUN WITHOUT TLS!
# Create local directories for the DB and Pretix itself
mkdir -p /data/pretix/{db,config,data}
touch /data/pretix/config/pretix.cfg
chown -R 15371:15371 /data/pretix/{config,data}
@tiefpunkt
tiefpunkt / export_foursquare_checkins.py
Last active October 3, 2016 19:44 — forked from dlo/export_foursquare_checkins.py
Download all your Foursquare checkins with Python.
# pip install requests
import requests
import json
url_template = 'https://api.foursquare.com/v2/users/self/checkins?limit=250&oauth_token={}&v=20131026&offset={}'
# If you navigate to https://developer.foursquare.com/docs/explore, Foursquare
# will generate an OAuth token for you automatically. Cut and paste that token
# below.
oauth_token = ""
@tiefpunkt
tiefpunkt / hourcount.ino
Last active June 12, 2016 20:12
Arduino Betriebsstundenzähler
#define IN_PIN 13
#define ON HIGH
#define OFF LOW
#define IGNORE_THRESHOLD 500
long starttime, duration;
int curr_status, prev_status;
#include <ESP8266WiFi.h>
#include <ESP8266WiFiMulti.h>
@tiefpunkt
tiefpunkt / mw_patch.sh
Last active August 29, 2015 14:07
Update a MediaWiki installation using patch files
#!/bin/bash
confirm () {
# call with a prompt string or use a default
read -r -p "${1:-Are you sure? [y/N]} " response
case $response in
[yY][eE][sS]|[yY])
true
;;
*)

Keybase proof

I hereby claim:

  • I am tiefpunkt on github.
  • I am tiefpunkt (https://keybase.io/tiefpunkt) on keybase.
  • I have a public key whose fingerprint is AAA4 5709 504C BDF4 4E97 A421 59B4 F38F 3CB0 F081

To claim this, I am signing this object:

@tiefpunkt
tiefpunkt / ws-proxy.py
Last active January 3, 2016 09:59
WebService Proxy for MQTT, to be used with one of the contribites UIs of MQTTitude. Can connect to a TLS-only Broker as well.
#!/usr/bin/env python
# coding: utf-8
# ------------------------------------------------------
#
# MQTT WS Proxy with TLS support
#
# By Severin Schols (@tiefpunkt)
# Based on https://gist.github.com/fiorix/1878983
# ------------------------------------------------------
@tiefpunkt
tiefpunkt / tm.ahk
Created March 19, 2013 08:49
Alt+Shift+8 for ™ on Windows as an AutoHotkey Script. Been using that shortcut on Linux all the time. Worklaptop runs Win7, needed it there as well.
!+8::Send
@tiefpunkt
tiefpunkt / geiger.py
Created February 9, 2013 19:54
Sending measurements from a MighyOhm Geiger Counter to cosm, using a Raspberry Pi and its onboard serial interface.
#!/bin/python
import serial
from datetime import datetime
import eeml
import eeml.datastream
API_KEY = 'YOUR_COSM_API_KEY'
API_URL = 102285
@tiefpunkt
tiefpunkt / README.md
Created November 14, 2012 19:15
Wrapper shell scripts for iodine