<?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 rishabhsharma on Medium]]></title>
        <description><![CDATA[Stories by rishabhsharma on Medium]]></description>
        <link>https://medium.com/@rishabh27sharma?source=rss-393ce2b26a32------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*gAQzBib3ifgFsB7DzFnTiA.jpeg</url>
            <title>Stories by rishabhsharma on Medium</title>
            <link>https://medium.com/@rishabh27sharma?source=rss-393ce2b26a32------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Wed, 18 Nov 2026 22:11:52 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@rishabh27sharma/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[Jenkins on AWS Cloud ☁]]></title>
            <link>https://rishabh27sharma.medium.com/jenkins-on-aws-cloud-bb99d624fe5e?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/bb99d624fe5e</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Tue, 09 May 2023 09:16:21 GMT</pubDate>
            <atom:updated>2023-05-09T09:16:21.851Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/796/1*sn0o3Ln8Uo-t7CnpBcy1qw.png" /></figure><p><em>Hello folks👋🏻,</em></p><p><em>In this article we will be looking at how to install and configure Jenkins over AWS Cloud on EC2 Instance.</em></p><p><em>Jenkins is an open-source automation server that integrates with a number of AWS Services, including: AWS CodeCommit, AWS CodeDeploy, Amazon EC2 Spot, and Amazon EC2 Fleet. Here we will see how we can install Jenkins on EC2 Instance.</em></p><h3><em>Prerequisites</em></h3><ol><li><em>An AWS Account</em></li><li><em>Putty to ssh into ec2 instance</em></li><li><em>And a big smile on your face</em>😊</li></ol><p><strong><em>Let’s get started!</em></strong></p><blockquote><strong>Creating a security group</strong></blockquote><p><em>EC2 &gt; Security Groups &gt; Create security group</em></p><p><em>Inbound Rules: Allow SSH, HTTP and Port 8080 (default) for Jenkins</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3WK_jaa13tAQ7D1DYgXDXQ.png" /></figure><h4><strong>Launching an EC2 Instance</strong></h4><p><em>EC2 &gt; Instances &gt; Launch an Instance</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*O8R-7Yfu4xyaIoioTrdtlg.png" /></figure><p><em>Here, we will be using </em><strong><em>Amazon Linux AMI</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4yXRcOQZq5f7NyIzFG5atQ.png" /></figure><p><em>Instance type as </em><strong><em>t2.micro</em></strong><em> (free-tier)</em></p><p><em>Create a new key pair -&gt; </em><strong><em>.pem</em></strong><em> file will get download</em></p><p><em>Use </em><strong><em>Puttygen</em></strong><em> to </em><strong><em>convert .pem to .ppk</em></strong><em> format which will be required to SSH into ec2 instance using Putty.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OqgVhppPnJ-M5kL4BBalZQ.png" /></figure><p><em>Select created security group(jenkins)</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WGSBDeUUzYZGTjx_qR9fHA.png" /></figure><p><em>Click on Launch instance</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BbhJVHL_tUJNEUENfaO0HA.png" /></figure><p><em>Our Instance is up &amp; running</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NZd_muQqDr7uXLYy5ae35Q.png" /></figure><p><em>Now that the Amazon EC2 instance has been launched, Jenkins can be installed &amp; configured properly.</em></p><h4><em>Steps to follow :</em></h4><p><strong><em>Connecting EC2 instance using Putty</em></strong></p><p><em>There is a default user named </em><strong><em>ec2-user</em></strong><em>. We will be using it to ssh into ec2 instance.</em></p><p><strong><em>Open Putty</em></strong></p><p><em>1 ) Hostname (or IP address) as </em><strong><em>ec2-user@Public-IP</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/595/1*2eI0qZfiKStHhGTY99nTig.png" /></figure><p><em>2 ) On left panel go to </em><strong><em>Connection &gt; SSH &gt; Auth</em></strong></p><p><em>3 ) At private key file for Authentication browse your </em><strong><em>.ppk file</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*ihumFWTpqB58FEw5Nbb3Rg.png" /></figure><p><em>4) Click Open then Accept</em></p><p><em>We will get connected to our ec2 instance</em></p><h4>Installing Jenkins</h4><p><em>Completing the previous steps enables you to download and install Jenkins on AWS.</em></p><p><em>To download and install Jenkins:</em></p><p><em>1 </em>) <em>Ensure that your software packages are up to date on your instance by using the following command to perform a quick software update:</em></p><pre>[ec2-user@ip ~]$ sudo yum update –y</pre><p><em>2 ) Add the Jenkins repo using the following command:</em></p><pre>[ec2-user@ip ~]$ sudo wget -O /etc/yum.repos.d/jenkins.repo \<br>    https://pkg.jenkins.io/redhat-stable/jenkins.repo</pre><p><em>3 ) Import a key file from Jenkins-CI to enable installation from the package:</em></p><pre>[ec2-user@ip ~]$ sudo rpm --import https://pkg.jenkins.io/redhat-stable/jenkins.io-2023.key</pre><p><em>4 ) Install Java (Amazon Linux 2023):</em></p><pre>[ec2-user@ip ~]$ sudo dnf install java-11-amazon-corretto -y</pre><p><em>5 ) Install Jenkins</em></p><pre>[ec2-user@ip ~]$ sudo yum install jenkins -y</pre><p><em>6 ) Enable the Jenkins service to start at boot:</em></p><pre>[ec2-user@ip ~]$ sudo systemctl enable jenkins</pre><p><em>7 ) Start Jenkins as a service</em></p><pre>[ec2-user@ip ~]$ sudo systemctl start jenkins</pre><p><em>You can check the status of the Jenkins service using the command:</em></p><pre>[ec2-user@ip ~]$ sudo systemctl status jenkins</pre><h4>Configuring Jenkins</h4><p><em>Jenkins is now installed and running on your EC2 instance. To configure Jenkins:</em></p><ol><li><em>Connect to </em><strong><em>http://&lt;your_server_public_ip&gt;:8080</em></strong><em> from your browser.</em></li></ol><p><em>You will be able to access Jenkins:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WXun-SKeBb3dkKD_W4CVaQ.png" /></figure><p><em>2. As prompted, enter the password found in </em><strong><em>/var/lib/jenkins/secrets/initialAdminPassword</em></strong></p><pre>[ec2-user@ip ~]$ sudo cat /var/lib/jenkins/secrets/initialAdminPassword</pre><p><em>Provide Password -&gt; Click Continue</em></p><p><em>3 . You will be prompted to </em><strong><em>Customize Jenkins Page.</em></strong><em> Click </em><strong><em>Install suggested plugins</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*S4NyF_FUH1O7vsF3dnJbLA.png" /></figure><p><em>4. Once the installation is complete, the </em><strong><em>Create First Admin User</em></strong><em> will open. Enter your information, and then select </em><strong><em>Save and Continue</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NgcFqR-A63aJ--TiaGS6FQ.png" /></figure><p><em>Instance Configuration -&gt; select </em><strong><em>Save and Finish</em></strong><em>.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PvdEKu1rLfrKj3yHCe3yZQ.png" /></figure><p><em>Jenkins is ready!</em></p><p><em>Jenkins setup is complete. click </em><strong><em>Start using Jenkins</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fQpUMsZ09HOvBSoLlOwnvw.png" /></figure><p><em>Here is how</em><strong><em> Jenkins Dashboard</em></strong><em> look like!</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*jSpI1NeY-rwUYivzs2UfYA.png" /></figure><h4><em>Let’s create a simple Job:</em></h4><p><em>1 ) Click </em><strong><em>Create a Job</em></strong></p><p><em>2 ) Enter an item name -&gt; select </em><strong><em>Freestyle project -&gt; </em></strong><em>click</em><strong><em> OK</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-QVYr_BEysX3ozfOLjvRqQ.png" /></figure><p><em>3 ) Configure</em></p><p><em>Go down to </em><strong><em>Build Steps</em></strong><em> -&gt; select </em><strong><em>Execute Shell</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XGB754ouapIrMksidImg3g.png" /></figure><p><em>4 ) click </em><strong><em>Save</em></strong></p><p><em>5 ) Now we can build this Job</em></p><p><em>6) Click on </em><strong><em>Build Now</em></strong><em> -&gt; After Job build successfully -&gt; Click on Job -&gt; select </em><strong><em>Console Output</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7jj3Ei_5PEEsT2sjRzhU5g.png" /></figure><p><strong><em>We have successfully setup Jenkins over AWS Cloud!!</em></strong></p><h3>⚡Happy Learning! Keep Growing!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=bb99d624fe5e" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding K-means Clustering and its Use cases in Security Domain]]></title>
            <link>https://rishabh27sharma.medium.com/understanding-k-means-clustering-and-its-use-cases-in-security-domain-c93531e2d243?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/c93531e2d243</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Mon, 19 Jul 2021 12:59:48 GMT</pubDate>
            <atom:updated>2021-08-24T14:47:56.639Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*IkaSGcUp6UshqkdBfNXniw.jpeg" /></figure><p>K-means clustering is one of the simplest and popular unsupervised machine learning algorithms.</p><p>“The objective of K-means is simple: group similar data points together and discover underlying patterns. To achieve this objective, K-means looks for a fixed number (<em>k</em>) of clusters in a dataset.”</p><p><strong>“</strong>A cluster refers to a collection of data points aggregated together because of certain similarities”.</p><h3>K-means Algorithm</h3><p><strong>K-means</strong> algorithm is an iterative algorithm that tries to partition the dataset into <em>K </em>pre-defined distinct non-overlapping subgroups (clusters) where each data point belongs to <strong>only one group</strong>. It tries to make the intra-cluster data points as similar as possible while also keeping the clusters as different (far) as possible. It assigns data points to a cluster such that the sum of the squared distance between the data points and the cluster’s centroid (arithmetic mean of all the data points that belong to that cluster) is at the minimum. The less variation we have within clusters, the more homogeneous (similar) the data points are within the same cluster.</p><h3>How the K-means algorithm works</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*rLeGqQZ0iLuaQ10mM06rhA.gif" /></figure><p>The way k-means algorithm works is as follows:</p><ol><li>Specify number of clusters <em>K</em>.</li><li>Initialize centroids by first shuffling the dataset and then randomly selecting <em>K </em>data points for the centroids without replacement.</li><li>Keep iterating until there is no change to the centroids. i.e. assignment of data points to clusters isn’t changing.</li><li>Compute the sum of the squared distance between data points and all centroids.</li><li>Assign each data point to the closest cluster (centroid).</li><li>Compute the centroids for the clusters by taking the average of the all data points that belong to each cluster.</li></ol><h3>Advantages of K-means Clustering</h3><ol><li>It is fast, Robust, Easy to understand, Comparatively Efficient.</li><li>If data sets are distinct, then gives the best results.</li><li>Flexible, Easy to interpret.</li><li>Better computational Cost, Enhances Accuracy.</li></ol><h3>Disadvantages of K-means Clustering</h3><ol><li>If there are two highly overlapping data, then it cannot be distinguished and cannot tell that there are two clusters.</li><li>Cannot handle outliers and noisy data.</li><li>Do not work for the non-linear data set, Lacks consistency, Sensitive to scale.</li></ol><h3>Use-Cases in Security Domain</h3><p>With the advancement in technology and the increase in the number of digital sources, data quantity increases every day and, consequently, the cyber security related data quantity. Traditional security systems such as Intrusion Detection Systems (IDS) are not capable of handling such a growing amount of data set in real time.</p><p>k-means clustering is one of the commonly used clustering algorithms in cyber security analytics aimed at dividing security related data into groups of similar entities, which in turn can help in gaining important insights about the known and unknown attack patterns. This technique helps a security analyst to focus on the data specific to some clusters only for the analysis. To improve performance, k-means can exploit the triangle inequality to skip many point-center distance computations, without affecting the clustering results.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*KwQCTx8GRH1HsRSFvhz3oQ.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c93531e2d243" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JavaScript : Industry Use Cases]]></title>
            <link>https://rishabh27sharma.medium.com/javascript-industry-use-cases-e42fd5d018c4?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/e42fd5d018c4</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Mon, 21 Jun 2021 10:18:58 GMT</pubDate>
            <atom:updated>2021-06-21T10:18:58.209Z</atom:updated>
            <content:encoded><![CDATA[<h3>JavaScript : Industry Use Cases</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WhqG5NMi42Q4iNwewXYLqQ.jpeg" /></figure><p>JavaScript is the world’s most popular programming language.</p><p>It is a light-weight object-oriented programming language which is used by several websites for scripting the webpages. It is an interpreted, full-fledged programming language that enables dynamic interactivity on websites when applied to an HTML document.</p><h3>Major Companies Are Using JavaScript</h3><p>There’s no denying that JavaScript is everywhere, but just how are some of the world’s largest tech companies using JavaScript? For these companies, JavaScript is immensely important, and that doesn’t look like it’s going to change any time soon.</p><h3>Google</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/1*vHFZ3v6ECA7F_uitmZ8SYA.gif" /></figure><p>How doesn’t Google use JavaScript? Seriously, it’s everywhere. Google’s search results that spring up as your typing get there with JavaScript. The Gmail web client is powered by JavaScript. Google Docs? Yeah, that’s JavaScript too.</p><p>Google develops and usually open sources it’s own JavaScript tools. The most obvious example is AngularJS. Angular is used most prominently in Google’s DoubleClick advertising platform, but it’s also one of the most popular front end frameworks available. It’s even part of the MEAN stack.</p><p>Google’s more intensive services, like Google Docs, use Closure Tools. This set of tools compiles JavaScript into a lower-level faster form more suited for rich and highly responsive web applications.</p><p>There’s another big point to touch on. Google developed Chrome. Chrome, being a web browser, needed a JavaScript engine, so Google also made V8. V8 not only powers Chrome, it’s at the heart of NodeJS. So, without Google, there would be no Node.</p><h3>Facebook</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EH4t9GW8k-XxJdfEWk4fGw.gif" /></figure><p>You’re probably aware that Facebook uses JavaScript. It’s kind of hard to miss. What’s probably not as obvious is exactly how much JavaScript goes into making Facebook and how much Facebook is involved in JavaScript development.</p><p>Try disabling JavaScript in your web browser and going to Facebook. The website will actually stop you from logging in because it won’t work without JavaScript.</p><p>You may have noticed the way that Facebook loads. Each piece of the page is separate. Facebook has invented its own way of breaking down and delivering sections of JavaScript separately. In an odd way, each section of your Facebook page is a collection of independent JavaScript applications.</p><p>It doesn’t stop there. Facebook created <strong>React</strong>, one of the most popular front end frameworks. Facebook uses React on Facebook.com as well as Instagram and WhatsApp.</p><h3>PayPal</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N4WVktNPSuARMwXMzmo4Ag.png" /></figure><p>PayPal has obviously been using JavaScript on the front end of their website for a long time, but that’s only the beginning.</p><p>The online payment giant was one of the earliest adopters of NodeJS. During an overhaul of their account overview page, they decided to try building the page in Node at the same time as their usual Java development. The NodeJS version worked out so well, that they chose to use it in production and build all client-facing applications in Node going forward. That means that most of what you see in your account is running on Node.</p><p>PayPal even went as far as to create and maintain their own version of Express, called <strong>KrakenJS</strong>. It’s pretty obvious that they like JavaScript over at PayPal.</p><h3>Netflix</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*EYE0V5ZctwSbi6K1fcq4zg.gif" /></figure><p>Like PayPal, Netflix started out using Java for just about everything. They too ran into problems with Java’s size and the time it required to develop.</p><p>Over time, Netflix moved away from its more traditional structure into the cloud and started to introduce NodeJS. With Node, Netflix was able to break down pieces of their user interface into individual services. This more distributed approach was able to speed things up an alleviate stress on their servers. Today, a large portion of Netflix’s interface is running on Node.</p><h3>Uber</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*YHv1F16f9eyP0yedDPo98g.jpeg" /></figure><p>Uber needs to handle loads of data in real time. They have millions of requests coming in continuously, and that’s not just hits on a page. Uber needs to track driver locations, rider locations, and incoming ride requests. It has to seamlessly sort that data and match riders as fast as possible.</p><p>All of that plays to NodeJS’s and JavaScript’s strengths. Node is designed to handle requests and hand off data quickly. It’s asynchronous capabilities are a huge part of that. Node is central to Uber’s user facing stack for just that reason.</p><h3>eBay</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*4FhoFGjdIUFFtBSA23a21w.jpeg" /></figure><p>eBay’s story is a lot like Netflix’s. For a long time, just about everything in eBay’s tech stack was based on Java. A few years ago, eBay encountered a problem that Java wasn’t the right solution for. They decided to give NodeJS a shot instead.</p><p>Node worked so well that eBay not only kept using it for that particular service, they began migrating their entire user facing stack to NodeJS. Now, just about everything that you interact with on eBay is powered by Node. Sure, beneath Node, Java is still dealing with their databases, but eBay still places a lot of trust in NodeJS.</p><h3>JavaScript Is Everywhere!</h3><p>These companies are among the largest tech companies in the world. Many are also running the largest production deployments of NodeJS. The others are responsible for important parts of the JavaScript ecosystem as a whole.</p><blockquote>⚡Keep Learning Keep Growing!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e42fd5d018c4" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Classify Cyber Crime Offenses Using Confusion Matrix]]></title>
            <link>https://rishabh27sharma.medium.com/classify-cyber-crime-offenses-using-confusion-matrix-4276c017ae2b?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/4276c017ae2b</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Sat, 05 Jun 2021 07:44:48 GMT</pubDate>
            <atom:updated>2021-06-05T07:44:48.375Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*D7Hbdp9ooUVu3IkETz48mw.jpeg" /></figure><p>Particularly in the last decade, Internet usage has been growing rapidly. However, as the Internet becomes a part of the day to day activities, cybercrime is also on the rise. Cybercrime will cost nearly <strong>$6 trillion </strong>per annum by 2021 as per the cybersecurity ventures report in 2020. For illegal activities, cybercriminals utilize any network computing devices as a primary means of communication with a victims’ devices, so attackers get profit in terms of finance, publicity and others by exploiting the vulnerabilities over the system. Cybercrimes are steadily increasing daily. Evaluating cybercrime attacks and providing protective measures by manual methods using existing technical approaches and also investigations has often failed to control cybercrime attacks.</p><p>Therefore, this study proposes a flexible computational tool using machine learning techniques to analyze cybercrimes rate at a state wise in a country that helps to classify cybercrimes. Security analytics with the association of data analytic approaches help us for analyzing and classifying offenses from India-based integrated data that may be either structured or unstructured. The main strength of this work is testing analysis reports, which classify the offenses accurately with 99 percent accuracy.</p><h4>Proposed Methodology</h4><p>At present, there is no generalized framework is available to categorize cybercrime offenses by feature extraction of the cases. In the present work, data analysis and machine learning are incorporated to build a cybercrime detection and analytics system. The proposed system’s design and implementation utilize classification, clustering and supervised algorithms.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/1*BWUOo8rKTvqJw-4rHdYWoQ.png" /><figcaption>Proposed approach to analyze cybercrime incidents</figcaption></figure><h4><strong>Information Gathering</strong></h4><p>In the reconnaissance phase, the integrated data (structured and unstructured) are collected from Kaggle and CERT-In. The integrated data are stored as raw data in the database.</p><p>Table depicts sample data of the dataset considered in the proposed model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*qfP98lnovaPbV9zDTvt6HQ.png" /><figcaption>Sample dataset of the proposed model</figcaption></figure><h4>Preprocessing</h4><p>In this phase only the feature extraction process takes place. It converts the high dimensional data to low dimensional data.</p><h4>Prediction Analysis</h4><p>In the prediction analysis step, the cybercrime data were analyzed and used to predict which crime is occurring more in a particular year at a particular location. Through this analysis, one can predict the cybercrime data and can reduce the incarnation of cybercrime incidents.</p><h4>Results and Analysis</h4><p>The proposed system is designed and developed by considering the data from sources such as Kaggle and CERT-In. It consists of more than 2000 records with the eight attributes such as incident, offender, victim, harm, year, location, age of the offender and cybercrime. Incidents that occurred in India during 2012–2017 were considered. More than 2000 records are used to construct and test the proposed computational system.</p><p>The over-all occurrence of the cybercrime incidents in India during certain specified periods. It demonstrates that the occurrence of the Identity (ID) theft is more when compared to the other two attacks. We can take some countermeasures in order to reduce the existence of the ID theft attack in India. The existence of the copyright attack and hacking is also more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/795/1*gEvZpwWRgu0zcfwe2ZjkKg.png" /><figcaption>Overall occurrence of cybercrime in India</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/973/1*17t57FrjZLljdTZih5IwAQ.png" /><figcaption>Precision recall and f-1 score for the proposed model</figcaption></figure><p>Above figure demonstrates the precision, recall and f-1 score for our model. These can be obtained by using the <strong>confusion matrix </strong>obtained in our model and we can get the average accuracy rate for the cybercrimes that are predicted. Let’s know understand about confusion matrix.</p><p><strong>What is Confusion Matrix and why we need it?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/1*MAqF-90RlLemfvRvqoyKnQ.png" /></figure><p><strong>“Confusion Matrix is a performance measurement for machine learning classification where output can be two or more classes.”</strong></p><p>It is a table with 4 different combinations of predicted and actual values.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/356/1*g5zpskPaxO8uSl0OWT4NTQ.png" /></figure><p>It is extremely useful for measuring Recall, Precision, Specificity, Accuracy and most importantly AUC-ROC Curve.</p><h4>We can use confusion matrix to calculate various metrics:</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/754/1*fUnVMuu91SR_Ehrfvne2iA.jpeg" /></figure><ol><li><strong>Accuracy:</strong> The values of confusion matrix are used to calculate the accuracy of the model. It is the ratio of all correct predictions to overall predictions (total values)</li></ol><blockquote>Accuracy = (TP + TN)/(TP + TN + FP + FN)</blockquote><p>2. <strong>Precision: </strong>It is the measure of truly predicted positive samples to the total number of positively predicted samples. If the precision score is more then it represents that our model is pretty good to classify the samples.</p><blockquote>Precision= TP / TP + FP</blockquote><p>3. <strong>Recall:</strong> It is the measure of truly predicted positive samples of all the samples present in the actual class as yes. It is also termed as the sensitivity of the model.</p><blockquote>Recall = (T<strong>rue</strong> positives / all <strong>actual</strong> positives) = TP / TP + FN</blockquote><p>4. <strong>F1 score</strong>: It is calculated as the weighted average of both precision and recall. Its main components (considerations) are true negatives, true positives, false negatives and false positives. F1 score is preferred more than accuracy in order to know our classifier model performance measure</p><blockquote>F1 Score=2 × (precision × recall)</blockquote><p>Figure depicts the <strong>confusion matrix</strong> for our model when the training size was 0.8 and the test size was 0.2. By this, we know how many cases are classified correctly and how many are classified incorrectly. It means we can find out the true negatives and true positives and false negatives and false positives classified by using the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/910/1*osqQB_XxWwpAnwCqDkSerQ.png" /><figcaption>Confusion matrix for the proposed model</figcaption></figure><p>The anomaly based <strong>intrusion detection system (IDS)</strong> is widely used based on different machine learning algorithms. The IDS is usually evaluated by its ability to make accurate predictions of attacks. In case of the binary classifier IDS four possible outcomes are possible. Attacks correctly predicted as attacks (TP), or incorrectly predicted as normal (FN). Normal correctly predicted as normal (TN), or incorrectly predicted as attack (FP).</p><p>The <strong>confusion matrix</strong>, maintains information about actual and predicted classes. Intrusion detection systems are mainly discriminate between two classes, attack class (malicious, threats or abnormal data) and normal class (normal data points). Different machine learning algorithms may be used in order to build anomaly based IDS. The anomaly based IDS aims to profile the normal behavior in order to discriminate between normal and intrusions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SB3dyQYBnK0VhlmxNLEhzw.png" /></figure><h4>Let’s understand the terms used here:</h4><p>The four instances TP, TN, FP and FN are counted due to the relation between the predicted and actual classes. They are composed in the 2x2 confusion matrix as shown in Table. It shows that there are also two classes of connection points “Normal” and “Attack”.</p><ul><li><strong>True Positive (TP) :</strong> for attack detected when it is actually attack.</li><li><strong>True Negative (TN) :</strong> for normal detected when it is actually normal.</li><li><strong>False Positive (FP) (Type I Error):</strong> for attack detected when it is actually normal.</li><li><strong>False Negative (FN) (Type II Error):</strong> for normal detected when it is actually attack <strong>(False Alarm)</strong>.</li></ul><h3>Type I Error : <strong>False Positive (FP)</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*73oWTR1qIHBlJgsOU7G20g.png" /><figcaption>Type I error (False Positive)</figcaption></figure><p>This type of error is the most <strong>dangerous</strong>. In such cases our system predicts that we are safe and secure with no attack but in actual cyber attack actually takes place. In this case no notification would have reached the security team and nothing can be done to prevent it.</p><h3>Type II Error : False Negative (FN)</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/700/1*jbVgkvaMfe8qNF1f9KEuYA.png" /><figcaption>Type II error — False Alarm (False Negative)</figcaption></figure><p>This type of error are not very dangerous as our system is protected in reality but model predicted an attack. the team would get notified and check for any malicious activity.</p><h3>Conclusions and Future Scope</h3><p>In the present world, cybercrime offenses are happening at an alarming rate. As the use of the Internet is increasing many offenders, make use of this as a means of communication in order to commit a crime. The framework developed in our work is essential to the creation of a model that can support analytics regarding the identification, detection and classification of the integrated cybercrime offenses (structured and unstructured). The main focus of our work is to find the attacks that take advantage of the security vulnerabilities and analyze these attacks by making use of machine learning techniques.</p><p><strong>Thanks for reading !!!</strong></p><blockquote>⚡Keep Learning Keep Growing!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4276c017ae2b" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deploy Machine Learning Model inside Docker Container]]></title>
            <link>https://rishabh27sharma.medium.com/deploy-machine-learning-model-inside-docker-container-96b5d4fcb315?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/96b5d4fcb315</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Thu, 27 May 2021 09:58:33 GMT</pubDate>
            <atom:updated>2021-05-27T09:58:33.458Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Lp2HR8T-miRjM84n_4RZkQ.png" /></figure><p>In this article we will be looking how we can deploy and run Machine Learning models inside docker containers.</p><p>Here I am working with RHEL-8 and I already have docker inside my RHEL-8.</p><blockquote>To know more how we can install and configure docker inside RHEL-8. Refer to <a href="https://hrishabhsharma183.medium.com/configuring-httpd-webserver-setting-up-python-interpreter-and-running-python-code-on-docker-4d01dd501b4">https://hrishabhsharma183.medium.com/configuring-httpd-webserver-setting-up-python-interpreter-and-running-python-code-on-docker-4d01dd501b4</a></blockquote><p>First we have to start the docker service</p><pre><strong># systemctl start docker<br># systemctl enable docker<br># systemctl status docker</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vICk-rELTRh3MK14sE8AFQ.png" /></figure><p>After starting docker service we have to pull the image from<strong> docker hub</strong> which we require to launch container.</p><p>Here we will be using <strong>centos</strong> image.</p><p>Command to pull image</p><pre><strong># docker pull centos:latest</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*vOHSy-DSG4N7sG3dRn4cdg.png" /></figure><p>To check the images command is</p><pre><strong># docker images</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/798/1*RZKWW7idMK6TABNSLQwWnw.png" /></figure><p>Command to launch container</p><pre><strong># docker run -it --name ml centos:latest </strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/549/1*85Fo9mkwmCk-LKLCU9isiQ.png" /></figure><p><strong>within a sec</strong> we have our container launched. After running the above command we will land inside our container. To manage our code properly we are creating separate workspace/directory. We will keep our code here.</p><pre><strong># mkdir MLOps</strong></pre><pre><strong># cd MLOps</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/1*q2kq96A_2IhU7QVgL6eW3Q.png" /></figure><p>In this image yum is already configured, so we can use it to install software/packages.</p><p>Now we have to install python3</p><pre><strong># yum install python3 -y</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hhNITvyC200U2jXZD2aetg.jpeg" /></figure><p>After installing python3 we need to install some libraries which are required for our ML Model.</p><pre><strong># pip3 install pandas</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rlc6Lkf3xabjhy-EG-vwCA.png" /></figure><pre><strong># pip3 install scikit-learn</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hR8-_1YpqLuEQ8Oulnb4Vg.png" /></figure><pre><strong># pip3 list</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*UBLBChhgN4LIm_0ha16NSw.png" /></figure><p>In my Base OS (RHEL-8) i.e. Docker Host I have created Machine Learning model for <strong>Salary Prediction</strong> which is based on <strong>Simple Linear Regression model</strong> using dataset <strong>Salary_Data.csv</strong></p><pre><strong># SalaryPrediction.py</strong></pre><pre><strong>import pandas as pd<br>dataset = pd.read_csv(&quot;Salary_Data.csv&quot;)<br>X = dataset[&#39;YearsExperience&#39;].values.reshape(30,1)<br>y = dataset[&#39;Salary&#39;]<br>from sklearn.linear_model import LinearRegression<br>model = LinearRegression()<br>model.fit(X,y)</strong></pre><pre><strong>ye = input(&quot;Enter Years of Experience: &quot;)<br>salary = model.predict([[float(ye)]])<br>print(&quot;Salary :&quot;,salary)</strong></pre><p>Now we have to copy our trained model and dataset inside our running docker container named <strong>ml</strong> to our created workspace named MLOps.</p><p>To do this we have command</p><pre><strong># docker cp SalaryPrediction.py ml:/MLOps<br># docker cp Salary_Data.csv ml:/MLOps</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rkHDiE9X2QsNO0VOixOAMw.png" /></figure><p>So we now have our dataset and model inside our docker container.</p><p>Running trained model to predict the salary based on Year of Experience:</p><pre><strong># python3 SalaryPrediction.py</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/827/1*-yleeBT3956Gvw32vk9bpQ.png" /></figure><p><strong>Done!</strong></p><h3>⚡Keep Learning Keep Growing!</h3><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=96b5d4fcb315" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[⚡MongoDB : Industry Use Cases]]></title>
            <link>https://rishabh27sharma.medium.com/mongodb-industry-use-cases-856390ffb202?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/856390ffb202</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Sun, 23 May 2021 08:44:45 GMT</pubDate>
            <atom:updated>2021-05-23T08:50:44.116Z</atom:updated>
            <content:encoded><![CDATA[<h3>⚡MongoDB : Industry Use Cases</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fl_ySpJQeoebfcDbBNLsIQ.png" /></figure><h3>MongoDB : The database for modern applications</h3><p>MongoDB is a general purpose, document-based, distributed database built for modern application developers and for the cloud era.</p><p>It provides support for all the popular languages like C, C++, C#, .Net, Go, Java, Node.js, Perl, PHP, Python, and many more.</p><p>Used by millions of developers to power the world’s most innovative products and services.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/951/1*7W_BCso_uJfwQVKucBkjLQ.png" /><figcaption><em>Image courtesy of Stack Overflow 2019 Developer Survey, Most Wanted Database</em></figcaption></figure><h3>Some Real-World Companies That Use MongoDB</h3><h4><strong>eBay</strong></h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/758/1*U_hrmIIYqcLDqJEMko21WQ.jpeg" /></figure><p>eBay is a multinational company that provides a platform for the customer to customer sales. It is currently running a large number of projects in MongoDB like merchandising categorization, cloud management, metadata storage, search suggestions.</p><h4>MetLife</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*urenuK7BpoIYtX8-EyKX7Q.jpeg" /></figure><p>MetLife is a leading company in employee benefit programs, annuities, and insurance. There are more than 90 million customers in the Middle East, Europe, Asia, Latin America, Japan, United States. MetLife is using MongoDB for its advanced customer service application called The Wall.</p><p>This application provides a combined view of transactions, policy details, and other details of MetLife Customers. It looks like Wall of Facebook, which takes data from 70 legacy systems and merges it into a single record. It stores 24 Terabytes of data and runs across six servers in two data centers. MetLife is working on a series of Big Data projects where MongoDB-based applications are part of it.</p><h4>Shutterfly</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MVtEsr9SBd-ApBlaqd64Ig.jpeg" /></figure><p>Shutterfly is one of the most popular online photo sharing, and it is using MongoDB to manage and store more than 6 billion images, which has a transaction rate of up to 10,000 operations per second. Shutterfly earlier used Oracle but later transitioned to MongoDB.</p><p>Shutterfly company realized that moving to a non-relational database will help them to increase their scalability, performance, and productivity of the programmer.</p><p>Shutterfly did consider many other alternate database systems like BerkeleyDB, CouchDB, or Cassandra. The company has confirmed that they are pleased with their decision of transitioning from Oracle to MongoDB.</p><h4>Aadhar</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/970/1*JMwIj_SoMq_Cs2B7HBYehQ.jpeg" /></figure><p>It is India’s Unique Identification project, which has the biggest biometrics database in the world. Aadhar Project is using MongoDB as its database to store a massive amount of demographic and biometric data of more than 1.2 billion Indians. MongoDB is being used for the storage of images in the Aadhar project.</p><h4>EA</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aa_z3UyE-1PKjIyURVMopw.png" /></figure><p>EA is an online multiplayer game that is using MongoDB Database for its game called FIFA Online 3. MongoDB can easily handle complicated things that need synchronization with each other entirely.</p><h3>IoT - MongoDB Use Case for Bosch</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZEyLNzXRrxHA45NwVJmjvA.png" /></figure><p>One of the interesting use cases of MongoDB involves Bosch. Internet of Things (IoT) has transformed the way businesses operate, and Bosch, one of the technology leaders, is not lagging behind.</p><p>Bosch has invested a lot on smart power tools and advanced telematics. The key driver to these projects has been the Internet of things. IoT doesn’t just deal with connected devices, but it also specializes in giving real-time insights to improve the processes.</p><p>MongoDB has helped Bosch to deliver the IoT-powered apps to its consumers.</p><p>As the IoT market is inflating, Bosch plans to implement IoT in most of its services, and MongoDB is accelerating this process for Bosch by giving them an advantage with the scalability and high level of availability.</p><p>It would have been difficult for Bosch to execute and implement the IoT platforms with the relational database systems.</p><h3>Key Takeaways:</h3><p>MongoDB can be used to:</p><ul><li>Handle multiple documents through a single folder irrespective of size, data models, etc.</li><li>Drive IoT growth.</li><li>Improve flexibility.</li><li>Improve availability.</li><li>Get real-time analytics.</li><li>Improve content management platform experience.</li></ul><blockquote>Thanks for reading !!!😊✨</blockquote><blockquote>Keep learning and keep growing⚡</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=856390ffb202" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Running GUI Applications inside Docker Containers]]></title>
            <link>https://rishabh27sharma.medium.com/running-gui-applications-inside-docker-containers-87fbe03ce624?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/87fbe03ce624</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Thu, 13 May 2021 10:39:49 GMT</pubDate>
            <atom:updated>2021-05-30T06:47:09.540Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/928/1*YC-qHJMDNWxZLxUY6Nq9xQ.png" /></figure><p><em>While the IT world is embracing Containers Technology primarily for Enterprise Server Applications, there is also a huge scope of Docker Containers impacting the Desktop and Development Environment.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*0_jstHuSlrlfljDsyIAtAQ.jpeg" /></figure><p><em>Docker is a set of the platform as service products that use OS-level virtualization to deliver software in packages called containers.</em></p><p><strong><em>What are the issues while launching a GUI application?</em></strong></p><p><em>Docker doesn’t come with GUI as there is are minimal use cases with it. So, if we want to run GUI applications on a docker container then we need a display, as the container is not connected to the display. We need to connect the display of Base-OS.</em></p><p><strong><em>There can be two types of applications (usually services) that you can containerize</em></strong></p><ul><li><em>Applications that run as a Background Service (like a Database, webserver)</em></li><li><em>GUI Applications that run in the foreground (like firefox, jupyter notebook)</em></li></ul><p><em>Foreground applications requires</em><strong><em> Xserver</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/420/1*of7VdIQM6qR2hddmCJ32NQ.jpeg" /></figure><p><em>X is an application that manages one or more graphical displays and inputs like (keyboard, mouse, webcam etc.) connected to the computer. X is the GUI protocol for Linux/Unix system.</em></p><p><em>So, Services communicate with the X-server to display a graphical interface and receive input from the user and the X-server clients can be on the remote system.</em></p><p><em>For a GUI Application to run, we need to have a </em><strong><em>XServer</em></strong><em> which is available as part of every Linux Desktop Environment, But within a Container we don’t have any</em><strong><em> XServer</em></strong><em> — so we will</em></p><ul><li><em>Share the Host’s XServer with the Container by creating a volume</em></li></ul><p><strong>--volume=&quot;$HOME/.Xauthority:/root/.Xauthority:rw&quot;</strong></p><ul><li><em>Share the Host’s </em><strong><em>DISPLAY</em></strong><em> environment variable to the Container</em></li></ul><p><strong>--env=&quot;DISPLAY&quot;</strong></p><ul><li><em>Run container with </em><strong><em>host</em></strong><em> network driver with</em></li></ul><p><strong>--net=host</strong></p><p><em>So let’s get started</em></p><p><em>First we have to start the docker service</em></p><pre><strong># systemctl start docker<br># systemctl enable docker<br># systemctl status docker</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vICk-rELTRh3MK14sE8AFQ.png" /></figure><p><em>Command to pull image</em></p><pre><strong># docker pull centos:latest</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/814/1*vOHSy-DSG4N7sG3dRn4cdg.png" /></figure><p><em>Now let’s create a </em><strong><em>Dockerfile</em></strong><em> for creating docker image for GUI:</em></p><p><strong>vim Dockerfile</strong></p><p><strong>cat Dockerfile</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/807/1*9SNOsEnn9-22JP9L09-N4Q.png" /></figure><p><em>Use this</em><strong><em> Dockerfile</em></strong><em> to build an image with a </em><strong><em>GUI application for running jupyter notebook inside docker container</em></strong></p><p><strong>docker build -t jupyter-gui .</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/961/1*L8IUKIZ7NVpPJwtUS5cFTA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/895/1*1j9BNYyuZtWZ9wKjM0ot7g.png" /></figure><p><em>After this let’s launch the container from our created docker image </em><strong><em>jupyter-gui</em></strong></p><pre><strong># </strong><strong>docker run --name jupyter --net=host --env=&quot;DISPLAY&quot; --volume=&quot;$HOME/.Xauthority:/root/.Xauthority:rw&quot; jupyter-gui:latest</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*k43qvsxmxg6uSl2pqj0bmw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*mf6sP5ry6lCnAlSPOtZ5Kw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HRKi7Ac8eGRzFIS5HH8ZCQ.png" /></figure><blockquote>Thanks for reading !!!😊✨ keep learning! keep growing!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=87fbe03ce624" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[AI on AWS☁️ Workshop]]></title>
            <link>https://rishabh27sharma.medium.com/ai-on-aws-%EF%B8%8F-workshop-5619a8a4be57?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/5619a8a4be57</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Mon, 05 Apr 2021 13:16:34 GMT</pubDate>
            <atom:updated>2021-04-05T13:24:06.083Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vRVDkcga_cTWD2kvDGIQiA.gif" /></figure><p><strong><em>AWS offers the broadest and deepest set of tools to create impactful AI solutions faster.</em></strong></p><p><em>I had an amazing and very much informative workshop. </em><strong><em>One of the best workshop to be a part of</em></strong><em>. In just two days I had explored so many AI/ML services offered by AWS Cloud and learnt to implement them with so much powerful practical demos.</em></p><p><em>I would like to thank </em><strong><em>Mr. Vimal Daga</em></strong><em> Sir for sharing the valuable knowledge.</em></p><h4><strong><em>#Day_1</em></strong></h4><p><em>It was started from very basics about AI/ML, need for Cloud Computing.</em></p><p><strong><em>AWS AI Services Explored</em></strong></p><h3><strong><em>Amazon Rekognition</em></strong></h3><p><em>Deep learning-based image and video analysis.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NT9o1Aet-i0g2jqdM6MBpQ.png" /></figure><h3><strong><em>Amazon Polly</em></strong></h3><p><em>Turn text into lifelike speech across many languages</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*avI3Ic_DiQKsgnngWD_dRw.png" /></figure><p><em>Practically work with these service from AWS Web-UI portal as well as creating code in python using jupyter notebooks.</em></p><p><em>To connect AWS cloud using python language we require SDK i.e. </em><strong><em>boto3 library from python.</em></strong></p><p><em>Python Application Specifications</em></p><ul><li><em>Connect with Webcam using </em><strong><em>opencv-python</em></strong><em> library to click photo.</em></li><li><em>Upload photo to </em><strong><em>S3</em></strong><em> service of AWS Cloud.</em></li><li><em>Connect as a client to </em><strong><em>Amazon Rekognition </em></strong><em>and </em><strong><em>Amazon Polly.</em></strong></li><li><em>Output -&gt; Response</em></li></ul><blockquote><em>Refer to code on my GitHub </em><a href="https://github.com/hrishabhsharma/AI-on-AWS-Workshop">https://github.com/hrishabhsharma/AI-on-AWS-Workshop</a></blockquote><h4>#Day_2</h4><h3><strong><em>Amazon Lex</em></strong></h3><p><em>Add voice and chat conversational bots to your applications</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y_PgYjtfPflX7TOMyRkEew.png" /></figure><p><strong><em>Created one chat bot for finding bitcoin price.</em></strong></p><h3>Amazon Kendra</h3><p><em>Highly accurate intelligent search service powered by machine learning.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vnG8vzjJmx3hBK1ZpJlAHw.jpeg" /></figure><h3>Amazon Forecast</h3><p><em>Amazon Forecast is a fully managed service that uses statistical and machine learning algorithms to deliver highly accurate time-series forecasts</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aYBV9r0TfsBvaEs1d8bVQA.png" /></figure><h3>Amazon CodeGuru</h3><p><em>Automate code reviews and optimize application performance with ML-powered recommendations</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9L-2NcsrlvVyIc3WcoMTGg.jpeg" /></figure><h4>Amazon Transcribe</h4><p><em>Amazon Transcribe makes it easy for developers to add speech to text capabilities to their applications.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*Hvh_HFHG4cH2yET0ARJnIg.jpeg" /></figure><h3>Amazon Comprehend</h3><p><em>Amazon Comprehend is a natural-language processing (NLP) service that uses machine learning to uncover information in unstructured data.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*TVOayYR_37LW665fwkFStQ.gif" /></figure><h3>Amazon Textract</h3><p><em>Easily extract printed text, handwriting, and data from virtually any document.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*cn2t3nQn4ujZRLiKVjRXsw.jpeg" /></figure><h3>Amazon Translate</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/401/1*rcMPYTR4oV_7SOumlBecGg.png" /></figure><p><em>Amazon Translate is a neural machine translation service that delivers fast, high-quality, and affordable language translation.</em></p><h3>Amazon Personalize</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/302/1*sxNhpf3NSSZhYRYwgfmpqg.jpeg" /></figure><p><em>Create real-time personalized user experiences faster at scale</em></p><h3>Amazon Fraud Detector</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*E2DUbpXCx0AoXtVvgqXo8A.jpeg" /></figure><blockquote>Thanks for reading !!!😊✨ keep Learning!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/856/1*0uMFOeZg5Q0_5uF5v0GNQw.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5619a8a4be57" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[☸️LAUNCHING A WORDPRESS APPLICATION WITH MYSQL DATABASE ON K8S CLUSTER OVER AWS☁️ USING ANSIBLE]]></title>
            <link>https://rishabh27sharma.medium.com/%EF%B8%8Flaunching-a-wordpress-application-with-mysql-database-on-k8s-cluster-over-aws-%EF%B8%8F-using-ansible-e56bce213701?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/e56bce213701</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Fri, 19 Mar 2021 04:39:18 GMT</pubDate>
            <atom:updated>2021-03-19T04:39:18.289Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Hello everyone👋🏻, another very much interesting and important use case based automation article. In this article we will be </em><strong><em>Launching a WordPress Application with MYSQL Database on K8S Cluster over AWS☁️ using Ansible.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3wisYPrWqhAf90TCVHbpuw.gif" /></figure><p><em>I have already configured k8s multi node cluster over AWS using Ansible. In this article we will setup WordPress Application on our K8S Cluster using Ansible.</em></p><p><em>To know how to configure k8s multi node cluster over AWS using ansible you refer to my article</em></p><blockquote><a href="https://hrishabhsharma183.medium.com/%EF%B8%8Fconfiguring-k8s-multi-node-cluster-over-aws-%EF%B8%8F-%EF%B8%8Fusing-ansible-8d0da3a4b6c">https://hrishabhsharma183.medium.com/%EF%B8%8Fconfiguring-k8s-multi-node-cluster-over-aws-%EF%B8%8F-%EF%B8%8Fusing-ansible-8d0da3a4b6c</a></blockquote><p><em>We will configure everything using </em><strong><em>Ansible Roles</em></strong><em>.</em></p><p><strong><em>Ansible Role</em></strong></p><pre><strong>ansible-galaxy init wordpress-mysql</strong></pre><p><em>After creating ansible roles we need to write the yaml code inside the respective files. we have </em><strong><em>vars </em></strong><em>folder to keep variables and tasks folder to write </em><strong><em>tasks.</em></strong></p><pre><strong>---<br># tasks file for wordpress-mysql</strong></pre><pre><strong>#task to launch mysql <br>  - name: &quot;Launching MySql&quot;<br>    shell: &quot;kubectl run mydb --image=mysql:5.7 <br>--env=MYSQL_ROOT_PASSWORD={{ password }}   --env=MYSQL_DATABASE=wpdb  --env=MYSQL_USER=hrishabh  --env=MYSQL_PASSWORD={{ password }}&quot;<br>    register: MySQL<br>  - debug:<br>      var: &quot;MySQL.stdout_lines&quot;</strong></pre><pre><strong>#task to launch wordpress<br>  - name: &quot;Launching Wordpress&quot;<br>    shell: &quot;kubectl run mywp --image=wordpress:5.1.1-php7.3-apache&quot;<br>    register: wordpress<br>  - debug:<br>      var: &quot;wordpress.stdout_lines&quot;</strong></pre><p><strong><em>vars file for wordpress-mysql</em></strong></p><pre><strong>---<br># vars file for wordpress-mysql</strong></pre><pre><strong>password: &quot;your password&quot;</strong></pre><p><strong><em>“Exposing WordPress to the public world”</em></strong></p><pre><strong># Exposing Wordpress<br>  - name: &quot;Exposing wordpress&quot;<br>    shell: &quot;kubectl expose pods mywp  --type=NodePort  --port=80&quot;<br>    register: exposed<br>    ignore_errors: yes<br>  - debug: <br>      var: &quot;exposed.stdout_lines&quot;</strong></pre><p><em>To get service:</em></p><pre><strong>- name: &quot;get service&quot;<br>    shell: &quot;kubectl get svc&quot;<br>    register: svc<br>  - debug:<br>      var: &quot;svc.stdout_lines&quot;</strong></pre><p><em>After launching the pods it takes time to launch so, I am pausing the playbook for 60 seconds so all the pods will be ready and we can get the complete information of the pods</em></p><pre><strong>- name: &quot;Pausing playbook for 60 seconds&quot;<br>    pause: <br>      seconds: 60</strong></pre><pre><strong>- name: &quot;Getting Database IP&quot;<br>    shell: &quot;kubectl get pods -o wide&quot;<br>    register: Database_IP<br>  - debug:<br>      var: &quot;Database_IP.stdout_lines&quot;</strong></pre><p><strong><em>Creating main playbook “wp-mysql-setup.yml” to launch WordPress and MySQL on K8S Cluster over AWS </em></strong><em>☁️</em></p><pre><strong>- hosts: [&quot;tag_Name_K8S_Master&quot;]<br>  roles:<br>  - name: &quot;Launching Wordpress and Mysql&quot;<br>    role: &quot;/k8s-multi-node-cluster/wordpress-mysql&quot;</strong></pre><p><em>The command to execute the playbook </em><strong><em>“wp-mysql-setup.yml”</em></strong></p><pre><strong>ansible-playbook wp-mysql-setup.yml</strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*NoEyPuyjbJYAAQzT2af2eQ.gif" /></figure><p><em>Now you can take the public of any of the nodes whether master or slave with the exposed port, you will get landed to the </em><strong><em>wordpress login page</em></strong><em> and then enter </em><strong><em>password and username of the mysql database</em></strong><em> and hit the </em><strong><em>run installation </em></strong><em>button.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BSULbHndM5s8a0S1BOPR5A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*d9fxWL5PkOwtXX80qIXamw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*6u3-E0L1yPX3HrKXV-tOKw.png" /></figure><p><strong><em>Our WordPress Application is ready!</em></strong></p><p><strong><em>We can also check from our Master Node</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*QL1GU7tALPJHakF_mHj9kQ.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*QkwunQwLaaONnuxyXFXRBQ.jpeg" /></figure><blockquote>Thanks for reading !!!😊✨ keep Learning!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e56bce213701" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[☸️Configuring K8S Multi-Node Cluster over AWS ☁️ ️using Ansible]]></title>
            <link>https://rishabh27sharma.medium.com/%EF%B8%8Fconfiguring-k8s-multi-node-cluster-over-aws-%EF%B8%8F-%EF%B8%8Fusing-ansible-8d0da3a4b6c?source=rss-393ce2b26a32------2</link>
            <guid isPermaLink="false">https://medium.com/p/8d0da3a4b6c</guid>
            <dc:creator><![CDATA[rishabhsharma]]></dc:creator>
            <pubDate>Thu, 18 Mar 2021 07:10:42 GMT</pubDate>
            <atom:updated>2021-03-18T07:10:42.952Z</atom:updated>
            <content:encoded><![CDATA[<p><em>Hello everyone👋🏻, Back with another very much interesting and important use case based automation article. In this article we will be </em><strong><em>Configuring K8S Multi-Node Cluster over AWS </em></strong><em>☁️.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*RLVr8LnTPwJRoK1lnjdM8g.png" /></figure><p><em>We will configure everything using </em><strong><em>Ansible Roles</em></strong><em>.</em></p><p><em>We need to follow step by step procedure to achieve this:</em></p><ol><li><em>We will launch three ec2-instances over AWS cloud one as </em><strong><em>Master Node</em></strong><em> and two are </em><strong><em>Slave/Worker Nodes.</em></strong></li></ol><p><em>2. Configuring K8S Master</em></p><p><em>3. Configuring K8S Slaves</em></p><p>👨🏻‍💻 <strong><em>Ansible Configuration file “/etc/ansible/ansible.cfg”</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/943/1*jWLAvb5-bb24gxZLvRk3Aw.png" /></figure><p><strong><em>Ansible Role to launch ec2 instances</em></strong></p><pre><em><br>&gt; Creating role to create </em><strong><em>ec2-instance</em></strong><em>.<br>  </em><strong><em>ansible galaxy init ec2-launch</em></strong></pre><p><em>After creating ansible roles we need to write the yaml code inside the respective files. we have </em><strong><em>vars </em></strong><em>folder to keep variables and tasks folder to write </em><strong><em>tasks.</em></strong></p><p><strong><em>tasks file for ec2-launch</em></strong></p><pre><strong><em>---<br></em># tasks file for ec2-launch</strong></pre><pre><strong>- name:  &quot;Provisioning ec2 instances over AWS Cloud&quot;<br>  ec2:<br>    image: &quot;{{ image_id }}&quot;<br>    instance_type: &quot;{{ instance_type }}&quot;    <br>    region: &quot;{{ region }}&quot;<br>    key_name: &quot;{{ key }}&quot;<br>    wait: yes<br>    count: 1<br>    state: present<br>    vpc_subnet_id: &quot;{{ vpc_subnet_id }}&quot;<br>    group_id: &quot;{{ security_group_id }}&quot;<br>    aws_access_key: &quot;{{ aws_access_key }}&quot;<br>    aws_secret_key: &quot;{{ aws_secret_key }}&quot;<br>    instance_tags:<br>            Name: &quot;{{ item }}&quot;<br>  loop: &quot;{{ OS_Names }}&quot;</strong></pre><p><strong><em>vars file for ec2-launch</em></strong></p><pre><strong>---<br># vars file for ec2-launch</strong></pre><pre><strong>image_id: &quot;ami-0eeb03e72075b9bcc&quot;<br>instance_type: &quot;t2.micro&quot;<br>region: &quot;ap-south-1&quot;<br>key: &quot;arth&quot;<br>vpc_subnet_id: &quot;subnet-f7d4c19f&quot;<br>security_group_id: &quot;sg-2904234e&quot;<br>aws_access_key: &quot;enter access key&quot;<br>aws_secret_key: &quot;enter secret key&quot;<br>OS_Names:<br>        - &quot;K8S_Master&quot;<br>        - &quot;K8S_Slave1&quot;<br>        - &quot;K8S_Slave2&quot;</strong></pre><p><strong><em>Creating main playbook “setup.yml” to launch ec2 instances over AWS </em></strong>☁️</p><pre><strong>- hosts: localhost<br>  roles:<br>  - role: &quot;/k8s-multi-node-cluster/ec2-launch&quot;</strong></pre><p><em>The command to execute the playbook “</em><strong><em>setup.yml”</em></strong></p><pre><strong><em>ansible-playbook setup.yml</em></strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qt4lMZaii2yAq9ROXLl52w.png" /></figure><p><em>Now we can check the ec2 dashboard, we will see the instances has been created and running successfully.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*luaTDd7OHLssbu14vffwEw.png" /></figure><p><em>Here I am using dynamic inventory which will dynamically retrieve all the hosts.</em></p><p><em>Now after launching the ec2-instances we can now configure K</em><strong><em>ubernetes Multi Node Cluster </em></strong><em>on these</em><strong><em> </em></strong><em>instances.</em></p><h3><strong>Kubernetes Multi-Node Cluster</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T9ehFQ6_8sQ60iyFjaF_5g.gif" /></figure><blockquote>To setup k8s multi node cluster manually visit <a href="https://github.com/hrishabhsharma/Kubernetes-Multi-Node-Cluster-Over-AWS-Cloud">https://github.com/hrishabhsharma/Kubernetes-Multi-Node-Cluster-Over-AWS-Cloud</a></blockquote><p><strong><em>Ansible Roles to configure k8s-master and k8s-slaves</em></strong></p><pre><em>&gt; Creating role to configure </em><strong><em>k8s-master</em></strong><em>.<br>  </em><strong><em>ansible galaxy init k8s-master<br></em></strong><em>&gt; Creating role to configure </em><strong><em>k8s-slaves</em></strong><em>.<br>  </em><strong><em>ansible galaxy init k8s-slaves</em></strong></pre><p><strong><em>Steps for configuring Kubernetes Master node :</em></strong></p><ol><li><em>“Install docker (As we are using Amazon Linux 2 image so we don’t need to configure repo for docker)”</em></li></ol><pre><strong>---<br># tasks file for k8s-master<br> - name: &quot;Installing docker&quot;<br>   package:<br>     name: docker<br>     state: present</strong></pre><p>2. “<em>Starting and Enabling docker service”</em></p><pre><strong>- name: &quot;Starting and Enabling docker service&quot;<br>   service:<br>     name: docker<br>     state: started<br>     enabled: yes</strong></pre><p><em>3. “Configuring yum repo for Kubernetes”</em></p><pre><strong>- name: &quot;Configuring yum repo for kubernetes&quot;<br>   copy:<br>     src: &quot;/k8s-multi-node-cluster/k8s-master/files/kubernetes.repo&quot;<br>     dest: &quot;/etc/yum.repos.d/kubernetes.repo&quot;</strong></pre><p><em>4. “Installing kubeadm, kubectl, kubelet”</em></p><pre><strong>- name: &quot;Installing kubeadm, kubectl, kubelet&quot;<br>   yum:<br>     name: &quot;{{ item }}&quot;<br>     state: present<br>     disable_excludes: kubernetes<br>   loop: &quot;{{ packages }}&quot;</strong></pre><p><em>5. “Starting and Enabling kubelet”</em></p><pre><strong>- name: &quot;Starting and Enabling kubelet&quot;<br>   service:<br>     name: kubelet<br>     state: started<br>     enabled: yes</strong></pre><p><em>6. “Pulling Images using kubeadm”</em></p><pre><strong>- name: &quot;Pulling Images using kubeadm&quot;<br>   shell: &quot;kubeadm config images pull&quot;<br>   changed_when: false</strong></pre><p><em>7. “Change driver of docker from </em><strong><em>cgroupfs</em></strong><em> to </em><strong><em>systemd</em></strong></p><pre><strong>- name: &quot;Changing the driver in the docker&quot;<br>   copy:<br>      content: |<br>         {<br>            &quot;exec-opts&quot;: [&quot;native.cgroupdriver=systemd&quot;]<br>         }<br>      dest: /etc/docker/daemon.json<br>   register: output</strong></pre><p><em>8. “Restarting Docker Service”</em></p><pre><strong>- name: &quot;Restarting Docker&quot;<br>   service:<br>      name: docker<br>      state: restarted<br>   when: output.changed == true</strong></pre><p><em>9. “Installing </em><strong><em>iproute-tc</em></strong><em>”</em></p><pre><strong>- name: &quot;Installing iproute-tc&quot;<br>   package:<br>      name: iproute-tc<br>      state: present</strong></pre><p><em>10. “Setting bridge-nf-call-iptables to 1”</em></p><pre><strong>- name: &quot;Setting bridge-nf-call-iptables to 1&quot;<br>   shell: | <br>       echo &quot;1&quot;  &gt; /proc/sys/net/bridge/bridge-nf-call-iptables<br>   changed_when: false</strong></pre><p><em>11. “Initializing Master”</em></p><pre><strong>- name: &quot;Initializing Master&quot;<br>   shell: &quot;kubeadm init --pod-network-cidr={{ cidr }} --ignore-preflight-errors=NumCPU --ignore-preflight-errors=Mem --node-name=master&quot;<br>   ignore_errors: yes</strong></pre><p><em>12. “Creating .kube directory”</em></p><pre><strong>- name: &quot;Creating .kube directory&quot;<br>   shell: &quot;mkdir -p $HOME/.kube&quot;</strong></pre><p><em>13. “Copying /etc/kubernetes/admin.conf $HOME/.kube/config”</em></p><pre><strong>- name: &quot;Copying /etc/kubernetes/admin.conf $HOME/.kube/config&quot;<br>   shell: &quot;sudo cp -i /etc/kubernetes/admin.conf $HOME/.kube/config&quot;</strong></pre><p><em>14. “Changing owner permission of $HOME/.kube/config”</em></p><pre><strong>- name: &quot;changing owner permission&quot;<br>   shell: &quot;sudo chown $(id -u):$(id -g) $HOME/.kube/config&quot;</strong></pre><p><em>15. “Configuring with</em><strong><em> flannel</em></strong><em> plugin”</em></p><pre><strong>- name: &quot;Configuring with flannel plugin&quot;<br>   shell: &quot;kubectl apply  -f </strong><a href="https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml"><strong>https://raw.githubusercontent.com/coreos/flannel/master/Documentation/kube-flannel.yml</strong></a><strong>&quot;</strong></pre><p><em>16. “Generating Token”</em></p><pre><strong>- name: &quot;Generating Token&quot;<br>   shell: &quot;kubeadm token create  --print-join-command&quot;<br>   register: token<br>   ignore_errors: yes</strong></pre><pre><strong>- debug: <br>     var: token.stdout_lines<br>   register: token</strong></pre><p><strong><em>vars file for k8s-master</em></strong></p><pre><strong>---<br># vars file for k8s-master</strong></pre><pre><strong>cidr: &quot;10.244.0.0/16&quot;<br>packages:<br>   - kubeadm<br>   - kubelet<br>   - kubectl</strong></pre><p><em>We have completed all the required steps to achieve configuration on master node. Now we need to do configuration on Slave nodes. The Configuration on Slave nodes is much simpler as most of the steps are repeated.</em></p><p><strong><em>Steps for configuring Kubernetes Slave nodes :</em></strong></p><ol><li><em>“Install docker (As we are using Amazon Linux 2 image so we don’t need to configure repo for docker)”</em></li></ol><pre><strong>---<br># tasks file for k8s-slaves</strong></pre><pre><strong>- name: &quot;Installing docker&quot;<br>   package:<br>     name: docker<br>     state: present</strong></pre><p>2. “<em>Starting and Enabling docker service”</em></p><pre><strong>- name: &quot;Starting and Enabling docker service&quot;<br>   service:<br>     name: docker<br>     state: started<br>     enabled: yes</strong></pre><p><em>3. “Configuring yum repo for Kubernetes”</em></p><pre><strong>- name: &quot;Configuring yum repo for kubernetes&quot;<br>   copy:<br>     src: &quot;/k8s-multi-node-cluster/k8s-master/files/kubernetes.repo&quot;<br>     dest: &quot;/etc/yum.repos.d/kubernetes.repo&quot;</strong></pre><p><em>4. “Installing kubeadm, kubectl, kubelet”</em></p><pre><strong>- name: &quot;Installing kubeadm, kubectl, kubelet&quot;<br>   yum:<br>     name: &quot;{{ item }}&quot;<br>     state: present<br>     disable_excludes: kubernetes<br>   loop: &quot;{{ packages }}&quot;</strong></pre><p><em>5. “Starting and Enabling kubelet”</em></p><pre><strong>- name: &quot;Starting and Enabling kubelet&quot;<br>   service:<br>     name: kubelet<br>     state: started<br>     enabled: yes</strong></pre><p><em>6. “Change driver of docker from </em><strong><em>cgroupfs</em></strong><em> to </em><strong><em>systemd</em></strong></p><pre><strong>- name: &quot;Changing the driver in the docker&quot;<br>   copy:<br>      content: |<br>         {<br>            &quot;exec-opts&quot;: [&quot;native.cgroupdriver=systemd&quot;]<br>         }<br>      dest: /etc/docker/daemon.json<br>   register: output</strong></pre><p><em>7. “Restarting Docker Service”</em></p><pre><strong>- name: &quot;Restarting Docker&quot;<br>   service:<br>      name: docker<br>      state: restarted<br>   when: output.changed == true</strong></pre><p><em>8. “Installing </em><strong><em>iproute-tc</em></strong><em>”</em></p><pre><strong>- name: &quot;Installing iproute-tc&quot;<br>   package:<br>      name: iproute-tc<br>      state: present</strong></pre><p><em>9. “Setting bridge-nf-call-iptables to 1”</em></p><pre><strong>- name: &quot;Setting bridge-nf-call-iptables to 1&quot;<br>   shell: | <br>       echo &quot;1&quot;  &gt; /proc/sys/net/bridge/bridge-nf-call-iptables<br>       echo &quot;1&quot;  &gt; /proc/sys/net/bridge/bridge-nf-call-ip6tables<br>   changed_when: false</strong></pre><p><em>10. “Joining Slave to Master”</em></p><pre><strong>- name: &quot;Joining Slave to Master&quot;<br>   shell: &quot;{{ master_token }}&quot;<br>   ignore_errors: yes<br>   register: joined</strong></pre><pre><strong>- debug:<br>     var: joined.stdout_lines</strong></pre><p><strong><em>vars file for k8s-slaves</em></strong></p><pre><strong>---<br># vars file for k8s-slaves</strong></pre><pre><strong>packages:<br>   - kubeadm<br>   - kubelet<br>   - kubectl</strong></pre><p><strong><em>Creating main playbook “k8s-playbook.yml” to configure master, slaves, using Dynamic Inventory over AWS </em></strong>☁️</p><pre><strong>- hosts: [&quot;tag_Name_K8S_Master&quot;]<br>  roles:<br>  - name: &quot;Configuring Master Node&quot;<br>    role:  &quot;/k8s-multi-node-cluster/k8s-master&quot;</strong></pre><pre><strong>- hosts: [&quot;tag_Name_K8S_Slave1&quot;, &quot;tag_Name_K8S_Slave2&quot;]<br>  vars_prompt:<br>  - name: &quot;master_token&quot;<br>    prompt: &quot;Enter Token to Join Slaves to Master: &quot;<br>    private: no<br>  roles:<br>  - name: &quot;Configuring Slave Nodes&quot;<br>    role:  &quot;/k8s-multi-node-cluster/k8s-slaves&quot;</strong></pre><p><em>The command to execute the playbook </em><strong><em>“k8s-playbook.yml”</em></strong></p><pre><strong><em>ansible-playbook k8s-playbook.yml</em></strong></pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XSGC3Ym6J83Ov70GHfMWSA.gif" /></figure><p><strong><em>Now we can check from Master Node that our cluster is successfully configured!</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VpbRcMpUizfExwMNCvGlrg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/875/1*QkwunQwLaaONnuxyXFXRBQ.jpeg" /></figure><blockquote>Thanks for reading !!!😊✨ keep Learning!</blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8d0da3a4b6c" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>