Hugo Setup on Ubuntu

1. Install Latest Hugo Extended (Ubuntu amd64)#

Use this script to automatically fetch and install the latest .deb package from GitHub.

#!/usr/bin/env bash

echo "Installing latest Hugo Extended..."

ARCH=$(dpkg --print-architecture)

if [ "$ARCH" != "amd64" ]; then
  echo "This script currently supports amd64 only."
  echo "Detected architecture: $ARCH"
  exit 1
fi

echo "Fetching latest version..."
LATEST=$(curl -s [https://api.github.com/repos/gohugoio/hugo/releases/latest](https://api.github.com/repos/gohugoio/hugo/releases/latest) \
  | grep '"tag_name":' \
  | sed -E 's/.*"v([^"]+)".*/\1/')

if [ -z "$LATEST" ]; then
  echo "Failed to fetch latest version."
  exit 1
fi

echo "Latest version: $LATEST"
FILE="hugo_extended_${LATEST}_linux-amd64.deb"
URL="[https://github.com/gohugoio/hugo/releases/download/v$](https://github.com/gohugoio/hugo/releases/download/v$){LATEST}/${FILE}"

echo "Downloading $FILE..."
wget -q --show-progress "$URL"

if [ ! -f "$FILE" ]; then
  echo "Download failed."
  exit 1
fi

echo "Installing package..."
sudo dpkg -i "$FILE"
sudo apt-get -f install -y

echo "Cleaning up..."
rm -f "$FILE"

echo ""
echo "Installed Hugo version:"
hugo version

echo ""
echo "Done."

2. Install Blowfish Theme#

Commands to initialize your project (e.g., canada2argentina) and install the Blowfish theme as a submodule.

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#

Update Attempt — 2026-10-02#

  • Host: HP1GPU (10.1.2.231), compose directory /home/marc/docker-compose/immich.
  • Attempted stable upgrade from v3.1.0 to v3.2.4, including CUDA machine learning; PostgreSQL and Valkey images were unchanged.
  • Pre-upgrade database dump: /mnt/Immich/Immich-Uploads/upgrade-backups/2026-10-02-v3.2.4/database.sql.gz. Gzip integrity check passed and the SQL dump completion marker was verified.
  • Original compose file preserved as docker-compose.yaml.pre-v3.2.4; stable image override saved as docker-compose.stable-v3.2.4.yaml.
  • Server failed to start with PostgreSQL password authentication failure. Restored the original compose file and recreated both application containers with local v3.1.0 images using docker-compose.recovery-v3.1.0.yaml.
  • The same database authentication error persisted after rollback to v3.1.0, indicating an authentication/configuration issue upon container recreation. Following the user’s restart through their 1Password workflow, the API responded successfully with v3.1.0 and pong, with zero application container restarts. The stable upgrade remains pending. Credential inspection requires explicit authorization under the vault agent instructions.
  • Root filesystem has approximately 3.2 GB free (95% used); old and new images retained. No database restore or credential changes performed.

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#

  • Photo ingress: The HP1Photos share on the Synology VM is the source of truth and is pushed one-way to the UNAS-Pro Photos share by the Linux sync hosts.
  • Immich: Immich reads the photo library from the UNAS-Pro Photos share.
  • UNAS-Pro protection: TrueNAS nodes pull the Photos and Immich data from UNAS-Pro according to the schedules documented in Unifi UNAS-Pro Backup Strategy.
  • Manual sync: Run pushphotos on HP1GPU (10.1.2.231) or HP1Docker (10.1.2.202) when a sync is required.

See Unifi UNAS-Pro Backup Strategy#3.2 Synology Photos to UNAS-Pro Push for the mounts, script, exclusions, and deletion policy.

Linux

Linux Initial Setup Guide#


1. Initial System Setup#

Timezone & Updates#

timedatectl set-timezone America/Toronto
apt update && apt full-upgrade -y

Warpification (Terminal UI)#

echo -e '\n# Auto-Warpify\nprintf '\''\eP$f{"hook": "SourcedRcFileForWarp", "value": { "shell": "bash", "uname": "'$(uname)'" }}\x9c'\'' ' >> ~/.bashrc

Essential Package Installation#

For Virtual Machines (Full Suite):

apt install gdebi curl sudo gpg ethtool ngrep lshw lsscsi cifs-utils ncdu etherwake lshw sudo tasksel fail2ban openssh-server qemu-guest-agent unzip smbclient fio iperf3 nmap net-tools apt-transport-https software-properties-common wget duf tldr zip git eza snapd samba glances -y

For LXC Containers (Lightweight):

Linux - Various Command Lines

Linux & Proxmox Command Line Toolbox#


1 Storage & Disk Management#

1.1 Clean Up & Space Recovery#

# Purge unused packages and clean cache
apt autoremove --purge && apt autoclean
# Reclaim journal log space (limit to 500MB)
journalctl --vacuum-size=500M

1.2 Identify Large Files & Folders#

# List all files with human-readable sizes
ls -lah
# Summary of folder sizes in current directory
du -sh *
# Identify top 10 largest folders on root
sudo du -xh / | sort -rh | head -n 10
# Disk space usage summary (filtered for MB/GB)
du -cha --max-depth=1 / | grep -E "M|G"

1.3 Hugo Project Specifics (Size Checks)#

# Find files larger than 25MB in project
find /home/marc/hugo/canada2argentina -type f -size +25M -exec ls -lh {} +
# Count total files in the public build folder
find /home/marc/hugo/canada2argentina/public -type f | wc -l
# List top 25 largest files in project
find /home/marc/hugo/canada2argentina -type f -exec du -h {} + | sort -rh | head -n 25

1.4 Disk Health & Partitions#

# Wipe all partitions/signatures from a disk (CAUTION)
sgdisk --zap-all /dev/sdX
# Detailed SMART health report
smartctl -a /dev/sda | less
# Deep scan for bad blocks (Takes a long time)
badblocks -v /dev/sda -s

2 Proxmox & Virtualization#

2.1 VM / Container Management#

# Unlock a stuck VM or Container
qm unlock <vmid>
pct unlock <ctid>
# Resize a container disk (Final size, cannot shrink)
pct resize 103 rootfs 16G
# List running LXC containers
pct list | awk 'NR>1'

2.2 High Availability (HA) Fixes#

# Disable HA for a specific VM/CT to allow manual fixes
ha-manager set vm:200 --state disabled
ha-manager set ct:103 --state disabled

2.3 Repository & Templates#

# Update and list available CT templates
pveam update
pveam available
# List all active apt sources
grep -r '' /etc/apt/sources.list*

2.4 Proxmox Boot & Kernel#

# List and pin a specific kernel
proxmox-boot-tool kernel list
proxmox-boot-tool kernel pin 6.8.8-4-pve

3 Networking & Connectivity#

3.1 Troubleshooting & Discovery#

# Check DNS resolution
nslookup google.com
nslookup pi.hole
# Check open listening ports
ss -lntu
netstat -plant
# Performance test (Client mode, 8 parallel streams)
iperf3 -c 10.1.1.11 -P8

3.2 SSH & Remote Access#

# View real-time system logs for USB/Kernel errors
dmesg -w
dmesg -T | grep usb
# Clear "Remote Host Identification Changed" error
nano ~/.ssh/known_hosts

3.3 File Transfers (SCP)#

# Copy local images from Mac to Hugo site on Server
scp -v /Users/marc/Downloads/to_convert/* root@10.1.2.202:/home/marc/hugo/canada2argentina/static/images/
# Backup and transfer a folder between servers
tar -czvf "$(date +%Y-%m-%d_%Hh%M)_PangolinBackup.tar.gz" pangolin/
scp pangolin.tar.gz root@72.11.147.220:/home/marc/docker-compose

4 System & Hardware Info#

4.1 RAM & CPU#

# Clear RAM cache (Drop caches)
sync && echo 3 | tee /proc/sys/vm/drop_caches
# Check ZFS ARC summary and free RAM
arc_summary -s arc && free -h

4.2 BIOS & Hardware#

# Get BIOS version and serial info
sudo dmidecode -t bios
# List SCSI and PCIe hardware
lsscsi -u
lspci

4.3 Legacy iLO3 Fix (Firefox)#

  1. Type about:config in address bar.
  2. Search: security.tls.version.enable-deprecated.
  3. Set to: true.

5 Miscellaneous Utilities#

5.1 Permissions & Scripts#

# Make script executable and run
chmod +x ./unifi-9.0.114.sh && ./unifi-9.0.114.sh

5.2 Scheduling & Processes#

# Instant test of cron behavior (Sends message to all terminals)
* * * * * echo "Hello from cron" | wall
# Cancel a pending shutdown
shutdown -c

5.3 Print the path of the folder you are in#

# Print the path of the folder you are in
pwd

6 SSD SMART Testing on Proxmox#

6.1 Identify the drive#

# Display the drive model, serial number, capacity, and type.
lsblk -d -o NAME,MODEL,SERIAL,SIZE,TYPE /dev/sdX

6.2 View the current SMART report#

# Display the complete SMART health report.
smartctl -x /dev/sdX

6.3 Run a short self-test#

# Start a short, read-only SSD self-test.
smartctl -t short /dev/sdX

6.4 Check the test status#

# Check whether the self-test is still running or has completed.
smartctl -c /dev/sdb
echo "===== /dev/sdb ====="; smartctl -c /dev/sdb | grep -E "Self-test execution|remaining"

6.5 Check the test status if many disks tests running#

#One disk check of test
echo "===== /dev/sdk ====="
smartctl -x /dev/sdk | grep -iE "Self-test execution status|remaining|Background long"
# Multi Check whether the self-test is still running or has completed.
for d in /dev/sdb /dev/sdc /dev/sdd /dev/sde; do
  echo "===== $d ====="
  smartctl -x "$d" | grep -iE "Self-test execution status|remaining|Background long"
done

6.6 Run an extended self-test#

# Start an extended, read-only SSD self-test.
smartctl -t long /dev/sdX
#many
for d in /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde; do
  echo "===== Starting long test on $d ====="
  smartctl -t long "$d"
done

6.7 Check the extended test status#

# Check whether the extended test is complete.
smartctl -c /dev/sdX

6.8 Abort#

# Stop the test (this will stop all test if multiple started together)
smartctl -X
#If multiple
for d in /dev/sda /dev/sdb /dev/sdc /dev/sdd /dev/sde /dev/sdf /dev/sdg /dev/sdh; do
  echo "===== $d ====="
  smartctl -X "$d"
done

6.9 View the final report#

# Display the final SMART report, including self-test results.
smartctl -x /dev/sdX

6.10 Save the report#

# Save the SMART report to a text file.
smartctl -x /dev/sdX > sdX-smart-report.txt

Linux Desktop Configuration Guide

Linux Desktop Configuration Guide#


1. Initial System & User Setup#

Privilege Escalation#

# Add user to sudo group
sudo usermod -aG sudo marc
# Activate root account
sudo passwd root

Essential UI Software#

# File Browsers (Dolphin is recommended)
sudo apt install dolphin krusader konqueror -y
# Partition Manager
sudo apt install gparted -y
# Synaptic & GDebi
sudo apt install synaptic gdebi -y

2. Repositories & Package Management#

Enable Non-Free & Backports#

  1. Open the Software app > Top Right Corner > Software Repositories.
  2. Enable Non-Free and Contrib.

Configure Backports Manually:

n8n AI & Database Management

n8n AI & Database Management#


1. Database Administration#

Access the backend Postgres instance to monitor or clear AI-related data.

Access the Database#

docker exec -it n8n_postgres16 psql -U n8n -d n8n

Table Inspection#

-- Count entries in knowledge base
SELECT COUNT(*) FROM n8n_knowledge_base;
-- Count entries in chat history
SELECT COUNT(*) FROM n8n_chat_histories;
-- View table structure
\d n8n_knowledge_base
-- Preview top 20 entries
SELECT * FROM n8n_knowledge_base LIMIT 20;

Maintenance (Data Deletion)#

-- Clear all chat histories
DELETE FROM n8n_chat_histories;
-- Clear all knowledge base vectors
DELETE FROM n8n_knowledge_base;

2. AI Agent: System Prompt (Wally)#

Copy and paste the following into the System Message field of your n8n AI Agent node.

Nextcloud Installation & Optimization

Nextcloud Installation & Optimization Guide#


Antigracity-cli chat during last update: agy –conversation=208181d3-885d-4b18-8544-403c7747e6d1

1. PHP Configuration#

Ensure PHP 8.3 is tuned for Nextcloud performance.

Edit php.ini#

nano /etc/php/8.3/apache2/php.ini

Modify these values (remove the ; prefix):

memory_limit = 512M
upload_max_filesize = 200M
max_execution_time = 360
post_max_size = 200M
date.timezone = America/Toronto

; OPcache Settings
opcache.enable=1
opcache.interned_strings_buffer=16
opcache.max_accelerated_files=10000
opcache.memory_consumption=128
opcache.save_comments=1
opcache.revalidate_freq=1

Enable Apache Modules & APCu#

a2enmod dir env headers mime rewrite ssl
systemctl restart apache2
# Enable CLI for memory caching
nano /etc/php/8.3/mods-available/apcu.ini

Add:

Obsidian

1 Core Obsidian Shortcuts#

These are the most essential keys for building your homelab documentation rapidly.

Action Shortcut (Mac) Result
Quick Open Cmd + O Search for any note in your vault.
Insert Link Cmd + K Creates standard []( ) syntax.
Toggle Sidebar Cmd + S Hides/Shows the file explorer.
Search in Note Cmd + F Finds text within the current file.
Global Search Cmd + Shift + F Searches your entire vault.
Command Palette Cmd + P Access every feature (Templates, Plugins, etc).

Since we switched to Standard Markdown Links, use these to keep the “network” alive.

Obsidian and Hugo setup on Mac

Homelab: 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 vaults directly via GitHub.

Ollama & Stable Diffusion AI Guide

Ollama & Stable Diffusion AI Guide#

1 HP1GPU - Docker (Ollama Model Inventory)#

1.1 llama3.2:latest (2.0 GB)#

  • Consuming VM: HP1Docker
  • Services:
    • karakeep (Docker)
    • paperless (Docker)
    • [n8n](n8n.md) (Docker)

1.2 qwen3-vl:8b (6.1 GB)#

  • Consuming VM: HP1Docker
    • Service: paperless-ai (Docker)

1.3 gemma3:12b (8.1 GB)#

  • Consuming VM: HP1GPU
  • Service:
    • open-webui (Docker)

1.4 llama3.2-vision:latest (7.8 GB)#

  • Consuming VM: HP1Docker
  • Service:
    • paperless Inactive (Commented out in compose)

1.5 qwen2.5vl:3b (3.2 GB)#

  • Consuming VM: HP1Docker
  • Service: paperless (Testing)
  • Status: Inactive (Commented out in compose)

1.6 glm-ocr:latest (2.2 GB)#

1.7 gemma4::e4b (9.6 GB)#

1.8 nomic-embed-text:latest (274 MB)#

  • Service: Internal Embeddings / RAG
  • Status: Active (Implicit)

2 Ollama Installation & Network Setup#

2.1 Basic Installation#

# Open firewall port
ufw allow 11434/tcp
# Official Install Script
curl -fsSL [https://ollama.com/install.sh](https://ollama.com/install.sh) | sh

2.2 Enable Local Network Access#

To allow other devices to use the AI, you must change the bind address from 127.0.0.1 to 0.0.0.0.