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 / 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: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 / gist:a17ce1c1d79abc176c50d040b3cb1042
Created November 21, 2017 09:42
Create ping log from camera DCS-936L
ping -i 5 -D 192.168.0.110 | while read pong; do if [[ $pong != *"PING"* ]]; then echo "$(date +'%F %T'): $pong" | tee -a ~/Nedlastinger/ipcamping.log ; fi; done
@hkskoglund
hkskoglund / gist:ece519552967e932963981d34568a18d
Created November 24, 2017 06:56
Reboot DCS-936L camera curl
curl --anyauth -v 'http://192.168.0.110/eng/admin/reboot.cgi' -H 'Referer: http://192.168.0.110/eng/admin/tools_default.cgi' --data 'reboot=true' --compressed
@hkskoglund
hkskoglund / gist:af5adb82df36ecf6d1d0cd233e267bd3
Created December 20, 2017 15:27
Get root folderstring DCS-936L camera
curl --anyauth -u admin: 'http://192.168.0.110/eng/admin/adv_sdcard.cgi?folderpath=&command=video' -s -e 'http://192.168.0.110/eng/admin/adv_sdcard.cgi?folderpath=20171220&command=video&filesperpage=100' | grep folderstring | cut -d ">" -f 2 | cut -d "<" -f 1
@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 / gist:b0e6408b8e068f4d6891d7dda27551bf
Created September 14, 2018 11:34
Moving flight record slider back and forth leads to out of memory (see RSS) -DJI GO v 4.3.0
while sleep 1; do adb shell ps -p $(adb shell pgrep dji | head -n 1) -T; done
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a200 27682 27682 763 2506844 730904 0 0 S dji.go.v4
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a200 27682 27682 763 2506844 730908 0 0 S dji.go.v4
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a200 27682 27682 763 2506844 731176 0 0 S dji.go.v4
USER PID TID PPID VSZ RSS WCHAN ADDR S CMD
u0_a200 27682 27682 763 2506844 731692 0 0 S dji.go.v4
@hkskoglund
hkskoglund / gist:9fdcfe89b562295b92f33c5757c402da
Created September 23, 2018 06:42
DJI GO Android v4.3.0 - signed out of app resource use
I signed out of the app to see the resource utilization.
Why is SwUdpService and timer-0..4 + amapLocCoreThre running when signed out of app?
Why is two location listeners active (1m and 900ms) ?
Every 5,0s: adb shell dumpsys cpuinfo | grep -A20 dji.go satellite: Sun Sep 23 08:38:33 2018
3.9% 31624/dji.go.v4: 2.4% user + 1.4% kernel / faults: 4838 minor
@hkskoglund
hkskoglund / gist:970e5612f7a98bbfb5893651292374bf
Created September 24, 2018 07:44
DJI GO v4.3.0 Android - Explicit concurrent copying GC - is it necessary?
09-24 09:39:59.085 11279 11279 I DJILocationManager: Attempting to get last known location from default providers...
09-24 09:39:59.980 11279 11422 I zygote : Explicit concurrent copying GC freed 4979(320KB) AllocSpace objects, 1(20KB) LOS objects, 50% free, 17MB/35MB, paused 1.854ms total 277.349ms
09-24 09:40:00.847 11279 11348 E getNetworkObject: network type:1
09-24 09:40:00.853 11279 11348 E SwUdpService: SwUdpConnect ...result=1
09-24 09:40:01.196 11279 11279 I DJILocationManager: Attempting to get last known location from default providers...
09-24 09:40:02.706 11279 11422 I zygote : Explicit concurrent copying GC freed 6591(655KB) AllocSpace objects, 1(20KB) LOS objects, 49% free, 17MB/35MB, paused 2.517ms total 276.893ms
09-24 09:40:02.932 11279 11348 E getNetworkObject: network type:1
09-24 09:40:02.934 11279 11348 E SwUdpService: SwUdpConnect ...result=1
09-24 09:40:03.198 11279 11279 I DJILocationManager: Attempting to get last known location from default providers...
09-24 09:40:04.945 11279 11
@hkskoglund
hkskoglund / gist:cb60fb454ecb27951f4e4bea339f1f83
Created September 25, 2018 07:09
DJI GO Android app v4.3.0
Testing DJILocationManager (has GPS sensor enabled all the time...)
[henning@satellite ~]$ adb -e logcat --pid=$(adb shell pidof dji.go.v4) | grep -i DJILoc
09-25 09:04:03.692 516 722 I DJILocationManager: Attempting to get last known location from AMap Service Location Provider...
09-25 09:04:03.692 516 722 I DJILocationManager: AMapServiceLocationProvider: getSourceProvider()
09-25 09:04:03.734 516 722 I DJILocationManager: Attempting to get last known location from default providers...
09-25 09:04:03.783 516 516 I DJILocationManager: Configuration requires not to use Google Play Service, so skipping that step to AMap Service Location Provider
09-25 09:04:03.783 516 516 I DJILocationManager: Attempting to get location from AMap Service Location Provider...
09-25 09:04:03.783 516 516 I DJILocationManager: AMapServiceLocationProvider: getSourceProvider()
09-25 09:04:03.911 516 516 I DJILocationManager: Configuration requires not to use Google Play Service, so skipping that step to