<?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: Mintu Agarwal</title>
    <description>The latest articles on DEV Community by Mintu Agarwal (@mintuagarwal).</description>
    <link>https://dev.to/mintuagarwal</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%2F1231473%2Fc31fff23-c636-47f6-a254-804367e93e86.png</url>
      <title>DEV Community: Mintu Agarwal</title>
      <link>https://dev.to/mintuagarwal</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/mintuagarwal"/>
    <language>en</language>
    <item>
      <title>Installation Guide for pdf2image for python</title>
      <dc:creator>Mintu Agarwal</dc:creator>
      <pubDate>Wed, 13 Dec 2023 14:55:34 +0000</pubDate>
      <link>https://dev.to/mintuagarwal/installation-guide-for-pdf2image-for-python-5ai3</link>
      <guid>https://dev.to/mintuagarwal/installation-guide-for-pdf2image-for-python-5ai3</guid>
      <description>&lt;p&gt;Recently for my Python project, I wanted to create images of the generated PDF from my script. I added an option to whether I want to create the images and used &lt;code&gt;pdf2image.convert_from_path&lt;/code&gt; to create jpeg files for the same.&lt;/p&gt;

&lt;p&gt;However, the installation of pdf2image isn't your usual &lt;code&gt;pip3 install pdf2image&lt;/code&gt;. It would rather throw an error like this -&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;The headers or library files could not be found for jpeg,
  a required dependency when compiling Pillow from source.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So first install some dependencies into your system using and then execute you &lt;code&gt;pip3 install&lt;/code&gt; 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-get install libjpeg-dev zlib1g-dev
pip3 install pdf2image
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also &lt;/p&gt;

</description>
      <category>pdf</category>
      <category>python</category>
      <category>image</category>
      <category>install</category>
    </item>
    <item>
      <title>Installation Guide for wkhtmltopdf for pdfkit in Python</title>
      <dc:creator>Mintu Agarwal</dc:creator>
      <pubDate>Tue, 12 Dec 2023 09:34:14 +0000</pubDate>
      <link>https://dev.to/mintuagarwal/python-wkhtmltopdf-for-pdfkit-installation-guide-2745</link>
      <guid>https://dev.to/mintuagarwal/python-wkhtmltopdf-for-pdfkit-installation-guide-2745</guid>
      <description>&lt;p&gt;Hi all, recently I created a project which required transforming an HTML output into a pdf file using python3. I faced several nuances while running the pdfkit util - &lt;code&gt;from_file&lt;/code&gt; in python which internally requires wkhtmltopdf&lt;/p&gt;

&lt;p&gt;You might face an error like the one below when executing pdfkit utilities.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;OSError: No wkhtmltopdf executable found: "b''"
If this file exists please check that this process can read it or you can pass path to it manually in method call, check README. Otherwise please install wkhtmltopdf - https://github.com/JazzCore/python-pdfkit/wiki/Installing-wkhtmltopdf
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;As stated above, we must install the package from the above source. Installing using &lt;code&gt;apt-get install&lt;/code&gt; or &lt;code&gt;pip3 install&lt;/code&gt; may not necessarily work for you.&lt;/p&gt;

&lt;p&gt;For me it threw the following error&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;gt; sudo apt-get install wkhtmltopdf
&amp;gt; pdfkit.from_file('x.html', 'y.pdf')
OSError: wkhtmltopdf exited with non-zero code 1. error:
qt.qpa.screen: QXcbConnection: Could not connect to display localhost:0.0
Could not connect to any X display.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;So the preferred way to get this is:&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 -p ./ https://github.com/wkhtmltopdf/packaging/releases/download/0.12.6-1/wkhtmltox_0.12.6-1.bionic_amd64.deb
sudo dpkg -i  wkhtmltox-0.12.1_linux-wheezy-amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If after executing the second command you see the following error:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dpkg: dependency problems prevent configuration of wkhtmltox:
 wkhtmltox depends on libpng12-0; however:
  Package libpng12-0 is not installed.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Install the libpng12-0 not using &lt;code&gt;apt-get install&lt;/code&gt; but again the package itself&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 http://se.archive.ubuntu.com/ubuntu/pool/main/libp/libpng/libpng12-0_1.2.54-1ubuntu1_amd64.deb
