<?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: Muhammad ABir</title>
    <description>The latest articles on DEV Community by Muhammad ABir (@muhammadabir).</description>
    <link>https://dev.to/muhammadabir</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%2F834783%2F523cdaea-2256-4de2-a6d7-13ecedf2ff3c.jpg</url>
      <title>DEV Community: Muhammad ABir</title>
      <link>https://dev.to/muhammadabir</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/muhammadabir"/>
    <language>en</language>
    <item>
      <title>How to Automatically Remove All LinkedIn Connections with Python</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Wed, 13 Nov 2024 15:08:37 +0000</pubDate>
      <link>https://dev.to/muhammadabir/how-to-automatically-remove-all-linkedin-connections-with-python-3h7m</link>
      <guid>https://dev.to/muhammadabir/how-to-automatically-remove-all-linkedin-connections-with-python-3h7m</guid>
      <description>&lt;p&gt;Are you tired of manually removing LinkedIn connections one by one? It can be time-consuming and frustrating, especially if you have hundreds or even thousands of connections that you no longer need. Well, I’ve created a solution for you!&lt;/p&gt;

&lt;p&gt;With this Python script, you can automatically remove unwanted LinkedIn connections with just a few lines of code. This script uses &lt;strong&gt;Selenium&lt;/strong&gt; to interact with LinkedIn’s web interface, mimicking human behavior, and automating the process of removing connections. No need to worry about account bans, as the script simulates human-like interaction with pauses between actions.&lt;/p&gt;

&lt;h2&gt;
  
  
  Key Features:
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Automates the Removal of LinkedIn Connections&lt;/strong&gt;: Save time by removing unwanted connections in bulk.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Human-Like Interaction&lt;/strong&gt;: The script waits between actions, ensuring that LinkedIn doesn’t flag your account for suspicious activity.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Easy to Use&lt;/strong&gt;: Simply input your login credentials, run the script, and let it do the rest!&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  How It Works:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;strong&gt;Login to LinkedIn&lt;/strong&gt;: The script logs into your LinkedIn account using your email and password stored in an &lt;code&gt;.env&lt;/code&gt; file for added security.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Navigate to Connections Page&lt;/strong&gt;: It goes directly to your LinkedIn connections page, where all your connections are listed.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Click and Remove&lt;/strong&gt;: For each connection, the script clicks the "More" button, selects "Remove Connection," and confirms the removal.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Continuous Removal&lt;/strong&gt;: The script continues to remove connections one by one with pauses between actions to simulate human behavior.&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  How to Use:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Clone the repository or download the script from the GitHub link.&lt;/li&gt;
&lt;li&gt;Set up your environment by installing the required dependencies and creating a &lt;code&gt;.env&lt;/code&gt; file with your LinkedIn credentials.&lt;/li&gt;
&lt;li&gt;Run the script, sit back, and let it do the work!&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  Requirements:
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Python 3.10.x&lt;/li&gt;
&lt;li&gt;Selenium&lt;/li&gt;
&lt;li&gt;Firefox&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  Final Words:
&lt;/h2&gt;

&lt;p&gt;This script is a simple yet powerful tool for anyone who needs to clean up their LinkedIn connections. Whether you’ve added people by mistake or just want to declutter your network, this script will save you time and effort.&lt;/p&gt;

&lt;p&gt;If you found this post helpful, make sure to like and comment below. Don’t forget to check out the full script on &lt;a href="https://the-zero-byte.blogspot.com/2024/11/how-to-automatically-remove-all.html" rel="noopener noreferrer"&gt;Blog&lt;/a&gt; and watch the video tutorial &lt;a href="https://youtu.be/lCABfevLJjM" rel="noopener noreferrer"&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Happy coding! 🚀&lt;/p&gt;

</description>
      <category>python</category>
      <category>selenium</category>
      <category>automation</category>
      <category>webscraping</category>
    </item>
    <item>
      <title>Sending Emails with Queues in Node.js - Improve Your App’s Email Deliverys</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Wed, 06 Nov 2024 14:14:39 +0000</pubDate>
      <link>https://dev.to/muhammadabir/sending-emails-with-queues-in-nodejs-improve-your-apps-email-deliverys-2gog</link>
      <guid>https://dev.to/muhammadabir/sending-emails-with-queues-in-nodejs-improve-your-apps-email-deliverys-2gog</guid>
      <description>&lt;h2&gt;
  
  
  Why You Need an Email Queue System in Node.js for Scalable, Fast Email Delivery
&lt;/h2&gt;

&lt;p&gt;When building modern web applications, handling email communication is a critical feature. Whether you're sending verification emails, password resets, or notifications, ensuring fast and reliable delivery is essential. However, sending emails directly from the application can slow down your user experience and increase server load. This is where email queues come in—offering a solution to these challenges while improving overall performance.&lt;/p&gt;

&lt;p&gt;In this article, we’ll explore how you can implement an email queue system in Node.js, why it’s important, and how it can drastically improve your app’s email delivery process.&lt;/p&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Setting Up an Email Queue in Node.js&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Let’s dive into how you can implement an email queue system using Node.js and &lt;strong&gt;Bull&lt;/strong&gt;, a popular queue library for handling jobs in Node.js.&lt;/p&gt;

&lt;h3&gt;
  
  
  1. &lt;strong&gt;Install Required Packages&lt;/strong&gt;
&lt;/h3&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm init &lt;span class="nt"&gt;-y&lt;/span&gt;
npm i express nodemailer ioredis bull dotenv
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;nodemailer&lt;/code&gt; is used for sending emails.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;bull&lt;/code&gt; is a powerful job queue library for Node.js.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;dotenv&lt;/code&gt; is used for managing environment variables.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;File Structure&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;-root
 |-lib
   |-emailService.js       # Handles email sending logic
   |-emailQueue.js         # Manages the email queue
-server.js                 # Main server file to run the app
-package.json              # Contains app dependencies and scripts
-package-lock.json         # Ensures consistent dependency versions
-.env                      # Stores sensitive data like email credentials and Redis config
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;In this structure:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;  &lt;code&gt;emailService.js&lt;/code&gt; will handle the actual logic for sending emails.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;emailQueue.js&lt;/code&gt; will manage the queue where email jobs are placed and processed.&lt;/li&gt;
&lt;li&gt;  &lt;code&gt;.env&lt;/code&gt; will store sensitive information like email credentials and Redis configuration.&lt;/li&gt;
&lt;/ul&gt;

&lt;h4&gt;
  
  
  Inside .env file
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;REDIS_HOST=127.0.0.1
REDIS_PORT=6379

MAIL_HOST=
MAIL_PORT=
MAIL_USER=
MAIL_PASS=
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  2. &lt;strong&gt;Create the Email Service (lib/emailService.js)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;emailService.js&lt;/code&gt; file will contain the logic to send emails using &lt;strong&gt;Nodemailer&lt;/strong&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;nodemailer&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;nodemailer&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;config&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;transporter&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;nodemailer&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;createTransport&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="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MAIL_HOST&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="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MAIL_PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="na"&gt;secure&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;auth&lt;/span&gt;&lt;span class="p"&gt;:&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="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MAIL_USER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;pass&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MAIL_PASS&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;exports&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sendEmail&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;emailOptions&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="k"&gt;return&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;transporter&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendMail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;emailOptions&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;h3&gt;
  
  
  3. &lt;strong&gt;Create the Email Queue (lib/emailQueue.js)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;emailQueue.js&lt;/code&gt; file will set up the queue and process email jobs using &lt;strong&gt;Bull&lt;/strong&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;Queue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;bull&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;emailService&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./emailService&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;dotenv&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;config&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;emailQueue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Queue&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;emailQueue&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;redis&lt;/span&gt;&lt;span class="p"&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="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REDIS_HOST&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="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;REDIS_PORT&lt;/span&gt;
  &lt;span class="p"&gt;},&lt;/span&gt;
  &lt;span class="na"&gt;limiter&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="na"&gt;max&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;duration&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;
  &lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;

