<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Untitled Publication]]></title><description><![CDATA[Untitled Publication]]></description><link>https://blog.udhay.dev</link><generator>RSS for Node</generator><lastBuildDate>Sun, 19 Apr 2026 04:24:14 GMT</lastBuildDate><atom:link href="https://blog.udhay.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to Update the Node.js Version in a PM2 Instance]]></title><description><![CDATA[Updating the Node.js version in a PM2-managed application requires a few key steps to ensure a smooth transition without losing your process state. Follow these steps to update Node.js while keeping your PM2 processes intact.
Step 1: Save the Current...]]></description><link>https://blog.udhay.dev/how-to-update-the-nodejs-version-in-a-pm2-instance</link><guid isPermaLink="true">https://blog.udhay.dev/how-to-update-the-nodejs-version-in-a-pm2-instance</guid><category><![CDATA[Node.js]]></category><category><![CDATA[pm2]]></category><category><![CDATA[Devops]]></category><category><![CDATA[nodeJS Developer]]></category><category><![CDATA[upgrade]]></category><category><![CDATA[node js]]></category><dc:creator><![CDATA[Udhayakumar]]></dc:creator><pubDate>Fri, 21 Feb 2025 06:46:49 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1740120136391/fc011e1b-aa6b-4159-8ff3-e41de966a51e.webp" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Updating the Node.js version in a PM2-managed application requires a few key steps to ensure a smooth transition without losing your process state. Follow these steps to update Node.js while keeping your PM2 processes intact.</p>
<h1 id="heading-step-1-save-the-current-pm2-state"><strong>Step 1: Save the Current PM2 State</strong></h1>
<p>Before updating Node.js, save the current PM2 process list to restore it later. Run:</p>
<pre><code class="lang-bash">pm2 save
</code></pre>
<p>This ensures that your running applications and their configurations are backed up.</p>
<h1 id="heading-step-2-disable-pm2-auto-start"><strong>Step 2: Disable PM2 Auto-Start</strong></h1>
<p>If PM2 is set up to start automatically on system boot, disable it before updating Node.js:</p>
<pre><code class="lang-bash">pm2 unstartup
</code></pre>
<p>This prevents conflicts during the update process.</p>
<h1 id="heading-step-3-update-nodejs"><strong>Step 3: Update Node.js</strong></h1>
<p>Use a version manager like <strong>NVM (Node Version Manager)</strong> to update Node.js.</p>
<p>Refer my Blogs to Update / Install</p>
<ol>
<li><p><a target="_blank" href="https://udhayakumarc.medium.com/how-to-install-update-nvm-and-node-in-ubuntu-7dcedf321bf0">Install / Update NVM in Ubuntu</a></p>
</li>
<li><p><a target="_blank" href="https://udhayakumarc.medium.com/how-to-install-upgrade-node-in-windows-5d27f4a7c070">Install/ Upgrade Node in Windows</a></p>
</li>
</ol>
<p>Verify the installation:</p>
<pre><code class="lang-bash">node -v
</code></pre>
<h1 id="heading-step-4-reinstall-pm2"><strong>Step 4: Reinstall PM2</strong></h1>
<p>Since PM2 is installed globally, updating Node.js may remove it. Reinstall PM2 using:</p>
<pre><code class="lang-bash">npm install -g pm2
</code></pre>
<h1 id="heading-step-5-update-pm2"><strong>Step 5: Update PM2</strong></h1>
<p>Ensure PM2 is updated to the latest version to avoid compatibility issues:</p>
<pre><code class="lang-bash">pm2 update
</code></pre>
<h1 id="heading-step-6-restore-the-previous-pm2-state"><strong>Step 6: Restore the Previous PM2 State</strong></h1>
<p>Reload the saved process list to restore your applications:</p>
<pre><code class="lang-bash">pm2 resurrect
</code></pre>
<h1 id="heading-step-7-re-enable-pm2-auto-start"><strong>Step 7: Re-enable PM2 Auto-Start</strong></h1>
<p>If you want PM2 to start automatically on system reboot, reconfigure it with:</p>
<pre><code class="lang-bash">pm2 startup
</code></pre>
<p>Follow the on-screen instructions to complete the setup.</p>
<h1 id="heading-step-8-reload-applications-with-the-new-nodejs-version"><strong>Step 8: Reload Applications with the New Node.js Version</strong></h1>
<p>Finally, reload your applications with the updated environment variables:</p>
<pre><code class="lang-bash">pm2 reload &lt;app-name or index&gt; --update-env
</code></pre>
<h1 id="heading-conclusion"><strong>Conclusion</strong></h1>
<p>By following these steps, you can seamlessly update your Node.js version while ensuring that your PM2-managed applications continue running smoothly.</p>
<p>Let me know if you need further clarification! 🚀</p>
<h3 id="heading-refrences">Refrences:</h3>
<ol>
<li><a target="_blank" href="https://pm2.keymetrics.io/docs/usage/update-pm2/">PM2’s update documentation</a></li>
</ol>
]]></content:encoded></item><item><title><![CDATA[Reset user password in MySQL]]></title><description><![CDATA[Let's see how to reset the MySQL user password.
I am using the below commands to reset the MySQL root user password in the Ubuntu 22 LTS.

Stop the MySQL by the following commands

sudo systemctl stop mysql

sudo /etc/init.d/mysql stop


Run the mysq...]]></description><link>https://blog.udhay.dev/reset-user-password-in-mysql</link><guid isPermaLink="true">https://blog.udhay.dev/reset-user-password-in-mysql</guid><category><![CDATA[SQL]]></category><category><![CDATA[MySQL]]></category><category><![CDATA[authentication]]></category><category><![CDATA[reset]]></category><category><![CDATA[Devops]]></category><category><![CDATA[RDBMS]]></category><category><![CDATA[Databases]]></category><dc:creator><![CDATA[Udhayakumar]]></dc:creator><pubDate>Thu, 17 Oct 2024 10:39:09 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1729161451693/a2e735fc-3c59-4f1c-9a63-b4ad0bc10137.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Let's see how to reset the MySQL user password.</p>
<p>I am using the below commands to reset the MySQL root user password in the Ubuntu 22 LTS.</p>
<ol>
<li>Stop the MySQL by the following commands</li>
</ol>
<pre><code class="lang-bash">sudo systemctl stop mysql
</code></pre>
<pre><code class="lang-bash">sudo /etc/init.d/mysql stop
</code></pre>
<ol start="2">
<li>Run the mysqld</li>
</ol>
<pre><code class="lang-bash">sudo mysqld_safe --skip-grant-tables &amp;
</code></pre>
<p>If you face the error like below,</p>
<pre><code class="lang-bash">mysqld_safe Directory <span class="hljs-string">'/var/run/mysqld'</span> <span class="hljs-keyword">for</span> UNIX socket file don<span class="hljs-string">'t exists</span>
</code></pre>
<p>Then run the below commands, to create and folder and update the permission</p>
<pre><code class="lang-bash">sudo mkdir -p /var/run/mysqld
sudo chown mysql:mysql /var/run/mysqld
</code></pre>
<ol start="3">
<li>Login into the MySQL</li>
</ol>
<p>Use the below command to login, without password</p>
<pre><code class="lang-bash">mysql -u root
</code></pre>
<p>Change the databse to <code>mysql</code>, by usnig the below command</p>
<pre><code class="lang-sql"><span class="hljs-keyword">use</span> mysql;
</code></pre>
<p>Flush the privileges</p>
<pre><code class="lang-sql"><span class="hljs-keyword">FLUSH</span> <span class="hljs-keyword">PRIVILEGES</span>;
</code></pre>
<p>Try to alter the password, by using the command</p>
<pre><code class="lang-sql"><span class="hljs-keyword">ALTER</span> <span class="hljs-keyword">USER</span> <span class="hljs-string">'root'</span>@<span class="hljs-string">'localhost'</span> <span class="hljs-keyword">IDENTIFIED</span> <span class="hljs-keyword">BY</span> <span class="hljs-string">'password'</span>;
</code></pre>
<p>If you face the below error</p>
<pre><code class="lang-bash">ERROR 1524 (HY000): Plugin <span class="hljs-string">'auth_socket'</span> is not loaded
</code></pre>
<p>Then, update the Plugin for authentication</p>
<pre><code class="lang-sql"><span class="hljs-keyword">ALTER</span> <span class="hljs-keyword">USER</span> <span class="hljs-string">'root'</span>@<span class="hljs-string">'localhost'</span> <span class="hljs-keyword">IDENTIFIED</span> <span class="hljs-keyword">WITH</span> mysql_native_password <span class="hljs-keyword">BY</span> <span class="hljs-string">'password'</span>
</code></pre>
<p>Exit from mysql</p>
<pre><code class="lang-sql">exit
</code></pre>
<ol start="4">
<li>Stop the MySQL service</li>
</ol>
<pre><code class="lang-bash">sudo systemctl stop mysql
</code></pre>
<ol start="5">
<li>Start the service</li>
</ol>
<pre><code class="lang-bash">sudo systemctl start mysql
</code></pre>
<p>And, try to login into mysql now with new password you set</p>
<pre><code class="lang-bash">mysql -u root -p
</code></pre>
<p>Hope it will prompt for password, Enter the password</p>
<pre><code class="lang-bash">password:
</code></pre>
]]></content:encoded></item><item><title><![CDATA[How to Set Up Vmmon and Vmnet Modules in VMware Workstation for Ubuntu]]></title><description><![CDATA[Are you facing the below error when installing the vmware modules in Vmware workstation?


I followed the instructions to install those modules from this GitHub repo.

Find the vmware version installed
 To find version of the vmware installed, run th...]]></description><link>https://blog.udhay.dev/how-to-set-up-vmmon-and-vmnet-modules-in-vmware-workstation-for-ubuntu</link><guid isPermaLink="true">https://blog.udhay.dev/how-to-set-up-vmmon-and-vmnet-modules-in-vmware-workstation-for-ubuntu</guid><category><![CDATA[vmware]]></category><category><![CDATA[Ubuntu]]></category><category><![CDATA[VMware Workstation]]></category><category><![CDATA[Cloud]]></category><category><![CDATA[Devops]]></category><category><![CDATA[vmmom]]></category><category><![CDATA[vmnet]]></category><category><![CDATA[vmware modules]]></category><dc:creator><![CDATA[Udhayakumar]]></dc:creator><pubDate>Wed, 09 Oct 2024 12:11:28 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1728474729204/95b36103-2d8f-4c17-aa29-64cb9ce882f6.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Are you facing the below error when installing the vmware modules in Vmware workstation?</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728469329397/f98469fd-d19d-48b8-8acf-246bf5d38dce.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728469439397/b5923707-3cd8-4082-a33d-39c5fee04e79.png" alt class="image--center mx-auto" /></p>
