<?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 Megha Bansal on Medium]]></title>
        <description><![CDATA[Stories by Megha Bansal on Medium]]></description>
        <link>https://medium.com/@megha-bansal?source=rss-3fe921b319da------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*flFWrg58lHoyqUgs3g0PDA.jpeg</url>
            <title>Stories by Megha Bansal on Medium</title>
            <link>https://medium.com/@megha-bansal?source=rss-3fe921b319da------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 18:40:42 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@megha-bansal/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[Usage of ‘lsof’ command in Linux]]></title>
            <link>https://medium.com/analytics-vidhya/usage-of-lsof-command-in-linux-1d37cb91aed8?source=rss-3fe921b319da------2</link>
            <guid isPermaLink="false">https://medium.com/p/1d37cb91aed8</guid>
            <category><![CDATA[linux-kernel]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[linux-tutorial]]></category>
            <category><![CDATA[kernel]]></category>
            <category><![CDATA[lsof]]></category>
            <dc:creator><![CDATA[Megha Bansal]]></dc:creator>
            <pubDate>Wed, 14 Sep 2022 15:56:54 GMT</pubDate>
            <atom:updated>2022-09-14T17:20:49.779Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PKw4QVJ8wTrw0Vj5.jpg" /></figure><blockquote><strong><em>INTRODUTION</em></strong></blockquote><p><strong>lsof</strong> lists the open files associated with your application. In Linux, almost any interaction with the system is treated like a file. As a result, if your application writes to a file or opens a network connection, <strong>lsof</strong> will reflect that interaction as a file. Similar to <strong>netstat</strong>, you can use <strong>lsof</strong> to check for listening ports.</p><blockquote><strong><em>INSTALLATION</em></strong></blockquote><p>✔ For RHEL / CentOS / Fedora</p><pre>$ sudo yum install lsof -y<br>or<br>$ sudo dnf install lsof -y</pre><p>✔ Debian Based Systems ( Ubuntu / Linux Mint )</p><pre>$ sudo apt install lsof -y</pre><blockquote><strong><em>OUTPUT FIELDS</em></strong></blockquote><p>lsof output field structure by default is like:</p><pre>COMMAND  PID  TID  USER  FD  TYPE  DEVICE  SIZE/OFF  NODE  NAME</pre><p>✔ <strong>COMMAND</strong> contains the first nine characters of the name of the UNIX<br> command associated with the process.<br>✔ <strong>PID</strong> is the Process Identification number of the process.<br>✔ <strong>TID</strong> is the task (thread) Identification number.<br>✔ <strong>USER</strong> is the user ID number or login name of the user to whom<br> the process belongs.<br>✔ <strong>FD</strong> is the File Descriptor number of the file.<br>✔ <strong>TYPE</strong> refers to the type of node associated with the file. <br>✔ <strong>DEVICE</strong> contains the device numbers, separated by commas.<br>✔ <strong>SIZE/OFF</strong> is the size of the file or the file offset in bytes.<br>✔ <strong>NODE</strong> is the inode number in the filesystem.<br>✔ <strong>NAME</strong> is the name of the mount point and file system on which.<br> the file resides, or the name of a file specified in the <em>names</em> option.</p><blockquote><strong><em>BACKEND OF lsof</em></strong></blockquote><p><strong>lsof</strong> leverages an extremely powerful feature of the linux kernel: the <strong>/proc </strong>file system. The kernel exports a lot of internal information under /proc, which you can browse with ‘ls’ and manipulate with a normal text editor. If you look at the content of the /proc directory, you see several subdirectories with a number as their name. Those are PIDs, and each of those subdirectories contains the details of a specific process. Inside, among other things, there’s the list of file descriptors for that process.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/426/1*GmO52eQSylkdtc_7sTl8Dw.png" /><figcaption>lsof backend</figcaption></figure><blockquote><strong><em>SOME COMMANDS</em></strong></blockquote><p>Below are some of the popular usage of the lsof command.</p><p><strong>1) Lists out all the files that are opened by any process in the system</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*Qw7W2C6-CyimNOj7YpWCHA.png" /><figcaption>lsof | head</figcaption></figure><p><strong>2) Lists out all the files that are opened by any process of a particular user in the system</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*WRZPEyJknzX_ohkS5iTzsw.png" /><figcaption>lsof -u &lt;username&gt; | head</figcaption></figure><p><strong>3) List all files which are opened by everyone except a specific user</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*Lb5r4Tgdgi4mw-f7LbUj-A.png" /><figcaption>lsof -u ^root | head</figcaption></figure><p><strong>4) List all open ipv4 network files ( lsof -i 6 for ipv6)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*G1JJiQtySi_YiCDEF10R0Q.png" /><figcaption>lsof -i 4</figcaption></figure><p><strong>5) List all open files that are opened by a particular process</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*TOLkgi1TZK5cKXnfLCcprQ.png" /><figcaption>lsof -p &lt;pid&gt;</figcaption></figure><p><strong>6)</strong> <strong>Files opened by all other PID</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/832/1*zxIc48wJMo3KTmMh5cLg1w.png" /><figcaption>lsof -p ^&lt;pid&gt; | head</figcaption></figure><p><strong>7)</strong> <strong>Which processes and users are reading/writing this file/dir</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/1*x6_dCbF1Fo_Du0-et6Tqng.png" /><figcaption>lsof &lt;filename&gt;</figcaption></figure><p><strong>8)</strong> <strong>Where is the binary file for that process</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*sw-c8ywMNS5O3R2HwNXAUg.png" /><figcaption>lsof -p &lt;pid&gt; | grep bin | head</figcaption></figure><p><strong>9)</strong> <strong>Which shared library has that process opened</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*PnbtMjb3KxaUtUUf47M3wA.png" /><figcaption>lsof -p &lt;pid&gt; | grep .so | head</figcaption></figure><p><strong>10)</strong> <strong>Where the process is logging to</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*bj4QyICXLr7WbLVBdYgvYQ.png" /><figcaption>lsof -p &lt;pid&gt; | grep log</figcaption></figure><p><strong>11)</strong> <strong>Which process is listening on port x</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*xRUDlFMFYD6j3-XNZLZtaA.png" /><figcaption>lsof -i &lt;protocol name&gt;</figcaption></figure><p><strong>12)</strong> <strong>List parent process IDs</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/1*byqS15afq6S8Sg4rOw2o3Q.png" /><figcaption>lsof -R | head</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1d37cb91aed8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/usage-of-lsof-command-in-linux-1d37cb91aed8">Usage of ‘lsof’ command in Linux</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Getting started with AWS CLI ( Command Line Interface )]]></title>
            <link>https://medium.com/analytics-vidhya/getting-started-with-aws-cli-command-line-interface-ac9ecb332e55?source=rss-3fe921b319da------2</link>
            <guid isPermaLink="false">https://medium.com/p/ac9ecb332e55</guid>
            <category><![CDATA[ec2]]></category>
            <category><![CDATA[cloud-computing]]></category>
            <category><![CDATA[aws]]></category>
            <category><![CDATA[ebs-volume]]></category>
            <category><![CDATA[aws-cli]]></category>
            <dc:creator><![CDATA[Megha Bansal]]></dc:creator>
            <pubDate>Tue, 13 Oct 2020 17:52:02 GMT</pubDate>
            <atom:updated>2020-10-14T12:55:01.872Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1017/0*tHezTGVhyqoXDtKu.png" /></figure><blockquote><strong><em>WHAT IS CLI?</em></strong></blockquote><p>CLI is a command-line program that accepts text input to execute functions. AWS provides us with an option of accessing their tools using <strong>AWS CLI</strong>. With minimal configuration, the AWS CLI enables you to start running commands that implement functionality equivalent to that provided by the browser-based <strong>AWS Management Console</strong> from the command prompt in your terminal program</p><blockquote><strong><em>WHY AWS CLI?</em></strong></blockquote><p>✔ <strong>Saves Time-</strong> Suppose you are trying to find a large folder. You have to log in to your account, find the right folder and look for the right file. But with AWS CLI, if you know the right command the entire tasks will take just a few seconds</p><p>✔ <strong>Automation-</strong> It gives you the ability to automate the entire process of controlling and managing AWS services through scripts. There are many things which the web UI can’t automate, everything is very manual. For eg- We can’t launch 2 EC2 instances from different AMI at one click.</p><blockquote><strong><em>INSTALLING AND CONFIGURING AWS CLI</em></strong></blockquote><p>You can install the CLI from <a href="https://docs.aws.amazon.com/cli/latest/userguide/install-cliv2.html"><strong>here</strong></a> according to your Operating System.</p><p>→After installing, you have to configure it. It includes your security credentials, the default output format, and the default AWS Region. For this, you’ll require the <strong>Access Key</strong> <strong>ID</strong> and <strong>Secret Access Key </strong>which can be obtained by IAM after creating a user / existing user with appropriate policies ( I have attached <strong>PowerUserAccess </strong>). After creating a user, you’ll get the credentials.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FPMbdf1sda27fYRjwHAedw.png" /><figcaption>Access Key ID and Secret Access Key</figcaption></figure><p>→ Go to your CMD and type</p><pre>aws configure</pre><p>→ Enter the Access key ID, Secret Acess Key, Region and the Output Format (default is JSON) for your commands.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/936/1*-SvvCmXWlhRNBdoIfhyriw.png" /></figure><p>You’re done with the setup!</p><blockquote><strong><em>PRACTICAL</em></strong></blockquote><p>This practical consists of the following tasks:</p><p>🔅 Create a key pair</p><p>🔅 Create a security group</p><p>🔅 Launch an instance using the above created key pair and security group.</p><p>🔅 Create an EBS volume of 1 GB.</p><p>🔅 The final step is to attach the above created EBS volume to the instance created in the previous steps</p><p><strong><em>1. Create a key pair</em></strong></p><pre>aws ec2 create-key-pair --key-name myclikey</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/935/1*8qMmyGhbTxA5JQmgMKdH-Q.png" /><figcaption>CLI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*BAxvB5cIFqhTLTRLd3oHRQ.png" /><figcaption>AWS Management Console</figcaption></figure><p><strong><em>2. Create a security group</em></strong></p><pre>aws ec2 create-security-group --group-name aws_cli_intro --description &quot;aws cli&quot; --vpc-id vpc-2ef81845</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vsCeD7CSKae3Mzt1YSNwwg.png" /><figcaption>CLI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GpmJ9LFpA6YC2MSRtjLuRw.png" /><figcaption>AWS Management Console</figcaption></figure><p><strong>Adding ingress rules to a security group:</strong></p><pre>aws ec2 authorize-security-group-ingress -- group-id sg-02915ad4c4814ecda --group-name aws_cli_intro --protocol tcp --port 22 --cidr 0.0.0.0/0</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*makrdgae5_H15yi9RcQObA.png" /><figcaption>Rule Created in AWS Console</figcaption></figure><p><strong><em>3. Launch an ec2 instance</em></strong></p><pre>aws ec2 run-instances --image-id ami-0e306788ff2473ccb --instance-type t2.micro --count=1 --subnet-id subnet-1ce09f50 --security-group-ids sg-02915ad4c4814ecda --key-name myclikey</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e_G1--5WESqmvkuPMs_7Lw.png" /><figcaption>CLI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T55jwB-qdkEY0-G6arZArQ.png" /><figcaption>AWS Management Console</figcaption></figure><p><strong><em>4. Create an EBS volume of 1 GB</em></strong></p><pre>aws ec2 create-volume --availability-zone ap-south-1b --size 1</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tAR0wcUB14tIKEfICv1ryw.png" /><figcaption>AWS Management Console</figcaption></figure><p><strong><em>5. Attach the volume to the instance</em></strong></p><pre>aws ec2 attach-volume --volume-id vol-09866940fb6a5eb52 --instance-id i-07c80aac43edf812f --device=/dev/sdf</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5FUJWDd5y5uO5IUeck3v8Q.png" /><figcaption>CLI</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yLp9vtqKQMqvMUoiyt0Vlw.png" /><figcaption>Volume attached</figcaption></figure><p><strong>Now we can do remote login using</strong></p><pre>ssh -l ec2-user &lt;public IP&gt; -i myclikey.pem</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aTRvsqSwHnKfdPicyHFDDQ.png" /><figcaption>Connect to the instance using SSH</figcaption></figure><p><strong>And further, create partition and store data</strong></p><p><strong>→Create partition:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EX6Kvv64BGhLE1JWmDr2Vg.png" /></figure><p><strong>→ Format partition:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pQMS6ieD8AZ6G2fd65ceIQ.png" /></figure><p><strong>→ Mount Partition:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9PX5-0boOwks9ah8RFy5CA.png" /></figure><p><strong>You’re good to go!</strong></p><p><strong>Thank you! Hope you had a wonderful read </strong>⭐</p><p>In case of any query, reach out to me on <a href="https://www.linkedin.com/in/megha-bansal-8aa76996/"><strong>Linkedln</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ac9ecb332e55" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/getting-started-with-aws-cli-command-line-interface-ac9ecb332e55">Getting started with AWS CLI ( Command Line Interface )</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Virtualization and Hypervisors]]></title>
            <link>https://medium.com/analytics-vidhya/virtualization-and-hypervisors-73f5453db376?source=rss-3fe921b319da------2</link>
            <guid isPermaLink="false">https://medium.com/p/73f5453db376</guid>
            <category><![CDATA[virtualization]]></category>
            <category><![CDATA[virtual-machine]]></category>
            <category><![CDATA[servers]]></category>
            <category><![CDATA[hypervisors]]></category>
            <category><![CDATA[cloud]]></category>
            <dc:creator><![CDATA[Megha Bansal]]></dc:creator>
            <pubDate>Sat, 10 Oct 2020 17:30:47 GMT</pubDate>
            <atom:updated>2020-10-11T13:07:11.209Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/780/1*61c98tRYGV9nM99bk1i4-g.png" /><figcaption>Don’t worry if you can’t figure it out right now!</figcaption></figure><blockquote><strong><em>WHAT EXACTLY IS VIRTUALIZATION?</em></strong></blockquote><p>Let’s look at the scene before Virtualization came into the picture.</p><ul><li>Individual applications running on individual systems. There would be many servers. Talking about the challenges:</li></ul><p>🌟 Only a limited capacity is used ( In case of minor workloads). Rest of the resources would go waste.</p><p>🌟 Applications perform in a different way in different Operating Systems. Suppose I want to run my application in Windows as well as Linux. Then I would have to buy another server and on top of that another OS.</p><ul><li>On the other hand, Virtualization enables us to have a single server and on top of that multiple OS. There are various other kinds of Virtualization as well.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/690/0*tRU3LakSa0ocEHCj.png" /></figure><p>So, Virtualization is nothing but a means to create a virtual version of a device or resource, such as — Server, Storage, Network or OS where the framework divides the resources into one or more execution environments. Devices, Applications and Human Beings are able to interact with the virtual resource as if it were a single logical resource.</p><blockquote><strong><em>ROLE OF HYPERVISORS</em></strong></blockquote><ul><li>In simple terms- It brings about Virtualization. It is computer software, firmware or hardware that creates and runs <a href="https://en.wikipedia.org/wiki/Virtual_machine">virtual machines</a>.</li><li>It can be classified into two kinds:</li></ul><p><strong>→Type-1, native or bare-metal hypervisors</strong></p><p><strong>→Type-2 or hosted hypervisors</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*huiKcBMqj0haM6DJ.png" /><figcaption>Types of hypervisors</figcaption></figure><ul><li><strong>Type-1</strong> hypervisors run directly on the hardware ( bare metal ). They don&#39;t require an underlying OS. They have direct access to the host hardware and resources and distribute it accordingly. Examples of Type 1 hypervisors are<strong> VMware ESXi, Microsoft Hyper-V, Xen</strong> etc.</li><li><strong>Type-2 </strong>hypervisors require an underlying OS. They run on top of an OS and gives us an environment to run other OS and applications. They don&#39;t have direct access to the host hardware and resources. Examples of Type 2 hypervisors are <strong>Oracle Virtualbox, VMware Workstation</strong> etc.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/870/1*VqKqFT2nbhkTYRTlX4c--A.png" /></figure><blockquote><strong><em>USE CASES OF BOTH THE TYPES</em></strong></blockquote><p><strong>Type-1</strong> is used in companies and for all the heavy workloads. We don’t need to worry about any OS, we just need hardware. Scaling becomes easier. Essential data is more secure because there’s no scope of an OS getting crashed. On the other hand, <strong>Type-2</strong> is mostly used for basic/personal needs such as learning and testing as is it not good from a longer-run perspective</p><p><strong>Thank you! Hope you had a wonderful read.</strong></p><p>In case of any query, reach out to me on <a href="https://www.linkedin.com/in/megha-bansal-8aa76996/"><strong>Linkedln</strong></a><strong>.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=73f5453db376" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/virtualization-and-hypervisors-73f5453db376">Virtualization and Hypervisors</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Deployment of WordPress on Google Cloud Platform ( GCP) with VPC and Kubernetes Integration]]></title>
            <link>https://medium.com/analytics-vidhya/deployment-of-wordpress-on-google-cloud-platform-gcp-with-vpc-and-kubernetes-integration-ee0e25f89ad6?source=rss-3fe921b319da------2</link>
            <guid isPermaLink="false">https://medium.com/p/ee0e25f89ad6</guid>
            <category><![CDATA[load-balancing]]></category>
            <category><![CDATA[gcp]]></category>
            <category><![CDATA[vpc-peering]]></category>
            <category><![CDATA[kubernetes-engine]]></category>
            <category><![CDATA[storage-services]]></category>
            <dc:creator><![CDATA[Megha Bansal]]></dc:creator>
            <pubDate>Sat, 29 Aug 2020 17:23:06 GMT</pubDate>
            <atom:updated>2020-08-31T07:55:35.377Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*9wNbTi5biGksnWnb.png" /><figcaption>GCP</figcaption></figure><p>This blog contains the following task process and details :</p><p>1. Create one project.</p><p>2. Create two VPC networks in the project.</p><p>3. Create a link between both the VPC networks using VPC Peering.</p><p>4. Create a Kubernetes Cluster in one of the VPC and launch WordPress by using Docker image with the Load Balancer.</p><p>5. Create a SQL server in another VPC and create a database.</p><p>6. Connect the SQL database to the web application launched in the Kubernetes cluster.</p><blockquote><strong>Wait, why cloud computing?</strong></blockquote><p>→provides with various resources and services, is a pay as you use model.</p><p>→you no longer need to pay wages for expert staff</p><p>→your energy consumption costs may be reduced</p><p>→there are fewer time delays.</p><p>→ your business can scale up or scale down your operation and storage needs quickly to suit your situation</p><p>and much more….</p><blockquote><strong>1. Project Creation:</strong></blockquote><p>We have created a new project named <strong>GCPtask</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e6Rc80o3a50B5CcViEN0Kw.jpeg" /></figure><blockquote><strong>2. Creation of the two VPC networks</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/550/1*67Jkf7NNGA3y591aNzI6Qw.jpeg" /></figure><blockquote><strong><em>What is VPC?</em></strong></blockquote><p>Virtual Private Cloud (VPC) enables us to launch resources into a virtual network that you’ve defined. It resembles a traditional network that you’d operate in your own data center, along with the benefits of GCP. We do not require to use public internet and can use the private network of GCP for performing tasks.</p><blockquote>Created two VPC networks — <strong>vpcwp ( For Wordpress) </strong>and<strong> vpcdb ( For database).</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MJoUU8wCPmglPtunF3aYDg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-CZO_YwsiH5xdJHiku4bbw.jpeg" /></figure><blockquote>We can see both the VPC networks on the dashboard</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*niFrF68q_Gwg3t_iaFd3gQ.jpeg" /></figure><blockquote><strong>3. VPC Peering</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*G9LmAKDgvR-_rCxzO4RKsw.jpeg" /></figure><blockquote><strong>What is VPC Peering?</strong></blockquote><p>Creating a connection between different VPC is known as VPC Peering in simple terms. It allows internal IP connectivity across two VPC networks regardless of whether they belong to the same project or the same organization.</p><blockquote><strong>NOTE:</strong> VPC Peering has to be established from both the sides ( both the networks).</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*5a03rRikqPyaX5YshuRA9Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/885/1*VSM8RhFU7fRrrw2nWHTDLQ.jpeg" /></figure><p>We can see the connection has been established from both the sides and is active( In case any one of them is being displayed as inactive, that means the two-way connection has not been done)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-4x0uVDqamVF7uEiqH3y1A.jpeg" /></figure><blockquote><strong>4. Kubernetes Cluster</strong></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*bMqDCOICRhWB__4KWuWvGQ.jpeg" /></figure><blockquote><strong>What is Kubernetes?</strong></blockquote><p>Kubernetes is basically a management tool for containers <strong>( Docker, Podman, Crio etc)</strong> . Some requirements can be solved by different containers. But what if due to some reason the environment goes down? We can’t monitor it manually. We need some intelligent tool for this. Kubernetes does that. It does <strong>auto-scaling</strong> and also has inbuilt <strong>load balancers</strong>. Some of the terms related to it:</p><p><strong>→ Node: </strong>Kubernetes runs your workload by placing containers into Pods to run on <em>Nodes</em>. A node may be a virtual or physical machine, depending on the cluster. Each node contains the services necessary to run <a href="https://kubernetes.io/docs/concepts/workloads/pods/">p</a>ods, managed by the control plane. <strong>Kubernetes</strong> is a <strong>master</strong>-<strong>slave</strong> type of architecture with certain components.</p><p><strong>→Pod: </strong>A pod is a collection of containers and its storage inside a node of Kubernetes cluster. Each pod in Kubernetes is assigned a unique <em>Pod IP address </em>within the cluster, which allows applications to use ports without the risk of conflict</p><p>We have created a Kubernetes cluster using <strong>GKE ( Google Kubernetes Engine)</strong></p><p>We have specified the number of nodes we want in each zone</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rP8LNmUiPDsgoIelJYX0jQ.jpeg" /></figure><p>The architecture of our node image</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rxBLtB02t6G5hFVjfK3Wpg.jpeg" /></figure><blockquote>We can have two types of location/center: <strong>Zonal</strong> ( launches all nodes in one zone) and <strong>Regional</strong> ( distributes among different zones)</blockquote><p>We have used regional locations</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5UhE8y0RlkZjh63ojBtZng.jpeg" /></figure><p>We have created our cluster in the <strong>vpcwp </strong>network as we plan to launch WordPress here.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Ew7k9bvtzYmacdxt8ekwA.jpeg" /></figure><p>We can see our cluster has been created and the three instances have been launched:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9etbKxydwwJdBomLnSdJ1Q.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*W1FywAzD5vtFxDPD7iNXKQ.jpeg" /></figure><blockquote><strong>Launch Wordpress on the top of Kubernetes cluster</strong></blockquote><p>We need to connect to the cluster using the <strong>Google Cloud Shell</strong>. For that, we need to run the following command in the shell.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gs1mOJwafg9ROt4bIkDgfg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p0weO1UcvlVSUhferN1pcQ.jpeg" /></figure><p>We have used the image of Docker and created the deployment for WordPress:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*x4zCZ8fM6KzDSGZ6z0M6Iw.jpeg" /></figure><p>After this, a pod will be created for WordPress. But what if the pod gets deleted or there is high traffic? <strong>Replicas </strong>and <strong>LoadBalancers</strong> are used to handle it:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHPNso7H4rxbgVHbf6liFQ.jpeg" /></figure><p>We can see initially there aren’t any load balancers created on our GCP</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iQwOAR0N-lPe9ouCtNXZPg.jpeg" /></figure><p>But as soon as we expose our pod using LoadBalancer, it is automatically created in GCP. We can give the IP provided by the Load Balancer to our clients to access the site.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZvSMCwHw4j-LMfb-6j5dyg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9poPjRrZKaEqEGUiCqk45w.jpeg" /></figure><blockquote><strong>5. Creating SQL server in another VPC</strong></blockquote><p><strong>Why not just launch our Database server in the node pool using cluster?</strong></p><p>→ We know a database is the most critical part of any business. We will have to manage everything, also keeping high security into consideration. So, instead of that, we can use the managed service by GCP for creating and managing our critical databases. GCP manages everything related to security, resources, scaling etc. We can create our front end using an instance and connect it to the database service.</p><p>Creation of MySQL database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wpt14KGeCNR7w-oVQcogvQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/689/1*zacJCP6ioq4aFooMHSlcJg.jpeg" /></figure><p>In the configuration options, we have connected to the private IP as we want to create it in our <strong>vpcdb</strong> network</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/762/1*pNTOTR1RSM7FagMpC81DZg.jpeg" /></figure><p>Creating a new user and database for our WordPress site:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AgjqQ4JqVrmK6zIPgJRIAg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ajkgMBsKTisy-92BxnfP5g.jpeg" /></figure><p>To connect to our database, we have to run the following command in the shell:</p><blockquote>mysql -h &lt;IP of your database server&gt; -u &lt;username&gt; -p</blockquote><p>Enter the password given for the user, we’ll get the SQL terminal. We can see that for our WordPress database, there are no tables available initially.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*5rUhxs8fQoSvo-JgejRMxg.jpeg" /></figure><blockquote><strong>6. Connecting Database to our site</strong></blockquote><p>Access the WordPress site using the LoadBalancer IP Address.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3-naVtoKzoHhdWI9OhKjrA.jpeg" /></figure><p>Enter the details to connect to the database:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nyFjZCBloQG-i_0-WNBKTA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9AiwkOv5ANF6igvGWR_ZZg.jpeg" /></figure><p>The MySQL database has been attached now. We can use WordPress to create our blogs!!!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OVjxPUCmAeXT_6YDR-SHsA.jpeg" /></figure><p>ALso, if we now check our database, a table would have been created:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*GxHcu6xGiDmD-5OOk_nFmw.jpeg" /></figure><p>Thank you!</p><p>For any queries, <a href="https://www.linkedin.com/in/megha-bansal-8aa76996/">connect with me on Linkedln</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ee0e25f89ad6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/deployment-of-wordpress-on-google-cloud-platform-gcp-with-vpc-and-kubernetes-integration-ee0e25f89ad6">Deployment of WordPress on Google Cloud Platform ( GCP) with VPC and Kubernetes Integration</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Task 1- GitHub, Jenkins, and Docker Integration]]></title>
            <link>https://medium.com/analytics-vidhya/task-1-github-jenkins-and-docker-integration-d3b7c1d60bb6?source=rss-3fe921b319da------2</link>
            <guid isPermaLink="false">https://medium.com/p/d3b7c1d60bb6</guid>
            <category><![CDATA[jenkins]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[docker]]></category>
            <category><![CDATA[devops]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Megha Bansal]]></dc:creator>
            <pubDate>Fri, 28 Aug 2020 09:27:03 GMT</pubDate>
            <atom:updated>2020-08-31T07:57:19.269Z</atom:updated>
            <content:encoded><![CDATA[<h3>GitHub, Jenkins, and Docker Integration</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*92_WEfTqaa9e5dqs" /></figure><ul><li>The industry is moving towards automating everything. This article in about integrating our <strong>GitHub</strong> repository with <strong>Jenkins</strong> and using containers ( <strong>Docker</strong>) to deploy web pages ( Using httpd image)</li><li>We have to create a master branch and a developer branch in a new repository in GitHub.</li><li>Then we have to create 3 jobs in Jenkins:</li></ul><blockquote><strong>JOB 1:</strong></blockquote><p>If Developer pushes to developer branch then Jenkins will fetch from developer branch and deploy the website on the developer-docker environment ( <strong>Testing environment)</strong></p><blockquote><strong>JOB 2:</strong></blockquote><p>If Developer pushes to master branch then Jenkins will fetch from the master branch and deploy on the master-docker environment ( <strong>Production environment</strong>) and use ngrok ( tunnel ) to connect to the world.</p><blockquote><strong>JOB 3:</strong></blockquote><p>This is the job managed by the <strong>Quality Assurance team</strong>. If the site is correct and meets the requirements, this job would be executed. It will go to GitHub, merge the developer branch with the master branch, and trigger JOB 2.</p><blockquote><strong>PREREQUISITES:</strong></blockquote><ul><li><strong>Linux</strong></li><li><strong>Git Bash</strong></li><li><strong>GitHub</strong></li><li><strong>Docker — CE</strong></li><li><strong>Jenkins</strong></li><li><strong>Browser</strong></li></ul><blockquote><strong>STEPS:</strong></blockquote><p>1) A repository is created locally with 2 branches- <strong>Master </strong>and <strong>Developer </strong>and the website content has been added.</p><p>2) Jenkins has been installed in our Redhat8 system. We have to start its service.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*2YY-UpwB4Yyt7d6K" /></figure><p>Jenkins provides us with a UI to use it easily which can be accessed from the browser using the IP address of our RedHat system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zmfud_DaJsf43b0y" /></figure><p><strong>3) JOB 1:</strong></p><p>This job will download and copy the file from GitHhub in redhat to the specified folder , and will launch the docker OS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*V4L13VG5VSTAuRcU" /></figure><p>Code written for launching docker OS:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pk9U228L87o-vVWN" /></figure><p><strong>4) JOB3:</strong></p><p>The QAT(Quality Assurance Team) will check the code and if it doesn’t pass the requirements then this will not be merged with the master branch. Else, it will be merged and trigger job2</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*SIp011fykH4_lcz7" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*5Lwc7TDdXDoNF_3d" /></figure><p><strong>5) JOB2:</strong></p><p>If Developer pushes to master branch then Jenkins will fetch from the master branch and deploy on the Production environment. ( Both the testing and production environment is in different docker container)</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x5zSJ2xc4QlVnCk5" /></figure><p>Code written for launching docker env:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-mO2HA2hOxHrq8F7" /></figure><p>Finally, we create a tunnel using ./ngrok and visit our deployed web page</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*WGK6slLzXEar-RG1" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*0V2yDqS_kHloBE_f" /></figure><p>For any queries, <a href="https://www.linkedin.com/in/megha-bansal-8aa76996/">connect with me on Linkedln</a>.</p><h3>Published By</h3><p><em>Originally published at </em><a href="https://www.linkedin.com/pulse/task-1-github-jenkins-docker-integration-megha-bansal/"><em>https://www.linkedin.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d3b7c1d60bb6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/task-1-github-jenkins-and-docker-integration-d3b7c1d60bb6">Task 1- GitHub, Jenkins, and Docker Integration</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Face recognition using Transfer learning and VGG16]]></title>
            <link>https://medium.com/analytics-vidhya/face-recognition-using-transfer-learning-and-vgg16-cf4de57b9154?source=rss-3fe921b319da------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf4de57b9154</guid>
            <category><![CDATA[convolutional-network]]></category>
            <category><![CDATA[keras]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[transfer-learning]]></category>
            <dc:creator><![CDATA[Megha Bansal]]></dc:creator>
            <pubDate>Wed, 26 Aug 2020 18:37:45 GMT</pubDate>
            <atom:updated>2020-08-31T07:56:25.560Z</atom:updated>
            <content:encoded><![CDATA[<p>Transfer learning is a method of reusing a pre-trained model knowledge for another task. It can be used for classification, regression and clustering problems. It is a long process to collect related training data and rebuild the models. In such cases, Transferring of Knowledge or transfer learning from disparate domains would be desirable.</p><h3>What is VGG16?</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*vczqmHklozzgLpZxKAZEjw.jpeg" /></figure><p>VGG is a Convolutional Neural Network architecture, It was proposed by <a href="http://www.robots.ox.ac.uk/~karen/">Karen Simonyan</a> and <a href="https://en.wikipedia.org/wiki/Andrew_Zisserman">Andrew Zisserman </a>of <a href="https://en.wikipedia.org/wiki/Oxford_Robotics_Institute">Oxford Robotics Institute</a> in the year 2014. It was submitted to Large Scale Visual Recognition Challenge 2014 (ILSVRC2014) and The model achieves 92.7% top-5 test accuracy in ImageNet (dataset).</p><ul><li>The first and second convolutional layers are comprised of 64 feature kernel filters and size of the filter is 3×3. As input image (RGB image with depth 3) passed into first and second convolutional layer, dimensions changes to 224x224x64. Then the resulting output is passed to max pooling layer with a stride of 2.</li><li>The third and fourth convolutional layers are of 124 feature kernel filters and size of filter is 3×3. These two layers are followed by a max pooling layer with stride 2 and the resulting output will be reduced to 56x56x128.</li><li>The fifth, sixth and seventh layers are convolutional layers with kernel size 3×3. All three use 256 feature maps. These layers are followed by a max pooling layer with stride 2.</li><li>Eighth to thirteen are two sets of convolutional layers with kernel size 3×3. All these sets of convolutional layers have 512 kernel filters. These layers are followed by max pooling layer with stride of 1.</li><li>Fourteen and fifteen layers are fully connected hidden layers of 4096 units followed by a softmax output layer (Sixteenth layer) of 1000 units.</li></ul><h3>Transfer Learning Using VGG16</h3><p>We can add one more layer or retrain the last layer to extract the main features of our image. We can also give the weight of VGG16 and train again, instead of using random weight <strong>(Fine Tuning). </strong>Here in this task, we have to do face recognition using transfer learning for the model training. We will use pre-defined weights and will freeze the upper layers or the input layers and will use them as they have weights.</p><p>I have used <a href="https://research.google.com/colaboratory/faq.html">Google Colab</a> for training this model.</p><ol><li>Keras.applications with TensorFlow as the backend is used for importing the vgg16 model and its weights. include_top is set to False so that the output layer is not included. Otherwise, we will not be able to add one more fully connected layer after it. Then we freeze all the layers.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*1_xdj14EfJQoBsuB" /></figure><p>2) We append new layers with the previous model and print the entire structure of our model by model.summary()</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*oJ3JcXNTKYIB3Pom" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*_J5Hhh3-ZGMREMBV" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Xxmz2t4fWm6h64G2" /></figure><p>3)I have mounted Google drive to colab to import the image dataset to be used for training and prediction.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Lhqo0M2IaS1-avDg" /></figure><p>4) Importing training images and this will tell us the number of images and classes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*O1et3zv8riKqoS-_" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*c54MkjsQED7n_0Mm" /></figure><p>5)Training our layers again to build the vgg model using transfer learning. Then save the model as face recognisation.h5</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*HOH3X7aBKHmZFHcq" /></figure><p>6)Loading our model and using it to recognize faces:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*wekLiFMLcOqrTO-q" /></figure><p>Output:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*yYs2bfR0q-rzxN87" /></figure><p>For complete code please visit <a href="https://github.com/megha1906/TransferLearning-using-VGG16">https://github.com/megha1906/TransferLearning-using-VGG16</a></p><p>Thankyou!</p><p>For any queries, <a href="https://www.linkedin.com/in/megha-bansal-8aa76996/">connect with me on Linkedln</a>.</p><h3>Published By</h3><p><em>Originally published at </em><a href="https://www.linkedin.com/pulse/face-recognition-using-transfer-learning-vgg16-megha-bansal/"><em>https://www.linkedin.com</em></a><em>.</em></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf4de57b9154" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/face-recognition-using-transfer-learning-and-vgg16-cf4de57b9154">Face recognition using Transfer learning and VGG16</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>