&lt;span class="c1"&gt;// Process emails in the queue&lt;/span&gt;
&lt;span class="nx"&gt;emailQueue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;process&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;job&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Processing job &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; for &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;to&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="k"&gt;try&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;subject&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;html&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;data&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;emailOptions&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;MAIL_USER&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;to&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;subject&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;html&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
    &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;emailService&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendEmail&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;emailOptions&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Email sent to &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;to&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="p"&gt;}&lt;/span&gt; &lt;span class="k"&gt;catch &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="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="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Error sending email: &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;message&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;// Automatically retry failed jobs (up to 3 attempts)&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;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;attemptsMade&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="mi"&gt;3&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;error&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="c1"&gt;// Error handling&lt;/span&gt;
&lt;span class="nx"&gt;emailQueue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;on&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;failed&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;job&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="nf"&gt;error&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Job &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;job&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt; failed: &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;message&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="p"&gt;});&lt;/span&gt;

&lt;span class="nx"&gt;module&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;exports&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;emailQueue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. &lt;strong&gt;Create the Email Queue (lib/emailQueue.js)&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;The &lt;code&gt;server.js&lt;/code&gt; file is the entry point of your application. It will set up the routes and initiate the email queue:&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;express&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;express&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;emailQueue&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;require&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;./lib/emailQueue&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;app&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;express&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;use&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;express&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;

