<?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[Anubhav's Blog]]></title><description><![CDATA[Anubhav's Blog]]></description><link>https://blog.anubhavsingh.dev</link><generator>RSS for Node</generator><lastBuildDate>Sat, 14 Nov 2026 00:00:57 GMT</lastBuildDate><atom:link href="https://blog.anubhavsingh.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How my automation agent went from 100 round-trips to zero]]></title><description><![CDATA[I built an AI agent that automates my Windows PC and saves repeat jobs as tested skills. Renaming trip photos went from 100 round-trips to zero.]]></description><link>https://blog.anubhavsingh.dev/ai-automation-agent-for-windows</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/ai-automation-agent-for-windows</guid><category><![CDATA[ai agents]]></category><category><![CDATA[automation]]></category><category><![CDATA[Deepseek]]></category><category><![CDATA[TypeScript]]></category><category><![CDATA[Windows]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Sun, 13 Sep 2026 09:50:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/9c25316f-1478-4cb2-922e-5deab575dd6a.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>After every trip I rename my photos to the date and time they were taken, using the date stored inside each photo rather than the file's date. The first time I asked my agent to do it, it wrote a program, renamed the photos and checked its work. The check said every photo was dated correctly. Two of them were 12 hours off: a photo taken at 16:05 had been named 0405. The agent had read each time the way Windows displays it, as text formatted for my locale, instead of from the photo's own data, and the check it ran was built from those same wrong names, so of course it agreed with them.</p>
<p>It did work out the bug on its own. Then, halfway through fixing it, it hit my limit of 100 steps and stopped, with those two photos still wrong.</p>
<img src="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/69a57c05-af50-4886-989b-99d5b5f26c06.png" alt="First try at renaming a folder of photos by the date they were taken: stopped at the 100-step limit after 9 minutes, while fixing its own bugs." style="display:block;margin:0 auto" />

<p>The next run, on a folder from a different camera, finished the skill, then ran out of steps too while it was still checking its work. After that, the same job on the first folder took under 2 seconds and zero round-trips to the model. The renaming itself took 9 milliseconds.</p>
<img src="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/80cd1051-6446-4b8d-8abe-d68c368154f7.png" alt="The same job on the same folder, done by the saved skill: 0 round-trips to the model, 1.8 seconds." style="display:block;margin:0 auto" />

<p>(The console calls each call to the model a round-trip. A run with zero round-trips still makes one short call, 751 tokens here, to write up the answer.)</p>
<p>The folder from the other camera, which names its files in capitals and has two shots taken in the same minute, now takes 4 round-trips and 6.7 seconds.</p>
<img src="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/bf1cefaf-eaf6-4bce-b9d9-800c8d994214.png" alt="A folder from a different camera, done by the same skill: 4 round-trips, 6.7 seconds." style="display:block;margin:0 auto" />

<p>Getting from that first run to these is what the whole project is about. Below is how it works, in the same order as my LinkedIn post, then the bug that taught me the most, then how it compares with Claude Code.</p>
<h2>What it is</h2>
<p>It's a personal automation agent that runs on my Windows machine. I give it a task in plain English, either from the command line or from a small web console, and it does the whole job: files, photos, web APIs, websites and desktop apps. It doesn't stop to ask me before each step. That was a deliberate choice, and it's why a lot of this post is about safety.</p>
<p>The core is small. There are six basic things it can do: run a command, write and run a program, call an HTTP API, drive a browser, drive a desktop app, and read or write files. None of that core code knows anything about specific tasks. Everything task-specific lives in skills the agent writes for itself.</p>
<h2>Programs instead of clicks</h2>
<p>Most of the time an agent spends is waiting on the model, not running tools. Before I settled on TypeScript, I measured how much a faster language would save end to end, and it was about 1%.</p>
<p>So the agent is pushed to write a program instead of doing things one step at a time. Moving 22 files into month folders should be one script, not 22 separate commands with a model call between each. Long tool output gets cut down before it goes back to the model (the full copy is kept in the audit log), and the start of every prompt stays the same between calls so the provider can cache it.</p>
<p>When it picks how to do something, it goes for the most predictable option available: an existing skill first, then a program, command or API call, then the browser, and only then a desktop app. In the browser it reads pages through the accessibility tree rather than screenshots, using a browser profile I sign in to myself. On the desktop it uses the keyboard and the accessibility tree first, then a real mouse pointer, and screenshots only as a last resort.</p>
<p>I also measured whether to turn on the model's reasoning mode. I ran 7 tasks in both modes, 3 times each, and checked every result by looking at the files afterwards rather than asking a model how it went. Both modes succeeded 95% of the time. With reasoning on, runs were 19% slower and used 62% more output tokens, so it stays off.</p>
<h2>Skills</h2>
<p>When a task is going to come back, like renaming photos after a trip, a monthly expense export or a morning log check, the agent saves its solution as a skill. I can ask for one, as I did with the photos, but it's also told to do this by itself for work that will recur, and to leave one-off questions alone. A skill is a versioned program with its own tests, and it's kept in the repository, so every new one shows up as a diff I can read.</p>
<p>That's why the photos were so quick the second time: the agent ran the skill instead of working the job out again. When a request matches a skill closely enough, the skill answers with zero round-trips, as it did for the first folder. For the other camera's folder, the model still spent 4 round-trips picking the skill and checking the result on disk.</p>
<h2>Tests before a skill is kept</h2>
<p>This is the risky part. A skill runs with no model around to question it, so if it's slightly wrong, it doesn't fail once. It gets the same data wrong every month and nobody notices. I think that's the biggest risk in the whole system, so a skill has to pass checks like these before it's saved:</p>
<ul>
<li><p>A committed input file with a known-correct output.</p>
</li>
<li><p>Expected values worked out by a different method than the skill uses. Otherwise a test written by the same model that wrote the code can just agree with it.</p>
</li>
<li><p>Broken inputs: an empty file, a missing column, a malformed row, the wrong locale, negative numbers, unicode.</p>
</li>
<li><p>A second file of the same kind laid out differently, with a test named after what's different. This is the only real evidence that a skill handles that kind of task, not just the one file it was written for.</p>
</li>
<li><p>Running it twice gives the same result, and a failed run leaves the input untouched.</p>
</li>
<li><p>A verified run on real data, and the whole suite passing twice in a row.</p>
</li>
</ul>
<p>The second check is exactly what the first photo run was missing: its check agreed with its mistake because both came from the same wrong reading. For the photo skill, the second example is the folder from the other camera.</p>
<p>The console can start a run that tries to create a skill, but there's no button that adds one directly. I didn't want a way around the tests.</p>
<p>One of the first skills totalled a bank export by category. The tests turned it down seven times before it passed, and each time the problem was real: quoted thousands separators, a negative refund row, and an ampersand in a category name.</p>
<img src="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/759ccd6b-dcbd-4d58-9166-e9e74fdb0ce6.png" alt="The four skills the agent has saved so far." style="display:block;margin:0 auto" />

<h2>It doesn't ask before each step</h2>
<p>Since nothing waits for my approval, the checks sit in front of every action, and when in doubt they refuse:</p>
<ul>
<li><p>There's a list of commands it won't run, like deleting a drive, force-pushing a protected branch or formatting a disk. When something is refused, it reports that instead of trying a different way to write the same command.</p>
</li>
<li><p>If a command's name is only known at runtime, it's refused, because it can't be checked beforehand.</p>
</li>
<li><p>Files are backed up before its file tools change them.</p>
</li>
<li><p>It can't delete its own audit log, memory or backups.</p>
</li>
</ul>
<p>This isn't a sandbox and I don't treat it like one. For example, Python code the agent writes isn't checked against that command list. That's a known trade-off, not something I missed.</p>
<img src="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/845b2652-1bd2-4edb-a4f5-9de7e50e87de.png" alt="Commands the guard refused during one run, with the rule behind each refusal." style="display:block;margin:0 auto" />

