<?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: Sadhan Sarker</title>
    <description>The latest articles on Forem by Sadhan Sarker (@mesadhan).</description>
    <link>https://forem.com/mesadhan</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%2F121595%2Fb8ec5c2b-19fc-4bbb-8b9c-1bdb7269f670.jpg</url>
      <title>Forem: Sadhan Sarker</title>
      <link>https://forem.com/mesadhan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/mesadhan"/>
    <language>en</language>
    <item>
      <title>Monitoring Cronjobs in GKE</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Wed, 05 Apr 2023 18:57:20 +0000</pubDate>
      <link>https://forem.com/mesadhan/monitoring-cronjobs-in-gke-h7j</link>
      <guid>https://forem.com/mesadhan/monitoring-cronjobs-in-gke-h7j</guid>
      <description>&lt;p&gt;The article discusses the importance of monitoring cronjobs in Google Kubernetes Engine (GKE). Cronjobs are time-based tasks that run periodically in a Kubernetes cluster, and it's essential to monitor them to ensure they are running as expected and to identify any issues or errors. The article provides insights into how to set up monitoring for cronjobs using various tools. By monitoring cronjobs, developers can proactively identify and fix issues, prevent downtime, and ensure the reliability of their GKE applications.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ kubectl cluster-info&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;vi job.yaml&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Input:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;apiVersion: batch/v1
kind: Job
metadata:
  name: helloworld
spec:
  template:
    spec:
      containers:
      - name: busybox
        image: busybox
        command: ["echo", "Hello Kubernetes!!!"]
      restartPolicy: Never
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now hit this command to create job&lt;/p&gt;

&lt;p&gt;&lt;code&gt;$ kubeclt create -f job.yaml&lt;/code&gt;&lt;/p&gt;

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

&lt;p&gt;&lt;code&gt;job.batch/helloworld created&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Now hit this command to watch all&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ watch kubectl get all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Every 2.0s: kubectl get all                                                                                                                      cs-6000-devshell-vm-0c4755a8-b531-4460-b60e-1fb2786e220b: Sat Jul  4 14:52:47 2020
NAME                   READY   STATUS      RESTARTS   AGE
pod/helloworld-dfr2k   0/1     Completed   0          4m25s
NAME                 TYPE        CLUSTER-IP   EXTERNAL-IP   PORT(S)   AGE
service/kubernetes   ClusterIP   10.8.0.1     &amp;lt;none&amp;gt;        443/TCP   23m
NAME                   COMPLETIONS   DURATION   AGE
job.batch/helloworld   1/1           2s         4m26s
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kubectl describe job helloworld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;lab_aa43f292201f@cloudshell:~ (lab-gcp)$ kubectl describe job helloworld
Name:           helloworld
Namespace:      default
Selector:       controller-uid=1e48440c-bdd3-11ea-85d1-42010a8000e4
Labels:         controller-uid=1e48440c-bdd3-11ea-85d1-42010a8000e4
               job-name=helloworld
Annotations:    &amp;lt;none&amp;gt;
Parallelism:    1
Completions:    1
Start Time:     Sat, 04 Jul 2020 14:48:23 +0600
Completed At:   Sat, 04 Jul 2020 14:48:25 +0600
Duration:       2s
Pods Statuses:  0 Running / 1 Succeeded / 0 Failed
Pod Template:
 Labels:  controller-uid=1e48440c-bdd3-11ea-85d1-42010a8000e4
          job-name=helloworld
 Containers:
  busybox:
   Image:      busybox
   Port:       &amp;lt;none&amp;gt;
   Host Port:  &amp;lt;none&amp;gt;
   Command:
     echo
     Hello Kubernetes!!!
   Environment:  &amp;lt;none&amp;gt;
   Mounts:       &amp;lt;none&amp;gt;
 Volumes:        &amp;lt;none&amp;gt;
Events:
 Type    Reason            Age    From            Message
 ----    ------            ----   ----            -------
 Normal  SuccessfulCreate  7m22s  job-controller  Created pod: helloworld-dfr2k
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Finally, to delete hit&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ kubectl delete job helloworld
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;student_02_aa43f292201f@cloudshell:~ (labs-gcp-b17e65df)$ kubectl delete job helloworld
job.batch "helloworld" deleted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Congratulations
&lt;/h2&gt;

&lt;p&gt;I hope we learn something exciting about gRPC framework. Thanks for time &amp;amp; passion. Feel free to ask me anything.&lt;/p&gt;

&lt;p&gt;Say Hi to me on &lt;a href="https://twitter.com/eng_sadhan"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/csesadhan/"&gt;Linkedin&lt;/a&gt;, and &lt;a href="https://medium.com/@csesadhan"&gt;Medium&lt;/a&gt; where I keep on sharing interesting updates.&lt;/p&gt;

</description>
      <category>gke</category>
      <category>gcp</category>
      <category>cronjobs</category>
      <category>kubernetes</category>
    </item>
    <item>
      <title>Install Nexus Repository Manager in Linux Centos7, Deploy and Use 'artifacts</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Mon, 01 Aug 2022 10:58:00 +0000</pubDate>
      <link>https://forem.com/mesadhan/install-nexus-repository-manager-linux-in-centos7-deploy-and-use-jar-4bge</link>
      <guid>https://forem.com/mesadhan/install-nexus-repository-manager-linux-in-centos7-deploy-and-use-jar-4bge</guid>
      <description>&lt;p&gt;Step 1: Login to your Linux server and update the yum packages. Also install required utilities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yum update &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nb"&gt;install &lt;/span&gt;wget &lt;span class="nt"&gt;-y&lt;/span&gt;
java &lt;span class="nt"&gt;-version&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;yum &lt;span class="nb"&gt;install &lt;/span&gt;java-1.8.0-openjdk.x86_64 &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 2: Download the latest nexus. You can get the latest download links fo for nexus from here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cd&lt;/span&gt; /opt
&lt;span class="nb"&gt;sudo &lt;/span&gt;wget &lt;span class="nt"&gt;-O&lt;/span&gt; latest-unix.tar.gz https://download.sonatype.com/nexus/3/latest-unix.tar.gz
&lt;span class="nb"&gt;tar&lt;/span&gt; &lt;span class="nt"&gt;-xvzf&lt;/span&gt; latest-unix.tar.gz
&lt;span class="nb"&gt;sudo mv &lt;/span&gt;nexus-3&lt;span class="k"&gt;*&lt;/span&gt; nexus
&lt;span class="nb"&gt;mv &lt;/span&gt;sonatype-work nexusdata
&lt;span class="nb"&gt;ls&lt;/span&gt; &lt;span class="nt"&gt;-lh&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Step 3: Set User/Permissions and Configurations&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;useradd &lt;span class="nt"&gt;--system&lt;/span&gt; &lt;span class="nt"&gt;--no-create-home&lt;/span&gt; nexus
&lt;span class="nb"&gt;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; nexus:nexus /opt/nexus
&lt;span class="nb"&gt;chown&lt;/span&gt; &lt;span class="nt"&gt;-R&lt;/span&gt; nexus:nexus /opt/nexusdata
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit &lt;code&gt;/opt/nexus/bin/nexus.vmoptions&lt;/code&gt; file&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi /opt/nexus/bin/nexus.vmoptions
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-Xms2703m
-Xmx2703m
-XX:MaxDirectMemorySize=2703m
-XX:+UnlockDiagnosticVMOptions
-XX:+LogVMOutput
-XX:LogFile=../nexusdata/nexus3/log/jvm.log
-XX:-OmitStackTraceInFastThrow
-Djava.net.preferIPv4Stack=true
-Dkaraf.home=.
-Dkaraf.base=.
-Dkaraf.etc=etc/karaf
-Djava.util.logging.config.file=etc/karaf/java.util.logging.properties
-Dkaraf.data=../nexusdata/nexus3
-Dkaraf.log=../nexusdata/nexus3/log
-Djava.io.tmpdir=../nexusdata/nexus3/tmp
-Dkaraf.startLocalConsole=false
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Edit &lt;code&gt;nexus.rc&lt;/code&gt; file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi /opt/nexus/bin/nexus.rc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Uncomment &lt;code&gt;run_as_user&lt;/code&gt; parameter and add new value.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;run_as_user="nexus"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;We need to modify the &lt;code&gt;nexus-default.properties&lt;/code&gt; file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi /opt/nexus/etc/nexus-default.properties
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Change &lt;code&gt;application-host=0.0.0.0&lt;/code&gt; and port &lt;code&gt;application-host=9081&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Configure the open file limit of the nexus user.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi /etc/security/limits.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Add the below values to the file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nexus - nofile 65536
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Step 4: Set Nexus as a System Service&lt;/p&gt;

&lt;p&gt;Create the Systemd service file in &lt;code&gt;/etc/systemd/system/&lt;/code&gt;.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo vi /etc/systemd/system/nexus.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Add the following contents to the unit file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[Unit]
Description=Nexus Service
After=syslog.target network.target

[Service]
Type=forking
LimitNOFILE=65536
ExecStart=/opt/nexus/bin/nexus start
ExecStop=/opt/nexus/bin/nexus stop
User=nexus
Group=nexus
Restart=on-failure

[Install]
WantedBy=multi-user.target
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Manage Nexus Service, Execute the following command to add nexus service to boot.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;systemctl daemon-reload
systemctl enable nexus.service
systemctl start nexus.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Monitor the log file.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;tail -f /opt/nexusdata/nexus3/log/nexus.log
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Check the running service port.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;netstat -tunlp | grep 9081
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Show default login password.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cat /opt/nexusdata/nexus3/admin.password
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h2&gt;
  
  
  Deploy and Use Artifacts in Spring Boot Project
&lt;/h2&gt;

