Mac OS - Aliases Management

Mac OS - Aliases Management#

Quick Restore (Workstation Rebuild):

  1. Clone your scripts: git clone git@github.com:marcoue/Scripts.git ~/Scripts
  2. Run the restore script: source ~/Scripts/MacOS/Aliases/MacOS_Aliases_restore.sh
  3. Retrieve local secrets from your 1Password Homelab Vault under the entry Mac OS .zshrc file and copy them into your local ~/.zshrc (Edit using: nano ~/.zshrc).
  4. Refresh your shell configuration to apply the new tokens: source ~/.zshrc.

Related Recovery Guides: Master Checklist: Mac OS - Recovery | Packages Sync: Mac OS - Brewfile | Repository Standard: Scripts Mangement.

Mac OS - Brewfile

Mac OS - Brewfile#

Daily Sync Shortcuts (Keep Computers Mirrored):

  • Run pushbrew on the machine where you just installed/removed software to scan your system, update the Brewfile, and push it to GitHub.
  • Run pullbrew on your other workstations to pull the update and automatically install/clean up your packages to match.

Quick Restore & Sync (Workstation Rebuild):

  • To Restore (New Computer):
    1. Install Homebrew (if missing): /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
    2. Clone scripts: git clone git@github.com:marcoue/Scripts.git ~/Scripts
    3. Reinstall all software: brew bundle --file=~/Scripts/MacOS/Brew/Brewfile
  • To Sync Updates (Ongoing):
    • Pull latest and clean up local packages: pullbrew

Related Recovery Guides: Master Checklist: Mac OS - Recovery | Shortcut Configuration: Mac OS - Aliases Management | Repository Standard: Scripts Mangement.

Mac OS - Recovery

Mac OS - Recovery#


1. Pre-Crash Backup Checklist (Do This Now)#

Ensure these configurations are regularly backed up or pushed to GitHub to prevent data loss.

  • 1.1 Setup Brewfile Versioning: Dump, commit, and push your system package lists.
  • 1.2 Sync Packages & Scripts: Track changes to package lists using pushbrew and script/alias updates using pushscripts.
    • Details: Completed. Use pushbrew for package list updates and pushscripts for codebase updates. See Mac OS - Brewfile.
  • 1.3 Automate MCP Config Pushes: Update the mcp alias to push local configuration commits.
    • Details: Completed. mcp alias now auto-commits and pushes local changes to GitHub (MCP-Config-MacOS).
  • 1.4 Version-Control Custom Aliases: Migrate custom shortcuts out of local configurations.
  • 1.5 Double Check Git Hook Backups: Save a copy of your Git hooks.
    • Details: Completed. The mirror hook is backed up at ~/Scripts/MacOS/post-commit-hook.sh.

2. Workstation Rebuild Checklist (In Case of Crash)#

Follow these steps in order to restore the Mac Studio environment on a fresh macOS installation.

Scripts Management Migration Plan

Scripts Management Migration Plan#

This document is the master architectural migration plan for establishing /Users/marc/Scripts as your primary local master Git repository, linked to git@github.com:marcoue/Scripts.git, with automated mirroring to the UNAS-Pro NAS (/Volumes/Software/Software/Scripts/) and automated pull execution by remote TrueNAS/Linux/Proxmox nodes.


1. Executive Summary & Architecture Goal#

🎯 Primary Master Architecture#

  1. Master Repository: /Users/marc/Scripts on your Mac SSD is your primary master repository for editing, testing, running, and managing all homelab scripts.
  2. GitHub Remote: Linked to git@github.com:marcoue/Scripts.git on branch main.
  3. Automated NAS Mirroring: A Git post-commit hook automatically syncs committed scripts from ~/Scripts/ to /Volumes/Software/Software/Scripts/ on UNAS-Pro.
  4. Remote Server Pull Execution: Remote servers (HP1, HP2, HP3, HP7, HP8, Proxmox, Linux) pull their scripts from UNAS-Pro (Software/Scripts/) on their scheduled runs.

