<?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 Nithish Kumar on Medium]]></title>
        <description><![CDATA[Stories by Nithish Kumar on Medium]]></description>
        <link>https://medium.com/@kumarnithish1999?source=rss-cb2f85d2922e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Stories by Nithish Kumar on Medium</title>
            <link>https://medium.com/@kumarnithish1999?source=rss-cb2f85d2922e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 25 Nov 2026 02:49:43 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@kumarnithish1999/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[Run a Machine Learning Model in Docker Container]]></title>
            <link>https://kumarnithish1999.medium.com/run-a-machine-learning-model-in-docker-container-7ca021802edb?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/7ca021802edb</guid>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[containers]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Sun, 16 Jul 2023 12:42:10 GMT</pubDate>
            <atom:updated>2023-07-16T12:42:10.063Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/802/1*u5GKgby1-a-Di4oGjaYqzw.png" /></figure><p>Running machine learning models in Docker containers offers numerous advantages, making it a popular choice in the industry. Docker provides a lightweight, portable, and isolated environment for deploying machine learning models, enabling seamless integration with various data pipelines and real-time applications. Here I’m building every thing from scratch.</p><p>First we need to install Docker in Base OS (In my case, it is RHEL 9). For Installing Docker, we have to add repo of Docker. To add repo, install yum-utils.</p><pre>sudo yum install yum-utils</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*omSr0rOjj5ta0Rvgv5fIzw.png" /></figure><pre># Adding repo of Docker.<br><br>sudo yum-config-manager — add-repo https://download.docker.com/linux/centos/docke<br>r-ce.repo</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*k7JEu4wzOEV0n8CVHtAogA.png" /></figure><p>Now Install docker using below cmd:</p><pre>yum install docker -y</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/724/1*c1B-YpK6HSSll7YREgnR2Q.png" /></figure><p>Start the services using systemctl command</p><pre>systemctl start docker<br><br># check it is working or not<br>systemctl status docker</pre><p>Run a container so that we will test our salary model (I’ve downloaded it from internet). Here I’m using centos 7 version.</p><pre>docker run -it — name salary_model centos:7</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*mvD3PnCRqTIu5gDGU5ygAQ.png" /></figure><p>Install python and required python libraries for machine learning model.</p><pre>yum install python3<br><br>pip3 install joblib<br><br>pip3 install sklearn </pre><p>Now I’m copying the downloaded model to docker container using docker cp command.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/760/1*2FrIOdgOKxXagMszij46lw.png" /></figure><p>To predict the salary model, I’ve written some python code which will take input as experience and give output as expected salary based on experience.</p><pre># py-salary.py<br><br>import os<br>import joblib<br>mind=joblib.load(‘salary.pk1’)<br>os.system(“clear”)<br>print(“Welcome”)<br>mind=joblib.load(‘salary.pk1’)<br>i=float(input(“Enter Years of Experience: “))<br>print(“Predicted salary of the employee is “,mind.predict([[i]]))</pre><p>Now execute the python file</p><pre>python3 py-salary.py</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*QkaFjEjc1g6m6_LYSIw2KQ.png" /></figure><p>Note: both python file and salary machine learning model should be in one folder.</p><p><em>…Signing Off…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7ca021802edb" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploring QR Code Generation from Command Line with qrenco.de and curl]]></title>
            <link>https://kumarnithish1999.medium.com/exploring-qr-code-generation-from-command-line-with-qrenco-de-and-curl-a3845f2edcae?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/a3845f2edcae</guid>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[qrcodegenerator]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Sun, 16 Jul 2023 07:28:21 GMT</pubDate>
            <atom:updated>2023-07-16T07:28:21.726Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DNX8YsJ59dWeB80e3X6fkA.png" /></figure><p><strong>Introduction:</strong> In today’s digital age, QR codes have become incredibly popular for quickly sharing information and accessing content using smartphones. In this blog post, we will delve into the process of generating QR codes from the command line, utilizing the qrenco.de service and cURL. Specifically, we’ll focus on creating a QR code for the widely-used social media platform, Facebook.</p><p><strong>Understanding qrenco.de:</strong> qrenco.de is a user-friendly web service that simplifies QR code generation via the command line with the help of cURL. It eliminates the need for complex APIs or third-party libraries, making the QR code creation process seamless.</p><p><strong>Generating a QR Code for Google:</strong> Let’s generate a QR code for Facebook using qrenco.de. Open your command-line interface and execute the following cURL command:</p><pre>curl qrenco.de/www.google.com</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/493/1*fZep4ulb8HqDX8ouQ4fPZw.png" /></figure><p><strong>Verifying the QR Code:</strong> After running the cURL command, navigate to your current working directory to find the “qr_code.png” file. Open the file using an image viewer or scan it with a QR code reader app on your smartphone. You should be directed to the Facebook website upon scanning the QR code.</p><p><strong>Conclusion:</strong> QR codes offer a convenient way to share and access information effortlessly. Generating QR codes from the command line with qrenco.de and cURL simplifies this process even further. In this blog post, we covered how to install cURL, generate a QR code for Facebook using qrenco.de, and verify the generated QR code.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a3845f2edcae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Efficient User Management: Implementing Auto Logout for Inactive Sessions in a Shared Linux Server]]></title>
            <link>https://kumarnithish1999.medium.com/efficient-user-management-implementing-auto-logout-for-inactive-sessions-in-a-shared-linux-server-f9ecb77d7dc7?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/f9ecb77d7dc7</guid>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Sun, 16 Jul 2023 06:56:48 GMT</pubDate>
            <atom:updated>2023-07-16T06:56:48.092Z</atom:updated>
            <content:encoded><![CDATA[<p>In shared server environments, managing user sessions can be challenging due to security concerns and the risk of misuse. Manually monitoring active sessions on each system is impractical and time-consuming. However, there’s a straightforward solution: implementing an auto logout feature for inactive user sessions. In this tutorial, we’ll learn how to automatically log out users from local or SSH sessions after a specified period of inactivity on Unix-like systems. Let’s proceed to simplify and improve your user management process.</p><h3>Method 1: Auto Logout using ~/.bashrc or ~/.bash_profile</h3><ol><li>Open the ~/.bashrc or ~/.bash_profile file:</li></ol><pre>vi ~/.bash_profile<br><br>or <br><br>vi ~/.bashrc</pre><p>2. Add the following line to set the auto-logout timeout in seconds (e.g., 100 seconds):</p><ul><li>TMOUT=100</li></ul><p>3. Replace “100” with the desired number of seconds before automatic logout.</p><p>4. Save the changes by pressing Ctrl + O and then press Enter. To exit the text editor, press Ctrl + X.</p><p>5. If you made changes to /etc/profile, the changes will apply system-wide. However, if you edited ~/.bashrc, the changes will only affect the current user. In that case, you may need to log out and log back in for the changes to take effect.</p><p>6. Apply the changes by running the following command:</p><pre>source ~/.bashrc<br><br>or <br><br>source ~/.bash_profile</pre><p>7. Now, when a user remains inactive for the specified period of time, they will be automatically logged out. To modify or delete this timeout setting, simply delete the added line from the ~/.bashrc or ~/.bash_profile file.</p><h3>Method 2: Auto Logout using SSH server configuration</h3><ol><li>Edit the SSH config file:</li></ol><pre>sudo nano /etc/ssh/sshd_config</pre><p>2. Locate the following options related to SSH inactivity:</p><pre>ClientAliveInterval <br>ClientAliveCountMax</pre><ul><li>ClientAliveInterval: Sets a timeout interval in seconds after which if no data has been received from the client, sshd will send a message through the encrypted channel to request a response from the client. The default is 0, indicating that these messages will not be sent to the client. This option applies to protocol version 2 only.</li><li>ClientAliveCountMax: Sets the number of client alive messages which may be sent without sshd receiving any messages back from the client. If this threshold is reached while client alive messages are being sent, sshd will disconnect the client, terminating the session. The default value is 3.</li></ul><p>3. To configure an auto-logout interval of, for example, 10 minutes, set the values as follows:</p><pre>ClientAliveInterval 600     # 10 minutes (10m x 60s) ClientAliveCountMax 0       # Disable client alive messages, terminate the session directly after the interval</pre><p>4. Restart the SSH service after setting the values:</p><pre>sudo service sshd restart</pre><p>Now, inactive user sessions will be automatically logged out after the specified period of inactivity, improving security and managing shared server resources efficiently. Choose the method that suits your requirements best, and feel free to adjust the timeout value to meet your needs.</p><p><em>….Signing Off….</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f9ecb77d7dc7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Secure SSH Configuration in a Docker CentOS Container]]></title>
            <link>https://kumarnithish1999.medium.com/secure-ssh-configuration-in-a-docker-centos-container-e2415750208d?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2415750208d</guid>
            <category><![CDATA[sshd]]></category>
            <category><![CDATA[remote-login]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[ssh]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Wed, 05 Jul 2023 07:37:33 GMT</pubDate>
            <atom:updated>2023-07-05T07:37:33.262Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*TY85oVaBOzmmmoirtnASKw.png" /></figure><p><strong>Introduction:</strong></p><p>In this blog post, we will explore how to configure SSH inside a CentOS-based Docker container and establish secure communication between the container and the host system. By following these steps, you can securely log in to the host system from inside the container and vice versa, allowing for seamless interaction between the two environments.</p><p><strong>Step 1: </strong>Install Docker in your local machine. Now run one container using centos:7 image</p><pre>yum install docker &amp;&amp; systemctl start docker</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/460/1*_gfEl15qGgX_wD6HWftYNw.png" /></figure><p><strong>Step 2:</strong> Now install both ssh server and ssh client in the same docker container. Use below commands.</p><pre>yum install openssh-server <br>yum install openssh-clients</pre><p>Configure ssh. open /etc/ssh/sshd_config and remove # to the below line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*9HPNl3Vm9VgndcYqh_KP2w.png" /></figure><p>Before starting ssh service, you have to generate some required keys by server using below command</p><pre>ssh-keygen -A</pre><p><strong>Step 3: </strong>Start the ssh services</p><pre>/usr/sbin/sshd</pre><p>Now try ssh to ur host machine. In my case it is redhat system</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/1*4krpbr3VkStL235Xvdlaew.png" /></figure><p>Its working fine. Let’s try ssh from host system to docker OS. For this, first you have to know the docker IP. Here is the command</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/472/1*bLATSgZ7iwcgIOVq-SIoAA.png" /></figure><p>Now I’m going to do ssh to 172.17.0.2 Docker IP. Will it work ?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/1*3aeS6jWtD5vvQsXypxzRiw.png" /></figure><p>As you see, it says permission denied. Why because, we haven’t given password to the root account in docker OS. To give password use below command. Run the below cmd inside docker OS.</p><pre>echo ‘root:redhat’ | chpasswd</pre><p>Now try again to do ssh to docker OS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/603/1*pxLFUOTlKP7J12QUfBfRnA.png" /></figure><p><strong>Conclusion:</strong></p><p>By following the steps outlined in this blog post, you can configure SSH inside a Docker CentOS container and establish a secure connection between the container and the host system. This setup allows for seamless interaction and secure remote management of the containerized environment. With proper security configurations in place, you can confidently utilize SSH for various administrative tasks and development workflows within your Docker environment.</p><p><em>…Signing Off…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2415750208d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Harnessing the Power of AWS Services: Transcribing MP3 Files with Lambda and Transcribe]]></title>
            <link>https://kumarnithish1999.medium.com/harnessing-the-power-of-aws-services-transcribing-mp3-files-with-lambda-and-transcribe-ab31b875200e?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/ab31b875200e</guid>
            <category><![CDATA[aws-transcribe]]></category>
            <category><![CDATA[lambda]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[aws-s3]]></category>
            <category><![CDATA[automation]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 07:26:58 GMT</pubDate>
            <atom:updated>2023-07-04T07:26:58.473Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/551/1*ML2j-CJlpdZTLS9DoJj0XQ.png" /></figure><p><strong>Introduction:</strong></p><p>In this blog, we’ll explore how to leverage the power of various AWS services to transcribe MP3 files automatically. We’ll utilize Amazon S3, AWS Lambda, and Amazon Transcribe to create a seamless workflow for transcribing audio content. By the end of this guide, you’ll have a fully functional system that can transcribe your MP3 files with ease.</p><p><strong>Step 1: </strong>Create an S3 bucket to store your MP3 files and the transcribed output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4bvdM_Vey4wW1em4vjaVg.png" /></figure><p>Step 2: Create lambda function which has the code to send mp3 to transcribe job and then output will be stored in same bucket. And python code is here</p><pre>import json<br>import boto3<br>import uuid<br><br>myid = uuid.uuid1().int<br>transcribe = boto3.client(‘transcribe’)<br>def lambda_handler(event, context):<br> <br> obj = event[‘Records’][0][‘s3’][‘object’][‘key’]<br> bucket = event[‘Records’][0][‘s3’][‘bucket’][‘name’]<br> url = “s3://” + bucket + “/” + obj<br> <br> resp = transcribe.start_transcription_job(<br>   TranscriptionJobName=’job’+ ‘-’ + str(myid),<br>   LanguageCode=’en-US’,<br>   MediaFormat=’mp3&#39;,<br>   OutputBucketName=bucket,<br>   Media={<br>     ‘MediaFileUri’: url <br>   },<br>   OutputKey=’job-’ + str(myid) + ‘.json’<br>  )<br> <br> print(resp)</pre><p>we have to generate a unique job id every time for running transcribe job. In python, we have a module called uuid to generate a token/id.</p><p><strong>Step 3: </strong>Create event-notification and give permission/role to lambda to access transcribe service. Go to properties of bucket &gt; event notifications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*UqJRCNsSSzFcRclsgWWsbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*TkPe_RL2GzP99XHV4EJuAw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/706/1*wuzyhTkV_VXiM0YFtKeXDQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*W6qZ5kifliZVopxF2eaCXw.png" /></figure><p>Now go to your lambda function and give permission role to access transcribe service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*14QtuNQyxcFrHamIycwNpQ.png" /></figure><p><strong>Step 4: </strong>Now upload mp3 file to s3 bucket, in same bucket you will get output file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qsR3Dqfia_0Df6G10T8fwg.png" /></figure><p><strong>Conclusion:</strong> By combining the power of Amazon S3, AWS Lambda, and Amazon Transcribe, we’ve created an automated system for transcribing MP3 files. This solution can be easily scaled to handle large volumes of audio content, making it ideal for various applications such as transcription services, voice assistants, and content analysis.</p><p>Keep innovating and exploring new ways to leverage AWS services to solve real-world challenges!</p><p><em>…Signing Off…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ab31b875200e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Integrating S3 with Bulk Email Service AWS SES.]]></title>
            <link>https://kumarnithish1999.medium.com/integrating-s3-with-bulk-email-service-aws-ses-31f99ddb6cae?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/31f99ddb6cae</guid>
            <category><![CDATA[mail-services]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[lambda-function]]></category>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[s3-bucket]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 06:50:53 GMT</pubDate>
            <atom:updated>2023-07-04T06:50:53.565Z</atom:updated>
            <content:encoded><![CDATA[<h3>AWS Integrating S3 with Bulk Email Service AWS SES.</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*al-d1jeEsYyAgOEYwZqY9A.png" /></figure><p><strong>Introduction:</strong></p><p>In this tutorial, we will explore how to automate the process of sending emails using Amazon SES (Simple Email Service) and S3 (Simple Storage Service) integration. We’ll leverage the power of these AWS services to streamline email communication and enhance our email delivery capabilities.</p><p><strong>Step 1:</strong> Create S3 bucket and verify your email addresses in AWS SES which are in txt file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O4bvdM_Vey4wW1em4vjaVg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/303/1*XIX3nFPK1y6zOs9E5ZEllA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QFT8cwln9hihp0TnZ1Kksw.png" /></figure><p>Click on “create identity” &gt;&gt; give your mail address.</p><p><strong>Step 2: </strong>Create an AWS Lambda Function</p><p>Using the Boto3 library, we’ll write a Python script to automate the process of fetching the email content from S3, retrieving the recipient list, and sending the emails using Amazon SES. We’ll handle error handling, email personalization, and bulk sending efficiently. Here is the code:</p><pre>import boto3<br>import json<br><br>def lambda_handler(event, context):<br> # Retrieve email IDs from the S3 file<br> s3_bucket = event[‘Records’][0][‘s3’][‘bucket’][‘name’]<br> # Provide the path to your file in the S3 bucket<br> s3_key = event[‘Records’][0][‘s3’][‘object’][‘key’] <br><br> s3_client = boto3.client(‘s3’)<br> s3_object = s3_client.get_object(Bucket=s3_bucket, Key=s3_key)<br> email_ids = s3_object[‘Body’].read().decode(‘utf-8’).split(‘\n’)<br><br> # Send email for each email ID<br> ses_client = boto3.client(‘ses’)<br> for email_id in email_ids:<br>   email_id = email_id.strip() # Remove leading/trailing whitespace<br> <br>   # Perform email sending operations using SES client<br>   response = ses_client.send_email(<br>   Source=’&lt;FromAddress&gt;’,<br>   Destination={‘ToAddresses’: [email_id]},<br>   Message={<br>     ‘Subject’: {‘Data’: ‘Your Subject’},<br>     ‘Body’: {‘Text’: {‘Data’: ‘Your Email Body’}}<br>   }<br> )<br> <br> print(f”Email sent to {email_id}. Message ID: {response[‘MessageId’]}”)</pre><p>Now create event-notification in S3 bucket</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1004/1*UqJRCNsSSzFcRclsgWWsbQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/840/1*stRGmB4mCMSjzvNqO_eVXQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*8mtGZDx2UH7s27XE9fmqlQ.png" /></figure><p><strong>Step 3: </strong>Now give permissions to lambda to contact to SES service without any interruption. Click on configuration tab in lambda function. Give full access to SES service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/841/1*Dx1GJ719KyZNeYRVmgMU6g.png" /></figure><p><strong>Step 4:</strong> Now upload txt file which has email data to S3 bucket. SES service will send emails automatically.</p><p>Automating the process of sending emails using Amazon SES and S3 integration can significantly enhance your email delivery capabilities, save time, and streamline your communication workflows. By leveraging the power of AWS services and Python scripting, you can achieve efficient, personalized, and scalable email sending.</p><p><em>…Signing Off…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=31f99ddb6cae" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding the Speed of Docker:]]></title>
            <link>https://kumarnithish1999.medium.com/understanding-the-speed-of-docker-c972aa34267e?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/c972aa34267e</guid>
            <category><![CDATA[docker]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Tue, 04 Jul 2023 04:25:37 GMT</pubDate>
            <atom:updated>2023-07-04T04:25:37.585Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*a1MOaS4V7Kp0VIaw5sYbDw.png" /></figure><p>Let’s explore the Logic Behind Its Performance.</p><p><strong>Docker</strong>, an open-source containerization platform, has gained immense popularity for its exceptional speed and performance. In this blog post, we will delve into the factors that contribute to Docker’s speed and understand the underlying logic behind its impressive performance. By the end, you will have a deeper understanding of why Docker is renowned for its incredible speed.</p><p><strong>&gt;&gt; Lightweight Containers:</strong> One key aspect that sets Docker apart is its lightweight containerization. Docker containers leverage the host system’s kernel, which eliminates the need for running a separate guest operating system. This approach drastically reduces resource overhead and enables faster startup times and more efficient resource utilization.</p><p><strong>&gt;&gt; Shared Resources and Efficient Resource Management: </strong>Docker employs a layered file system and utilizes shared resources whenever possible. Docker images are built using layers, and if multiple containers use the same base image, those layers are shared. This results in faster image downloads, reduced storage requirements, and improved container startup times.</p><p>Additionally, Docker provides efficient resource management through container isolation and resource allocation controls. It allows fine-grained control over CPU, memory, and I/O resources, ensuring optimal performance and preventing resource contention among containers.</p><p>🔶Containerization and Process Isolation: Docker’s containerization approach isolates processes within containers, preventing conflicts between different applications or services running on the same host. Each container has its own file system, network interfaces, and process space, enabling applications to run independently without interfering with one another. This isolation improves security, stability, and performance by avoiding interference and resource contention.</p><p>🔶Image Caching and Reusability: Docker utilizes image caching, which significantly speeds up the process of creating and deploying containers. Once an image is built or pulled from a registry, subsequent builds or deployments can reuse the existing layers, reducing the time required to download, extract, and configure dependencies. This caching mechanism improves iterative development, CI/CD pipelines, and scalability.</p><p>🔶Efficient Networking: Docker provides networking capabilities that allow containers to communicate with each other and with external networks. Docker’s network drivers and virtual network interfaces enable efficient networking between containers, reducing latency and overhead associated with traditional virtualization approaches. Additionally, Docker leverages container networking techniques such as bridge networks, overlay networks, and DNS-based service discovery to facilitate seamless and performant communication.</p><p><strong>Conclusion: </strong><br>Docker’s incredible speed and performance can be attributed to its lightweight containers, shared resources, efficient resource management, process isolation, image caching, and optimized networking.</p><p>These factors, combined with its ecosystem of tools and practices, have made Docker the go-to choice for containerization in various industries. By understanding the underlying logic behind Docker’s speed, developers and DevOps professionals can leverage its capabilities to build, deploy, and scale applications efficiently.</p><p><em>…Signing Off…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c972aa34267e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting Started with Amazon ECS: Launching Containers with Ease]]></title>
            <link>https://kumarnithish1999.medium.com/getting-started-with-amazon-ecs-launching-containers-with-ease-9edbe62667c?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/9edbe62667c</guid>
            <category><![CDATA[serverless-architecture]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[containers]]></category>
            <category><![CDATA[aws-ecs]]></category>
            <category><![CDATA[aws]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Sun, 02 Jul 2023 10:35:22 GMT</pubDate>
            <atom:updated>2023-07-02T10:35:22.631Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/280/1*R7o62OM6JN0MqCNpSb9PPg.png" /></figure><p><strong>Introduction:<br></strong>Amazon Elastic Container Service (ECS) is a fully managed container orchestration service that simplifies the deployment and management of containers on AWS. It allows you to easily run and scale containerized applications without the need to manage the underlying infrastructure. In this tutorial, we will walk through the necessary steps to set up an ECS service and launch a container using specific images. Let’s dive in! 🚀</p><p><strong>Step 1: Set up the ECS Cluster</strong></p><p>Create an ECS cluster using the AWS Management Console.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yW8JJTQXyjY0SUYcpHXAbg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/957/1*yX9r09pJYA7XNCSEyFHfuw.png" /></figure><p>Configure the cluster settings, such as instance type, desired capacity, and networking options. For now I’m not configuring any other settings. Click on ‘create’ .</p><p><strong>Step 2: Create Task Definitions</strong></p><p>Define the task requirements and specifications in a Task Definition. Specify container images, resource allocation, environment variables, and container networking settings.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EY5N26rih7ykpUcF_A3rxg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7QYTBrWzkCFf4OKCyxMNMQ.png" /></figure><p>For testing, I’m using apache-webserver-php image from Vimal sir docker hub. After that in memory limit and cpu settings, we have to create one role so that we won’t get any permissions related error.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/859/1*M0R7X0QeBKFR2d1daSpWwA.png" /></figure><p>Now click on ‘create task definition’.</p><p><strong>Step 3: Create a container.</strong></p><p>After creating task definition click on ‘Run Task’ as shown below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ict27ATQ-Y1InSp_3sCPcQ.png" /></figure><p>In Run task tab, select cluster name which you have created before. And then Click on ‘create’</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/867/1*X8rYiu_eQLNgflhzYpdKgg.png" /></figure><p>Now check whether your container is launched or not in Task Definition tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AQJb8qOP5E5o_ND7Ehv5Ww.png" /></figure><p>Finally, we have to click on public IP Address for checking docker is working or not. I’ve taken the docker image which is configured in such a way that it will show it’s IP Address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YtEMOE6MxpG6XjbrhoYY-w.png" /></figure><p>Note: Container will show it’s private address not public address (13.235.65.25)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zpYB1Z7wZfv9ZBanvK3KCg.png" /></figure><p>📄Amazon ECS provides a robust platform for managing and deploying containerized applications. By following the steps outlined in this tutorial, you can easily set up an ECS cluster, define task requirements, configure services, and launch containers with specific images. Whether you’re running microservices, batch jobs, or long-running applications, ECS simplifies the container management process and allows you to focus on your application’s core functionality.</p><p>✨That’s all for now. I will create another blog for customizing ECS with our own requirements in future. Watch out for more and give a like.</p><p><em>…Signing Off…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9edbe62667c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating EC2 Instance, Volume, and Attachments with CLI and API]]></title>
            <link>https://kumarnithish1999.medium.com/creating-ec2-instance-volume-and-attachments-with-cli-and-api-8dcf05cce1ac?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dcf05cce1ac</guid>
            <category><![CDATA[boto3-python]]></category>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[cli]]></category>
            <category><![CDATA[ebs-volume]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Sat, 01 Jul 2023 06:57:29 GMT</pubDate>
            <atom:updated>2023-07-01T07:01:26.820Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/308/1*VdU-2MpFsm0MCR_o6_-neQ.png" /></figure><p>📄In this blog, I’m going to explain how we can launch EC2 Instance without going to AWS portal, and attach a newly created volume to that instance. And another service which is SNS, will create a topic and subscribe to my mail for demonstration purpose.</p><p><strong>👨‍💻prerequisites: <br></strong>1. AWS Configure<br>2. Boto3 Library</p><p><strong>🔶Launching EC2 Instance and creating volume and attaching it to ec2 instance.</strong></p><pre>aws ec2 run-instances --image-id &lt;image Id&gt; --count 1 --instance-type &lt;instance_type&gt;</pre><p>The above command will create a new instance in configured region. Now create a volume.</p><pre>aws ec2 create-volume --size 5 --availability-zone ap-south-1b</pre><p><strong>Note:</strong> You have to give same availability zone to volume where your ec2 instance is launched.</p><p>Final thing is to attaching volume to ec2 instance.</p><pre>aws ec2 attach-volume --volume-id &lt;Volume Id &gt; --instance-id &lt;instance Id&gt; --device /dev/sdf</pre><p>Done with CLI commands. Now Let’s jump to Boto3 library in python.</p><p>Python code:</p><pre>import boto3<br>ec2_res = boto3.resource(“ec2”)<br>ec2_client = boto3.client(‘ec2’)<br>response = ec2_res.create_instances( <br> ImageId = “&lt;image_id&gt;”,<br> InstanceType=’&lt;instance-type&gt;’,<br> MaxCount = 1,<br> MinCount = 1<br>)<br><br>vol = ec2_res.create_volume(<br> AvailabilityZone=’&lt;zone&gt;’,<br> Size = 5,<br>)<br><br>vol_client = boto3.client(‘ebs’)<br>vol_client.attach_to_instance(<br> Device=’/dev/sdk’,<br> InstanceId=’&lt;instance_id&gt;&#39;,<br>)</pre><p>For creating, we have to use resource module. while accessing the services we can use both resource module and client module. But we don’t have some required attributes in resource module. So it’s a good practice to use client module.</p><p><strong>🔶Creating a SNS topic and subscribe to email for event notifications:</strong></p><pre>aws sns create-topic --name &lt;topic-name&gt;</pre><p>Topic is a logical access point that acts as a communication channel.</p><pre>aws sns subscribe --topic-arn &lt;topic-arn&gt;:&lt;topic-name&gt; --protocol &lt;protocol&gt; --notification-endpoint &lt;email&gt;</pre><p>Now you will get a mail for subscription confirmation from AWS. Once your subscription confirmed, then you can publish your message.</p><pre>aws sns publish --topic-arn &lt;topic-arn&gt;:&lt;name&gt; --message &quot;&lt;message&gt;&quot;</pre><p>That’s all. See you in the next blog.</p><p><em>…Signing Off…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dcf05cce1ac" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AWS Case Study of Coursera]]></title>
            <link>https://kumarnithish1999.medium.com/aws-case-study-of-coursera-d4296e3c80d5?source=rss-cb2f85d2922e------2</link>
            <guid isPermaLink="false">https://medium.com/p/d4296e3c80d5</guid>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[coursera]]></category>
            <category><![CDATA[case-study]]></category>
            <category><![CDATA[aws-codebuild]]></category>
            <dc:creator><![CDATA[Nithish Kumar]]></dc:creator>
            <pubDate>Thu, 29 Jun 2023 14:34:52 GMT</pubDate>
            <atom:updated>2023-06-29T14:34:52.468Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/326/1*HGJQ5_o354L1xR837lqFiw.png" /><figcaption>Coursera</figcaption></figure><p><strong>About Coursera:</strong></p><p>✨Coursera is the world’s largest provider of massive open online classes (MOOC). It has more than 150 university partners from 29 countries and more than 25 million registered students. To Host its website and support, Coursera relies heavily on Amazon Web Services (AWS).</p><p><strong>💁Which Services Coursera using for hosting their website ??</strong></p><p>&gt;&gt; Coursera website is a single page application written in JavaScript and it is hosted on Amazon Simple Service Storage (AWS S3) and served using CloudFront. Previously they used EC2 instances for launching Jenkins Servers to build their applications and at present they are using AWS Code Build.</p><p>&gt;&gt; Docker Containers on AWS ECS enabled Coursera to easily move to micro services based architecture. And they use AWS ECR to upload customized docker image with all dependencies installed, so that they can test the application seamlessly and fast. CloudFront is used to provide globally distributed network of proxy servers to cache content. So that consumers can access the content (web videos) fast.</p><p>🤔Let’s discuss challenges faced by <strong>Coursera</strong></p><p>&gt;&gt; Coursera is Challenged by limited Build Capacity. To build and deploy its application, Coursera used 8 Jenkins machines running on AWS EC2 service. Whenever a change was committed to GitHub, it would trigger Jenkins to build Javascript code and upload/host it on AWS S3.</p><p>&gt;&gt; This process worked for a while. But day to day their application code grew (by adding new features), build time starts taking long time. Previously, application were deployed as a single Monolithic Build. A problem with one application would stop deployment of entire application. To improve build, it broke up its monolithic application into 50 individual applications containing different parts of website. Now they can build and deploy separately.</p><p>&gt;&gt; So, if anytime they need to build entire application, they need to start 50 different Jenkins jobs to build all individual applications. However they don’t have sufficient capacity to run 50 jobs at once. So jobs queue up and take long time to build entire application.</p><blockquote>“We were looking for a solution that would allow us to run jobs in parallel. So we wouldn’t need to wait for a job to finish to run the next one.” says Kane (one of the senior Engineer in Coursera.)</blockquote><p><strong>Solution is</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/1*a8g6ZIV4Kr6VhJJ0P3a2Pg.png" /><figcaption>Code Build</figcaption></figure><p><strong>What is Code Build and How they using it …</strong></p><p>&gt;&gt; <strong>Code Build:</strong> It is a fully managed continuous integration service that compiles source code, run tests and produces ready-to-deploy software packages. Now company started using AWS Code Build for compiling source code which is JavaScript and run tests and produced software packages. And these Software packages deploy on production environment using AWS ECS.</p><p>&gt;&gt; Along with all these things, coursera started using a custom build environment. Like instead standard Node.js containers for its build, it uses AWS code build to create a sperate Docker Image which includes all required Javascript dependencies as cache. Now that image is pushed to AWS ECR (Elastic Container Registry) and take it refernce for further builds.</p><p>&gt;&gt; Now to build a application, all they need to do is to retrieve docker image from AWS container registry, run the scripts which is committed on GitHub, and upload/host it to Amazon S3.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/746/1*taPFWA8U3qiYAWL_VAHbkA.png" /></figure><p><strong>Advantages using Code Build</strong></p><p>&gt;&gt; Increased Speed: With AWS Code Build, building an application now takes about 10 minutes.</p><blockquote>“ To get same performance on Jenkins would cost four times as much because we would need to spin up 50 Jenkins EC2 Instances to have builds finish that quickly” says Kane.</blockquote><p>&gt;&gt; Scalability: On Average, company runs 300–500 builds each day using AWS Code Build, and because the service scales continuously and processes multiple builds in parallel, builds are not left waiting in queue.</p><blockquote>“If we needed to run 70 builds all at once, we could do so.” says Kane.</blockquote><p>&gt;&gt; Cost Saving: Before using AWS Code Build, company using Jenkins which is running on EC2 instances to build its application. The Jenkins instances were spun up each morning and sat idle until there was a job. Here instances are keep on running for idle which will end up with a huge cost.</p><p>&gt;&gt; So in AWS Code Build, when new code came it starts build and cost is calculated for build time, so they end up with a small cost compared to running instances for whole day.</p><blockquote>“Next, we’re going to add some of our backend services to AWS Code build and see what that looks like” added Kane.</blockquote><p>That’s all guys, See U in next blog.</p><p><em>…Signing Off…</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d4296e3c80d5" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>