Skip to content

Instantly share code, notes, and snippets.

@bfg100k
bfg100k / snapRAID_helper.sh
Last active January 26, 2024 20:22
Bash helper script to help with the automation of routine snapRAID tasks. Add it as a cron job to automate the routine tasks of running sync and scrub. Script will optionally send you email of status and issues encountered during the run.
#!/bin/bash
#######################################################################
# This is a helper script that keeps snapraid parity info in sync with
# your data and optionally verifies the parity info. Here's how it works:
# 1) It first calls diff to figure out if the parity info is out of sync.
# 2) If parity info is out of sync, AND the number of deleted files exceed
# X (configurable), it triggers an alert email and stops. (In case of
# accidental deletions, you have the opportunity to recover them from
# the existing parity info)
# 3) If partiy info is out of sync, AND the number of deleted files exceed X
@bfg100k
bfg100k / wlan5_manager.sh
Last active February 4, 2016 01:26
Ash script to manage the on/off state of the 5GHz band radio based on usage (i.e. devices connected) for Asus routers running custom firmware by Padavan (https://code.google.com/p/rt-n56u/)
#!/bin/bash
# Script to auto start/stop 5GHz wireless radio based on presence of
# certain MAC addresses on the LAN.
# CODITION TO :
# * TURN ON radio - one or more device(s) is/are on LAN
# * TURN OFF radio - ALL devices are _NOT_ on 5GHz band
#
# REQUIRED ENTWARE PACKAGES :
# * wget - Get files over HTTP/S, FTP
#
@bfg100k
bfg100k / lan_monitor.sh
Last active December 20, 2023 04:35
This is a script to check for new devices on the network (regardless of connectivity type. i.e. wired, wireless, vpn). New devices (either new MAC or old MAC with new hostname) joining the network will trigger an email alert to be sent. A simple intrusion detection system for Asus routers running custom firmware by Padavan (https://code.google.c…
#!/bin/bash
# Script to monitor devices on network (regardless of connectivity type.
# i.e. wired, wireless, vpn). New devices (either new MAC or old MAC with
# new hostname) joining the network will trigger an email alert to be sent.
#
# REQUIRED ENTWARE PACKAGES :
# * msmtp - SMTP client to send mail to external email addresses
#
# Author: SidneyC <sidneyc_at_outlook_dot_com>
#