linux-server-ops
Skill14 starsChanged 31 days agoMITView on GitHub
Audits and fixes Linux server resource pressure safely, with evidence. Covers full disks (ENOSPC, Errno 28), inode exhaustion, runaway logs, oversized journald, Docker images, volumes, logs and build cache, old kernels, package caches, core dumps, /tmp, memory and swap pressure, and runaway processes. Works read-only first, measures before and after, makes small reversible changes, never deletes data it cannot identify, asks before anything destructive, then adds prevention (logrotate, journald limits, Docker log options, alerts) and writes a short server report. Use when someone says \"disk full\", \"no space left on device\", \"Errno 28\", \"server is slow\", \"out of memory\", \"OOM killed\", \"what is eating my disk\", \"clean up my server\", \"docker is using all my space\" or \"load is high\".
- Reads credentials
In this repository63 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- board-advisorSkill
- bottleneck-removalSkill
- business-auditSkill
- business-starterSkill
- competitor-researchSkill
- founder-independenceSkill
- hand-it-offSkill
- happy-customerSkill
- hiring-replacementSkill
- meeting-follow-upSkill
- monday-numbersSkill
- new-hireSkill
- no-meeting-mondaySkill
- obsidian-brainSkill
- ops-deskSkill
- safe-resaleSkill
- spreadsheet-dashboardSkill
- warm-leadSkill
- downloadable-asset-engineeringSkill
- html-to-pdfSkill
- precision-pdf-editingSkill
- repo-radarSkill
- secure-credentialsSkill
- security-auditorSkill
- best-timeSkill
- brand-deal-filterSkill
- comment-replySkill
- content-monthSkill
- daily-socialSkill
- dm-closerSkill
- idea-bankSkill
- marketing-teamSkill
- reel-ideationSkill
- reel-scorecardSkill
- trial-postSkill
- viral-breakdownSkill
- youtube-seoSkill
- caption-engineSkill
- content-multiplierSkill
- edit-styleSkill
- footage-ingestSkill
- longform-editSkill
- podcast-repurposeSkill
- raw-to-reelSkill
- ready-to-filmSkill
- reel-captionsSkill
- script-polishSkill
- thumbnail-generatorSkill
- use-local-whisperSkill
- conversion-funnel-auditingSkill
- llms-txtSkill
- seo-agentSkill
- website-designerSkill
- website-devSkill
- be-conciseSkill
- humanizerSkill
- launch-weekSkill
- linkedin-writerSkill
- newsletterSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
10 rules. About 0 are common, 5 are distinctive, and 5 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
5
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 24
Never delete data you cannot identify: If you cannot say what wrote a file, what reads it and how it would be rebuilt, it stays.
- Very specific: line 29
Lock-out safety: Never change SSH, firewall or network config without a second way in (provider console or a second SSH path).
- Very specific: line 31
Secrets stay secret: Never print .env files, keys or credentialed unit files.
- Very specific: line 37
Run the inventory block in references/commands.md: df in bytes and inodes (separate problems), memory and swap, top processes, failed …
- Very specific: line 58
Use du -x so mounts are not counted twice.
- Distinctive: line 74
/tmp: only files past a stated age, not open, from a producer you recognise.
- Distinctive: line 77
If the disk is still full after the safe steps, more deletion is not the answer.
- Very specific: line 81
Add only what addresses the cause you found, and validate each config with its own checker.
- Distinctive: line 94
No new "No space left on device" since the fix.
- Distinctive: line 95
Every new config passed its validator.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Linux Server Ops
A full disk or a starved server usually has one boring cause: a log nobody rotates, a cache nobody prunes, a process that leaks. The real danger is the cleanup, like docker system prune -a --volumes on a live box deleting a database. This skill finds the cause with measurements, frees space in the safest order, and stops it coming back.
Commands target Ubuntu and Debian. Notes for RHEL-family, Alpine and Arch are in references/commands.md, which holds every copy-paste command this file refers to.
What it does
- Inventory the server read-only: disks, inodes, memory, swap, top processes, services, containers.
- Diagnose what is actually growing and why, with numbers.
- Fix in a fixed order, safest first, measuring each step. Anything destructive waits for a yes.
- Prevent recurrence: rotation, size limits, alerts.
- Verify services are healthy and write
SERVER-REPORT.mdfromtemplates/SERVER-REPORT.md.
Safety rules
- Read-only first. Inventory and diagnose change nothing. Some passive-sounding commands mutate:
npm cache verifygarbage-collects,docker buildx ducan write config, and anyclean,prune,purge,gc,vacuumorautoremovedeletes. Keep those for the fix step. - Measure before and after every change. The final
dfdifference is the real result, not the sum of what you deleted (hard links, sparse files and other writers make them differ). - Never delete data you cannot identify. If you cannot say what wrote a file, what reads it and how it would be rebuilt, it stays. Report it as "unknown, kept".
- Always keep, unless the owner names the exact item: databases and their WAL or journal files, Docker volumes, backups and snapshots, git repositories, user uploads and home directories, credentials and keys, anything under
/var/libthat belongs to a running service, files under/tmpthat are recent or held open. - Ask before destructive steps. Show the exact command, paths, measured size and what is lost. A yes covers that bundle only.
- Prefer reversible moves. Truncate instead of delete, move instead of remove, disable a service before removing its unit, back up a config before editing it.
- Do not kill what you do not understand. Find the process's service and owner, and stop it through systemd rather than
kill -9. - Lock-out safety. Never change SSH, firewall or network config without a second way in (provider console or a second SSH path). Keep the current session open and test from a new one. Validate first (
sshd -t,nft -c). No second path, no change: write it up instead. - Do not make it worse. On a nearly full disk, install and download nothing during the audit.
- Secrets stay secret. Never print
.envfiles, keys or credentialed unit files. Redact.
Steps
1. Inventory (read-only)
Run the inventory block in references/commands.md: df in bytes and inodes (separate problems), memory and swap, top processes, failed units, docker system df, journalctl --disk-usage, and the timestamp. Write the numbers into the report's "Before" section straight away.
2. Diagnose
Work out which of these it is. More than one is common.
| Symptom | Likely cause | How to confirm |
df at 100% | big files or directories | du -x by level, largest files list |
df says full, du total is much smaller | deleted files still held open | lsof +L1 |
df has space, writes fail | inodes exhausted | df -i at 100%, count files per directory |
/var/log huge | a log with no rotation, or a debug flag left on | measure the file twice 30 s apart for growth rate |
/var/lib/docker huge | container JSON logs, dangling images, build cache, volumes | docker system df -v, per-container log sizes |
/var/log/journal huge | no journald size limit | journalctl --disk-usage |
/boot full | old kernels piling up | dpkg -l 'linux-image-*' vs uname -r |
/var/cache/apt or ~/.cache large | package caches | du -sh each |
/var/crash or /var/lib/systemd/coredump large | crashing process dumping core | coredumpctl list |
high load, slow, OOM in dmesg | a process leaking memory, too little RAM, no swap | dmesg -T, journalctl -k, RSS over time |
Rules for diagnosis:
- Use
du -xso mounts are not counted twice.du -d1 /hides regular files directly under/; a swap file there is often the "missing" gigabytes. - The largest file is not automatically the cause. A large database can be correct; an unbounded log or cache is the defect.
- Measure growth twice, do not guess it. Check whether a noisy log is the cause or a symptom of a disk that was already full.
- For memory, page cache is fine. "Available is low and swap is busy" is the problem, not "free is low".
3. Fix (safest first)
Go in this order and stop once there is comfortable headroom (at least 15% or a few GB free). Record bytes freed per step.
- Stop the bleeding. Truncate a fast-growing file in place (
truncate -s 0 FILE) once you know its producer. Deleting it frees nothing while the process holds it open. - Deleted-but-open files. Restart or reload the owning service. Ask first on production.
- Package caches.
apt-get clean; language caches only if nothing is mid-install. - Journald.
journalctl --vacuum-size=500M. - Rotated logs, core dumps, crash reports past retention, after noting any crash in the report.
- Old kernels.
apt-get autoremove --purge, never the one fromuname -r. - Docker: truncate oversized container logs, then dangling images, build cache, identified stopped containers. Ask first before
docker image prune -a. Never remove volumes unless the owner names each one: that is where databases live. - /tmp: only files past a stated age, not open, from a producer you recognise.
- Memory: restart a leaking process through systemd, cap it with
MemoryMax=, or add swap if there is none. Do not disable the OOM killer.
If the disk is still full after the safe steps, more deletion is not the answer. Give the owner options with measured sizes: bigger disk, move data to another volume, or retire a workload.
4. Prevent
Add only what addresses the cause you found, and validate each config with its own checker. Snippets are in references/commands.md.
- logrotate for app logs without it. Test with
logrotate -d. - journald limits via a drop-in (
SystemMaxUse=,SystemKeepFree=). - Docker log limits in
daemon.json(max-size,max-file). They only apply to new containers; existing ones need recreating (ask first) or a logrotate rule for their exact log paths. - Bounded scheduled cleanup, e.g. weekly build-cache prune older than 7 days. No
-a, no volumes in cron. - A disk alert that is silent when healthy, checks block %, free bytes and inode %, and has a cooldown. Wire it to the notification channel you already use.
- Core dump cap with
MaxUse=.
5. Verify
- Rerun
df -B1,df -i,free -h. Report used-space reduction and available-space gain separately (on ext4 freed space refills reserved blocks first). systemctl --failedunchanged; healthy containers still healthy, same IDs unless recreated on purpose.- No new "No space left on device" since the fix; the growth source measured again and stable.
- Every new config passed its validator; the alert is silent when healthy and fires on a forced test.
Output
Fill templates/SERVER-REPORT.md (off the full disk if possible): a three-line summary (what was wrong, what was done, current headroom), before and after numbers, actions with bytes freed, what was kept and why, prevention added, and decisions waiting on the owner. In the chat, give only the summary, the before and after line, and pending yes or no questions.
Honest limits
- Triage and hygiene, not capacity planning. If data is legitimately growing, the fix is more disk.
- Numbers are point-in-time; on a busy server they move while you measure.
- It cannot know your retention rules (compliance logs, audit trails). State them before cleanup.
- It does not tune databases (VACUUM, compaction). That needs the database's own tools and a maintenance window.
- Tested on Ubuntu and Debian; other distros get notes, not guarantees.
- With no backup and no second way in, it will tell you to fix that first and will refuse SSH or firewall changes.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

