Skip to content

Instantly share code, notes, and snippets.

Avatar

Rafael Römhild rroemhild

  • Germany, Hessen, MKK
View GitHub Profile
@rroemhild
rroemhild / Door_Window_Sensor.js
Last active Aug 20, 2019
LoRaWAN Tabs decoder for The Things Network Console
View Door_Window_Sensor.js
/**
* Payload example on port 100: 01FB3700001F0000
**/
function Decoder(bytes, port) {
var decoded = {};
if (port === 100) {
decoded.open = bytes[0] & 0x01;
decoded.voltage = (25 + (bytes[1] & 0xf)) / 10;
@rroemhild
rroemhild / dialup.sh
Last active Apr 15, 2018
congstar wvdial config
View dialup.sh
#!/bin/bash
(
while : ; do
wvdial congstar
sleep 10
done
) &
@rroemhild
rroemhild / errbot.service
Created May 11, 2016
Errbot systemd service
View errbot.service
[Unit]
Description=Errbot
After=network.target
[Service]
Type=forking
User=errbot
Environment="CONFIGFILE=/etc/errbot/config.py"
ExecStart=/usr/local/bin/errbot --daemon --config $CONFIGFILE
ExecStop=/bin/kill -SIGINT $MAINPID
@rroemhild
rroemhild / errbot.init
Created May 11, 2016
Errbot init.d start script
View errbot.init
#!/bin/sh
### BEGIN INIT INFO
# Provides: errbot
# Required-Start: $local_fs $remote_fs $network
# Required-Stop: $remote_fs
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Errbot
### END INIT INFO
View keybase.md

Keybase proof

I hereby claim:

  • I am rroemhild on github.
  • I am rroemhild (https://keybase.io/rroemhild) on keybase.
  • I have a public key ASAYIPva1Txin2wZ5SSoSSdsT6oDD66IZfBUVU6NCKbGwAo

To claim this, I am signing this object:

@rroemhild
rroemhild / is_true.sh
Last active Aug 29, 2015
bash is_true function
View is_true.sh
is_true() {
local var=${1,,}
case $var in
yes|y|true|t|on|1) return 0 ;;
esac
return 1
}
is_true "true"; echo $?
# 0
@rroemhild
rroemhild / htpasswd.py
Last active Jan 4, 2016 — forked from eculver/htpasswd.py
Replacement for htpasswd
View htpasswd.py
#!/usr/bin/env python
"""Replacement for htpasswd"""
# Original author: Eli Carter
import os
import sys
import random
from getpass import getpass
from optparse import OptionParser
@rroemhild
rroemhild / .Xdefaults
Created Jun 22, 2012
Xdefaults solarized
View .Xdefaults
!----------------------------------------------------------
! Xft settings
!----------------------------------------------------------
Xft.dpi: 96
Xft.antialias: true
Xft.rgba: rgb
Xft.hinting: true
Xft.hintstyle: hintslight
View gist:2855383
query_yesno () {
DEFAULT="no"
YES="y"
NO="n"
case $2 in
[Yy]*) YES="Y"
DEFAULT="yes";;
[Nn]*) NO="N"
DEFAULT="no";;
@rroemhild
rroemhild / pymod_test.sh
Created Feb 9, 2010
sample shell script to test python modules
View pymod_test.sh
#!/bin/sh
pymod_test()
{
echo -n "Testing python module $1: "
python -c "import $1" 2> /dev/null
retval=$?
if [ "$retval" -eq "0" ]; then
echo "Ok"
else