<?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: Yogeshwaran Tech Tools</title>
    <description>The latest articles on DEV Community by Yogeshwaran Tech Tools (@yogeshwarantechtools).</description>
    <link>https://dev.to/yogeshwarantechtools</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4271768%2F034776aa-98ce-41bc-b046-0395e94d3ccd.png</url>
      <title>DEV Community: Yogeshwaran Tech Tools</title>
      <link>https://dev.to/yogeshwarantechtools</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/yogeshwarantechtools"/>
    <language>en</language>
    <item>
      <title>12 Linux commands I run first when a server misbehaves</title>
      <dc:creator>Yogeshwaran Tech Tools</dc:creator>
      <pubDate>Sun, 29 Nov 2026 07:02:49 +0000</pubDate>
      <link>https://dev.to/yogeshwarantechtools/12-linux-commands-i-run-first-when-a-server-misbehaves-n37</link>
      <guid>https://dev.to/yogeshwarantechtools/12-linux-commands-i-run-first-when-a-server-misbehaves-n37</guid>
      <description>&lt;p&gt;When a server is slow or a service is down, a fixed routine beats guessing. These are the twelve commands I run first, in order, and what to look for.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Is the machine overloaded?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;uptime
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The three load averages (1, 5, 15 minutes) should be below your CPU count. Compare with &lt;code&gt;nproc&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Who is using CPU and memory?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;top -o %CPU        &lt;span class="c"&gt;# or: htop&lt;/span&gt;
ps aux --sort=-%mem &lt;span class="o"&gt;|&lt;/span&gt; head
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Look for one process dominating, or many copies of the same process.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Is memory exhausted?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;free -h
dmesg -T &lt;span class="o"&gt;|&lt;/span&gt; grep -i -E &lt;span class="s1"&gt;'out of memory|oom'&lt;/span&gt; &lt;span class="o"&gt;|&lt;/span&gt; tail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If &lt;code&gt;available&lt;/code&gt; is near zero or the kernel killed processes, you have a memory problem, not a CPU one.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Is the disk full?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;df -h
df -i              &lt;span class="c"&gt;# inodes can run out even when space is free&lt;/span&gt;
du -xh /var --max-depth=1 &lt;span class="o"&gt;|&lt;/span&gt; sort -h &lt;span class="o"&gt;|&lt;/span&gt; tail
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A full &lt;code&gt;/var&lt;/code&gt; (logs) is the most common cause of mysterious failures.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Is the disk slow?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;iostat -x 1 3      &lt;span class="c"&gt;# from the sysstat package&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;High &lt;code&gt;%util&lt;/code&gt; and &lt;code&gt;await&lt;/code&gt; mean the disk is the bottleneck.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. What failed recently?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl --failed
journalctl -p err -b --no-pager &lt;span class="o"&gt;|&lt;/span&gt; tail -50
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  7. Is the service itself healthy?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;systemctl status myapp
journalctl -u myapp -n 100 --no-pager
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  8. Is anything listening where it should?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss -tulpn          &lt;span class="c"&gt;# listening sockets and the owning process&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  9. Can the network reach the world?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ping -c 3 1.1.1.1
curl -sI https://example.com &lt;span class="o"&gt;|&lt;/span&gt; head -5
dig +short example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If IP works but names do not, it is DNS.&lt;/p&gt;

&lt;h2&gt;
  
  
  10. How many connections are open?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ss -s
ss -tan state established &lt;span class="o"&gt;|&lt;/span&gt; wc -l
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A sudden spike can mean traffic, a leak or an attack.&lt;/p&gt;

&lt;h2&gt;
  
  
  11. Did a recent change cause it?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;last -n 10                 &lt;span class="c"&gt;# recent logins&lt;/span&gt;
find /etc -mmin -60 -type f 2&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;/dev/null   &lt;span class="c"&gt;# config changed in the last hour&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  12. Is the clock right?
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;timedatectl
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wrong time breaks TLS, tokens and log correlation.&lt;/p&gt;

&lt;h2&gt;
  
  
  Habit worth building
&lt;/h2&gt;

&lt;p&gt;Write down the output of each step as you go. Most incidents are solved by step 4 or 6, and the notes make the post-mortem easy.&lt;/p&gt;

