<?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[Amrit Adhikari]]></title><description><![CDATA[Amrit Adhikari's Blogs | Article | Tech Article |]]></description><link>https://amrit69.com.np</link><generator>RSS for Node</generator><lastBuildDate>Fri, 13 Nov 2026 14:39:06 GMT</lastBuildDate><atom:link href="https://amrit69.com.np/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Image Gallery for Mac: The Ultimate Local Photo Viewer]]></title><description><![CDATA[Introducing Image Gallery — a high-performance, local photo viewer designed specifically for Mac users but fully optimized for Windows as well. Say goodbye…]]></description><link>https://amrit69.com.np/image-gallery-for-mac-the-ultimate-local-photo-viewer</link><guid isPermaLink="true">https://amrit69.com.np/image-gallery-for-mac-the-ultimate-local-photo-viewer</guid><category><![CDATA[macOS]]></category><category><![CDATA[image gallery]]></category><category><![CDATA[mac book]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Mon, 23 Feb 2026 07:07:56 GMT</pubDate><enclosure url="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/641d34cc119b5a3e2efea714/2cfc7cbe-d464-4a9c-8329-8d0036d7845c.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3>Unleash Blazing-Fast Performance on Your Mac</h3>
<p>Introducing <strong>Image Gallery</strong> — a high-performance, local photo viewer designed specifically for Mac users but fully optimized for Windows as well. Say goodbye to sluggish photo viewers and hello to a seamless experience. Image Gallery is tailored for those who demand speed, uncompromising privacy, and a sleek, native interface, whether on Mac or Windows.</p>
<p>If you've ever struggled with slow desktop photo applications, especially when viewing hundreds of high-resolution images, or if you prefer keeping your personal photos and memories securely on your local device rather than uploading them to a corporate cloud, <strong>Image Gallery</strong> was built with you in mind.</p>
<p><a href="https://github.com/iamawmrit/Image-Gallery.git"><mark class="bg-yellow-200 dark:bg-yellow-500/30">https://github.com/iamawmrit/Image-Gallery.git</mark></a></p>
<p><a href="https://awmrit.com/">https://awmrit.com/</a></p>
<img src="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/641d34cc119b5a3e2efea714/2a86bc1a-2b53-4318-9931-a592eca96ad1.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3>Why Choose Image Gallery?</h3>
<p><strong>Image Gallery</strong> comes packed with features that enhance both your viewing and editing experience. With a core focus on <strong>speed</strong>, <strong>privacy</strong>, and a <strong>beautiful aesthetic</strong>, this app offers everything you need to manage and enjoy your photos. Here's a detailed look at its standout features:</p>
<hr />
<h4><strong>Key Features of Image Gallery:</strong></h4>
<ul>
<li><p><strong>Masonry Grid Layout:</strong><br />Photos are automatically arranged in a responsive, visually appealing grid while maintaining their original aspect ratios, making your collection easy to browse.</p>
</li>
<li><p><strong>Local &amp; Private:</strong><br />All image processing is done on your device. No cloud uploads, no data tracking, and no telemetry. Your privacy is our priority.</p>
</li>
<li><p><strong>Blazing-Fast Performance:</strong><br />With optimized virtual scrolling and efficient thumbnail generation, Image Gallery can handle thousands of photos without any lag, providing a smooth, fast experience.</p>
</li>
<li><p><strong>Dark Mode:</strong><br />Designed for ease on the eyes, the modern dark interface lets your photos shine while ensuring comfort during long viewing sessions.</p>
</li>
</ul>
<hr />
<h3><strong>Organize and Discover with Ease</strong></h3>
<ul>
<li><p><strong>Seamless Navigation:</strong><br />Image Gallery features a native sidebar interface that makes it simple to browse your file system and organize your photo collection effortlessly.</p>
</li>
<li><p><strong>Detailed Metadata &amp; EXIF View:</strong><br />Get insights into your photos with a detailed EXIF and metadata panel, providing important information like camera settings and file details.</p>
</li>
<li><p><strong>Built-in Editing Tools:</strong><br />Crop, adjust, and annotate your photos directly within the app. The powerful editing suite lets you fine-tune contrast, apply presets, and even draw on images.</p>
</li>
<li><p><strong>Immersive Viewing Mode:</strong><br />Enter full-screen mode with dark mode for an immersive, distraction-free viewing experience, ensuring your images take center stage.</p>
</li>
</ul>
<img src="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/641d34cc119b5a3e2efea714/d794e71b-db22-4645-adb3-b245eda589d8.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/641d34cc119b5a3e2efea714/bf2ba7b3-b3e8-4f30-9add-5a9781221ea3.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/641d34cc119b5a3e2efea714/4a19bf72-b856-48c3-af10-b5e23c718b52.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/641d34cc119b5a3e2efea714/f0cd3ec2-c09c-4fc7-be0e-703db84605d3.png" alt="" style="display:block;margin:0 auto" />

<img src="https://cloudmate-test.s3.us-east-1.amazonaws.com/uploads/covers/641d34cc119b5a3e2efea714/8eda9c7c-692a-4e54-a3f9-2bc75cb9e962.png" alt="" style="display:block;margin:0 auto" />

<hr />
<h3><strong>Built for Speed and Privacy</strong></h3>
<p><strong>Image Gallery</strong> is more than just a photo viewer; it’s a comprehensive tool designed to streamline your digital photo experience. The app’s robust performance ensures that no matter how large your photo library is, you can browse and edit your images seamlessly. Whether you’re working with a handful of photos or thousands, <strong>Image Gallery</strong> handles it all with lightning speed.</p>
<hr />
<h3><strong>Contribute to the Open-Source Community</strong></h3>
<p>Image Gallery is an open-source project created by <a href="http://awmrit.com"><strong><mark class="bg-yellow-200 dark:bg-yellow-500/30">a</mark></strong></a><a href="https://awmrit.com"><mark class="bg-yellow-200 dark:bg-yellow-500/30">wmrit.com</mark></a><mark class="bg-yellow-200 dark:bg-yellow-500/30">, </mark> and it’s a labor of love. I am actively seeking feedback, bug reports, and contributors to help make this app even better. Whether you’re submitting a feature request or contributing code, your involvement helps strengthen the open-source community and improve the overall experience for users worldwide.</p>
<p><mark class="bg-yellow-200 dark:bg-yellow-500/30">Check out the source code and contribute on </mark> <a href="https://github.com/iamawmrit/Image-Gallery.git"><mark class="bg-yellow-200 dark:bg-yellow-500/30">GitHub</mark></a><mark class="bg-yellow-200 dark:bg-yellow-500/30">.</mark></p>
<p><a href="https://github.com/iamawmrit/Image-Gallery.git"><mark class="bg-yellow-200 dark:bg-yellow-500/30">https://github.com/iamawmrit/Image-Gallery.git</mark></a></p>
<hr />
<h3><strong>Get Started with Image Gallery</strong></h3>
<p>Ready to take control of your digital memories? Clone the repository, build Image Gallery for your operating system, and experience unparalleled photo management. With its focus on performance, privacy, and user experience, Image Gallery is the ultimate local photo viewer for anyone who values speed and security.</p>
]]></content:encoded></item><item><title><![CDATA[A Free Typing Speed Test for Everyone typing.awmrit.com]]></title><description><![CDATA[In today’s digital world, typing is one of the most essential yet overlooked skills. Whether you're a developer, student, writer, or professional, your…]]></description><link>https://amrit69.com.np/a-free-typing-speed-test-for-everyone-typingawmritcom</link><guid isPermaLink="true">https://amrit69.com.np/a-free-typing-speed-test-for-everyone-typingawmritcom</guid><category><![CDATA[typing]]></category><category><![CDATA[speed]]></category><category><![CDATA[typing speed]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Fri, 12 Dec 2025 06:35:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1765521050703/42c1e652-0d23-4a83-8135-d99b702ef0b2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><img src="https://messages-prod.27c852f3500f38c1e7786e2c9ff9e48f.r2.cloudflarestorage.com/deb0ce91-4810-4bf0-abc6-a9d9ad97cc8d/1765520895740-019b113e-672b-7027-b487-1d72392faf9b.png?X-Amz-Algorithm=AWS4-HMAC-SHA256&amp;X-Amz-Content-Sha256=UNSIGNED-PAYLOAD&amp;X-Amz-Credential=af634fe044bd071ab4c5d356fdace60f%2F20251212%2Fauto%2Fs3%2Faws4_request&amp;X-Amz-Date=20251212T062816Z&amp;X-Amz-Expires=3600&amp;X-Amz-Signature=e9499a1ed48cb065a6b8abfd9931822bf9b6d533ffa486b6f508f2aa15163e28&amp;X-Amz-SignedHeaders=host&amp;x-amz-checksum-mode=ENABLED&amp;x-id=GetObject" alt /></p>
<p>In today’s digital world, typing is one of the most essential yet overlooked skills. Whether you're a developer, student, writer, or professional, your typing speed directly impacts your productivity. Faster typing doesn’t just help you complete tasks quickly — it helps you think more clearly, stay focused longer, and work more efficiently.</p>
<p>This is exactly why I built <a target="_blank" href="https://typing.awmrit.com/"><strong><mark>https://typing.awmrit.com/</mark></strong></a>, a free, distraction-free typing speed test designed for anyone who spends time at a keyboard.</p>
<h2 id="heading-why-typing-speed-matters-more-than-you-think"><strong>Why Typing Speed Matters More Than You Think</strong></h2>
<p>Most of us type for hours every single day, but very few intentionally work on improving this skill. The difference between typing at 40 WPM and 80 WPM can significantly influence how you work:</p>
<ul>
<li><p><strong>Longer flow state</strong> — You stay focused without breaking rhythm.</p>
</li>
<li><p><strong>Lower cognitive load</strong> — Your mind processes ideas faster than your fingers, so better speed reduces friction.</p>
</li>
<li><p><strong>Faster execution</strong> — You write, code, document, and communicate more efficiently.</p>
</li>
<li><p><strong>Less fatigue</strong> — Smooth typing reduces strain over long work sessions.</p>
</li>
</ul>
<p>Improvement doesn’t happen instantly — it takes practice. But having the right tool makes a huge difference.</p>
<h2 id="heading-introducing-typingawmritcom"><strong>Introducing typing.awmrit.com</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1765521248012/b0a13c49-5461-46cb-9981-6f641c2447ef.png" alt class="image--center mx-auto" /></p>
<p>I created <strong>typing.awmrit.com</strong> to offer a simple, elegant typing experience without the clutter found on many typing websites.</p>
<p>Here’s what makes it stand out:</p>
<h3 id="heading-real-time-wpm-amp-accuracy-tracking">🔹 <strong>Real-Time WPM &amp; Accuracy Tracking</strong></h3>
<p>See your speed and accuracy update live as you type — no waiting until the end to know how you're performing.</p>
<h3 id="heading-multiple-test-modes">🔹 <strong>Multiple Test Modes</strong></h3>
<p>Choose how you want to practice:</p>
<ul>
<li><p>Time-based: <strong>15s, 30s, 60s</strong></p>
</li>
<li><p>Word-count based</p>
</li>
<li><p>Curated quotes for variety</p>
</li>
</ul>
<h3 id="heading-no-sign-up-or-login-required">🔹 <strong>No Sign-Up or Login Required</strong></h3>
<p>Just open the site and start typing immediately.</p>
<h3 id="heading-shareable-results">🔹 <strong>Shareable Results</strong></h3>
<p>Capture and share your typing score instantly.</p>
<h3 id="heading-dark-theme-for-better-focus">🔹 <strong>Dark Theme for Better Focus</strong></h3>
<p>Designed to reduce strain and help you practice comfortably for longer periods.</p>
<h3 id="heading-virtual-keyboard-display">🔹 <strong>Virtual Keyboard Display</strong></h3>
<p>Watch your keypresses in real time — great for spotting typing habits or mistakes.</p>
<h2 id="heading-where-do-you-stand"><strong>Where Do You Stand?</strong></h2>
<p>The average typing speed is around <strong>40 WPM</strong>.<br />Experienced developers and professionals often reach <strong>60–70 WPM</strong> or more.</p>
<p>Curious about your typing level?</p>
<h2 id="heading-try-it-now"><strong>Try it now</strong></h2>
<p>👉 <a target="_blank" href="https://typing.awmrit.com/"><strong>https://typing.awmrit.com/</strong></a></p>
<p>Give it a try, track your progress, and have fun improving a skill that genuinely boosts productivity.<br />Feel free to share your WPM — I’d love to see how fast everyone can type! 🏆</p>
]]></content:encoded></item><item><title><![CDATA[Book Flip / Turn 3D Effect: An Interactive Experience using turnjs]]></title><description><![CDATA[In the digital age, presenting content in an engaging and interactive manner is essential for capturing the audience's attention. The Book Flip / Turn 3D…]]></description><link>https://amrit69.com.np/book-flip-turn-3d-effect-an-interactive-experience-using-turnjs</link><guid isPermaLink="true">https://amrit69.com.np/book-flip-turn-3d-effect-an-interactive-experience-using-turnjs</guid><category><![CDATA[Book Flip]]></category><category><![CDATA[3d effect]]></category><category><![CDATA[turn js]]></category><category><![CDATA[turnjs]]></category><category><![CDATA[bookk flip]]></category><category><![CDATA[turn page]]></category><category><![CDATA[books]]></category><category><![CDATA[js]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Thu, 06 Mar 2025 08:13:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1741248718528/c052f4da-7fff-491c-b5c2-9ce7241a801b.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-introduction"><strong>Introduction</strong></h2>
<p>In the digital age, presenting content in an engaging and interactive manner is essential for capturing the audience's attention. The <strong>Book Flip / Turn 3D Effect</strong> project offers a unique solution that transforms ordinary content into an immersive experience. This web application allows users to interactively flip through pages, providing a realistic book-like effect that enhances user engagement.</p>
<h2 id="heading-project-overview"><strong>Project Overview</strong></h2>
<p>The <strong>Book Flip / Turn 3D Effect</strong> is designed to be fully responsive, ensuring an optimal viewing experience across various devices, from desktops to mobile phones. By utilizing modern web technologies, this project presents an innovative way for users to explore content, whether it's a digital magazine, portfolio, or any other type of publication.</p>
<h2 id="heading-you-can-find-the-complete-project-on-github-book-flip-turn-3d-effecthttpsgithubcomiamawmritbook-flip-3deffecthttpsgithubcomiamawmritbook-flip-3deffect">You can find the complete project on GitHub: <a target="_blank" href="https://github.com/iamawmrit/book-flip-3DEffect"><strong><mark>Book Flip / Turn 3D Effect</mark></strong></a><a target="_blank" href="https://github.com/iamawmrit/book-flip-3DEffect"><mark>.</mark></a></h2>
<p><a target="_blank" href="https://github.com/iamawmrit/book-flip-3DEffect">Based on the file list</a> provided, the folder structure appears to be:</p>
<pre><code class="lang-markdown"><span class="hljs-bullet">-</span> images
<span class="hljs-bullet">  -</span> img-1.png
<span class="hljs-bullet">  -</span> img-2.jpg
<span class="hljs-bullet">  -</span> img-3.png
<span class="hljs-bullet">-</span> index.html
<span class="hljs-bullet">-</span> book-effect/index.js
<span class="hljs-bullet">-</span> Readme.md
<span class="hljs-bullet">-</span> style.css
<span class="hljs-bullet">-</span> turn.js
</code></pre>
<p>The key elements in the folder structure are:</p>
<ol>
<li><p><code>images</code> folder containing 3 image files: <code>img-1.png</code>, <code>img-2.jpg</code>, and <code>img-3.png</code>.</p>
</li>
<li><p><code>index.html</code> file.</p>
</li>
<li><p><code>book-effect/index.js</code> file.</p>
</li>
<li><p><a target="_blank" href="http://Readme.md"><code>Readme.md</code></a> file.</p>
</li>
<li><p><code>style.css</code> file.</p>
</li>
<li><p><code>turn.js</code> file.</p>
</li>
</ol>
<h3 id="heading-key-features"><strong>Key Features</strong></h3>
<ul>
<li><p><strong>Responsive Design</strong>: The flipbook layout adapts seamlessly to different screen sizes, providing an optimal user experience on any device.</p>
</li>
<li><p><strong>Modern User Interface</strong>: The design is clean and visually appealing, making it easy for users to navigate.</p>
</li>
<li><p><strong>Interactive Navigation</strong>: Users can effortlessly flip through the pages, thanks to the powerful Turn.js plugin, which simulates a realistic page-turning effect.</p>
</li>
</ul>
<h3 id="heading-technologies-used"><strong>Technologies Used</strong></h3>
<p>The flipbook is built using the following technologies:</p>
<ul>
<li><p><strong>HTML5</strong>: For the structural framework of the flipbook.</p>
</li>
<li><p><strong>CSS3</strong>: For styling and ensuring responsiveness.</p>
</li>
<li><p><strong>JavaScript</strong>: To add interactive elements.</p>
</li>
<li><p><strong>Turn.js</strong>: This jQuery plugin provides a lifelike flipping effect, enhancing the overall user experience.</p>
</li>
</ul>
<h2 id="heading-installation-guide"><strong>Installation Guide</strong></h2>
<p>To set up the <strong>Book Flip / Turn 3D Effect</strong> on your local machine, follow these simple steps:</p>
<ol>
<li><p>Clone the repository:</p>
<pre><code class="lang-bash"> git <span class="hljs-built_in">clone</span> https://github.com/iamawmrit/book-flip-3DEffect.git
</code></pre>
</li>
<li><p>Navigate into the project directory:</p>
<pre><code class="lang-bash"> <span class="hljs-built_in">cd</span> book-flip-3DEffect
</code></pre>
</li>
<li><p>Open <code>index.html</code> in your web browser to view the flipbook.</p>
</li>
</ol>
<h3 id="heading-example-images"><strong>Example Images</strong></h3>
<p>Here are a few examples of the content that can be featured in the flipbook:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741248485684/83fa7965-1090-4002-b5da-1955be6eddf7.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741248499659/44bded3e-6dfa-4aaf-998b-1c2089a57cf7.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741248602798/3e4d1db6-6abc-4db3-826a-1caa4f93de8e.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1741248513798/34e204a0-052f-45bf-bc55-a89dfa17550f.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>The <strong>Book Flip / Turn 3D Effect</strong> project is a free-to-use tool that beautifully combines functionality with an engaging user interface. It serves as an excellent example of how to create interactive web applications that captivate users and enhance their experience.</p>
<p>You can find the complete project on GitHub: <a target="_blank" href="https://github.com/iamawmrit/book-flip-3DEffect">Book Flip / Turn 3D Effect</a>.</p>
<p>Explore, contribute, and enjoy the immersive experience of flipping through digital content!</p>
<hr />
<p>Feel free to replace <code>path/to/imageX.jpg</code> with the actual paths to your images and adjust any text as needed!</p>
]]></content:encoded></item><item><title><![CDATA[Setting Up a Secure Django Environment with PostgreSQL, Nginx, and Gunicorn on Ubuntu]]></title><description><![CDATA[Django is a powerful web framework that allows you to quickly build robust applications in Python. While its local development server is great for…]]></description><link>https://amrit69.com.np/setting-up-a-secure-django-environment-with-postgresql-nginx-and-gunicorn-on-ubuntu</link><guid isPermaLink="true">https://amrit69.com.np/setting-up-a-secure-django-environment-with-postgresql-nginx-and-gunicorn-on-ubuntu</guid><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Thu, 06 Mar 2025 07:59:02 GMT</pubDate><content:encoded><![CDATA[<h2 id="heading-introduction">Introduction</h2>
<p>Django is a powerful web framework that allows you to quickly build robust applications in Python. While its local development server is great for development, production environments require a more secure and scalable setup.</p>
<p>In this guide, we'll walk you through the process of deploying a Django project on an Ubuntu server with a PostgreSQL database, using Gunicorn to serve the application and Nginx as a reverse proxy. This setup enhances security and performance by leveraging the strengths of each component.</p>
<p>We'll also discuss how to configure systemd to manage Gunicorn and set up a virtual environment for isolating dependencies.</p>
<h2 id="heading-prerequisites">Prerequisites</h2>
<ul>
<li><p>An Ubuntu 22.04 server or newer with a non-root user and sudo privileges</p>
</li>
<li><p>An active firewall</p>
</li>
<li><p>A registered domain name (optional but recommended)</p>
</li>
</ul>
<hr />
<h2 id="heading-step-1-install-required-packages">Step 1: Install Required Packages</h2>
<ol>
<li><p>First, update your package lists:</p>
<pre><code class="lang-bash"> sudo apt update
 sudo apt upgrade -y
