Skip to content

Instantly share code, notes, and snippets.

@bdlow
bdlow / do_backup.sh
Last active August 23, 2023 06:36
scripts to initiate a backup from a source Synology NAS
#!/bin/sh
# this script will initiate a backup from a source Synology NAS
# 'challenges'
# - there's no blocking means to run a backup task (i.e. a command to start a
# backup task and not return until it's complete); instead we only have
# asynchronous actions to start a task and then later check state
# - it takes some period of time to actually start the task, i.e. starting a
# backup and immediately checking backup state will likely (incorrectly)
# return "not running"
# - there appears to be no way to actually tell if the backup succeeded or not,
#!/bin/sh
# elementary PTZ control of a Reolink PTZ camera
# example usage: move to position 1 and take a photo:
# ./camctrl.sh -i 192.168.1.99 -p secret -c TOPOS -m 1 -f snap.jpg
# see also https://github.com/fwestenberg/reolink_dev
# alternative approach via ONVIF
# https://github.com/ZoneMinder/zoneminder/blob/master/scripts/ZoneMinder/lib/ZoneMinder/Control/Reolink.pm
# awk -f netstat.awk < /proc/net/tcp
# https://staaldraad.github.io/2017/12/20/netstat-without-netstat/
function hextodec(str,ret,n,i,k,c){
ret = 0
n = length(str)
for (i = 1; i <= n; i++) {
c = tolower(substr(str, i, 1))
k = index("123456789abcdef", c)
ret = ret * 16 + k
}

Keybase proof

I hereby claim:

  • I am bdlow on github.
  • I am benlow (https://keybase.io/benlow) on keybase.
  • I have a public key ASDkltt8Cn-X43Hg5q1wiMJhHaEpVw6OwpU3X7ht5xvS1Qo

To claim this, I am signing this object: