namo amida butsu

This commit is contained in:
2025-09-21 18:54:38 +05:30
commit 2e36a3ecab
7 changed files with 474 additions and 0 deletions

147
bind-machine-spirits.sh Executable file
View File

@@ -0,0 +1,147 @@
#!/bin/bash
# Sacred Drive Mounting Ritual for the Raspberry Pi Shrine
# May the Omnissiah bless this automaton script
# For the Emperor and the Machine God!
echo "=========================================="
echo " SACRED DRIVE MOUNTING RITUAL INITIATED "
echo " In the name of the Omnissiah we bind "
echo " the Machine Spirits to our will "
echo "=========================================="
echo
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "ERROR: This sacred ritual requires root privileges!"
echo "Execute with: sudo bash bind-machine-spirits.sh"
exit 1
fi
echo "🔱 Phase 1: Invoking the Machine Spirit's blessing..."
sleep 1
# Install NTFS support if not present
echo "📦 Ensuring NTFS-3G drivers are blessed by the Omnissiah..."
apt update -qq
apt install -y ntfs-3g
echo "🛠️ Phase 2: Creating sacred mount points..."
# Create mount directories
mkdir -p /mnt/omnissiah-vault
mkdir -p /mnt/machine-spirit
# Set proper ownership
chown $AETOS_UID:$AETOS_GID /mnt/omnissiah-vault
chown $AETOS_UID:$AETOS_GID /mnt/machine-spirit
echo "✅ Sacred directories created:"
echo " 🗂️ /mnt/omnissiah-vault (for the great data hoard)"
echo " 🧠 /mnt/machine-spirit (for system consciousness)"
echo
echo "💾 Phase 3: Backing up the sacred fstab codex..."
# Backup fstab
cp /etc/fstab /etc/fstab.backup.$(date +%Y%m%d_%H%M%S)
echo "✅ Backup created: /etc/fstab.backup.$(date +%Y%m%d_%H%M%S)"
echo
echo "📜 Phase 4: Inscribing the binding runes into fstab..."
# Get dynamic values blessed by the Omnissiah
AETOS_UID=$(id -u aetos)
AETOS_GID=$(id -g aetos)
echo "🔍 Divine revelation of user identities:"
echo " aetos UID: $AETOS_UID"
echo " aetos GID: $AETOS_GID"
# Check if entries already exist
if grep -q "omnissiah-vault\|machine-spirit" /etc/fstab; then
echo "⚠️ WARNING: Sacred bindings already detected in fstab!"
echo " Skipping fstab modification to prevent corruption..."
else
# Add mount entries to fstab
cat >> /etc/fstab << EOF
# Sacred Drive Bindings - Blessed by the Omnissiah
# 7.3TB Omnissiah's Vault - Mass Storage for Movies & Media (sda2)
UUID=C678E33A78E3283F /mnt/omnissiah-vault ntfs-3g defaults,nofail,uid=${AETOS_UID},gid=${AETOS_GID},umask=022,x-systemd.automount,x-systemd.device-timeout=30s 0 0
# 931.5GB Machine Spirit - System Data, Configs, DB & Metadata (sdb3)
UUID=203E29533E292370 /mnt/machine-spirit ntfs-3g defaults,nofail,uid=${AETOS_UID},gid=${AETOS_GID},umask=022,x-systemd.automount,x-systemd.device-timeout=30s 0 0
EOF
echo "✅ Sacred bindings inscribed successfully!"
fi
echo "⚡ Phase 5: Awakening the Machine Spirits..."
# Reload systemd to acknowledge the sacred changes
echo "🔄 Reloading systemd daemon to acknowledge the new bindings..."
systemctl daemon-reload
# Test mount all
if mount -a; then
echo "✅ All Machine Spirits have awakened successfully!"
else
echo "❌ ERROR: Some Machine Spirits resist binding!"
echo " Check the sacred logs for heretical errors..."
exit 1
fi
echo
echo "🔍 Phase 6: Verifying the sacred bindings..."
# Check if drives are mounted
echo "Current mount status:"
df -h | grep -E "(omnissiah-vault|machine-spirit)" || echo " Drives not yet manifested in the material realm..."
echo
echo "📁 Phase 7: Blessing the directory structure..."
# Create useful subdirectories
if mountpoint -q /mnt/omnissiah-vault; then
mkdir -p /mnt/omnissiah-vault/{movies,tv-shows,documentaries,archives,media}
chown -R $AETOS_UID:$AETOS_GID /mnt/omnissiah-vault
echo "✅ Omnissiah's Vault directory structure blessed"
fi
if mountpoint -q /mnt/machine-spirit; then
mkdir -p /mnt/machine-spirit/{configs,databases,metadata,logs,backups,system}
chown -R $AETOS_UID:$AETOS_GID /mnt/machine-spirit
echo "✅ Machine Spirit directory structure blessed"
fi
echo
echo "=========================================="
echo " SACRED RITUAL COMPLETED! "
echo "=========================================="
echo "🔱 The Machine Spirits are bound!"
echo "📁 Omnissiah's Vault: /mnt/omnissiah-vault"
echo "🧠 Machine Spirit: /mnt/machine-spirit"
echo
echo "The Emperor protects your data!"
echo "May your storage serve the Imperium well!"
echo "=========================================="
# Final verification
echo
echo "🔧 Final Systems Check:"
echo "Mounted filesystems:"
mount | grep -E "(omnissiah-vault|machine-spirit)" | sed 's/^/ /'
echo
echo "Storage capacity report:"
df -h | grep -E "(omnissiah-vault|machine-spirit)" | sed 's/^/ /'
echo
echo "Directory permissions:"
ls -la /mnt/ | grep -E "(omnissiah-vault|machine-spirit)" | sed 's/^/ /'
echo
echo "🎉 Ritual complete! Reboot to test automatic mounting."
echo " To verify: sudo reboot && df -h"

44
bind-spirit-callers.sh Executable file
View File

@@ -0,0 +1,44 @@
#!/bin/bash
# Update and upgrade system packages
echo "Updating system packages..."
sudo apt update
sudo apt full-upgrade -y
# Install qbittorrent-nox (headless version)
echo "Installing qBittorrent-nox..."
sudo apt install -y qbittorrent-nox
# Create a system user for qBittorrent (optional but recommended)
echo "Creating qBittorrent user..."
sudo useradd -r -m qbt
# Add your normal user (pi) to the qbt group to access downloaded files
sudo usermod -a -G qbt $USER
# Create systemd service file for qBittorrent
echo "Creating systemd service file..."
sudo tee /etc/systemd/system/qbittorrent-nox.service > /dev/null <<EOF
[Unit]
Description=qBittorrent Command Line Client
After=network.target
[Service]
User=$USER
ExecStart=/usr/bin/qbittorrent-nox
Restart=always
[Install]
WantedBy=multi-user.target
EOF
# Reload systemd, enable and start qBittorrent service
echo "Enabling and starting qBittorrent service..."
sudo systemctl daemon-reload
sudo systemctl enable qbittorrent-nox
sudo systemctl start qbittorrent-nox
echo "qBittorrent installation and service setup complete."
echo "Access the Web UI at http://<your_pi_ip>:8080"
echo "Default credentials: username: admin, password: adminadmin"
echo "It's highly recommended to change the default login credentials in the Web UI."

42
bind-spirit-holders.sh Executable file
View File

@@ -0,0 +1,42 @@
#!/bin/bash
# Update and upgrade system packages
echo "Updating system packages..."
sudo apt-get update
sudo apt-get upgrade -y
# Remove old Docker versions if any
echo "Removing old Docker versions..."
for pkg in docker.io docker-doc docker-compose podman-docker containerd runc; do
sudo apt-get remove -y $pkg
done
# Install prerequisites for Docker Compose
echo "Installing prerequisites for Docker Compose..."
sudo apt-get install -y libffi-dev libssl-dev python3 python3-pip
# Install Docker using the official convenience script
echo "Installing Docker..."
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# Add current user to the Docker group
echo "Adding user to docker group..."
sudo usermod -aG docker $USER
# Enable and start Docker service
echo "Enabling and starting Docker service..."
sudo systemctl enable docker
sudo systemctl start docker
# Install Docker Compose
echo "Installing Docker Compose..."
sudo pip3 install docker-compose
# Verify Docker and Docker Compose versions
echo "Docker version:"
docker --version
echo "Docker Compose version:"
docker-compose --version
echo "Installation complete. Please reboot your Raspberry Pi."

49
bind-vox-spirit.sh Executable file
View File

