<?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 Nuwanthi Rajapaksha on Medium]]></title>
        <description><![CDATA[Stories by Nuwanthi Rajapaksha on Medium]]></description>
        <link>https://medium.com/@nuwanthidileka?source=rss-690a7b757550------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*Z5AhU5chBCDOk0IhcDRC2w.jpeg</url>
            <title>Stories by Nuwanthi Rajapaksha on Medium</title>
            <link>https://medium.com/@nuwanthidileka?source=rss-690a7b757550------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Fri, 20 Nov 2026 17:57:51 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@nuwanthidileka/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[Understanding EC2 Storage: Exploring gp3 Volumes in AWS]]></title>
            <link>https://medium.com/@nuwanthidileka/understanding-ec2-storage-exploring-gp3-volumes-in-aws-da82f6b26c8e?source=rss-690a7b757550------2</link>
            <guid isPermaLink="false">https://medium.com/p/da82f6b26c8e</guid>
            <category><![CDATA[aws-gp3]]></category>
            <category><![CDATA[gp3-vs-gp2]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[amazon-ec2]]></category>
            <dc:creator><![CDATA[Nuwanthi Rajapaksha]]></dc:creator>
            <pubDate>Sun, 08 Mar 2026 03:34:41 GMT</pubDate>
            <atom:updated>2026-03-08T03:34:41.554Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Tj_iTbjKrXr37KgXv4zzBA.png" /></figure><p>When you launch a virtual machine in the cloud (Amazon EC2), one of the most critical decisions you’ll make is where to store your data. In AWS, storage isn’t just a “hard drive” — it’s a flexible service that can be tuned for speed, size, and cost.</p><p>In this article, we explore storage options for Amazon EC2 and take a deeper look at <strong>gp3 volumes</strong>, one of the most commonly recommended storage types for modern workloads.</p><h3>EC2 Storage Options</h3><p>Instances running on Amazon EC2 can use multiple storage services depending on application needs. Each storage type is designed for different use cases such as persistent storage, shared file systems, or object storage.</p><p>Some of the main storage options include:</p><ul><li>Amazon Elastic Block Store (EBS) — persistent block storage attached to EC2 instances</li><li>Instance Store — temporary storage physically attached to the host machine</li><li>Amazon Elastic File System — scalable shared file storage</li><li>Amazon S3 — object storage for large-scale data storage</li></ul><p>Among these, <strong>Amazon EBS</strong> is the most commonly used storage solution for EC2 workloads.</p><h3>What is Amazon EBS?</h3><p>Amazon Elastic Block Store (EBS) provides <strong>persistent block storage volumes</strong> that can be attached to EC2 instances. These volumes behave like traditional hard drives or SSDs and allow applications to store data reliably.</p><p>However, unlike physical disks, EBS volumes provide additional flexibility in the cloud. The term <strong>“Elastic”</strong> refers to capabilities such as:</p><ol><li><strong>Detach and Reattach:</strong> You can move an EBS volume from one instance to another in the same availability zone.</li><li><strong>Live Modifications:</strong> You can increase your disk size or change its speed <strong>without turning the server off.</strong></li></ol><p>Key characteristics of EBS include:</p><ul><li>Persistent storage even when an EC2 instance is stopped</li><li>Ability to attach and detach volumes from instances</li><li>High durability and availability</li><li>Support for snapshots and backups</li><li>Scalable performance depending on volume type</li></ul><p>EBS volumes are commonly used for:</p><ul><li>Operating system boot volumes</li><li>Databases</li><li>Enterprise applications</li><li>File systems for application servers</li></ul><h3>Types of EBS Volumes</h3><p>Amazon EBS offers several volume types optimized for different performance requirements.</p><h4>SSD-Based Volumes</h4><p>Designed for transactional workloads that require low latency.</p><ul><li>gp3 (General Purpose SSD)</li><li>gp2 (Previous generation general-purpose SSD)</li><li>io1 (Provisioned IOPS SSD)</li><li>io2 (High performance Provisioned IOPS SSD)</li></ul><h4>HDD-Based Volumes</h4><p>Designed for large sequential workloads.</p><ul><li>st1 — Throughput optimized HDD</li><li>sc1 — Cold HDD storage</li></ul><p>Among these options, <strong>gp3 volumes are currently the recommended general-purpose storage solution for most workloads.</strong></p><h3>What is gp3?</h3><p>General Purpose SSD gp3 is the latest generation of general-purpose SSD storage offered by Amazon EBS. It was introduced to improve performance flexibility and reduce costs compared to the previous gp2 volume type.</p><p>The key innovation of gp3 volumes is that <strong>performance is no longer tied to volume size</strong>. This means users can configure storage size, IOPS, and throughput independently based on application needs.</p><p>This flexibility allows organizations to optimize both <strong>performance and cost</strong>.</p><h3>Why gp3 is the Gold Standard</h3><p>In your AWS console, you’ll see several Volume Types. For a long time, <strong>gp2</strong> was the default. Today <strong>gp3</strong> is the recommended choice.</p><h4>The Problem with the Old Way (gp2)</h4><p>With gp2 volumes, performance was tied to size. If you wanted a faster drive (more IOPS), you had to buy a bigger drive. It was like being forced to buy a massive 18-wheeler truck just because you wanted a fast engine.</p><h4>The gp3 Revolution: Decoupling</h4><p>With <strong>gp3</strong>, performance is independent of size. You can have a tiny 10GB drive but give it a racing engine for speed. This flexibility allows you to optimize costs significantly.</p><h3>gp3 Performance Characteristics</h3><p>gp3 volumes provide predictable and configurable performance.</p><h4>Baseline Performance</h4><p>Every gp3 volume includes baseline performance of:</p><ul><li><strong>3000 IOPS</strong></li><li><strong>125 MB/s throughput</strong></li></ul><p>This baseline is included regardless of volume size.</p><h4>Maximum Performance</h4><p>gp3 volumes can scale performance up to:</p><ul><li><strong>16,000 IOPS</strong></li><li><strong>1000 MB/s throughput</strong></li></ul><p>These performance levels can be provisioned independently of storage capacity, allowing applications to achieve higher performance without increasing storage size.</p><h4>Key Performance Metrics</h4><p>Two important metrics for storage performance are:</p><p><strong>IOPS (Input/ Output Operations Per Second)</strong><br> This measures the number of read or write operations a storage device can perform per second.( how many “small tasks” the drive can handle at once) High IOPS is great for <strong>Databases</strong>.</p><p><strong>Throughput</strong><br> This measures the amount of data transferred per second, usually expressed in MB/s. High Throughput is great for <strong>Video Processing</strong> or <strong>Large Log Files</strong>.</p><p><strong>The Best Part:</strong> Every gp3 volume comes with a free baseline of <strong>3,000 IOPS</strong> and <strong>125 MB/s throughput</strong> included in the price.</p><h3>gp2 vs. gp3: A Quick Comparison</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FZhkIeAM6jnn_x0yYLNY6w.png" /><figcaption>Fig 01: gp2 vs gp3</figcaption></figure><h3>Common Use Cases for gp3</h3><p>gp3 volumes are suitable for a wide range of applications, including:</p><ul><li>Web and application servers</li><li>Development and test environments</li><li>Medium-sized databases</li><li>Microservices architectures</li><li>Virtual desktop environments</li><li>Boot volumes for EC2 instances</li></ul><p>For most general workloads in AWS, gp3 volumes offer an ideal balance of <strong>cost, performance, and flexibility</strong>.</p><h3>Best Practices for Using gp3 Volumes</h3><p>To get the best performance and cost efficiency from gp3 volumes, consider the following best practices:</p><p><strong>Right-size performance settings</strong><br> Avoid overprovisioning IOPS and throughput if your workload does not require it.</p><p><strong>Monitor performance metrics</strong><br> Use Amazon Cloud Watch to track metrics such as IOPS, latency, and throughput.</p><p><strong>Use snapshots for backup</strong><br> Create backups using Amazon EBS Snapshots to protect critical data.</p><p><strong>Optimize for workload patterns</strong><br> Database workloads may require higher IOPS, while analytics workloads may require higher throughput.</p><h3>Conclusion</h3><p>Choosing the right storage solution is a critical aspect of designing efficient cloud infrastructure. With the flexibility, performance, and cost benefits it offers, gp3 has become the preferred general-purpose storage option for many AWS workloads.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=da82f6b26c8e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why AWS Uses Elastic IP Addresses]]></title>
            <link>https://medium.com/@nuwanthidileka/why-aws-uses-elastic-ip-addresses-cd5496110d41?source=rss-690a7b757550------2</link>
            <guid isPermaLink="false">https://medium.com/p/cd5496110d41</guid>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[elastic-ip-address]]></category>
            <category><![CDATA[aws-ec2-instance]]></category>
            <category><![CDATA[ec2-instance]]></category>
            <category><![CDATA[aws-elastic-ip]]></category>
            <dc:creator><![CDATA[Nuwanthi Rajapaksha]]></dc:creator>
            <pubDate>Tue, 03 Mar 2026 03:17:57 GMT</pubDate>
            <atom:updated>2026-03-03T03:17:57.636Z</atom:updated>
            <content:encoded><![CDATA[<p>When you launch an instance in Amazon EC2, it receives a standard public IP address. The problem is that this address is <strong>temporary</strong>.</p><p>Your public IP can change if</p><ul><li>The instance is <strong>Stopped.</strong></li><li>The instance is <strong>Restarted.</strong></li><li>The instance is <strong>Replaced</strong> (common if you use Auto Scaling or Spot Instances).</li></ul><h3><strong>Why is this a problem?</strong></h3><p>If you are running a <strong>Web Server</strong>, hosting an <strong>API</strong>, or have <strong>DNS records</strong> pointing to that IP, those links will break the moment the IP changes. Users will get a ‘Connection Timed Out’ error. To them, your service simply looks like it’s down.</p><h3>What Is an Elastic IP?</h3><p>An Elastic IP (EIP) is a <strong>static, public IPv4 address</strong> provided by AWS that you allocate to your account.</p><p><strong>Key Points to Remember:</strong></p><ul><li><strong>Static:</strong> It never changes unless you manually release it.</li><li><strong>Account-Owned:</strong> It belongs to your AWS account, not a specific server.</li><li><strong>Re-assignable:</strong> You can detach it from one instance and attach it to another instantly.</li><li><strong>Region-Specific:</strong> An elastic IP created in one region cannot be used in another region.</li></ul><h3>How Elastic IP Works</h3><p>The process of using an Elastic IP happens in two main steps:</p><p><strong>1. Allocate the Elastic IP</strong></p><p>First, you request (allocate) an Elastic IP from the AWS public IP address pool. At this stage, the IP belongs to your AWS account, but it is not yet connected to any resource.</p><p><strong>2. Associate the Elastic IP</strong></p><p>Next, you associate the Elastic IP with an EC2 instance. Once associated, the instance can be accessed using this permanent public IP address.</p><h4>How Internet Traffic Reaches Your EC2 Instance</h4><p>When a user accesses your application using the Elastic IP, the network flow works like this:</p><ol><li>A user enters the website’s domain name in their browser.</li><li>The request travels through the public internet to AWS.</li><li>AWS receives the request and identifies the Elastic IP.</li><li>AWS then forwards the traffic to the EC2 instance that the Elastic IP is associated with.</li><li>The EC2 instance processes the request and sends the response back to the user.</li></ol><p>In simple terms, the connection flow is:</p><p><strong>Internet User → Elastic IP → EC2 Instance</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oxy2CyPpLzj9eS_NL05uTQ.png" /><figcaption>fig 01: connection flow</figcaption></figure><h3>Real-World Use Cases</h3><ul><li><strong>Stable DNS:</strong> You can point api.yourcompany.com to one IP and never worry about updating it again.</li><li><strong>Quick Failover:</strong> If your primary server crashes, you can re-point your EIP to a standby “backup” server in seconds.</li><li><strong>Whitelisting:</strong> Many third-party APIs require you to provide a single, fixed IP address for security.</li></ul><h3>Elastic IP vs. Normal Public IP</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/932/1*1VhVcewzPDvxBmCPokksGQ.png" /><figcaption>fig 02: Comparison elastic vs public IP</figcaption></figure><h3>The Pricing Trap</h3><p>AWS wants IPv4 addresses to be used, not hoarded. Because of this, they use a “Use it or Lose money” pricing model:</p><ul><li><strong>Free Tier:</strong> You generally get one Elastic IP for free if it is attached to a running instance.</li><li><strong>The Penalty:</strong> If you allocate an EIP and <strong>don’t</strong> attach it to a running instance (it sits idle), AWS will charge you an hourly fee.</li></ul><h3>Best Practices &amp; Better Alternatives</h3><p>While EIPs are great, they aren’t always the best solution as you grow.</p><ul><li><strong>Only use EIPs when necessary:</strong> Don’t give every server an EIP if it doesn’t need to be reached directly from the internet.</li><li><strong>Release unused IPs:</strong> Keep your account clean to avoid costs.</li><li><strong>Look into Load Balancers:</strong> For high-traffic websites, it is better to use an <strong>Elastic Load Balancer (ELB)</strong>.</li><li><strong>Use Route 53:</strong> Instead of hardcoding IPs, use <strong>Amazon Route 53</strong> (DNS) to manage how traffic reaches your resources.</li></ul><p>In short, <strong>Elastic IP = a permanent public address you control in AWS.</strong> It provides the stability your applications need to stay reachable in the ever-changing environment of the cloud.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cd5496110d41" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding VPC CIDR Blocks, Subnets, and IP Planning in AWS]]></title>
            <link>https://medium.com/@nuwanthidileka/understanding-vpc-cidr-blocks-subnets-and-ip-planning-in-aws-ea25db26b4b3?source=rss-690a7b757550------2</link>
            <guid isPermaLink="false">https://medium.com/p/ea25db26b4b3</guid>
            <dc:creator><![CDATA[Nuwanthi Rajapaksha]]></dc:creator>
            <pubDate>Wed, 28 Jan 2026 16:08:16 GMT</pubDate>
            <atom:updated>2026-01-31T06:29:16.152Z</atom:updated>
            <content:encoded><![CDATA[<p>When you begin working with AWS networking, one of the ideas you will come across is the <strong>Virtual Private Cloud(VPC)</strong>. The VPC is your own isolated network, inside AWS. To set up the VPC properly you need to know about <strong>CIDR blocks, subnets and IP planning</strong>. This is important for the Virtual Private Cloud to work the way you want it to.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*63DVLxN63u7EMfF8sPlqWA.png" /><figcaption>Figure 01: AWS VPC with Public and Private Subnets</figcaption></figure><h3>What Is a VPC?</h3><p>An <strong>Amazon VPC (Virtual Private Cloud)</strong> is a logically isolated network where you launch AWS resources such as EC2 instances, RDS databases, and load balancers.</p><p>Think of a VPC as:</p><blockquote><em>Your own private data center network inside AWS.</em></blockquote><p>When you create a VPC, the most important decision you make is choosing its <strong>CIDR block</strong>.</p><h3>Understanding CIDR Blocks</h3><h3>What Is CIDR?</h3><p>CIDR stands for <strong>Classless Inter-Domain Routing</strong>. It defines <strong>how many IP addresses</strong> your network has.</p><p>Example:</p><pre>10.0.0.0/16</pre><h4>Breaking it down:</h4><ul><li>10.0.0.0 → Network starting address</li><li>/16 → Size of the networkIPv4 addresses have <strong>32 bits total</strong>.</li></ul><p>So:</p><pre>Host bits = 32 - CIDR</pre><p>Examples:</p><ul><li>/16 → 16 host bits → 2¹⁶ = 65,536 IPs</li><li>/24 → 8 host bits → 2⁸ = 256 IPs</li><li>/28 → 4 host bits → 2⁴ = 16 IPs</li></ul><p>Smaller number after / → <strong>Bigger network</strong></p><p>Bigger number after / → <strong>Smaller network</strong></p><h3>Why AWS Forces You to Choose a CIDR</h3><p>AWS needs CIDR blocks to:</p><ul><li>Assign private IPs to resources</li><li>Avoid IP conflicts</li><li>Control routing</li><li>Plan network capacity</li></ul><p>Without CIDR, AWS wouldn’t know <strong>how many resources you can run</strong> in your network.</p><h3>Private IP Ranges Allowed in AWS VPCs</h3><p>A VPC is a <strong>private network</strong>, not part of the public internet. Because of this, AWS only allows IP addresses that are reserved for <strong>private use</strong> (defined by RFC 1918).</p><ul><li>10.0.0.0/8→ first 8 bits fixed</li></ul><p><strong>Range: </strong>10.0.0.0 → 10.255.255.255</p><ul><li>172.16.0.0/12→ first 12 bits fixed</li></ul><p><strong>Range:</strong> 172.16.0.0 → 172.31.255.255</p><ul><li>192.168.0.0/16 → first 16 bits<strong> </strong>fixed</li></ul><p><strong>Range:</strong> 192.168.0.0 → 192.168.255.255</p><p>Any VPC CIDR block <strong>must fall within one of these ranges</strong>.</p><p>In practice, most AWS examples use:</p><pre>10.0.0.0/16</pre><p>because it provides a large address space and is easy to subnet.</p><h3>Choosing a VPC CIDR Block (IP Planning)</h3><p>Before creating subnets, always think ahead.</p><p>Ask yourself:</p><ul><li>How many environments will I have? (dev, test, prod)</li><li>Will I need VPC peering or VPNs later?</li><li>How many resources might I run?</li></ul><h4>Common Practice</h4><pre>VPC CIDR: 10.0.0.0/16</pre><p>Why?</p><ul><li>Plenty of IPs</li><li>Easy to subnet</li><li>Avoids future overlap issues</li></ul><p><strong>Important:</strong><br> You <strong>cannot change</strong> the primary CIDR block later without adding a secondary CIDR.</p><h3>What Is a Subnet?</h3><p>A <strong>subnet</strong> is a smaller network inside a VPC.</p><p>Key points:</p><ul><li>Every subnet <strong>belongs to one Availability Zone</strong></li><li>Subnets divide your VPC into logical sections</li><li>Resources (EC2, RDS) are launched inside subnets</li></ul><p>Example:</p><pre>VPC:     10.0.0.0/16<br>Subnet:  10.0.1.0/24</pre><h3>Why EC2 Always Needs a Subnet</h3><p>When you launch an EC2 instance:</p><ul><li>AWS assigns it a <strong>private IP</strong></li><li>That IP comes from a <strong>subnet</strong></li></ul><h3>Public vs Private Subnets</h3><p>AWS does not explicitly label a subnet as public or private. <strong>Routing decides behavior</strong>, not CIDR size.</p><h4>Public Subnet</h4><ul><li>Has a route to an <strong>Internet Gateway</strong></li></ul><p>Used for:</p><ul><li>Bastion hosts</li><li>Load balancers</li><li>Public-facing EC2 instances</li></ul><h4>Private Subnet</h4><ul><li>No direct route to the internet</li></ul><p>Used for:</p><ul><li>Application servers</li><li>Databases</li><li>Can access the internet via <strong>NAT Gateway</strong></li></ul><h3>Subnet Sizing (/24 Is Your Best Friend)</h3><p>A very common subnet size:</p><pre>/24 → 256 IP addresses</pre><p>But AWS reserves <strong>5 IPs per subnet</strong>:</p><ul><li>Network address</li><li>VPC router</li><li>DNS</li><li>Reserved future use</li><li>Broadcast address</li></ul><p>So usable IPs:</p><pre>256 - 5 = 251</pre><h3>Common CIDR Sizes</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/628/1*B7Iiev7JnKTRvpInOgRexw.png" /><figcaption>Table 01: CIDR sizes</figcaption></figure><h4>Example Subnet Design</h4><pre>VPC: 10.0.0.0/16</pre><pre>Public Subnets:<br>- 10.0.1.0/24 (AZ-a)<br>- 10.0.2.0/24 (AZ-b)</pre><pre>Private Subnets:<br>- 10.0.11.0/24 (AZ-a)<br>- 10.0.12.0/24 (AZ-b)</pre><p>This design is:</p><ul><li>Highly available</li><li>Easy to understand</li><li>Production-ready</li></ul><h3>Availability Zones and High Availability</h3><p>Best practice:</p><ul><li>Create <strong>at least one subnet per Availability Zone.</strong></li><li>Duplicate your subnet structure across Availability Zones.</li></ul><p>Why?</p><ul><li>If one Availability Zone fails, your application stays online</li></ul><h3>Common IP Planning Mistakes</h3><ul><li>Using very small CIDRs like /28 too early</li><li>Overlapping CIDRs between VPCs</li><li>Not planning for future VPC peering</li><li>Putting databases in public subnets</li><li>One subnet for everything</li></ul><h3>Best Practices</h3><ul><li>Start with a /16 VPC</li><li>Use /24 subnets</li><li>Separate public and private subnets</li><li>Design across multiple Availability Zones</li><li>Plan before clicking “Create VPC”</li></ul><p>The VPC CIDR defines your network’s capacity, subnets organize that capacity, and EC2 instances draw their private IP addresses from those subnets.</p><p>In the next article, we’ll shift focus to <strong>EC2 storage and explore gp3 volumes</strong>, including how to size and configure them for real workloads.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ea25db26b4b3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding AWS Security Groups: A Beginner’s Guide]]></title>
            <link>https://medium.com/@nuwanthidileka/understanding-aws-security-groups-a-beginners-guide-5fc31a28abfa?source=rss-690a7b757550------2</link>
            <guid isPermaLink="false">https://medium.com/p/5fc31a28abfa</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws-security-group]]></category>
            <category><![CDATA[aws-vpc]]></category>
            <dc:creator><![CDATA[Nuwanthi Rajapaksha]]></dc:creator>
            <pubDate>Tue, 06 Jan 2026 16:52:09 GMT</pubDate>
            <atom:updated>2026-01-07T15:33:51.254Z</atom:updated>
            <content:encoded><![CDATA[<p>We discussed Key Pairs in the first article, how these are helpful in establishing a secure connection to your AWS resource.</p><p>As soon as you begin to create instances, you will soon be asked questions like these:</p><blockquote><em>“Who can access my instance, and who can’t?”</em></blockquote><p>Specially, security groups deal with this. You can think of <strong>security groups</strong> as your EC2 instance’s <strong>firewall</strong>, which decides who can communicate with it, and on which ports.</p><h3>What Is a Security Group?</h3><p>So, a <strong>security group</strong> is kind of a <strong>traffic controller</strong> for your EC2 instances.</p><blockquote><em>“It determines whom it lets in, whom it excludes”</em></blockquote><p>It’s not just about the ports and IP addresses — it’s about s<strong>ecure access control</strong>. Any traffic <strong>not explicitly allowed</strong> is automatically denied, so your instance is protected by default.</p><h3>Where Are Security Groups Used?</h3><p>Security groups can be attached to:</p><ul><li>EC2 instances</li><li>Load balancers</li><li>RDS databases</li><li>VPC-enabled Lambda functions</li></ul><h3>How Security Groups Work</h3><p>Here’s what makes them easy to understand:</p><ul><li><strong>Allow rules only:</strong> Anything not allowed is automatically blocked.</li><li><strong>Stateful: </strong>When incoming traffic (inbound traffic) is permitted, the response automatically comes back without the need to define outbound rules for that response.</li></ul><p>This makes easier managing access than traditional firewalls.</p><h3>Inbound Rules (Incoming Traffic)</h3><p>Inbound rules specifies <strong>who can access your instance.</strong></p><p><strong>Example:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*b7Es_niTObaGP1SBtytfFQ.png" /><figcaption>Table 01: Example Inbound Rules</figcaption></figure><p>Only traffic satisfying these criteria is allowed to pass through.</p><h3>Outbound Rules (Outgoing Traffic)</h3><p>Outbound rules define <strong>where your instance is allowed to send traffic</strong>.</p><p>By default, all outbound traffic is allowed, which lets your instance:</p><ul><li>Download updates</li><li>Connect to APIs</li><li>Reach the internet (if routing allows)</li></ul><h3>A Quick Look at VPC</h3><p>A <strong>VPC (Virtual Private Cloud)</strong> is basically your own private network inside AWS. Even if you haven’t launched an instance yet, any security group you create will belong to a specific VPC, you can’t use it outside that network.</p><p>So when AWS asks you to select a VPC while creating a security group, it’s just making sure your firewall rules belong to the right network.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KHRbCoRqjlVAtmAQwYL8Ug.png" /><figcaption>Figure 01: Virtual Private Cloud</figcaption></figure><h3>Understanding CIDR in Security Groups</h3><p><strong>CIDR (Classless Inter-Domain Routing)</strong> is just a way to <strong>define ranges of IP addresses</strong>. In security groups, it tells AWS <strong>who is allowed to connect to your instance</strong>.</p><p>Here are a few practical examples you’ll see:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/787/1*BOF2enb4XtIMQkIR1TGCbA.png" /><figcaption>Table 02: CIDR examples</figcaption></figure><p>Basically, CIDR is how you <strong>filter traffic</strong> without touching your subnets or routing tables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ryac-RRbg9-YdHrkvCzW1Q.png" /><figcaption>Figure 02: CIDR</figcaption></figure><h3>Creating a Security Group</h3><p>Even before launching an instance, you can <strong>create security groups</strong> inside a VPC. Think of this as <strong>preparing your firewall rules</strong> in advance.</p><p>When creating a security group, you’ll:</p><ol><li>Pick the VPC it belongs to</li><li>Add inbound rules (who can reach it)</li><li>Add outbound rules (where it can send traffic)</li></ol><p>Once that’s done, <strong>any instance you attach it to later will follow those rules automatically</strong>.</p><h3>Security Group Referencing</h3><p>Normally, when you allow traffic in a security group, you specify <strong>IP addresses or ranges (CIDR)</strong>. For example, you might allow your laptop’s IP (x.x.x.x/32) to access your server on SSH port 22.</p><p>But what if you have multiple instances in your VPC, like a <strong>web server</strong>, an <strong>application server</strong>, and a <strong>database server</strong>? Instead of writing the IP of the web server every time, AWS lets you allow traffic <strong>from another security group</strong>. This is called <strong>Security Group Referencing</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d-GxGi6jOBWXtBEpKr0xhw.png" /><figcaption>Figure 03: Security Group Referencing</figcaption></figure><p><strong>Example:</strong></p><ul><li>You have an <strong>Application Security Group</strong> (App SG) for your app servers.</li><li>You have a <strong>Database Security Group</strong> (DB SG) for your database servers.</li><li>You want the database to only accept traffic from the app servers.</li></ul><p>Instead of using IP addresses, you <strong>set the source of DB SG to App SG</strong>. Then what happens:</p><ul><li>Any instance attached to App SG can access the database.</li><li>If you add more app instances later, they automatically get access, no need to change IP rules.</li></ul><p><strong>Why this is useful:</strong></p><ul><li>You <strong>don’t have to manage IP addresses manually</strong>.</li><li>It makes security rules <strong>dynamic and easier to scale</strong>.</li><li>It matches the <strong>tiered architecture</strong> of many applications: Web → App → DB.</li></ul><p>Think of security groups as your instance’s <strong>personal firewall</strong>. Even if you haven’t launched an EC2 instance yet, understanding them now will make everything easier later.</p><p>In the next article, we’ll dive into <strong>VPC CIDR blocks, subnets, and IP planning</strong>, which are the building blocks for designing networks in AWS.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5fc31a28abfa" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Key Pairs Explained for Beginners]]></title>
            <link>https://medium.com/@nuwanthidileka/aws-key-pairs-explained-for-beginners-52074fac132b?source=rss-690a7b757550------2</link>
            <guid isPermaLink="false">https://medium.com/p/52074fac132b</guid>
            <category><![CDATA[aws-key-pair]]></category>
            <category><![CDATA[aws-ec2]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nuwanthi Rajapaksha]]></dc:creator>
            <pubDate>Mon, 29 Dec 2025 08:31:29 GMT</pubDate>
            <atom:updated>2025-12-29T08:31:29.025Z</atom:updated>
            <content:encoded><![CDATA[<p>When I started learning AWS and launched my first EC2 instance, I was asked to select a <strong>key pair</strong>. At that point, I knew how to create one, but I didn’t fully understand <strong>what it actually does, why it is required, or how different options work</strong>.</p><p>This article explains AWS key pairs in a simple way, based on what I’ve learned so far. This is the <strong>first article in a series</strong> where I document my AWS learning journey. I welcome feedback, corrections, and recommendations so I can improve both my understanding and future articles.</p><h3>1. What Is an AWS Key Pair?</h3><p>An <strong>AWS key pair</strong> is a set of cryptographic keys that AWS uses to <strong>securely connect to an EC2 instance</strong>.</p><p>A key pair contains</p><ul><li>a public key</li><li>a private key</li></ul><p>Instead of using a username and password, AWS uses key pairs to make EC2 access <strong>more secure.</strong></p><h3>2. Public Key vs Private Key</h3><p><strong>Public Key</strong></p><ul><li>Stored <strong>inside the EC2 instance</strong></li><li>Added automatically during instance launch</li><li>Used to verify incoming connections</li></ul><p><strong>Private Key</strong></p><ul><li>Downloaded by <strong>you only once</strong></li><li>Stored on your local machine</li><li>Used when you connect to EC2 using SSH</li></ul><p>AWS <strong>never stores the private key</strong>.</p><h3>3. Supported Key Pair Types and Requirements</h3><p>AWS supports different key pair types depending on the <strong>operating system</strong> of the EC2 instance.</p><ul><li><strong>RSA Key Pair</strong></li></ul><p><strong>RSA</strong> stands for <strong>Rivest–Shamir–Adleman. RSA </strong>is a type of public-key cryptography algorithm that is used to send secret messages and verify identities online using a pair of special digital “keys”.</p><p>Supported on <strong>Linux and Windows</strong> EC2 instances.</p><ul><li><strong>Ed25519 Key Pair</strong></li></ul><p>Ed25519 is a modern and efficient type of digital signature scheme based on Elliptic Curve Cryptography (ECC). Ed25519 is a fast, and secure way to create digital signatures and handle authentication online, often considered an improvement over older methods like RSA in terms of efficiency and security.</p><p>Supported on <strong>Linux EC2 instances only.</strong></p><h3>4. Private Key File Formats</h3><p>When creating a key pair, AWS also asks for a <strong>private key file format</strong>. There are two formats as <strong>.pem </strong>and <strong>.ppk</strong></p><p><strong>.pem</strong></p><ul><li>Default AWS format</li><li>Used on <strong>Linux and macOS</strong></li><li>Works with OpenSSH</li></ul><p><strong>.ppk</strong></p><ul><li>Used mainly on <strong>Windows</strong></li><li>Required for PuTTY SSH client</li><li>Not directly compatible with OpenSSH</li></ul><p>If you download a .pem file but use PuTTY, you must convert it to .ppk using <strong>PuTTYgen</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YDztx1tp6RsyJ9pcYJpOdw.png" /><figcaption>fig 1: choosing the right private key format</figcaption></figure><h3>5. Key Pairs Are Region-Specific</h3><p>AWS key pairs are <strong>region-specific</strong>.</p><p>This means:</p><ul><li>A key pair created in one region cannot be used in another region</li><li>A key pair created in us-east-1 will not appear in ap-south-1</li></ul><p>This often causes confusion when launching EC2 instances.</p><h3>6. How Key Pairs Are Used During EC2 Launch</h3><p>When you launch an EC2 instance:</p><ol><li>You select or create a key pair</li><li>AWS copies the <strong>public key</strong> to the instance</li><li>The instance is configured to allow login only with the matching private key</li></ol><p>When you later connect:</p><ol><li>Your client proves identity using the private key</li><li>EC2 verifies it using the public key</li><li>Access is granted if they match</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GGWucnJhVszDprVigGZ4eQ.png" /><figcaption>fig 2: How AWS key pairs authenticate an EC2 connection</figcaption></figure><h3>7. Key Pairs Alone Are Not Enough</h3><p>Even with the correct key pair:</p><ul><li>You <strong>cannot connect</strong> to EC2 if the security group does not allow access</li></ul><p>For example:</p><ul><li>SSH requires <strong>port 22</strong> to be allowed</li></ul><p>I’ll cover security groups in the next article.</p><p><strong>This article reflects my understanding while learning AWS. If you have suggestions or notice anything that can be improved, I’d really appreciate your feedback.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=52074fac132b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[REST-Assured for Beginners — Part 1]]></title>
            <link>https://medium.com/@nuwanthidileka/rest-assured-for-beginners-part-1-4010eb006438?source=rss-690a7b757550------2</link>
            <guid isPermaLink="false">https://medium.com/p/4010eb006438</guid>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[api-test-automation]]></category>
            <category><![CDATA[restassured]]></category>
            <dc:creator><![CDATA[Nuwanthi Rajapaksha]]></dc:creator>
            <pubDate>Sat, 23 Nov 2024 06:34:11 GMT</pubDate>
            <atom:updated>2024-11-23T06:35:52.322Z</atom:updated>
            <content:encoded><![CDATA[<h3>REST-Assured for Beginners — Part 1</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/602/1*LIgR-vX9w_zap3Us_91mDA.jpeg" /><figcaption>Fig 01 : Rest Assured Flowchart: Original image from<a href="https://www.jadeglobal.com/sites/default/files/inline-images/rest-assured-flowchart.jpg"> Jade Global</a></figcaption></figure><p>This article is for beginners who want to start with <strong>REST-Assured</strong>, a Java-based library for automating REST APIs. It enables developers to create highly customizable HTTP requests to test a wide range of RESTful operations while validating server responses. For example, you can verify status codes, headers, cookies, and even the response body.</p><p>This first article in the series focuses on writing test cases for basic CRUD (Create, Read, Update, Delete) operations.</p><h3>Why Use REST-Assured?</h3><p>APIs are the backbone of modern applications, and testing them ensures reliability and quality. Here’s why you should consider using <strong>REST-Assured</strong>:</p><ul><li>Simple and intuitive <strong>Behavior-Driven Development (BDD)</strong> syntax.</li><li>Built-in support for validating JSON and XML.</li><li>Easy integration with testing frameworks like <strong>TestNG</strong> and <strong>JUnit</strong>.</li><li>Extensive capabilities for request and response validation.</li></ul><h3>Prerequisites</h3><p>Before starting, make sure you have the following:</p><ul><li><strong>Java 9+</strong>: Required to run REST-Assured. <a href="https://www.oracle.com/java/technologies/downloads/">Download here</a></li><li><strong>Eclipse IDE</strong>: Recommended for development. <a href="https://www.eclipse.org/downloads/packages/release/2022-06/r/eclipse-ide-java-developers">Download here</a></li><li><strong>TestNG</strong>: Add via the Eclipse marketplace.</li><li><strong>Maven</strong>: Comes with Eclipse, used for dependency management.</li></ul><p>Instead of creating a regular Java project, we’ll create a Maven project. This allows us to easily manage dependencies through the pom.xml file.</p><h3>Setting Up the Maven Project</h3><ol><li>Create a Maven project with the following required fields:</li></ol><ul><li><strong>GroupId</strong>: Represents your project name.</li><li><strong>ArtifactId</strong>: Root package name.</li></ul><p>2. Add the required dependencies in pom.xml: These are the dependencies that need to be added: <strong>Rest-assured</strong>, <strong>Json-path</strong>, <strong>Json</strong>, <strong>gson</strong>, <strong>Testing</strong>, <strong>Scribejava-api</strong> , <strong>Json-schema-validator</strong>, and <strong>XML-schema-validator</strong>.</p><p>You can find and add these dependencies from the <a href="https://mvnrepository.com/">Maven Repository</a>.</p><pre>&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot; xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;<br>  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;<br>  &lt;groupId&gt;RestAssuredTraining1&lt;/groupId&gt;<br>  &lt;artifactId&gt;RestAssuredTraining1&lt;/artifactId&gt;<br>  &lt;version&gt;0.0.1-SNAPSHOT&lt;/version&gt;<br>  &lt;dependencies&gt;<br>  &lt;dependency&gt;<br>    &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;<br>    &lt;artifactId&gt;rest-assured&lt;/artifactId&gt;<br>    &lt;version&gt;5.1.1&lt;/version&gt;<br>    &lt;scope&gt;test&lt;/scope&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;<br>    &lt;artifactId&gt;json-path&lt;/artifactId&gt;<br>    &lt;version&gt;5.1.1&lt;/version&gt;<br>    &lt;scope&gt;test&lt;/scope&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;org.json&lt;/groupId&gt;<br>    &lt;artifactId&gt;json&lt;/artifactId&gt;<br>    &lt;version&gt;20220320&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;com.google.code.gson&lt;/groupId&gt;<br>    &lt;artifactId&gt;gson&lt;/artifactId&gt;<br>    &lt;version&gt;2.10.1&lt;/version&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;org.testng&lt;/groupId&gt;<br>    &lt;artifactId&gt;testng&lt;/artifactId&gt;<br>    &lt;version&gt;7.8.0&lt;/version&gt;<br>    &lt;scope&gt;test&lt;/scope&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;com.github.scribejava&lt;/groupId&gt;<br>    &lt;artifactId&gt;scribejava-apis&lt;/artifactId&gt;<br>    &lt;version&gt;8.3.1&lt;/version&gt;<br>    &lt;scope&gt;runtime&lt;/scope&gt;<br>&lt;/dependency&gt;<br>&lt;dependency&gt;<br>    &lt;groupId&gt;io.rest-assured&lt;/groupId&gt;<br>    &lt;artifactId&gt;json-schema-validator&lt;/artifactId&gt;<br>    &lt;version&gt;5.4.0&lt;/version&gt;<br>&lt;/dependency&gt;<br> <br>  &lt;/dependencies&gt;<br>&lt;/project&gt;</pre><p>3. Add these static imports to your test classes: You can refer to the <a href="https://github.com/rest-assured/rest-assured/wiki/GettingStarted">Getting Started guide</a> for more details.</p><pre>import static io.restassured.RestAssured.*;<br>import static io.restassured.matcher.RestAssuredMatchers.*;<br>import static org.hamcrest.Matchers.*;</pre><h3>Writing Test Cases for CRUD Operations</h3><p>REST-Assured follows a <strong>BDD style</strong>, where:</p><ul><li><strong>given()</strong>: Defines the prerequisites for the request, such as headers, cookies, authentication, content type, etc.</li><li><strong>when()</strong>: Specifies the HTTP method (GET, POST, PUT, DELETE).</li><li><strong>then()</strong>: Contains response validations.</li></ul><h4>1. Get Users</h4><p>Retrieve users from page 2 and validate the response.</p><pre>@Test<br>void getUsers() { <br>    given()<br>    .when()<br>        .get(&quot;https://reqres.in/api/users?page=2&quot;)<br>    .then()<br>        .statusCode(200) // Verify status code<br>        .body(&quot;page&quot;, equalTo(2)) // Validate page number<br>        .log().all(); // Log the entire response<br>}</pre><h4>1. Create User</h4><p>To create a user, we need to pass data in the request body. Here, a HashMap is used to store the data as key-value pairs, which are then converted into JSON format. This JSON data is sent as part of the POST request. Using a HashMap is one of the simplest ways to structure data, and in future articles, we will explore other methods for generating the request body.</p><pre>@Test<br>void createUser() {<br>    HashMap&lt;String, String&gt; hm = new HashMap&lt;&gt;();<br>    hm.put(&quot;name&quot;, &quot;Jane&quot;);<br>    hm.put(&quot;job&quot;, &quot;Trainee&quot;);<br><br>    given()<br>        .contentType(&quot;application/json&quot;) // Specify content type<br>        .body(hm) // Send data as body<br>    .when()<br>        .post(&quot;https://reqres.in/api/users&quot;)<br>    .then()<br>        .statusCode(201) // Verify status code<br>        .log().all(); // Log the response<br>}</pre><h4>3. Update User</h4><p>To update a user, we first need to capture the dynamically generated id of the created user. This is achieved using jsonPath the <strong>createUser</strong> test, which stores the generated id in a global variable. This id is then used in the <strong>updateUser</strong> test to specify which user to update.</p><p>Additionally, to ensure the tests run in sequence, the <strong>updateUser</strong> test is set to depend on the <strong>createUser</strong> test using dependsOnMethods. The dependsOnMethodsensures that certain tests run only after others have been successfully completed. The execution order is further managed by assigning priorities to the tests using priority.</p><p>The <strong>updateUser</strong> test validates the response using a status code of 200, ensuring that the update operation is successful.</p><pre>int id;<br><br>@Test(priority = 1)<br>void createUser() {<br>    HashMap&lt;String, String&gt; hm = new HashMap&lt;&gt;();<br>    hm.put(&quot;name&quot;, &quot;Jane&quot;);<br>    hm.put(&quot;job&quot;, &quot;Trainee&quot;);<br><br>    id = given()<br>            .contentType(&quot;application/json&quot;)<br>            .body(hm)<br>        .when()<br>            .post(&quot;https://reqres.in/api/users&quot;)<br>            .jsonPath().getInt(&quot;id&quot;); // Capture and store the generated ID<br>}</pre><pre>@Test(priority = 2, dependsOnMethods = &quot;createUser&quot;)<br>void updateUser() {<br>    HashMap&lt;String, String&gt; hm = new HashMap&lt;&gt;();<br>    hm.put(&quot;name&quot;, &quot;Jane Maria&quot;);<br>    hm.put(&quot;job&quot;, &quot;Management Trainee&quot;);<br><br>    given()<br>        .contentType(&quot;application/json&quot;)<br>        .body(hm)<br>    .when()<br>        .put(&quot;https://reqres.in/api/users/&quot; + id) // Use the captured ID<br>    .then()<br>        .statusCode(200) // Verify that the update is successful<br>        .log().all();<br>}</pre><h4>4. Delete Users</h4><p>In the ‘Delete Users’ test, we use the captured ID to send a DELETE request and validate that the user is successfully deleted.</p><pre>@Test(priority = 3)<br>void deleteUser() {<br>    given()<br>    .when()<br>        .delete(&quot;https://reqres.in/api/users/&quot; + id)<br>    .then()<br>        .statusCode(204) // Verify deletion<br>        .log().all();<br>}</pre><p>This article covered the basics of using REST-Assured to write CRUD operation test cases. By leveraging its BDD syntax, you can easily validate both requests and responses. In the next article, we’ll explore different ways to generate the request body other than the HashMap.</p><p><strong>Have you tried testing APIs with REST-Assured? Share your experience or suggestions for improvements in the comments below!</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4010eb006438" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Image Interpolation]]></title>
            <link>https://medium.com/@nuwanthidileka/image-interpolation-5e4cbe90603a?source=rss-690a7b757550------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e4cbe90603a</guid>
            <category><![CDATA[interpolation]]></category>
            <category><![CDATA[digital-image-processing]]></category>
            <dc:creator><![CDATA[Nuwanthi Rajapaksha]]></dc:creator>
            <pubDate>Sat, 06 Aug 2022 13:56:11 GMT</pubDate>
            <atom:updated>2022-08-06T14:03:22.466Z</atom:updated>
            <content:encoded><![CDATA[<p>Through this article, I’m going to discuss a few interpolation techniques. Before moving to interpolation techniques let’s see what is interpolation first and why interpolation is used.</p><p><strong>Interpolation is the process of using known data to estimate values at unknown locations</strong>. This works in two directions and tries to achieve the best approximation of a pixel’s intensity based on the values of surrounding pixels. As it’s an approximation method image will always lose some quality when interpolated.</p><p><strong>Image interpolation occurs especially when an image is resized or distorted(remapped) from a one-pixel grid to another.</strong></p><p>There are plenty of interpolation techniques. Interpolation algorithms can be grouped into two categories.</p><ol><li>Adaptive</li><li>Non -adaptive</li></ol><p>Adaptive methods change depending on what they are interpolating (sharp edges vs smooth texture) while non-adaptive methods treat all pixel values equally.</p><p>This article is mainly focused on non-adaptive methods. Out of the non-adaptive methods also I’m going to discuss</p><p>1. Nearest neighbor Interpolation</p><p>2. Bilinear Interpolation</p><p>3. Bicubic Interpolation</p><p><strong>Nearest Neighbor Interpolation</strong></p><p>This is the most basic form of interpolation. The nearest Neighbor algorithm only considers one pixel, the closest one to the interpolated point. This requires the least processing time of all the interpolation algorithms. And has the effect of simply making each pixel bigger.</p><p><strong>Bilinear Interpolation</strong></p><p>Considers the closest 2x2 neighborhood of known pixel values (total 4 pixels) surrounding the unknown pixel and then takes the weighted average of these values to assign the unknown pixel.</p><p>This will create smoother-looking images than the nearest neighbor and needs more processing time.</p><p><strong>Bicubic Interpolation</strong></p><p>Bicubic Interpolation Considers the closest 4x4 neighborhood of known pixel values (total of 16 pixels) surrounding the unknown pixels. Since the known pixels are at various distances from the unknown pixel, closer pixels will give higher weighting.</p><p>This produces noticeably sharper images than the nearest neighbor and bilinear interpolations. Bicubic interpolation is an ideal combination of processing time and output quality.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*-vlt5kAM2YMTKqBz3ZH6KA.png" /><figcaption>Fig. 1 Visual comparison of different interpolation methods. (a) Nearest-neighbor. (b) Bilinear. ( c )Bicubic. (d) Original HR image (4x) from <a href="https://www.researchgate.net/figure/sual-comparison-of-different-interpolation-methods-a-Nearest-neighbor-b-Bilinear_fig2_287419933">ResearchGate</a></figcaption></figure><p>If you have any suggestions for improvements, <a href="http://www.linkedin.com/in/nuwanthirajapaksha">let me know!</a></p><p><strong>References</strong></p><p>Digital Image Processing FOURTH EDITION Rafael C. Gonzalez • Richard E. Woods</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e4cbe90603a" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Git and GitHub for Beginners.]]></title>
            <link>https://medium.com/geekculture/git-and-github-for-beginners-15dc8a8b385d?source=rss-690a7b757550------2</link>
            <guid isPermaLink="false">https://medium.com/p/15dc8a8b385d</guid>
            <category><![CDATA[git-commands]]></category>
            <category><![CDATA[version-control]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[open-source]]></category>
            <category><![CDATA[git]]></category>
            <dc:creator><![CDATA[Nuwanthi Rajapaksha]]></dc:creator>
            <pubDate>Mon, 16 Aug 2021 08:25:06 GMT</pubDate>
            <atom:updated>2021-08-18T06:23:14.295Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/934/1*THIFVN_-7EppNHieVv62Rw.png" /></figure><p>This article is for beginners who are going to start with Git and GitHub. Through this article, first I’m going to discuss what is Git and GitHub and then I’m moving towards the basic commands you have to know while using Git.</p><p>Git is a free, open-source <strong>distributed version control system</strong> that means a software tool that helps the software teams to work collaboratively on big software projects by managing the source code over time. Version control systems keep track of the source code in a special database called a repository in a structured way. Without a version control system, it is difficult to keep the track of the changes made to the project and to know who made those changes. You have to keep separate files as final, latest and in the end, you have to deal with a new final version. For software teams, the version control system makes it easier to keep of track the changes made by the fellow team members without emailing the updates and collaborate effectively on the project.</p><p>You can use a command-line, a graphical user interface, code editor, or an IDE to make git work. Throughout this article, we are going to discuss Git using a command line.</p><p><strong>What is GitHub?</strong></p><p>GitHub is a hosting service that can be used to integrate with Git. There are many other solutions for GitHub. The most popular alternatives are <strong>GitLab</strong> and <strong>Bitbucket</strong>. So you do not need GitHub to use Git, but you cannot use GitHub without Git. GitHub is helpful when more than one person is working on a project letting them to built a centralized repository where everyone can manage, edit and upload code files avoiding all the confusion in an organized, easy manner.</p><h3>Getting started with git and GitHub:</h3><p><strong>Install Git and create a GitHub account</strong></p><p>First, you’ll have to install Git and create a GitHub account. You can <a href="https://git-scm.com/downloads">click here</a> to install Git. Once you’ve done with that, create a GitHub account <a href="https://github.com/">here</a>.</p><p><strong>Configuring git</strong></p><p>Then you have to configure your username and email address in your Git Bash terminal. You can use the following command to configure your username.</p><p>git config — — global user.name “Username”</p><p>You can configure the email address by the following command.</p><p>git config — — global user .email “ Your email ”</p><p><strong>Create a local git repository (project)</strong></p><p>First, you have to create a folder where you want to store all your project files and open it with Git Bash.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*NPr_9XeMGB7l9VYuB8obAA.png" /></figure><p><strong>Initializing git repository</strong></p><p>Next, you have to initialize the git repository. For that, you can use the <strong>git init</strong> command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/839/1*Q409jVSZ43NTAPZXtV1d9Q.png" /></figure><p><strong>Add new files to the repository</strong></p><p>You can use the <strong>touch</strong> command to add new files to the repository. Here I have added two files as file1.txt and file2.txt ( or else you can create these files manually )</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bjk7-qHI5X50YDylNBe_Bg.png" /></figure><p>Then you can use the <strong>git status</strong> command to find out which files’ existence is known by git. As these files are not added to the index (staging area) yet. Here we can see two untracked files. Without instructing git to track them git won’t track those files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/806/1*Kf8CI1gr4StiOXelBxksdw.png" /></figure><p><strong>Add files to the staging environment</strong></p><p>You can use the <strong>git add</strong> command to add files to the staging area.</p><p><strong>git add -A</strong> command will add all existing files to the staging area. You can use <strong>git add “&lt;filename&gt; ”</strong> to add files separately to the staging area.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3zaS8ad0aASKHugTVgxDpQ.png" /></figure><p>After adding the files to the staging area you can check the <strong>git status</strong> again. Then you can see all the existing files are added to the index and ready to be committed.</p><p><strong>Create Commit</strong></p><p>Commit means recording snapshots of a repository at a given time. You can use the following commands to do a commit.</p><p><strong>git commit</strong></p><p>This will launch the default text editor to commit the message and committed snapshots will get staged.</p><p><strong>git commit –m “&lt;message&gt;”</strong></p><p>With this command, you can directly commit the changes with the commit message. You can see the <strong>git commit</strong> command has committed changes to the local repository. The commit message should be a clear explanation of your changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jMxm52FDxZhtmPfm0n06QQ.png" /></figure><p><strong>Create a branch</strong></p><p>If you need to add a new feature to the main project you can use a branch to develop the new feature without making changes to the main project. Every Git repository’s first branch is master by default.</p><p>You can use the following command to create a branch.</p><p><strong>git branch &lt;branch&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9oS0LHP_QBiY5MYVbkHgyA.png" /></figure><p>And to move inside to the newly created branch you can use the <strong>git checkout</strong> command.</p><p><strong>git checkout &lt;branch&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nw6qLOoFug9hTzftO5eIrQ.png" /></figure><p>You can use the <strong>git checkout –b &lt;branch&gt;</strong> command to create a branch and check out the new branch at the same time.</p><p>I have created a file3.txt file and commit it to the newly created branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NQjLKx_KSczTIV-0IJilsg.png" /></figure><p><strong>Merge branch</strong></p><p>Merging is used to combine the work of different branches.</p><p>You can use the merge command to merge the newly created branches to the master branch. When merging make sure to check out in the destination branch.</p><p>My destination branch is the master branch. So first I have to checkout into the master branch and then merge the new branch with the merge command.</p><p><strong>git merge &lt;branch&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lGAPBzXO1rA39lmqYUC2ww.png" /></figure><p>Now the changes you made for the new branch are merged with the master branch.</p><p><strong>Pull the changes from GitHub to the local repository</strong></p><p>Pulling is done from the remote GitHub repository to the local repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1001/1*QZmcjewn2SjfkowBGVij0Q.png" /></figure><p>After creating the remote repository then you have to copy the URL of the remote repository and add it with the <strong>git remote add origin &lt;URL&gt;</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*kWgNrmZ0uVQuPKg0RsJYMw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TYJYBNmTopw-Sj2rhUsjtQ.png" /></figure><p>In this command, you are adding the remote repository, with the URL as an origin to your local git repository.</p><p>Always pull the changes before the push. This will ensure that your local copy is in sync with the remote repository. As other members of the team are pushing to the remote copy, and if you push before syncing up, you could end up with merge conflicts when you push.</p><p>To get the changes made on the central repository of GitHub to the local repository you can use the <strong>git pull origin master</strong> command.</p><p><strong>Push Local Repository to GitHub</strong></p><p>This command is used to transfer commits made from your local repository to your remote repository.</p><p>As I have already merged changes to the master branch now I can use the <strong>git push origin master</strong> to add my files in the master branch to the central repository.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KUGrTZEDPDqRjPwKR4Nx-g.png" /></figure><p>You can also merge the branch you are working on to the master branch after pushing the branch to GitHub. Let’s assume I’m working on a branch called newProject2</p><p>I have used the command <strong>git push origin newProject2</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rU_d1FPbfT3Donhv7y3CYQ.png" /></figure><p>When you refresh the GitHub page you can see a notification saying that newProject2 had recent pushes. Then you have to create a pull request to alert the repository owners to merge the changes in your branch to the master branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fVJ4LqZe7ptremqCtdah2A.png" /></figure><p>Then you will see a button at the bottom that says ‘Merge pull request’. By clicking that you can merge your changes into the master branch.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Gfjtp3U7WFMFQ0gcfGD5zw.png" /></figure><p>After the merge is completed it will give you a message “Pull request successfully merged.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDc-rNaEwIeTwU2h-Gvt2Q.png" /></figure><p>After merging the branch it is better to delete the branch as too many branches will create a mess.</p><p>These are the most common, basic commands you will come across when you are dealing with Git and GitHub projects. I hope this article will be helpful for beginners to get a basic idea about Git commands.</p><p><a href="https://www.atlassian.com/git/glossary">for more Git commands!</a></p><p>If you have any suggestions for improvements, <a href="http://www.linkedin.com/in/nuwanthirajapaksha">let me know!</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=15dc8a8b385d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/geekculture/git-and-github-for-beginners-15dc8a8b385d">Git and GitHub for Beginners.</a> was originally published in <a href="https://medium.com/geekculture">Geek Culture</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>