&lt;span class="c1"&gt;// Sample route to trigger email sending&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;post&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;/signup&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="k"&gt;async &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;res&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="kd"&gt;const&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nx"&gt;username&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;password&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;req&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;body&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

  &lt;span class="c1"&gt;// signup logics here &lt;/span&gt;

  &lt;span class="c1"&gt;// Generate a 6-digit OTP&lt;/span&gt;
  &lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;otp&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;floor&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;100000&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nb"&gt;Math&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;random&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;900000&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;toString&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;otpExpiresAt&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;Date&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;now&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="mi"&gt;5&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;60&lt;/span&gt; &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="mi"&gt;1000&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt; &lt;span class="c1"&gt;// OTP expires in 5 minutes&lt;/span&gt;

  &lt;span class="c1"&gt;// Add email to the queue&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;emailQueue&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;add&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
    &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;subject&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Verify Your Email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
    &lt;span class="na"&gt;text&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`Your verification code is: &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;otp&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="na"&gt;html&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s2"&gt;`&amp;lt;p&amp;gt;Your verification code is: &amp;lt;strong&amp;gt;&lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;otp&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;&amp;lt;/strong&amp;gt;&amp;lt;/p&amp;gt;`&lt;/span&gt;
  &lt;span class="p"&gt;});&lt;/span&gt;

  &lt;span class="nx"&gt;res&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;json&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt; &lt;span class="na"&gt;message&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Signup successful. Please check your email for the OTP verification code.&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;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;8000&lt;/span&gt;&lt;span class="p"&gt;,&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Server is running on port 8000&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  &lt;strong&gt;Why Email Queues are Essential&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Using an email queue system in your Node.js application provides several benefits:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Non-blocking Operations&lt;/strong&gt;: Email sending is offloaded to a background process, preventing it from blocking the main application thread. This leads to a faster, more responsive user experience.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Scalability&lt;/strong&gt;: As your application grows and the volume of emails increases, email queues allow you to scale efficiently by processing emails in the background without overloading your system.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Reliability&lt;/strong&gt;: Email queues often come with retry mechanisms, ensuring that emails are reattempted in case of failure, and preventing the loss of critical messages.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Optimized Server Performance&lt;/strong&gt;: By handling emails asynchronously, you can better manage server load, reduce latency, and avoid timeouts, especially when your application experiences traffic spikes.&lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h3&gt;
  
  
  &lt;strong&gt;Conclusion&lt;/strong&gt;
&lt;/h3&gt;

&lt;p&gt;Implementing an email queue system in Node.js is a simple yet powerful way to optimize email delivery, improve server performance, and provide a seamless user experience. By offloading email sending to a background process, you can avoid blocking your main application flow, ensuring that your users don’t face slow loading times or interrupted services. Whether you're sending OTPs, password reset emails, or notifications, an email queue can enhance scalability, reliability, and overall performance, keeping your app running smoothly even as your user base grows.&lt;/p&gt;

&lt;p&gt;For the complete code, visit the &lt;a href="https://github.com/muhammadabir64/node-email-queue" rel="noopener noreferrer"&gt;GitHub repository&lt;/a&gt;, and don’t forget to &lt;a href="https://www.youtube.com/watch?v=n7AIa1ZsWYc&amp;amp;t=1s" rel="noopener noreferrer"&gt;watch the full tutorial&lt;/a&gt; for an in-depth, hands-on guide.&lt;/p&gt;

</description>
      <category>node</category>
      <category>redis</category>
      <category>queue</category>
      <category>backend</category>
    </item>
    <item>
      <title>Regex Simplified: The Art of Pattern Matching with Regular Expressions</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Sat, 11 Feb 2023 07:08:52 +0000</pubDate>
      <link>https://dev.to/muhammadabir/regex-simplified-the-art-of-pattern-matching-with-regular-expressions-319h</link>
      <guid>https://dev.to/muhammadabir/regex-simplified-the-art-of-pattern-matching-with-regular-expressions-319h</guid>
      <description>&lt;p&gt;Regular expressions (regex) are a powerful tool for matching and manipulating strings. They are used in many programming languages, including Python, JavaScript, Perl, and Ruby, to name a few. Regex patterns are used to search, match, and replace text, and they are an essential part of many text processing applications.&lt;/p&gt;

&lt;p&gt;A regex pattern is a combination of characters that define a searchable pattern. It consists of literal characters and special characters known as metacharacters. Literal characters, such as letters, numbers, and symbols, match themselves exactly. Metacharacters, on the other hand, have special meaning and are used to match specific types of characters or groups of characters. Some common metacharacters include:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;code&gt;:&lt;/code&gt; Escapes a special character, making it a literal character&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;.&lt;/code&gt; Matches any single character except for a newline&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;*&lt;/code&gt; Matches zero or more occurrences of the preceding character or group&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;+&lt;/code&gt; Matches one or more occurrences of the preceding character or group&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;?&lt;/code&gt; Matches zero or one occurrence of the preceding character or group&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;^&lt;/code&gt; Matches the beginning of a line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;$&lt;/code&gt; Matches the end of a line&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[]&lt;/code&gt; Matches any character within the brackets&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;[^]&lt;/code&gt; Matches any character not within the brackets&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;{m,n}&lt;/code&gt; Matches between m and n occurrences of the preceding character or group&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;( )&lt;/code&gt; Grouping characters and capturing groups&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;|&lt;/code&gt; Alternation, matches either the expression before or the expression after the &lt;code&gt;|&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\d&lt;/code&gt; Matches a digit (equal to [0-9])&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\D&lt;/code&gt; Matches a non-digit (equal to [^0-9])&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\w&lt;/code&gt; Matches a word character (equal to [a-zA-Z0-9_])&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\W&lt;/code&gt; Matches a non-word character (equal to [^a-zA-Z0-9_])&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\s&lt;/code&gt; Matches a whitespace character (equal to [\t\n\r\f\v ])&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\S&lt;/code&gt; Matches a non-whitespace character (equal to [^\t\n\r\f\v ])&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\b&lt;/code&gt; Matches a word boundary&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\B&lt;/code&gt; Matches a non-word boundary&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\A&lt;/code&gt; Matches the beginning of the string&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\Z&lt;/code&gt; Matches the end of the string, or before the newline at the end of the string&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;\z&lt;/code&gt; Matches the end of the string&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Regex patterns are used with the &lt;code&gt;match()&lt;/code&gt;, &lt;code&gt;search()&lt;/code&gt;, and &lt;code&gt;sub()&lt;/code&gt; functions in most programming languages. The &lt;code&gt;match()&lt;/code&gt; function matches the pattern at the beginning of the string, while the &lt;code&gt;search()&lt;/code&gt; function scans the entire string for the first occurrence of the pattern. The &lt;code&gt;sub()&lt;/code&gt; function is used to replace matched patterns with new text.&lt;/p&gt;

&lt;p&gt;One of the key benefits of using regex is its ability to match complex patterns with a single expression. For example, you can use a regex pattern to match email addresses, URLs, phone numbers, and more. Regex patterns can also be used to validate user input, such as checking if a string is a valid password.&lt;/p&gt;

&lt;p&gt;It's important to note that regex can become complex and difficult to read, especially when matching multiple patterns or using complex expressions. In these cases, it's a good idea to break down the pattern into smaller parts and test each part individually.&lt;/p&gt;

&lt;p&gt;In conclusion, regex patterns are an essential tool for text processing and manipulation. They allow developers to match and manipulate strings with great precision, saving time and reducing the number of lines of code required. Whether you're a seasoned developer or just starting out, it's important to familiarize yourself with regex and add it to your toolkit.&lt;/p&gt;

&lt;p&gt;here is an simple example of regex in different language:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;in python
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;

&lt;span class="c1"&gt;# Match email addresses
&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;example@gmail.com&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;compile&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sa"&gt;r&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;match&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;pattern&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;email&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Email found:&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;match&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;group&lt;/span&gt;&lt;span class="p"&gt;())&lt;/span&gt;
&lt;span class="k"&gt;else&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Email not found.&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;in javascript
&lt;/li&gt;
&lt;/ul&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;email&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&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="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;pattern&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;a-zA-Z0-9._%+-&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+@&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;a-zA-Z0-9.-&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;+&lt;/span&gt;&lt;span class="se"&gt;\.[&lt;/span&gt;&lt;span class="sr"&gt;a-zA-Z&lt;/span&gt;&lt;span class="se"&gt;]{2,}&lt;/span&gt;&lt;span class="sr"&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;match&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;email&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;match&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;pattern&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;match&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Email found:&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;match&lt;/span&gt;&lt;span class="p"&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="k"&gt;else&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="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;Email not found.&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In these examples, the regular expression &lt;code&gt;[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}&lt;/code&gt; matches a string that starts with one or more characters that are letters, digits, &lt;code&gt;.&lt;/code&gt;, &lt;code&gt;_&lt;/code&gt;, &lt;code&gt;%&lt;/code&gt;, &lt;code&gt;+&lt;/code&gt;, or &lt;code&gt;-&lt;/code&gt;, followed by an @ symbol, followed by one or more characters that are letters, digits, &lt;code&gt;.&lt;/code&gt;, or &lt;code&gt;-&lt;/code&gt;, followed by a &lt;code&gt;.&lt;/code&gt; symbol and then two or more characters that are letters.&lt;/p&gt;

</description>
      <category>regex</category>
      <category>programming</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>The Ultimate MongoDB Command Cheatsheet for Developers</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Fri, 10 Feb 2023 18:00:00 +0000</pubDate>
      <link>https://dev.to/muhammadabir/the-ultimate-mongodb-command-cheatsheet-for-developers-5f9i</link>
      <guid>https://dev.to/muhammadabir/the-ultimate-mongodb-command-cheatsheet-for-developers-5f9i</guid>
      <description>&lt;p&gt;This MongoDB command cheatsheet is the perfect tool for developers who want to work more efficiently and effectively with MongoDB. With 50 of the most commonly used MongoDB commands, this reference guide provides quick and easy access to the information you need to get the job done. Whether you're new to MongoDB or an experienced user, this cheatsheet will help you streamline your development process and maximize your productivity. So, if you want to take your MongoDB skills to the next level, be sure to get this must-have cheatsheet today!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;use &amp;lt;database&amp;gt;&lt;/code&gt; switch to a specific database&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;show dbs&lt;/code&gt; list all available databases&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.createCollection(&amp;lt;collection_name&amp;gt;)&lt;/code&gt; create a new collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.insertOne(&amp;lt;document&amp;gt;)&lt;/code&gt; insert a single document into a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.insertMany([&amp;lt;document1&amp;gt;, &amp;lt;document2&amp;gt;, ...])&lt;/code&gt; insert multiple documents into a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.find()&lt;/code&gt; query all documents in a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.findOne()&lt;/code&gt; query a single document in a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.find(&amp;lt;filter&amp;gt;)&lt;/code&gt; query documents in a collection using a filter&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.findOne(&amp;lt;filter&amp;gt;)&lt;/code&gt; query a single document in a collection using a filter&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.updateOne(&amp;lt;filter&amp;gt;, &amp;lt;update&amp;gt;)&lt;/code&gt; update a single document in a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.updateMany(&amp;lt;filter&amp;gt;, &amp;lt;update&amp;gt;)&lt;/code&gt; update multiple documents in a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.deleteOne(&amp;lt;filter&amp;gt;)&lt;/code&gt; delete a single document from a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.deleteMany(&amp;lt;filter&amp;gt;)&lt;/code&gt; delete multiple documents from a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.aggregate(&amp;lt;pipeline&amp;gt;)&lt;/code&gt; perform aggregation operations on a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.count()&lt;/code&gt; count the number of documents in a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.drop()&lt;/code&gt; delete a collection and its data&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.createIndex(&amp;lt;field&amp;gt;, &amp;lt;options&amp;gt;)&lt;/code&gt; create an index on a field in a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.ensureIndex(&amp;lt;field&amp;gt;, &amp;lt;options&amp;gt;)&lt;/code&gt; ensure an index on a field in a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.getIndexes()&lt;/code&gt; list all indexes for a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.dropIndex(&amp;lt;index&amp;gt;)&lt;/code&gt; delete an index from a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.dropIndexes()&lt;/code&gt; delete all indexes from a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.reIndex()&lt;/code&gt; rebuild all indexes for a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.&amp;lt;collection_name&amp;gt;.explain()&lt;/code&gt; provide execution statistics for a query&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.runCommand({&amp;lt;command&amp;gt;})&lt;/code&gt; run a database command&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.getCollectionNames()&lt;/code&gt; list all collections in a database&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.getProfilingLevel()&lt;/code&gt; get the current profiling level&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.setProfilingLevel(&amp;lt;level&amp;gt;)&lt;/code&gt; set the profiling level&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.system.profile.find()&lt;/code&gt; query the system.profile collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.currentOp()&lt;/code&gt; display current in-progress operations&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.killOp(&amp;lt;opid&amp;gt;)&lt;/code&gt; kill a specific operation&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.serverStatus()&lt;/code&gt; display server status information&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.printCollectionStats()&lt;/code&gt; display statistics for a collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.repairDatabase()&lt;/code&gt; repair a database and its collections&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.cloneDatabase(&amp;lt;source&amp;gt;, &amp;lt;target&amp;gt;)&lt;/code&gt; clone a database to a new target database&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.copyDatabase(&amp;lt;source&amp;gt;, &amp;lt;target&amp;gt;)&lt;/code&gt; copy a database from a source to a target host&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.shutdownServer()&lt;/code&gt; shut down the MongoDB server&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.listDatabases()&lt;/code&gt; list all databases on the MongoDB server&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.stats()&lt;/code&gt; display database statistics&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.version()&lt;/code&gt; display the version of the MongoDB server&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.eval(&amp;lt;function&amp;gt;)&lt;/code&gt; evaluate a JavaScript expression on the server&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.loadServerScripts()&lt;/code&gt; load scripts stored in the `db.system.js collection&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.auth(&amp;lt;username&amp;gt;, &amp;lt;password&amp;gt;)&lt;/code&gt; authenticate as a specific user&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.logout()&lt;/code&gt; log out of the current user session&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.getUser(&amp;lt;username&amp;gt;)&lt;/code&gt; get information about a specific user&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.createUser(&amp;lt;user&amp;gt;)&lt;/code&gt; create a new user&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.updateUser(&amp;lt;username&amp;gt;, &amp;lt;user&amp;gt;)&lt;/code&gt; update an existing user&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.dropUser(&amp;lt;username&amp;gt;)&lt;/code&gt; delete a user&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.grantRolesToUser(&amp;lt;username&amp;gt;, &amp;lt;roles&amp;gt;)&lt;/code&gt; grant roles to a user&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.revokeRolesFromUser(&amp;lt;username&amp;gt;, &amp;lt;roles&amp;gt;)&lt;/code&gt; revoke roles from a user&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;db.getRole(&amp;lt;role&amp;gt;)&lt;/code&gt; get information about a specific role.&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>mongodb</category>
      <category>database</category>
      <category>cheatsheet</category>
    </item>
    <item>
      <title>Unlocking the Power of the Windows Command Prompt: 50 Must-Know Commands</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Fri, 10 Feb 2023 09:53:45 +0000</pubDate>
      <link>https://dev.to/muhammadabir/unlocking-the-power-of-the-windows-command-prompt-50-must-know-commands-3741</link>
      <guid>https://dev.to/muhammadabir/unlocking-the-power-of-the-windows-command-prompt-50-must-know-commands-3741</guid>
      <description>&lt;p&gt;Unleash the full capabilities of your Windows system with this guide to 50 underutilized Command Prompt commands. From network management to system information, these powerful yet lesser-known commands will help you streamline your workflow and get the most out of your Windows experience. Whether you're a seasoned user or just starting to explore the command line, this list has something for everyone.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;ping&lt;/code&gt; Tests connectivity to a networked device.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tracert&lt;/code&gt; Displays the path taken by packets to reach a networked device.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ipconfig&lt;/code&gt; Displays the configuration of the network adapter.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nslookup&lt;/code&gt; Queries DNS servers for information about a domain name.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat&lt;/code&gt; Displays active network connections and their status.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tasklist&lt;/code&gt; Displays a list of running processes and their information.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;taskkill&lt;/code&gt; Terminates a running process.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ftp&lt;/code&gt; Transfers files between computers using FTP.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;xcopy&lt;/code&gt; Copies files and directories from one location to another.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;net&lt;/code&gt; Manages various aspects of the network.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;dir&lt;/code&gt; Displays a list of files and directories in a folder.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd&lt;/code&gt; Changes the current working directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;type&lt;/code&gt; Displays the contents of a text file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;copy&lt;/code&gt; Copies one or more files to another location.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;xcopy&lt;/code&gt; Copies files and directories, including subdirectories, to another location.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rename&lt;/code&gt; Renames a file or directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;del&lt;/code&gt; Deletes one or more files.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rd&lt;/code&gt; Deletes a directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;md&lt;/code&gt; Creates a new directory.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cls&lt;/code&gt; Clears the command-line screen.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sort&lt;/code&gt; Sorts the contents of a text file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;find&lt;/code&gt; Searches for a text string in a file or set of files.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;grep&lt;/code&gt; Searches for a text pattern in a file or set of files.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;net user&lt;/code&gt; Manages user accounts, including adding and removing users.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;net localgroup&lt;/code&gt; Manages local user groups, including adding and removing users from groups.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;net share&lt;/code&gt; Manages shared resources, including creating and deleting shares.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;net view&lt;/code&gt; Displays a list of network resources, including computers, shares, and printers.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chkdsk&lt;/code&gt; Checks the integrity of the file system and repairs any errors it finds.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sfc /scannow&lt;/code&gt; Scans the system files and replaces any that are corrupted or missing.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;start&lt;/code&gt; Opens a program or file.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;net time&lt;/code&gt; Displays or sets the date and time on the network.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat -a&lt;/code&gt; Shows all active connections and listening ports.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat -b&lt;/code&gt; Shows the executables involved in creating each network connection or listening port.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat -r&lt;/code&gt; Shows the routing table for the local system.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;nslookup -a&lt;/code&gt; Shows the authoritative DNS server for a domain.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat -e&lt;/code&gt; Shows network statistics, including the number of bytes and packets sent and received.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat -n&lt;/code&gt; Shows active connections and listening ports, but does not attempt to resolve hostnames or service names.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat -o&lt;/code&gt; Shows the process ID associated with each network connection or listening port.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;netstat -p&lt;/code&gt; Shows the protocol associated with each network connection or listening port.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systeminfo&lt;/code&gt; Shows information about the system, including the operating system version, system uptime, and system configuration.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;whoami&lt;/code&gt; Shows the user account that is currently logged in.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;set&lt;/code&gt; Displays or sets environment variables.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;time&lt;/code&gt; Shows or sets the system time.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;date&lt;/code&gt; Shows or sets the system date.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ping -t&lt;/code&gt; Pings a networked device continuously until stopped.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ping -a&lt;/code&gt; Attempts to resolve the hostname of a networked device.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ping -n&lt;/code&gt; Specifies the number of echo requests to send.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ping -l&lt;/code&gt; Specifies the size, in bytes, of the echo request packet.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ping -f&lt;/code&gt; Specifies that the echo request packet should not be fragmented.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ping -i&lt;/code&gt; Specifies the time-to-live value for the echo request packet.`&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;These additional commands will help you further explore and utilize the power of the Windows command-line. Again, I encourage you to familiarize yourself with these commands, as well as the various options and arguments that can be used with each command, to make the most of your Windows system.&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>A Simple and Customizable Password Generator in Python</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Tue, 07 Feb 2023 08:27:42 +0000</pubDate>
      <link>https://dev.to/muhammadabir/a-simple-and-customizable-password-generator-in-python-510i</link>
      <guid>https://dev.to/muhammadabir/a-simple-and-customizable-password-generator-in-python-510i</guid>
      <description>&lt;p&gt;In today's digital age, it's important to have strong and secure passwords to protect your personal and sensitive information. However, coming up with new and unique passwords can be difficult and time-consuming. That's where a password generator comes in handy. In this article, we will be building a simple yet customizable password generator using Python.&lt;/p&gt;