</code></pre>
</li>
<li><p>Next, install Python, PostgreSQL, and Nginx, along with other dependencies:</p>
<pre><code class="lang-bash"> sudo apt install python3-venv python3-dev libpq-dev postgresql postgresql-contrib nginx curl -y
</code></pre>
</li>
</ol>
<hr />
<h2 id="heading-step-2-configure-postgresql-database">Step 2: Configure PostgreSQL Database</h2>
<ol>
<li><p>Switch to the <code>postgres</code> user:</p>
<pre><code class="lang-bash"> sudo -u postgres psql
</code></pre>
</li>
<li><p>Create a new PostgreSQL database and user, replacing <code>myproject</code> and <code>myprojectuser</code> with your project’s name:</p>
<pre><code class="lang-sql"> <span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">DATABASE</span> myproject;
 <span class="hljs-keyword">CREATE</span> <span class="hljs-keyword">USER</span> myprojectuser <span class="hljs-keyword">WITH</span> <span class="hljs-keyword">PASSWORD</span> <span class="hljs-string">'password'</span>;
 <span class="hljs-keyword">ALTER</span> <span class="hljs-keyword">ROLE</span> myprojectuser <span class="hljs-keyword">SET</span> client_encoding <span class="hljs-keyword">TO</span> <span class="hljs-string">'utf8'</span>;
 <span class="hljs-keyword">ALTER</span> <span class="hljs-keyword">ROLE</span> myprojectuser <span class="hljs-keyword">SET</span> default_transaction_isolation <span class="hljs-keyword">TO</span> <span class="hljs-string">'read committed'</span>;
 <span class="hljs-keyword">ALTER</span> <span class="hljs-keyword">ROLE</span> myprojectuser <span class="hljs-keyword">SET</span> timezone <span class="hljs-keyword">TO</span> <span class="hljs-string">'UTC'</span>;
 <span class="hljs-keyword">GRANT</span> <span class="hljs-keyword">ALL</span> <span class="hljs-keyword">PRIVILEGES</span> <span class="hljs-keyword">ON</span> <span class="hljs-keyword">DATABASE</span> myproject <span class="hljs-keyword">TO</span> myprojectuser;
