<?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: MD. Shadman Murshed</title>
    <description>The latest articles on DEV Community by MD. Shadman Murshed (@shadman_murshed266).</description>
    <link>https://dev.to/shadman_murshed266</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%2F2927127%2F61f75247-b5d0-482f-9755-cf98942c3647.png</url>
      <title>DEV Community: MD. Shadman Murshed</title>
      <link>https://dev.to/shadman_murshed266</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/shadman_murshed266"/>
    <language>en</language>
    <item>
      <title>Bangla Pdf to Word converter(Without OCR)</title>
      <dc:creator>MD. Shadman Murshed</dc:creator>
      <pubDate>Sun, 13 Apr 2025 05:33:17 +0000</pubDate>
      <link>https://dev.to/shadman_murshed266/bangla-pdf-to-word-converterwithout-ocr-4f66</link>
      <guid>https://dev.to/shadman_murshed266/bangla-pdf-to-word-converterwithout-ocr-4f66</guid>
      <description>&lt;p&gt;I used Python script to extract everything from the PDF then convert to Docx.&lt;/p&gt;

&lt;p&gt;First, install Python in my machine. &lt;br&gt;
Verify the installation.&lt;br&gt;
&lt;code&gt;python --version&lt;/code&gt;&lt;br&gt;
Paste the command and check the version.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Ft20s7vheni1gyizdzi1k.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Ft20s7vheni1gyizdzi1k.png" alt="Image description" width="560" height="200"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To extract Bangla (Bengali) text from a PDF without using OCR, the PDF must contain selectable or embedded text, not scanned images.&lt;br&gt;
PyMuPDF works great with Bangla Unicode text if the PDF has embedded/selectable text.&lt;/p&gt;

&lt;p&gt;PyMuPDF (fitz) installation Commands.&lt;br&gt;
&lt;code&gt;pip install PyMuPDF&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
&lt;a href="https://media2.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%2Fqvmdprh6d6jhcu9s55vh.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqvmdprh6d6jhcu9s55vh.png" alt="Image description" width="576" height="191"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There’s a Python package called bijoy2unicode. It handles common Bijoy fonts and converts to Unicode reliably.&lt;br&gt;
Now, install it in the file directory.&lt;br&gt;
&lt;code&gt;pip install bijoy2unicode&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fww2sjkt8lisfe8b6lues.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fww2sjkt8lisfe8b6lues.png" alt="Image description" width="800" height="275"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;For converting my PDF to Word format, need to install.&lt;br&gt;
&lt;code&gt;pip install python-docx&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F17zmzsup7ujld7ujhq9i.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F17zmzsup7ujld7ujhq9i.png" alt="Image description" width="581" height="276"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Inspite of installing one by one, we can use a single compact command to install all the dependencies.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install flask python-docx pymupdf

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then I run my python script after installing the dependencies.&lt;br&gt;
Here is the repository. Just clone the repo and run it in your machine.&lt;br&gt;
Link: &lt;code&gt;https://github.com/smrafy20/ban_PDF-Word.git&lt;/code&gt;&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Nginx Config for Load Balancing</title>
      <dc:creator>MD. Shadman Murshed</dc:creator>
      <pubDate>Wed, 12 Mar 2025 07:45:04 +0000</pubDate>
      <link>https://dev.to/shadman_murshed266/nginx-config-for-load-balancing-5gmm</link>
      <guid>https://dev.to/shadman_murshed266/nginx-config-for-load-balancing-5gmm</guid>
      <description>&lt;p&gt;&lt;strong&gt;Installation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt update&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo apt install nginx -y&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;After that enable it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo systemctl enable nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then Start it.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo systemctl start nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Check the status(Running)&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;sudo systemctl status nginx

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It will show this kinds of output.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fc08ly07tg96flqpzgiqy.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fc08ly07tg96flqpzgiqy.png" alt="Image description" width="800" height="524"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;To verify the installation, just paste the address in the web browser.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;http://localhost&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then we will see the webpage like that. If we paste our IP on the address bar, we will see the same thing.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fga4my9uzc907hffaxjig.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fga4my9uzc907hffaxjig.png" alt="Image description" width="707" height="419"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creating Backend servers&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;For Backend-1, the port is 8083&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p ~/backend1 &amp;amp;&amp;amp; cd ~/backend1
echo '&amp;lt;h1&amp;gt;Backend Server 1&amp;lt;/h1&amp;gt;' &amp;gt; index.html
python3 -m http.server 8083

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2F83t6nqnccb8cdrtjxrca.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F83t6nqnccb8cdrtjxrca.png" alt="Image description" width="567" height="165"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;For Backend-2, the port is 8084&lt;/u&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;mkdir -p ~/backend2 &amp;amp;&amp;amp; cd ~/backend2
echo '&amp;lt;h1&amp;gt;Backend Server 2&amp;lt;/h1&amp;gt;' &amp;gt; index.html
python3 -m http.server 8084

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://media2.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%2Fhn67b3t19dqqjz9nb2if.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fhn67b3t19dqqjz9nb2if.png" alt="Image description" width="416" height="182"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Configure for Load Balancing&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo nano /etc/nginx/nginx.conf&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Then Configure like that..&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;user  nginx;
worker_processes  auto;

