Skip to content

Instantly share code, notes, and snippets.

@ManningWorks
ManningWorks / telegram_notification.sh
Last active December 11, 2022 12:15
A small bash script for sending myself notifications from unRAID
#!/bin/bash
TOKEN=XXX
CHAT_ID=XXX
URL="https://api.telegram.org/bot$TOKEN/sendMessage"
LIMIT=95
CACHE_LIMIT=60
#Checks how much space% is consumed on the array
ARRAY_USED_PERCENT=`df -h /mnt/user | awk '{print $5}' | sed -ne 2p | cut -d'%' -f1`
#Checks how much available space there is in GB
@ManningWorks
ManningWorks / Check_unlinked_downloads.sh
Last active March 31, 2020 23:25
Check for unlinked downloads
#!/bin/bash
# A simple shell script to check if all my downloaded items have a hardlink associated with them
# The result will be all *.mkv items that do not have more than 1 file linked to this inode
# This is primarily used in Conjunction with Sonarr and Radarr for downloaded item handling
UNLINKED_DOWNLOADS=`find /mnt/user/Media/downloads/ -type f -links 1 -iname *.mkv`
[ -z "$UNLINKED_DOWNLOADS" ] && echo "All good" || echo "$UNLINKED_DOWNLOADS
To delete all files:
find /mnt/user/Media/downloads/ -type f -links 1 -iname *.mkv -exec rm -i {} \;"
@ManningWorks
ManningWorks / check_docker_status.sh
Created March 31, 2020 23:29
Check status of Docker and attempt to restart the service it's stopped. If something goes wrong it will notify Telegram.
#!/bin/bash
# A simple bash script to check the current status of my Docker service
# If the 'rc.docker status' command returns anything other than "running" a message is sent to my Telegram bot
# The script will attempt to restart Docker and send the result to Telegram
TOKEN=""
CHAT_ID=""
URL="https://api.telegram.org/bot$TOKEN/sendMessage"
DOCKER_STATUS_FULL="$(/etc/rc.d/rc.docker status)"
@ManningWorks
ManningWorks / Set-ChromeDefaultProfile.ps1
Last active March 20, 2026 23:40
Promotes any Chrome profile folder to Default by syncing both the filesystem and Local State in one shot, with full undo support.
# Set-ChromeDefaultProfile.ps1
# Promotes any Chrome profile folder to Default by syncing both the filesystem
# and Local State in one shot.
#
# Usage:
# .\Set-ChromeDefaultProfile.ps1 -TargetProfile "Profile 2"
# .\Set-ChromeDefaultProfile.ps1 -TargetProfile "Profile 2" -UserDataPath "C:\Custom\Chrome\User Data"
#
# Parameters:
# -TargetProfile The profile folder name you want to promote to Default (required)
@ManningWorks
ManningWorks / fix_docker_labels.sh
Created March 26, 2026 00:21
Fix Unraid 3rd Party Docker Containers using runlike
#!/bin/bash
# Script to add net.unraid.docker.managed=dockerman label to all containers
echo "=== Unraid Docker Label Fixer ==="
echo ""
echo "This script will add the dockerman label to all containers."
echo "After running this, you'll need to Force Update each container in Unraid UI."
echo ""