This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# run from unraid shell. not inside plex docker. | |
# where do you want to store the script? | |
dst="/mnt/user/media/scripts/plex-nvidia-patch.sh" | |
# download patch source: https://github.com/keylase/nvidia-patch | |
wget https://raw.githubusercontent.com/keylase/nvidia-patch/master/patch.sh -O $dst |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# https://gist.github.com/scrathe | |
# https://www.reddit.com/r/PleX/comments/vcc95i/database_repair_script_for_common_plex_db_errors/ | |
# what is this? performs the steps outlined in Plex's garbage instructions on how to "Manually Repair the Database" https://support.plex.tv/articles/repair-a-corrupted-database/ | |
# notes | |
# although this script will backup your Plex DB, i would suggest making your own backup. | |
# this script assumes you are comfortable with copying/pasting/running random things from the internet. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# what is this? query your Radarr library and make changes via the API. | |
# in this example we query all Radarr entries, identify movies that are named (movie title), THE (year) and update the .path and .folderName to (THE movie title) (year) | |
# after updating Radarr, rename the folders on the filesystem; https://gist.github.com/scrathe/0bedf625916df1a0d070c053c284017d | |
RADARR_API_KEY="1234567890" | |
RADARR_HOST="10.0.0.20" | |
RADARR_PORT="7878" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# what is this? identify movies that are named (movie title), THE (year) and rename to (THE movie title) (year) | |
OLDIFS="$IFS" | |
IFS=$'\n' | |
targetDirectories=$(find . -maxdepth 1 -type d -regextype "posix-extended" -regex '.*\,\s(The|the)\s.*' -print | cut -d/ -f 2) | |
for dir in $targetDirectories; do |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# what is this? poll your UPS using "upsc" and store values using InfluxDB for use with Grafana | |
# unRAID UPS plugin; https://forums.unraid.net/topic/60217-plugin-nut-v2-network-ups-tools/ | |
# unRAID CA User Scripts; plugin https://forums.unraid.net/topic/48286-plugin-ca-user-scripts/ | |
# unRAID User Scripts; add script, custom schedule = */1 * * * * | |
command="upsc ups" | |
influxdb="ups,host=Tower" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# This should always return the name of the docker container running plex - assuming a single plex docker on the system. | |
con="$(docker ps --format "{{.Names}}" | grep -i plex)" | |
echo -n "<b>Applying hardware decode patch... </b>" | |
# Check to see if Plex Transcoder2 Exists first. | |
exists=$(docker exec -i "$con" stat "/usr/lib/plexmediaserver/Plex Transcoder2" >/dev/null 2>&1; echo $?) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# credit; https://forums.unraid.net/topic/69255-cant-access-host-from-docker-container-when-using-br0/?do=findComment&comment=635402 | |
# note: the path to the script must be accessible from within the docker shell | |
# option 1) run from inside the docker shell (do this first to make sure it works) | |
# option 2) run-as unraid user-script scheduled on-first-array-start-only (run once in background to avoid unraid reboot) | |
# nohup docker events --filter "container=plex" | awk '/container start/ { system("docker exec -i plex /bin/bash -c '/media/scripts/docker-plexencode/script'") }' & |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# cronjob to monitor domains for IP changes, and add them to PeerGuardian Linux (pgl) allowlist | |
# https://wiki.archlinux.org/index.php/PeerGuardian_Linux | |
# sudo crontab -e | |
# W="list of domains to be allowed" | |
*/30 * * * * W="site.one site.two site.three" ; for H in $W ; do for H_IP in `dig $H A +short | grep -P "^\d.*"` ; do echo "${H}:${H_IP}-255.255.255.255" | tee -a '/etc/pgl/allow.txt' ; done ; done && sort /etc/pgl/allow.txt | uniq > /etc/pgl/allow.p2p && service pgl reload |