&lt;p&gt;Create or Edit this &lt;code&gt;~/.m2/settings.xml&lt;/code&gt; file:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;vi ~/.m2/settings.xml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Update contents of the file.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;settings&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://maven.apache.org/SETTINGS/1.2.0"&lt;/span&gt; &lt;span class="na"&gt;xmlns:xsi=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema-instance"&lt;/span&gt;
  &lt;span class="na"&gt;xsi:schemaLocation=&lt;/span&gt;&lt;span class="s"&gt;"http://maven.apache.org/SETTINGS/1.2.0 http://maven.apache.org/xsd/settings-1.2.0.xsd"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="c"&gt;&amp;lt;!--  unblock so that we can download artifacts from nexus repo  --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;mirrors&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;mirror&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;id&amp;gt;&lt;/span&gt;maven-default-http-blocker&lt;span class="nt"&gt;&amp;lt;/id&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;mirrorOf&amp;gt;&lt;/span&gt;dummy&lt;span class="nt"&gt;&amp;lt;/mirrorOf&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;name&amp;gt;&lt;/span&gt;Dummy mirror to override default blocking mirror that blocks http&lt;span class="nt"&gt;&amp;lt;/name&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;url&amp;gt;&lt;/span&gt;http://0.0.0.0/&lt;span class="nt"&gt;&amp;lt;/url&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/mirror&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/mirrors&amp;gt;&lt;/span&gt;


  &lt;span class="c"&gt;&amp;lt;!--nexus server configuration--&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;servers&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;server&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;id&amp;gt;&lt;/span&gt;nexus&lt;span class="nt"&gt;&amp;lt;/id&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;username&amp;gt;&lt;/span&gt;admin&lt;span class="nt"&gt;&amp;lt;/username&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;password&amp;gt;&lt;/span&gt;19e36q29-1e09-42ce-af29-4f74563a7467&lt;span class="nt"&gt;&amp;lt;/password&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/server&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/servers&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/settings&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Deploy jar or artifact to nexus server
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Now create a maven project. Open &lt;code&gt;pom.xml&lt;/code&gt; file, and add this content inside &lt;code&gt;project&lt;/code&gt; tag.
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="cp"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;project&lt;/span&gt; &lt;span class="na"&gt;xmlns=&lt;/span&gt;&lt;span class="s"&gt;"http://maven.apache.org/POM/4.0.0"&lt;/span&gt; &lt;span class="na"&gt;xmlns:xsi=&lt;/span&gt;&lt;span class="s"&gt;"http://www.w3.org/2001/XMLSchema-instance"&lt;/span&gt; &lt;span class="na"&gt;xsi:schemaLocation=&lt;/span&gt;&lt;span class="s"&gt;"http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;

  &lt;span class="c"&gt;&amp;lt;!-- ...other  --&amp;gt;&lt;/span&gt;

  &lt;span class="c"&gt;&amp;lt;!--  deploy libs to nexus repository --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;distributionManagement&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;repository&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;id&amp;gt;&lt;/span&gt;nexus&lt;span class="nt"&gt;&amp;lt;/id&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;url&amp;gt;&lt;/span&gt;http://119.168.0.0:9081/repository/sadhan&lt;span class="nt"&gt;&amp;lt;/url&amp;gt;&lt;/span&gt;
      &lt;span class="c"&gt;&amp;lt;!--&amp;lt;name&amp;gt;Nexus Releases&amp;lt;/name&amp;gt;--&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/repository&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;snapshotRepository&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;id&amp;gt;&lt;/span&gt;nexus&lt;span class="nt"&gt;&amp;lt;/id&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;url&amp;gt;&lt;/span&gt;http://119.168.0.0:9081/repository/sadhan&lt;span class="nt"&gt;&amp;lt;/url&amp;gt;&lt;/span&gt;
      &lt;span class="c"&gt;&amp;lt;!--&amp;lt;name&amp;gt;Nexus Snapshot&amp;lt;/name&amp;gt;--&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/snapshotRepository&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/distributionManagement&amp;gt;&lt;/span&gt;

&lt;span class="nt"&gt;&amp;lt;/project&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now hit the following command to deploy jar to nexus repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn deploy        
mvn deploy &lt;span class="nt"&gt;-e&lt;/span&gt;        
mvn deploy &lt;span class="nt"&gt;-e&lt;/span&gt; release

mvn deploy &lt;span class="nt"&gt;-DaltDeploymentRepository&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nexus::default::http://119.168.0.0:9081/repository/sadhan
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  Use and download jar/artifact from nexus server
&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;Now pull the jar file from nexus repository.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Makes sure &lt;code&gt;~/.m2/setting.xml&lt;/code&gt; file copied properly.&lt;/p&gt;

&lt;p&gt;Now open &lt;code&gt;pom.xml&lt;/code&gt; file and add this upload dependency inside &lt;code&gt;dependencies&lt;/code&gt; tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;dependency&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;groupId&amp;gt;&lt;/span&gt;com.revesoft&lt;span class="nt"&gt;&amp;lt;/groupId&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;artifactId&amp;gt;&lt;/span&gt;olm&lt;span class="nt"&gt;&amp;lt;/artifactId&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;version&amp;gt;&lt;/span&gt;0.0.1&lt;span class="nt"&gt;&amp;lt;/version&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/dependency&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add this below content inside &lt;code&gt;project&lt;/code&gt; tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight xml"&gt;&lt;code&gt;  &lt;span class="c"&gt;&amp;lt;!--to use nexus repositories we need that --&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;repositories&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;repository&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;id&amp;gt;&lt;/span&gt;nexus&lt;span class="nt"&gt;&amp;lt;/id&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;url&amp;gt;&lt;/span&gt;http://119.168.0.0:9081/repository/sadhan/&lt;span class="nt"&gt;&amp;lt;/url&amp;gt;&lt;/span&gt;
      &lt;span class="c"&gt;&amp;lt;!--&amp;lt;name&amp;gt;Nexus Releases&amp;lt;/name&amp;gt;--&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/repository&amp;gt;&lt;/span&gt;
  &lt;span class="nt"&gt;&amp;lt;/repositories&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Using CLI, we can download the jar file from nexus repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;mvn dependency:resolve &lt;span class="nt"&gt;-DremoteRepositories&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;nexus::default::http://119.168.0.0:9081/repository/sadhan 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;Note: Here id nexus is the same as in &lt;code&gt;~/.m2/settings.xml&lt;/code&gt; file. so use same it to download the jar file.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Optional
&lt;/h1&gt;

&lt;p&gt;Upload blob file to nexus repository.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;curl -v --user 'admin:admin123' --upload-file ./test.png http://localhost:9081/repository/documentation/test.png
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Congratulations
&lt;/h2&gt;

&lt;p&gt;I hope we learn something exciting about Nexus. Thanks for time &amp;amp; passion. Feel free to ask me anything.&lt;/p&gt;

&lt;p&gt;Say Hi to me on &lt;a href="https://twitter.com/eng_sadhan"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/csesadhan/"&gt;Linkedin&lt;/a&gt;, and &lt;a href="https://medium.com/@csesadhan"&gt;Medium&lt;/a&gt; where I keep on sharing interesting updates.&lt;/p&gt;

&lt;p&gt;References&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://help.sonatype.com/repomanager3/nexus-repository-administration/formats/maven-repositories"&gt;https://help.sonatype.com/repomanager3/nexus-repository-administration/formats/maven-repositories&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>codenewbie</category>
      <category>webdev</category>
      <category>java</category>
      <category>nexus</category>
    </item>
    <item>
      <title>Up and Running with gRPC</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Tue, 04 Jan 2022 05:00:18 +0000</pubDate>
      <link>https://forem.com/mesadhan/up-and-running-with-grpc-4e6p</link>
      <guid>https://forem.com/mesadhan/up-and-running-with-grpc-4e6p</guid>
      <description>&lt;p&gt;Hello, Today I am going to talk about gRPC.&lt;/p&gt;

&lt;p&gt;A high performance, open source universal RPC framework by google.&lt;/p&gt;

&lt;p&gt;Now its part of the Cloud Foundation (CNCF)&lt;/p&gt;

&lt;h3&gt;
  
  
  Let's Understand RPC!
&lt;/h3&gt;

&lt;p&gt;An RPC is a Remote Procedure Call. Google introduce gRPC, But Common Object Request Broker Architecture (CORBA) had RPC before!&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1dzau45x1dedvgqsiysp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F1dzau45x1dedvgqsiysp.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In this above example, you see right side a server code written any other language and left client code calling server function. Okay, Lets consider server written in python we want to call this function from another language, what we will do we simply create a rest api then call that api using other language client. Now think 🤔 is not it cool? if we could call that function nativity like we call functions. I know that will be amazing using RPC we can do that easily.&lt;/p&gt;

&lt;p&gt;Here is an another example from grpc.io website. You can see gRPC server code is written in C++, and gRPC Stubs Or Clients are written in different languages. Here as Stubs they are using Ruby and Java Android client. Do not worry I will share complete example end of the season.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21nzr4lfgo9w9g80zjbd.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F21nzr4lfgo9w9g80zjbd.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  When we choose gRPC?
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;When we wants to build microservices&lt;/li&gt;
&lt;li&gt;Wants to communicate between cross-languages services&lt;/li&gt;
&lt;li&gt;Planning to build distributed services&lt;/li&gt;
&lt;li&gt;Needs client &amp;amp; server streaming &lt;/li&gt;
&lt;li&gt;Needs Http/2 based transport protocol&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://grpc.io/" rel="noopener noreferrer"&gt;Read more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  gRPC vs REST
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;REST&lt;/strong&gt;&lt;br&gt;
REST uses HTTP/1.1 protocol through the JSON or XML messaging format. Common http verbs like {GET, POST, PUT, DELETE etc}&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;gRPC&lt;/strong&gt;&lt;br&gt;
gRPC uses HTTP/2 protocol through Protocol buffer. Methods {unary, server-streaming, client-streaming and bi-directional call}. It offers language independence support 11 programming languages.&lt;/p&gt;

&lt;h3&gt;
  
  
  gRPC methods/operations
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqfxnjmf153ecdzasb06.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fbqfxnjmf153ecdzasb06.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  What is Protocol Buffer
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Protocol buffer are language language-neutral, platform-neutral extensible mechanism for serializing structured data&lt;/li&gt;
&lt;li&gt;Code generated for any language&lt;/li&gt;
&lt;li&gt;Very convenient for transporting a lot of data&lt;/li&gt;
&lt;li&gt;Data is binary and efficiently serialized (small payloads)&lt;/li&gt;
&lt;li&gt;Support Java, Go, Python, NodeJs, Objective-C, C++ and more with proto3 language version.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://developers.google.com/protocol-buffers" rel="noopener noreferrer"&gt;Read more&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  gRPC vs Rest
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgt7haylwgnqg5kl0yxcu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fgt7haylwgnqg5kl0yxcu.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  Sample gRPC Based Micro-service Architecture
&lt;/h3&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zl24tnet7489lipkztt.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2F3zl24tnet7489lipkztt.png" alt="Image description"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/mesadhan/grpc-codelab" rel="noopener noreferrer"&gt;Complete gRPC server &amp;amp; clients check that Demo Codebase&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Congratulations
&lt;/h2&gt;

&lt;p&gt;I hope we learn something exciting about gRPC framework. Thanks for time &amp;amp; passion. Feel free to ask me anything.&lt;/p&gt;

&lt;p&gt;Say Hi to me on &lt;a href="https://twitter.com/eng_sadhan" rel="noopener noreferrer"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/csesadhan/" rel="noopener noreferrer"&gt;Linkedin&lt;/a&gt;, and &lt;a href="https://medium.com/@csesadhan" rel="noopener noreferrer"&gt;Medium&lt;/a&gt; where I keep on sharing interesting updates.&lt;/p&gt;

</description>
      <category>grpc</category>
      <category>webdev</category>
      <category>node</category>
      <category>go</category>
    </item>
    <item>
      <title>Securing cloud storage files with KMS</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Sun, 05 Jul 2020 02:25:09 +0000</pubDate>
      <link>https://forem.com/mesadhan/securing-cloud-storage-files-with-kms-fhl</link>
      <guid>https://forem.com/mesadhan/securing-cloud-storage-files-with-kms-fhl</guid>
      <description>&lt;p&gt;Cloud Key Management Service (KMS) allows us to create, import &amp;amp; manage cryptographic keys and also perform cryptographic operations in a single centralized cloud service the same way on-premises. By using &lt;a href="https://cloud.google.com/kms"&gt;Cloud KMS&lt;/a&gt;, &lt;a href="https://cloud.google.com/hsm"&gt;Cloud HSM&lt;/a&gt;, or &lt;a href="https://cloud.google.com/kms/docs/ekm"&gt;Cloud External Key Manager&lt;/a&gt; or &lt;a href="https://cloud.google.com/storage/docs/encryption/customer-managed-keys"&gt;Customer-Managed Encryption Keys&lt;/a&gt; (CMEK integrations)  we can encrypt, decrypt, and verify.&lt;/p&gt;

