<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Wealth Qubit</title>
    <description>The latest articles on DEV Community by Wealth Qubit (@wealthqubit).</description>
    <link>https://dev.to/wealthqubit</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3864447%2Feb9b0ee8-a7f3-4a32-8dda-ace95a7b64a9.png</url>
      <title>DEV Community: Wealth Qubit</title>
      <link>https://dev.to/wealthqubit</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/wealthqubit"/>
    <language>en</language>
    <item>
      <title>14 Bash Scripts I Use on Every Production Server</title>
      <dc:creator>Wealth Qubit</dc:creator>
      <pubDate>Mon, 06 Apr 2026 19:09:50 +0000</pubDate>
      <link>https://dev.to/wealthqubit/14-bash-scripts-i-use-on-every-production-server-445i</link>
      <guid>https://dev.to/wealthqubit/14-bash-scripts-i-use-on-every-production-server-445i</guid>
      <description>&lt;p&gt;I got tired of writing the same scripts for every client server.&lt;/p&gt;

&lt;p&gt;Every new Laravel deployment meant the same setup: monitoring, &lt;br&gt;
backups, health checks, deployment automation. Hours of work &lt;br&gt;
that should take minutes.&lt;/p&gt;

&lt;p&gt;So I packaged 14 production ready scripts into a vault I now &lt;br&gt;
drop onto every server in under 20 minutes.&lt;/p&gt;

&lt;p&gt;Here's every script, what it does, and why it exists.&lt;/p&gt;




&lt;h2&gt;
  
  
  The Setup
&lt;/h2&gt;

&lt;p&gt;Every script shares a single notification library &lt;code&gt;notify.sh&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Configure it once with your Slack webhook, Discord webhook, &lt;br&gt;
or email address. Every script calls it automatically. &lt;br&gt;
No manual editing across 14 files.&lt;/p&gt;

&lt;p&gt;Run &lt;code&gt;setup.sh&lt;/code&gt; once an interactive wizard asks which channel &lt;br&gt;
you want, tests the connection live, and configures everything.&lt;/p&gt;




&lt;h2&gt;
  
  
  1. selfheal.sh: Auto-restarts crashed processes
&lt;/h2&gt;

&lt;p&gt;Queue worker dies or gets stuck at 3am. PHP-FPM stops responding. &lt;br&gt;
MySQL crashes under load.&lt;/p&gt;

&lt;p&gt;Without this script: your client calls you at 7am asking &lt;br&gt;
why the site is down.&lt;/p&gt;

&lt;p&gt;With this script: it restarts automatically and sends a Slack &lt;br&gt;
alert before anyone notices.&lt;/p&gt;

&lt;p&gt;Checks nginx, php-fpm, mysql, and Laravel queue workers &lt;br&gt;
every 5 minutes via cron. Restarts anything that's down. &lt;br&gt;
Logs every incident.&lt;/p&gt;




&lt;h2&gt;
  
  
  2. health-report.sh: Daily server digest
&lt;/h2&gt;

&lt;p&gt;Every morning at 8am, Slack receives:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;CPU usage&lt;/li&gt;
&lt;li&gt;RAM usage&lt;/li&gt;
&lt;li&gt;Disk usage per mount point&lt;/li&gt;
&lt;li&gt;SSL expiry countdown&lt;/li&gt;
&lt;li&gt;Pending security updates&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;No dashboard. No monthly fee. One cron job.&lt;/p&gt;




&lt;h2&gt;
  
  
  3. deploy.sh: Zero downtime Laravel deployments
&lt;/h2&gt;

&lt;p&gt;One command runs the full deployment sequence:&lt;/p&gt;

&lt;p&gt;git pull → composer install → migrate → config cache → &lt;br&gt;
route cache → view cache → restart workers → Slack notification.&lt;/p&gt;

&lt;p&gt;On failure: sends a rollback alert with the exact error. &lt;br&gt;
Never find out about a broken deployment from a client again.&lt;/p&gt;