</code></pre>
</li>
<li><p>Exit the PostgreSQL prompt:</p>
<pre><code class="lang-sql"> \q
</code></pre>
</li>
</ol>
<hr />
<h2 id="heading-step-3-set-up-the-python-virtual-environment">Step 3: Set Up the Python Virtual Environment</h2>
<ol>
<li><p>Create and navigate to your project directory:</p>
<pre><code class="lang-bash"> mkdir ~/myprojectdir
 <span class="hljs-built_in">cd</span> ~/myprojectdir
</code></pre>
</li>
<li><p>Set up a virtual environment and activate it:</p>
<pre><code class="lang-bash"> python3 -m venv myprojectenv
 <span class="hljs-built_in">source</span> myprojectenv/bin/activate
</code></pre>
</li>
<li><p>Install Django, Gunicorn, and the PostgreSQL adapter:</p>
<pre><code class="lang-bash"> pip install django gunicorn psycopg2-binary
</code></pre>
</li>
</ol>
<hr />
<h2 id="heading-step-4-create-and-configure-the-django-project">Step 4: Create and Configure the Django Project</h2>
<ol>
<li><p>Start a new Django project:</p>
<pre><code class="lang-bash"> django-admin startproject myproject .
</code></pre>
</li>
<li><p>Configure <code>ALLOWED_HOSTS</code> in <code>myproject/</code><a target="_blank" href="http://settings.py"><code>settings.py</code></a>:</p>
<pre><code class="lang-python"> ALLOWED_HOSTS = [<span class="hljs-string">'your_domain.com'</span>, <span class="hljs-string">'your_server_ip'</span>, <span class="hljs-string">'localhost'</span>]
</code></pre>
</li>
<li><p>Set up the PostgreSQL database connection in <code>myproject/</code><a target="_blank" href="http://settings.py"><code>settings.py</code></a>:</p>
<pre><code class="lang-python"> DATABASES = {
     <span class="hljs-string">'default'</span>: {
         <span class="hljs-string">'ENGINE'</span>: <span class="hljs-string">'django.db.backends.postgresql'</span>,
         <span class="hljs-string">'NAME'</span>: <span class="hljs-string">'myproject'</span>,
         <span class="hljs-string">'USER'</span>: <span class="hljs-string">'myprojectuser'</span>,
         <span class="hljs-string">'PASSWORD'</span>: <span class="hljs-string">'password'</span>,
         <span class="hljs-string">'HOST'</span>: <span class="hljs-string">'localhost'</span>,
         <span class="hljs-string">'PORT'</span>: <span class="hljs-string">''</span>,
     }
 }
</code></pre>
</li>
<li><p>Set up static files:</p>
<pre><code class="lang-python"> STATIC_URL = <span class="hljs-string">'/static/'</span>
 STATIC_ROOT = BASE_DIR / <span class="hljs-string">'static'</span>
</code></pre>
</li>
</ol>
<hr />
<h2 id="heading-step-5-complete-django-setup">Step 5: Complete Django Setup</h2>
<ol>
<li><p>Migrate the database schema:</p>
<pre><code class="lang-bash"> python manage.py migrate
</code></pre>
</li>
<li><p>Create a Django superuser:</p>
<pre><code class="lang-bash"> python manage.py createsuperuser
</code></pre>
</li>
<li><p>Collect static files:</p>
<pre><code class="lang-bash"> python manage.py collectstatic
</code></pre>
</li>
</ol>
<hr />
<h2 id="heading-step-6-test-gunicorns-ability-to-serve-the-project">Step 6: Test Gunicorn's Ability to Serve the Project</h2>
<ol>
<li><p>Run Gunicorn to test serving your application:</p>
<pre><code class="lang-bash"> gunicorn --<span class="hljs-built_in">bind</span> 0.0.0.0:8000 myproject.wsgi
</code></pre>
</li>
<li><p>Visit <a target="_blank" href="http://your_server_ip:8000"><code>http://your_server_ip:8000</code></a> to verify that Django is running.</p>
</li>
</ol>
<hr />
<h2 id="heading-step-7-create-gunicorn-systemd-socket-and-service-files">Step 7: Create Gunicorn systemd Socket and Service Files</h2>
<ol>
<li><p>Create a Gunicorn socket file:</p>
<pre><code class="lang-bash"> sudo nano /etc/systemd/system/gunicorn.socket
</code></pre>
<p> Add the following content:</p>
<pre><code class="lang-ini"> <span class="hljs-section">[Unit]</span>
 <span class="hljs-attr">Description</span>=gunicorn socket

 <span class="hljs-section">[Socket]</span>
 <span class="hljs-attr">ListenStream</span>=/run/gunicorn.sock

 <span class="hljs-section">[Install]</span>
 <span class="hljs-attr">WantedBy</span>=sockets.target
</code></pre>
</li>
<li><p>Create a Gunicorn service file:</p>
<pre><code class="lang-bash"> sudo nano /etc/systemd/system/gunicorn.service
</code></pre>
<p> Add the following content, replacing paths and user details as needed:</p>
<pre><code class="lang-ini"> <span class="hljs-section">[Unit]</span>
 <span class="hljs-attr">Description</span>=gunicorn daemon
 <span class="hljs-attr">Requires</span>=gunicorn.socket
 <span class="hljs-attr">After</span>=network.target

 <span class="hljs-section">[Service]</span>
 <span class="hljs-attr">User</span>=user_name
 <span class="hljs-attr">Group</span>=www-data
 <span class="hljs-attr">WorkingDirectory</span>=/home/user_name/myprojectdir
 <span class="hljs-attr">ExecStart</span>=/home/user_name/myprojectdir/myprojectenv/bin/gunicorn \
           --access-logfile - \
           --workers 3 \
           --bind unix:/run/gunicorn.sock \
           myproject.wsgi:application

 <span class="hljs-section">[Install]</span>
 <span class="hljs-attr">WantedBy</span>=multi-user.target
</code></pre>
</li>
<li><p>Start and enable the Gunicorn socket:</p>
<pre><code class="lang-bash"> sudo systemctl start gunicorn.socket
 sudo systemctl <span class="hljs-built_in">enable</span> gunicorn.socket
</code></pre>
</li>
</ol>
<hr />
<h2 id="heading-step-8-configure-nginx-as-a-reverse-proxy">Step 8: Configure Nginx as a Reverse Proxy</h2>
<ol>
<li><p>Create an Nginx configuration file:</p>
<pre><code class="lang-bash"> sudo nano /etc/nginx/sites-available/myproject
</code></pre>
<p> Add the following content:</p>
<pre><code class="lang-nginx"> <span class="hljs-section">server</span> {
     <span class="hljs-attribute">listen</span> <span class="hljs-number">80</span>;
     <span class="hljs-attribute">server_name</span> your_domain.com your_server_ip;

     <span class="hljs-attribute">location</span> / {
         <span class="hljs-attribute">proxy_pass</span> http://unix:/run/gunicorn.sock;
         <span class="hljs-attribute">proxy_set_header</span> Host <span class="hljs-variable">$host</span>;
         <span class="hljs-attribute">proxy_set_header</span> X-Real-IP <span class="hljs-variable">$remote_addr</span>;
         <span class="hljs-attribute">proxy_set_header</span> X-Forwarded-For <span class="hljs-variable">$proxy_add_x_forwarded_for</span>;
         <span class="hljs-attribute">proxy_set_header</span> X-Forwarded-Proto <span class="hljs-variable">$scheme</span>;
     }

     <span class="hljs-attribute">location</span> /static/ {
         <span class="hljs-attribute">alias</span> /home/awm/myprojectdir/static/;
     }
 }
</code></pre>
</li>
<li><p>Enable the configuration and restart Nginx:</p>
<pre><code class="lang-bash"> sudo ln -s /etc/nginx/sites-available/myproject /etc/nginx/sites-enabled
 sudo nginx -t
 sudo systemctl restart nginx
</code></pre>
</li>
</ol>
<hr />
<h2 id="heading-step-9-troubleshoot-and-complete-setup">Step 9: Troubleshoot and Complete Setup</h2>
<ol>
<li><p>If Nginx or Gunicorn is not running, check their logs:</p>
<pre><code class="lang-bash"> sudo journalctl -u nginx
 sudo journalctl -u gunicorn