&lt;p&gt;In this post, we are going to deal with &lt;a href="https://cloud.google.com/kms"&gt;Cloud KMS&lt;/a&gt;, &lt;a href="https://cloud.google.com/storage"&gt;Cloud Storage&lt;/a&gt;, &lt;a href="https://cloud.google.com/sdk"&gt;Cloud SDK&lt;/a&gt;. Also, learn about encryption and manage encryption keys using KMS. So, let’s a drive-in. Sign-in to Google Cloud Platform &lt;a href="https://console.cloud.google.com/"&gt;(GCP) Console&lt;/a&gt; and Create a new project and activate our Cloud Shell.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--TVqpQcWT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2i21w0xzae8wcwml1lgy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--TVqpQcWT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/2i21w0xzae8wcwml1lgy.png" alt="Alt Text" width="880" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click &lt;code&gt;Continue&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--I9c-0yd4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9np4zdtt0e7dj5hlqcbf.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--I9c-0yd4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/9np4zdtt0e7dj5hlqcbf.png" alt="Alt Text" width="588" height="266"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a Cloud Storage Bucket
&lt;/h2&gt;

&lt;p&gt;Create Cloud Storage Bucket, we can do that using &lt;a href="https://cloud.google.com/storage/docs/gsutil"&gt;gsutil&lt;/a&gt;, remember bucket names are globally unique. Run the following command in Cloud Shell to set a variable to our bucket name:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;export &lt;/span&gt;&lt;span class="nv"&gt;CLOUD_STORAGE_BUCKET_NAME&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;put_our_unique_bucket_name
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, just hit the following command, to create a new cloud storage bucket,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gsutil mb gs://&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CLOUD_STORAGE_BUCKET_NAME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--lY2H1hub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cdj1yx5cvmts0h5l3ppa.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--lY2H1hub--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/cdj1yx5cvmts0h5l3ppa.jpg" alt="Alt Text" width="880" height="254"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Create a sample data
&lt;/h2&gt;

&lt;p&gt;Create a simple file so that we can encrypt &amp;amp; decrypt that file, Open Cloud Shell and create a new file, Here, I’m using &lt;code&gt;Vim&lt;/code&gt; console-based text editor. If we want, we can download the source file from another location. To create a new file, run the following command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;vi hello.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Input: to insert content press &lt;code&gt;i&lt;/code&gt;,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Hello! From Cloud Storage KMS. We are going to encrypt and decrypt this file using Cloud KMS.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; To save that &lt;code&gt;hello.txt&lt;/code&gt; file press &lt;code&gt;Ctrl+c&lt;/code&gt; and type &lt;code&gt;:wq&lt;/code&gt; . To read that file content hit below commands,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;hello.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Hello! From Cloud Storage KMS. We are going to encrypt and decrypt this file using Cloud KMS.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Enable Cloud KMS Service
&lt;/h2&gt;

&lt;p&gt;Before using Cloud KMS, we must need to enable that service. It could be done from &lt;a href="https://console.cloud.google.com/apis/api/cloudkms.googleapis.com"&gt;Cloud Console UI&lt;/a&gt; and another is from gcloud CLI command. To enable the Cloud KMS Service, run the following command in our Cloud Shell:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud services &lt;span class="nb"&gt;enable &lt;/span&gt;cloudkms.googleapis.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Optional, this only needs to be done once per project&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud services &lt;span class="nb"&gt;enable &lt;/span&gt;cloudkms.googleapis.com &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--project&lt;/span&gt; &lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;GOOGLE_CLOUD_PROJECT&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Create KeyRing and CryptoKey
&lt;/h2&gt;

&lt;p&gt;In order to encrypt &amp;amp; decrypt data, we need to create a KeyRing and a CryptoKey. KeyRings are useful for Grouping keys. To create KeyRing for a global region:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud kms keyrings create &lt;span class="s2"&gt;"our-keyring"&lt;/span&gt; &lt;span class="nt"&gt;--location&lt;/span&gt; &lt;span class="s2"&gt;"global"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: If we want to view that newly created key then &lt;a href="https://console.cloud.google.com/iam-admin/kms"&gt;Open Web UI&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Next, using the new KeyRing, create a CryptoKey&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud kms keys create &lt;span class="s2"&gt;"our-cryptokey"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--location&lt;/span&gt; &lt;span class="s2"&gt;"global"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--keyring&lt;/span&gt; &lt;span class="s2"&gt;"our-keyring"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--purpose&lt;/span&gt; &lt;span class="s2"&gt;"encryption"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From Web UI We can view that Keys,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--yjGufi9S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/21kpbihku3xsvlxg74by.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--yjGufi9S--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/21kpbihku3xsvlxg74by.jpg" alt="Alt Text" width="880" height="764"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Click on &lt;code&gt;our-keyring&lt;/code&gt; then we are able to see &lt;code&gt;our-cryptokey&lt;/code&gt;, which is group together&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--vVcl4LZT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/t1j2wckwvj5vvq7qz34f.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--vVcl4LZT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/t1j2wckwvj5vvq7qz34f.jpg" alt="Alt Text" width="880" height="356"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Encrypt our file
&lt;/h2&gt;

&lt;p&gt;Encrypt the &lt;code&gt;hello.txt&lt;/code&gt; file contents using Cloud KMS. Here, I’m using the gcloud command-line tool. But we can also encrypt data using the &lt;a href="https://cloud.google.com/kms/docs/reference/rest/"&gt;Cloud KMS API&lt;/a&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud kms encrypt &lt;span class="nt"&gt;--location&lt;/span&gt; &lt;span class="s2"&gt;"global"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--keyring&lt;/span&gt; &lt;span class="s2"&gt;"our-keyring"&lt;/span&gt; &lt;span class="nt"&gt;--key&lt;/span&gt; &lt;span class="s2"&gt;"our-cryptokey"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--plaintext-file&lt;/span&gt; ./hello.txt &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--ciphertext-file&lt;/span&gt; ./hello.enc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will create a &lt;code&gt;hello.enc&lt;/code&gt; file which will be encrypted. To open that encrypt file run:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;hello.enc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Output:&lt;/strong&gt; Cloud be like an unreadable hash like “6B!h&amp;gt;X7^RR*IRt;_*b~0IrP1&amp;lt;)]'ǞЉt c”&lt;/p&gt;

&lt;p&gt;Now, we can upload that encrypted file to the Cloud Storage, run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gsutil &lt;span class="nb"&gt;cp&lt;/span&gt; ./hello.enc gs://&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CLOUD_STORAGE_BUCKET_NAME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can view our encrypted file which actually uploaded,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--knz0S6s_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zbkklklcfjunxsnbl6hm.jpg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--knz0S6s_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/zbkklklcfjunxsnbl6hm.jpg" alt="Alt Text" width="880" height="303"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  Decrypt our file
&lt;/h2&gt;

&lt;p&gt;If we want to decrypt that &lt;code&gt;hello.enc&lt;/code&gt;. Or, we have already encrypted data then we can copy that from Cloud Storage bucket by the following command,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gsutil &lt;span class="nb"&gt;cp &lt;/span&gt;gs://&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CLOUD_STORAGE_BUCKET_NAME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;/hello.enc &lt;span class="nb"&gt;.&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: In this case, we don’t have to do that because we already have our &lt;code&gt;hello.enc&lt;/code&gt; file.&lt;/p&gt;

&lt;p&gt;Now, We can decrypt that file by the following command below,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud kms decrypt &lt;span class="nt"&gt;--location&lt;/span&gt; &lt;span class="s2"&gt;"global"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--keyring&lt;/span&gt; &lt;span class="s2"&gt;"our-keyring"&lt;/span&gt; &lt;span class="nt"&gt;--key&lt;/span&gt; &lt;span class="s2"&gt;"our-cryptokey"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--ciphertext-file&lt;/span&gt; ./hello.enc &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--plaintext-file&lt;/span&gt; ./hello-decryped.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To open that &lt;code&gt;hello-decryped.txt&lt;/code&gt; file run following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;cat &lt;/span&gt;hello-decryped.txt
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



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

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;Hello! From Cloud Storage KMS. We are going to encrypt and decrypt this file using Cloud KMS.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Cleanup environment
&lt;/h2&gt;

&lt;p&gt;To delete cloud storage bucket, which we created earlier, run the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gsutil &lt;span class="nb"&gt;rm&lt;/span&gt; &lt;span class="nt"&gt;-r&lt;/span&gt; gs://&lt;span class="k"&gt;${&lt;/span&gt;&lt;span class="nv"&gt;CLOUD_STORAGE_BUCKET_NAME&lt;/span&gt;&lt;span class="k"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Note: Cloud KMS resources can’t be deleted. However, we can destroy that by the following command&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;gcloud kms keys versions destroy &lt;span class="s2"&gt;"1"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--location&lt;/span&gt; &lt;span class="s2"&gt;"global"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--key&lt;/span&gt; &lt;span class="s2"&gt;"our-cryptokey"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
    &lt;span class="nt"&gt;--keyring&lt;/span&gt; &lt;span class="s2"&gt;"our-keyring"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Congratulations
&lt;/h2&gt;

&lt;p&gt;We have successfully encrypted and decrypt data using Cloud KMS and stored encrypted data in Cloud Storage. Thanks for time &amp;amp; passion. Feel free to ask me anything.&lt;/p&gt;

&lt;p&gt;Say Hi to me on &lt;a href="https://twitter.com/eng_sadhan"&gt;Twitter&lt;/a&gt;, &lt;a href="https://www.linkedin.com/in/csesadhan/"&gt;Linkedin&lt;/a&gt;, and &lt;a href="https://medium.com/@csesadhan"&gt;Medium&lt;/a&gt; where I keep on sharing interesting updates.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://medium.com/@csesadhan/securing-cloud-storage-files-with-kms-73d48403cbd5"&gt;Original Post&lt;/a&gt;&lt;/p&gt;

</description>
      <category>gcp</category>
      <category>googlecloud</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Journey to Google Cloud Platform (GCP)</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Tue, 23 Jun 2020 00:50:44 +0000</pubDate>
      <link>https://forem.com/mesadhan/journey-to-google-cloud-platform-gcp-kae</link>
      <guid>https://forem.com/mesadhan/journey-to-google-cloud-platform-gcp-kae</guid>
      <description>&lt;h2&gt;
  
  
  🔰 Overview
&lt;/h2&gt;

&lt;p&gt;Most of us are heard about Amazon Web Services(AWS) and Microsoft Azure, Google Cloud Platform (GCP), and other Cloud Providers. From experience, I found all the cloud providers are offering really competitive services.&lt;/p&gt;

