<?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 Milan Dikkumburage on Medium]]></title>
        <description><![CDATA[Stories by Milan Dikkumburage on Medium]]></description>
        <link>https://medium.com/@dikkumburage?source=rss-e7d867e535c8------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*8Dz3K-XKMIbgavYJsnCRYg.png</url>
            <title>Stories by Milan Dikkumburage on Medium</title>
            <link>https://medium.com/@dikkumburage?source=rss-e7d867e535c8------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 00:05:22 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@dikkumburage/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[How to Squash Multiple Commits Into One Before a Code Review]]></title>
            <link>https://medium.com/@dikkumburage/how-to-squash-multiple-commits-into-one-before-a-code-review-67d661634c42?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/67d661634c42</guid>
            <category><![CDATA[merge]]></category>
            <category><![CDATA[pull-request]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[pull-request-reviews]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Fri, 02 Oct 2026 16:57:01 GMT</pubDate>
            <atom:updated>2026-10-02T16:57:01.262Z</atom:updated>
            <content:encoded><![CDATA[<p><em>A quick, safe way to clean up your commits before someone reviews your PR.</em></p><p>We’ve all been there. You open a pull request, and the commit list looks like this: “wip”, “fix typo”, “actually fix it this time”. It works, but it’s messy. Your reviewer now has to click through every small commit to understand one simple change.</p><p>You don’t have to redo anything to fix this. Git can combine all those commits into one, and your code stays exactly the same. I did this recently on one of my own feature branches, so I’ll walk you through the real example, step by step.</p><h3>The starting point</h3><p>My feature branch had two commits, both part of the same change to an audit module:</p><pre>$ git log --oneline origin/develop..HEAD<br>log full audit event JSON to CloudWatch on every publish<br>add Details field to audit Event</pre><p>Two separate commits, one logical feature. The goal: end up with a single commit that contains both changes.</p><h3>Step 1: Confirm your working tree is clean</h3><pre>git status</pre><p>You want to see nothing to commit, working tree clean. If there are uncommitted changes lying around, commit or stash them first. Don&#39;t skip this check: you don&#39;t want stray edits sneaking into your squashed commit.</p><h3>Step 2: Soft-reset back to where the branch started</h3><p>First, make sure your view of the base branch is current, then reset:</p><pre>git fetch origin<br>git reset --soft origin/develop</pre><p>This is the step that confuses people the first time, so it’s worth understanding exactly what it does. Git tracks three things during a reset: your commit history, your staging area, and your actual files on disk. --soft touches only the first one.</p><p>Think of your two commits as two sealed boxes. reset --soft doesn&#39;t throw away what&#39;s inside them. It unseals both boxes and dumps everything onto the table as staged changes. Nothing is deleted; it&#39;s just no longer divided into two commits.</p><p>Run git status right after this and you&#39;ll see every changed file listed as staged, which is proof nothing was lost.</p><blockquote><strong><em>Tip:</em></strong><em> If </em><em>develop has moved on since you created your branch, resetting to </em><em>origin/develop would also stage changes that reverse your teammates&#39; new work. The safe version resets to the point where your branch actually split off:</em></blockquote><blockquote><em>git reset --soft $(git merge-base HEAD origin/develop)</em></blockquote><h3>Step 3: Recommit everything as one commit</h3><pre>git commit -m &quot;add Details field and CloudWatch logging to audit events&quot;</pre><p>Now repack everything from the table back into a single box. This is also your chance to write a better commit message than any of the originals: describe what the change does as a whole.</p><h3>Step 4: Verify</h3><pre>git log --oneline origin/develop..HEAD</pre><pre>add Details field and CloudWatch logging to audit events</pre><p>One commit. Exactly what we wanted.</p><h3>Step 5: Push it, carefully</h3><p>Since this branch was already pushed (it has an open pull request), you’ve just rewritten public history. A normal git push will be rejected; Git is protecting you from accidentally discarding commits. You need to force it:</p><pre>git push --force-with-lease origin &lt;your-branch-name&gt;</pre><p>Why --force-with-lease and not plain --force? Plain --force blindly overwrites whatever is on the remote, no questions asked. If a teammate pushed something to that branch since you last fetched, you&#39;d silently destroy their work. --force-with-lease checks first: it refuses to push if the remote has changed since your last fetch, so you can&#39;t accidentally clobber someone else&#39;s commits.</p><p>Naming the branch explicitly, rather than just running git push --force-with-lease, also removes any ambiguity about where the push is going. Git would push to the current branch&#39;s tracked remote by default, but when you&#39;re force-pushing, being explicit is worth the extra few keystrokes.</p><h3>The result</h3><p>Open your pull request again and the commit count drops from two to one, with the combined diff intact. Your reviewer now sees one clear, well-described change instead of piecing together your thought process from a trail of incremental commits.</p><h3>A word of caution</h3><p>This technique rewrites history. That’s perfectly fine on your own feature branch that nobody else has pulled from. But avoid it on shared branches like main or develop, where other people&#39;s work depends on the existing commit history. Squash your branch, not the team&#39;s.</p><h3>TL;DR</h3><pre>git status                                # 1. make sure the tree is clean<br>git fetch origin<br>git reset --soft origin/develop           # 2. unpack commits into staged changes<br>git commit -m &quot;one clear message&quot;         # 3. repack as a single commit<br>git log --oneline origin/develop..HEAD    # 4. verify: one commit<br>git push --force-with-lease origin &lt;branch&gt;  # 5. push safely</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=67d661634c42" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Managing Multiple Python Versions on Ubuntu 22.04]]></title>
            <link>https://medium.com/@dikkumburage/managing-multiple-python-versions-on-ubuntu-22-04-180403f3a8bb?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/180403f3a8bb</guid>
            <category><![CDATA[python3]]></category>
            <category><![CDATA[python-programming]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Wed, 18 Jun 2025 06:40:54 GMT</pubDate>
            <atom:updated>2025-06-18T06:41:16.826Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/684/1*Eg_9RbYWJacYK-2Jg1uSLQ.png" /></figure><p>If you’re a developer or sysadmin working with Python on <strong>Ubuntu 22.04</strong>, you’ve likely noticed that it ships with <strong>Python 3.12+</strong> by default. While that’s great for staying up to date, many tools and applications — like <strong>PlayOnLinux</strong>, legacy scripts, or certain Python packages — still require older versions such as <strong>Python 3.10</strong>.</p><p>In this guide, I’ll walk you through how I installed Python 3.10 alongside 3.12 and safely switched between them — <strong>without breaking system dependencies</strong></p><h4><strong>Why I Needed Python 3.10</strong></h4><p>I originally had only <strong>Python 3.12.3</strong> installed. However, while working with <strong>PlayOnLinux</strong>, I encountered an error due to a deprecated module (asyncore) that was removed in Python 3.12. That’s when I decided to install Python 3.10 side by side — and manage both versions cleanly.</p><h4>Step-by-Step: Managing Multiple Python Versions on Ubuntu</h4><ol><li>Add the Deadsnakes PPA</li></ol><p>The Deadsnakes PPA provides older (and newer) Python versions for Ubuntu.</p><pre>sudo add-apt-repository ppa:deadsnakes/ppa<br>sudo apt update</pre><p>2.Install Python 3.10</p><p>Now install Python 3.10, including its development headers and virtual environment tools:</p><pre>sudo apt install python3.10 python3.10-venv python3.10-dev</pre><p>Check that it’s installed:</p><pre>python3.10 --version</pre><p>3. Configure python3 to Point to Python 3.10</p><p>Instead of replacing Python 3.12 (which might break your system), we’ll use update-alternatives to <strong>safely switch between versions</strong>.</p><p>First, register both versions:</p><pre>sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1<br>sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 2</pre><p>Now select the default:</p><pre>sudo update-alternatives --config python3</pre><p>Choose the option for Python 3.10.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Mp6G0NeqBMOGpj9jYxSWDg.png" /></figure><p>4. Verify the Change</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*izENFJxKA0VtLdslHJFg-Q.png" /></figure><h4><strong>Bonus Tip: Use Virtual Environments</strong></h4><p>If you want to isolate your Python 3.10 work without affecting the system:</p><pre>python3.10 -m venv ~/env310<br>source ~/env310/bin/activate</pre><p>Now you’re using Python 3.10 inside a safe, sandboxed environment.</p><h3>Final Thoughts</h3><p>Managing multiple Python versions on Ubuntu is straightforward when done properly. You don’t need to uninstall newer versions — just install the version you need and switch between them using update-alternatives. This method kept my system stable while letting me run older applications without error.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=180403f3a8bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MAC Productivity keyboard shortcuts]]></title>
            <link>https://medium.com/@dikkumburage/mac-productivity-keyboard-shortcuts-fb1bb43ea480?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb1bb43ea480</guid>
            <category><![CDATA[mac]]></category>
            <category><![CDATA[keyboard-shortcuts]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Thu, 06 Mar 2025 07:01:30 GMT</pubDate>
            <atom:updated>2025-03-26T12:12:24.814Z</atom:updated>
            <content:encoded><![CDATA[<h3>🖥️ General Shortcuts</h3><ul><li><strong>Command (⌘) + Space</strong> → Open Spotlight Search 🔍<br><em>Example: Quickly search for apps, files, or do calculations.</em></li><li><strong>Command (⌘) + Tab</strong> → Switch between open apps ↔️<br><em>Example: Jump between Chrome and VS Code in an instant.</em></li><li><strong>Command (⌘) + Q</strong> → Quit the current app ❌<br><em>Example: Close apps completely instead of just minimizing.</em></li><li><strong>Command (⌘) + Option + Esc</strong> → Force quit an app ⚠️<br><em>Example: Use when an app is unresponsive.</em></li></ul><h3>📄 File &amp; Finder Shortcuts</h3><ul><li><strong>Command (⌘) + Shift + N</strong> → Create a new folder 📂<br><em>Example: Organize your files quickly in Finder.</em></li><li><strong>Command (⌘) + Delete</strong> → Move a file to Trash 🗑️<br><em>Example: Quickly delete unwanted files.</em></li><li><strong>Command (⌘) + Shift + G</strong> → Open “Go to Folder” in Finder 📁<br><em>Example: Jump to a specific folder using its path.</em></li><li><strong>Command (⌘) + I</strong> → Get Info on a file ℹ️<br><em>Example: View file details like size and permissions.</em></li></ul><h3>🌐 Web &amp; Browsing Shortcuts (Safari/Chrome)</h3><ul><li><strong>Command (⌘) + T</strong> → Open a new tab 🆕<br><em>Example: Open a new tab in Safari or Chrome.</em></li><li><strong>Command (⌘) + W</strong> → Close the current tab ❎<br><em>Example: Close a browser tab when done.</em></li><li><strong>Command (⌘) + Shift + T</strong> → Reopen the last closed tab 🔄<br><em>Example: Restore an accidentally closed tab.</em></li><li><strong>Command (⌘) + L</strong> → Highlight the address bar 📍<br><em>Example: Quickly type a new URL or search.</em></li></ul><h3>📝 Text Editing Shortcuts</h3><ul><li><strong>Command (⌘) + C / X / V</strong> → Copy ✂️ / Cut ✏️ / Paste 📋<br><em>Example: Copy and paste text easily.</em></li><li><strong>Command (⌘) + Z / Shift + Command (⌘) + Z</strong> → Undo ⏪ / Redo ⏩<br><em>Example: Fix mistakes quickly.</em></li><li><strong>Option + Left/Right Arrow</strong> → Move cursor one word at a time ↔️<br><em>Example: Navigate text efficiently.</em></li><li><strong>Command (⌘) + A</strong> → Select all text 🔵<br><em>Example: Highlight everything in a document.</em></li><li><strong>Command (⌘) + Shift + V</strong> → Paste without formatting ✨<br><em>Example: Paste text without copying the style.</em></li></ul><h3>📸 Screenshots &amp; Recording</h3><ul><li><strong>Command (⌘) + Shift + 3</strong> → Capture full screen 📷<br><em>Example: Take a quick screenshot of everything on your display.</em></li><li><strong>Command (⌘) + Shift + 4</strong> → Capture a selected area 🎯<br><em>Example: Drag and select a specific portion.</em></li><li><strong>Command (⌘) + Shift + 5</strong> → Open screenshot toolbar 📸<br><em>Example: Record your screen or capture a window.</em></li></ul><h3>🚀 Productivity &amp; System Shortcuts</h3><ul><li><strong>Command (⌘) + H</strong> → Hide current window 🔳<br><em>Example: Hide the current app without closing it.</em></li><li><strong>Command (⌘) + M</strong> → Minimize the current window ➖<br><em>Example: Keep your desktop clean while multitasking.</em></li><li><strong>Command (⌘) + Option + D</strong> → Show/hide Dock ⚓<br><em>Example: Free up screen space when needed.</em></li><li><strong>Control + Command (⌘) + Q</strong> → Lock the screen 🔒<br><em>Example: Secure your Mac when stepping away.</em></li></ul><p>To view the mac terminal branch</p><p><a href="https://ohmyz.sh/">https://ohmyz.sh/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb1bb43ea480" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Common Slash Commands in Confluence]]></title>
            <link>https://medium.com/@dikkumburage/common-slash-commands-in-confluence-bd51fa083ff0?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd51fa083ff0</guid>
            <category><![CDATA[confluence]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Wed, 11 Dec 2024 11:23:33 GMT</pubDate>
            <atom:updated>2024-12-11T11:23:33.733Z</atom:updated>
            <content:encoded><![CDATA[<h4>/note</h4><ul><li><strong>Adds a Note Panel</strong> to highlight information.</li><li><strong>Example Output</strong>:</li><li>📝 <em>This is a note panel, useful for important highlights.</em></li></ul><h4>/warning</h4><ul><li><strong>Adds a Warning Panel</strong> to indicate caution or alert users.</li><li><strong>Example Output</strong>:</li><li>⚠️ <em>This is a warning panel, useful for critical information</em></li></ul><h4>/info</h4><ul><li><strong>Adds an Info Panel</strong> for general informational content.</li><li><strong>Example Output</strong>:</li><li>ℹ️ <em>This is an info panel, great for supplemental information.</em></li></ul><h4>/success</h4><ul><li><strong>Adds a Success Panel</strong> to indicate successful actions or outcomes.</li><li><strong>Example Output</strong>:</li><li>✅ <em>This is a success panel, useful for positive results.</em></li></ul><h4>/table</h4><ul><li><strong>Inserts a Table</strong> where you can define rows and columns.</li><li><strong>Example Output</strong>:Column 1Column 2Column 3Data 1Data 2Data 3</li></ul><h4>/decision</h4><ul><li><strong>Adds a Decision Log</strong> to capture decisions made during discussions.</li><li><strong>Example Output</strong>:</li><li>💡 <em>Decision: Move forward with the deployment plan.</em></li></ul><h4>/code</h4><ul><li><strong>Inserts a Code Block</strong> for syntax-highlighted code.</li><li><strong>Example Output</strong>:</li></ul><pre>def hello_world():<br>    print(&quot;Hello, World!&quot;)</pre><h4>/status</h4><ul><li><strong>Adds a Status Label</strong> for indicating task progress or status.</li><li><strong>Example Output</strong>:</li><li><em>Status:</em> <strong>In Progress</strong></li></ul><h4>/date</h4><ul><li><strong>Inserts the Current Date</strong> or lets you choose a date.</li><li><strong>Example Output</strong>:</li><li><em>December 11, 2024</em></li></ul><h4>/expand</h4><ul><li><strong>Adds an Expandable Section</strong> to hide/reveal content.</li><li><strong>Example Output</strong>:</li><li><strong>Expandable Section</strong><br><em>(Click to expand/collapse this content.)</em></li></ul><h4>/task list</h4><ul><li><strong>Creates a Checklist</strong> for task tracking.</li><li><strong>Example Output</strong>:</li></ul><h4>/file</h4><ul><li><strong>Uploads a file</strong> or links to one.</li></ul><h4>/link</h4><ul><li><strong>Creates a hyperlink</strong> or internal link to a Confluence page.</li></ul><h4>/toc</h4><ul><li><strong>Adds a Table of Contents</strong> that dynamically updates based on headings.</li></ul><h4>/quote</h4><ul><li><strong>Inserts a Block Quote.</strong></li><li><strong>Example Output</strong>:</li><li><em>“This is an inspirational quote.”</em></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd51fa083ff0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to access multiple EKS cluster via console]]></title>
            <link>https://medium.com/@dikkumburage/how-to-access-multiple-eks-cluster-via-console-2ff0c5498bb9?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ff0c5498bb9</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 07:21:56 GMT</pubDate>
            <atom:updated>2024-12-05T16:37:34.587Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to manage multiple EKS clusters across different AWS accounts using the terminal</h3><p>Managing multiple EKS clusters across environments can become tedious, especially when switching profiles frequently. With AWS CLI and the awsp tool, you can streamline this process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/710/1*VFZIoTt7urLyBkAX8UE2uQ.png" /></figure><h3>Prerequisites</h3><ol><li><strong>EKS Cluster Setup</strong>: Ensure you have active EKS clusters configured in AWS.</li><li><strong>AWS CLI Installed</strong>: Make sure the AWS CLI is installed and functional on your system.</li></ol><h3>Steps to Set Up and Use awsp for EKS</h3><h4>1. Set Up AWS Profiles</h4><p>Configure individual profiles for your EKS clusters:</p><pre>aws configure --profile PROFILE_NAME</pre><p>For example:</p><pre>aws configure --profile my-eks-cluster</pre><p>Verify the profiles using:</p><pre>cat ~/.aws/config<br>cat ~/.aws/credentials</pre><h4>2. Install awsp Tool</h4><p>Install the awsp utility using Node.js:</p><pre>npm install -g awsp</pre><p>Add the following alias to your shell configuration (~/.bashrc or ~/.zshrc):</p><pre>alias awsp=&quot;source _awsp&quot;</pre><p>Reload the shell configuration:</p><pre>source ~/.zshrc  # or source ~/.bashrc</pre><p><strong>3. Configure EKS with Profiles</strong></p><p>Set the Kubernetes configuration for each EKS cluster:</p><pre>aws eks update-kubeconfig --region &lt;region&gt; --name &lt;cluster-name&gt; --profile &lt;profile-name&gt;</pre><p><strong>4.Switch between profiles using </strong><strong>awsp</strong></p><pre>awsp</pre><p><strong>5.You’ll see a list of profiles</strong></p><pre>AWS Profile Switcher<br>? Choose a profile (Use arrow keys)<br>my-cluster-eks<br>❯ default</pre><p><strong>Reference</strong></p><p><a href="https://github.com/johnnyopao/awsp">https://github.com/johnnyopao/awsp</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ff0c5498bb9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy MySQL InnoDB cluster on redhat 7/8 servers]]></title>
            <link>https://medium.com/@dikkumburage/how-to-deploy-mysql-innodb-cluster-on-redhat-1f05de124956?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/1f05de124956</guid>
            <category><![CDATA[innodb]]></category>
            <category><![CDATA[cluster]]></category>
            <category><![CDATA[redhat-linux]]></category>
            <category><![CDATA[databas]]></category>
            <category><![CDATA[mysql]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Mon, 08 Jul 2024 06:23:36 GMT</pubDate>
            <atom:updated>2024-07-09T18:19:21.103Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction</h3><p>In this article, we will walk through the steps to deploy a MySQL InnoDB cluster on four Red Hat servers. This setup includes three servers acting as database servers and one server as an application server. By the end of this guide, you will have a fully functional MySQL InnoDB cluster ready for production use.</p><h3>InnoDB Cluster overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/563/1*3sIaRCMMjLMkMIpDmsvOsA.png" /></figure><h3>Prerequisites</h3><p>Before you begin, ensure you have the following:</p><ul><li>Four Red Hat servers with access to the internet.</li><li>Basic knowledge of MySQL and Linux command line.</li><li>sudo privileges on all servers.</li><li>MySQL 8.4 RPM package for Red Hat (download from the official MySQL website).</li></ul><h4>Step 1: Set Hostnames</h4><p>Set the hostnames for the servers:</p><p><strong>Database Servers:</strong></p><pre>sudo hostnamectl set-hostname mysql-01.slcoud.lk<br>sudo hostnamectl set-hostname mysql-02.slcoud.lk<br>sudo hostnamectl set-hostname mysql-03.slcoud.lk</pre><p><strong>Application Server:</strong></p><pre>sudo hostnamectl set-hostname mysql-router.slcoud.lk</pre><h4><strong>Step 2: Download and Install MySQL</strong></h4><p>Download and install MySQL for Red Hat on <strong>all three database servers (mysql-01, mysql-02, mysql-03)</strong>:</p><pre>sudo rpm -ivh mysql84-community-release-el9-1.noarch.rpm<br>sudo setenforce 0<br>sudo yum install mysql-server<br>sudo systemctl start mysqld<br>sudo systemctl status mysqld<br>sudo grep &#39;temporary password&#39; /var/log/mysqld.log<br>sudo yum install mysql-shell -y</pre><h4><strong>Step 3: Verify MySQL Installation</strong></h4><p>Verify the MySQL Community Edition on <strong>all three database servers</strong>:</p><pre>mysql&gt; \s<br>--------------<br>mysql  Ver 8.4.1 for Linux on x86_64 (MySQL Community Server - GPL)<br>Connection id:          188<br>Current database:<br>Current user:           root@localhost<br>SSL:                    Not in use<br>Current pager:          stdout<br>Using outfile:          &#39;&#39;<br>Using delimiter:        ;<br>Server version:         8.4.1 MySQL Community Server - GPL</pre><h4><strong>Step 4: Switch Modes in MySQL Shell</strong></h4><p>Switch between different modes in MySQL Shell on <strong>all three database servers</strong>:</p><pre>Switch to JavaScript mode: \js <br>Switch to SQL mode: \sql <br>Switch to Python mode: \py<br>View schemas:  \sql show schemas;</pre><h4><strong>Step 5: Connect to MySQL</strong></h4><p>Connect to MySQL using the root user on <strong>all three database servers</strong>:</p><pre>mysqlsh<br>\connect root@localhost</pre><p>Enter the temporary password retrieved from /var/log/mysqld.log</p><h4><strong>Step 6: Configure Instance</strong></h4><p>Configure the MySQL instance on <strong>all three database servers</strong>:</p><pre>mysqlsh<br>\connect root@localhost<br>dba.configureInstance()</pre><p>Select option 2 to add the password.</p><h4><strong>Step 7: Connect with IC User</strong></h4><p>Connect with the IC user on <strong>all three database servers</strong></p><pre>mysqlsh<br>\connect root@localhost<br>\connect ic@localhost</pre><h4><strong>Step 8: Check Instance Configuration</strong></h4><p>Check the instance configuration on <strong>all three database servers</strong>:</p><pre>MySQL  localhost:33060+ ssl  JS &gt; dba.checkInstanceConfiguration()</pre><h4><strong>Step 9: Create Cluster</strong></h4><p>Create the cluster on <strong>the primary database server (mysql-01)</strong>:</p><pre>MySQL  localhost:33060+ ssl  JS &gt; dba.createCluster(&#39;prodcluster&#39;)<br>MySQL  localhost:33060+ ssl  JS &gt; dba.getCluster()<br>MySQL  localhost:33060+ ssl  JS &gt; herc = dba.getCluster()<br>MySQL  localhost:33060+ ssl  JS &gt; herc.status()</pre><h4><strong>Step 10: Add Instances to Cluster</strong></h4><p>Add new instances to the cluster on <strong>the primary database server (mysql-01)</strong>:</p><pre>MySQL  localhost:33060+ ssl  JS &gt; herc.addInstance(&#39;ic@mysql-02.slcoud.lk&#39;)<br>MySQL  localhost:33060+ ssl  JS &gt; herc.addInstance(&#39;ic@mysql-03.slcoud.lk&#39;)</pre><h4><strong>Step 11: Verify Cluster Setup</strong></h4><p>Verify the cluster setup on <strong>the primary database server (mysql-01)</strong>:</p><pre>\sql <br>MySQL  localhost:33060+ ssl  SQL &gt; show schemas;<br>use mysql_innodb_cluster_metadata;<br>show tables;<br><br>Switch to performance_schema:<br><br>use performance_schema;<br>MySQL  localhost:33060+ ssl  performance_schema  SQL &gt; select * from replication_group_members;</pre><h4><strong>Step 12: Configure MySQL Router</strong></h4><p>Install and configure the MySQL Router on <strong>the application server (mysql-router)</strong>:</p><pre>sudo rpm -ivh mysql84-community-release-el9-1.noarch.rpm<br>sudo setenforce 0<br>mysqlrouter --bootstrap ic@mysql-01.slcoud.lk:3306 --directory /home/gcpmilan/data --user=root</pre><p>Start the MySQL Router service:</p><pre>mysqlrouter -c /home/gcpmilan/data/mysqlrouter.conf<br>./start.sh</pre><p>Verify the router is running:</p><pre>netstat -ntlp</pre><h4><strong>Step 13: Reboot the Cluster</strong></h4><p>Reboot the cluster from a complete outage on <strong>the primary database server (mysql-01)</strong>:</p><pre>MySQL  localhost:33060+ ssl  JS &gt; dba.rebootClusterFromCompleteOutage()</pre><h3>Step 14: Cluster Failover Test</h3><p>To test the failover, stop the MySQL service on one of the database servers (e.g., mysql-02):</p><pre>sudo systemctl stop mysqld</pre><p>Check the cluster status on the primary database server (mysql-01/mysql-02/mysql-03):</p><pre>MySQL  localhost:33060+ ssl  JS &gt; dba.getCluster()<br>MySQL  localhost:33060+ ssl  JS &gt; herc = dba.getCluster()<br>MySQL  localhost:33060+ ssl  JS &gt; herc.status()</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1f05de124956" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to Deploy wordpress on kubernetes]]></title>
            <link>https://medium.com/@dikkumburage/how-to-deploy-wordpress-on-kubernetes-003e876e20e0?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/003e876e20e0</guid>
            <category><![CDATA[ingress]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[wordpress]]></category>
            <category><![CDATA[kubernetes]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Thu, 16 May 2024 06:05:40 GMT</pubDate>
            <atom:updated>2024-05-16T06:05:40.577Z</atom:updated>
            <content:encoded><![CDATA[<h3>Introduction:</h3><p>Deploying WordPress on Kubernetes with Minikube combines the scalability and reliability of Kubernetes with local development ease. Kubernetes offers auto-scaling, updates, and resource isolation, ideal for hosting WordPress. Minikube simplifies Kubernetes testing and development locally.</p><h3>Prerequisites:</h3><p><strong>Minikube Installed:</strong> Ensure you have Minikube installed on your local machine. You can download and install Minikube from the official <a href="https://github.com/kubernetes/minikube">Minikube GitHub repository</a> or using package managers like Homebrew (for macOS/Linux) or Chocolatey (for Windows).</p><p><strong>kubectl CLI:</strong> Install the kubectl command-line tool, which is used to interact with Kubernetes clusters. You can install kubectl using package managers or download it directly from the Kubernetes official website.</p><p><strong>Ingress Controller (Optional):</strong> To access WordPress from outside the cluster, you may need to set up an Ingress controller. Minikube provides an addon for Nginx Ingress, which you can enable using minikube addons enable ingress.</p><h3><strong>Steps</strong></h3><p><strong>01.Create yml file as below</strong></p><p>wordpress.yml</p><pre># MySQL Deployment<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: mysql-deployment<br>spec:<br>  replicas: 1<br>  selector:<br>    matchLabels:<br>      app: mysql<br>  template:<br>    metadata:<br>      labels:<br>        app: mysql<br>    spec:<br>      containers:<br>        - name: mysql<br>          image: mysql:5.7<br>          env:<br>            - name: MYSQL_ROOT_PASSWORD<br>              value: your_root_password<br>            - name: MYSQL_DATABASE<br>              value: wordpress<br>---<br># MySQL Service<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: mysql-service<br>spec:<br>  selector:<br>    app: mysql<br>  ports:<br>    - protocol: TCP<br>      port: 3306<br>      targetPort: 3306<br><br>---<br># WordPress Deployment<br>apiVersion: apps/v1<br>kind: Deployment<br>metadata:<br>  name: wordpress-deployment<br>spec:<br>  replicas: 2<br>  selector:<br>    matchLabels:<br>      app: wordpress<br>  template:<br>    metadata:<br>      labels:<br>        app: wordpress<br>    spec:<br>      containers:<br>        - name: wordpress<br>          image: wordpress:latest<br>          ports:<br>            - containerPort: 80<br>          env:<br>            - name: WORDPRESS_DB_HOST<br>              value: mysql-service<br>            - name: WORDPRESS_DB_NAME<br>              value: wordpress<br>            - name: WORDPRESS_DB_USER<br>              value: root<br>            - name: WORDPRESS_DB_PASSWORD<br>              value: your_root_password<br>---<br># WordPress Service<br>apiVersion: v1<br>kind: Service<br>metadata:<br>  name: wordpress-service<br>spec:<br>  selector:<br>    app: wordpress<br>  ports:<br>    - protocol: TCP<br>      port: 80<br>      targetPort: 80<br>  type: NodePort<br>---<br># WordPress Ingress<br>apiVersion: networking.k8s.io/v1<br>kind: Ingress<br>metadata:<br>  name: wordpress-ingress<br>  annotations:<br>    nginx.ingress.kubernetes.io/rewrite-target: /<br>spec:<br>  rules:<br>    - host: my-wordpress.com<br>      http:<br>        paths:<br>          - path: /<br>            pathType: Prefix<br>            backend:<br>              service:<br>                name: wordpress-service<br>                port:<br>                  number: 80</pre><p><strong>02.Deploy the wordpress</strong></p><pre>kubectl create -f wordpress.yml</pre><p><strong>03.Adding host record</strong></p><p>First get the minikube ip</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*CxOat2CouV6nRyb3GIKiHQ.png" /></figure><p>Update the hostfile with domain name</p><pre>sudo vim /etc/hosts<br><br>192.168.49.2 my-wordpress.com<br></pre><p><strong>04. Access the wordpress url in your browser</strong></p><p><a href="http://my-wordpress.com/">http://my-wordpress.com/</a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*2E-1-p8JnkXc5EwlL5CESA.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=003e876e20e0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install the node exporter on redhat 8]]></title>
            <link>https://medium.com/@dikkumburage/how-to-install-the-node-exporter-on-redhat-8-10d431f4e733?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/10d431f4e733</guid>
            <category><![CDATA[node-exporter]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Fri, 03 May 2024 06:47:51 GMT</pubDate>
            <atom:updated>2024-05-03T06:47:51.637Z</atom:updated>
            <content:encoded><![CDATA[<ol><li><strong>Download the latest release of Node Exporter</strong>:</li></ol><pre>wget https://github.com/prometheus/node_exporter/releases/download/v1.3.1/node_exporter-1.3.1.linux-amd64.tar.gz</pre><p>2.<strong>Extract the downloaded file</strong>:</p><pre>tar xvfz node_exporter-*.tar.gz</pre><p>3.<strong>Move the Node Exporter binary to your PATH</strong>:</p><p>Move the Node Exporter binary to a directory in your PATH, such as /usr/local/bin/:</p><pre>sudo mv node_exporter-*/node_exporter /usr/local/bin/</pre><p>4.<strong>Create a systemd service file for Node Exporter</strong>:</p><p>Create a systemd service file for Node Exporter at /etc/systemd/system/node_exporter.service:</p><pre>sudo vim /etc/systemd/system/node_exporter.service</pre><p>In the node_exporter.service file, add the following content:</p><pre>[Unit]<br>Description=Node Exporter<br>Wants=network-online.target<br>After=network-online.target<br><br>[Service]<br>User=node_exporter<br>Group=node_exporter<br>Type=simple<br>ExecStart=/usr/local/bin/node_exporter<br><br>[Install]<br>WantedBy=default.target</pre><p>5.<strong>Create a user for Node Exporter</strong>:</p><p>For security reasons, it’s a good practice to run Node Exporter as a non-root user:</p><pre>sudo useradd -rs /bin/false node_exporter</pre><p>6.<strong>Reload the systemd manager configuration</strong>:</p><p>Use the systemctl command to reload the systemd manager configuration:</p><pre>sudo systemctl daemon-reload</pre><p>7.<strong>Start the Node Exporter service</strong>:</p><p>Start the Node Exporter service with the systemctl command:</p><pre>sudo systemctl start node_exporter</pre><p>8.<strong>Enable the Node Exporter service to start on boot</strong>:</p><p>Enable the Node Exporter service to start on boot with the systemctl command:</p><pre>sudo systemctl enable node_exporter</pre><p>After these steps, you should have Node Exporter installed and running on your RHEL system. You can access the Node Exporter metrics at <a href="http://your_server_ip:9100/metrics.">http://your_server_ip:9100/metrics.</a></p><p>Note :- Sometime you have to disable the SELINUX</p><pre>sudo setenforce 0</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=10d431f4e733" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to install prometheus on redhat 8]]></title>
            <link>https://medium.com/@dikkumburage/how-to-install-prometheus-on-redhat-8-89eb19d98f7a?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/89eb19d98f7a</guid>
            <category><![CDATA[prometheus]]></category>
            <category><![CDATA[monitoring]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Fri, 03 May 2024 06:39:01 GMT</pubDate>
            <atom:updated>2024-05-03T06:48:23.265Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>1.Download the latest release of Prometheus</strong>:</p><p>You can download the latest release of Prometheus from the <a href="https://prometheus.io/download/">Prometheus download page</a>. Use the wget command to download it:</p><pre>sudo wget https://github.com/prometheus/prometheus/releases/download/v2.30.3/prometheus-2.30.3.linux-amd64.tar.gz</pre><p>2.<strong>Extract the downloaded file</strong>:</p><pre>tar xvfz prometheus-*.tar.gz</pre><p>3.<strong>Move the Prometheus and promtool binaries to your PATH</strong>:</p><p>Move the Prometheus and promtool binaries to a directory in your PATH, such as /usr/local/bin/:</p><pre>sudo mv prometheus-2.30.3.linux-amd64/prometheus /usr/local/bin/<br>sudo mv prometheus-2.30.3.linux-amd64/promtool /usr/local/bin/</pre><p>4.<strong>Create the Prometheus configuration file</strong>:</p><p>Create a directory for the Prometheus configuration file, such as /etc/prometheus/, and create the configuration file prometheus.yml in this directory:</p><pre>sudo mkdir /etc/prometheus<br>sudo nano /etc/prometheus/prometheus.yml</pre><p>In the prometheus.yml file, add the following content:</p><pre>global:<br>  scrape_interval:     15s<br>  evaluation_interval: 15s<br><br>scrape_configs:<br>  - job_name: &#39;prometheus&#39;<br>    static_configs:<br>    - targets: [&#39;localhost:9090&#39;]</pre><p>5.<strong>Create a systemd service file for Prometheus</strong>:</p><p>Create a systemd service file for Prometheus at /etc/systemd/system/prometheus.service:</p><pre>sudo vim /etc/systemd/system/prometheus.service</pre><p>In the prometheus.service file, add the following content:</p><pre>[Unit]<br>Description=Prometheus<br>Wants=network-online.target<br>After=network-online.target<br><br>[Service]<br>User=root<br>Group=root<br>Type=simple<br>ExecStart=/usr/local/bin/prometheus \<br>--config.file /etc/prometheus/prometheus.yml \<br>--storage.tsdb.path /var/lib/prometheus/ \<br>--web.console.templates=/etc/prometheus/consoles \<br>--web.console.libraries=/etc/prometheus/console_libraries<br><br>[Install]<br>WantedBy=multi-user.target</pre><p>6.<strong>Reload the systemd manager configuration</strong>:</p><p>Use the systemctl command to reload the systemd manager configuration:</p><pre>sudo systemctl daemon-reload</pre><p>7.<strong>Start the Prometheus service</strong>:</p><pre>sudo systemctl start prometheus</pre><p>8.<strong>Enable the Prometheus service to start on boot</strong>:</p><pre>sudo systemctl enable prometheus</pre><p>9.After these steps, you should have Prometheus installed and running on your RHEL system. You can access the Prometheus web interface by opening your web browser and navigating to <a href="http://your_server_ip:9090/">http://your_server_ip:9090/</a></p><p>Note :- Sometime you have to disable the SELINUX</p><pre>sudo setenforce 0</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=89eb19d98f7a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to generate gcp linux vm ssh key]]></title>
            <link>https://medium.com/@dikkumburage/how-to-generate-gcp-linux-vm-ssh-key-6a00bba8e9d6?source=rss-e7d867e535c8------2</link>
            <guid isPermaLink="false">https://medium.com/p/6a00bba8e9d6</guid>
            <dc:creator><![CDATA[Milan Dikkumburage]]></dc:creator>
            <pubDate>Wed, 24 Apr 2024 11:26:31 GMT</pubDate>
            <atom:updated>2024-04-24T11:26:31.997Z</atom:updated>
            <content:encoded><![CDATA[<pre>ssh-keygen -t rsa -b 2048 -C &quot;your_email@example.com&quot;<br><br><br>ssh-add &lt;your_ssh_key_name&gt;</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6a00bba8e9d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>