Skip to content

Instantly share code, notes, and snippets.

View dragonworx's full-sized avatar

dragonworx

  • Australia
View GitHub Profile
# ── commit ───────────────────────────────────────────────────────────────────
# stage everything, let haiku write the message, then commit and push after a
# confirm. Enter or y accepts; esc, n or anything else leaves changes staged.
commit() {
git rev-parse --is-inside-work-tree >/dev/null 2>&1 || {
print -u2 "commit: not inside a git repository"; return 1
}
# Colours stay empty when stdout isn't a terminal, so piping stays clean.
local C_RESET C_DIM C_BOLD C_GREEN C_RED

VPS Setup Runbook

Ubuntu 26.04 · 4 vCPU / 8 GB · two gists, two stages, ~15 min.

Gists

Gist File Contents
1ef59bb1… ubuntu-bootstrap.sh Stage 1 — asks questions, patches, fetches stage 2
0953c926… ubuntu-provision.sh Stage 2 — everything else (sshkey embedded inside)
#!/usr/bin/env bash
#
# provision.sh — first-run provisioning for a fresh Ubuntu 26.04 LTS VPS
#
# Target : Ubuntu 26.04 LTS "Resolute Raccoon", 4 vCPU / 8 GB RAM
# Run as : root, on a brand new machine, once
#
# sudo bash provision.sh 2>&1 | tee /root/provision.log
#
# Takes roughly 10-15 minutes. A verification pass at the end reports
#!/usr/bin/env bash
#
# ubuntu-bootstrap.sh — stage 1 of 2. Small enough to read before you run it.
#
# Fresh Ubuntu 26.04 box, logged in as root:
#
# curl -fsSL "https://gist.githubusercontent.com/dragonworx/1ef59bb118bf018d876d4a0cab78e67d/raw/ubuntu-bootstrap.sh?cb=$(date +%s)" | bash
#
# Job: collect what stage 2 needs, patch the box, install the packages needed
# to fetch stage 2, then hand off. Nothing else.
@dragonworx
dragonworx / gitsnips.md
Last active October 29, 2021 04:52
Git Snips

Commits

Get hash for commit: git rev-parse HEAD

Stop commit during message edit in VIM: :cq (q! doesn't stop commit)

Adding

@dragonworx
dragonworx / .gitconfig
Last active September 23, 2021 00:47
Gitconfig aliases
[alias]
st = status
ci = commit
br = branch
co = checkout
com = checkout master
fe = fetch origin
bn = !git for-each-ref --format='%(refname:short)' `git symbolic-ref HEAD`
rb = rebase
rbm = rebase master