Skip to content

Instantly share code, notes, and snippets.

View toke's full-sized avatar

Thomas Kerpe toke

View GitHub Profile
@toke
toke / mqtt2sense.sh
Last active September 10, 2015 08:45
Hacky mqtt2opensensemap bash script for http://opensensemap.org Subscribes to MQTT Topics and publishes data to opensensemap.
#!/bin/bash
#####################################################################################
# mqtt2sense - Publish mqtt-topics to opensensemap.org or compatible server
# Toke 2015
# Public Domain - no rights reserved
#####################################################################################
CURL="/usr/bin/curl"
MOSQUITTO="/usr/bin/mosquitto_sub"

Reverse proxy over 3G modem (draft)

We will explain how to configure a cubieboard running debian as a reverese proxy. The modules that will be used are wvdial and autossh

Credits goes to:

1. http://blog.rootshell.be/2015/02/19/my-little-pwnie-box/
2. https://wiki.archlinux.org/index.php/3G_and_GPRS_modems_with_pppd
@toke
toke / programmers.txt
Created April 26, 2015 15:25
AVR JTAGICE MKII programmers.txt entry for Arduino IDE 1.6
## JTAGICE MK II
jtag2isp.name=JTAGICE MkII ISP
jtag2isp.communication=usb
jtag2isp.protocol=jtag2isp
jtag2isp.program.tool=avrdude
jtag2isp.program.protocol=stk500v2
jtag2isp.speed=115200
jtag2isp.program.extra_params=-Pusb
@toke
toke / nginx_auth.conf
Last active August 29, 2015 14:16
Ngninx Proxy Auth
Server {
location / {
auth_basic "closed site";
auth_basic_user_file conf/htpasswd;
}
location /b {
allow 192.168.1.1/24;

CVS2GIT

export REPOPATH="abc/production_ng"
export REPONAME="cvsmigration"
mkdir cvs-migration
cd cvs-migration
mkdir cvs2svn-tmp

cvs2git \
@toke
toke / short-git-rev.md
Last active August 29, 2015 14:16
Print short git rev

Short Git-REV:

REV=$(git rev-parse HEAD)
echo ${REV::7}

or the correct way ;-) :

@toke
toke / advisory_locks_example.sql
Last active January 18, 2022 21:32
Example for advisory locks in postgresql
do $$
DECLARE
ADV_LOCK BOOLEAN DEFAULT FALSE;
LOCK_ID INTEGER DEFAULT 50;
BEGIN
-- EARLY LOCK
-- LOCK_ID := 'tablename'::regclass::integer;
SELECT pg_try_advisory_lock(LOCK_ID) into ADV_LOCK;
RAISE NOTICE 'LOCK_ID: %', LOCK_ID;
IF ADV_LOCK THEN
@toke
toke / route.txt
Last active August 29, 2015 14:07
Routing via se?
Tracing route to toke.de [2a01:4f8:100:14a5::3]
over a maximum of 30 hops:
1 1 ms <1 ms <1 ms 2002:5b59:128c:fc:xxxx:xxxx:xxxx:xxxx
2 1 ms <1 ms <1 ms 2002:5b59:128c:0:xxxx:xxxx:xxxx:xxxx
3 * * * Request timed out.
4 58 ms * 67 ms gi8-47.se.sto.dch.dr1.port80.se [2001:16d8:1:6240::1]
5 45 ms 51 ms 43 ms ae1-u1301.se.sto.dch.cr1.port80.se [2001:16d8:1:1354::95]
6 * 56 ms 53 ms Tengi4-2.se.mlm.wtc.cr0.port80.se [2001:16d8:1:1371::1]
7 64 ms 47 ms * decix-gw.hetzner.de [2001:7f8::616c:0:1]
@toke
toke / mebus-433sensor.md
Last active August 29, 2015 14:06
Being sick at home on a saturday afternoon and some time to spare? Lets make sense out of bleeps....

Analyzing the Mebus Wireless Sensor

I have a Mebus Weather station from a discounter in my kitchen and an wireless sensor outside the kitchen window. It operates at 433.92MHz and it's blips and bits are not yet analyzed (at least by me). So lets try to read it.

I will use my crappy rtl2832 DVB Dongle (Rafael Micro R820T) for that. I'd buyed it some time ago for 1€. I'ts a little bit whiny about everything. Touch it – määää. Use it without an Powered HUB wäääää. But even that crappy thing is useful ;-)

I have some clue what to expect, so I don't start at zero. I assume the data is modulated as OOK. (On Off Keying) and I have an progam rtl_443 which can help me decode it.

@toke
toke / README.md
Last active July 3, 2020 00:36
K.R.A.U.S. in C

K.R.A.U.S. in pure C

Abstract

This is a C fork of the famous K.R.A.U.S. (floor of the day) application by @jautz written in perl. The acronym K.R.A.U.S. stands for the German phrase "Kaffee-Runde auf unterschiedlichen Stockwerken". It's origin lies far in the beginning of civilisation and was once called Tempus clausum.

Since being independent of a single implementation is cruical for live threatening services this fork has been established.