sudo dpkg -i libpng12-0_1.2.54-1ubuntu1_amd64.deb
sudo dpkg -i  wkhtmltox-0.12.1_linux-wheezy-amd64.deb
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now your problem must get resolved. Upvote if this worked for you!&lt;br&gt;
Also, &lt;a href="https://github.com/Mintuagarwal/Yaml-to-CV-generator"&gt;the link &lt;/a&gt; to my project where I used pdfkit, which creates HTML and pdf of your Resume with the user providing the contents in a yaml.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Github Authentication</title>
      <dc:creator>Mintu Agarwal</dc:creator>
      <pubDate>Tue, 12 Dec 2023 07:54:44 +0000</pubDate>
      <link>https://dev.to/mintuagarwal/github-authentication-3il3</link>
      <guid>https://dev.to/mintuagarwal/github-authentication-3il3</guid>
      <description>&lt;p&gt;From 2021-08-13, GitHub is no longer accepting account passwords when authenticating Git operations. You need to add a PAT (Personal Access Token) instead, and you can follow the below method to add a PAT on your system.&lt;/p&gt;

&lt;p&gt;Create Personal Access Token on GitHub&lt;br&gt;
From your GitHub account, go to &lt;code&gt;Settings&lt;/code&gt; → &lt;code&gt;Developer Settings&lt;/code&gt; → &lt;code&gt;Personal Access Token&lt;/code&gt; → &lt;code&gt;Generate New Token&lt;/code&gt; (Give your password) → Fillup the form → click &lt;code&gt;Generate token&lt;/code&gt; → Copy the generated Token, it will be something like ghp_sFhFsSHhTzMDreGRLjmks4Tzuzgthdvfsrta&lt;/p&gt;

&lt;p&gt;Now follow the below method based on your machine:&lt;/p&gt;

&lt;p&gt;For Windows OS ⤴&lt;br&gt;
Go to &lt;code&gt;Credential Manager&lt;/code&gt; from &lt;code&gt;Control Panel&lt;/code&gt; → &lt;code&gt;Windows Credentials&lt;/code&gt; → find &lt;code&gt;git:https://github.com&lt;/code&gt; → &lt;code&gt;Edit&lt;/code&gt; → On Password replace with with your GitHub Personal Access Token → You are Done&lt;/p&gt;

&lt;p&gt;If you don’t find git:&lt;a href="https://github.com"&gt;https://github.com&lt;/a&gt; → Click on Add a generic credential → Internet address will be git:&lt;a href="https://github.com"&gt;https://github.com&lt;/a&gt; and you need to type in your username and password will be your GitHub Personal Access Token → Click Ok and you are done&lt;/p&gt;

&lt;p&gt;For macOS ⤴&lt;br&gt;
Click on the Spotlight icon (magnifying glass) on the right side of the menu bar. Type Keychain access then press the Enter key to launch the app → In Keychain Access, search for github.com → Find the internet password entry for github.com → Edit or delete the entry accordingly → You are done&lt;/p&gt;

&lt;p&gt;For a Linux-based OS ⤴&lt;br&gt;
For Linux, you need to configure the local GIT client with a username and email address,&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git config --global user.name "your_github_username"
$ git config --global user.email "your_github_email"
$ git config -l
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once GIT is configured, we can begin using it to access GitHub. Example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
&amp;gt; Cloning into `YOUR-REPOSITORY`...
Username: &amp;lt;type your username&amp;gt;
Password: &amp;lt;type your password or personal access token (GitHub)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now cache the given record in your computer to remembers the token:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git config --global credential.helper cache
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;If needed, anytime you can delete the cache record by:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;$ git config --global --unset credential.helper
$ git config --system --unset credential.helper
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
    </item>
  </channel>
</rss>
