Posts by BashSnippets

@BashSnippets

BashSnippets

Building a free bash script library. One script at a time | https://bashsnippets...
North America bashsnippets.xyz Joined May 2026
4k Points • 117 Badges • 10 Connections • 11 Followers • 30 Following

Comments by BashSnippets

5 days • Articles • 5 min read
certbot had been running quietly on my server for almost two years without a single issue. Automatic renewals. Silent cron job. I never thought about it. Set it up once, tested it once, and mentally moved it to the "solved" column of my infrastructu...
post-cover-19878
5 days • Tutorials • 4 min read
Three Lines of Bash Stand Between Your Cron Job and a Silent Outage Level: Intermediate · Time: 6 min · Outcome: A hardened, ShellCheck-clean cron wrapper generated for you Three separate incidents taught me the same lesson over about a year. A /1...
post-cover-21961
5 days • Articles • 1 min read
A demo script called report, two directories on PATH, and one mv between them, all on a scratch tmpfs: $ report report 2.1: 14 jobs ok exit=0 $ mv /opt/jobs/bin/report /opt/jobs/newbin/report $ ls -l /opt/jobs/newbin/report rwxrwxr-x 1 root root 42 ...
5 days • Articles • 1 min read
A 64M scratch tmpfs, a worker process holding its log open on file descriptor 3, and the usual reflex when space runs low: rm the log. du on the directory dropped from 48M to 0. df stayed at 48M used. The next 32M write failed with No space left on d...
Oct 15 • Articles • 1 min read
The standard bash alerting pattern ends the same way everywhere you read it: pipe the finding into mail. So I checked what my own box would actually do with that line. $ type -a mail mailx sendmail mail not found mailx not found sendmail not found ...
Oct 10 • Articles • 1 min read
Who owns that port? One ss flag answers it without sudo For months my dev server started on 3001 because something already held 3000, and I kept stepping around it. When I finally asked, ss -ltn 'sport = :3000' showed the port listening on every in...
post-cover-27426
Oct 10 • Articles • 1 min read
A script that writes straight to the path a consumer reads can die halfway and leave a torn file that everything downstream loads as complete. No error appears anywhere, because the only process that failed is gone. I tested the fix the unfriendly wa...
Oct 10 • Articles • 1 min read
A four-line YAML file port: 8080, supportemail, transport: tcp, reportdir: /var/reports and the rename most people type first: sed -i 's/port/listenport/g' app.yml. GNU sed 4.9 exited 0 and printed nothing, because -i never does. Afterwards the file ...
Oct 10 • Articles • 1 min read
I set three log files to known ages with touch -d — exactly 30 days, 30 days and 12 hours, and 31 days — then ran what I thought was a 30-day retention policy: find . -name '.log' -mtime +30 It returned one file: the 31-day-old one. The 30.5-day f...
Jul 1 • Tutorials • 6 min read
I meant to delete the .cache files under a data directory. The server had been running for two months and the cache layer had grown to about 14GB. The application team told me it was safe to purge it — they'd rebuilt the cache logic and the old files...
post-cover-20867
Jul 1 • Articles • 4 min read
My Backup Hadn't Run in 9 Days and Nothing Told Me Level: Intermediate · Time: 5 min · Outcome: A cron command that can't hang forever The backup ran fine every night for fourteen months, and then it didn't run for nine days, and nothing told me. ...
post-cover-21384
Jun 9 • Tutorials • 6 min read
Nobody announces small features. You ship them, they're in there, and the people who find them either notice or they don't. I want to start documenting these because some of them are the kind of thing that makes a tool actually worth using day-to-day...
post-cover-20000
Jun 7 • Articles • 3 min read
Here's a script that will ruin your day: !/bin/bash cd /nonexistent/folder rm -rf echo "Done" The cd fails because the folder doesn't exist. Bash ignores the failure. rm -rf runs in whatever directory you were already in. The script prints "Done...
post-cover-19616
Jun 3 • Articles • 4 min read
The Problem Nobody Talks About 970 million people worldwide live with mental health disorders. But almost every mental health tool built with AI assumes the same user: fast internet, English as a first language, a US or UK phone number to call in ...
post-cover-19609
Jun 3 • Articles • 2 min read
I'm Wasey, a solo developer from Varanasi, India. I built DramaHub — a fully live OTT streaming app on Google Play Store. 7,000+ downloads, 1,000+ daily active users, sub-1% crash rate, ₹0/month infrastructure. Here's the exact architecture that m...
May 28 • Articles • 6 min read
I have lost work exactly once. It was a side project. A static site I'd been building over a weekend. I was reorganizing the folder structure, running mv commands to shuffle things around, and I fat-fingered a path. Moved an entire directory into a ...
post-cover-19015
May 28 • Articles • 1 min read
Most developers buy a domain before deploying a portfolio or project online. But recently, I discovered DigitalPlat FreeDomain — a platform that allows developers to register free domains under extensions like .qzz.io and connect them to services l...
post-cover-19178
May 21 • Tutorials • 6 min read
I Google "bash remove file extension" at least once a month. Every time I need ${filename%.txt} I have to look it up. I've written that exact syntax probably 40 times across different scripts. My brain refuses to memorize it. And every time I need i...
post-cover-18495
chevron_left