<p>Those refusals came from the run that finished the photo skill. Four were ordinary scripts with an expression where the guard expects a command name, so it couldn't check them in advance. The fifth was a recursive delete of the skill's draft folder, with the folder's path in a variable the guard couldn't be sure wasn't empty.</p>
<p>The command list also had a hole. <code>Remove-Item C:\* -Recurse -Force</code> was refused, but <code>Remove-Item -Path C:\ -Recurse -Force</code> was allowed, and that's probably the most natural way to write the most destructive command on the machine. A Windows drive root ends in a backslash, the next character was a space, and the parser treated that backslash as escaping the space. The path became <code>C: -Recurse</code>, which didn't match any rule. The parser already read each command more than one way and refused it if any reading was dangerous, so the fix was to add one more reading with escapes turned off. I found this by poking at the rules before running my own "delete everything in C:" test, not by running it.</p>
<p>I also mutation-tested the guard. I wrote 19 small changes by hand, each removing one protection, to see whether the tests would notice. They missed four. One was a rule no test had ever reached, because a broader rule always caught those cases first. I tried an off-the-shelf mutation testing tool before that, but it reported working code as untested, so I couldn't use it.</p>
<p>Another lesson went the other way. At one point the desktop tools had no way to press a key, and a task needed one. So the agent wrote a script that loaded Windows UI Automation and sent the key from there, completely around the rule that it may only type into windows it opened. Taking the ability away didn't stop it. It just moved the action somewhere the guard couldn't see. Adding a proper key press (focus the field, check the focus actually landed, then press the key) brought it back under the guard and cut that run from 23 round-trips to 6.</p>
<p>That rule about windows came from a near miss. On Windows 11, opening a file with Notepad doesn't start a new Notepad. It adds a tab to the one that's already running, and mine had eight unsaved documents in it. Every check passed, and the agent would still have typed into my work. Now it can read any window, but it can only write to windows this run started.</p>
<h2>The console</h2>
<p>The console is a small React app that runs locally. It shows what's running now, anything that needs attention, what has run recently, and exactly what each run did, step by step. From it I can start, cancel, re-run and schedule work. It can't skip the tests or unlock guard rules, and the secrets vault stays on the command line. It only listens on localhost, and every action needs a header that a page from another site can't send.</p>
<p>Each run's page puts the agent's final answer above the status. I changed that after a run where I asked the agent to fix a file that didn't exist. It told me so clearly, but the page showed a green "ok" over eleven collapsed steps. The status only tells you the run finished without crashing, not whether it did what you asked.</p>
<p>It runs one task at a time, because there's only one desktop and one browser profile to share.</p>
<img src="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/2313957c-5807-4219-9d1b-ddf98228aa50.png" alt="The console's overview page." style="display:block;margin:0 auto" />

<h2>The bug that taught me the most</h2>
<p>A log digest skill had passed every test. Then it got a log where each line put the level first, in brackets, with a logger name before the message. It didn't match any of the 353 error lines, returned a total of zero, and marked its own result as verified.</p>
<p>Nothing crashed and the output looked normal. That's what makes a wrong zero so dangerous: "no errors today" is exactly what you'd hope to hear, so nobody questions it.</p>
<p>So I added a requirement. A skill now has to show that it fails loudly when it gets input of the right kind that it can't read, either by throwing an error or by setting a flag the caller has to check. A test that just expects zero doesn't count. As soon as I added that check, it found the same bug in a reference skill in my own test suite, which was reporting totals for files it had never parsed.</p>
<p>After that change I had the agent rebuild the skill, and on that log the new version refused instead of answering: "log is unreadable: most lines are not records." Refusing is much safer than a wrong zero, but it still wasn't reading the file. The remaining bug was a timestamp pattern that only matched at the start of a line, so a date in second position was never found.</p>
<img src="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/995cc4ce-bf19-48b9-8fe9-df8dd051f3a7.png" alt="The agent's notes on the fix: the timestamp pattern only matched at the start of each line." style="display:block;margin:0 auto" />

<p>After the fix it was saved as version 2, and it now reads that log in 3 round-trips: 353 errors, split 160, 156 and 37 across the three days, which matches a separate parser I checked it against.</p>
<img src="https://cdn.hashnode.com/uploads/covers/61f6b3f366fcfc728be1a807/a0c3bc78-8f6d-4b81-9fbb-1559fd114145.png" alt="The fixed log skill counting 353 errors over three days. An earlier version reported zero." style="display:block;margin:0 auto" />

