This page is a scrubbed, public-safe version of an internal AI/SI operations runbook — the
command cheat-sheet a systems engineer builds up over years of running Linux servers,
virtualisation hosts, firewalls, databases, certificates and Raspberry Pi devices.
It is organised into the same sections as the original workbook, one page each — reach any of
them from the AI/SI Prompts menu above. Every
task on this page shows three things:
A description — what the task achieves and which tools it uses.
The commands — the actual snippet, exactly as recorded, with every
credential, token, licence key and internal host name or IP replaced by a
<PLACEHOLDER>.
An AI prompt — a ready-to-paste instruction that asks an AI assistant to
regenerate that snippet as a clean, parameterised, re-runnable script.
The point of the AI-prompt column is to show how a pile of accumulated tribal knowledge can
be turned into something an assistant can reproduce and improve on demand: you keep the intent,
and let the model rewrite the mechanics for whatever host you are on today. Nothing on this
page should be run without reading it first — several snippets are destructive
(dd, rm -rf, postsuper -d ALL, firewall reloads).
New install
Sets the global Git identity (user name and email) on a fresh host before its first commit.
Generate a Bash script for the task “New install”. Parameterise the user name and email, set them with git config --global, skip any value that is already set, and print the resulting identity. Assume CentOS/RHEL or Raspberry Pi OS as appropriate, comment each step, and never hard-code a real identity — read it from the environment.
Set remote to another git server
Points the repository at a new remote, creates a branch named after the host, pushes it upstream and records the change with etckeeper.
Generate a Bash script for the task “Set remote to another git server”. Parameterise the remote URL and branch (default $HOSTNAME); add the origin (or update it if one exists), create and switch to the branch, push it with upstream tracking, and commit via etckeeper when it is installed. Assume CentOS/RHEL or Raspberry Pi OS as appropriate, comment each step, and never hard-code a real credential — read secrets from the environment.
Get and view all branches
Fetches every remote branch and lists local and remote branches together.
Commands
git fetch -a && git branch -a
AI prompt
Generate a Bash script for the task “Get and view all branches”. Fetch all remotes, prune deleted branches, and list local and remote branches with the current branch highlighted and each branch’s last commit date. Comment each step and make it safe to run in any repository.
If the hostname is wrong
Recovers when the host’s branch was created under the wrong hostname: remove the origin and redo the remote and branch setup.
Commands
git remote remove origin
Then run all of the above
AI prompt
Generate a Bash script for the task “If the hostname is wrong”. Parameterise the remote URL and the correct branch name (default $HOSTNAME); remove the existing origin, re-add it, create and push the correctly named branch, and optionally delete the mis-named branch locally and on the remote after confirmation. Assume CentOS/RHEL or Raspberry Pi OS as appropriate, comment each step, and never hard-code a real credential — read secrets from the environment.
Verify all repos for security alerts (Dependabot)
Scans all personal GitHub repositories for open critical or high-severity Dependabot security alerts, reporting which repos have alerts enabled and their current alert counts.
Commands
gh api /user/repos --paginate -q '.[].full_name' | while read repo; do
crit=$(gh api "/repos/$repo/dependabot/alerts?state=open&severity=critical" -q 'length' 2>/dev/null)
high=$(gh api "/repos/$repo/dependabot/alerts?state=open&severity=high" -q 'length' 2>/dev/null)
if [ -z "$crit" ] && [ -z "$high" ]; then
echo "$repo: dependabot alerts not enabled/accessible"
else
echo "$repo: critical=${crit:-0} high=${high:-0}"
fi
done
AI prompt
Generate a Bash script to verify all GitHub repos for david-mrai have 0 critical or high security alerts. Use gh api /user/repos --paginate to list all repos, then query each repo's Dependabot alerts API for open critical and high-severity alerts. Report which repos have alerts enabled and their current counts. Exit with status 0 if all repos have zero alerts, non-zero if any repo has critical or high alerts. Assume the user has gh CLI installed and authenticated, comment each step, and never hard-code credentials — read from environment.