Useful Scripts

Collection of useful scripts for Windows and Linux

ProfessorShroom šŸ„ Scripts

Just a useful collection of scripts for Linux and Windows.

Docker

  • dockerInstallPi.sh - Install Docker on a Raspberry Pi
  • dockerInstallUbuntu.sh - Install Docker on Ubuntu
  • updateDockerContainers.sh - Updates all Docker containers, assuming all are held within the same directory
    For example, if all containers are held within /mnt/docker/ you just add the name of the subfolder
    Change the following line to your Docker directory dockerDir="/path/to/docker/containers" and then input your containers like below
    containers="
    Jellyfin
    Radarr
    SABnzbd
    Sonarr
    "
    

MergerFS

  • mergerFSBalance.sh - Balances my MergerFS volume, but excludes a directory on one of the drives I do not want balanced
    -e /mnt/drive1/Docker/ means that the Docker folder within drive 1 is excluded from the balance process

Metadata

  • removeImgMetadata.sh - Removes metadata from all images
    You set the directory by changing TARGET_DIR="$BASE_DIR/location/of/images"
    Leave $BASE_DIR will run a relative path from the location of the script, removing it will allow you to input an absolute path
    Will install exiftool if not already installed
  • removeImgMetadata.ps1 - Exactly the same as above, but for Windows

Nextcloud

  • nextcloudSync.sh - Runs a two-way Nextcloud sync to a specified location.
    Change WATCH_DIR="/path/to/Nextcloud" to change the location of Nextcloud on the local drive

  • nextcloudService.service - SystemD service file for the above script
    Only errors are logged to avoid clogging up the log file
    Change RequiresMountsFor=/path/to/nextcloud to the drive that the Nextcloud folder is located in
    Change /path/to/nextcloudSync.sh under ExecStart to wherever the script is located
    Change User=user to your username
    Change EnvironmentFile=/home/user/nextcloud.env to the location of your env file

  • nextcloudService.timer - SystemD service timer file for the above script, this is delayed for 2 minutes after booting and will run every 5 minutes unless an instance is already running

  • nextcloud.env - Environment file containing your credentials
    Change REMOTE="https://username:password@nextcloud.domain.com" to suit your username, password (app password if using MFA), and Nextcloud domain
    I’d suggest locking it by running sudo chmod 600 and sudo chown root:root on the file after entering your credentials

Windows

šŸŗ If this project has been helpful and you enjoy what I do and want to support me I would really appriciate it! šŸ”½ Support Me!
Support Me!