<?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>DEV Community: Nitin Garg</title>
    <description>The latest articles on DEV Community by Nitin Garg (@ernitingarg).</description>
    <link>https://dev.to/ernitingarg</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%2F1116133%2F412cc112-778f-4948-b98b-9d0d108e26d7.jpeg</url>
      <title>DEV Community: Nitin Garg</title>
      <link>https://dev.to/ernitingarg</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ernitingarg"/>
    <language>en</language>
    <item>
      <title>Design pattern using c#</title>
      <dc:creator>Nitin Garg</dc:creator>
      <pubDate>Thu, 24 Aug 2023 14:05:36 +0000</pubDate>
      <link>https://dev.to/ernitingarg/design-pattern-using-c-614</link>
      <guid>https://dev.to/ernitingarg/design-pattern-using-c-614</guid>
      <description>&lt;p&gt;Design patterns are reusable solutions to common problems that occur during software design and development. They are like templates or blueprints that provide a structured way to solve recurring design challenges in a software application. These patterns are not specific to a particular programming language or technology; instead, they offer general guidelines and best practices for designing robust, maintainable, and efficient software.&lt;/p&gt;

&lt;p&gt;There are mainly 3 categories of design patterns introduced by the "Gang of Four" (GoF) in their book "Design Patterns: Elements of Reusable Object-Oriented Software." explained below:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creational Patterns:&lt;/strong&gt; These patterns deal with object creation mechanisms, abstracting the instantiation process.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-02-abstract_factory-md"&gt;Abstract Factory&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-03-builder-md"&gt;Builder&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-01-factory-md"&gt;Factory Method&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-04-prototype-md"&gt;Prototype&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-05-singleton-md"&gt;Singleton&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Structural Patterns:&lt;/strong&gt; These patterns focus on how objects are composed or structured to form larger, more complex structures. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-06-adapter-md"&gt;Adapter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-07-bridge-md"&gt;Bridge&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-08-composite-md"&gt;Composite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-09-decorator-md"&gt;Decorator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-10-facade-md"&gt;Facade&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-11-flyweight-md"&gt;Flyweight&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-12-proxy-md"&gt;Proxy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Behavioral Patterns:&lt;/strong&gt; These patterns are concerned with how objects interact and communicate with one another.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-13-chain_of_responsibility-md"&gt;Chain of Resp.&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-14-command-md"&gt;Command&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-15-interpreter-md"&gt;Interpreter&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-16-iterator-md"&gt;Iterator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-17-mediator-md"&gt;Mediator&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-18-memento-md"&gt;Memento&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-19-observer-md"&gt;Observer&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-20-state-md"&gt;State&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-21-strategy-md"&gt;Strategy&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-22-template-md"&gt;Template&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://gist.github.com/ernitingarg/179a443096752c84353853b9d303373e#file-23-visitor-md"&gt;Visitor&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>designpatterns</category>
      <category>csharp</category>
      <category>tutorial</category>
      <category>dotnet</category>
    </item>
    <item>
      <title>How to create Memory Dumps for dotnet applications in Linux?</title>
      <dc:creator>Nitin Garg</dc:creator>
      <pubDate>Mon, 10 Jul 2023 00:19:23 +0000</pubDate>
      <link>https://dev.to/ernitingarg/how-to-create-and-analyze-memory-dumps-for-dotnet-applications-in-linux-3o8m</link>
      <guid>https://dev.to/ernitingarg/how-to-create-and-analyze-memory-dumps-for-dotnet-applications-in-linux-3o8m</guid>
      <description>&lt;p&gt;Memory dumps are invaluable diagnostic tools for analyzing system performance and identifying memory leaks. In this blog post, we will walk you through the process of creating memory dumps on Linux machines, specifically focusing on dotnet applications. Additionally, we'll explore how to transfer the memory dump to your local Windows machine and perform analysis using the dot memory tool. Let's dive in!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating Memory Dump on Linux for dotnet application:&lt;/strong&gt;&lt;br&gt;
