<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[CodeX - Medium]]></title>
        <description><![CDATA[Everything connected with Tech &amp; Code. Follow to join our 1M+ monthly readers - Medium]]></description>
        <link>https://medium.com/codex?source=rss----29038077e4c6---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>CodeX - Medium</title>
            <link>https://medium.com/codex?source=rss----29038077e4c6---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 09:23:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/codex" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com" rel="hub"/>
        <item>
            <title><![CDATA[How to Find Who Still Has SSH Access to Your Servers, and Remove Them (2026)]]></title>
            <link>https://medium.com/codex/how-to-find-who-still-has-ssh-access-to-your-servers-and-remove-them-2026-2a157fe80443?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/2a157fe80443</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[ssh]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Daxesh Italiya]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 20:11:01 GMT</pubDate>
            <atom:updated>2026-11-21T20:11:01.704Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Most teams check one file and stop. SSH access hides in five places. Here is how to audit all five and cut access in the right order.</em></p><p><em>I’m the CTO at CtrlOps, so weigh my tool mentions accordingly. Every command in this guide works without it.</em></p><p>To find who still has SSH access to your servers, you have to check five places. Most teams check one. They open authorized_keys, delete a line, and call the offboarding done.</p><p>Meanwhile, the contractor who left in March can still log in. Through a shared deploy account. Through a password nobody rotated. Through a session that never closed.</p><p><strong>Quick answer:</strong> SSH access lives in five places: authorised keys, password logins, sudo rights, past logins, and live sessions. Audit all five on every server. Then expire the account, delete the key, block it with sshd’s RevokedKeys list, end open sessions, and re-run the audit.</p><p>Here’s what you’ll get:</p><ul><li>A short script that shows every key on a server, as fingerprints</li><li>How to tell a key that exists from a key that actually gets used</li><li>A removal order that won’t lock you out of your own box</li><li>Two OpenSSH settings that stop access from piling up again</li></ul><p>Let’s start.</p><p><strong>Why does SSH access outlive the people who had it?</strong></p><p>SSH access outlives people because nothing in OpenSSH ties a key to an employee. A key works until someone deletes it, on every server it was ever copied to. Small teams add keys fast during a launch and remove them slowly, or never.</p><p>Attackers count on that. In the 2026 Verizon DBIR, credential abuse showed up at some point in the attack chain of 39% of breaches. As the first way in, it fell to 13% this year, behind exploited vulnerabilities at 31%. That is still the second act of most breaches: attackers get in one way, then use credentials to move around. Third parties were involved in 48% of breaches, up from 30% a year earlier (<a href="https://www.verizon.com/business/resources/T343/reports/2026-dbir-data-breach-investigations-report.pdf">Verizon 2026 DBIR</a>).</p><p>IBM puts the global average cost of a breach at a record $4.99 million in its 2026 report (<a href="https://newsroom.ibm.com/2026-07-29-ibm-study-one-in-four-malicious-breaches-are-ai-enabled,-costing-companies-6-million-on-average">IBM</a>).</p><p>Contractors and agencies are part of that third-party picture. Every server you opened for one stays open until you close it.</p><p><strong>Where does SSH access hide on a Linux server?</strong></p><p>SSH access hides in five places: authorized keys on every account, password logins, sudo rights, login history, and live sessions. Check all five on each server. A key audit alone misses shared passwords. A password audit misses keys that sshd reads from somewhere other than the home folder.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LbdvuPeXMQfHPATAq40e1Q.png" /><figcaption><em>The five places SSH access hides, and the command that finds each one</em></figcaption></figure><ul><li><strong>Keys:</strong> ssh-keygen -lf on every authorized keys file</li><li><strong>Passwords: </strong>sshd -T plus /etc/shadow</li><li><strong>Sudo:</strong> getent group plus /etc/sudoers.d/</li><li><strong>Past logins:</strong> last plus the sshd log</li><li><strong>Live sessions:</strong> who plus ss</li></ul><p><strong>1. Authorised keys, on every account</strong></p><p><strong>Best for:</strong> finding who can log in with a key.</p><p>First, check where sshd actually reads keys from:</p><blockquote>sudo sshd -T | grep -iE ‘authorizedkeysfile|authorizedkeyscommand|trustedusercakeys’</blockquote><p>If authorizedkeyscommand or trustedusercakeys is set to anything but none, keys also come from a script or a certificate authority. Reading files won’t show you everyone.</p><p>Now save this as who-has-access.sh. It asks sshd which key files it reads, walks every account in /etc/passwd, and prints each key as a fingerprint:</p><blockquote>#!/bin/bash</blockquote><blockquote># Run as root: sudo bash who-has-access.sh</blockquote><blockquote>patterns=$(sshd -T | awk ‘/^authorizedkeysfile/ {$1=””; print}’)</blockquote><blockquote>while IFS=: read -r user _ _ _ _ home shell; do</blockquote><blockquote>for p in $patterns; do</blockquote><blockquote>f=${p//%u/$user}</blockquote><blockquote>f=${f//%h/$home}</blockquote><blockquote>[[ $f = /* ]] || f=”$home/$f”</blockquote><blockquote>[ -f “$f” ] || continue</blockquote><blockquote>echo “== $user shell=$shell file=$f”</blockquote><blockquote>ssh-keygen -lf “$f”</blockquote><blockquote>done</blockquote><blockquote>done &lt; /etc/passwd</blockquote><p>This covers the default .ssh/authorized_keys and .ssh/authorized_keys2, plus any custom path your AuthorizedKeysFile setting names, such as /etc/ssh/authorized_keys/%u. It does not cover keys from AuthorizedKeysCommand or a certificate authority. Check those separately.</p><p>Don’t skip accounts with a nologin shell. A key there can’t open a shell, but it can still open SSH tunnels unless the key line carries restrict.</p><p>Get the leaver’s fingerprint with ssh-keygen -lf contractor.pub and search the output for it. Match on the fingerprint, never the comment. Comments are free text, and copied keys often carry someone else’s name.</p><p>No terminal handy? Paste the file into CtrlOps’ free authorized_keys Analyzer. It shows each key’s fingerprint, strength, and restrictions, and flags keys nobody can account for. It runs in your browser.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mmk4-eBxse5kxaL_PxCokw.png" /><figcaption><em>One fingerprint found on root and deploy, on a server the leaver never had a personal account on</em></figcaption></figure><p><strong>2. Password logins</strong></p><p><strong>Best for:</strong> catching access a key audit can’t see.</p><blockquote>sudo sshd -T | grep -E ‘^(passwordauthentication|kbdinteractiveauthentication|permitrootlogin)’</blockquote><blockquote>sudo awk -F: ‘$2 ~ /^\$/ {print $1}’ /etc/shadow</blockquote><blockquote>sudo grep -rn ‘^PasswordAuthentication’ /etc/ssh/sshd_config /etc/ssh/sshd_config.d/</blockquote><p>The first line shows whether sshd accepts passwords at all. Use sshd -T, not sshd_config, because drop-in files in sshd_config.d/ can override the main file. The second line lists accounts that have a password set. If passwords are on and the leaver knew one, that account is still open to them.</p><p>The third line shows which file sets it. When the Include line sits at the top of sshd_config, as it does on Ubuntu, a drop-in that says yes beats a main file that says no, because sshd keeps the first value it reads.</p><p>sshd -T shows the global settings only. A Match block can turn passwords back on for one user or one network. Test the leaver’s actual case:</p><blockquote>sudo sshd -T -C user=contractor,host=server,addr=203.0.113.10 | grep -E ‘^(passwordauthentication|permitrootlogin)’</blockquote><p>To grade the rest of your sshd settings, paste the config into the free sshd_config Analyzer. It reads drop-in files too, and nothing gets uploaded.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQm0GxBja_cQiVOLBbPytA.png" /><figcaption><em>sshd -T shows password logins still on, even though sshd_config says no</em></figcaption></figure><p><strong>3. Sudo rights (and the group that acts like root)</strong></p><p><strong>Best for:</strong> knowing how much damage a forgotten login can do.</p><blockquote>getent group sudo wheel admin docker</blockquote><blockquote>sudo grep -rhvE ‘^\s*(#|$)’ /etc/sudoers /etc/sudoers.d/</blockquote><blockquote>sudo -l -U contractor</blockquote><p>The grep prints every active sudo rule, including narrow ones like deploy ALL=(root) /usr/bin/systemctl. The last command shows one person’s effective rights.</p><p>Look for named users in sudoers.d. Teams often drop a one-line file there for a contractor during an incident, then forget it. Check the docker group too. Membership there is root access in practice.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w7HyBBSxqEN9HJrrBXCaqA.png" /><figcaption><em>A forgotten contractor file in sudoers.d, plus a docker group member with root-level access</em></figcaption></figure><p><strong>Running this on 12 servers, one SSH session at a time?</strong></p><p>That’s 12 logins, 12 copies of the output, and one box you’ll skip because it was offline that day.</p><p>CtrlOps is a local-first desktop app for managing Linux servers over SSH, with an AI terminal that asks before it runs anything. Its Access screen scans your saved servers and lists each person, the servers they can reach, how many give them sudo, and the exact login they land on.</p><ul><li>The scan only reads. Nothing changes until you act.</li><li>Remove from all servers asks you to type the person’s name, then revokes their key across the fleet in one step.</li><li>Export Audit saves a snapshot of who can access what. It stays on your machine.</li></ul><p>I lead the team that builds it, so ask me anything about how the scan works in the responses. 1 month free trial, no credit card. <a href="https://your-ctrlops-link/?ref=medium-ssh-access-audit">See how Access works</a></p><p><strong>4. Past logins</strong></p><blockquote><strong>Best for:</strong> telling a key that exists from a key that gets used.</blockquote><blockquote>last -ai | head -30</blockquote><p>sudo journalctl -u ssh -u sshd — since “-90d” | grep “Accepted”</p><p>last shows who logged in, when, and from which IP. The sshd log shows how: Accepted publickey lines include the key fingerprint, Accepted password lines don’t. On older systems, read /var/log/auth.log (Debian, Ubuntu) or /var/log/secure (RHEL).</p><p>Both logs rotate. A quiet log doesn’t prove a key was never used.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vutEZ3DlcEdW-SGJ6sigmw.png" /><figcaption><em>Accepted publickey lines tie each login to a key fingerprint and source IP</em></figcaption></figure><p><strong>5. Live sessions</strong></p><p><strong>Best for:</strong> catching someone who is logged in right now.</p><blockquote>who</blockquote><blockquote>sudo ss -tnp state established ‘( sport = :22 )’</blockquote><p>who lists users with a terminal open. ss also catches sessions without one, like an ssh -N tunnel, and shows the sshd process ID behind each source IP. You’ll need that ID during removal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZEgoPtK5zebdU6b5rrLDVA.png" /><figcaption><em>ss shows an open tunnel that who misses, with the sshd process ID to end it</em></figcaption></figure><p><strong>How do you remove someone’s SSH access completely?</strong></p><p>Remove access in this order: expire the account, delete the key, block the key in sshd, end live sessions, then rotate what they knew. Order matters. Kill a session first and they can reconnect at once with a key you haven’t deleted yet.</p><p><strong>Step 1: Expire their personal account</strong></p><blockquote>sudo usermod -L -e 1 contractor</blockquote><p>-L locks the password. -e 1 expires the account, and sshd refuses an expired account even with a valid key. On a default setup (UsePAM yes), passwd -l on its own does not stop key logins.</p><p><strong>Step 2: Delete their key everywhere it appeared</strong></p><p>Back up the file, then drop the line that holds their key. Use the full base64 part of the key, which is the second field of the line. Never use just the start of it: every ed25519 key begins with the same AAAAC3NzaC1lZDI1NTE5AAAA, so a short prefix would delete everyone’s keys.</p><p>Use grep -vF instead of sed, because base64 keys contain / and + characters that break a sed pattern.</p><blockquote>f=/home/deploy/.ssh/authorized_keys</blockquote><blockquote>key=$(awk ‘{print $2}’ contractor.pub)</blockquote><blockquote>sudo cp -p “$f” “$f.bak”</blockquote><blockquote>sudo grep -vF “$key” “$f.bak” | sudo tee “$f” &gt; /dev/null</blockquote><blockquote>diff “$f.bak” “$f”</blockquote><p>The diff should show exactly one removed line. If it shows more, restore the backup with sudo cp -p “$f.bak” “$f” and check your key value.</p><p>Repeat for root and every shared account where the fingerprint showed up. Before you touch a file, confirm your own key is still in it.</p><p><strong>Step 3: Block the key for good with RevokedKeys</strong></p><p>Deleting a line fixes today. A provisioning script or an old backup can put it back next month. RevokedKeys makes sshd refuse that key no matter which file it sits in.</p><blockquote>cat contractor.pub | sudo tee -a /etc/ssh/revoked_keys</blockquote><blockquote>sudo chown root:root /etc/ssh/revoked_keys &amp;&amp; sudo chmod 644 /etc/ssh/revoked_keys</blockquote><blockquote>echo ‘RevokedKeys /etc/ssh/revoked_keys’ | sudo tee /etc/ssh/sshd_config.d/10-revoked.conf</blockquote><blockquote>sudo sshd -t &amp;&amp; sudo systemctl reload ssh</blockquote><p>The service is sshd on RHEL-family systems. If your distro has no sshd_config.d folder, add the line to sshd_config directly.</p><p>Create the revoked keys file before you reload. If sshd can’t read that file, it refuses public key logins for every user, you included. Keep your current session open until you’ve tested a fresh login in a second terminal.</p><p>RevokedKeys works per server. Copy the file and the setting to every server, not just the one you’re on.</p><p>Here is what it looks like when an old key comes back. The key is in authorized_keys again, a login with it still fails, and the log names the file that blocked it. The ssh line runs from a machine that holds the key:</p><blockquote>sudo ssh-keygen -lf /home/deploy/.ssh/authorized_keys</blockquote><blockquote>ssh deploy@server</blockquote><blockquote>sudo journalctl -u ssh — since “-5min” | grep -i revoked</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qQm0GxBja_cQiVOLBbPytA.png" /><figcaption><em>A revoked key gets refused even after someone adds it back to authorized_keys</em></figcaption></figure><p><strong>Step 4: End live sessions</strong></p><p>On a personal account, end everything that user runs:</p><p>sudo loginctl terminate-user contractor</p><p>On a shared account like deploy, don’t kill every process. Your teammates use it too. Take the sshd process ID that ss showed for the leaver’s IP and confirm it first:</p><p>ps -o pid,user,args -p &lt;pid&gt;</p><p>sudo kill &lt;pid&gt;</p><p><strong>Step 5: Rotate what they knew</strong></p><ul><li>Any shared password on an account with password logins on</li><li>Any team key they ever had a copy of, on every server and CI job that uses it</li><li>Keys your cloud provider injects from instance or project metadata, removed at the provider, not only on the box</li><li>Git deploy keys and CI secrets they created</li></ul><p><strong>Step 6: Re-run the audit and save it</strong></p><p>Run who-has-access.sh again and search for the fingerprint. Zero matches on every server means the key is gone. Save the output with the date. The next time a client asks who can reach production, that file is your answer.</p><p><strong>How do you stop SSH access from piling up again?</strong></p><p>Give access an end date the day you grant it. OpenSSH has supported an expiry-time option on authorized_keys lines since version 7.7 (<a href="https://www.openssh.com/txt/release-7.7">OpenSSH 7.7 release notes</a>). A contractor’s key can switch itself off, with nobody touching the server.</p><p>expiry-time=”20270131&quot; ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAA… contractor-acme-2026</p><p>A bare date is read in the server’s local time zone and takes effect at the start of that day. Use YYYYMMDDHHMM for a precise cutoff. Test it once on a throwaway key before you rely on it.</p><p>Three more habits keep the next audit short:</p><ul><li><strong>Restrict automation keys.</strong> Prefix CI and backup keys with restrict,command=”/path/to/script”. The key can run one job and nothing else: no shell, no tunnels.</li><li><strong>Name every key.</strong> Generate keys with a comment like ssh-keygen -t ed25519 -C “name-laptop-2026”. The fingerprint proves the match. The comment tells you whose key it is.</li><li><strong>Audit every quarter.</strong> Run who-has-access.sh on each server, save the output, and diff it against last quarter’s file. New lines are the ones to question.</li></ul><p>For the rest of the SSH hardening list, CtrlOps keeps a free VPS SSH access checklist you can run through server by server.</p><p><strong>Which approach should you pick?</strong></p><p>Under five servers, the script in this guide is enough. Past ten servers or several clients, the manual audit eats an afternoon, and the box you skip is where the old key survives. That’s the point where one fleet-wide view pays off.</p><ul><li><strong>Stay manual if:</strong> you run 1 to 5 servers, one team, and can block 30 minutes a quarter.</li><li><strong>Use a fleet tool like CtrlOps if:</strong> you run 10+ servers, bring in contractors often, or clients ask for access reports.</li><li><strong>Look at SSH certificates or an access proxy if:</strong> you need always-on, central identity control. CtrlOps is a desktop app, and its Access scan is a snapshot you re-run after key changes, not live monitoring.</li></ul><p><strong>The offboarding checklist</strong></p><ul><li>Server list complete, including staging, client, and offline boxes</li><li>Leaver’s fingerprint searched on every account, not just theirs</li><li>Password logins and shared passwords checked, including Match blocks</li><li>sudoers.d and docker group cleaned</li><li>Personal account expired with usermod -L -e 1</li><li>Key deleted, diff checked, then added to RevokedKeys on every server</li><li>Open sessions ended</li><li>Shared keys, metadata keys, deploy keys, and CI secrets rotated</li><li>Audit re-run, zero matches, report saved with the date</li></ul><p><strong>FAQ</strong></p><p><strong>How do I check who has SSH access to my Linux server?</strong></p><p>Run ssh-keygen -lf on the authorized keys file of every account, including root and shared ones. Then check sshd -T for password logins and other key sources, list sudo and docker group members, and read last plus the sshd log. Checking keys alone misses shared passwords.</p><p><strong>Does locking a Linux account block SSH key logins?</strong></p><p>Not on a default setup. With UsePAM yes, passwd -l and usermod -L lock only the password, so key logins still work. Run usermod -e 1 to expire the account. sshd refuses expired accounts even with a valid key.</p><p><strong>How do I permanently block an SSH key?</strong></p><p>Append the public key to a file and point sshd’s RevokedKeys setting at it, then reload sshd. The key gets refused even if someone adds it back to authorized_keys. Do this on every server. Create the file first: if sshd can’t read it, all public key logins fail.</p><p><strong>Can SSH keys expire automatically?</strong></p><p>Yes. Since OpenSSH 7.7, you can put expiry-time=”YYYYMMDD” before a key in authorized_keys, and sshd refuses it once that date arrives. SSH certificates signed with ssh-keygen -V give you expiry at fleet scale.</p><p><strong>How do I kick a user out of an active SSH session?</strong></p><p>On a personal account, run sudo loginctl terminate-user username. On a shared account, find that session’s sshd process ID with ss -tnp, confirm it with ps, and kill only that process. Delete their key first, or they can reconnect right away.</p><p><strong>Can CtrlOps remove one person’s SSH access from all servers at once?</strong></p><p>Yes. Its Access screen lists every person found across your saved servers. Remove from all servers revokes their key fleet-wide after you type their name to confirm. The scan and the audit export stay on your machine.</p><p><em>Thanks for Reading :)</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2a157fe80443" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/how-to-find-who-still-has-ssh-access-to-your-servers-and-remove-them-2026-2a157fe80443">How to Find Who Still Has SSH Access to Your Servers, and Remove Them (2026)</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How Visual Studio’s New Profiler Agent Finds the Bottleneck Before You Do]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/codex/how-visual-studios-new-profiler-agent-finds-the-bottleneck-before-you-do-0efcf6cbed4a?source=rss----29038077e4c6---4"><img src="https://cdn-images-1.medium.com/max/1600/1*zbacBumP1WZ2aaiMR1qbng.png" width="1600"></a></p><p class="medium-feed-snippet">Point Visual Studio&#x2019;s Profiler Agent at CsvHelper, a CSV library its maintainers have hand-tuned for years, and it flagged roughly 30,000&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/codex/how-visual-studios-new-profiler-agent-finds-the-bottleneck-before-you-do-0efcf6cbed4a?source=rss----29038077e4c6---4">Continue reading on CodeX »</a></p></div>]]></description>
            <link>https://medium.com/codex/how-visual-studios-new-profiler-agent-finds-the-bottleneck-before-you-do-0efcf6cbed4a?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/0efcf6cbed4a</guid>
            <category><![CDATA[github-copilot]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[visual-studio]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Coders Stop]]></dc:creator>
            <pubDate>Sat, 21 Nov 2026 13:06:01 GMT</pubDate>
            <atom:updated>2026-11-21T13:06:01.500Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Rust vs C++ in 2026: Which Builds Safer, More Reliable Software?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/codex/rust-vs-c-in-2026-which-builds-safer-more-reliable-software-7ed1dfda144c?source=rss----29038077e4c6---4"><img src="https://cdn-images-1.medium.com/max/1672/1*HaqedhVCV_iGE3u8pcBVUw.png" width="1672"></a></p><p class="medium-feed-snippet">The safety gap is real and now measurable. The reliability gap is a different question, and the answer is less comfortable for both camps.</p><p class="medium-feed-link"><a href="https://medium.com/codex/rust-vs-c-in-2026-which-builds-safer-more-reliable-software-7ed1dfda144c?source=rss----29038077e4c6---4">Continue reading on CodeX »</a></p></div>]]></description>
            <link>https://medium.com/codex/rust-vs-c-in-2026-which-builds-safer-more-reliable-software-7ed1dfda144c?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/7ed1dfda144c</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[language]]></category>
            <dc:creator><![CDATA[PhynixAI]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 20:21:01 GMT</pubDate>
            <atom:updated>2026-11-21T05:01:21.816Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Update nginx Now: NGINX2Root (CVE-2026–123007), an HTTP/2 Flaw Rated 9.2 That Can Lead to Root]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/codex/update-nginx-now-nginx2root-cve-2026-123007-an-http-2-flaw-rated-9-2-that-can-lead-to-root-2666de59b234?source=rss----29038077e4c6---4"><img src="https://cdn-images-1.medium.com/max/1672/1*MTV94ztm1h2k7O6_m6nJ7g.png" width="1672"></a></p><p class="medium-feed-snippet">Five nginx vulnerabilities, one unpatched Linux kernel bug, and why checking nginx -v alone won&apos;t settle your nerves.</p><p class="medium-feed-link"><a href="https://medium.com/codex/update-nginx-now-nginx2root-cve-2026-123007-an-http-2-flaw-rated-9-2-that-can-lead-to-root-2666de59b234?source=rss----29038077e4c6---4">Continue reading on CodeX »</a></p></div>]]></description>
            <link>https://medium.com/codex/update-nginx-now-nginx2root-cve-2026-123007-an-http-2-flaw-rated-9-2-that-can-lead-to-root-2666de59b234?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/2666de59b234</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[backend-development]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Developer Awam]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 13:05:06 GMT</pubDate>
            <atom:updated>2026-11-20T13:05:05.236Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[10 Linux Commands You’ve Probably Never Heard Of]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/codex/10-linux-commands-youve-probably-never-heard-of-fce43c1d8566?source=rss----29038077e4c6---4"><img src="https://cdn-images-1.medium.com/max/600/1*ZlGj79MueB5TFzH3tSITVQ.jpeg" width="600"></a></p><p class="medium-feed-snippet">Part-1</p><p class="medium-feed-link"><a href="https://medium.com/codex/10-linux-commands-youve-probably-never-heard-of-fce43c1d8566?source=rss----29038077e4c6---4">Continue reading on CodeX »</a></p></div>]]></description>
            <link>https://medium.com/codex/10-linux-commands-youve-probably-never-heard-of-fce43c1d8566?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/fce43c1d8566</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[coding]]></category>
            <dc:creator><![CDATA[Pawan Natekar | Devops | AWS | K8s | Linux]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 13:05:01 GMT</pubDate>
            <atom:updated>2026-11-20T13:04:59.981Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Self-Hosted Spotify on a Raspberry Pi — Part 20/B: Tagging a Music Library with Beets]]></title>
            <link>https://medium.com/codex/self-hosted-spotify-on-a-raspberry-pi-part-20-b-tagging-a-music-library-with-beets-118ea1904eb1?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/118ea1904eb1</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[raspberry-pi]]></category>
            <category><![CDATA[self-hosting]]></category>
            <category><![CDATA[music]]></category>
            <category><![CDATA[spotify]]></category>
            <dc:creator><![CDATA[Levente Csikor]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 13:02:50 GMT</pubDate>
            <atom:updated>2026-11-20T13:02:49.037Z</atom:updated>
            <content:encoded><![CDATA[<h3>Part 20/B — How I Run My Entire Digital Life on a Raspberry Pi: Self-Hosted Spotify on a Raspberry Pi</h3><blockquote><strong>Part 20/B: Tagging a Music Library with Beets</strong></blockquote><p>In <a href="https://medium.com/codex/part-20-a-self-hosted-spotify-on-a-raspberry-pi-finding-music-youre-allowed-to-keep-93592df42170">Part 20/A</a> I covered where music comes from: purchases, free downloads the artist offers, and openly licensed releases, all landing in an inbox folder. This part is what happens next, and it also deals with the other thing in my collection: old CDs I ripped years ago. What the two have in common is that the files are playable but not trustworthy. Every artist tags differently, old rip software tagged worse, some files have no cover art, some have a genre that means nothing, and the folder structure is whatever it happened to be. This is <a href="https://beets.io">Beets</a>, the librarian that won’t shelve anything until it’s catalogued correctly, and the component that fought back hardest. It ends with a glossary of the commands that actually mattered.</p><p>Everything here assumes the music is yours to keep: bought, offered for free by its owner, openly licensed, or ripped from discs you own. Ripping your own discs raises its own question, and the rules on private copies differ by country, so check yours.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9QiprB5Tc0TqGsr9SApzlg.png" /><figcaption>Legit crates and a shoebox of old CDs in, obsessive librarian in the middle, tidy shelf at the end. — image generated via Nano Banana</figcaption></figure><p>To view the full article:</p><p><a href="https://cslev.vip/blog/raspberry-pi-self-hosting-part-20b/">Part 20/B - How I Run My Entire Digital Life on a Raspberry Pi: Self-Hosted Spotify on a Raspberry Pi: Tagging Music</a></p><h3>What goes through Beets</h3><p>Three kinds of material, each needing slightly different handling:</p><ul><li><strong>Purchased and artist-offered downloads.</strong> Usually tagged well. Albums go in inbox/albums/, loose tracks in inbox/singles/.</li><li><strong>Openly licensed releases</strong> from netlabels, Jamendo or the Free Music Archive. Tagging quality varies the most here, and cover art is often missing.</li><li><strong>My older collection, including ripped CDs.</strong> Staged in temp/existing/, imported copy-first in album mode, with the originals never touched.</li></ul><h3>Why this has to happen before Navidrome</h3><p><a href="https://navidrome.org">Navidrome</a>, the server in Part 20/C, is <strong>read-only</strong>, deliberately and permanently. It has no tag editor and none is planned. It parses tags into its own database and serves from there: play counts and playlists live in its database, while artist, album and title live only in the file. Fix tags at the file level before Navidrome ever sees them, or don’t fix them at all. That’s the entire reason this is a separate stage.</p><h3>The container, and a config you can copy</h3><pre>services:<br>  beets:<br>    image: lscr.io/linuxserver/beets:latest<br>    container_name: beets<br>    restart: unless-stopped<br>    environment:<br>      - PUID=1000<br>      - PGID=1000<br>      - TZ=Asia/Singapore<br>    volumes:<br>      - /mnt/storage/music/config/beets:/config<br>      - /mnt/storage/music:/data<br>    networks:<br>      pi_docker_network:</pre><p>First, split the inbox in two. A folder of unrelated singles and a folder holding one album need different import modes, and you’ll see why shortly:</p><pre># mkdir -p /mnt/storage/music/temp/inbox/{albums,singles}</pre><p>/mnt/storage/music/config/beets/config.yaml:</p><pre>directory: /data/library/beets<br>library: /config/musiclibrary.db<br><br>plugins: musicbrainz chroma fromfilename fetchart embedart scrub duplicates edit lastgenre replaygain ftintitle badfiles missing web<br><br>paths:<br>  default: $albumartist/$album%aunique{}/$track $title<br>  singleton: $artist/Singles/$title<br>  comp: Various Artists/$album%aunique{}/$track $title<br><br>import:<br>  copy: yes<br>  move: no<br>  write: yes<br>  incremental: yes<br>  log: /config/import.log<br>  quiet_fallback: asis<br><br>match:<br>  strong_rec_thresh: 0.04<br>  max_rec:<br>    missing_tracks: medium<br><br>fetchart:<br>  auto: yes<br>  maxwidth: 1200<br>embedart:<br>  auto: yes<br>  remove_art_file: yes<br><br>lastgenre:<br>  auto: yes<br>  source: album<br>  force: no<br><br>replaygain:<br>  backend: ffmpeg<br><br>edit:<br>  itemfields: track title artist album genres year<br>  albumfields: album albumartist<br></pre><p>What the interesting lines do:</p><ul><li><strong>musicbrainz</strong> is the metadata source itself. Without it Beets has nothing to match against, and nothing else in this config will warn you. The next section is the story of how I found that out.</li><li><strong>chroma</strong> is the plugin doing the clever part. When a file&#39;s tags are too thin or wrong to trust, it fingerprints the raw audio via <a href="https://acoustid.org">AcoustID</a>/Chromaprint and matches the recording itself, not the filename, against <a href="https://musicbrainz.org">MusicBrainz</a>.</li><li><strong>strong_rec_thresh: 0.04</strong> is Beets&#39; default, written out so it can&#39;t change silently. It means a match has to be roughly 96% similar to be applied without asking. A looser value such as 0.10 accepts about 90%, and sooner or later that applies a plausible-but-wrong release, like the 2011 remaster when you own the 1994 original.</li><li><strong>max_rec: missing_tracks: medium</strong> is also a default written out. If a release has tracks your copy lacks, its recommendation is capped at &quot;medium&quot;, so quiet mode never applies it silently. A partial CD rip is exactly that case, and it matters in the CD section below.</li><li><strong>copy: yes, </strong><strong>move: no</strong> is the safe day-one setting. Beets writes a corrected copy into the library and leaves your original where it was, so any mistake is a delete away from undone. More on when to flip it near the end.</li><li><strong>quiet_fallback: asis</strong> only matters for unattended -q runs. When nothing matches confidently, it files the track using whatever tags it already has instead of leaving it stranded. That keeps the library growing, but it moves the review burden from before a file enters the library to after. Wrong tags get filed instead of skipped.</li><li><strong>scrub</strong> strips every tag Beets has no field for and rewrites the ones it does track. That&#39;s fine by me, since it keeps files free of cruft, but anything exotic a source embedded is gone after import.</li><li><strong>fetchart and </strong><strong>embedart</strong> fetch and embed art automatically, and remove_art_file: yes deletes the cover.jpg once it&#39;s embedded, so the embedded image is the single source of truth. The cover art section below explains why, and what it costs.</li></ul><h3>War story: Beets matched nothing, because of one missing word</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O5hNPka94yBNV8cMXkKUJQ.png" /><figcaption>The librarian was ready the whole time. Nobody plugged in the catalog. — image generated via Nano Banana</figcaption></figure><p>For a long time Beets found nothing. Every album ended in No matching release found, every single in No matching recordings found, and I kept explaining it away: independent releases are missing from MusicBrainz, partial rips can&#39;t match, the track count must be off. None of that was the cause.</p><p>The tell came from one verbose run on a 12-track album I knew was in MusicBrainz:</p><pre>Loading plugins: badfiles, chroma, duplicates, edit, embedart, fetchart, fromfilename, ftintitle, lastgenre, missing, replaygain, scrub, web<br>...<br>Search terms: Stanton Warriors - The Warriors<br>chroma: musicbrainz plugin not enabled; acoustid matches will not produce candidates<br>Evaluating 0 candidates.</pre><p>Two things stand out. musicbrainz isn&#39;t in the list of loaded plugins, and no line anywhere says Beets queried MusicBrainz. It never asked. Since Beets 2.4 the MusicBrainz autotagger is a separate plugin. It&#39;s in the default plugin list, but the moment you write your own plugins: line, you have to add it yourself. <a href="https://beets.readthedocs.io/en/stable/guides/tagger.html">Beets&#39; own tagger guide</a> says to check exactly this when you get &quot;No matching release found&quot; for an album you know is in MusicBrainz. My config had a custom plugins: line without it, so Beets had no metadata source at all, and chroma can only produce candidates through that plugin, which is what its log line says.</p><p>The fix is one word, already in the config above. Confirm it took:</p><pre># docker exec beets beet version</pre><p>That lists the enabled plugins and should now include musicbrainz.</p><p><strong>The lesson:</strong> before theorizing about why Beets finds nothing, run one import with -v and read three things: which plugins loaded, what Search terms it used, and whether it then actually queried MusicBrainz. Evaluating 0 candidates means nothing came back from any source, and if no search happened at all, no amount of tweaking the tags will help.</p><h3>The importer in five minutes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9O6UWZoLWj-QVO_g0wusAg.png" /><figcaption>One folder, two fates: Beets will happily call a pile of singles an album unless you tell it not to. — image generated via Nano Banana</figcaption></figure><p>Everything else in this post is a variation on three ideas.</p><h4><strong>Album mode versus singleton mode</strong></h4><p>By default Beets treats every directory with music in it as one album. Point it at a folder with one album and it works. Point it at a folder of unrelated singles and it tries to match them all as a single bogus release, fails, and skips the lot. The fix is -s, which makes Beets treat every file independently. That&#39;s why the inbox is split:</p><pre># docker exec -it beets beet import /data/temp/inbox/albums     # each album in its own subfolder<br># docker exec -it beets beet import -s /data/temp/inbox/singles # every file on its own</pre><h4><strong>Quiet and as-is</strong></h4><p>-q never prompts: it applies matches that are confident enough and defers the rest according to quiet_fallback. -A skips MusicBrainz entirely and trusts the tags a file already has. Use -A when the source tags cleanly, which a purchased Bandcamp release usually does.</p><h4><strong>The prompt</strong></h4><p>When there’s no confident match you get a menu, and the single capital letter in each option is the key:</p><pre>No matching recordings found.<br>➜ [S]kip, Use as-is, Enter search, enter Id, aBort, eDit?</pre><p>Careful with two of them: E is <strong>Enter search</strong> (retry MusicBrainz with different terms) and a capital D is <strong>eDit</strong> (open the tag editor). I pressed the wrong one more than once. For album imports the menu also offers as Tracks and Group albums, both of which you&#39;ll want to avoid for reasons covered below.</p><h4><strong>Look before you import</strong></h4><p>On the no-match screen Beets prints only the file path, because there’s no candidate to compare against, so there’s no switch that shows the current tags there. For a while I used eDit as a viewer: open the editor, see everything is fine, go back, press Use as-is. The info plugin does that job without the round trip. With info on the plugins line, preview a whole folder:</p><pre># docker exec beets sh -c &#39;beet info -i &quot;artist,title,album,genres,year&quot; /data/temp/inbox/singles/*&#39;</pre><p>The sh -c makes the container&#39;s shell expand the *, since your host shell doesn&#39;t know the container&#39;s paths. Test the glob on a few files first, and if a field name is rejected, drop -i to see every tag. If the tags look right, skip the prompts entirely:</p><pre># docker exec -it beets beet import -sA /data/temp/inbox/singles</pre><p>-A never tries a MusicBrainz match, so a mainstream track that would have matched gets filed plain, which for this kind of catalog rarely matters. There&#39;s also a config option, none_rec_action: asis under import:, that imports no-match files as-is even in an interactive session while still prompting for real candidates. The catch is that you stop seeing those files at all, so pair it with the preview.</p><h3>War story: a container that kept retrying a command that couldn’t work</h3><p>First boot looked healthy: a wall of Created database backup at: lines as Beets migrated its schema. Then this, forever:</p><pre>error: unknown command &#39;web&#39;<br>error: unknown command &#39;web&#39;<br>error: unknown command &#39;web&#39;</pre><p>This isn’t a config mistake. <a href="https://github.com/linuxserver/docker-beets">LinuxServer’s beets image</a> always tries to start beet web as its foreground service and healthcheck, whatever your config says. <a href="https://github.com/linuxserver/docker-beets/issues/119">An open feature request</a> asks for a CLI-only mode. A healthy boot looks like this instead:</p><pre>* Serving Flask app &#39;beetsplug.web&#39;<br> * Running on http://127.0.0.1:8337<br>Connection to localhost (127.0.0.1) 8337 port [tcp/*] succeeded!<br>[ls.io-init] done.</pre><p>The fix is one word, web, on the plugins line, already in the config above. It binds to 127.0.0.1 inside the container only, so nothing is exposed unless you publish the port.</p><p>It’s also useless for what I wanted next. beet web is a read-only browse-and-play interface, <a href="https://github.com/beetbox/beets/blob/v1.5.0/docs/plugins/web.rst">by its own documentation</a>: it can&#39;t tag, edit or trigger an import. I wanted a phone-friendly way to say &quot;import what I just downloaded&quot; without SSH, and the options were a cron job or a webhook container. A webhook means another always-on container whose whole job is turning an HTTP request into shell execution on the Pi, which is a much bigger blast radius than the convenience is worth. So the choice was cron or nothing. Cron is the lighter of the two, and this is the host crontab line I&#39;d use. It needs the two-folder split from earlier, and I&#39;ve marked the one flag in it I haven&#39;t tested:</p><pre>*/15 * * * * docker exec beets sh -c &#39;beet import -q --quiet-fallback skip /data/temp/inbox/albums; beet import -qs --quiet-fallback skip /data/temp/inbox/singles&#39;</pre><p>--quiet-fallback skip overrides quiet_fallback: asis for these runs, so anything Beets isn&#39;t sure about waits in the import log instead of being filed. The flag is in Beets&#39; CLI reference, but I haven&#39;t run it.</p><h4><strong>But do your imports by hand</strong></h4><p>I’d put cron a distant second, and this post has already shown why. Quiet mode only applies strong matches, and quiet_fallback: asis files everything below that with its old tags and no review. The 87% album in the next section would have gone into the library unreviewed, wrong edition and all. Genres, years, collaboration credits and artist spelling are decisions that only come up in an interactive session, and each one of them became a cleanup job when I got it wrong. A timer can also fire while a download is still arriving and import half a file. Run the import yourself right after you download something, while you remember what it is. If you do add the cron job later, keep it on skip, and read the log.</p><h3>Reading a real match</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lzc8s9JhsjIvrZl0ZQpgKA.png" /><figcaption>When the percentages tie, the stopwatch decides. — image generated via Nano Banana</figcaption></figure><p>Once the plugin was on, the first album I ran gave me a real candidate screen for the first time. A 12-track album, with the two best candidates:</p><pre>Candidates:<br>1. 87.8% Stanton Warriors - The Warriors<br>          MusicBrainz, Digital Media, 2011, XW, Punks, PUNKSD001<br>2. 87.6% Stanton Warriors - The Warriors<br>          MusicBrainz, CD, 2011, GB, Punks, PUNKSCD001</pre><p>The percentages are nearly tied, so they can’t decide it. The ≠ lines can. Candidate 1 wanted track 11 to run 4:04 where my file runs 3:56, an 8-second gap that means a different edit or master, and it added &quot;(radio edit)&quot; to two titles. Candidate 2&#39;s durations matched within about a second (Leader 3:36 against 3:36, Ouepe Ouepa 3:20 against 3:20). Same album, different editions, and only the durations tell you which one your files came from. My rule: when scores are within a point or two, compare the lengths. Equal or within a second means the same master, and several seconds off means another edit.</p><p>Neither candidate reached the 96% “strong” cutoff, which is why this album needed a human. In quiet mode anything below strong falls to quiet_fallback, and with asis that means the album would have been filed with its old tags, unseen. M shows more candidates and A applies one. On a matched import, applying does more than fix tags: fetchart fetches cover art, embedart embeds it, lastgenre fills a genre, and replaygain computes loudness, which can be slow on a Pi.</p><h3>Traps for loose singles</h3><h4><strong>“No matching recordings found” needs a real check before you blame the database</strong></h4><p>For a long time every file ended up here and I blamed MusicBrainz coverage, when the cause was the missing plugin above. With it enabled, a no-match is worth a minute of checking: search musicbrainz.org yourself. If the release is there, the problem is the search, so use enter Id and paste the release URL. If it genuinely isn&#39;t there, which can happen with small independent releases, skip matching with -A, or let quiet_fallback: asis file it with the tags it has.</p><h4><strong>“Skipped 1 paths” with no explanation is incremental history</strong></h4><p>With incremental: yes, Beets remembers every path it has been shown, including ones you skipped or later deleted, and silently declines to show them again. I spent a while convinced a file was unmatchable when Beets had simply never looked:</p><pre>No files imported from /data/temp/inbox/singles/Night Rollers.opus<br>Skipped 1 paths.</pre><p>-I ignores that history for one run. And note that beet remove doesn&#39;t clear it, which is why re-importing something you just removed can look like it does nothing.</p><p>Two more things trigger the same message. First, the history stores the <em>original</em> path, so while Beets is copying (the day-one copy: yes) the source files stay behind in staging and every later run over the same folder skips all of them. A run that ends with No files imported from /data/temp/existing and Skipped 23 paths usually means all 23 were handled before. Check one with beet list title:&quot;...&quot; before assuming anything is wrong, and if they&#39;re already in the library and only a field is missing, don&#39;t re-import: fix it with beet modify. Second, by default Beets also records <em>skip</em> decisions, so a file you skipped, or one a quiet run skipped for you, is never offered again. -I re-offers everything under the path, including what&#39;s already imported, which can mean duplicate prompts for albums already in the library, so point it at the narrowest folder you can. To keep a quiet pass&#39;s skips visible to a later interactive pass, add --incremental-skip-later so they aren&#39;t recorded.</p><p>One more -s warning while we&#39;re here: it treats every file under the path as a single. Point it at a folder of loose singles, not at a tree that contains albums, or those albums&#39; tracks get filed under Singles/.</p><h4><strong>The singleton path template needs the field you can actually edit</strong></h4><p>My first paths.singleton used $albumartist. I&#39;d correct artist in the editor, the tag would change, and the file would stay in the old folder, because the template was built from a different field the editor never showed me. For a standalone single, &quot;album artist&quot; isn&#39;t a meaningful concept anyway. Key the template to $artist.</p><h3>The <em>genre</em> versus genres trap</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4ikj3-jBe5Ylsv-JaVc5Rg.png" /><figcaption>Same name, different drawer. — image generated via Nano Banana</figcaption></figure><p>A file arrives with a generic or wrong genre: a catch-all, an Electronic on something obviously drum and bass, or nothing useful. (Mine came with YouTube&#39;s catch-all Music on the route in the <a href="https://medium.com/codex/part-20-a-self-hosted-spotify-on-a-raspberry-pi-finding-music-youre-allowed-to-keep-93592df42170">Part 20/A appendix</a>, but any source can hand you a bad genre.) I fixed it by typing the right genre into the import editor, then checked with beet list -f &#39;$genre&#39;, which reported success. The actual audio file, checked with ffprobe, still carried the old value.</p><p>Current Beets has two genre fields sharing a display alias:</p><pre># docker exec beets beet list -f &#39;$id: genre=[$genre] genres=[$genres]&#39; title:&quot;Night Rollers&quot;</pre><pre>7: genre=[drum and bass] genres=[Electronic]</pre><p>genre is the legacy field, still writable, and it held every manual correction. genres is the multi-value field Beets writes into the file&#39;s tags. Every edit I made landed in the one that doesn&#39;t reach the file. A separate wrinkle: the no-match editor screen never showed me a genre field at all, whatever my itemfields said, so I stopped fighting it and fixed genre afterward:</p><pre># docker exec -it beets beet modify genres:Electronic genres=&quot;drum and bass&quot; -m</pre><p>Beets shows a diff and asks before touching anything. Queries are substring matches, so genres:Electronic would also catch Electronic Dance; read the diff.</p><h4><strong>One spelling tip</strong></h4><p>lastgenre normalizes against a whitelist, and <a href="https://raw.githubusercontent.com/beetbox/beets/master/beetsplug/lastgenre/genres.txt">Beets&#39; bundled list</a> spells it drum and bass, with &quot;and,&quot; not DnB or Drum &amp; Bass. Type it that way when you set it by hand, so manual and automatic entries don&#39;t fragment your library into three spellings of one genre.</p><p><strong>The lesson generalizes:</strong> when a command reports success and a downstream check still shows the old value, don’t trust the display template. Query the raw field directly.</p><h3>Setting a genre for a whole import</h3><p>When a whole folder is one genre and the files won’t match anywhere, typing the genre into the editor for every track gets old fast. The import command can do it for you:</p><pre># docker exec -it beets beet import -s --set genres=&quot;breaks&quot; &quot;/data/temp/existing/Breaks&quot;</pre><p>--set field=value assigns that field to everything imported in the run, so it&#39;s one command per genre folder. Use -s here only because these are loose singles, and see the incremental section above for why not to point it at a tree that contains albums. Use genres, not genre, for the reason in the trap above.</p><p><strong>The editor will not show it, and that’s expected.</strong> Beets applies --set after you&#39;ve made your choice at the prompt, so if you open the editor to fix an artist or a title, genres: still shows as an empty list:</p><pre>genres: []</pre><p>Leave it alone. The genre is added automatically when the import is applied. It’s easy to doubt this, so check it with the same count used in the audit below, once before the import and once after:</p><pre># docker exec beets beet list -f &#39;$genres&#39; | sort -f | uniq -c | sort -rn</pre><p>The breaks line should grow by exactly the number of tracks you imported. I used this on singles. For album imports, check the per-track values too, since maintainers describe --set as applying at album level there. Match the spelling your library already uses, so you don&#39;t create another variant of the same genre.</p><h3>When you’ve forgotten how you spelled a genre</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*CJ_mrTiZATbkcS07O1zYXg.png" /><figcaption>Many spellings, one jar. — image generated via Nano Banana</figcaption></figure><p>Genres are free text, and nothing in this pipeline polices them. A rip keeps whatever its ripper guessed, an as-is import keeps whatever the source said, and anything you type is exactly as consistent as you were that day. After enough imports the same genre exists under several spellings, and anything that groups by genre, such as a client’s genre browser, shows them as separate entries. I haven’t checked whether Navidrome folds case itself.</p><p>The audit is one pipeline. It reads every track’s genres, counts each distinct value, and sorts by popularity:</p><pre># docker exec beets beet list -f &#39;$genres&#39; | sort -f | uniq -c | sort -rn</pre><p>sort -f ignores case while sorting, so Breaks and breaks land next to each other, and uniq -c still counts them separately, which is what makes a spelling split visible. Blank lines are tracks with no genre at all. Mine looked like this (trimmed):</p><pre>     73 Breakbeat<br>     50 Breaks<br>     28 Drum &amp; Bass<br>     25 drum and bass<br>     17 Soundtrack<br>     12 breaks<br>      8 Drum and bass<br>      4 soundtrack<br>      6 Other<br>      1 Drum and Bass<br>      1 Breakz</pre><p>Four spellings of drum and bass, three of breaks, two of soundtrack, and a placeholder. Two notes. A track with several genres prints them joined by ; and counts as its own line, so split on ; first if you want per-genre totals. And run the same count against the legacy $genre field once, because anything typed into the wrong field, as in the trap above, shows up there and nowhere else.</p><h4><strong>Pick one spelling per genre</strong></h4><p><a href="https://raw.githubusercontent.com/beetbox/beets/master/beetsplug/lastgenre/genres.txt">Beets’ own </a><a href="https://raw.githubusercontent.com/beetbox/beets/master/beetsplug/lastgenre/genres.txt">lastgenre whitelist</a> is a sensible reference, and it spells it drum and bass, with &quot;and&quot; and not &amp;. You can search it from inside the container, using the path from your own verbose log (it varies by image version):</p><pre># docker exec beets grep -n -i &quot;break&quot; /lsiopy/lib/python3.12/site-packages/beetsplug/lastgenre/genres.txt</pre><h4>Merge with modify</h4><p>Queries ignore case but can&#39;t treat &amp; as and, so drum and bass needs two commands:</p><pre># docker exec -it beets beet modify genres:&quot;drum and bass&quot; genres=&quot;drum and bass&quot;<br># docker exec -it beets beet modify genres:&quot;drum &amp; bass&quot; genres=&quot;drum and bass&quot;</pre><p>The first catches drum and bass, Drum and bass and Drum and Bass. The second catches the &amp; variant. Each shows a diff and asks before changing anything, and the diff will include tracks that already have the right spelling, which is harmless. Genres aren&#39;t part of any path template, so nothing moves. Only tags are rewritten.</p><p>Queries are substring matches, so read the diff every time. genres:break would also catch Breakbeat, which is why I&#39;d run genres:&quot;breaks&quot; and genres:&quot;breakz&quot; separately, and whether Breakbeat is the same genre as Breaks is a taste call, not a technical one. An anchored regex query is the stricter option, but I haven&#39;t tested it on this multi-value field.</p><p>Then rerun the count. Merging the four drum and bass spellings above should give a single line of 62 (28 + 25 + 8 + 1) and nothing else that looks like it. The placeholder, Other here, is worth setting properly rather than merging.</p><h4><strong>Prevention</strong></h4><p>lastgenre normalizes the genres it fetches itself, and as far as I can tell it leaves what you typed alone, so it won&#39;t tidy this for you. The habit that works is deciding the spelling once, then using it everywhere: in the editor, in --set genres=..., and in modify.</p><h3>Fixing things after the fact</h3><h4>Retagging</h4><p>beet modify &lt;query&gt; field=value edits items already in the library, and beet edit &lt;query&gt; reopens the editor on them. If the change affects the file&#39;s computed path, Beets says so in the prompt and relocates the file in the same step:</p><pre>Really modify, move and write tags? (Yes/no/select)</pre><p>That single confirmation both corrects the tag and moves the file, so you don’t need a separate beet move.</p><h4>Queries are case-insensitive, and there’s no setting to change that</h4><p>I ended up with both Kestrel Lane and KESTREL LANE folders because two files disagreed on capitalization. A plain query like artist:&quot;KESTREL LANE&quot; matches both, and it&#39;s a substring match, so it would also catch Kestrel Lane &amp; Moss. To match exactly that artist in any capitalization, use an anchored regex, preview it, then normalize:</p><pre># docker exec beets beet list -f &#39;$albumartist | $artist | $title | $path&#39; artist::&#39;(?i)^kestrel lane$&#39;<br># docker exec -it beets beet modify artist::&#39;(?i)^kestrel lane$&#39; artist=&quot;Kestrel Lane&quot;<br># docker exec -it beets beet modify -a albumartist::&#39;(?i)^kestrel lane$&#39; albumartist=&quot;Kestrel Lane&quot;</pre><p>Singles are filed by artist and albums by albumartist, so both need fixing. Each modify shows a diff and moves the files into one folder. To tell two folders apart by case on disk, match on the path instead, which is case-sensitive on Linux:</p><pre># docker exec beets beet list -f &#39;$path&#39; path::KESTREL</pre><p>Once MusicBrainz is enabled, matched imports take its spelling of the artist, so this drift mostly comes from as-is imports.</p><h4>Don’t mv files yourself</h4><p>Beets stores every file’s location in its database. Move a file by hand and the database still points at the old path, and beet write, later imports and duplicate detection get confused in ways that surface weeks later. Fix the tag and let Beets move the file.</p><h4>Redoing an import cleanly</h4><pre># docker exec -it beets beet remove -d artist:&quot;Kestrel Lane&quot; title:&quot;Night Rollers&quot;<br># docker exec -it beets beet import -sI /data/temp/inbox/singles/&quot;Night Rollers.opus&quot;</pre><p>remove -d deletes the database record and the filed copy. Without -d the stale file stays on disk. And -I is needed, for the reason in the previous section.</p><h4>A policy decision worth making once</h4><p>Collaboration credits split folders: Kestrel Lane &amp; Moss and Kestrel Lane are different strings, so they become different directories. I keep the primary artist in artist and put the collaborator in the title, for example Night Rollers (feat. Moss).</p><p>Navidrome&#39;s search covers titles, artists and albums, so the credit stays findable by typing it, though browsing by artist page won&#39;t show it. Check that in your own client. The alternative, keeping full credit in artist, is just as valid. The point is to choose one rule instead of deciding per track.</p><h3>Cover art: who fills it, and what overwrites what</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wed6_QSlQOGVytVCSKMULQ.png" /><figcaption>Navidrome checks the folder before the file, so tidy one of them away. — image generated via Nano Banana</figcaption></figure><p>Two things can supply artwork, and they can disagree. Beets is the one that writes art into your library. Navidrome only reads it and never writes to your music. So the question is really what Beets does, and then which image Navidrome prefers when it finds more than one.</p><h4>Why some files never got any</h4><p>fetchart is enabled with auto: yes, and for a long time it did nothing for me. By its documentation, remote sources (Cover Art Archive, iTunes, Amazon and the rest) are only queried when an import applied a MusicBrainz match; for as-is imports and -A, Beets looks for art only in the local folder. Nothing was matching, because of the missing plugin, so fetchart never got to search. With MusicBrainz enabled, matched imports should now fetch art at import time. As-is imports still won&#39;t, so the backfill below stays useful.</p><h4>What happens to art that’s already embedded</h4><p>Say a file already has art baked in, such as a generic logo or a low-quality image. Beets doesn’t look at that image when it decides what to do. It tracks art as a “file on the side” (cover.jpg in the album folder), not as the picture inside the tags, and embedart only embeds once an album has such a file. So on an as-is import with no cover.jpg, there&#39;s nothing to embed and the existing embedded image is simply left alone. Later, if you backfill with fetchart and embedart, Beets <strong>does overwrite</strong> it. The embedart docs mention being &quot;reluctant to overwrite existing embedded art&quot; as the reason for two safeguards, and neither helps when you&#39;re replacing a bad image on purpose. ifempty: yes refuses to touch any file that already has art. compare_threshold only replaces art that&#39;s similar to what&#39;s there (and needs ImageMagick), while a real cover can look nothing like the generic image it replaces. Leave both at their defaults for a deliberate replacement. If you&#39;d rather just remove a bad embedded image, beet clearart &lt;query&gt; strips it.</p><p>The backfill is two commands, and the standalone fetchart doesn&#39;t have the as-is restriction:</p><pre># docker exec beets beet fetchart -f artist:&quot;Kestrel Lane&quot;<br># docker exec beets beet embedart artist:&quot;Kestrel Lane&quot;</pre><p>fetchart downloads the image; embedart writes it into the file&#39;s tags. And here&#39;s a trap: the flags don&#39;t mean the same thing across the two commands. fetchart -f is <em>force</em>, but embedart -f is <em>file</em>, a specific image to embed. I ran embedart -f artist:... and got error: image file /artist:... not found. Leave the flag off. Don&#39;t be surprised if a forced search still comes up empty for obscure releases.</p><h4>What Navidrome prefers</h4><p>By default Navidrome looks for album art in this order: an image file named cover, folder or front in the album folder, then an image embedded in the files, then an external service (currently Last.fm, per its docs, and it needs an API key you&#39;d have to set up), then its blue-vinyl placeholder. Notice that the folder image comes first. fetchart saves a cover.jpg into the album folder by default, so a bad cover.jpg can beat a good embedded image sitting right next to it. That&#39;s why the config above sets remove_art_file: yes:</p><pre>embedart:<br>  auto: yes<br>  remove_art_file: yes</pre><p>remove_art_file deletes the album art file after it has been embedded, so the embedded image is the only one left and Navidrome has nothing to prefer over it. The tradeoff is that any other player relying on a cover.jpg in the folder loses it. Try it on one album first, and check whether a manual beet embedart run removes the file as well as the automatic one. The alternative is to leave remove_art_file off and put embedded first in Navidrome&#39;s ND_COVERARTPRIORITY, which I cover in Part 20/C.</p><p>Our config sets auto: yes for both plugins, remove_art_file: yes on embedart and maxwidth: 1200 on fetchart, so everything else here is a default. maxwidth needs ImageMagick or Pillow, and I haven&#39;t checked what the container ships, so if images aren&#39;t being resized, look there first. And Navidrome caches artwork, so after changing art it needs a rescan or its artwork refresh command, also covered in Part 20/C.</p><h3>Stop storing everything twice, but only when you trust it</h3><p>Once the workflow has proven itself on a few batches, copy: yes means every file exists twice. To switch:</p><pre>import:<br>  copy: no<br>  move: yes</pre><pre># docker restart beets<br># docker exec beets beet config | grep -A 6 &quot;^import:&quot;</pre><p>Confirm the running process picked it up. Two caveats. First, this only affects imports from now on. Everything already in the library stays put, and the leftover originals in the inbox are now redundant. Delete those by hand, in small batches, after verifying the library copy. Check with beet stats before and after a cleanup pass, and verify the field that matters rather than the one that displays convincingly. Second, with move: yes there&#39;s no inbox copy to fall back on, so <strong>keep a backup of anything you paid for</strong>, and don&#39;t flip this on day one. Put -c back on any run over irreplaceable material, since it forces copy for that run and takes precedence over move: yes.</p><h4>What move leaves behind</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KcpPvRdcAGk5VazNYy06PQ.png" /><figcaption>Beets moves the music. The paperwork stays behind. — image generated via Nano Banana</figcaption></figure><p>move: yes moves the audio files Beets imports, and it treats the cover image as album art: it moves the image along, embeds it, and remove_art_file: yes then deletes it. So the cover doesn&#39;t linger. What does stay in the source folder is everything Beets has no concept of: old .m3u playlists, .nfo files, rip logs, whatever else came in the download. Beets only cleans up folders that end up empty, so a folder with leftovers sticks around, and clearing it out is manual. Navidrome ignores those files, and an old .m3u is useless anyway, because it points at paths that no longer exist.</p><p>Before you delete the leftovers, check the cover embed. remove_art_file deletes the image after embedding, so if the embed had silently failed, the art would now exist nowhere. has_cover_art is a query field in recent Beets versions, and I used it two ways on one album: false returned nothing and true returned every track.</p><pre># docker exec beets beet list -f &#39;$title&#39; album:&quot;Your Album&quot; has_cover_art:false<br># docker exec beets beet list -f &#39;$title&#39; album:&quot;Your Album&quot; has_cover_art:true</pre><p>If the first prints nothing and the second lists every track, the art is embedded. Also confirm the track count matches what was in the source folder, then remove the leftover folder:</p><pre># ls -la &quot;/mnt/storage/music/temp/inbox/albums/&lt;album folder&gt;&quot;<br># rm -r &quot;/mnt/storage/music/temp/inbox/albums/&lt;album folder&gt;&quot;</pre><p>The ls first is the point: you should see only extras you recognize, like .nfo, .m3u and logs, and no audio files. Only delete once you&#39;ve confirmed the library copy is complete, and keep a backup of anything you can&#39;t get again. If the .nfo has provenance you care about, copy it into the licenses/ folder from <a href="https://medium.com/codex/part-20-a-self-hosted-spotify-on-a-raspberry-pi-finding-music-youre-allowed-to-keep-93592df42170">Part 20/A</a> first. Community plugins such as copyartifacts and filetote can carry extra files along with an import; they don&#39;t ship with Beets and I haven&#39;t tried them.</p><h3>Beets command glossary</h3><p>The commands that actually mattered, one line each.</p><ul><li>beet import &lt;path&gt; — imports a folder as an album, grouping its files together; use it for real albums.</li><li>beet import -s &lt;path&gt; — imports every file as an independent single; use it for any folder of loose singles.</li><li>beet import -q &lt;path&gt; — runs quietly, applying confident matches and deferring the rest per quiet_fallback; use it for unattended runs once you&#39;ve seen how your files score.</li><li>beet import -A &lt;path&gt; — skips MusicBrainz and trusts the tags a file already has; use it for sources that tag cleanly.</li><li>beet import -c &lt;path&gt; — forces copy for this run, overriding move: yes; use it on irreplaceable material after switching to move, and skip it while copy: yes is your default.</li><li>beet import -I &lt;path&gt; — ignores the incremental history for one run; use it to re-import a path Beets already saw.</li><li>beet import --incremental-skip-later &lt;path&gt; — stops skip decisions from being recorded; use it on quiet passes whose skips you&#39;ll review by hand later.</li><li>beet import --set genres=&quot;&lt;genre&gt;&quot; &lt;path&gt; — assigns a field to everything imported in that run, applied after your choices; use it to give a folder of singles one genre.</li><li>beet list -f &#39;&lt;format&gt;&#39; &lt;query&gt; — prints a read-only listing in a custom format; use it to check real stored values before trusting a display.</li><li>beet list -f &#39;$genres&#39; | sort -f | uniq -c | sort -rn — counts every distinct genre spelling in the library; use it to audit genres before unifying them.</li><li>beet modify &lt;query&gt; field=value — edits a field on imported items and relocates them if the path changes; use it to fix a wrong artist or genres afterward.</li><li>beet modify -a &lt;query&gt; field=value — does the same at album level; use it to fix album or albumartist for a whole album at once.</li><li>beet edit &lt;query&gt; — reopens the interactive editor on library items; use it to re-correct a mistake.</li><li>beet remove -d &lt;query&gt; — deletes the database record and the file; use it to undo an import before redoing it.</li><li>beet move &lt;query&gt; — relocates a file to match its current tags; use it to fix a stale path.</li><li>beet write &lt;query&gt; — pushes database values into the file&#39;s tags; use it to reconcile a database and file mismatch.</li><li>beet fetchart -f &lt;query&gt; — forces a remote search for cover art; use it to backfill art that import never fetched.</li><li>beet embedart &lt;query&gt; — embeds the associated art into the file&#39;s tags; run it after fetchart, and leave off -f, which means a file path here.</li><li>beet clearart &lt;query&gt; — strips embedded images from matching items; use it to remove a bad embedded image.</li><li>beet list &lt;query&gt; has_cover_art:false — lists tracks with no embedded art (true for the opposite); use it to confirm the embed worked after remove_art_file deleted the image.</li><li>beet info -i &#39;&lt;fields&gt;&#39; &lt;path&gt; — dumps a file&#39;s current tags without importing, and needs the info plugin; use it to preview a folder before choosing -A.</li><li>beet stats — prints library totals; use it to confirm an import added what you expected.</li><li>beet fields — lists every field name Beets recognizes; use it to confirm a field exists before querying it.</li><li>beet config — dumps the fully merged, active configuration; use it to rule out a stale config after editing.</li><li>beet version — lists Beets&#39; version and the enabled plugins; use it to confirm musicbrainz actually loaded.</li><li>beet -v import &lt;path&gt; — runs a verbose import that shows plugins loaded, search terms and candidates; use it to find out why Beets found nothing.</li></ul><h3>What’s next</h3><p>One last thing on the config. Keep copy: yes while you&#39;re learning, because it makes every mistake in this post a delete away from undone. Once you&#39;re familiar with Beets and these commands, and you&#39;ve seen how your own files score, change it to copy: no and move: yes, as described in &quot;Stop storing everything twice, but only when you trust it,&quot; so every file stops existing twice. Keep a backup of anything irreplaceable, and add -c to runs over it.</p><p>The library is organized, tagged and consistent enough to trust. <strong>Part 20/C</strong> hands it to Navidrome, which does the least work and causes the fewest problems of anything in this series. After the above, that’s exactly what I wanted from the finish line.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=118ea1904eb1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/self-hosted-spotify-on-a-raspberry-pi-part-20-b-tagging-a-music-library-with-beets-118ea1904eb1">Self-Hosted Spotify on a Raspberry Pi — Part 20/B: Tagging a Music Library with Beets</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Java 27 Changed the Default Garbage Collector in Small Containers.]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://medium.com/codex/java-27-changed-the-default-garbage-collector-in-small-containers-cd8a9b72fa24?source=rss----29038077e4c6---4"><img src="https://cdn-images-1.medium.com/max/1672/1*TN87pdCBeiY0LxYoEEhlNg.png" width="1672"></a></p><p class="medium-feed-snippet">Your Spring Boot service runs in a container with one CPU and 768 MB of memory.</p><p class="medium-feed-link"><a href="https://medium.com/codex/java-27-changed-the-default-garbage-collector-in-small-containers-cd8a9b72fa24?source=rss----29038077e4c6---4">Continue reading on CodeX »</a></p></div>]]></description>
            <link>https://medium.com/codex/java-27-changed-the-default-garbage-collector-in-small-containers-cd8a9b72fa24?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/cd8a9b72fa24</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[microsoft]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-development]]></category>
            <dc:creator><![CDATA[The Turtle Code]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 13:02:45 GMT</pubDate>
            <atom:updated>2026-11-20T13:02:44.688Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Design patterns part 1 — Singleton pattern]]></title>
            <link>https://medium.com/codex/design-patterns-part-1-singleton-pattern-2eca51192757?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/2eca51192757</guid>
            <category><![CDATA[java]]></category>
            <category><![CDATA[double-checked-locking]]></category>
            <category><![CDATA[singleton]]></category>
            <category><![CDATA[design-patterns]]></category>
            <category><![CDATA[lazy-initialization]]></category>
            <dc:creator><![CDATA[Ramsunthar Sivasankar]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 12:41:27 GMT</pubDate>
            <atom:updated>2026-11-20T12:40:45.320Z</atom:updated>
            <content:encoded><![CDATA[<h3>Design patterns part 1 — Singleton pattern</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/0*HfHUr1tBadrUdYiP.png" /><figcaption>(source: <a href="https://www.hojjatk.com/2014/08/design-patterns.html">https://www.hojjatk.com/2014/08/design-patterns.html</a>)</figcaption></figure><p>This is a new topic that I am going to talk about. Most of the developers might heard about design patterns or maybe that word. In interviews also you will be asked about design patterns even it for an Associate position.</p><h4>What is <strong>Design Pattern?</strong></h4><p>It is a general solution for common problems that occurring in software design and it is more like a pre-designed template that we can customize to solve the problem. You can’t directly convert into code because it is just a general concept for solving specific problems. For easier understanding, you know that Dollar is the standard currency for the global economy likewise these design patterns are the standard best practices in the software design and through this developers are able to communicate using well understood term for interactions of the software design. Most importantly design patterns are language independent. In 1994, <a href="https://en.wikipedia.org/wiki/Erich_Gamma">Erich Gamma</a>, <a href="https://wiki.c2.com/?JohnVlissides">John Vlissides</a>,<a href="https://en.wikipedia.org/wiki/Ralph_Johnson_(computer_scientist)"> Ralph Johnson</a>, and Richard Helm published a book called “<a href="https://www.amazon.com/gp/product/0201633612/"><strong>Design Patterns: Elements of Reusable Object-Oriented Software</strong></a>” which explained about the design patterns to programming and it consist of 23 design patterns solving various problems of software design and it also known as “<strong>GoF book</strong>”</p><h4>Why do we need Design Pattern ?</h4><p>We can reuse these design patterns in different projects. By using this we can give solution which helps to define the architecture of the system. We can use it in our projects without a fear because they are based on the expertise and experience of professional software developers and we can build a better system because design patterns provide a proper clarification to design the system architecture.</p><h4>Classification of Design patterns</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/1*oWnAusXJ12YwcOIBiCZhPA.png" /><figcaption>Types of Design Patterns (source: <a href="http://www.algorithmforum.com/2018/08/design-patterns-software-design-pattern.html">http://www.algorithmforum.com/2018/08/design-patterns-software-design-pattern.html</a>)</figcaption></figure><p>There are mainly 3 categories in design pattern such as creational, structural, and behavioral as I showed in the above image.</p><p><strong>Creational patterns </strong>— This pattern provide object creation mechanisms in a controlled manner that helps to reduce the code complexity.</p><p><strong>Structural patterns</strong> —This explains how to combine objects and classes into bigger structures while maintaining flexibility and efficiency.</p><p><strong>Behavioral pattern — </strong>This pattern is all about the communication between objects.</p><p>So this is basic of design pattern and I’ll be discussing some of these design patterns in the upcoming article as well and this is going to be a series of article.</p><h3>Singleton Pattern</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*m9lFGge1PTOPcXjQiWazgQ.jpeg" /></figure><p>What is “<strong>Singleton design pattern”,</strong> It actually means one instance(unique instance) per container and if you are using Java then one instance per JVM. There may be a case where we have to use only one instance of a particular object in a project. So this concept allows us to create and use that one instance throughout the project. For example, Lets say person X has an account in ABC bank and he/she withdrawing a certain amount of money from his/her account <strong>at the same time </strong>person Y depositing some money to person X’s account. Note that this transaction happening in the same time. So if we didn’t follow singleton design pattern here, It leads to data inconsistency. So if we use one instance of this account object, then this transaction will happen smoothly. We use this pattern while connecting database as well because there will be multiple query updates to a single table at a time.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*Btlr2bV7sLdF5vrDwEOf_g.png" /><figcaption>class diagram of singleton pattern</figcaption></figure><p>There are certain things we should follow while implementing this design pattern,</p><ul><li>We should create a static variable for the instance and it should not take any arguments.</li><li>We should create a private constructor and it prevents creating instance of singleton class from outside the class</li><li>We should create a static method to provide a global access point for the singleton object.</li></ul><p>Lets take a look at the code,</p><h4>Early Initialization</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd826d5b118726fce385dc4aa9962097/href">https://medium.com/media/cd826d5b118726fce385dc4aa9962097/href</a></iframe><p>as you can see from the above code, we create an instance (instance) from the Singleton class with a private constructor and public method (getInstance())to give global access to that instance.</p><blockquote>Note — volatile keyword is used to keep the data consistency in the multi-threads scenario. <a href="https://www.javatpoint.com/volatile-keyword-in-java">Click here</a> to learn more about usage of volatile.</blockquote><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c6ac3927d7c37f417b13dbc7e86134af/href">https://medium.com/media/c6ac3927d7c37f417b13dbc7e86134af/href</a></iframe><p>To test, I have created a class called <strong>Application </strong>and assigned two different variable to use the singleton object. If I run this I’ll get the output as follows,</p><pre>singletonPattern.Singleton@3830f1c0<br>singletonPattern.Singleton@3830f1c0</pre><p>Even though I assigned to two different variable and called in different time, it still access the same instance because its singleton. What happens in the first file (Singleton_1.java) is the instance was created as soon as the application loads and this is called “<strong>Early Initialization</strong>”. There may be a case where we don’t need the singleton object all the time. So at that case, this will be a disadvantage. Lets see how we can overcome this.</p><h4>Lazy Initialization</h4><p>In here we don’t create the instance at the beginning as you can see from the code below (line number 3). So when we invoke getInstance() method, it checks(line number 9) whether there is an instance already created or not. If already created it returns that instance(line number 12) and if not it will create a new instance(line number 10). Which means it only creates when we request and this is known as “<strong>Lazy Initialization</strong>”</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce6a3549da37d37b0682592f6532d666/href">https://medium.com/media/ce6a3549da37d37b0682592f6532d666/href</a></iframe><p>The problem in here is if there are two threads coming in concurrently, first thread goes to line number 9 and check whether there is a instance created or not and since this is the first thread it will go to line number 10. While the instance is been creating the second thread comes to line number 9, at this point the instance is not created yet so it will allows the second thread to line number 10. So this is NOT thread safe. There may be a case where multiple threads may create instance like this. To avoid that we can do some changes in the code and lets see how.</p><h4>Lazy Initialization — with Thread safe</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/7fc2a2d417c0e55d5df9997529257431/href">https://medium.com/media/7fc2a2d417c0e55d5df9997529257431/href</a></iframe><p>Lets take the same scenario as before (two threads), So the first thread will come to line number 9 and check whether the instance is null or not, since its null it will go to line number 10 and acquire the lock then it will go into the synchronized block and check again for existence of the instance and it will create the instance on line number 12. Now the second thread goes to line number 9 and it will allow because the instance creating process is going on which means its still null. But when it hits the line number 10, it will stop the second thread to move further because the lock is already acquired by the first thread. So the second thread can only go further after the first thread releases the lock (by completing the execution). Its known as “<strong>double checked locking”. </strong>So the second thread will be allowed by the synchronized block and inside that it checks again and at that time instance is not null so it will return the same instance (line number 16).</p><p>Some people will use the synchronized keyword in the access method(next to static keyword in getInstance method). You can do that but <strong>you should not</strong> because this is small example but in the actual project there may be lot of codes should be executed within that method so at that time if there multiple threads coming concurrently, each threads coming after the first one have to wait more time to access the method. So it is always best to put the synchronized block wherever its needed.</p><p>So this the <strong>Singleton pattern</strong> and I hope you will understand this. I will be discussing about Factory pattern in the next article.</p><h3>References</h3><p>I have referred to the following YouTube video to write this article, which was made by <a href="https://medium.com/u/26403c4bd160">Krishantha Dinesh</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2Fg7RfBhO-rhU%3Flist%3DPLD-mYtebG3X86i3uyAXwZKfVtUy2gMDdo&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3Dg7RfBhO-rhU&amp;image=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2Fg7RfBhO-rhU%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/ce650a89b373c4d0fdae35f1722a4e8e/href">https://medium.com/media/ce650a89b373c4d0fdae35f1722a4e8e/href</a></iframe><ul><li><a href="https://sourcemaking.com/design_patterns">Design Patterns and Refactoring</a></li><li><a href="https://refactoring.guru/design-patterns/what-is-pattern">What&#39;s a design pattern?</a></li><li><a href="https://www.javatpoint.com/design-patterns-in-java">Design Patterns in Java - Javatpoint</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2eca51192757" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/design-patterns-part-1-singleton-pattern-2eca51192757">Design patterns part 1 — Singleton pattern</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Modern Javascript]]></title>
            <link>https://medium.com/codex/modern-javascript-a5c7dd9c2b07?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/a5c7dd9c2b07</guid>
            <category><![CDATA[modern-javascript]]></category>
            <category><![CDATA[js]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Ramsunthar Sivasankar]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 12:41:05 GMT</pubDate>
            <atom:updated>2026-11-20T12:40:37.429Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/747/1*Vqqwc9b4xq1XK8NzgMw8qQ.png" /><figcaption>(source: <a href="https://pureinfotech.com/set-print-screen-key-screenshot-screen-sketch-windows-10/">https://pureinfotech.com/set-print-screen-key-screenshot-screen-sketch-windows-10/</a>)</figcaption></figure><p>you might have learned javascript here and there some people might have learned in their school IT subject. But most of the developers started to learn JS when the stacks like MEAN and MERN came into the picture. Because on that point onwards JS has changed in many aspects. <strong>Ecma </strong>is the foundation of JS. Each and every developer must know the fundamental of JS. So lets talk about some of the modern concept of JS.</p><h3>Scope</h3><p>There are 3 ways of declare a variable in JS, one is using var keyword next one is let and other one is const but what is the difference ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/385/1*O6BVBuy517PoNz7R7DE4-A.png" /><figcaption>1-scope.js</figcaption></figure><p>When considering the above code, it will give the output as follows when u run this code,</p><pre>i =0<br>i =1<br>i =2<br>i =3<br>i =4<br>i =5<br>i =6<br>i =7<br>i =8<br>i =9<br>k =9</pre><p>but when you use let instead of var while declaring the variable “<strong>k</strong>” in the line number 2 (let k =i)then what will happen ? You will get something like this 👉 ReferenceError: k is not defined</p><p>Because the variable that defined with let key word will not visible outside the scope. So as a best practice, its better to use the let keyword to declare the variable in a lengthy scripts or in multiple function in a project. It makes debugging easier.</p><h3>Const</h3><p>If you have used const in the above scenario, you will get the same response as the let gave but for a different reason. Lets see why,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*ClTgFsmq6c-6wPJAl1oWfQ.png" /><figcaption>2-const.js</figcaption></figure><p>if you run this code you will get an TypeError because we are trying to change the constant variable.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/253/1*sVREh6zU86SS9wZZm1NY6g.png" /><figcaption>2-const.js</figcaption></figure><p>If you run this code then you will get [ 10, 20, 30 ] as an output. Because const only protecting a variable which is not object or array. So you can change the array as the above code.</p><h3>Arrow Function</h3><p>We usually write a function in JS like,</p><pre>function functionName (parameter) {<br>     //to-do<br>}</pre><p>But there are new ways we can write a function in JS such as,</p><pre>const functionName =(parameter) =&gt; {<br>    //to-do<br>}</pre><p>or if a function has only one line inside the body we can write it as,</p><pre>const functionName = (parameter) =&gt; //to-do;</pre><p>This is called <strong>Arrow Function. </strong>lets see an example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*xN6SJdB1lKFR3rPlk3gM_A.png" /><figcaption>3-arrowF1.js</figcaption></figure><p>If you run the above code you will get the output as follows,</p><pre>10<br>10<br>10<br>4</pre><p>This is the beauty of arrow function.</p><h3>Behavior of Arrow function</h3><p>Even though arrow function is a alternative way of writing a function in modern JS, there are some differences in how these two behave. Lets see with a simple example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/491/1*n_MsVH-1neskk6bgbel2gg.png" /><figcaption>4-arrowF2.js</figcaption></figure><p>So if you looks closely in the above code segment, <strong>print </strong>is a object variable which has two function <strong>function1 </strong>(normal function) and <strong>function2 </strong>(arrow function). What will be the output when we run this above code? you will get,</p><pre>1st function : { function1: [Function: function1], function2: [Function: function2] }<br>2nd function : {}</pre><p>Because in the normal function, <strong>this </strong>keyword represents the object that called the function and at the same time in the arrow function, <strong>this </strong>keyword represents the object that defined the arrow function. <a href="https://www.w3schools.com/js/js_arrow_function.asp">click here</a> to learn more on <strong>this </strong>keyword. So don’t get confused.</p><h3>Object</h3><p>Now lets look into the things that we can do in JS objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/363/1*iaAmzdSiYjwd-cni3JkB7A.png" /><figcaption>5-object.js</figcaption></figure><p>in this above code, demoObject is a object which supposed to have a key : value pair. But I used a num without a pair. If I run this you will get,</p><pre>1.4142135623730951</pre><p>Because I have already declared and used other module (Math) to that variable, so in that case we don’t need to specify it as a <strong>key : value</strong> pair. That is actually similar to num:num; but that is not necessary to put.</p><p>Lets look at an another example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/1*tpY6dIPkOcByAfqHqmsGRg.png" /><figcaption>5-object.js</figcaption></figure><p>In this above code, [status] is the key on line number 5. That is called <strong>dynamic property</strong>. It means we can set a place holder as a key in the object if the key value is a dynamic. lets say you want to send an object to the user through the service and you are informed that the key value is not static. In that case you can set a place holder as a key and then get the value from the user. So if run the code you will get,</p><pre>{ key: &#39;value&#39;, service: &#39;approved&#39; }</pre><p>For the demo, I have set the place holder value in the line number 1 as service.</p><h3>Freeze method</h3><p>lets look at another cool feature,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/366/1*rEIkt74UrHqBEVpdskkOnQ.png" /><figcaption>6-freeze.js</figcaption></figure><p>In this above code, I defined an object with one key with empty value and I am setting the value and printing it (forget about the comment for the moment). Then I am again changing the value and printing the object again. So if you run this you will get,</p><pre>{ x: &#39;alpha&#39; }<br>{ x: &#39;beta&#39; }</pre><p>as an output. So what will happen if I uncomment the line number 4 and run it again then what will be the output ?</p><pre>{ x: &#39;alpha&#39; }                                 <br>{ x: &#39;alpha&#39; }</pre><p>You will get this as an output. Because if you use <strong>freeze, </strong>it will not allow to change the value no matter what. So while working, let say you want to keep an object value same as in all the services in an application then you can freeze the value and pass it in the services. So what do thing of the following,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*CxZLz1mBb1GDmAGC2MvW2w.png" /><figcaption>6-freeze.js</figcaption></figure><p>So you think the value of the object will look like once I print it,</p><pre>{ x: ‘alpha’, y: 5 }<br>{ x: ‘alpha’, y: 5 }</pre><p>But no, if I run the code the output will be,</p><pre>{ x: &#39;alpha&#39;, y: { z: 5 } }<br>{ x: &#39;alpha&#39;, y: { z: &#39;444&#39; } }</pre><p>Because you need to keep in mind that <strong>Object.freeze()</strong> method only freeze the first level values(not the first value its first level) and it won’t freeze inner level object values.</p><h3>Template</h3><p>Lets look into the template,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/770/1*xI-6KL1UKKF2FhYaq2V8vg.png" /><figcaption>7-template.js</figcaption></figure><p>If you run this you will get</p><pre>Edward Kenway born in England</pre><p>So template is not a big topic but it is used to replace the value in the execution time. These are written with the dollar sign and curly brackets. And the whole sentence should be between the backticks(``).</p><h3>Classes in JS</h3><p>most of the people started their IT carrier with the Java or .Net as their first OOP programming language. We used class in those languages. As you all know, that classes are templates for creating objects and in here it is JS objects. Now let see how classes are working in JS,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/991/1*q2s3GK9JN76ema4QqE0ybw.png" /><figcaption>8-class.js</figcaption></figure><p>Usually in Java, we use the constructor in the same name as the class name but in here we use the keyword constructor . Even though we use name in the constructor (above code) we don’t need to declare as in JAVA. Most importantly we can override a function when calling through an object. So if you execute the above code, you will get like the following,</p><pre>Connor is an employee<br>Edward is an Employee and Principal of VNC<br>This function is overridden</pre><p>First 2 lines of output are expected because I have called those function from each classes . But after the overriding you can see the output as “This function is overridden”. So even though this looks exactly like Java class but in reality it mimics.</p><h3>Destructuring in JS</h3><p>This is a JS expression to take out values from array or properties from JS objects. If we take array destructuring, we can declare two variables separately and assign values in one line as in the following code,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/277/1*oOSCiA7x7eOx09dAU3_UUQ.png" /><figcaption>9-destructure.js</figcaption></figure><p>So you will get,</p><pre>5<br>10 </pre><p>as the output. Lets take another example, so in the following code there is a function, I have created an object with some key values and then I’ve created a function called “<strong>area” </strong>and passed one of the value of <strong>“Obj ” </strong>as a parameter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/383/1*N3C-iJtosxmI_TapobkqCw.png" /><figcaption>9-destructure.js</figcaption></figure><p>Lets see what will happen if I run the code,</p><pre>5.9049000000000005</pre><p>I got 5.9049000000000005 as the output because I have logged the function with the Obj as the parameter so I don’t need to specifically mention the value of the Obj (like Obj.value). It automatically gets the value from the Obj.</p><p>So lets say we are printing as follows with the same code,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/490/1*Wtlvi3IAe0cz7HmgcMktIQ.png" /><figcaption>9-destructure.js</figcaption></figure><p>So in the above code I’ve added a function called area1 with an interesting parameter and I explain it, as I mentioned in the previous method call (area) I passed the object as the parameter but in here, I passed the object as well as key value with condition({value}, {round =3} ={}). Basically if there is any value given to the round it will take 3. So the output will come with the decimal place according to the round value. So If I run the code,</p><pre>5.905<br>5.90490</pre><p>as I mentioned above in the first console I didn’t pass any value to round so it just print with 3 decimal point and in the second console log I passed 5 as the parameter for the round variable so it prints the output with 5 decimal point.</p><p>Lets take another example with and without destructuring in file handling,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/1*KnRlI9TCkleW9ykwbkgsgQ.png" /><figcaption>9-destructure.js</figcaption></figure><p>As you can see normally we require the fs module and used a variable and use the function from that variable as the above code. But using destructuring we can write it like the following,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/712/1*7FQmYaZ6qDB-3EMtUitIxg.png" /><figcaption>9-destructure.js</figcaption></figure><p>as you can see from the above code, we don’t need any const to call the function from it and we can just directly call any methods we want. So here I used writeFile. Lets take another example,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*pE1b--rkdh6j4BShHxJW3w.png" /><figcaption>9-destructure.js</figcaption></figure><p>So in the above code there are only 4 property (with one empty) with 5 values. If you run this,</p><pre>10<br>50</pre><p>In here, it skips the value for the empty property and assigned the value to d<strong> </strong>.<strong> </strong>That is why d’s value printed as 50. Lets see what will happen if we change the code a little bit,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*lpObi8pgptZwyWx5LuZ7Dg.png" /><figcaption>9-destructure.js</figcaption></figure><p>So in here, there are two property a and otherValues and if we run the code,</p><pre>10<br>[ 20, 30, 40, 50 ] </pre><p>We know that a is 10 but the <strong>spread operator</strong> (…) used to get the rest of the values to be assigned to the otherValues property. We can use this spread operator to copy an array to another. Lets see how its done,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/415/1*K1O7MQU31OJjZ1-SCgCJ-g.png" /><figcaption>9-destructure.js</figcaption></figure><p>Nothing much only I have added these lines to that code and if we print this we will get,</p><pre>10<br>[ 20, 30, 40, 50 ]<br>new  array:20,30,40,50</pre><p>As you can see the new object(newArr) got the copied value. And also you can use this to merge two arrays as well. This is also suitable for the objects as well and lets see how,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/462/1*IeImRDC8wdxifgRb51wzrw.png" /><figcaption>9-destructure.js</figcaption></figure><p>In this code segment, I have created a games object with some values. As you can see I have passed games object to a string and object with spread operator and If I run this,</p><pre>stealth<br>{ name: &#39;Splinter Cell&#39;, character: &#39;sam fisher&#39;, sequel: 6 }</pre><p>so the type got printed and everything else were assigned to gameDetails object. And also we can copy object just like the array using destructuring.</p><h3>Promise</h3><p>When we are dealing with asynchronous operations in JS (like HTTP request and response), we used callback function. But Promise is better than callback functions. In general, we can pass function as a parameter to another function. (callback is also a function). So the problem with the callback is it will create “<strong>Callback Hell</strong>” which means the code will be messy when there are so many nested functions called within functions. Promise is able to handle this kind of problem. Basically in promise, it resolves when nothing went wrong or it rejects. In other word, we use it to get synchronous output out of asynchronous process.</p><p>There are 3 states in promise such as pending, resolved , and rejected. Lets look at the code,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/1*CKIF67R8bew99Tyn8piUBg.png" /><figcaption>10-promise.js</figcaption></figure><p>To create a promise, we use a constructor. I set the timeout to mimic the HTTP response (it takes some time to populate). This code explains the basic idea how the promise works.</p><p>To use the promise, we have to use then() for resolving and catch() for rejecting.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/707/1*eP7DiEAn1bzg2P3un_ic_Q.png" /><figcaption>10-promise.js</figcaption></figure><p>and if you run this you will get the following output after 3000 milliseconds,</p><pre>Promise is resolved!</pre><p>We also can create a function to use the previous promise like the following code,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*zwZkWvrjRNHLUdc-2mAUcg.png" /><figcaption>10-promise.js</figcaption></figure><p>There is something called <strong>chaining</strong>, lets say there are multiple async requests, we can create a separate promise and chain it with other promise. Like creating a function and adding the new promise in the then() method like in the following code (only the then part),</p><pre>...<br>.then(1stPromiseObject)<br>.then(2ndPromiseResolve)<br>...</pre><h3>Async/Await</h3><p>This works with promise and make promises easier to write. If there is a function starts with the <strong>async </strong>keyword, the function will return a promise. The <strong>await </strong>works only inside the <strong>async functions. </strong>This keyword let the JS to know that hey! wait until the promise returns any results. If you use await without async, you will get syntaxError saying “await is only valid in async function”. Most importantly, this is more easier syntax than <strong>promise.then(). </strong>Lets take a look at the example (consider the previous <strong>demoPromise </strong>code),</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/402/1*ZZ7cyEcxovzzVyWlYGiXiw.png" /><figcaption>10-promise.js</figcaption></figure><p>So this is the how function willl looks like with async and await. This is easy to understand comparing to other types.</p><p>I hope you have learnt lot of new JS features using this article and I have uploaded these codes in my GitHub.<a href="https://github.com/Ramsunthar/JS-snippets"> Click Here</a> to check the codes. Keep learning.</p><h3>References</h3><p>I have referred the following YouTube videos to write this article, which was made by <a href="https://medium.com/u/26403c4bd160">Krishantha Dinesh</a></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FJc2iW4yVv38%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DJc2iW4yVv38&amp;image=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fi.ytimg.com%2Fvi%2FJc2iW4yVv38%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/68dc968947c229b6ca0a10da856ffdb1/href">https://medium.com/media/68dc968947c229b6ca0a10da856ffdb1/href</a></iframe><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fembed%2FXK_lB5-XzhQ%3Fstart%3D2&amp;display_name=YouTube&amp;url=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttps%2Fwww.youtube.com%2Fwatch%3Fv%3DXK_lB5-XzhQ&amp;image=https%3A%2F%2Fsummer-heart-0930.chufeiyun1688.workers.dev%3A443%2Fhttp%2Fi.ytimg.com%2Fvi%2FXK_lB5-XzhQ%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/a3037e87c5c7dc65a6743012164af2d8/href">https://medium.com/media/a3037e87c5c7dc65a6743012164af2d8/href</a></iframe><ul><li><a href="https://www.w3schools.com/js/js_arrow_function.asp">JavaScript Arrow Function</a></li><li><a href="https://www.geeksforgeeks.org/destructuring-assignment-in-javascript/">Destructuring Assignment in JavaScript - GeeksforGeeks</a></li><li><a href="https://www.loginradius.com/blog/async/callback-vs-promises-vs-async-await/">Callback vs Promises vs Async Await</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a5c7dd9c2b07" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/modern-javascript-a5c7dd9c2b07">Modern Javascript</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Man in the middle (MITM) attack (Part 01 — ARP poisoning & DNS spoofing)]]></title>
            <link>https://medium.com/codex/man-in-the-middle-mitm-attack-part-01-arp-poisoning-dns-spoofing-51ad724edd6b?source=rss----29038077e4c6---4</link>
            <guid isPermaLink="false">https://medium.com/p/51ad724edd6b</guid>
            <category><![CDATA[arp-poisoning]]></category>
            <category><![CDATA[man-in-the-middle-attack]]></category>
            <category><![CDATA[dns-spoofing]]></category>
            <category><![CDATA[security]]></category>
            <dc:creator><![CDATA[Ramsunthar Sivasankar]]></dc:creator>
            <pubDate>Fri, 20 Nov 2026 12:41:04 GMT</pubDate>
            <atom:updated>2026-11-20T12:40:33.262Z</atom:updated>
            <content:encoded><![CDATA[<h3>Man in the middle (MITM) attack (Part 01 — ARP poisoning &amp; DNS spoofing)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*2GZVWQjLvyOaumjAqcWipQ.jpeg" /><figcaption>(source: <a href="https://blog.malwarebytes.com/101/2018/07/when-three-isnt-a-crowd-man-in-the-middle-mitm-attacks-explained/">https://blog.malwarebytes.com/101/2018/07/when-three-isnt-a-crowd-man-in-the-middle-mitm-attacks-explained/</a>)</figcaption></figure><p>Most of the young people play online games right? There is a time where we played a game called “<strong>Barn buddy</strong>”. In that game, we had our own farm, a small house, and other animals like horses, cows, and etc. And also we can have a dog to protect the farm from other player stealing goods from our farm. It was school time back then, so some of my friends didn’t have PC at their home. So they give their Facebook credential to a friend who had PC and said to open the his facebook daily and feed the dog in the game or else the dog will sleep. In here, how can he guarantee that his friend won’t look into his messages or maybe texting to someone by acting like his friend. Do you think this is hacking? technically no.</p><h3>MITM</h3><p>This stands for Man In The Middle attack and it occurs when a perpetrator places himself into communication between a user and an application, either to listen in or to mimic one of the parties, making it look as though a regular information exchange is taking place. The attack is usually to steal personal information, like account details, card details, and credentials. Most of attacks are done to business, financial websites where logging in is requested.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*o2wmHX1BVCT2EzNItGOSKw.png" /><figcaption>MITM attack (source: <a href="https://www.imperva.com/learn/application-security/man-in-the-middle-attack-mitm/">https://www.imperva.com/learn/application-security/man-in-the-middle-attack-mitm/</a>)</figcaption></figure><p>It’s a form of eavesdropping attack in which an attacker interrupts a conversation or data transfer in progress. The attackers pose as both genuine parties after placing themselves in the “middle” of the transfer as showed in the above figure. This allows an attacker to intercept data and information from both parties while also providing malicious links or other information to both genuine participants in a way that may not be discovered.</p><p>There are several types of MITM attacks,</p><ul><li>ARP Cache Poisoning</li><li>DNS Spoofing</li><li>IP Spoofing</li><li>Wi-Fi Eavesdropping</li><li>Session Hijacking</li></ul><p>Lets discuss some of these MITM attack types.</p><h3>ARP Cache Poisoning</h3><h4><strong>What is</strong> <strong>ARP?</strong></h4><p>ARP stands for <strong>Address Resolution Protocol</strong>. In a local-area network (LAN), it is a protocol that links a dynamic Internet Protocol (IP) address to a fixed physical machine address (MAC address). This process is very important because the IP and MAC addresses lengths differ, so there must be a proper translation is needed so the systems can identify each other. Mostly IPV4 is used nowadays which is 32 bit long but MAC addresses are 48 bit long. So ultimately, ARP is translating IP address(32 bit) to MAC address(48 bits) and vice versa. ARP works between Data Link layer and Network layer because MAC address in mostly considered in the Data Link layer and IP address is referred in the network layer.</p><h4>How Does ARP Work?</h4><p>mapping process begins when a data packet arrives at the gateway to a host machine and the data packets prompts the ARP to select the MAC address which matches the IP address. The host will look into it’s ARP cache for preexisting translation for that particular IP address and if it doesn’t exist then the ARP process will take place.</p><p>Lets say, there are PC1 and PC2 and PC1 wants to send data to PC2 in a LAN network. For that PC1 should know the MAC address of PC2 and it is done by translating PC2’s IP address. Once it has the PC2’s MAC address, PC1 will store it in its ARP cache (to load it quickly when its needed). And then its send the data package.</p><blockquote>ARP only translates 32bit IP addresses to 48 bit MAC addresses so this is only suitable for IPv4. But when the packages are sent with IPv6, the Neighborhood Discovery Protocol will be used. <a href="https://ieeexplore.ieee.org/document/8022867">Click here</a> to study more about NDP (Neighborhood Discovery Protocol)</blockquote><h4>ARP Poisoning</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/848/1*hUBqxbe_9Jc1ZNxlcJtiTw.png" /><figcaption>(source: <a href="https://www.imperva.com/learn/application-security/arp-spoofing/">https://www.imperva.com/learn/application-security/arp-spoofing/</a>)</figcaption></figure><p>This is where the attackers intercept the communication between target user and the router. To do this, attacker must have the access to the specific network. In a data transferring process, there are three things need to be considered such as IP Address (logical address), Subnet mask(range of IPs) and Default gateway(IP address of the router which is endpoint of a specific network). Lets say there are PC1(target) and PC2(attacker) in a network including a router A. Now in this scenario, lets say PC1 wants to search something on the web so it will broadcast the default gateway with its IP address by asking which device has this specific gateway address. Every device will ignore except the Router A. Now this router will acknowledge by sending its MAC address to PC1 so PC1 will store this in its ARP cache. So PC2 knows that PC1 wants to connect with the internet since it broadcast the message. Now PC2 can clear the target’s ARP cache since it already knows the IP address of PC1 from the broadcast message. (There are specific tools to send forged ARP responses such as Arpspoof or Driftnet) So the PC2 will send it’s MAC address after deleting the APR cache of PC1. So now PC1 will think that PC2’s MAC address is Router’s address and it will update the ARP cache. Now all the network traffic will be sent to PC2 and PC2 will send it to router and do the vice versa. So technically PC1 don’t know that PC2 is in the middle of the network traffic and monitoring everything.</p><p>It can be identified by checking the ARP cahe (type apr -a in the cmd and it will show the IPs and the MACs). So if there are two IP address having the same MAC address then it means the system was attacked. Using Two way SSL is also one of the method to prevent this attack. If they two way SSL, attacker can’t decrypt the message even though they get the messages. Next way is using static ARP, so this will prevent devices from listening ARP responses. All we have to do is just defines the static ARP mapping. We also use <strong>packet filtering </strong>solution to identify poisoned ARP by checking whether is there any conflicting source information or not.</p><h3>DNS spoofing</h3><h4>what is DNS</h4><p>It stands for <strong>Domain Name System </strong>and this is like a contact list in your mobile phone which matches peoples name with their phone number. Every website has its unique IP address so when the network population increases, it is impossible for people to memorize all the IP address oh the websites. That is where DNS comes in. This will match the unique ID of a website to a human readable domain name. There are several websites where we can buy domain names, so that we can assign that to our own sites. For example,</p><p>if you want to know the IP address of google, there are several ways to find out and I’ll show you one. All you have to do is open your Command prompt and type ping google.com and you will get something like follows,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/610/1*kJBxnKlPaeqFmQzf6l1-sw.png" /></figure><p>as you can see when I ping the google it response with the IP address(This is a dynamic one and DNS will have large number of IPs for google. The OS and browser will shuffle the list time to time) within the box bracket.</p><h4>How DNS works ?</h4><p>There are four main DNS server involved when loading a website such as,</p><ul><li><strong>DNS recursor</strong> — This is responsible for receive queries from the client through web browsers and making additional requests.</li><li><strong>Root nameserver</strong> — This is responsible for translating human readable domain into IP address. Basically this works as a reference to other specific locations.</li><li><strong>TLD nameserver</strong> — This is the Top Level Domain nameserver and this is the next step in searching the specific IP. This holds the last part of the hostname. (In <a href="http://www.google.com,">www.google.com,</a> the Top Level Domain server is “com”)</li><li><strong>Authoritative nameserver </strong>—This is the last place where the search will happen and if the specific server has access to the requested website then it will return the IP to the hostname back to the initial place(DNS recursor) which made the initial request.</li></ul><p>So lets say the user is requesting for google.com(just an example) in the browser. The request will first go to <strong>recursive resolver (DNS recursor)</strong> which usually operated by the Internet Service Provider. So this will talk to <strong>Root server. </strong>Then the Root server will connect with all other DNS servers in the world which know DNS details about TLD. Most importantly there are so many servers that are supporting the Root server so the DNS will make sure that user sent to a server which is close to him. So every TLD nameservers store both TLD and second level domain. So the TLD nameserver will return the IP address of the domain’s name server. Now domain’s name server will get the query from the recursive resolver and DNS server knows the IP for the entire domain. Now the google.com will be sent to the recursive resolver. So now browser will be able to load the IP address which is given by the recursive resolver. At the end browser can show content of the site by requesting to that website.</p><p>Now lets see how an attack can happen using DNS,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*iXtq5H7G2wWby269ELDJHg.png" /><figcaption>(source: <a href="https://www.imperva.com/learn/application-security/dns-spoofing/">https://www.imperva.com/learn/application-security/dns-spoofing/</a>)</figcaption></figure><p>DNS spoofing also known as DNS cache poisoning. In here an attacker will change the DNS record that helps to redirect online network traffic to a fake website which looks like the original webpage. Lets say the attacker creates a fake Facebook login page and altered the DNS record. And also he created a sample food discount poster as a click bait. So now when the client seeing the poster he might want to get the discount. So when he clicks that it redirect to the fake website which is a fb login page in this scenario. So the client will enter his username and password with a bright smile in face to redeem the discount. Now through the fake site the attacker will be able to get the username and the password and sometimes the attacker again redirect it to the official web page to login again. Usually we don’t mind right? We may think like oh maybe I typed the wrong password and try again and obviously it will open his profile because that is the official page.</p><p>So if you are visiting a website for the first time those details will be saved in your local DNS cache you can view that by typing ipconfig/displaydns in the command prompt.</p><h4>How can we prevent DNS spoofing</h4><ul><li>Using <strong>DNS spoofing detection tools </strong>— this will scan all the incoming data, before sending the responses.</li><li>Using <strong>Domain name system security extensions (DNSSEC) </strong>— It is a set of protocols that act as a extra layer to the DNS and monitor its data exchanges.</li><li>Using <strong>End-to-end encryption (SSL)</strong></li><li>As a user we can flush the DNS cache if you find anything suspicious. To flush the DNS cache, simply go to CMD and type ipconfig/flushdns.</li><li>Its is also better to use a VPN so it provides a private DNS server which uses End-to-end encryption already.</li></ul><p>So this is it and I will talk about the rest of the attack and prevention method in the upcoming articles.</p><h3>References</h3><ul><li><a href="https://www.imperva.com/learn/application-security/man-in-the-middle-attack-mitm/">What is MITM (Man in the Middle) Attack | Imperva</a></li><li><a href="https://www.veracode.com/security/man-middle-attack">Man in the Middle Attack: Tutorial &amp; Examples | Veracode</a></li><li><a href="https://www.fortinet.com/resources/cyberglossary/what-is-arp">What Is Address Resolution Protocol (ARP)? | Fortinet</a></li><li><a href="https://ieeexplore.ieee.org/document/8022867">IPv6 Neighbor Discovery Protocol Specifications, Threats and Countermeasures: A Survey</a></li><li><a href="https://www.imperva.com/learn/application-security/arp-spoofing/">What is ARP Spoofing | ARP Cache Poisoning Attack Explained | Imperva</a></li></ul><p><a href="https://www.cloudflare.com/learning/dns/what-is-dns/">https://www.cloudflare.com/learning/dns/what-is-dns/</a></p><ul><li><a href="https://www.verisign.com/en_IN/website-presence/online/how-dns-works/index.xhtml">How The Domain Name System (DNS) Works - Verisign India</a></li><li><a href="https://www.keycdn.com/support/dns-spoofing">What Is DNS Spoofing? - KeyCDN Support</a></li><li><a href="https://www.imperva.com/learn/application-security/dns-spoofing/">What is DNS Spoofing | Cache Poisoning Attack Example | Imperva</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=51ad724edd6b" width="1" height="1" alt=""><hr><p><a href="https://medium.com/codex/man-in-the-middle-mitm-attack-part-01-arp-poisoning-dns-spoofing-51ad724edd6b">Man in the middle (MITM) attack (Part 01 — ARP poisoning &amp; DNS spoofing)</a> was originally published in <a href="https://medium.com/codex">CodeX</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>