Skip to content

Instantly share code, notes, and snippets.

View rroemhild's full-sized avatar

Rafael Römhild rroemhild

View GitHub Profile
@rroemhild
rroemhild / Door_Window_Sensor.js
Last active August 20, 2019 10:52
LoRaWAN Tabs decoder for The Things Network Console
/**
* 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 / gist:190970
Created September 22, 2009 10:16
simple shell script log function
# Vars for log()
LOGGER="/usr/bin/logger" # Path to logger
FACILITY="LOCAL4" # Syslog facility
PROG="´basename $0´" # Program name
SYSLOG="YES" # Write to Syslog? (YES/NO)
VERBOSE="NO" # Write to STDOUT? (YES/NO)
# Function: log()
# Usage: log priority "message"
log()