<?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[Stories by Kirusanthan Ravichandran on Medium]]></title>
        <description><![CDATA[Stories by Kirusanthan Ravichandran on Medium]]></description>
        <link>https://medium.com/@kirusanthanr.20?source=rss-87fc2a5ccd62------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*ch9Agj1msGWzbLPhYl67LQ.jpeg</url>
            <title>Stories by Kirusanthan Ravichandran on Medium</title>
            <link>https://medium.com/@kirusanthanr.20?source=rss-87fc2a5ccd62------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 02:52:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kirusanthanr.20/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Is Your Website Wide Open? PHP2Shell Explained (Technical Deep Dive)]]></title>
            <link>https://medium.com/@kirusanthanr.20/is-your-website-wide-open-php2shell-explained-technical-deep-dive-2abac07e65ea?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/2abac07e65ea</guid>
            <category><![CDATA[node]]></category>
            <category><![CDATA[cve]]></category>
            <category><![CDATA[php]]></category>
            <category><![CDATA[php2shell]]></category>
            <category><![CDATA[october]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Thu, 22 Oct 2026 10:26:51 GMT</pubDate>
            <atom:updated>2026-10-22T10:26:51.528Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Two critical vulnerabilities in PHP’s core engine can turn an ordinary HTTP request into remote code execution. Here’s how they work, which versions are affected, and what developers must do immediately.</em></p><p><em>Published: 22 October 2026 | Cybersecurity • PHP • Web Security</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wFUTjVRZvL0G2r0uQ5RDBg.png" /></figure><p>Imagine spending months securing your website.</p><p>You’ve implemented authentication, validated user inputs, configured your firewall, updated your application dependencies, and followed security best practices.</p><p>Yet an attacker might still be able to execute commands on your server without logging in, exploiting your application code, or even reaching the part of PHP that runs your application.</p><p>That is the danger behind <strong>PHP2Shell</strong>.</p><p>On 21 October 2026, the PHP development team released emergency security updates addressing two critical vulnerabilities in the PHP runtime itself:</p><ul><li><strong>CVE-2026–109618 — Remote Code Execution via Out-of-Memory Corruption</strong></li><li><strong>CVE-2026–109619 — Remote Code Execution via Stale Global State</strong></li></ul><p>Both carry a <strong>CVSS v4.0 severity score of 9.2 (Critical)</strong>.</p><p>Successful exploitation can allow unauthenticated remote code execution (RCE) or disclosure of sensitive process memory.</p><p>The problem is not limited to one vulnerable WordPress plugin, a poorly written Laravel application, or an outdated Magento installation.</p><p><strong>The vulnerability exists inside the PHP engine that runs these applications.</strong></p><p>And that changes everything.</p><h3>Why PHP2Shell Is Such a Big Deal</h3><p>PHP remains one of the most widely deployed server-side programming languages.</p><p>According to W3Techs, as of 21 October 2026, PHP was used by approximately 69.3% of websites whose server-side programming language could be identified.</p><p>It powers an enormous ecosystem, including:</p><ul><li>WordPress and WooCommerce</li><li>Magento and other e-commerce platforms</li><li>Drupal and Joomla</li><li>Laravel and Symfony applications</li><li>MediaWiki</li><li>Custom enterprise applications</li><li>Countless shared-hosting and legacy systems</li></ul><p>All of these applications depend on the PHP runtime.</p><p>An application can have excellent security practices and still be exposed if the underlying PHP version is vulnerable.</p><p>Security researchers demonstrated unauthenticated code execution against representative WordPress, Drupal, and Joomla deployments.</p><p>They also demonstrated attacks capable of leaking PHP process memory, potentially exposing passwords, authentication tokens, API keys, and other sensitive information.</p><p>The most important distinction is that <strong>the affected application does not necessarily need its own exploitable bug</strong>.</p><p>To understand why, we need to look inside PHP.</p><h3>What Actually Happens When PHP Processes a Web Request?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hA8uM0o3l2Cv419O1VNfng.png" /></figure><p>Before discussing the vulnerabilities, let’s understand a normal PHP request.</p><p>When someone opens a PHP-powered website, their browser sends an HTTP request to the web server.</p><p>That request passes through several stages.</p><p><strong>1. The client sends an HTTP request.</strong></p><p>The request may contain URL parameters, cookies, form data, or uploaded files.</p><p><strong>2. The web server forwards the request to PHP.</strong></p><p>Depending on the deployment, PHP can execute through Apache mod_php, PHP-FPM, php-cgi, LiteSpeed, FrankenPHP, or another integration.</p><p>These interfaces are collectively known as SAPIs (Server APIs).</p><p><strong>3. PHP initializes the request environment.</strong></p><p>The engine prepares memory, request variables, global state, and internal data structures.</p><p>It may also parse multipart/form-data submitted through HTML forms.</p><p><strong>4. PHP executes application code.</strong></p><p>WordPress, Laravel, Magento, or the custom PHP application processes the request and generates a response.</p><p><strong>5. PHP cleans up request-specific resources.</strong></p><p>Temporary memory and request-owned data structures are released or reset.</p><p><strong>6. A PHP worker may handle another request.</strong></p><p>For performance, some PHP workers remain alive and process multiple requests rather than starting a completely new process each time.</p><p>The important assumption is that request-specific state must not remain accessible after its memory has been freed.</p><p>PHP2Shell exposes situations where this assumption breaks.</p><p>And once freed memory can be referenced again, the consequences can be serious.</p><h3>The Technical Root Cause: Use-After-Free</h3><p>At the heart of PHP2Shell are memory-safety problems involving invalid cleanup and stale memory references.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Hyq-1zyX7gkSgi71YCiXiQ.png" /></figure><p>One of the central concepts is <strong>use-after-free (CWE-416)</strong>.</p><p>Imagine a program allocates a block of memory to store some information.</p><p>Later, the program releases that memory because it believes the information is no longer needed.</p><p>But somewhere else, a pointer still references the old location.</p><p>If the program accesses that pointer again, it may read data that no longer belongs to it or interpret newly allocated data as something else.</p><p>That is a use-after-free condition.</p><p>In the wrong circumstances, attackers can manipulate what occupies the freed memory and influence how the program behaves.</p><p>This may lead to:</p><ul><li>Application or worker crashes</li><li>Disclosure of adjacent or reused memory</li><li>Corruption of internal structures</li><li>Execution of attacker-controlled code</li></ul><p>PHP2Shell involves particularly dangerous variations because the memory-state problems arise during PHP’s request initialization, error handling, and cleanup.</p><p>Some of those operations take place before application code executes.</p><h3>CVE-2026–109618: Remote Code Execution via Out-of-Memory Corruption</h3><p>The first vulnerability concerns how PHP responds to an unexpected out-of-memory (OOM) condition.</p><p>PHP applications normally operate with memory limits.</p><p>When PHP reaches certain memory allocation failures, it must interrupt processing and recover from the error.</p><p>Internally, PHP uses mechanisms including longjmp() for non-local error recovery.</p><p>Instead of returning normally through every function, execution can jump directly to an error-handling context.</p><p>That becomes dangerous if an internal data structure has only been partially initialized.</p><p><strong>How the vulnerability happens</strong></p><p>Consider this simplified sequence:</p><p><strong>Step 1 — Request parsing begins.</strong></p><p>PHP receives a specially structured HTTP request and starts preparing request data.</p><p>Certain attack paths involve multipart/form-data and PHP’s upload-progress or session-handling internals.</p><p><strong>Step 2 — PHP allocates memory.</strong></p><p>While processing the request, the engine creates internal objects and request-specific structures.</p><p><strong>Step 3 — An out-of-memory condition interrupts processing.</strong></p><p>A memory allocation fails while an internal structure is incomplete.</p><p><strong>Step 4 — PHP enters its error recovery path.</strong></p><p>The execution flow may skip normal initialization or cleanup steps.</p><p><strong>Step 5 — Cleanup encounters invalid internal state.</strong></p><p>The engine may interpret partially initialized or otherwise invalid memory as legitimate data.</p><p><strong>Step 6 — Memory corruption occurs.</strong></p><p>Under exploitable conditions, attackers can manipulate the resulting memory behavior.</p><p>Researchers demonstrated that these conditions can lead to remote code execution.</p><p>The especially concerning scenario involves <strong>Apache with mod_php</strong>, where unauthenticated exploitation was demonstrated with default settings before the application script runs.</p><p>Remote code execution was also demonstrated through application-level paths involving PHP-FPM.</p><p>This means application security controls cannot be treated as a complete defense.</p><h3>CVE-2026–109619: Remote Code Execution via Stale Global State</h3><p>The second vulnerability involves persistent PHP state that incorrectly retains references to request-owned memory.</p><p>This is closely related to how long-running PHP workers are reused.</p><p>Normally, when a request finishes, PHP must reset or remove pointers that refer to the request’s temporary memory.</p><p>However, some internal structures can retain stale references after particular fatal-error conditions.</p><p><strong>How the vulnerability happens</strong></p><p><strong>Step 1 — A request modifies internal state.</strong></p><p>During processing, PHP stores references to request-owned data in internal global structures.</p><p><strong>Step 2 — An unexpected error occurs.</strong></p><p>A fatal error interrupts the ordinary execution or cleanup sequence.</p><p><strong>Step 3 — Request memory is released.</strong></p><p>The request ends, and memory belonging to it is freed.</p><p><strong>Step 4 — A stale pointer remains.</strong></p><p>An internal structure continues to reference memory that is no longer valid.</p><p><strong>Step 5 — A later operation uses that pointer.</strong></p><p>For certain attack paths, another request handled by the same worker encounters the stale reference.</p><p><strong>Step 6 — Use-after-free is triggered.</strong></p><p>The engine accesses memory that may already have been reused for another purpose.</p><p>With a suitable memory layout, this can result in memory corruption and remote code execution.</p><p><strong>What makes this technically interesting?</strong></p><p>Researchers identified related problems involving PHP’s fatal-error backtrace handling and OPcache state.</p><p>Fatal-error backtraces can retain references to request-specific information.</p><p>OPcache, meanwhile, maintains compiled PHP structures and runtime metadata for performance. Certain failure paths can leave inconsistent state that affects how those structures are interpreted.</p><p>The OPcache-related attack can involve state shared across workers, so not every variant depends on two requests reaching the same worker.</p><p>These are deep engine-level issues, not conventional input-validation bugs.</p><p><strong>An attacker is targeting the runtime’s memory management, not merely the application running inside it.</strong></p><h3>Why Traditional Website Security May Not Be Enough</h3><p>PHP2Shell is unusual because several familiar security assumptions become unreliable.</p><p><strong>1. Secure application code is not a complete defense</strong></p><p>Developers can sanitize inputs, use prepared statements, enable CSRF protection, and maintain strict authentication systems.</p><p>Those practices remain important.</p><p>But they do not repair memory-safety vulnerabilities inside the PHP runtime.</p><p>An attacker may reach vulnerable PHP internals before normal application protections execute.</p><p><strong>2. The vulnerable design patterns are old</strong></p><p>The affected behavior reaches back to PHP 5.4, released in 2012.</p><p>That means the relevant problems have existed in the PHP ecosystem for approximately 14 years.</p><p>The age of a codebase does not necessarily mean a bug is easy to find.</p><p>Some memory-safety vulnerabilities are exceptionally difficult to reproduce and exploit reliably.</p><p><strong>3. Exploitation can expose information without achieving a shell</strong></p><p>Remote code execution is the most dramatic outcome.</p><p>However, memory disclosure is also serious.</p><p>PHP processes may temporarily contain authentication tokens, API credentials, database secrets, or other sensitive information.</p><p>Researchers demonstrated ways to extract process-memory information independently of full code execution.</p><p><strong>4. The risk extends beyond a single PHP framework</strong></p><p>An exploit may require a particular PHP configuration, SAPI, memory layout, or reachable processing path.</p><p>Not every affected deployment is equally easy to exploit.</p><p>Nevertheless, switching from WordPress to Laravel, or from Magento to another PHP application, does not remove the underlying vulnerability.</p><p>The runtime itself must be fixed.</p><h3>The PHP2Shell Disclosure Timeline</h3><p>The timing of this incident is almost as important as the technical details.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ws9JmQpr1KoubpRcLVM7Yw.png" /></figure><p><strong>17 October 2026 — Early exploitation attempt detected</strong></p><p>Amazon Threat Intelligence later reported that its MadPot honeypot telemetry contained a PHP2Shell exploitation attempt dating to 17 October.</p><p>That was four days before the public release of the patches.</p><p><strong>20 October 2026 — The coordinated disclosure process was disrupted</strong></p><p>The two CVE identifiers began circulating online before the planned announcement.</p><p>According to the PHP Foundation, full technical details were not initially leaked. However, an inadvertently published demonstration video subsequently revealed limited additional information.</p><p>The PHP project accelerated its security release.</p><p><strong>21 October 2026 — Attacks and proof-of-concept activity intensified</strong></p><p>Cloudflare and other security organizations observed attack traffic and efforts to bypass defensive rules.</p><p>Amazon also identified multiple exploitation attempts against its sensors.</p><p><strong>21 October 2026 — Official PHP patches released</strong></p><p>Around 14:00 UTC, the PHP project released the emergency security updates.</p><p>The fixed versions were PHP 8.5.12, 8.4.27, 8.3.36, and 8.2.35.</p><p><strong>22 October 2026 — Active exploitation remains a concern</strong></p><p>Security providers have reported proof-of-concept activity and exploitation attempts in the wild.</p><p>Amazon described the vulnerabilities as being broadly exploited, although its honeypot evidence alone does not establish how many production servers have been successfully compromised.</p><p>For defenders, the important conclusion is simple:</p><p><strong>Do not assume exploitation began only when the vulnerabilities became public.</strong></p><p>Incident investigations should consider activity dating back to at least 17 October 2026.</p><h3>AI-Assisted Security Research Changed the Discovery Process</h3><p>Another important part of this story is the role of artificial intelligence.</p><p>The PHP Foundation explained that early signs of the out-of-memory problem had already been identified during security work in 2024.</p><p>However, transforming that understanding into a concrete, reliably exploitable vulnerability proved difficult.</p><p>In 2026, several research organizations contributed to understanding the full security impact.</p><p>These included Calif, OpenAI, Wiz, and the PHP Foundation’s security teams.</p><p>Calif participated in OpenAI’s Patch the Planet program, while Wiz used AI-assisted research tools during vulnerability analysis and exploit validation.</p><p>AI models helped researchers analyze complicated execution paths, investigate memory behavior, and validate findings.</p><p>This matters because exploiting memory corruption has historically required substantial specialist expertise.</p><p>Modern AI-assisted tools can reduce the time needed to understand complex codebases and investigate challenging vulnerabilities.</p><p>That helps defenders discover serious issues earlier.</p><p>But it also raises an uncomfortable question:</p><p><strong>What happens when attackers use similar tools to understand newly disclosed vulnerabilities and adapt exploits more quickly?</strong></p><p>The PHP2Shell incident suggests that the time available between public disclosure and widespread attack activity can be extremely short.</p><h3>Which PHP Versions Are Vulnerable?</h3><p>The PHP development team released fixes on 21 October 2026.</p><p>The affected branches and patched versions are:</p><p><strong>PHP 8.5</strong></p><ul><li>Vulnerable: PHP 8.5.0 through 8.5.11</li><li>Fixed: PHP 8.5.12</li></ul><p><strong>PHP 8.4</strong></p><ul><li>Vulnerable: Versions earlier than 8.4.27</li><li>Fixed: PHP 8.4.27</li></ul><p><strong>PHP 8.3</strong></p><ul><li>Vulnerable: Versions earlier than 8.3.36</li><li>Fixed: PHP 8.3.36</li></ul><p><strong>PHP 8.2</strong></p><ul><li>Vulnerable: Versions earlier than 8.2.35</li><li>Fixed: PHP 8.2.35</li></ul><p><strong>PHP 8.1 and older</strong></p><ul><li>Affected: Versions dating back to PHP 5.4</li><li>Status: End-of-life; no new official PHP project releases for these branches</li><li>Remediation: Migrate to a supported, patched branch or obtain a verified vendor-backported security update</li></ul><p>The PHP project also published minimal source-level backports for PHP 7.4, 8.0, and 8.1.</p><p>These are not replacements for moving to a supported release.</p><p><strong>How can you check your PHP version?</strong></p><p>On a Linux server, you can start with:</p><pre>php -v</pre><p>This displays the PHP version used by the command-line executable.</p><p>However, be careful.</p><p><strong>The command-line PHP version may not be the same version serving your website.</strong></p><p>Check the actual PHP-FPM pool, Apache module, container image, or hosting runtime used by each application.</p><p>A server may have multiple PHP versions installed simultaneously.</p><h3>How to Protect Your PHP Applications</h3><p>The PHP security team has been clear:</p><p><strong>Updating to a fixed PHP release is the only complete remediation.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jlI0WSKGmp4b5H9ueQFjGw.png" /></figure><p>Configuration changes can reduce exposure, but they do not eliminate every vulnerability path.</p><p><strong>1. Upgrade the PHP runtime immediately</strong></p><p>Update to the appropriate patched version:</p><ul><li>PHP 8.5.12</li><li>PHP 8.4.27</li><li>PHP 8.3.36</li><li>PHP 8.2.35</li></ul><p>For legacy releases, use a verified vendor-supported backport or migrate to a supported branch.</p><p>Make sure the update reaches the environment actually processing production requests.</p><p><strong>2. Rebuild and redeploy containers</strong></p><p>If your application uses Docker or Kubernetes, updating PHP on the host does not automatically update PHP inside an existing container image.</p><p>Update the image or base image, rebuild where necessary, and redeploy the affected workloads.</p><p>Verify that newly started containers are running the patched PHP binaries.</p><p><strong>3. Apply temporary mitigations where patching is delayed</strong></p><p>The PHP security advisory describes several partial mitigations.</p><p>For specific stale-global-state attack paths, disable PHP session upload progress:</p><pre>session.upload_progress.enabled = 0</pre><p>For PHP 8.5, disable fatal-error backtraces:</p><pre>fatal_error_backtraces = 0</pre><p>For the out-of-memory corruption vulnerability, the PHP team also describes setting:</p><pre>memory_limit = -1</pre><p>However, removing the PHP memory limit has operational consequences and does not eliminate underlying allocation failures. It must be assessed carefully alongside operating-system and container resource controls.</p><p>The advisory additionally recommends appropriate POST and upload size limits and other request-processing restrictions.</p><p>Changes should be applied through server or PHP configuration mechanisms that take effect before request parsing.</p><p>Restart the affected PHP workers after changing relevant settings.</p><p><strong>None of these temporary mitigations makes an unpatched PHP installation fully safe.</strong></p><p><strong>4. Review logs for suspicious requests</strong></p><p>Security teams should examine web-server and PHP logs for unusual multipart requests, repeated fatal errors, abnormal POST traffic, unexpected worker crashes, and other suspicious activity.</p><p>Amazon specifically recommends investigating requests involving the PHP session upload-progress mechanism.</p><p>Review historical evidence from at least 17 October 2026, rather than limiting the investigation to activity after patch publication.</p><p><strong>5. Review sensitive credentials and runtime activity</strong></p><p>Inspect affected systems for unexpected process execution, file modifications, persistence mechanisms, and suspicious outbound connections.</p><p>If indicators suggest exploitation or memory exposure, prioritize rotation of potentially exposed:</p><ul><li>Database credentials</li><li>API keys</li><li>Session-signing secrets</li><li>Authentication tokens</li><li>Other sensitive credentials used by the PHP application</li></ul><p>The scope of credential rotation should reflect the incident investigation and potential exposure.</p><p><strong>6. Keep WAF protections enabled</strong></p><p>Cloudflare and other security providers deployed protections for known PHP2Shell attack patterns.</p><p>These controls can reduce exposure while infrastructure is being updated.</p><p>However, a WAF is a defensive layer, not a substitute for the runtime patch.</p><h3>Does Switching from mod_php to PHP-FPM Solve the Problem?</h3><p><strong>Not completely.</strong></p><p>The PHP project identified Apache with mod_php as a particularly high-risk configuration because researchers demonstrated unauthenticated exploitation before application code executed.</p><p>PHP-FPM can offer useful process-management and isolation benefits.</p><p>However, PHP-FPM deployments are also within the affected scope, and researchers demonstrated exploitable paths involving them.</p><p>Changing the SAPI without updating PHP is not a complete remediation.</p><h3>The Larger Engineering Lesson</h3><p>PHP2Shell is more than another pair of CVE identifiers.</p><p>It exposes a deeper reality about software security.</p><p>Modern applications depend on layers of software that developers rarely inspect directly.</p><p>We write controllers, services, APIs, and business logic.</p><p>But underneath those applications are language runtimes, memory allocators, operating systems, libraries, and infrastructure components.</p><p>A weakness in any of those layers can undermine the security of everything built above it.</p><p>PHP2Shell is a reminder that vulnerabilities do not always originate in code written by the application developer.</p><p>Sometimes, the most serious weakness sits in the software responsible for executing that code.</p><p>The incident also highlights how AI-assisted research is changing vulnerability discovery.</p><p>Problems that once required exceptionally long investigations may now become more practical to identify, reproduce, and validate.</p><p>Security maintenance must adapt to that accelerating timeline.</p><h3>Final Checklist for Developers and Infrastructure Teams</h3><p>If you manage PHP-powered applications, take these actions:</p><ol><li><strong>Inventory</strong> every PHP runtime across production, staging, development, CI, and container environments.</li><li><strong>Upgrade</strong> to PHP 8.5.12, 8.4.27, 8.3.36, or 8.2.35, or obtain an appropriate verified vendor-backported fix.</li><li><strong>Restart and verify</strong> all affected workers and services after patching.</li><li><strong>Apply partial mitigations</strong> to environments that cannot yet be updated, without treating them as complete protection.</li><li><strong>Investigate historical activity</strong>, including suspicious events from 17 October onward.</li><li><strong>Assess possible credential exposure</strong> and rotate affected secrets when warranted.</li><li><strong>Continue monitoring</strong> for attempted exploitation and signs of compromise.</li></ol><p><strong>Final Thought</strong></p><p>A website does not become secure simply because its application code is secure.</p><p>It is only as secure as the runtime and infrastructure beneath it.</p><p>PHP2Shell demonstrates how a memory-handling flaw that survived for more than a decade can suddenly become an urgent security problem across a major portion of the web.</p><blockquote><strong><em>If your website runs PHP, verify its runtime version today.</em></strong></blockquote><p>The patch is available.</p><p>The exploitation risk is real.</p><p>And delaying an emergency runtime update is a risk no infrastructure team should take lightly.</p><p><strong>References and Further Reading</strong></p><ol><li><a href="https://www.php.net/archive/2026.php">PHP Project — Official Security Advisory</a></li><li><a href="https://thephp.foundation/blog/2026/10/21/todays-php-security-release-and-how-were-strengthening-php-security/">The PHP Foundation — Today’s PHP Security Release</a></li><li><a href="https://www.wiz.io/blog/php2shell-php-rce">Wiz Research — PHP2Shell Technical Research</a></li><li><a href="https://blog.cloudflare.com/php-vulnerabilities-waf-protection">Cloudflare — PHP2Shell WAF Protections</a></li><li><a href="https://aws.amazon.com/blogs/security/amazon-threat-intelligence-identifies-php2shell-exploitation-prior-to-public-disclosure-in-madpot/">AWS — PHP2Shell Exploitation Before Public Disclosure</a></li></ol><p><em>Technical information and exploitation status are current as of 22 October 2026.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2abac07e65ea" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Jev vs LLM: Understanding AI Decision-Making Through a Simple Support Ticket Example]]></title>
            <link>https://medium.com/@kirusanthanr.20/jev-vs-llm-understanding-ai-decision-making-through-a-simple-support-ticket-example-d66d713322c4?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/d66d713322c4</guid>
            <category><![CDATA[rlcd]]></category>
            <category><![CDATA[typesafe-ai]]></category>
            <category><![CDATA[llm]]></category>
            <category><![CDATA[jevai]]></category>
            <category><![CDATA[jevs]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Thu, 24 Sep 2026 03:41:16 GMT</pubDate>
            <atom:updated>2026-09-24T03:41:16.488Z</atom:updated>
            <content:encoded><![CDATA[<p><em>I was trying to understand Jev from a software engineering perspective, and one simple question helped me connect the dots: “If I already have an LLM, why would I need Jev?”</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vRi5Txr0V_uvqODxf1UDjg.png" /></figure><p>When I first came across <strong>Jev from TypeSafe AI</strong>, I had a very basic question:</p><blockquote><strong><em>Isn’t Jev just another way of prompting an AI model?</em></strong></blockquote><p>For example, suppose a customer-support application receives this ticket:</p><blockquote><strong><em>“I made a payment yesterday, but I haven’t received my refund yet.”</em></strong></blockquote><p>I can give this text to an LLM and ask:</p><blockquote><em>“Which department should I send this ticket to?”</em></blockquote><p>So what exactly changes when I use Jev?</p><p>The difference becomes much clearer when we stop thinking about <strong>generating text</strong> and start thinking about <strong>making decisions inside software</strong>.</p><h3>1. Let’s start with a normal LLM</h3><p>Imagine our application uses an LLM.</p><p>A ticket arrives:</p><pre>I made a payment yesterday,<br>but I haven&#39;t received my refund yet.</pre><p>Our backend could send a prompt like:</p><pre>You are a customer support assistant.</pre><pre>Read the following ticket and determine<br>which department should handle it.</pre><pre>Ticket:<br>&quot;I made a payment yesterday,<br>but I haven&#39;t received my refund yet.&quot;</pre><pre>Which department should handle it?</pre><p>The LLM might answer:</p><blockquote><em>“This appears to be a payment/refund issue, so the ticket should be forwarded to the Billing Department.”</em></blockquote><p>For a human, that’s perfectly understandable.</p><p>But our <strong>software</strong> doesn’t really need that paragraph.</p><p>It needs something like:</p><pre>BILLING</pre><p>Now our backend has to somehow interpret the LLM’s natural-language answer.</p><h3>2. What if we use Jev?</h3><p>Instead of asking:</p><blockquote><em>“Tell me what I should do with this ticket.”</em></blockquote><p>we define the <strong>decision itself</strong>.</p><p>For example:</p><pre>Question:Which department should handle this ticket?</pre><pre>Possible choices:</pre><pre>1. BILLING<br>2. TECHNICAL_SUPPORT<br>3. ACCOUNT_SUPPORT<br>4. SALES</pre><p>Then we give Jev the actual ticket:</p><pre>I made a payment yesterday,<br>but I haven&#39;t received my refund yet.</pre><p>Now the problem isn’t:</p><blockquote><em>“Generate an answer.”</em></blockquote><p>It is:</p><blockquote><strong><em>“Choose one of these predefined options based on the given information.”</em></strong></blockquote><p>The result can be a structured decision such as:</p><pre>BILLING</pre><p>That’s the fundamental difference I was trying to understand.</p><h3>3. So do I need to define the choices beforehand?</h3><p><strong>Yes — when you’re using a Choice decision, your application defines the possible choices.</strong></p><p>Think about it from a software engineering perspective.</p><p>You might already have:</p><pre>enum Department {<br>    BILLING,<br>    TECHNICAL_SUPPORT,<br>    ACCOUNT_SUPPORT,<br>    SALES<br>}</pre><p>Your application knows that these are the valid departments.</p><p>When a ticket arrives, you don’t suddenly create new departments.</p><p>Instead:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*bKUP2MKSJMVXct0QdkjGHA.png" /></figure><p>So the <strong>ticket changes from request to request</strong>, but the <strong>decision definition normally belongs to your application’s design</strong>.</p><h3>4. When does the API call happen?</h3><p>This was another question I had.</p><p>I initially wondered:</p><blockquote><em>“Do I call Jev when I define the choices, or do I call it when the ticket actually arrives?”</em></blockquote><p>The answer is easier to understand if we separate <strong>configuration</strong> from <strong>execution</strong>.</p><p>Your application knows beforehand:</p><pre>Departments:<br>    BILLING<br>    TECHNICAL_SUPPORT<br>    ACCOUNT_SUPPORT<br>    SALES</pre><p>Then, when an actual ticket arrives:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jNSLjPrZsslDO6333xPNdg.png" /></figure><p>So you’re not calling Jev every time just to tell it:</p><blockquote><em>“Hey, these are my departments.”</em></blockquote><p>Instead, the decision structure is part of how you’ve designed the AI interaction, and the <strong>actual ticket is the dynamic input</strong>.</p><h3>5. This is where Jev becomes different from an LLM</h3><p>Consider the two approaches.</p><h3>LLM Vs Jev</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O-AlY-R-old0V2cr-QCJ6A.png" /></figure><p>The difference isn’t simply:</p><blockquote><em>“LLM understands text, Jev understands text.”</em></blockquote><p>Both can work with textual information.</p><p>The important difference is <strong>what you’re asking the model to produce</strong>.</p><p>An LLM is generally optimized for generating language.</p><p>Jev is designed around <strong>making typed decisions</strong>.</p><h3>6. But can an LLM also return JSON?</h3><p>Absolutely.</p><p>And this is where the comparison becomes more interesting.</p><p>You might say:</p><blockquote><em>“Wait. I can tell GPT to return JSON.”</em></blockquote><p>For example:</p><pre>{<br>  &quot;department&quot;: &quot;BILLING&quot;<br>}</pre><p>That’s true.</p><p>So Jev isn’t useful merely because:</p><blockquote><em>“It returns JSON.”</em></blockquote><p>The deeper idea is that the <strong>decision itself is the primary object</strong>.</p><p>With a conventional LLM, you’re essentially asking a language model to produce structured text.</p><p>With Jev, the system is designed around <strong>typed decision primitives</strong> such as Choice, Score, and Noul.</p><p>That’s a more important distinction than simply “text vs JSON.”</p><h3>7. What are Choice, Score and Noul?</h3><p>Now let’s extend our support-ticket example.</p><p>Our application might need three different decisions.</p><h3>Question 1</h3><blockquote><em>Which department should handle this?</em></blockquote><p>That’s a <strong>Choice</strong>.</p><pre>BILLING<br>TECHNICAL_SUPPORT<br>ACCOUNT_SUPPORT<br>SALES</pre><h3>Question 2</h3><blockquote><em>How urgent is this ticket?</em></blockquote><p>That’s a <strong>Score</strong>.</p><p>For example:</p><pre>0 = Low<br>1 = Medium<br>2 = High<br>3 = Critical</pre><p>The model can produce a score representing where the ticket falls on that scale.</p><h3>Question 3</h3><blockquote><em>Does the customer explicitly request a refund?</em></blockquote><p>That’s a <strong>Noul</strong>-type probabilistic proposition.</p><p>Conceptually, the result could be:</p><pre>0.96</pre><p>meaning the proposition is considered highly likely.</p><p>So you can remember them as:</p><pre>Choice → Which one?</pre><pre>Score  → How much / What level?</pre><pre>Noul   → How likely is this proposition to be true?</pre><h3>8. Do all three appear in every Jev response?</h3><p><strong>No.</strong></p><p>This was another important thing I needed to understand.</p><p>Choice, Score, and Noul aren’t three mandatory fields that Jev throws into every response.</p><p>Your application asks for the decisions it actually needs.</p><p>For example, if all you need is:</p><blockquote><em>“Which department?”</em></blockquote><p>you use a <strong>Choice</strong>.</p><p>If you also want:</p><blockquote><em>“How urgent?”</em></blockquote><p>you add a <strong>Score</strong>.</p><p>If you also want:</p><blockquote><em>“Is this definitely a refund request?”</em></blockquote><p>you can use a <strong>Noul</strong>.</p><p>Conceptually:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J5kb_zZKRDQpEELSEtuXdg.png" /></figure><p>You don’t need all three just because you’re using Jev.</p><h3>9. Now let’s turn this into a real software project</h3><p>Imagine this is a semester project:</p><blockquote><strong><em>AI-powered Customer Support Ticket Routing System</em></strong></blockquote><p>A customer submits:</p><pre>&quot;I made a payment yesterday,<br>but I haven&#39;t received my refund yet.&quot;</pre><p>Your Spring Boot backend receives it.</p><h3>Step 1 — Save the ticket</h3><pre>POST /tickets<br>       ↓<br>Database</pre><h3>Step 2 — Send the ticket to Jev</h3><p>Your backend asks:</p><pre>Which department?</pre><pre>BILLING<br>TECHNICAL_SUPPORT<br>ACCOUNT_SUPPORT<br>SALES</pre><h3>Step 3 — Jev makes the decision</h3><pre>BILLING</pre><h3>Step 4 — Your Java application acts on it</h3><pre>if (department == BILLING) {<br>    assignToBillingTeam(ticket);<br>}</pre><p>Now AI isn’t sitting inside your application as a chatbot.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zeedmYpMeHQKGY1IRpXMLQ.png" /></figure><p>It’s part of your <strong>business workflow</strong>.</p><h3>10. And that’s the part I find most interesting</h3><p>A common way of adding AI to a student project is:</p><pre>Website<br>   ↓<br>Chatbot<br>   ↓<br>LLM</pre><p>That’s useful, but it can sometimes feel like:</p><blockquote><em>“We added AI because the project needs AI.”</em></blockquote><p>A decision-oriented system is different.</p><p>You can put AI directly into the application’s workflow:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l2NI4Hnuvzvk6ZGruegaXg.png" /></figure><p>The AI becomes part of the <strong>system’s decision-making process</strong>.</p><h3>11. The simplest way to understand the difference</h3><p>If I give an LLM this:</p><blockquote><em>“I haven’t received my payment refund. What should I do?”</em></blockquote><p>I’m essentially asking:</p><blockquote><strong><em>“Generate an answer for me.”</em></strong></blockquote><p>If I give Jev the same ticket and define:</p><blockquote><em>“Choose the department responsible for this ticket from these four departments.”</em></blockquote><p>I’m asking:</p><blockquote><strong><em>“Make this specific decision for my software.”</em></strong></blockquote><p>That’s the mental model that helped me understand Jev.</p><h3>LLM Vs Jev</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MTCcpD1HpqGYhTU2FiadTw.png" /></figure><p>And that leads to a much more useful way of thinking about AI in software engineering:</p><blockquote><strong><em>An LLM can generate the words your application says. A decision model like Jev can provide structured judgments that your application can act on.</em></strong></blockquote><p>That doesn’t mean one universally replaces the other. In a real application, you could even use both:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OU94l3mDx7qYrvjy0HOziQ.png" /></figure><p>And <strong>that</strong>, to me, is the interesting engineering use case: not simply adding an AI chatbot to a project, but making AI a structured component of the application’s actual decision-making workflow.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d66d713322c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why Can’t I Delete That File? Linux Permissions & Docker UIDs Explained for Beginners]]></title>
            <link>https://medium.com/@kirusanthanr.20/why-cant-i-delete-that-file-linux-permissions-docker-uids-explained-for-beginners-b88c55003705?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/b88c55003705</guid>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[ubuntu]]></category>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Thu, 18 Jun 2026 11:31:14 GMT</pubDate>
            <atom:updated>2026-06-18T11:31:14.316Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A practical guide to understanding </em><em>Permission denied — and how Docker makes it worse</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iW24N8PLy0HVIhWh9RPYmw.png" /></figure><p>If you’ve ever run a Docker container, mounted a volume, and then found yourself unable to edit or delete the files it created — you’ve hit one of Linux’s oldest design decisions colliding with one of Docker’s default behaviours. This article explains why it happens, from first principles, and gives you three real solutions.</p><h3>Part 1 — Every File Has an Owner and a Group</h3><p>In Ubuntu (and every Linux system), every single file and directory carries two identifiers:</p><ul><li><strong>UID</strong> — User ID. An integer that says <em>which user owns this file</em>.</li><li><strong>GID</strong> — Group ID. An integer that says <em>which group owns this file</em>.</li></ul><p>The kernel never stores usernames. It stores numbers. The human-readable name (alice, docker, www-data) is just a lookup table in /etc/passwd and /etc/group. Run id in your terminal to see your own:</p><pre>$ id<br>uid=1000(alice)  gid=1000(alice)  groups=1000(alice),4(adm),27(sudo),998(docker)</pre><p>Every process you run — your shell, vim, python, curl — inherits your UID. That&#39;s how the kernel knows whether you&#39;re allowed to open a file.</p><h3>Part 2 — The Nine Permission Bits</h3><p>Every file has <strong>nine permission bits</strong>, split into three groups of three: owner, group, others.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QN-BGVtlzrTeDmJL1q_Ygg.png" /><figcaption>Permission bits</figcaption></figure><p>Reading the string from left to right:</p><p>Position Meaning - (first char) file type: - = regular file, d = directory, l = symlink rwx (chars 2–4) owner permissions r-x (chars 5–7) group permissions r-x (chars 8–10) others permissions</p><p>chmod 755 sets owner=7 (rwx), group=5 (r-x), others=5 (r-x). The octal number is just each triplet added up: r=4, w=2, x=1.</p><pre># Set a file to rwxr-xr-x<br>chmod 755 myscript.sh</pre><pre># Explicitly: owner read+write+execute, group read-only, others read-only<br>chmod u=rwx,g=r,o=r myfile.txt</pre><pre># See the result<br>ls -la myfile.txt<br># -rwxr--r-- 1 alice alice 1234 Jun 18 myfile.txt</pre><h3>Part 3 — How the Kernel Checks Access (First Match Wins)</h3><p>When a process tries to open a file, the kernel runs one check — and stops at the <strong>first match</strong>:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LZI_Tcfmmmc82w2r4gZrGw.png" /><figcaption>Kernel Access Check</figcaption></figure><p>The critical rule: <strong>it does not combine bits</strong>. If you are the file’s owner, only the owner bits matter — even if the group bits would give more access.</p><pre># Example: file owned by alice, group=docker, permissions 060 (----rw----)<br># alice tries to read → she IS the owner → owner bits apply → owner has 0 bits → DENIED<br># even though the group bits grant rw!</pre><p>Root (UID 0) is the one exception: it bypasses read and write checks entirely.</p><h3>Part 4 — Directories Are Special</h3><p>Directory permission bits look the same but mean completely different things:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2gKKDDTU19ZcNohP1_b-og.png" /><figcaption>Directory Permissions</figcaption></figure><p>The confusing combinations:</p><p>Bits ls works? Open a file? Create/delete? r-- ✓ (see names) ✗ ✗ --x ✗ ✓ (if you know the name) ✗ rw- ✓ ✗ ✗ (no x) rwx ✓ ✓ ✓ r-x ✓ ✓ ✗</p><pre># Common safe defaults:<br>chmod 755 mydir/        # owner full, group+others read+enter — good for web roots<br>chmod 700 private/      # owner only — nobody else can even list contents<br>chmod 770 shared/       # owner + group full access — good for team directories</pre><p><strong>Never reach for </strong><strong>chmod 777 as a &quot;Docker fix&quot;</strong> — that gives every user on the machine write access to your directory.</p><h3>Part 5 — Why Docker Causes Permission Problems</h3><p>This is where it gets interesting.</p><p>A Docker container is a <strong>process namespace</strong> — an isolated process tree sharing the same kernel as your host. When you bind-mount a directory (-v ./data:/data), you are not copying files into the container. You are exposing the <strong>exact same filesystem objects</strong> — same inodes, same kernel VFS entries — to the container process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SOPQA9miboxZr1A9D-lPyw.png" /><figcaption>Docker UID</figcaption></figure><p>Here’s the chain of events:</p><ol><li><strong>Docker images run as root by default.</strong> Most official images (nginx, postgres, node) start their entrypoint as UID 0. It’s convenient inside the container.</li><li><strong>The container writes a file to the bind-mount.</strong> The kernel records the file’s owner as UID 0 — just a number in the inode.</li><li><strong>You look at the file from your host.</strong> ls -la ./data/ shows root root. That UID 0 is the <em>same</em> UID 0 on your host.</li><li><strong>Your shell is UID 1000.</strong> You’re not the owner, not in group 0. The other bits (usually r--) don&#39;t include write. Permission denied.</li></ol><pre># Reproduce the problem yourself:<br>mkdir test-data<br>docker run --rm -v $(pwd)/test-data:/output alpine \<br>  sh -c &quot;echo hello &gt; /output/file.txt&quot;</pre><pre>ls -la test-data/<br># -rw-r--r-- 1 root root 6 Jun 18 file.txt  ← owned by root!</pre><pre>rm test-data/file.txt<br># rm: cannot remove &#39;file.txt&#39;: Permission denied</pre><h3>Why doesn’t Docker translate UIDs automatically?</h3><p>Because the container shares the host’s <strong>user namespace</strong> by default. The kernel has one global table of UIDs — there is no “inside the container UID 0” vs “outside UID 0”. They are the same integer.</p><p>The Linux feature that <em>does</em> introduce a translation layer is called <strong>user namespaces</strong>. With a user namespace, the kernel maintains a mapping: “UID 0 inside this namespace = UID 100000 outside it.” Files the container writes are owned by 100000 on the host — still not <em>your</em> UID, but at least it’s not root. Docker calls this feature userns-remap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YJhYvcbdQ2d4kJtuc78-bQ.png" /><figcaption>userns-remap</figcaption></figure><h3>Part 6 — Three Solutions</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UyaKuNmvmHNgB_dBR0oRSA.png" /><figcaption>Solutions</figcaption></figure><h3>Solution 1 — Run the container as your UID (best)</h3><p>Pass your UID and GID at runtime. Files the container creates will be owned by your user.</p><pre># One-liner<br>docker run --rm \<br>  --user $(id -u):$(id -g) \<br>  -v $(pwd)/data:/data \<br>  myimage</pre><pre># docker-compose.yml<br>services:<br>  app:<br>    image: myimage<br>    user: &quot;${UID}:${GID}&quot;<br>    volumes:<br>      - ./data:/data</pre><p><strong>Gotcha:</strong> some images bake files owned by root inside the container (log dirs, pid files). Running as UID 1000 may break those. Test first, or use an image that explicitly supports non-root users.</p><h3>Solution 2 — Enable userns-remap daemon-wide (good, transparent)</h3><p>One config change, restart Docker, and every container gets UID remapping automatically. No per-container flags needed.</p><pre># /etc/docker/daemon.json<br>{<br>  &quot;userns-remap&quot;: &quot;default&quot;<br>}</pre><pre># Restart the Docker daemon<br>sudo systemctl restart docker</pre><p>Docker creates a dockremap user and maps container UID 0 to a high unprivileged host UID (e.g. 100000). Check the mapping:</p><pre>cat /etc/subuid<br># dockremap:100000:65536</pre><p><strong>Note:</strong> existing containers may need to be recreated. Image layers are stored in a separate namespace-specific directory.</p><h3>Solution 3 — Post-hoc chown (quick fix only)</h3><p>After the container writes files, reclaim ownership:</p><pre>sudo chown -R $(id -u):$(id -g) ./docker-onprem</pre><pre># Or with explicit values if you know them<br>sudo chown -R 1000:1000 ./data/</pre><p>This doesn’t prevent the problem — it just cleans up after. Fine for one-off local dev scripts. Breaks in CI pipelines or when a container writes files continuously.</p><h3>Quick Reference Cheatsheet</h3><pre># --- Inspect permissions ---<br>ls -la                          # list with permissions and owner<br>stat filename                   # full inode info including UID/GID<br>id                              # your UID, GID, and all groups</pre><pre># --- Change permissions ---<br>chmod 755 file                  # rwxr-xr-x (octal)<br>chmod u+x file                  # add execute for owner only<br>chmod go-w file                 # remove write from group and others<br>chmod -R 755 mydir/             # recursive</pre><pre># --- Change ownership ---<br>chown alice file                # change owner<br>chown alice:docker file         # change owner and group<br>sudo chown -R $(id -u):$(id -g) ./dir   # reclaim from root</pre><pre># --- Find files owned by root in current tree ---<br>find . -user root               # files owned by root<br>find . -not -user $(id -u)      # files NOT owned by you</pre><pre># --- Docker: run as your user ---<br>docker run --user $(id -u):$(id -g) myimage<br>docker run --user 1000:1000 myimage</pre><pre># --- Check UID inside a running container ---<br>docker exec mycontainer id</pre><pre># --- userns-remap ---<br># Add to /etc/docker/daemon.json: { &quot;userns-remap&quot;: &quot;default&quot; }<br>sudo systemctl restart docker<br>cat /etc/subuid                 # verify mapping</pre><h3>Mental Model to Keep</h3><blockquote><strong><em>UIDs are just integers. The kernel knows nothing about containers. A bind-mount is a raw filesystem reference — there is no translation layer. UID 0 inside a container IS UID 0 on the host.</em></strong></blockquote><p>Once that clicks, the solution becomes obvious: make the container process run as a UID that matches who you want to own the output files.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b88c55003705" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Your First Maven Release]]></title>
            <link>https://medium.com/@kirusanthanr.20/your-first-maven-release-d49c44429b1b?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/d49c44429b1b</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[releases]]></category>
            <category><![CDATA[maven-plugin]]></category>
            <category><![CDATA[maven-release-plugin]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Wed, 17 Jun 2026 03:55:50 GMT</pubDate>
            <atom:updated>2026-06-17T03:55:50.287Z</atom:updated>
            <content:encoded><![CDATA[<p><em>You’ve just been handed the task: “Do the release.” Here’s everything you need to know — no experience required.</em></p><h3>The Problem It Solves</h3><p>Picture this: you have a Spring Boot microservices project with three services — user-service, order-service, and payment-service. It&#39;s Friday afternoon and your tech lead says: &quot;We need to release version 1.2.0 by end of day.&quot;</p><p>Without the Maven Release Plugin, you’d have to:</p><ol><li>Manually edit every pom.xml to remove -SNAPSHOT</li><li>Run a full build and pray all tests pass</li><li>Manually create a Git tag</li><li>Push the tag</li><li>Edit every pom.xml again to bump to the next development version</li><li>Push again</li><li>Build and deploy to your artifact repository</li><li>Repeat any step you got wrong</li></ol><p>With the Maven Release Plugin, you run <strong>two commands</strong> and it handles all of that for you.</p><h3>The Version Lifecycle</h3><p>Before anything else, understand the three states a Maven version goes through:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*aBrFYKsrHwMKhzd8mFnV5g.png" /><figcaption>version lifecycle</figcaption></figure><ul><li><strong>SNAPSHOT</strong> means “work in progress.” Maven knows this version may change at any time.</li><li><strong>Release version</strong> is final and immutable. Once 1.2.0 is released, it can never be re-released.</li><li><strong>Next SNAPSHOT</strong> is the version your team works on after the release. The plugin bumps this automatically.</li></ul><h3>How a Multi-Module Project Is Structured</h3><p>In a microservices setup, you have one <strong>parent POM</strong> at the root and each service has its own child module. This is crucial for the release plugin — it runs on the parent and handles all modules together.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*_eOQRsbV3oGJOD0rtQ5iQQ.png" /><figcaption>multi module project</figcaption></figure><p>The golden rule: <strong>every child module must inherit its version from the parent.</strong> No child should declare its own &lt;version&gt; tag. This is what allows the release plugin to update all of them in one shot.</p><h3>Prerequisites Checklist</h3><p>Do not skip this section. The release plugin is strict. If any of these conditions aren’t met, it will fail early — which is actually a feature, not a bug.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*oXyAuH-zRYvRACllnqWOcA.png" /><figcaption>Prerequistic checklist</figcaption></figure><p>Go through every item before running your first release:</p><ul><li><strong>Run </strong><strong>git status</strong> — make sure it says &quot;nothing to commit, working tree clean&quot;</li><li><strong>Search your POMs</strong> for any dependency version ending in -SNAPSHOT (other than your own modules) — if found, those must be released first</li><li><strong>Confirm your </strong><strong>&lt;scm&gt; block</strong> exists in the parent POM with the correct Git URL</li><li><strong>Confirm push access</strong> — run git push manually once to make sure it works</li></ul><h3>POM Configuration</h3><p>All configuration lives in the <strong>parent POM</strong>. You touch child module POMs only to remove any stray &lt;version&gt; tags.</p><h3>Parent POM</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*mGbZSedoVVCE7SRhcdLHXw.png" /><figcaption>Parent pom</figcaption></figure><p>Four things to get right in the parent POM:</p><ol><li>&lt;modules&gt; — lists every child service</li><li>&lt;scm&gt; — your Git remote URL (the plugin needs this to tag and push)</li><li>&lt;distributionManagement&gt; — where built JARs should be deployed (Nexus, Artifactory, GitHub Packages)</li><li>&lt;plugin&gt; block for maven-release-plugin with autoVersionSubmodules=true</li></ol><p>The autoVersionSubmodules=true setting is especially important for multi-module projects — without it, Maven would ask you to confirm the version for every single module interactively.</p><h3>Child Module POM</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*oLd0aQUoHsSFzMvMpqlgiQ.png" /><figcaption>Child module pom</figcaption></figure><p>Child module POMs should be lean. They declare their parent, their own artifactId, and their own dependencies — nothing more. No &lt;version&gt; tag.</p><h3>How It Works: The Two Phases</h3><p>The release plugin works in two separate phases. You can (and should) run them separately.</p><h3>Phase 1: release:prepare</h3><p>This phase validates your project, stamps the release version, and tags Git. No artifacts are deployed yet.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*gu7iESnrQjVMRXdjYfqy9A.png" /><figcaption>Prepare flow</figcaption></figure><p>After release:prepare completes successfully:</p><ul><li>A Git commit exists with version 1.2.0</li><li>A Git tag v1.2.0 is pushed to remote</li><li>Another Git commit exists with version 1.3.0-SNAPSHOT</li><li>A file called release.properties sits in your project root (this is the handoff to phase 2)</li></ul><h3>Phase 2: release:perform</h3><p>This phase takes the tagged code and deploys it to your artifact repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*zP57DCj0J4tnIsAY5zI_lA.png" /><figcaption>perform flow</figcaption></figure><p>After release:perform completes:</p><ul><li>Your JARs are in Nexus/Artifactory under version 1.2.0</li><li>A temporary target/checkout/ directory was created and used (safe to delete)</li></ul><h3>Commands</h3><p>Here are every command you’ll ever need, in the order you’ll use them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*zy6ja41fmw2vdKx5oSa70A.png" /><figcaption>commands</figcaption></figure><p><strong>The most important habit: always run the dry-run first.</strong></p><pre>mvn release:prepare -DdryRun=true</pre><p>This simulates the entire prepare phase without making a single Git commit or file change. It’s free to run and will catch most problems before they happen.</p><p>Once you’re satisfied the dry run is clean:</p><pre>mvn release:clean<br>mvn release:prepare<br>mvn release:perform</pre><p>That’s it. Those three commands do a full release of all your modules.</p><h3>What Gets Produced</h3><p>After a successful release, here’s exactly what exists in the world:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*rG3YATTa1B0mF1W9UE931g.png" /><figcaption>outputs</figcaption></figure><p><strong>In your Git repository:</strong></p><ul><li>A permanent tag (e.g. v1.2.0) pointing to the exact commit that was released</li><li>Two commits on your main branch — one for the release version, one bumping to the next SNAPSHOT</li></ul><p><strong>In Nexus/Artifactory:</strong></p><ul><li>One JAR per module: user-service-1.2.0.jar, order-service-1.2.0.jar, etc.</li><li>One POM per module (so other teams can declare your service as a dependency)</li></ul><p><strong>Temporary files on disk</strong> (appear during the process, safe to delete after):</p><ul><li>release.properties — the bridge between prepare and perform</li><li>pom.xml.releaseBackup — a backup used if rollback is needed</li><li>target/checkout/ — temp directory where perform builds from the tag</li></ul><h3>Common Errors and How to Fix Them</h3><p>The plugin’s error messages are precise. Here’s what they mean and how to fix them:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*_-7SVAAtMIdJs64qLzmwDw.png" /><figcaption>Common Errors</figcaption></figure><p><strong>The single most common mistake for beginners</strong> is having a dirty Git working tree — even one unsaved file will fail the release. Always commit or stash everything before you start.</p><p><strong>The second most common mistake</strong> is forgetting to remove the &lt;version&gt; tag from a child module POM. The plugin will not update it, which causes version mismatches after the release.</p><h3>The Mental Model: What’s Actually Happening</h3><p>Think of the release plugin as an <strong>automated quality gate with a paper trail</strong>:</p><ol><li>It refuses to release anything that isn’t clean (no uncommitted changes, no SNAPSHOT deps)</li><li>It makes the release reproducible — the Git tag means anyone can check out that exact code forever</li><li>It’s atomic in prepare — if any step fails, you can roll back cleanly</li><li>It separates “deciding the release version” (prepare) from “actually publishing” (perform) — useful in CI/CD where you might want human approval between the two</li></ol><h3>Quick Reference Card</h3><p>Command What It Does mvn release:prepare -DdryRun=true Simulate — no real changes mvn release:clean Delete temp files from a previous run mvn release:prepare Validate, tag, bump version mvn release:perform Build + deploy from the tag mvn release:rollback Undo a failed prepare Term Plain English SNAPSHOT &quot;Work in progress&quot; version suffix SCM The &lt;scm&gt; block that tells Maven your Git URL autoVersionSubmodules Apply the same version to all child modules automatically distributionManagement Where to upload your built JARs release.properties Temporary file that links prepare → perform tagNameFormat Controls the Git tag name, e.g. v1.2.0</p><h3>Summary</h3><p>The Maven Release Plugin is one of those tools that feels complex until you understand its purpose: it’s automating a checklist of steps that are easy to forget or get wrong manually. Once you’ve done it once, the flow becomes second nature:</p><ol><li>Make sure everything is committed and clean</li><li>Dry run: mvn release:prepare -DdryRun=true</li><li>Clean: mvn release:clean</li><li>Prepare: mvn release:prepare</li><li>Perform: mvn release:perform</li></ol><p>Good luck with your first release. The first time is the hardest — after that, it’s just two commands.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d49c44429b1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker for Beginners: From Zero to Running Your First Container]]></title>
            <link>https://medium.com/@kirusanthanr.20/docker-for-beginners-from-zero-to-running-your-first-container-abf7b0856ebf?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/abf7b0856ebf</guid>
            <category><![CDATA[docker-beginner]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-compose]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[basic-docker-command]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 10:51:26 GMT</pubDate>
            <atom:updated>2026-06-09T10:54:48.197Z</atom:updated>
            <content:encoded><![CDATA[<p><em>If you just got added to a project that uses Docker and have no idea what’s going on — this is for you.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WTsyqPfZdGq81CsoWoKNMw.png" /><figcaption>Cover Image</figcaption></figure><h3>Why Docker Exists</h3><p>Before Docker, deploying an app meant fighting the classic problem: “It works on my machine.” The app runs fine on your laptop, but breaks on the server because the server has a different Java version, different OS libraries, different environment variables.</p><p>Docker solves this by packaging your app <em>and everything it needs to run</em> into a single portable unit. That unit runs identically everywhere — your laptop, a teammate’s machine, a cloud server.</p><h3>The Mental Model (Start Here)</h3><p>Before touching any files, you need to understand three terms. Everything else builds on these.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*vwYtZLP7-gkJ2qbYrNTQhQ.png" /><figcaption>Mental Model</figcaption></figure><p><strong>Dockerfile</strong> — A plain text file. It’s the <em>recipe</em>. It tells Docker: “start with this OS, copy these files, run these install commands, and when someone runs this, execute this command.”</p><p><strong>Image</strong> — The result of building a Dockerfile. Think of it like a USB drive with a fully set-up system on it. It’s portable, read-only, and can be shared.</p><p><strong>Container</strong> — What happens when you <em>run</em> an image. Like plugging in that USB drive and booting from it. It’s a live, running, isolated process.</p><p>The sequence is always:</p><p><strong>write a Dockerfile → build it into an image → run the image as a container</strong>.</p><h3>The Dockerfile</h3><p>When you see a Dockerfile in a project, this is what it&#39;s doing — giving Docker step-by-step instructions to build the app&#39;s image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*b6kBjxBDxLcxkyLrZRXXjQ.png" /><figcaption>Dockerfile</figcaption></figure><p>Here’s what each instruction means:</p><p>* FROM :-Picks the base image — your starting OS + runtime (e.g. Java 21 on Alpine Linux)</p><p>* WORKDIR :-Sets the working directory inside the container for all following commands</p><p>* COPY :-Copies files from your machine into the imageRUNRuns a shell command <em>during build</em> — installing packages, compiling, etc.</p><p>* EXPOSE :-Documents which port the app uses (informational only)</p><p>* ENV :-Sets environment variables inside the container</p><p>* ENTRYPOINT :-The command Docker runs when the container starts</p><p><strong>One important thing:</strong> EXPOSE does not actually open any port. It&#39;s just documentation. The real port mapping happens when you run the container (see the commands section).</p><h3>The docker-compose.yml File</h3><p>Most real projects don’t run one container — they run several. Your Spring Boot app needs a database. Maybe also a Redis cache. Running and connecting each one manually would be painful.</p><p>docker-compose.yml defines all your containers together, how they&#39;re built, and how they talk to each other. One file to rule them all.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*_b_r--xB10BtK1-SF9tW9Q.png" /><figcaption>Docker Compose File</figcaption></figure><p><strong>Key fields to understand:</strong></p><p>services: — Everything under this is one container. The key name (like app or db) becomes the container&#39;s name on the network.</p><p>build: . — Build this container&#39;s image from the Dockerfile in the current folder. Use this for <em>your</em> code.</p><p>image: postgres:16 — Use a pre-built image from Docker Hub. Use this for databases, caches, and third-party services — no Dockerfile needed.</p><p>ports: &quot;8080:8080&quot; — Map a port from your machine to a port inside the container. Format is HOST:CONTAINER. The left number is what you type in your browser.</p><p>environment: — Environment variables injected into the container. This is how you pass database URLs, passwords, and feature flags.</p><p>depends_on: — Ensures listed services start before this one.</p><p>volumes: — Mounts a folder or named volume so data survives container restarts. Without this, your database is wiped every time the container stops.</p><h3>How Containers Talk to Each Other</h3><p>This trips up almost every beginner. Here’s the rule:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*8O7te-6sqYWsqEnp8UwHAw.png" /><figcaption>Docker Network</figcaption></figure><p>When Compose starts your services, it automatically creates a private network and puts all containers on it. Every service can reach every other service <strong>using the service name as the hostname</strong>.</p><p>So if your database service is called db in docker-compose.yml, your Spring Boot app connects to it at:</p><pre>jdbc:postgresql://db:5432/mydb</pre><p>Not localhost. Not an IP address. Just db — the service name.</p><p><strong>From your own machine</strong> (your browser, Postman, etc.), you use localhost plus the <em>left</em> number from the ports: mapping:</p><pre>http://localhost:8080</pre><p>If a service has no ports: entry, it&#39;s intentionally not reachable from outside Docker. That&#39;s actually the secure default for production databases.</p><h3>The Commands You’ll Use Every Day</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*4jxIPzxuxvvvpPmKGljZ0Q.png" /><figcaption>Docker Commands</figcaption></figure><h3>Starting and stopping (Docker Compose)</h3><p>bash</p><pre># Start all services in the background<br>docker compose up -d</pre><pre># Force rebuild images then start (do this after changing code)<br>docker compose up --build -d</pre><pre># Stop and remove all containers<br>docker compose down</pre><pre># Stop and remove containers + delete all volumes (wipes DB data)<br>docker compose down -v</pre><h3>Logs and debugging</h3><p>bash</p><pre># Stream live logs from all services<br>docker compose logs -f</pre><pre># Logs from one service only<br>docker compose logs app</pre><pre># Check which services are running<br>docker compose ps</pre><pre># Open a shell inside a running container<br>docker exec -it &lt;container-id&gt; sh</pre><p>Get the container ID from docker compose ps or docker ps.</p><h3>Building images manually</h3><pre># Build an image from the Dockerfile in the current folder<br>docker build -t myapp .</pre><pre># Run a container from that image<br>docker run -p 8080:8080 myapp</pre><h3>Your First Day on a Docker Project — What to Do</h3><ol><li><strong>Open </strong><strong>docker-compose.yml</strong> in the project root. Read through the services: section. Identify each service name, what image it uses, and what ports it exposes.</li><li><strong>Run </strong><strong>docker compose up -d</strong> from the project root. This builds and starts everything.</li><li><strong>Run </strong><strong>docker compose logs -f</strong> to see what&#39;s happening. Look for error messages or successful startup logs.</li><li><strong>Access the app</strong> at localhost:&lt;HOST_PORT&gt; — the left number from the ports: mapping on your app service.</li><li><strong>After making code changes</strong>, run docker compose up --build -d to rebuild your image.</li><li><strong>When something is broken</strong>, run docker compose logs &lt;service-name&gt; to see that service&#39;s output.</li></ol><h3>Common Beginner Mistakes</h3><p><strong>Editing code and not seeing changes</strong> — Docker doesn’t hot-reload by default. After changing code, you need to rebuild: docker compose up --build.</p><p><strong>Using </strong><strong>localhost inside a container</strong> — If your app inside Docker tries to connect to localhost:5432 for the database, it&#39;s looking for Postgres <em>inside that same container</em>. It&#39;s not there. Use the service name: db:5432.</p><p><strong>Losing database data</strong> — If you run docker compose down -v, volumes are deleted. Your database is empty. Only use -v when you actually want to reset the database.</p><p><strong>Port conflicts</strong> — If port 8080 is already in use on your machine, Docker will fail to start. Change the left number in ports: to something else, like &quot;8081:8080&quot;, and access the app at localhost:8081.</p><h3>Summary</h3><p>Docker solves the “works on my machine” problem by packaging apps into portable containers.</p><ul><li><strong>Dockerfile</strong> — the build recipe for your app’s image</li><li><strong>Image</strong> — the built, portable snapshot</li><li><strong>Container</strong> — the running instance of an image</li><li><strong>docker-compose.yml</strong> — defines and connects multiple containers together</li><li>Inside Docker: services find each other by <strong>service name</strong></li><li>Outside Docker: you reach services via <strong>localhost:HOST_PORT</strong></li></ul><p>The fastest way to get productive: open the docker-compose.yml in your project, understand what each service is, then run docker compose up -d and docker compose logs -f.</p><p><em>Found this helpful? Follow for more beginner-friendly engineering content.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=abf7b0856ebf" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Blocking Your Main Thread: How to Send Emails the Right Way in Java]]></title>
            <link>https://medium.com/@kirusanthanr.20/stop-blocking-your-main-thread-how-to-send-emails-the-right-way-in-java-404e75ea105f?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/404e75ea105f</guid>
            <category><![CDATA[spring-boot]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[kotlin]]></category>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[reactive-programming]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Tue, 09 Jun 2026 09:10:32 GMT</pubDate>
            <atom:updated>2026-06-09T09:10:32.221Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A performance guide for Java developers — from campus-style code to industry-standard async patterns</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EIhN26zL2_1aHHQ-vyb3MQ.png" /></figure><p>Sending a confirmation email feels harmless. It’s just one method call. How bad could it be?</p><p>Bad enough to take down your API under load.</p><p>This article walks through exactly why blocking your main thread on SMTP is dangerous, what most beginners do wrong, and the right way to fix it in plain Java — from a simple ExecutorService to Spring Boot&#39;s @Async. At the end, I&#39;ll show how this maps to a production Kotlin/Reactor implementation.</p><h3>The Problem: What Actually Happens When You Send an Email</h3><p>When a user hits your API, your server assigns a <strong>thread</strong> to handle that request — a worker that runs your code from the moment the request arrives until the HTTP response is sent back. That thread needs to stay available.</p><p>Sending an email isn’t a local operation. It requires talking to a remote SMTP server — and that involves several network round trips:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sfMMyhsJXjVr4DKRJnzhmQ.png" /><figcaption>Thread Concept</figcaption></figure><ul><li><strong>DNS lookup</strong> to find the mail server (~50ms)</li><li><strong>TCP handshake</strong> to open the connection (~30–100ms)</li><li><strong>SMTP protocol exchange</strong> (EHLO, AUTH, RCPT, DATA — multiple round trips)</li><li><strong>Server acknowledgement</strong> (depends entirely on the remote server)</li></ul><p>During all of this, your thread is doing <em>nothing</em>. It’s blocked — sitting idle, waiting for the network. In Java terms, this is <strong>blocking I/O</strong>.</p><p>This is fine for one request. But under load, it compounds fast.</p><h3>The Bad Way: What Most Of us Wrote in campus</h3><p>Here’s the code almost every junior developer writes on their first project:</p><pre>// ❌ WRONG — everything runs on the request thread<br><br>public class TemplateController {<br><br>    public Template submitTemplate(String enterpriseId, String templateId) {<br><br>        // Step 1: Save to database (fast ~50ms) ✓<br>        Template template = templateService.save(enterpriseId, templateId);<br><br>        // Step 2: Send email notification<br>        // ⚠ This runs ON THE SAME THREAD as the HTTP request.<br>        // The thread is now blocked — waiting on a remote SMTP server.<br>        // The user&#39;s HTTP response is DELAYED until the email is sent.<br>        emailService.sendApprovalEmail(enterpriseId, template);<br><br>        // This line only runs AFTER the email is fully sent (~800ms later)<br>        return template;<br>    }<br>}</pre><p>This looks completely reasonable. You save the template, you send the email, you return. But there are three serious problems:</p><p><strong>1. The user waits for the email to finish.</strong> Your HTTP response only goes out <em>after</em> emailService.sendApprovalEmail() returns. That means the user experiences 800ms–2s of latency for something they never needed to wait for. They submitted a form — the email is not their concern.</p><p><strong>2. Thread pool exhaustion under load.</strong> Your application server has a finite thread pool (Tomcat’s default is 200 threads). If 200 users submit simultaneously, all 200 threads are frozen waiting on SMTP. Request 201 times out. Your entire API appears to hang — not because the CPU is busy, but because every worker is idle-waiting on a mail server.</p><p><strong>3. Cascade failure.</strong> If the mail server is down, slow, or misconfigured, every request thread hangs until the socket timeout — often 30 seconds. A broken notification service can take down your whole API. These concerns should be completely isolated.</p><h3>The Fix: Offload to a Background Thread</h3><p>The solution is straightforward: <strong>hand the email task to a separate thread pool and return immediately.</strong> The main thread is freed. The email happens in parallel.</p><h3>Option 1 — Plain Java with ExecutorService</h3><pre>public class TemplateController {<br><br>    // A pool of 10 background threads for async tasks<br>    private final ExecutorService backgroundPool =<br>        Executors.newFixedThreadPool(10);<br><br>    public Template submitTemplate(String enterpriseId, String templateId) {<br><br>        // Step 1: Save to database (fast) — still on main thread<br>        Template template = templateService.save(enterpriseId, templateId);<br><br>        final Template savedTemplate = template; // must be effectively final for lambda<br><br>        // Step 2: Hand email off to a background thread<br>        backgroundPool.submit(() -&gt; {<br>            try {<br>                // This runs on a DIFFERENT thread<br>                emailService.sendApprovalEmail(enterpriseId, savedTemplate);<br>            } catch (Exception e) {<br>                // Always catch errors in fire-and-forget tasks!<br>                logger.error(&quot;Email failed for enterprise {}&quot;, enterpriseId, e);<br>            }<br>        });<br><br>        // ✅ Returns IMMEDIATELY — no waiting for the email<br>        // The background thread handles the email independently<br>        return template;<br>    }<br>}</pre><p>ExecutorService is Java&#39;s built-in thread pool abstraction from java.util.concurrent. You call .submit() with a lambda, and Java dispatches it to an available background thread. The main thread carries on without waiting.</p><p>A few things worth noting:</p><ul><li><strong>Always wrap background tasks in try/catch.</strong> Exceptions thrown inside a submitted lambda don’t propagate anywhere by default — they silently disappear. Without that catch block, a failed email would go completely unnoticed.</li><li><strong>Use </strong><strong>newFixedThreadPool(N)</strong> when you want predictable resource usage. Pick N based on your expected concurrency and the latency of your email provider.</li><li>For more control, consider ThreadPoolExecutor directly — it lets you configure queue size, rejection policy, and thread naming.</li></ul><h3>Option 2 — Spring Boot with @Async</h3><p>If you’re building a Spring Boot application, you don’t need to manage an ExecutorService manually. Spring&#39;s @Async annotation handles the thread dispatch for you:</p><p>Three steps:</p><ol><li>Add @EnableAsync to your main application class — just once.</li></ol><pre>@SpringBootApplication<br>@EnableAsync  // ← add this to your main class<br>public class MyApp {<br>    public static void main(String[] args) {<br>        SpringApplication.run(MyApp.class, args);<br>    }<br>}</pre><p>2. Annotate your email method with @Async — Spring intercepts the call and runs it on a background TaskExecutor.</p><pre>@Service<br>public class EmailService {<br><br>    @Async  // ← Spring automatically runs this on a background thread<br>    public CompletableFuture&lt;Void&gt; sendApprovalEmail(String enterpriseId, Template t) {<br>        smtpClient.send(buildEmail(t));  // runs off the main thread<br>        return CompletableFuture.completedFuture(null);<br>    }<br>}</pre><p>3. The calling code stays unchanged. It looks synchronous but behaves asynchronously.</p><pre>public Template submitTemplate(String enterpriseId, String templateId) {<br>    Template template = templateService.save(enterpriseId, templateId);<br><br>    emailService.sendApprovalEmail(enterpriseId, template);<br>    // ↑ Returns immediately. Spring handled the background thread for you.<br><br>    return template;<br>}</pre><h3>The Timeline Difference</h3><p>Here’s what the two approaches look like in practice with 5 concurrent requests:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kt6IRtbC0al4CMk56iq25g.png" /><figcaption>Timeline Difference</figcaption></figure><p>In the blocking case, every request thread is frozen until SMTP completes — the user waits ~850ms. In the non-blocking case, the main threads are freed after the DB write (~65ms) and the email happens independently in the background. <strong>That’s a 13× improvement in response time</strong> with zero change to the business logic.</p><h3>⚙️ What This Looks Like in Production (Kotlin + Project Reactor)</h3><p>In reactive systems — like Spring WebFlux — the same concept applies, but expressed through Project Reactor’s Mono API:</p><pre>// Production Kotlin — same idea, reactive style<br>fun submitSmsTemplateForApproval(...) =<br>    smsTemplateApprovalService.submitForApproval(...)<br>        .doOnNext { template -&gt;<br><br>            // Side-effect: build the email Mono but don&#39;t run it yet<br>            val notifyMono = when (template.status.name) {<br>                &quot;APPROVED&quot; -&gt; emailService.notifyTemplateApproved(...)<br>                else        -&gt; emailService.notifyTemplateApprovalRequested(...)<br>            }<br><br>            notifyMono<br>                .subscribeOn(Schedulers.boundedElastic())  // ← like backgroundPool.submit()<br>                .subscribe(<br>                    { },                        // on success: nothing extra needed<br>                    { e -&gt; log.error(..., e) }  // on error: log it (like our try/catch)<br>                )<br>        }</pre><p>.subscribeOn(Schedulers.boundedElastic()) is the reactive equivalent of submitting to a background thread pool. boundedElastic is Reactor&#39;s scheduler specifically designed for blocking I/O — it creates threads on demand but caps the total to prevent unbounded growth.</p><p>The separate .subscribe() call detaches the email Mono from the main pipeline. The caller never waits for it. The error handler in the subscribe() call plays the same role as the try/catch in the ExecutorService example — if email fails, it logs and moves on without affecting the API response.</p><h3>Key Takeaways</h3><ul><li><strong>SMTP is blocking I/O.</strong> Every millisecond waiting for a mail server is a millisecond your thread is frozen and unavailable.</li><li><strong>Never run blocking I/O on the request thread.</strong> This applies to email, SMS, file I/O, and any slow third-party HTTP call.</li><li><strong>Use </strong><strong>ExecutorService</strong> for plain Java. Use @Async for Spring Boot. Use Schedulers.boundedElastic() for reactive/WebFlux.</li><li><strong>Always handle errors in background tasks.</strong> Uncaught exceptions in background threads disappear silently.</li><li><strong>Isolate notification failures from business operations.</strong> A broken email service should never fail a template submission.</li></ul><p>The principle is simple: do the fast, business-critical work on the main thread. Hand everything slow, non-critical, or I/O-bound to a background pool. Return fast. Your users and your ops team will thank you.</p><p><em>Found this useful? Share it with a junior dev who’s about to ship their first email-on-main-thread bug. 🙂</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=404e75ea105f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Enabling TLS on MariaDB Running in Docker Compose — A Beginner’s Guide]]></title>
            <link>https://medium.com/@kirusanthanr.20/enabling-tls-on-mariadb-running-in-docker-compose-a-beginners-guide-e90c5c534102?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/e90c5c534102</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[mariadb]]></category>
            <category><![CDATA[tls]]></category>
            <category><![CDATA[ssl]]></category>
            <category><![CDATA[docker-compose]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Wed, 27 May 2026 09:33:00 GMT</pubDate>
            <atom:updated>2026-05-27T09:33:00.161Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Encrypt your database connections from scratch, with zero prior TLS experience required.</em></p><p>If you’ve ever set up a MariaDB container and connected your app to it, all that traffic — your passwords, your queries, your data — was travelling as plain text. Anyone who could intercept that traffic on the same network could read every byte of it.</p><p>TLS fixes that. It encrypts the pipe between your app and your database so the data is unreadable in transit. This guide will walk you through enabling it from scratch, but more importantly, it will explain <em>why</em> every step exists — because once you understand the concepts, the commands stop feeling like magic incantations.</p><h3>The Mental Model: What TLS Actually Does</h3><p>Before touching a single command, let’s build the right mental picture.</p><p>Without TLS, your app and MariaDB talk like two people shouting across a room. Anyone nearby can hear everything — usernames, passwords, query results, all of it.</p><p>With TLS, they speak in a code that only they can understand. Before any real data flows, they go through a <strong>handshake</strong> where the server proves its identity and they agree on an encryption method. After that, everything is encrypted.</p><p>There are three core concepts you need to understand.</p><h3>Concept 1: The Certificate Authority (CA)</h3><p>A CA is like a passport office. It doesn’t travel with you or verify your identity at every checkpoint. But because it <em>issued</em> your passport and stamped it, anyone who trusts that office will trust you — without ever having met you before.</p><p>In TLS, the CA’s job is to <strong>sign certificates</strong>. When a client connects to MariaDB, it checks: <em>“Was this server’s certificate signed by a CA I trust?”</em> If yes, it proceeds with encryption.</p><p>In everyday HTTPS (websites), companies like Let’s Encrypt or DigiCert are the CAs. Your browser comes pre-loaded with ~150 CAs it trusts. When you visit https://google.com, Google presents a certificate signed by one of those CAs and your browser trusts it automatically.</p><p>For a private MariaDB instance inside Docker, we don’t need a public CA. We create our own using OpenSSL. It’s just a key pair and a certificate that says: <em>“I am the CA for this project.”</em></p><h3>Concept 2: The Three Files MariaDB Needs</h3><p>TLS requires three files on the server side:</p><p><strong>ca-cert.pem — the CA certificate</strong> This is a <em>public document</em>. It contains no secrets. You share it freely with every client that needs to connect to MariaDB. The client uses it to verify: <em>&quot;Was the server&#39;s certificate signed by this CA?&quot;</em> Think of it as the notary&#39;s official stamp — you can show it to anyone.</p><p><strong>server-cert.pem — the server certificate</strong> This is MariaDB&#39;s identity card, signed by the CA. It proves to connecting clients: <em>&quot;I am the genuine MariaDB server for this project.&quot;</em> Also public — MariaDB sends this to clients automatically during the handshake.</p><p><strong>server-key.pem — the server private key</strong> This is the secret that proves MariaDB actually owns the certificate above. It never leaves the server. If someone steals it, they can impersonate your database. Treat it like a password — chmod 600, never commit it to git, never share it.</p><blockquote><strong><em>Rule of thumb:</em></strong><em> anything ending in </em><em>-key.pem is secret. Anything ending in </em><em>-cert.pem is public.</em></blockquote><h3>Concept 3: Docker’s Role (It’s Simpler Than You Think)</h3><p>Docker itself does nothing special for TLS. It’s just a file-mounting mechanism here. Your job is:</p><ol><li>Generate the cert files on your <strong>host machine</strong></li><li><strong>Mount</strong> them into the container at a known path</li><li>Tell MariaDB where to find them via a config file</li></ol><p>That’s the entire Docker side of this. TLS is purely a MariaDB + OpenSSL concern.</p><h3>One-Way TLS vs Mutual TLS</h3><p>Before the steps, one more distinction worth understanding.</p><p><strong>One-way TLS (what we’re doing):</strong> Only the server has certificates. The client just holds ca-cert.pem to verify the server&#39;s identity. The client still authenticates using its normal MariaDB <strong>username and password</strong>. This is right for most applications.</p><p><strong>Mutual TLS (mTLS):</strong> Both the server <em>and</em> the client present certificates. No username/password needed — the certificate itself is the identity. This is used in high-security, zero-trust environments where you want to ensure only specific pre-approved clients can connect, even if credentials are stolen.</p><p>For this guide, we’ll implement one-way TLS. It’s the standard choice for the vast majority of use cases.</p><h3>Step 1: Generate the Certificates</h3><p>Create a certs/ folder in your project root and generate the files with OpenSSL.</p><pre>mkdir -p certs &amp;&amp; cd certs</pre><p><strong>Generate the CA key and certificate:</strong></p><pre>openssl genrsa 2048 &gt; ca-key.pem</pre><pre>openssl req -new -x509 -nodes -days 3650 \<br>  -key ca-key.pem \<br>  -out ca-cert.pem \<br>  -subj &quot;/CN=MariaDB-CA&quot;</pre><p><strong>Generate the server key and certificate (signed by the CA):</strong></p><pre>openssl req -newkey rsa:2048 -nodes \<br>  -keyout server-key.pem \<br>  -out server-req.pem \<br>  -subj &quot;/CN=mariadb-server&quot;</pre><pre>openssl x509 -req -days 3650 \<br>  -set_serial 01 \<br>  -in server-req.pem \<br>  -out server-cert.pem \<br>  -CA ca-cert.pem \<br>  -CAkey ca-key.pem</pre><p><strong>Fix file permissions:</strong></p><pre>chmod 600 server-key.pem ca-key.pem<br>chmod 644 server-cert.pem ca-cert.pem</pre><blockquote><em>⚠️ The </em><em>-subj &quot;/CN=mariadb-server&quot; CN should match the hostname your client uses to connect. For production, consider using a Subject Alternative Name (SAN) certificate.</em></blockquote><p>You should now have four files: ca-key.pem, ca-cert.pem, server-key.pem, server-cert.pem.</p><h3>Step 2: Create the MariaDB Config File</h3><p>Create a conf/ folder and add a config file that tells MariaDB where the certs live:</p><pre># conf/mariadb.cnf</pre><pre>[mysqld]<br>ssl_ca   = /etc/mysql/certs/ca-cert.pem<br>ssl_cert = /etc/mysql/certs/server-cert.pem<br>ssl_key  = /etc/mysql/certs/server-key.pem</pre><pre># Optional: force TLS for ALL connections (enable only after verifying TLS works)<br># require_secure_transport = ON</pre><p>The paths above are <em>inside the container</em> — you’ll mount them there in the next step.</p><blockquote><em>⚠️ Don’t uncomment </em><em>require_secure_transport until after you&#39;ve verified TLS is working. Otherwise you&#39;ll lock yourself out of your own database.</em></blockquote><h3>Step 3: Update docker-compose.yml</h3><p>Mount the certs and config into the container as read-only volumes:</p><pre>services:<br>  mariadb:<br>    image: mariadb:11<br>    restart: unless-stopped<br>    environment:<br>      MARIADB_ROOT_PASSWORD: your_secure_password<br>      MARIADB_DATABASE: mydb<br>      MARIADB_USER: myuser<br>      MARIADB_PASSWORD: mypassword<br>    ports:<br>      - &quot;3306:3306&quot;<br>    volumes:<br>      # Mount cert files (read-only)<br>      - ./certs/ca-cert.pem:/etc/mysql/certs/ca-cert.pem:ro<br>      - ./certs/server-cert.pem:/etc/mysql/certs/server-cert.pem:ro<br>      - ./certs/server-key.pem:/etc/mysql/certs/server-key.pem:ro<br>      # Mount custom config<br>      - ./conf/mariadb.cnf:/etc/mysql/conf.d/tls.cnf:ro<br>      # Persist data<br>      - mariadb_data:/var/lib/mysql</pre><pre>volumes:<br>  mariadb_data:</pre><p>The :ro flag mounts files as read-only inside the container — good security practice for certs.</p><p>Your project structure should look like this:</p><pre>your-project/<br>├── docker-compose.yml<br>├── certs/<br>│   ├── ca-cert.pem<br>│   ├── ca-key.pem         ← keep this secret!<br>│   ├── server-cert.pem<br>│   └── server-key.pem<br>└── conf/<br>    └── mariadb.cnf</pre><h3>Step 4: Start and Verify</h3><p>Bring up the container:</p><pre>docker compose up -d</pre><p>Check the logs for any errors:</p><pre>docker compose logs mariadb</pre><p>Verify TLS is active inside the container:</p><pre>docker compose exec mariadb \<br>  mariadb -u root -p -e &quot;SHOW VARIABLES LIKE &#39;%ssl%&#39;;&quot;</pre><p>You should see have_ssl = YES and have_openssl = YES in the output.</p><p>Connect from outside with TLS verification:</p><pre>mariadb -h 127.0.0.1 -u root -p \<br>  --ssl-ca=./certs/ca-cert.pem \<br>  --ssl-verify-server-cert \<br>  -e &quot;STATUS;&quot;</pre><p>Look for SSL: Cipher in use is ... in the STATUS output. That confirms the connection is encrypted end-to-end.</p><h3>Bonus: Require TLS Per User</h3><p>Instead of forcing TLS globally, you can require it only for specific users:</p><pre>-- Require TLS for an existing user<br>ALTER USER &#39;myuser&#39;@&#39;%&#39; REQUIRE SSL;<br>FLUSH PRIVILEGES;</pre><pre>-- Or create a new user that requires TLS from the start<br>CREATE USER &#39;secureuser&#39;@&#39;%&#39;<br>  IDENTIFIED BY &#39;strongpassword&#39;<br>  REQUIRE SSL;<br>GRANT ALL PRIVILEGES ON mydb.* TO &#39;secureuser&#39;@&#39;%&#39;;<br>FLUSH PRIVILEGES;</pre><p>Verify the setting took effect:</p><pre>SELECT user, host, ssl_type<br>FROM mysql.user<br>WHERE user = &#39;myuser&#39;;</pre><h3>Common Gotcha: File Ownership</h3><p>If MariaDB fails to start with a “Can’t open file” error, it’s likely a permissions issue. The MariaDB container runs as UID 999 (the mysql user). Fix it with:</p><pre>chown 999:999 certs/server-key.pem certs/server-cert.pem</pre><h3>Final Checklist</h3><ul><li>[ ] CA cert + server cert generated in certs/</li><li>[ ] server-key.pem permissions set to 600</li><li>[ ] conf/mariadb.cnf points to the cert paths inside the container</li><li>[ ] docker-compose.yml mounts certs + config as read-only volumes</li><li>[ ] SHOW VARIABLES LIKE &#39;%ssl%&#39; shows have_ssl = YES</li><li>[ ] Client connection STATUS shows cipher in use</li><li>[ ] certs/*.pem added to .gitignore</li><li>[ ] require_secure_transport or per-user REQUIRE SSL configured (optional)</li></ul><h3>Summary</h3><p>The key insight is that TLS in this setup has nothing to do with Docker specifically. Docker is just the transport for getting cert files into the container. The real work is:</p><ul><li><strong>OpenSSL</strong> creates the CA and signs the server certificate</li><li><strong>MariaDB</strong> reads those certs at startup and enables TLS on port 3306</li><li><strong>Your app</strong> connects with --ssl-ca pointing to ca-cert.pem, verifies the server&#39;s identity, and communicates over an encrypted channel</li></ul><p>Once this is in place, all data between your application and MariaDB — queries, results, credentials — is encrypted in transit. For any production database, this is the baseline, not a bonus.</p><p><em>Found this useful? Follow for more practical guides on databases, Docker, and backend infrastructure.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e90c5c534102" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Middleman: A Beginner’s Guide to Apache HTTPD and ProxyPass]]></title>
            <link>https://medium.com/@kirusanthanr.20/the-middleman-a-beginners-guide-to-apache-httpd-and-proxypass-40f5687feae0?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/40f5687feae0</guid>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[apache]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tech-for-beginners]]></category>
            <category><![CDATA[devops]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Mon, 15 Dec 2025 03:14:06 GMT</pubDate>
            <atom:updated>2025-12-15T03:18:00.962Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dJzkMbg_BvBIRpWuaRVSfg.jpeg" /></figure><p>If you are stepping into web development or server management, you will hear “Apache” and “ProxyPass” constantly. They are the backbone of how many modern applications talk to the internet.</p><p>Here is a breakdown of what they are, why we use them, and a perfect analogy to make the concepts click.</p><h3>The Librarian: Decoding Apache HTTPD</h3><p><strong>The Technical Definition</strong></p><blockquote><strong><em>Apache HTTPD</em></strong><em> (often just called “Apache”) is web server software. Its primary job is to accept requests from a web browser (like Chrome or Firefox) and send back the correct files (HTML, images, CSS).</em></blockquote><p><strong>The Analogy: Imagine a Library</strong></p><ul><li><strong>You (The Client/Browser):</strong> You walk up to the front desk and ask for a specific book.</li><li><strong>Apache (The Librarian):</strong> The librarian listens to your request, walks to the shelf, grabs the book, and hands it to you.</li></ul><p>If Apache is serving static files (like a simple HTML page), it acts exactly like this librarian. You ask for a page; it hands you the page.</p><h3>The Waiter: Introducing ProxyPass</h3><p>Modern web applications are rarely just static files on a shelf. They are often complex programs running in the background (like Python, Node.js, or Java applications). These applications run on their own “ports” (like localhost:3000).</p><p>Apache cannot simply “grab” these off a shelf. It needs to ask the application to generate the page. This is where <strong>ProxyPass</strong> comes in.</p><p><strong>The Technical Definition</strong></p><blockquote><strong><em>ProxyPass</em></strong><em> is a directive (a specific instruction) inside Apache. It tells Apache: “Hey, when someone asks for this specific URL, don’t look on your own shelves. Instead, go ask that application running over there on port 3000, get the answer, and bring it back to the user.”</em></blockquote><p>This setup makes Apache a <strong>Reverse Proxy</strong>.</p><p>The Analogy: The Restaurant</p><p>Let’s shift the analogy from a Library to a Restaurant.</p><ul><li><strong>You:</strong> The Customer at a table.</li><li><strong>Apache:</strong> The Waiter.</li><li><strong>The Backend App (Node/Python):</strong> The Chef in the kitchen.</li></ul><p>You (the customer) cannot walk into the kitchen and scream your order at the Chef. That is chaotic and insecure. Instead, you tell Apache (The Waiter): <em>“I want a steak.”</em></p><p>ProxyPass is the waiter’s training. It tells the waiter: <em>“When a customer asks for steak, walk into the kitchen to Station 4, ask Chef Mike to cook it, wait for him to hand it to you, and then walk it back to the customer.”</em></p><p>To you, the steak came from the waiter. You don’t know or care about Chef Mike or Station 4. You just know you ordered from the waiter and got food.</p><h3>What it looks like in code</h3><p>Here is what that “Waiter’s Training” looks like inside your Apache configuration file (httpd.conf):</p><p>Apache</p><pre>&lt;VirtualHost *:80&gt;<br>    ServerName localhost<br>    <br>    # The &quot;Waiter&quot; Instruction<br>    # When user visits /api, go to the app on port 3000<br>    ProxyPass &quot;/api&quot; &quot;http://localhost:3000&quot;<br>    ProxyPassReverse &quot;/api&quot; &quot;http://localhost:3000&quot;<br>&lt;/VirtualHost&gt;</pre><h3>Why You Need a Middleman: Solving CORS and Port Chaos</h3><p>You might wonder, “Why do I need a middleman? Why can’t I just talk to the Chef (Backend App) directly?”</p><p>In a development environment, using Apache with ProxyPass solves three major headaches:</p><h3>1. The “CORS” Nightmare</h3><p>Web browsers have a strict security rule: A webpage on Port 80 cannot talk to an API on Port 3000 unless you have special permission. This triggers a browser security mechanism called <strong>Cross-Origin Resource Sharing (CORS)</strong>.</p><ul><li><strong>With ProxyPass:</strong> Apache makes everything look like it is coming from the same place. The browser sees the webpage coming from localhost and the API data coming from localhost/api. It assumes they are from the same &quot;origin&quot; and doesn&#39;t block the request.</li></ul><h3>2. Clean URLs (No more Port Numbers)</h3><ul><li><strong>Without ProxyPass:</strong> You have to remember that your frontend is on http://localhost:8080, your API is on http://localhost:3000, and your database admin tool is on <a href="http://localhost:5432.">http://localhost:5432.</a></li><li><strong>With ProxyPass:</strong> You configure Apache so you can just go to:</li><li>http://localhost/ (Frontend)</li><li>http://localhost/api (Backend)</li><li>http://localhost/admin (Database tool)</li></ul><h3>3. Security &amp; Simulation</h3><p>In the real world (Production), you never expose your backend app directly to the internet. Using Apache in “Dev” helps you simulate the real setup. It teaches you how headers are passed and how traffic flows before you deploy to a live server.</p><h3>The “Exposed Kitchen” Scenario: What Happens Without ProxyPass?</h3><p>If you remove Apache and ProxyPass from the equation, here is what happens:</p><ul><li><strong>The Risk:</strong> Backend apps (like Flask or Express) are usually not designed to be front-facing security guards. They are good at cooking (processing data), not bouncing unruly customers (handling DDoS attacks or SSL encryption).</li><li><strong>Broken Links &amp; Hardcoding:</strong> Your frontend code has to be hardcoded to look for localhost:3000. If you move the backend to a different server or port later, your whole app breaks. With ProxyPass, the frontend just asks for /api, and Apache worries about where /api actually lives.</li><li><strong>The SSL/HTTPS Headache:</strong> Setting up secure HTTPS on a Node.js or Python app can be annoying. Apache handles HTTPS easily. Without it, you might be forcing your backend team to manage security certificates, which distracts them from writing code.</li></ul><h3>Key Takeaways</h3><ul><li><strong>Apache HTTPD:</strong> The building manager who greets guests.</li><li><strong>ProxyPass:</strong> The instruction that tells the manager, “If they ask for X, go get it from the specialist in Room B.”</li><li><strong>The Benefit:</strong> It keeps your architecture clean, secure, and easy to use, hiding the messy “kitchen” logic from the customer.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=40f5687feae0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Stop Fearing Linux! How to Install ANY App (The Easy Way)]]></title>
            <link>https://medium.com/@kirusanthanr.20/stop-fearing-linux-how-to-install-any-app-the-easy-way-e29b4f33ebb8?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/e29b4f33ebb8</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[installation]]></category>
            <category><![CDATA[apps]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[ubuntu]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Fri, 24 Oct 2025 09:50:28 GMT</pubDate>
            <atom:updated>2025-10-24T09:50:28.076Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S8xepIHxsqYiO6R0E0nYyQ.png" /></figure><p>You just switched to Linux. You’re excited! You open Firefox to get your favorite apps: VS Code, Spotify, or Steam.</p><p>You find the download page and… you stop.</p><p>What is a .deb? What is a snap? What&#39;s flatpak? Or .tar.gz? Why are there 5 different ways to install one app?</p><p>If you’ve felt this confusion, you are not alone. It’s the most common hurdle for new users. But in the next two minutes, we are going to make it simple.</p><p>This is your final guide to mastering Linux software installation.</p><h3>1. The BIG Secret: Your “App Store”</h3><p>First, forget the Windows habit of hunting for .exe files.</p><p>Linux has a built-in, secure “App Store” called a <strong>Package Manager</strong>. On Ubuntu (and distributions based on it, like Mint), this is called apt.</p><p>Think of it as a giant, safe warehouse of software. apt knows where every official app is, how to install it, and—most importantly—all the <strong>dependencies</strong> (other little bits of code) that app needs to run.</p><p>This is your <strong>FIRST, BEST, and SAFEST</strong> option. Always try this first!</p><p>Bash</p><pre># First, always refresh your &#39;app list&#39;<br>sudo apt update<br># Now, install an app (e.g., GIMP photo editor)<br>sudo apt install gimp</pre><p>That’s it! No websites, no “.exe” files. Just one command.</p><h3>2. Know Your System (Before You Download!)</h3><p>But what if your app isn’t in the main apt warehouse? (Like Google Chrome).</p><p>You’ll have to download a file from the app’s website. But before you click anything, you <strong>MUST</strong> know two things about your computer.</p><ul><li>What’s my Version? (e.g., Ubuntu 24.04)</li><li>What’s my Architecture? (Is it 64-bit? 32-bit? ARM?)</li></ul><p>Open your terminal and type these two commands:</p><pre># 1. Check your Ubuntu version<br>lsb_release -a<br># 2. Check your system architecture<br>uname -m</pre><p>You’ll see an output like this:</p><p>Description: Ubuntu 24.04 LTS</p><p>Architecture: x86_64</p><p><strong>CRITICAL TIP:</strong> x86_64 is the standard 64-bit architecture for almost all modern desktop and laptop PCs (both Intel and AMD). On download websites, this is often called amd64.</p><p><strong>x86_64 = </strong><strong>amd64 = 64-bit.</strong> They mean the same thing! This one fact will save you so much confusion.</p><p>Now you’re ready to download.</p><h3>3. The 5 Main Ways to Install (From Easiest to Hardest)</h3><p>Here are the 5 types of files you’ll see, explained from simplest to most advanced.</p><h3>Method 1: The .deb File (The “Ubuntu Installer”)</h3><p>This is the most common one you’ll find for Ubuntu. A .deb file is the Linux equivalent of a .msi installer on Windows. It&#39;s a package built specifically for Debian-based systems like Ubuntu.</p><p><strong>How to install:</strong></p><p>You could double-click it, but the best way is with the terminal. Why? Because you can use apt to install it, and apt will automatically find and install all its dependencies for you.</p><pre># 1. Navigate to your Downloads folder<br>cd ~/Downloads<br># 2. Tell apt to install the local file (the &#39;./&#39; just means &#39;in this folder&#39;)<br>sudo apt install ./google-chrome-stable_current_amd64.deb</pre><p>This is the modern, recommended way. It’s so much easier than the old dpkg -i method, which would often fail and force you to manually fix dependencies.</p><h3>Method 2: The Universal App (Snap &amp; Flatpak) 📦</h3><p>This is the “new” way and it’s brilliant.</p><p>What if one package could run on <em>any</em> Linux system, whether it’s Ubuntu, Fedora, or anything else? That’s what Snaps and Flatpaks do.</p><p>They are “sandboxed” packages, meaning they come bundled with all their dependencies inside. They are isolated from your system (which is great for security) and “just work.”</p><p><strong>Snap (Made by Ubuntu):</strong></p><p>Snaps are built into Ubuntu. This is often the easiest way.</p><pre># Example: Install VS Code<br>sudo snap install code --classic</pre><p><strong>Flatpak (Community-driven):</strong></p><p>You may need to enable Flatpak first, but it’s just as powerful.</p><pre># 1. Install Flatpak<br>sudo apt install flatpak<br># 2. Add the main &quot;Flathub&quot; app store<br>flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo<br># 3. Install your app<br>flatpak install flathub com.visualstudio.code</pre><p>The takeaway: If you see a Snap or Flatpak option, it’s a fantastic, simple choice.</p><h3>Method 3: The Portable App (.AppImage)</h3><p>This one is magic. It’s not an “installation” at all.</p><p>An AppImage is the entire app in one single file. It&#39;s like a portable .exe on Windows. You don&#39;t install it; you just run it.</p><ul><li>Download the file (e.g., MyApp.AppImage)</li><li>Make it executable (give it permission to run)</li><li>Run it</li></ul><pre># 1. Give it permission to run<br>chmod +x MyApp-x86_64.AppImage<br># 2. Run it!<br>./MyApp-x86_64.AppImage</pre><h3>Method 4: The “Other Team” (.rpm)</h3><p>You will see this one. A .rpm file is a package for a different family of Linux, like Fedora, Red Hat, or CentOS.</p><p>It will <strong>NOT</strong> work on Ubuntu. Just remember:</p><ul><li>Ubuntu / Debian / Mint = .deb</li><li>Fedora / Red Hat = .rpm</li></ul><p>If you’re on Ubuntu, ignore the .rpm download.</p><h3>Method 5: The Expert Mode (.tar.gz)</h3><p>This is the “final boss.”</p><p>A .tar.gz (or .tar.xz) file is just a compressed folder, like a .zip file. It often contains the raw source code. This isn&#39;t an &quot;installer&quot;—it&#39;s a &quot;do-it-yourself&quot; kit. You have to build the app yourself.</p><pre># 1. Unzip the file<br>tar -xvzf package-name.tar.gz<br>cd package-name<br># 2. READ THE README! (It has the real instructions)<br># 3. The classic (but not guaranteed) 3-step-dance:<br>./configure<br>make<br>sudo make install</pre><p><strong>Warning for beginners:</strong> Avoid this if you can! It’s hard to update, hard to uninstall, and your main apt package manager won&#39;t even know it&#39;s there. Only use this if you have no other choice.</p><h3>4. The “Secret Level”: PPAs (Personal Package Archives)</h3><p>What if an app is new, or you want a version that’s newer than the one in the official apt store?</p><p>You use a <strong>PPA (Personal Package Archive)</strong>.</p><p>A PPA is like telling apt: &quot;Hey, I trust this other developer&#39;s warehouse, too. Please check it for software and updates.&quot;</p><p>This gives you the best of both worlds: you get the newest software, but it’s installed and updated cleanly through apt.</p><pre># 1. Add the new &quot;warehouse&quot; (PPA for OBS Studio, for example)<br>sudo add-apt-repository ppa:obsproject/obs-studio<br># 2. Refresh your app list (so &#39;apt&#39; sees the new apps)<br>sudo apt update<br># 3. Install the app normally!<br>sudo apt install obs-studio</pre><h3>Your Final Cheat Sheet</h3><pre>| Task / Command / Fact            | Best Practice / Notes                                      |<br>|---------------------------------|------------------------------------------------------------|<br>| **Best Way (Always try first!)** | `sudo apt update` then `sudo apt install &lt;app-name&gt;`       |<br>| **Your 64-bit System**           | `x86_64` and `amd64` mean the same thing                  |<br>| **Install a .deb file**          | `sudo apt install ./file-name.deb` (This is the best way!)|<br>| **Install a Snap**               | `sudo snap install &lt;app-name&gt;`                             |<br>| **Install a Flatpak**            | `flatpak install flathub &lt;app-name&gt;`                       |<br>| **Run an AppImage**              | `chmod +x file.AppImage` then `./file.AppImage`            |<br>| **Install from a PPA**           | `sudo add-apt-repository ppa:...` then `sudo apt update`   |<br>| **Red Hat file**                 | `.rpm` — Ignore this on Ubuntu                             |<br>| **Source Code file**             | `.tar.gz` — Avoid this unless you&#39;re an expert             |</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e29b4f33ebb8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Multiple Database versions in Linux Here’s the Secret! (NO DOCKER!)]]></title>
            <link>https://medium.com/@kirusanthanr.20/one-laptop-two-mysql-versions-heres-the-secret-no-docker-a024614db9df?source=rss-87fc2a5ccd62------2</link>
            <guid isPermaLink="false">https://medium.com/p/a024614db9df</guid>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[developer]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[multiple-versions]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Kirusanthan Ravichandran]]></dc:creator>
            <pubDate>Wed, 15 Oct 2025 10:08:10 GMT</pubDate>
            <atom:updated>2025-10-15T10:14:15.259Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Y0G8Jq9-s1iDDLrOHjAGcw.png" /></figure><p>If you’re a developer, you know this pain.</p><p>Project A needs <strong>MySQL 5.7</strong>. But your new project needs <strong>MySQL 8.0</strong>! You install one… and the other one breaks!</p><p>It’s a nightmare.</p><p>You think, “Okay, I’ll just use Docker.” But some companies say no. Or maybe you just don’t want the overhead. You want something pure, simple, and fast on your Linux machine.</p><p>For years, this was frustrating. But what if I told you there’s a way? A simple trick to run any number of MySQL versions, side-by-side, without them ever fighting?</p><p>No Docker. No sudo. No headaches. Let&#39;s do this.</p><h3>Step 1: Build Their Homes</h3><p>The big secret is <strong>isolation</strong>. We’re going to give each MySQL version its own private folder. They won’t even know the other exists!</p><p>Open your terminal and make two folders.</p><p>Bash</p><pre>mkdir -p ~/Projects/MySQL/mysql57<br>mkdir -p ~/Projects/MySQL/mysql80</pre><p>That’s it! mysql57 is for version 5.7, and mysql80 is for 8.0. Simple!</p><h3>Step 2: Get the Goods</h3><p>Next, we download the official MySQL binaries. Think of these as “MySQL in a box.”</p><p>Go into each folder and download the right version.</p><p>Bash</p><pre># For MySQL 5.7<br>cd ~/Projects/MySQL/mysql57<br>wget https://dev.mysql.com/get/Downloads/MySQL-5.7/mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz<br>tar -xzf mysql-5.7.44-linux-glibc2.12-x86_64.tar.gz --strip-components=1</pre><pre># For MySQL 8.0<br>cd ~/Projects/MySQL/mysql80<br>wget <a href="https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.40-linux-glibc2.28-x86_64.tar.xz">https://dev.mysql.com/get/Downloads/MySQL-8.0/mysql-8.0.40-linux-glibc2.28-x86_64.tar.xz</a><br>tar -xJf mysql-8.0.40-linux-glibc2.28-x86_64.tar.xz --strip-components=1</pre><p>Now each folder has its own copy of MySQL, ready to go!</p><h3>Step 3: Wake Them Up!</h3><p>Before we can use them, we have to initialize the databases. We’ll start them without a root password for now — this is just for development.</p><p>Bash</p><pre># Wake up MySQL 5.7<br>cd ~/Projects/MySQL/mysql57<br>bin/mysqld --initialize-insecure --basedir=&quot;$(pwd)&quot; --datadir=&quot;$(pwd)/data&quot;</pre><pre># Wake up MySQL 8.0<br>cd ~/Projects/MySQL/mysql80<br>bin/mysqld --initialize-insecure --basedir=&quot;$(pwd)&quot; --datadir=&quot;$(pwd)/data&quot;</pre><p><strong>What if you hit a roadblock?</strong> On some systems (like Ubuntu 24.04), you might see a libaio.so.1: cannot open error. Don&#39;t panic! It&#39;s a tiny missing library. The fix is one command:</p><p>Bash</p><pre>sudo apt-get install libaio1t64Run that, then try initializing again. Success!</pre><h3>Step 4: The Magic Trick — Separate Rules</h3><p>This is the most important part! We need to tell each MySQL instance to use a different <strong>port</strong> and <strong>socket</strong>. This is how they can run at the same time without crashing into each other.</p><p>Create a file named my.cnf inside your mysql57 folder with these rules:</p><pre># ~/Projects/MySQL/mysql57/my.cnf</pre><p>Add these configs and save the file:-</p><pre>[mysqld]<br>basedir=/home/username/Projects/MySQL/mysql57<br>datadir=/home/username/Projects/MySQL/mysql57/data<br>port=3307<br>socket=/tmp/mysql57.sock<br>pid-file=/tmp/mysql57.pid</pre><p>Now, do the same for mysql80, but change the port and file names!</p><pre># ~/Projects/MySQL/mysql80/my.cnf</pre><pre>[mysqld]<br>basedir=/home/username/Projects/MySQL/mysql80<br>datadir=/home/username/Projects/MySQL/mysql80/data<br>port=3308<br>socket=/tmp/mysql80.sock<br>pid-file=/tmp/mysql80.pid</pre><p><em>(Remember to replace </em><em>username with your actual username!)</em></p><p>See? Port <strong>3307</strong> for one, <strong>3308</strong> for the other. They are now officially friendly neighbors.</p><h3>Step 5: Start the Engines!</h3><p>It’s time. Let’s run them both!</p><pre># Start 5.7<br>cd ~/Projects/MySQL/mysql57<br>bin/mysqld --defaults-file=&quot;$(pwd)/my.cnf&quot; &amp;</pre><pre># Start 8.0<br>cd ~/Projects/MySQL/mysql80<br>bin/mysqld --defaults-file=&quot;$(pwd)/my.cnf&quot; &amp;</pre><p>That little &amp; at the end tells them to run in the background. And just like that, you have <strong>two different MySQL versions running on one machine!</strong></p><p>To prove it, connect to each one separately:</p><p>Bash</p><pre># Connect to MySQL 5.7<br>bin/mysql --socket=/tmp/mysql57.sock -u root</pre><pre># Connect to MySQL 8.0<br>bin/mysql --socket=/tmp/mysql80.sock -u root</pre><p>It works! They are both alive and independent.</p><h3>Step 6: Become a Command-Line Wizard</h3><p>Typing those long commands is annoying. Let’s create magic words to start and stop our databases.</p><p>Open your ~/.bashrc file and add these aliases:</p><pre># MySQL 5.7 Aliases<br>alias start_mysql57=&#39;cd ~/Projects/MySQL/mysql57 &amp;&amp; bin/mysqld --defaults-file=&quot;$(pwd)/my.cnf&quot; &amp;&#39;<br>alias stop_mysql57=&#39;cd ~/Projects/MySQL/mysql57 &amp;&amp; bin/mysqladmin --socket=/tmp/mysql57.sock -u root shutdown&#39;</pre><pre># MySQL 8.0 Aliases<br>alias start_mysql80=&#39;cd ~/Projects/MySQL/mysql80 &amp;&amp; bin/mysqld --defaults-file=&quot;$(pwd)/my.cnf&quot; &amp;&#39;<br>alias stop_mysql80=&#39;cd ~/Projects/MySQL/mysql80 &amp;&amp; bin/mysqladmin --socket=/tmp/mysql80.sock -u root shutdown&#39;</pre><p>Save the file and refresh your terminal with source ~/.bashrc.</p><p>Now, you can just type:</p><pre>start_mysql57 #to start the db </pre><pre>stop_mysql80   #to stop the db</pre><p>How cool is that?!</p><h3>So, Why is This Help?</h3><p>You just solved a problem that frustrates thousands of developers.</p><ul><li><strong>Total Isolation:</strong> Your projects will never conflict again.</li><li><strong>Run in Parallel:</strong> Have 5.7 and 8.0 running at the exact same time.</li><li><strong>No Docker Needed:</strong> Perfect for restricted environments or when you want a lightweight setup.</li><li><strong>Zero Root Access:</strong> Everything lives safely in your home folder.</li></ul><p>You went from dependency hell to total control. Now you can switch between projects instantly, start and stop any database version you want, and keep everything clean and simple.</p><p>This is how you code smarter, not harder. <strong>And it just works.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a024614db9df" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>