&lt;h2&gt;
  
  
  The Code
&lt;/h2&gt;

&lt;p&gt;We'll start by defining the &lt;code&gt;password_generator&lt;/code&gt; function, which takes five parameters: &lt;code&gt;password_length&lt;/code&gt;, &lt;code&gt;use_lowercase&lt;/code&gt;, &lt;code&gt;use_uppercase&lt;/code&gt;, &lt;code&gt;use_digits&lt;/code&gt;, and &lt;code&gt;use_symbols&lt;/code&gt;. The password_length parameter determines the length of the generated password. The other parameters determine which character sets to include in the password. If a parameter is set to &lt;code&gt;True&lt;/code&gt;, the corresponding character set will be included in the password. If a parameter is set to &lt;code&gt;False&lt;/code&gt;, it will be excluded.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;random&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;

&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;password_generator&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;password_length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;use_lowercase&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;use_uppercase&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;use_digits&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;use_symbols&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="c1"&gt;# Define the character sets for the password based on the input
&lt;/span&gt;    &lt;span class="n"&gt;characters&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;use_lowercase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;characters&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ascii_lowercase&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;use_uppercase&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;characters&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ascii_uppercase&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;use_digits&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;characters&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;string&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;digits&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="n"&gt;use_symbols&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="n"&gt;characters&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;!@#$%^&amp;amp;*()_+=-&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;

    &lt;span class="c1"&gt;# Use random.choices() to generate a password of the desired length
