Multi-platform personal machine initialization and bootstrap toolchain for Ubuntu, macOS (Apple Silicon), legacy Debian, and Windows / Cygwin.
Centralizes environment provisioning across servers, single-board computers (e.g. Orange Pi / Raspberry Pi), personal Macs, and Windows workstations with a unified toolchain philosophy: uv for user-space Python, modern CLI utilities, grapeot/.dotfiles integration, oh-my-zsh, and Git identity Yan Wang <[email protected]> on Ubuntu, macOS, and Cygwin (legacy Debian 7 uses [email protected]).
| Path | Target Platform | Execution Model | Description |
|---|---|---|---|
setup_ubuntu.sh |
Ubuntu Linux (22.04+ / Debian-like, x86_64 & aarch64) | Idempotent CLI script | Modern Linux server / SBC bootstrap (apt packages, uv, oh-my-zsh, rupa/z, dotfiles, git config, zsh default shell, verification). |
mac/setup.sh |
macOS (Apple Silicon arm64) |
5-stage pipeline | Master orchestrator: bootstrap → TUI apps (may call davinci.sh) → DaVinci presence check (does not invoke davinci.sh) → verify. Darwin/arm64 guard lives here only. |
mac/bootstrap.sh |
macOS (arm64) |
Standalone / Stage 1 | Unconditional base layer: Xcode CLT, Homebrew, gum, uv, core CLI formulae, Meslo Nerd Font, mas-cli, oh-my-zsh, git config, dotfiles, system preferences. No Darwin/arm64 guard of its own. |
mac/apps.sh |
macOS (arm64) |
Standalone / Stage 2+3 | Interactive multi-select TUI: 25 GUI items (23 brew casks + DaVinci handler + Antigravity Tools GitHub DMG), 11 CLI formulae + rustup, 3 App Store apps. |
mac/davinci.sh |
macOS (arm64) |
Standalone / called from apps.sh |
Automated DaVinci Resolve downloader and installer via Blackmagic API registration flow. setup.sh Stage 4 does not run this script. |
mac/verify.sh |
macOS (arm64) |
Standalone / Stage 5 | Comprehensive post-install verification of CLI binaries, GUI apps, dotfiles, git config, and preferences. |
setup_debian.sh |
Debian 7 (Legacy x86_64) | Single-run desktop script | Historical Debian 7 server-to-desktop setup (apt sources unstable, XFCE4, SSH port 30, Chrome / Dropbox deb downloads, QuickTile). |
setup_windows.ps1 |
Windows (PowerShell) | PowerShell script | Windows bootstrap: Chocolatey, git, Cygwin installer invocation, and dotfiles symlink setup. |
cygwin.sh |
Cygwin | Cygwin zsh script | Cygwin environment setup invoked by setup_windows.ps1 (oh-my-zsh, rupa/z, dotfiles, SSH host config). |
quicktile.cfg |
Linux X11 | Config file | Keyboard-driven window tiling configuration for QuickTile (used by setup_debian.sh). |
docs/dev_mac.md |
macOS | Specification / Prompt Layer | Generative Kernel specification, complete app inventory, cask mappings, and design rationale. |
docs/working.md |
All | Documentation | Architectural changelogs, lessons learned, and maintenance notes. |
Recommended for modern Ubuntu server installations, cloud instances, and ARM single-board computers (e.g. Orange Pi Zero 3W, Raspberry Pi).
cd DebianInit
./setup_ubuntu.shsetup_ubuntu.sh is guarded by set -euo pipefail and is designed to be safe to re-run:
- Apt Packages (
sudo): Installs core utilities:- Editors & Shell:
vim,zsh,tmux - Version Control & Development:
git,tig,build-essential,pkg-config - File & Network Utilities:
curl,wget,rsync,htop,zip,unzip,dos2unix,parallel,trash-cli
- Editors & Shell:
- Python Toolchain (
uv): Installsuvvia the official standalone script (UV_NO_MODIFY_PATH=1to preserve dotfiles symlinks). Distro system Python is untouched. The current-sessionPATHincludes both~/.local/binand~/.cargo/bin. - Environment Setup: Appends
export PATH="$HOME/.local/bin:$PATH"to~/.zshenvif that file does not already mention.local/bin. Does not persist~/.cargo/binin~/.zshenv. - Shell & Navigation:
- Installs ohmyzsh/ohmyzsh via the official unattended installer if
~/.oh-my-zshis not already a directory (directory-only check; does not inspectoh-my-zsh.sh). - Clones rupa/z to
~/zif not present.
- Installs ohmyzsh/ohmyzsh via the official unattended installer if
- Dotfiles Deployment: Clones grapeot/.dotfiles to
~/.dotfilesif missing, then always executesdeploy_linux.sh(backs up.vimrc,.zshrc,.tmux.confto.bakand creates symlinks). - Git Identity: Sets global Git configuration:
user.name=Yan Wanguser.email=[email protected]push.default=simple,color.ui=auto,core.fileMode=false
- Login Shell: Changes the user default shell via
chsh -s "$(command -v zsh)"(skipped if already zsh). Does not hardcode/usr/bin/zsh. Does not change SSH port 22. - Automated Verification: Verifies presence of
zsh,git,tmux,uv, andtrash-put.
Note on SBC / Vendor OS Images: Some vendor Linux distributions (e.g. certain Orange Pi / Armbian images) populate a stub directory at
~/.oh-my-zshcontaining onlycache/.setup_ubuntu.shtreats any existing~/.oh-my-zshdirectory as installed and will skip the official installer. In this scenario, move the stub aside (mv ~/.oh-my-zsh ~/.oh-my-zsh.bak) and re-run the script (orgit clone --depth=1 https://github.com/ohmyzsh/ohmyzsh.git ~/.oh-my-zsh).
The macOS initialization toolchain follows the Generative Kernel architecture: combining an unconditional deterministic foundation with interactive user selection and automated API fallbacks.
cd DebianInit
./mac/setup.shmac/setup.sh (Darwin arm64 only)
├── Stage 1: mac/bootstrap.sh (Critical base layer — aborts on failure)
├── Stage 2+3: mac/apps.sh (Interactive TUI — continues on partial failure; calls davinci.sh if DaVinci is selected)
├── Stage 4: DaVinci presence check (does not invoke davinci.sh; warns to run it separately if missing)
└── Stage 5: mac/verify.sh (Comprehensive post-installation health check)
Each stage script can also be executed independently:
mac/bootstrap.sh:- Installs Xcode Command Line Tools (
xcode-select --install). - Installs Homebrew (
/opt/homebrew) and adds it to PATH. - Installs
gum(charmbracelet TUI engine). - Installs
uvstandalone toolchain (curl -LsSf https://astral.sh/uv/install.sh | sh, noUV_NO_MODIFY_PATH; PATH export is session-only). - Installs core CLI formula suite:
coreutils,wget,tmux,ripgrep,htop,btop,macmon,p7zip,rsync,nmap,shellcheck,tig,socat,gh,git-lfs,exiftool,neovim,fd,lazygit,zellij. - Installs
font-meslo-lg-nerd-font(cask) andmas(formula; mas-cli). - Configures oh-my-zsh (official unattended installer; directory-only check), Git identity (
Yan Wang <[email protected]>; alsopush.default=simple,color.ui=auto,core.fileMode=false), and — only if~/.dotfilesis absent — clones grapeot/.dotfiles and runsdeploy_mac.sh. - Sets macOS preference
DSDontWriteNetworkStores = TRUE(prevents.DS_Storeclutter on network drives).
- Installs Xcode Command Line Tools (
mac/apps.sh:- Interactive multi-select dialogs powered by
gum choose(all items pre-selected by default; deselect to skip). - GUI Applications (25 items: 23 brew casks + DaVinci special handler + Antigravity Tools GitHub DMG): Claude, ChatGPT, ChatGPT Atlas, Cursor, Codex, LM Studio, Ollama, VS Code, Android Studio, Docker Desktop, iTerm2, Telegram, Zoom, DaVinci Resolve, Gyroflow, BambuStudio, OpenSCAD, Roon, Tailscale (standalone), Windows App, 1Password, Firefox, Rectangle, Antigravity, Antigravity Tools (GitHub Release DMG from
lbjlaq/Antigravity-Manager). - CLI Tools & Compilers (11 formulae + rustup):
ffmpeg,sox,zbar,pandoc,marp-cli,borgbackup,cmake,go,swig,astrometry-net,argyll-cms, and Rust via officialrustup.rs(sh -s -- -y). - App Store via
mas: Compressor (ID:424390742), Photomator (ID:1444636541), Xcode (opensmacappstore://apps.apple.com/app/id497799835for manual installation; not installed viamas).
- Interactive multi-select dialogs powered by
mac/davinci.sh(called fromapps.shwhen selected; not invoked bysetup.shStage 4):- Programmatically interacts with Blackmagic Design API (
GET /api/support/latest-stable-version/davinci-resolve/macandPOST /api/register/us/download/{downloadId}) to retrieve a time-limited signed URL for DaVinci Resolve (~6.5 GB.dmg/.zip/.pkg), downloads it with single-threadedcurl, andopens the file (does not unzip). Falls back toopen https://www.blackmagicdesign.com/products/davinciresolveon API failure.
- Programmatically interacts with Blackmagic Design API (
mac/verify.sh:- Checks core CLI binaries (
brew,git,nvim,tmux,rg,fd,lazygit,gh,zellij,gum,uv), a fixed optional/Applicationslist,DSDontWriteNetworkStores, existence of~/.dotfilesand~/.oh-my-zshdirectories, and Gituser.name/user.email.
- Checks core CLI binaries (
For detailed rationale, cask name mappings, and Tailscale configuration rules, refer to docs/dev_mac.md.
Provides a Unix-like CLI environment on Windows workstations.
From an elevated PowerShell session:
# Execute the automated Windows setup script
.\setup_windows.ps1The script performs (actual order):
- Downloads the official Cygwin 64-bit installer (
setup-x86_64.exe) and fetchescygwin.shfrom the GitHubmasterbranch (overwrites any local copy). - Installs Chocolatey and then
gitvia Chocolatey. - Runs the Cygwin installer with base packages:
vim,openssh,rsync,gcc-g++,make,wget,curl,dos2unix,tig,zsh,tmux. - Configures
/etc/passwdso the user home is/cygdrive/c/Users/<User>and the shell iszsh. - Launches
cygwin.shinside the Cygwin environment. - Installs
7zip,vim, andpython3via Chocolatey, then bootstraps pip viaget-pip.pyusing the hardcoded pathC:\Python36\python.exe. - Creates NTFS symlinks for
.vim,.vimrc, and.zshrcusing Windowskernel32.dll!CreateSymbolicLink.
- Installs oh-my-zsh and clones
rupa/z. - Clones
.dotfilesand links.tmux.conf(disables powerline for Windows terminal compatibility). - Sets global Git identity (
Yan Wang <[email protected]>). - Rewrites SSH daemon
Port 22→Port 30(reads/etc/sshd_config, writes/etc/ssh/sshd_config) and runsssh-host-config. - Does not set
push.defaultorcore.fileMode(onlyuser.name,user.email,color.ui).
⚠️ Historical Reference Only:setup_debian.shwas written for clean Debian 7 ("Wheezy") server installations from 2013. It is not idempotent and should not be executed on modern Debian/Ubuntu releases or ARM hardware.
su apt-get install sudo git git clone https://github.com/grapeot/DebianInit visudo # grant sudo privilege exit cd DebianInit ./setup_debian.sh | tee logs
Actions performed by the legacy script:
- Modifies
/etc/apt/sources.listpointing fromwheezytounstable(main contrib non-free). - Installs XFCE4 desktop environment, fonts, Adwaita theme, and audio stack (
pulseaudio). Does not install a display manager; ends withstartx. - Modifies SSH daemon port from 22 to 30 (
/etc/ssh/sshd_config). - Sets Git identity to
Yan Wang <[email protected]>(historical; other platforms use[email protected]). - Downloads and installs
amd64Debian packages for Google Chrome (google-chrome-stable_current_amd64.deb) and Dropbox (dropbox_1.6.0_amd64.deb). - Compiles and installs QuickTile (window tiling helper, not a window manager) from source and copies
quicktile.cfgto~/.config. - Switches default login shell to
zshviachsh -s $(which zsh)and starts X11 viastartx.
Maintained by Yan Wang (grapeot). Licensed under MIT or public domain where applicable.