System Administration Prompt Cheatsheet

Quick-reference prompt templates for system administration, DevOps, and troubleshooting tasks.

Published by DutchBSD B.V. Published
Quick-reference prompts for system administration tasks
Quick-reference prompts for system administration tasks

Introduction

This cheatsheet gives practical prompts for system administration, DevOps, and SRE work. Each entry shows the pattern, an example prompt, and the expected outcome. Use this as a quick reference alongside the full guide: Prompt Engineering for System Administration .


Script generation

PatternExample promptOutcome
Disk monitoringWrite a Bash script for Ubuntu 22.04 that checks disk usage on / every hour and emails an alert if usage exceeds 80 percent.Generates a shell script with df and mail integration, suitable for cron.
Process monitoringCreate a PowerShell script that lists all processes consuming more than 200MB RAM, sorted by usage.Outputs a PowerShell script using Get-Process with filtering and sorting.
Log rotationWrite a Bash script to rotate logs in /var/log/myapp/ weekly, keeping 4 backups.Produces a logrotate-style script with compression and retention.

Config generation

PatternExample promptOutcome
Web serverGenerate an Nginx reverse proxy config for a Flask app on port 5000, including SSL with Let’s Encrypt.Secure Nginx config with proxy settings and SSL block.
DatabaseWrite a PostgreSQL pg_hba.conf that allows local connections for role appuser but denies remote access.Access control config with explicit host rules.
KubernetesProvide a Kubernetes YAML to deploy a Redis pod with a PersistentVolumeClaim for storage.Complete manifest with pod, PVC, and deployment spec.

Log analysis

PatternExample promptOutcome
Web logsAnalyze this Apache access log and summarize the 3 most common HTTP status codes.Produces a frequency breakdown of codes like 200, 404, 500.
Database logsHere are 50 lines from a MySQL error log. Identify recurring errors and likely causes.Highlights repeated issues such as failed connections or table corruption.
System logsReview this syslog snippet and explain which service is failing and why.Identifies service failures and suggests possible fixes.

Security audits

PatternExample promptOutcome
SSHAudit this sshd_config and list insecure settings. Suggest safer alternatives.Flags weak ciphers, root login enabled, missing restrictions.
NginxReview this nginx.conf for security hardening. Recommend headers like CSP and HSTS.Produces a list of security header improvements.
ContainersGiven this Dockerfile, point out potential security issues and propose fixes.Identifies risky practices like running as root or using latest tags.

Documentation and runbooks

PatternExample promptOutcome
Service restartWrite a runbook for restarting PostgreSQL on Ubuntu 22.04 safely.Step-by-step checklist with commands and verification steps.
Incident responseDraft incident response steps for diagnosing an Nginx 502 Bad Gateway error.Procedural guide: check upstream service, logs, and configs.
DeploymentDocument the steps to roll out a new version of a Dockerized app using Kubernetes rolling updates.Ordered instructions with kubectl commands and rollback strategy.

Best practices

  • Always provide OS, tool, or service versions for accurate answers
  • Ask for explanations, not just code or configs
  • Request non-destructive commands first (dry runs, safe flags)
  • Treat generated output as a draft and validate before use

Further reading