To begin, we need to install the necessary diagnostic tools. Follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Login to the Linux machine using SSH.&lt;/li&gt;
&lt;li&gt;Run the following commands to install the diagnostic tools:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update 
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;wget
&lt;span class="nb"&gt;sudo &lt;/span&gt;wget https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb 
&lt;span class="nb"&gt;sudo &lt;/span&gt;dpkg &lt;span class="nt"&gt;-i&lt;/span&gt; packages-microsoft-prod.deb 
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt update
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;apt-transport-https 
&lt;span class="nb"&gt;sudo &lt;/span&gt;apt &lt;span class="nb"&gt;install &lt;/span&gt;dotnet-sdk-6.0 &lt;span class="nt"&gt;-y&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dotnet &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;dotnet tool &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--tool-path&lt;/span&gt; /tools dotnet-trace
&lt;span class="nb"&gt;sudo &lt;/span&gt;dotnet tool &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--tool-path&lt;/span&gt; /tools dotnet-counters
&lt;span class="nb"&gt;sudo &lt;/span&gt;dotnet tool &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--tool-path&lt;/span&gt; /tools dotnet-dump
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Once the tools are installed, navigate to the &lt;code&gt;/tools&lt;/code&gt; directory and verify the installation by running:
&lt;/li&gt;
&lt;/ul&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; /tools
./dotnet-dump &lt;span class="nt"&gt;--help&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Identify the process for which you want to create a memory dump. Execute the following command to find the process ID:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;ps aux
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Finally, create the memory dump using the dotnet-dump tool:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;./dotnet-dump collect &lt;span class="nt"&gt;-p&lt;/span&gt; &amp;lt;pid&amp;gt; &lt;span class="nt"&gt;-o&lt;/span&gt; &amp;lt;dump_file_path&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Replace &lt;code&gt;&amp;lt;pid&amp;gt;&lt;/code&gt; with the process ID and  with the desired path to save the memory dump.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Transferring the Memory Dump to your Local Machine:&lt;/strong&gt;&lt;br&gt;
Once you have the memory dump file on the Linux machine, follow these steps to transfer it to your local Windows machine:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open Git Bash or a command prompt on your local machine.&lt;/li&gt;
&lt;li&gt;Use the scp command to copy the memory dump snapshot from the remote Linux machine to your local Windows machine:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;scp &lt;span class="nt"&gt;-r&lt;/span&gt; remote_vm_username@remote_vm_ip_address:remote_path_for_dump_snapshot local_path_for_dump_snapshot
&lt;span class="c"&gt;#Example&lt;/span&gt;
scp &lt;span class="nt"&gt;-r&lt;/span&gt; user1@60.60.100.100:/home/user1/dump_2023_21 /c/dumps
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Analyzing the Memory Dump using dot memory tool:&lt;/strong&gt;&lt;br&gt;
To analyze the memory dump on your local Windows machine, follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install the &lt;a href="https://www.jetbrains.com/dotmemory/"&gt;dot-memory&lt;/a&gt; tool on your Windows machine.&lt;/li&gt;
&lt;li&gt;Launch the dot-memory tool.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;Import the Process Dump&lt;/code&gt; snapshot obtained from the memory dump you transferred earlier.&lt;/li&gt;
&lt;li&gt;Explore the various analysis features and tools provided by dot-memory to identify and analyze memory leaks effectively.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Conclusion:&lt;br&gt;
Memory dumps are indispensable when it comes to diagnosing system performance issues and memory leaks. In this blog post, we discussed the step-by-step process of creating memory dumps on Linux machines for dotnet applications. We also covered the procedure for transferring the memory dump snapshot to your local Windows machine and using the dot memory tool to perform analysis. By following these guidelines, you can effectively investigate and resolve memory-related issues in your Linux environment.&lt;/p&gt;