</code></pre>
</li>
</ol>
<hr />
<p>Following this setup, your Django application will be served through Nginx and Gunicorn, backed by PostgreSQL for database management, and secured on Ubuntu.</p>
]]></content:encoded></item><item><title><![CDATA[How to Run php artisan queue:work Continuously on cPanel for Laravel Projects]]></title><description><![CDATA[To have the php artisan queue:work command always running on cPanel, you’ll need to set it up using a background process or a cron job that runs…]]></description><link>https://amrit69.com.np/how-to-run-php-artisan-queuework-continuously-on-cpanel-for-laravel-projects</link><guid isPermaLink="true">https://amrit69.com.np/how-to-run-php-artisan-queuework-continuously-on-cpanel-for-laravel-projects</guid><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Mon, 10 Feb 2025 10:13:55 GMT</pubDate><content:encoded><![CDATA[<p>To have the <code>php artisan queue:work</code> command always running on cPanel, you’ll need to set it up using a <strong>background process</strong> or a <strong>cron job</strong> that runs indefinitely. However, cron jobs typically run for a specified time and terminate, so you can't rely on them for a truly persistent background task.</p>
<p>Here's how you can set it up with <strong>Process Management</strong> or using <strong>supervisord</strong> (if available) or through a long-running cron job loop:</p>
<h3 id="heading-method-1-using-nohup-for-a-long-running-process">Method 1: Using <code>nohup</code> for a Long-Running Process</h3>
<ol>
<li><p><strong>SSH into your cPanel account</strong>:</p>
<ul>
<li>You’ll need SSH access to your cPanel account to run this command in the terminal. Ensure SSH is enabled for your account.</li>
</ul>
</li>
<li><p><strong>Run the Queue Worker in the Background</strong>:</p>
<ul>
<li><p>Navigate to the directory where your Laravel project is located, e.g.:</p>
<pre><code class="lang-bash">  <span class="hljs-built_in">cd</span> /home/username/public_html
</code></pre>
</li>
<li><p>Then, use the <code>nohup</code> command to run the worker in the background:</p>
<pre><code class="lang-bash">  nohup php artisan queue:work --daemon &amp;
</code></pre>
</li>
<li><p>The <code>--daemon</code> flag makes the queue worker run continuously without stopping. The <code>nohup</code> command prevents the process from being terminated when you log out.</p>
</li>
<li><p>The <code>&amp;</code> puts the process in the background.</p>
</li>
</ul>
</li>
<li><p><strong>Monitor the process</strong>:</p>
<ul>
<li><p>After running the command, check if the process is running:</p>
<pre><code class="lang-bash">  ps aux | grep queue:work
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Ensure it restarts automatically</strong>:</p>
<ul>
<li>The <code>nohup</code> command ensures it will keep running after you disconnect, but to ensure it restarts automatically in case of failure, you can set up a cron job that checks the process every minute and restarts it if it’s not running.</li>
</ul>
</li>
</ol>
<h3 id="heading-method-2-using-cron-to-keep-the-worker-alive">Method 2: Using <code>cron</code> to Keep the Worker Alive</h3>
<ol>
<li><p><strong>Create a Persistent Cron Job</strong>:</p>
<ul>
<li><p>In cPanel, go to <strong>Cron Jobs</strong> under <strong>Advanced</strong>.</p>
</li>
<li><p>Set up a cron job that runs every minute to check if the worker is already running, and if not, restart it. Use this cron job:</p>
</li>
</ul>
</li>
</ol>
<pre><code class="lang-bash">    * * * * * ps aux | grep <span class="hljs-string">'queue:work'</span> | grep -v grep || nohup php /home/username/public_html/artisan queue:work --daemon &amp;
</code></pre>
<ul>
<li>This command checks if the <code>queue:work</code> process is already running (<code>ps aux | grep 'queue:work'</code>). If not, it starts the process (<code>nohup php artisan queue:work --daemon &amp;</code>).</li>
</ul>
<ol start="2">
<li><p><strong>Save and test the cron job</strong>:</p>
<ul>
<li>After setting up the cron job, it will ensure the worker is always running, even if it crashes or stops for any reason.</li>
</ul>
</li>
</ol>
<h3 id="heading-method-3-using-supervisord-if-allowed-on-your-server">Method 3: Using <code>supervisord</code> (if allowed on your server)</h3>
<p>If you have access to a process manager like <code>supervisord</code> (it may need to be installed and configured by your hosting provider), you can configure it to keep the queue worker running:</p>
<ol>
<li><p><strong>Install</strong> <code>supervisord</code> (if allowed):</p>
<ul>
<li>In some shared hosting environments, this may not be possible, but if you have a VPS or dedicated server, <code>supervisord</code> is a great tool for managing background processes.</li>
</ul>
</li>
<li><p><strong>Configure</strong> <code>supervisord</code> to manage the worker:</p>
<ul>
<li><p>Add a new configuration to supervise the Laravel queue worker.</p>
</li>
<li><p>Example configuration:</p>
<pre><code class="lang-plaintext">  [program:laravel-queue-worker]
  command=php /home/username/public_html/artisan queue:work --daemon
  autostart=true
  autorestart=true
  stderr_logfile=/home/username/laravel-queue-error.log
  stdout_logfile=/home/username/laravel-queue-output.log
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Start and monitor with</strong> <code>supervisord</code>:</p>
<ul>
<li>After configuring, start the process with <code>supervisord</code>.</li>
</ul>
</li>
</ol>
<hr />
<p><strong>Note</strong>: Using <code>nohup</code> or the cron job method is the simplest and most effective way to run <code>php artisan queue:work</code> continuously on cPanel since shared hosting typically restricts tools like <code>supervisord</code>.</p>
<p>Let me know if you need further clarification or assistance!</p>
]]></content:encoded></item><item><title><![CDATA[All Needed Tools Today!]]></title><description><![CDATA[Comprehensive List of the Best AI Tools & Applications Explore the most innovative AI tools and applications available online. This guide organizes them…]]></description><link>https://amrit69.com.np/all-needed-tools-today</link><guid isPermaLink="true">https://amrit69.com.np/all-needed-tools-today</guid><category><![CDATA[AI]]></category><category><![CDATA[Image to Text Converter]]></category><category><![CDATA[text to image]]></category><category><![CDATA[tools]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Mon, 27 Jan 2025 06:08:18 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1737952678695/9ad60bdb-82ad-402d-ad4e-7c3b92439a93.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Comprehensive List of the Best AI Tools &amp; Applications</strong></p>
<p>Explore the most innovative AI tools and applications available online. This guide organizes them into relevant categories, helping you find the perfect solution for your needs. With over 13,000 tools and resources, discover how AI can transform your workflow.</p>
<hr />
<h3 id="heading-ai-platforms-and-databases"><strong>AI Platforms and Databases</strong></h3>
<ol>
<li><p><a target="_blank" href="https://bestofai.com/"><strong>Best of AI</strong></a></p>
<ul>
<li><p>The largest AI database online, featuring over 13,076 tools and applications.</p>
</li>
<li><p>A one-stop platform to find AI tools for any task, organized for easy reference.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-ai-image-generators"><strong>AI Image Generators</strong></h3>
<ol>
<li><p><a target="_blank" href="https://piclumen.com/"><strong>Piclumen</strong></a></p>
<ul>
<li><p>AI-powered text-to-image generator with unlimited usage.</p>
</li>
<li><p>Images are saved on the cloud for 30 days.</p>
</li>
<li><p>Known for producing high-quality visuals.</p>
</li>
</ul>
</li>
<li><p><a target="_blank" href="https://klingai.com/"><strong>Kling AI</strong></a></p>
<ul>
<li>Create imaginative images and videos using state-of-the-art generative AI technology.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://perchance.org/ai-text-to-image-generator"><strong>Perchance</strong></a></p>
<ul>
<li><p>Free, unlimited AI cinematic image generator.</p>
</li>
<li><p>Perfect for creating stunning visuals for personal and professional projects.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-ai-video-generators"><strong>AI Video Generators</strong></h3>
<ol>
<li><p><a target="_blank" href="https://www.genmo.ai/">Genmo</a></p>
<ul>
<li>AI-powered text-to-video generator with unlimited usage (free but little bit show and limitation).</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-text-to-speech-tts-tools"><strong>Text-to-Speech (TTS) Tools</strong></h3>
<ol>
<li><p><a target="_blank" href="https://speechma.com/"><strong>SPEECHMA</strong></a></p>
<ul>
<li><p>Free text-to-speech tool with unlimited AI voices.</p>
</li>
<li><p>Ideal for creating natural-sounding audio for various applications.</p>
</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-ui-and-design-tools"><strong>UI and Design Tools</strong></h3>
<ol>
<li><p><a target="_blank" href="https://www.magicpatterns.com/"><strong>Magic Patterns</strong></a></p>
<ul>
<li><p>Convert sentences into UI design with code.</p>
</li>
<li><p>Perfect for prototyping software ideas quickly.</p>
</li>
</ul>
</li>
<li><p><a target="_blank" href="https://websim.ai/"><strong>Websim</strong></a></p>
<ul>
<li>Transforms text descriptions into UI designs with code.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.recraft.ai/projects"><strong>Recraft</strong></a></p>
<ul>
<li>An advanced text-to-UI design tool similar to Figma.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://openui.fly.dev/"><strong>OpenUI</strong></a></p>
<ul>
<li><p>Generate UI designs based on descriptions or reference screenshots.</p>
</li>
<li><p>Includes version history and account-based usage tracking.</p>
</li>
</ul>
</li>
<li><p><a target="_blank" href="https://v0.dev/"><strong>V0.dev</strong></a></p>
<ul>
<li>Code-to-UI tool supporting multiple languages, including React.js.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.napkin.ai/"><strong>Napkin</strong></a></p>
<ul>
<li>Converts text into visual designs for idea-sharing and collaboration.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.maneken.app/"><strong>Maneken</strong></a></p>
<ul>
<li>Simplifies mockup creation with an all-in-one catalog and editor.</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-ai-development-tools"><strong>AI Development Tools</strong></h3>
<ol>
<li><p><a target="_blank" href="https://www.widecanvas.ai/"><strong>Widecanvas AI</strong></a></p>
<ul>
<li>Allows users to draw, speak, and code apps seamlessly.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.reweb.so/"><strong>Reweb</strong></a></p>
<ul>
<li>A visual builder tailored for developers, simplifying app and web design.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.dora.run/"><strong>Dora</strong></a></p>
<ul>
<li>Create 3D animated websites without coding, leveraging AI tools.</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-professional-assets-for-creators"><strong>Professional Assets for Creators</strong></h3>
<ol>
<li><p><a target="_blank" href="https://freevideoeffect.com/"><strong>MATESFX</strong></a></p>
<ul>
<li>Offers free editing assets for video creators.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://daisyui.com/"><strong>DaisyUI</strong></a></p>
<ul>
<li><p>Tailwind CSS components for rapid web development.</p>
</li>
<li><p>Version 4 introduces significant updates.</p>
</li>
</ul>
</li>
<li><p><a target="_blank" href="https://hugeicons.com/"><strong>Hugeicons</strong></a></p>
<ul>
<li>Features an extensive library of beautiful icons for projects.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.pixelcut.ai/"><strong>Pixelcut</strong></a></p>
<ul>
<li>Best professional profile picture maker.</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-video-editing-and-content-creation"><strong>Video Editing and Content Creation</strong></h3>
<ol>
<li><p><a target="_blank" href="https://www.ssemble.com/"><strong>Ssemble</strong></a></p>
<ul>
<li>Reassemble long videos into engaging shorts effortlessly.</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-search-and-chat-tools"><strong>Search and Chat Tools</strong></h3>
<ol>
<li><p><a target="_blank" href="https://monica.im/"><strong>Monica</strong></a></p>
<ul>
<li>A free alternative to ChatGPT, supporting long-form responses.</li>
</ul>
</li>
<li><p><a target="_blank" href="https://www.perplexity.ai/"><strong>Perplexity</strong></a></p>
<ul>
<li>Similar to ChatGPT but includes references and website links for verification.</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-seo-and-marketing-tools"><strong>SEO and Marketing Tools</strong></h3>
<ol>
<li><p><a target="_blank" href="https://seostudio.tools/"><strong>SEO Studio</strong></a></p>
<ul>
<li>Comprehensive SEO tools, ideal for YouTube optimization and more.</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-rss-and-news-apis"><strong>RSS and News APIs</strong></h3>
<ol>
<li><p><a target="_blank" href="https://developer.nytimes.com/docs/rss-api/1/"><strong>NYTimes RSS API</strong></a></p>
<ul>
<li>Best for integrating RSS feeds with real-time news updates.</li>
</ul>
</li>
</ol>
<hr />
<h3 id="heading-free-fonts"><strong>Free Fonts</strong></h3>
<ol>
<li><p><a target="_blank" href="http://anepali.com/">anepali</a></p>
<ul>
<li>Best for Nepali free fonts.</li>
</ul>
</li>
</ol>
<hr />
<p>Whether you're a developer, designer, marketer, or content creator, these tools and resources are designed to enhance productivity and creativity across various domains. Dive in and explore the potential of AI!</p>
]]></content:encoded></item><item><title><![CDATA[How to Fetch Data from an API Using React Query in a React.js Project Like a Pro]]></title><description><![CDATA[In this article, we will explore how to fetch data from an API in a React.js project using React Query. We’ll also look at how to handle loading states and…]]></description><link>https://amrit69.com.np/how-to-fetch-data-from-an-api-using-react-query-in-a-reactjs-project-like-a-pro</link><guid isPermaLink="true">https://amrit69.com.np/how-to-fetch-data-from-an-api-using-react-query-in-a-reactjs-project-like-a-pro</guid><category><![CDATA[React]]></category><category><![CDATA[react-query]]></category><category><![CDATA[APIs]]></category><category><![CDATA[data fetching]]></category><category><![CDATA[react router]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Sun, 06 Oct 2024 05:43:44 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1728193282821/773b571b-14c7-4265-98fb-998b30916b1a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>In this article, we will explore how to fetch data from an API in a React.js project using React Query. We’ll also look at how to handle loading states and errors gracefully. By the end, you’ll be able to integrate React Query into your projects to streamline data fetching with built-in caching, error handling, and more.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<p>To follow along, make sure you have:</p>
<ul>
<li><p>Basic knowledge of React and React Router.</p>
</li>
<li><p>Node.js and npm installed.</p>
</li>
</ul>
<h3 id="heading-step-1-setting-up-the-project">Step 1: Setting Up the Project</h3>
<p>First, let’s set up a basic React project with React Query and React Router:</p>
<ol>
<li><p><strong>Create a new React app</strong>:</p>
<pre><code class="lang-bash"> npx create-react-app react-query-example
 <span class="hljs-built_in">cd</span> react-query-example