&lt;/span&gt;    &lt;span class="n"&gt;password&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="sh"&gt;""&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;join&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;random&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;choices&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;characters&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;password_length&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;password&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The function uses the &lt;code&gt;string&lt;/code&gt; module's &lt;code&gt;ascii_lowercase&lt;/code&gt; and &lt;code&gt;ascii_uppercase&lt;/code&gt; constants to define the lowercase and uppercase characters, respectively. The &lt;code&gt;string&lt;/code&gt; module's &lt;code&gt;digits&lt;/code&gt; constant defines the digit characters. The symbols are defined as a string of commonly used symbols.&lt;/p&gt;

&lt;p&gt;The &lt;code&gt;random.choices()&lt;/code&gt; function is used to generate a password of the desired length. The function generates a list of random characters from the characters string and then joins the list into a single string using the &lt;code&gt;join()&lt;/code&gt; method.&lt;/p&gt;

&lt;h2&gt;
  
  
  User Input
&lt;/h2&gt;

&lt;p&gt;Next, we'll prompt the user for the desired password length and the character sets to include in the password.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="c1"&gt;# Prompt the user for the desired password length
&lt;/span&gt;&lt;span class="n"&gt;password_length&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;int&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Enter desired password length: &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

&lt;span class="c1"&gt;# Prompt the user for the character sets to include in the password
&lt;/span&gt;&lt;span class="n"&gt;use_lowercase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Include lowercase characters? (y/n): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;use_uppercase&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Include uppercase characters? (y/n): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;use_digits&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Include digits? (y/n): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;span class="n"&gt;use_symbols&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&gt;input&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Include symbols? (y/n): &lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;lower&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;==&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;y&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The user inputs are converted to boolean values using the comparison operator &lt;code&gt;== "y"&lt;/code&gt;. If the user enters "y", the corresponding parameter will be set to &lt;code&gt;True&lt;/code&gt;, otherwise it will be set to &lt;code&gt;False&lt;/code&gt;.&lt;/p&gt;

&lt;h2&gt;
  
  
  Output
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;~ python password_generator.py

