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 / trimShell.java
Created June 10, 2016 09:04
trim a shell variable name to valid characters using java and regex
public class trimShell
{
public static void doShowTrim(String s, String regex) {
System.out.println("in: '"+s+"' out: '" +s.replaceAll(regex,"_").toLowerCase());
}
public static void main (String[] args)
{
String regex = "[^A-Za-z0-9_]";
System.out.println("Regex used: '"+regex+"'");
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 / calcframes.py
Last active April 20, 2017 20:15
c3voc: calculates inframe and outframe number from corresponding timestamps used by shotcut
import datetime, sys
if len(sys.argv) != 3:
print "usage: ", sys.argv[0], "<in> <out>"
exit()
instr="00:01:57.640"
instr=sys.argv[1]
ints=datetime.datetime.strptime(instr, "%H:%M:%S.%f")
@bjoern-r
bjoern-r / racoon-xauth-psk.conf
Last active August 21, 2017 07:54
android vpn ipsec xauth psk
path pre_shared_key "/etc/racoon/psk.txt";
path certificate "/etc/racoon/certs";
timer {
# NOTE: varies between carriers
natt_keepalive 45 sec;
}
listen {
isakmp 78.47.68.26[500];
isakmp_natt 78.47.68.26[4500];
@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
@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 / 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 / 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 / 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 / busybox-static-chroot.md
Last active April 9, 2019 06:30
busybox static chroot

create user

usermod -G chrootlogin joe

add to sshd_config

change file /etc/ssh/sshd_config

Subsystem sftp internal-sftp