</code></pre>
</li>
<li><p><strong>Install the required packages</strong>:</p>
<pre><code class="lang-bash"> npm install @tanstack/react-query react-router-dom
</code></pre>
</li>
</ol>
<h3 id="heading-step-2-setting-up-react-query">Step 2: Setting Up React Query</h3>
<p>React Query requires a <code>QueryClient</code> and a <code>QueryClientProvider</code> to manage API requests. In your main file (e.g., <code>main.jsx</code>), set up React Query like this:</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">import</span> React <span class="hljs-keyword">from</span> <span class="hljs-string">'react'</span>;
<span class="hljs-keyword">import</span> ReactDOM <span class="hljs-keyword">from</span> <span class="hljs-string">'react-dom/client'</span>;
<span class="hljs-keyword">import</span> { QueryClient, QueryClientProvider } <span class="hljs-keyword">from</span> <span class="hljs-string">'@tanstack/react-query'</span>;
<span class="hljs-keyword">import</span> { createBrowserRouter, RouterProvider } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-router-dom'</span>;
<span class="hljs-keyword">import</span> App <span class="hljs-keyword">from</span> <span class="hljs-string">'./App.jsx'</span>;
<span class="hljs-keyword">import</span> Products <span class="hljs-keyword">from</span> <span class="hljs-string">'./Products.jsx'</span>;
<span class="hljs-keyword">import</span> Product <span class="hljs-keyword">from</span> <span class="hljs-string">'./Product.jsx'</span>;

<span class="hljs-comment">// Create a QueryClient instance</span>
<span class="hljs-keyword">const</span> queryClient = <span class="hljs-keyword">new</span> QueryClient({
    <span class="hljs-attr">defaultOptions</span>: {
        <span class="hljs-attr">queries</span>: {
            <span class="hljs-attr">staleTime</span>: <span class="hljs-number">10000</span>,
        },
    },
});

<span class="hljs-keyword">const</span> router = createBrowserRouter([
    { <span class="hljs-attr">path</span>: <span class="hljs-string">'/'</span>, <span class="hljs-attr">element</span>: <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">App</span> /&gt;</span></span> },
    { <span class="hljs-attr">path</span>: <span class="hljs-string">'/products'</span>, <span class="hljs-attr">element</span>: <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">Products</span> /&gt;</span></span> },
    { <span class="hljs-attr">path</span>: <span class="hljs-string">'/products/:productId'</span>, <span class="hljs-attr">element</span>: <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">Product</span> /&gt;</span></span> },
]);

ReactDOM.createRoot(<span class="hljs-built_in">document</span>.getElementById(<span class="hljs-string">'root'</span>)).render(
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">QueryClientProvider</span> <span class="hljs-attr">client</span>=<span class="hljs-string">{queryClient}</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">RouterProvider</span> <span class="hljs-attr">router</span>=<span class="hljs-string">{router}</span> /&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">QueryClientProvider</span>&gt;</span></span>
);
</code></pre>
<h3 id="heading-step-3-creating-the-app-component">Step 3: Creating the <code>App</code> Component</h3>
<p>We’ll start by creating a simple <code>App</code> component with links to the Products page.</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">import</span> { Link } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-router-dom'</span>;

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">App</span>(<span class="hljs-params"></span>) </span>{
    <span class="hljs-keyword">return</span> (
        <span class="xml"><span class="hljs-tag">&lt;&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>React Query<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
                <span class="hljs-tag">&lt;<span class="hljs-name">Link</span> <span class="hljs-attr">to</span>=<span class="hljs-string">"/products"</span>&gt;</span>Products<span class="hljs-tag">&lt;/<span class="hljs-name">Link</span>&gt;</span>
            <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
        <span class="hljs-tag">&lt;/&gt;</span></span>
    );
}

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> App;
</code></pre>
<h3 id="heading-step-4-fetching-data-in-the-products-component">Step 4: Fetching Data in the <code>Products</code> Component</h3>
<p>Now, let’s fetch a list of products from an API and display them. We’ll use the <code>useQuery</code> hook to fetch data and handle loading and error states.</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">import</span> { useQuery } <span class="hljs-keyword">from</span> <span class="hljs-string">"@tanstack/react-query"</span>;
<span class="hljs-keyword">import</span> { Link } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-router-dom'</span>;

<span class="hljs-keyword">const</span> fetchProducts = <span class="hljs-keyword">async</span> () =&gt; {
  <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">"https://dummyjson.com/products"</span>);
  <span class="hljs-keyword">if</span> (!response.ok) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">"Failed to fetch products"</span>);
  <span class="hljs-keyword">const</span> data = <span class="hljs-keyword">await</span> response.json();
  <span class="hljs-keyword">return</span> data.products;
};

<span class="hljs-keyword">const</span> Products = <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-keyword">const</span> { isLoading, error, <span class="hljs-attr">data</span>: products } = useQuery({ 
    <span class="hljs-attr">queryKey</span>: [<span class="hljs-string">'products'</span>], 
    <span class="hljs-attr">queryFn</span>: fetchProducts 
  });

  <span class="hljs-keyword">if</span> (isLoading) <span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Loading...<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span></span>;
  <span class="hljs-keyword">if</span> (error) <span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>{error.message}<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span></span>;

  <span class="hljs-keyword">return</span> (
    <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Products<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">ul</span>&gt;</span>
        {products.map(product =&gt; (
          <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">key</span>=<span class="hljs-string">{product.id}</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">Link</span> <span class="hljs-attr">to</span>=<span class="hljs-string">{</span>`/<span class="hljs-attr">products</span>/${<span class="hljs-attr">product.id</span>}`}&gt;</span>{product.title}<span class="hljs-tag">&lt;/<span class="hljs-name">Link</span>&gt;</span>
          <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        ))}
      <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
  );
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> Products;
</code></pre>
<p>In the <code>Products</code> component:</p>
<ul>
<li><p>We define an async function <code>fetchProducts</code> that fetches data from the API.</p>
</li>
<li><p>The <code>useQuery</code> hook is used to manage the data fetching. It handles caching, loading, and error states automatically.</p>
</li>
<li><p><code>isLoading</code> is <code>true</code> while data is being fetched, so we show a loading message.</p>
</li>
<li><p>If <code>error</code> exists, we display the error message.</p>
</li>
<li><p>Once data is fetched, we map through the <code>products</code> and render them as links.</p>
</li>
</ul>
<h3 id="heading-step-5-fetching-data-in-the-product-component">Step 5: Fetching Data in the <code>Product</code> Component</h3>
<p>To display individual product details, we’ll set up a <code>Product</code> component with similar error handling.</p>
<pre><code class="lang-jsx"><span class="hljs-keyword">import</span> { useQuery } <span class="hljs-keyword">from</span> <span class="hljs-string">"@tanstack/react-query"</span>;
<span class="hljs-keyword">import</span> { useParams } <span class="hljs-keyword">from</span> <span class="hljs-string">'react-router-dom'</span>;

