Skip to content

Instantly share code, notes, and snippets.

View hkskoglund's full-sized avatar
💭
Hi!

Henning Skoglund hkskoglund

💭
Hi!
View GitHub Profile
@hkskoglund
hkskoglund / gist:1204bf7537f5713f22b28e1a9490e405
Created November 21, 2017 09:41
Filter ping log from DCS-936 camera to CSV-format with timestamp in ms and ping time
cat ~/Nedlastinger/ipcamping.log | tail -n 9600 | cut -d' ' -f 3,10 | cut -b 2-11,25- | tr = , | (IFS=","; while read time ms ; do time=$(( $time * 1000 + 3600000)); echo "$time,$ms"; done) | tee ~/Nedlastinger/filtered.log
@hkskoglund
hkskoglund / sdmotion
Created November 7, 2017 13:49
Motion detection to SD Card log D-link DCS-936L
#!/bin/bash
sdlog | grep -E 'Motion' | tail -n 150 | tac | nl
@hkskoglund
hkskoglund / gist:5a04773b573cc28613b5d35f5e02127c
Created October 14, 2017 08:37
Disable SD recording D-link DCS-936L camera curl command
curl 'http://192.168.0.110/eng/admin/adv_record.cgi' -H 'Cookie: usePath=null' -H 'Origin: http://192.168.0.110' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: nb-NO,en-US;q=0.8,sv-SE;q=0.6,sv;q=0.4,da-DK;q=0.2,da;q=0.2,nb;q=0.2,no;q=0.2,nn;q=0.2,en;q=0.2' -H 'Upgrade-Insecure-Requests: 1' -H 'Authorization: Basic YWRtaW46' -H 'Content-Type: application/x-www-form-urlencoded' -H 'Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8' -H 'User-Agent: Mozilla/5.0 (Windows NT 10.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/61 Safari/537.36' -H 'Cache-Control: max-age=0' -H 'Referer: http://192.168.0.110/eng/admin/adv_record.cgi' -H 'Connection: keep-alive' -H 'DNT: 1' --data 'enable=0' --compressed -s -w "%{http_code}\n" -o /dev/null
@hkskoglund
hkskoglund / checkbattery
Last active December 26, 2020 23:09
bluetooth battery service uuid 0x2A19 polling with gatttool
#!/usr/bin/bash
# prints in CSV format for import into visualization tools
hextodec ()
{
hci_test_device_batterylevel=$((16#$1))
}
if [ -z "$1" ]