Skip to content

Instantly share code, notes, and snippets.

View Git-on-my-level's full-sized avatar

David Zhang Git-on-my-level

View GitHub Profile
@Git-on-my-level
Git-on-my-level / remote-headless-mac-setup.md
Created January 28, 2026 10:38
Set up a new Mac to with SSH/Mosh, Tailscale, and minimal sane tmux setup

Mac-to-Mac Remote Shell Stack (Tailscale + SSH + Mosh + tmux) — Low-Lag, High-Reliability Setup

This gist documents a reproducible setup for a “remote shell that feels local” between a laptop and one or more headless Macs (e.g., Mac minis). It is optimized for:

  • High latency / packet loss links (SSH typing lag, key repeats, “rubber band” echo)
  • Roaming networks (Wi-Fi drops, IP changes)
  • Long-lived sessions (detach/reattach, crash tolerance)

Core design decisions:

  • Tailscale provides a private, encrypted, stable network plane (no port forwarding/NAT complexity).
  • OpenSSH (Remote Login) is used for authentication, key management, and compatibility.
@Git-on-my-level
Git-on-my-level / update_git_repos.sh
Last active August 14, 2025 11:40
Update `main` for multiple git repositories in the current directory
#!/bin/bash
# Initialize arrays to store results
successful_updates=()
failed_updates=()
skipped_repos=()
no_git_repos=()
@Git-on-my-level
Git-on-my-level / fix-git-filename-case.sh
Created May 14, 2025 13:29
Bash script to fix Git file case mismatches on case-sensitive filesystems (e.g., macOS APFS). Solves the problem of when you rename a file, but git doesn't recognize the filename as changed.
#!/bin/bash
# Set IFS to prevent word splitting issues with spaces in paths
IFS=''
# Use git ls-files -z and a while loop with null delimiter
# The '-d $'\0'' tells read to use null character as delimiter
# The '-r' prevents backslash escapes from being interpreted
git ls-files -z | while IFS= read -r -d $'\0' file_path; do