<?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 Upendra Prasad Neupane  on Medium]]></title>
        <description><![CDATA[Stories by Upendra Prasad Neupane  on Medium]]></description>
        <link>https://medium.com/@upendrapn?source=rss-3f41700071ca------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*ivFmo8gRjHBSVxJm</url>
            <title>Stories by Upendra Prasad Neupane  on Medium</title>
            <link>https://medium.com/@upendrapn?source=rss-3f41700071ca------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 20:33:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@upendrapn/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to Migrate an EC2 Instance Between AWS Accounts: What to Consider and Be Aware Of]]></title>
            <link>https://medium.com/@upendrapn/how-to-migrate-an-ec2-instance-between-aws-accounts-what-to-consider-and-be-aware-of-f4052c7149e1?source=rss-3f41700071ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/f4052c7149e1</guid>
            <dc:creator><![CDATA[Upendra Prasad Neupane ]]></dc:creator>
            <pubDate>Thu, 13 Aug 2026 05:58:47 GMT</pubDate>
            <atom:updated>2026-08-13T05:58:47.505Z</atom:updated>
            <content:encoded><![CDATA[<p>Moving an application server from one AWS account to another can sound complicated, especially if you are new to Amazon EC2.</p><p>You may have an existing EC2 instance with an operating system, applications, configuration files, installed packages, and data. The obvious question is:</p><blockquote><strong><em>Do I have to build the entire server again in the new AWS account?</em></strong></blockquote><p>Fortunately, in many cases, the answer is <strong>no</strong>.</p><p>AWS provides a convenient way to create a reusable image of an EC2 instance called an <strong>Amazon Machine Image (AMI)</strong>. You can use that AMI to move the server’s operating system, installed software, configuration, and EBS-backed storage into another AWS account.</p><p>This article explains the process step by step, in beginner-friendly language.</p><h3>What We Are Trying to Achieve</h3><p>Imagine you have an EC2 instance running in:</p><p><strong>AWS Account A</strong></p><p>and you want to move it to:</p><p><strong>AWS Account B</strong></p><p>The overall process looks like this:</p><pre>Existing EC2<br>     │<br>     ▼<br>Create AMI<br>     │<br>     ▼<br>Share AMI with New Account<br>     │<br>     ▼<br>Copy AMI into New Account<br>     │<br>     ▼<br>Launch New EC2<br>     │<br>     ▼<br>Configure Networking &amp; Security<br>     │<br>     ▼<br>Test Application</pre><p>The important idea is that <strong>the AMI carries the server image</strong>, while things such as networking, security groups, IAM roles, and public IP addresses need to be handled separately.</p><h3>What Is an AMI?</h3><p>Before looking at the migration process, it is important to understand what an AMI is.</p><p><strong>AMI stands for Amazon Machine Image.</strong></p><p>An AMI is a template that can be used to create EC2 instances.</p><p>It can contain things such as:</p><ul><li>Operating system</li><li>Installed applications</li><li>Application configuration</li><li>System configuration</li><li>Data stored on included EBS volumes</li></ul><p>Think of an AMI as a <strong>blueprint of your EC2 server</strong>.</p><p>For example, suppose an EC2 instance has:</p><pre>Ubuntu/Linux<br>     +<br>Web server<br>     +<br>Application<br>     +<br>Required packages<br>     +<br>Configuration files<br>     +<br>EBS volume data</pre><p>Creating an AMI allows you to capture that environment and use it to create another EC2 instance.</p><p>AWS describes the normal process as:</p><p><strong>Existing EC2 → Create AMI → Launch new EC2 from AMI.</strong></p><h3>Why Use an AMI for Migration?</h3><p>Without an AMI, you could create a new EC2 instance and manually install everything again.</p><p>For example:</p><pre>Create EC2<br>    ↓<br>Install operating system<br>    ↓<br>Install packages<br>    ↓<br>Install web server<br>    ↓<br>Install application<br>    ↓<br>Copy configuration<br>    ↓<br>Copy data<br>    ↓<br>Configure everything<br>    ↓<br>Test</pre><p>This can take considerable time and creates opportunities for mistakes.</p><p>With an AMI, the process becomes much simpler:</p><pre>Existing EC2<br>    ↓<br>Create AMI<br>    ↓<br>Copy AMI<br>    ↓<br>Launch EC2</pre><p>However, there is an important distinction:</p><blockquote><strong><em>An AMI does not magically migrate your entire AWS environment.</em></strong></blockquote><p>It primarily represents the server image and its included storage. AWS resources around that server must be configured separately.</p><h3>Step 1: Create an AMI from the Existing EC2</h3><p>Start in the AWS account containing the original EC2 instance.</p><p>Go to:</p><p><strong>AWS Console → EC2 → Instances</strong></p><p>Select the EC2 instance you want to migrate.</p><p>Then select:</p><p><strong>Actions → Image and templates → Create image</strong></p><p>Give the AMI a meaningful name, such as:</p><pre>application-server-migration</pre><p>If possible, keep <strong>Reboot instance</strong> enabled when creating the image.</p><p>Why?</p><p>Rebooting helps improve filesystem consistency when the AMI is created.</p><p>Then select:</p><p><strong>Create image</strong></p><p>AWS will create the AMI and the associated EBS snapshots.</p><p>Wait until the AMI status becomes:</p><p><strong>Available</strong></p><p>The source material follows this same process: select the instance, choose <strong>Create image</strong>, wait for the AMI to become available, and then use that image for the new instance.</p><h3>Step 2: Share the AMI with the New AWS Account</h3><p>Once the AMI is available, you need to make it accessible from the destination AWS account.</p><p>Go to:</p><p><strong>EC2 → AMIs</strong></p><p>Select the AMI.</p><p>Then choose:</p><p><strong>Actions → Edit AMI permissions</strong></p><p>Change the permissions so that the destination AWS account can access the AMI.</p><p>You will need the AWS Account ID of the destination account.</p><p>Conceptually:</p><pre>Account A<br>   │<br>   │ AMI<br>   ▼<br>Share<br>   │<br>   ▼<br>Account B</pre><p>The destination account can now see the shared AMI.</p><h3>What About Encrypted EBS Volumes?</h3><p>This is an important consideration.</p><p>If the AMI uses <strong>encrypted EBS volumes</strong>, you also need to handle the associated AWS KMS permissions correctly.</p><p>The KMS key must be accessible to the destination account according to AWS’s cross-account encryption requirements.</p><p>This is one of the areas where an EC2 migration can become more complicated than simply sharing an AMI.</p><h3>Step 3: Open the New AWS Account</h3><p>Now log in to the destination AWS account.</p><p>Go to:</p><p><strong>EC2 → AMIs</strong></p><p>Look for the AMI shared from the original AWS account.</p><p>You should be able to find it under the shared AMIs area.</p><p>At this point, you have two accounts involved:</p><pre>AWS Account A<br>     │<br>     │ Shared AMI<br>     ▼<br>AWS Account B</pre><p>But there is one additional step that is strongly recommended.</p><h3>Step 4: Copy the AMI into the New Account</h3><p>Instead of continuously relying on the AMI from the original account, copy the AMI into the destination account.</p><p>Select the shared AMI and choose:</p><p><strong>Actions → Copy AMI</strong></p><p>The destination account can then create its own copy.</p><p>Why is this useful?</p><p>Because the destination account now has its <strong>own AMI</strong>.</p><p>The migration becomes:</p><pre>Original Account</pre><pre>EC2<br> │<br> ▼<br>AMI<br> │<br> │ Share<br> ▼</pre><pre>New Account</pre><pre>Shared AMI<br> │<br> ▼<br>Copied AMI<br> │<br> ▼<br>New EC2</pre><p>This gives the destination account a more independent copy of the server image.</p><p>Wait until the copied AMI becomes:</p><p><strong>Available</strong></p><p>before launching the new instance.</p><h3>Step 5: Launch a New EC2 from the AMI</h3><p>Once the AMI is available in the new account, select it and choose:</p><p><strong>Launch instance from AMI</strong></p><p>This creates the new EC2 instance based on the server image.</p><p>However, <strong>do not simply accept every default setting and click Launch</strong>.</p><p>This is where many beginners make mistakes.</p><p>The AMI contains the server environment, but several AWS infrastructure settings need to be configured for the new account.</p><h3>What Do You Need to Configure?</h3><p>When launching the new EC2, the AMI provides the server image, but you still need to configure the <strong>AWS infrastructure around it</strong>:</p><ul><li><strong>Instance type:</strong> Choose the same type as the original server or resize if needed.</li><li><strong>Key pair:</strong> Select a key pair you can use to access the instance.</li><li><strong>VPC &amp; Subnet:</strong> Choose the appropriate network in the new account.</li><li><strong>Public IP:</strong> Configure public IP, Elastic IP, or other connectivity based on your architecture.</li><li><strong>Security Group:</strong> Configure required ports and restrict SSH access to trusted sources where possible.</li><li><strong>IAM Role:</strong> Recreate or select the required IAM role for AWS service access.</li><li><strong>Storage:</strong> Review the EBS volume size and type. Remember that temporary instance-store storage is not the same as persistent EBS storage.</li></ul><p><strong>In short:</strong> The AMI brings the server; <strong>you configure the networking, access, permissions, and infrastructure around it.</strong>What Does an AMI Actually Migrate?</p><h3>What Migrates with the AMI?</h3><p>The easiest way to remember it is:</p><p><strong>AMI = Server</strong><br><strong>AWS infrastructure = Configure separately</strong></p><p>The AMI carries the <strong>OS, installed applications, server configuration, and included EBS data</strong>.</p><p>You still need to handle resources such as <strong>VPC, subnet, security groups, IAM roles, Elastic IP, Route 53, SSL certificates, Secrets Manager, CloudWatch alarms, Load Balancers, and KMS</strong> separately.</p><h3>What About IP Addresses?</h3><p>The new EC2 will generally receive <strong>new private and public IP addresses</strong>. If your application uses an Elastic IP or domain name, plan the IP reassignment or update DNS accordingly.</p><h3>Production Migration</h3><p>For production workloads, don’t terminate the old EC2 immediately:</p><p><strong>Create AMI → Share → Copy → Launch New EC2 → Test → Switch traffic/DNS → Monitor → Keep old server for rollback → Terminate old server</strong></p><p>This approach gives you a safer migration with a rollback option if something goes wrong.</p><h3>A Practical Pre-Launch Checklist</h3><p>Before clicking <strong>Launch instance</strong>, review these settings:</p><ul><li>Correct AMI selected</li><li>Correct instance type</li><li>Correct key pair</li><li>Correct VPC</li><li>Correct subnet</li><li>Public IP configuration reviewed</li><li>Security group configured</li><li>SSH access restricted appropriately</li><li>HTTP/HTTPS rules configured if required</li><li>IAM role configured</li><li>Storage configuration reviewed</li><li>Application-specific ports opened if required</li><li>DNS plan prepared</li><li>SSL certificates considered</li><li>Secrets and environment variables checked</li><li>External AWS services reviewed</li><li>Old EC2 kept available for rollback</li></ul><h3>Common Mistakes to Avoid</h3><h3>Mistake 1: Assuming the AMI Migrates Everything</h3><p>It doesn’t.</p><p>An AMI is primarily a server image.</p><p>You still need to think about:</p><pre>VPC<br>Security Groups<br>IAM<br>DNS<br>Load Balancer<br>Elastic IP<br>KMS<br>Secrets<br>Monitoring</pre><h3>Mistake 2: Opening SSH to Everyone</h3><p>Avoid:</p><pre>22 → 0.0.0.0/0</pre><p>when it isn’t necessary.</p><p>Restrict administrative access as much as possible.</p><h3>Mistake 3: Deleting the Old Server Too Early</h3><p>Don’t immediately terminate the original EC2.</p><p>First:</p><pre>Launch<br>   ↓<br>Test<br>   ↓<br>Verify<br>   ↓<br>Switch traffic<br>   ↓<br>Monitor<br>   ↓<br>Then remove old infrastructure</pre><h3>Mistake 4: Forgetting IAM Permissions</h3><p>The application might work perfectly at the operating-system level but fail when it tries to access AWS services.</p><p>For example:</p><pre>Application<br>    ↓<br>S3<br>    ✕<br>AccessDenied</pre><p>This can happen if the required IAM role wasn’t recreated in the destination account.</p><h3>Mistake 5: Forgetting External Dependencies</h3><p>Your EC2 may depend on services outside the AMI.</p><p>For example:</p><pre>EC2<br> ├── RDS<br> ├── S3<br> ├── Route 53<br> ├── Secrets Manager<br> ├── CloudWatch<br> └── Load Balancer</pre><p>Migrating the EC2 alone does not automatically migrate these services.</p><p>You need to identify and plan for each dependency.</p><h3>The Big Picture</h3><p>The easiest way to remember EC2 account migration is:</p><pre>SERVER<br>                │<br>                ▼<br>          Create AMI<br>                │<br>                ▼<br>        Share with Account B<br>                │<br>                ▼<br>          Copy the AMI<br>                │<br>                ▼<br>        Launch New EC2<br>                │<br>       ┌────────┴────────┐<br>       ▼                 ▼<br>   Server Image      AWS Resources<br>       │                 │<br>       │                 ├── VPC<br>       │                 ├── Subnet<br>       │                 ├── Security Group<br>       │                 ├── IAM<br>       │                 ├── DNS<br>       │                 ├── Load Balancer<br>       │                 └── Other Services<br>       │<br>       └── AMI</pre><p>The AMI handles the <strong>server side</strong>.</p><p>You handle the <strong>AWS infrastructure around the server</strong>.</p><p>Once you understand this distinction, EC2 migration becomes much easier to plan.</p><h3>Conclusion</h3><p>Migrating an EC2 instance between AWS accounts does not necessarily mean rebuilding the server from scratch.</p><p>An <strong>AMI provides a practical way to capture an existing EC2 environment and use it to launch a new instance in another AWS account</strong>.</p><p>The basic workflow is:</p><pre>Existing EC2<br>     ↓<br>Create AMI<br>     ↓<br>Share AMI<br>     ↓<br>Copy AMI<br>     ↓<br>Launch EC2<br>     ↓<br>Configure networking &amp; security<br>     ↓<br>Test application<br>     ↓<br>Move traffic<br>     ↓<br>Retire old server</pre><p>The most important lesson for beginners is this:</p><blockquote><strong><em>An AMI moves the server image, not your entire AWS architecture.</em></strong></blockquote><p>So before considering a migration complete, always review the networking, security, IAM permissions, DNS, storage, encryption, monitoring, and other AWS services connected to the original EC2.</p><p>With a proper checklist and a rollback plan, an EC2 account-to-account migration can be a controlled and relatively straightforward process.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f4052c7149e1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[IBM watsonx — From the Eyes of an AWS User]]></title>
            <link>https://medium.com/@upendrapn/ibm-watsonx-from-the-eyes-of-an-aws-user-d629d08bd2c1?source=rss-3f41700071ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/d629d08bd2c1</guid>
            <category><![CDATA[ibm]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Upendra Prasad Neupane ]]></dc:creator>
            <pubDate>Thu, 11 Jun 2026 14:51:34 GMT</pubDate>
            <atom:updated>2026-06-12T06:26:24.975Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/400/0*AjdikUiSPeva2inI" /></figure><h3>I was already using AWS — spinning up services, working with SageMaker, maybe poking around Bedrock — and then watsonx showed up on my radar. My first reaction was honestly: <em>“okay but why? I already have AWS for this.”</em></h3><p>Turns out, it’s not a replacement. It’s a different flavor of the same idea, built for a different kind of problem.</p><h3>The Way I Think About It Now</h3><p>When I was in AWS, I had to <strong>assemble everything myself.</strong> S3 for storage, Glue to catalog it, Athena to query it, SageMaker to train models, Clarify if I wanted bias checks — and I was the one wiring it all together.</p><p>watsonx feels like someone already wired it together for me. More opinionated, more structured. Less freedom, but way less setup.</p><h3>Mapping It To What I Already Know</h3><h4>watsonx.ai → The SageMaker + Bedrock I Already Used</h4><p>This felt immediately familiar. I already knew SageMaker for training and deploying models, and Bedrock for calling foundation models without managing infrastructure. watsonx.ai is basically both of those in one place — except IBM’s own models (called <strong>Granite</strong>) are the foundation models on the shelf instead of Anthropic or Titan.</p><p>The Studio UI felt like SageMaker Studio. Same idea — notebooks, experiments, model deployment — just IBM’s skin on it.</p><p><em>“Oh, this is just my SageMaker workflow but everything lives under one roof.”</em></p><h4>watsonx.data → The S3 + Glue + Athena Stack I Was Already Stitching Together</h4><p>On AWS I was constantly jumping between S3 (store it), Glue (catalog it), and Athena (query it). Three services, three consoles, three sets of permissions to manage.</p><p>watsonx.data does all three in one place. And the part that caught my attention — it runs on <strong>Apache Iceberg and Presto</strong>, which are open standards. So unlike AWS where your data pipeline gets cozy with proprietary formats, here I could theoretically move my data to another platform without starting from scratch.</p><p><em>“It’s like if S3 + Glue + Athena had a baby, and that baby didn’t lock you in.”</em></p><h4>watsonx.governance → The Thing AWS Never Really Gave Me</h4><p>This one had no clean AWS equivalent in my experience. SageMaker Clarify exists, sure — I could use it to check for bias. But it was always something I had to opt into, set up separately, and remember to use.</p><p>watsonx.governance is different. It’s <strong>baked in from the start.</strong> Every model automatically gets an <strong>AI FactSheet</strong> — think of it like a nutrition label that says: who built this model, what data was it trained on, how is it performing right now, has it drifted?</p><p>Coming from AWS where I had to manually set up monitoring and documentation — this felt like having a compliance officer sitting next to me the whole time. Annoying if you just want to move fast. Essential if you’re in banking, healthcare, or anywhere regulators can knock on your door.</p><p><em>“On AWS I had to remember to care about governance. On watsonx it’s not optional.”</em></p><h3>The Honest Comparison</h3><p><strong>What I Did on AWS — What watsonx Calls It</strong></p><blockquote>SageMaker + Bedrock — watsonx.ai</blockquote><blockquote>S3 + Glue + Athena — watsonx.data</blockquote><blockquote>SageMaker Clarify (when I remembered) — watsonx.governance (always on)</blockquote><blockquote>SageMaker Studio — watsonx Studio</blockquote><h3>My Takeaway</h3><p>If I’m building fast, experimenting, and I have full control over my stack — I’d still reach for AWS. I know it, I trust it, the ecosystem is massive.</p><p>But if I’m walking into a company that has <strong>compliance requirements</strong>, needs to <strong>explain every AI decision to regulators</strong>, or wants governance baked in rather than bolted on — watsonx makes a lot more sense. IBM built this for enterprises that can’t afford to get AI governance wrong.</p><p>It’s not better or worse than AWS. It’s built for a different kind of accountability.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d629d08bd2c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing Amazon Nova: The Future of Multimodal Generative AI for Businesses and Creators]]></title>
            <link>https://medium.com/@upendrapn/introducing-amazon-nova-the-future-of-multimodal-generative-ai-for-businesses-and-creators-5e7102e150bb?source=rss-3f41700071ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/5e7102e150bb</guid>
            <category><![CDATA[gen-ai-tools]]></category>
            <category><![CDATA[aws-ai-services]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[gen-ai-for-business]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Upendra Prasad Neupane ]]></dc:creator>
            <pubDate>Sun, 15 Dec 2024 12:00:37 GMT</pubDate>
            <atom:updated>2025-01-19T03:43:27.536Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon has introduced <strong>Amazon Nova</strong> at AWS re: Invent 2024, a groundbreaking suite of foundation models (FMs) that promises to revolutionize the way we think about generative AI. With the ability to process text, images, and videos as input, Amazon Nova is a powerful tool for businesses and individuals looking to take advantage of the latest in AI technology. In this blog, we will explore what Amazon Nova is, what it can do, and how individuals and businesses can benefit from it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*62MCTKkM2iHtaJtv" /><figcaption>Announcement of Amazon Nova at AWS re invent 2024</figcaption></figure><p><strong>What is Amazon Nova?</strong></p><p>Amazon Nova is a new generation of state-of-the-art foundation models designed to tackle a wide range of generative AI tasks. These models are available exclusively in Amazon Bedrock, Amazon’s fully managed platform for building and scaling generative AI applications. What sets Amazon Nova apart from other AI models is its ability to process multiple types of data — text, images, and videos — and generate meaningful outputs in the form of text, images, and videos.</p><p>Amazon Nova is a versatile solution for both understanding and creating content, and it offers multiple models designed to meet the needs of different industries and use cases.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*yPd7vKshhpkacqFD" /><figcaption>Image Generated Using Amazon Nova. Source: <a href="https://www.aboutamazon.com/news/aws/amazon-nova-artificial-intelligence-bedrock-aws">About Amazon — AWS Announcement</a></figcaption></figure><p><strong>What Does Amazon Nova Do?</strong></p><p>Amazon Nova is designed to provide AI capabilities in two main areas: <strong>Understanding Models</strong> and <strong>Creative Content Generation Models</strong>. Here’s what each category offers:</p><h3>1. Understanding Models:</h3><p>These models accept input in the form of text, images, or videos, and generate outputs in text. They help businesses and individuals analyze and understand complex information, making it easier to work with large datasets, videos, and documents. Here are the key models in this category:</p><ul><li><strong>Amazon Nova Micro</strong>: A text-only model focused on speed and cost-effectiveness, ideal for tasks such as text summarization, translation, and basic reasoning.</li><li><strong>Amazon Nova Lite</strong>: A multimodal model capable of processing text, images, and video inputs to generate text outputs. It is perfect for real-time customer service, document analysis, and visual question-answering tasks.</li><li><strong>Amazon Nova Pro</strong>: A high-performance multimodal model designed for more complex tasks, including document analysis and workflows that require API calls and tool usage.</li><li><strong>Amazon Nova Premier</strong>: The most capable model for complex reasoning tasks and creating custom models through distillation. It will be available in Q1 2025.</li></ul><h3>2. Creative Content Generation Models:</h3><p>These models help you create new content from scratch, such as images and videos. By using text and image inputs, Amazon Nova can generate high-quality visuals and video content tailored to your needs. Key models in this category include:</p><ul><li><strong>Amazon Nova Canvas</strong>: A state-of-the-art image generation model that can produce high-quality images with fine control over style, content, and editing features like inpainting, outpainting, and background removal.</li><li><strong>Amazon Nova Reel</strong>: A video generation model that allows you to create short videos using text prompts and reference images. You can control visual style, pacing, and even camera movements to create professional-quality video content.</li></ul><h3>How Amazon Nova Benefits Individuals and Businesses</h3><p>Amazon Nova’s range of models opens up new possibilities for both individuals and businesses. Here’s how they can benefit from these powerful tools:</p><h3>For Individuals:</h3><ol><li><strong>Content Creation</strong>: Individuals looking to create high-quality images or videos can use Amazon Nova to bring their ideas to life. Whether you’re a hobbyist, artist, or content creator, Nova’s image and video generation tools can help you create stunning visuals for social media, marketing, or personal projects.</li><li><strong>Enhanced Productivity</strong>: If you’re someone who works with large volumes of data or content, Nova’s understanding models can help you quickly summarize, translate, or analyze text, documents, and videos, saving you time and effort.</li></ol><h3>For Businesses:</h3><ol><li><strong>Streamlined Document Processing</strong>: Amazon Nova can analyze and understand complex documents, such as contracts or financial reports. Businesses can use it for document summarization, decision-making support, and workflow automation, improving efficiency across the board.</li><li><strong>Customer Service and Support</strong>: By integrating Nova into customer-facing applications, businesses can provide real-time customer support. With Nova Lite, for example, companies can handle customer queries that involve analyzing images, charts, or videos, providing faster and more accurate responses.</li><li><strong>Marketing and Advertising</strong>: Companies in the creative industries can use Amazon Nova’s image and video generation models to produce high-quality marketing content. Whether it’s creating promotional videos, social media posts, or advertising material, Nova can help generate content at scale.</li><li><strong>AI Agents</strong>: Nova’s agentic capabilities allow businesses to build intelligent AI agents capable of interacting with users, processing information, and even automating complex workflows. This is especially useful for industries that require decision-making based on visual and textual data.</li></ol><h3>The Potential of Amazon Nova: Revolutionizing the AI Landscape</h3><p>The potential of Amazon Nova is enormous. With its multimodal capabilities, businesses can integrate text, image, and video processing into their workflows, which was previously very challenging and expensive. Nova’s scalability, low cost, and ability to process up to 300,000 tokens and 30 minutes of video content per request make it an ideal tool for enterprise-grade applications.</p><p>Moreover, Nova’s customization features enable businesses to fine-tune the models for specific industry needs, ensuring that the AI understands their unique terminologies and requirements. Whether you’re in legal, finance, healthcare, or any other industry, Amazon Nova can be tailored to meet your demands.</p><h3>Availability and Regions</h3><p>Currently, by Dec 2024, Amazon Nova is available in the <strong>US East (N. Virginia)</strong> AWS region. Additionally, Amazon Nova Micro, Lite, and Pro are also available in the <strong>US West (Oregon)</strong> and <strong>US East (Ohio)</strong> regions through cross-region inference. This means businesses and developers in these regions can start leveraging Nova’s powerful capabilities right now.</p><p>Amazon Nova is available via <strong>Amazon Bedrock</strong>, AWS’s platform for managing and scaling generative AI applications. To get started, simply sign up for Amazon Bedrock, and begin building your applications with Nova.</p><h3>Key Takeaways</h3><ul><li><strong>What is Amazon Nova?</strong> A new generation of foundation models designed to process text, images, and video for both understanding and content creation tasks.</li><li><strong>What can it do?</strong> It can analyze and understand documents, videos, and images, and generate high-quality text, images, and videos for various use cases.</li><li><strong>Who can use it?</strong> Both individuals and businesses can benefit from Nova’s capabilities in content creation, document analysis, customer support, and much more.</li><li><strong>Availability:</strong> Amazon Nova is currently available in the US East (N. Virginia) region, with Amazon Nova Micro, Lite, and Pro also available in the US West (Oregon) and US East (Ohio) regions.</li></ul><p>If you’re ready to harness the power of Amazon Nova, head over to the <strong>Amazon Bedrock</strong> console today and start building innovative applications that leverage the latest in AI technology.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5e7102e150bb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Machine Learning with AWS: Leveraging AWS Services for Your AI Use Case]]></title>
            <link>https://medium.com/@upendrapn/machine-learning-with-aws-leveraging-aws-services-for-your-ai-use-case-a52a2d21c7a7?source=rss-3f41700071ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/a52a2d21c7a7</guid>
            <category><![CDATA[bedrock]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[sagemaker]]></category>
            <category><![CDATA[machine-learning-ai]]></category>
            <dc:creator><![CDATA[Upendra Prasad Neupane ]]></dc:creator>
            <pubDate>Sat, 21 Sep 2024 12:00:55 GMT</pubDate>
            <atom:updated>2024-12-27T17:25:24.239Z</atom:updated>
            <content:encoded><![CDATA[<p>In today’s world where data drives everything, machine learning (ML) has become a game-changer. It helps businesses solve tough problems, make operations smoother, and give customers more personalized experiences.<br>AI/ML has significantly boosted the economy and streamlined daily operations. Every business is now striving to incorporate AI into its processes to stay competitive.</p><p>AWS (Amazon Web Services) offers a wide range of tools and services that simplify the process of starting your machine learning (ML) journey or integrating AI capabilities into your business products. Let’s explore how AWS can support you in leveraging ML to drive innovation and efficiency.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/0*0SYNQdG14TwHposc.png" /><figcaption>AI/ML in AWS</figcaption></figure><h3>Why Pick AWS for Machine Learning?</h3><p>AWS is great for ML because it’s flexible, secure, and works for everyone — whether you’re just starting or running a big enterprise. Here are some reasons to choose AWS:</p><ul><li><strong>All-in-One Tools</strong>: AWS gives you everything you need, from cleaning your data to deploying your model.</li><li><strong>Scalability</strong>: Handle small projects or huge workloads without a problem.</li><li><strong>Easy Integration</strong>: AWS services work well together, making your life easier.</li><li><strong>Budget-Friendly</strong>: With pay-as-you-go pricing, you only pay for what you use.</li></ul><h3>Key Machine Learning Services on AWS</h3><h4>1. <a href="https://aws.amazon.com/sagemaker/">Amazon SageMaker</a></h4><p>Amazon SageMaker is AWS’s star ML service. It covers the entire ML process:</p><ul><li><strong>Build</strong>: Use prebuilt Jupyter notebooks, IDEs, and AutoML to start quickly.</li><li><strong>Train</strong>: Train your models efficiently with managed compute resources and features like spot instances.</li><li><strong>Deploy</strong>: Easily deploy your models using real-time endpoints or batch processing.</li></ul><p>SageMaker also has handy features like a Data Wrangler for cleaning data, a Model Monitor to keep an eye on your models, and Pipelines for automating workflows.</p><h4>2. AI Services</h4><p>Don’t want to build models from scratch? No problem! AWS has pre-trained AI services:</p><ul><li><a href="https://aws.amazon.com/rekognition/"><strong>Amazon Rekognition</strong></a>: Analyze images and videos.</li><li><a href="https://aws.amazon.com/comprehend/"><strong>Amazon Comprehend</strong></a>: Understand text and find patterns.</li><li><a href="https://aws.amazon.com/polly/"><strong>Amazon Polly</strong></a>: Convert text to speech.</li><li><a href="https://aws.amazon.com/transcribe/"><strong>Amazon Transcribe</strong>:</a> Turn speech into text.</li><li><a href="https://aws.amazon.com/transcribe/"><strong>Amazon Translate</strong></a>: Translate languages instantly.</li><li><a href="https://docs.aws.amazon.com/lexv2/latest/dg/what-is.html"><strong>Amazon Lex</strong></a>: Build conversational agents with text and voice capabilities.</li><li><a href="https://aws.amazon.com/bedrock/"><strong>Amazon Bedrock</strong></a>: For advanced, generative AI applications, Bedrock allows you to access a variety of powerful FM (foundational models) from leading providers. With Bedrock, you can easily build and scale AI applications without needing to manage the underlying infrastructure.</li></ul><h4>3. Deep Learning Tools</h4><p>For developers who need more control, AWS provides:</p><ul><li><strong>Deep Learning AMIs</strong>: Preconfigured environments for popular ML tools like TensorFlow and PyTorch.</li><li><strong>Framework Support</strong>: Use Scikit-learn, Keras, XGBoost, and more.</li></ul><h4>4. Data Storage and Analytics</h4><p>ML needs good data, and AWS helps you handle it:</p><ul><li><a href="https://aws.amazon.com/s3/"><strong>Amazon S3</strong></a>: Store all your data securely.</li><li><a href="https://aws.amazon.com/glue/"><strong>AWS Glue</strong></a>: Prepare and clean your data for ML.</li><li><a href="https://aws.amazon.com/redshift/"><strong>Amazon Redshift</strong></a>: Analyze large datasets easily.</li></ul><h3>Real-Life Examples of ML on AWS</h3><p>Companies from different fields use AWS ML services to make a difference:</p><ul><li><strong>Healthcare</strong>: Predict patient outcomes and improve treatments.</li><li><strong>Retail</strong>: Recommend products and manage inventory better.</li><li><strong>Finance</strong>: Spot fraud and assess risks automatically.</li><li><strong>Manufacturing</strong>: Predict machine failures and optimize supply chains.</li></ul><h3>How to Get Started with ML on AWS</h3><ol><li><strong>Identify Your Needs</strong>: What problem are you trying to solve? What data do you have?</li><li><strong>Try SageMaker Studio</strong>: It’s beginner-friendly and guides you through the process.</li><li><strong>Experiment with AI Services</strong>: Quickly test ideas using pre-trained models.</li><li><strong>Scale Up When Ready</strong>: AWS makes it easy to grow as your needs increase.</li></ol><h3>Final Thoughts</h3><p>With advancements in technology and increasing demand, AWS continues to evolve with more AI/ML services that help businesses and organizations meet their needs effectively. From healthcare to education, retail businesses to stock markets, large financial institutions, and so on, AWS AI/ML services simplify operations and empower businesses to scale and grow significantly.</p><p>#aws #ml #ai</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a52a2d21c7a7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Docker and Kubernetes How They Work Together]]></title>
            <link>https://medium.com/@upendrapn/docker-and-kubernetes-how-they-work-together-dfac388ed9d7?source=rss-3f41700071ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/dfac388ed9d7</guid>
            <dc:creator><![CDATA[Upendra Prasad Neupane ]]></dc:creator>
            <pubDate>Thu, 15 Aug 2024 12:00:15 GMT</pubDate>
            <atom:updated>2024-12-27T15:17:10.198Z</atom:updated>
            <content:encoded><![CDATA[<p>Containerization and orchestration have transformed how we develop, deploy, and scale applications. Two pivotal tools in this ecosystem are Docker and Kubernetes. In this blog, we’ll explore Docker, Kubernetes, their components, use cases, and how they complement each other to streamline modern application development.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/915/1*J5my1IpMvyivQC4YAXo4IA.png" /><figcaption>Docker and K8s</figcaption></figure><h3>What is Docker?</h3><p>Docker is an open-source platform that enables developers to automate the deployment of applications inside lightweight, portable containers. Containers bundle an application with all its dependencies, ensuring that it runs consistently across different environments. For instance, imagine a development team working on a web application with specific versions of Node.js and a database. With Docker, the team can package the app and its environment into a container, allowing it to run seamlessly on any system that supports Docker. is an open-source platform that enables developers to automate the deployment of applications inside lightweight, portable containers. Containers bundle an application with all its dependencies, ensuring that it runs consistently across different environments.</p><h3>Key Components of Docker</h3><ol><li><strong>Docker Engine</strong>: The core of Docker, responsible for building, running, and managing containers.</li><li><strong>Docker Images</strong>: Immutable templates containing the application code, runtime, libraries, and configurations.</li><li><strong>Docker Containers</strong>: Running instances of Docker images. They are isolated but share the host operating system’s kernel.</li><li><strong>Docker Compose</strong>: A tool for defining and managing multi-container applications using YAML files.</li><li><strong>Docker Hub</strong>: A repository for sharing and distributing Docker images.</li></ol><p>To better understand these components, imagine a workflow where a developer creates an application, packages it as a Docker image, and pushes it to Docker Hub. Later, they use Docker Compose to deploy multiple containers of the application, each managed by Docker Engine. The interplay of these components ensures seamless application deployment and management.</p><h3>Use Cases of Docker</h3><ul><li><strong>Simplified Development</strong>: Docker ensures consistent development and production environments.</li><li><strong>Microservices Architecture</strong>: Containers encapsulate microservices, making them easier to deploy and manage.</li><li><strong>Efficient Resource Utilization</strong>: Containers are lightweight, reducing overhead compared to virtual machines.</li><li><strong>Streamlined CI/CD Pipelines</strong>: Docker simplifies building, testing, and deploying applications.</li></ul><h3>What is Kubernetes?</h3><p>Kubernetes, often abbreviated as K8s, was developed by Google and released as an open-source project in 2014. It originated from Google’s internal system, Borg, which managed the company’s large-scale containerized workloads. The primary motivation behind Kubernetes was to provide a robust platform for automating the deployment, scaling, and management of containerized applications across distributed systems. often abbreviated as K8s, is an open-source container orchestration platform. It automates the deployment, scaling, and management of containerized applications across clusters of machines.</p><h3>Key Components of Kubernetes</h3><ol><li><strong>Pod</strong>: The smallest deployable unit in Kubernetes, usually containing one or more containers.</li><li><strong>Node</strong>: A machine (virtual or physical) in the Kubernetes cluster where Pods are deployed.</li><li><strong>Cluster</strong>: A set of Nodes managed by Kubernetes.</li><li><strong>Kubelet</strong>: An agent running on each Node, ensuring that containers are running in Pods.</li><li><strong>Controller Manager</strong>: Manages controllers that regulate the cluster’s state.</li><li><strong>Scheduler</strong>: Assigns Pods to Nodes based on resource requirements and availability.</li><li><strong>API Server</strong>: The gateway to the Kubernetes control plane, allowing users and tools to interact with the cluster.</li><li><strong>ETCD</strong>: A distributed key-value store for Kubernetes configuration data.</li></ol><h3>Use Cases of Kubernetes</h3><ul><li><strong>Scalability</strong>: Automatically scales applications based on demand.</li><li><strong>High Availability</strong>: Ensures application uptime by redistributing workloads in case of failures.</li><li><strong>Multi-Cloud and Hybrid Deployments</strong>: Orchestrates containers across various environments.</li><li><strong>Efficient Resource Management</strong>: Optimizes hardware utilization by managing resources dynamically.</li></ul><h3>How Docker and Kubernetes Work Together</h3><p>While Docker focuses on containerization, Kubernetes excels at orchestrating those containers. Here’s how they align:</p><ol><li><strong>Containerization Foundation</strong>: Docker creates containers; Kubernetes orchestrates them across multiple Nodes.</li><li><strong>Scalability</strong>: Kubernetes leverages Docker containers to scale applications seamlessly.</li><li><strong>Networking</strong>: Kubernetes manages inter-container and external communications, complementing Docker’s networking capabilities.</li><li><strong>Storage Management</strong>: Kubernetes provides persistent storage solutions for Docker containers.</li></ol><h3>Benefits of Combining Docker and Kubernetes</h3><ul><li><strong>Portability</strong>: Applications packaged in Docker containers run consistently on Kubernetes clusters.</li><li><strong>Automation</strong>: Kubernetes automates scaling, updates, and recovery of Docker containers.</li><li><strong>Efficiency</strong>: Optimal resource utilization by orchestrating containers across multiple Nodes.</li></ul><h3>Differences Between Docker and Kubernetes</h3><p>Aspect Docker Kubernetes <strong>Purpose</strong> Containerization Orchestration <strong>Scope</strong> Individual containers Multiple containers and clusters <strong>Scaling</strong> Manual Automatic <strong>Storage</strong> Basic options Advanced persistent storage <strong>Networking</strong> Simple configurations Comprehensive networking model</p><h3>Key Takeaways</h3><ul><li><strong>Docker</strong> simplifies application deployment by packaging it with dependencies in portable containers.</li><li><strong>Kubernetes</strong> automates the orchestration of containers, ensuring scalability and reliability across distributed systems.</li><li><strong>Collaboration</strong>: Docker and Kubernetes complement each other, with Docker focusing on containerization and Kubernetes excelling in orchestration.</li><li><strong>Efficiency</strong>: Together, they optimize resource utilization and streamline application lifecycle management.</li></ul><h3>Conclusion</h3><p>Docker and Kubernetes are not competing tools; they complement each other. Docker simplifies the creation of containers, while Kubernetes ensures their efficient deployment and scaling. Together, they form a powerful duo for building, deploying, and managing modern applications.</p><p>By leveraging both tools, organizations can embrace cloud-native principles, enabling faster development cycles, better scalability, and robust system reliability.</p><p><em>Ready to take your first step into the world of containers and orchestration? Start exploring Docker and Kubernetes today!</em></p><p>#docker #k8s #kubernetes #opensource</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dfac388ed9d7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Extracting Text and Objects from Images Using AWS ML Services: Amazon Rekognition and Textract]]></title>
            <link>https://medium.com/@upendrapn/extracting-text-and-objects-from-images-using-aws-ml-services-amazon-rekognition-and-textract-525ef46bbe1b?source=rss-3f41700071ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/525ef46bbe1b</guid>
            <dc:creator><![CDATA[Upendra Prasad Neupane ]]></dc:creator>
            <pubDate>Fri, 05 Jul 2024 19:26:32 GMT</pubDate>
            <atom:updated>2024-12-27T17:38:49.468Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>Before jumping into the content, I assume you have basic AWS knowledge, basic understanding of how web applications work, and have used VS Code or other Editors.</blockquote><h3>What Are We Doing Today?</h3><p>Today, we are extracting text and objects from images using AWS ML Services, Amazon Rekognition and Textract, as the title suggests.</p><p><strong>But how are we doing it?</strong></p><p>We will use an inbuilt web application called AcadeML, which contains multiple images and allows you to manually upload your own images. Through API calls, we’ll send these images to Amazon Rekognition and Textract.</p><h4>Examples</h4><ol><li><strong>Concert Poster</strong>: Upload a photo of a Nepathya concert poster. Amazon Rekognition will identify objects like band members and instruments, while Amazon Textract will extract text such as the date, venue, and sponsors.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0bKxySS9Px2jKtnHUDe64Q.png" /><figcaption>Extracting labels/Objects</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Nu7ghbfeKwxq3bJ7CXDcww.png" /><figcaption>Extracting Text in the image</figcaption></figure><ol><li><strong>Street Vendor</strong>: Upload a photo of a street vendor in Kathmandu. Amazon Rekognition will label objects such as fruits, vegetables, and the vendor, while Amazon Textract will extract any text present in the image.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FKOReEFo1m64pRidmhErvQ.png" /><figcaption>Extracting objects in the image</figcaption></figure><p>(In above image text are not detectable)</p><blockquote>Both services provide a confidence score, indicating the model’s certainty in its recognition of objects and text.</blockquote><h3>Tasks Overview</h3><p>We will carry out two main tasks:</p><ol><li><strong>Run Web Application Locally</strong>: Clone a public repository containing the web app code and run it locally without incorporating AWS ML services initially.</li><li><strong>Integrate Amazon Rekognition and Textract</strong>: Integrate these AWS ML services into the existing web application to see the extracted text and objects.</li></ol><h3>Task 1: Cloning and Running the Web App Locally</h3><blockquote>Before that, let me explain our web app. This web app is built with Vue.js for the frontend to create the user interface, and it uses Node.js for the backend to handle API interactions with Amazon Rekognition and Textract. We will not dive deep into the web app code, as our focus is on how AWS ML services work and can be integrated with a web app. If you are familiar with Vue.js, Node.js, and making API calls, that’s great, but if not, that’s fine too, as we will be concentrating more on the AWS ML API part.</blockquote><h3>Steps to Run the App Locally</h3><ol><li><strong>Clone the Repo</strong>:</li></ol><pre>git clone https://github.com/build-on-aws/building-a-machine-learning-enabled-web-app&quot;Open Terminal in VS Code: Ensure you are in the right directory like: &quot;PS C:\Users\user\Desktop\mlapi\building-a-machine-learning-enabled-web-app&gt;</pre><p><strong>2. Install Dependencies</strong>:</p><pre>npm install</pre><blockquote>When you run npm install with the provided package.json file, the installation will include the following dependencies: @aws-sdk/client-rekognition for Rekognition service, @aws-sdk/client-textract for Textract service, @mdi/font for Material Design Icons, buffer for polyfill support of Node.js Buffer API, roboto-fontface for Roboto fonts, vue as the JavaScript framework for building user interfaces, vuetify as the UI library with material components, and webfontloader for loading web fonts.</blockquote><blockquote>Additionally, the devDependencies installed will include @vitejs/plugin-vue for integrating Vue with Vite, vite as the frontend build tool, and vite-plugin-vuetify for Vuetify support in Vite. These packages will be added to your node_modules directory and listed in your package-lock.json file.</blockquote><p><strong>3. Run the Application</strong>:</p><pre>npm run dev</pre><p><strong>5. Access the Application</strong>: Open the browser and go to:</p><pre>http://localhost:3000/</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1bcbfA7cBquI7VFg" /><figcaption>Running web app locally</figcaption></figure><p>6. You will see a collection of sample images and an option to upload your own images. The app includes buttons to “Detect Labels” and “Detect Text,” but these features won’t work yet since the ML APIs aren’t integrated.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*JAO4dr0QjiKPE2le" /><figcaption>Web App interface</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*b76L7Sg4XdsEkM2-" /><figcaption>When you click in detect labels or detect text</figcaption></figure><h3>Task 2: Integrating Amazon Rekognition and Textract</h3><blockquote>Before integrating Amazon Rekognition and Textract into our web app, we need to authenticate our application with AWS. This ensures that our application has the necessary permissions to access and use AWS services. We achieve this authentication using AWS access key, which consist of an Access Key ID and a Secret Access Key and region.</blockquote><blockquote>Ensure you IAM user account has enough permissions , I have administrative permissions in my IAM account which I am using here.</blockquote><h3>Steps to Obtain AWS Access Key</h3><ol><li><strong>Sign in to AWS Management Console</strong></li><li><strong>Navigate to Security Credentials</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/976/1*muNebHT-EX1HDpyOs6qdOg.png" /></figure><ol><li><strong>Create Access Keys</strong>:</li></ol><ul><li>Click on “Create access key”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/958/1*r0ANIy80PsZLUlIGNC-FhA.png" /></figure><ul><li>Choose “Command Line Interface (CLI)”, Tick the confirmation and select “Next”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/913/1*bBSdY_pcvejD5zfQNlrEbQ.png" /></figure><ul><li>Add a description (optional) and click “Create access key”</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gq6Kc9YQuiDYiUTPsdtd0w.png" /></figure><ul><li>Download the .csv file containing your new Access Key ID and Secret Access Key, or copy the credentials</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/660/0*lrN_o83tWDlFch6M" /><figcaption>After downloading you will see like this</figcaption></figure><blockquote><em># Do not worry I will remove access key :&lt;</em></blockquote><h3>Setting Up Environment Variables</h3><ol><li><strong>Create a </strong><strong>.env.local File</strong> in the root directory of your project and add the following lines:</li></ol><pre>VITE_AWS_ACCESS_KEY_ID=your_access_key_id<br>VITE_AWS_SECRET_ACCESS_KEY=your_secret_access_key<br>VITE_AWS_REGION=us-east-1</pre><p>#Be mindful of what region are you in, I am in us-east-1</p><p><strong><em>The </em></strong><strong><em>VITE_ prefix ensures these variables are exposed to the client-side code.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7gEqHODBC3o5_JMNO5Mtxg.png" /><figcaption>“.env.local” file in root directory with access key and region with VITE_ prefit</figcaption></figure><h3>Integrating AWS SDK in AmazonML.js</h3><ol><li><strong>Open the </strong><strong>AmazonML.js File</strong> in the src directory.</li></ol><h3>Import Statements</h3><pre>import { Buffer } from &quot;buffer&quot;;<br>import { RekognitionClient, DetectLabelsCommand } from &quot;@aws-sdk/client-rekognition&quot;;<br>import { DetectDocumentTextCommand, TextractClient } from &quot;@aws-sdk/client-textract&quot;;<br></pre><blockquote><strong>Importing necessary AWS SDK clients and the Buffer class</strong>: This part imports the classes and functions required to interact with AWS Rekognition and Textract services, as well as the Buffer class to handle binary data.</blockquote><h3>AWS Credentials</h3><pre>const creds = {<br>  region: import.meta.env.VITE_AWS_REGION,<br>  credentials: {<br>    accessKeyId: import.meta.env.VITE_AWS_ACCESS_KEY_ID,<br>    secretAccessKey: import.meta.env.VITE_AWS_SECRET_ACCESS_KEY,<br>    <br>  },<br>};</pre><blockquote>Note: Remove this line as we are not hosted workshop account:</blockquote><blockquote>seesessionToken: import.meta.env.VITE_AWS_SESSION_TOKEN, // leave out if not in hosted workshop</blockquote><blockquote><strong>Setting up AWS credentials using environment variables</strong>: This object holds the necessary credentials and region information to authenticate and interact with AWS services.</blockquote><h3>Client Initialization</h3><pre>let rekognitionClient = null;<br>let textractClient = null;</pre><blockquote><strong>Variables to hold the Rekognition and Textract client instances</strong>: These variables will store the instances of Rekognition and Textract clients, ensuring they are only created once.</blockquote><h3>Analyze Image Function</h3><pre>export async function analyzeImageML(type, imageData) {<br>  const uimage_bytes = base64ToUint8Array(imageData.split(&quot;data:application/octet-stream;base64,&quot;)[1]);<br>  const params = {<br>    Image: { Bytes: uimage_bytes },<br>    MaxLabels: 10,<br>    MinConfidence: 80,<br>  };<br>  <br>  var returnData = null;<br>  try {<br>    if (type == &quot;labels&quot;) {<br>      if (!rekognitionClient)  <br>        rekognitionClient = new RekognitionClient(creds);<br>      const query = new DetectLabelsCommand(params);<br>      let response = await rekognitionClient.send(query);        <br>      returnData = {<br>        type: &quot;success&quot;,<br>        text: response,<br>      };<br>    } else if (type == &quot;text&quot;) {<br>      if (!textractClient) <br>        textractClient = new TextractClient(creds);<br>      const params = {<br>        Document: { Bytes: uimage_bytes },<br>      };<br>      const query = new DetectDocumentTextCommand(params);<br>      let response = await textractClient.send(query);<br>      returnData = {<br>        type: &quot;success&quot;,<br>        text: response,<br>      };  <br>    }<br>  } catch (error) {<br>    returnData = {<br>      type: &quot;error&quot; /* success info warning error */,<br>      text: error.message,<br>    };<br>  }<br>  return JSON.stringify(returnData);  <br>}</pre><blockquote><strong>Main function to analyze the image using Rekognition or Textract based on the type</strong>:</blockquote><blockquote><strong>Convert image data to bytes</strong>: Converts the base64 encoded image data to a Uint8Array.</blockquote><blockquote><strong>Parameters setup</strong>: Sets up the parameters for the Rekognition or Textract API calls.</blockquote><blockquote><strong>Rekognition for labels</strong>: If the type is “labels”, it initializes the Rekognition client (if not already initialized), sends a request to detect labels, and stores the response.</blockquote><blockquote><strong>Textract for text</strong>: If the type is “text”, it initializes the Textract client (if not already initialized), sends a request to detect text, and stores the response.</blockquote><blockquote><strong>Error handling</strong>: Catches and handles any errors that occur during the API call, storing the error message.</blockquote><h3>Helper Function</h3><pre>function base64ToUint8Array(base64Data) {<br>  const decoded = Buffer.from(base64Data, &quot;base64&quot;);<br>  const bytes = new Uint8Array(<br>    decoded.buffer,<br>    decoded.byteOffset,<br>    decoded.byteLength<br>  );<br>  return bytes;<br>}</pre><blockquote><strong>Converts base64 encoded image data to a </strong><strong>Uint8Array</strong>:</blockquote><blockquote><strong>Decode base64 data</strong>: Decodes the base64 data to a buffer.</blockquote><blockquote><strong>Create Uint8Array</strong>: Creates a Uint8Array from the buffer to be used by the AWS SDK.</blockquote><h3>Testing the Application</h3><ol><li><strong>Save the Changes</strong> to AmazonML.js.</li><li><strong>Run the Application</strong>:</li></ol><pre>npm run dev</pre><ol><li><strong>Open the Application</strong>: Navigate to:</li></ol><pre>http://localhost:3000/</pre><ol><li><strong>Upload an Image</strong> and use the “Detect Labels” and “Detect Text” buttons to test the integration.</li></ol><p>In Conclusion We’ve successfully integrated Amazon Rekognition and Textract into a web application to extract objects and text from images. By following the steps outlined above, you can build and enhance your web applications with powerful AWS ML capabilities.</p><p>#aws #ml #rekognition #textract</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=525ef46bbe1b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Steps to Access an AWS EC2 Instance Using SSH]]></title>
            <link>https://medium.com/@upendrapn/steps-to-access-an-aws-ec2-instance-using-ssh-c7ab3eb01499?source=rss-3f41700071ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7ab3eb01499</guid>
            <dc:creator><![CDATA[Upendra Prasad Neupane ]]></dc:creator>
            <pubDate>Tue, 25 Jun 2024 19:10:34 GMT</pubDate>
            <atom:updated>2024-06-26T03:59:15.317Z</atom:updated>
            <content:encoded><![CDATA[<h3>Steps to Access an AWS EC2 Instance Using SSH from your local machine</h3><p>Before jumping into core part lets start with background ,What is SSH , its history and How it works.</p><h3>Introduction to SSH</h3><p>SSH (Secure Shell) is a network protocol that provides a secure way to access a computer over an unsecured network. It encrypts the data exchanged between the client (local machine) and the server (remote machine). Before SSH, the TELNET protocol was used for remote communication, but it transmitted data in plain text, which was not secure.</p><h3>How SSH Works</h3><p>SSH works by creating a secure channel between the client (local machine) and the server (remote machine). Here’s how it establishes a connection:</p><ol><li><strong>Server and Client</strong>:</li></ol><ul><li>The server runs SSH server software.</li><li>The client runs SSH client software</li></ul><p><strong>2. Authentication</strong>:</p><ul><li>The client initiates a connection to the server.</li><li>The server responds with its public key.</li><li>The client and server negotiate encryption parameters to establish a secure connection.</li><li>The client authenticates itself to the server using various methods, commonly by providing a private key.</li></ul><p><strong>3. Establishing a Secure Connection</strong>:</p><ul><li>Once authenticated, the server allows the client to access the shell or execute commands.</li><li>All communication between the client and server is encrypted.</li></ul><h3>Steps to Access an AWS EC2 Instance Using SSH</h3><h4>1. Create an EC2 Instance</h4><p>First, create an EC2 instance in your AWS account. This involves choosing an Amazon Machine Image (AMI), instance type, configuring instance details, adding storage, and configuring security groups.</p><h4>2. Key Pair (Login)</h4><p>During the instance creation, you need to select or create a key pair. This key pair will be used to securely connect to your instance.</p><ol><li><strong>Create a Key Pair</strong>:</li></ol><ul><li>In the “Key pair (login)” section, select “Create new key pair”.</li><li>Enter a name for your key pair.</li><li>Choose the key pair type (e.g., RSA).</li><li>Select the private key file format (.pem for OpenSSH, .ppk for PuTTY).</li><li>Click “Create key pair”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/823/1*fm8PSdN0h20AyxQwpZ9aeQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kWOjhJpkbASnredhlVV4qQ.png" /><figcaption>In above Screenshot I create the new key pair in RSA time for .pem file format to use it with my local ubuntu terminal</figcaption></figure><ol><li><strong>Download the .pem File</strong>:</li></ol><ul><li>After creating the key pair, a .pem file will be downloaded to your local machine. Save this file in a secure location as you will need it to SSH into your EC2 instance.</li></ul><h4>3. Go to the Directory Where the .pem File is Downloaded</h4><p>Open your terminal (Command Prompt, Git Bash, or Terminal on Mac/Linux) and navigate to the directory where you downloaded the .pem file.</p><h4>4. Change the File Permission</h4><p>To secure your .pem file and ensure it is not publicly viewable, change its permissions:</p><p><strong><em>(chmod 400 &lt;your-pem-file&gt;.pem)</em></strong></p><p><strong><em>Example: (chmod 400 ec2-lab.pem)</em></strong></p><h4>5. Connect to the EC2 Instance Using SSH</h4><p>Now, you can connect to your EC2 instance using the SSH command:</p><p><strong><em>(ssh -i &lt;your-pem-file&gt;.pem ubuntu@&lt;your-ec2-public-ip&gt;)</em></strong></p><p><strong><em>Example: (ssh -i ec2-lab.pem ubuntu@3.26.149.304)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*alOQaaCt-4rrW68J1FstWw.png" /><figcaption>In Screenshot above , We went to the directory where .pem file is located , gave the permission and then access the remote server (ec2 instance)</figcaption></figure><p>You can see that above upen@upen (my local machine user name and host name) is changed into ubuntu@ip_##.##.##.## ( ubuntu as user name and ##.##.##.## as host name)</p><h4>Note on SSH Clients</h4><ul><li><strong>Linux/Mac</strong>: You can directly use the terminal to SSH as SSH is inbuilt.</li><li><strong>Windows</strong>: You can use Git Bash or Windows Subsystem for Linux (WSL) to run the SSH commands. Alternatively, you can use PuTTY, but you will need to convert the .pem file to .ppk format using PuTTYgen.</li></ul><h3>Verifying Server Connection from Local Terminal (Create txt file in local and verify in ec2, aws console)</h3><ol><li><strong>Create a directory and navigate to it:</strong></li></ol><p><strong><em>(mkdir test) and (cd test)</em></strong></p><ol><li>Create a simple text file:</li></ol><p><strong><em>(echo “this is testing” &gt; test.txt)</em></strong></p><ol><li>Exit the SSH session:</li></ol><p><strong><em>(ctrl+d)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*xtomETCI6fvEZbEEe0Cw8Q.png" /><figcaption>In above Screeshot above first we created directory and inside that created simple txt file.</figcaption></figure><ol><li><strong>Verify the file using EC2 Instance Connect:</strong></li></ol><ul><li>Go to the AWS Management Console.</li><li>Navigate to the EC2 Dashboard.</li><li>Select your instance and click “Connect”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*A0pmMogSsp0H_8B2IZ_pIw.png" /></figure><ul><li>Choose “EC2 Instance Connect” and click “Connect”.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*Thudv83WUnrLRavGyRcrgw.png" /><figcaption>In above Screenshot we are tying to connect EC2 instannce using EC2 Instance Connect after you click to connect in left most in the bottom it will open new tab with terminal</figcaption></figure><ul><li>Verify the text file by listing the directory and displaying its contents step by step:</li></ul><p><strong><em>(ls) </em></strong>to check the list of directories, it will show the ‘test’ directory.</p><p><strong><em>(cd test) </em></strong>to go to the ‘test’ directory.</p><p><strong><em>(ls) </em></strong>to see the list of files in that directory, it will show ‘test.txt’.</p><p><strong><em>(cat test.txt) </em></strong>to display the content which is “this is testing”.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/714/1*1U3tKpYVKZ7DlPGEyBYUmQ.png" /><figcaption>Verifying from EC2 instance connect</figcaption></figure><h3>Installing and Verifying Git on EC2</h3><h4>Step 1: Install Git on the EC2 Instance</h4><p>You already logged out from the server in the local earlier using Exit the SSH session (ctrl+d), so now again access the server using the same way like earlier:</p><ol><li>Change the file permission:</li></ol><p><strong><em>(chmod 400 &lt;your-pem-file&gt;.pem)</em></strong></p><ol><li>Connect to the EC2 instance:</li></ol><p><strong><em>(ssh -i &lt;your-pem-file&gt;.pem ubuntu@&lt;your-ec2-public-ip&gt;)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*csv0Klmm5hZKyOacHUJYTA.png" /><figcaption>Accessing EC2 instance</figcaption></figure><ol><li>Then, update the package list:</li></ol><p><strong><em>(sudo apt-get update)</em></strong></p><ol><li>Install Git:</li></ol><p><strong><em>(sudo apt-get install -y git)</em></strong></p><ol><li>Verify the installation by checking the Git version:</li></ol><p><strong><em>(git — version)</em></strong></p><p>(You should see output similar to <strong><em>git version 2.x.x </em></strong>confirming that Git is installed in the server from the local terminal)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Pu7jnJ7inTBY5v_DWyJibQ.png" /><figcaption>Installing git</figcaption></figure><ol><li>Exit the SSH session:</li></ol><p><strong>(ctrl+d)</strong></p><h4>Step 2: Verify the Git Installation Using EC2 Instance Connect</h4><ol><li>Go to the AWS Management Console.</li><li>Navigate to the EC2 Dashboard.</li><li>Select your instance and click “Connect”.</li><li>Choose “EC2 Instance Connect” and click “Connect”.</li><li>Verify the installation by checking the Git version:</li></ol><ul><li><strong><em>(git — version)</em></strong></li><li>You should see output similar to<strong><em> git version 2.x.x </em></strong>confirming that Git is installed.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kOQcYfAhJJrrMGc0tHWjIA.png" /><figcaption>Navigate to EC2 instane connect like we did earlier and run above command to verify the git installed</figcaption></figure><h3>Installing and Verifying Nginx on EC2</h3><h4>Step 1: SSH into Your EC2 Instance</h4><p>You already logged out from the server in the local earlier using Exit the SSH session (ctrl+d), so now again access the server using the same way like earlier:</p><ul><li>Change the file permission:</li></ul><p><strong>(chmod 400 &lt;your-pem-file&gt;.pem)</strong></p><ul><li>Connect to the EC2 instance:</li></ul><p><strong><em>(ssh -i &lt;your-pem-file&gt;.pem ubuntu@&lt;your-ec2-public-ip&gt;)</em></strong></p><h4>Step 2: Install Nginx on the EC2 Instance</h4><p>Once you are logged into the EC2 instance via SSH:</p><ol><li>Update the package list:</li></ol><p><strong><em>(sudo apt-get update)</em></strong></p><ol><li>Install Nginx:</li></ol><p><strong><em>(sudo apt-get install -y nginx)</em></strong></p><ol><li>Start the Nginx service:</li></ol><p><strong><em>(sudo systemctl start nginx)</em></strong></p><ol><li>Enable Nginx to start on boot:</li></ol><p><strong><em>(sudo systemctl enable nginx)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gyGPhvmuzy6XfsfRLyX8Yg.png" /><figcaption>Installing nginx from local terminal</figcaption></figure><h4>Step 3: Verify the Installation Using EC2 Instance Connect</h4><ol><li>Go to the AWS Management Console.</li><li>Navigate to the EC2 Dashboard.</li><li>Copy the public IP of the instance.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/750/1*Gm6MF5VJIBXcjtPyy5gMBQ.png" /></figure><ol><li>Paste it in a new tab or click in open address, and it will show some content starting from “Welcome to Nginx” and ending with “Thank you for using Nginx”.like below:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/587/1*hhrn54veqUxJMvjCPvO6Ug.png" /></figure><p>Alternatively, you can verify by:</p><ol><li>Go to the AWS Management Console.</li><li>Navigate to the EC2 Dashboard.</li><li>Select your instance and click “Connect”.</li><li>Choose “EC2 Instance Connect” and click “Connect”.</li><li>Verify Nginx is running by checking the status:</li></ol><p><strong><em>(sudo systemctl status nginx)</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ureFrkx9hGQ0Kgc5hZND1Q.png" /></figure><p>From above workflow We created a key pair, verify the server connection by creating a directory and a text file, install and verify Git and Nginx on your EC2 instance from your local terminal, and use EC2 Instance Connect in the AWS Management Console.</p><p>“Hope you get know about ssh and how to access EC2 instance from local machine using steps above”</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7ab3eb01499" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Linux Made Easy: A Beginner’s Journey Through Bash]]></title>
            <link>https://medium.com/@upendrapn/linux-made-easy-a-beginners-journey-through-bash-f62e7259aa2d?source=rss-3f41700071ca------2</link>
            <guid isPermaLink="false">https://medium.com/p/f62e7259aa2d</guid>
            <category><![CDATA[bash-scripting]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[scripting-language]]></category>
            <category><![CDATA[bash-script]]></category>
            <category><![CDATA[bash]]></category>
            <dc:creator><![CDATA[Upendra Prasad Neupane ]]></dc:creator>
            <pubDate>Wed, 15 May 2024 12:00:16 GMT</pubDate>
            <atom:updated>2026-04-25T11:50:47.880Z</atom:updated>
            <content:encoded><![CDATA[<p>I have tried to document the important Bash commands that are essential for scripting and other tasks.</p><p>Bash is one of the most widely used shells in Unix-like systems, offering powerful tools and commands for managing files, processes, and systems. Whether you’re a beginner or an experienced Linux user, understanding Bash operations is essential for efficient work on the command line.</p><p>This guide covers essential Bash operations, from basic commands to advanced scripting and system monitoring.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/784/1*XenZ3k5S5SvP6EF8uPAZLQ.png" /><figcaption>Bash</figcaption></figure><h3>1. Basic Bash Commands</h3><p>Bash is all about efficiency, and using the right commands can significantly speed up your workflow. Below are some fundamental commands every Bash user should know:</p><ul><li><strong>echo</strong>: Prints arguments or messages.</li></ul><pre>echo &quot;Hello, World!&quot;          # Outputs &quot;Hello, World!&quot; to the terminal.</pre><ul><li><strong>pwd</strong>: Prints the current working directory.</li></ul><pre>pwd                       #Displays the full path of the current directory.</pre><ul><li><strong>cd</strong>: Changes the directory.</li></ul><pre>cd /home/user                      #Navigates to the /home/user directory.</pre><ul><li><strong>ls</strong>: Lists files and directories in the current directory.</li></ul><pre>ls -l                   #Displays a detailed list of files and directories.</pre><ul><li><strong>cat</strong>: Concatenates and displays file content.</li></ul><pre>cat file.txt              #Outputs the content of file.txt to the terminal.</pre><ul><li><strong>man</strong>: Displays manual pages for commands.</li></ul><pre>man ls                              #Shows the manual for the `ls` command.</pre><p>These commands lay the foundation for interacting with your system in a Bash environment.</p><h3>2. File Operations</h3><p>Managing files is an essential task in Bash. Below are some commands that help you manipulate files:</p><ul><li><strong>touch</strong>: Creates an empty file.</li></ul><pre>touch newfile.txt             #Creates a new, empty file named newfile.txt.</pre><ul><li><strong>cp</strong>: Copies files or directories.</li></ul><pre>cp source.txt dest.txt                      #Copies source.txt to dest.txt.</pre><ul><li><strong>mv</strong>: Moves or renames files.</li></ul><pre>mv oldname.txt newname.txt             #Renames oldname.txt to newname.txt.</pre><ul><li><strong>rm</strong>: Removes files or directories.</li></ul><pre>rm file.txt                           #Deletes file.txt from the directory.</pre><ul><li><strong>find</strong>: Searches for files in a directory hierarchy.</li></ul><pre>find /home -name &quot;*.txt&quot;    #Finds all .txt files under /home.chmod: Changes file permissions.</pre><ul><li><strong>chmod</strong>: Changes file permissions.</li></ul><pre>chmod 755 script.sh  #Sets read, write, execute permissions for the owner; read, execute for others.</pre><p>These commands provide you with the flexibility to manage your files efficiently.</p><h3>3. Process Management</h3><p>Bash also allows you to monitor and manage system processes:</p><ul><li><strong>ps</strong>: Displays current processes.</li></ul><pre>ps aux        #Lists all running processes along with detailed information.</pre><ul><li><strong>top</strong>: Shows real-time process activity.</li></ul><pre>top          #Displays live updates of system processes and resource usage.</pre><ul><li><strong>kill</strong>: Sends signals to terminate processes.</li></ul><pre>kill 1234                            #Terminates the process with PID 1234.</pre><ul><li><strong>bg</strong>: Puts a process in the background.</li></ul><pre>bg %1                                  #Resumes job 1 in the background.</pre><ul><li><strong>fg</strong>: Brings a process to the foreground.</li></ul><pre>fg %1                                   #Brings job 1 to the foreground.</pre><p>Managing processes effectively ensures optimal system performance.</p><h3>4. Networking Commands</h3><p>Networking is a critical component of Linux systems. Here are some commands to get started:</p><ul><li><strong>ping</strong>: Sends ICMP packets to test connectivity.</li></ul><pre>ping google.com   #Sends packets to google.com to test network connectivity.ifconfig: Displays or modifies network interfaces.</pre><ul><li><strong>ifconfig</strong>: Displays or modifies network interfaces.</li></ul><pre>ifconfig eth0       #Shows the configuration of the eth0 network interface.</pre><ul><li><strong>ssh</strong>: Connects to a remote server.</li></ul><pre>ssh user@hostname                 #Opens an SSH session to the remote host.</pre><ul><li><strong>scp</strong>: Securely copies files between hosts.</li></ul><pre>scp file.txt user@remote:/path      #Transfers file.txt to the remote host.</pre><p>These commands simplify managing networks from the command line.</p><h3>5. Bash Pipelines &amp; Redirection</h3><p>Bash excels in combining commands and redirecting output:</p><ul><li><strong>Pipe (</strong><strong>|)</strong>: Sends the output of one command as input to another.</li></ul><pre>ls | grep &quot;.txt&quot;         #Filters the output of ls to show only .txt files.</pre><ul><li><strong>Redirect (</strong><strong>&gt; and </strong><strong>&gt;&gt;)</strong>: Redirects output to a file (overwrite or append).</li></ul><pre>echo &quot;Hello&quot; &gt; file.txt    #Writes &quot;Hello&quot; to file.txt, overwriting its content.  <br>echo &quot;World&quot; &gt;&gt; file.txt   #Appends &quot;World&quot; to file.txt.</pre><ul><li><strong>Error Redirection (</strong><strong>2&gt; and </strong><strong>2&gt;&amp;1)</strong>: Handles error output.</li></ul><pre>ls non_existing_file 2&gt; error.log        #Logs error messages to error.log.</pre><p>These tools are invaluable for creating efficient workflows.</p><h3>6. Text Processing</h3><p>Linux offers powerful tools for processing text:</p><ul><li><strong>sort</strong>: Sorts lines in text files.</li></ul><pre>sort file.txt                      #Sorts lines in file.txt alphabetically.</pre><ul><li><strong>cut</strong>: Removes sections from lines.</li></ul><pre>cut -d&#39; &#39; -f1 file.txt   #Extracts the first field from each line using a space as the delimiter.</pre><ul><li><strong>awk</strong>: Processes and extracts data from files.</li></ul><pre>awk &#39;{print $1}&#39; file.txt   #Prints the first column of each line in file.txt.</pre><ul><li><strong>sed</strong>: Edits and transforms text streams.</li></ul><pre>sed &#39;s/old/new/&#39; file.txt #Replaces the first occurrence of &quot;old&quot; with &quot;new&quot; in each line of file.txt.</pre><ul><li><strong>wc</strong>: Counts lines, words, and characters.</li></ul><pre>wc -l file.txt                     #Counts the number of lines in file.txt.</pre><h3>7. Scripting Basics</h3><p>Scripting is where Bash truly shines. Below are the fundamentals:</p><ul><li><strong>Variables</strong>: Store data for processing.</li></ul><pre>myvar=&quot;Hello&quot;            #Assigns the string &quot;Hello&quot; to the variable myvar.</pre><ul><li><strong>Conditions</strong>: Perform checks and act based on results.</li></ul><pre>if [-f file.txt]; then echo &quot;File exists&quot;;fi   #Checks if file.txt exists and prints a message if it does.</pre><ul><li><strong>Loops</strong>: Automate repetitive tasks.</li></ul><pre>for i in {1..5}; do echo $i; done  #Loops from 1 to 5 and prints each number.</pre><ul><li><strong>Functions</strong>: Modularize code for reuse.</li></ul><pre>function myfunc { echo &quot;Hello, Function!&quot;; }   #Defines a reusable function.</pre><p>Mastering scripting can automate mundane tasks and improve productivity.</p><h3>8. System Monitoring &amp; Information</h3><p>Keep your system healthy with these commands:</p><ul><li><strong>df</strong>: Reports filesystem disk space usage.</li></ul><pre>df -h                   #Shows disk space usage in a human-readable format.</pre><ul><li><strong>du</strong>: Shows directory space usage.</li></ul><pre>du -sh /var/log      #Displays the total size of the /var/log directory in a human-readable format.</pre><ul><li><strong>free</strong>: Displays memory usage.</li></ul><pre>free -m                              #Shows memory usage in megabytes.</pre><ul><li><strong>uptime</strong>: Shows system uptime.</li></ul><pre>uptime   #Outputs how long the system has been running and the load average.</pre><ul><li><strong>w</strong>: Displays logged-in users and their activities.</li></ul><pre>w</pre><p>Use these commands to keep tabs on your system.</p><h3>9. Package Management</h3><p>Package management is a key aspect of maintaining software on Linux systems. Here’s how you can handle it:</p><ul><li><strong>apt (for Debian-based systems)</strong>: Installs, updates, and manages software packages.</li></ul><pre>sudo apt update                      #Updates the package index.   <br>sudo apt install vim                 #Installs the vim text editor. <br>sudo apt remove vim                  #Removes the vim text editor.</pre><ul><li><strong>yum (for RHEL-based systems)</strong>: Manages packages on Red Hat and CentOS systems.</li></ul><pre>sudo yum update                        #Updates all installed packages.<br>sudo yum install httpd                 #Installs the Apache HTTP server.  <br>sudo yum remove httpd                  #Removes the Apache HTTP server.</pre><ul><li><strong>pacman (for Arch-based systems)</strong>: Manages packages on Arch Linux.</li></ul><pre>sudo pacman -Syu                       #Updates the system and packages.   <br>sudo pacman -S firefox                 #Installs the Firefox browser.   <br>sudo pacman -R firefox                 #Removes the Firefox browser.</pre><ul><li><strong>dnf (modern replacement for </strong><strong>yum)</strong>: Used in newer RHEL-based distributions.</li></ul><pre>sudo dnf update                         #Updates all installed packages.   <br>sudo dnf install nginx                  #Installs the Nginx web server.  <br>sudo dnf remove nginx                   #Removes the Nginx web server.</pre><h3>10. Archiving &amp; Compression</h3><p>Manage archives and save space with these tools:</p><ul><li><strong>tar</strong>: Archives files.</li></ul><pre>tar -czvf archive.tar.gz /path  <br># -c: Create an archive.  <br># -z: Compress the archive using gzip.  <br># -v: Verbose mode, shows progress.  <br># -f: Specifies the filename of the archive.  <br># This command archives and compresses the contents of the `/path` directory into `archive.tar.gz`.gzip: Compresses files.</pre><ul><li><strong>gzip</strong>: Compresses individual files.</li></ul><pre>gzip file.txt  <br># Compresses the file `file.txt` into `file.txt.gz` to save space.</pre><ul><li><strong>unzip</strong>: Extracts ZIP archives.</li></ul><pre>unzip archive.zip  <br># Extracts all the contents of `archive.zip` into the current directory.</pre><p>These utilities streamline data management, making it easier to compress, archive, and extract files.</p><h3>Conclusion</h3><p>Bash offers a powerful interface for managing Linux systems. By mastering these commands, you can streamline your workflow, automate tasks, and effectively manage your environment. Whether you’re just starting or looking to refine your skills, Bash is an invaluable tool in the Linux ecosystem.</p><p>#linux #opensource #bash #scripting</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f62e7259aa2d" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>