Skip to content

Instantly share code, notes, and snippets.

View 007revad's full-sized avatar

Dave Russell 007revad

  • Australia
  • 07:12 (UTC +10:00)
View GitHub Profile
@007revad
007revad / gitpybackup.py
Created October 7, 2023 09:13 — forked from jarrodnorwell/gitpybackup.py
Backup `repo_count` of public repositories for username`
#
# main.py
# GitPyBackup
#
# Created by Jarrod Norwell on 07/10/2023.
#
"""
Because the user specified only has 40~ repositories I've made this as basic as possible,
just change the username and repo_count to get started, it'll download all repos into the cwd
@007revad
007revad / autorun.sh
Created August 26, 2023 05:05 — forked from Jip-Hop/autorun.sh
Autorun Synology Hyper Backup and Integrity Check with Email Notifications
#!/bin/sh
# This script is to be used in combination with Synology Autorun:
# - https://github.com/reidemei/synology-autorun
# - https://github.com/Jip-Hop/synology-autorun
#
# You need to change the task_id to match your Hyper Backup task.
# Get it with command: more /usr/syno/etc/synobackup.conf
#
# I like to keep "Beep at start and end" disabled in Autorun, because I don't
@007revad
007revad / synology-shutdown-temperature.md
Created May 7, 2023 05:55 — forked from borekb/synology-shutdown-temperature.md
How to increase the shutdown temperature on Synology NAS

Synology: how to increase shutdown temperature

My Synology DS218+ runs with a single SSD disk that has an operating temperature range of 0–70 °C, which is common for SSDs. Synology, however, has a default shutdown temperature of 61 °C, probably due to HDDs and some lazy programming.

I'm a very light user of NAS – all I want is a network attached storage and silence. My DS218+ has one 2 TB SSD disk in it and I've changed the system fan for a quieter / slower one.

Everything runs fine but about once in a month, I get this notification:

[Synology DS218+]Synology shut down due to disk overheating. >

#!/usr/bin/env bash
# shellcheck disable=SC1083,SC2054,SC2121,SC2207
if [[ $1 == "--debug" ]]; then
set -x
export PS4='`[[ $? == 0 ]] || echo "\e[1;31;40m($?)\e[m\n "`:.$LINENO:'
fi
getdriveinfo() {
#!/usr/bin/env bash
# Get Synology model reliably
unique=$(get_key_value /etc/synoinfo.conf unique | cut -d'_' -f3) # returns 213+
echo "unique: $unique"
model=$(cat /proc/sys/kernel/syno_hw_version) # returns DS213pv10-j
echo "model: $model"
@007revad
007revad / install.sh
Last active February 10, 2023 01:16
Script to install my other scripts
#!/usr/bin/env bash
# shellcheck disable=SC2016,SC2012
Script=Script_Name
bin=bin
config=bin/config
# TODO
@007revad
007revad / edit_preferences_xml.sh
Last active January 24, 2023 06:57
Bash script to test replacing Machine IDs in Plex's Preferences.xml from a backup Preferences.xml
#!/usr/bin/env bash
#-------------------------------------------------------------------------
# https://gist.github.com/007revad
# Script verified at https://www.shellcheck.net/
#--------------------------------------------------------------------------
# Note: The echo lines are just for verifying it's doing what it should
#--------------------------------------------------------------------------
path="~/plex_sync_test"
path_bak="~/plex_sync_bak_test"
@007revad
007revad / docker-autocompose.sh
Last active January 8, 2023 22:11
A script to run docker-autocompose then move the .yml files to a specified folder.
#!/usr/bin/env sh
#--------------------------------------------------------------------------------------
# A script to create docker-compose.yml files from running docker containers.
#
# Script can be run with a container name parameter to only process that container:
# sudo -s docker-autocompose.sh plex
#
# Or with no parameter, or the "all" parameter, to process all running containers:
# sudo -s docker-autocompose.sh all
#
@007revad
007revad / hdd_writecache.sh
Last active January 30, 2023 21:13
Enable, disable or show current HDDs' write cache setting.
#!/usr/bin/env bash
#-----------------------------------------------------------
# Enable, disable or show current HDDs' write cache setting
# https://gist.github.com/007revad
#
# Run in a shell with:
# sudo hdd_writecache.sh
#-----------------------------------------------------------
# If Linux has more than 26 HDDs it names the extra ones sdaa, sdab, sdac etc
@007revad
007revad / subs_tv.sh
Last active November 26, 2022 01:46
Rename subs in season downloads and move up to the season's mkv/mp4 folder
#!/usr/bin/env bash
#--------------------------------------------------------------------------------------------
# Rename English subtitles in TV season's Subs folder and move up to season's mkv/mp4 folder
#
# Author: 007revad
# Gist on Github: https://gist.github.com/007revad
# Script verified at https://www.shellcheck.net/
#--------------------------------------------------------------------------------------------
if [[ -n $1 ]] && [[ -d $1 ]]; then