<?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"><channel><title><![CDATA[Shell Scripting]]></title><description><![CDATA[Shell Scripting]]></description><link>https://devopsinsights.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Wed, 14 Oct 2026 10:40:44 GMT</lastBuildDate><atom:link href="https://devopsinsights.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Learning Jenkins on AWS EC2]]></title><description><![CDATA[I have followed the steps below to achieve a fully functional Jenkins setup on an AWS EC2 instance, including Docker configuration as an agent. This guide will help you set up your own CI/CD environment, ready for deploying applications to Kubernetes...]]></description><link>https://devopsinsights.hashnode.dev/learning-jenkins-on-aws-ec2</link><guid isPermaLink="true">https://devopsinsights.hashnode.dev/learning-jenkins-on-aws-ec2</guid><category><![CDATA[ Jenkins, DevOps]]></category><category><![CDATA[Docker]]></category><category><![CDATA[ Abhishek Veeramalla ]]></category><dc:creator><![CDATA[Aakanchha Sharma]]></dc:creator><pubDate>Tue, 05 Nov 2024 05:34:02 GMT</pubDate><content:encoded><![CDATA[<p>I have followed the steps below to achieve a fully functional Jenkins setup on an AWS EC2 instance, including Docker configuration as an agent. This guide will help you set up your own CI/CD environment, ready for deploying applications to Kubernetes and more.</p>
<hr />
<h3 id="heading-installation-on-ec2-instance">Installation on EC2 Instance</h3>
<h4 id="heading-steps-i-followed-to-install-jenkins-on-aws-ec2">Steps I Followed to Install Jenkins on AWS EC2</h4>
<ol>
<li><p><strong>Launch an EC2 Instance on AWS</strong>:</p>
<ul>
<li>I went to the <strong>AWS Console</strong>, navigated to <strong>Instances (running)</strong>, and selected <strong>Launch instances</strong> to create a new EC2 instance.</li>
</ul>
</li>
<li><p><strong>Install Java</strong>:</p>
<ul>
<li><p>Since Jenkins requires Java, I installed Java with the following commands:</p>
<pre><code class="lang-python">  bashCopy codesudo apt update
  sudo apt install openjdk<span class="hljs-number">-11</span>-jre
</code></pre>
</li>
<li><p>I verified the Java installation:</p>
<pre><code class="lang-python">  bashCopy codejava -version
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Install Jenkins</strong>:</p>
<ul>
<li><p>Next, I added Jenkins to the package repository and installed it:</p>
<pre><code class="lang-python">  bashCopy codecurl -fsSL https://pkg.jenkins.io/debian/jenkins.io<span class="hljs-number">-2023.</span>key | sudo tee /usr/share/keyrings/jenkins-keyring.asc &gt; /dev/null
  echo deb [signed-by=/usr/share/keyrings/jenkins-keyring.asc] https://pkg.jenkins.io/debian binary/ | sudo tee /etc/apt/sources.list.d/jenkins.list &gt; /dev/null
  sudo apt-get update
  sudo apt-get install jenkins
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Open Port 8080 on EC2</strong>:</p>
<ul>
<li>To allow external access, I configured the security group to open <strong>port 8080 (TCP)</strong>. This allows Jenkins to be accessed from outside AWS.</li>
</ul>
</li>
<li><p><strong>Access Jenkins</strong>:</p>
<ul>
<li>I accessed Jenkins using the EC2 instance’s public IP at <code>http://&lt;ec2-instance-public-ip&gt;:8080</code>.</li>
</ul>
</li>
<li><p><strong>Login to Jenkins</strong>:</p>
<ul>
<li><p>I retrieved the initial admin password with:</p>
<pre><code class="lang-python">  bashCopy codesudo cat /var/lib/jenkins/secrets/initialAdminPassword
</code></pre>
</li>
<li><p>Then, I logged in to Jenkins and selected <strong>Install suggested plugins</strong>.</p>
</li>
</ul>
</li>
<li><p><strong>Create an Admin User</strong>:</p>
<ul>
<li>I created my first admin user, which is recommended for securing future use cases with this Jenkins instance.</li>
</ul>
</li>
<li><p><strong>Install Docker Pipeline Plugin</strong>:</p>
<ul>
<li>To integrate Docker with Jenkins, I went to <strong>Manage Jenkins &gt; Manage Plugins</strong>, searched for "Docker Pipeline" under the <strong>Available</strong> tab, installed the plugin, and restarted Jenkins.</li>
</ul>
</li>
<li><p><strong>Docker Configuration on EC2</strong>:</p>
<ul>
<li><p>I installed Docker on the instance:</p>
<pre><code class="lang-python">  bashCopy codesudo apt update
  sudo apt install docker.io
