Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View bjoern-r's full-sized avatar

Björn bjoern-r

  • Berlin; Germany
View GitHub Profile
@bjoern-r
bjoern-r / create_start_minichroot.sh
Created April 8, 2019 19:45
Script to create a minimal chroot with busybox, dropbear and dtach and allow ssh access on port 5022
#!/bin/bash
CHROOTDIR=/opt/minichroot
mkdir -p ${CHROOTDIR}/bin
mkdir -p ${CHROOTDIR}/lib64
mkdir -p ${CHROOTDIR}/etc/dropbear
mkdir -p ${CHROOTDIR}/dev
mkdir -p ${CHROOTDIR}/tmp
@bjoern-r
bjoern-r / ovpn_route.sh
Created February 21, 2019 11:07
openvpn script to configure routes via different routing table
#!/bin/sh
# add to config
# --route-noexec
# --route-up script.sh
# --route-pre-down script.sh
echo "++++++++++++ $script_type ++++++++++++" | logger -t ovpn_route
#env | tee -a /tmp/vpn
#echo "--------------------------------------" | tee -a /tmp/vpn
@bjoern-r
bjoern-r / bloom.py
Last active January 23, 2019 17:31 — forked from marcan/bloom.py
Simple Bloom filter implementation in Python 3 (for use with the HIBP password list)
#!/usr/bin/python3
#
# Simple Bloom filter implementation in Python 3
# Copyright 2017 Hector Martin "marcan" <marcan@marcan.st>
# Licensed under the terms of the MIT license
#
# Written to be used with the Have I been pwned? password list:
# https://haveibeenpwned.com/passwords
#
# Download the pre-computed filter here (968MB, k=11, false positive p=0.0005):
@bjoern-r
bjoern-r / etc_mosquitto_conf.d_sonoff.conf
Last active October 16, 2021 20:58
sonoff POW into influxdb
#listener 1883 192.168.178.25
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
bjoern-r / sonoff2emoncms.py
Last active December 2, 2018 11:31
sonoff POW MQTT to emoncms publisher
#!/usr/bin/env python
import paho.mqtt.client as mqtt
import json
import time
import requests
nodename="sonoff"
apikey="--xx--"
url="https://emoncms.org/input/post"
@bjoern-r
bjoern-r / randomTrace.md
Last active September 22, 2018 12:49
Random Tracepaces from around the world

From Japan

curl nixda.biz/ip

133.11.240.193

tracepath nixda.biz

 1?: [LOCALHOST]                                         pmtu 1500
 1:  gateway                                               1.652ms 
@bjoern-r
bjoern-r / add_interfaces_dhcp.sh
Created March 8, 2018 17:10
script to configure all unconfigured interfaces for dhcp and bring them up. Ubuntu-16.04
#!/bin/sh
# Author: bri
# Will add all interfaces in state DOWN to /etc/network/interfaces.d/auto.cfg
# with option dhcp
## for iface in `ls /sys/class/net/`; do
/sbin/ip -br l | awk '/DOWN/{print $1}' |
while read dev
do
@bjoern-r
bjoern-r / horizon_simle.py
Last active November 22, 2017 13:52
Host the openstack dashboard horizon using wsgiref.simple_server and werkzeug
import logging
import os
import sys
from django.core.wsgi import get_wsgi_application
from django.conf import settings
from wsgiref.simple_server import make_server
from werkzeug.wsgi import SharedDataMiddleware,DispatcherMiddleware
from werkzeug.exceptions import NotFound
from werkzeug.utils import redirect
docker run -it --name=qt5 -v $(pwd):/quassel ubuntu:14.04
1 apt-get install libssl-dev
2 mkdir qt5
3 cd qt5/
4 apt-key update && apt-get update && apt-get install -y build-essential perl python git
5 cd ..
6 cd qt5/
7 git clone git://code.qt.io/qt/qt5.git
8 cd qt5/
@bjoern-r
bjoern-r / Huawei_E3372_openwrt.md
Last active February 2, 2024 13:34
How to use a Huawei E3372 on OpenWRT

HOWTO use a Huawei E3372 on OpenWRT

This modem is also sold as a MegaFon M150-2 USB dongle

Needed Software

Install the needed packages via opkg tool

opkg update