<span class="hljs-keyword">const</span> fetchProduct = <span class="hljs-keyword">async</span> (id) =&gt; {
    <span class="hljs-keyword">const</span> response = <span class="hljs-keyword">await</span> fetch(<span class="hljs-string">`https://dummyjson.com/products/<span class="hljs-subst">${id}</span>`</span>);
    <span class="hljs-keyword">if</span> (!response.ok) <span class="hljs-keyword">throw</span> <span class="hljs-keyword">new</span> <span class="hljs-built_in">Error</span>(<span class="hljs-string">"Failed to fetch product details"</span>);
    <span class="hljs-keyword">return</span> response.json();
};

<span class="hljs-keyword">const</span> Product = <span class="hljs-function">() =&gt;</span> {
    <span class="hljs-keyword">const</span> { productId } = useParams();
    <span class="hljs-keyword">const</span> { isLoading, error, <span class="hljs-attr">data</span>: product } = useQuery({
        <span class="hljs-attr">queryKey</span>: [<span class="hljs-string">'product'</span>, productId],
        <span class="hljs-attr">queryFn</span>: <span class="hljs-function">() =&gt;</span> fetchProduct(productId),
    });

    <span class="hljs-keyword">if</span> (isLoading) <span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>Loading...<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span></span>;
    <span class="hljs-keyword">if</span> (error) <span class="hljs-keyword">return</span> <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>{error.message}<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span></span>;

    <span class="hljs-keyword">return</span> (
        <span class="xml"><span class="hljs-tag">&lt;<span class="hljs-name">div</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>{product.title}<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Price: ${product.price}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
            <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>Description: {product.description}<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span></span>
    );
};

<span class="hljs-keyword">export</span> <span class="hljs-keyword">default</span> Product;
</code></pre>
<p>In the <code>Product</code> component:</p>
<ul>
<li><p>We use the <code>useParams</code> hook to access the <code>productId</code> from the URL.</p>
</li>
<li><p>The <code>fetchProduct</code> function makes a request to the API, passing in the <code>productId</code>.</p>
</li>
<li><p>Similar to the <code>Products</code> component, we handle loading and error states. If there is an error, we show the error message; otherwise, we display the product details.</p>
</li>
</ul>
<h3 id="heading-wrapping-up">Wrapping Up</h3>
<p>With React Query, data fetching in React becomes much simpler and more reliable. This example showcases:</p>
<ul>
<li><p><strong>Centralized Error and Loading Management</strong>: React Query automatically handles loading and error states, which we can customize in our components.</p>
</li>
<li><p><strong>Data Caching</strong>: Data fetched with React Query is cached and can be configured to stay fresh or stale based on the <code>staleTime</code> setting in <code>QueryClient</code>.</p>
</li>
</ul>
<p>You can now build on top of this foundation, extending your project to include more features or different API endpoints as needed. React Query’s robust features make it an ideal tool for any project that relies on external data fetching.</p>
]]></content:encoded></item><item><title><![CDATA[Adding an SSH key to your GitHub account from a MacBook]]></title><description><![CDATA[Adding an SSH key to your GitHub account from a MacBook involves a few steps. Here's a guide: Open Terminal on your MacBook. Generate SSH Key: Start the…]]></description><link>https://amrit69.com.np/adding-an-ssh-key-to-your-github-account-from-a-macbook</link><guid isPermaLink="true">https://amrit69.com.np/adding-an-ssh-key-to-your-github-account-from-a-macbook</guid><category><![CDATA[ssh]]></category><category><![CDATA[ssh-keys]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[macbook]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Sat, 27 Apr 2024 05:29:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1714195714421/56e9e19c-b77c-4252-bc18-f199f5c101de.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Adding an SSH key to your GitHub account from a MacBook involves a few steps. Here's a guide:</p>
<ol>
<li><p>Open Terminal on your MacBook.</p>
</li>
<li><p>Generate SSH Key:</p>
<pre><code class="lang-bash"> ssh-keygen -t rsa -b 4096 -C <span class="hljs-string">"your_email@example.com"</span>
</code></pre>
</li>
<li><p>Start the SSH agent:</p>
<pre><code class="lang-bash"> <span class="hljs-built_in">eval</span> <span class="hljs-string">"<span class="hljs-subst">$(ssh-agent -s)</span>"</span>
</code></pre>
</li>
<li><p>Add SSH private key to the agent:</p>
<pre><code class="lang-bash"> ssh-add -K ~/.ssh/id_rsa
</code></pre>
</li>
<li><p>Copy SSH public key to clipboard:</p>
<pre><code class="lang-bash"> pbcopy &lt; ~/.ssh/id_rsa.pub
</code></pre>
</li>
<li><p>Log in to your GitHub account in a web browser.</p>
</li>
<li><p>Go to "Settings" by clicking on your profile icon in the top-right corner and selecting "Settings".</p>
</li>
<li><p>In the left sidebar, click on "SSH and GPG keys".</p>
</li>
<li><p>Click on the "New SSH key" button.</p>
</li>
<li><p>In the "Title" field, add a descriptive label for your SSH key (e.g., MacBook).</p>
</li>
<li><p>Paste your SSH key into the "Key" field. You can paste it directly from your clipboard.</p>
</li>
<li><p>Click the "Add SSH key" button.</p>
</li>
<li><p>GitHub will prompt you to confirm adding the SSH key. Enter your GitHub password to confirm.</p>
</li>
<li><p>Verify the SSH key:</p>
<pre><code class="lang-bash">ssh -T git@github.com
</code></pre>
</li>
</ol>
<p>That's it! Your SSH key should now be added to your GitHub account.</p>
]]></content:encoded></item><item><title><![CDATA[Temp Emails and Phone Numbers!]]></title><description><![CDATA[Email. Phone Number.]]></description><link>https://amrit69.com.np/temp-emails-and-phone-numbers</link><guid isPermaLink="true">https://amrit69.com.np/temp-emails-and-phone-numbers</guid><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Wed, 06 Mar 2024 17:40:59 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709746701626/45b375f5-e582-4346-be68-1aee99ef6384.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-email">Email.</h2>
<p><a target="_blank" href="https://www.emailondeck.com/">https://www.emailondeck.com/</a></p>
<h2 id="heading-phone-number">Phone Number.</h2>
<p><a target="_blank" href="https://quackr.io/">https://quackr.io/</a></p>
]]></content:encoded></item><item><title><![CDATA[How to Install Odoo with source code (DEV edition)]]></title><description><![CDATA[Open the command prompt. Go to the directory where you want to take a clone of Odoo’s source code. Take a clone using the command (HTTPS). git clone]]></description><link>https://amrit69.com.np/how-to-install-odoo-with-source-code-dev-edition</link><guid isPermaLink="true">https://amrit69.com.np/how-to-install-odoo-with-source-code-dev-edition</guid><category><![CDATA[odo]]></category><category><![CDATA[Odoo]]></category><category><![CDATA[Python]]></category><category><![CDATA[localhost]]></category><category><![CDATA[source code]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Wed, 28 Feb 2024 05:17:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1709095836965/0f36f13c-1026-4a70-af49-1604a34309be.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-i-download-odoo-source-code"><strong>i. Download Odoo Source Code</strong></h2>
<ol>
<li><p>Open the command prompt.</p>
</li>
<li><p>Go to the directory where you want to take a clone of Odoo’s source code.</p>
</li>
<li><p>Take a clone using the command (HTTPS).</p>
<p> git clone <a target="_blank" href="https://github.com/odoo/odoo.git">https://github.com/odoo/odoo.git</a></p>
</li>
</ol>
<h2 id="heading-ii-install-python">ii. <strong>Install Python</strong></h2>
<p>Download the Python installer <a target="_blank" href="http://www.python.org/downloads/">www.python.org/downloads/</a> and install it. (in 2024 for Odoo 17, I recommend Python 3.10.5 version)</p>
<h2 id="heading-iii-install-postgresql-12-or-newer-version">iii. <strong>Install PostgreSQL (12 or newer version)</strong></h2>
<p>Download Postgresql from <a target="_blank" href="https://www.postgresql.org/download/">https://www.postgresql.org/download/</a> and install it.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709096271861/c557f33f-e309-4bf0-a8a2-c2b3d2c88c62.png" alt="Install Postgresql" class="image--center mx-auto" /></p>
<p>Please select all the fields where we need pgAdmin4 later to access the database.</p>
<h2 id="heading-iv-create-a-new-postgresql-user"><strong>iv. Create a new PostgreSQL user</strong></h2>
<ol>
<li>Go to pgAdmin and follow the given steps.</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709096562566/14393f83-7dc2-41f4-8bc2-c74295b2b5c0.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709096597846/82f29990-3868-4617-b0b9-9b5fabe716f7.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709096612919/037b4d87-e666-4d80-8b93-d15ae374c9f6.png" alt class="image--center mx-auto" /></p>
<p>For easiness username and password I set "odoo".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709096622320/ec1c8ccf-9c15-47c9-abbc-6b0a17896fe2.png" alt class="image--center mx-auto" /></p>
<p>And set the privileges of the user.</p>
<h2 id="heading-v-install-dependent-libraries"><strong>V. Install Dependent Libraries</strong></h2>
<p>In the command prompt, go to the recently cloned Odoo repo where the requirements.txt file is located and run the commands:</p>
<p><mark>note: I would like to recommend making a virtual environment.</mark></p>
<pre><code class="lang-bash"><span class="hljs-comment">#creating virtual env</span>
python -m venv .venv
<span class="hljs-comment">#activating virtual env</span>
.\.venv\Scripts\activate
</code></pre>
<p>Your virtual environment is active. Now, open your terminal and copy and paste the below commands.</p>
<pre><code class="lang-bash">pip install setuptools wheel