error_log  /var/log/nginx/error.log notice;
pid        /var/run/nginx.pid;

events {
    worker_connections 1024;
}

http {
    include       /etc/nginx/mime.types;
    default_type  application/octet-stream;

    log_format  main  '$remote_addr - $remote_user [$time_local] "$request" '
                      '$status $body_bytes_sent "$http_referer" '
                      '"$http_user_agent" "$http_x_forwarded_for"';

    access_log  /var/log/nginx/access.log  main;

    sendfile        on;
    #tcp_nopush     on;

    keepalive_timeout  65;

    upstream backend_servers {
        server 127.0.0.1:8083;
        server 127.0.0.1:8084;
    }

    server {
        listen 80;

        location / {
            proxy_pass http://backend_servers;
        }
    }

    #gzip  on;

    include /etc/nginx/conf.d/*.conf;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Save the file and exit (Ctrl + X, then Y, then Enter).&lt;/p&gt;

&lt;p&gt;Now, Test the config.&lt;br&gt;
&lt;code&gt;sudo nginx -t&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
it will give a successful text if everything is okay.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fzdf4tbk6g4bs7llgm6yw.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fzdf4tbk6g4bs7llgm6yw.png" alt="Image description" width="800" height="109"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;If successful, restart Nginx:&lt;br&gt;
&lt;code&gt;sudo systemctl restart nginx&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
For the health check, I modify the config file in upstream part and add checking parameters.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;upstream backend_servers {
    server 127.0.0.1:8083 max_fails=3 fail_timeout=10s;
    server 127.0.0.1:8084 max_fails=3 fail_timeout=10s;
}

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Testing config&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Check if Nginx is forwarding requests:&lt;br&gt;
&lt;code&gt;curl -I http://localhost&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fqcv1jyklkmsyqbghzdvs.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fqcv1jyklkmsyqbghzdvs.png" alt="Image description" width="800" height="279"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;u&gt;Stop any of backend server&lt;/u&gt;&lt;/p&gt;

&lt;p&gt;Check the port-8083 is running or not.&lt;br&gt;
&lt;code&gt;sudo lsof -i :8083&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
This will show the PID (Process ID) of the application using that port.&lt;/p&gt;

&lt;p&gt;*Same for another port(8084)&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F6x1h90hrmkjj0hd3hu0m.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F6x1h90hrmkjj0hd3hu0m.png" alt="Image description" width="800" height="220"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Now, to kill the process. paste the command.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;sudo kill -9 &amp;lt;PID&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
For port-8083, PID was 22278.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo kill -9 22278
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Verify that from the browser. It will show like that.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2Fe4iu4prxdnz5owlv5soq.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2Fe4iu4prxdnz5owlv5soq.png" alt="Image description" width="554" height="692"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Notice that, the server-2 is running perfectly because it is not killed yet.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.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%2F594l098mklfsrpcu77bi.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.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%2F594l098mklfsrpcu77bi.png" alt="Image description" width="468" height="224"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;If we want to restart server-1.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;code&gt;cd ~/backend1  &lt;br&gt;
&lt;/code&gt;&lt;br&gt;
(# Change this path if your script is elsewhere)&lt;br&gt;
Then run. &lt;code&gt;python3 -m http.server 8083&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Monitor Load Balance&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;verify if Nginx is listening on port 80:&lt;code&gt;sudo ss -tulnp | grep nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Log for monitoring: &lt;code&gt;sudo tail -f /var/log/nginx/access.log&lt;br&gt;
&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Uninstall Nginx&lt;/strong&gt;&lt;br&gt;
&lt;code&gt;sudo systemctl stop nginx&lt;br&gt;
&lt;/code&gt;&lt;br&gt;
After stop, remove all file.&lt;br&gt;
&lt;code&gt;sudo apt-get purge nginx nginx-common -y&lt;/code&gt;&lt;br&gt;
&lt;code&gt;sudo apt-get autoremove -y&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;Check if any Nginx files remain: &lt;code&gt;dpkg -l | grep nginx&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;delete the Nginx configuration directory: &lt;code&gt;sudo rm -rf /etc/nginx&lt;/code&gt;&lt;/p&gt;

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