&lt;p&gt;AWS, Azure has a higher market share and popularity rather than GCP. But practically, It's always not necessary to choose one Cloud base on popularity. It depends on the needs. Sometimes, It could be wisher decisions so providers not act like monopolistic.  Cloud provider gives us the ability to make a hybrid cloud, I think that will be another cool option. Today let's make a visit about Google Cloud Platform (GCP)&lt;/p&gt;

&lt;h3&gt;
  
  
  🔰 About Google Cloud Platform
&lt;/h3&gt;

&lt;p&gt;I found Google Cloud is very Developer focused. Google has site reliability engineers (SREs), not only Operations people to manage their services. Generally, I feel GCP built from Dev. sides rather than operations or infrastructure. Other hand AWS built from ops or infra sides rather Dev. GCP feels me Coding first then the tools come later, Other AWS feels DevOps cloud.&lt;/p&gt;

&lt;p&gt;Google is all about Big Data. They have Smart Googlers they develop lots of internal innovation. They published many white-papers and released things as Open source like &lt;code&gt;Kubernetes (K8s)&lt;/code&gt;. Also, they Commercialized their own used services like BigTable, Spanner, GCS, BigQuery, etc. AWS is a more regional basic service, on the other hand Google is intrinsically global.&lt;/p&gt;

&lt;p&gt;I just try to put some constructive view, Other cloud providers give us the ability, but we need to implement those by own.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔰 GCP offering me what? I have no idea about the Cloud!
&lt;/h3&gt;

&lt;p&gt;I'm going to introduce something really helpful and handle to start. I would like to give a short reference so that anyone can start with GCP. Sometimes we need a high-level overview so that we can deep dive into it. It's not about expert or beginner, sometime overview and references help to memorize something in an organized way. You know we all are human so it's really hard to memories everything once. I would like to recommend don't try to memorize everything at a time. When you will have done hands-on later it automatically remembers. Here are those references,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--jHWXThro--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/gregsramblings/google-cloud-4-words/master/DarkPoster-lowres.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--jHWXThro--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://raw.githubusercontent.com/gregsramblings/google-cloud-4-words/master/DarkPoster-lowres.png" alt="The Google Cloud Developer's Cheat Sheet" width="880" height="587"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://github.com/gregsramblings/google-cloud-4-words"&gt;Image Source&lt;/a&gt; | &lt;a href="https://cloud.google.com/products"&gt;If wants to look further, in details about GCP Products &amp;amp; Services.&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If some products and services are complex to understand then don't worry about that cause do not need to expertise on everything at a time. You have to pay for services as needed, you save money and can focus on innovation. &lt;/p&gt;

&lt;h3&gt;
  
  
  🔰 How much it cost? I'm not going to invest money in that!
&lt;/h3&gt;

&lt;p&gt;Yes, it's really important to thought. As a beginner or expert both have different perspectives on that topic. GCP offers,&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--VULuwtyI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3wq7nvqxulmu6el85ulo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--VULuwtyI--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/3wq7nvqxulmu6el85ulo.png" alt="pricing" width="880" height="328"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let me talk first about the beginner. They would like to explore GCP products so they deploy sample applications and play around on it. Once they get skilled, Students, startups, and individual developers deploy their first innovative application. And it's readiest for production with high availability, reliability, and scalability. So that they can serve their client globally. Other hands, Experts &amp;amp; professionals like to simulate their products and like to integrate third-party services. They might use other providers like AWS or Azure, so now they looking for something else that could GCP offers. Which gives them business value. For that reason, GCP offers &lt;code&gt;Google Cloud Free Tier&lt;/code&gt;. I will talk about it later in details, &lt;a href="https://cloud.google.com/pricing"&gt;Additional, you can take a look at GCP pricing&lt;/a&gt;&lt;/p&gt;

&lt;h3&gt;
  
  
  🔰 I would like to Explore the Google Cloud Platform!
&lt;/h3&gt;

&lt;p&gt;For that reason, they offer &lt;strong&gt;GCP Free Trial&lt;/strong&gt;. It does not get charged for the billing account. &lt;strong&gt;We only need a credit card, for verification. Don't worry, later it must have to manually upgraded for a paying account&lt;/strong&gt;. I will be a great option who want to learn and explore GCP. &lt;strong&gt;When you create a free trial account on GCP you also get $300 USD credit that you can use up to 12 months.&lt;/strong&gt; If you used up to $300 USD over. Then you're existing one will be paused and it offers you for a paid account upgrade. Additionally, It only allows for individuals and has some restrictions, remembers business accounts are not eligible for the free trial. &lt;a href="https://cloud.google.com/free/"&gt;Open a Free Trial Account&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--mpTQw3-g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w2weqemt7imsfvn32fm6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--mpTQw3-g--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/w2weqemt7imsfvn32fm6.png" alt="Alt Text" width="880" height="424"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Keep learning and Exploring. Coding is fun 😎.&lt;/p&gt;

&lt;p&gt;👌 Thanks for your time &amp;amp; passion. Feel free to ask me anything.&lt;/p&gt;

&lt;p&gt;Say Hi to me on &lt;a href="https://twitter.com/eng_sadhan"&gt;Twitter&lt;/a&gt; and &lt;a href="https://www.linkedin.com/in/csesadhan/"&gt;Linkedin&lt;/a&gt; where I keep on sharing interesting updates.&lt;/p&gt;

&lt;h3&gt;
  
  
  References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://inthecloud.withgoogle.com/training-discount/register.html"&gt;Training Courses&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://landing.google.com/sre/books/"&gt;Site Reliability Engineering (SRE) Book&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=XZmGGAbHqa0"&gt;Inside Google data center&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.youtube.com/watch?v=zDAYZU4A3w0"&gt;Google Data Center 360° Tour&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/compute/docs/regions-zones/"&gt;regions-zones&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/about/locations/#regions-tab"&gt;Regions Map&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Google_data_centers#Software"&gt;Google Data Centers Tools&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/beyondcorp/"&gt;Security-Beyondcorp&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/compute/all-pricing#network"&gt;Network Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/load-balancing/docs/https/"&gt;Global Load Balancing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/pricing"&gt;How much it Cost - Pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/free/docs/gcp-free-tier"&gt;Free Trial Account&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>gcp</category>
      <category>devops</category>
      <category>linux</category>
      <category>codenewbie</category>
    </item>
    <item>
      <title>Unix File Symbolic Permission</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Fri, 19 Jun 2020 09:41:49 +0000</pubDate>
      <link>https://forem.com/mesadhan/unix-file-symbolic-permission-84</link>
      <guid>https://forem.com/mesadhan/unix-file-symbolic-permission-84</guid>
      <description>&lt;p&gt;I'm trying to introduce how can we change the permission using symbolic permission, another way is numeric permission. Just open up Unix Terminal and then explore those commands. &lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--d_UkXShT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jmgavin5pikwrxo1zscb.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--d_UkXShT--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/jmgavin5pikwrxo1zscb.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👌 Thanks for your time &amp;amp; passion.&lt;br&gt;
Feel free to comments, If you have any issues &amp;amp; queries.&lt;/p&gt;

&lt;p&gt;Feel free to ask me anything and &lt;a href="https://twitter.com/eng_sadhan"&gt;Follow me on Twitter &lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>Vi (Vim) Text base editor regular commands</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Wed, 17 Jun 2020 18:48:01 +0000</pubDate>
      <link>https://forem.com/mesadhan/vi-vim-text-base-editor-regular-commands-404n</link>
      <guid>https://forem.com/mesadhan/vi-vim-text-base-editor-regular-commands-404n</guid>
      <description>&lt;p&gt;Vi (Vim) Text base editor regular commands. Should be used to, on these commands. It will save you life.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BGZjzQhG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/klf65mu4a6sjfbfiry2c.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BGZjzQhG--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/klf65mu4a6sjfbfiry2c.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👌 Thanks for your time &amp;amp; passion. Feel free to ask me anything.&lt;br&gt;
If you have any issues &amp;amp; queries. &lt;a href="https://twitter.com/eng_sadhan"&gt;Follow me on Twitter &lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>devops</category>
      <category>beginners</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Let's Look at Networking Modes</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Wed, 17 Jun 2020 16:38:20 +0000</pubDate>
      <link>https://forem.com/mesadhan/let-s-look-at-networking-modes-1gbe</link>
      <guid>https://forem.com/mesadhan/let-s-look-at-networking-modes-1gbe</guid>
      <description>&lt;p&gt;Many of us, confused about Networking Modes. I hope this will helps you to understand.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Lv0urVVX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hxzv150nhmja3c572zup.jpeg" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Lv0urVVX--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/hxzv150nhmja3c572zup.jpeg" alt="Alt Text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;👌 Thanks for your time &amp;amp; passion. Feel free to ask me anything.&lt;br&gt;
If you have any issues &amp;amp; queries. &lt;a href="https://twitter.com/eng_sadhan"&gt;Follow me on Twitter &lt;/a&gt;&lt;/p&gt;

</description>
      <category>linux</category>
      <category>webdev</category>
      <category>beginners</category>
      <category>devops</category>
    </item>
    <item>
      <title>The Complete Dev. Startup Organization Setup with GitHub</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Sun, 17 May 2020 12:28:39 +0000</pubDate>
      <link>https://forem.com/mesadhan/the-complete-dev-startup-organization-setup-with-github-44kk</link>
      <guid>https://forem.com/mesadhan/the-complete-dev-startup-organization-setup-with-github-44kk</guid>
      <description>&lt;p&gt;I found complete startups organization management solution with GitHub. As a startup Software development &amp;amp; technology team, we need to consider lots of things like project source code management, do teamwork, teams and build packages maintainability. In here we can configure everything in the same place. Finally, last but not last everything is free. 😇&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰 1. Open an Organization
&lt;/h2&gt;

&lt;p&gt;Open this Url &lt;a href="https://github.com/organizations/plan" rel="noopener noreferrer"&gt;https://github.com/organizations/plan&lt;/a&gt; . Pick a Plan that suitable for the organization. Here we choose a free plan.&lt;/p&gt;

&lt;p&gt;Choose Plan: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd3iaefd8u66xiir88eu6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fd3iaefd8u66xiir88eu6.png" title="Choose Plan" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Free Plan Registration Page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc7u9dddug9xhtjs4t36g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fc7u9dddug9xhtjs4t36g.png" title="Registration Page" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;In here nothing complex just put organizational information like what will be organizational account name, contact email address and finally organizational type.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: Don't worry the information will be changeable in future.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;After hit next we are able to get a welcome page like below, we don't need to invite everyone now, we can add them later to do so hit &lt;code&gt;Skip the step&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Welcome and Users Invitation Page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fftwm8b3oqkjbyq4rqqrb.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fftwm8b3oqkjbyq4rqqrb.png" title="Invitation Page" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Congratulation Here, we have a homepage of our organization. we need to configure a couple of things we will make it later.&lt;/p&gt;