<p>I followed the instructions to install those modules from <a target="_blank" href="https://github.com/mkubecek/vmware-host-modules">this GitHub repo</a>.</p>
<ol>
<li><p><strong>Find the vmware version installed</strong></p>
<p> To find version of the vmware installed, run the below command</p>
<pre><code class="lang-bash"> vmware -v
</code></pre>
<p> It will show the output as</p>
<pre><code class="lang-bash"> VMware Workstation 17.5.0 build-22583795/code
</code></pre>
<p> From the baove out the version of the vmware installed is <strong>17.5.0</strong></p>
</li>
<li><p><strong>Get the code form Github</strong></p>
<p> Go to <a target="_blank" href="https://github.com/mkubecek/vmware-host-modules">this github repository</a> and <code>branches</code>, click the <code>all</code> tab. Search for the version you have installed like shown below.</p>
<p> <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1728474090278/7ebe3ab3-6647-460a-99ff-3017369283b6.png" alt class="image--center mx-auto" /></p>
<p> Copy the branch name, and run the below command to get the source code into your system(Host).</p>
<pre><code class="lang-bash"> git <span class="hljs-built_in">clone</span> -b branch-name https://github.com/mkubecek/vmware-host-modules.git
</code></pre>
<p> Replace the <em>branch-name</em> with, you copied from github repository</p>
</li>
<li><p>Compile and Install</p>
<p> Go to directory vmware-host-modules like <code>cd cmware-host-modules</code>, And run the following two command. Make sure all VMs are stopped</p>
<pre><code class="lang-bash"> sudo make
 sudo make install
