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 / pastebinit-startup.sh
Created November 30, 2015 08:06
Start pastebin server
docker run -d --name=pastebinit -e PASTEBINIT_USERNAME=foo -e PASTEBINIT_PASS=aceme -p 8081:8081 bjoern/pastebinit -b http://demo.fiteagle.org:8081/ -p 8081
echo 'for cleanup run: docker exec -it pastebinit sh -c "find /files/ -mtime +10 | xargs echo rm"'
@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 / refresh-ssl-certificates.sh
Created January 8, 2016 09:54
refresh letsencrypt ssl certificates for nginx using docker
#!/bin/sh
set -e
docker pull quay.io/letsencrypt/letsencrypt:latest
docker rm -f letsencrypt || true
for DOMAIN in foobar.de aceme.com ; do
docker run --rm --name letsencrypt \
-v "/data/nginx/static:/webroot" \
-v "/etc/letsencrypt:/etc/letsencrypt" \
@bjoern-r
bjoern-r / docker-cleanup.sh
Created June 8, 2016 08:34
cleanup local docker images
#!/bin/bash
echo "About to remove the following images:"
docker images | awk '/^<none>/ {print}'
echo "press <ctrl+c> to abort! <enter> to continue"
read foo
docker images | awk '/^<none>/ {print $3}' | xargs --no-run-if-empty docker rmi
@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+"'");
@bjoern-r
bjoern-r / Huawei_E3372_openwrt.md
Last active June 4, 2024 20:07
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
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 / 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