&lt;p&gt;Welcome and Home Page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyjppfu0o374wqsi2waqe.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fyjppfu0o374wqsi2waqe.png" title="Home Page" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔰 2. Organization Settings
&lt;/h2&gt;

&lt;p&gt;Select the &lt;code&gt;Settings&lt;/code&gt; tab and we have setting information. We can update easily require information. That information is related to the organization. So filling that information we can globally tell about an organization. It is pretty simple to configure.&lt;/p&gt;

&lt;p&gt;Here is Setting page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4xsfhxjzpez4d9e9dffi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F4xsfhxjzpez4d9e9dffi.png" title="Setting Page" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔰 3. Projects Management
&lt;/h2&gt;

&lt;p&gt;Now choose the &lt;code&gt;Projects tab&lt;/code&gt;. This is a great window where we can find out which projects are going on about their metrics and more about project backlog related stuff.&lt;/p&gt;

&lt;p&gt;Here is Project page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz6ngz3xc1bc64j237hie.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fz6ngz3xc1bc64j237hie.png" title="Project Page" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔰 4. Teams Management
&lt;/h2&gt;

&lt;p&gt;Now choose &lt;code&gt;Teams Tab&lt;/code&gt;. In this simple window, we are able to control different teams. We can create invite our team members. we can also discuss and collaborate in an individual team or Whole organization. It's is cool stuff?. Team communication and collaboration is easy.&lt;/p&gt;

&lt;p&gt;Here is our teams page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmj1wd42u58fwnjyr9pzu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fmj1wd42u58fwnjyr9pzu.png" title="Teams Page" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔰 5. People Management - Do Administrative Stuff.
&lt;/h2&gt;

&lt;p&gt;Now choose &lt;code&gt;People Tab&lt;/code&gt;. In this page all the people are visible, We can do the administrative task from here. Here we can change and permit user ownership and roles So that we can do the different level of organizational administrative job.  &lt;/p&gt;

&lt;p&gt;Here is peoples management page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6xurhdef5km209u18lxq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F6xurhdef5km209u18lxq.png" title="People Managment" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔰 6. Packages Management
&lt;/h2&gt;

&lt;p&gt;Now choose &lt;code&gt;Packages Management&lt;/code&gt;. Github came with great feature. Now we can easily manage packages, binaries and build we can easily upload our common reusable packages and use them into projects. Not need to go for an external solution. Now Everything in on the same place.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Note: It has some pricing related issue, so check before using it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here is package management page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcgoprh7269t2922v4awi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fcgoprh7269t2922v4awi.png" title="Package Management" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔰 7. Create a New Repository
&lt;/h2&gt;

&lt;p&gt;Hit &lt;code&gt;Create Repository&lt;/code&gt;. As like as GitHub personal user account, Now we can create a personal organizational repository, It can be &lt;code&gt;Public/Private&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Here is - Package Management Page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7l1dc879t4z0uk10ktiy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7l1dc879t4z0uk10ktiy.png" title="How to create Github Organization" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Here is - New Repository Creation Page:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1uhbyfc19of2do2yi6cq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F1uhbyfc19of2do2yi6cq.png" title="Rep Creation Page" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔰 8. How to Publish Project Source Code
&lt;/h2&gt;

&lt;p&gt;This is an &lt;code&gt;Empty Repository Page&lt;/code&gt;. We can follow their guidelines, But before doing that we need to set up &lt;a href="https://git-scm.com/downloads" rel="noopener noreferrer"&gt;Git client&lt;/a&gt; So that we can execute those commands. Else if we have an existing project already then we can just simply upload it using drag and drop by selecting &lt;code&gt;upload and existing file&lt;/code&gt; blue link. But the command line is recommended and very convenient to do this. Once we are hands-on by dirty our hand, it will be really fun.&lt;/p&gt;

&lt;p&gt;Here is - Empty Repository Page: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwt06ia4mka61bn1rmuy6.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fwt06ia4mka61bn1rmuy6.png" title="Empty Repo Page" alt="alt text"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev-to-uploads.s3.amazonaws.com/i/1y0r0ms765y1d9kg5ydl.png" rel="noopener noreferrer"&gt;https://dev-to-uploads.s3.amazonaws.com/i/1y0r0ms765y1d9kg5ydl.png&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  🔰 9. Learn More about Git &amp;amp; Commands
&lt;/h2&gt;
&lt;h3&gt;
  
  
  📗 First Time Git Configuration
&lt;/h3&gt;

&lt;p&gt;Before you can start using Git, you need to configure it. Run each of the following lines on the command line to make sure everything is set up.&lt;/p&gt;

&lt;p&gt;🕹 Sets up Git with your name&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.name "&amp;lt;Your-Full-Name&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;🕹 Sets up Git with your email&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git config --global user.email "&amp;lt;your-email-address&amp;gt;"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  📗 The seven rules of a great Git commit message
&lt;/h3&gt;

&lt;p&gt;Keep in mind: This has all been said before.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Separate subject from the body with a blank line&lt;/li&gt;
&lt;li&gt;Limit the subject line to 50 characters&lt;/li&gt;
&lt;li&gt;Capitalize the subject line&lt;/li&gt;
&lt;li&gt;Do not end the subject line with a period&lt;/li&gt;
&lt;li&gt;Use the imperative mood in the subject line&lt;/li&gt;
&lt;li&gt;Wrap the body at 72 characters&lt;/li&gt;
&lt;li&gt;Use the body to explain what and why vs. how&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Summarize changes in around 50 characters or less

More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of the commit and the rest of the text as the body. The
blank line separating the summary from the body is critical (unless
you omit the body entirely); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.

Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequences of this
change? Here's the place to explain them.

Further paragraphs come after blank lines.

 - Bullet points are okay, too

 - Typically a hyphen or asterisk is used for the bullet, preceded
   by a single space, with blank lines in between, but conventions
   vary here

If you use an issue tracker, put references to them at the bottom,
like this:

Resolves: #123
See also: #456, #789
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;&lt;code&gt;Note:&lt;/code&gt; we can add multiple line commit using &lt;code&gt;git commit&lt;/code&gt; command &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  📗 Branching, Merging and Tagging
&lt;/h3&gt;

&lt;p&gt;The git branch is a very important concept. It becomes really helpful when project co-workers are frequently working on new features development. Also, It makes the project more maintainable &amp;amp; integrable. If we want to contribute on any Open Source project then we need branch.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;git branch&lt;/code&gt; command is used to interact with Git's branches:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;It can be used to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;list all branch names in the repository&lt;/li&gt;
&lt;li&gt;create new branches&lt;/li&gt;
&lt;li&gt;delete branches&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🕹 Create Branch&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch latest
git branch footer-fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🕹 Switch Back and forth to different Branch.&lt;br&gt;
To navigate into different branches using &lt;code&gt;git checkout&lt;/code&gt;&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; git checkout footer-fix
 git checkout -b header-fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: &lt;code&gt;git checkout -b header-fix&lt;/code&gt; create a new branch and make it &lt;code&gt;Active Branch&lt;/code&gt; in the code editor.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;🕹 Delete Branch&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git branch -d footer-fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;🕹 See All Branches At Once&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log --oneline --decorate --graph --all
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;🕹 Undo from selected Branch&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# undo once, from commits
git reset --hard HEAD^
git reset --hard master^

git reset --hard HEAD^

# undo twice, from commits
git reset --hard HEAD^^
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;🕹 Merge into different Branch&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git merge &amp;lt;name-of-branch-to-merge-in-[Eg.footer-fix]&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Note: &lt;code&gt;Active branch merge with given &amp;lt;name-of-branch-to-merge-in&amp;gt;&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;🕹 Syncs all the available remote branches&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git fetch
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;🕹 Push update or changes using&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git push origin master
git push origin footer-fix
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  📗 Merge Conflict
&lt;/h3&gt;

&lt;p&gt;When multiple teams and peoples are working on a single file or branch at the same time then merging conflict occurs. To avoid these types of occurrence, we need to avoid working on the same file &amp;amp; branch at the same time.&lt;/p&gt;

&lt;p&gt;🕹 Merge Conflict Indicators Explanation&lt;br&gt;
The editor has the following merge conflict indicators:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt;&amp;lt; HEAD&lt;/code&gt; everything below this line (until the next indicator) shows you &lt;code&gt;what's on the current branch&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;||||||| merged common ancestors&lt;/code&gt; everything below this line (until the next indicator) shows you &lt;code&gt;what the original lines were&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;=======&lt;/code&gt; is the end of the original lines, everything that follows (until the next indicator) is &lt;code&gt;what's on the branch that's being merged in&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&amp;gt;&lt;/code&gt; heading-update is the ending indicator of &lt;code&gt;what's on the branch that's being merged&lt;/code&gt; in (in this case, the heading-update branch)&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🕹 Resolving A Merge Conflict&lt;/p&gt;

&lt;p&gt;Git is using the merge conflict indicators to show you what lines caused the merge conflict on the two different branches as well as what the original line used to have. So to resolve a merge conflict, you need to:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;choose which line(s) to keep&lt;/li&gt;
&lt;li&gt;remove all lines with indicators&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;Notes: finally make new commit after resolve it manually.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
  
  
  📗 Undoing Changes
&lt;/h3&gt;

&lt;p&gt;🕹 Git reset or revert local changes until commit &lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git checkout .
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;🕹 Changing The Last Commit&lt;/p&gt;

&lt;p&gt;With the &lt;code&gt;--amend&lt;/code&gt; flag, you can alter the most-recent commit.&lt;br&gt;
like, Add Forgotten Files To Commit&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git commit --amend
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  📗 The git revert Command
&lt;/h3&gt;

&lt;p&gt;Now that I've made a commit with some changes, I can revert it with the git revert command&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git log
git revert &amp;lt;SHA-of-commit-id-to-revert&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;This command:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;SHA-of-commit-id-to-revert&lt;/code&gt; will be founded by &lt;code&gt;git log&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;will undo the changes that were made by the provided commit&lt;/li&gt;
&lt;li&gt;creates a new commit to record the change&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🕹 Change remote origin&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git remote set-url origin https://github.com/mesadhan/sample-app.git
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;🕹 Remote origin status&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git remote -v
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h3&gt;
  
  
  📗 Relative Commit References for Back and forth
&lt;/h3&gt;

&lt;p&gt;Sometimes we back&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt; – indicates the parent commit&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;~&lt;/code&gt; – indicates the first parent commit&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Here's how we can refer to previous commits:&lt;/p&gt;

&lt;p&gt;The parent commit – the following indicate the parent commit of the current commit&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HEAD^&lt;/li&gt;
&lt;li&gt;HEAD~&lt;/li&gt;
&lt;li&gt;HEAD~1&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The grandparent commit – the following indicate the grandparent commit of the current commit&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HEAD^^&lt;/li&gt;
&lt;li&gt;HEAD~2&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The great-grandparent commit – the following indicate the great-grandparent commit of the current commit&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;HEAD^^^&lt;/li&gt;
&lt;li&gt;HEAD~3&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  📗 Remove Local and Remote Commit
&lt;/h3&gt;

