
Founder of @AgentScoutHQ. Building a daily-tested directory of AI agents & MCP servers. Notes, stacks, real numbers.
Joined September 2023
- Tweets5.5K
- Following7.1K
- Followers2.1K
- Likes30.1K
Pinned Tweet
AgentScout now tracks 6,000+ AI agent tools.
3,200+ MCP servers. Daily link checks. Live handshake tests. Fresh listings every morning.
Find the right agent for the job in seconds, free.
agentscouthq.com
44
When a server says the disk is full, I don't go hunting by hand anymore. One line shows where the space went:
du -xh -d 1 / 2>/dev/null | sort -h | tail -5
Then run it again inside the biggest folder, and keep going down. -x keeps it on one filesystem, so mounted drives don't muddy the numbers.
20
Backing up a SQLite database with cp while the app is running? You can end up with a copy that won't open or is missing data.
sqlite3 app.db ".backup backup.db"
The .backup command, or VACUUM INTO 'backup.db' on SQLite 3.27+, makes a consistent copy while the app keeps writing. In WAL mode, recent writes live in app.db-wal, so copying app.db alone misses them.
20
A bash script that keeps running after a step fails can do real damage. Put this at the top:
set -euo pipefail
-e stops on the first failed command. -u makes an unset variable an error instead of an empty string. pipefail catches failures inside a pipe, so npm run build | tee build.log stops the script when the build fails.
15
Typing the same long ssh command with a key file, a port and a user every time? Give the server a name in ~/.ssh/config.
Host prod
HostName 203.0.113.10
User deploy
Port 2222
IdentityFile ~/.ssh/prod_ed25519
Now it's ssh prod. scp, rsync and git over SSH pick up the same name.
13
My scripts call curl with --fail-with-body now. Plain curl exits 0 on a 404 or a 500, so the script keeps going as if the request worked.
curl -sS --fail-with-body "$API_URL"
Any HTTP status of 400 or higher makes curl exit with code 22, and the error body still shows up in the log. It needs curl 7.76 or newer. On older versions, use --fail, which drops the body.
31
Turning on DMARC for your domain? Start with p=none, not reject.
p=none doesn't change delivery, but with a rua address set, mailbox providers send you daily reports on everything sent as your domain.
Those reports surface the senders you forgot about, like a billing system or a form service. Fix their SPF or DKIM alignment, then move to quarantine and later to reject.
20
Still installing dotenv just to read a .env file? Node can load it itself.
node --env-file=.env server.js
It's built in since Node 20.6. Variables already set in the real environment win over the file, so a stray .env won't override production settings. Put the flag before the script name, or Node hands it to your script as an argument instead.
1
34
A cron job that runs every 5 minutes but sometimes takes 7 will end up running twice at once. Wrap it in flock.
*/5 * * * * flock -n /tmp/sync.lock /usr/local/bin/sync.sh
With -n, a new run exits right away if the last one still holds the lock. The lock is released when the process exits, even if it crashes, so there's no stale lock to clean up.
33
Every fetch() in my scripts gets a timeout now. fetch has no timeout option, and a hung API can stall a job for minutes.
fetch(url, { signal: AbortSignal.timeout(5000) })
After 5 seconds it rejects with a TimeoutError. Catch that, log which URL it was, and decide whether to retry or fail the job.
2
1
62
Setting a session cookie? Three flags do most of the work.
HttpOnly keeps JavaScript, including injected scripts, from reading it. Secure sends it only over HTTPS. SameSite=Lax keeps it off most cross-site requests, which blocks a lot of CSRF.
Set all three yourself. Some browsers treat a cookie with no SameSite as Lax, but not all of them do.
35
Want to know when your TLS certificate actually expires, not when you think it renews? Ask the server.
echo | openssl s_client -connect "$HOST:443" -servername "$HOST" 2>/dev/null | openssl x509 -noout -enddate
Keep -servername. Without it, a server hosting several sites can return a different certificate than your visitors get. Swap -enddate for -checkend 1209600 and it exits non-zero inside 14 days, which is easy to alert on.
26
Postgres won't stop a runaway query on its own. Set statement_timeout on your app's role.
ALTER ROLE app_user SET statement_timeout = '5s';
New sessions for that role cancel any statement that runs longer than 5 seconds. Pooled connections pick it up when they reconnect, and a migration that needs longer can raise it for its own session.
1
32
Seeing "database is locked" from SQLite once a second request shows up? Turn on WAL mode.
PRAGMA journal_mode=WAL lets reads keep going while a write happens. It's stored in the database file, so you set it once.
There's still one writer at a time, so also set PRAGMA busy_timeout=5000 on every connection. A second writer then waits up to 5 seconds instead of failing right away.
39
Want only the certificate authorities you actually use to be able to issue for your domain? Add a CAA record.
Add an issue entry for each CA you use, for example 0 issue "letsencrypt.org". dig CAA yourdomain shows what's set now.
List every CA that issues for you, including your CDN's, or the next renewal fails. Public CAs have to check CAA before they issue.
34
About to run git clean to get a fresh tree? Run it with -n first.
git clean -n -d prints every untracked file and folder it would delete and touches nothing. Untracked files aren't in Git, so once they're gone, Git can't bring them back.
Be extra careful with -x. It also removes ignored files, which means your .env and local config go too.
21
Cron job runs fine when you paste it in a terminal but does nothing from crontab? Check for a %.
In a crontab line, % means newline, so date +%F cuts your command off right there. Escape it as \%F.
The other usual suspect is PATH. Cron's is minimal, so set PATH at the top of the crontab or use full paths. Moving the command into a script avoids both.
27
Put your site behind Cloudflare and the origin still gets every page request? Check cf-cache-status.
By default Cloudflare caches static files like images, CSS and JS, but not HTML. curl -sI your page and you'll see cf-cache-status: DYNAMIC.
To cache pages, add a Cache Rule set to Eligible for cache, and bypass it for anything personal, like logged-in or admin paths.
31
Giving a cron job, a dashboard or an AI agent access to your Stripe account? Don't hand it your secret key. Make a restricted key.
In the Stripe dashboard, a restricted key starts with rk_ and you set each resource to None, Read or Write. A revenue report only needs Read on charges and subscriptions.
One key per job also means you can revoke one leaked key without breaking everything else.
1
26











