<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: shiv </title>
    <description>The latest articles on Forem by shiv  (@shivdevops).</description>
    <link>https://forem.com/shivdevops</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F388172%2F962e3e33-0fad-4763-8b08-43aa62387354.jpg</url>
      <title>Forem: shiv </title>
      <link>https://forem.com/shivdevops</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/shivdevops"/>
    <language>en</language>
    <item>
      <title>GMAIL SSMTP MAIL SERVER INSTALLATION SHELL SCRIPT FOR UBUNTU </title>
      <dc:creator>shiv </dc:creator>
      <pubDate>Sat, 22 Aug 2020 05:22:50 +0000</pubDate>
      <link>https://forem.com/shivdevops/gmail-ssmtp-mail-server-installation-shell-script-afk</link>
      <guid>https://forem.com/shivdevops/gmail-ssmtp-mail-server-installation-shell-script-afk</guid>
      <description>&lt;p&gt;A Simple Gmail SSMTP(Secure Simple Mail Transfer Protocol) fully automated installation shell script for all Ubuntu versions.SSMTP can be used only for sending mails alone.It doesn't has any features life receiving mails,drafts etc. &lt;/p&gt;

&lt;p&gt;Updating the system&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   apt update -y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Installing mailutils&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   apt-get install mailutils -y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Installing smtp mail server&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   apt-get install ssmtp -y
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Gets the mail id for mailing purposes, Which is the sender mail address and from this mail id mails will be sent ,Stores in ssmtp.conf file&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; echo -n  "provide your email id:" 
 read  mail
 echo "AuthUser=$mail" &amp;gt;&amp;gt; /etc/ssmtp/ssmtp.conf 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Gets the respective mail password for mailing purposes.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; echo -n "Provide your email password:"
 read  password;
 echo "AuthPass=$password" &amp;gt;&amp;gt; /etc/ssmtp/ssmtp.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Some configurations will be updated in-order to do a secure mail transfer.587 ssmtp port.&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo "mailhub=smtp.gmail.com:587" &amp;gt;&amp;gt; /etc/ssmtp/ssmtp.conf
echo "UseSTARTTLS=YES" &amp;gt;&amp;gt; /etc/ssmtp/ssmtp.conf
echo "FromLineOverride=YES" &amp;gt;&amp;gt; /etc/ssmtp/ssmtp.conf
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/shivdevops/GMAIL-SSMTP-MAIL-SERVER-INSTALLATION-SHELL-SCRIPT"&gt;SSMTP Fully Automated Installation Shell Script Available in Github&lt;/a&gt;&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>ssmtp</category>
      <category>gmail</category>
      <category>mailserver</category>
    </item>
    <item>
      <title>Install Google Keep Notes On Ubuntu 20.04 </title>
      <dc:creator>shiv </dc:creator>
      <pubDate>Wed, 29 Jul 2020 09:27:59 +0000</pubDate>
      <link>https://forem.com/shivdevops/install-google-keep-notes-in-ubuntu-20-04-2jjp</link>
      <guid>https://forem.com/shivdevops/install-google-keep-notes-in-ubuntu-20-04-2jjp</guid>
      <description>&lt;p&gt;&lt;strong&gt;Install Google Keep Notes In Ubuntu 20.04&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To Install Google keep first need to install Google chrome.&lt;/p&gt;

&lt;p&gt;1.Downloading Google Chrome:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;2.Installing Google Chrome:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt; sudo apt install ./google-chrome-stable_current_amd64.deb
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;3.Open Chrome browser Use this link: &lt;a href="https://chrome.google.com/webstore/detail/google-keep-notes-and-lis/hmjkmjkepdijhoojdojkdfohbdgmmhki?hl=en"&gt;Google Keep for Ubuntu&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Google Keep - Notes and Lists Page will be opened.Select Add Button.&lt;/p&gt;

&lt;p&gt;4.Once you installed this app, type &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     chrome://apps/ 
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;in Google chrome address bar to go to the Chrome Apps page.&lt;/p&gt;

&lt;p&gt;There you’ll see a list of app shortcuts including Google Keep. Right-click on the icon and select "Create Shortcuts…"&lt;/p&gt;

</description>
      <category>ubuntu</category>
      <category>google</category>
      <category>linux</category>
      <category>notes</category>
    </item>
    <item>
      <title>RELATIONAL OPERATORS OF WHILE LOOP IN LINUX/UNIX SHELL SCRIPT</title>
      <dc:creator>shiv </dc:creator>
      <pubDate>Thu, 23 Jul 2020 16:48:36 +0000</pubDate>
      <link>https://forem.com/shivdevops/relational-operators-of-while-loop-in-linux-unix-shel-script-1mam</link>
      <guid>https://forem.com/shivdevops/relational-operators-of-while-loop-in-linux-unix-shel-script-1mam</guid>
      <description>&lt;h1&gt;
  
  
  Unix / Linux - Shell Relational Operators:
