Git & GitHub Guide

Git & GitHub Guide#


1 Installation & Initial Configuration#

1.1 Installation#

MacOS (Requires Homebrew)#

brew install git

Linux (Debian/Ubuntu)#

apt-get install git

Verify Version#

git --version

1.2 Global Configuration#

# Set Identity
git config --global user.name "Marc Ouellet"
git config --global user.email "marc.ouellet@gmail.com"

# Set Default Branch to match GitHub (main)
git config --global init.defaultBranch main

# Verify Settings
git config --global user.name
git config --global user.email

# Common Alias
git config --global alias.s "status"

2 The Collaborative Workflow#

To work simultaneously on the same project without overwriting each other, you should follow a specific cycle for every work session. This process ensures that everyone stays in sync while moving one step at a time.

GPU Passthrough Guide

Proxmox GPU Passthrough Guide (NVIDIA Tesla P4)#


1. Proxmox Host Configuration#

Pre-requisites#

  • Ensure PCIe Bifurcation is set to OFF in the server BIOS.

Enable IOMMU#

  1. Open the GRUB configuration:
nano /etc/default/grub
  1. Modify the line GRUB_CMDLINE_LINUX_DEFAULT="quiet" to:
GRUB_CMDLINE_LINUX_DEFAULT="quiet intel_iommu=on"
  1. Update GRUB:
update-grub
  1. Reboot the host.

Verify IOMMU Status#

dmesg | grep -e DMAR -e IOMMU

Note: Look for the line: DMAR: IOMMU enabled.


2. VM Configuration (Ubuntu 24.04)#

VM Hardware Settings#

  • Machine: q35
  • BIOS: SeaBIOS
  • Note: Do NOT run apt update or upgrade yet.

Add PCIe Device#

  1. Shut down the VM.
  2. Go to Hardware > Add > PCI Device.
  3. Select Raw Device > Select your GPU.
  4. Ensure All Functions and PCI-Express are checked.

3. Driver Installation in VM#

Verify Hardware Detection#

lspci -v
lspci -nnk | grep -iA2 nvidia

Prepare Build Environment#

Required for version 550+ drivers:

Grafana & InfluxDB Installation

Grafana & InfluxDB Installation Guide#


1. Install Grafana#

Documentation: Grafana Debian Installation
Video Reference: Grafana Setup Guide

Install Prerequisites#

apt-get install -y apt-transport-https software-properties-common wget

Import GPG Key#

mkdir -p /etc/apt/keyrings/
wget -q -O - [https://apt.grafana.com/gpg.key](https://apt.grafana.com/gpg.key) | gpg --dearmor | sudo tee /etc/apt/keyrings/grafana.gpg > /dev/null

Add Stable Repository#

echo "deb [signed-by=/etc/apt/keyrings/grafana.gpg] [https://apt.grafana.com](https://apt.grafana.com) stable main" | tee -a /etc/apt/sources.list.d/grafana.list

Install Grafana OSS#

apt-get update
apt-get install grafana -y

Enable and Start Service#

systemctl daemon-reload
systemctl enable grafana-server
systemctl start grafana-server
systemctl status grafana-server

2. Install InfluxDB#

Documentation: InfluxDB Installation

HP Server BIOS Performance Profiles

HP Server BIOS Performance & Power Profiles#


Performance vs. Power Savings Comparison#

Proxmox settings Performance & Power Management Proxmox Aliases Permanent Bash SSH Aliases

Use the following table to configure your HP server nodes based on their specific workload requirements (e.g., HP1 for 100% Performance, Garage nodes for Power Savings).

Sub-Menu Setting 100% Performance Optimized Hybrid 100% Power Savings
Main Workload Profile Low Latency Custom Minimum Power Usage
Power Mgmt Power Regulator Static High Performance OS Control Mode Static Low Power Mode
Power Mgmt Core C-State Disabled Enabled (C6) Enabled (C6)
Power Mgmt Package C-State Disabled Enabled (PC6) Enabled (PC6)
Power Mgmt Energy Perf. Bias Max Performance Balanced Perf. Power Savings Mode
Power Mgmt Collaborative Power Disabled Enabled Enabled
Power Mgmt Intel Turbo Boost Enabled Enabled Disabled
Power Mgmt Energy Efficient Turbo Disabled Disabled Enabled
Memory NUMA Group Size Clustered Clustered Flat
Memory Sub-NUMA Cluster Disabled Disabled Disabled
Memory Memory Speed Max / Auto Max / Auto Minimum (e.g., 2133)
Memory Stale A to S Enabled Enabled Enabled
Memory LLC Dead Line Alloc Enabled Enabled Disabled
Prefetchers Hardware Prefetcher Enabled Enabled Disabled
Prefetchers Adjacent Cache Line Enabled Enabled Disabled
Prefetchers DCU Streamer/IP Enabled Enabled Disabled
I/O Options Intel VT-d Enabled Enabled Enabled
I/O Options SR-IOV Enabled Enabled Enabled
I/O Options Above 4G Decoding Enabled Enabled Enabled
I/O Options I/O Non-posted Prefetch Disabled Disabled Enabled
UPI Options Link Enablement All Links All Links Single Link
UPI Options Link Power Mgmt Disabled Enabled Enabled
UPI Options Link Frequency Max / Auto Auto Minimum
UPI Options UPI Prefetcher Enabled Enabled Disabled
UPI Options Direct to UPI (D2K) Enabled Enabled Disabled
Adv. Tuning Jitter Control Auto-Tuned Disabled Disabled
Adv. Tuning Enhanced Proc. Perf. Enabled Enabled Disabled
Adv. Tuning PCI P2P Serialization Disabled Disabled Enabled
Adv. Tuning IODC Configuration Auto Auto Disabled
Adv. Tuning Posted Interrupt Thr. Disabled Disabled Enabled
Adv. Power Redundant PSU Mode Balanced Balanced High Efficiency

HP1 (Main Cluster): Use the 100% Performance column to minimize latency for your Docker containers and local AI (Ollama).

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#

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

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#

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

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"

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

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#

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'

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

Repository & Templates#

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

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#

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

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

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#

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

BIOS & Hardware#

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

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#

Permissions & Scripts#

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

Scheduling & Processes#

# Instant test of cron behavior (Sends message to all terminals)
* * * * * echo "Hello from cron" | wall
# Cancel a pending shutdown
shutdown -c
# Print the path of the folder you are in
pwd

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.