<?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 Pasindu Jayaweera on Medium]]></title>
        <description><![CDATA[Stories by Pasindu Jayaweera on Medium]]></description>
        <link>https://medium.com/@pasindujay?source=rss-555b86c771d6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*u46YZ0DgMZsnnP0NT6IL_Q.jpeg</url>
            <title>Stories by Pasindu Jayaweera on Medium</title>
            <link>https://medium.com/@pasindujay?source=rss-555b86c771d6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 23:04:06 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@pasindujay/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[Germany builds Europe’s first Exascale AI Factory!]]></title>
            <link>https://medium.com/@pasindujay/better-late-than-never-germany-builds-europes-first-exascale-ai-factory-a7ec3e0209a0?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a7ec3e0209a0</guid>
            <category><![CDATA[gpu]]></category>
            <category><![CDATA[nvidia]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[germany]]></category>
            <category><![CDATA[hpc]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Mon, 24 Mar 2025 20:02:10 GMT</pubDate>
            <atom:updated>2025-03-24T20:16:38.493Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P208DXpbd0w94VlKB_tSGw.png" /></figure><p>When it comes to the coldwars among the countries/regions, ‘Technology’ has become a significant measurement within last few years.<br>While USA and China are competing for the 1st place, it seems the Europeans are still at the starting line, trying to digest WTF is happening around them. <br>If we consider the history, the pioneers of the greatest innovations were majorly from EU. Alan Turing (England), Johannes Kepler (Germany), Nikola Tesla(Austria), Leonardo Da Vinci (Italy) likewise you name the field, there would be many late pioneers that gifted many innovations to the world. But the momentum has changed. From being in the cutting-edge technology, the region has become a backbencher in everyway. For an example, in Germany the legal binding contract usually means a physical paper with signatures. It should be in a paper, and it should be the hand-written signature.<br>From a moment like this, as an AI enthusthiastic, one of the greatest news I heard recently is that Germany is in the process of building an Exascale super computer to be used as an AI Factory.</p><p>What is Exascale? Exa = 1,000,000,000,000,000,000. In another way, its 10 into the power of 18 or we could say 18 zeros. A Exascale super computer can do 1,000,000,000,000,000,000 FLOPS. FLOPS is a measurement that reveals the number of floating point operations that can be done in a second. Do you feel it? Exascale is a massive speed! At least in 2025, the year I’m writing this, there are less than handful of such computers all around the world. So, Germany taking this initiative is showing that they are trying to bounce back in this game.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/345/1*8dklurJLygE6bXyoWhU_ZQ.png" /></figure><p>The factory is funded jointly by <a href="https://eurohpc-ju.europa.eu/">EuroHPC </a>and the <a href="https://www.bmbf.de/EN/Home/home_node.html">German Federal ministry of Education and Research</a>. The factory is located at Jülich in North Rhine-Westphalia and being cordinated by Jülich Supercomputing Center (JSC), followed by many more institutes across EU.</p><p>Building Structure:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BcBtaBS-_mgDFtZLnShQ8A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_YoIESP0tw2RiLcC2ivC0A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qZ-h40YwSVUG-ZcUHs6OTw.jpeg" /></figure><h4><strong>Hardware Stack</strong></h4><p><strong>GPU</strong>: NVIDIA GH200 Grace Hopper Superchip ❤</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/467/1*A-jr7e4gAzSm--9sWUhUoQ.png" /></figure><p><strong>Total GPUs</strong>: 24,000<br><strong>Network</strong>: NVIDIA Quantum-2 InfiniBand Platform</p><p><em>Interested more in the stack? </em><a href="https://www.youtube.com/watch?v=eKzNKxWUeCE"><em>https://www.youtube.com/watch?v=eKzNKxWUeCE</em></a></p><p>The factory is set to go online by mid of this year.</p><p>You can easily google for the typical information about the factroy. But I just wanted to share with you how massive the speed of this beast is going to be. The speed of it can be interpreted in below ways;</p><ul><li>If human brain is 1 exaFLOP!<br>As I found out, its typically says that the human brain operates at 1 exaFLOP. It’s not a good measurement, because the brain is not doing floating point operations, but its about all the processing of events; including synapse, nural, cognitive, sensory, etc. So compared to that, <strong>JUPITER AI is roughly as fast as the human brain!</strong></li><li>If FLOPS are Euros! <br>The factory could have given every human being in the world nearly €120,000 on every second!<br><em>(Assumption: total population: 8.2 billion)</em></li><li>If JUPITER AI to train GPT-3!<br>As per source [2] it has required 3.14 x 10²³ FLOPS to train the GPT-3.<br><strong>The JUPITER AI factory can train the GPT-3 LLM within 4 days!</strong><br>Math: 3.14 x 10²³ FLOPS / 10¹⁸ FLOPS = 3.14 x 10⁵s <br>= 314000/86400 days = ~3.6 days</li></ul><p>I hope starting from mid 2025, the output of this machine is going to encourage the whole AI commnity in Europe as well as across the world to break through previously forseen impossibilities.</p><p><strong>References</strong></p><p>[1] — <a href="https://www.scienceabc.com/humans/the-human-brain-vs-supercomputers-which-one-wins.html">https://www.scienceabc.com/humans/the-human-brain-vs-supercomputers-which-one-wins.html</a></p><p>[2] — <a href="https://www.hyro.ai/glossary/gpt-3/">https://www.hyro.ai/glossary/gpt-3/</a></p><p>[3] — <a href="https://nvidianews.nvidia.com/news/nvidia-grace-hopper-superchip-powers-jupiter-defining-a-new-class-of-supercomputers-to-propel-ai-for-scientific-discovery">https://nvidianews.nvidia.com/news/nvidia-grace-hopper-superchip-powers-jupiter-defining-a-new-class-of-supercomputers-to-propel-ai-for-scientific-discovery</a></p><p>[4] — <a href="https://www.fz-juelich.de/">https://www.fz-juelich.de/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a7ec3e0209a0" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Policies for Babes (dummies are too techy now)]]></title>
            <link>https://medium.com/@pasindujay/aws-policies-for-babes-dummies-are-too-techy-now-2b385f0e5e7e?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/2b385f0e5e7e</guid>
            <category><![CDATA[iam-policy]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[policy]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[aws-policies]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Thu, 06 Feb 2025 21:34:25 GMT</pubDate>
            <atom:updated>2025-02-07T03:02:22.081Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*88sL0DVJ_54wAxMnt-EYig.png" /></figure><p>When it comes to Identity and Access Management (IAM), the 3 main elements are Users, Groups and Roles. It is the policies that determine (either allow or deny) to what extent these elements are connected with resources and services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*vzB9uQ_uSCbpo2N4TPnHTg.png" /></figure><p>Aligning to that universal definition, in AWS eco-system, an AWS Policy provide the access control to AWS users, AWS roles and AWS groups against AWS resources and services. These AWS Policies are the fundamentals of AWS security.</p><p><strong>Anatomy of AWS Policy</strong></p><p>What would you identify as a ‘well-designed’ policy? <br>A well-designed policy should be written in simple, yet clear, concise and specific to the point. <br>From developers point-of-view, it should be easy to ‘feed’ into a piece of logic code. There are two best ways to write the policy in that way, and AWS decided to go with one of those; JSON (Java Script Object Notation).<br>Take a look at the below sample AWS Policy:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/b3cf048f82ce0619cf2d43839e5901ba/href">https://medium.com/media/b3cf048f82ce0619cf2d43839e5901ba/href</a></iframe><p>This sample contains main syntaxes of an AWS Policy. Let’s look at them one by one.</p><ol><li>Version — This simply denotes the policy language version. Remember; the date mention has nothing to do with the interpretation of the policy. It’s for the AWS ‘engine’ to know that we are adhering to that specific policy language version. <br>FYI: There are two versions so far as I know, Old one is 2008–10–17 and current one is 2012–10–17. Why “10–17”? Nothing special, its just the release date of these versions. Instead of v1, v2 AWS has been using the release date to make things complex!</li><li>Statement — In a single policy there can be multiple definitions. Statement is the boundry for all of these definitions. As said, there can be multiple statments in a single AWS policy file.</li><li>Effect — There are only two decision exists when we break down a policy definition to the atomic level; its either ALLOW, or DENY. Effect is for these 2 values.</li><li>Action — Let’s make it short: AWS operation(s) or even we could say AWS Service API operations.</li><li>Resource — The specific AWS resource the action applies to. Denoted by ARN (Amazon resource Name) of the specific resource.</li><li>Condition — This is not mandatory, but often useful. In case if we can not exacty define the eligible criteria for the policy, we can use this very smartly and fine-tune the criteria.</li></ol><h4>Best Practices when writing a policy</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/390/1*quYArm0V3_DjB8h_fiu6uw.png" /></figure><p>To write a policy to the point, you need to have very good logical mind. And of course the same policy can be written in many ways. But think well, it might be something like you are going around the head to touch the nose!</p><p>However, you can consider following points are universal best practices when you writing a policy.</p><ol><li>Use least priviledges<br>Just the exact priviledge. Imagine a user need to read a file in S3 bucket. Just provide ReadOnly permission. Nothing more — nothing less. On one way this avoids user doing something beyond his/her requirement. On the other hand side, lesser priviledges means lesser risk for exploitations.</li><li>DENY &gt;&gt;&gt;&gt; ALLOW<br>Deny is always the king! Does not matter when you use it, it over-rides any ‘Allow’s in the policy. This could actually lead you into trouble sometimes that you can not get the required criteria out. In that case you can use ‘Not Action’ and write the criteria in the ‘inverse-definition’ method, if you got what I mean :)</li><li>Use policy variables and tags<br>Do you remember RegEx? We can use policy variables and let those be resolved at the runtime based on the context. This is a very good syntax that adds dynamic flexibility to a policy. <br>i.e: Imagine you want users to allow S3 bucket access, but only to the objects that stored after that user’s username. This is how we can write it using the policy variable ${aws:username}</li></ol><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/69fb4058e48effad5b9bcfd0e5a2f3aa/href">https://medium.com/media/69fb4058e48effad5b9bcfd0e5a2f3aa/href</a></iframe><p>How about tags? If you have at least created 1 EC2 server, you should know what are the tags. Tags are key-value pairs that AWS let us store at most of the places for ease our logics and lives. For an example let’s say we are running 2 EC instances one for Development and one for Production. Then we could have Tag with Key as ‘Env’ and Values ‘Dev’ and ‘Prod’.<br>Development EC2 would have: Env:Dev<br>Production EC2 would have: Env:Prod<br>And in our AWS Policy we can separate access to Dev and Prod for different users/groups/roles by using this tag.<br>Let’s see the policy for Development server:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/033437fcbe23573f8cf94610a2d3ac8d/href">https://medium.com/media/033437fcbe23573f8cf94610a2d3ac8d/href</a></iframe><p>Similar to that, you can write the policy for Production server.</p><p>4. Use AWS Access Advisor and AWS Access Analyzer.<br>AWS Access Advisor is a tool that you can see the set of permissions granted in a policy along with the last used time. You can identify which are the unnecessary permissions that were let through your criteria and clean those up (Rememer least priviledge practice!).<br>AWS Access Analyzer is almost doing same object, but yet slightly different. It rather helps you on reviewing policy configuration to find unintended access. (Not by looking at the usage).<br>Instead of going for an example, I would say try out it with your policies in the console.</p><p>However, the general recommendation is to use both together.</p><p>The policy story can go on and on with topics such as policy types, policy condition operators and also towards permission boundaries. <br>But, for a begining, this would be enough to get a good idea</p><p>Alright babes, now that you’ve got to know AWS policies, go forth and secure all those resources you got ;)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2b385f0e5e7e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Germany’s Digital Leap: Cloud Adoption and Beyond]]></title>
            <link>https://medium.com/@pasindujay/germanys-digital-leap-cloud-adoption-and-beyond-a87de4c463e1?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/a87de4c463e1</guid>
            <category><![CDATA[industry-4-0]]></category>
            <category><![CDATA[cloud]]></category>
            <category><![CDATA[digital-transformation]]></category>
            <category><![CDATA[germany]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Wed, 29 Jan 2025 21:42:31 GMT</pubDate>
            <atom:updated>2025-01-29T21:42:31.991Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vA-gv_q51bWmFMJem0favQ.jpeg" /></figure><h3>Introduction</h3><p>Although Germany is generally known for the stories about it’s not-so-good bureaucracy, the recent changes in the country indicates a sharp rise of cloud infrastructure landscape in the country. The self-explanatory factors such as, market growth-adoption rates, industry insights, expansion of data center market and corporate investments towards cloud infrastructure reveals that fact.<br>The German private sector consisting industry giants like Volkswagen, Siemens, Deutche Telekom, is driving these topics with massive investments in Cloud expansions, AI and Industry 4.0.<br>Adhering to those, we can also see the government is reacting supportively with providing the essential regulatory requirements for establishing a safe and clean IT landscape within the country.<br>This article explores how Germany uplift its digital ecosystem with its collaborative approach between government and the private sector.</p><blockquote>“97% of German companies with at least 50 employees rely on cloud computing.” — KPMG [1]</blockquote><p>A survey from KPMG reveals the cloud-first approach has become the country-standard, which is adopted by more than 50% of the companies in the country. Amidst the complexity, most of them are preferring to maintain a hybrid (public-private cloud) model to distribute the workload, and not relying on a single cloud provider.</p><p>Last year in June, Amazon announced [2] their new investment of €10 billion in Germany for expansion of its cloud infrastructure. In fact, if you already heard about “AWS European Sovereign Cloud”, AWS is building a dedicated data center in Brandenburg, Germany; an independent cloud (not another region in current AWS infrastructure!) just for Europe that will facilitate smooth cloud transformation for EU public and private organisations while protecting the evolving sovereignty needs of the region. This is planned to go-live at the end of this year.</p><h3>How German government supports Digital transformation</h3><p>On the other side, the German government is playing a critical role in fostering these cloud infrastructure adoptions. <br>Since a few years, we are seeing their role with regulatory support popping up. As of now, some major regulatory bodies that the German government facilitated would be;</p><ul><li>The General Data Protection Regulation (GDPR) ensures the privacy and security of personal data of the individuals within the European ‘economic area’ (even beyond that area in related cases).</li><li>Digital Operational Resilience Act (DORA) ensures the financial institutions in Germany are resilient to possible operational disruptions (i.e: cyberattacks). This act goes deeper, that the precautions are mandatory, not only for the financial institutions, but also extending to their vendors.</li><li>Gaia-X Protocol ensures the security and control over the user data during data federation within Europe. The user gains the control over his/her data on both its access and usage permissions.</li><li>Digital Strategy 2025 outlines the expected digital transformation of Germany, including cloud adoption.</li></ul><h4>German Digital Strategy 2025</h4><p>Keeping all those paper-based, letter-centric, fax-supported, slow, old-school services aside, the government took a leap to introduce their Digital Strategy for 2025 with major turnovers. <br>The strategy mainly addresses government’s plans for 3 points;</p><ol><li>Investment — increase public/ private investments</li><li>Regulation — framework to protect standards during the transformations</li><li>Collaboration — international collaborations to compete globally</li></ol><p>When driving towards these points, one key component for that would be De:HUB initiative which was started back in 2016 by the Government.</p><h4>De:HUB</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*efn0r9ivH2Dpeih5-snrVg.jpeg" /></figure><p>de:hub is a digital network that built connecting 12 hubs across the Germany. The intention of this network is to facilitate collaboration among varies stakeholders in digital transformation storyline such as;</p><ul><li>Large firms: Siemens, Volkswagen, SAP, Bosch, Deutche Telekom</li><li>Medium size enterprises: Trumpf, Festo, Würth, B.Braun, Steibel Eltron</li><li>Scientific sources: Fraunhofer society, Max Planck society, DLR (German Aerospace), Karlsruhe Institute of Technology, My ex-neighbour: Technical university of Munich</li><li>Startup communities: Rocket internet, Factory Berlin, Startupbootcamp, Hubraum, Berlin Startup Academy</li></ul><p><em>(Not limited to these stakeholders)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/834/1*MaZ-ErZAr9uoSK6wgloqjg.jpeg" /><figcaption>The 12 hubs of de:hub network</figcaption></figure><p>In summary, for any organization in Germany that is seeking / struggling with moden digital technologies, de:hub acts as a bridge between it and the digital ecosystem. When I say bridging its not only the subject experties. From expertiese to funding, collaboration, resourcing and scailing up, the hub becomes the bridge.</p><p>de:hub is specially important for cloud adoption, because the unique challenges associated with transformation-to-cloud such as, complexity, security, costs and skills gaps.</p><h3>How private sector in Germany supports Digital Transformation</h3><p>Hand-in-hand with the government initiatives the private sector is playing a crucial role to uplift the digital ecosystem in the country.</p><h4>1. Investments</h4><p>The indurstry giants in the country are investing billions of euros for digital technology topics for 2025<br>Some interesting investments are;</p><p><strong>Volkswagen</strong></p><ul><li>Invest for developing in-house software unit (called CARIAD) that will consist of autonomouse driving.</li><li>Microsoft Azure and Qualcomm partnerships for developing cloud-based AI.</li></ul><p><strong>Siemens</strong></p><ul><li>Expansion of Siemens Xcelerator (cloud-based industry automation platform)</li><li>Invest for building metaverse solutions for factories, with collaboration of NVIDIA.</li></ul><p><strong>Deutche Telekom</strong></p><ul><li>Invest for fiber-optic network and 5G across the country. (€50 billion investment!)</li><li>Expansion of Open telekom cloud (A GAIA-X compliant cloud service).</li></ul><h4>2. Support for de:hub</h4><p>As I mention previously, the concept of de:hub is running by the support of whole private sector of the country. Government is only facilitating the concept. The synergy that comes from this brilliant networking reflect in the tech-giants themselves as well.</p><h4>3. Upskilling the workforce of the country</h4><p>In 2025, Germany is expecting a shortage of 200,000 cloud expertieses. The private sectory is inveseting in varies upskilling initiatives to address that.</p><p>One initiative is VW’s work-study degree program, where they provide study and training combined degree programs that run for 3–5 years.</p><h4>4. Adoption of Industry 4.0</h4><p>Industry 4.0 A.K.A the fourth industrial revolution is a concept that is being used in many countries but uniquly strategized based on each country’s overall vision and mission. Germany has accepted this concept and the private sector is adopting those ideas such as smart-factories, automated supply chain management, predective analysis.</p><h4>5. Public-Private Partnerships</h4><p>Many private firms are building collaborations with the government on the initiatives for digital transformation. When it comes to complex topics like digital transformation, there are goals that neither a government or a private firm can not accomplish alone. That is why PPPs are playing an important role in this journey.</p><p>Although Germany is undergoing major necessities in its digital ecosystem such as skills gap and lay offs, the collobarative approach between the government and the private sector that initiate the strategies such as Digital Strategy 2025 seems to be strongly addressing the missing parts of the story towards Germany being a solid leader in the digital age. While getting there, the cloud infrastructure of the country will be the backbone of this digital ecosystem which is going to be a vital factor. So every single euro that’s being invested towards ‘cloud’ is going to be nothing but the foundation for a smarter and sustainable future.</p><p>Btw, are you looking to unlock the full potential of your business in the digital age? I can help you with <a href="https://www.advisory-threesixty.com/">my team</a>! Cheers :)</p><p><strong>References</strong></p><p>[1] Gutjahr, G., Bojen, G., Ennemann, M., &amp; NiederÉE, M. (2023, September 29). Cloud use is standard in German companies. <em>KPMG</em>. <a href="https://kpmg.com/de/en/home/insights/2023/09/cloud-monitor-2023.html">https://kpmg.com/de/en/home/insights/2023/09/cloud-monitor-2023.html</a></p><p>[2] — BMWK - Federal Ministry for Economic Affairs and Climate Action. (n.d.). <em>Digital Strategy 2025</em>. <a href="https://www.bmwk.de/Redaktion/EN/Publikationen/digitale-strategie-2025.html">https://www.bmwk.de/Redaktion/EN/Publikationen/digitale-strategie-2025.html</a></p><p>[3] — <em>Twelve Hubs, one digital network</em>. (n.d.). <a href="https://www.de.digital/DIGITAL/Redaktion/EN/Dossier/digital-hub-initiative.html">https://www.de.digital/DIGITAL/Redaktion/EN/Dossier/digital-hub-initiative.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a87de4c463e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Internet simplified; What happens when you load a webpage? (Part I)]]></title>
            <link>https://medium.com/@pasindujay/internet-simplified-what-happens-when-you-load-a-webpage-part-i-647eae749045?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/647eae749045</guid>
            <category><![CDATA[url]]></category>
            <category><![CDATA[network]]></category>
            <category><![CDATA[dns]]></category>
            <category><![CDATA[web3]]></category>
            <category><![CDATA[internet]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Fri, 02 Aug 2024 11:53:51 GMT</pubDate>
            <atom:updated>2024-08-02T11:53:51.957Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*oc8cARvhWqh9N9PDh5_odA.png" /></figure><p>Ever think of what happens behind the screen when you type a URL in the browser and press enter?<br>We are going to take a closer look at the process.</p><h4>URL — Universal Resource Locator</h4><p>The URL that you type in the browser can contain the following parts,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WtBUqSoQHMmUX9BmMypt5Q.png" /></figure><p>The public websites are hosted in different locations that are reachable through internet. Once you type a URL in the browser, from the moment you press Enter until the browser loads the website to the screen, there are 2 major flows behind.<br>1. Flow 01: Identifying where to reach for the website.<br>2. Flow 02: Reaching that location and retrieving the content.</p><p>Let’s check out those in detail;</p><p>For the example, let’s take the domain “<a href="https://www.srilanka.travel/">https://www.srilanka.travel</a>” which should take us to the<strong> Sri Lanka Tourism</strong> website. Let’s also assume that it’s the first time that we go to that website from this browser.</p><h3>Flow 01: Identifying where to reach for the website</h3><p>In WWW (also in local networks as well), the servers are identified by their IP addresses.</p><blockquote>IP addresses are the identifier that allows information to be sent between devices on a network: they contain location information and make devices accessible for communication. [1]</blockquote><p>An IP address (IPv4) is consisted of a set of 4 numbers (making it a 32bit value). The numbers goes from 0.0.0.0 to 255.255.255.255. Due to the extensive expansion of assets connecting to internet, IPv6 has introduced and it an IPv6 address, there are 8 sets of alpha-numeric numbers which makes it a 128-bit value. While IPv4 can generate 4 billion unique addresses, IPv6 can generate 340 undecillion unique addresses (340×10³⁶).</p><p>It’s obvious that we can’t keep all those IP addresses for our websites in memory. So the domain names come to the stage. We remember the domain names and let our browser to deal with all the hard work. (Tip: you should be able to understand that if we use the</p><p>Therefore, basically the first flow for the browser is to identify the IP address of the server where the Sri Lanka Tourism website is hosted.</p><p>So we start from the begining. We type <a href="https://www.srilanka.travel/">https://www.srilanka.travel</a> in the address-bar and press enter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/376/1*_R8zvp0TycAFg1IDvAQeOw.png" /></figure><p>From where browser starts this investigation (theoritically we call it the ‘lookup’)?<br>The little it knows is the single DNS server that was informed by the ISP of the internet provider(i.e: Mobitel, Vodafone, etc.) while connecting. So the browser will reach it and ask for the IP address.</p><p><strong>What is a DNS Server?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/539/1*3aJyCaTLUEsR6uLz1lJGPA.png" /></figure><p>The main function of a Domain Name System (DNS) Server is to find the IP addresses of the domain names. For that the server maintains a table (IP table) and when a request comes it looksup in the table. <br>It’s not practical to maintain all the domain name mappings in a single DNS Server. It may be possible from space point of view. But, think about the requests and updates that comes to those. The content will be continously keep updating from all over the world. So a single server can not handle that much of IO at all. So there is a layers of DNS Servers for that.</p><p>The closest DNS server to the browser is called ‘Primary DNS Server’. Going further up from there we are having Second level, ….., Top level , Root level DNS servers. Within this hierary, the name mapping records cascade down. One important configuration in this secenario would be TTL — Time to Live. When a higher layer passes down a record to down, it also passes this configuration of TTL. This usually is in miliseconds.</p><p><strong>Why TTL is important?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/1*1zpubVihx0Uu4KLPYCuoQQ.png" /><figcaption>TTL Grim Reaper :)</figcaption></figure><p>To explain this, we need to understand the caching within this flow. If we take our example, the first time the browser runs the first flow to find out the IP address, and the result comes down the DNS servers that involved in that flow is going to cache that result. TTL defines the expiry time of that cache. Imagine if we are going to change a hosting of a certain domain to another server (different IP), then even if we update the respective ‘original’ DNS server with the new IP, the layers below will not pick it until the cache is timed out. So it is important to maintain this TTL value with an understanding.<br>Let’s say if we know there’s going to be an IP chance in near future, we can set the TTL to a lower value in advance. This will increase the number of hits on the top layers of the DNS server hierarcy, but after our change of IP, we can revert it to the regular values.<br><em>(Now a days, there are so many workarounds that avoid this scenario, but I’m just ingoring all these and using the explanation to emphasis the idea of DNS routing :) )</em></p><p>……</p><p>Coming back to the first flow of the browser again, now the primary DNS server will check if it has the relevant mapping. If not, the request will go towards top layers until the result it found (or till the timeout).</p><p>Once the result it found, the response will come in the same path where it went upwards and reach the browser. So now the browser has the IP address that it needs to reach, so its ready for the second flow :)</p><p>Few more points:<br>The browser also has a cache to keep the most recent IP mappings. So the second time you try that URL, the first flow will not be executed.</p><p>Your computer which runs the browser is also having a local IP-table. If necessary we can add our own records there so that the browser will received the relevant IP address from the local IP table. (The precedence of lookup is starting from the local IP table. So if the record is found there, there will not be any calls getting out of the computer.</p><p><strong>How about some old-school ‘hacking’ trick? <br></strong><em>(Technical definition: Setting up a phishing site using DNS manipulation ;)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dtM1VxNWgPz6rFGa_0OFbA.jpeg" /></figure><p>If you read the last paragraph properly, you should find a way to trick a user.<br>Imagine you copy the facebook login page design and able to host it locally. And then add a record in the local IP table to be, facebook.com : 128.0.0.1:&lt;port&gt; (or else wherever you host your duplicate design page). <br>Then the moment a user try to go to facebook.com from the browser, the request will come into your host, because as per the precedence, the lookup is starting from local IP table.<br>So the rest it obvious!</p><p>Yes, there will be a SSL certificate warning for your local host. But we could easily avoid that by importing our own SSL certificate to the browser.</p><p>Take this as more of a learning point to be aware next time you use an unknown computer. <br><strong><em>Performing this with bad intention is highily discouraged and the writer is not obligated to any consequences :)</em></strong></p><p>I will put some linux commands that you can use to check on these.</p><p>1. dig (Domain Information Groper)<br>You can try something like,</p><blockquote>dig srilanka.travel</blockquote><p>and it will reveal the DNS information relating to the query.</p><p>2. nslookup<br>This will simply show you domain name mapping information (basically the IPs).</p><blockquote>nslookup srilank.travel</blockquote><p>Try adding a custom record to the local IP table and running command to see if the locally recorded IP is getting hit for the lookup.</p><p>End of the first flow. Now the browser know the IP address of the (web) server where the srilanka.travel website is hosted.</p><p>Where is the second flow?<br>Well, see you on the next post :)</p><p>[1] — Kaspersky. “What Is an IP Address?” Kaspersky Resource Center. Accessed August 2, 2024. <a href="https://www.kaspersky.com/resource-center/definitions/what-is-an-ip-address">https://www.kaspersky.com/resource-center/definitions/what-is-an-ip-address</a>.</p><p>[2] — Javatpoint. “IPv4 vs IPv6.” Javatpoint. Accessed August 2, 2024. <a href="https://www.javatpoint.com/ipv4-vs-ipv6">https://www.javatpoint.com/ipv4-vs-ipv6</a>.</p><p><em>The content is all on my learnings. So feel free to point if there’s any mistake or to give your thoughts.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=647eae749045" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[බුදු දහමේ සංයුතිය (The composition of Buddhism)]]></title>
            <link>https://medium.com/@pasindujay/%E0%B6%B6%E0%B7%94%E0%B6%AF%E0%B7%94-%E0%B6%AF%E0%B7%84%E0%B6%B8%E0%B7%9A-%E0%B7%83%E0%B6%82%E0%B6%BA%E0%B7%94%E0%B6%AD%E0%B7%92%E0%B6%BA-the-composition-of-buddhism-c3aa0558171d?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3aa0558171d</guid>
            <category><![CDATA[බෞද්ධ]]></category>
            <category><![CDATA[බුදු-දහම]]></category>
            <category><![CDATA[nirvana]]></category>
            <category><![CDATA[buddhism]]></category>
            <category><![CDATA[බුද්ධාගම]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Sat, 30 Dec 2023 18:42:24 GMT</pubDate>
            <atom:updated>2024-05-29T23:03:21.347Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dwkXA9PlqJ2Ewua2kkc1ig.png" /></figure><h3>ආගම යනු “Religion” ද?</h3><p>ඉංග්‍රීසි භාෂාවේ ආගම වෙනුවෙන් භාවිතාවන්නනේ Religion යෙදුමයි. නමුත් Religion ලෙස Oxford ශබ්ධකෝෂය අර්ථකථනය කර ඇත්තේ පහත පරිදිය,</p><blockquote>දෙවියෙකු හෝ දෙවි කෙනෙකුගේ පැවැත්ම පිළිබඳ විශ්වාසය සහ ඔවුන්ට නමස්කාර කිරීම හා සම්බන්ධ ක්‍රියාකාරකම් හෝ අධ්‍යාත්මික නායකයෙකුගේ ඉගැන්වීම්</blockquote><p>බුදු දහම අනුව මෙය නිවැරදි නැත.</p><p>නඩු විභාගයේදී අධිකරණයට නීති වලට අමතරව ලබා දී ඇති මාර්ගෝපදේශ ප්‍රමාණයක් තිබේ. මේවා හඳුන්වන්නේ ‘ආප්ත’ ලෙසයි. බුදු දහමට අනුව, ආගමක් යනු එවැනි ආප්ත ගොනුවකි.</p><h3>බුදු දහමේ ආප්ත-ගොනුව</h3><p>ඉපදුන දින සිට අද දක්වා ඔබ කොතෙක් බණ අසා ඇත්ද? නොයෙක් කතාවස්තූන් තුලින් කොතෙන් නම් ‘ආප්ත’ අසා ඇත්ද? බොහෝ විට ඒ දේ තුලින් ඔබට හැඟීයන්නේ, බුදු දහමෙහි ඉමක් කොනක් නැති බවකි. මෙයට හේතුව විවිධ මුලාශ්‍ර තුලින් එම ආප්ත ලබා දෙන්නේ විවිධ අයුරින් බැවිනි. <br>නමුත් ක්‍රමානුකුල ගොනුකිරීමක් (composition) ලෙස මෙය ලිහාගතහොත් ඔබට බුදු දහමේ මායිම ලකුණු කල හැකි ද?<br>එනම්, බුදු දහම යනු මෙපමණයි, මෙයට පිටින් කිසිවක් නැත, යනුවෙන් ප්‍රකාශ කල හැකි ද?</p><p>එවැනි පැහැදිලිකිරීමක් සොයාගත නොහැකි වූ බැවින් පහලින් ඇත්තේ ඒ සඳහා ගත් උත්සහයකි :)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*exCbO0atpk2cFWexlf5Gvw.png" /></figure><p>මා සොයාගත් පරිදි බුදු දහමේ මායිම මෙයයි.</p><p><em>English readers: The English graph will be added soon:)</em></p><p>Ref: බෞද්ධයාගේ අත්පොත — රේරුකානේ චන්ද්‍රවිමල හිමි</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3aa0558171d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 most common mistakes done in a WSO2 production deployment]]></title>
            <link>https://medium.com/@pasindujay/5-most-common-mistakes-done-in-a-wso2-production-deployment-c8d90d9c008?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c8d90d9c008</guid>
            <category><![CDATA[cicd]]></category>
            <category><![CDATA[middleware]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Sun, 10 Dec 2023 11:13:43 GMT</pubDate>
            <atom:updated>2023-12-10T11:13:43.469Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*kjTCzwsjBX--PtCCh14b7Q.png" /></figure><p>“Deploying code is like baking a cake — it always takes longer than you think, and if you forget one ingredient, everyone notices.” In fact, the things might ended up in loosing millions or billions from your account!</p><p>Here are the 5 most common issues I’ve seen people do while creating a WSO2 production deployments. In fact, most of the points may valid for any kind of system in production.</p><ol><li>Dumba$$ resource allocation</li></ol><p>Most of the issues found in production environments are directly or in-directly connect with at least one bad allocation of a resource.<br>In a WSO2 deployment, you have 5 basic resource areas to define. <br>Those are CPU, Memory, Database Configs, JVM and Network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TMvDW1LS3KCXRYTcQkeDMA.png" /></figure><p>2. Where the heck is High availability?<br>High availability (HA) is a significant feature that WSO2 products are capable of, yet you have to configure it with care.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xsBAS2RSJ2qleTZBDQ0qqQ.png" /></figure><p>3. Worst security configurations</p><p>Although security issues are not common compared to other issues, the reason for that as I’m seeing is that as this is a middleware environment, most often its not exposed to the outside as it is. In fact in complex environments with running many front ends, backends, this middleware environment is places in a unique layer where no body really cares to crack :) Having said that, I’ve seen many vulnerabilities listed below exists in those.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lS_Axepdk0mWVq-TnQUILg.png" /></figure><p>4. Ride in manual; die like real men!<br>Another main mistake I’ve seen in not using automation. In many cases, automation is seen as a completely new area that needs separate investment. Due to this, the environments are maintained with manual actions and sometimes with very basic automation efforts like copying with bash-scripts. This often leads to cases such as,<br>- Incorrect configurations<br>- Inconsistent configs over different environments<br>- Increased time consumption for deployments<br>- Inability to scale<br>- Inability to patch for critical issues<br>- No roll-back capabilities.</p><p>The remediation would be: Invest time and implement proper automation process including configuration management automation. You can find WSO2 recommendations for those in the website as well.</p><p>5. Black-boxing; zero observability</p><p>Although there are numerous amount of ways to capture observability metrics in WSO2 products, theres no real way to view those from the WSO2 server it-self in a descriptive manner. You often have to take the captures out and use thrid party tools or to connect the metrics outstream to the thrid party tool. Due to this, not many are aware of these captures that ends up in not configuring or not keeping ways to capture those when needed in a production environment. Most common issues due to this are,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VmoehuODv0vsXzELz7W_Bw.png" /></figure><p>Using proper features in proper way is like delegating your responsibilities to correct people. If you do it properly, it will bring you a lot of relief.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c8d90d9c008" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Four reasons why you should not go for Internship at WSO2!!!]]></title>
            <link>https://medium.com/@pasindujay/four-reasons-why-you-should-not-go-for-internship-at-wso2-d7611c6214b9?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/d7611c6214b9</guid>
            <category><![CDATA[sri-lanka]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Thu, 18 May 2023 14:19:15 GMT</pubDate>
            <atom:updated>2023-05-18T14:21:03.890Z</atom:updated>
            <content:encoded><![CDATA[<p>Four reasons why you should not go for Internship at WSO2!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eG065r-_rw2ZCXo0.jpg" /></figure><p>Doesn’t matter how much freelancing you have done, the experience you are going to get from an industrial training (= internship) will be the foundation for a successful career. When it comes to the field of Information Technology in Sri Lanka, one major from the front-line is <a href="https://wso2.com/">WSO2</a>. Therefore it is not false to say that anyone in the IT sector will not miss if they get a chance to have their internship at WSO2 Inc. But read this first! Trust me, it is not what it looks!</p><p><strong>1. Too much resources for six months.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*66lCYOu3YEpbrfa6.jpg" /></figure><p>At the beginning of the internship, a mentor will be assigned to you, he will give you the introduction and let you the tasks and guide you when needed. Trust me, he is not the only person you will have to get help. Literally any member of your team or from the other teams will share their knowledge and it’s a matter of meeting them and asking about your issues. From the tech-lead of the team to associate engineers, you will find all of them are rich in lots of resources that you can learn. Only them? Nah! With the mailing-list-culture of WSO2, you will be exposed to the whole people in the company including the ones in the overseas branches. You will see what they are developing, what are the concepts, the architecture designs, etc. through email-lists. You can even participate in any of those and share what you know and learn what you don’t know. The CEO, Mr. <a href="https://wso2.com/about/team/sanjiva-weerawarana/">Sanjiva</a> is actively participating in most of them. If you create a filter and follow the threads which he is participating (just like I did!) you will learn about his concept and the vision. The HR division will fill your inbox with the news about Tech-talks which are happening so often on WSO2 premises. While the development goes on, you will participate in code-reviews, product councils, calls with clients, etc. So you will understand WSO2 is a place with lots of resources where you will unable to grab them all with in a duration of six months.</p><p><strong>2. Too much technologies for six months.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*V4k1r2ScBj2T8-Sz.jpg" /></figure><p>The first few days of my internship, most of the words I heard in the discussions among the team members were out of my tech-vocabulary! So I created a doc and wrote down few terms per day and googled them. The product which you will be assigned will be consist of lots of technologies that are unique to that product. For an example, Enterprise Mobility Manager (EMM), the product which I contributed had Android, iOS, Windows components. There is an IoT product where there are various different technologies are used as the product has to be compatible with various IoT devices in the market.<br>The best example is the R&amp;D team! They use languages which non of the other teams are using. Some people tends to say that WSO2 developments are basically focused on their ‘Carbon’ kernel therefore you will expose to ‘generic’ technologies. But there are hundreds of other technologies which are used to build various components to be run on top of Carbon. Ultimately you will find the six months are not enough for you to learn at least the basics of all the technologies in this company.</p><p><strong>3. Too much fun for six months.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s19dOTBSljYdt1O_.jpg" /></figure><p>What kind of fun will you be expecting as an intern for six months? How many dinners, treats, team-outings? Well get ready, the number is bigger that you expect. From high-tea at Kingsbury to BBQ at Meemure, I had gone through some explosive fun events with the team.<br>The best thing is that working itself is fun! Our team had a group-chat where we simply humiliated each other! Doesn’t matter if you are intern or the tech-lead, if you have done any ‘fishy’ thing, then get ready for a bunch of sarcastic humiliations from team members! At the tea times, we had carom championships.<br>Just because the weekends are holidays, don’t think on going home and spending the time alone. The HR division will come with various events like Cricket Fiesta, Badminton Tournament, MotorRally, etc to make you busy at weekends. The Gym in the 8th floor will bring the beast in you! Sanjiva sir will be there at the basketball court around 7pm on most days to practice with you! Do you still think this much of fun and enjoyment is bearable for an intern within six months? Not at all!</p><p><strong>4. Too much troubles in the post-internship period.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8D1qkdSSYA0hiCiN.jpg" /></figure><p>Having such kind of ‘happening’ set of six months, do you think you can get ready in the next day, go to university, sit in the lecture room and focus on the lecture? Sorry dude, that’s impossible. The moment I sat for the first lecture after my internship, I missed my chair at the company! The worse came at the tea-time; could I open the fridge in the canteen and grab some drinks I like?<br>Getting back to the university routine will take a few weeks plus you will suffer things like depression, aging, loneliness, social anxiety due to missing your awesome team!</p><p>I had gone through the four scenarios described above. If you are afraid of those factors, then you better not to go and suffer!<br>Finally I must pay ‘<strong>Too Much Thanks</strong>’ for all the team members of WSO2 EMM/IoT and specially my mentor, Mr. Prabath Abeysekara who was the tech-lead of the team.</p><p>P.S. :<br>Let this article be a payment of gratitude to all the amazing people who offered me, helped me and taught me during my the internship period. <br>All the best WSO2! Keep rocking! ❤</p><p>(Based on my internship in 2017)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d7611c6214b9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Are you කම්කරු or සෙකුරුටී? Analysis with Fuzzy Logic..]]></title>
            <link>https://medium.com/@pasindujay/are-you-a-%E0%B6%9A%E0%B6%B8%E0%B7%8A%E0%B6%9A%E0%B6%BB%E0%B7%94-or-a-%E0%B7%83%E0%B7%99%E0%B6%9A%E0%B7%94%E0%B6%BB%E0%B7%94%E0%B6%A7%E0%B7%93-analysis-with-fuzzy-logic-987dfcfd0729?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/987dfcfd0729</guid>
            <category><![CDATA[sri-lankan-politics]]></category>
            <category><![CDATA[fuzzy-logic]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Thu, 18 May 2023 14:12:14 GMT</pubDate>
            <atom:updated>2023-05-19T07:59:45.075Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*JsfT8aYZaB0fRsx_nPR3gg.jpeg" /></figure><p>“උස නම් කම්කරු, මිටි නම් සෙකුරුටී” has been one of the trend setters the Sri Lankans in social media during couple of years back. So I believe the story is not needed to be explained here. What if the minister wants to create a ‘robot’ to analyze those qualifications of the applicants and provide suitable jobs? That is where the concept called Fuzzy Logic comes in handy. <br>First, let me give you a brief explanation on Fuzzy Logic.</p><p>If you are familiar with the theories behind digital electronics, the logic being used in coding, in most of the applications we are bounded with two cases; ‘True’ or ‘False’ ( 1 or 0 ). <br>But when it comes to the reality, most often the real judgments of human are not clearly stating either true or false. (Example: what girls say!). In fact most of those decisions lay between those ‘True’ and ‘False’ making them the two extremes. So instead of having only two cases, how can we represent this ‘degree of truth’ in programming? <br>Fuzzy logic is one approach that we can try out.<br>In fuzzy logic, we consider two types of variables,<br>1. Crisp variables : which contains precise values.<br>ex: <br>A = 3.532 <br>B = {true , false}<br>2. Linguistic variables : which has rather ‘blurred’ meanings.<br>ex: <br> Speed = {slow, normal, fast} <br> Salary = {high, medium, low}<br>ගැහැණු ළමයෙකුගේ කැමැත්ත = {අනේමන්දා, බලමු, කැමතියි, යාලුවෝ වගේ ඉමු, පපුවේ හිලක්}</p><p>You can see that the measurement of any linguistic variable is subjective to observer or designer. <br>For having any mapping between a degree of membership vs membership value we define the membership function. Since these linguistic variables have ‘blurred’ margins, we will see overlaps among the set of membership functions.<br>Consider the membership function below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/300/0*-tD_DWHJZxtH9YdA.png" /></figure><p>You can see that there are points which can be interpreted as either of ‘cold’ and ‘warm’. Similar story between ‘warm’ and ‘hot’.<br>So what we do now is, representing the linguistic decisions we have in these kind of membership functions. We will represent the linguistic input variables and the linguistic output variable in membership functions.</p><p>Next step is to form a set of Fuzzy rules. Fuzzy rules are the conditional statements in the form of IF x is A. THEN y is B where both A and B are linguistic variables.<br>Ex:<br>(Speed = Slow) ^ (Road = Clear) =&gt; (Weather = Cold)</p><p>Once we have membership functions to inputs and output as well as the set of fuzzy rules, it is all set!<br>Can you guess how the process happens?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/828/0*9s50t7eVq3Z9oMDi.png" /></figure><p>For the given input, we retrieve the degree of membership for each attribute using membership functions. (Which is known as Fuzzification). Then we apply the degrees to the fuzzy rules and receive the degree of output membership. Using that degree value finally we decide the correct linguistic output value referring to the membership functions of output (Which is known as De-fuzzyfication).</p><p>Feeling fuzz? Let’s move into our example.</p><p>The minister is considering <strong>height</strong>, <strong>education qualifications</strong> and <strong>commitment to his campaigns.</strong></p><p>1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*5dbIusjMkyvBgc7q.png" /></figure><p>2.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*hbNj_wzwaHyoO7cw.png" /></figure><p>3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*GNJrM9Q7hfMNffTe.png" /></figure><p>Now let’s see the membership function for the output called ‘<strong>Job classification’ </strong>as well.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/534/0*YVwX5LgCz5ieISNr.png" /></figure><p>Based on these considerations, the minister matches the occupations. What we represent is logic of matching using a set of Fuzzy rules.<br>As per the video we saw, these are the possible rules.</p><p>1. (Height=උස) ^ (Education=ප්‍රමාණවත්) v (Priority=වැඩි) =&gt; (Job = ඉහල)<br>2. (Height=මිටි) ^ (Education=ප්‍රමාණවත්) ^ (Priority=අඩු) =&gt; (Job = පහල)</p><p>Based on these set of rules, you can find the relevant degree of ‘Job’ for your qualifications. Then using the Job classification graph, you can find the most probable job that you will get from the so called minister!<br>For an example:<br>I’m 6ft. I have a degree and I’ve only participated in minister’s meetings. Then applying to each rule,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/994/1*Wl0necdV3mfzMvuBPqCIlw.png" /></figure><p>I got ‘1’ for ඉහල job and ‘0’ for පහල job. <br>Now referring to the job classification graph, I can say that I’m going to get a සිකුරුටි(රජයේ) or අමාත්‍යංශ තනතුර :D</p><p>You should have understood a briefly on how to use Fuzzy Logic for handling linguistic variables. <br>Learning something with a smile is not a bad thing at all, Isn’t it?</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=987dfcfd0729" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Inspect WSO2 APIM Gateways for artifact deployment issues in a production environment]]></title>
            <link>https://medium.com/@pasindujay/inspect-wso2-apim-gateways-for-artifact-deployment-issues-in-a-production-environment-3177063eeea2?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/3177063eeea2</guid>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[wso2]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Thu, 18 May 2023 12:59:23 GMT</pubDate>
            <atom:updated>2023-05-18T12:59:23.393Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*0oCGbUladKW0mI1gYZ25Pw.jpeg" /><figcaption>Tour De France 2016; A bicycle is being fixed while the rider is on the move (40 miles per hour)</figcaption></figure><p>If your organisation is running any sort of production environment, one of the worst nightmares is that getting issues which are not reproducible in the lower environments. The cause is the exact pre-conditions need to reproduce are not being set in the lower environments.</p><p>These situations left you with no option other than to take a dive right into the production environment.</p><p>If you are having WSO2 API Manager production deployment, usually these critical issues tends to be with gateway component, because it’s the component which is accepting and serving the API traffic. It’s true that the WSO2 carbon logs will provide debug info almost all the times when there’s an error. But again, it would be harder to grasp those from a production log and sooner or later we need more specific evidence to narrow down the issue.</p><p>In an API Manager production deployment, the gateway component can be horizontally scaled depending on the volume of the incoming traffic. In fact this can be automated in a container environment to auto scale the amount of gateway pods based on the CPU/ Memo or a custom metric. <br>Having multiple gateways leads us for the first question at many issues,</p><p>“Was the issue happening in all the gateways, few gateways or in any specific gateway?”</p><p>Then, when debugging the issue what we need is a way to inspect those gateways one by one. Before APIM 4.0.0, the API synapse artifacts were stored ‘physically’ in the server directory;<br> &lt;APIM-HOME&gt;/repository/deployment/server/synapse-configs<br>The life was easier with that because you could just ‘physically’ view the files. In most cases, this directory was mounted to be shared with all the gateways hence if the issue is specific to one gateway, usually it tends to be something other than synapse-deployment issue.</p><p>From APIM 4.0.0, API artifacts are stored in database and loaded to the memory at the gateway startup. The changes done to the APIs from the Publisher are notified to the gateways through a JMS queue and then being pulled from the control-plane. JMS is an asynchronous message sending method in point-to-point way. Which means, even when you received the API revision is ‘deployed’ from the publisher, the notification on that could still be in the JMS queue due to JMS related issues (Message congestion, msg loss, msg duplication, dead-letter queue related issues, etc).</p><p>Therefore, due to things like misconfigurations, issues with JMS, etc there could may be a chance that one or few gateways are not getting the API artifact updated properly. In such situations, there’s a easy method to inspect the artifacts directly from any specific API. That is Gateway REST API.</p><p>Gateway REST API contains resources to do the following operations.</p><ol><li>GET all APIs</li><li>GET details on a specific API<br>- API artifact<br>- API local-entry<br>- API sequences<br>- API endpoint(s)<br>- API subscription details</li><li>GET details on a specific application</li><li>GET subscription details of an application against an API</li></ol><p>I’ve uploaded a postman collection made collecting those above APIs to here: <a href="https://gist.github.com/pasindujw/27fcccf3780a47eaf40d12874e2772fb">https://gist.github.com/pasindujw/27fcccf3780a47eaf40d12874e2772fb</a></p><p>You can use basic authentication with admin-user’s credentials to invoke these. You will be invoking these directly against each API gateway server.</p><p>One issue you may face is that there could not be a direct route available to reach each gateway from outside. <br>In that case, you can think of following methods;<br>1. Execute the commands from a temporary node created in the same name-space.<br>2. Do a port-forwarding to the respective gateway node and invoke as localhost.<br>3. Modify gateway loadbalancer and redirect your request to the required gateway server (header-specific check, etc.)</p><p>References:<br><a href="https://apim.docs.wso2.com/en/latest/reference/product-apis/gateway-apis/gateway-v2/gateway-v2/">https://apim.docs.wso2.com/en/latest/reference/product-apis/gateway-apis/gateway-v2/gateway-v2/</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3177063eeea2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Using Log4J2 MDC to maintain correlation in WSO2 carbon logs]]></title>
            <link>https://medium.com/@pasindujay/using-log4j2-mdc-to-maintain-correlation-in-wso2-carbon-logs-1091a7954343?source=rss-555b86c771d6------2</link>
            <guid isPermaLink="false">https://medium.com/p/1091a7954343</guid>
            <category><![CDATA[wso2]]></category>
            <category><![CDATA[wso2-api-manager]]></category>
            <category><![CDATA[wso2-ei]]></category>
            <dc:creator><![CDATA[Pasindu Jayaweera]]></dc:creator>
            <pubDate>Tue, 16 May 2023 16:59:15 GMT</pubDate>
            <atom:updated>2023-05-16T16:59:15.894Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sauVvFS5ekDIKETJR8VIlg.png" /></figure><p><strong>Problem<br></strong>When it comes to a production environment consisting of WSO2 product(s), there could be a huge traffic flowing through some of theose components (gateways or EI). When there is some error in one or few of those request flows, although the server prints the respective error logs, it’s hard to track down which relates to what.</p><p>Especially, if there are custom logging which happens per-API request, then there would be several hundreds of logs per second in the carbon log file. In such scenarios, when there is some error which could consist of multiple error logs lines, that will be spreaded over a large set of logs which makes it almost impossible to correlate.</p><p><strong>Solution<br></strong>Log4J2 Message Diagnostic Context (MDC) is an instrument for distinguishing interleaved log output from different sources [1]. Using MDC, we can load a map-like structure containing details that the appender can access when the log message is actually written. Similar to how a ThreadLocal variable would be, the MDC structure is intrinsically bound to the currently executing thread. WSO2 products are using Log4J2 for logging work and we could use MDC to maintain the correlation among the set of logs relevant to each API invocation.</p><p><strong>Steps</strong><br>1. In &lt;WSO2-Home&gt;/repository/conf/log4j.properties file, change the below config to refer a custom json template:</p><p>appender.CARBON_LOGFILE.layout.type = JsonTemplateLayout</p><p>2. In &lt;WSO2_HOME&gt; directory, keep the below pattern in a file.<br>Filename: JsonTemplateLayout.json<br>Content:-<br>{<br>“instant”: {<br>“epochSecond”: {<br>“$resolver”: “timestamp”,<br>“epoch”: {<br>“unit”: “secs”,<br>“rounded”: true<br>}<br>}<br>},<br>“contextMap”: {<br>“$resolver”: “mdc”,<br>“stringified”: true<br>}<br>}</p><p>MDC can be filled with data which are useful for debugging (i.e: UUID, API details, Req details, etc.) and those will be accessible to the log appender at the time the log is written.</p><p>With the above configuration, you will observe the below pattern for the logs.</p><blockquote>{“<a href="http://twitter.com/timestamp">@timestamp</a>”:”2023–05–16T13:51:32.036Z”,”ecs.version”:”1.2.0&quot;,”log.level”:”INFO”,”message”:”{api:PizzaShackAPI:v1.0.0} STATUS = Executing default ‘fault’ sequence, ERROR_CODE = 404, ERROR_MESSAGE = No matching resource found for given API Request”,”process.thread.name”:”PassThroughMessageProcessor-20&quot;,”log.logger”:”org.apache.synapse.mediators.builtin.LogMediator”,”<strong>Correlation-ID”:”b7f35d15–05d4–4d87-ae13–8344477fd158</strong>&quot;,”bundle.id”:”754&quot;,”bundle.name”:”synapse-core”,”bundle.version”:”2.1.7.wso2v227_40&quot;}</blockquote><p>You can see now the log has a Correlation-ID. This is the Synapse MessageID and it will be unique for a single API flow, which means that if you search the logs with the above Correlation-ID, you will receive all the logs related to that specific API request.</p><p>Note: If you are having any custom plugins (i.e: customer handler), it’s better to check if the same correlation-ID is flowing through the custom objects, because I had one incident where the custom handler is having a different correlation-ID in MDC. <br>To fix that, I had to manually set the correction correlation-ID (MessageID) from the custom plugin.</p><blockquote><strong>String correlationIdHeader = (String) messageContext.getProperty(“TRANSACTION-ID-RESP”)</strong><br> <strong>MDC.put(“correlation_id”, correlationIdHeader);</strong></blockquote><p>[1] <a href="https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html">https://logging.apache.org/log4j/1.2/apidocs/org/apache/log4j/MDC.html</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1091a7954343" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>