Enter desired password length: 25
Include lowercase characters? &lt;span class="o"&gt;(&lt;/span&gt;y/n&lt;span class="o"&gt;)&lt;/span&gt;: n
Include uppercase characters? &lt;span class="o"&gt;(&lt;/span&gt;y/n&lt;span class="o"&gt;)&lt;/span&gt;: y
Include digits? &lt;span class="o"&gt;(&lt;/span&gt;y/n&lt;span class="o"&gt;)&lt;/span&gt;: y
Include symbols? &lt;span class="o"&gt;(&lt;/span&gt;y/n&lt;span class="o"&gt;)&lt;/span&gt;: y
Generated password: 6P&amp;amp;Y1FU&lt;span class="o"&gt;(&lt;/span&gt;^5_6RL5!&lt;span class="nv"&gt;$LWKJ4&lt;/span&gt;&lt;span class="c"&gt;#+W&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here is an web version of this &lt;a href="https://muhammadabir64.github.io/password-generator" rel="noopener noreferrer"&gt;view&lt;/a&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Linux for Power Users: A Cheatsheet of 50 Most Used Commands</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Fri, 27 Jan 2023 18:00:00 +0000</pubDate>
      <link>https://dev.to/muhammadabir/linux-command-quick-reference-for-power-users-50pb</link>
      <guid>https://dev.to/muhammadabir/linux-command-quick-reference-for-power-users-50pb</guid>
      <description>&lt;p&gt;A Linux commands cheatsheet is a quick reference guide for users to easily access and utilize various Linux commands. It includes a list of commonly used commands along with examples and explanations of their usage. This resource can be helpful for both beginners learning the Linux command line and experienced users looking to improve their efficiency and productivity. It can be used as a quick reference for daily tasks, troubleshooting, and system administration.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;
&lt;code&gt;ls&lt;/code&gt; - List files and directories in a directory. &lt;code&gt;ls /home&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cd&lt;/code&gt; - Change the current working directory. &lt;code&gt;cd /home/documents&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mkdir&lt;/code&gt; - Create a new directory. &lt;code&gt;mkdir new_directory&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rmdir&lt;/code&gt; - Remove an empty directory. &lt;code&gt;rmdir old_directory&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;rm&lt;/code&gt; - Remove files or directories. &lt;code&gt;rm file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;touch&lt;/code&gt; - Create a new file or update the timestamp of an existing file. &lt;code&gt;touch new_file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cp&lt;/code&gt; - Copy files or directories. &lt;code&gt;cp file.txt /home/documents/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;mv&lt;/code&gt; - Move or rename files or directories. &lt;code&gt;mv file.txt /home/documents/&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;pwd&lt;/code&gt; - Print the current working directory. &lt;code&gt;pwd&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cat&lt;/code&gt; - Display the contents of a file. &lt;code&gt;cat file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;less&lt;/code&gt; - Display the contents of a file one page at a time. &lt;code&gt;less file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;head&lt;/code&gt; - Display the first few lines of a file. &lt;code&gt;head file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tail&lt;/code&gt; - Display the last few lines of a file. &lt;code&gt;tail file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;grep&lt;/code&gt; - Search for a string in a file or output. &lt;code&gt;grep "search_string" file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;find&lt;/code&gt; - Search for files in a directory. &lt;code&gt;find / -name "file.txt"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;man&lt;/code&gt; - Display the manual for a command. &lt;code&gt;man ls&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chmod&lt;/code&gt; - Change file permissions. &lt;code&gt;chmod 755 file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;chown&lt;/code&gt; - Change file ownership. &lt;code&gt;chown user:group file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;su&lt;/code&gt; - Switch to another user. &lt;code&gt;su root&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;sudo&lt;/code&gt; - Run a command as the superuser. &lt;code&gt;sudo apt-get update&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;passwd&lt;/code&gt; - Change the password for a user. &lt;code&gt;passwd&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;df&lt;/code&gt; - Display filesystem usage. &lt;code&gt;df -h&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;du&lt;/code&gt; - Display disk usage for a directory. &lt;code&gt;du -sh /&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;free&lt;/code&gt; - Display memory usage. &lt;code&gt;free -m&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ps&lt;/code&gt; - Display process information. &lt;code&gt;ps aux&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;kill&lt;/code&gt; - Send a signal to a process. &lt;code&gt;kill -9 1234&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;top&lt;/code&gt; - Display real-time process information. &lt;code&gt;top&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;htop&lt;/code&gt; - A more user-friendly version of top. &lt;code&gt;htop&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;systemctl&lt;/code&gt; - Control system services. &lt;code&gt;systemctl start apache2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;apt-get&lt;/code&gt; - Package manager for Debian-based systems. &lt;code&gt;apt-get update&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;yum&lt;/code&gt; - Package manager for Red Hat-based systems. &lt;code&gt;yum update&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;wget&lt;/code&gt; - Download files from the internet. &lt;code&gt;wget https://example.com/file.zip&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;curl&lt;/code&gt; - Transfer data from or to a server using various protocols. &lt;code&gt;curl https://example.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ping&lt;/code&gt; - Test the connectivity to a host. &lt;code&gt;ping example.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;traceroute&lt;/code&gt; - Trace the route to a host. &lt;code&gt;traceroute example.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;ssh&lt;/code&gt; - Securely connect to a remote host. &lt;code&gt;ssh user@example.com&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;scp&lt;/code&gt; - Securely copy files to or from a remote host. &lt;code&gt;scp file.txt user@example.com:/path/to/file&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;tar&lt;/code&gt; - Create or extract files from a tar archive. &lt;code&gt;tar -xvf file.tar&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gzip&lt;/code&gt; - Compress or decompress files. &lt;code&gt;gzip file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;gunzip&lt;/code&gt; - Decompress files compressed with gzip. &lt;code&gt;gunzip file.txt.gz&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bzip2&lt;/code&gt; - Compress or decompress files. &lt;code&gt;bzip2 file.txt&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bunzip2&lt;/code&gt; - Decompress files compressed with bzip2. &lt;code&gt;bunzip2 file.txt.bz2&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;uname&lt;/code&gt; - Display system information. &lt;code&gt;uname -a&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;date&lt;/code&gt; - Display the current date and time. &lt;code&gt;date&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;cal&lt;/code&gt; - Display a calendar. &lt;code&gt;cal&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;time&lt;/code&gt; - Measure the running time of a command. &lt;code&gt;time ls /&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;history&lt;/code&gt; - Display the command history. &lt;code&gt;history&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;alias&lt;/code&gt; - Create a shortcut for a command. &lt;code&gt;alias ll='ls -l'&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;bash&lt;/code&gt; - Start the Bash shell. &lt;code&gt;bash&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;exit&lt;/code&gt; - Exit the current shell. &lt;code&gt;exit&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>javascript</category>
      <category>discuss</category>
    </item>
    <item>
      <title>Git at a Glance: A Cheatsheet of 30 Must-know Commands</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Thu, 26 Jan 2023 18:00:00 +0000</pubDate>
      <link>https://dev.to/muhammadabir/git-at-a-glance-a-cheatsheet-of-30-must-know-commands-1de5</link>
      <guid>https://dev.to/muhammadabir/git-at-a-glance-a-cheatsheet-of-30-must-know-commands-1de5</guid>
      <description>&lt;p&gt;Managing code and collaborating with others can be a daunting task, but Git makes it easy. This cheatsheet is here to help you take your Git skills to the next level by providing a comprehensive list of 30 essential commands. From initializing a new repository to merging changes, this cheatsheet covers all the basics you need to know to streamline your workflow and make your life as a developer much easier. Whether you're new to Git or an experienced user, this cheatsheet is a valuable resource to have on hand.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Initialize a new repository: &lt;code&gt;git init&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Clone an existing repository: &lt;code&gt;git clone [repository url]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Check the status of your repository: &lt;code&gt;git status&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add changes to the staging area: &lt;code&gt;git add [file name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Commit changes: &lt;code&gt;git commit -m "[commit message]"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;View the commit history: &lt;code&gt;git log&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;View the difference between the working directory and the staging area: &lt;code&gt;git diff&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;View the difference between the staging area and the last commit: &lt;code&gt;git diff --staged&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Discard changes in the working directory: &lt;code&gt;git checkout [file name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Discard changes in the staging area: &lt;code&gt;git reset [file name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Discard a commit: &lt;code&gt;git revert [commit hash]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Remove a file from the repository: &lt;code&gt;git rm [file name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Rename a file in the repository: &lt;code&gt;git mv [old file name] [new file name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show the branches in the repository: &lt;code&gt;git branch&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a new branch: &lt;code&gt;git branch [branch name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Switch to a different branch: &lt;code&gt;git checkout [branch name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Merge changes from one branch to another: &lt;code&gt;git merge [branch name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show remote repositories: &lt;code&gt;git remote&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show remote repositories: &lt;code&gt;git remote -v&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add a new remote repository: &lt;code&gt;git remote add [remote name] [repository url]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Push changes to a remote repository: &lt;code&gt;git push [remote name] [branch name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Pull changes from a remote repository: &lt;code&gt;git pull [remote name] [branch name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show the tags in the repository: &lt;code&gt;git tag&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a new tag: &lt;code&gt;git tag -a [tag name] -m "[tag message]"&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Checkout a specific tag: &lt;code&gt;git checkout [tag name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show the history of a file: &lt;code&gt;git log -p [file name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show the commits that contain a certain string: &lt;code&gt;git log -S [string]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show the commits that were made by a certain author: &lt;code&gt;git log --author=[author name]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show the commits that were made in a certain date range: &lt;code&gt;git log --since=[date] --until=[date]&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show the commits that were made on a certain branch: &lt;code&gt;git log [branch name]&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Please note that this is a list of commonly used Git commands, and there are many other commands that you can use as well. Additionally, each command has many options and flags that can be used to customize its behavior. I would suggest you to use the official Git documentation to learn more about the various commands and their usage.&lt;/p&gt;

</description>
      <category>productivity</category>
      <category>career</category>
      <category>refactorit</category>
      <category>discuss</category>
    </item>
    <item>
      <title>MySQL in a Nutshell: A Handy Cheatsheet of Frequently Used Queries</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Thu, 26 Jan 2023 11:53:16 +0000</pubDate>
      <link>https://dev.to/muhammadabir/mysql-in-a-nutshell-a-handy-cheatsheet-of-frequently-used-commands-36b7</link>
      <guid>https://dev.to/muhammadabir/mysql-in-a-nutshell-a-handy-cheatsheet-of-frequently-used-commands-36b7</guid>
      <description>&lt;p&gt;This MySQL cheatsheet provides a comprehensive list of essential commands for managing and manipulating databases. From creating and modifying tables to querying and updating data, this reference guide covers all the key commands you need to know to effectively work with MySQL. Whether you're a beginner or an experienced user, this cheatsheet is a valuable resource for quickly finding the command you need.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connect to MySQL: &lt;code&gt;mysql -u [username] -p&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show all databases: &lt;code&gt;SHOW DATABASES;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a new database: &lt;code&gt;CREATE DATABASE [database name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select a database: &lt;code&gt;USE [database name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show all tables in a database: &lt;code&gt;SHOW TABLES;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a new table: &lt;code&gt;CREATE TABLE [table name] ([column name] [data type], [column name] [data type], ...);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Display the structure of a table: &lt;code&gt;DESCRIBE [table name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Insert data into a table: &lt;code&gt;INSERT INTO [table name] ([column name], [column name], ...) VALUES ([value], [value], ...);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select data from a table: &lt;code&gt;SELECT [column name], [column name], ... FROM [table name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Update data in a table: &lt;code&gt;UPDATE [table name] SET [column name] = [new value] WHERE [condition];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Delete data from a table: &lt;code&gt;DELETE FROM [table name] WHERE [condition];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select data with a condition: &lt;code&gt;SELECT [column name], [column name], ... FROM [table name] WHERE [condition];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Select data with a join: &lt;code&gt;SELECT [column name], [column name], ... FROM [table name1] JOIN [table name2] ON [table name1.[column name] = [table name2].[column name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Order data by a column: &lt;code&gt;SELECT [column name], [column name], ... FROM [table name] ORDER BY [column name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Limit the number of rows returned: &lt;code&gt;SELECT [column name], [column name], ... FROM [table name] LIMIT [number];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Count number of rows: &lt;code&gt;SELECT COUNT([column name]) FROM [table name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Sum of a column: &lt;code&gt;SELECT SUM([column name]) FROM [table name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Average of a column: &lt;code&gt;SELECT AVG([column name]) FROM [table name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Group by a column: &lt;code&gt;SELECT [column name], [aggregate function]([column name]) FROM [table name] GROUP BY [column name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a new user: &lt;code&gt;CREATE USER 'username'@'host' IDENTIFIED BY 'password';&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Grant permissions to user: &lt;code&gt;GRANT [permission] ON [database name].[table name] TO 'username'@'host';&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Revoke permissions: &lt;code&gt;REVOKE [permission] ON [database name].[table name] FROM 'username'@'host';&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show all users: &lt;code&gt;SELECT User, Host FROM mysql.user;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Change a user's password: &lt;code&gt;SET PASSWORD FOR 'username'@'host' = PASSWORD('new_password');&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Rename a table: &lt;code&gt;ALTER TABLE [table name] RENAME TO [new table name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Add a column to a table: &lt;code&gt;ALTER TABLE [table name] ADD [column name] [data type];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Modify a column in a table: &lt;code&gt;ALTER TABLE [table name] MODIFY [column name] [data type];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Drop a column from a table: &lt;code&gt;ALTER TABLE [table name] DROP COLUMN [column name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create an index: &lt;code&gt;CREATE INDEX [index name] ON [table name] ([column name]);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Drop an index: &lt;code&gt;DROP INDEX [index name] ON [table name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a primary key: &lt;code&gt;ALTER TABLE [table name] ADD PRIMARY KEY ([column name]);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a foreign key: &lt;code&gt;ALTER TABLE [table name] ADD FOREIGN KEY ([column name]) REFERENCES [referenced table name] ([referenced column name]);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a unique constraint: &lt;code&gt;ALTER TABLE [table name] ADD UNIQUE ([column name]);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a check constraint: &lt;code&gt;ALTER TABLE [table name] ADD CHECK (condition);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a trigger: &lt;code&gt;CREATE TRIGGER [trigger name] [trigger action] [event] ON [table name] FOR EACH ROW [trigger code];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Drop a trigger: &lt;code&gt;DROP TRIGGER [trigger name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a stored procedure: &lt;code&gt;CREATE PROCEDURE [procedure name] ([parameter name] [data type], ...) BEGIN [procedure code]; END;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Call a stored procedure: &lt;code&gt;CALL [procedure name]([parameter value], ...);&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Drop a stored procedure: &lt;code&gt;DROP PROCEDURE [procedure name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a view: &lt;code&gt;CREATE VIEW [view name] AS SELECT [column name], ... FROM [table name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Drop a view: &lt;code&gt;DROP VIEW [view name];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Create a backup: &lt;code&gt;mysqldump -u [username] -p [database name] &amp;gt; [file name].sql&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Restore a backup: &lt;code&gt;mysql -u [username] -p [database name] &amp;lt; [file name].sql&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show current user: &lt;code&gt;SELECT CURRENT_USER();&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show server version: &lt;code&gt;SELECT VERSION();&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show system variables: &lt;code&gt;SHOW VARIABLES;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show status: &lt;code&gt;SHOW STATUS;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Show processlist: &lt;code&gt;SHOW FULL PROCESSLIST;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Kill a process: &lt;code&gt;KILL [process id];&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;Exit MySQL: &lt;code&gt;EXIT;&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Note: replace the square bracketed placeholders with actual values.&lt;/p&gt;

</description>
      <category>learning</category>
      <category>tooling</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Python &amp; Firebase realtime messaging</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Mon, 23 Jan 2023 18:00:00 +0000</pubDate>
      <link>https://dev.to/muhammadabir/python-firebase-realtime-messaging-mi5</link>
      <guid>https://dev.to/muhammadabir/python-firebase-realtime-messaging-mi5</guid>
      <description>&lt;p&gt;Firebase Realtime Database is a cloud-hosted NoSQL database that allows you to store and sync data between your users in real-time. You can use the Firebase Realtime Database with Python using the &lt;code&gt;firebase-admin&lt;/code&gt; library. Here is an example of how to send a message to the Firebase Realtime Database using Python:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Install the firebase-admin library:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install firebase-admin
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Import the necessary modules:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="n"&gt;firebase_admin&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Initialize the Firebase Admin SDK with a service account:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;cred&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;credentials&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nc"&gt;Certificate&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;path/to/serviceAccountKey.json&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;firebase_admin&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;initialize_app&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cred&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;databaseURL&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="s"&gt;https://your-project-name.firebaseio.com&lt;/span&gt;&lt;span class="sh"&gt;'&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Get a reference to the database:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ref&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;db&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;reference&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Send a message to the database:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;messages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;push&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;text&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;Hello, World!&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;})&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;You can also listen for real-time updates to the database:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight python"&gt;&lt;code&gt;&lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;on_message&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;event_type&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# can be 'put' or 'patch'
&lt;/span&gt;    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;path&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="nf"&gt;print&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;event&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;data&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;  &lt;span class="c1"&gt;# new data at /path
&lt;/span&gt;
&lt;span class="n"&gt;my_stream&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;ref&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;child&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="s"&gt;messages&lt;/span&gt;&lt;span class="sh"&gt;"&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;stream&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;on_message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Make sure to replace "path/to/serviceAccountKey.json" with the path to your service account key and "your-project-name" with the name of your Firebase project. The file will have the following structure:&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="p"&gt;{&lt;/span&gt;
  &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;type&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="s2"&gt;service_account&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="s2"&gt;project_id&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="s2"&gt;your-project-id&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="s2"&gt;private_key_id&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="s2"&gt;your-private-key-id&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="s2"&gt;private_key&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="s2"&gt;-----BEGIN PRIVATE KEY-----&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;your-private-key&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="s2"&gt;-----END PRIVATE KEY-----&lt;/span&gt;&lt;span class="se"&gt;\n&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="s2"&gt;client_email&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="s2"&gt;your-service-account-email&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="s2"&gt;client_id&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="s2"&gt;your-client-id&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="s2"&gt;auth_uri&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="s2"&gt;https://accounts.google.com/o/oauth2/auth&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="s2"&gt;token_uri&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="s2"&gt;https://oauth2.googleapis.com/token&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="s2"&gt;auth_provider_x509_cert_url&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="s2"&gt;https://www.googleapis.com/oauth2/v1/certs&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="s2"&gt;client_x509_cert_url&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="s2"&gt;https://www.googleapis.com/robot/v1/metadata/x509/your-service-account-email&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also, you can use the python library &lt;code&gt;pyrebase&lt;/code&gt; to interact with the Firebase Realtime Database using the REST API, it has some more functionality than &lt;code&gt;firebase-admin&lt;/code&gt; library.&lt;/p&gt;

</description>
      <category>discuss</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Simple way to build an Whatsapp bot using NodeJS</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Mon, 23 Jan 2023 11:56:59 +0000</pubDate>
      <link>https://dev.to/muhammadabir/simple-way-to-build-an-whatsapp-bot-using-nodejs-40nb</link>
      <guid>https://dev.to/muhammadabir/simple-way-to-build-an-whatsapp-bot-using-nodejs-40nb</guid>
      <description>&lt;p&gt;Creating a WhatsApp bot using Node.js requires a different approach than using the Telegram Bot API. WhatsApp does not provide a public API for building bots, but there are a few different ways to build a WhatsApp bot using Node.js.&lt;/p&gt;

&lt;p&gt;One way to build a WhatsApp bot is to use the Twilio API for WhatsApp. Twilio is a cloud communications platform that provides an API for sending and receiving WhatsApp messages. To use Twilio for WhatsApp, you will need to sign up for a Twilio account and obtain a Twilio phone number that is WhatsApp-enabled.&lt;/p&gt;

&lt;p&gt;Here is an example of a basic WhatsApp bot using the Twilio Node.js library:&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;accountSid&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_ACCOUNT_SID&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;authToken&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_AUTH_TOKEN&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;client&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&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;twilio&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;)(&lt;/span&gt;&lt;span class="nx"&gt;accountSid&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="nx"&gt;authToken&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// replace with your Twilio phone number&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;whatsapp:+14155238886&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="nx"&gt;client&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;messages&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;create&lt;/span&gt;&lt;span class="p"&gt;({&lt;/span&gt;
         &lt;span class="na"&gt;body&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World!&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;from&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="k"&gt;from&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
         &lt;span class="na"&gt;to&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;whatsapp:+1234567890&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="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;message&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;sid&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
      &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;done&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This example sends a message with the text "Hello World!" from the Twilio phone number to the specified WhatsApp number.&lt;/p&gt;

&lt;p&gt;You will need to replace &lt;code&gt;YOUR_ACCOUNT_SID&lt;/code&gt; and &lt;code&gt;YOUR_AUTH_TOKEN&lt;/code&gt; with the appropriate values from your Twilio account, and replace &lt;code&gt;+1234567890&lt;/code&gt; with the phone number of the recipient.&lt;/p&gt;

&lt;p&gt;You can also use Twilio's WhatsApp Sandbox to test your bot. The Sandbox allows you to test your bot by sending and receiving messages to a pre-approved number, rather than a real phone number.&lt;/p&gt;

&lt;p&gt;Another way is to use WhatsApp Business API which can be accessed via WhatsApp Business Account, this will give you access to more functionality and features compared to Twilio.&lt;/p&gt;

&lt;p&gt;Please keep in mind that WhatsApp's policies strictly prohibit the use of automated messaging systems and bots on the platform. Make sure to read and abide by WhatsApp's guidelines when building your bot.&lt;/p&gt;

&lt;p&gt;Suggested library: &lt;a href="https://wwebjs.dev/guide" rel="noopener noreferrer"&gt;wwebjs&lt;/a&gt;&lt;/p&gt;

</description>
      <category>node</category>
      <category>bot</category>
      <category>whatsapp</category>
    </item>
    <item>
      <title>Lets build a Telegram bot using NodeJS</title>
      <dc:creator>Muhammad ABir</dc:creator>
      <pubDate>Sun, 22 Jan 2023 18:00:00 +0000</pubDate>
      <link>https://dev.to/muhammadabir/lets-build-a-telegram-bot-using-nodejs-h79</link>
      <guid>https://dev.to/muhammadabir/lets-build-a-telegram-bot-using-nodejs-h79</guid>
      <description>&lt;p&gt;To create a Telegram bot using Node.js, you will need to install the &lt;code&gt;node-telegram-bot-api&lt;/code&gt; package. This package provides an easy-to-use interface for interacting with the Telegram Bot API.&lt;/p&gt;

&lt;p&gt;Here is an example of a basic Telegram bot that can respond to messages:&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;TelegramBot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nf"&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;node-telegram-bot-api&lt;/span&gt;&lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;

&lt;span class="c1"&gt;// replace with your own token&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;token&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;YOUR_TOKEN&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;bot&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="nc"&gt;TelegramBot&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;token&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="na"&gt;polling&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;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&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="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="o"&gt;=&amp;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;chatId&lt;/span&gt; &lt;span class="o"&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;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chatId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Hello World!&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;In this example, the bot will listen for incoming messages and respond with "Hello World!" when a message is received. The &lt;code&gt;polling: true&lt;/code&gt; option tells the bot to use long polling to receive updates from Telegram.&lt;/p&gt;

&lt;p&gt;You will need to replace &lt;code&gt;YOUR_TOKEN&lt;/code&gt; with the token you received from the Bot Father after creating your bot.&lt;/p&gt;

&lt;p&gt;You can also use commands to make the bot do specific things. For example, you can make the bot respond to the command '/start' like this:&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="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;onText&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\/&lt;/span&gt;&lt;span class="sr"&gt;start/&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="o"&gt;=&amp;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;chatId&lt;/span&gt; &lt;span class="o"&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;chat&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;id&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nx"&gt;bot&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;sendMessage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;chatId&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;'&lt;/span&gt;&lt;span class="s1"&gt;Welcome! How can I help you today?&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;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is just a simple example, you can make your bot more complex by using more advanced features of the Telegram Bot API, such as sending photos, audio, etc.&lt;/p&gt;

&lt;p&gt;Checkout the github &lt;a href="https://github.com/muhammadabir64/telegram-bot-nodejs" rel="noopener noreferrer"&gt;repo&lt;/a&gt;&lt;/p&gt;

</description>
      <category>welcome</category>
    </item>
  </channel>
</rss>
