Skip to content

Instantly share code, notes, and snippets.

View kernelkaribou's full-sized avatar

kernelkaribou

View GitHub Profile
@kernelkaribou
kernelkaribou / rsync_backup.sh
Last active May 1, 2025 14:03
Rsync "Backup" Script
#!/bin/bash
################################################################################
# rsync_backup.sh
#
# Script was created to have a robust, reusable script for rsync operations.
# While not considered a backup, very helpful to make a copy of one or more
# paths to a destination, typically on an automated basis. This will check for
# a .rsync_backup file in the provided destination and will prompt to create if
# does not exist. This is for validating the destination as sync target. Otherwise run
@kernelkaribou
kernelkaribou / gist:2643c7847eb2589fb4b738d973c81536
Last active September 15, 2023 23:56
Technitium DNS ad blocking manager via API
#!/bin/bash
###########################################################
# Purpose: Simple script to enable and disable ad blocking
# for technitium DNS server via API calls
#
# Usage: provide either 'enable' to enable ad blocking
# or 'disable DURATION' to disable
#
# Author: kernelkaribou@github
@kernelkaribou
kernelkaribou / windows_ssh_aliases.ps
Last active June 17, 2023 15:56
Flexible script for ssh aliases in Windows
#################################################################################
# Summary:
# This basic function is for when you have multiple servers you use login
# aliases but would not like to manage adding many aliases, especially when
# consistent with minor changes, like hostname.
#
# Setup:
# This script assumes you are on Windows. Add the below function to your
# powershell profile. This can be easily edited (or created) with the
# command:
@kernelkaribou
kernelkaribou / cloudflare_ddns.sh
Created March 5, 2023 13:26
Simple bash script to update Cloudflare DNS record to represent local public IP i.e. DDNS script
#!/bin/bash
####################################################################################
# Author: Kernelkaribou@github
#
# Purpose: Update a DNS record hosted at Cloudflare to represent network public IP.
# Based upon Cloudflare API v4
#
# In cloudflare, create API key for your zone in question, e.g. example.com
# Ensuring that it has Zone Read and DNS Edit permissions. DO NOT use a Global Key
@kernelkaribou
kernelkaribou / docker_datatabase_backup.sh
Last active June 19, 2022 20:03
Backup of all postgres and mariadb docker containers using native dump methods
#!/bin/bash
######################################################################
# Bash script for backing up varying docker database containers
#
# This will search for containers using common database image names
# Currently supports postgrest and mariadb
# This uses the common pg_dump and mysqldump methods of backup
# It will also gzip the results if the -c flag is passed
# Note: This is built with linuxserver MariaDB container but should
@kernelkaribou
kernelkaribou / pihole_sync.sh
Last active June 17, 2022 18:32
Pihole Instance Sync
#!/bin/bash
######################################################################
# Bash script for syncing pihole servers to a secondary
#
# This tool will allow you sync common pihole settings, either
# full server (DNS Records and Gravity DB for adlists) or select
# specific syncs to perform. It does NOT sync the core config settings
# of the instance found in setupVars.conf
#
@kernelkaribou
kernelkaribou / cloudflare_dyndns_synology
Last active May 14, 2024 21:31
Used to regularly update a Cloudflare DNS record from your Synology NAS.
#!/bin/bash
####################################################################################
# Author: Kernelkaribou@github
#
# Purpose: Update a DNS record hosted at Cloudflare to represent network public IP.
# Based upon Cloudflare API v4
#
# Additional Notes: This will send notifications to Synology log center.
# Comment out writeLog lines if not desired or on Synology platform
@kernelkaribou
kernelkaribou / datatype.py
Last active August 31, 2017 17:28 — forked from cbattlegear/bandwidth.py
Quick Bandwidth Format function
#Formatting of data sent in bytes to label in largest size
def format_data_type(i, type):
loop = 0
current_num = i
last_num = 0
if type == "net":
label = ["Bps", "KBps", "MBps", "GBps"]
if type == "size":
label = ["B", "KB", "MB", "GB", "TB"]
while(True):