pip install -r requirements.txt
</code></pre>
<h2 id="heading-vi-configure-odoo-amp-start-the-server">VI. <strong>Configure Odoo &amp; Start the Server</strong></h2>
<ol>
<li><p>Open the command prompt, visit the Odoo directory, and locate the Odoo-bin file.</p>
</li>
<li><p>Run the command:</p>
</li>
</ol>
<pre><code class="lang-bash">python odoo-bin -r db_user -w db_password --addons-path=addons -d demo_db
</code></pre>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709097092897/1ef9f384-5696-4f5e-bcc4-ff7ec11b5139.png" alt="How to run odoo with postgresql" class="image--center mx-auto" /></p>
<p>Now go to the browser and type <a target="_blank" href="http://localhost:8069"><mark>localhost:8069</mark></a></p>
<p>In the login screen, enter your email (<strong><mark>admin</mark></strong>) and password (<strong><mark>admin</mark></strong>) and Hit “Login”.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709097318271/3e54b5db-0651-446a-bf19-eaff2da7744a.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1709097344464/6fc23cb0-cf05-4788-89c7-ace0b15979ed.png" alt class="image--center mx-auto" /></p>
<p>Now, You're Good to Go------&gt;</p>
]]></content:encoded></item><item><title><![CDATA[Install and activate Office for FREE legally]]></title><description><![CDATA[Install and activate Office for FREE legally]]></description><link>https://amrit69.com.np/install-and-activate-office-for-free-legally</link><guid isPermaLink="true">https://amrit69.com.np/install-and-activate-office-for-free-legally</guid><category><![CDATA[active office]]></category><category><![CDATA[Activating Office 2019 using KMS license key]]></category><category><![CDATA[office365]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Sun, 04 Feb 2024 06:08:29 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1707026829000/2b330662-35b2-4968-98c6-4c1f430caf89.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-step-1-open-the-command-prompt-in-administrator-mode"><strong>Step 1:</strong> Open the command prompt in administrator mode.</h2>
<p>Just copy/paste the commands and do not forget to hit Enter to execute them.</p>
<pre><code class="lang-bash"><span class="hljs-built_in">cd</span> /d %ProgramFiles%\Microsoft Office\Office16
<span class="hljs-built_in">cd</span> /d %ProgramFiles(x86)%\Microsoft Office\Office16
</code></pre>
<h2 id="heading-step-2-open-the-location-of-the-office-installed-on-your-pc"><strong>Step 2:</strong> Open the location of the Office installed on your PC.</h2>
<p>Just copy/paste the commands and do not forget to hit Enter to execute them.</p>
<pre><code class="lang-bash"><span class="hljs-keyword">for</span> /f %x <span class="hljs-keyword">in</span> (<span class="hljs-string">'dir /b ..\root\Licenses16\ProPlus2019VL*.xrm-ms'</span>) <span class="hljs-keyword">do</span> cscript ospp.vbs /inslic:<span class="hljs-string">"..\root\Licenses16\%x"</span>
</code></pre>
<h2 id="heading-step-3-activate-your-office-using-the-kms-client-key"><strong>Step 3:</strong> Activate your Office using the KMS client key.</h2>
<p>Just copy/paste the commands and do not forget to hit Enter to execute them.</p>
<pre><code class="lang-bash">cscript ospp.vbs /setprt:1688
cscript ospp.vbs /unpkey:6MWKP &gt;nul
cscript ospp.vbs /inpkey:NMMKJ-6RK4F-KMJVX-8D9MJ-6MWKP
cscript ospp.vbs /sethst:107.175.77.7
cscript ospp.vbs /act
</code></pre>
<p><mark>Right now the Office is activated successfully.</mark></p>
<p>or</p>
<h3 id="heading-just-copypaste-the-commands-and-do-not-forget-to-hit-enter-to-execute-them">Just copy/paste the commands and do not forget to hit Enter to execute them.</h3>
<p><a target="_blank" href="https://massgrave.dev/">https://massgrave.dev/</a></p>
<pre><code class="lang-plaintext">irm https://get.activated.win | iex

irm https://massgrave.dev/get | iex
</code></pre>
]]></content:encoded></item><item><title><![CDATA[Oh My Posh Installation in a Minute!]]></title><description><![CDATA[Open a PowerShell prompt and run the following command: If you get any installation error use the following command to force-install: And For Update: Open…]]></description><link>https://amrit69.com.np/oh-my-posh-installation-in-a-minute</link><guid isPermaLink="true">https://amrit69.com.np/oh-my-posh-installation-in-a-minute</guid><category><![CDATA[oh-my-posh]]></category><category><![CDATA[terminal]]></category><category><![CDATA[Icons]]></category><category><![CDATA[Termin]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Mon, 16 Oct 2023 05:49:20 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1697436252412/db9e37ab-626b-414c-a886-b36ae90df721.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h2 id="heading-step-1-installation">Step 1: Installation</h2>
<p>Open a PowerShell prompt and run the following command:</p>
<pre><code class="lang-plaintext">winget install JanDeDobbeleer.OhMyPosh -s winget
</code></pre>
<p>If you get any installation error use the following command to <mark>force-install:</mark></p>
<pre><code class="lang-plaintext">Set-ExecutionPolicy Bypass -Scope Process -Force; Invoke-Expression ((New-Object System.Net.WebClient).DownloadString('https://ohmyposh.dev/install.ps1'))
</code></pre>
<p>And For Update:</p>
<p>Open a PowerShell prompt and run the following command:</p>
<pre><code class="lang-plaintext">winget upgrade JanDeDobbeleer.OhMyPosh -s winget
</code></pre>
<h2 id="heading-step-2-installation-prediction-source-history">Step 2: Installation Prediction Source History</h2>
<p>Open a PowerShell prompt and run the following command:</p>
<pre><code class="lang-plaintext">Install-Module -Name PSReadLine
</code></pre>
<h2 id="heading-step-3-for-terminal-icons">Step 3: For Terminal Icons</h2>
<p>For Icons on the terminal, Open a PowerShell prompt and run the following command:</p>
<pre><code class="lang-plaintext">Install-Module -Name Terminal-Icons -Repository PSGallery
</code></pre>
<p><mark>INFO</mark></p>
<p><mark>To display all icons, we recommend the use of a </mark> <a target="_blank" href="https://ohmyposh.dev/docs/installation/fonts"><mark>Hack Nerd Font</mark></a><mark>.</mark></p>
<pre><code class="lang-plaintext">oh-my-posh font install
</code></pre>
<h2 id="heading-step-4-powershell-profile">Step 4: Powershell Profile</h2>
<p>Now Open a PowerShell prompt and run the following command:</p>
<pre><code class="lang-plaintext">Code $profile
</code></pre>
<p>and copy and paste the following code</p>
<pre><code class="lang-plaintext">oh-my-posh init pwsh --config "$env:POSH_THEMES_PATH\jandedobbeleer.omp.json" | Invoke-Expression
Import-Module -Name Terminal-Icons
Import-Module -Name PSReadLine

Set-PSReadLineOPtion -PredictionSource History
</code></pre>
<p><mark>Note: For the Python Developer I would highly recommend that you follow this gist link and copy-paste code from the following gist:</mark></p>
<p><a target="_blank" href="https://gist.github.com/iamawmrit/748e53cb77a1d23195877d86a70e0fe0">https://gist.github.com/iamawmrit/748e53cb77a1d23195877d86a70e0fe0</a></p>
<p>Now You're good to go!</p>
<h2 id="heading-additional-things">Additional Things:</h2>
<p>For Fonts click on the following link to download <mark>Hack Nerd Font</mark> And use it on your terminal!</p>
<p><a target="_blank" href="https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Hack.zip">https://github.com/ryanoasis/nerd-fonts/releases/download/v3.0.2/Hack.zip</a></p>
]]></content:encoded></item><item><title><![CDATA[Exporting and Importing Data in Django]]></title><description><![CDATA[Introduction: Django provides powerful tools for exporting and importing data in your web applications. This article will guide you through the process of…]]></description><link>https://amrit69.com.np/exporting-and-importing-data-in-django</link><guid isPermaLink="true">https://amrit69.com.np/exporting-and-importing-data-in-django</guid><category><![CDATA[Python]]></category><category><![CDATA[Django]]></category><category><![CDATA[Export Import Data]]></category><category><![CDATA[json]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Wed, 11 Oct 2023 07:46:24 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1697010269393/ed720dca-9104-45ae-981f-b97337bf6efe.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><strong>Introduction:</strong></p>
<p>Django provides powerful tools for exporting and importing data in your web applications. This article will guide you through the process of exporting and importing data using the <code>dumpdata</code> and <code>loaddata</code> management commands in Django. These commands allow you to create data backups, transfer data between different projects, and manage data migration efficiently.</p>
<p><strong>Prerequisites:</strong></p>
<p>Before proceeding, ensure you have a Django project set up and running, and that you have data in your database that you want to export or import.</p>
<p><strong>Exporting Data with</strong> <code>dumpdata</code>:</p>
<p><strong>Step 1: Open the Command Line</strong></p>
<p>Open your command line or terminal and navigate to your Django project's root directory. Make sure your virtual environment is activated.</p>
<p><strong>Step 2: Run</strong> <code>dumpdata</code> to Export Data</p>
<p>The <code>dumpdata</code> command allows you to export data from your Django project. To export data for all installed apps and models, use the following command:</p>
<pre><code class="lang-bash">python manage.py dumpdata &gt; data.json
</code></pre>
<p>This command exports data from all apps and models and saves it to a file named <code>data.json</code>. You can replace <code>data.json</code> with your preferred file name and path.</p>
<p><strong>Step 3: Customizing the Export:</strong></p>
<p>To export data from specific apps or models, specify them as arguments to the <code>dumpdata</code> command. For example:</p>
<pre><code class="lang-bash">python manage.py dumpdata app_name.ModelName &gt; custom_data.json
</code></pre>
<p>This exports data only for the specified app and model to a file named <code>custom_data.json</code>.</p>
<p><strong>Importing Data with</strong> <code>loaddata</code>:</p>
<p><strong>Step 1: Open the Command Line</strong></p>
<p>Navigate to your Django project's root directory in the command line.</p>
<p><strong>Step 2: Run</strong> <code>loaddata</code> to Import Data</p>
<p>To import data from a JSON file, use the <code>loaddata</code> command:</p>
<pre><code class="lang-bash">python manage.py loaddata data.json
</code></pre>
<p>This command populates your database with data from the specified JSON file (in this case, <code>data.json</code>). Make sure the JSON file contains data in a format compatible with your Django models.</p>
<p><strong>Step 3: Verify the Import</strong></p>
<p>After running <code>loaddata</code>, you can verify that the data has been imported successfully by checking your Django admin interface or your application.</p>
<p><strong>Conclusion:</strong></p>
<p>Exporting and importing data in Django using the <code>dumpdata</code> and <code>loaddata</code> management commands is a straightforward and effective process. Whether you need to create backups, transfer data between projects, or manage data migration, these commands are valuable tools.</p>
<p>By following the steps outlined in this article, you can confidently export and import data in your Django project, ensuring data integrity and efficient data management.</p>
]]></content:encoded></item><item><title><![CDATA[Clone private repo to the cPanel!]]></title><description><![CDATA[You can copy and paste these commands into your terminal to execute them. You can copy and paste these commands into your terminal to execute them. Note…]]></description><link>https://amrit69.com.np/clone-private-repo-to-the-cpanel</link><guid isPermaLink="true">https://amrit69.com.np/clone-private-repo-to-the-cpanel</guid><category><![CDATA[cpanel]]></category><category><![CDATA[hosting]]></category><category><![CDATA[GitHub]]></category><category><![CDATA[deployment]]></category><category><![CDATA[repo to cpanel]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Fri, 06 Oct 2023 06:44:58 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1696578126365/3504b971-e7e9-4cd6-a161-3d960781adb0.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-overall-all-commands-are"><mark>Overall all commands are!</mark></h1>
<pre><code class="lang-bash"><span class="hljs-comment"># Generate an RSA SSH key pair with 2048 bits and a comment</span>
ssh-keygen -t rsa -b 2048 -C username@serverdomain