&lt;p&gt;To view commits history base on the number hit below command,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git rebase -i HEAD~2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Now Remove those commit from the list and save.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Optional, You can pull, if you want to sync with the latest work then below command,&lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git pull
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Otherwise, permanently change your local and remote repository using below command,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git push origin master
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;code&gt;Note:&lt;/code&gt; Here, &lt;code&gt;git rebase -i HEAD~2&lt;/code&gt;, will show last two commits. we can change the number for more commit history.&lt;/p&gt;
&lt;h3&gt;
  
  
  📗 Git Tag Command
&lt;/h3&gt;

&lt;p&gt;Git tag uses usually when we release a version for a product. It is important to know how we can tag annotations,&lt;/p&gt;

&lt;p&gt;🕹 add a tag with annotation and version&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag -a v1.0
git tag -a beta
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;&lt;code&gt;Sample Tag Commit message&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Put Headline About Tag
#
# Write a message for tag:
#   v1.0
# Lines starting with `#` will be ignored 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;CAREFUL:&lt;/code&gt; In the command above (git tag -a v1.0) the -a flag is used. This flag tells Git to create an annotated flag. If you don't provide the flag (i.e. git tag v1.0) then it'll create what's called a lightweight tag.&lt;/p&gt;

&lt;p&gt;Annotated tags are recommended because they include a lot of extra information such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the person who made the tag&lt;/li&gt;
&lt;li&gt;the date the tag was made&lt;/li&gt;
&lt;li&gt;a message for the tag&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Because of this, you should always use annotated tags.&lt;/p&gt;

&lt;p&gt;🕹 Verify Tag &amp;amp; Tag History&lt;/p&gt;

&lt;p&gt;After saving and quitting the editor, nothing is displayed on the command line. So how do we know that a tag was actually added to the project? If you type out just git tag, it will display all tags that are in the repository.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag
git log --decorate
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🕹 Deleting A Tag&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git tag -d v1.0
git tag --delete v1.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;👌 Thanks for your time &amp;amp; passion. Feel free to ask me anything.&lt;br&gt;
If you have any issues &amp;amp; queries. &lt;a href="https://twitter.com/eng_sadhan" rel="noopener noreferrer"&gt;Follow me on Twitter &lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰 References:-
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/pricing" rel="noopener noreferrer"&gt;https://github.com/pricing&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/organizations/plan" rel="noopener noreferrer"&gt;https://github.com/organizations/plan&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://git-scm.com/downloads" rel="noopener noreferrer"&gt;https://git-scm.com/downloads&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.blog/2020-04-14-github-is-now-free-for-teams/" rel="noopener noreferrer"&gt;https://github.blog/2020-04-14-github-is-now-free-for-teams/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>github</category>
      <category>beginners</category>
      <category>startup</category>
      <category>webdev</category>
    </item>
    <item>
      <title>Upload &amp; takes control over the Youtube Data API</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Mon, 27 Apr 2020 08:55:03 +0000</pubDate>
      <link>https://forem.com/mesadhan/upload-takes-control-over-the-youtube-data-api-2gb6</link>
      <guid>https://forem.com/mesadhan/upload-takes-control-over-the-youtube-data-api-2gb6</guid>
      <description>&lt;p&gt;Using Youtube Data API we can access YouTube features to our application, including the ability to upload videos, create and manage playlists, and more.&lt;/p&gt;

&lt;p&gt;As a Developer, we need to handle third party API or custom own API. There is no developer who is not integrated any single API in her development journey. So let me introduce API with you. What is actually API is. API is basically Application Programming Interfaces.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰 Bit of information about API
&lt;/h2&gt;

&lt;p&gt;If I make it simple then it's a common guideline, which way two software can talk to each other. Let’s break,&lt;/p&gt;

&lt;p&gt;-📗 Application:- is a service app or could be a third-party open data portal. (Eg. Youtube, Google Map, etc)&lt;br&gt;
-📗 Interface:- It's like a medium, which has some common definitions or formats. (Eg. JSON, XML or Other light-weight file format). JSON is a common and widely used format.&lt;br&gt;
-📗 And finally, Program:- is a set of codes that the developer writes to develop the application. (Eg. Youtube Data API Codes)&lt;/p&gt;

&lt;p&gt;I hope you guys get an idea about API if you want to know more about it. Then look below references.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://en.wikipedia.org/wiki/Application_programming_interface"&gt;Read Wikipedia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.freecodecamp.org/news/what-is-an-api-in-english-please-b880a3214a82"&gt;Read FreecodeCamp&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔰 Setting up your API-Key or Pre-configuration.
&lt;/h2&gt;

&lt;p&gt;As I mentioned two systems talk to each other. So one issue raises, that is Security! so that we can take over the control of application resources. API's could be open or close via API-key. We need to configure API-key for close application resources. Okay, let's setup api-key for Youtube Data API.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰 Setup Youtube Data API Congifuraiton
&lt;/h2&gt;

