Skip to content

Instantly share code, notes, and snippets.

{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": "-- Grafana --",
"enable": true,
"hide": true,
"iconColor": "rgba(0, 211, 255, 1)",
"name": "Annotations & Alerts",
@bdwilson
bdwilson / flows.json
Created January 9, 2021 19:47
Hubitat Performance Node-red Node - requires influxdb node, pushover node, note at top of flow has config instructions.
[
{
"id": "43ac6c1.6e31c94",
"type": "subflow",
"name": "Check Mem",
"info": "",
"category": "",
"in": [
{
"x": 50,
@bdwilson
bdwilson / snapshot.php
Created August 11, 2019 18:58
Hikvision Camera Snapshot Auth Proxy
<?php
# Hikvision Snapshot Proxy - authenticates session via GET request to retrieve
# a snapshot from an internal camera (not open to the Internet)
#
# https://yourserver/snapshot.php?auth=abcd1234&snapshot=2
# https://yourserver/snapshot.php?auth=abcd1234&snapshot=1
#
$password = "abcd1234";
$user = "user"; # of your camera
$pass = "password"; # of your camera
@bdwilson
bdwilson / nextdns-trace.log
Created August 9, 2020 16:51
nextdns stack trace
# nextdns trace
goroutine 26465 [running]:
main.run.func4(0x0, 0x0, 0xc0003e26d0, 0x5)
/home/runner/work/nextdns/nextdns/run.go:177 +0x80
github.com/nextdns/nextdns/ctl.(*Server).handle(0xc0000ce070, 0x55f000, 0xc00010c000, 0xc0003e26d0, 0x5, 0x0, 0x0, 0x0)
/home/runner/work/nextdns/nextdns/ctl/server.go:125 +0x140
github.com/nextdns/nextdns/ctl.(*Server).handleEvents(0xc0000ce070, 0x55f000, 0xc00010c000)
/home/runner/work/nextdns/nextdns/ctl/server.go:114 +0x154
created by github.com/nextdns/nextdns/ctl.(*Server).run
@bdwilson
bdwilson / flows.json
Last active July 13, 2020 23:21
Hubitat Node-Red Presence Flow
[
{
"id": "866a2010.a3d2f",
"type": "tab",
"label": "Hubitat Presence",
"disabled": false,
"info": ""
},
{
"id": "66b577d7.f56b48",
@bdwilson
bdwilson / hubitat_backup.sh
Last active June 4, 2020 14:41
Hubitat Backup (to be run on a Linux/Rpi)
#!/bin/bash
#
# Code borrowed from https://community.hubitat.com/t/solved-downloading-latest-backup-file/18065/5
#
IP=$1
DIR="$2"
if [ $# -eq 0 ]; then
@bdwilson
bdwilson / backup.sh
Last active May 31, 2020 21:38
vnstat configuration for Ubiquiti EdgeOS Edgerouter; these files are stored in /config/vnstat. Based on this (https://snippets.khromov.se/vnstat-on-edgerouter-historical-bandwidth-monitoring-and-graphical-dashboard-tutorial/) however the scripts below store the data in memory and only back them up nightly (to save on flash writes)
cp -Rp /var/log/vnstat /config
@bdwilson
bdwilson / backup_hubitat.sh
Created March 21, 2020 00:20
Backup hubitat device using last backup file created.
#!/bin/bash
#
# Code borrowed from https://community.hubitat.com/t/solved-downloading-latest-backup-file/18065/5
#
IP=$1
DIR="$2"
if [ $# -eq 0 ]; then
echo "Usage: $0 <IP Address> <Path to store backup>"
else
@bdwilson
bdwilson / wyze.conf
Created January 23, 2020 00:49
monit configuration file to only stream Wyze cam v2 if the camera is powered on. installed in /etc/monit/conf.d/
check host wyze-camera address 192.168.1.42
if failed icmp type echo
count 3 with timeout 5 seconds
2 times within 3 cycles
then exec "/etc/monit/stop_ffmpeg.sh"
else if succeeded for 2 cycles then exec "/etc/monit/start_ffmpeg.sh"
@bdwilson
bdwilson / stop_ffmpeg.sh
Created January 23, 2020 00:47
monit script to stop ffmpeg only when Wyze Cam V2 is on
#!/bin/sh
/usr/bin/screen -XS ffmpeg quit