~/devops-hub

Quick reference

18 tools

Every cheatsheet in the catalog, in one scroll — for when you know the tool and just need the command.

Docker Dockerfile

CommandWhat it does
docker psList running containers
docker ps -aList all containers, including stopped
docker imagesList local images
docker build -t name:tag .Build an image from a Dockerfile
docker run -d -p 8080:80 nameRun a container in the background with a port mapped
docker exec -it <id> shOpen a shell inside a running container
docker logs -f <id>Stream a container's logs
docker system prune -aRemove unused images, containers, and networks
docker compose up -dStart services defined in compose.yaml

→ full install guide

Kubernetes deployment.yaml

CommandWhat it does
kubectl get pods -AList pods in every namespace
kubectl get nodes -o wideList cluster nodes with details
kubectl apply -f file.yamlCreate or update resources from a manifest
kubectl describe pod <name>Show events and status for a pod
kubectl logs -f <pod>Stream logs from a pod
kubectl exec -it <pod> -- shOpen a shell inside a pod
kubectl rollout restart deploy/<name>Restart a deployment's pods
kubectl scale deploy/<name> --replicas=5Scale a deployment
kubectl config use-context <ctx>Switch cluster context

→ full install guide

Ansible playbook.yml

CommandWhat it does
ansible all -m ping -i inventoryCheck connectivity to all hosts
ansible-playbook site.ymlRun a playbook
ansible-playbook site.yml --checkDry-run without making changes
ansible-playbook site.yml --limit webRun against one host group
ansible-vault encrypt secrets.ymlEncrypt a file with Ansible Vault
ansible-galaxy install role_nameInstall a role from Galaxy
ansible-inventory --listPrint the resolved inventory as JSON

→ full install guide

Terraform main.tf

CommandWhat it does
terraform initDownload providers and set up the backend
terraform planPreview changes before applying
terraform applyApply changes to reach the desired state
terraform destroyTear down everything the state manages
terraform fmt -recursiveAuto-format .tf files
terraform validateCheck configuration syntax
terraform state listList resources tracked in state
terraform import addr idBring an existing resource under management

→ full install guide

Jenkins Jenkinsfile

CommandWhat it does
systemctl status jenkinsCheck service status (Linux)
java -jar jenkins-cli.jar -s URL list-jobsList jobs via the CLI
curl -X POST JENKINS_URL/job/NAME/buildTrigger a build via the REST API
Jenkinsfile: pipeline { agent any ... }Minimal declarative pipeline skeleton
sh 'command'Run a shell step inside a pipeline stage
archiveArtifacts artifacts: 'build/**'Save build output as an artifact

→ full install guide

Git .gitconfig

CommandWhat it does
git statusShow changed and staged files
git switch -c feature/xCreate and switch to a new branch
git add -pInteractively stage hunks
git commit -m "message"Commit staged changes
git rebase -i HEAD~5Interactively edit the last 5 commits
git stash / git stash popShelve and restore uncommitted work
git log --oneline --graph --allCompact visual history of all branches
git bisect startBinary-search commits for a regression

→ full install guide

Nginx nginx.conf

CommandWhat it does
sudo nginx -tTest config syntax before reloading
sudo systemctl reload nginxReload config without dropping connections
sudo systemctl status nginxCheck service status
tail -f /var/log/nginx/access.logFollow access logs
tail -f /var/log/nginx/error.logFollow error logs
nginx -VShow compiled-in modules and build flags
proxy_pass http://backend;Forward requests to an upstream in a server block

→ full install guide

Prometheus prometheus.yml

CommandWhat it does
upPromQL: 1 for targets currently reachable
rate(http_requests_total[5m])Per-second request rate over 5 minutes
histogram_quantile(0.95, ...)Compute the 95th percentile from a histogram
promtool check config prometheus.ymlValidate a config file
curl localhost:9090/-/reloadHot-reload config (needs --web.enable-lifecycle)
curl localhost:9100/metricsRead raw metrics from node_exporter

→ full install guide

Grafana dashboard.json

