Skip to content

Instantly share code, notes, and snippets.

# OSX > Linux
rsync -avP --iconv=utf-8-mac,utf-8
# Linux > OSX
rsync -avP --iconv=utf-8,utf-8-mac
@8cH9azbsFifZ
8cH9azbsFifZ / garmin_fit_timestamp_16.py
Created November 8, 2019 00:21
Handle timestamp_16 fields in Garmin FIT files
#!/usr/bin/python
from datetime import datetime
import pytz
# https://stackoverflow.com/questions/57774180/how-to-handle-timestamp-16-in-garmin-devices
# http://www.nlvocables.com/blog/?p=969
dt_offset = datetime(2019,4,30,22,0,0,0)
print (dt_offset)
timestamp = int(datetime.timestamp(dt_offset)) - 631065600
@8cH9azbsFifZ
8cH9azbsFifZ / gist:de32eb465c2c684ab5618ba6a747c524
Created August 27, 2019 20:04
Get DUTY_CYCLE on CCU3 using curl
curl -d "<?xml version='1.0'?><methodCall><methodName>listBidcosInterfaces</methodName></methodCall>
" http://localhost:2001/app_rpc 2>/dev/null|sed 's/.*DUTY_CYCLE.*<i4>//;s/<.*//'
@8cH9azbsFifZ
8cH9azbsFifZ / gist:ddc1a366480da6478fda7b3d60f1d406
Created August 3, 2019 20:33
Convert OpenHAB JSON Hue to .things format
/runtime/bin/client things list |grep hue |sed 's/hue:/ /;s/:/ /;s/:/ /;s/(T.*el=//;s/, .*)//'|awk '{print" "$1,$4,"\""$4"\" @ \"\" [ lightId=\""$3"\” ]"}' > conf/things/hue.things
@8cH9azbsFifZ
8cH9azbsFifZ / gist:98e0c4fbd433fc9859949af090d17bee
Created August 3, 2019 16:10
Convert OpenHAB JSON Homematic to .things format
./runtime/bin/client things list |grep homematic|grep -v VIR|grep -v "Type=Bridge"|sed 's/homematic:/ Thing /;s/:/ /;s/ [A-Z0-9]*:/ /;s/(.*Label=/"/;s/,.*/" @ ""/'
@8cH9azbsFifZ
8cH9azbsFifZ / 20190526_HmIP-FCI1_Patch
Created May 26, 2019 19:18
Fix Homematic HmIP-FCI1 Settings
#ssh -lroot homematic-raspi
mount -o remount,rw /
cp /www/config/easymodes/etc/hmipChannelConfigDialogs.tcl /www/config/easymodes/etc/hmipChannelConfigDialogs.tcl.bak
if [ -z "`grep "set eventDelayPrn 0" /www/config/easymodes/etc/hmipChannelConfigDialogs.tcl`" ]; then
sed -i "s/\(set hlpBoxHeight 80\)/\1\n set eventDelayPrn 0/g" /www/config/easymodes/etc/hmipChannelConfigDialogs.tcl
fi
mount -o remount,ro /