<?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: S.M. Khalid Mahmud</title>
    <description>The latest articles on DEV Community by S.M. Khalid Mahmud (@khalidccnu).</description>
    <link>https://dev.to/khalidccnu</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%2F1128488%2F28b76b01-c8c4-4ff4-a940-0b2e1bc7e700.jpeg</url>
      <title>DEV Community: S.M. Khalid Mahmud</title>
      <link>https://dev.to/khalidccnu</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/khalidccnu"/>
    <language>en</language>
    <item>
      <title>How to accessible multiple services via different domain or subdomain in DO droplet by Nginx</title>
      <dc:creator>S.M. Khalid Mahmud</dc:creator>
      <pubDate>Sat, 03 Aug 2024 09:07:48 +0000</pubDate>
      <link>https://dev.to/khalidccnu/how-to-accessible-multiple-services-via-different-domain-or-subdomain-in-do-droplet-by-nginx-2a6g</link>
      <guid>https://dev.to/khalidccnu/how-to-accessible-multiple-services-via-different-domain-or-subdomain-in-do-droplet-by-nginx-2a6g</guid>
      <description>&lt;p&gt;First, ensure that Nginx is installed on droplet. If it’s not installed, then install it using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Before configuring Nginx, the firewall needs to be adjusted to allow access to the service. Nginx registers itself as a service with ufw upon installation, making it straightforward to allow Nginx access.&lt;/p&gt;

&lt;p&gt;You can show ufw app list by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw app list
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then enable Nginx by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw allow 'Nginx Full'
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you can verify the change by typing:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ufw status
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To avoid a possible hash bucket memory problem that can arise from adding additional server names, it is necessary to adjust a single value in the &lt;strong&gt;/etc/nginx/nginx.conf&lt;/strong&gt; file. Open the file using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/nginx/nginx.conf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And, find the &lt;strong&gt;server_names_hash_bucket_size&lt;/strong&gt; directive and remove the &lt;strong&gt;#&lt;/strong&gt; symbol to uncomment the line.&lt;/p&gt;

&lt;p&gt;Here you will need to SSL/TLS Certificate also, so you need for that Let’s Encrypt using:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt update
sudo apt install certbot python3-certbot-nginx
sudo certbot --nginx -d example.com -d www.example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To automatically renew SSL/TLS certificates obtained with Let’s Encrypt using Certbot, you can set up a cron job.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo crontab -e
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then add this line at the bottom: &lt;strong&gt;0 0,12 * * * certbot renew --quiet&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, you need to create an Nginx configuration file for each service after successful all steps. Each configuration file will handle requests for a specific domain or subdomain and proxy them to the appropriate Docker container.&lt;/p&gt;

&lt;p&gt;Assuming you have a Next.js project running on port 3000, and you want to serve it on example.com, then you can create a configuration file like -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nano /etc/nginx/sites-available/example.com
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And add below blocks on this file :&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;server {
  listen 80;
  listen [::]:80;
  server_name example.com www.example.com;

  return 301 https://$host$request_uri;
}

