codewithkarani
All topics

Category

Linux & Servers

Every guide on Linux & Servers from Code With Karani - 47 field-tested articles on Linux & Servers for developers and teams.

47 articles

July 2026

  1. The pull model: systemd timers and release polling

    When the client's security team refuses a runner outright, you can still ship. A systemd timer on their server asks GitHub what the latest release is, compares it against what is checked out, and deploys when they differ. Nothing external can execute anything.

    8 min read

  2. Anatomy of a Frappe bench

    Five directories, one of which is not a directory at all but a collection of independent git repositories. Understanding that is the difference between a deploy that works and a Saturday spent fixing file ownership.

    8 min read

  3. What a runner actually is: GitHub-hosted vs self-hosted

    A runner is a process that asks GitHub for work and executes it wherever it happens to live. Once that sentence is true for you, deploying to a firewalled server with no inbound access stops being a trick.

    9 min read

  4. Ubuntu 18.04 Ignored /etc/network/interfaces: A Netplan Static IP That Works

    18.04 replaced ifupdown with Netplan, so the interfaces file you have edited for a decade does nothing. Here is the YAML that gives a server a static IP, and how to not lock yourself out.

    6 min read

  5. Ubuntu 16.04 Killed My Upstart Job: Converting an init Script to systemd

    Ubuntu 16.04 is the first LTS with systemd as PID 1, so initctl and your /etc/init job stopped working. Here is the unit file that replaces it, and how to read the failure.

    6 min read

  6. python: command not found on Ubuntu 20.04, and Why You Should Not Symlink It

    Ubuntu 20.04 ships no /usr/bin/python at all, so scripts and deploy jobs die with command not found. The correct fixes, and why the popular ln -s answer causes a worse bug later.

    6 min read

  7. 502 Bad Gateway: It Is Almost Never Nginx

    A 502 means Nginx asked your application for a response and did not get one. Read the error log line, match it to one of four causes, and stop restarting things at random.

    6 min read

  8. Access Denied for root@localhost After the MariaDB 10.4 Upgrade

    MariaDB 10.4 authenticates root through the unix_socket plugin, so the password you have used for years now returns error 1698. What changed, how to get in, and the right fix.

    6 min read

  9. Free HTTPS on Nginx With Let's Encrypt, and the Renewal Everyone Forgets

    Getting a free Let's Encrypt certificate on Nginx takes five minutes. Keeping it alive for the next three years is the part that breaks. Here is the issue, the config and the renewal.

    6 min read

  10. Installing ERPNext on Ubuntu 16.04: What the Easy Install Script Does Not Tell You

    The ERPNext install script works until it does not. Here are the four failures I hit on real servers, the MariaDB settings it needs, and how to finish a half-installed bench.

    6 min read

  11. Your Cert Automation Should Default to Let's Encrypt Staging

    Five test renewals can exhaust the duplicate certificate limit and block a real renewal for a week. Here is why certbot drifts to production, and the directory split that prevents it.

    8 min read

  12. Certbot connection refused on http-01: diagnosing proxies, IPv6 and port 80

    Connection refused is not the same as a timeout, and the difference tells you exactly where to look. A diagnostic order for failed Let's Encrypt http-01 challenges.

    10 min read

  13. Your App Keeps Dying: A systemd Unit File That Actually Keeps It Running

    Restart=always is not high availability, it is a bandaid over a bug. Here is the systemd unit file, restart policy, resource cap and sandbox config that keeps a real app alive on a real VPS.

    8 min read

  14. Nginx Reverse Proxy, TLS and Rate Limiting: The Config You Should Actually Be Running

    A one-line proxy_pass is not a reverse proxy. Real timeouts, correct forwarded headers, a Mozilla-grade TLS block and limit_req zones that stop credential stuffing without breaking your own app.

    7 min read

  15. Killed by the Kernel: What Really Happens When Your Server Runs Out of RAM

    The OOM killer is not random and your server did not just crash. Learn to read the dmesg kill record, tell a cgroup OOM from a global one, and cap the guilty process so MariaDB stops taking the bullet.

    8 min read

June 2026

  1. Restore First: How to Build Backups You Have Actually Tested

    Write the restore script before the backup script. A practical restore-first methodology with restic, verified database dumps, timed recovery drills and the failure modes that turn a backup into an expensive nothing.

    7 min read

  2. Certbot http-01 Fails Behind Your Force-HTTPS Redirect: It Is Not HSTS

    Let's Encrypt follows your 301 to HTTPS and ignores HSTS entirely. So the real cause of a failed http-01 renewal is one of four things, and disabling HSTS is not the fix.

    9 min read

  3. Certbot renewal fails silently: alerting before the certificate expires

    Certbot can fail twice a day for three months without telling anyone, and Let's Encrypt stopped sending expiry emails in 2025. Three independent alerts that catch it, with the tests.

    8 min read

  4. Lock Down a Fresh VPS in 20 Minutes: SSH Hardening That Survives Real Attacks

    A timed, copy-paste SSH hardening run for Ubuntu 24.04 - ed25519 keys, drop-in config that actually wins, UFW, fail2ban - plus the socket activation and drop-in ordering traps that lock people out.

    7 min read

  5. The 3am Outage Playbook: Reading Linux Logs Like a Detective

    Build the timeline before you build a theory. A working method for journalctl, grep and awk during a real outage - boot IDs, priority filters, the first anomaly rule, and the three culprits behind most 3am pages.

    7 min read

  6. Kubernetes DNS Timeouts That Come and Go: ndots, conntrack and the Five Second Stall

    Intermittent i/o timeout errors on Kubernetes DNS are three different bugs wearing one shirt. How to tell ndots amplification, a kernel conntrack race and a starved CoreDNS apart.

    11 min read

  7. Cron vs systemd Timers vs the Frappe Scheduler: Pick by Failure Mode, Not by Habit

    Three schedulers, three completely different failure modes. A decision rule plus working configs for cron with flock, systemd timers with catch-up, and Frappe scheduler_events - and why running all three breaks things.

    8 min read

  8. "Too Many Certificates Already Issued": Fixing Let's Encrypt Rate Limits

    The duplicate certificate limit is 5 per exact name set per week and global across all accounts, so switching clients cannot help. Here is what actually works.

    8 min read

  9. 'Unable to get local issuer certificate': fix the chain, not the client

    The site works in Chrome and fails everywhere else. That is an incomplete nginx certificate chain, and the fix is fullchain.pem, not curl -k or disabling verification.

    8 min read