</code></pre>
<p> Restart the vmware by using the below command</p>
<pre><code class="lang-bash"> sudo systemctl restart vmware
</code></pre>
<p> Then, open the vmware it will work smoothly and won’t show the pop to install the moduels again.</p>
<p> For more <a target="_blank" href="https://github.com/mkubecek/vmware-host-modules/blob/master/INSTALL">visit this installtion</a> guide from the author</p>
</li>
</ol>
<hr />
<p>The above soultion may not presist for every reboot. So, we may need to do every time the system reboots. To overcome from this, do the following</p>
<p>1. <strong>Create a Module Configuration File</strong></p>
<ol>
<li><p>Navigate to the <code>modules-load.d</code> directory:  </p>
<pre><code class="lang-bash"> <span class="hljs-built_in">cd</span> /etc/modules-load.d/
</code></pre>
</li>
<li><p>Create a new file for VMware modules:  </p>
<pre><code class="lang-bash"> sudo nano vmware-modules.conf
</code></pre>
</li>
</ol>
<p>2. <strong>Add VMware Modules</strong></p>
<p>Add the following lines to the file to specify the modules to load:  </p>
<pre><code class="lang-plaintext">vmmon
vmnet
</code></pre>
<p>3. <strong>Update Dependencies</strong></p>
<p>Run <code>depmod</code> to ensure the system recognizes the modules:</p>
<pre><code class="lang-bash">sudo depmod -a
</code></pre>
<p>Now the modules will be loaded automatically every time the system reboots.</p>
]]></content:encoded></item><item><title><![CDATA[HAProxy Basic Authentication]]></title><description><![CDATA[You can secure access to private or protected sites in HAProxy by enabling basic authentication, which prompts users for a username and password.
Steps for Setting Up Basic Authentication:

Create User Details: In /etc/haproxy/haproxy.cfg, add the us...]]></description><link>https://blog.udhay.dev/haproxy-basic-authentication</link><guid isPermaLink="true">https://blog.udhay.dev/haproxy-basic-authentication</guid><category><![CDATA[Haproxy]]></category><category><![CDATA[basic authentication]]></category><category><![CDATA[webserver]]></category><category><![CDATA[proxy]]></category><category><![CDATA[Devops]]></category><category><![CDATA[HA]]></category><category><![CDATA[high availability]]></category><dc:creator><![CDATA[Udhayakumar]]></dc:creator><pubDate>Fri, 27 Sep 2024 12:52:38 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1727440200676/23fdd59e-1875-43d7-9611-4f2acc216327.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You can secure access to private or protected sites in HAProxy by enabling basic authentication, which prompts users for a username and password.</p>
<h3 id="heading-steps-for-setting-up-basic-authentication">Steps for Setting Up Basic Authentication:</h3>
<ol>
<li><p><strong>Create User Details:</strong> In <code>/etc/haproxy/haproxy.cfg</code>, add the user list:</p>
<pre><code class="lang-bash"> userlist listofuser
   user udhay insecure-password udhayspassword
   user optionalAnotherUser insecure-password unsafepassword