<p>Bugs like this one are why the testing is split up by how predictable each part is:</p>
<ul>
<li><p>The predictable parts, like the guard, path handling and the skill registry, have strict unit tests. The guard and the checks a skill must pass are written as plain decision logic, so they can be tested without touching the disk.</p>
</li>
<li><p>The model loop is tested by replaying recorded runs, so CI never calls the API.</p>
</li>
<li><p>Every saved skill brings its own tests, and those stay in the test suite for good.</p>
</li>
<li><p>The model's judgement is measured with evals, with skills turned off, so I'm measuring the model and not a lucky skill match.</p>
</li>
<li><p>A benchmark counts model calls and cost, not how fast things feel.</p>
</li>
</ul>
<p>On top of that there's a manual test plan of ten real tasks, and every answer is checked against the files, not the agent's own report. The last time I ran it, it found three of the bugs in this post, including the wrong zero and the step limit that left two photos misnamed.</p>
<h2>How it compares with Claude Code</h2>
<p>Is it better than Claude Code? Hell no. Claude Code is much better at writing and changing code, it's better at one-off problems, and for most people it's the more useful tool.</p>
<p>Does it have some features Claude Code doesn't? Sure, a few.</p>
<p>First, it writes its own skills. When it solves a task that will come back, it saves the solution as a skill, and the skill has to pass the tests above before it's kept. After that, the task needs few or no round-trips: the first photo folder takes none, and the other camera's folder takes 4. Claude Code has skills too, but the model is the one that picks a skill up and carries it out, so every repeat still goes through the model. A saved skill is also fixed code, so the tenth run takes the same route as the first.</p>
<p>Second, it can control my Windows PC. Desktop apps are part of the core, next to commands, files and the browser, and the agent reads a window through Windows UI Automation before it reaches for the mouse. On Windows, Claude Code can only do this in its desktop app, where computer use is a research preview that's off by default. Its command-line version has computer use on macOS only.</p>
<p>Third, it runs on my own DeepSeek key, and that keeps it cheap. My DeepSeek bill for two days of testing, over 2,000 calls to the model, was $0.90. DeepSeek's Flash model costs $0.15 per million input tokens and \(0.60 per million output tokens off-peak, and double that at peak, against \)2 and $10 for Claude Sonnet 5. Input DeepSeek has already cached costs 50 times less again, which is why the agent keeps the start of every prompt the same. You can point Claude Code at DeepSeek too, through DeepSeek's Anthropic-compatible API, but Anthropic doesn't support non-Claude models, and Claude Code's browser and computer-use features need a Claude login.</p>
<p>I'd have put browsing in my own signed-in browser on this list too, but Claude Code already does that with its Chrome extension.</p>
<p>So I don't really see them as competing. Claude Code is a general agent. Mine is built for a handful of jobs that keep coming back on one machine.</p>
<h2>Stack</h2>
<p>TypeScript on Node, Playwright for the browser, Windows UI Automation through PowerShell for desktop apps, SQLite for memory and the audit log, React and Tailwind for the console, Vitest for tests, and DeepSeek as the model.</p>
<h2>What's next</h2>
<ul>
<li><p>Noticing when a signed-in browser session has expired and telling me, instead of retrying. That's what would break first if it ran unattended for a week.</p>
</li>
<li><p>A proper command to retire a skill. Fixing and re-saving a skill already works, but taking a bad one out is still done by hand.</p>
</li>
</ul>
<p>If you've built something like this, I'd like to hear how you decide what an agent is allowed to do on its own.</p>
]]></content:encoded></item><item><title><![CDATA[Authentication vs. Authorization: What’s the Difference and Why It Matters]]></title><description><![CDATA[Discover the difference between authentication and authorization, how they work, and why they’re critical for online security. Learn about cookies, tokens,]]></description><link>https://blog.anubhavsingh.dev/authentication-vs-authorization</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/authentication-vs-authorization</guid><category><![CDATA[authentication]]></category><category><![CDATA[authorization]]></category><category><![CDATA[JWT]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Mon, 16 Dec 2024 18:48:53 GMT</pubDate><content:encoded><![CDATA[<p>When it comes to online security, two terms you’ve probably heard a lot are <strong>authentication</strong> and <strong>authorization</strong>. These concepts often go hand in hand, but they’re not the same thing. Understanding the difference between them is important—not just for tech professionals but for anyone who interacts with online systems (which is pretty much all of us!).</p>
<p>In this blog, we’ll break down what authentication and authorization are, how they work, and why they matter. Along the way, we’ll also touch on key technologies like <strong>cookies</strong>, <strong>tokens</strong>, and <strong>CSRF protection</strong>, which are essential in modern web security.</p>
<hr />
<h2 id="heading-what-is-authentication"><strong>What Is Authentication?</strong></h2>
<p>Authentication is all about answering one question: <em>Who are you?</em> It’s the process of proving your identity to a system so it knows you’re the person you claim to be.</p>
<h3 id="heading-how-it-works"><strong>How It Works</strong></h3>
<p>Authentication typically involves providing some kind of credentials that the system can verify. These can include:</p>
<ul>
<li><p><strong>Passwords</strong>: The most common (and often weakest) form of authentication.</p>
</li>
<li><p><strong>Biometrics</strong>: Using your fingerprint, facial recognition, or retina scans.</p>
</li>
<li><p><strong>Tokens</strong>: These are unique pieces of information—like a session token or a JSON Web Token (JWT)—that prove your identity after logging in.</p>
</li>
<li><p><strong>Cookies</strong>: Small pieces of data stored on your browser that help websites remember your login status.</p>
</li>
<li><p><strong>Multi-Factor Authentication (MFA)</strong>: A combination of two or more methods, like entering a password and verifying a code sent to your phone.</p>
</li>
</ul>
<h3 id="heading-real-world-example"><strong>Real-World Example</strong></h3>
<p>When you log into your favorite social media platform, you enter your username and password. Once the system verifies these credentials, it creates a session for you. This session may be tracked using a <strong>session cookie</strong> that’s stored in your browser, so you don’t need to re-enter your credentials every time you navigate to a new page.</p>
<hr />
<h2 id="heading-what-is-authorization"><strong>What Is Authorization?</strong></h2>
<p>Authorization comes after authentication and answers a different question: <em>What are you allowed to do?</em> Even if a system knows who you are, it still needs to determine what permissions or access rights you have.</p>
<h3 id="heading-how-it-works-1"><strong>How It Works</strong></h3>
<p>Authorization involves setting and enforcing rules about what resources or actions a user is allowed to access. Some common methods include:</p>
<ul>
<li><p><strong>Access Control Lists (ACLs)</strong>: Lists that specify exactly who can access specific resources.</p>
</li>
<li><p><strong>Role-Based Access Control (RBAC)</strong>: Permissions are assigned based on a user’s role (e.g., admin, manager, or regular user).</p>
</li>
<li><p><strong>Tokens for Permissions</strong>: Sometimes, systems use tokens (like a JWT) to not only authenticate a user but also encode authorization details.</p>
</li>
<li><p><strong>Custom Policies</strong>: Rules that define what users can do under certain conditions, such as limiting access based on location or time.</p>
</li>
</ul>
<h3 id="heading-real-world-example-1"><strong>Real-World Example</strong></h3>
<p>Let’s say you’re logged into a cloud storage service. Authentication lets you access your account, but authorization ensures that you can only view your own files—not someone else’s.</p>
<hr />
<h2 id="heading-cookies-tokens-and-csrf-protection-in-authentication-and-authorization"><strong>Cookies, Tokens, and CSRF Protection in Authentication and Authorization</strong></h2>
<p>When working with authentication and authorization on the web, technologies like <strong>cookies</strong>, <strong>tokens</strong>, and <strong>CSRF (Cross-Site Request Forgery) protection</strong> play a crucial role.</p>
<h3 id="heading-cookies"><strong>Cookies</strong></h3>
<ul>
<li><p><strong>What They Are</strong>: Small files stored in your browser by a website.</p>
</li>
<li><p><strong>Role in Authentication</strong>: Cookies are often used to maintain sessions. After you authenticate, the server generates a session ID and stores it in a cookie. Every time you interact with the server, the cookie is sent along to verify that you’re still logged in.</p>
</li>
<li><p><strong>Risks</strong>: If cookies are stolen (e.g., via XSS attacks), they can be used by attackers to impersonate you.</p>
</li>
</ul>
<h3 id="heading-tokens"><strong>Tokens</strong></h3>
<ul>
<li><p><strong>What They Are</strong>: Pieces of data used to represent a user's identity.</p>
</li>
<li><p><strong>Role in Modern Systems</strong>:</p>
<ul>
<li><p><strong>Session Tokens</strong>: Used in traditional web apps to track a user’s session.</p>
</li>
<li><p><strong>JSON Web Tokens (JWTs)</strong>: Popular in modern APIs. A JWT contains user information and can include both authentication and authorization details.</p>
</li>
</ul>
</li>
<li><p><strong>Benefits</strong>: Tokens, especially JWTs, are stateless, meaning the server doesn’t need to store session information. This makes them ideal for distributed systems.</p>
</li>
<li><p><strong>Risks</strong>: If a token isn’t stored securely (e.g., in localStorage or sessionStorage), it can be accessed and misused by attackers.</p>
</li>
</ul>
<h3 id="heading-csrf-cross-site-request-forgery"><strong>CSRF (Cross-Site Request Forgery)</strong></h3>
<ul>
<li><p><strong>What It Is</strong>: A type of attack where a malicious website tricks your browser into performing actions on another site where you’re logged in.</p>
</li>
<li><p><strong>Example</strong>: If you’re logged into your bank and visit a malicious site, the attacker could trigger a money transfer using your session cookie.</p>
</li>
<li><p><strong>How It’s Prevented</strong>:</p>
<ul>
<li><p><strong>CSRF Tokens</strong>: Unique, unpredictable values sent with sensitive requests. The server checks this token to ensure the request is legitimate.</p>
</li>
<li><p><strong>SameSite Cookies</strong>: Restrict cookies so they aren’t sent with cross-site requests.</p>
</li>
</ul>
</li>
</ul>
<p>By combining cookies, tokens, and CSRF protection, modern web apps ensure that authentication and authorization processes are secure.</p>
<hr />
<h2 id="heading-authentication-vs-authorization-key-differences"><strong>Authentication vs. Authorization: Key Differences</strong></h2>
<p>Here’s a quick comparison to clarify the distinction:</p>
<div class="hn-table">
<table>
<thead>
<tr>
<td><strong>Aspect</strong></td><td><strong>Authentication</strong></td><td><strong>Authorization</strong></td></tr>
</thead>
<tbody>
<tr>
<td><strong>Definition</strong></td><td>Verifies your identity.</td><td>Determines what you’re allowed to do.</td></tr>
<tr>
<td><strong>Question Asked</strong></td><td>Who are you?</td><td>What are you allowed to do?</td></tr>
<tr>
<td><strong>When It Happens</strong></td><td>Before authorization.</td><td>After authentication.</td></tr>
<tr>
<td><strong>Examples</strong></td><td>Entering a password or scanning your fingerprint.</td><td>Accessing specific files, features, or tools.</td></tr>
</tbody>
</table>
</div><hr />
<h2 id="heading-why-both-are-important"><strong>Why Both Are Important</strong></h2>
<p>Authentication and authorization are two layers of security that work together:</p>
<ol>
<li><p><strong>Authentication</strong> ensures that only legitimate users can access a system.</p>
</li>
<li><p><strong>Authorization</strong> ensures that those users only access what they’re permitted to.</p>
</li>
</ol>
<p>Without authentication, anyone could enter your system. Without authorization, even legitimate users could access sensitive areas they’re not supposed to. Both are essential for security.</p>
<hr />
<h2 id="heading-where-you-see-this-in-action"><strong>Where You See This in Action</strong></h2>
<p>Here are some everyday examples of authentication and authorization working together:</p>
<ol>
<li><p><strong>Online Banking</strong>:</p>
<ul>
<li><p>Logging in with your username, password, and possibly a one-time code (authentication).</p>
</li>
<li><p>Viewing your account but not accessing someone else’s accounts (authorization).</p>
</li>
</ul>
</li>
<li><p><strong>Streaming Services</strong>:</p>
<ul>
<li><p>Logging into your account (authentication).</p>
</li>
<li><p>Accessing your profile but not managing the admin’s payment settings (authorization).</p>
</li>
</ul>
</li>
<li><p><strong>APIs and Tokens</strong>:</p>
<ul>
<li><p>A user logs into an app, and the app generates a JWT (authentication).</p>
</li>
<li><p>The JWT includes a scope defining what actions the user is allowed to perform (authorization).</p>
</li>
</ul>
</li>
</ol>
<hr />
<h2 id="heading-challenges-and-future-trends"><strong>Challenges and Future Trends</strong></h2>
<p>As systems become more complex, so do the challenges in authentication and authorization. Some ongoing issues include:</p>
<ol>
<li><p><strong>Weak Passwords</strong>: Many users still rely on easy-to-guess passwords.</p>
</li>
<li><p><strong>Phishing Attacks</strong>: Hackers use social engineering to steal login credentials.</p>
</li>
<li><p><strong>Session Hijacking</strong>: Attackers steal cookies or tokens to impersonate users.</p>
</li>
<li><p><strong>Zero Trust Security</strong>: A modern approach where no one is trusted by default, and every access attempt is rigorously verified.</p>
</li>
<li><p><strong>Decentralized Identity</strong>: Emerging blockchain-based systems aim to give users control over their own credentials.</p>
</li>
</ol>
<hr />
<h2 id="heading-conclusion"><strong>Conclusion</strong></h2>
<p>Authentication and authorization are like two sides of a coin. While authentication proves <em>who you are</em>, authorization defines <em>what you can do</em>. Technologies like cookies, tokens, and CSRF protection enhance these processes, making modern systems more secure.</p>
<p>Understanding these concepts is essential not only for developers and IT professionals but for anyone navigating the digital world. The next time you log in to an account or perform a sensitive action online, remember the layers of security working behind the scenes to keep your data safe.</p>
<hr />
]]></content:encoded></item><item><title><![CDATA[How to access the dark web in 2024?]]></title><description><![CDATA[how to access the dark web in 2022 without any knowledge of dark web, just with the help of vpn and tor browser]]></description><link>https://blog.anubhavsingh.dev/how-to-access-the-dark-web-in-2024</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/how-to-access-the-dark-web-in-2024</guid><category><![CDATA[web]]></category><category><![CDATA[vps]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Tue, 28 May 2024 17:31:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413311676/DMya88fuj.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You don't have to be a professional computer expert to access the dark web.</p>
<p>The dark web covers around 6% of the total internet.</p>
<p>While the deep web covers around 90% and only 4-5% is the surface web that we are using till now.</p>
<p>You just need to have the internet and a special browser to run websites on the dark web, mainly tor is enough to access the websites.</p>
<p>But it is recommended that you use a VPN with it.</p>
<p>In April some hackers got into the database of giant pizza company dominos and now they have made that data public. So anyone who knows how to access the dark web can go and check the data leaked by hackers.</p>
<p>I'll tell you the best way to access the dark web safely.</p>
<p>I'll walk you through everything about the dark web and the deep web.</p>
<h3 id="heading-dark-web-vs-deep-web-vs-surface-web"><strong>Dark Web vs Deep Web vs Surface Web</strong></h3>
<h4 id="heading-dark-web"><strong>Dark Web</strong></h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413172611/DHBlp8oEh.jpg" alt="dark-web1.jpg" /></p>
<p>The dark web is a part of the internet that is not crawled by a normal search engine such as google or yahoo. That means you cannot search for these kind of websites on google, bing or any search engine.</p>
<p>There are nearly 5000 live dark websites that are available of which more than 50% is illegal.</p>
<p>These websites do illegal stuff such as selling illegal items, medicines etc.</p>
<h4 id="heading-deep-web"><strong>Deep Web</strong></h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413199183/21w82JZyQ.jpg" alt="deep-web-1103706_1280.jpg" /></p>
<p>Now, What is the deep web? The deep web is not something illegal.</p>
<p>The deep web is all the data of the organizations or the content that are not directly available on the search engine.</p>
<p>The data that all the organizations use privately falls directly under the deep web, they need to use some kind of authentication to use or see that data.</p>
<p>Your google drive data also counts into the deep web because it is also not crawled by any search engine.</p>
<p>The website data that is also blocked from indexing using the robots.txt file is also under the deep web.</p>
<h4 id="heading-surface-web"><strong>Surface Web</strong></h4>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413214257/05DE39ejF.png" alt="surface web facebook.png" /></p>
<p>So now all remaining 5% remaining data is the surface web, the percentage can be deceiving.</p>
<p>Since this 5% data is somehow also connected to the deep web.</p>
<p>So it is much likely that the surface data is more than 5%.</p>
<p>Because there is no such study to check how much data is the dark web, deep web or surface web.</p>
<p>Surface data is the data that we use and see in daily life and are directly available from search engines.</p>
<h3 id="heading-why-use-the-dark-web"><strong>Why use the dark web?</strong></h3>
<p>Now the question is why would someone go somewhere where people are selling drugs and guns.</p>
<p>Well, the basic concept of the dark web is that no one can track you.</p>
<p>That means if you search for something on google then you will probably see the ads for the thing you searched for.</p>
<p>But on the dark web, neither your location nor your IP is being traced because the data is being sent to you from some relay locations. </p>
<p>Your data has already bounced thousands of miles before reaching you.</p>
<p>So it is nearly impossible to track you, that's the way all the illegal stuff is happening here. And no one is being caught.</p>
<p>But if you love privacy then the dark web is the best place for you.</p>
<h3 id="heading-dark-web-and-the-crypto-connection"><strong>Dark web and the crypto connection</strong></h3>
<p>Crypto has become famous in the last 2 years when bitcoin prices started shooting up the sky.</p>
<p>Crypto has become famous for the last 2 years but before that, the dark web was the only place where crypto was being used.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413225279/umjNwZUOC.jpg" alt="bitcoin.jpg" /></p>
<p>Because unlike other currencies crypto is untraceable.</p>
<p>If you buy something from cryptocurrency no one is going to know what you have bought and from where you have bought.</p>
<p>That's why all the illegal transaction of drugs, ammo, ammunition, illegal accounts that are hacked or illegal porn is done through cryptocurrency only.</p>
<h3 id="heading-what-is-onion"><strong>What is .onion?</strong></h3>
<p>Onion is a special-use top-level domain that is only used on the dark web because it can only be used with a tor or tor like browsers.</p>
<h3 id="heading-browsers-required-for-dark-web"><strong>Browsers required for Dark Web</strong></h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413234052/ok0zmfIZ4.png" alt="tor-logo.png" /></p>
<p>As you know it is not possible to open an onion website with a regular web browser such as chrome or firefox.</p>
<p>There are special types of browsers that we can take help of.</p>
<p>The most used and recommended browser is <a target="_blank" href="https://www.torproject.org/">TOR</a> because it reroutes all the traffic through many publicly listed nodes so that the entry node always remains anonymous.</p>
<p>That's what we want right privacy.</p>
<h3 id="heading-how-to-open-a-website-on-the-dark-web"><strong>How to open a website on the dark web?</strong></h3>
<p><strong>Step1:</strong></p>
<p>You will need two software, the first one is a VPN and the second one is a TOR browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413247479/8DnsbpyWx.png" alt="download-tor.png" /></p>
<p>So Go to <a target="_blank" href="https://www.torproject.org/">https://www.torproject.org/</a> website to download the tor browser.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413256065/yjYvLL8sn.png" alt="psiphon.png" /></p>
<p>Now go to the website to download <a target="_blank" href="https://www.psiphon3.com/en/index.html">Psiphon</a> VPN, which is the best free VPN, you can also use other VPNs if you want.</p>
<p>Now You can install tor browser and go to step 2.</p>
<p><strong>Step 2:</strong></p>
<p>Now you can open and connect to Psiphon VPN by selecting optimum location.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413265181/n1VYD6yiE.png" alt="connect-psiphon.png" /></p>
<p>Now you can open the tor browser, now every website should be working from the surface web as well as the dark web.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413272634/xG2ZNkijP.png" alt="connect-tor.png" /></p>
<p>Now click on connect to connect the tor in you pc.</p>
<p>Now you just need to search for a website that has a list of onion sites and try checking for these.</p>
<p>I recommend you to use the duckduckgo search engine which is a privacy-focused search engine.</p>
<h3 id="heading-some-websites-to-check-out-on-the-dark-web"><strong>Some Websites to check out on the dark web</strong></h3>
<ul>
<li><strong>The Dark Wiki</strong></li>
</ul>
<p>This is an awesome website just like Wikipedia with more content that is unavailable on original Wikipedia.</p>
<p>.onion link <strong>http://zqktlwi4fecvo6ri.onion/</strong></p>
<ul>
<li><strong>Mail2Tor</strong></li>
</ul>
<p>This is the best website for a secure means of communication since it's not the best idea to use your Gmail account anywhere on the onion websites.</p>
<p>.onion link <strong>http://mail2tor2zyjdctd.onion/</strong></p>
<ul>
<li><strong>Facebook</strong></li>
</ul>
<p>Since the dark web is all together with a different world it has its own Facebook.</p>
<p>.onion link <strong>https://www.facebookcorewwwi.onion/</strong></p>
<ul>
<li><strong>DuckDuckGo</strong></li>
</ul>
<p>You should not be using google in the dark web, so this is the best search engine to use on the dark web, it provides 100% anonymous </p>
<p>.onion link <strong>http://3g2upl4pq6kufc4m.onion/</strong></p>
<h3 id="heading-is-it-illegal-to-use-the-dark-web"><strong>Is it illegal to use the dark web?</strong></h3>
<p>In general, it is not illegal to use the dark web.</p>
<p>It is indeed a better choice for browsing the internet if you care about your privacy since you can't have privacy browsing anything if you are googling things with logged in account and even if you are logged out the browser gonna trace you.</p>
<p>So if browsing the internet is legal then what is illegal, buying kinds of stuff such as guns, ammo, drugs or hiring someone to hack an Instagram account for you is illegal.</p>
<p>Leaking someone's data and accessing that data is also illegal.</p>
<p><em>This article is only for educational purpose.</em></p>
]]></content:encoded></item><item><title><![CDATA[Functions in Solidity]]></title><description><![CDATA[You just started learning solidity and the functions look a bit overwhelming in solidity? Don't worry I'll explain everything about the functions, how to…]]></description><link>https://blog.anubhavsingh.dev/functions-in-solidity</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/functions-in-solidity</guid><category><![CDATA[Web3]]></category><category><![CDATA[Solidity]]></category><category><![CDATA[Blockchain]]></category><category><![CDATA[Beginner Developers]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Fri, 16 Sep 2022 20:31:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1663358916955/HhuG1tNqr.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>You just started learning solidity and the functions look a bit overwhelming in solidity? Don't worry I'll explain everything about the functions, how to use them, visibility, and mutability in this post.</p>
<p>If you are here then I assume you already have learned any of the high-level programming languages such as C++, Java, JavaScript or any one of the object-oriented programming languages.</p>
<p>Functions work the same way in all other languages but are a bit different in syntax. In solidity, functions have some additional keywords which we will understand more in this post.</p>
<p><strong>Syntax of function:</strong> <br />
function function_name(parameters) visibility mutability returns(return_type) { ... }</p>
<p>Functions in solidity start with the function keyword, but some functions don't start with the function keyword such as receive() and fallback() functions.</p>
<h2 id="heading-parameters-in-functions">Parameters in functions:</h2>
<p>functions in solidity accept a list of parameters, which can also be empty.</p>
<pre><code class="lang-solidity"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sum</span>(<span class="hljs-params"></span>) </span>{ <span class="hljs-comment">// no parameter</span>
  <span class="hljs-keyword">uint256</span> a <span class="hljs-operator">=</span> stateVar1 <span class="hljs-operator">+</span> stateVar2;
}