🔄 Data & Deployment Flow#

  [Mac Workstation] (Primary Master Workspace)
   └── ~/Scripts/ (git@github.com:marcoue/Scripts.git)
        ├── MacOS/
        ├── Linux/
        ├── Proxmox/
        └── TrueNAS/
             ├── (git commit)
        [Git post-commit Hook]
             ├── (rsync auto-mirror)
  [UNAS-Pro Master NAS] (Distribution Mirror)
   └── /Volumes/Software/Software/Scripts/
        ├── MacOS/
        ├── Linux/
        ├── Proxmox/
        └── TrueNAS/ (Exposed as Rsync Module: root@10.1.2.2::Software/Scripts/TrueNAS/)
             ├── (Rsync pull on schedule)
  [Remote Nodes: HP1, HP2, HP3, HP7, HP8, Proxmox, Linux]
   └── Local Execution of Version-Controlled Scripts

📂 1.1 Filesystem Standard & Disaster Recovery Protocol#

  1. Standard POSIX Filesystem Path:
    • The destination path /Volumes/Software/Software/Scripts/ (and subfolders MacOS/, Linux/, Proxmox/, TrueNAS/) is a standard, plain-text directory tree residing on the mounted Software SMB share (smb://10.1.2.2/Software). There are zero proprietary databases, hidden hooks, or custom file structures on the NAS.
  2. Mac Auto-Mount Convenience (Login Items):
    • To ensure the SMB share is always available for Git post-commit auto-mirroring, add /Volumes/Software to macOS System Settings > General > Login Items.
  3. macOS Reinstall / Disaster Recovery:
    • Reinstalling or replacing macOS on your Mac Studio has zero effect on UNAS-Pro or TrueNAS servers. The NAS files remain intact, and TrueNAS backup cron jobs continue executing without interruption.
    • To restore your Mac workstation repo after a fresh macOS install:
      # Step 1: Clone master repository from GitHub
      git clone git@github.com:marcoue/Scripts.git ~/Scripts
      
      # Step 2: Re-install 1-line Git post-commit auto-mirror hook
      cat << 'EOF' > ~/Scripts/.git/hooks/post-commit
      #!/usr/bin/env bash
      if [ -d "/Volumes/Software/Software/Scripts" ]; then
          rsync -av --delete --exclude='.git' --exclude='*.log' /Users/marc/Scripts/ /Volumes/Software/Software/Scripts/
      fi
      EOF
      chmod +x ~/Scripts/.git/hooks/post-commit

2. Complete Script Inventory & Mapping#

The following table lists all existing scripts found across your NAS repository (git@github.com:marcoue/Scripts.git) and local Mac folder (~/Scripts/), mapped to their final category subfolders:

Proxmox - PBS Backups via NAS with to GDrive

Proxmox Backup Server (PBS) - Backups via NAS to GDrive (Decoupled, Monitored & Encrypted)#

This guide is intended for off-site disaster recovery (DR) copies, not as a primary backup destination.

This documentation covers a decoupled, stage-based architecture: The PBS Method (Deduplicated Datastore on NAS): The Proxmox Backup Server (PBS) host HP1BackupServer (10.1.1.211) mounts a local NAS share under proper system ownership (uid=34) to run a fully deduplicated backup datastore. A dedicated sync container MMDocker (10.1.2.230) mounts the same share to asynchronously push the deduplicated chunk structure to Google Drive via an optimized rclone sync script.

Proxmox Backup Server - Mounting an SMB NAS Share as a PBS Datastore

Proxmox Backup Server - Mounting an SMB NAS Share as a PBS Datastore#

This note outlines the step-by-step process used to mount a remote SMB/Samba share from a NAS onto a Proxmox Backup Server (PBS) host at the OS level, assign proper permissions for the PBS daemon, and initialize it as a new backup datastore.

Prerequisites#

  • A target share on the NAS (e.g., //10.1.2.2/ProxmoxBackups).
  • An existing SMB credentials file on the PBS host (e.g., /root/.smb_credentials).

Step-by-Step Implementation#

Step 1: Create the Local Mount Directory#

Create a dedicated folder at the root of the PBS host filesystem where the network share will be attached.

Immich & Photo Management Guide

Immich & Photo Management Guide#


1. Synology Photo Workflow#

Album Creation#

  1. In Synology Photo:
    • Move images from Personal space to Shared Space.
    • Create an album with the moved images.

2. Immich Management#

External Libraries & Albums#

  1. Scan Libraries: Settings > Administration > External Library > Scan All Libraries.
  2. Monitor Progress: Jobs > Check when the job is finished.
  3. Create Album: Main page > Albums > Create Album > Select Photos.
  4. Sharing: Share with Nadine.

Backup Strategy#

  • MacStudio: Use Carbon Copy Cloner to sync HP1 Photos to UNAS.
  • UNAS: Backup the Immich folder from UNAS to HP1, HP7, and HP11.

3. Cloudflare Zero Trust: Mobile App Bypass#

Setup Cloudflare bypass access to allow the Immich mobile app to connect without manual Google Auth browser prompts. Reference: Cloudflare Tunnel Guide

Pangolin Backup Strategy

1 VPS BACKUP SYSTEM: Pangolin Docker#

Target VPS: 72.11.147.220
VPS Provider: RackNerd (RN-VPS)
Backup LXC: Proxmox 102
Retention: 28 Files (14 Days)

The backup is a pull operation: Proxmox LXC 102 initiates SSH to the VPS. The home ISP public IP is therefore used as the source IP seen by the VPS firewall. On 2026-08-12, the home IP was 208.96.219.86; this address is dynamic and must be updated if the ISP changes it.

Pangolin Tunnel - VPS Setup

Pangolin Tunnel Setup Guide#


Current VPS and SSH Access (Verified 2026-08-12)#

The current Pangolin VPS is hosted by RackNerd:

  • VPS hostname: RN-VPS
  • VPS public IP: 72.11.147.220
  • Operating system: Ubuntu
  • SSH port: TCP 22
  • Current home public IP: 208.96.219.86 (may change when the ISP address changes)

SSH access is restricted by multiple layers:

  1. UFW: incoming traffic is denied by default; TCP port 22 is allowed only from the current home public IP.
  2. Fail2ban: the sshd jail has the current home public IP in ignoreip, so it is not accidentally banned. The value must also be present persistently in /etc/fail2ban/jail.local.
  3. CrowdSec: the Pangolin container can enforce decisions through the Ubuntu host firewall via the INPUT and DOCKER-USER iptables chains.

The backup LXC connects outbound to the VPS. It does not require an inbound connection from the VPS to the home network. If the ISP IP changes, update both UFW and Fail2ban before the next backup.

Proxmox - Configuration

Proxmox Setup & Management Guide#

For fresh installations and initial server builds, please refer to the Proxmox - Initial Setup guide for automated provisioning steps.


1. Storage Management#

1.1 Storage: ZFS Pool Creation#

Create a simple mirrored or striped ZFS pool via CLI.

# Create a pool named 'Storage' using two disks
zpool create Storage sdb sdc

# The pool will now appear in Node > Storage > ZFS

1.2 Storage Specific Tests#

# Test SMB Share Throughput
dd if=/dev/zero of=/mnt/pve/HP1Storage/test.file bs=1M count=4000

# Test local-lvm Performance
dd if=/dev/zero of=/var/lib/vz/test.file bs=1M count=4000

2. Networking#

2.1 Add Second Network Bridge (Isolated VM Traffic)#

Use this for dedicated VM traffic on a specific physical port (e.g., eno6).