</description>
      <category>memorydump</category>
      <category>dotnet</category>
      <category>linux</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>How to create free certificate with Let's Encrypt?</title>
      <dc:creator>Nitin Garg</dc:creator>
      <pubDate>Sun, 09 Jul 2023 10:09:13 +0000</pubDate>
      <link>https://dev.to/ernitingarg/how-to-create-free-certificate-with-lets-encrypt-453n</link>
      <guid>https://dev.to/ernitingarg/how-to-create-free-certificate-with-lets-encrypt-453n</guid>
      <description>&lt;p&gt;Securing your web applications and websites with valid SSL/TLS certificates is essential for ensuring the privacy and security of user data. &lt;a href="https://letsencrypt.org"&gt;Let's Encrypt&lt;/a&gt;, a free and open certificate authority, provides an easy and automated way to obtain and manage SSL/TLS certificates. In this blog post, we will guide you through the process of creating a DNS validation server certificate using &lt;a href="https://letsencrypt.org/"&gt;Let's Encrypt&lt;/a&gt; and &lt;a href="https://certbot.eff.org/"&gt;Certbot&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 1: Add an A Record&lt;/strong&gt;&lt;br&gt;
Before obtaining a certificate, you need to have a root domain (e.g, &lt;code&gt;mydomain.com&lt;/code&gt;) registered. Choose a DNS registrar and log in to your account. Create an A record for the application under your domain (e.g., &lt;code&gt;myapp.mydomain.com&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 2: Install Certbot&lt;/strong&gt;&lt;br&gt;
Certbot is a popular Let's Encrypt client developed by the Electronic Frontier Foundation (EFF). It simplifies the process of obtaining and managing certificates. Install Certbot on your server by following these steps:&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;sudo &lt;/span&gt;apt-get update
&lt;span class="nb"&gt;sudo &lt;/span&gt;snap &lt;span class="nb"&gt;install &lt;/span&gt;core&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="nb"&gt;sudo &lt;/span&gt;snap refresh core
&lt;span class="nb"&gt;sudo &lt;/span&gt;snap &lt;span class="nb"&gt;install&lt;/span&gt; &lt;span class="nt"&gt;--classic&lt;/span&gt; certbot
&lt;span class="nb"&gt;sudo ln&lt;/span&gt; &lt;span class="nt"&gt;-s&lt;/span&gt; /snap/bin/certbot /usr/bin/certbot
&lt;span class="nb"&gt;sudo &lt;/span&gt;certbot &lt;span class="nt"&gt;--version&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 3: Create Certificates&lt;/strong&gt;&lt;br&gt;
Certbot provides various methods for domain validation and certificate retrieval. We will use Certbot's standalone mode, which runs a built-in web server to handle the validation process. Follow these steps to obtain your certificate:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Make sure port 80 is open in your firewall to allow Let's Encrypt to verify your domain:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;ufw allow 80
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Run the following Certbot command to obtain the certificate:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;certbot certonly &lt;span class="nt"&gt;--standalone&lt;/span&gt; &lt;span class="nt"&gt;--preferred-challenges&lt;/span&gt; http &lt;span class="nt"&gt;-d&lt;/span&gt; &lt;span class="o"&gt;[&lt;/span&gt;domain-name]
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;Replace &lt;code&gt;[domain-name]&lt;/code&gt; with your domain name (e.g., &lt;code&gt;myapp.mydomain.com&lt;/code&gt;).&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Note: By default, certbot creates all relevant certs files under /etc/letsencrypt/live/&lt;code&gt;[domain-name]&lt;/code&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Step 4: Convert PEM to P12 Format&lt;/strong&gt;&lt;br&gt;
To use the certificate in certain environments or platforms that require the P12 format, you need to convert the certificate from PEM to P12. Use the following OpenSSL 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;sudo &lt;/span&gt;openssl pkcs12 &lt;span class="nt"&gt;-export&lt;/span&gt; &lt;span class="nt"&gt;-out&lt;/span&gt; /path_to_store_p12_file/server.p12 &lt;span class="nt"&gt;-in&lt;/span&gt; /etc/letsencrypt/live/[domain-name]/fullchain.pem &lt;span class="nt"&gt;-inkey&lt;/span&gt; /etc/letsencrypt/live/[domain-name]/privkey.pem &lt;span class="nt"&gt;-passin&lt;/span&gt; pass: &lt;span class="nt"&gt;-passout&lt;/span&gt; pass:
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Step 5: Set Up Auto Renewal&lt;/strong&gt;&lt;br&gt;
Let's Encrypt certificates have a validity period of 90 days. To ensure uninterrupted service, set up a cron job to automatically renew your certificates. Follow these steps:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Delete the default Certbot cron job:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;grep &lt;/span&gt;certbot /etc/cron.&lt;span class="k"&gt;*&lt;/span&gt;/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;span class="nb"&gt;sudo rm&lt;/span&gt; &lt;span class="nt"&gt;-rf&lt;/span&gt; /etc/cron.d/certbot
&lt;span class="nb"&gt;grep &lt;/span&gt;certbot /etc/cron.&lt;span class="k"&gt;*&lt;/span&gt;/&lt;span class="k"&gt;*&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;service cron reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart cron.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Edit the Certbot renewal configuration file:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;nano /etc/letsencrypt/renewal/[domain-name].conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Update the file to add &lt;code&gt;renew_hook&lt;/code&gt; parameter which should convert PEM to P12, replace the old certificate and restart the application (Please modify it as per your need) :
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;renewalparams]
account &lt;span class="o"&gt;=&lt;/span&gt; db23cbfd3bb32421da493553c16b78de
pref_challs &lt;span class="o"&gt;=&lt;/span&gt; http-01,
authenticator &lt;span class="o"&gt;=&lt;/span&gt; standalone
server &lt;span class="o"&gt;=&lt;/span&gt; https://acme-v02.api.letsencrypt.org/directory
renew_hook &lt;span class="o"&gt;=&lt;/span&gt; openssl pkcs12 &lt;span class="nt"&gt;-export&lt;/span&gt; &lt;span class="nt"&gt;-out&lt;/span&gt; /path_to_store_p12_file/server.p12 &lt;span class="nt"&gt;-in&lt;/span&gt; /etc/letsencrypt/live/[domain-name]/fullchain.pem &lt;span class="nt"&gt;-inkey&lt;/span&gt; /etc/letsencrypt/live/[domain-name]/privkey.pem &lt;span class="nt"&gt;-passin&lt;/span&gt; pass: &lt;span class="nt"&gt;-passout&lt;/span&gt; pass: &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; systemctl restart myapp
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Create an override file for the Certbot timer:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl edit snap.certbot.renew.timer
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Add the following content to the new file, specify the cron time when cerbot should check the expiration of the certificate:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="o"&gt;[&lt;/span&gt;Timer]
&lt;span class="nv"&gt;OnCalendar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;
&lt;span class="nv"&gt;OnCalendar&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;Tue &lt;span class="k"&gt;*&lt;/span&gt;-&lt;span class="k"&gt;*&lt;/span&gt;-&lt;span class="k"&gt;*&lt;/span&gt; 15:30
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;ul&gt;
&lt;li&gt;Restart the necessary services:
&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl daemon-reload
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart snap.certbot.renew.timer
&lt;span class="nb"&gt;sudo &lt;/span&gt;systemctl restart snap.certbot.renew.service
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;


&lt;p&gt;&lt;strong&gt;Conclusion:&lt;/strong&gt;&lt;br&gt;
By following these steps, you can easily create a DNS validation server certificate using Let's Encrypt and Certbot. The automated renewal process ensures that your certificates remain valid and up-to-date. Securing your web applications and websites has never been easier, thanks to Let's Encrypt's free and open certificate authority.&lt;/p&gt;

&lt;p&gt;Remember to check the provided log files for any issues or errors. Please refer 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="c"&gt;# For current logs&lt;/span&gt;
&lt;span class="nb"&gt;sudo cat&lt;/span&gt; /var/log/letsencrypt/letsencrypt.log

&lt;span class="c"&gt;# For older logs&lt;/span&gt;
&lt;span class="nb"&gt;sudo &lt;/span&gt;zcat /var/log/letsencrypt/letsencrypt.log.1.gz.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Hope you like my very first post.&lt;/p&gt;

&lt;p&gt;Happy securing!&lt;/p&gt;

</description>
      <category>certificate</category>
      <category>security</category>
      <category>web</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