&lt;p&gt;For quick offline helpers while debugging (JSON, Base64, URL encoding), I keep a browser-only toolbox here: &lt;a href="https://luxury-malabi-8a7447.netlify.app/toolbox.html" rel="noopener noreferrer"&gt;https://luxury-malabi-8a7447.netlify.app/toolbox.html&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by Yogeshwaran Tech Tools. Corrections welcome.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>7 JWT mistakes that quietly break your authentication</title>
      <dc:creator>Yogeshwaran Tech Tools</dc:creator>
      <pubDate>Sun, 29 Nov 2026 06:59:32 +0000</pubDate>
      <link>https://dev.to/yogeshwarantechtools/7-jwt-mistakes-that-quietly-break-your-authentication-2of3</link>
      <guid>https://dev.to/yogeshwarantechtools/7-jwt-mistakes-that-quietly-break-your-authentication-2of3</guid>
      <description>&lt;p&gt;JWTs are everywhere, and most breaches involving them come from a handful of repeat mistakes. Here are seven I check for first, with the fix for each.&lt;/p&gt;

&lt;h2&gt;
  
  
  1. Believing the payload is secret
&lt;/h2&gt;

&lt;p&gt;A JWT is signed, not encrypted. Anyone holding the token can read the header and payload by Base64-decoding the middle part. Never put passwords, personal data or internal IDs you would not show a user in the payload.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Accepting any algorithm
&lt;/h2&gt;

&lt;p&gt;The header says which algorithm to use, but the server must decide. Always pass an allow-list when verifying:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// Node, jsonwebtoken&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;payload&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;jwt&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;verify&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;publicKeyOrSecret&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;algorithms&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s1"&gt;'RS256'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;     &lt;span class="c1"&gt;// never trust the token's own "alg"&lt;/span&gt;
  &lt;span class="n"&gt;issuer&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'https://auth.example.com'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="n"&gt;audience&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'my-api'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Old libraries accepted &lt;code&gt;alg: "none"&lt;/code&gt; (no signature at all). Current ones reject it, but only if you do not enable it and you pin the algorithm.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Mixing HS256 and RS256 keys
&lt;/h2&gt;

&lt;p&gt;If a verifier uses a public key but also accepts HS256, an attacker can sign a token with HS256 using the public key as the secret. Pin one algorithm per key and keep symmetric and asymmetric keys separate.&lt;/p&gt;

&lt;h2&gt;
  
  
  4. Weak or guessable HS256 secrets
&lt;/h2&gt;

&lt;p&gt;An HS256 secret like &lt;code&gt;secret&lt;/code&gt; or &lt;code&gt;changeme&lt;/code&gt; can be brute-forced offline from a single token. Use at least 32 random bytes (for example &lt;code&gt;openssl rand -base64 48&lt;/code&gt;) and load it from the environment, not source code.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Skipping claim checks
&lt;/h2&gt;

&lt;p&gt;A valid signature only proves who issued the token. Also check:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;exp&lt;/code&gt; (expiry) and &lt;code&gt;nbf&lt;/code&gt; (not before), allowing a few seconds of clock skew&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;iss&lt;/code&gt; (issuer) and &lt;code&gt;aud&lt;/code&gt; (audience), so a token for one service is not accepted by another&lt;/li&gt;
&lt;li&gt;Any role or scope claim, on the server, for every protected route&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  6. Storing tokens where scripts can steal them
&lt;/h2&gt;

&lt;p&gt;&lt;code&gt;localStorage&lt;/code&gt; is readable by any script on the page, so one XSS bug leaks every session. Prefer an &lt;code&gt;HttpOnly; Secure; SameSite=Lax&lt;/code&gt; cookie for browser apps, and add CSRF protection if you do.&lt;/p&gt;

&lt;h2&gt;
  
  
  7. No plan for revocation
&lt;/h2&gt;

&lt;p&gt;JWTs are valid until they expire. Keep access tokens short (5 to 15 minutes), use refresh tokens you can revoke server-side, and rotate them on use. For logout or password change, invalidate the refresh token and any session record.&lt;/p&gt;