&lt;/h1&gt;

&lt;p&gt;Relational operators that are  purely supports numeric values.It does not support any other strings etc.&lt;/p&gt;

&lt;h4&gt;
  
  
  1. -eq operator
&lt;/h4&gt;

&lt;p&gt;compares whether the value of two operands are equal or not.If true then -eq operator becomes true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;#!/bin/sh&lt;br&gt;
a=30&lt;br&gt;
b=30&lt;/p&gt;

&lt;p&gt;if [ $a -eq $b ]&lt;br&gt;
then&lt;br&gt;
   echo "$a -eq $b : a is equal to b"&lt;br&gt;
else&lt;br&gt;
   echo "$a -eq $b: a is not equal to b"&lt;br&gt;
fi&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;30 -eq 30: a is equal to b&lt;/p&gt;

&lt;h4&gt;
  
  
  2. -ne operator
&lt;/h4&gt;

&lt;p&gt;Compares whether the value of two operands are not equal or not.If true,then -ne operator becomes true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;#!/bin/sh&lt;br&gt;
a=30&lt;br&gt;
b=50&lt;/p&gt;

&lt;p&gt;if [ $a -ne $b ]&lt;br&gt;
then&lt;br&gt;
   echo "$a -ne $b: a is not equal to b"&lt;br&gt;
else&lt;br&gt;
   echo "$a -ne $b : a is equal to b"&lt;br&gt;
fi&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;30 -ne 50: a is not equal to b&lt;/p&gt;

&lt;h4&gt;
  
  
  3. -gt operator
&lt;/h4&gt;

&lt;p&gt;Compares whether the value of left operand is greater than the value of right operand.If true,then -gt operator becomes true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;#!/bin/sh&lt;br&gt;
a=60&lt;br&gt;
b=30&lt;/p&gt;

&lt;p&gt;if [ $a -gt $b ]&lt;br&gt;
then&lt;br&gt;
   echo "$a -gt $b: a is greater than b"&lt;br&gt;
else&lt;br&gt;
   echo "$a -gt $b: a is not greater than b"&lt;br&gt;
fi&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;60 -gt 30: a is greater than b&lt;/p&gt;

&lt;h4&gt;
  
  
  4. -lt operator
&lt;/h4&gt;

&lt;p&gt;Compares whether the value of left operand is less than the value of right operand.If true, then -lt operator becomes true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;#!/bin/sh&lt;br&gt;
a=40&lt;br&gt;
b=70&lt;/p&gt;

&lt;p&gt;if [ $a -lt $b ]&lt;br&gt;
then&lt;br&gt;
   echo "$a -lt $b: a is less than b"&lt;br&gt;
else&lt;br&gt;
   echo "$a -lt $b: a is not less than b"&lt;br&gt;
fi&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;40 -lt 70: a is less than b&lt;/p&gt;

&lt;h4&gt;
  
  
  5. -ge operator
&lt;/h4&gt;

&lt;p&gt;Compares whether the value of left operand is greater than or equal to the value of right operand.If True, then -ge operator becomes true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;#!/bin/sh&lt;br&gt;
a=50&lt;br&gt;
b=20&lt;/p&gt;

&lt;p&gt;if [ $a -ge $b ]&lt;br&gt;
then&lt;br&gt;
   echo "$a -ge $b: a is greater or  equal to b"&lt;br&gt;
else&lt;br&gt;
   echo "$a -ge $b: a is not greater or equal to b"&lt;br&gt;
fi&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;50 -ge 20: a is greater or equal to b&lt;/p&gt;

&lt;h4&gt;
  
  
  6. -le operator
&lt;/h4&gt;

&lt;p&gt;Compares whether the value of left operand is less than or equal to the value of right operand.If true, then the it becomes true.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Example:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;#!/bin/sh&lt;br&gt;
a=40&lt;br&gt;
b=40&lt;/p&gt;

&lt;p&gt;if [ $a -le $b ]&lt;br&gt;
then&lt;br&gt;
   echo "$a -le $b: a is less or  equal to b"&lt;br&gt;
else&lt;br&gt;
   echo "$a -le $b: a is not less or equal to b"&lt;br&gt;
fi&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;40 -le 40: a is less or  equal to b&lt;/p&gt;

</description>
      <category>linux</category>
      <category>uubuntu</category>
      <category>bash</category>
    </item>
    <item>
      <title>DOCKER INSTALLATION SHELL SCRIPT </title>
      <dc:creator>shiv </dc:creator>
      <pubDate>Tue, 21 Jul 2020 12:54:58 +0000</pubDate>
      <link>https://forem.com/shivdevops/docker-installation-shell-script-4h6g</link>
      <guid>https://forem.com/shivdevops/docker-installation-shell-script-4h6g</guid>
      <description>&lt;h1&gt;
  
  
  !/bin/bash