&lt;h2&gt;
  
  
  4. db-backup.sh: MySQL backups with S3 upload
&lt;/h2&gt;

&lt;p&gt;Compressed, timestamped dumps on a cron schedule.&lt;/p&gt;

&lt;p&gt;Slack notification on success. Email alert on failure. &lt;br&gt;
Optional S3 upload via AWS CLI for offsite storage.&lt;/p&gt;

&lt;p&gt;Runs nightly at 2am. Retention policy built in — &lt;br&gt;
keeps last 7 days locally, 30 days on S3.&lt;/p&gt;




&lt;h2&gt;
  
  
  5. vapt-check.sh: Security pre audit in one command
&lt;/h2&gt;

&lt;p&gt;Checks for the most common Laravel security misconfigurations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;.env file publicly exposed&lt;/li&gt;
&lt;li&gt;Debug mode enabled on production&lt;/li&gt;
&lt;li&gt;Missing X-Frame-Options header&lt;/li&gt;
&lt;li&gt;Missing HSTS header&lt;/li&gt;
&lt;li&gt;SSL certificate expiry&lt;/li&gt;
&lt;li&gt;Open ports that shouldn't be open&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Run this before every pentest engagement. &lt;br&gt;
Saves hours of manual checking.&lt;/p&gt;




&lt;h2&gt;
  
  
  6. ssl-check.sh: SSL expiry alerts across multiple domains
&lt;/h2&gt;

&lt;p&gt;Pass a list of domains. Get a Slack alert 30 days before &lt;br&gt;
any certificate expires.&lt;/p&gt;

&lt;p&gt;Supports unlimited domains in a single config file. &lt;br&gt;
Never get caught with an expired SSL again.&lt;/p&gt;




&lt;h2&gt;
  
  
  7. mysql-health-check.sh: Database performance monitor
&lt;/h2&gt;

&lt;p&gt;Checks:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Slow query count vs threshold&lt;/li&gt;
&lt;li&gt;Open connections vs max connections percentage&lt;/li&gt;
&lt;li&gt;InnoDB buffer pool hit rate&lt;/li&gt;
&lt;li&gt;Replication lag (if applicable)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Alerts only when thresholds are breached. &lt;br&gt;
Silent when everything is healthy.&lt;/p&gt;




&lt;h2&gt;
  
  
  8. pm2-monitor.sh: Node.js / PM2 process watchdog
&lt;/h2&gt;

&lt;p&gt;Checks all PM2 processes on a schedule. Restarts any that &lt;br&gt;
are stopped or in error state. Sends a Slack alert with &lt;br&gt;
exactly which process was affected and when.&lt;/p&gt;




&lt;h2&gt;
  
  
  9. wordpress-cleanup.sh: WP maintenance automation
&lt;/h2&gt;

&lt;p&gt;Deletes spam comments, clears transients, optimises database &lt;br&gt;
tables, removes unused post revisions.&lt;/p&gt;

&lt;p&gt;Runs weekly via cron. Keeps WordPress installs fast &lt;br&gt;
without needing a plugin to do it.&lt;/p&gt;




&lt;h2&gt;
  
  
  10. pr-summary.sh: AI-generated GitHub PR summaries
&lt;/h2&gt;

&lt;p&gt;Fetches open PRs from your GitHub repo. Sends each diff &lt;br&gt;
to Claude API. Posts a plain-English summary to Slack.&lt;/p&gt;

&lt;p&gt;Your team knows what's in review without reading the diff. &lt;br&gt;
Useful for async teams across timezones.&lt;/p&gt;




&lt;h2&gt;
  
  
  11. standup-collector.sh: Automatic standup from Slack history
&lt;/h2&gt;

&lt;p&gt;Pulls each team member's Slack messages from the last 24 hours. &lt;br&gt;
Formats them into a standup digest. Posts to your #standup &lt;br&gt;
channel automatically at 9am.&lt;/p&gt;