&lt;h2&gt;
  
  
  Quick audit checklist
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Algorithm pinned on every verify call.&lt;/li&gt;
&lt;li&gt;Secret or key length and storage reviewed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;exp&lt;/code&gt;, &lt;code&gt;iss&lt;/code&gt;, &lt;code&gt;aud&lt;/code&gt; verified.&lt;/li&gt;
&lt;li&gt;Nothing sensitive in the payload.&lt;/li&gt;
&lt;li&gt;Tokens kept out of &lt;code&gt;localStorage&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Short expiry plus revocable refresh tokens.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;When I debug these I keep a browser-only toolbox open so tokens never leave my machine: &lt;a href="https://luxury-malabi-8a7447.netlify.app/toolbox.html" rel="noopener noreferrer"&gt;https://luxury-malabi-8a7447.netlify.app/toolbox.html&lt;/a&gt; (JSON, Base64 and URL are free; the full version adds a JWT decoder, hashes and a regex tester). Decoding only reads a token; it does not verify the signature, so treat it as inspection, not validation.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by Yogeshwaran Tech Tools. Corrections welcome.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>A 10-minute HTTP security headers checklist for small websites</title>
      <dc:creator>Yogeshwaran Tech Tools</dc:creator>
      <pubDate>Sun, 29 Nov 2026 06:21:58 +0000</pubDate>
      <link>https://dev.to/yogeshwarantechtools/a-10-minute-http-security-headers-checklist-for-small-websites-5aj</link>
      <guid>https://dev.to/yogeshwarantechtools/a-10-minute-http-security-headers-checklist-for-small-websites-5aj</guid>
      <description>&lt;p&gt;Most small sites ship with zero security headers. Adding a handful takes ten minutes and removes whole classes of attacks (clickjacking, MIME sniffing, some XSS). This is the checklist I use for static sites.&lt;/p&gt;

&lt;h2&gt;
  
  
  The headers
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Header&lt;/th&gt;
&lt;th&gt;What it does&lt;/th&gt;
&lt;th&gt;Safe starting value&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Content-Security-Policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Limits where scripts, styles and images can load from&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;default-src 'self'&lt;/code&gt; (relax only what you need)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Strict-Transport-Security&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Forces HTTPS&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;max-age=31536000; includeSubDomains&lt;/code&gt; (once HTTPS works everywhere)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;X-Content-Type-Options&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Stops MIME sniffing&lt;/td&gt;
&lt;td&gt;&lt;code&gt;nosniff&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;X-Frame-Options&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Blocks clickjacking by framing&lt;/td&gt;
&lt;td&gt;
&lt;code&gt;DENY&lt;/code&gt; (or use CSP &lt;code&gt;frame-ancestors 'none'&lt;/code&gt;)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Referrer-Policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Controls what URL data you leak&lt;/td&gt;
&lt;td&gt;&lt;code&gt;strict-origin-when-cross-origin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Permissions-Policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Turns off browser features you don't use&lt;/td&gt;
&lt;td&gt;&lt;code&gt;camera=(), microphone=(), geolocation=()&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;&lt;code&gt;Cross-Origin-Opener-Policy&lt;/code&gt;&lt;/td&gt;
&lt;td&gt;Isolates your window from popups&lt;/td&gt;
&lt;td&gt;&lt;code&gt;same-origin&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;

&lt;h2&gt;
  
  
  Set them on Netlify
&lt;/h2&gt;

&lt;p&gt;Create a &lt;code&gt;_headers&lt;/code&gt; file in your publish folder:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;/*
  Content-Security-Policy: default-src 'self'; img-src 'self' data:; style-src 'self' 'unsafe-inline'
  Strict-Transport-Security: max-age=31536000; includeSubDomains
  X-Content-Type-Options: nosniff
  X-Frame-Options: DENY
  Referrer-Policy: strict-origin-when-cross-origin
  Permissions-Policy: camera=(), microphone=(), geolocation=()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Deploy, then check with &lt;code&gt;curl -sI https://your-site.example | grep -iE 'content-security|strict-transport|x-content|x-frame|referrer|permissions'&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  CSP without pain
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Start with &lt;code&gt;Content-Security-Policy-Report-Only&lt;/code&gt; so nothing breaks.&lt;/li&gt;
&lt;li&gt;Open the browser console and add only the sources that are reported.&lt;/li&gt;
&lt;li&gt;Prefer no inline scripts. If you must, use a nonce or hash instead of &lt;code&gt;'unsafe-inline'&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Common mistakes
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Setting HSTS before every subdomain supports HTTPS.&lt;/li&gt;
&lt;li&gt;Using &lt;code&gt;*&lt;/code&gt; in &lt;code&gt;script-src&lt;/code&gt;, which defeats the point.&lt;/li&gt;
&lt;li&gt;Testing only the home page: headers must apply to every path.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Test it
&lt;/h2&gt;

&lt;p&gt;Run your URL through a header scanner and fix anything marked missing. For quick offline checks of JSON responses, JWTs and hashes while debugging, I keep a free browser-only toolbox here: &lt;a href="https://luxury-malabi-8a7447.netlify.app/toolbox.html" rel="noopener noreferrer"&gt;https://luxury-malabi-8a7447.netlify.app/toolbox.html&lt;/a&gt; (JSON, Base64, URL free; JWT, hashes and regex in the full version).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Written by Yogeshwaran Tech Tools. Corrections welcome.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>security</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