&lt;/h1&gt;

&lt;p&gt;Checks whether docker installed or not:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   if [ ! -x /var/lib/docker ]; then
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;echo "INSTALLING docker"&lt;/p&gt;

&lt;p&gt;Installing software dependencies:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     echo "Y" | apt install apt-transport-https ca-certificates curl software-properties-common
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Adding the Docker key in repository:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -

    add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Updating the system:   &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    echo "Y" | apt update
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Installing Docker:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    apt-cache policy docker-ce

    echo "Y" | sudo apt install docker-ce

     echo "docker successfully installed"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Shows message if docker already installed during initial check:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  else
   echo "DOCKER ALREADY INSTALLED"
   fi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/shivdevops/DOCKER-INSTALLATION-SHELL-SCRIPT"&gt;Installation Shell Script for Docker Available in Github Repo&lt;/a&gt; &lt;/p&gt;

</description>
      <category>linux</category>
      <category>ubuntu</category>
      <category>docker</category>
      <category>shellscript</category>
    </item>
    <item>
      <title>INSTALLATION SHELL SCRIPT PHP COMPOSER</title>
      <dc:creator>shiv </dc:creator>
      <pubDate>Mon, 20 Jul 2020 11:40:45 +0000</pubDate>
      <link>https://forem.com/shivdevops/installation-shell-script-php-composer-3l7k</link>
      <guid>https://forem.com/shivdevops/installation-shell-script-php-composer-3l7k</guid>
      <description>&lt;h1&gt;
  
  
  !/bin/bash
&lt;/h1&gt;

&lt;p&gt;Check wether composer installed or not:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  if [ ! -x /usr/local/bin/composer ]; then
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;echo "INSTALLING composer"&lt;/p&gt;

&lt;p&gt;Checks the current php version &amp;amp; Install the dependencies:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    CURRENT=$(php -v | head -n 1 | cut -d " " -f 2 | cut -f1-2 -d".")

echo "Y" | apt install curl php$CURRENT-cli php$CURRENT-mbstring git unzip
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Change the path to tilde directory &amp;amp; Downloads the composer setup file:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;     cd ~

curl -sS https://getcomposer.org/installer -o composer-setup.php
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;It gets SHA384 composer value:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    HASH=$(curl https://composer.github.io/installer.sig | awk '{print $1}')
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Preparing composer installation setup:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    php -r "if (hash_file('SHA384', 'composer-setup.php') === '$HASH') { echo 'Installer verified'; } else { echo 'Installer corrupt'; unlink('composer-setup.php'); } echo PHP_EOL;"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Installing Composer:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;php composer-setup.php --install-dir=/usr/local/bin --filename=composer
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Removes the downloaded setup file:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rm -rf ~/composer-setup.php
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Message showing successfully installed:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;   echo "SUCESSFULLY INSTALLED composer"
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;During Initial check if composer installed already it shows message:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    else
echo "ALREAY INSTALLED composer"
    fi
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;a href="https://github.com/shivdevops/PHP-COMPOSER-INSTALLATION"&gt;Installation shell script for php-composer available in github repo&lt;/a&gt; &lt;/p&gt;

</description>
      <category>linux</category>
      <category>php</category>
      <category>composer</category>
      <category>shellscript</category>
    </item>
    <item>
      <title>REMOVE COMMANDS IN DOCKER</title>
      <dc:creator>shiv </dc:creator>
      <pubDate>Mon, 20 Jul 2020 10:41:43 +0000</pubDate>
      <link>https://forem.com/shivdevops/remove-commands-in-docker-3j92</link>
      <guid>https://forem.com/shivdevops/remove-commands-in-docker-3j92</guid>
      <description>&lt;p&gt;&lt;strong&gt;Removing the Every Unused:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To remove all stopped containers, dangling images, and unused networks:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;         docker system prune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;But above command doesn't remove the unused volumes.To Remove unused volume:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       docker system prune --volumes
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Removing the Docker Container:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;To remove all stopped containers &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;          docker container prune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;To Stop and Remove all Containers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Stop's All Containers&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;  docker container stop $(docker container ls -aq)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Remove's All Stopped Containers &lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    docker container rm $(docker container ls -aq)
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Removing All Images:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Removes all Dangling Images:&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       docker image prune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Removes all Unused Images&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;      docker image prune -a
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Removing All Unused Volumes:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;       docker volume prune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;Removing all unused network:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight"&gt;&lt;pre class="highlight plaintext"&gt;&lt;code&gt;    docker network prune
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

</description>
      <category>docker</category>
      <category>linux</category>
      <category>ubuntu</category>
      <category>ios</category>
    </item>
  </channel>
</rss>