@@ -0,0 +1,49 @@
#!/bin/bash
# Define your custom Plex config directory
CUSTOM_PLEX_CONFIG="/mnt/machine-spirit/configs/plex"
# Update and upgrade system packages
echo "Updating system packages..."
sudo apt update
sudo apt full-upgrade -y
# Install prerequisites
echo "Installing prerequisites..."
sudo apt install -y apt-transport-https curl
# Add Plex official repository GPG key and repo
echo "Adding Plex repository..."
curl https://downloads.plex.tv/plex-keys/PlexSign.key | gpg --dearmor | sudo tee /usr/share/keyrings/plex-archive-keyring.gpg > /dev/null
echo "deb [signed-by=/usr/share/keyrings/plex-archive-keyring.gpg] https://downloads.plex.tv/repo/deb public main" | sudo tee /etc/apt/sources.list.d/plexmediaserver.list
# Update package lists with Plex repo
sudo apt update
# Install Plex Media Server
echo "Installing Plex Media Server..."
sudo apt install -y plexmediaserver
# Stop Plex service before moving config
sudo systemctl stop plexmediaserver
# Move current Plex config to custom location
echo "Moving Plex config to custom directory..."
sudo rsync -av /var/lib/plexmediaserver/ "$CUSTOM_PLEX_CONFIG"/
# Backup and remove existing config directory and create symlink
echo "Setting up symlink from default location to custom config path..."
sudo mv /var/lib/plexmediaserver /var/lib/plexmediaserver.bak
sudo ln -s "$CUSTOM_PLEX_CONFIG" /var/lib/plexmediaserver
# Set correct permissions
echo "Setting permissions for Plex user on custom directory..."
sudo chown -R plex:plex "$CUSTOM_PLEX_CONFIG"
# Start Plex service
sudo systemctl start plexmediaserver
sudo systemctl enable plexmediaserver
echo "Plex Media Server installation complete."
echo "Access the Plex Web UI at http://<your_pi_ip>:32400/web"

58
drive-exterminatus-ritual.sh Executable file
View File

@@ -0,0 +1,58 @@
#!/bin/bash
# ======================================================
# >>> EXTERMINATUS RITUAL v3 <<<
# In the name of the Omnissiah, this script PURGES
# a selected mounted drive.
# ALL DATA ON THE DRIVE WILL BE LOST FOREVER.
# ======================================================
# Step 1: List mounted drives (skip root "/")
echo ">> Machine Spirit Survey: Listing mounted drives..."
echo
mount | grep "^/dev/" | grep -v "on / " | nl -w2 -s'. '
echo
read -r -p "Select the drive number to invoke Exterminatus: " CHOICE
# Step 2: Extract DEVICE and MOUNTPOINT
SELECTED=$(mount | grep "^/dev/" | grep -v "on / " | sed -n "${CHOICE}p")
DEVICE=$(echo "$SELECTED" | awk '{print $1}')
MOUNTPOINT=$(echo "$SELECTED" | awk '{print $3}')
if [ -z "$DEVICE" ] || [ -z "$MOUNTPOINT" ]; then
echo "!! Invalid selection. Ritual aborted."
exit 1
fi
# Step 3: Confirm with user
echo "⚠️ WARNING! You have chosen:"
echo " DEVICE: $DEVICE"
echo " MOUNT : $MOUNTPOINT"
echo "All data will be purged beyond recovery."
read -r -p "Do you invoke Exterminatus on this drive? (type YES): " CONFIRM
if [ "$CONFIRM" != "YES" ]; then
echo "Exterminatus aborted. The Machine Spirit whispers relief."
exit 1
fi
echo ">> Stopping Share in the name of Emperor and Omnissiah..."
sudo systemctl stop smbd nmbd
# Step 4: Begin purge
echo ">> Unmounting $MOUNTPOINT..."
sudo umount -f "$MOUNTPOINT" || { echo "!! Failed to unmount. Aborting."; exit 1; }
echo ">> Purging file allocation tables..."
sudo mkfs.ntfs -f -L "Cleansed_Vault" "$DEVICE" || { echo "!! mkfs.ntfs failed. Aborting."; exit 1; }
echo ">> Recreating mount point..."
sudo mkdir -p "$MOUNTPOINT"
echo ">> Remounting cleansed Vault..."
sudo mount -t ntfs-3g "$DEVICE" "$MOUNTPOINT"
echo ">> The Exterminatus is complete. The Vault has been reforged."
echo ">> Starting the share in the name of Emperor and Omnissiah..."
sudo systemctl start smbd nmbd

35
purge-heretic-folders.sh Executable file
View File

@@ -0,0 +1,35 @@
#!/bin/bash
# ================================
# Purge Ritual of the Omnissiah
# Cleans corrupted folders from the Vault
# ================================
MOUNT="/mnt/omnissiah-vault"
# Folders to purge (add more if needed)
TARGETS=(
"$MOUNT/Media/Movies/Legend.2015.1080p.BRRip.x264.AAC.ETRG"
"$MOUNT/Media/Movies/Naruto.OVA.Episodes.1.4"
"$MOUNT/Media/Movies/Swatantrya Veer Savarkar (2024) Hindi 1080p 10Bit ZEE5 WEB-DL DDP.ATMOS.5.1 HEVC x265 ESub-Telly [ProtonMovies]"
"$MOUNT/Media/Movies/XXX_to_be_deleted_001/www.YTS.AM.jpg"
"$MOUNT/Media/TV Shows/G.I.Joe/Season.2"
"$MOUNT/Media/TV Shows/www.Torrenting.com.Paatal.Lok.S02E07.1080p.AV1.10bit.MeGusta/Screens/screen0001.jpg"
"$MOUNT/Media BKP/Movies/Ranma/Movies/Movie 3 - Team Ranma vs. The Legendary Phoenix/Ranma Movie 3 - Team Ranma vs. The Legendary Phoenix.avi"
"$MOUNT/Media BKP/Movies/Ranma/OVA/Ranma Special OVA/Ranma Special OVA - 002.avi"
"$MOUNT/XXX_DELETE_Downloads"
)
echo ">> Beginning purge rituals… ⚙️🔥"
for item in "${TARGETS[@]}"; do
if [ -e "$item" ]; then
echo ">> Purging $item"
sudo rm -rf --force "$item" 2>/dev/null || \
sudo unlink "$item" 2>/dev/null || \
echo "!! Failed to purge $item (machine spirit resists)"
else
echo "-- Skipped $item (does not exist)"
fi
done
echo ">> Purge complete. The Omnissiah is appeased."

