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 Standard

📜 Scripts Management Process#

Workstation Sync Shortcut: To automatically backup all your scripts and custom terminal aliases configuration (staging and pushing your entire ~/Scripts/ repository):

pushscripts

This will stage all modified files in ~/Scripts/, commit, and push updates directly to GitHub and your NAS (without running Homebrew operations).

Workstation Update Shortcut: To pull down the latest custom scripts and terminal aliases from GitHub on an existing machine (after the first-time setup is complete):

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:

KVM - Tripp Lite Java Web Start Fix

Tripp Lite KVM Java Web Start (JNLP) Setup & SSL Fix#

This guide documents the fix for opening the Tripp Lite KVM virtual console (viewer.jnlp) on macOS when modern Java blocks connections due to legacy TLS/SSL cipher handshake failures.


1. Problem Overview#

When launching viewer.jnlp via Java Web Start (javaws), the applet fails with the following errors:

com.sun.deploy.net.FailedDownloadException: Unable to load resource: https://10.1.5.2:443/iClientJ12111.jar@pid=...
javax.net.ssl.SSLHandshakeException: Received fatal alert: handshake_failure

Cause#

Tripp Lite IP KVM switches (and rebranded ATEN/Avocent devices) rely on legacy SSL/TLS protocols (TLS 1.0 / TLS 1.1) and deprecated ciphers (e.g., 3DES, 1024-bit Diffie-Hellman keys). Modern Java runtimes (Java 8u291+ and newer) disable these protocols by default in java.security.

AI - Pi CLI

Installing and Launching Pi (pi.dev)#

Follow these steps to set up the Pi coding agent on your Mac Studio and link it straight to your custom local short-context models.


1 Environment Preparation#

Because Pi is a JavaScript terminal application, it runs on Node.js. If you do not have Node installed yet, use Homebrew to get it ready.

1.1 Install Node.js via Homebrew#

brew install node

2 Installation#

Install the official global Pi command-line tool. As noted in the documentation, we include the security flag to bypass unnecessary third-party package scripts.

GenDash and Hugo setup on Mac

Hugo file GenDash: Obsidian to Hugo Automated Publishing Guide

This guide outlines the infrastructure and configuration required to sync an Obsidian vault across multiple devices and automate the publishing process to a Hugo website via Cloudflare Pages.


1. Multi-Device Sync (The Git & Web Layer)#

To sync your notes between computers and view them on mobile devices without the overhead of real-time database sync engines:

1.1. Between Computers (Mac Studio & MacBook Pro/Air)#

We use the Obsidian Git plugin to synchronize GenDash vaults directly via GitHub.

AI - Claude Code CLI

Local AI Coding Agent Setup#

This guide documents the steps taken to install and configure Claude Code to run 100% locally on the Mac Studio M4 (64GB) using Ollama, ensuring complete privacy for local folders and Obsidian vaults.


1. Prerequisites (Mac Studio)#

  • Hardware: Mac Studio M4 (64GB Unified Memory).
  • Environment: Node.js v25.8.0 installed.
  • Local Brain: Ollama installed and running.

2. Install Claude Code (Native)#

Instead of using npm, we used the official native installer from Anthropic for better performance and signed binary security.

MacOS System Administration & Optimization

macOS System Administration & Optimization#

Workstation Recovery & Rebuild Standard: If you need to rebuild your Mac Studio or synchronize its software and aliases with another Mac, refer to the master checklist at Mac OS - Recovery.


1 Modify Known Hosts#

# Add description
nano ~/.ssh/known_hosts
# To remove a specific host
ssh-keygen -R 10.1.1.14
# Clear the full file
cat /dev/null > ~/.ssh/known_hosts

2 Disk Management & Diagnostics#

2.1 Identify and Verify Disks#

# List all physical and virtual disks
diskutil list
# Verify a specific disk (replace X with disk number)
diskutil verifyDisk /dev/diskX

2.2 SMART Monitoring (via Homebrew)#

# Install smartmontools
brew install smartmontools
# Check health of the primary NVMe drive
smartctl -a /dev/disk0

3 Homebrew Package Manager#

Official site: brew.sh