[Reference](./arch.md)
Create Key
set -euo pipefail
umask 077
# Create gpg key password
ITEM_ID="$(op item create --category Password --vault Private --title "pacman gpg key" --generate-password='letters,digits,64' --format json | jq -r .id)"
# Display password so you can enter it when prompted
op item get "${ITEM_ID}" --reveal --fields "password" --format json | jq -r .value
gpg --full-generate-key
# Choose ECC sign only because we only need to sign for publishing packages use-case, no encryption needed.
# (10) ECC (sign only)
# Choose Curve 25519 option because it is widely supported
# (1) Curve 25519 *default*
# Select 2 years for expiration so if you lose the key it will automatically expire, it is fine to extend expiration
# Real name: frii.day Pacman Repository
# Email address: pacman@frii.day
# Comment: Package Signing
GPG_FINGERPRINT="$(gpg --with-colons --fingerprint --list-secret-keys "pacman@frii.day" | awk -F: '$1 == "fpr" { print $10; exit }')"
PRIVATE_KEY_NAME="pacman-signing-private.asc"
PUBLIC_KEY_NAME="pacman-signing-public.asc"
TMP_DIR="$(mktemp -d)"
trap 'rm -rf "$TMP_DIR"' EXIT
gpg --armor --export-secret-keys "${GPG_FINGERPRINT}" > "${TMP_DIR}/${PRIVATE_KEY_NAME}"
gpg --armor --export "${GPG_FINGERPRINT}" > "${TMP_DIR}/${PUBLIC_KEY_NAME}"
op item edit "${ITEM_ID}" "private_key[file]=${TMP_DIR}/${PRIVATE_KEY_NAME}"
op item edit "${ITEM_ID}" "public_key[file]=${TMP_DIR}/${PUBLIC_KEY_NAME}"
op item edit "${ITEM_ID}" "rev_cert[file]=${HOME}/.gnupg/openpgp-revocs.d/${GPG_FINGERPRINT}.rev"
# todo generating the key locally is fine but put in on pi since doing the signing locally is awkward
# op read 'op://Private/pacman-gpg-key/password' |
# ssh alarm 'gpg --batch --pinentry-mode loopback --passphrase-fd 0 ...'
set -euo pipefail
GPG_FINGERPRINT="$(gpg --with-colons --fingerprint --list-secret-keys "pacman@frii.day" | awk -F: '$1 == "fpr" { print $10; exit }')"
ssh alarm "echo \"GPGKEY=${GPG_FINGERPRINT}\" > ~/.makepkg.conf"
TEMP_KEY="/tmp/key.gpg"
op read "op://Private/pacman gpg key/private_key" | ssh alarm "cat > ${TEMP_KEY}"
op item get --reveal "pacman gpg key" --fields "password" |
ssh alarm "gpg --batch --pinentry-mode loopback --passphrase-fd 0 --import ${TEMP_KEY}"
./fossil_install.md
Install treesitter parsers for neovim
nvim
:TSInstall go rust javascript css html sql markdown lua bash toml json regex
go install github.com/nats-io/natscli/nats@latest
mkdir -p ~/deploy
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
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
Install Webi CLI (not on arch though, pacman/yay good good)
Install GitHub CLI (not on arch).
webi gh
Install monitor manager (really good for getting a new monitor configured correctly) 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, you can also just use the TUI and uninstall it after Uncomment the correct lines in:
~/.config/hypr/monitors.conf
Install Neovim 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 -
Verify Neovim health.
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
Install the nvim-helper CLI used by <leader>b and the random log helpers.
cd ~/.config/nvim/tools/nvim-helper
go install
$GOBIN or $GOPATH/bin) is on your PATH.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.make base64-test to execute the Neovim end-to-end check that exercises the mapping against a scratch buffer.: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.Install staticcheck for additional Go analysis.
Install htop for resource monitoring.
Unix
brew install htop
Windows
choco install ntop.portable
Deb
sudo apt install htop
Install shellcheck for shell script linting.
Configure production & staging in .ssh/config
Install raspberry pi imager
sudo pacman -S rpi-imager
sudo -E rpi-imager
Syncthing / Wiki
Install Fossil
Secrets Management
Cron Jobs
For windows install
choco install windirstat
mkcert
sudo pacman -S mkcert
Inkscape
sudo pacman -Syu inkscape
Net Tools (nslookup)
sudo pacman -S bind
Command to open vim-dadbod
:DBUI
Connection string format for sqlite
sqlite://<file-system-path>
Example:
sqlite:///data/data.db
Sqlite
#deb
sudo apt update
sudo apt install sqlite3
#arch
sudo pacman -S sqlite
Markdown Linter
cargo install rumdl
Paper Scanner
Plugin the scanner via usb
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
sudo apt-get install graphviz -y
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 bat (used by the snippets generator).
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
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
Ensure the Chrome Tab Limit extension is installed and set to 4 tabs.
Ubuntu accessibility adjustments:
Install 1Password TUI.
go install github.com/JeremiahVaughan/one-password-tui@latest
Install i3.
sudo apt install i3 -y
mkdir -p ~/.config/i3
cp ./i3/config ~/.config/i3/config
Install zsh (optional; bash is fine).
sudo apt install zsh -y
chsh -s /bin/zsh
fzf
webi fzf
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
Firefox as alternate popular browser for testing
yay -S firefox
# or
sudo pacman -S firefox
Rust TUI email client
cargo install himalaya --locked --features "oauth2 keyring"
Install one password cli to manage the email secrets OnePassword
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
In settings, open it up to local network
Set env var
OLLAMA_HOST=0.0.0.0
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
Run recover:
./recovery.sh
./mass-deploy.sh
Wipe out NVIM cache:
rm -rf ~/.cache/nvim ~/.local/state/nvim ~/.local/share/nvim
Remove-Item -Recurse -Force "$env:LOCALAPPDATA\nvim-data"
Start neovim with no configs
nvim -u NONE
systemctl --user kill -s SIGKILL <service_name>
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
Direct ports for UDP for current node
cd ~/deploy
fd -t f -g 'port.txt' -x sh -c 'head -n1 "$1"' sh {} | paste -sd, -