&lt;p&gt;No standup meeting. No manual updates. Just the digest.&lt;/p&gt;




&lt;h2&gt;
  
  
  12. ngrok-tunnel.sh: Instant secure tunnel with Slack notification
&lt;/h2&gt;

&lt;p&gt;Starts an ngrok tunnel, captures the public URL, &lt;br&gt;
and posts it to Slack automatically.&lt;/p&gt;

&lt;p&gt;No more copying URLs manually when sharing local &lt;br&gt;
environments with clients.&lt;/p&gt;




&lt;h2&gt;
  
  
  13. log-rotate.sh: Custom log rotation with archiving
&lt;/h2&gt;

&lt;p&gt;Rotates Laravel logs, Nginx access logs, and MySQL slow &lt;br&gt;
query logs on a schedule.&lt;/p&gt;

&lt;p&gt;Compresses archives older than 7 days. Sends an alert on &lt;br&gt;
any log file exceeding 500MB before it kills your disk.&lt;/p&gt;




&lt;h2&gt;
  
  
  14. server-setup.sh: Full production server bootstrap
&lt;/h2&gt;

&lt;p&gt;The one that ties everything together.&lt;/p&gt;

&lt;p&gt;Run this on a fresh Ubuntu 22.04 VPS and get:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Nginx&lt;/li&gt;
&lt;li&gt;PHP 8.2&lt;/li&gt;
&lt;li&gt;MySQL 8&lt;/li&gt;
&lt;li&gt;Composer&lt;/li&gt;
&lt;li&gt;Node.js + PM2&lt;/li&gt;
&lt;li&gt;UFW firewall rules&lt;/li&gt;
&lt;li&gt;fail2ban&lt;/li&gt;
&lt;li&gt;Swap space configured&lt;/li&gt;
&lt;li&gt;All 13 scripts above installed and cron scheduled&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;One command. 15 minutes. Production-ready server.&lt;/p&gt;




&lt;h2&gt;
  
  
  Who This Is For
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Laravel developers managing client servers solo&lt;/li&gt;
&lt;li&gt;Sysadmins who want Slack or Discord alerts without 
paying $20–200/mo for monitoring SaaS tools&lt;/li&gt;
&lt;li&gt;Freelancers maintaining multiple servers who need 
a repeatable setup&lt;/li&gt;
&lt;li&gt;DevOps engineers who want production-grade scripts 
without writing them from scratch&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Who This Is NOT For
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Developers on managed hosting (Forge, Vapor, Heroku) 
— you don't need this&lt;/li&gt;
&lt;li&gt;Teams with dedicated DevOps engineers already running 
full monitoring stacks&lt;/li&gt;
&lt;li&gt;Beginners not yet comfortable with SSH and crontab&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Setup
&lt;/h2&gt;

&lt;p&gt;All 14 scripts ship with a single &lt;code&gt;setup.sh&lt;/code&gt; wizard.&lt;/p&gt;

&lt;p&gt;Run it on any Ubuntu 18.04–24.04 or above server. It asks which &lt;br&gt;
notification channel you want, tests the webhook live, &lt;br&gt;
configures everything, and installs all crontab entries.&lt;/p&gt;

&lt;p&gt;Total setup time: under 20 minutes.&lt;/p&gt;




&lt;p&gt;If you want all 14 scripts packaged and ready to deploy:&lt;/p&gt;

&lt;p&gt;👉 &lt;a href="https://wealthqubit.gumroad.com/l/devops-vault" rel="noopener noreferrer"&gt;WealthQubit DevOps Vault — $49, one time&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;No subscription. No SaaS. Scripts you own forever.&lt;/p&gt;

</description>
      <category>bash</category>
      <category>laravel</category>
      <category>devops</category>
      <category>productivity</category>
    </item>
  </channel>
</rss>
