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 / rename_pictures.sh
Last active January 1, 2016 04:49
rename pictures and movies according the exif or file timestamp
## resulting filename 20121018-102347-IMG_4743.jpg
## rename pictures
jhead -n%Y%m%d-%H%M%S-%f *.JPG | tee rename.log
## create restore script
awk '{ print "mv " $3 " " $1 }' rename.log >rename_undo.sh
## rename movies
stat -t"%Y%m%d-%H%M%S" *.MOV | awk '{ print "echo mv " $16 " " $10"-"$16 }' | sh | tee rename-mov.log | sh -x
@bjoern-r
bjoern-r / remote.xml
Created May 13, 2014 21:03
XBMC CEC Remote mappings for LG DTV LE2600
<!-- xbmc Remote -->
<keymap>
<global>
<remote>
<skipminus>back</skipminus>
<skipplus>ContextMenu</skipplus>
<!--stop>XBMC.ActivateWindow(Home)</stop-->
<pause>FullScreen</pause>
</remote>
</global>
@bjoern-r
bjoern-r / com.c
Last active January 22, 2020 00:36
very simple serial terminal
/*
* Building: cc -o com com.c
* Usage : ./com /dev/device [speed]
* Example : ./com /dev/ttyS0 [115200]
* Keys : Ctrl-A - exit, Ctrl-X - display control lines status
* Darcs : darcs get http://tinyserial.sf.net/
* Homepage: http://tinyserial.sourceforge.net
* Version : 2007-07-31
*
* Ivan Tikhonov, http://www.brokestream.com, kefeer@brokestream.com
@bjoern-r
bjoern-r / netatalk.conf
Created June 22, 2014 19:26
netatalk 3.x upstart script (/etc/init/netatalk.conf)
description "netatalk afp Server"
author "Bjoern Riemer <bjoern.riemer-ät-web.de>"
start on (local-filesystems and net-device-up and started avahi-daemon)
#start on runlevel [2345]
stop on runlevel [!2345]
respawn
expect daemon
@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];
git clone qt
git checkout stable
perl init-repository -no-webkit
./configure -opensource -confirm-license -no-accessibility -qt-sql-sqlite -qt-zlib -no-gif -no-libpng -no-libjpeg -nomake examples -no-gui -nomake tools -no-opengl -no-sm -no-xshape -no-xinerama -no-xcursor -no-xfixes -no-xrandr -no-xrender -no-fontconfig -no-xkb -no-glib -openssl-linked -no-dbus -static -prefix /opt/Qt-5.3.1-static -no-xcb -no-eglfs -no-kms -no-directfb -no-linuxfb -no-cups -no-iconv -no-alsa
make -j 4
cd qtbase
make install
cd ../qtscript
make -j 4
@bjoern-r
bjoern-r / hexdump_bytes.c
Created October 13, 2014 10:28
simple hexdump function borrowed from (boundarydevices/imx_usb_loader)
#include <stdio.h>
void hexdump_bytes(unsigned char *src, unsigned cnt, unsigned addr)
{
unsigned char *p = src;
int i;
while (cnt >= 16) {
printf("%08x: %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x %02x\n", addr,
p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], p[8], p[9], p[10], p[11], p[12], p[13], p[14], p[15]);
p += 16;
@bjoern-r
bjoern-r / hex2bin.py
Created November 2, 2014 11:45
convert hex to binary in python.
#copied from http://ctfcrew.org/writeup/90
f = open('openwrt-wrtsl54gs-squashfs.hex', 'r')
w = open('openwrt-wrtsl54gs-squashfs.bin', 'wb')
lines = f.readlines()
for l in lines:
w.write(l.strip('\n').decode('hex'))
w.close()
@bjoern-r
bjoern-r / xmlrpc-client.sh
Last active March 5, 2023 06:16
simple shell xmlrpc client that uses bash & curl
#!/bin/bash
# author jiyin@redhat.com
TEMP=`getopt -o vt: --long target -n 'example.bash' -- "$@"`
if [ $? != 0 ] ; then echo "getopt fail, terminating..." >&2 ; exit 1 ; fi
# Note the quotes around `$TEMP': they are essential!
eval set -- "$TEMP"
Usage() {
@bjoern-r
bjoern-r / gist:4cabe21a4610f9e01073
Created July 28, 2015 14:19
docker visualstudio
sudo docker run --rm -it --env=XAUTHORITY=/tmp/.docker.xauth -v /tmp/.docker.xauth:/tmp/.docker.xauth -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY --device /dev/dri --name visualstudio jess/visualstudio