&lt;p&gt;-[1] Visit, and &lt;a href="https://console.developers.google.com/apis/dashboard"&gt;Enable Youtube Data API&lt;/a&gt;&lt;br&gt;
-[2] If not exist then &lt;strong&gt;Create New Project&lt;/strong&gt;&lt;br&gt;
-[3] Search For API &lt;strong&gt;Youtube Data API&lt;/strong&gt;, Enable It.&lt;br&gt;
-[4] Then Left Menu Click &lt;strong&gt;Credentials&lt;/strong&gt;.&lt;br&gt;
-[5] Create &lt;strong&gt;API Keys&lt;/strong&gt;, Select &lt;strong&gt;none&lt;/strong&gt; then &lt;strong&gt;Restrict key&lt;/strong&gt; radio and choose &lt;strong&gt;Youtube Data API&lt;/strong&gt; from Dropdown.&lt;br&gt;
-[6] And Finally, From &lt;strong&gt;Credentials&lt;/strong&gt; create &lt;strong&gt;OAuth 2.0 Client IDs&lt;/strong&gt; with &lt;strong&gt;Authorized JavaScript origins&lt;/strong&gt; Urls [&lt;a href="http://localhost"&gt;http://localhost&lt;/a&gt;] and [&lt;a href="http://localhost:5000"&gt;http://localhost:5000&lt;/a&gt;] or [&lt;a href="https://custom-appserver-domain.com"&gt;https://custom-appserver-domain.com&lt;/a&gt;]&lt;br&gt;
-[7] Replace &lt;strong&gt;js/YoutubeDataApi.js&lt;/strong&gt; file &lt;strong&gt;CLIENT_KEY&lt;/strong&gt; and &lt;strong&gt;API_KEY&lt;/strong&gt;. &lt;br&gt;
-[8] Now run the app using &lt;strong&gt;live server&lt;/strong&gt; or deploy its production server. [I used VScode life server Extension]&lt;/p&gt;

&lt;p&gt;Note: Origins must me match as defined as &lt;strong&gt;OAuth2.0 client&lt;/strong&gt; console.&lt;br&gt;
Details guide will be found. &lt;a href="https://developers.google.com/youtube/v3/getting-started"&gt;Guide&lt;/a&gt;. Else Occurre authentication-related error. &lt;/p&gt;

&lt;h2&gt;
  
  
  🔰 I have attached a demo sample &lt;strong&gt;source code&lt;/strong&gt; below,
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://github.com/mesadhan/youtube-data-api-v3-example"&gt;Sample Project Source Code&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  🔰 Finally, Run &amp;amp; Test Application
&lt;/h2&gt;

&lt;p&gt;-📗 Clone Project from GitHub and then move on&lt;br&gt;
-📗 After run application using live server&lt;br&gt;
-📗 Login with Gmail account and accept require permission&lt;br&gt;
-📗 Finally, Navigate Button and test.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;I'm sorry I can't get enough time to optimize its example code. If anyone interested to work with this project then feels free to knock me. I came to share this example because I didn't found any complete tutorial on it. So I think it might be helpful for others.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;👌 Congratulations. &amp;amp; Thanks for your time &amp;amp; passion. Feel free to comments, If you have any issues &amp;amp; queries. &lt;a href="https://twitter.com/eng_sadhan"&gt;Follow me on Twitter &lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰 References:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://developers.google.com/youtube/v3/getting-started"&gt;https://developers.google.com/youtube/v3/getting-started&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://console.developers.google.com/apis/library/youtube.googleapis.com"&gt;https://console.developers.google.com/apis/library/youtube.googleapis.com&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;a href="https://console.developers.google.com/apis/credentials"&gt;https://console.developers.google.com/apis/credentials&lt;/a&gt;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>youtubedataapi</category>
      <category>tutorial</category>
      <category>javascript</category>
      <category>webdev</category>
    </item>
    <item>
      <title>OpenShift Origin 3.11 (OKD) Installation on a CentOS 7 Multi-Node Cluster</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Tue, 31 Mar 2020 07:51:59 +0000</pubDate>
      <link>https://forem.com/mesadhan/openshift-origin-3-11-okd-installation-on-a-centos-7-multi-node-cluster-1j11</link>
      <guid>https://forem.com/mesadhan/openshift-origin-3-11-okd-installation-on-a-centos-7-multi-node-cluster-1j11</guid>
      <description>&lt;h2&gt;
  
  
  Overview
&lt;/h2&gt;

&lt;p&gt;OpenShift Origin (OKD) is the Community Distribution of Kubernetes that powers Red Hat OpenShift. Built around a core of OCI container packaging and Kubernetes container cluster management, OKD is also augmented by application lifecycle management functionality and DevOps tooling. OKD provides a complete open-source container application platform&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰1. Prerequisites
&lt;/h2&gt;

&lt;p&gt;We can plan to install 3 physical machines or VM, and they should be connected on the Internet&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Distribution: Centos 7 linux [Os Minimal Installation]
IP Address: 192.168.31.182 with 8 GB, 2 Core
IP Address: 192.168.31.144 with 4 GB RAM, 2 Core
IP Address: 192.168.31.94 with 4 GB RAM, 2 Core

Login username: root
Password: 123456
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;Note: Mentioned ip address and credential uses just for references. Please take a look at&lt;/code&gt; &lt;a href="https://docs.okd.io/3.11/install/prerequisites.html"&gt;Official prerequisites&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰2. To access remotely through username &amp;amp; password, needs to Installing and Enabling OpenSSH
&lt;/h2&gt;

&lt;p&gt;📗 Install OpenSSH &amp;amp; net-tools packages, start and show status of SSH service, run automatic after reboot and finally show machine IP Address.&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yum –y install openssh-server openssh-clients net-tools

systemctl start sshd
systemctl status sshd
systemctl enable sshd
ifconfig
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Note: Now we can able to access those services through Terminal or Putty&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰3. Common steps for on all the machines or nodes [Here, Master, Compute, Infra], Login into each single machine
&lt;/h2&gt;

&lt;p&gt;📗 Step1: Install base packages&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;yum &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;-y&lt;/span&gt; wget git zile net-tools bind-utils iptables-services bridge-utils bash-completion kexec-tools sos psacct openssl-devel httpd-tools python-cryptography python2-pip python-devel python-passlib java-1.8.0-openjdk-headless &lt;span class="s2"&gt;"@Development Tools"&lt;/span&gt;
yum update &lt;span class="nt"&gt;-y&lt;/span&gt;

yum &lt;span class="nb"&gt;install &lt;/span&gt;docker-1.13.1
systemctl start docker &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; systemctl &lt;span class="nb"&gt;enable &lt;/span&gt;docker &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; systemctl status docker

yum &lt;span class="nt"&gt;-y&lt;/span&gt; &lt;span class="nb"&gt;install &lt;/span&gt;https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
&lt;span class="nb"&gt;sed&lt;/span&gt; &lt;span class="nt"&gt;-i&lt;/span&gt; &lt;span class="nt"&gt;-e&lt;/span&gt; &lt;span class="s2"&gt;"s/^enabled=1/enabled=0/"&lt;/span&gt; /etc/yum.repos.d/epel.repo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step2: Set hosts for all nodes, so future ansible can communicate with all machines for automation&lt;/p&gt;

&lt;p&gt;Open that file and &lt;code&gt;vi /etc/hosts&lt;/code&gt;, include contents&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;192.168.31.182  master.192.168.31.182.nip.io
192.168.31.144  compute.192.168.31.144.nip.io
192.168.31.94  infra.192.168.31.94.nip.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, restart network service&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;service network restart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;📗 Step3: Login into each single machine and set hostname for all nodes&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hostnamectl set-hostname hostname.&amp;lt;machine-ip&amp;gt;.nip.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Examples for all machine:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;hostnamectl set-hostname master.192.168.31.182.nip.io
hostnamectl set-hostname compute.192.168.31.144.nip.io
hostnamectl set-hostname infra.192.168.31.94.nip.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Note: Remember each machine has only one hostname, so don't put all hostname in a single machine.&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;📗 Step4: Modify '/etc/NetworkManager/NetworkManager.conf' so after reboot wifi-router each time, DNS shouldn't change.&lt;/p&gt;

&lt;p&gt;open this file &lt;code&gt;vi /etc/NetworkManager/NetworkManager.conf&lt;/code&gt;, include contents&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;[main]
#plugins=ifcfg-rh,ibft
dns=none
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step5: Modify &lt;code&gt;ifconfig label information&lt;/code&gt;, and use google DNS&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ifconfig
cd /etc/sysconfig/network-scripts
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;In Here, mine label was &lt;code&gt;ifcfg-ens33&lt;/code&gt;, so &lt;code&gt;vi ifcfg-ens33&lt;/code&gt; and include contents&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;PEERDNS="no"
DNS1="8.8.8.8"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step6: Modify &lt;code&gt;resolv.conf&lt;/code&gt; file, to update nameserver &amp;amp; search globally&lt;/p&gt;

&lt;p&gt;open &lt;code&gt;vi /etc/resolv.conf&lt;/code&gt;, include contents&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;search nip.io
nameserver 8.8.8.8
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step7: Restart network manager &amp;amp; network service&lt;/p&gt;

&lt;p&gt;systemctl restart NetworkManager&lt;br&gt;
service network restart&lt;/p&gt;

&lt;p&gt;📗 Step8: Change Selinux setting on Master,Compute,Infra&lt;/p&gt;

&lt;p&gt;open &lt;code&gt;vi /etc/selinux/config&lt;/code&gt;, include contents&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SELINUX=enforcing
SELINUXTYPE=targeted
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step9: Reboot machine&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;reboot
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;code&gt;Note: For unknown behaviors, we can restart network manager &amp;amp; service&lt;/code&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰4. Finally, log in into Master Machine and follow the below instructions,
&lt;/h2&gt;

&lt;p&gt;📗 Step1: create ssh key and copy public key to other machines or nodes, fso we can communicate without username and password. It's needed for SSH.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ssh-keygen

for host in master.192.168.31.182.nip.io \
master.192.168.31.182.nip.io \
compute.192.168.31.144.nip.io \
infra.192.168.31.94.nip.io; \
do ssh-copy-id -i ~/.ssh/id_rsa.pub $host;
done
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step2: After boot all the machines, we can ping from an external machine terminal or command&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ping google.com
ping master.192.168.31.182.nip.io
ping compute.192.168.31.144.nip.io
ping infra.192.168.31.94.nip.io
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Notes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ping VM to VM = Ok
ping Host to VM = Ok
ping www.google.com = Ok 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step3: install ansible 2.7 in master node&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;rpm -Uvh https://releases.ansible.com/ansible/rpm/release/epel-7-x86_64/ansible-2.7.10-1.el7.ans.noarch.rpm
ansible --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step4: Now, clone &lt;code&gt;openshift-ansible&lt;/code&gt; repository, and switch 3.11 release branch&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;git clone https://github.com/openshift/openshift-ansible.git
cd openshift-ansible &amp;amp;&amp;amp; git fetch &amp;amp;&amp;amp; git checkout release-3.11
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;📗 Step5: Create ansible &lt;code&gt;hosts.ini&lt;/code&gt; configuration,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Create an OSEv3 group that contains the masters, nodes, and etcd groups
[OSEv3:children]
masters
nodes
etcd

# Set variables common for all OSEv3 hosts
[OSEv3:vars]
# SSH user, this user should allow ssh based auth without requiring a password
ansible_ssh_user=root
# If ansible_ssh_user is not root, ansible_become must be set to true
ansible_become=true
openshift_master_default_subdomain=app.192.168.31.94.nip.io
deployment_type=origin

[nodes:vars]
openshift_disable_check=disk_availability,memory_availability,docker_storage
[masters:vars]
openshift_disable_check=disk_availability,memory_availability,docker_storage
# uncomment the following to enable htpasswd authentication; defaults to DenyAllPasswordIdentityProvider
openshift_master_identity_providers=[{'name': 'htpasswd_auth', 'login': 'true', 'challenge': 'true', 'kind': 'HTPasswdPasswordIdentityProvider'}]

# host group for masters
[masters]
192.168.31.182

# host group for etcd
[etcd]
192.168.31.182

# host group for nodes, includes region info
[nodes]
192.168.31.182  openshift_node_group_name='node-config-master'
192.168.31.144  openshift_node_group_name='node-config-compute'
192.168.31.94  openshift_node_group_name='node-config-infra'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;📗 Step5: Execute ansible playbooks with &lt;code&gt;hosts.ini&lt;/code&gt; configuration,&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ansible-playbook -i hosts.ini playbooks/prerequisites.yml
ansible-playbook -i hosts.ini playbooks/deploy_cluster.yml
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Note: If you're &lt;code&gt;prerequisites.yml&lt;/code&gt; not throw any error, then you can ready for &lt;code&gt;deploy_cluster.yml&lt;/code&gt;. After hours of later, you can able to see this screen. I hope your face will be glowing like mine! 🤩&lt;/p&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--RDHDP1Uc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z76bblo7og2zqoa3kjxl.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--RDHDP1Uc--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/z76bblo7og2zqoa3kjxl.png" alt="Alt Text" width="880" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;📗 Step6: Create Admin User, so that we can log in to web console, we can also able to see web console URL&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;htpasswd -c /etc/origin/master/htpasswd admin
oc status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--ZqILK-4Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/myrh8n2mcdv6zq8u8r8k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--ZqILK-4Y--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/i/myrh8n2mcdv6zq8u8r8k.png" alt="Alt Text" width="880" height="550"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Note: We already created admin users, so use those credentials to move forward.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;After 5 hours (depends on internet speed and nodes resources), successfully able to install a private cloud on an open-source container application platform using centos 7 with 3 nodes. It's lots of fun. It might occur errors if you're network connection is poor and machines or nodes resources (CPU, RAM) are not properly.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;👌 Congratulations. &amp;amp; Thanks for your time &amp;amp; passion.&lt;br&gt;
Feel free to comments, If you have any issues &amp;amp; queries.&lt;/p&gt;

&lt;h2&gt;
  
  
  🔰 References:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://docs.okd.io"&gt;https://docs.okd.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.okd.io/3.11/install/index.html"&gt;https://docs.okd.io/3.11/install/index.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.okd.io/3.11/install/prerequisites.html"&gt;https://docs.okd.io/3.11/install/prerequisites.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.okd.io/3.11/install/host_preparation.html"&gt;https://docs.okd.io/3.11/install/host_preparation.html&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>devops</category>
      <category>openshift</category>
      <category>kubernetes</category>
      <category>privatecloud</category>
    </item>
    <item>
      <title>Manage Your're Mail Using IMAP</title>
      <dc:creator>Sadhan Sarker</dc:creator>
      <pubDate>Mon, 02 Mar 2020 07:19:22 +0000</pubDate>
      <link>https://forem.com/mesadhan/manage-your-re-mail-using-imap-2p18</link>
      <guid>https://forem.com/mesadhan/manage-your-re-mail-using-imap-2p18</guid>
      <description>&lt;h2&gt;
  
  
  📗 IMAP Overview
&lt;/h2&gt;

&lt;p&gt;If you have ever set up an email client or app, you will have certainly come across the terms &lt;code&gt;POP&lt;/code&gt; and &lt;code&gt;IMAP&lt;/code&gt;.&lt;br&gt;
&lt;code&gt;IMAP-is short for Internet Message Access Protocol&lt;/code&gt;, while &lt;code&gt;POP-translates to Post Office Protocol&lt;/code&gt;. In other words, both are email protocols. You might listen about &lt;code&gt;Outlook&lt;/code&gt;, &lt;code&gt;Thunderbird&lt;/code&gt;, &lt;code&gt;Eudora&lt;/code&gt;, &lt;code&gt;GNUMail&lt;/code&gt;, &lt;code&gt;or (Mac) Mail&lt;/code&gt; app which provides custom mail management services they download messages from your email account and to make changes like archiving messages or sorting them into folders and giving more personalization.&lt;/p&gt;

&lt;p&gt;Essentially, the main difference of the two protocols is that POP downloads emails from the server for permanent local storage, while IMAP leaves them on the server and just caches (temporarily stores) emails locally. In other words, IMAP is a form of cloud storage.&lt;/p&gt;
&lt;h3&gt;
  
  
  📗 When Choose POP:-
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;if you want to access your mail from only one single device.&lt;/li&gt;
&lt;li&gt;if need constant access to your email, regardless of internet availability.&lt;/li&gt;
&lt;li&gt;if you have limited server storage.&lt;/li&gt;
&lt;/ul&gt;
&lt;h3&gt;
  
  
  📗 When Choose IMAP:-
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;if want to access your email from multiple different devices.&lt;/li&gt;
&lt;li&gt;if you have a reliable and constant internet connection.&lt;/li&gt;
&lt;li&gt;if you want to receive a quick overview of new emails or emails on the server.&lt;/li&gt;
&lt;li&gt;if local storage space is limited.&lt;/li&gt;
&lt;li&gt;if worried about backing your emails up.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;If confused, then go with IMAP. It’s the more modern protocol, it allows you to be flexible, and your email is automatically backed up on the server. &lt;/p&gt;

&lt;p&gt;Today, we're going to look into IMAP, It's the open standard that describes how to access messages in an email mailbox. While we want to read and send mail programmatically, then IMAP is important. we just need an IMAP client with implemented on top of IMAP protocol standards.&lt;/p&gt;

&lt;p&gt;Now let's deep dive into it. We’re going to connect to an email account, list all of the available folders in the mailbox, and download a message. Here, we are going to use &lt;code&gt;NodeJS IMAP Client&lt;/code&gt; which will help us to explore,&lt;/p&gt;
&lt;h2&gt;
  
  
  📗 Enable IMAP permission for your E-Mail
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Log in your Gmail then, Open Email Setting, then Select &lt;code&gt;Forwarding and POP/IMAP&lt;/code&gt; tab and change the status to &lt;code&gt;IMAP access: Status: IMAP is enabled&lt;/code&gt;. To do so Select &lt;code&gt;Enable IMAP&lt;/code&gt;. &lt;a href="https://mail.google.com/mail/u/0/#settings/fwdandpop"&gt;After login into Gmail, Click Dynamic Link For Quick Access&lt;/a&gt;.&lt;/li&gt;
&lt;li&gt;Now enable &lt;code&gt;Less Secure Apps: ON&lt;/code&gt;. To do &lt;a href="https://myaccount.google.com/lesssecureapps"&gt;After login into Gmail, Click Dynamic Link For Quick Access&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
  
  
  🔰 Now, Setup IMAP Client
&lt;/h2&gt;

&lt;p&gt;Here, I'm using nodejs client but you can use other language clients to achieve those features,&lt;/p&gt;

&lt;p&gt;Before creating a node application make sure node is installed in your machine, You can find the installation guide from here [&lt;a href="https://nodejs.org/en/download/"&gt;https://nodejs.org/en/download/&lt;/a&gt;].&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node --version
npm --version
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;🔰Create a node application,&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir imap-client-app
npm init -y
npm install --save imap
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;p&gt;Note: NodeJs library &lt;a href="https://github.com/mscdex/node-imap"&gt;Node-IMAP Client at Github.&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;
  
  
  📗 Take a look at implementation,
&lt;/h2&gt;

&lt;p&gt;🔰 Now, create &lt;code&gt;manage-mailbox.js&lt;/code&gt; files&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Imap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;imap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;inspect&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;util&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;


&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;getEmailFromInbox&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;INBOX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;box&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="c1"&gt;// we can define range '1:3'&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;seq&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;1:*&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="na"&gt;bodies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HEADER.FIELDS (FROM TO SUBJECT DATE)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;struct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seqno&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Message #%d&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seqno&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;prefix&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;(#&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;seqno&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;) &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                &lt;span class="p"&gt;});&lt;/span&gt;
                &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;prefix&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Parsed header: %s&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Imap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parseHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;
                &lt;span class="p"&gt;});&lt;/span&gt;
            &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Fetch error: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Done fetching all messages!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="c1"&gt;//mailServer.end();&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;createLabel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;labelName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;addBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;labelName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{});&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;New Label or Box Created&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;getMailboxStatusByName&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;inboxName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;status&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;inboxName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;mailbox&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;mailbox&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Label or Box Status&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;getMailBoxLabels&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;getBoxes&lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;mailbox&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;mailbox&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;deleteLabel&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;labelName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;mailServer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;delBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;labelName&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{})&lt;/span&gt;
   &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Label or Box removed&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;mailServer1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Imap&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;example@gmail.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;imap.gmail.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;993&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;tls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;tlsOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;rejectUnauthorized&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;authTimeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Source Server Error:- &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="nx"&gt;mailServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ready&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;mailServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;INBOX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;box&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;server1 ready&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;

    &lt;span class="c1"&gt;// mail operation&lt;/span&gt;
    &lt;span class="nx"&gt;getMailBoxLabels&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;getEmailFromInbox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nx"&gt;createLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo-label1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;deleteLabel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;demo-label1&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
    &lt;span class="nx"&gt;getMailboxStatusByName&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;mailServer1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;INBOX&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="nx"&gt;mailServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔰 To run that script, hit below command, see output&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node manage-mailbox.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;🔰 We can import and export email, one email server to another email server. To copy email create &lt;code&gt;copy-mailbox.js&lt;/code&gt;,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;Imap&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;imap&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt; &lt;span class="nx"&gt;inspect&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;util&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="c1"&gt;// Here, copy email source-mail-server to target-mail-server&lt;/span&gt;
