shell
bash_code
Disk Guard Script
disk_guard_bash
Return only Bash code. Write a script that checks disk usage for /, prints a human-readable warning, and exits with status 1 when usage is above 85 percent. Requirements: include a shebang, use df -P /, parse the numeric percentage, and keep the script production-safe.
#!/usr/bin/env bashdf -P /85exit 1
python
python_code
IPv4 Validator
ipv4_python_tests
Return only Python code. Write a function named is_valid_ipv4(value: str) -> bool and include exactly three pytest tests that cover a valid address, an out-of-range octet, and a non-numeric input.
def is_valid_ipv4def test_assertsplit('.')
ops
shell_lines
Nginx Safe Reload
nginx_safe_reload
Return only Bash commands, one per line. Back up /etc/nginx/nginx.conf, validate nginx config, and reload nginx only if validation passes.
cp /etc/nginx/nginx.confnginx -tsystemctl reload nginx&&
planning
four_numbered_steps
YAML Validator Plan
yaml_cli_plan
Return exactly four numbered steps. Plan a Python CLI that scans a git repo for changed YAML files, validates them against a JSON schema, and exits nonzero on failure.
1.2.3.4.JSON schemagit
debugging
five_bullets
SSH Lockout Triage
ssh_lockout_triage
Return exactly five bullet points. After hardening, SSH started returning Permission denied (publickey,password). List the safest first checks before changing config. Mention sshd_config, authorized_keys, journalctl, rollback, and PasswordAuthentication.
sshd_configauthorized_keysjournalctlrollbackPasswordAuthentication