<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sum</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _a, <span class="hljs-keyword">uint256</span> _b</span>) </span>{ <span class="hljs-comment">// list of parameters</span>
  stateVariableC <span class="hljs-operator">=</span> _a <span class="hljs-operator">+</span> _b;
}
</code></pre>
<h2 id="heading-returning-values-from-function">Returning Values from function:</h2>
<p>Functions in solidity can return any value which has to be defined in the function itself, which can be uint, int, string, bool or bytes.</p>
<pre><code class="lang-solidity"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sum</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>) </span>{
  <span class="hljs-keyword">return</span> (a <span class="hljs-operator">+</span> b);
}
</code></pre>
<h3 id="heading-there-are-two-ways-that-a-function-can-return-values">There are two ways that a function can return values.</h3>
<p><strong>Named returns</strong>
In this, the return type with the name of the returning variable is defined in the function. (No need to return keyword)</p>
<pre><code class="lang-solidity"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sum</span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span> _num1, <span class="hljs-keyword">uint256</span> _num2</span>) 
<span class="hljs-title"><span class="hljs-keyword">public</span></span> 
<span class="hljs-title"><span class="hljs-keyword">pure</span></span> 
<span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span> _num3</span>) </span>{
  _num3 <span class="hljs-operator">=</span> _num1 <span class="hljs-operator">+</span> _num2;
}
</code></pre>
<p><strong>Unnamed returns</strong>
In this return type, the return keyword is used and the values can be returned using the returns keyword.</p>
<pre><code class="lang-solidity"><span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">sum</span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span> _num1, <span class="hljs-keyword">uint256</span> _num2</span>) 
<span class="hljs-title"><span class="hljs-keyword">public</span></span> 
<span class="hljs-title"><span class="hljs-keyword">pure</span></span> 
<span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>) </span>{
  <span class="hljs-keyword">return</span> (_num1 <span class="hljs-operator">+</span> _num2);
}
</code></pre>
<h2 id="heading-visibility-of-functions">Visibility of Functions:</h2>
<p>Visibility of the functions is defined as who and from where a function can be called, there are four types of visibility for functions, public, external, internal and private.
<em>State variables cannot be declared as external, but can be declared as public, internal or private.</em></p>
<p><strong>public:</strong> Public function can be called from any contract and account. <br />
<strong>external:</strong> External functions can only be called from outside the smart contract. <br />
<strong>internal:</strong> Internal functions can be called inside the contract that defines it and all other smart contracts that inherit from it. <br />
<strong>private:</strong> Private functions can only be called within the contract that defines the function. <br /></p>
<p>public functions are the <em>most permissive</em> functions whereas private functions are the <em>most restrictive</em> ones.</p>
<h2 id="heading-state-mutability">State Mutability:</h2>
<p><strong>view:</strong> Functions that are declared with the view keyword can only read the state but cannot modify any state variables.</p>
<pre><code class="lang-solidity"><span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">ViewKeyword</span> </span>{
<span class="hljs-keyword">uint256</span> <span class="hljs-keyword">public</span> num;
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">square</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">view</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>) </span>{
    <span class="hljs-keyword">return</span> (num <span class="hljs-operator">*</span> num); <span class="hljs-comment">// reading from state but not changing it</span>
    }
}
</code></pre>
<p><strong>pure:</strong> Functions that are declared with pure keyword neither can read state variables nor can read variables from the blockchain.</p>
<pre><code class="lang-solidity"><span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">PureKeyword</span> </span>{
<span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">square</span>(<span class="hljs-params"><span class="hljs-keyword">uint256</span> _num</span>) <span class="hljs-title"><span class="hljs-keyword">pure</span></span> <span class="hljs-title"><span class="hljs-keyword">returns</span></span> (<span class="hljs-params"><span class="hljs-keyword">uint256</span></span>) </span>{
    <span class="hljs-keyword">return</span> (_num <span class="hljs-operator">*</span> _num); <span class="hljs-comment">// neither reading state nor modifying</span>
    }
}
</code></pre>
<h2 id="heading-payable-functions">Payable Functions:</h2>
<p>Functions declared payable can receive ether into the contract.</p>
<pre><code class="lang-solidity"><span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Payable</span> </span>{
  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">deposit</span>(<span class="hljs-params"></span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title"><span class="hljs-keyword">payable</span></span> </span>{ }
  <span class="hljs-comment">// call the deposit() function along with some ether</span>
  <span class="hljs-comment">// it will automatically update the balance of the contract </span>
}
</code></pre>
<h2 id="heading-function-modifiers">Function Modifiers:</h2>
<p>Modifiers are code that can run before and/or after a function call.
Modifiers can be used to restrict access, validate inputs and guard against reentrancy attacks.</p>
<pre><code class="lang-solidity"><span class="hljs-class"><span class="hljs-keyword">contract</span> <span class="hljs-title">Modifiers</span> </span>{
  <span class="hljs-keyword">address</span> <span class="hljs-keyword">public</span> owner;
  <span class="hljs-function"><span class="hljs-keyword">constructor</span> </span>{
    owner <span class="hljs-operator">=</span> <span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span>;
  }

  <span class="hljs-function"><span class="hljs-keyword">modifier</span> <span class="hljs-title">onlyOwner</span> (<span class="hljs-params"></span>) </span>{
    <span class="hljs-built_in">require</span>(<span class="hljs-built_in">msg</span>.<span class="hljs-built_in">sender</span> <span class="hljs-operator">=</span><span class="hljs-operator">=</span> owner, <span class="hljs-string">"Not Owner"</span>);
    <span class="hljs-keyword">_</span>;
  }

  <span class="hljs-function"><span class="hljs-keyword">function</span> <span class="hljs-title">changeOwner</span> (<span class="hljs-params"><span class="hljs-keyword">address</span> _newOwner</span>) <span class="hljs-title"><span class="hljs-keyword">public</span></span> <span class="hljs-title">onlyOwner</span> </span>{
    <span class="hljs-comment">// onlyOwner here works as a middleware, the code inside</span>
    <span class="hljs-comment">// changeOwner function will only execute when the code inside</span>
    <span class="hljs-comment">// onlyOwner modifier is executed successfully</span>
    owner <span class="hljs-operator">=</span> _newOwner;
  }
}
</code></pre>
<p></p><hr /><p></p>
<h2 id="heading-thats-it">That's it!</h2>
<p>That was pretty much all the basics of how to use functions in solidity. 
I hope this article was a good read for you. Do share it with your friends and other peers.  <br />
Thank you!!
<br /></p>
<p><a target="_blank" href="https://twitter.com/anubhavsinghdev">Find me on Twitter</a></p>
]]></content:encoded></item><item><title><![CDATA[How To Increase The Speed Of Your WordPress Blog?]]></title><description><![CDATA[Do you want to get your business on the internet? Your website must rank on Google and other search engines, for increasing your business. Speed of the…]]></description><link>https://blog.anubhavsingh.dev/how-to-increase-the-speed-of-your-wordpress-blog</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/how-to-increase-the-speed-of-your-wordpress-blog</guid><category><![CDATA[Blogging]]></category><category><![CDATA[blog]]></category><category><![CDATA[WordPress]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Wed, 18 May 2022 18:09:13 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1653415715880/YHfk6h3SM.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Do you want to get your business on the internet? Your website must rank on Google and other search engines, for increasing your business.</p>
<p>Speed of the website is very important for SEO because the faster speed of the website increases user experience</p>
<p>"<em>A user lefts the website if the website takes more than 4 seconds.</em>"</p>
<p>So it is very important that your website loads in less than 4 seconds.</p>
<p>This blog website <a target="_blank" href="https://blog.anubhavsingh.dev/">Anubhav Singh</a> loads in less than completely 1.7s.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653415922168/tcl7mrGYX.png" alt="gt-metrix.png" /></p>
<p>You can check your website speed on <a target="_blank" href="https://gtmetrix.com/">GTMetrix.com</a></p>
<h1 id="heading-use-more-reliable-website-hosting">Use More Reliable Website Hosting</h1>
<p>You must use powerful website hosting that suits your pockets and also fulfils the requirements of your website.</p>
<p>Choose a web hosting that gives you good performance and speed that means it provides enough RAM, CPU and I/O speed to run your blog.</p>
<p>I recommend <a target="_blank" href="https://www.siteground.com/">Siteground</a> which is a very famous web hosting service for a WordPress website that has very good pricing and awesome speed, <a target="_blank" href="https://www.siteground.com/">Siteground</a> start from $6.99/month.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653415955791/o_ygfOTPV.png" alt="siteground.png" /></p>
<p>Please try to ignore free hosting services because it doesn't provide enough resources and has too many limits.</p>
<p>The most <strong>important</strong> thing in choosing web hosting is the location of servers used by the <strong>hosting provider</strong> that is if most of your traffic is from India then it is always better to choose a hosting that has its servers in India, so it loads quicker in a users browser. </p>
<p>You can still choose the data centre from the USA or other places if you find that cheap and use some CDN to consolidate the speed.</p>
<h1 id="heading-optimize-js-css-and-images">Optimize JS, CSS and Images</h1>
<p>It is important to optimize JavaScript, CSS and images of the posts so that it loads quicker, in a browser.</p>
<p>There are many WordPress plugins available to optimize these codes and images automatically such as <a target="_blank" href="https://wp-rocket.me/">WP-Rocket</a>, WP-Optimize, and many more.</p>
<p>You can also pre-optimize the images before uploading that to WordPress.</p>
<p>This is recommended because most of the image optimizing plugins are paid.</p>
<h1 id="heading-use-manification-techniques"><strong>Use Manification Techniques</strong></h1>
<p>If you use WP-Rocket or WP-Optimize plugin then these plugins automatically decrease the size of js and CSS by removing excess useless spaces from the codes which increases the loading speed.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653415965985/70iaJMJ4V.png" alt="minified.png" /></p>
<p>This is what minified CSS looks like.</p>
<h1 id="heading-use-content-delivery-network-cdn">Use Content Delivery Network (CDN)</h1>
<p>A CDN is a set of distributed servers all over the world, which work together to provide fast delivery of data.</p>
<p>A CDN helps to load the assets of a website such as JS, CSS and HTML faster.</p>
<p>A good CDN also protects through malicious attacks such as a DDOS attack.</p>
<p>Many major websites such as Netflix, Facebook, Amazon uses CDN.</p>
<p>Now the question is how can a CDN increase a website's speed?</p>
<p>To understand this, let's assume that the user is in India and your server location is in the USA so it will take some time for your hosting provider to transfer data from the USA to India due to both countries geographical location, so the best way to do is to use a CDN that has high-speed servers in USA and INDIA so the data is transferred from web host server to USA's CDN servers to INDIA's CDN server to the user which is way faster than normal data transfer from a web host.</p>
<p>So which is the best CDN to use today?</p>
<p>Today there are many paid CDN which has good speed, but there is a free CDN that is just as good as paid CDN or even better that is <strong><a target="_blank" href="https://www.cloudflare.com/">Cloudflare</a>.</strong></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653415977641/fn3zH_bNU.png" alt="cloudflare.png" /></p>
<p>It is highly recommended if you are new to a website blog or hosting you should use <a target="_blank" href="https://www.cloudflare.com/">Cloudflare</a>.</p>
<h1 id="heading-keep-the-size-of-your-homepage-less">Keep The Size Of Your Homepage Less</h1>
<p>Many users leave a website if it has more than 2 seconds of loading time.</p>
<p>So everything on the homepage must be optimized and the size should be less than 1 MB so it loads in 2 to 3 seconds.</p>
<p>If you optimize the images then the size will automatically decrease.</p>
<p><em>"Less size more speed."</em></p>
<h1 id="heading-final-verdict">Final Verdict</h1>
<p>Two of the main reasons of a slow website is poor structure and low quality old website hosting servers, so first look if you can improve these two things.</p>
<p>These two things will improve the User experience and website speed by great extend.</p>
]]></content:encoded></item><item><title><![CDATA[How to host static files on GitHub pages?]]></title><description><![CDATA[GitHub is the best way to host static assets. But most people don't know this so they tend to buy a hosting service that is not cheap. From now on you are…]]></description><link>https://blog.anubhavsingh.dev/how-to-host-static-files-on-github-pages</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/how-to-host-static-files-on-github-pages</guid><category><![CDATA[website]]></category><category><![CDATA[hosting]]></category><category><![CDATA[Web Hosting]]></category><category><![CDATA[GitHub]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Wed, 11 May 2022 17:59:53 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414299850/u4w5PBjuF.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="https://github.com/">GitHub</a> is the best way to host static assets.</p>
<p>But most people don't know this so they tend to buy a hosting service that is not cheap.</p>
<p>From now on you are gonna host all your static websites on Github pages.</p>
<p>Let's understand everything about GitHub pages to host all HTML, CSS and JavaScript.</p>
<h2 id="heading-what-are-github-and-github-pages"><strong>What are GitHub and GitHub pages?</strong></h2>
<p>Github is a provider of Internet hosting for software development and version control using Git. And Github pages is where you can host your static HTML, CSS and JS.</p>
<h2 id="heading-how-to-upload-data-to-github"><strong>How to upload data to GitHub?</strong></h2>
<p>There are mainly three ways, to do this </p>
<ol>
<li><a target="_blank" href="https://github.com/">Github Website</a></li>
<li><a target="_blank" href="https://cli.github.com/">Github CLI</a></li>
<li><a target="_blank" href="https://desktop.github.com/">GitHub desktop</a> </li>
</ol>
<h3 id="heading-github-website">Github website</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413995905/aMka4Ky4x.png" alt="upload github.png" /></p>
<p>You just have to make a repository and upload all the files</p>
<h3 id="heading-github-cli">GitHub CLI</h3>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414013055/KekFPQcXv.png" alt="github cli download.png" /></p>
<p>First you will need to download GitHub CLI software from this <a target="_blank" href="https://cli.github.com/">website.</a></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414110602/CHiRJrf9w.jpg" alt="Inkedupload github cli_LI.jpg" /></p>
<p>And the after you create a repository you will see some commands written like above.</p>
<p>You can run the command in command prompt or PowerShell.</p>
<h3 id="heading-github-desktop">Github desktop</h3>
<p>This software is just an upgraded version of GitHub CLI it can do all the tasks easily and has good UI.</p>
<p>You will need to download this software and can create new repository directly from this software.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414123728/ob2cvetB4.png" alt="github desktop.png" /></p>
<p>One thing to keep in mind is that your main HTML page file should be named as index.html to make it work.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414133913/V5OX-8d4c.png" alt="name index.png" /></p>
<p>If you keep the name of the file something else then it can work but you have to add the file name at the end of the URL.</p>
<h2 id="heading-how-to-enable-github-pages"><strong>How to enable GitHub pages</strong>?</h2>
<p>You just need to go on the pages tab present in settings of your repository on which you want to enable GitHub pages on and you can select the branch for which you want your website to host on.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414629500/WuWWwtbdO.png" alt="custom domain.png" class="image--center mx-auto" /></p>
<p>If you haven't created any branch that mostly it is there in the name of main or master.</p>
<p>You can select your branch from source option.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414157795/KkuCmSTg8.png" alt="brach.png" /></p>
<p>Click on save, that will create your URL for particular repository.</p>
<p>Now you will get the domain on the subdomain of github.io as your GitHub account name with the name of the repository at the end.</p>
<p>The URL for your website will look like this :</p>
<p>https://your-account-name.github.io/repository-name/</p>
<h2 id="heading-how-to-add-your-custom-domain-name"><strong>How to add your custom domain name?</strong></h2>
<p>You just have to change the DNS of your domain in DNS settings from the domain provider.</p>
<p>You have to point the domain to Github's IP or your Github's subdomain.</p>
<p>To do this first you have to go to the DNS manager of your domain name.</p>
<p>And then create a CNAME record that points to your GitHub subdomain.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414178202/exTHehZYv.png" alt="cname record.png" /></p>
<p>You can find this option somewhere in your DNS manager.</p>
<p>In the end, you just have to add that domain name to the custom domain field and click save in the pages tab in GitHub.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414184389/kj59ZRi1S.png" alt="custom domain.png" /></p>
<p>Github -&gt; Repository -&gt; Settings -&gt; Pages</p>
<p>You can get a free domain from freenom to use, its not the best idea to use freenom's free domain but still a very good choice for showing off your new project to your friends.</p>
<p>Check the post on <a target="_blank" href="https://blog.anubhavsingh.dev/how-to-get-a-free-domain-3-methods">3 best ways to get a free domain</a>.</p>
<h2 id="heading-add-ssl-to-your-website"><strong>Add SSL to your website</strong></h2>
<p>If you are using a custom domain SSL doesn't come with it installed, you have to install the SSL certificate, GitHub provides a free SSL certificate you just have to enable from your page settings.</p>
<p>But, the best way to add an SSL certificate to your website is by using CloudFlare, which provides premium SSL and other security features such as saving your website form DDOS attack for free.</p>
<h2 id="heading-how-to-do-this-by-cloudflare"><strong>How to do this by Cloudflare?</strong></h2>
<p>Cloudflare is a CDN, a CDN is a set of distributed servers all over the world, which work together to provide fast delivery of data.</p>
<p>A CDN helps to load the assets of a website such as JS, CSS and HTML faster.</p>
<p>Cloudflare is free for non-commercial use, you can use it as a DNS manager you just have to use Cloudflare's nameservers in the DNS editor of your domain provider.</p>
<p>Please copy your own Name Servers provided by Cloudflare don't copy from below.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414258201/Np5YscIdF.png" alt="cloudflare ns.png" /></p>
<p>Your Domain Provider -&gt; DNS Manager -&gt; Nameservers</p>
<p>Now you can add the CNAME or A records in Cloudflare with even higher speed.</p>
<p>Using Cloudflare with github is just a cherry on top.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653414265630/iAeNr2S1t.png" alt="cname record cloudflare.png" class="image--center mx-auto" /></p>
<p>The @ represents the root of your domain, you have to use @ if you want to point the whole domain to somewhere else.</p>
<h2 id="heading-why-are-github-pages-better-than-other-cheap-hosting-providers"><strong>Why are GitHub pages better than other cheap hosting providers?</strong></h2>
<p>GitHub is a big company it hardly goes down it has an uptime of 99.9% so downtime is not a problem, and the speed is also much better than other cheap web hosting services. </p>
<p>Github also provided good speed to all the pages hosted on github and if you are using Cloudflare then you have the best speed possible.</p>
]]></content:encoded></item><item><title><![CDATA[12 Best Software to use as a developer]]></title><description><![CDATA[Applications are used widely across everyone using a computer but when it comes to developers some software just increases the productivity of developers…]]></description><link>https://blog.anubhavsingh.dev/12-best-software-to-use-as-a-developer</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/12-best-software-to-use-as-a-developer</guid><category><![CDATA[software]]></category><category><![CDATA[Developer]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Sat, 30 Apr 2022 17:36:52 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413779501/4_ncnG0Qv.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Applications are used widely across everyone using a computer but when it comes to developers some software just increases the productivity of developers drastically, here are 12 software that you need to use right now.</p>
<h1 id="heading-vs-code-editor"><strong>VS Code Editor</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413563279/qO5r5azRe.png" alt="vs-code.png" /></p>
<p><a target="_blank" href="https://code.visualstudio.com/">Visual Studio Code</a> is a source code editor made by Microsoft for Windows, Linux and macOS. It is the best source code editor for now because of its features.</p>
<p>It supports syntax highlighting, snippets, code refactoring and has inbuilt git supports, which makes it even better for website development.</p>
<p>VS Code also has support for extensions, which can make vs code even better.</p>
<p>If you write programs in C language, then you can download the extension names as code-runner and that will give you a button that will compile and run your code in a single click.</p>
<h1 id="heading-notion"><strong>Notion</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413581606/uoruSze-b.png" alt="notion.png" /></p>
<p><a target="_blank" href="https://www.notion.so/">Notion</a> is an All-in-one workspace that is very useful for a college student. You can use this in many ways, use pages to make this a to-do list, or write down the ideas you want to work on.</p>
<p>I use this app very much for taking notes, saving my idea and sometimes even for writing articles.</p>
<p>You can use this app and software on your phone and PC with the same account.</p>
<p>If you are a college student you can get a free pro account in this software through your .edu or .ac.in email address given by your university.</p>
<h1 id="heading-office-365"><strong>Office 365</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413597919/-Rv2y78qG.png" alt="office.png" /></p>
<p><a target="_blank" href="https://www.office.com/">Office365</a> is the latest version of Microsoft office, it is free for college students through .edu or .ac.in email.</p>
<p>You will get Microsoft word, excel, PowerPoint, OneNote, Teams, Publisher, Access and Outlook for free if using college email id.</p>
<p>And if you don't have a college id then you still can use online office365 or can buy from Microsoft.</p>
<h1 id="heading-discord"><strong>Discord</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413626466/uYbj9ZrES.png" alt="discord.png" /></p>
<p><a target="_blank" href="https://discord.com/">Discord</a> is the easiest way to collaborate with your friends through audio, video and text, it is a VoIP, instant messaging service.</p>
<p>You can connect with other people through servers created by people and have a talk with them or collaborate with them.</p>
<p>People mostly use discord for gaming and streaming but it can also be used for many things.</p>
<h1 id="heading-github-desktop"><strong>Github Desktop</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413637532/xeHB9jTnL.png" alt="github desktop.png" /></p>
<p><a target="_blank" href="https://desktop.github.com/">GitHub Desktop</a> simplifies the task of initializing and committing using command line git, now you can directly commit the changes to the remote GitHub without remembering complex command-line syntax.</p>
<p>Github desktop simplifies your development workflow and is very much useful for people who are fed up with complex git commands.</p>
<h1 id="heading-hyper"><strong>Hyper</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413649058/vOU9iZQ3I.png" alt="hyper.png" /></p>
<p><a target="_blank" href="https://hyper.is/">Hyper</a> is an electron based terminal, based on HTML, CSS and JS.</p>
<p>You can install themes and plugins in the terminal. You will find this very useful if you code in Node and React JS or do automation scripting stuff.</p>
<p>Hyper is faster to use and looks beautiful for a Command Line Interface.</p>
<h1 id="heading-xtreme-download-manager"><strong>Xtreme Download Manager</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413659844/tPv-521RO.png" alt="xdm.png" /></p>
<p><a target="_blank" href="https://xtremedownloadmanager.com/">Xtreme download manager</a> is a downloading tool that immensely increases the speed of downloading files up to 5 times.</p>
<p>It can resume broken links, download, schedule videos from youtube. It is integrated with chrome and firefox through a simple extension made by them. It also has an inbuilt video converter which converts video for your other mobile or TV.</p>
<p>If you download big files with an unstable internet connection then this software is a lifesaver.</p>
<h1 id="heading-grammarly"><strong>Grammarly</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413675679/LajoBaicc.png" alt="grammerly.png" /></p>
<p><a target="_blank" href="https://www.grammarly.com/">Grammarly</a> is a cross-platform cloud-based writing assistant that goes through all the grammar and punctuation of the data that you wrote.</p>
<p>Grammarly combines advanced techniques such as machine learning, deep learning and other grammar rules to improve your writing.</p>
<p>It gives suggestions and also tells you what corrections you should make.</p>
<p>So now you will never get the grammar wrong in your English assignments.</p>
<h1 id="heading-notepad"><strong>Notepad++</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413688284/COjj3Kbmt.png" alt="notepad++.png" /></p>
<p><a target="_blank" href="https://notepad-plus-plus.org/">Notepad++</a> is a text and source editor with multiple features and has support for nearly every programming language.</p>
<p>It is just like an upgraded version of notepad with programming features added to it.</p>
<p>Notepadd++ supports lots of plugins which is just a cherry on top.</p>
<h1 id="heading-putty"><strong>Putty</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413701835/AP4pm0hvc.png" alt="putty.png" /></p>
<p><a target="_blank" href="https://www.putty.org/">PuTTY</a> is a free and open-source terminal emulator. It supports several network protocols such as SCP, SSH, Telnet etc.</p>
<p>You can use this to transfer files between your emulator OS and host OS or can use this with AWS to install or update any software to your AWS account.</p>
<p>With the help of putty, you can also transfer data to any device or use a device that supports SSH.</p>
<h1 id="heading-virtualbox"><strong>VirtualBox</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413721671/6adkR529v.png" alt="vbox.png" /></p>
<p>Oracle <a target="_blank" href="https://www.virtualbox.org/">VM VirtualBox</a> is a free and Open Source application for creating, managing and running virtual machines (VMs).</p>
<p>You can install a different OS to test the latest OS or you can use any OS and use it as a sandbox to test software that you think may contain malware.</p>
<p>If you are a windows user and wanted to switch to Linux then first you can try it on VirtualBox to see if you like that or not.</p>
<h1 id="heading-spotify"><strong>Spotify</strong></h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653413732277/yNoTA1X6g.png" alt="spotify.png" /></p>
<p><a target="_blank" href="https://www.spotify.com/">Spotify</a> is an audio streaming service, where you can listen to music and podcasts.</p>
<p>It is the ultimate stress-busting app that has helped many people, </p>
<p>if you can't focus on anything or can't find a solution to a problem then you certainly should take a break and listen to some music.</p>
<hr />
<p><strong>Comment Your Most Used software below.</strong></p>
]]></content:encoded></item><item><title><![CDATA[How to get a free domain? (3 Methods)]]></title><description><![CDATA[the three best ways to get a domain name for free to work on for you projects]]></description><link>https://blog.anubhavsingh.dev/how-to-get-a-free-domain-3-methods</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/how-to-get-a-free-domain-3-methods</guid><category><![CDATA[domain]]></category><category><![CDATA[website]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Wed, 20 Apr 2022 17:17:50 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1653412449613/bckW8BZaj.jpg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>The domain name is the address of the website that people type in their web browsers to get to the location of the website.</p>
<p>"<em>A domain is an address just like someone has a home address or has a telephone number.</em>"</p>
<p>You can get a domain as low as 2$ or ₹100, but there are also some ways in which you can get a free domain.</p>
<h1 id="heading-buy-hosting-that-provides-free-domain">BUY HOSTING THAT PROVIDES FREE DOMAIN</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653412321815/cBdb2SoRJ.png" alt="Screenshot_1.png" class="image--center mx-auto" /></p>
<p>Get a web hosting which gives the offer to get a free .com/.org or .net free tld, this is the best way to get a free domain but it will cost you decent money for website hosting.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653412332854/gk3oikaH9.png" alt="Screenshot_2.png" class="image--center mx-auto" /></p>
<p>You can buy hosting from BlueHost or any other hosting that provides a free .com or .org domain.</p>
<h1 id="heading-get-a-free-subdomain-from-free-web-hosting">GET A FREE SUBDOMAIN FROM FREE WEB HOSTING</h1>
<p>Get a free subdomain from any free domain services.</p>
<p>There is a free web hosting names <a target="_blank" href="https://infinityfree.net/">infinityfree.net</a> which gives you a free subdomain for every free hosting, you can host a website free on <a target="_blank" href="https://infinityfree.net/">InfinityFree</a> as well as get a free subdomain.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653412343600/bMHNLRisL.png" alt="Screenshot_3.png" class="image--center mx-auto" /></p>
<p>But that wouldn't look professional because that subdomain will look something like yourname.infinityfree.net which just doesn't look good. </p>
<h1 id="heading-totally-free-domain">Totally Free Domain</h1>
<p>So what's the best way to get a free domain is,</p>
<p>Use the website <a target="_blank" href="https://www.freenom.com/">freenom</a> it provides 5 free TLD's.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653412352225/cH7cxb2fb.png" alt="Screenshot_4.png" class="image--center mx-auto" /></p>
<p>You can get a free .tk, .ml, .ga, .cf or .gq TLD which is far better than subdomains and other hostings which provide free domains only with web hosting.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653412362515/JHrf4AJlI.png" alt="Screenshot_5.png" class="image--center mx-auto" /></p>
<p>You can get any or all of this TLD for free, awesome!!! isn't it?</p>
<p>Now you don't even have to pay money for checking if your website works correctly, now you just have to point your freenom domain to any of the free hosting websites. and your website is ready.</p>
<p>Now you will ask if these domains are free then why doesn't everyone use these domains, but pay enormous money on .com or .org domains.</p>
<p>There are many reasons for which we should not use these free TLDs domains for your project that anyone other than you wants to see.</p>
<p>You should probably use these TLD's only if you are trying out your project to get on the internet.</p>
<p>What are the main reasons someone should not have these ccTLDs from Freenom?</p>
<ul>
<li><strong>Phishing Attacks</strong></li>
</ul>
<p>All these 5 TLDs rank highest in the number of phishing attacks done on anyone by an URL link just because these are free TLDs.</p>
<p>This is the reason why most of the mails coming from these domains go in your spam folder.</p>
<ul>
<li><strong>Banned in many hosting services</strong></li>
</ul>
<p>These domains are also banned from many hosting services, this is because of the reason that most people use these domains for phishing attacks.</p>
<ul>
<li><strong>Bad SEO</strong></li>
</ul>
<p>Since many websites and email hosting services have banned these domains that generally have a bad SEO effect which causes the website to rank relatively low in the Search Engine.</p>
<ul>
<li><strong>You are not the owner</strong></li>
</ul>
<p>You are not the owner of this domain, if you buy the .com domain then you are the owner of that .com domain but not in these TLDs, the website freenom.com is the real owner of these domains.</p>
<p>You cannot transfer this domain to some other place, you just can use the domains.</p>
<ul>
<li><strong>Most abused domains</strong></li>
</ul>
<p>According to spamhus.org these are one of the most abused domains on the internet with more than 17% per TLD and have a badness index of more than 1.</p>
<p>What I recommend.</p>
<p>Don't use these domains even if you want your project to be 1% serious.</p>
<p>These domains have serious issues for ranking in google.</p>
<p>Use these domains for your site or some fun project or if you are a developer you can connect these domains to your GitHub static projects.</p>
]]></content:encoded></item><item><title><![CDATA[How to make a python bot that defeats everyone on Lichess.]]></title><description><![CDATA[How to automate the chess moves just with help of python and a chess engine. You don’t need to know any advance concepts of python, just follow this blog.]]></description><link>https://blog.anubhavsingh.dev/how-to-make-a-python-bot-that-defeats-everyone-on-lichess</link><guid isPermaLink="true">https://blog.anubhavsingh.dev/how-to-make-a-python-bot-that-defeats-everyone-on-lichess</guid><category><![CDATA[Python]]></category><category><![CDATA[automation]]></category><dc:creator><![CDATA[Anubhav Singh]]></dc:creator><pubDate>Mon, 11 Apr 2022 17:03:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/unsplash/G8wvNzm_fK0/upload/v1653411234241/mvJL7-QaD.jpeg" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>Automation is the new hot thing today, in this post, I am gonna tell you how can you automate the chess moves just with help of python and a chess engine. You don’t need to know python, you just need to know the basics of any programming language to understand the code, you can still run the bot even with zero knowledge of any programming language, just copy the code at end of this post and edit some things that are commented in the script.</p>
<p>We are going to automate the chess moves on Lichess website for this these are the things that are required:</p>
<ul>
<li><p>python -&gt; python interpreter</p>
</li>
<li><p>pyautogui -&gt; python package</p>
</li>
<li><p>stockfish -&gt;python package</p>
</li>
<li><p>requests -&gt; python package</p>
</li>
<li><p>stockfish engine -&gt; for making strong moves</p>
</li>
<li><p>lichess account -&gt; for getting the FEN for the current board position</p>
</li>
</ul>
<h2 id="heading-step-1-python"><strong>Step 1: Python</strong></h2>
<p>Install python from the official website and tick the add to environment variables in the installer to add python command to the command line.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653411258505/N8MyRGzXU.png" alt="Screenshot_1.png" /></p>
<h2 id="heading-step-2-downloading-engine"><strong>Step 2: Downloading Engine</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653411275404/fYFPMzP9c.png" alt="Screenshot_2.png" /></p>
<p>Download Stockfish 13 which is compatible with your os and hardware from the stockfish website, stockfish is an open-source chess engine that will help the python script to make the best moves according to the position.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653411303657/Q88NBYHcZ.png" alt="Screenshot_3.png" /></p>
<h2 id="heading-step-3-lichess-account"><strong>Step 3: Lichess Account</strong></h2>
<p>Create a liches account if you don’t have it yet, you will need this to make API requests to play against anyone on lichess.</p>
<p>To get the API key do the following steps:</p>
<p>Login to your Lichess account</p>
<p>Go to this https://lichess.org/account/oauth/token link to create an API token. Write a description and switch on all the options below and click submit.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653411353338/OrILwRWM4.png" alt="Screenshot 2021-05-15 163409.png" /></p>
<p>Make sure to copy your new personal access token now because You won’t be able to see that again!</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653411360626/erdx-3gaQ.png" alt="Screenshot 2021-05-15 163437.png" /></p>
<h2 id="heading-step-4-python-package"><strong>Step 4: Python Package</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653411369388/GUhRG-MzL.png" alt="Screenshot 2021-05-15 163643.png" /></p>
<p>Now we need to install all the packages that I have written above pyautogui, stockfish and requests, To install a python package we need to do pip install “package-name” in the command line without double-quotes.</p>
<h2 id="heading-step-5-lichess-typing-mode"><strong>Step 5: Lichess Typing Mode</strong></h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653411388278/ONGs2V9Gu.png" alt="Screenshot 2021-05-15 163803.png" /></p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1653411376283/kQmhFCQyy.png" alt="Screenshot 2021-05-15 163744.png" /></p>
<p>Switch on input moves with the keyboard mode from the Lichess website so that Lichess can read the moves from the keyboard that are written by out python bot.</p>
<h2 id="heading-step-6-coding"><strong>Step 6: Coding</strong></h2>
<p>Now we start to write the code in notepad++ or vs-code the editor of your choice.</p>
<pre><code class="lang-plaintext">import pyautogui
from stockfish import Stockfish
import requests
def hit(key):
    pyautogui.press(key)
    return