99
sanctify-network-share.sh Executable file
View File

@@ -0,0 +1,99 @@
#!/bin/bash
set -e
# =====================================================================
# ✠ In the Name of the Omnissiah ✠
# Rite of Network Sanctification
# This script forges SMB daemons to guard the sacred data vaults.
# Let no heresy dwell within these parameters.
# =====================================================================
# === CONFIGURATION SIGILS ===
USER="aetos" # Bearer of the Emperor's Sigil
SHARES=(
"/mnt/omnissiah-vault:Omnissiah-Vault" # 7.3TB Holy Vault of Media Relics
"/mnt/machine-spirit:Machine-Spirit" # 931GB Machine Spirit for DBs
)
# === INSTALLATION OF HOLY DAEMONS ===
echo "[*] Installing Samba daemons — awaken smbd & nmbd..."
if command -v apt >/dev/null 2>&1; then
sudo apt update
sudo apt install -y samba
elif command -v dnf >/dev/null 2>&1; then
sudo dnf install -y samba
else
echo "Unsupported package manager. Manual rites required."
exit 1
fi
# === CONSECRATION OF STORAGE SHRINES ===
echo "[*] Consecrating vault directories for Emperors work..."
for entry in "${SHARES[@]}"; do
DIR="${entry%%:*}"
sudo mkdir -p "$DIR"
sudo chown -R "$USER:$USER" "$DIR"
done
# === SMB.CONF SCRIPTURES ===
echo "[*] Backing up smb.conf — preserve the old texts of Mars..."
sudo cp /etc/samba/smb.conf /etc/samba/smb.conf.bak.$(date +%F-%H%M%S)
# Purge traces of past heresies (incorrect configs)
sudo sed -i '/# Omnissiah Vault/,/^\[/d' /etc/samba/smb.conf || true
sudo sed -i '/# Machine Spirit/,/^\[/d' /etc/samba/smb.conf || true
# Inscribe new holy shares into smb.conf
for entry in "${SHARES[@]}"; do
DIR="${entry%%:*}"
NAME="${entry##*:}"
sudo tee -a /etc/samba/smb.conf >/dev/null <<EOF
# ✠ ${NAME} Share ✠
# Machine Spirits bound by the will of the Omnissiah.
[${NAME}]
path = ${DIR}
# Let mortals witness, but not alter without sigil
browseable = yes
# Grant write privileges in Emperors name
read only = no
writable = yes
# HERESY DENIED — no guest trespassers
guest ok = no
# Sigil-bearer ${USER} alone may access
valid users = ${USER}
EOF
done
# === SAMBA PASSWORD RITE ===
echo "[*] Inscribing ${USER} into the Book of smbpasswd..."
sudo smbpasswd -a "$USER"
# === AWAKENING OF DAEMONS ===
echo "[*] Restarting Samba services — let smbd and nmbd chant praises..."
if systemctl list-unit-files | grep -q nmbd.service; then
sudo systemctl restart smbd nmbd
sudo systemctl enable smbd nmbd
else
sudo systemctl restart smbd
sudo systemctl enable smbd
fi
# === VOID SHIELD CONFIG (FIREWALL) ===
if command -v ufw >/dev/null 2>&1; then
sudo ufw allow samba
elif command -v firewall-cmd >/dev/null 2>&1; then
sudo firewall-cmd --permanent --add-service=samba
sudo firewall-cmd --reload
else
echo "[!] No firewall rites detected — proceed with caution, Acolyte."
fi
# === FINAL BLESSING ===
echo "[*] Network sanctification complete!"
echo "Invoke thus from clients:"
echo " smb://<server-ip>/Omnissiah-Vault"
echo " smb://<server-ip>/Machine-Spirit"
echo
echo "✠ May the Emperor and the Omnissiah guard these shares. ✠"