</code></pre>
<p> Replace with your own credentials. However, using plain-text passwords is insecure. To create <strong>hashed passwords</strong>, follow these steps:</p>
</li>
<li><p><strong>Hash the Password:</strong> Install the <code>mkpasswd</code> tool:</p>
<ol>
<li><p>Install the <code>mkpasswd</code> tool:</p>
<pre><code class="lang-bash"> sudo apt install whois
</code></pre>
</li>
<li><p>Has the password</p>
<pre><code class="lang-bash"> mkpasswd -m sha-256 mypassword
</code></pre>
<p> The above will command will prove the hashed password as output like below,</p>
<pre><code class="lang-bash"> <span class="hljs-variable">$5</span><span class="hljs-variable">$s6Subz0X7FSX2zON</span><span class="hljs-variable">$r94OtF6gOfWlGmySwvn3pDFIAHbIpe6mWneueqtBOl</span>/
</code></pre>
</li>
<li><p>Replace the plain password</p>
<p> So you can replace the plain text password by hashed password. Then, the userlist will be</p>
<pre><code class="lang-bash"> userlist listofuser
   user udhay password <span class="hljs-variable">$5</span><span class="hljs-variable">$s6Subz0X7FSX2zON</span><span class="hljs-variable">$r94OtF6gOfWlGmySwvn3pDFIAHbIpe6mWneueqtBOl</span>/
   <span class="hljs-comment"># Other users</span>
</code></pre>
</li>
</ol>
</li>
<li><p><strong>Add Basic Auth in HAProxy:</strong> Update your HAProxy configuration:</p>
<pre><code class="lang-nginx"> <span class="hljs-comment"># Other config goes here</span>
 <span class="hljs-attribute">frontend</span> example_frontend
   <span class="hljs-comment"># Other config goes here....</span>
   bind :<span class="hljs-number">443</span> ssl crt /etc/haproxy/ssl/udhay.dev.pem
   use_backend private_site if { hdr(host) -<span class="hljs-attribute">i</span> udhay.dev }
   <span class="hljs-comment"># Other backends will go here..</span>

 backend private_site
   <span class="hljs-comment"># Add your other configs</span>
   http-request auth unless { http_auth(listofusers) }
   <span class="hljs-attribute">server</span> web_server <span class="hljs-number">127.0.0.1:80</span>
</code></pre>
</li>
</ol>
<p>By following these steps, you'll have basic authentication enabled to secure your site.</p>
]]></content:encoded></item></channel></rss>