&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;copyEmail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;srcServer1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;srcServer2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;emailServerName&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;srcServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ALL&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;error&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;uids&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="c1"&gt;//console.log('message', uids);&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;uids&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;srcServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;uids&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;bodies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;HEADER.FIELDS (FROM TO SUBJECT DATE)&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="na"&gt;struct&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt; &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seqno&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="c1"&gt;//console.log('Got a message with seq no: ' + seqno);&lt;/span&gt;

            &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="nx"&gt;bufLen&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bufferText&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;data&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="nx"&gt;bufferText&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;toString&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;utf8&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;push&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="nx"&gt;bufLen&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="nx"&gt;chunk&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="p"&gt;});&lt;/span&gt;
                &lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Parsed header: %s&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;inspect&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;Imap&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;parseHeader&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;bufferText&lt;/span&gt;&lt;span class="p"&gt;)));&lt;/span&gt;                  &lt;span class="c1"&gt;// email contents&lt;/span&gt;
                    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`====&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;emailServerName&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; - Finished message no. &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;seqno&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; =======`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;            &lt;span class="c1"&gt;// email email seqno&lt;/span&gt;

                    &lt;span class="c1"&gt;//console.log('message-binay-buffer', buffer);&lt;/span&gt;
                    &lt;span class="c1"&gt;//console.log('message-bufLen', bufLen);&lt;/span&gt;
                    &lt;span class="c1"&gt;//console.log('message-total-email-count', count);&lt;/span&gt;

                    &lt;span class="nx"&gt;buffer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;Buffer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;concat&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;bufLen&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                    &lt;span class="nx"&gt;srcServer2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;append&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;buffer&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="na"&gt;date&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;date&lt;/span&gt;&lt;span class="p"&gt;),&lt;/span&gt;
                        &lt;span class="na"&gt;flags&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Seen&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt;
                    &lt;span class="p"&gt;},&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="o"&gt;--&lt;/span&gt;&lt;span class="nx"&gt;count&lt;/span&gt; &lt;span class="o"&gt;===&lt;/span&gt; &lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Done copying!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
                            &lt;span class="nx"&gt;srcServer2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                    &lt;span class="c1"&gt;// close mail server1 connection&lt;/span&gt;
                            &lt;span class="nx"&gt;srcServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;end&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;                    &lt;span class="c1"&gt;// close mail server2 connection&lt;/span&gt;
                        &lt;span class="p"&gt;}&lt;/span&gt;
                    &lt;span class="p"&gt;});&lt;/span&gt;

                &lt;span class="p"&gt;});&lt;/span&gt;
            &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Fetch error: &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;end&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Done fetching all messages!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;};&lt;/span&gt;

&lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;srcServer2&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Imap&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;example-target@gmail.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;imap.gmail.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;993&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;tls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;tlsOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="na"&gt;rejectUnauthorized&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
    &lt;span class="p"&gt;},&lt;/span&gt;
    &lt;span class="na"&gt;authTimeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;
&lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Target mail server error:- &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;srcServer2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ready&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nx"&gt;srcServer2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;INBOX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;box&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Target mail server ready&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;srcServer1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nx"&gt;Imap&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
            &lt;span class="na"&gt;user&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;example-source@gmail.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;password&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;password&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;host&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;imap.gmail.com&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;port&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;993&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;tls&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
            &lt;span class="na"&gt;tlsOptions&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="na"&gt;rejectUnauthorized&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;
            &lt;span class="p"&gt;},&lt;/span&gt;
            &lt;span class="na"&gt;authTimeout&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;
        &lt;span class="p"&gt;}).&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Source Server Error:- &lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;srcServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;ready&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="nx"&gt;srcServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;INBOX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;true&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;box&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Source mail server ready&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

                &lt;span class="nx"&gt;copyEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;srcServer1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;srcServer2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Server1&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;})&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="nx"&gt;srcServer1&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;})&lt;/span&gt;
&lt;span class="nx"&gt;srcServer2&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;connect&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔰 To run that script, hit below command, see the output&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;node copy-mailbox.js
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;blockquote&gt;
&lt;p&gt;We’ve done it! you’ve learned major components of IMAP. We connected to an IMAP server, logged in to our email account, listed folders on the remote server, and downloaded message data, create a label, list of mail count. This is exactly what happens under the hood in email apps as you browse your mailbox.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  📗 Bonus Section
&lt;/h2&gt;

&lt;p&gt;🔰 Read Unseen email and update flag.&lt;/p&gt;

&lt;p&gt;If, we like to parse email, use &lt;code&gt;Mailparser&lt;/code&gt;. which is an advanced email parser for &lt;code&gt;Node.js&lt;/code&gt;. Install package from here [&lt;a href="https://nodemailer.com/extras/mailparser/"&gt;https://nodemailer.com/extras/mailparser/&lt;/a&gt;]&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm install mailparser --save
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="c1"&gt;// false = read only mood off, so after fetch we can update flag.&lt;/span&gt;
&lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;openBox&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;INBOX&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kc"&gt;false&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;box&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="k"&gt;throw&lt;/span&gt; &lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;search&lt;/span&gt;&lt;span class="p"&gt;([&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;UNSEEN&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;],&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;

        &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;server&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;results&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;bodies&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;simpleParser&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;mailparser&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nx"&gt;simpleParser&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

        &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;message&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;seqno&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kd"&gt;let&lt;/span&gt; &lt;span class="nx"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;headers&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;body&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;''&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;body&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;info&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;simpleParser&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                    &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;parsed&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;textAsHtml&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="p"&gt;});&lt;/span&gt;
            &lt;span class="p"&gt;});&lt;/span&gt;
            &lt;span class="nx"&gt;msg&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;attributes&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;attrs&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="nx"&gt;uid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;attrs&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;uid&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
                &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;attrs&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
            &lt;span class="p"&gt;});&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;

        &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;once&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;error&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;reject&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;err&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
        &lt;span class="p"&gt;});&lt;/span&gt;
    &lt;span class="p"&gt;});&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;👌 Congratulations. &amp;amp; Thanks for your time &amp;amp; passion.&lt;br&gt;
Feel free to comments, If you have any issues &amp;amp; queries.&lt;/p&gt;

&lt;h3&gt;
  
  
  🔰 References
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://tools.ietf.org/html/rfc3501.html"&gt;https://tools.ietf.org/html/rfc3501.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://support.google.com/accounts/answer/6010255"&gt;https://support.google.com/accounts/answer/6010255&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://myaccount.google.com/lesssecureapps"&gt;https://myaccount.google.com/lesssecureapps&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://support.google.com/mail/answer/7126229"&gt;https://support.google.com/mail/answer/7126229&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://github.com/mscdex/node-imap"&gt;https://github.com/mscdex/node-imap&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://nodemailer.com/extras/mailparser/"&gt;https://nodemailer.com/extras/mailparser/&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>node</category>
      <category>imap</category>
      <category>email</category>
      <category>javascript</category>
    </item>
  </channel>
</rss>