<span class="hljs-comment"># Create an SSH configuration file if it doesn't exist</span>
touch ~/.ssh/config

<span class="hljs-comment"># Set the permissions of the SSH configuration file to 0600</span>
chmod 0600 ~/.ssh/config

<span class="hljs-comment"># Change ownership of the SSH configuration file to the username</span>
chown username:username ~/.ssh/config

<span class="hljs-comment"># Test the SSH connection to GitHub</span>
ssh -T git@github.com
</code></pre>
<p>You can copy and paste these commands into your terminal to execute them.</p>
<h2 id="heading-step-1-open-the-terminal-from-your-cpanel">Step 1: Open the terminal from your cPanel</h2>
<h2 id="heading-step-2-type-or-copy-this-text">Step 2: Type or copy this text</h2>
<pre><code class="lang-bash"><span class="hljs-comment"># Generate an RSA SSH key pair with 2048 bits and a comment</span>
ssh-keygen -t rsa -b 2048 -C username@serverdomain
</code></pre>
<p>You can copy and paste these commands into your terminal to execute them.</p>
<p><mark>Note: fill in the username and the server domain as shown in the given below:</mark></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572003183/792395f2-17ad-4cd0-8070-dec4a4c10008.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-3-now-press-enter">Step 3: Now press enter</h2>
<p><mark>note: there could be already so if you want to overwrite then type y and press enter</mark></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572056520/9d6ece95-57d1-4630-a096-450fb0ce88c2.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572092137/425b56e1-d1da-4e89-a254-4bc0afa9a8a9.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-4-now-copy-and-paste-or-type-given-below-command">Step 4: Now copy and paste or type given below command</h2>
<pre><code class="lang-bash"><span class="hljs-comment"># Create an SSH configuration file if it doesn't exist</span>
touch ~/.ssh/config

<span class="hljs-comment"># Set the permissions of the SSH configuration file to 0600</span>
chmod 0600 ~/.ssh/config

<span class="hljs-comment"># Change ownership of the SSH configuration file to the username</span>
chown username:username ~/.ssh/config
</code></pre>
<p>You can copy and paste these commands into your terminal to execute them.</p>
<p><mark>note: check in the username you have to put your username</mark></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572194507/7ec42331-8f7d-40df-8a04-7aa5d0007429.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572315762/63f5f49e-488a-4b79-92b3-73227738b7f1.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-5-now-open-ssh-access-on-your-cpanel">Step 5: Now open <mark>SSH Access</mark> on your cPanel</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572381241/8e15158a-4156-40ca-9dce-b47c0e62d678.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-6-now-open-manage-ssh-keys">Step 6: Now open <mark>Manage SSH Keys</mark></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572437317/e9221c6e-a76a-4f1a-9b0d-6d6413860daa.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-7-now-open-the-viewithdownload-option">Step 7: Now open the <mark>View/Download </mark> Option</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572516790/d4e9e766-723f-4282-b3d5-5dd2d6ee86ec.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-8-now-copy-the-ssh-key-or-download-it">Step 8: Now copy the ssh key or download it</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572554544/5a0b84c7-3a8e-4ec7-8b09-c53cec4b330f.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-8-now-go-to-the-github-repo-and-add-deploy-keys-by-below-screenshots">Step 8: Now go to the GitHub repo and add deploy keys by below screenshots</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572692932/c9c12dde-df22-4050-81d1-a06f83013e92.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572812762/b931649a-dd57-4bee-8054-2c7ca22afda8.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572843352/48791c58-8966-480a-8b52-6b5dd7b0d0f7.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-9-now-open-the-terminal-again-on-your-cpanel-and-paste-the-given-below-command-and-press-enter">Step 9: Now open the terminal again on your cPanel and paste the given below command and press enter</h2>
<pre><code class="lang-bash"><span class="hljs-comment"># Test the SSH connection to GitHub</span>
ssh -T git@github.com
</code></pre>
<p>You can copy and paste these commands into your terminal to execute them.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696572932995/dc6338bd-18fd-4716-b7db-5a4ef6cc3b81.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-10-now-go-to-the-git-version-control-on-cpanel">Step 10: Now go to the Git version control on Cpanel</h2>
<p>now, click on the create button. and copy the ssh link of the private repo from your GitHub</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696573112167/309635e7-8ce1-4395-a2e7-62ada2458174.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696573163536/66cf86b0-5f6c-429f-8bd1-62d1a1728ed2.png" alt class="image--center mx-auto" /></p>
<h2 id="heading-step-11-now-click-on-the-create-button-copy-the-ssh-link-of-the-private-repo-from-your-github-and-paste-it-to-the-clone-url-option">Step 11: Now, click on the create button, copy the SSH link of the private repo from your GitHub and paste it to the <mark>clone URL</mark> Option</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696573248713/7b502be7-17d9-4e49-b38f-c778f3e0314b.png" alt class="image--center mx-auto" /></p>
<p><mark>note: you could change the repository path and simply click on the create button if you want to update the changes go to the manage option and you can simply update and update from the remote, just as shown in the screenshot below</mark></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696573343191/8e9c17be-87bb-43b7-b565-77f1f1d71e61.png" alt class="image--center mx-auto" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1696573438388/44603974-4a2a-460f-b3fe-265c950e33cf.png" alt class="image--center mx-auto" /></p>
]]></content:encoded></item><item><title><![CDATA[What is Django and it's Installation!]]></title><description><![CDATA[Django is a high-level Python web framework that simplifies the development of web applications by providing a set of tools, libraries, and conventions for…]]></description><link>https://amrit69.com.np/what-is-django-and-its-installation</link><guid isPermaLink="true">https://amrit69.com.np/what-is-django-and-its-installation</guid><category><![CDATA[Django]]></category><category><![CDATA[django rest framework]]></category><category><![CDATA[Python]]></category><category><![CDATA[coding]]></category><category><![CDATA[backend]]></category><dc:creator><![CDATA[Amrit Adhikari]]></dc:creator><pubDate>Wed, 04 Oct 2023 11:22:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1696485431615/8807ac2f-859d-4830-808c-5c2a80f8488e.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Django is a high-level Python web framework that simplifies the development of web applications by providing a set of tools, libraries, and conventions for building robust, secure, and maintainable websites and web applications. It follows the Model-View-Controller (MVC) architectural pattern, which is commonly referred to as the Model-View-Template (MVT) in Django terminology.</p>
<p>To install Django, you'll need to have Python installed on your computer. Django is compatible with Python 3.6 or later. Here are the steps to install Django:</p>
<ol>
<li><p><strong>Install Python:</strong> If you don't have Python installed, download and install it from the official Python website (<a target="_blank" href="https://www.python.org/downloads/">https://www.python.org/downloads/</a>). Make sure to check the option to add Python to your system's PATH during installation.</p>
</li>
<li><p><strong>Create a Virtual Environment (Optional but Recommended):</strong> It's a good practice to create a virtual environment for your Django projects to isolate them from your system's Python environment. You can create a virtual environment using the following command:</p>
<pre><code class="lang-python"> python -m venv myenv
</code></pre>
<p> Replace <code>myenv</code> with the name you want to give to your virtual environment.</p>
</li>
<li><p><strong>Activate the Virtual Environment (Optional but Recommended):</strong> Depending on your operating system, you can activate the virtual environment using the following commands:</p>
<ul>
<li><p><strong>Windows:</strong></p>
<pre><code class="lang-python">  myenv\Scripts\activate
</code></pre>
</li>
<li><p><strong>macOS and Linux:</strong></p>
<pre><code class="lang-python">  source myenv/bin/activate
</code></pre>
</li>
</ul>
</li>
<li><p><strong>Install Django:</strong> With your virtual environment activated, use pip (Python's package manager) to install Django:</p>
<pre><code class="lang-python"> pip install django
</code></pre>
<p> This command will download and install the latest version of Django.</p>
</li>
<li><p><strong>Verify Installation:</strong> To ensure that Django has been installed successfully, you can check the installed version by running:</p>
<pre><code class="lang-python"> python -m django --version
</code></pre>
<p> This should display the version number of Django.</p>
</li>
</ol>
<p>Now that you have Django installed, you can start creating your web applications by following the Django documentation and tutorials. To create a new Django project, you can use the <code>django-admin</code> command or the <code>django-admin startproject</code> command followed by the project name. For example:</p>
<pre><code class="lang-python">django-admin startproject myproject
</code></pre>
<p>This will create a new Django project named "myproject" with the necessary directory structure and configuration files.</p>
<p>Once your project is created, you can use the <code>python</code> <a target="_blank" href="http://manage.py"><code>manage.py</code></a> <code>runserver</code> command to start the development server and begin building your Django web application.</p>
]]></content:encoded></item></channel></rss>