Skip to content

Instantly share code, notes, and snippets.

bjoern-r /
Last active Oct 20, 2020 — forked from rectalogic/
Parse spis and keys from "ip xfrm state" output and generate a Wireshark ESP decryption config that can decrypt an ESP capture.
#!/usr/bin/env python
Runs "ip xfrm state" and outputs lines to be added to ~/.wireshark/esp_sa
This process must be run using sudo.
This allows Wireshark to decrypt ipsec traffic captured with 'sudo tcpdump -vni any -U -w /tmp/esp.pcap "ip proto 50"'
import sys
import subprocess
bjoern-r / BatteryVoltageGuard.ino
Created Apr 14, 2020
Simple Arduino sketch to control a relais to switch a relais if the voltage read from the adc is below a certain level
View BatteryVoltageGuard.ino
Battery Guard
Use an arduino nano and connect the input voltage with an voltage divider to A0
I used 9kOhm and 1kOhm to get a /10 divider to be able to measure up to 50V
Switch points are for a 12v AGM battery.
The relais is controlled via D7.
#define NUM_READINGS 10
#define RELAIS_PIN 7
#define ADC_REF 5.0
bjoern-r /
Last active Nov 2, 2019
CodiMD docker with Oauth2 via

CodeiMD authentication via Oauth2 with django-oidc-provider

install django-oidc-provider

create application in django-oidc-provider

Configure allowed callback urls:

Configure scopes:

bjoern-r /
Last active Apr 9, 2019
busybox static chroot

create user

usermod -G chrootlogin joe

add to sshd_config

change file /etc/ssh/sshd_config

Subsystem     sftp   internal-sftp
bjoern-r /
Created Apr 8, 2019
Script to create a minimal chroot with busybox, dropbear and dtach and allow ssh access on port 5022
mkdir -p ${CHROOTDIR}/bin
mkdir -p ${CHROOTDIR}/lib64
mkdir -p ${CHROOTDIR}/etc/dropbear
mkdir -p ${CHROOTDIR}/dev
mkdir -p ${CHROOTDIR}/tmp
bjoern-r /
Created Feb 21, 2019
openvpn script to configure routes via different routing table
# add to config
# --route-noexec
# --route-up
# --route-pre-down
echo "++++++++++++ $script_type ++++++++++++" | logger -t ovpn_route
#env | tee -a /tmp/vpn
#echo "--------------------------------------" | tee -a /tmp/vpn
bjoern-r /
Last active Jan 23, 2019 — forked from marcan/
Simple Bloom filter implementation in Python 3 (for use with the HIBP password list)
# Simple Bloom filter implementation in Python 3
# Copyright 2017 Hector Martin "marcan" <>
# Licensed under the terms of the MIT license
# Written to be used with the Have I been pwned? password list:
# Download the pre-computed filter here (968MB, k=11, false positive p=0.0005):
View etc_mosquitto_conf.d_sonoff.conf
#listener 1883
listener 1883
log_dest syslog
log_dest stdout
log_dest topic
log_type error
log_type warning
log_type notice
log_type information
connection_messages true
bjoern-r /
Last active Dec 2, 2018
sonoff POW MQTT to emoncms publisher
#!/usr/bin/env python
import paho.mqtt.client as mqtt
import json
import time
import requests
bjoern-r /
Last active Sep 22, 2018
Random Tracepaces from around the world

From Japan



 1?: [LOCALHOST]                                         pmtu 1500
 1:  gateway                                               1.652ms