</code></pre>
</li>
<li><p>Then, I granted Docker permissions to the Jenkins and Ubuntu users:</p>
<pre><code class="lang-python">  bashCopy codesudo usermod -aG docker jenkins
  sudo usermod -aG docker ubuntu
  systemctl restart docker
</code></pre>
</li>
<li><p>Finally, I restarted Jenkins to complete the Docker configuration: <code>http://&lt;ec2-instance-public-ip&gt;:8080/restart</code></p>
</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-success">Success!</h3>
<p>Following these steps, I set up Jenkins with Docker as an agent on an EC2 instance. You’re now ready to start building and deploying applications with Jenkins on AWS!</p>
]]></content:encoded></item><item><title><![CDATA[How to use AWS CLI]]></title><description><![CDATA[Below are the steps:
(1) Go to your AWs account
(2) In your account click on security credentials.
(3)Get access key and secret access key by clicking on create Access key.
(4) Download and run the AWS CLI MSI installer for Windows (64-bit):
C:\> msi...]]></description><link>https://devopsinsights.hashnode.dev/how-to-use-aws-cli</link><guid isPermaLink="true">https://devopsinsights.hashnode.dev/how-to-use-aws-cli</guid><category><![CDATA[General Programming]]></category><dc:creator><![CDATA[Aakanchha Sharma]]></dc:creator><pubDate>Tue, 25 Jun 2024 05:38:04 GMT</pubDate><content:encoded><![CDATA[<p>Below are the steps:</p>
<p>(1) Go to your AWs account</p>
<p>(2) In your account click on security credentials.</p>
<p>(3)Get access key and secret access key by clicking on create Access key.</p>
<p>(4) Download and run the AWS CLI MSI installer for Windows (64-bit):</p>
<p><code>C:\&gt; msiexec.exe /i</code> <a target="_blank" href="https://awscli.amazonaws.com/AWSCLIV2.msi"><code>https://awscli.amazonaws.com/AWSCLIV2.msi</code></a></p>
<p>(5) Then follow below steps:</p>
<p>C:\Windows\System32&gt; aws configure</p>
<p>AWS Access Key ID [None]:</p>
<p>AWS Secret Access Key [None]:</p>
<p>Default region name [None]:</p>
<p>Default output format [None]:</p>
<p>(6) Now AWS CLI is configured and you can try different commands:</p>
<p><a target="_blank" href="https://docs.aws.amazon.com/cli/latest/reference/">https://docs.aws.amazon.com/cli/latest/reference/</a></p>
<p>(7) Example:</p>
<p>C:\Windows\System32&gt;aws ec2 stop-instances --instance-ids i-0c03b046c021085f1 --region us-east-1</p>
<p>{ "StoppingInstances": [</p>
<p>{ "CurrentState": {</p>
<p>"Code": 64,</p>
<p>"Name": "stopping"</p>
<p>},</p>
<p>"InstanceId": "i-0c03b046c021085f1",</p>
<p>"PreviousState": {</p>
<p>"Code": 16,</p>
<p>"Name": "running"</p>
<p>} } ] }</p>
]]></content:encoded></item><item><title><![CDATA[Mastering the shebang line]]></title><description><![CDATA[In earlier days, in shell scripting sh executable was used in place of bash as well , the reason being most of the operating systems were using sh as a softlink to bash executables but now a days some operating systems like ubuntu uses dash as their ...]]></description><link>https://devopsinsights.hashnode.dev/mastering-the-shebang-line</link><guid isPermaLink="true">https://devopsinsights.hashnode.dev/mastering-the-shebang-line</guid><category><![CDATA[#shellscripting #devops]]></category><dc:creator><![CDATA[Aakanchha Sharma]]></dc:creator><pubDate>Mon, 17 Jun 2024 06:03:04 GMT</pubDate><content:encoded><![CDATA[<p>In earlier days, in shell scripting sh executable was used in place of bash as well , the reason being most of the operating systems were using sh as a softlink to bash executables but now a days some operating systems like ubuntu uses dash as their default executables, so it is advised to use the specific executables for your script file instead of relying to earlier writing practice.</p>
<p>#!/bin/sh</p>
<p>#!/bin/bash</p>
<p>#!/bin/dash</p>
<p>#! is termed as shebang or bang.</p>
]]></content:encoded></item></channel></rss>