Setup Checklist

  1. Basic Node setup (needed on all nodes dev, server, etc) Background services running as non root

    mkdir -p /home/piegarden/.local/share/systemd/user
    # needed otherwise services will only work when the user is logged in
    sudo loginctl enable-linger $USER
    # verify
    loginctl show-user $USER -p Linger
    
  2. Remove Windows Junk Use custom removal option, because you really want to get rid of the game bar stuff. It is very annoying https://github.com/Raphire/Win11Debloat

  3. Install Webi CLI.

  4. Install GitHub CLI.

    webi gh
    
  5. Clone Neovim Config: Reference

    gh auth login
    
    • Windows

      cd ~/AppData/Local && gh repo clone nvim
      
    • Linux

      cd ~/.config && gh repo clone nvim
      
    • macOS

      cd ~/.config && gh repo clone nvim
      
  6. Emplace dotfiles

    # only remove if you are sure all your files are tracked in git
    rm -rf ~/.config/hypr
    ln -s ~/.config/nvim/dotfiles/hypr ~/.config/hypr
    
    rm -rf ~/.config/espanso
    ln -s ~/.config/nvim/dotfiles/espanso ~/.config/espanso
    
  7. Install monitor manager Option 1. (prefered) Reference

    yay -S hyprmon-bin
    # run hyprmon and set positioning and scaling
    hyprmon
    

    Option 2. Alternatively you can edit the monitors.conf file, but I found the TUI to be a far better experience Scalling to monitor size Uncomment the correct lines in:

    ~/.config/hypr/monitors.conf
    
  8. Install Neovim.

    • install stuff to help tree-sitter

      # For installing new parsers
      cargo install tree-sitter-cli && \
         echo 'export PATH="$HOME/.cargo/bin:$PATH"' >> ~/.bashrc && \
         source ~/.bashrc
      tree-sitter --version
      # For compiling the parsers written in C
      brew upgrade zig || brew install zig
      
      # Helpers
      cd ~/Downloads
      
      git clone https://codeberg.org/jeremiahvaughan/base64-toggle.git
      cargo install --path ./base64-toggle
      
      git clone https://codeberg.org/jeremiahvaughan/random-string.git
      cargo install --path ./random-string
      
      cd -
      
    • Reference

    • Open Neovim.

    • If you see an install error, it just means something needs to be installed; handle the dependency and restart Neovim.

    • After restarting, run:

      :checkhealth
      
    • If Neovim misbehaves, view logs with:

      :messages
      

      For tree-sitter issues you may want to clear the cache: nvim troubleshooting

  9. Install neovide https://neovide.dev/

    • Arch

      sudo pacman -S neovide
      
  1. Install the nvim-helper CLI used by <leader>b and the random log helpers.

    cd ~/.config/nvim/tools/nvim-helper
    go install
    
    • Ensure the resulting binary directory (usually $GOBIN or $GOPATH/bin) is on your PATH.
    • Run make nvim-helper-test (from the repo root) to execute the helper's unit tests; the command automatically isolates Go's build cache in /tmp/nvim-gocache.
    • Run make base64-test to execute the Neovim end-to-end check that exercises the mapping against a scratch buffer.
    • Use :GoUpdate inside Neovim to run the helper's Go module updater; set vim.g.go_update_target_version (defaults to 1.24.7) to control the enforced go directive and populate the quickfix list with updated go.mod files.
  2. Fixing path issues for GUI applications like NEOVIDE Set env vars like $PATH in: ~/.config/hypr/envs.conf. This lets your

    env = PATH,/home/piegarden/.local/opt/go/bin:/home/piegarden/go/bin:$PATH
    # Reload for changes to take effect:
    hyprctl reload
    # then restart session (reload alone isn't enough)
    
  3. Install ripgrep for fuzzy search

    • Reference

      #deb
      sudo apt-get install ripgrep
      
  4. Install staticcheck for additional Go analysis.

  5. Install Nerd Fonts Hack (Hack Nerd Font Mono).

  6. Install one these:

    • WezTerm
    • Alacritty
  7. Install delta

    • Reference

      # Arch
      pacman -S git-delta
      # Mac
      brew install git-delta
      
  8. Install LazyGit.

    • Reference

    • Emplace config file:

    • Windows

      Copy-Item .\lazygit\config.yml $env:APPDATA\lazygit\config.yml
      
      • Linux

        rm -rf ~/.config/lazygit
        ln -s ~/.config/nvim/dotfiles/lazygit ~/.config/lazygit
        
  9. Install jq

    webi jq
    
  10. Restore Vimium from backup.

  11. Install htop for resource monitoring.

    • Unix

      brew install htop
      
    • Windows

      choco install ntop.portable
      
    • Deb

      sudo apt install htop
      
  12. Emplace .gitconfig

    cp ~/.config/nvim/dotfiles/.gitconfig ~/
    
  13. Install fd

    webi fd
    
  14. Install shellcheck for shell script linting.

  15. Add SSH key.

    nvim id_ed25519
    chmod 600 id_ed25519
    
  16. Create deploy and service directories.

    mkdir -p ~/deploy
    mkdir -p ~/.local/share/systemd/user
    
  17. Configure production & staging in .ssh/config

    • Optional: sftp another computer and copy that .ssh/config
  18. Install Codex (he likes using python as a tool so we add that for him).

    brew install codex
    webi python3
    
  19. Install sops Reference

  20. Install Age Reference

    go install filippo.io/age/cmd/...@latest
    
  21. Install raspberry pi imager

    sudo pacman -S rpi-imager
    sudo -E rpi-imager
    
    # or
    
    sudo pacman -S flatpak
    flatpak install flathub org.raspberrypi.rpi-imager
    flatpak run org.raspberrypi.rpi-imager
    
    
  22. Install LVFS to update bios

    sudo pacman -S fwupd
    
  23. Syncthing / Wiki

  24. Install Fossil

  25. Rsync

    sudo pacman -S rsync
    
  26. Secrets Management

  27. Cron Jobs

  28. Install Draw.io Desktop

    • Reference

      mkdir -p ~/Applications
      VERSION=29.5.2
      mv ~/Downloads/drawio-x86_64-${VERSION}.AppImage ~/Applications/
      chmod +x ~/Applications/drawio-x86_64-${VERSION}.AppImage
      mv "${HOME}/Applications/drawio-x86_64-${VERSION}.AppImage" ~/Applications/drawio.AppImage
      cat <<-EOF > "${HOME}/.local/share/applications/drawio.desktop"
      [Desktop Entry]
      Name=Draw.io
      Exec=/home/piegarden/Applications/drawio.AppImage
      Icon=/home/piegarden/Applications/drawio.png
      Type=Application
      Categories=Utility;
      Terminal=false
      EOF
      
      
  29. Cross Compiler for Rust Install Rust

    # 1) Ensure rustup-managed toolchain is installed
    curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
    rustup default stable
    rustup toolchain install stable
    
    # 2) Add ARM64 Rust target to that toolchain
    rustup target add --toolchain stable aarch64-unknown-linux-gnu
    
    # 3) Cross C toolchain (needed by sqlite3-sys and other C deps)
    sudo pacman -S --needed aarch64-linux-gnu-gcc
    
    # 4) Verify
    rustup target list --installed | rg aarch64-unknown-linux-gnu
    rustup show active-toolchain
    which cargo rustc rustup
    
  30. Disable Docker if you not using it (it can conflict with dnsmasq which is useful for setting up local dns without having to edit hosts file

    systemctl stop docker docker.socket && \
        systemctl disable docker docker.socket && \
    

    systemctl stop containerd &&
    systemctl disable containerd &&
    sudo rm -f /etc/systemd/resolved.conf.d/20-docker-dns.conf

  31. For windows install

    choco install windirstat
    

    Revo Uninstaller

  32. mkcert

    sudo pacman -S mkcert
    
  33. Inkscape

    sudo pacman -Syu inkscape
    
  34. Espanso Reference

    sudo pacman -S wxwidgets-gtk3
    # Clone the Espanso repository
    git clone https://github.com/espanso/espanso
    
    cd espanso
    
    # Compile espanso in release mode
    # NOTE: this will take a while (~5/15 minutes)
    cargo build -p espanso --release --no-default-features --features modulo,vendored-tls,wayland
    sudo mv target/release/espanso /usr/local/bin/espanso
    # Register espanso as a systemd service (required only once)
    espanso service register
    
    # Start espanso
    espanso start
    
    # Your screen will flicker until you run this
    sudo setcap "cap_dac_override+p" $(which espanso)
    
  35. Net Tools (nslookup)

    sudo pacman -S bind
    
  36. Flameshot (screenshot tool) Referenc

    brew install --cask flameshot
    
  37. Eza

    cargo install eza
    

References

Using vim-dadbod

Command to open vim-dadbod

:DBUI 

Connection string format for sqlite

sqlite://<file-system-path>

Example:

sqlite:///data/data.db
  1. Sqlite

    #deb
    sudo apt update
    sudo apt install sqlite3
    #arch
    sudo pacman -S sqlite
    
  2. Markdown Linter

    cargo install rumdl
    
  3. Paper Scanner

Plugin the scanner via usb

Driver Scan Button Helper

sudo apt update
sudo apt install sane-utils libsane1

cat << EOF > scan.service
[Unit]
Description=Scanner Service that allows button on scanner to work
After=network-online.target

[Service]
WorkingDirectory=/home/piegarden/Downloads
ExecStart=/usr/bin/brscan-skey -f
Restart=always
RestartSec=45

[Install]
WantedBy=default.target
EOF
# Check connected scanners
scanimage -L

Golang Profiler

Setup

sudo apt-get install graphviz -y

Generate profile and view

make p
go tool pprof http://localhost:8081/debug/pprof/profile?seconds=30
go tool pprof -http=:8082 http://localhost:8081/debug/pprof/profile?seconds=1

Install Maybe

  1. Install bat (used by the snippets generator).

  2. Configure copy/paste for remote SSH sessions.

    • macOS via iTerm2 (recommended).

    • macOS alternative:

      cp ./alacritty.toml "$HOME/.alacritty.toml"
      

      or

      cp ./.wezterm.lua "$HOME/.wezterm.lua"
      
    • Windows:

      Copy-Item .\alacritty.toml $env:APPDATA\alacritty\alacritty.toml
      

      or

      Copy-Item .\.wezterm.lua $env:USERPROFILE\.wezterm.lua
      
  3. Install Starship.

    • Reference: https://starship.rs

    • Place configs:

      ln -s "$HOME/.config/nvim/starship/starship.toml" ~/.config/starship.toml
      
    • Windows PowerShell profile:

      Copy-Item .\starship\Microsoft.PowerShell_profile.ps1 $profile
      
  4. Ensure the Chrome Tab Limit extension is installed and set to 4 tabs.

  5. Ubuntu accessibility adjustments:

    • Disable slow animations.
    • Enable large text.
    • Enable Night Light via Settings → Displays.
    • Configure fingerprint reader.
  6. Install 1Password TUI.

    go install github.com/JeremiahVaughan/one-password-tui@latest
    
  7. Install i3.

    sudo apt install i3 -y
    mkdir -p ~/.config/i3
    cp ./i3/config ~/.config/i3/config
    
  8. Install zsh (optional; bash is fine).

    sudo apt install zsh -y
    chsh -s /bin/zsh
    
  9. fzf

    webi fzf
    
  10. AP mode in case you don't have a wireless AP handy: ref: https://wiki.archlinux.org/title/Software_access_point

    sudo pacman -S hostapd
    sudo pacman -S dnsmasq
    in /etc/hostapd/hostapd.conf
        set ssid, wpa_passphrase, 
    

    enable ieee80211n, ieee80211d, ieee80211ac, ieee80211ax, disable require_ht (windows wants this) set: wpa=2, wpa_key_mgmt=WPA-PSK, rsn_pairwise=CCMP, country_code=US

     sudo systemctl enable hostapd
     sudo systemctl start hostapd
     sudo systemctl enable dnsmasq
     sudo systemctl start dnsmasq
     sudo mkdir /etc/systemd/system/hostapd.service.d
     sudo nvim /etc/systemd/system/hostapd.service.d/override.conf
    
    
     [Unit]
     BindsTo=sys-subsystem-net-devices-wlan0.device
     After=sys-subsystem-net-devices-wlan0.device
    
     check active dns leases
     ```bash
     cat /var/lib/misc/dnsmasq.leases
    
    
  11. Firefox as alternate popular browser for testing

    yay -S firefox
    # or
    sudo pacman -S firefox
    
  12. Rust TUI email client

    cargo install himalaya --locked --features "oauth2 keyring"
    

    Install one password cli to manage the email secrets OnePassword

  13. Crush (opencode) Reference

    go install github.com/charmbracelet/crush@latest
    # give crush the golang lsp
    webi go-essentials
    # give crush the rust lsp
    rustup component add rust-analyzer
    # place your api key:
    # 1 (neovide). ~/.config/uwsm/env
    # 2 (shell). ~/.bashr
    

    Local model install Ollama On Windows make sure Ollama is exposed

  14. In settings, open it up to local network

  15. Set env var

    OLLAMA_HOST=0.0.0.0
    
  16. anki flash cards Install

export VERSION="26.08"
tar xaf "Downloads/anki-${VERSION}-linux-x86_64.tar.zst"
cd anki-linux
mkdir -p ~/Applications
mv anki.png "${HOME}/Applications/anki.png"
sudo ./install.sh

export ANKI=$(which anki)
cat <<-EOF > "${HOME}/.local/share/applications/anki.desktop"
[Desktop Entry]
Name=Anki
Exec=${ANKI}
Icon=${HOME}/Applications/anki.png
Type=Application
Categories=Utility;
Terminal=false
EOF

Troubleshooting

Recovery

Run recover:

./recovery.sh

Mass Deploy

./mass-deploy.sh

Nvim

  1. Wipe out NVIM cache:

    rm -rf ~/.cache/nvim ~/.local/state/nvim ~/.local/share/nvim
    
    Remove-Item -Recurse -Force "$env:LOCALAPPDATA\nvim-data"
    
  2. Start neovim with no configs

    nvim -u NONE
    

Kill a service that refuses to die

systemctl --user kill -s SIGKILL <service_name>

Maintenance

Database maintenance

If you need to delete a bunch of data from the DB:

# Turn off database backups
systemctl --user stop jobby

# Turn off the service
systemctl --user stop shepherd

# Run the query
sqlite3 ~/deploy/shepherd-data/data 'DELETE FROM service_log;'

# Vacuum the database
sqlite3 ~/deploy/shepherd-data/data 'VACUUM;'

# Checkpoint the WAL file
sqlite3 ~/deploy/shepherd-data/data 'PRAGMA wal_checkpoint(TRUNCATE);'

# Verify sizes are what you expect
ls -hal ~/deploy/shepherd-data

# Turn on the database backups
systemctl --user start jobby

# Turn on the service
systemctl --user start shepherd

Home Router

Direct ports for UDP for current node

cd ~/deploy
fd -t f -g 'port.txt' -x sh -c 'head -n1 "$1"' sh {} | paste -sd, -