server {
  listen 443 ssl;
  listen [::]:443 ssl;
  server_name example.com www.example.com;

  ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
  ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
  ssl_protocols TLSv1.2 TLSv1.3;
  ssl_ciphers 'TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-CCM:ECDHE-RSA-AES256-CCM:ECDHE-RSA-AES128-SHA256:ECDHE-RSA-AES256-SHA384';
  ssl_prefer_server_ciphers on;

  location / {
    proxy_pass http://localhost:3000;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded-Host $host;
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If you have multiple service, you can create additional configuration files, for example:&lt;br&gt;
&lt;strong&gt;/etc/nginx/sites-available/service1.example.com&lt;/strong&gt;&lt;br&gt;
&lt;strong&gt;/etc/nginx/sites-available/service2.example.com&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Each file will have a similar structure, just make sure to replace the server_name and proxy_pass with appropriate values.&lt;/p&gt;

&lt;p&gt;Also must be linked your configuration files with &lt;strong&gt;/etc/nginx/sites-enabled/&lt;/strong&gt; to enable them:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo ln -s /etc/nginx/sites-available/example.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/service1.example.com /etc/nginx/sites-enabled/
sudo ln -s /etc/nginx/sites-available/service2.example.com /etc/nginx/sites-enabled/
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; Always test your Nginx configuration before restarting:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo nginx -t
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If the test is successful, restart Nginx to apply the changes:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo systemctl restart nginx
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>digitalocean</category>
      <category>ngnix</category>
      <category>domain</category>
    </item>
    <item>
      <title>How to automatic deployment from GitHub to server via FTP (GitHub Actions)</title>
      <dc:creator>S.M. Khalid Mahmud</dc:creator>
      <pubDate>Tue, 24 Oct 2023 15:20:45 +0000</pubDate>
      <link>https://dev.to/khalidccnu/how-to-automatic-deployment-from-github-to-server-via-ftp-github-actions-4l6l</link>
      <guid>https://dev.to/khalidccnu/how-to-automatic-deployment-from-github-to-server-via-ftp-github-actions-4l6l</guid>
      <description>&lt;p&gt;We are going to take a look at how we can automate deployment from GitHub to server via FTP. To do that we have to create some folder and file in project root where &lt;strong&gt;.git&lt;/strong&gt; folder exist. Such as:&lt;/p&gt;

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

&lt;p&gt;Now, we need to add below code in &lt;strong&gt;server-deploy-via-ftp&lt;/strong&gt; file, which we created before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI-FTP

# Controls when the action will run.
on:
  # Triggers the workflow on push or pull request event but only for the main branch
  push:
    branches: [ main ]
  #  pull_request:
  #    branches: [ main ]

  # Allows to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more job that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "FTP"
  deploy-via-ftp:
    runs-on: ubuntu-latest
    steps:
      # Checkouts repository under $GITHUB_WORKSPACE, so job can access it
      - uses: actions/checkout@v2

      - name: FTP Deploy
        uses: SamKirkland/FTP-Deploy-Action@4.3.2
        with:
          server: ${{ secrets.SERVER }}
          username: ${{ secrets.USERNAME }}
          password: ${{ secrets.PASSWORD }}

          # File will copy to under this path
          server-dir: ${{ secrets.SERVER_DIR }}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then we need to create some secrets on GitHub. For creating GitHub secrets, go to repository &lt;strong&gt;Settings&lt;/strong&gt;, then click on &lt;strong&gt;Secrets&lt;/strong&gt; from sidebar. Secrets are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SERVER: Your server address
USERNAME: Your ftp username
PASSWORD: Your ftp password
SERVER_DIR: Where GitHub project will be uploaded
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now push project on GitHub. And check status from &lt;strong&gt;Actions&lt;/strong&gt; in repository.&lt;/p&gt;

</description>
      <category>ftp</category>
      <category>github</category>
      <category>server</category>
    </item>
    <item>
      <title>How to automatic deployment from GitHub to server via SFTP (GitHub Actions)</title>
      <dc:creator>S.M. Khalid Mahmud</dc:creator>
      <pubDate>Tue, 24 Oct 2023 15:03:21 +0000</pubDate>
      <link>https://dev.to/khalidccnu/how-to-automatic-deployment-from-github-to-server-via-sftp-github-actions-3g0p</link>
      <guid>https://dev.to/khalidccnu/how-to-automatic-deployment-from-github-to-server-via-sftp-github-actions-3g0p</guid>
      <description>&lt;p&gt;We are going to take a look at how we can automate deployment from GitHub to server via SFTP. To do that we have to create some folder and file in project root where &lt;strong&gt;.git&lt;/strong&gt; folder exist. Such as:&lt;/p&gt;

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

&lt;p&gt;Now, we need to add below code in &lt;strong&gt;server-deploy-via-sftp&lt;/strong&gt; file, which we created before.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;name: CI-SFTP

# Controls when the action will run.
on:
  # Triggers the workflow on push or pull request event but only for the main branch
  push:
    branches: [ main ]
  #  pull_request:
  #    branches: [ main ]

  # Allows to run this workflow manually from the Actions tab
  workflow_dispatch:

# A workflow run is made up of one or more job that can run sequentially or in parallel
jobs:
  # This workflow contains a single job called "SFTP"
  deploy-via-sftp:
    runs-on: ubuntu-latest
    steps:
      # Checkouts repository under $GITHUB_WORKSPACE, so job can access it
      - name: Checkout
        uses: actions/checkout@v3

      - name: SFTP Deploy
        uses: wlixcc/SFTP-Deploy-Action@v1.2.4
        with:
          server: ${{ secrets.SERVER }}
          port: 22 # default is 22
          username: ${{ secrets.USERNAME }}
          ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}

          # Puts all file to under this path
          local_path: ./server/* # default is ./*
          # File will copy to under this path
          remote_path: ${{ secrets.REMOTE_PATH }}

          # Arg
          args: "-o ConnectTimeout=5"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Here we need &lt;strong&gt;SSH&lt;/strong&gt; private key, which is basically a method of authenticating GitHub to make changes on deployment server. So for this we are gonna have to generate an SSH key pair and to do that we are gonna have to open up a terminal where need to access deployment server. Then, we need to enter below command:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Now hit &lt;strong&gt;Enter&lt;/strong&gt; to save the key. And keep empty &lt;strong&gt;passphrase&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;We need to get public &amp;amp; private key. For that need to write below commands:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;cd ~/.ssh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





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

&lt;/div&gt;



&lt;p&gt;Now, we can see two files, such as&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;id_rsa -&amp;gt; private key &lt;/li&gt;
&lt;li&gt;id_rsa.pub -&amp;gt; public key&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;And also we need to create some secrets on GitHub and a new file &lt;strong&gt;authorized_keys&lt;/strong&gt; in &lt;strong&gt;.ssh&lt;/strong&gt; folder in deployment server, where need to write &lt;strong&gt;public key&lt;/strong&gt; (id_rsa.pub content) and for creating GitHub secrets, go to repository &lt;strong&gt;Settings&lt;/strong&gt;, then click on &lt;strong&gt;Secrets&lt;/strong&gt; from sidebar. Secrets are:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;SERVER: Your server address
USERNAME: Your server username
REMOTE_PATH: Where GitHub project will be uploaded
SSH_PRIVATE_KEY: Recently created private key on deploment server (id_rsa)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now push project on GitHub. And check status from &lt;strong&gt;Actions&lt;/strong&gt; in repository.&lt;/p&gt;

</description>
      <category>sftp</category>
      <category>github</category>
      <category>server</category>
    </item>
    <item>
      <title>How to increase Firebase project limit</title>
      <dc:creator>S.M. Khalid Mahmud</dc:creator>
      <pubDate>Sat, 14 Oct 2023 06:25:04 +0000</pubDate>
      <link>https://dev.to/khalidccnu/how-to-increase-firebase-project-limit-37c2</link>
      <guid>https://dev.to/khalidccnu/how-to-increase-firebase-project-limit-37c2</guid>
      <description>&lt;p&gt;Firebase is a &lt;strong&gt;Backend-as-a-Service (Baas)&lt;/strong&gt;. It provides developers with a variety of tools and services to help them develop quality apps, grow their user base. It is built on Google’s infrastructure.&lt;/p&gt;

&lt;p&gt;So, firebase is important for development. But, problem is on project limit. Now, we will learn to increase project limit.&lt;/p&gt;

&lt;p&gt;Firstly go to &lt;strong&gt;Firebase console&lt;/strong&gt; and then click &lt;strong&gt;Add project&lt;/strong&gt;. After clicking &lt;strong&gt;Add project&lt;/strong&gt;, you can see below picture, then click on &lt;strong&gt;Request an increase&lt;/strong&gt;.&lt;/p&gt;

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

&lt;p&gt;Now, you will see a &lt;strong&gt;form&lt;/strong&gt; where you need to fill necessary information.&lt;/p&gt;

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

&lt;p&gt;After filling all information, click on &lt;strong&gt;Submit&lt;/strong&gt; and you need to wait for &lt;strong&gt;confirmation email&lt;/strong&gt;.&lt;/p&gt;

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

</description>
      <category>firebase</category>
    </item>
    <item>
      <title>How to Customize Ubuntu Terminal</title>
      <dc:creator>S.M. Khalid Mahmud</dc:creator>
      <pubDate>Fri, 13 Oct 2023 09:18:47 +0000</pubDate>
      <link>https://dev.to/khalidccnu/how-to-customize-ubuntu-terminal-475n</link>
      <guid>https://dev.to/khalidccnu/how-to-customize-ubuntu-terminal-475n</guid>
      <description>&lt;h3&gt;
  
  
  Table of Content
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Install ZSH&lt;/li&gt;
&lt;li&gt;Install Oh My Posh&lt;/li&gt;
&lt;li&gt;Install Nerd Font&lt;/li&gt;
&lt;li&gt;Activate Oh My Posh&lt;/li&gt;
&lt;li&gt;Change the Theme&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Install ZSH
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;At first, you need to install the &lt;strong&gt;Z shell&lt;/strong&gt;. So, go to the &lt;strong&gt;Ubuntu&lt;/strong&gt; terminal and run the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo apt install zsh
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that is done, need to &lt;strong&gt;change&lt;/strong&gt; the default shell. By default, it remains &lt;strong&gt;bash&lt;/strong&gt;. If you want to check it, then run the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now run the below command to change the shell:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;Then it will ask to set the login shell. So, type:&lt;br&gt;
&lt;/p&gt;

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

&lt;/div&gt;



&lt;p&gt;And press Enter.&lt;/p&gt;

&lt;p&gt;Now &lt;strong&gt;restart&lt;/strong&gt; the terminal, and you'll be greeted by &lt;strong&gt;ZSH config&lt;/strong&gt;. In that case, select option &lt;strong&gt;2&lt;/strong&gt; (&lt;em&gt;press 2 on your keyboard&lt;/em&gt;) for the default settings.&lt;/p&gt;

&lt;p&gt;Congratulations! You now have set ZSH as your default shell. Now you can go ahead with your terminal customization and install Oh My Posh.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Install Oh My Posh
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;First, you need to install &lt;strong&gt;Oh My Posh&lt;/strong&gt; and &lt;strong&gt;UnZip&lt;/strong&gt; so you can unzip the files in a second.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/posh-linux-amd64 -O /usr/local/bin/oh-my-posh
sudo chmod +x /usr/local/bin/oh-my-posh
sudo apt install unzip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Next up, you need to download the themes.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir ~/.poshthemes
wget https://github.com/JanDeDobbeleer/oh-my-posh/releases/latest/download/themes.zip -O ~/.poshthemes/themes.zip
unzip ~/.poshthemes/themes.zip -d ~/.poshthemes
chmod u+rw ~/.poshthemes/*.json
rm ~/.poshthemes/themes.zip
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Install Nerd Font
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;You need to use Nerd Font to &lt;strong&gt;display&lt;/strong&gt; all the nice custom icons. You can download them directly from &lt;a href="https://www.nerdfonts.com/font-downloads" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Just save them on your computer, unzip and install them.&lt;/p&gt;

&lt;p&gt;Then, you need to set this font from terminal settings.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Activate Oh My Posh
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now you need to add some code to your &lt;strong&gt;zshrc&lt;/strong&gt; file; which theme you want to use in Oh My Posh will indicate. That's a necessary step for terminal customization.&lt;/p&gt;

&lt;p&gt;Open your &lt;strong&gt;zshrc&lt;/strong&gt; file by running the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And add the following two lines at the bottom of it.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Oh My Posh Theme Config
eval "$(oh-my-posh --init --shell zsh --config '~/.poshthemes/atomic.omp.json')"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now press Ctrl + O and then Enter to save your file, and to close the file, press Ctrl + X.&lt;/p&gt;

&lt;p&gt;Finally, you need to activate the theme by running the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Change the Theme
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now, if you want to change your current theme, then just open your &lt;strong&gt;zshrc&lt;/strong&gt; file by running the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;nano ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;And scroll down to where you added your # Oh My Posh Theme Config and &lt;strong&gt;replace&lt;/strong&gt; the old theme name with the new theme name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;# Oh My Posh Theme Config
eval "$(oh-my-posh --init --shell zsh --config '~/.poshthemes/night-owl.omp.json')"
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now press Ctrl + O and then Enter to save your file, and to close the file, press Ctrl + X.&lt;/p&gt;

&lt;p&gt;Finally, you need to activate the new theme by running the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;source ~/.zshrc
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
    <item>
      <title>How to Install Ubuntu Terminal Using Subsystem for Linux</title>
      <dc:creator>S.M. Khalid Mahmud</dc:creator>
      <pubDate>Thu, 12 Oct 2023 06:17:38 +0000</pubDate>
      <link>https://dev.to/khalidccnu/how-to-install-ubuntu-terminal-using-subsystem-for-linux-1962</link>
      <guid>https://dev.to/khalidccnu/how-to-install-ubuntu-terminal-using-subsystem-for-linux-1962</guid>
      <description>&lt;p&gt;&lt;strong&gt;Windows Subsystem for Linux (&lt;em&gt;WSL&lt;/em&gt;)&lt;/strong&gt; allows the installation of a complete &lt;strong&gt;Ubuntu&lt;/strong&gt; terminal environment on a Windows machine and provides for the development of cross-platform applications without leaving windows.&lt;/p&gt;

&lt;p&gt;At first, you need to go to your search menu in windows and type &lt;strong&gt;Powershell&lt;/strong&gt;. After done, right-click on &lt;strong&gt;Powershell&lt;/strong&gt; and select &lt;strong&gt;Run as administrator&lt;/strong&gt;. Then a popup window will show, and click on yes. Now you need to put two commands.&lt;/p&gt;

&lt;h4&gt;
  
  
  To enable Windows Subsystem for Linux:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  To enable Virtual Machine Platform:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, you must restart your computer, and again you need to go to &lt;strong&gt;Powershell&lt;/strong&gt; as &lt;strong&gt;administrator&lt;/strong&gt; and put one command.&lt;/p&gt;

&lt;h4&gt;
  
  
  To set WSL2 as the default environment:
&lt;/h4&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;wsl.exe --set-default-version 2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you have to download &lt;strong&gt;Ubuntu&lt;/strong&gt; from &lt;strong&gt;Microsoft Store&lt;/strong&gt; and open it. It will take time to set up the process thoroughly, and you will need your &lt;strong&gt;credentials&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Now, you have completed your all process. Thank you!&lt;/p&gt;

</description>
    </item>
    <item>
      <title>How to Install Oh My Posh in Windows</title>
      <dc:creator>S.M. Khalid Mahmud</dc:creator>
      <pubDate>Wed, 11 Oct 2023 16:58:40 +0000</pubDate>
      <link>https://dev.to/khalidccnu/how-to-install-oh-my-posh-in-windows-58aj</link>
      <guid>https://dev.to/khalidccnu/how-to-install-oh-my-posh-in-windows-58aj</guid>
      <description>&lt;h3&gt;
  
  
  Table of Content
&lt;/h3&gt;

&lt;ul&gt;
&lt;li&gt;Installation&lt;/li&gt;
&lt;li&gt;Activation&lt;/li&gt;
&lt;li&gt;Install Nerd Font&lt;/li&gt;
&lt;li&gt;Change the Theme&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Installation
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;First, you need to install the &lt;strong&gt;Powershell&lt;/strong&gt; from &lt;strong&gt;Microsoft Store&lt;/strong&gt;. After that, go to the &lt;strong&gt;Powershell&lt;/strong&gt; terminal to run the below command and then &lt;strong&gt;restart&lt;/strong&gt; the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Activation
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;Now you need to initialize the &lt;strong&gt;Profile&lt;/strong&gt;. So, the first thing you need to do is run the following command and &lt;strong&gt;check&lt;/strong&gt; its path:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;echo $profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;After that, you will need to &lt;strong&gt;create&lt;/strong&gt; the profile manually using the &lt;strong&gt;above getting path&lt;/strong&gt;, and an editor will need to open the file where the following line must be added:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;oh-my-posh --init --shell pwsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$(oh-my-posh --version)/themes/jandedobbeleer.omp.json | Invoke-Expression
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now press Ctrl + S. And the last one is, if you want to set beautiful terminal icons, then add the following line in the &lt;strong&gt;profile&lt;/strong&gt; also (&lt;em&gt;Optional&lt;/em&gt;):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Import-Module -Name Terminal-Icons
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then, &lt;strong&gt;install&lt;/strong&gt; the terminal icons module using the below command and &lt;strong&gt;restart&lt;/strong&gt; the terminal.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Install-Module -Name Terminal-Icons -RequiredVersion 0.9.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Install Nerd Font
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;You need to use Nerd Font to &lt;strong&gt;display&lt;/strong&gt; all the nice custom icons. You can download them directly from &lt;a href="https://www.nerdfonts.com/font-downloads" rel="noopener noreferrer"&gt;here&lt;/a&gt;. Just save them on your computer, unzip and install them and you need to set this font from terminal settings.&lt;/p&gt;

&lt;p&gt;&lt;a&gt;&lt;/a&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;h4&gt;
  
  
  Change the Theme
&lt;/h4&gt;
&lt;/blockquote&gt;

&lt;p&gt;If you want to change your current theme, then open your &lt;strong&gt;Profile Script&lt;/strong&gt; by running the below command:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;notepad $profile
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, scroll to where you added your &lt;strong&gt;Theme Config&lt;/strong&gt; and &lt;strong&gt;replace&lt;/strong&gt; the old theme name with the new theme name.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;oh-my-posh --init --shell pwsh --config https://raw.githubusercontent.com/JanDeDobbeleer/oh-my-posh/v$(oh-my-posh --version)/themes/night-owl.omp.json | Invoke-Expression
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now press Ctrl + S. Then &lt;strong&gt;restart&lt;/strong&gt; the terminal.&lt;/p&gt;

</description>
      <category>ohmyposh</category>
      <category>terminal</category>
    </item>
    <item>
      <title>How to host a node.js application in cPanel</title>
      <dc:creator>S.M. Khalid Mahmud</dc:creator>
      <pubDate>Fri, 28 Jul 2023 16:30:48 +0000</pubDate>
      <link>https://dev.to/khalidccnu/how-to-host-a-nodejs-application-in-cpanel-16l2</link>
      <guid>https://dev.to/khalidccnu/how-to-host-a-nodejs-application-in-cpanel-16l2</guid>
      <description>&lt;p&gt;Node.js is a popular, event-driven JavaScript runtime where you can use to build robust web applications. If you are already familiar with creating node.js apps, you may be wondering how to get your app onto a shared server. In this article, I explain how to host a node.js application in cPanel.&lt;/p&gt;

&lt;p&gt;To deploy node.js application on hosting, firstly you have to create the application. You can create application using cPanel graphical interface by selecting &lt;strong&gt;Setup Node.js App&lt;/strong&gt; under &lt;strong&gt;Software&lt;/strong&gt; section of cPanel home screen.&lt;/p&gt;

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

&lt;p&gt;Now click &lt;strong&gt;CREATE APPLICATION&lt;/strong&gt; to begin the application setup on the Node.js App page:&lt;/p&gt;

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

&lt;p&gt;Then on the &lt;strong&gt;CREATE APPLICATION&lt;/strong&gt; form, fill out the following fields:&lt;/p&gt;

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

&lt;ul&gt;
&lt;li&gt;Node.js version: Choose your preferred version from the dropdown list. (Latest version is recommended)&lt;/li&gt;
&lt;li&gt;Application mode: Select either Development or Production from the list. One may initially choose Development and then switch to Production.&lt;/li&gt;
&lt;li&gt;Application root: It is for the location of application files in the file system. To form the full path to the application files in the cPanel home directory, the value will be appended to "/home/&amp;gt;username&amp;lt;/&amp;gt;applicationroot&amp;lt;".&lt;/li&gt;
&lt;li&gt;Application URL: It is to form a web URL of the application.&lt;/li&gt;
&lt;li&gt;Application startup file: The very first file that the application will process once it has been launched.&lt;/li&gt;
&lt;li&gt;Environment variables: This is a user-definable value that can affect the way running processes will behave on a application.&lt;/li&gt;
&lt;/ul&gt;

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

&lt;p&gt;Click &lt;strong&gt;CREATE&lt;/strong&gt; after finishing the form. After created successfully an application starts automatically. Then, click &lt;strong&gt;STOP APP&lt;/strong&gt; to stop the application and upload your all node app files on application root from &lt;strong&gt;File Manager&lt;/strong&gt;. Now, you need to back on Node.js App page for install dependencies. For install dependencies, click &lt;strong&gt;Run NPM Install&lt;/strong&gt;. After successful installation, click &lt;strong&gt;START APP&lt;/strong&gt; to start again the application.&lt;/p&gt;

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

&lt;p&gt;Now "It works!"&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you want to run MongoDB with your node app, then you need to open port 27017 for your hosting by creating a support ticket.&lt;/p&gt;
&lt;/blockquote&gt;

</description>
      <category>node</category>
      <category>cpanel</category>
    </item>
  </channel>
</rss>
