From dc56739e94385ec042fa62fb89a9f3d0829a92e9 Mon Sep 17 00:00:00 2001 From: WickedYoda <68271168+wickedyoda@users.noreply.github.com> Date: Sat, 22 Feb 2025 16:36:26 -0600 Subject: [PATCH] fdg --- copy-move-files/Brandons-Minecraft_backup.sh | 28 ++++++ paperless-ngx/paperless-ngx-install.sh | 98 ++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 copy-move-files/Brandons-Minecraft_backup.sh create mode 100644 paperless-ngx/paperless-ngx-install.sh diff --git a/copy-move-files/Brandons-Minecraft_backup.sh b/copy-move-files/Brandons-Minecraft_backup.sh new file mode 100644 index 0000000..27c8adb --- /dev/null +++ b/copy-move-files/Brandons-Minecraft_backup.sh @@ -0,0 +1,28 @@ +@echo off +setlocal + +:: Define Source and Destination +set "SOURCE=C:\Users\yates\AppData\Local\Packages\Microsoft.MinecraftUWP_8wekyb3d8bbwe\LocalState\games\com.mojang" +set "DEST=\\nas\public\game_backups\Minecraft\Brandons-backup" + +:: Map Network Drive +net use Z: \\nas\public /user:traver /persistent:yes + +:: Check if the network drive was successfully mapped +if %ERRORLEVEL% neq 0 ( + echo Failed to connect to NAS. Check network access and credentials. + exit /b 1 +) + +:: Ensure destination exists +if not exist "%DEST%" mkdir "%DEST%" + +:: Run Robocopy to Move Files +robocopy "%SOURCE%" "%DEST%" /z /s /r:2 /w:3 /XD + +:: Unmap Network Drive +net use Z: /delete /yes + +echo Backup completed successfully! +pause +endlocal \ No newline at end of file diff --git a/paperless-ngx/paperless-ngx-install.sh b/paperless-ngx/paperless-ngx-install.sh new file mode 100644 index 0000000..29f3c78 --- /dev/null +++ b/paperless-ngx/paperless-ngx-install.sh @@ -0,0 +1,98 @@ +#!/bin/bash + +# Paperless-NGX Installer for Debian 12 +# This script installs dependencies, configures the environment, and sets up Paperless-NGX. + +set -e + +echo "Updating and installing required dependencies..." +sudo apt update && sudo apt upgrade -y +sudo apt install -y python3 python3-pip python3-dev \ + imagemagick fonts-liberation gnupg libpq-dev \ + default-libmysqlclient-dev pkg-config libmagic-dev \ + libzbar0 poppler-utils unpaper ghostscript \ + icc-profiles-free qpdf liblept5 libxml2 pngquant \ + zlib1g tesseract-ocr build-essential python3-setuptools \ + python3-wheel mariadb-client redis-server + +# Enable Redis and start it +echo "Configuring Redis..." +sudo systemctl enable redis +sudo systemctl start redis + +# Create paperless system user +echo "Creating paperless user..." +sudo adduser paperless --system --home /opt/paperless --group + +# Download and install Paperless-NGX +PAPERLESS_VERSION="v1.10.2" +PAPERLESS_URL="https://github.com/paperless-ngx/paperless-ngx/releases/download/${PAPERLESS_VERSION}/paperless-ngx-${PAPERLESS_VERSION}.tar.xz" + +echo "Downloading Paperless-NGX ${PAPERLESS_VERSION}..." +cd /opt +sudo -u paperless curl -O -L $PAPERLESS_URL +sudo -u paperless tar -xf "paperless-ngx-${PAPERLESS_VERSION}.tar.xz" +sudo mv "paperless-ngx-${PAPERLESS_VERSION}" /opt/paperless + +# Create necessary directories +echo "Creating directories..." +sudo mkdir -p /opt/paperless/media /opt/paperless/data /opt/paperless/consume +sudo chown paperless:paperless /opt/paperless/media /opt/paperless/data /opt/paperless/consume + +# Configure Paperless +echo "Configuring Paperless..." +cat <||' /etc/ImageMagick-6/policy.xml + +# Configure systemd services +echo "Setting up systemd services..." +cat <