CommandWhat it does
localhost:3000Default web UI address (admin/admin on first login)
grafana-cli plugins install <id>Install a plugin from the catalog
sudo systemctl status grafana-serverCheck service status
/etc/grafana/grafana.iniMain server config file
/var/lib/grafana/grafana.dbDefault SQLite store for dashboards & users
Dashboards > Export > Save JSONExport a dashboard for version control

→ full install guide

Helm Chart.yaml

CommandWhat it does
helm repo add name urlAdd a chart repository
helm search repo keywordSearch added repositories
helm install release chartInstall a chart as a named release
helm upgrade --install release chartInstall or upgrade in one command
helm rollback release 1Roll back to a previous revision
helm list -AList releases across all namespaces
helm uninstall releaseRemove a release
helm template chartRender manifests locally without installing

→ full install guide

AWS CLI credentials

CommandWhat it does
aws configureSet access key, secret, region, and output format
aws sts get-caller-identityConfirm which identity/account you're using
aws s3 lsList S3 buckets
aws s3 sync ./dir s3://bucket/pathSync a local directory to S3
aws ec2 describe-instancesList EC2 instances and their state
aws --profile name <cmd>Run a command against a named profile
aws logs tail /log/group --followStream CloudWatch logs

→ full install guide

Vault vault-config.hcl

CommandWhat it does
vault server -devRun a throwaway dev server (never for production)
export VAULT_ADDR='http://127.0.0.1:8200'Point the CLI at a Vault server
vault loginAuthenticate the CLI session
vault kv put secret/app key=valueWrite a KV secret
vault kv get secret/appRead a KV secret
vault policy write name policy.hclUpload an access policy
vault operator unsealUnseal a Vault after startup

→ full install guide

Consul consul.hcl

CommandWhat it does
consul agent -devRun a single-node dev agent
consul membersList cluster members and their status
consul catalog servicesList registered services
consul kv put key valueWrite to Consul's key/value store
consul connect proxy -sidecar-for appRun a mesh sidecar proxy for a service
consul operator raft list-peersInspect the Raft consensus peers

→ full install guide

Podman Containerfile

CommandWhat it does
podman psList running containers
podman run -d -p 8080:80 nameRun a container in the background
podman build -t name:tag .Build an image from a Containerfile
podman pod create --name appCreate a pod grouping several containers
podman generate systemd --name appGenerate a systemd unit for a container
podman machine startStart the Linux VM backing Podman on macOS

→ full install guide

Argo CD application.yaml

CommandWhat it does
argocd login HOSTAuthenticate the CLI against a server
argocd app listList managed applications
argocd app sync my-appForce a sync from Git to cluster
argocd app get my-appShow sync status and diff
argocd app set my-app --sync-policy automatedEnable auto-sync for an app
kubectl -n argocd get podsCheck the health of Argo CD's own pods

→ full install guide

GitHub CLI config.yml

CommandWhat it does
gh auth loginAuthenticate the CLI with a GitHub account
gh repo clone owner/repoClone a repository
gh pr create --fillOpen a pull request from the current branch
gh pr listList open pull requests
gh pr checkout 123Check out a PR by number
gh issue listList open issues
gh workflow run name.ymlTrigger a GitHub Actions workflow
gh release create v1.0.0Cut a new release

→ full install guide

Vagrant Vagrantfile

CommandWhat it does
vagrant init hashicorp/bionic64Create a Vagrantfile for a base box
vagrant upCreate and boot the VM
vagrant sshSSH into the running VM
vagrant haltStop the VM
vagrant destroyDelete the VM entirely
vagrant statusShow current VM state
vagrant provisionRe-run provisioning scripts on a running VM

→ full install guide

Packer template.pkr.hcl

CommandWhat it does
packer init .Download required plugins for a template
packer validate template.pkr.hclCheck a template for errors
packer build template.pkr.hclBuild the image(s) defined in a template
packer fmt -recursiveAuto-format HCL templates
packer consoleInteractively evaluate HCL expressions

→ full install guide