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
2.3k Points42 Badges3 Connections4 Followers23 Following

Posts by BashSnippets

BashSnippets in Articles 3 min read
The backup ran every night at 2am and emailed me a green "847 files archived" summary. I'd built it, tested it against my own home directory where every file was named like report2024.csv, watched it sail through, and shipped it. For weeks the summar...
post-cover-20592
BashSnippets in Articles 4 min read
For three weeks a deployment pipeline reported every step green and shipped a build that had failed to compile on every single run. The build step ended in npm run build | tee build.log so the output could be archived. That pipe is the whole story: b...
post-cover-20433
BashSnippets in Tutorials 3 min read
A backup script of mine created a lock file on startup so two copies couldn't run at once — sensible. Then one night it hit an error partway through, set -e killed it on the spot, and it died without ever reaching the line that removes the lock. The ...
post-cover-20323
BashSnippets in Tutorials 6 min read
Every time I provision a new server — whether it's a $5 DigitalOcean droplet for a side project or a client's production box — there's a set of scripts I copy to /opt/scripts before I do anything else. Not after the app is deployed. Not after the fi...
post-cover-20082
BashSnippets in 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
BashSnippets in Articles 5 min read
A client handed me SSH access to a server they'd been running for two years. No documentation. No handoff notes. No "here's what's running and why." Just a root password in a LastPass share and a Slack message that said "it hosts our web app, let us...
post-cover-19992
BashSnippets in 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
BashSnippets in 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
BashSnippets in Articles 3 min read
I used to open files to search for things. A config had the wrong database host somewhere. I knew it was in one of the files in /etc/nginx/ but I didn't know which one. So I opened nginx.conf. Searched. Not there. Opened sites-available/default. Sea...
post-cover-19376
BashSnippets in Articles 3 min read
Every time I SSH into a server, the first thing I want to know is: how's it doing? Not a deep dive. Not a monitoring dashboard. Just the basics: how long has it been running, how much RAM is left, is the disk getting full, what's the IP. Five things...
BashSnippets in Articles 2 min read
My project folder used to look like this: new-site/ new-site-2/ new-site-final/ new-site-final-ACTUAL/ test-backup/ backup-old/ Yours probably looks similar. We've all been there. You start a project, name the folder something reasonable, and then...
post-cover-19186
BashSnippets in Tutorials 8 min read
ShellCheck Error Codes Explained: How to Decode, Fix, and Prevent the Most Common Bash Warnings Level: Beginner to Intermediate Time: ~10 minutes What you'll leave with: A clear understanding of ShellCheck's error code system, how to fix the on...
post-cover-19016
BashSnippets in 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
BashSnippets in Tutorials 4 min read
Here's how it usually goes: You deploy something. Traffic is light. Server load sits at 15% and you move on to the next thing. Then traffic grows, or a cron job stacks on itself, or a memory leak slowly eats through your RAM over 72 hours. By the ti...
post-cover-18494
BashSnippets in Articles 4 min read
Nginx crashed on a Saturday night. An OOM kill, probably — I was running a Node app that leaked memory like a broken faucet. The service went down at 2:14 AM. I found out at 8:30 AM when I opened my laptop and saw Slack messages from six hours earlie...
post-cover-18487
BashSnippets in 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
BashSnippets in Articles 3 min read
It was a WordPress site on a $5 DigitalOcean droplet. Client's small business. Nothing fancy. I had SSH access. I had root. I had every tool I needed to set up automated backups. I just... didn't. Because it was a small site. Because I'd "get to it ...
post-cover-18480
BashSnippets in Tutorials 2 min read
Every experienced Linux user has been there: you install something, or move directories around, and suddenly command not found appears for tools you know are installed. You check which, type, echo $PATH, and still waste 10-20 minutes hunting down th...
post-cover-17087
BashSnippets in Tutorials 1 min read
The Problem You're setting file permissions and you type chmod 754... or was it 744? You Google it. Again. Or you're starting a new bash script and you copy the header block from your last script because you can't remember the exact set -euo pipef...
post-cover-16991
BashSnippets in Tutorials 2 min read
The Problem You're deploying a script and need the right file permissions. You type chmod 754... or was it 744? You Google it. You find a Stack Overflow thread from 2011. You get it wrong anyway. chmod's octal notation is one of those things every...
post-cover-16987
chevron_left

Latest Jobs

View all jobs →