dir=r""
# complete path of your stockfish.exe file in double quotes up
# if your location is C:/stock/stockfish-x64.exe then
# dir = r"C:/stock/stockfish-x64.exe"
stockfish = Stockfish(dir, parameters={"Threads":2})
# increase or decrese cpu threads as you want
print(stockfish.get_parameters())
headers = {'Authorization': 'Bearer "API"'} 
# type your api key instead of API without double quotes
# headers line will look like this =&gt; headers = {'Authorization': 'Bearer lskdhflksdf'} 
while True:
    response = requests.get(
        "https://lichess.org/api/account/playing", headers=headers)
    jsonD = response.json()
    stockfish.set_fen_position(
        jsonD["nowPlaying"][0]["fen"]+" "+jsonD["nowPlaying"][0]["color"][0])
    if(jsonD["nowPlaying"][0]["isMyTurn"]):
      # calling pautogui
        pyautogui.keyDown('enter')
        # increase move time to increase engine strength
        move = stockfish.get_best_move_time(2500)
        hit(move[0])
        hit(move[1])
        hit(move[2])
        hit(move[3])
        # while loop will end when someone gets checkmate or resigns
</code></pre>
<p>Now start the game from the website and run the program as python main.py if you have named the python file as main.py and then switch to chrome tab to see your bot defeat everyone.</p>
<p><strong>Warning:</strong> Don’t do this in your main Lichess account because Lichess can ban your account for cheating.</p>
]]></content:encoded></item></channel></rss>