<?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 LibenHailu on Medium]]></title>
        <description><![CDATA[Stories by LibenHailu on Medium]]></description>
        <link>https://medium.com/@TechMarauder?source=rss-6b31ab51f87e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*aJxJaT6JQfpfUae3c0klBw.jpeg</url>
            <title>Stories by LibenHailu on Medium</title>
            <link>https://medium.com/@TechMarauder?source=rss-6b31ab51f87e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 04:58:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@TechMarauder/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[Cloud Computing Fundamentals in Google Cloud: Architecture, Security, and Governance]]></title>
            <link>https://medium.com/@TechMarauder/cloud-computing-fundamentals-in-google-cloud-architecture-security-and-governance-a171b3ec9a7d?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a171b3ec9a7d</guid>
            <category><![CDATA[google-cloud-platform]]></category>
            <category><![CDATA[google-cloud]]></category>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Fri, 02 Oct 2026 11:16:46 GMT</pubDate>
            <atom:updated>2026-10-02T11:16:46.987Z</atom:updated>
            <content:encoded><![CDATA[<p>In a world where data is being created every second, we need efficient ways to <strong>store, process, and retrieve data</strong>.</p><p>But before we talk about cloud computing, let’s take a step back in time and see how organizations managed their infrastructure before the cloud era.</p><p>Before cloud computing, organizations typically stored their data and ran their applications on <strong>physical infrastructure</strong>, commonly referred to as <strong>on-premises infrastructure</strong>.</p><p>This infrastructure could be located in a company-owned <strong>data center</strong> or even within the organization’s office.</p><p>The organization was responsible for managing everything — from <strong>compute and networking to storage, security, maintenance, and hardware upgrades</strong>.</p><p>For example, if a company needed more computing power, it would have to purchase additional physical servers, install them in its data center, configure them, and maintain them.</p><p>While this approach gave organizations direct control over their infrastructure, it also came with significant costs and operational challenges.</p><p><strong>Today, many of these computing resources are hosted by Cloud Service Providers (CSPs)</strong> and made available <strong>on demand</strong>, typically using a <strong>metered, pay-as-you-go pricing model</strong>. Instead of purchasing and maintaining physical servers themselves, organizations can rent computing, storage, networking, and other resources from a CSP.</p><p>But where are these resources actually located?</p><p>Cloud Service Providers operate <strong>massive data centers</strong> around the world.</p><p>A <strong>data center</strong> is a physical facility that houses servers, storage systems, networking equipment, and other components required to run applications and store data.</p><p>These data centers are connected to each other through <strong>high-speed networks</strong>, allowing cloud providers to deliver services across different locations while providing redundancy and reliability.</p><p>To organize this infrastructure geographically, cloud providers use concepts such as <strong>regions</strong> and <strong>availability zones</strong>.</p><ul><li><strong>Availability Zone (AZ)</strong> — A physically separate location within a cloud region. An AZ typically consists of one or more data centers with independent power, networking, and other infrastructure.</li><li><strong>Region</strong> — A geographic area that contains multiple Availability Zones.</li></ul><p>For example, an AWS Region such as <strong>us-east-1 (N. Virginia)</strong> contains multiple Availability Zones. Applications can be deployed across multiple AZs to improve availability and resilience.</p><p>So, in simple terms:</p><p><strong>Data Center → Availability Zone → Region</strong></p><p>This physical infrastructure is what ultimately powers the cloud services we interact with every day.</p><p>In Google Cloud, infrastructure is organized into <strong>regions and zones</strong>, and these locations can serve as different <strong>failure domains</strong>.</p><p>A <strong>failure domain</strong> is a set of resources that can fail together due to a common underlying issue. Designing an application across multiple failure domains helps reduce the impact of a failure.</p><p>For example, if an application is deployed across multiple zones, a failure affecting one zone does not necessarily make the entire application unavailable.</p><p>This leads us to an important concept: <strong>resiliency</strong>.</p><p><strong>Resiliency</strong> is the ability of a system to prepare for, withstand, respond to, and recover from disruptions while continuing to provide its intended service.</p><p>One common way to improve resiliency is through <strong>redundancy</strong>.</p><p><strong>Redundancy</strong> is the practice of maintaining multiple copies or instances of resources in different locations so that the failure of one does not cause the entire system to fail.</p><p>For example, data can be replicated across multiple locations. If one location becomes unavailable, another copy can still be used.</p><p>In simple terms:</p><p><strong>Redundancy helps eliminate single points of failure and improves availability.</strong></p><p>Another important concept in distributed systems is <strong>latency</strong>.</p><p><strong>Latency</strong> is the amount of time it takes for data or a request to travel from one location to another and for the corresponding response to return.</p><p>Generally, the farther apart two systems are, the greater the network latency can be. This is one reason why choosing an appropriate cloud region can be important when designing an application.</p><h3>Cloud Deployment Models</h3><p>Cloud providers deliver infrastructure and services through different <strong>deployment models</strong>.</p><p>The three commonly discussed deployment models are:</p><ul><li><strong>Public Cloud</strong></li><li><strong>Private Cloud</strong></li><li><strong>Hybrid Cloud</strong></li></ul><h3>Public Cloud</h3><p>A <strong>public cloud</strong> is a cloud model in which computing, storage, networking, and other resources are provided by a cloud service provider over a network, typically the internet.</p><p>These resources can be provisioned on demand, allowing organizations to avoid purchasing and maintaining all of the underlying physical infrastructure themselves.</p><p>Public cloud infrastructure commonly uses a <strong>multi-tenant environment</strong>, where the underlying physical infrastructure is shared among multiple customers while logical and security boundaries keep their resources isolated.</p><p>A <strong>multi-tenant environment</strong> is an environment in which multiple customers share underlying infrastructure and resources provided by the same cloud service provider.</p><p>For example, two different companies might run their applications on the same physical server infrastructure while their data, applications, and permissions remain logically isolated from each other.</p><h3>Private Cloud</h3><p>A <strong>private cloud</strong> is a cloud computing model in which the infrastructure and resources are dedicated to a <strong>single organization</strong>.</p><p>The infrastructure can be hosted <strong>on-premises</strong> in an organization’s own data center or operated by a third-party provider.</p><p>Unlike a public cloud, where the underlying infrastructure is shared among multiple customers, a private cloud provides a <strong>single-tenant environment</strong>.</p><p>In a single-tenant environment, the infrastructure is dedicated to one organization rather than being shared among multiple customers.</p><h3>Hybrid Cloud</h3><p>A <strong>hybrid cloud</strong> combines <strong>private and public cloud environments</strong>, allowing organizations to use both models based on their requirements.</p><p>For example, an organization might keep sensitive workloads in its private infrastructure while using public cloud services for applications that require additional scalability.</p><p>This allows organizations to combine the <strong>control and customization of private infrastructure</strong> with the <strong>scalability and flexibility of public cloud services</strong>.</p><h3>Multicloud</h3><p><strong>Multicloud</strong> is a strategy in which an organization uses services from <strong>more than one cloud service provider</strong>.</p><p>For example, an organization might use AWS for computing, Google Cloud for data analytics, and Microsoft Azure for other workloads.</p><p>Multicloud is different from hybrid cloud:</p><ul><li><strong>Hybrid cloud</strong> → combines private and public cloud environments.</li><li><strong>Multicloud</strong> → uses multiple cloud providers.</li></ul><p>An organization can use <strong>both strategies at the same time</strong>.</p><h3>Virtualization</h3><p><strong>Virtualization is one of the foundational technologies behind modern cloud computing.</strong></p><p>Virtualization is a technology that creates <strong>virtual versions of physical computing resources</strong>, such as servers, storage, and networking resources.</p><p>One of the most common examples is a <strong>Virtual Machine (VM)</strong>.</p><p>A VM is a software-based computer that behaves like a physical computer. It can have its own operating system, such as <strong>Linux or Windows</strong>, applications, files, and virtual hardware.</p><p>However, the VM does not have its own physical CPU, memory, or storage. Instead, it uses resources provided by the underlying physical machine.</p><p>For example, a physical server with 64 GB of RAM and 16 CPU cores could run multiple VMs. The available physical resources can be allocated among those VMs according to their requirements.</p><h3>Hypervisor</h3><p>Virtualization uses a <strong>hypervisor</strong> to manage the relationship between the physical hardware and virtual machines.</p><p>A <strong>hypervisor</strong> is a software or firmware layer that creates and manages virtual machines while allocating physical resources such as CPU, memory, storage, and networking to them.</p><p>There are two main types of hypervisors:</p><h3>Type 1 — Bare-Metal Hypervisor</h3><p>A <strong>Type 1 hypervisor</strong>, also known as a <strong>bare-metal hypervisor</strong>, runs directly on the physical hardware rather than on top of a conventional host operating system.</p><p>Because it interacts directly with the underlying hardware, it generally provides efficient resource management and is commonly used in servers and data centers.</p><p>Examples include <strong>VMware ESXi, Microsoft Hyper-V, and Xen</strong>.</p><h3>Type 2 — Hosted Hypervisor</h3><p>A <strong>Type 2 hypervisor</strong>, also known as a <strong>hosted hypervisor</strong>, runs as an application on top of an existing operating system.</p><p>For example, you can install VirtualBox on Windows or Linux and then create virtual machines inside it.</p><p>The architecture looks like this:</p><p><strong>Type 1:</strong></p><p>Physical Hardware → Hypervisor → Virtual Machines</p><p><strong>Type 2:</strong></p><p>Physical Hardware → Host OS → Hypervisor → Virtual Machines</p><p>The hypervisor manages and allocates physical resources among the VMs while keeping the virtual machines logically isolated from one another.</p><h3>Cloud Data Storage</h3><p><strong>Cloud storage</strong> is a service that allows organizations and individuals to store, access, and manage digital data using storage infrastructure operated by a cloud service provider.</p><p>Instead of purchasing and maintaining their own physical storage infrastructure, organizations can use storage resources provided by a CSP.</p><p>Depending on the service, the cloud provider can be responsible for infrastructure maintenance, durability, replication, and availability.</p><p>This allows organizations to focus more on their applications and data rather than managing the underlying physical storage infrastructure.</p><h3>Benefits of Cloud Data Storage</h3><p>Cloud data storage provides several benefits to organizations:</p><ul><li><strong>Scalability</strong> — Storage capacity can be increased or decreased based on demand without purchasing additional physical hardware.</li><li><strong>Redundancy</strong> — Data can be replicated across different systems or locations to reduce the impact of hardware or infrastructure failures.</li><li><strong>Cost Savings</strong> — Organizations can avoid large upfront investments in physical storage infrastructure and typically pay for the resources they use.</li><li><strong>Security</strong> — Cloud providers offer security capabilities such as encryption, access controls, monitoring, and identity management. However, customers are still responsible for configuring and using these controls correctly.</li></ul><h3>Types of Data</h3><p>The type of storage we choose often depends on the type of data we need to store.</p><p>There are two broad categories of data:</p><h3>Structured Data</h3><p><strong>Structured data</strong> is data organized according to a predefined format or schema.</p><p>It is commonly represented using <strong>rows and columns</strong>, making it easy to search, query, and analyze.</p><p>For example:</p><p>IDNameAge1Abebe252Hana28</p><p>Relational databases are commonly used to store structured data.</p><h3>Unstructured Data</h3><p><strong>Unstructured data</strong> does not follow a predefined tabular structure.</p><p>Examples include:</p><ul><li>Images</li><li>Videos</li><li>Audio files</li><li>Documents</li><li>PDFs</li><li>Logs</li></ul><p>Because this type of data can vary greatly in size and format, different storage technologies are often used to manage it.</p><h3>Types of Cloud Storage</h3><p>Cloud storage can generally be divided into three major types:</p><h3>File Storage</h3><p><strong>File storage</strong> organizes data using a hierarchical structure of <strong>files and directories</strong>.</p><p>It works similarly to the file system on a personal computer.</p><p>For example:</p><pre>/project<br>    /src<br>        app.py<br>    /documents<br>        report.pdf</pre><p>File storage is useful when applications need to access data using a traditional file and folder structure.</p><p>Examples include shared file systems and code repositories.</p><h3>Object Storage</h3><p><strong>Object storage</strong> stores data as individual <strong>objects</strong> inside containers called <strong>buckets</strong>.</p><p>An object typically contains:</p><ul><li>The actual data</li><li>Metadata</li><li>A unique identifier or key</li></ul><p>Object storage is particularly useful for large amounts of unstructured data such as images, videos, backups, documents, and logs.</p><p>Examples include Amazon S3, Google Cloud Storage, and Azure Blob Storage.</p><h3>Block Storage</h3><p><strong>Block storage</strong> divides data into fixed-size blocks and stores those blocks separately.</p><p>The blocks can then be assembled and presented to a computer as a storage volume.</p><p>Block storage is commonly used with <strong>virtual machines, databases, and applications that require low-latency storage</strong>.</p><p>In simple terms:</p><p><strong>File → Files and folders</strong></p><p><strong>Object → Objects inside buckets</strong></p><p><strong>Block → Data divided into blocks</strong></p><h3>Cloud Security Controls</h3><p>Cloud environments use different types of security controls to protect systems and data.</p><p>Common categories include:</p><ul><li><strong>Identity controls</strong></li><li><strong>Protective controls</strong></li><li><strong>Network controls</strong></li><li><strong>Detective controls</strong></li><li><strong>Response controls</strong></li><li><strong>Recovery controls</strong></li></ul><h3>Identity Controls</h3><p>An <strong>identity control</strong> is a security measure used to verify who a user or system is and determine what resources they are allowed to access.</p><p>For example:</p><ul><li>Authentication</li><li>Authorization</li><li>Multi-factor authentication (MFA)</li><li>Identity and Access Management (IAM)</li></ul><h3>Protective Controls</h3><p><strong>Protective controls</strong> are measures designed to prevent or reduce the impact of security threats.</p><p>Examples include:</p><ul><li>Antivirus and endpoint protection</li><li>Web Application Firewalls (WAF)</li><li>Encryption</li><li>Security policies</li><li>Infrastructure as Code (IaC) security policies</li></ul><h3>Network Controls</h3><p><strong>Network controls</strong> protect systems and resources by controlling how traffic can reach them.</p><p>Examples include:</p><ul><li>Firewalls</li><li>Security groups</li><li>Network access control lists (NACLs)</li><li>Network segmentation</li><li>Private networks</li></ul><h3>Detective Controls</h3><p><strong>Detective controls</strong> are used to identify suspicious activity, security threats, or policy violations.</p><p>Examples include:</p><ul><li>Logging</li><li>Monitoring</li><li>Intrusion detection</li><li>Security alerts</li></ul><h3>Response Controls</h3><p><strong>Response controls</strong> are measures used to respond to detected security incidents.</p><p>They can include automated or manual actions such as:</p><ul><li>Blocking suspicious traffic</li><li>Disabling compromised credentials</li><li>Isolating affected resources</li><li>Triggering incident-response workflows</li></ul><h3>Recovery Controls</h3><p><strong>Recovery controls</strong> help restore systems, data, and functionality after a failure or security incident.</p><p>Examples include:</p><ul><li>Backups</li><li>Data replication</li><li>Disaster recovery</li><li>Restoring systems from known-good states</li></ul><h3>Shared Responsibility Model</h3><p>When organizations use cloud services, security responsibilities are divided between the <strong>Cloud Service Provider (CSP)</strong> and the <strong>customer</strong>.</p><p>This is commonly known as the <strong>Shared Responsibility Model</strong>.</p><p>The exact responsibilities depend on the cloud provider and the service being used.</p><h3>Cloud Service Provider Responsibilities</h3><p>The CSP is generally responsible for securing and maintaining the underlying cloud infrastructure.</p><p>This can include:</p><ul><li>Physical data centers</li><li>Physical servers</li><li>Physical networking equipment</li><li>Underlying cloud infrastructure</li><li>Infrastructure availability and resilience</li></ul><h3>Customer Responsibilities</h3><p>Customers are generally responsible for securing what they <strong>put in and configure in the cloud</strong>.</p><p>This can include:</p><ul><li>Configuring cloud services securely</li><li>Managing identities and permissions</li><li>Protecting their data</li><li>Configuring network access</li><li>Managing application security</li><li>Meeting their security and compliance requirements</li></ul><p>For example, the cloud provider may secure the physical server running your application, but <strong>you may still be responsible for configuring who can access your application and data</strong>.</p><p>This is why cloud security is a shared responsibility rather than something handled entirely by the CSP.</p><h3>Cloud Misconfiguration</h3><p>One common source of cloud security incidents is <strong>misconfiguration</strong>.</p><p>Examples include:</p><ul><li>Excessive IAM permissions</li><li>Publicly accessible storage</li><li>Unnecessary open network ports</li><li>Weak authentication settings</li><li>Incorrect security group rules</li></ul><p>Organizations can reduce these risks through practices such as:</p><ul><li>Continuously monitoring cloud configurations</li><li>Automating security checks</li><li>Using Infrastructure as Code</li><li>Applying security policies</li><li>Regularly reviewing permissions</li><li>Using <strong>IAM with the principle of least privilege</strong></li></ul><h3>Principle of Least Privilege</h3><p>The <strong>principle of least privilege</strong> means giving a user, application, or system <strong>only the minimum permissions required to perform its intended function</strong>.</p><p>For example, if an application only needs to read objects from a specific storage bucket, it should not be given permission to delete objects from every bucket in the account.</p><p>This reduces the potential impact if an identity or application is compromised.</p><h3>Shared Fate Model</h3><p>The <strong>Shared Fate Model</strong> is an approach in which a Cloud Service Provider (CSP) takes a more active role in helping customers secure their cloud environments throughout their entire security journey.</p><p>Instead of simply providing infrastructure and leaving the customer responsible for security, the CSP provides <strong>guidance, tools, best practices, and resources</strong> that help customers build and maintain secure cloud environments.</p><p>The goal is to help organizations identify and mitigate security risks at every stage of their cloud adoption.</p><p>Some ways organizations can strengthen their security posture include:</p><ul><li><strong>Security foundations</strong></li><li><strong>Landing zones</strong></li><li><strong>Risk mitigation</strong></li></ul><h3>Security Foundations</h3><p><strong>Security foundations</strong> provide recommended best practices and blueprints for configuring and deploying cloud environments securely.</p><p>For example, Google Cloud provides security guidance and recommended configurations that organizations can use when setting up their cloud environments.</p><p>These foundations help organizations establish a secure baseline before deploying workloads.</p><h3>Landing Zones</h3><p>A <strong>landing zone</strong> is a modular and scalable cloud environment designed to provide a secure foundation for an organization’s workloads.</p><p>A landing zone can include configurations for:</p><ul><li>Identity and access management</li><li>Networking</li><li>Security policies</li><li>Logging and monitoring</li><li>Resource organization</li><li>Governance</li></ul><p>The goal is to provide a standardized foundation that an organization can adapt to its business and technical requirements.</p><h3>Risk Mitigation</h3><p>The Shared Fate Model also focuses on helping customers <strong>identify and mitigate risks</strong> in their cloud environments.</p><p>Google Cloud provides security tools that can help organizations understand and manage their security posture and risks.</p><p>For example, <strong>Risk Manager</strong> can provide visibility into an organization’s technical risk posture and help generate reports that can be used to evaluate risks across the organization.</p><h3>Cloud Service Models</h3><p>Cloud services can be categorized into different service models based on how much of the infrastructure and software stack is managed by the Cloud Service Provider.</p><p>The three major service models are:</p><ul><li><strong>Infrastructure as a Service (IaaS)</strong></li><li><strong>Platform as a Service (PaaS)</strong></li><li><strong>Software as a Service (SaaS)</strong></li></ul><p>The service model determines how responsibilities are divided between the <strong>CSP and the customer</strong>.</p><h3>Infrastructure as a Service (IaaS)</h3><p>With <strong>IaaS</strong>, the CSP provides fundamental computing infrastructure such as:</p><ul><li>Virtual machines</li><li>Storage</li><li>Networking</li></ul><p>The customer is responsible for managing much of the software stack, including the operating system, applications, configurations, and data.</p><p>For example, when using a cloud VM, the provider manages the underlying physical infrastructure, while the customer may be responsible for the operating system and applications running on the VM.</p><h3>Platform as a Service (PaaS)</h3><p>With <strong>PaaS</strong>, the CSP manages more of the underlying infrastructure and software platform.</p><p>The customer primarily focuses on:</p><ul><li>Writing and deploying application code</li><li>Managing application data</li><li>Configuring the application</li><li>Managing application-level security</li></ul><p>This allows developers to build and deploy applications without having to manage the underlying servers and operating systems.</p><h3>Software as a Service (SaaS)</h3><p>With <strong>SaaS</strong>, the CSP manages most of the underlying infrastructure and application platform.</p><p>The customer typically focuses on:</p><ul><li>Using the application</li><li>Managing users</li><li>Configuring access</li><li>Managing their data and content</li><li>Applying appropriate security settings</li></ul><p>Examples include cloud-based applications such as <strong>Gmail</strong>.</p><p>In simple terms:</p><p><strong>IaaS → You manage more</strong></p><p><strong>PaaS → Shared management</strong></p><p><strong>SaaS → CSP manages more</strong></p><h3>Other Cloud Service Models</h3><p>Beyond IaaS, PaaS, and SaaS, you may also encounter more specialized <strong>as-a-Service</strong> models.</p><h3>Function as a Service (FaaS)</h3><p><strong>FaaS</strong> is a serverless computing model that allows developers to run individual functions or pieces of code without managing the underlying servers.</p><p>The cloud provider handles the infrastructure required to execute the function.</p><p>For example, a function might be triggered when a file is uploaded to cloud storage.</p><h3>Identity as a Service (IDaaS)</h3><p><strong>IDaaS</strong> provides identity-related capabilities as a cloud service.</p><p>Common features include:</p><ul><li>Single Sign-On (SSO)</li><li>Multi-Factor Authentication (MFA)</li><li>Identity management</li><li>Access management</li></ul><h3>Firewall as a Service (FWaaS)</h3><p><strong>Firewall as a Service</strong> provides firewall capabilities through a cloud-based service.</p><p>It allows organizations to control and inspect network traffic without necessarily deploying and maintaining traditional physical firewall appliances.</p><h3>Identity and Access Management (IAM)</h3><p><strong>Identity and Access Management (IAM)</strong> is a system used to control <strong>who can access which resources and what actions they are allowed to perform</strong>.</p><p>A simple way to think about IAM is:</p><blockquote><strong><em>Who can do what on which resource?</em></strong></blockquote><p>For example:</p><blockquote><em>A developer can read objects from a specific storage bucket.</em></blockquote><p>IAM commonly involves three important concepts:</p><ul><li><strong>Principals</strong></li><li><strong>Roles</strong></li><li><strong>Policies</strong></li></ul><h3>Principals</h3><p>A <strong>principal</strong> represents an identity that can access a resource.</p><p>A principal can represent:</p><ul><li>A human user</li><li>A service account</li><li>A group</li><li>A workload or application identity, depending on the IAM system</li></ul><p>A <strong>service account</strong> is a non-human identity that applications, workloads, or services can use to authenticate and access cloud resources.</p><p>For example, a virtual machine might use a service account to access objects stored in a cloud storage bucket.</p><h3>Roles</h3><p>A <strong>role</strong> is a collection of permissions that can be granted to a principal.</p><p>For example, a role might contain permissions that allow a principal to:</p><ul><li>Read data</li><li>Create resources</li><li>Update resources</li><li>Delete resources</li></ul><p>Instead of assigning individual permissions one by one, organizations can assign an appropriate role.</p><h3>Policies</h3><p>An IAM <strong>policy</strong> defines who has access to which resources and what roles or permissions they have.</p><p>Policies can contain <strong>allow rules</strong> and, depending on the IAM system, <strong>deny rules</strong>.</p><h3>Groups</h3><p><strong>Groups</strong> allow organizations to combine multiple users or service accounts and manage their access collectively.</p><p>For example, instead of giving the same permissions individually to 20 developers, an organization can create a <strong>Developers</strong> group and assign the appropriate role to that group.</p><p>When a new developer joins the team, adding them to the group can automatically give them the required access.</p><h3>Allow and Deny Policies</h3><h3>Allow Policy</h3><p>An <strong>allow policy</strong> grants a principal permission to perform specific actions on a resource, usually through assigned roles.</p><p>For example:</p><blockquote><em>The Developers group can read objects from the production storage bucket.</em></blockquote><p>Some systems also allow conditions to further restrict when or how that access can be used.</p><h3>Deny Policy</h3><p>A <strong>deny policy</strong> explicitly prevents certain permissions or actions, even when an allow policy might otherwise grant them.</p><p>For example:</p><blockquote><em>Developers are denied permission to delete production resources.</em></blockquote><p>Deny rules can therefore provide an additional layer of protection against unintended or excessive access.</p><h3>IAM Best Practice: Use Groups</h3><p>A useful IAM practice is to <strong>grant roles to groups rather than managing permissions individually for every user whenever possible</strong>.</p><p>For example:</p><pre>Developers Group<br>       |<br>       └── Cloud Storage Reader Role<br>                    |<br>       ┌────────────┼────────────┐<br>       ↓            ↓            ↓<br>    User A        User B        User C</pre><p>This makes access management easier to maintain.</p><p>When someone joins the development team, you can add them to the appropriate group instead of manually configuring their permissions across many resources.</p><p>The broader principle is:</p><p><strong>Use centralized access management + least privilege + groups where appropriate.</strong></p><h3>Cloud Networking</h3><p>Networking is another fundamental component of cloud computing.</p><p>Many of the networking concepts we use in traditional infrastructure also exist in the cloud, but cloud providers implement them using software-defined and virtualized technologies.</p><h3>Traditional Networking Components</h3><p>Let’s first look at two common networking devices.</p><h3>Router</h3><p>A <strong>router</strong> is a network device that connects different networks together and determines where network traffic should be sent.</p><p>For example, a router can connect a company’s internal network to the internet.</p><h3>Switch</h3><p>A <strong>network switch</strong> connects devices within a network and forwards data between them.</p><p>For example, computers, servers, and printers within an office network can connect to each other through a switch.</p><h3>Software-Defined Networking</h3><p>In traditional infrastructure, networking relies heavily on physical routers, switches, firewalls, and other appliances.</p><p>In cloud environments, many of these networking capabilities are implemented through <strong>software</strong>.</p><p>This approach is commonly known as <strong>Software-Defined Networking (SDN)</strong>.</p><p>SDN separates network management and control from the underlying physical networking hardware. Cloud providers can use software to create and manage virtual networks, routing, firewall rules, load balancing, and other networking capabilities.</p><p>The underlying physical routers and switches still exist inside the cloud provider’s data centers. However, customers interact with these capabilities primarily through <strong>software, APIs, and cloud management tools</strong> rather than directly configuring physical devices.</p><p>One major advantage of software-defined networking is <strong>flexibility and scalability</strong>.</p><p>For example, networking resources and configurations can be created, modified, or scaled through APIs and automation.</p><p>SDN can also integrate with monitoring and security systems, allowing organizations to observe network traffic and detect potentially suspicious activity.</p><h3>Load Balancing</h3><p>Cloud applications can receive a large number of requests from users.</p><p>Instead of sending all of these requests to a single server, cloud platforms can use <strong>load balancing</strong> to distribute traffic across multiple backend resources.</p><p>For example:</p><pre>Users<br>                    |<br>                    ↓<br>              Load Balancer<br>              /     |      \<br>             ↓      ↓       ↓<br>          Server  Server   Server<br>             1      2        3</pre><p>This can improve <strong>availability, scalability, and performance</strong>.</p><p>Cloud providers offer different types of load balancers depending on the type of traffic and the layer at which they operate.</p><p>Two important categories are:</p><ul><li><strong>Application Load Balancers</strong></li><li><strong>Network Load Balancers</strong></li></ul><h3>Application Load Balancer</h3><p>An <strong>Application Load Balancer</strong> operates at <strong>Layer 7 (Application Layer)</strong> of the OSI model.</p><p>Because it operates at the application layer, it can make routing decisions based on application-level information, such as:</p><ul><li>HTTP/HTTPS requests</li><li>Hostnames</li><li>URL paths</li><li>HTTP headers</li></ul><p>For example:</p><pre>example.com/api/*  → API servers</pre><pre>example.com/images/* → Image servers</pre><h3>Network Load Balancer</h3><p>A <strong>Network Load Balancer</strong> operates primarily at <strong>Layer 4 (Transport Layer)</strong>.</p><p>It handles network traffic based on information such as:</p><ul><li>IP addresses</li><li>TCP ports</li><li>UDP ports</li></ul><p>Because it operates at a lower layer, it is useful for workloads that require high-performance network-level load balancing.</p><blockquote><strong><em>Important correction:</em></strong><em> An Application Load Balancer does not simply “use IP.” IP addresses are primarily Layer 3 information. Application load balancers can inspect Layer 7 information such as HTTP requests, hostnames, and paths.</em></blockquote><h3>Virtual Private Cloud (VPC)</h3><p>A <strong>Virtual Private Cloud (VPC)</strong> is a logically isolated virtual network that allows organizations to run and connect cloud resources in a controlled networking environment.</p><p>You can think of a VPC as your organization’s <strong>private network inside the cloud</strong>.</p><p>A VPC allows you to configure things such as:</p><ul><li>IP address ranges</li><li>Subnets</li><li>Routes</li><li>Firewall rules</li><li>Network connectivity</li></ul><p>Although the underlying physical infrastructure is shared by the cloud provider, the VPC provides <strong>logical isolation</strong> between customers and their resources.</p><h3>Google Cloud VPC</h3><p>In <strong>Google Cloud</strong>, VPC networks are <strong>global resources</strong>.</p><p>This means that the VPC itself is not limited to a particular region or zone.</p><p>However, resources such as virtual machine instances are associated with specific regions and zones, and <strong>subnets are regional resources</strong>.</p><p>For example:</p><pre>Google Cloud VPC<br>                    |<br>       ┌────────────┴────────────┐<br>       ↓                         ↓<br>  US Region                 Europe Region<br>       |                         |<br>   Subnet A                  Subnet B<br>       |                         |<br>     VMs                       VMs</pre><p>This global nature allows a single VPC network to span multiple regions.</p><h3>Network Segmentation</h3><p>A VPC can be divided into smaller networks called <strong>subnets</strong>.</p><p>This practice is known as <strong>network segmentation</strong>.</p><p>Network segmentation divides a larger network into smaller logical sections, allowing organizations to control communication between different parts of their infrastructure.</p><p>For example:</p><pre>VPC<br>                  |<br>       ┌──────────┼──────────┐<br>       ↓          ↓          ↓<br>   Frontend    Backend    Database<br>    Subnet      Subnet      Subnet</pre><p>This can improve security because organizations can apply different firewall rules and routing policies to different parts of the network.</p><p>For example:</p><ul><li>Frontend resources may be accessible from the internet.</li><li>Backend services may only accept traffic from the frontend.</li><li>Database resources may only accept traffic from the backend.</li></ul><p>This creates layers of protection and reduces unnecessary network access.</p><h3>Cloud Interconnect</h3><p>Organizations often need to connect their existing on-premises infrastructure to their cloud environment.</p><p><strong>Cloud Interconnect</strong> is a Google Cloud service that provides connectivity between an organization’s on-premises network and Google’s network.</p><p>This allows organizations to create a connection between their existing infrastructure and resources running in Google Cloud.</p><p>For example:</p><pre>On-Premises Data Center<br>          |<br>          | Cloud Interconnect<br>          ↓<br>    Google Cloud Network<br>          |<br>          ↓<br>         VPC<br>          |<br>     ┌────┴────┐<br>     ↓         ↓<br>   Backend   Database</pre><p>This can be useful for organizations that operate in a <strong>hybrid cloud environment</strong>, where some workloads remain on-premises while others run in the cloud.</p><h3>Google Cloud Architecture, Security, and Governance</h3><h3>1. Global Infrastructure: Regions, Zones, and Resiliency</h3><p>At the core of any Cloud Service Provider (CSP), such as Google Cloud, is an interconnected global infrastructure.</p><ul><li><strong>Data Centers:</strong> Physical facilities that house racks of bare-metal servers, network switches, and storage arrays.</li><li><strong>Zones:</strong> Isolated deployment areas consisting of one or more connected data centers within a region.</li><li><strong>Regions:</strong> Geographic areas composed of multiple independent zones.</li></ul><pre>+-------------------------------------------------------------+<br>|                        Google Cloud                         |<br>|  +-------------------------------------------------------+  |<br>|  |                   Region (e.g., us-central1)          |  |<br>|  |  +----------------+ +----------------+ +------------+ |  |<br>|  |  |     Zone A     | |     Zone B     | |   Zone C   | |  |<br>|  |  |  [Datacenter]  | |  [Datacenter]  | |[Datacenter]| |  |<br>|  |  +----------------+ +----------------+ +------------+ |  |<br>|  +-------------------------------------------------------+  |<br>+-------------------------------------------------------------+</pre><h3>High Availability and Fault Tolerance</h3><p>Grouping resources into distinct zones and regions creates separate <strong>failure domains</strong>. By deploying applications across multiple zones or regions, organizations achieve <strong>redundancy</strong> (eliminating single points of failure) and <strong>resiliency</strong> (the ability to withstand and recover from disruptions).</p><p>This global footprint can also minimize <strong>latency</strong> — the time it takes for data packets to travel across the network — by placing workloads closer to end users.</p><h3>2. Cloud Deployment Models</h3><p>Cloud infrastructure can be organized into distinct deployment models based on isolation, scalability, and governance requirements.</p><p>ModelTenancy &amp; ArchitectureCore Use Case<strong>Public Cloud</strong>Multi-tenant; resources are provided over the public internetHigh scalability, rapid elasticity, and low operational overhead<strong>Private Cloud</strong>Single-tenant; dedicated infrastructure, often hosted on-premisesStrict regulatory requirements, dedicated environments, and isolated workloads<strong>Hybrid Cloud</strong>Interconnected public and private environmentsPhased cloud migrations, burst capacity, and sensitive data isolation<strong>Multicloud</strong>Workloads distributed across two or more CSPsReducing vendor dependency and improving disaster recovery redundancy</p><h3>3. The Compute Engine: From Virtualization to Serverless</h3><h3>Virtualization and Hypervisors</h3><p>Virtualization abstracts physical computing resources into software-defined instances known as <strong>Virtual Machines (VMs)</strong>. The abstraction layer that runs directly on or above the physical hardware is called a <strong>hypervisor</strong>.</p><ul><li><strong>Type 1 (Bare-Metal):</strong> Runs directly on physical hardware without an underlying host operating system. This architecture generally provides higher performance, lower overhead, and a smaller attack surface.</li><li><strong>Type 2 (Hosted):</strong> Runs as an application layer on top of a host operating system.</li></ul><h3>The Rise of Serverless Computing</h3><p>Moving further up the abstraction ladder, <strong>serverless computing</strong> abstracts away much of the underlying server, operating system, and infrastructure management.</p><ul><li><strong>Backend as a Service (BaaS):</strong> Outsources backend components — including managed authentication, databases, and push notifications — allowing teams to focus primarily on application development.</li><li><strong>Function as a Service (FaaS):</strong> Executes isolated, single-purpose blocks of code that are triggered by system events, such as <strong>Cloud Functions</strong>.</li></ul><p>Functions are typically <strong>ephemeral</strong> (short-lived) and can scale down to zero when idle. Their short execution lifespan can also reduce the amount of time an exploited function remains active.</p><h3>4. Cloud Storage Architecture and Tiering</h3><p>Google Cloud provides three fundamental storage models:</p><ul><li><strong>File Storage:</strong> Hierarchical file systems designed for shared, structured directory access across workloads.</li><li><strong>Block Storage:</strong> High-performance, raw storage volumes, such as Persistent Disk, that can be attached directly to virtual machine instances.</li><li><strong>Object Storage:</strong> Flat-namespace storage designed for unstructured data such as images, videos, backups, and logs. Objects are stored in virtual containers called <strong>buckets</strong>, such as those provided by Google Cloud Storage.</li></ul><h3>Hot vs. Cold Storage Classes</h3><p>Data access patterns influence storage costs and retention strategies. Google Cloud Storage provides multiple storage classes designed for different access frequencies.</p><pre>Frequent Access (Hot) ----------------------------------&gt; Infrequent Access (Cold)</pre><pre>[ Standard ] ---------&gt; [ Nearline ] ---------&gt; [ Coldline ] ---------&gt; [ Archive ]<br>(Web, Streaming)         (Monthly Access)        (Quarterly Access)      (Long-Term)</pre><ul><li><strong>Standard Storage:</strong> Designed for frequently accessed data, such as website assets, active datasets, and streaming media.</li><li><strong>Nearline Storage:</strong> Cost-optimized for data accessed relatively infrequently, such as monthly reporting data and backups.</li><li><strong>Coldline Storage:</strong> Designed for data that is accessed infrequently, such as quarterly backups and disaster recovery data.</li><li><strong>Archive Storage:</strong> A low-cost storage class intended for long-term retention, compliance records, and disaster recovery assets that are rarely accessed.</li></ul><h3>5. Software-Defined Networking (SDN) and Security</h3><p>Cloud environments replace many traditional physical network appliances with <strong>Software-Defined Networking (SDN)</strong>.</p><h3>Virtual Private Clouds (VPCs)</h3><p>In Google Cloud, a <strong>Virtual Private Cloud (VPC)</strong> is a software-defined network that provides an isolated networking environment for cloud resources. VPCs facilitate <strong>network segmentation</strong> by partitioning the network into regional <strong>subnets</strong>, providing granular traffic control and reducing the potential blast radius of security incidents.</p><ul><li><strong>Hybrid Connectivity:</strong> Services such as <strong>Cloud Interconnect</strong> provide low-latency, enterprise-grade connections between on-premises networks and Google Cloud VPCs.</li><li><strong>Load Balancing:</strong> Google Cloud distributes traffic using different types of load balancers, including <strong>Network Load Balancers</strong> for Layer 4 traffic and <strong>Application Load Balancers</strong> for Layer 7 HTTP/HTTPS traffic.</li><li><strong>Cloud Firewalls:</strong> Stateful, software-defined firewall rules can be used to control ingress and egress traffic and enforce network security boundaries.</li></ul><h3>6. Identity and Access Management (IAM)</h3><p>Identity is a primary security perimeter in modern cloud architectures. Google Cloud IAM enforces declarative access controls using principals, roles, and policies.</p><pre>Principal<br>    │<br>    │ assigned a<br>    ▼<br>Role (Permissions)<br>    │<br>    │ applied through an<br>    ▼<br>IAM Policy<br>    │<br>    │ grants access to<br>    ▼<br>Resource</pre><pre>+--------------------------------------------------------------------+<br>|                             Google IAM                             |<br>|                                                                    |<br>|  [ Principal ]                   [ IAM Role ]         [ Resource ] |<br>|  - Human User (Google Account)     - Viewer             - Compute  |<br>|  - Service Account (Workload)  --&gt; - Storage Admin  --&gt; - Storage  |<br>|  - Group (Best Practice)           - Custom Role        - BigQuery |<br>+--------------------------------------------------------------------+</pre><ul><li><strong>Principals:</strong> Human users, Google Groups, or <strong>Service Accounts</strong>. Service accounts are non-human identities used by applications, automated processes, and workloads.</li><li><strong>Roles:</strong> Collections of individual API permissions that determine what actions a principal can perform.</li><li><strong>Policies:</strong> Declarative rules that bind roles to principals for specific resources. <strong>Allow Policies</strong> grant permissions, while <strong>Deny Policies</strong> explicitly prevent certain permissions from being granted.</li></ul><h3>Access Control Best Practices</h3><ul><li><strong>Principle of Least Privilege:</strong> Grant only the minimum permissions required for a principal to perform its designated function.</li><li><strong>Group-Based Access Control:</strong> Assign roles to Google Groups rather than individual accounts to simplify permission management and reduce permission creep during organizational changes.</li><li><strong>Workforce Identity Federation:</strong> Use Single Sign-On (SSO) and federated identities backed by Multi-Factor Authentication (MFA) to reduce the need for long-lived credentials and service account keys.</li></ul><h3>7. Cloud Security Governance: Shared Responsibility vs. Shared Fate</h3><p>Securing cloud environments requires a clear division of operational accountability across different service models.</p><pre>On-Premises         IaaS                 PaaS                 SaaS<br>+-------------+     +-------------+      +-------------+      +-------------+<br>| Application |     | Application |      | Application |      | [CSP Mgmt]  |<br>| Data        |     | Data        |      | Data        |      | Data/Access |<br>| Runtime     |     | Runtime     |      | [CSP Mgmt]  |      | [CSP Mgmt]  |<br>| Middleware  |     | Middleware  |      | [CSP Mgmt]  |      | [CSP Mgmt]  |<br>| OS          |     | OS          |      | [CSP Mgmt]  |      | [CSP Mgmt]  |<br>| Virtualiz.  |     | [CSP Mgmt]  |      | [CSP Mgmt]  |      | [CSP Mgmt]  |<br>| Hardware    |     | [CSP Mgmt]  |      | [CSP Mgmt]  |      | [CSP Mgmt]  |<br>+-------------+     +-------------+      +-------------+      +-------------+</pre><p>Customer Managed: Entire Stack App &amp; Data Only Data &amp; Access</p><h3>The Shared Responsibility Model</h3><p>The division of responsibility generally depends on the service model:</p><ul><li><strong>The CSP’s Domain (Security OF the Cloud):</strong> Physical data center security, hardware provisioning, core hypervisor management, and the security of the underlying cloud infrastructure.</li><li><strong>The Customer’s Domain (Security IN the Cloud):</strong> IAM configuration, firewall rules, data protection, encryption keys, guest operating system patching in IaaS environments, and application source code.</li></ul><blockquote><strong><em>Note:</em></strong><em> Misconfigured access controls, excessive permissions, exposed resources, and configuration drift within the customer’s domain can create significant cloud security risks.</em></blockquote><h3>Defense-in-Depth Control Framework (NIST CSF)</h3><p>A resilient cloud architecture can align security controls with the <strong>NIST Cybersecurity Framework (CSF)</strong>:</p><ul><li><strong>Identify:</strong> Catalog assets, assess system exposure, and establish configuration baselines.</li><li><strong>Protect:</strong> Implement IAM least privilege, encryption at rest and in transit, and network security controls.</li><li><strong>Detect:</strong> Continuously monitor audit logs and use automated threat detection tools.</li><li><strong>Respond:</strong> Automate incident response and containment workflows to limit the impact of detected threats.</li><li><strong>Recover:</strong> Maintain backups and automated infrastructure pipelines to restore services and infrastructure after an incident.</li></ul><h3>Google Cloud’s Shared Fate Model</h3><p>Moving beyond the traditional Shared Responsibility model, Google Cloud promotes a <strong>Shared Fate</strong> approach. Rather than leaving customers to manage their security responsibilities entirely on their own, the provider aims to help customers establish and maintain secure cloud environments through:</p><ul><li><strong>Security Foundations &amp; Landing Zones:</strong> Pre-architected, modular blueprints that help establish hardened resource hierarchies, VPC configurations, and IAM structures.</li><li><strong>Risk Management and Protection Programs:</strong> Tools and programs designed to help organizations assess their security posture, identify risks, and improve their overall security and resilience.</li></ul><h3>Conclusion</h3><p>Migrating to Google Cloud transforms how organizations build, secure, and scale infrastructure. Understanding the interplay between global failure domains, virtualization, software-defined networking, IAM, storage architecture, and defense-in-depth security principles enables engineering teams to build modern architectures that are <strong>resilient, scalable, and secure by design.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a171b3ec9a7d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Networking in AWS Cloud: Building a Two-Tier Application with VPC, Public & Private Subnets]]></title>
            <link>https://aws.plainenglish.io/networking-in-aws-cloud-building-a-two-tier-application-with-vpc-public-private-subnets-bd2d4992c41c?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/bd2d4992c41c</guid>
            <category><![CDATA[vpc]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[networking]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Mon, 28 Sep 2026 14:46:18 GMT</pubDate>
            <atom:updated>2026-09-28T14:46:18.996Z</atom:updated>
            <content:encoded><![CDATA[<p>Networking in the cloud is a reflection of traditional networking. We call it <strong>virtual networking</strong>.</p><p>Networking in the cloud is similar to regular networking in a data center.</p><p>In comparison, in traditional networking, we have a <strong>data center</strong> where we launch multiple services. In AWS, we have <strong>Amazon VPC (Virtual Private Cloud)</strong>.</p><p>The following are some comparisons between traditional networking and AWS networking:</p><ul><li>In traditional networking, we have <strong>routers</strong>. In AWS, we have <strong>route tables</strong>.</li><li>In traditional networking, we have <strong>switches (subnets)</strong>. In AWS, we have <strong>subnets</strong>.</li><li>In traditional networking, we have <strong>firewalls</strong> to block traffic based on certain rules. In AWS, we have <strong>security groups</strong> and <strong>network access control lists (network ACLs)</strong>.</li><li>In traditional networking, we have <strong>servers and operating systems</strong>. In AWS, we have <strong>Amazon Elastic Compute Cloud (Amazon EC2) instances</strong>.</li><li>In traditional networking, we have a <strong>modem</strong>. In AWS, we have an <strong>Internet Gateway</strong>.</li></ul><h3>Amazon VPC (Virtual Private Cloud)</h3><p>Amazon VPC is a service that you can use to provision a logically isolated section of the AWS Cloud. You can launch your AWS resources in a virtual network that you define.</p><h3>What does it do?</h3><p>Amazon VPC gives you control over your virtual networking resources, including:</p><ul><li>Selecting an IP address range</li><li>Creating subnets</li><li>Configuring route tables and network gateways</li></ul><p>It gives you the ability to:</p><ul><li>Customize your network configuration</li><li>Use multiple layers of security</li></ul><h3>Amazon VPC Features</h3><ul><li>It is dedicated to an AWS account.</li><li>It belongs to a single AWS Region.</li><li>It can span multiple Availability Zones.</li><li>It is logically isolated from other Amazon VPCs.</li><li>You can create multiple VPCs.</li><li>You can create multiple subnets in your VPC, but fewer subnets are recommended to reduce network topology complexity.</li></ul><h3>IP Addressing in Amazon VPC</h3><p>When you create a VPC, you must specify an IPv4 address range by choosing a CIDR (Classless Inter-Domain Routing) block, for example: 10.0.0.0/16.</p><p>The VPC address range can be as large as /16 (65,536 addresses) or as small as /28 (16 addresses).</p><p>Private IP ranges should be used according to <strong>RFC 1918</strong>.</p><p>IP ranges should not overlap with the addresses of other networks to which a VPC is connected.</p><p>The IP address range cannot be changed after the VPC is created. However, a secondary VPC CIDR block can be assigned to the VPC.</p><h3>Private IP Address Ranges</h3><p>When an Amazon VPC is created, you can choose a CIDR block from the following private address ranges specified in <strong>RFC 1918</strong>:</p><p>The smallest permitted block size is /28, and the largest is /16.</p><p>With each subnet CIDR block, AWS reserves the first four IP addresses and the last IP address:</p><ul><li>10.0.0.0 — Network address</li><li>10.0.0.1 — VPC router</li><li>10.0.0.2 — Domain Name System (DNS) server</li><li>10.0.0.3 — Reserved for future use</li><li>10.0.0.255 — Network broadcast address, which is not supported in the VPC but is still reserved</li></ul><h3>Amazon VPC Components</h3><ul><li><strong>CIDR block</strong> — A private IP range should be given, from /16 to /28.</li><li><strong>Subnet</strong> — A subnet allocates a range of IP addresses within your VPC. These subnets are either <strong>private or public subnets</strong>. Public subnets have a route table with a route to the Internet Gateway associated with them, while private subnets do not. Like the VPC CIDR block, subnets also need an IP address range.</li><li><strong>Route table</strong> — Rules (also known as routes) that the VPC uses to route traffic. Targets are services such as an <strong>Internet Gateway, VPC Endpoint, or NAT Gateway</strong>. The routes specify where the traffic should go and the specific target it should go to.</li><li><strong>Internet Gateway</strong> — Attaches to your VPC and permits communication from your VPC to the internet. This service must be created and attached to the VPC. After it is attached, a route to the Internet Gateway must be added to the route table associated with the public subnet in order for resources to reach the internet.</li><li><strong>VPC Endpoint</strong> — Provides a private connection between your VPC and AWS services without the need to use the internet.</li><li><strong>Network Address Translation (NAT) Gateway</strong> — A NAT Gateway is placed in a public subnet and provides network address translation so that resources in a private subnet can reach the internet.</li></ul><h3>Internet Gateway</h3><p>An Internet Gateway permits communication from a VPC to the internet. It is horizontally scaled to meet traffic needs, be redundant, and be highly available.</p><h4>Public Subnet</h4><ul><li>It is associated with a route table that has a route to the Internet Gateway.</li><li>It will have a route such as 0.0.0.0/0, with the target as igw-xxxxx.</li></ul><h4>Public IP Address</h4><ul><li>For an instance to communicate over the internet, it must have a public IPv4 address or an Elastic IP address.</li></ul><h3>NAT Gateway</h3><p>A NAT Gateway permits instances in the private subnet to connect outside the VPC. However, anything outside the VPC cannot initiate a connection to the instances in the private subnet. It will be sent a <strong>RESET </strong>flag.</p><h4>Public Subnet</h4><ul><li>The NAT Gateway is assigned an <strong>Elastic IP address</strong>, which is a public IP address, and is located in the public subnet.</li></ul><h4>Private Subnet</h4><ul><li>It will have the route 0.0.0.0/0, with the target as nat-xxxxx, in the associated route table for the private subnet.</li></ul><h4>Private IP Address</h4><ul><li>Due to the NAT Gateway, the instances in the private subnet do not need a public IP address.</li></ul><h3>Route Tables</h3><p>A route table holds routes and targets that direct network traffic within the VPC.</p><h4>Destination</h4><p>The destination is an IP address and CIDR range. For example, 0.0.0.0/0, which represents the internet.</p><h4>Target</h4><p>The target is either a gateway or a network interface. It specifies where the destination traffic should go.</p><h4>Route Table Association</h4><p>Each route table must be associated with a subnet. A route table associates the subnet and gateways together.</p><h4>Public and Private Subnet</h4><p>A subnet is a range of IP addresses within the VPC.</p><h3>Availability Zones</h3><p>There is one subnet per Availability Zone because a subnet cannot span multiple Availability Zones.</p><h4>Public Subnet</h4><p>Traffic is routed to an Internet Gateway by having a route table that has a route to the Internet Gateway.</p><h4>Private Subnet</h4><p>Traffic is not routed directly to the internet.</p><h4>Subnet Sizing</h4><p>If more than one subnet in a VPC is created, the CIDR blocks of the subnets cannot overlap.</p><h3>Security Groups</h3><p>A security group is a firewall at the EC2 instance level that controls incoming traffic.</p><p>Security groups are <strong>stateful</strong>, meaning that if requests from your instance are sent, the response traffic is allowed to flow back regardless of the inbound rules.</p><p>Security groups block all traffic by default. You must allow the <strong>protocol, port range, Internet Control Message Protocol (ICMP) type, and source or destination</strong>.</p><h3>Network ACLs</h3><p>A Network ACL acts as a firewall at the subnet level.</p><p>Network ACLs are <strong>stateless</strong>, meaning that traffic that is allowed out must also be explicitly allowed back in.</p><p>The default Network ACL allows all traffic by default. You can create rules to allow or deny traffic.</p><p>Putting Everything Together</p><p>Now let’s see everything in action by creating a VPC and its additional components and building this architectural diagram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/651/1*GOtPnYZ0plrDwaciyM9juQ.png" /></figure><h3>1. Create VPC</h3><p>Now we will create a VPC, an Internet Gateway, two subnets, and a NAT Gateway. The NAT Gateway will help our EC2 instance in the private subnet have internet connectivity.</p><p>Go to the <strong>VPC Dashboard</strong> by searching for <strong>VPC</strong>.</p><p>Then click <strong>Create VPC</strong>.</p><p>I will keep the other settings as default. I will set the <strong>number of Availability Zones to 1</strong>. I will customize the CIDR block for my IP range to /24.</p><p>For the <strong>NAT Gateway configuration</strong>, I will select <strong>1 AZ</strong>.</p><p>For <strong>VPC endpoints</strong>, I will select <strong>None</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rjohpEvrOo1fKuNNS2VXsg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wxBex4v6Wo3Jcra8JJu71w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MWc0LVdaLboCbw8-_qkUpQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WEiNV0jTo5I-pRpP-AhVIg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bgrbg6FBmc31BByUdY3hXg.png" /></figure><p>Now wait until all the resources are created.</p><h3>2. Create Additional Subnets</h3><p>Now let’s create additional subnets for high availability in another Availability Zone.</p><p>From the sidebar, select <strong>Subnets</strong> and click <strong>Create subnet</strong>.</p><p>Select the VPC you just created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0rtf9pc7C41Vf6vwvspGiQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rGrSoYQv0_VH53pBgvKokw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V3srX_SQpemRJwWzzLqQQQ.png" /></figure><p>Now let’s create the second private subnet the same way.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*URnQlcsZDXfFHL2nrrbAag.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ijnip4nKQcZmXtL-22Ig5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_DfjMnapl68eABjQ6dZzKw.png" /></figure><h3>3. Let’s Associate Subnets and Routes</h3><p>From the sidebar, click <strong>Route Tables</strong>.</p><p>Since when we created the VPC, we selected <strong>VPC and more</strong>, we should already have a route table created for us.</p><p>Find the <strong>public route table</strong>. Once you find it, click the <strong>Subnet associations</strong> tab and add the newly created public subne</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uX8fQnnPaeLVyGgQjQG8tA.png" /></figure><p>Now let’s do the same for our private subnet too.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JZPLc0D_GiDjsNpeIT5zyQ.png" /></figure><h3>4. Create Security Group</h3><p>A security group acts as a firewall for your instance.</p><p>Under <strong>Security</strong>, click <strong>Security Groups</strong>, and then click the <strong>Create security group</strong> button.</p><p>Configure the inbound rules accordingly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uFlkHiEZ9pjRJXfIzXkLWw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zLZMwcAuIxqTGIGcooAeqQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lCfRrme-jl1ED5ORf8tCrw.png" /></figure><h3>5. Launch EC2 Instances</h3><p>Now we have a <strong>private subnet</strong> and a <strong>public subnet</strong>.</p><p>We will deploy a backend on the <strong>private subnet</strong>. The backend needs internet access, which it can get through the <strong>NAT Gateway</strong> that was already created when we created the VPC using the <strong>VPC and more</strong> option.</p><p>We will deploy our <strong>frontend on the public subnet</strong> so that it can be accessible from the internet.</p><p>Let’s start with the backend. Our backend is going to run on <strong>port 5000</strong>.</p><p>Let’s create a security group to allow inbound network traffic on port 5000 from our <strong>web security group</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pkB8vhCwUxfv701jP1YJsA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8QG2ORBi53vdXrDgv_ehpA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SFkeaaPmEt3muD76N8j4Yg.png" /></figure><p>Now let’s create an EC2 instance to deploy the backend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xvGglydQr1w_dUW8AcgnYQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aJJLgTuDXRhp0hCu72A17w.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XPqpK77_314A_62-_831gg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZVOoicy-DBL70jkx3hrRwA.png" /></figure><p>Here is the full backend script used:</p><pre>#!/bin/bash<br>yum update -y<br>yum install -y python3<br>cat &lt;&lt; &#39;EOF&#39; &gt; /home/ec2-user/app.py<br>from http.server import HTTPServer, BaseHTTPRequestHandler<br>import json<br>class SimpleHandler(BaseHTTPRequestHandler):<br>    def do_GET(self):<br>        self.send_response(200)<br>        self.send_header(&#39;Content-Type&#39;, &#39;application/json&#39;)<br>        self.end_headers()<br>        data = {<br>            &quot;status&quot;: &quot;success&quot;,<br>            &quot;tier&quot;: &quot;private-backend&quot;,<br>            &quot;message&quot;: &quot;Hello from the Private Subnet Backend!&quot;<br>        }<br>        self.wfile.write(json.dumps(data).encode(&#39;utf-8&#39;))<br>httpd = HTTPServer((&#39;0.0.0.0&#39;, 5000), SimpleHandler)<br>httpd.serve_forever()<br>EOF<br>nohup python3 /home/ec2-user/app.py &gt; /home/ec2-user/app.log 2&gt;&amp;1 &amp;</pre><p>Now let’s create our frontend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9tfvjIE-9z6C_yry51Zblw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4puquvmCHUpzuaAG_6VDBw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DcKyFTPAda5EpM32PmEBug.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*edy_UyzcTSiubWiouiSiNA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e1801yP_E23vUcXZYV3zFQ.png" /></figure><p>Here is the full frontend script used:</p><pre>#!/bin/bash<br>yum update -y<br>yum install -y httpd php<br>cat &lt;&lt; &#39;EOF&#39; &gt; /var/www/html/index.php<br>&lt;!DOCTYPE html&gt;<br>&lt;html&gt;<br>&lt;head&gt;<br>    &lt;title&gt;2-Tier Web Application&lt;/title&gt;<br>    &lt;style&gt;<br>        body { font-family: -apple-system, BlinkMacSystemFont, &quot;Segoe UI&quot;, Roboto, sans-serif; margin: 40px; background-color: #f7f9fa; }<br>        .card { background: white; border-radius: 8px; padding: 24px; box-shadow: 0 4px 6px rgba(0,0,0,0.1); max-width: 600px; }<br>        .badge { display: inline-block; padding: 4px 8px; border-radius: 4px; font-weight: bold; font-size: 12px; }<br>        .public { background-color: #d1fae5; color: #065f46; }<br>        .private { background-color: #e0e7ff; color: #3730a3; margin-top: 15px; padding: 12px; border-radius: 6px; }<br>        pre { background: #1e293b; color: #f8fafc; padding: 12px; border-radius: 4px; overflow-x: auto; }<br>    &lt;/style&gt;<br>&lt;/head&gt;<br>&lt;body&gt;<br>    &lt;div class=&quot;card&quot;&gt;<br>        &lt;span class=&quot;badge public&quot;&gt;Public Subnet&lt;/span&gt;<br>        &lt;h2&gt;Frontend Web Server&lt;/h2&gt;<br>        &lt;p&gt;This page is hosted in the public subnet and fetches live data from the internal backend.&lt;/p&gt;<br>        &lt;div class=&quot;private&quot;&gt;<br>            &lt;strong&gt;Backend API Call Result:&lt;/strong&gt;<br>            &lt;?php<br>            $backend_ip = &quot;YOUR_BACKEND_PRIVATE_IP_HERE&quot;;<br>            $url = &quot;http://&quot; . $backend_ip . &quot;:5000&quot;;<br>            $ctx = stream_context_create(array(&#39;http&#39; =&gt; array(&#39;timeout&#39; =&gt; 5)));<br>            $response = @file_get_contents($url, false, $ctx);<br>            if ($response === FALSE) {<br>                echo &quot;&lt;p style=&#39;color: #dc2626;&#39;&gt;&lt;strong&gt;Failed to reach backend!&lt;/strong&gt; Verify that the Backend instance is running, port 5000 is open from Web Security Group, and the IP is correct.&lt;/p&gt;&quot;;<br>            } else {<br>                echo &quot;&lt;pre&gt;&quot; . htmlspecialchars($response) . &quot;&lt;/pre&gt;&quot;;<br>            }<br>            ?&gt;<br>        &lt;/div&gt;<br>    &lt;/div&gt;<br>&lt;/body&gt;<br>&lt;/html&gt;<br>EOF<br>systemctl enable httpd<br>systemctl start httpd</pre><p>Now let’s launch the instance. Once it is launched, let’s wait for a few minutes until the status changes to <strong>Running</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1MadNLfSUqBwAY3qvJg4VA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bQG-81lwyQ5BT3ocOVvVZQ.png" /></figure><p>Once it is in a <strong>Running</strong> state, you can access the frontend either through the <strong>public IP address</strong> or the <strong>public DNS</strong> of the instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EdNkL6HkQ0qKDtiMkHXGLA.png" /></figure><p>Now we have successfully deployed our two-tier application.</p><h4>Conclusion</h4><p>In this article, we explored the basics of AWS networking, including VPCs, subnets, route tables, Internet Gateways, NAT Gateways, security groups, and Network ACLs.</p><p>We then built a simple two-tier application with a frontend in a public subnet and a backend in a private subnet. The backend can access the internet through the NAT Gateway without needing a public IP.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bd2d4992c41c" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/networking-in-aws-cloud-building-a-two-tier-application-with-vpc-public-private-subnets-bd2d4992c41c">Networking in AWS Cloud: Building a Two-Tier Application with VPC, Public &amp; Private Subnets</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Bash Shell Fundamentals: From Linux Commands to Automation]]></title>
            <link>https://medium.com/@TechMarauder/bash-shell-fundamentals-from-linux-commands-to-automation-881f64c9f6a8?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/881f64c9f6a8</guid>
            <category><![CDATA[bash]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[bash-scripting]]></category>
            <category><![CDATA[bash-script]]></category>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Sat, 22 Aug 2026 06:01:38 GMT</pubDate>
            <atom:updated>2026-08-22T06:01:38.238Z</atom:updated>
            <content:encoded><![CDATA[<h3>The Bourne Again Shell: Bash Shell</h3><p>A <strong>shell</strong> is a command-line interface that accepts and interprets commands, allowing users to interact with the operating system. It provides an environment in which commands, programs, and shell scripts can be executed.</p><p>A shell generally has two main functions:</p><ul><li><strong>Program:</strong> Provides an interface for interacting with system utilities and programs.</li><li><strong>Interpreter:</strong> Accepts, interprets, and executes commands entered by the user.</li></ul><p>Linux supports several different shells, including:</p><ul><li>Bash</li><li>sh</li><li>ksh</li><li>zsh</li><li>fish</li></ul><p><strong>Bash (Bourne Again Shell)</strong> is one of the most widely used shells and is the default shell on many Linux distributions.</p><h3>Variables</h3><p>A <strong>variable</strong> is used to store a value that can be accessed and manipulated later in a shell script.</p><p>In Bash, variables can store strings, numbers, filenames, device names, and other types of data. Bash variables are not strongly typed, so values are generally treated as strings unless they are used in a context that performs arithmetic or another specific operation.</p><pre>first_name=&quot;john&quot; # variable assignment in bash<br>echo $first_name # displays the variable </pre><h4>Bash Variable Naming Rules</h4><p>By convention:</p><ul><li>Variable names are usually written in lowercase or snake_case.</li><li>Environment variables are usually written in uppercase.</li><li>Variable names can contain letters (a-z, A-Z), numbers (0-9), and underscores (_).</li><li>A variable name cannot contain spaces or most special characters.</li><li>A variable name cannot begin with a number.</li><li>There must be <strong>no spaces around the </strong><strong>= sign</strong> when assigning a variable.</li></ul><p>For example:</p><pre>name=&quot;Liben&quot;<br>age=27</pre><p>This is incorrect:</p><pre>name = &quot;Liben&quot;</pre><h4>Environment Variables</h4><p><strong>Environment variables</strong> are variables that are passed from a process to its child processes. They are commonly used to provide information about the current environment to programs and applications.</p><p>For example, environment variables can contain information such as:</p><ul><li>The current user’s home directory</li><li>The location of executable programs</li><li>The current working environment</li><li>Configuration values</li><li>Temporary directories</li></ul><p>You can access an environment variable using $:</p><pre>echo &quot;$HOME&quot;</pre><p>Environment variables can also be created using export:</p><pre>export APP_ENV=&quot;production&quot;</pre><p>The export command makes the variable available to child processes.</p><p>Some common environment variables include:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd57916267a758a76f6e3967592e6dda/href">https://medium.com/media/cd57916267a758a76f6e3967592e6dda/href</a></iframe><h4>The env Command</h4><p>The env command is used to display the environment variables available to the current shell.</p><p>Syntax</p><p>env [options]</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ae96fcd0bf044e83fa778b380fdd0110/href">https://medium.com/media/ae96fcd0bf044e83fa778b380fdd0110/href</a></iframe><h4>The alias Command</h4><p>An <strong>alias</strong> allows you to create a shortcut for a longer command. This is useful for commands that you frequently use.</p><pre>alias ll=&quot;ls -l&quot; # sets ll as an alias for ls -l</pre><p>Aliases are normally temporary and only exist for the current shell session. To make an alias persistent, you can add it to your shell configuration file, such as .bashrc.</p><p>For example:</p><pre>alias ll=&quot;ls -lah&quot;</pre><p>You can also create aliases that make potentially destructive commands interactive. For example:</p><pre>alias rm=&quot;rm -i&quot;<br>alias cp=&quot;cp -i&quot;<br>alias mv=&quot;mv -i&quot;</pre><p>The -i option asks for confirmation before performing certain operations.</p><h4>The unalias Command</h4><p>The unalias command removes an alias from the current shell.</p><p>Syntax</p><p>unalias [alias_name]</p><pre>unalias ll # unalias ll commaand</pre><h4>Bash Script</h4><p>A <strong>Bash script</strong> is a text file containing a sequence of commands that Bash can execute. Scripts are commonly used to automate repetitive tasks such as backups, deployments, system administration, and monitoring.</p><pre>#!/bin/bash<br>SOURCE=&quot;/home/user/documents&quot;<br>DEST=&quot;/home/user/backups&quot;<br>DATE=$(date +%Y-%m-%d)<br><br>mkdir -p &quot;$DEST&quot;<br>tar -czf &quot;$DEST/backup-$DATE.tar.gz&quot; &quot;$SOURCE&quot;<br>echo &quot;Backup done!&quot;</pre><p>Simple backup script example: you have to give execute permission to run the script</p><pre>chmod +x backup.sh</pre><p>Then it can be executed with:</p><pre>./backup.sh</pre><h4>The # Character</h4><p>The # character is used to create comments in Bash.</p><p>A comment is ignored by Bash when the script is executed.</p><p>For example:</p><pre># This is a comment<br>echo &quot;Hello&quot;</pre><p>Comments are useful for explaining what different parts of a script do.</p><h4>The Shebange(#!)</h4><p>The #! sequence at the beginning of a script is called a <strong>shebang</strong>.</p><p>It specifies which interpreter should be used to execute the script.</p><p>For example:</p><pre>#!/bin/bash</pre><p>This tells the system to execute the script using Bash.</p><p>Another common form is:</p><pre>#!/usr/bin/env bash</pre><p>The shebang is particularly important because different shells can have different syntax and features. Specifying the interpreter ensures that the script is executed using the expected shell.</p><h4>Script Documentation</h4><p>System administrators and developers often document their shell scripts using a standard template. Good documentation makes scripts easier to understand, maintain, and troubleshoot.</p><p>A script header commonly includes:</p><ul><li>Script name</li><li>Description</li><li>Author</li><li>Version</li><li>Date</li><li>Usage instructions</li><li>ExamplesFor example:</li></ul><pre>###############################################################################<br># Script Name : backup.sh<br># Description : Creates a compressed backup of a specified directory.<br># Author      : Liben Hailu<br># Version     : 1.0<br># Date        : 2026-08-03<br># Usage       : ./backup.sh &lt;source_directory&gt; &lt;backup_directory&gt;<br># Example     : ./backup.sh /home/liben/Documents /home/liben/backups<br>#<br># Exit Codes:<br>#   0 - Success<br>#   1 - Invalid arguments<br>#   2 - Source directory does not exist<br>###############################################################################</pre><p>Good documentation is especially useful when scripts are shared between team members or executed as part of automated systems.</p><p>Some useful commands</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/f3961bdd770ef5107e6e81f070d78274/href">https://medium.com/media/f3961bdd770ef5107e6e81f070d78274/href</a></iframe><h4>Operators</h4><p>Bash supports several types of operators.</p><h4>Arithmetic Operators</h4><p>Common arithmetic operators include:</p><pre>+    Addition<br>-    Subtraction<br>*    Multiplication<br>/    Division<br>%    Modulus</pre><p>Increment and decrement operations can also be performed using arithmetic expressions.</p><p>For example:</p><pre>a=10<br>b=5</pre><pre>sum=$((a + b))</pre><pre>echo &quot;$sum&quot;</pre><p>Output:</p><pre>15</pre><p>Bash performs arithmetic expressions using the $((...)) syntax.</p><h4>Script Arguments</h4><p><strong>Arguments</strong> are values passed to a script when the script is executed. They allow a script to receive input from the command line.</p><p>Consider this script:</p><pre>#!/bin/bash</pre><pre>sum=$(($1 + $2))</pre><pre>echo &quot;$sum&quot;</pre><p>If the script is executed as:</p><pre>./my_script.sh 2 5</pre><p>then:</p><pre>$1 = 2<br>$2 = 5</pre><p>Therefore, the result is:</p><pre>7</pre><p>Some commonly used special parameters include:</p><pre>$0    Name of the script<br>$1    First argument<br>$2    Second argument<br>$#    Number of arguments<br>$@    All arguments<br>$?    Exit status of the last command</pre><h4>Expression</h4><p>expressions use $(( expression )) notation to evaluate expressions; expressions are evaluated and usually assigned to a variable.</p><h4>Conditional Statement</h4><p>Conditional statements allow a script to execute different blocks of code depending on whether a condition is true or false.</p><p>Bash supports structures such as:</p><ul><li>if</li><li>if-else</li><li>if-elif-else</li><li>case</li><li>test</li></ul><p>For example:</p><pre>#!/bin/bash<br><br>marks=75<br><br>if [ &quot;$marks&quot; -ge 90 ]; then<br>    echo &quot;Grade A&quot;<br>elif [ &quot;$marks&quot; -ge 70 ]; then<br>    echo &quot;Grade B&quot;<br>else<br>    echo &quot;Grade C&quot;<br>fi</pre><p>Output:</p><pre>Grade B</pre><p>The condition is evaluated first. If it is true, the corresponding block is executed. Otherwise, Bash checks the next condition.</p><p>There are different logical control statements; these are: if, if-else, if-elif-else, and test.</p><h4>The test command</h4><p>The test command is used to evaluate conditions. It can be used to compare values and check properties of files and directories.</p><p>Syntax</p><pre>test &lt;expression&gt;</pre><p>For example:</p><pre>test 100 -lt 99</pre><p>This condition is false because 100 is not less than 99.</p><p>The test command returns an <strong>exit status</strong>:</p><ul><li>0 means the condition is true.</li><li>A non-zero value means the condition is false.</li></ul><p>The [ ... ] syntax is commonly used as an alternative to test:</p><pre>[ &quot;$marks&quot; -ge 70 ]</pre><h4>Comparison Operators</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/19b6b65a2be20bcd908bf9ae3111b502/href">https://medium.com/media/19b6b65a2be20bcd908bf9ae3111b502/href</a></iframe><h4>Loop Statement</h4><p>Loops allow a block of code to be executed repeatedly.</p><p>Common Bash loops include:</p><ul><li>for — iterates over a list of values.</li><li>while — continues while a condition is true.</li><li>until — continues until a condition becomes true.</li></ul><h4>for Loop</h4><pre>for name in John Alice Bob<br>do<br>    echo &quot;Hello $name&quot;<br>done</pre><p>This prints a greeting for each name.</p><h4>while Loop</h4><p>A while loop continues as long as its condition is true.</p><pre>count=1<br><br>while [ &quot;$count&quot; -le 5 ]<br>do<br>    echo &quot;Count: $count&quot;<br>    count=$((count + 1))<br>done</pre><h4>until Loop</h4><p>An until loop continues until its condition becomes true.</p><pre>count=1<br>until [ &quot;$count&quot; -gt 5 ]<br>do<br>    echo &quot;Count: $count&quot;<br>    count=$((count + 1))<br>done</pre><h4>Loop control statement</h4><p>Bash provides two important commands for controlling loops:</p><h3>break</h3><p>break immediately terminates the current loop.</p><h3>continue</h3><p>continue skips the rest of the current iteration and moves to the next iteration.</p><p>For example:</p><pre>#!/bin/bash<br><br>for number in {1..5}<br>do<br>    if [ &quot;$number&quot; -eq 3 ]; then<br>        continue<br>    fi<br><br>    if [ &quot;$number&quot; -eq 5 ]; then<br>        break<br>    fi<br><br>    echo &quot;Number: $number&quot;<br>done<br>echo &quot;Loop finished&quot;</pre><p>The output is:</p><pre>Number: 1<br>Number: 2<br>Number: 4<br>Loop finished</pre><p>When number is 3, continue skips that iteration. When number is 5, break terminates the loop completely.</p><h4>The read Command</h4><p>The read command allows a Bash script to receive input from the user and store it in a variable.</p><p>For example:</p><pre>#!/bin/bash<br><br>echo &quot;Enter your name:&quot;<br>read name<br>echo &quot;Hello, $name&quot;</pre><p>When the user enters their name, the value is stored in the name variable.</p><p>You can also use read -p to display the prompt directly:</p><pre>read -p &quot;Enter your name: &quot; name<br>echo &quot;Hello, $name&quot;</pre><h4>The exit Command</h4><p>The exit command terminates a Bash script and returns an <strong>exit status</strong> to the shell or calling process.</p><p>Common exit statuses include:</p><pre>0       Success<br>1       General error<br>n       A specific error condition</pre><p>By convention, an exit status of 0 indicates success, while a non-zero status indicates an error or another condition.</p><p>For example:</p><pre>#!/bin/bash<br>FILE=&quot;/tmp/test.txt&quot;<br><br>if [ ! -f &quot;$FILE&quot; ]; then<br>    echo &quot;Error: File does not exist&quot;<br>    exit 1<br>fi<br>echo &quot;File found&quot;<br>exit 0</pre><p>If the file does not exist, the script prints an error message and exits with status 1.</p><p>If the file exists, the script continues and eventually exits successfully with status 0.</p><p>You can check the exit status of the previous command using:</p><pre>echo $?</pre><p>For example:</p><pre>ls /tmp<br>echo $?</pre><p>If ls executes successfully, $? will contain 0.</p><h4>Conclusion</h4><p>Bash is much more than a tool for executing individual Linux commands. It provides a complete scripting environment that can be used to automate system administration tasks, manage files and processes, perform calculations, handle user input, and make decisions based on conditions.</p><p>Understanding variables, environment variables, aliases, scripts, arguments, conditional statements, loops, and exit statuses provides a strong foundation for writing useful Bash automation scripts and working effectively with Linux systems.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=881f64c9f6a8" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Computer Fundamentals: Understanding What Happens Inside a Computer]]></title>
            <link>https://medium.com/@TechMarauder/computer-fundamentals-understanding-what-happens-inside-a-computer-9c8a2e2bcefe?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9c8a2e2bcefe</guid>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Sat, 08 Aug 2026 19:57:50 GMT</pubDate>
            <atom:updated>2026-08-08T19:57:50.233Z</atom:updated>
            <content:encoded><![CDATA[<p>When we use a computer every day, we interact with applications, websites, files, and other software without thinking much about what is happening underneath.</p><p>But what actually happens when we press a key, open an application, save a file, or connect a USB device?</p><p>To understand computers at a deeper level, we need to understand how they represent information, how instructions are executed, how memory and storage work, and how the different hardware components communicate.</p><p>These are my notes and key takeaways from studying computer fundamentals.</p><h3>What Is a Computer?</h3><p>A computer is a device that stores and processes data by performing calculations.</p><p>At a high level, we can think of a computer as a system that performs four fundamental operations:</p><p><strong>Input → Processing → Output → Storage</strong></p><p>For example, when we type something on a keyboard:</p><ol><li>The keyboard provides input.</li><li>The computer processes that input.</li><li>The result is displayed on the screen.</li><li>The information can be stored if we save it.</li></ol><p>But underneath all of this, computers ultimately work with binary.</p><h3>Understanding the Binary System</h3><p>The <strong>binary system</strong>, also known as the <strong>base-2 numeral system</strong>, is fundamental to computing.</p><p>Unlike the decimal system, which uses ten digits from 0 to 9, binary uses only two values:</p><pre>0<br>1</pre><p>A single binary digit is called a <strong>bit</strong>.</p><p>A group of eight bits is called a <strong>byte</strong>.</p><p>Because each bit can have two possible states, eight bits can represent:</p><pre>2⁸ = 256</pre><p>different values.</p><p>This simple representation of 0s and 1s forms the foundation of digital computing.</p><h3>Character Encoding</h3><p>Computers need a way to represent characters such as letters, numbers, and punctuation using binary.</p><p>This is where <strong>character encoding</strong> comes in.</p><p>Character encoding provides a mapping between characters and numerical values that computers can represent in binary.</p><h3>ASCII</h3><p><strong>ASCII (American Standard Code for Information Interchange)</strong> is one of the oldest and most widely known character encoding standards.</p><p>It represents English letters, digits, and punctuation.</p><p>ASCII defines 128 characters. This wasn’t enough to represent all of the characters needed for different languages around the world.</p><h3>UTF-8</h3><p><strong>UTF-8</strong> addresses this limitation.</p><p>It is compatible with ASCII for the original ASCII characters while allowing characters to use different numbers of bytes.</p><p>This makes it possible to represent characters from many different writing systems.</p><p>UTF-8 is one of the most widely used character encoding standards today.</p><h3>How Computers Understand Instructions</h3><p>We use programs every day:</p><ul><li>Web browsers</li><li>Text editors</li><li>Music players</li><li>Games</li><li>Development tools</li><li>Mobile applications</li></ul><p>But what exactly is a program?</p><p>A <strong>program is a set of instructions that tells a computer what to do.</strong></p><p>These instructions are stored in persistent storage such as an HDD or SSD.</p><p>When a program needs to run, the operating system loads the necessary instructions and data into RAM, where the CPU can access them.</p><p>At a lower level, the CPU executes machine instructions defined by the processor’s instruction set.</p><p>This gives us a simplified picture:</p><pre>Program<br>   ↓<br>Machine Instructions<br>   ↓<br>CPU<br>   ↓<br>Hardware Operations</pre><h3>The CPU</h3><p>The <strong>Central Processing Unit (CPU)</strong> is one of the most important components of a computer.</p><p>It executes instructions and performs calculations.</p><p>A CPU works with several components that help it process information efficiently:</p><ul><li>Registers</li><li>Cache</li><li>Cores</li><li>Control logic</li><li>Arithmetic and logic units</li><li>Memory</li><li>Clock</li></ul><p>Let’s look at some of these components.</p><h3>Registers</h3><p><strong>Registers</strong> are small, extremely fast storage locations inside the CPU.</p><p>They temporarily hold information that the CPU is actively working with.</p><p>For example, a register might contain:</p><ul><li>A number being calculated</li><li>A memory address</li><li>An instruction</li><li>An intermediate result</li></ul><p>Because registers are located directly inside the CPU, they are extremely fast.</p><h3>CPU Cache</h3><p>RAM is significantly slower than the CPU.</p><p>If the CPU had to wait for RAM every time it needed data, a lot of processing time would be wasted.</p><p>This is where <strong>CPU cache</strong> comes in.</p><p>Cache stores frequently accessed data and instructions close to the CPU so they can be accessed more quickly.</p><p>Modern CPUs typically have multiple cache levels:</p><ul><li><strong>L1</strong> — smallest and fastest</li><li><strong>L2</strong> — larger but slower than L1</li><li><strong>L3</strong> — generally larger and slower than L2</li></ul><p>The basic idea is simple:</p><blockquote><em>Keep frequently needed information as close to the CPU as possible.</em></blockquote><h3>The CPU Instruction Cycle</h3><p>At a simplified level, the CPU repeatedly performs an instruction cycle:</p><ol><li><strong>Fetch</strong> — retrieve an instruction from memory.</li><li><strong>Decode</strong> — determine what the instruction means.</li><li><strong>Execute</strong> — perform the required operation.</li><li><strong>Store</strong> — save the result when necessary.</li></ol><p>This happens extremely quickly.</p><p>A simple program may contain thousands or millions of instructions, and the CPU processes them continuously.</p><h3>CPU Cores</h3><p>Modern CPUs usually contain multiple <strong>cores</strong>.</p><p>A CPU core can independently execute instructions.</p><p>For example:</p><ul><li>Single-core → 1 core</li><li>Dual-core → 2 cores</li><li>Quad-core → 4 cores</li><li>Octa-core → 8 cores</li></ul><p>Multiple cores allow a processor to handle multiple streams of work concurrently, depending on the workload and the software.</p><p>This is one reason modern computers can run many applications at the same time.</p><h3>External Data Bus</h3><p>The <strong>External Data Bus (EDB)</strong> is a group of wires that connects different parts of a computer and allows data to move between them.</p><p>At a simplified level, electrical signals can represent binary states:</p><pre>Signal present → 1<br>Signal absent  → 0</pre><p>Data buses can have different widths, such as:</p><ul><li>8-bit</li><li>16-bit</li><li>32-bit</li><li>64-bit</li></ul><p>A wider bus can transfer more bits in a single transfer.</p><p>For example, an 8-bit data bus can transfer one byte at a time.</p><p>Modern computers use much more sophisticated interconnects than the simple bus model suggests, but the fundamental idea remains the same: <strong>components need a way to exchange information.</strong></p><h3>Transistors</h3><p>At the physical foundation of modern computing are <strong>transistors</strong>.</p><p>Transistors control electrical signals and allow electronic circuits to represent different states.</p><p>By combining transistors, engineers can create <strong>logic gates</strong>.</p><p>Common logic gates include:</p><ul><li>AND</li><li>OR</li><li>NOT</li><li>XOR</li></ul><p>These gates can be combined into increasingly complex circuits.</p><p>At a very high level:</p><pre>Transistors<br>     ↓<br>Logic Gates<br>     ↓<br>Digital Circuits<br>     ↓<br>Processors and Memory<br>     ↓<br>Computer</pre><p>Modern processors contain billions of transistors.</p><h3>Memory Controller</h3><p>The <strong>Memory Controller</strong> manages communication between the CPU and system memory.</p><p>In older computer architectures, memory controllers were commonly part of the motherboard chipset.</p><p>In many modern systems, the memory controller is integrated directly into the CPU.</p><p>Its job is to coordinate access between the processor and RAM.</p><h3>Address Bus</h3><p>The <strong>address bus</strong> communicates the location of the data that the CPU wants to access.</p><p>This is different from the data bus.</p><p>A simplified example is:</p><pre>CPU<br> │<br> │  &quot;I need data from this address&quot;<br> ↓<br>Address Bus<br> │<br> ↓<br>Memory<br> │<br> │  &quot;Here is the data&quot;<br> ↓<br>Data Bus<br> │<br> ↓<br>CPU</pre><p>The address tells the computer <strong>where</strong> the data is.</p><p>The data bus carries <strong>the actual data</strong>.</p><h3>CPU Clock and Clock Speed</h3><p>The CPU uses a clock signal to coordinate operations.</p><p>When we see a CPU advertised as running at <strong>3.0 GHz</strong>, this refers to its clock frequency.</p><p>One gigahertz represents one billion cycles per second.</p><p>However, clock speed alone does not determine CPU performance.</p><p>Two CPUs running at the same frequency can have very different performance because of differences in:</p><ul><li>Architecture</li><li>Number of cores</li><li>Instructions per cycle</li><li>Cache</li><li>Memory subsystem</li><li>Power limits</li><li>Thermal design</li></ul><p>Therefore, comparing CPUs based only on GHz can be misleading.</p><h3>CPU Architecture</h3><p>CPUs can have different architectures, including <strong>32-bit</strong> and <strong>64-bit</strong> architectures.</p><p>A 64-bit processor can work with wider values and address a much larger memory space than a 32-bit processor.</p><p>There are also different instruction set architectures, such as:</p><ul><li>x86–64</li><li>ARM</li><li>RISC-V</li></ul><p>The instruction set architecture defines the instructions and programming model that software targets when running on a processor.</p><h3>RAM</h3><p><strong>RAM (Random Access Memory)</strong> is the computer’s working memory.</p><p>Unlike persistent storage, RAM is <strong>volatile memory</strong>.</p><p>This means that its contents are normally lost when power is removed.</p><p>When you open an application, the operating system loads the necessary program instructions and data from storage into RAM.</p><p>The CPU can then access that information much more efficiently than repeatedly reading it from persistent storage.</p><h3>DRAM</h3><p>One common type of RAM is <strong>DRAM (Dynamic Random Access Memory)</strong>.</p><p>Modern computers commonly use <strong>DDR SDRAM (Double Data Rate Synchronous Dynamic Random Access Memory)</strong>.</p><p>Different generations include:</p><ul><li>DDR</li><li>DDR2</li><li>DDR3</li><li>DDR4</li><li>DDR5</li></ul><p>Each generation has introduced improvements in speed, capacity, and power efficiency.</p><h3>The Memory Hierarchy</h3><p>We can combine what we have learned so far into a memory hierarchy.</p><p>From fastest and smallest to slower and larger, we can roughly think of it as:</p><pre>Registers<br>    ↓<br>L1 Cache<br>    ↓<br>L2 Cache<br>    ↓<br>L3 Cache<br>    ↓<br>RAM<br>    ↓<br>SSD<br>    ↓<br>HDD</pre><p>The closer storage is to the CPU, the faster it generally is.</p><p>However, faster storage is typically more expensive and available in smaller quantities.</p><p>This trade-off between <strong>speed, capacity, and cost</strong> is one of the fundamental ideas in computer architecture.</p><h3>The Motherboard</h3><p>The <strong>motherboard</strong> is the main circuit board that connects many of the components in a computer.</p><p>It provides connections for:</p><ul><li>CPU</li><li>RAM</li><li>Storage</li><li>Graphics</li><li>Expansion cards</li><li>USB devices</li><li>Network interfaces</li></ul><p>Important motherboard characteristics include:</p><ul><li>CPU socket</li><li>Memory slots</li><li>Expansion slots</li><li>Storage interfaces</li><li>Chipset</li><li>Form factor</li></ul><h3>Chipset: Northbridge and Southbridge</h3><p>Older computer architectures commonly used two major chipset components.</p><h3>Northbridge</h3><p>The <strong>Northbridge</strong> handled high-speed communication involving components such as the CPU, RAM, and graphics.</p><h3>Southbridge</h3><p>The <strong>Southbridge</strong> handled many input/output operations, including communication with storage devices and peripherals.</p><p>However, this terminology is largely historical.</p><p>Modern computer architectures have moved many of these responsibilities into the CPU and other dedicated controllers.</p><p>Understanding these terms is still useful because they appear frequently in older computer architecture and IT support materials.</p><h3>Expansion Slots</h3><p>Expansion slots allow us to extend the functionality of a computer.</p><p>For example, we can install:</p><ul><li>Graphics cards</li><li>Network cards</li><li>Sound cards</li><li>Storage controllers</li></ul><p>One of the most important modern standards for expansion is <strong>PCI Express (PCIe)</strong>.</p><h3>GPU</h3><p>Another important component is the <strong>GPU (Graphics Processing Unit)</strong>.</p><p>While CPUs are designed for general-purpose processing, GPUs are designed to perform many operations in parallel.</p><p>This makes GPUs particularly useful for:</p><ul><li>Graphics rendering</li><li>Video processing</li><li>Machine learning</li><li>Scientific computing</li><li>Other highly parallel workloads</li></ul><p>A GPU can be integrated into a processor or provided as a dedicated graphics card.</p><h3>Motherboard Form Factor</h3><p>The <strong>form factor</strong> describes the physical dimensions and layout of a hardware component.</p><p>For motherboards, common form factors include:</p><ul><li>ATX</li><li>Micro-ATX</li><li>Mini-ITX</li></ul><p>The form factor affects the physical size of the motherboard and determines what type of computer case it can fit into.</p><h3>Storage: HDD vs SSD</h3><p>RAM is temporary working memory, but computers also need <strong>persistent storage</strong>.</p><p>Persistent storage keeps information even when the computer is turned off.</p><p>Two common storage technologies are:</p><ul><li>HDD</li><li>SSD</li></ul><h3>HDD — Hard Disk Drive</h3><p>A <strong>Hard Disk Drive (HDD)</strong> uses spinning magnetic platters and a mechanical arm to read and write data.</p><p>HDD performance is commonly associated with <strong>RPM (revolutions per minute)</strong>.</p><p>Because HDDs contain moving mechanical components, they can be more susceptible to mechanical wear and physical damage.</p><h3>SSD — Solid State Drive</h3><p>An <strong>SSD (Solid State Drive)</strong> stores data using flash memory instead of spinning magnetic platters.</p><p>SSDs have no moving mechanical parts and generally provide much faster access times than traditional HDDs.</p><p>This is why SSDs have become standard in modern computers.</p><h3>SATA and NVMe</h3><p>Storage devices need an interface and protocol to communicate with the computer.</p><p><strong>SATA (Serial ATA)</strong> is a widely used storage interface.</p><p><strong>NVMe (Non-Volatile Memory Express)</strong> is designed for high-speed non-volatile storage and commonly operates over PCI Express.</p><p>This allows NVMe SSDs to provide significantly higher performance than traditional SATA-based storage.</p><h3>Power Supply</h3><p>Computers require electrical power, but electricity from a wall outlet cannot simply be sent directly to every component.</p><p>Electrical current can broadly be described as:</p><ul><li><strong>AC (Alternating Current)</strong> — current periodically changes direction.</li><li><strong>DC (Direct Current)</strong> — current flows in one direction.</li></ul><p>A computer’s <strong>Power Supply Unit (PSU)</strong> converts AC power from the electrical outlet into the appropriate DC voltages required by computer components.</p><h3>Peripherals</h3><p>A <strong>peripheral</strong> is a device connected to a computer that provides additional functionality.</p><p>Examples include:</p><ul><li>Keyboard</li><li>Mouse</li><li>Monitor</li><li>Printer</li><li>Webcam</li><li>External storage</li></ul><p>One of the most common connection standards is <strong>USB (Universal Serial Bus)</strong>.</p><p>Some USB standards include:</p><ul><li>USB 2.0 — up to 480 Mb/s</li><li>USB 3.0 — up to 5 Gb/s</li><li>USB 3.1 — up to 10 Gb/s</li></ul><p>It is also important to distinguish between bits and bytes:</p><ul><li><strong>MB</strong> = megabyte</li><li><strong>Mb/s</strong> = megabits per second</li></ul><p>Since one byte contains eight bits, these units should not be confused.</p><h3>Drivers</h3><p>When we connect a device such as a mouse, keyboard, printer, or webcam, the operating system needs software that allows it to communicate with that device.</p><p>This software is called a <strong>device driver</strong>.</p><p>Drivers provide the instructions and interfaces necessary for the operating system to interact with specific hardware.</p><p>This is also a good example of <strong>abstraction</strong>.</p><p>Applications don’t need to understand the electrical details of a mouse. They can interact with the operating system, while the operating system and driver handle the hardware-specific details.</p><h3>The Operating System</h3><p>The <strong>operating system (OS)</strong> is another important layer between applications and hardware.</p><p>A simplified view looks like this:</p><pre>Applications<br>      ↓<br>Operating System<br>      ↓<br>Drivers / System Interfaces<br>      ↓<br>Hardware</pre><p>The operating system manages resources such as:</p><ul><li>CPU</li><li>Memory</li><li>Storage</li><li>Processes</li><li>Files</li><li>Devices</li><li>Networking</li></ul><p>Instead of applications directly controlling every hardware component, they can use operating-system abstractions.</p><p>This makes software development much easier and allows the same application to work across different hardware configurations.</p><h3>BIOS, UEFI, and the Boot Process</h3><p>When we press the power button, the operating system does not immediately appear.</p><p>Several things happen first.</p><p>A simplified boot process looks like this:</p><pre>Power On<br>   ↓<br>Firmware starts<br>   ↓<br>Hardware initialization<br>   ↓<br>POST<br>   ↓<br>Find boot device<br>   ↓<br>Load bootloader<br>   ↓<br>Load operating system<br>   ↓<br>OS initialization<br>   ↓<br>Login / Desktop</pre><h3>BIOS</h3><p><strong>BIOS (Basic Input/Output System)</strong> is traditional firmware used to initialize hardware and begin the boot process.</p><h3>UEFI</h3><p><strong>UEFI (Unified Extensible Firmware Interface)</strong> is the modern replacement for traditional BIOS.</p><p>It performs the same fundamental role of initializing hardware and starting the boot process while providing additional capabilities and support for modern hardware.</p><p>The firmware is stored in non-volatile memory on the motherboard.</p><h3>POST</h3><p><strong>POST (Power-On Self-Test)</strong> is part of the startup process.</p><p>It checks the available hardware and helps determine whether the computer can continue with the boot process.</p><h3>CMOS</h3><p>You may also hear the term <strong>CMOS</strong> when discussing BIOS settings.</p><p>Historically, a small amount of battery-backed memory was used to store system configuration information such as the date, time, and firmware settings.</p><p>Today, the term “CMOS” is still commonly used when referring to firmware configuration, even though modern systems use more advanced technologies for storing these settings.</p><h3>Reimaging a Computer</h3><p>In IT support, you may come across the term <strong>reimaging</strong>.</p><p>A <strong>disk image</strong> is a copy of an operating system or system configuration.</p><p><strong>Reimaging</strong> involves wiping a system and reinstalling the operating system using an appropriate image.</p><p>This can be useful when:</p><ul><li>Preparing computers for new users</li><li>Recovering corrupted systems</li><li>Standardizing machines</li><li>Deploying computers in an organization</li></ul><h3>What Happens When You Open an Application?</h3><p>Now let’s connect everything together.</p><p>Imagine that you double-click your web browser.</p><h3>1. Input</h3><p>You move your mouse and click.</p><p>The mouse sends input to the computer.</p><h3>2. Operating System</h3><p>The operating system receives the input through the appropriate driver and determines what action should be taken.</p><h3>3. Storage</h3><p>The browser’s program files are stored on an SSD or HDD.</p><h3>4. Loading</h3><p>The operating system loads the necessary program instructions and data from storage into RAM.</p><h3>5. CPU</h3><p>The CPU fetches and executes the instructions.</p><h3>6. Cache</h3><p>Frequently accessed instructions and data may be stored in CPU cache so that they can be accessed more quickly.</p><h3>7. GPU</h3><p>If graphical processing is required, the CPU and GPU work together to render the interface.</p><h3>8. Display</h3><p>The resulting graphical information is sent to the monitor.</p><p>And the process continues as you interact with the application.</p><p>What looks like a simple action — opening an application — involves many layers of hardware and software working together.</p><h3>Putting Everything Together</h3><p>We can now create a simplified mental model of a computer:</p><pre>┌───────────────┐<br>                  │      CPU      │<br>                  │               │<br>                  │ Cores         │<br>                  │ Registers     │<br>                  │ Cache         │<br>                  └───────┬───────┘<br>                          │<br>                     Interconnect<br>                          │<br>          ┌───────────────┼───────────────┐<br>          │               │               │<br>         RAM           Storage            GPU<br>          │           SSD / HDD            │<br>          │               │               │<br>          └───────────────┼───────────────┘<br>                          │<br>                     Motherboard<br>                          │<br>               ┌──────────┴──────────┐<br>               │                     │<br>          Peripherals             Network</pre><p>Above this hardware sits the operating system, which provides abstractions that applications can use.</p><p>This layered design is one of the most important concepts in computing.</p><h3>Key Takeaways</h3><p>After studying these topics, some of the concepts that stood out to me were:</p><ul><li><strong>Binary</strong> is the foundation for representing information in digital computers.</li><li><strong>Bytes</strong> are groups of eight bits.</li><li><strong>Character encoding</strong> allows computers to represent human-readable characters.</li><li><strong>The CPU</strong> executes instructions and performs calculations.</li><li><strong>Registers and cache</strong> provide fast access to information close to the CPU.</li><li><strong>RAM</strong> provides temporary working memory.</li><li><strong>Storage</strong> provides persistent data storage.</li><li><strong>The motherboard</strong> connects the major components of a computer.</li><li><strong>The GPU</strong> is optimized for highly parallel workloads.</li><li><strong>Drivers</strong> allow software to communicate with hardware.</li><li><strong>The operating system</strong> manages hardware resources and provides useful abstractions.</li><li><strong>BIOS and UEFI</strong> initialize hardware and start the boot process.</li><li><strong>Transistors and logic gates</strong> form the physical foundation of digital computing.</li><li><strong>Buses and interconnects</strong> allow components to communicate.</li></ul><h3>Final Thoughts</h3><p>Before studying computer fundamentals, it was easy to think of a computer as a single machine that simply runs applications.</p><p>Breaking it down into its individual components makes the picture much clearer.</p><p>When we type something, input is generated by a peripheral. The operating system and drivers process that input. Programs provide instructions, which the CPU executes. RAM holds the data and instructions currently being used, while cache keeps frequently accessed information close to the CPU. Storage keeps information persistently, and the GPU can handle highly parallel graphical workloads.</p><p>All of these components communicate through different interfaces and interconnects, while firmware initializes the hardware and starts the operating system.</p><p>What looks like a simple action — opening an application, typing a word, or saving a file — is actually the result of many layers of hardware and software working together.</p><p>Understanding these fundamentals provides a foundation for learning more advanced topics such as <strong>operating systems, networking, distributed systems, cloud computing, cybersecurity, and systems engineering</strong>.</p><p>These concepts may seem basic, but they answer an important question:</p><blockquote><strong><em>What is actually happening underneath the software we use every day?</em></strong></blockquote><p>Understanding that layer is an important step toward becoming a better engineer.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9c8a2e2bcefe" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Essentials: Everything You Need to Know to Get Started]]></title>
            <link>https://medium.com/@TechMarauder/linux-essentials-everything-you-need-to-know-to-get-started-2ed836732326?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2ed836732326</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linux-administration]]></category>
            <category><![CDATA[linux-commands]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Thu, 06 Aug 2026 12:30:52 GMT</pubDate>
            <atom:updated>2026-08-06T12:30:52.017Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is Linux</h3><p>A computer consists of <strong>hardware</strong> and <strong>software</strong>, and it requires an <strong>operating system (OS)</strong> to function. The OS manages hardware resources, provides services for applications, and ensures multiple programs can run efficiently without competing for all system resources. <strong>Linux</strong> is a free, open-source, and highly customizable operating system built around the <strong>Linux kernel</strong>, created by <strong>Linus Torvalds</strong> in <strong>1991</strong>. Many Linux <strong>distributions</strong>, such as <strong>Ubuntu, Debian, and Red Hat Enterprise Linux (RHEL)</strong>, package the kernel with additional software for different use cases.</p><h3>Major components of Linux OS</h3><h4>1 - Kernel</h4><p>The <strong>kernel</strong> is the core functionalities of the operating system. It manages <strong>CPU time</strong>, <strong>memory</strong>, <strong>hardware devices</strong>, and <strong>system resources</strong>, allowing multiple applications and users to share the computer efficiently. It also handles <strong>process management</strong>, <strong>memory management</strong>, <strong>file systems</strong>, <strong>device communication (I/O)</strong>, and <strong>resource allocation</strong>.</p><h4>2 - Daemons</h4><p><strong>Daemons</strong> are background processes that provide system services without direct user interaction. They usually start automatically and their names often end with “<strong>d”</strong>. Examples include <strong>syslogd</strong>, which collects and manages system logs, and <strong>sshd</strong>, which listens for incoming SSH connections.</p><h4>3 - Applications</h4><p><strong>Applications</strong> are user-facing software programs that help users perform specific tasks. They run on top of the operating system and use system resources provided by the OS. Examples include <strong>web browsers, games, databases, text editors, and note-taking applications</strong>.</p><h4>4 - Data files</h4><p><strong>Data files</strong> are files that contain information used or created by programs. They can store different types of data, such as <strong>images, music, documents, and text</strong>. Data files are organized into <strong>directories (folders)</strong>, which help group and manage files. A file is usually represented in the format <strong>directory_name/filename.extension</strong>, where the filename should be unique within the same directory.</p><h4>5 - Configuration files</h4><p><strong>Configuration files</strong> store settings and preferences used by the Linux system, services, and applications. They are usually plain text files that define initial values, options, or behavior for programs. Some configuration files can also contain commands or scripts that run during system startup. Common extensions include <strong>.conf, </strong><strong>.cfg, </strong><strong>.cnf, </strong><strong>.cf, and </strong><strong>.ini</strong>.</p><p>Example:</p><ul><li><strong>/etc/group</strong> → Stores information about system groups and their users.</li></ul><h3>Linux interfaces</h3><p><strong>Linux commonly provides two types of interfaces:</strong><br><strong>CLI (Command-Line Interface)</strong> — A text-based interface where users interact with the system by typing commands. Many servers use CLI because it is lightweight and efficient.<br><strong>GUI (Graphical User Interface)</strong> — A visual interface that uses windows, icons, and menus, commonly used on desktop systems.</p><p>When using the CLI, the <strong>shell</strong> interprets commands and provides the available commands and features. Different shells offer different functionality. Common Linux shells include:</p><ul><li><strong>sh (Bourne Shell)</strong> — The original Unix shell.</li><li><strong>bash (Bourne Again Shell)</strong> — An enhanced version of sh and the default shell in many Linux distributions.</li><li><strong>ksh (Korn Shell)</strong> — A Unix shell with additional scripting features.</li></ul><h3>Linux Command Line</h3><p><strong>Linux commands are case-sensitive</strong>, meaning ls and LS are treated as different commands. Commands generally follow this syntax:</p><p><strong>command [options] [arguments]</strong></p><ul><li><strong>Command</strong> — Specifies the action you want Linux to perform.</li><li><strong>Options</strong> — Modify how the command behaves (usually start with - or --).</li><li><strong>Arguments</strong> — Specify the target the command operates on.</li></ul><p>Example:</p><pre>man -i whoami</pre><ul><li><strong>Command:</strong> man → Displays manual pages.</li><li><strong>Option:</strong> -i → Performs a case-insensitive search.</li><li><strong>Argument:</strong> whoami → The manual page or topic to search for.</li></ul><h3>Useful Commands</h3><h4>whoami command</h4><p><strong>whoami</strong> – Displays the username of the current logged-in user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ylrJ1vI7srl_QRMkBechfQ.png" /></figure><h4>id command</h4><p><strong>id</strong> – Displays the user ID (UID), group ID (GID), and groups associated with the current user.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*w2LvtuTEo_9nihr0BZuPdg.png" /></figure><p>As it is shown in the screen shot</p><p>uid=1000(ec2-user) → User ID is 1000, username is ec2-user<br>gid=1000(ec2-user) → Primary group ID is 1000, group name is ec2-user<br>groups=… → The user belongs to the ec2-user, adm, wheel, systemd-journal Sales, HR, Finance, Shipping, Managers and CEO</p><p>To check another user information use id and user name as argument</p><pre>id root</pre><h4>hostname command</h4><p><strong>hostname</strong> – Displays or sets the system&#39;s hostname, which identifies the machine on a network (TCP/IP). It can show the current host name, domain name, or node name of the system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8cv1S1ZNoaMX3cJT34NyAA.png" /></figure><h4>uptime command</h4><p>Displays how long the system has been up since the last boot</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yUiiMJUKDQynDE8foARdcQ.png" /></figure><h4>date command</h4><p>The Linux date command is used to <strong>display and set the system date and time</strong>. It is commonly used in scripts, logging, automation, and system administration.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kiglwgtqZwQB6IIcvqm9kw.png" /></figure><h4>cal command</h4><p>The cal command is used to display a simple calendar. If no arguments are specified, the current month is displayed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZwxJduVy2JbYQXshifG38A.png" /></figure><h4>clear command</h4><p>The clear command is used to clear the terminal screen</p><h4>echo command</h4><p>The echo command displays the specified text on the screen. It is commonly used in scripts to provide users with information as the script runs</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*wUKVa9KNDvKyqXuJgkXkMQ.png" /></figure><h4>history command</h4><p>Bash keeps a history of user commands in a file located in the user’s home directory. The history command is used to view the command history</p><p>history stored in /home/username/.bash_history</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*En37zQkjM1P05YAx0rxNDw.png" /></figure><p>if you want to re-run a command from the history use</p><p>!&lt;command_nummber&gt;</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*J1LCkfbSjKq8cTaH9yi--w.png" /></figure><p>bash keeps history of commands, up and down cycles through the output of history</p><h4>touch command</h4><p>touch command is used to create, change, or modify timestamp on existing file, it can also be used to create empty file in a directory</p><p>you can create more than one file at a time</p><pre>touch file1 file2 file3</pre><h4>cat command</h4><p>cat(concatenate) command reads data from file and provides the content output as output with in the terminal window</p><h3>Users and Groups</h3><p>user accounts represent a user on the system, it is best practice to assign one user per account(don’t share account), user information(accounts) is stored in<strong> /etc/passwd</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W2kea6z8l2Nb2GZHcb3QlQ.png" /></figure><p>In the above example</p><p><strong>Username </strong>ssarkar</p><p><strong>Password</strong>x(the password hash is stored in /etc/shadow)</p><p><strong>UID</strong>1010</p><p><strong>GID</strong>1010</p><p><strong>Home Directory</strong>/home/ssarkar</p><p><strong>Login Shell</strong>/bin/bash</p><h4>useradd command</h4><p>creates user account, create home directory for user in /home</p><pre>useradd john<br>id john # prints user id for a user john<br>grep john /etc/passwd # grep searchs for a string in a file</pre><p>useradd options</p><ul><li><strong>-c </strong>comment helps to hold full name eg: useradd -c &quot;Liben&quot; liben</li><li><strong>-e</strong> adds expiration eg: useradd -e 2027-01-01 liben</li><li><strong>-d</strong> sets home directory path eg: useradd -d /users/liben liben</li></ul><h4>usermod command</h4><p>usermod command helps to modify or change parts of or the whole existing user account</p><p>usermod options</p><ul><li><strong>-c </strong>comment helps to hold full name eg: usermod -c &quot;Liben&quot; liben</li><li><strong>-e</strong> adds expiration eg: usermod -e 2027-01-01 liben</li></ul><h4>userdel command</h4><p>userdel command delete user account, r option deletes user’s home directory.</p><pre>useradd john <br>id john<br>userdel -r john<br>id john # should print no such user</pre><h4>passwd command</h4><p>user password are set by passwd command, you must enter the password twice</p><p>users can reset their own password, and the root user can reset any user password.</p><pre>passwd john # john is the user name of the user </pre><h4>Managing User Groups</h4><p>A group is set of accounts with similar security needs, easier to give permission that share similar need than giving individually.</p><p>storage location for group is /etc/group</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MKl5-bYpAB8MxJwxFI_n1Q.png" /></figure><p>for example for the CEO group in the above example</p><p><strong>Group Name </strong>CEO</p><p><strong>Password </strong>x(place holder for group password)</p><p><strong>GID</strong>1017(group id)</p><p><strong>Group Members</strong>mjackson,ec2-user</p><p>As you have seen for users there are alternative commands for groups aswell like groupadd, groupmod, groupdel command</p><ul><li><strong>groupadd </strong>creates a new group eg: groupadd group</li><li><strong>groupmod</strong> modifies an existing user eg: groupmod -n new_group old_group</li><li><strong>groupdel</strong> deletes an existing user eg: groupdel groupx</li></ul><p><strong>NB:</strong> adding user to agroup is modification of a user, not a group, to add a user to a group you can use usermod or gpasswd command.</p><pre>usermod -aG hr john # adds user john to hr group<br>gpasswd -a john hr # adds user john to hr group</pre><h4>gpasswd command</h4><p>used to administer/etc/passwd file</p><p>some options to use with gpasswd</p><ul><li><strong>-a, — add </strong>adds a user to a group</li><li><strong>-d, — delete </strong>removes a user from a group</li><li><strong>-M, — members user1, user2 </strong>sets the list of members of group</li><li><strong>-A, — administrators admin1, admin, — members user1, user2 </strong>sets the list of administrators of group</li></ul><h4>User Permissions</h4><p>user permission levels</p><h4>Root user</h4><ul><li>Access any file</li><li>Change any file</li><li>Control services</li><li>Manage any account</li><li>Manage hardware</li><li>Manage linux kernel</li><li>Manage software</li></ul><h4>Standard user</h4><ul><li>Access any file permissiion is given forr</li><li>Controls file that the user owns</li><li>Limited access to manage the system</li></ul><p>root user is powerful user account</p><p>command prompt for root user starts with #</p><p>command prompt for standard user start with $</p><p>It is important to create a standard user with the right privileges to avoid unauthorized access to files or programs</p><h4>su command</h4><p>su command helps standard user to elevate permission for administrative task</p><p>sudo root— switch to root user with in the current user’s environment</p><p>su — root— switch to root with root user’s environment</p><p>su — substitute user, helps to login as any user including root</p><h4>/etc/sudoers file</h4><p>Delegates specific command to specific users by adding them to /etc/sudoers</p><p>The syntax is users hosts=(user:group) commands</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PO0jxUr6oHLYfLHFHduzzQ.png" /></figure><p>As it is shown in the screenshot above</p><ul><li>Allow members of the group to shout down the local host:</li><li>%users localhost=/usr/sbin/shutdown -r now</li></ul><p>As such you can delegate specific commands to specific users by adding them to the /etc/sudoers file</p><h4>Using sudo</h4><p>sudo requires password of the current user whereas su requires the password of the substitute account</p><p>sudo is safer as it doesn&#39;t need password of substitute user, temporarily elevates the permission of the current user</p><p>The use of sudo is logged at /var/log/messages and the command run using sudo permission is logged at /var/log/secure</p><h4>SU</h4><ul><li>Activates full administrator access</li><li>Used when all administrative access is required</li><li>Users are prompted for root user password</li></ul><h4>SUDO</h4><ul><li>Only delegates permission</li><li>Users are prompted with their own password</li><li>One time root permission</li></ul><h4>Working with Files</h4><p>Everything in linux is file, commands, directories, processes, even hardwares are represented in files</p><h4>File system hierarchy standard (FHS)</h4><ul><li>/ — root of the file system</li><li>/boot — boot files and kernel</li><li>/dev — devices</li><li>/etc — configuration files</li><li>/home — standard users home directory</li><li>/media— removable media</li><li>/mnt — network drivers</li><li>/root — root user home directory</li><li>/var — log file, network services, print spool</li></ul><p>commonly used by most linux distributions</p><h4>ls command</h4><p>displays list of files in a directory, different colors represents different types of files</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9zuTfsrMQteyN8hr9XFYjQ.png" /></figure><p>ls &lt;directory_name&gt; lists all the files in that directory, you can also chain multiple directories eg: ls directory1 directory2</p><p>Options that are used with ls</p><ul><li><strong>-l </strong>long format(shows permission)</li><li><strong>-h </strong>file size reported in human-friendly format</li><li><strong>-a </strong>shows all files, including hidden files</li><li><strong>-R </strong>list subdirectories</li><li><strong>— sort=extension or -x </strong>sorts alphabetically by file extension</li><li><strong>— sort=size or -S </strong>sorts by file size</li><li><strong>— sort=time or -t </strong>sorts by modification time</li><li><strong>— sort=version or -v </strong>sorts by version</li><li><strong>-r </strong>list in reverse order(naturally ls prints in sorted order)</li></ul><p>you can combine options like ls -al(shows hidden files and other files with details)</p><h4>more command</h4><p>more command is used for files that dont fit on one screen</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*K5BVhc9IRT2wf1AXs-u71Q.png" /></figure><p>loads entire file then user can scroll</p><p>some options that are used with more</p><ul><li><strong>-d </strong>display information about how to navigate at the bottom of the screen</li><li><strong>-f </strong>prevents line wrap</li><li><strong>-p </strong>clears the screen before displaying the content</li><li><strong>-s </strong>squeezes multiple blank lines in to one line</li></ul><p>usage</p><p>more [-options] [-num] [+/pattern] [+linenum] [file_num]</p><ul><li><strong>num </strong>number of lines to display</li><li><strong>/pattern </strong>string to find in the file</li><li><strong>linenum </strong>the line number where the content starts to display</li><li><strong>file_name </strong>name of the file to display the content of</li></ul><h4>less command</h4><p>less command display file contents that don&#39;t fit on one screen, you can scroll up and down through the content</p><p>less loads faster than more, since it doesn’t load every page before displays result due to this it is used for large files.</p><p>usage</p><p>less [options] filename</p><p>Options</p><ul><li><strong>-N </strong>shows line numbers</li><li><strong>-X </strong>displays the content after the last command and does not clear the screen when exiting</li><li><strong>+F </strong>watches for file content changes</li></ul><h4>head command</h4><p>The head command displays the first 10 lines of a file by default</p><p>can display multiple files eg: head file1.txt file2.txt</p><p>usage</p><p>head [options] filename(s)</p><ul><li><strong>-n&lt;</strong>number<strong>&gt; </strong>first n lines to display</li><li><strong>-c&lt;</strong>number<strong>&gt; </strong>first c bytes to display</li></ul><h4>tail command</h4><p>The tail command displays the last 10 lines of a file by default, like head command it can dispaly multiple files content</p><p>usage</p><p>tail [options] filename(s)</p><p>options</p><ul><li><strong>-n&lt;</strong>number<strong>&gt; </strong>last n lines to display</li><li><strong>-c&lt;</strong>number<strong>&gt; </strong>last c bytes to display</li><li><strong>-f </strong>monitor for file changes</li></ul><h4>cp command</h4><p>The cp command copies files and directories, by default cp overwrites existing files that have the same name</p><p>usage:</p><p>cp &lt;file_name&gt; &lt;destination&gt;</p><p>Options</p><ul><li><strong>-a </strong>archives file</li><li><strong>-f</strong> force copy override destination file</li><li><strong>-i </strong>interactive ask before overwrite</li><li><strong>-l</strong> link files instead of copy</li><li><strong>-L </strong>follow symolic links</li><li><strong>-n</strong> no file overrite</li><li><strong>-R </strong>recursive copy including hidden</li><li><strong>-u</strong> update(copy when source is newer than destination)</li><li><strong>-v</strong> print verbose informative message</li></ul><h4>rm command</h4><p>The rm command deletes file</p><p>usage</p><p>rm [options] filename(s)</p><p>Options</p><ul><li><strong>-d </strong>removes a directory the directory must be empty</li><li><strong>-r </strong>allows to remove a non empty directory</li><li><strong>-f </strong>never prompt user(useful when deleting a directory with many files)</li><li><strong>-i </strong>prompts the user for confirmation for each file</li><li><strong>-v </strong>display the names of deleted files</li></ul><p>you can use regular expression with rm eg: rm *.png removes all files with .png extention</p><h4>mkdir command</h4><p>The mkdir command creates new directories</p><p>usage</p><p>mkdir [options] filename(s)</p><p>options</p><ul><li><strong>-m&lt;</strong>mask<strong>&gt; </strong>sets a permission to the directory</li><li><strong>-p </strong>creates a parent directory</li></ul><pre>mkdir -m 700 dir1 # creates the dir1 directory with the mask 700 for permission<br>mkdir -p /home/user/dir1/dir2 # create the folders following the path</pre><h4>mv command</h4><p>The mv command moves a file from one directory to another directory, the mv command can also be used to rename file if source and destination are the same, by default mv command overwrites existing files that have the same name</p><p>usage</p><p>mv [options] source destination</p><p>options</p><ul><li><strong>-i </strong>prompts before overwriting a file</li><li><strong>-f </strong>avoids being prompted</li><li><strong>-n </strong>does not overwrite existing files</li><li><strong>-v </strong>verbose option prints the name of files that are moved or renamed</li></ul><p>you can use regular expression to move files of the same type eg: mv *.png &lt;dirname&gt; moves all files with extension .png in to the specified directory</p><h4>rmdir command</h4><p>The rmdir command deletes existing empty directory, rmdir is equivalent to rm -d, if a directory is not empty -r option can be used with rm command</p><h4>pwd command</h4><p>The pwd command outputs absolute path of current location in the file system, it is used to know where you are in the file directory structure</p><p><strong>NB:</strong> path defines a directories to be traversed to get to a particular resource, GUI(graphical user interface) or CLI(command line interface) can be used to traverse the path, there are two type of paths</p><ul><li>Absolute path: complete path from the root of the file system eg: /home/user/Documents/projects</li><li>Relative path: a path from the current directory eg: Documents/projects</li></ul><h4>cd command</h4><p>The change directory or cd command is used to move from one directory to another</p><p>.. is used to go up one level from the current directory</p><h3>Working with Files</h3><h4>hash command</h4><ul><li>displays a list of recently run programs, location and the number of times they have run on a hash table</li><li>hash command can be used to reset or modify the hash table</li><li>location information includes the program’s full path name</li><li>syntax hash [options] [-p pathname] [options] [commandName …]</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fmCauqeE4zwTkvMD5rxBiA.png" /></figure><p>options</p><ul><li><strong>-d </strong>deletes the location for commandName from the hash table</li><li><strong>-l </strong>displays output in a format that can be used as input to another command</li><li><strong>-p </strong>sets pathName as the full path location for commandName</li><li><strong>-r </strong>empties the hash table</li><li><strong>-t </strong>displays the location of commandName</li></ul><h4>cksum command</h4><p>The cksum command generates checksum value for a file or stream of data, it is used to see whether the file is corrupted during transfer</p><p>syntax: cksum [filename]</p><h4>find command</h4><p>The find command searches a designated directory for a files that matches the specified criteria</p><p>can search by</p><ul><li>owner</li><li>file name</li><li>file size</li><li>file modification date</li></ul><p>can specify directories to search for to narrow search space</p><p>can specify which action to take the file is found</p><p>syntax: find [directory to start from] [options] [what to find]</p><p>eg: find /home/john -name file.txt</p><p>when searching by name you can use wildcard to match pattern</p><p>options</p><ul><li><strong>-name &lt;</strong>filename<strong>&gt; </strong>searches by file name</li><li><strong>-iname &lt;</strong>filename<strong>&gt; </strong>searches by file name but ignores case</li><li><strong>-user &lt;</strong>filename<strong>&gt; </strong>searches by file owner</li><li><strong>-type &lt;</strong>filename<strong>&gt; </strong>searches by file type</li></ul><p>Actions that are used with find command can be write location of searched files to a file, run commands on searched files, delete searched files</p><p>options</p><ul><li><strong>-fprint </strong>write output to a file</li><li><strong>-exec </strong>run a command</li><li><strong>-delete </strong>delete the file</li></ul><h4>grep command</h4><p>The grep command searches for a particular text pattern or string and displays each occurrence</p><p>syntax: grep &lt;text pattern or string&gt; &lt;where to search&gt;</p><p>options</p><ul><li><strong>-i </strong>ignore case</li><li><strong>-r </strong>recursive search</li><li><strong>-l </strong>list only file names</li><li><strong>-n </strong>display line number</li><li><strong>-c </strong>count of matching lines</li><li><strong>— files-with-matches </strong>names of files that contain selected lines are written to standard output</li></ul><h4>find vs grep</h4><p><strong>find</strong></p><ul><li>serches files based on given criteria</li><li>it is used to locate files</li><li>return file names</li></ul><p><strong>grep</strong></p><ul><li>searches file content for a given string or text pattern</li><li>is used to find a string in a file</li><li>returns occurrences of a searched string</li></ul><h4>diff command</h4><p>compares line by line displays the differences</p><p>syntax: diff [options] file1 file2</p><h4>Links</h4><p>Links are another way to refer to files</p><p><strong>Links and inode</strong></p><p>you can use link to refer to the same file by using different names, you can use links to access the same file from more than one location in the file system.</p><p>every file has inode object that uniquely identifies its data location and attributes.</p><p>Two types of links</p><ul><li><strong>hard link </strong>— points to a file’s inode, can not reference a directory, if the original file is deleted its data exists until the hard link is deleted, syntax for creating hard link: ln [options] [originalFileName] [linkName] , eg: ln /home/user/file.txt /projects/file.txt, if the original file is deleted, its content still exists until the hard link is deleted</li><li><strong>symbolic(soft) link </strong>— points to the original file name or a hard link, can point to a directory, if the original file is deleted, the soft link is broken until a new file with the original name, syntax for creating symbolic link: ln -s [options] [originalFileName] [linkName]</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nep43IZNYM3JzCuF3AdxBQ.png" /></figure><p>Hard linking example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uKrEP--wn8ljkbQPYoUOsA.png" /></figure><p>Symbolic linking example</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jN8btothBy3W55esv7rL2A.png" /></figure><h4>tar command</h4><p>Bundles a collection of files in to a single archive file for easier copying or downloading, created bundle is called tarball</p><p>contents of the archive file can optionally be compressed, the tar command can also be used to unbundle an archive file</p><pre>tar -cvf tarball.tar file1 file2 file3 # bundles and compresses file1, file2 and file3 in to a file called tarball.tar<br>tar -xf tarball.tar # to unbundle or extract files from tarball </pre><p>tar command can be used for file downloads, copying, large number of files or moving</p><p>options</p><ul><li><strong>-x </strong>extract the contents of a tarball</li><li><strong>-z </strong>compress the contents of a tarball by using the gzip utility</li><li><strong>-f </strong>specifies the name of the tarball</li><li><strong>-v </strong>produces verbose output by showing file names while the tarball is processed, shows the progress as the tarball is created</li></ul><h4>gzip command</h4><p>compresses or decompresses files, including tarballs</p><pre>gzip salesdata.tar # to compress tarball<br>gzip -d salesdata.tar.gz # to decompress a tarball </pre><p>use gzip command to compress and decompress files, including tarballs, common for internet downloads, archiving log files, archiving old files</p><h4>The zip and unzip command</h4><p>The zip command is used as a compression tool</p><ul><li>syntax: zip -r [folderName]</li></ul><p>The unzip command is used as an extraction tool</p><ul><li>syntax: unzip [folderName].zip</li></ul><p>when a folder is zipped you can use recursion option -r to include the content of its sub directories</p><h3>Managing File Permissions</h3><h4>Linux permission types</h4><p>— rwxr--xr — x</p><ul><li>r(read) — permission to open and read a file</li><li>w(write) — permission to change the file’s content</li><li>x(execute) — permission that gives user the ability to run a program</li><li>_/d(filetype) —indicates if the file is a regular file in a directory or a directory</li></ul><h4>permission modes</h4><p>Linux has two modes to configure permissions</p><ul><li><strong>Absolute mode:</strong> use numbers to represent file permissions, this mode is commonly used to set permissions</li><li><strong>Symbolic mode:</strong> use a combination of letters and symbols to add permission or to remove any set of permission</li></ul><p><strong>NB: </strong>you can change permission of a file with chmod command, you must be a superuser or owner of a file or a directory to change its permissions</p><pre>chmod g+w file # symbolic mode example<br>chmod 764 file # absolute mode example </pre><p>ls -l file shows file with owner of a file and its permission along with file or directory size, modified date and time, file or folder name</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p3iWTDT6OhjmQB_refmn3A.png" /></figure><h4>chown command</h4><p>The owner and associated group for a file or directory can be changed with chown command</p><p>usage</p><p>chown [options] user[:group] file(s)</p><pre>chown new-owner:new-group file<br>chown new-owner file<br>chown :new-group file </pre><h4>chmod command</h4><p>The chmod(change mode) command is used to change permission of a file</p><p><strong>chmod in symbolic mode</strong></p><p><strong>identity</strong></p><ul><li><strong>u </strong>user or owner</li><li><strong>g </strong>group</li><li><strong>o </strong>other</li></ul><p><strong>permission</strong></p><ul><li><strong>r </strong>read</li><li><strong>w </strong>write</li><li><strong>x </strong>execute</li></ul><p><strong>operator</strong></p><ul><li><strong>+ </strong>grants a permission</li><li><strong>- </strong>removes a permission</li><li>= removes a permission and sets a new one</li></ul><pre>chmod u+x script.sh<br>chmod g=x script.sh<br>chmod g-rw file.txt<br>chmod o-r script.sh</pre><p><strong>chmod in absolute mode</strong></p><p><strong>permission</strong></p><ul><li><strong>4 </strong>read</li><li><strong>2 </strong>write</li><li><strong>1 </strong>execute</li><li><strong>7 </strong>all permissions</li></ul><pre>chmod 400 file.txt #sets read access to the owner no permission for group &amp; other</pre><h4>Bash meta-characters</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/32828f94ff70e7ae7c2d2227982de24a/href">https://medium.com/media/32828f94ff70e7ae7c2d2227982de24a/href</a></iframe><h4>Redirection operators</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4dab41ee863d14953f6de4a06a48b46/href">https://medium.com/media/c4dab41ee863d14953f6de4a06a48b46/href</a></iframe><p><strong>NB:</strong> The &gt; redirector operator overwrites existing file content with out warning, noclobber variable can be set inorder to avoid this file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yj9-B-0Rbf7Axz0kTLGFvQ.png" /></figure><h4>tee command</h4><p>The tee command displays output to screen and write to a file</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5NVupjLWEiPTjRybynvJ5A.png" /></figure><h4>cut command</h4><p>cut sections from lines of text by characters, byte positions or delimeter, displays that information to standard output, can be used to pull out important information</p><p>options</p><ul><li><strong>-b </strong>byte</li><li><strong>-c </strong>column</li><li><strong>-f </strong>field</li><li><strong>-d </strong>delimeter</li></ul><h4>sed command</h4><p>sed is a non-interactive text editor command, edits based on the rules that are provided(can insert, delete, search and replace)</p><p>support regular expression</p><pre>sed &#39;s/page/website/&#39; example.txt </pre><p>The above command replaces page with website only for the first occurences on each line, /n can be used to replace the nth occurence /g to replace all occurences</p><p>by default sed command doesnt write to the file it self, it writes to the standard output</p><h4>sort command</h4><p>sort command sorts in a specific order, alphabetical, reverse order, number or month</p><p>examples</p><ul><li><strong>sort file.txt</strong> outputs lines in alphabetical order</li><li><strong>sort -r file.txt </strong>outputs lines in reverse alphabetical order</li><li><strong>sort -u file.txt </strong>removes duplicate entries (useful for log files)</li><li><strong>sort -M file.txt </strong>outputs lines in order of month</li></ul><p>options</p><ul><li><strong>-o </strong>outputs the result to a file</li><li><strong>-r </strong>sorts in reverse order</li><li><strong>-n </strong>sorts numerically if the file contains number</li><li><strong>-k </strong>sorts according to the kth column(if the file is formatted as a table)</li><li><strong>-u </strong>removes duplicate</li><li><strong>-c </strong>tells whether a file is already sorted</li></ul><h4>awk command</h4><p>The awk command is used to write small programs to transform data, can define variable, can use string and artimetic operators, can use loops and control flows</p><p>usually used to generate formatted report</p><p>syntax there are two ways to invoke awk command with explicit program and with a program file</p><pre>awk option -f program-file input-file<br>awk option &#39;prgram&#39; input-file</pre><p>option</p><ul><li><strong>-F Fs</strong> to specify a filed separator</li><li><strong>-f </strong>source-file to specify a file that contains awk script</li><li><strong>-v var=value</strong> to declare variable</li></ul><pre>awk -F: &#39;{print $1}&#39; /etc/passwd # prints username -F: tells the content in the file are separated by :</pre><h4>Managing Processes</h4><h4>program</h4><p>a program is a series of instruction given to a computer, used to tell a computer which action to take</p><p>there are two kind of programs</p><ul><li>system programs</li><li>application programs</li></ul><h4>process</h4><p>process is a running program, identified by process ID number(PID)</p><p>can be viewed with commands like: ps, pstree</p><p>When a process runs, it can cycle through various states:</p><ul><li><strong>start</strong>: The process is created</li><li><strong>Ready</strong>: The process is waiting to be assigned processor time</li><li><strong>Running</strong>: The process is in progress</li><li><strong>Waiting</strong>: The process is waiting for an event</li><li><strong>Stopped</strong>: The process is finished running</li></ul><h4>child process</h4><p>some services require more than one process to provide functionality, so they spawn child processes(sub processes)</p><p>often the child processes inherit most of the attributes of the parent process</p><h4>ps command</h4><p>The ps(process status) command gives an overview of the current processes that will be running in the operating system, it dispalys information on active processes, that includes</p><ul><li>Process ID(PID)</li><li>Terminal type(TTY) that the user is using</li><li>Time that process has been runing</li><li>Command(CMD) which is the name of the command that launched the process</li></ul><p>options</p><ul><li><strong>-e </strong>list all current processes</li><li><strong>-b </strong>use batch mode</li><li><strong>-fp &lt;</strong>number<strong>&gt; </strong>list process by PID</li><li><strong>-a </strong>list all processes not associated with the terminal</li><li><strong>-T </strong>list all processes associated with the terminal</li><li><strong>-r </strong>restricts to running processes only</li><li><strong>-ef </strong>views in full-format listing</li><li><strong>-fp &lt;</strong>number<strong>&gt; </strong>list processes by PID</li><li><strong>-L </strong>list all format specifiers</li></ul><h4>pidof command</h4><p>The pidof command helps to display the process ID(PID) of a running program</p><p>usage</p><p>pidof [options] programName</p><pre>pidof sshd</pre><p>options</p><ul><li><strong>-s </strong>returns only one PID</li><li><strong>-c </strong>returns only PIDs that are in the same root directory</li><li><strong>-w </strong>shows process that do not show a command line</li><li><strong>-S </strong>serves as a separator that is used between PIDs</li></ul><h4>pstree command</h4><p>The pstree command displays running processes in a tree format, identifies parent process with [] and child process with {}</p><p>usage</p><p>pstree [options] [pid, user]</p><p>options</p><ul><li><strong>-a </strong>shows argument in the command line with the output</li><li><strong>-p </strong>shows the PID which will show in decimal numbers inside parenthesis after a process name</li><li><strong>-c </strong>expands identical subtrees(by default pstree compacts the tree)</li><li><strong>-n </strong>sorts by the same parent PID instead of a process name</li></ul><h4>top command</h4><p>The top command displays a real-time summary of system performance and utilization and lists the processes and threads active in the system</p><p>options</p><ul><li><strong>-h and v </strong>shows usage and version information</li><li><strong>-b </strong>starts top in batch mode</li></ul><h4>Task status in top</h4><p>Task(process or thread) can have one of the following states</p><ul><li><strong>running</strong>: The process is running on the CPU or present in the run queue</li><li><strong>sleep</strong>: The process is waiting for an I/O operation to complete</li><li><strong>stopped</strong>: The process has been stopped by a job control signal or is being traced</li><li><strong>zombie</strong>: The process is a child process whose parent process has been ended</li></ul><h4>CPU values in top</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/5d464d89f1d9af097942ee0482c5d5c5/href">https://medium.com/media/5d464d89f1d9af097942ee0482c5d5c5/href</a></iframe><h4>kill command</h4><p>The kill command ends a process, when a process fails to quit, options kill command includes often are</p><ul><li><strong>-9 </strong>SIGKILL immediately stops the process with no graceful exit</li><li><strong>-15 </strong>SIGTERM exits without immediately terminating</li><li><strong>-19 </strong>SIGSTOP pauses the process and can use the command line</li></ul><h4>nice and renice command</h4><p>The nice command launches a new process at a given priority, the range is -20 for high priority and 19 is for lowest priority</p><p>usage</p><p>nice [options] [cmd]</p><p>The renice command adjusts the priority of that is already running</p><p>usage</p><p>renice [options] [cmd]</p><h4>jobs command</h4><p>jobs are processes that users start and manage that are identifiable by a job number</p><p>jobs can run in foreground and background, you can change background job to foreground job and viseversa</p><h4>at and cron commands</h4><p>at commands runs a task once at the specified time</p><pre>at -l # displays scheduled jobs<br>atrm [job_number] # deletes scheduled job with job_number</pre><p>cron deamon runs a task on a regular basis at the specified time</p><h4>crontab command</h4><p>crontab(cron table) holds the commands and steps that the cron deamon will run</p><pre><br># Run a script every minute<br>* * * * * echo &quot;Hello from cron&quot; &gt;&gt; /tmp/cron.log</pre><p>It is useful fore regular backups, clean ups, scripts to rotate logs or reminder message</p><h3>Manging services</h3><h4>systemctl command</h4><p>used to troubleshout tasks if services aren’t working correctly</p><p>usage</p><p>systemctl &lt;subcommand&gt; &lt;sevicename&gt;</p><p>subcommands include, status, start, stop, restart, enable and disable</p><p>you can also use service command to manage services but systemctl has more options and features</p><h4>System Performance Information</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0f2d23025e5ac822355b78241c1b0ff/href">https://medium.com/media/c0f2d23025e5ac822355b78241c1b0ff/href</a></iframe><h4>Software Management</h4><p>different distributions have different approaches for managing software</p><p>for example RedHat uses Red Hat Package Manager(RPM) to manage software, software pacakges have .rpm file extention, and YUM utility is commonly used on the front-end interface to RPM</p><p>pacakge managers maintain the software through its lifecycle, install, update, inventory, uninstall</p><p>repositories are servers that contain software pacakges</p><pre>yum -y install zsh # installs zsh pacakge -y accepts every confirmation with yes<br>yum list installed # displays installed pacakges<br>yum remove zsh # removes zsh package</pre><h4>Logging</h4><p>Logs keep record of events on the system, which help with auditing</p><p>There are different log types</p><ul><li>System logs(system startup information and system shutdown times)</li><li>Events logs(user login and logout events)</li><li>Application logs(startup time, actions and errors)</li><li>Service logs</li></ul><p>Logs can be used for security audits, service level agreements(SLA), practive troubleshooting</p><h4>Logging Levels</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/9d03c4a4710e3bf8e04353a51428da9f/href">https://medium.com/media/9d03c4a4710e3bf8e04353a51428da9f/href</a></iframe><h4>Important Log Files</h4><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d24e3b00d1b1d8d099ef3a8127db2a31/href">https://medium.com/media/d24e3b00d1b1d8d099ef3a8127db2a31/href</a></iframe><h4>lastlog command</h4><p>lastlog command reports recent login information on the system, lastlog command retrives user information from /var/log/lastlog file</p><pre>lastlog # displays login info for all users<br>lastlog -u ec2-user # displays login info for ec2-user only <br>lastlog -t 1 # displays login info more recent than 1 day ago</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2ed836732326" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Amazon Elastic Cloud Compute(Amazon EC2) Fundamentals: Building Elastic Cloud Infrastructure on AWS]]></title>
            <link>https://aws.plainenglish.io/amazon-elastic-cloud-compute-amazon-ec2-fundamentals-building-elastic-cloud-infrastructure-on-aws-1c1611f8a5f6?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c1611f8a5f6</guid>
            <category><![CDATA[amazon-ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Wed, 15 Jul 2026 09:33:23 GMT</pubDate>
            <atom:updated>2026-09-16T14:08:59.089Z</atom:updated>
            <content:encoded><![CDATA[<p>In this blog, we will explore one of the core services in AWS: <strong>compute</strong>. We will focus on <strong>Amazon Elastic Compute Cloud (Amazon EC2)</strong> and continue our discussion with EC2 moving forward.</p><p>We will explore Amazon EC2, including how to launch and configure instances, AMIs, instance types, networking, storage, security groups, and other important components.</p><p>We will also go beyond a single EC2 instance and build a scalable architecture using <strong>EC2 Auto Scaling</strong>, <strong>Application Load Balancer</strong>, <strong>Target Groups</strong>, <strong>Launch Templates</strong>, and <strong>Scaling Policies</strong>. By the end, you will understand how AWS services work together to create highly available and elastic applications.</p><p>Everything we build and run starts with compute. AWS provides a broad catalog of compute services designed to support different workloads and use cases.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c533f77f0318d39d6c47d707b3587a66/href">https://medium.com/media/c533f77f0318d39d6c47d707b3587a66/href</a></iframe><p>Out of these services, you can choose the one that best fits your workload. If you need more control over your infrastructure, consider using <strong>virtual machines (VMs)</strong> or <strong>containers</strong>.</p><p><strong>Amazon Elastic Compute Cloud (Amazon EC2)</strong> provides secure, scalable, and resizable compute capacity in the cloud. It can be used to host a wide variety of workloads, including application servers, web servers, database servers, mail servers, game servers, media servers, catalog servers, file servers, compute servers, and proxy servers.</p><p>Amazon EC2 gives you full administrative access to the <strong>guest operating system</strong> the operating system running inside the virtual machine. The <strong>host operating system</strong>, which runs on the physical server hosting one or more virtual machines, is fully managed by AWS.</p><h3>Things to Consider When Launching an EC2 Instance</h3><h3>AMI(Amazon Machine Image)</h3><p>An <strong>Amazon Machine Image (AMI)</strong> provides the information required to launch an Amazon EC2 instance. It contains an operating system and often includes pre-installed software, libraries, and configurations.</p><p>An AMI includes:</p><ul><li>A <strong>template for the root volume</strong>, which contains the operating system and everything installed on it. When you launch an EC2 instance, AWS creates the root volume by copying this template.</li><li><strong>Launch permissions</strong>, which determine which AWS accounts are allowed to use the AMI.</li><li>A <strong>block device mapping</strong>, which specifies the storage volumes that will be attached to the EC2 instance when it is launched.</li></ul><p>AWS provides several types of AMIs:</p><ul><li><strong>Quick Start AMIs</strong> — Official AMIs provided and maintained by AWS for common operating systems and use cases.</li><li><strong>My AMIs</strong> — Custom AMIs that you have created and own.</li><li><strong>AWS Marketplace AMIs</strong> — AMIs provided by AWS partners and third-party vendors. These are preconfigured for specific use cases, allowing you to get started quickly with applications such as databases, security tools, and enterprise software.</li><li><strong>Community AMIs</strong> — AMIs shared by members of the AWS community. Since AWS does not review or validate these AMIs, they are generally <strong>not recommended for production or corporate environments</strong>.</li></ul><p>AMIs provide <strong>repeatability</strong>, allowing you to create EC2 instances in a consistent and efficient manner. They are <strong>reusable</strong>, enabling you to launch multiple instances from the same image. They also improve <strong>recoverability</strong>, as you can use an AMI as a backup to quickly recreate an instance if needed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z_X99xfWa9_NfcoOXjMeEA.jpeg" /></figure><h3>Instance type</h3><p>An <strong>instance type</strong> determines the resources available to an EC2 instance, including <strong>memory (RAM), processing power (CPU), storage type and capacity, and network performance</strong>.</p><p>AWS provides different EC2 instance categories:</p><ul><li><strong>General Purpose</strong> — Balanced compute, memory, and networking resources for a wide range of workloads.</li><li><strong>Compute Optimized</strong> — Designed for workloads that require high CPU performance.</li><li><strong>Memory Optimized</strong> — Designed for applications that require large amounts of memory.</li><li><strong>Storage Optimized</strong> — Designed for workloads that require high-speed local storage and high I/O performance.</li><li><strong>Accelerated Computing</strong> — Uses specialized hardware accelerators such as GPUs for machine learning, graphics processing, and high-performance computing workloads.</li></ul><p>EC2 instances are organized by <strong>family, generation, and size</strong>.</p><p>Example: <strong>t3.large</strong></p><ul><li><strong>T</strong> → Instance family name</li><li><strong>3</strong> → Generation number (newer generations generally provide better performance and efficiency)</li><li><strong>large</strong> → Instance size (determines the amount of vCPU and memory allocated to the instance)</li></ul><p>For example, a <strong>t3.large</strong> instance provides <strong>2 vCPUs and 8 GB of memory</strong>.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/761decdadb095d55b3663eb51d37469f/href">https://medium.com/media/761decdadb095d55b3663eb51d37469f/href</a></iframe><p><strong>Note:</strong> Network bandwidth also depends on the instance type. To increase network throughput between multiple EC2 instances, you can use a <strong>placement group</strong>. <strong>Enhanced Networking</strong> can also be enabled to improve network performance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*V_uqQ1ms6zDLoPae1axocw.jpeg" /></figure><h3>Network Setting</h3><p>After making sure you are in the correct region, you must specify the network location.</p><p>When you launch an EC2 instance in the <strong>default VPC (Virtual Private Cloud)</strong>, AWS assigns a public IP address by default. For <strong>non-default VPCs</strong>, AWS does not assign a public IP address by default.</p><p>Subnets have an attribute that determines whether instances launched within them receive public IP addresses automatically. When launching an EC2 instance, you can also specify whether a public IP address should be assigned. This instance-level setting overrides the subnet attribute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*bHtzWFvH0ezFLrl-o_mkOQ.jpeg" /></figure><h3>IAM(Identity and Access Management) roles</h3><p>Usually, your instance might need to interact with other AWS services. Instead of passing credentials, it is recommended to use <strong>IAM roles</strong> to properly authorize EC2 instances to make API requests to other AWS services.</p><p>For example, if an Amazon EC2 instance needs to access a bucket in <strong>Amazon Simple Storage Service (Amazon S3)</strong>, an IAM role can be used to grant the required permissions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jw1L1kcUwJNo5uVGGXm5sw.jpeg" /></figure><h3>User data</h3><p>Used to automate the completion of installations and configurations during instance launch.</p><p>Examples include:</p><ul><li>Updating the instance operating system.</li><li>Fetching and installing software license keys.</li><li>Installing additional software or configuration files.</li></ul><p>When an EC2 instance is created, the <strong>user data script</strong> runs during the final stage of the boot process with <strong>root user privileges</strong> on the instance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ViDr3i_f4ukwhxFEhTe2NA.jpeg" /></figure><h3>Storage options</h3><p>You can configure storage options such as the type, size of the <strong>root volume</strong>, where the guest operating system (OS) is installed. You can also add additional storage volumes when launching an EC2 instance.</p><p>For each volume attached to your instance, you can specify:</p><ul><li>The size of the disk.</li><li>The volume type.</li><li>Whether the storage should be retained after the instance is terminated.</li><li>Whether encryption should be enabled.</li></ul><p><strong>Amazon EC2 Instance Store</strong> provides <strong>ephemeral (temporary) block-level storage</strong> for your instance. This storage is located on disks that are physically attached to the host computer.</p><p><strong>Amazon Elastic Block Store (Amazon EBS)</strong> provides persistent block storage for EC2 instances. EBS volumes can be easily resized or changed to a different volume type without disrupting your workload, allowing you to optimize storage based on your application’s needs.</p><p>Instance Store storage is <strong>ephemeral</strong>, meaning that if the instance is stopped, terminated, or the underlying host fails, the data stored on the instance store is lost. Therefore, for valuable data, it is recommended to use <strong>Amazon EBS</strong> as the root volume and use Amazon EBS, <strong>Amazon S3</strong>, or other AWS storage services for additional storage requirements.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dDptb5wJ1D7xYkzEVCs0hA.jpeg" /></figure><h3>Tags</h3><p>A <strong>tag</strong> is a label that you attach to an AWS resource. It consists of a <strong>key</strong> and an optional <strong>value</strong>.</p><p>You can categorize tags based on attributes such as <strong>purpose, owner, and environment</strong>.</p><p>Tags are <strong>case-sensitive</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9jY8qBbXE_TZThZbE3waZw.jpeg" /></figure><h3>Security groups</h3><p>A <strong>security group</strong> acts as a firewall that controls network traffic for one or more EC2 instances. If a security group is not specified, the <strong>default security group</strong> will be used.</p><p>Security group rules specify the allowed network <strong>source</strong> for inbound traffic and the allowed <strong>destination</strong> for outbound traffic. The source can be an IP address, IP range, anywhere (0.0.0.0/0), VPC endpoint, or another security group.</p><p>By default, a security group allows all outbound traffic and denies all inbound traffic unless explicitly allowed.</p><p><strong>Network Access Control Lists (Network ACLs)</strong> can also be used as firewalls to control traffic and protect subnets within a VPC.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*dqYIz8irp8U5Q0kTDXGLvw.jpeg" /></figure><h3>Key pair</h3><p>Amazon EC2 uses <strong>public key cryptography</strong> to encrypt and decrypt login information.</p><p>This technology uses a <strong>public key</strong> to encrypt a piece of data. The recipient then uses the corresponding <strong>private key</strong> to decrypt the data. The public and private keys together are known as a <strong>key pair</strong>.</p><p>Public key cryptography enables you to securely access your EC2 instances by using a private key instead of a password.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LLLnVfC_y9lQbsDj4X-WXw.jpeg" /></figure><p>Now that we have gone through each step and selected the appropriate instance configuration, with a public IP address enabled and the correct security group configured, we can connect to the instance and install the software required for our workload without the need for any additional services.</p><p>However, EC2 instances are <strong>not inherently elastic</strong>. They can fail for various reasons, such as hardware failures, Availability Zone issues, or instance termination. A single EC2 instance also does not automatically scale to handle changes in demand.</p><p>For this reason, it is <strong>not recommended</strong> to run production workloads on a single EC2 instance. Instead, production applications should use <strong>Amazon EC2 Auto Scaling</strong> to automatically launch or terminate instances based on demand, improving both availability and fault tolerance.</p><p>At this point, you have enough knowledge to launch and manage a <strong>non-production</strong> workload on Amazon EC2. To build a truly <strong>elastic</strong> architecture, the next step is to learn about <strong>Amazon EC2 Auto Scaling</strong>.</p><p><strong>Elasticity</strong> is the ability of a system to automatically <strong>scale out</strong> (add resources) or <strong>scale in</strong> (remove resources) in response to changes in workload demand.</p><h3>There are three components to EC2 Auto Scaling</h3><p><strong>1. Launch Template:</strong> A Launch Template is a feature of EC2 Auto Scaling that allows a way to templatize your launch requests. It enables you to store launch parameters so that you do not have to specify them every time you launch an instance. For example, a launch template can contain a specific Amazon Machine Image, instance type, storage, and networking settings that you typically use to launch instances. For each Launch Template, you can create one or more numbered Launch Template Versions. Each version can have different launch parameters.</p><p><strong>2. Auto Scaling Groups:</strong> For auto scaling your EC2 instances are organized into groups so that they can be treated as a logical unit for the purposes of scaling and management. When you create a group, you can specify its minimum, maximum, and desired number of EC2 instances.</p><p><strong>3. Scaling Policies:</strong> A Scaling Policy tells Auto Scaling when and how to scale. Scaling can occur manually, on a schedule, on demand, or you can use Auto Scaling to maintain a specific number of instances.</p><p>Auto Scaling is well suited for applications that have unpredictable demand patterns that can experience hourly, daily, or weekly variability in usage. This helps you to manage your cost and eliminate over-provisioning of capacity during times when it is not needed. Auto Scaling can also find an unhealthy instance, terminate that instance, and launch a new one based on the scaling plan.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/511/1*7qK6q8jZ6Dyy5j8c4MYilg.png" /></figure><p>In a typical EC2 Auto Scaling architecture, users first access the application through <strong>Amazon Route 53</strong>, which provides DNS resolution and routes traffic to the application’s endpoint.</p><p>The request is then forwarded to an <strong>Internet Gateway</strong>, which provides communication between the VPC and the internet. The traffic reaches an <strong>Application Load Balancer (ALB)</strong>, which distributes incoming requests across healthy EC2 instances registered in a <strong>Target Group</strong>.</p><p>The <strong>Auto Scaling Group (ASG)</strong> manages the EC2 instances behind the Target Group. It automatically launches new instances when demand increases and terminates instances when demand decreases. Newly launched instances are automatically registered with the Target Group and become available to receive traffic from the Load Balancer.</p><p>The complete request flow is:</p><p><strong>User → Amazon Route 53 → Internet Gateway → Application Load Balancer → Target Group → EC2 Instances managed by Auto Scaling Group</strong></p><p>Now, let&#39;s see the architecture in action and implement the above design.</p><p>For this blog, I won&#39;t cover the process of creating a <strong>VPC (Virtual Private Cloud)</strong>, <strong>Internet Gateway</strong>, and <strong>Route Tables</strong>, as they are outside the scope of this article. Instead, I will use the <strong>default VPC</strong>, which already includes these components out of the box.</p><p>However, if you want to create a new VPC, make sure you are in the desired AWS region and follow these steps:</p><ol><li>Create a <strong>VPC</strong>.</li><li>Create an <strong>Internet Gateway</strong> and attach it to your VPC.</li><li>Create subnets within your VPC. Ideally, create at least two subnets across different <strong>Availability Zones</strong> to improve high availability.</li><li>Create a <strong>Route Table</strong> and associate it with your subnets.</li><li>Edit the route table and add a route to your <strong>Internet Gateway</strong> to allow internet connectivity.</li></ol><p>Now, let’s start by creating a target group. The EC2 instances that are created in a specific subnet will be part of the target group. The load balancer will point to the target group, and the target group will route traffic to the instances. These instances are created by the Auto Scaling Group based on a specified auto-scaling policy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gCTTNNXL818yZTQMVLEzGQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7EVhcPlmFEEpXpL5AEEV7A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jmaZkgyUZqYcblVshPnImg.png" /></figure><p>If you don’t want to change anything other than this click next</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQkcop-3tV-30hf0_8fH5A.png" /></figure><p>Now, click Next and create the target group. As of now, you don’t have any instances, but you will have them in a few minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GmIj_SmXmE0h0p3VXiJfjg.png" /></figure><p>This target group doesn’t have a load balancer yet. Let’s create the load balancer now.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*q0gSRzmhgFl_ELFvqoQZzg.png" /></figure><p>Create an Application Load Balancer since you are working with EC2 instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*X42OiEZ15UT9ZC9mIZggHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4MHGnj8Fdrv_VGdIBhzx1Q.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hgD96p1fp4JggpcakxuOeg.png" /></figure><p>Now, we have to create a new security group instead of using the default security group. This security group will allow traffic from the internet through port 80 for HTTP.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yZdE5tg-2bnc8fwG2YrDSA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSWh-oueg59bbZDruDo45A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pG8CJAf1VJXZfost3SnfQg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Uhp9mUfXv3TMWkCAfDVUwg.png" /></figure><p>Now, let’s continue with creating the Auto Scaling Group. Before that, you have to create a launch template that will be used by the Auto Scaling Group, let’s proceed with launch template creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZifcFumReozg4PvnD89SVg.png" /></figure><p>Choose AMI</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*riJzkf2UtdIIgYE5XMmmjQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OSfs5GiAqd9AfVN4e6lGMw.png" /></figure><p>On the instances, we have to allow port 80 so that network traffic can be routed to the instances. We can also allow port 22 for SSH access.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-sFoVXZm_7UfrHPkwRVO_A.png" /></figure><p>Now, let’s attach the security group to the launch template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WYq_OFMoVGl9X_0UyVlFdg.png" /></figure><p>Update the storage if necessary.<br>Now, add the user data script that installs the Nginx server, and create the launch template.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SoHFAAD5TuMIXsRDgXTUkg.png" /></figure><p>Now, go ahead and create the Auto Scaling Group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jAmJg5XjnWcDJ4vwVX4mGA.png" /></figure><p>Select instance type</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LckIMDC8POmXjFsujvXL_g.png" /></figure><p>Update network configurations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yiM-Jd6lr7bJ9EqRm2fiSA.png" /></figure><p>Chose Load balancer from existing load balancer</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u-wCFFSG4lHNnMkBy5EFbg.png" /></figure><p>Update health check configuration if needed</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nxYT5muh0Jt-rxDLU76OEA.png" /></figure><p>Set desired, min and max capacity</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*v8KyJY0HkJhIQnEnlv9Qlw.png" /></figure><p>Select target tracking based on CloudWatch metrics. Leave the other settings as they are, and create the Auto Scaling Group.</p><p>Now, we have two instances running. If you go to the Instances section, you will be able to see them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*39_vzg-BI4mT230mT-qvuA.png" /></figure><p>Now, let’s go to the Load Balancing option, copy the DNS name, and paste it into a new tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*xGdx1iTLgtITtHfTlJ8JLw.png" /></figure><p>You should see your application running. If you get a <strong>502 Bad Gateway</strong> error, give it some time and try again after a few minutes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9spUah3OyWAfWdiIfq5dtA.png" /></figure><p>Now, let’s see if it can self-heal and maintain the desired instance count by stopping one of the instances.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*_BBQkLa4S8f_QNabGb1cZA.png" /></figure><p>As you can see, it is initializing a new instance automatically.</p><h3>Types of Auto Scaling</h3><p><strong>Manual Scaling</strong></p><ul><li>Requires a person to manually increase or decrease resources(changing desired capacity).</li><li>Useful when workload changes are predictable but infrequent.</li><li>Provides full control but does not respond automatically to sudden traffic changes.</li></ul><p><strong>Dynamic Scaling</strong></p><ul><li>Automatically adjusts resources based on real-time metrics(using target policy like CPU metric).</li><li>Uses conditions such as CPU utilization, memory usage, or request count.</li><li>Scales out during high demand and scales in when demand decreases.</li></ul><p><strong>Predictive Scaling</strong></p><ul><li>Uses machine learning and historical data to predict future traffic patterns.</li><li>Adds resources before expected demand increases.</li><li>Helps maintain performance during predictable traffic spikes.</li></ul><p><strong>Scheduled Scaling</strong></p><ul><li>Adjusts resources based on predefined schedules.</li><li>Useful for applications with regular usage patterns.</li><li>Example: Increasing servers during business hours and reducing them overnight.</li></ul><h3>Tear down</h3><ul><li>Go to <strong>Load Balancers</strong>, select your load balancer, click <strong>Actions</strong>, and choose <strong>Delete load balancer</strong>.</li><li>Go to <strong>Target Groups</strong>, select your target group, click <strong>Actions</strong>, and choose <strong>Delete</strong>.</li><li>Go to <strong>Auto Scaling Groups</strong>, select your Auto Scaling Group, click <strong>Actions</strong>, and choose <strong>Delete</strong>.</li><li>Go to <strong>Launch Templates</strong>, select your launch template, click the <strong>Actions</strong> dropdown, and choose <strong>Delete launch template</strong>.</li><li>Go to <strong>Security Groups</strong>, select the security groups you created, and delete them.</li><li>If AWS says a security group is still being used, go to <strong>Inbound Rules</strong>, remove the inbound rules, save the changes, and try deleting it again.</li></ul><p>Following the above process should terminate all running EC2 instances and remove the related resources.</p><h3>Summary</h3><p>In this blog, we explored Amazon EC2 and the key components required to launch and manage instances, including AMIs, instance types, networking, IAM roles, storage, and security groups.</p><p>We also learned why running a single EC2 instance is not suitable for production workloads and how <strong>EC2 Auto Scaling</strong> helps maintain availability and handle changing demand.</p><h3>Before you go</h3><ul><li>Please take a moment to like the post and follow the writer!</li><li>Did you know that over 400,000 developers share what they’re building, learning, and discovering across our platforms every month? Learn how you can contribute <a href="https://plainenglish.io/write-for-us">here</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c1611f8a5f6" width="1" height="1" alt=""><hr><p><a href="https://aws.plainenglish.io/amazon-elastic-cloud-compute-amazon-ec2-fundamentals-building-elastic-cloud-infrastructure-on-aws-1c1611f8a5f6">Amazon Elastic Cloud Compute(Amazon EC2) Fundamentals: Building Elastic Cloud Infrastructure on AWS</a> was originally published in <a href="https://aws.plainenglish.io/">AWS in Plain English</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Sidecar Containers in Kubernetes: When to Use Them?]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">A sidecar container is a container that runs alongside the main application container within the same Pod.</p><p class="medium-feed-link"><a href="https://medium.com/@TechMarauder/sidecar-containers-in-kubernetes-when-to-use-them-01348cb75260?source=rss-6b31ab51f87e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@TechMarauder/sidecar-containers-in-kubernetes-when-to-use-them-01348cb75260?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/01348cb75260</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[kubernetes]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Tue, 31 Mar 2026 18:37:58 GMT</pubDate>
            <atom:updated>2026-03-31T18:37:58.832Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Optimizing Docker Images: Transitioning from Excessively Large to Suitable for Production]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">When building Docker images, many developers&#x2019; focus is simply &#x201C;getting it to work.&#x201D; However, for production environments, image size&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@TechMarauder/optimizing-docker-images-transitioning-from-excessively-large-to-suitable-for-production-496aa0feed4f?source=rss-6b31ab51f87e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@TechMarauder/optimizing-docker-images-transitioning-from-excessively-large-to-suitable-for-production-496aa0feed4f?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/496aa0feed4f</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[docker-image]]></category>
            <category><![CDATA[dockerfiles]]></category>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Thu, 26 Mar 2026 18:21:05 GMT</pubDate>
            <atom:updated>2026-03-26T18:21:05.248Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Why Is My Database on My Linux Server Slow? A Practical Debugging Guide for Engineers]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">It&#x2019;s 2 AM. Your application is timing out. Users are frustrated. Dashboards look &#x201C;normal&#x201D;&#x2026; but something is off.</p><p class="medium-feed-link"><a href="https://medium.com/@TechMarauder/why-is-my-database-on-my-linux-server-slow-a-practical-debugging-guide-for-engineers-edb06a068305?source=rss-6b31ab51f87e------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@TechMarauder/why-is-my-database-on-my-linux-server-slow-a-practical-debugging-guide-for-engineers-edb06a068305?source=rss-6b31ab51f87e------2</link>
            <guid isPermaLink="false">https://medium.com/p/edb06a068305</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[mysql]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[system-adm]]></category>
            <category><![CDATA[sre]]></category>
            <dc:creator><![CDATA[LibenHailu]]></dc:creator>
            <pubDate>Tue, 24 Mar 2026 17:55:24 GMT</pubDate>
            <atom:updated>2026-03-24T17:55:24.969Z</atom:updated>
        </item>
    </channel>
</rss>