<?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[Prodengg by Harshit Budhraja - The Official Blog]]></title><description><![CDATA[Experimenting my way through &amp; writing about a plethora of "geeky" stuff - from open-source &amp; Javascript to APIs &amp; Dark Web - I'm a product and engi]]></description><link>https://harshitbudhraja.com</link><image><url>https://cdn.hashnode.com/res/hashnode/image/upload/v1641484516227/JRWYf9hk3.png</url><title>Prodengg by Harshit Budhraja - The Official Blog</title><link>https://harshitbudhraja.com</link></image><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 04:00:52 GMT</lastBuildDate><atom:link href="https://harshitbudhraja.com/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Types of APIs: REST v/s SOAP]]></title><description><![CDATA[Before we get into this, if you're new here or don't know me - I'm Harshit, and I'm a Software Engineer primarily working on Backend Systems. In my steep upward career of 3+ years, I've worked at two unicorns - BigBasket (bigbasket.com), India's Larg...]]></description><link>https://harshitbudhraja.com/types-of-apis-rest-vs-soap</link><guid isPermaLink="true">https://harshitbudhraja.com/types-of-apis-rest-vs-soap</guid><category><![CDATA[REST API]]></category><category><![CDATA[SOAP API]]></category><category><![CDATA[types of api]]></category><category><![CDATA[Postman]]></category><category><![CDATA[learning]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Thu, 13 Apr 2023 00:45:21 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1681346610142/b1e4235a-166a-4327-9daa-a729a788a1b2.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Before we get into this, if you're new here or don't know me - I'm Harshit, and I'm a Software Engineer primarily working on Backend Systems. In my steep upward career of 3+ years, I've worked at two unicorns - BigBasket (<strong>bigbasket.com</strong>), India's Largest Online Grocery Supermarket and Postman (<a target="_blank" href="http://postman.com"><strong>postman.com</strong></a>), an API Development Platform which was my latest sprint.</p>
<p>This is a new series that I've started - Demystifying APIs, and it aims to promote API Literacy in the tech community. Feel free to ask me any questions around APIs in the comments below or by tweeting to me (<a target="_blank" href="http://twitter.com/harshitbudhraja"><strong>twitter.com/harshitbudhraja</strong></a>) - I'll be happy to answer each one of those.</p>
<p>Also, don't forget to subscribe to my newsletter, so that you don't miss any of the further posts in this series.</p>
</blockquote>
<p>In the last post, we introduced APIs and discussed the basics of what they are and how they work. In case you missed it, do check it out here: <a target="_blank" href="https://harshitbudhraja.com/what-is-an-api">https://harshitbudhraja.com/what-is-an-api</a></p>
<p>In this post, we'll dive deeper into the most commonly used types of APIs - REST and SOAP APIs. Let's begin with a closer look at these two types, shall we?</p>
<h1 id="heading-what-are-rest-apis">What are REST APIs?</h1>
<p>REST stands for Representational State Transfer, and it is a type of web service that uses HTTP protocols to transfer data. REST APIs are stateless, which means that they do not maintain any information about the client. Instead, each request contains all the necessary information to complete the request.</p>
<p>REST APIs use standard HTTP methods such as GET, POST, PUT, DELETE, and PATCH to perform operations on resources. These resources can be anything that can be identified by a unique identifier, such as a user, a product, or an order.</p>
<p>One of the advantages of REST APIs is that they are easy to understand and implement, which makes them very popular among developers. They also allow for caching, which can improve performance.</p>
<h1 id="heading-what-are-soap-apis">What are SOAP APIs?</h1>
<p>SOAP stands for Simple Object Access Protocol, and it is a type of web service that uses XML as the data format and a standardized messaging protocol for communication. SOAP APIs are stateful, which means that they maintain information about the client.</p>
<p>SOAP APIs use a specific messaging format called a SOAP envelope, which contains a header and a body. The header contains information about the message, such as the message ID and the destination. The body contains the actual message.</p>
<p>SOAP APIs are often used in enterprise environments where security and reliability are of utmost importance. They provide a standardized way of communicating between systems, which makes them ideal for integrating different systems.</p>
<h1 id="heading-structural-differences-in-rest-and-soap">Structural differences in REST and SOAP</h1>
<p>Let's try to understand with examples, the differences in the structure of the request and response messages. Before that, you should know that REST APIs typically use JSON or XML for data exchange, while SOAP APIs use XML exclusively. Additionally, SOAP APIs require the use of a WSDL (Web Services Description Language) file to define the API methods and message formats, while REST APIs do not have a standardized definition format.</p>
<blockquote>
<p>We'll be talking about different API Definition Types in the upcoming posts in this series, so make sure you stay tuned and subscribe to the newsletter to receive email digests whenever I publish.</p>
</blockquote>
<p>Okay, so we were talking about structures, right?</p>
<h2 id="heading-rest-structure">REST Structure</h2>
<p><strong>Request:</strong></p>
<pre><code class="lang-plaintext">GET /hello HTTP/1.1
Host: example.com
Accept: application/json
</code></pre>
<p>The request includes a <code>GET</code> method to access the <code>/hello</code> endpoint on the <a target="_blank" href="http://example.com"><code>example.com</code></a> domain. It also includes an <code>Accept</code> header indicating that the client is expecting a JSON response.</p>
<p><strong>Response:</strong></p>
<pre><code class="lang-plaintext">HTTP/1.1 200 OK
Content-Type: application/json

{ "message": "Hello, World!" }
</code></pre>
<p>The response includes a <code>200 OK</code> status code indicating that the request was successful. It also includes a <code>Content-Type</code> header indicating that the response is in JSON format. The response body includes a JSON object with a <code>message</code> property set to "Hello, World!".</p>
<h2 id="heading-soap-structure">SOAP Structure</h2>
<p><strong>Request:</strong></p>
<pre><code class="lang-plaintext">POST /hello HTTP/1.1
Host: example.com
Content-Type: text/xml;charset=UTF-8
Content-Length: nnn

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;HelloWorldRequest xmlns="http://example.com"&gt;
      &lt;name&gt;World&lt;/name&gt;
    &lt;/HelloWorldRequest&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>
<p>The request includes a <code>POST</code> method to access the <code>/hello</code> endpoint on the <a target="_blank" href="http://example.com"><code>example.com</code></a> domain. It also includes a <code>Content-Type</code> header indicating that the request is in XML format. The request body includes a SOAP envelope containing a <code>HelloWorldRequest</code> element with a <code>name</code> child element set to "World".</p>
<p><strong>Response:</strong></p>
<pre><code class="lang-plaintext">HTTP/1.1 200 OK
Content-Type: text/xml;charset=UTF-8
Content-Length: nnn

&lt;?xml version="1.0" encoding="UTF-8"?&gt;
&lt;soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/"&gt;
  &lt;soap:Body&gt;
    &lt;HelloWorldResponse xmlns="http://example.com"&gt;
      &lt;message&gt;Hello, World!&lt;/message&gt;
    &lt;/HelloWorldResponse&gt;
  &lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;
</code></pre>
<p>The response includes a <code>200 OK</code> status code indicating that the request was successful. It also includes a <code>Content-Type</code> header indicating that the response is in XML format. The response body includes a SOAP envelope containing a <code>HelloWorldResponse</code> element with a <code>message</code> child element set to "Hello, World!".</p>
<h1 id="heading-when-to-use-rest-and-when-to-use-soap">When to use REST and when to use SOAP?</h1>
<p>The decision to use either REST or SOAP depends on several factors such as the type of application being developed, the complexity of the API, the performance requirements, and the desired level of security.</p>
<p>RESTful APIs are ideal for building lightweight web services that are simple, scalable, and easy to develop. They are particularly suitable for public-facing APIs that need to support a variety of clients, including web browsers, mobile apps, and IoT devices. REST APIs use HTTP and offer a standardized set of methods and status codes, which makes them easy to use and understand. They also offer good performance and caching capabilities, which can help improve the scalability of the application.</p>
<p>SOAP APIs are a better choice for building complex, enterprise-level applications that require more advanced security and transaction management features. They use XML-based messaging to exchange data between client and server, which makes them more secure and reliable. SOAP APIs also offer support for advanced messaging features such as message queuing, reliable messaging, and transaction processing, which can be important for mission-critical applications.</p>
<h1 id="heading-examples-of-public-rest-and-soap-apis">Examples of Public REST and SOAP APIs</h1>
<p>SOAP APIs used to be common in the last decade, but most providers have slowly moved towards REST for the reasons mentioned above. An example of a publicly used SOAP API is the <strong>Europe PMC</strong> (<a target="_blank" href="https://europepmc.org/SoapWebServices">https://europepmc.org/SoapWebServices</a>).</p>
<p>REST APIs are more commonly used in modern software, so the examples are numerous. But for instance, <strong>Github</strong> has one (<a target="_blank" href="https://docs.github.com/en/rest?apiVersion=2022-11-28">https://docs.github.com/en/rest?apiVersion=2022-11-28</a>), <strong>Apple</strong> has one to help authenticate using Apple's Servers (<a target="_blank" href="https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api">https://developer.apple.com/documentation/sign_in_with_apple/sign_in_with_apple_rest_api</a>).</p>
<p>These are just to mention a few. In fact, you can find yourself surrounded by APIs, you just have to look.</p>
<p>Now, because we're covering REST and SOAP, why don't we write simple Hello World APIs in both of them?</p>
<h1 id="heading-code-time-hello-world-in-soap-and-rest">Code Time: Hello World in SOAP and REST</h1>
<h2 id="heading-using-nodejs-and-rest">Using NodeJs and REST</h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express'</span>);
<span class="hljs-keyword">const</span> app = express();
<span class="hljs-keyword">const</span> port = <span class="hljs-number">3000</span>;

app.get(<span class="hljs-string">'/'</span>, <span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
  res.send(<span class="hljs-string">'Hello World!'</span>);
});

app.listen(port, <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`REST API Example listening at http://localhost:<span class="hljs-subst">${port}</span>`</span>);
});
</code></pre>
<p>In this example, we create a simple REST API that responds to a GET request to the root URL ("/") with the message "Hello World!". The <code>express</code> package is used to handle the HTTP requests and responses.</p>
<h2 id="heading-using-nodejs-and-soap">Using NodeJs and SOAP</h2>
<pre><code class="lang-javascript"><span class="hljs-keyword">const</span> express = <span class="hljs-built_in">require</span>(<span class="hljs-string">'express'</span>);
<span class="hljs-keyword">const</span> app = express();
<span class="hljs-keyword">const</span> bodyParser = <span class="hljs-built_in">require</span>(<span class="hljs-string">'body-parser'</span>);
<span class="hljs-keyword">const</span> soap = <span class="hljs-built_in">require</span>(<span class="hljs-string">'soap'</span>);

<span class="hljs-keyword">const</span> wsdlUrl = <span class="hljs-string">'http://www.dneonline.com/calculator.asmx?wsdl'</span>;
<span class="hljs-keyword">const</span> port = <span class="hljs-number">3000</span>;

app.use(bodyParser.raw({ <span class="hljs-attr">type</span>: <span class="hljs-function"><span class="hljs-keyword">function</span> (<span class="hljs-params"></span>) </span>{ <span class="hljs-keyword">return</span> <span class="hljs-literal">true</span>; }, <span class="hljs-attr">limit</span>: <span class="hljs-string">'5mb'</span> }));

app.post(<span class="hljs-string">'/hello'</span>, <span class="hljs-function">(<span class="hljs-params">req, res</span>) =&gt;</span> {
  <span class="hljs-keyword">const</span> xml = req.body.toString();
  soap.createClient(wsdlUrl, <span class="hljs-function">(<span class="hljs-params">err, client</span>) =&gt;</span> {
    client.HelloWorld({}, <span class="hljs-function">(<span class="hljs-params">err, result</span>) =&gt;</span> {
      res.setHeader(<span class="hljs-string">'Content-Type'</span>, <span class="hljs-string">'text/xml'</span>);
      res.send(result.HelloWorldResult);
    });
  });
});

app.listen(port, <span class="hljs-function">() =&gt;</span> {
  <span class="hljs-built_in">console</span>.log(<span class="hljs-string">`SOAP API Example listening at http://localhost:<span class="hljs-subst">${port}</span>`</span>);
});
</code></pre>
<p>In this example, we create a simple SOAP API that responds to a POST request to the "/hello" endpoint with the message "Hello World!". The <code>body-parser</code> package is used to parse the XML request body. The <code>soap</code> package is used to create a SOAP client and call the <code>HelloWorld</code> operation on the SOAP API.</p>
<h1 id="heading-conclusion">Conclusion</h1>
<p>In conclusion, REST and SOAP APIs are the two most common types of APIs. REST APIs are easy to understand and implement, while SOAP APIs are more secure and reliable. Which type of API you choose to use will depend on your specific needs and requirements.</p>
<p>In case you have any more questions or concerns about REST or SOAP APIs, or there is something you'd want me to talk about in the upcoming posts, please tweet to me (<a target="_blank" href="http://twitter.com/harshitbudhraja"><strong>twitter.com/harshitbudhraja</strong></a>) or leave a comment on this post.</p>
<p>In the upcoming posts, we will be diving deeper into REST APIs and the principles governing them. We will also discuss different types of API definitions, including OpenAPI, AsyncAPI, GraphQL and more. Stay tuned!</p>
]]></content:encoded></item><item><title><![CDATA[Generating vanity .onion addresses for Tor v3 (ED25519) hidden services]]></title><description><![CDATA[ED25519 (formerly, Proposal 224) is a public-key signature system that is now being adopted by Tor v3 hidden services. As per Tor's official statement on its blog, v2, which relies on older systems of public-key signatures, will be completely depreca...]]></description><link>https://harshitbudhraja.com/generating-vanity-onion-addresses-for-tor-v3-hidden-services</link><guid isPermaLink="true">https://harshitbudhraja.com/generating-vanity-onion-addresses-for-tor-v3-hidden-services</guid><category><![CDATA[tor]]></category><category><![CDATA[dark web]]></category><category><![CDATA[torbrowser]]></category><category><![CDATA[.onion]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Mon, 13 Feb 2023 11:42:35 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1676288329051/bff3b121-5aae-4f83-9821-e9b0035b86f8.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p><a target="_blank" href="https://ed25519.cr.yp.to"><strong>ED25519</strong></a> (formerly, Proposal 224) is a public-key signature system that is now being adopted by Tor v3 hidden services. As per <a target="_blank" href="https://blog.torproject.org/v2-deprecation-timeline">Tor's official statement on its blog</a>, v2, which relies on older systems of public-key signatures, will be completely deprecated and removed by October 2021.</p>
<p>So, as I was experimenting with Tor in the last few days, I decided to check out tools to help generate these new ED25519 signatures. Out of many out there, <a target="_blank" href="https://github.com/cathugger/mkp224o">mkp224o</a> worked well for me.</p>
<p>Now usually, setting up the dependencies for such C99-based tools is usually trickier in most Windows or MacOS systems than in Linux systems. But, thanks to <a target="_blank" href="https://hub.docker.com/r/nwtgck/mkp224o">this</a> docker image which I found on the <a target="_blank" href="https://hub.docker.com">DockerHub</a>, things were smooth for me.</p>
<h2 id="heading-lets-see-how-to-generate-one-then">Let's see how to generate one, then?</h2>
<p>It's fairly straightforward with Docker - just run a container from the image, exec inside it and use the tool 🚀</p>
<p>To run a container and exec inside it:</p>
<pre><code class="lang-bash">docker run -it nwtgck/mkp224o
</code></pre>
<p>Once you're in, <code>mkp224o</code> will be available to you as an executable. You can check out the usage and options by running <code>mkp224o -h</code> to see a help text like this:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621417878298/hRpevwX6D.png" alt="image.png" /></p>
<h2 id="heading-need-a-quick-start-command-to-begin-with-eh">Need a quick-start command to begin with, eh?</h2>
<p>Well, got you covered there. Let's quickly see which options are the easiest, to begin with:</p>
<ol>
<li><p><code>-B</code> - Use this for batching the key generation process.</p>
</li>
<li><p><code>-S 1</code> - Use this for printing stats after every second as the generator is running.</p>
</li>
<li><p><code>-d dirname</code> - Use this to output all the generated .onions to a <code>dirname</code> directory</p>
</li>
<li><p><code>-n 1</code> - To stop the process after 1 key is matching the filters is found</p>
</li>
</ol>
<p>With all the above options, here's how the syntax to generate 2 keys starting with <code>temp</code> and store them into a <code>onions</code> directory looks like:</p>
<pre><code class="lang-bash">mkp224o -B -S 1 -d onions -n 2 temp
</code></pre>
<p>And voila, we now have them in the specified directory:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1621417972524/0HCLtPVym.png" alt="image.png" /></p>
<p>You can find the public key, secret key and a hostname file for each .onion that you've generated.</p>
<p>Happy Tor-ing! 🧅😁</p>
]]></content:encoded></item><item><title><![CDATA[What is an API?]]></title><description><![CDATA[Before we get into this, if you're new here or don't know me - I'm Harshit, and I'm a Software Engineer currently working at Postman (https://postman.com), an API Development Platform.
This is a new series that I've started - Demystifying APIs, and i...]]></description><link>https://harshitbudhraja.com/what-is-an-api</link><guid isPermaLink="true">https://harshitbudhraja.com/what-is-an-api</guid><category><![CDATA[APIs]]></category><category><![CDATA[API basics ]]></category><category><![CDATA[api]]></category><category><![CDATA[app development]]></category><category><![CDATA[Postman]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Thu, 09 Feb 2023 16:20:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1675959401577/455c7144-631d-4cb4-84ec-4e31915b8434.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>Before we get into this, if you're new here or don't know me - I'm Harshit, and I'm a Software Engineer currently working at Postman (https://postman.com), an API Development Platform.</p>
<p>This is a new series that I've started - Demystifying APIs, and it aims to promote API Literacy in the tech community. Feel free to ask me any questions around APIs in the comments below or by tweeting to me (https://twitter.com/harshitbudhraja) - I'll be happy to answer each one of those.</p>
<p>Also, don't forget to subscribe to my newsletter, so that you don't miss any of the further posts in this series.</p>
</blockquote>
<p>Well, nothing fancy here. Let me start by telling you that most (actually, ALL) modern software use APIs in one way or the other.</p>
<h1 id="heading-okay-but-what-exactly-is-an-api">Okay, but what exactly is an API? 🤔</h1>
<p>API stands for <strong>Application Programming Interface</strong>. Don't stress too much over it (just remember it for your interviews though 😛).</p>
<p>Breaking it down for you:</p>
<ol>
<li><p><strong>Application -</strong> This <strong>c</strong>ould be anything from a mobile app, web app, or desktop app to apps that run on your smartwatch to even browser extensions.</p>
</li>
<li><p><strong>Programming</strong> - To make them (i.e. the apps) work according to your requirements.</p>
</li>
<li><p><strong>Interface</strong> - Any tool/library/software/hardware that helps you complete your task (in this case, helps you program your apps).</p>
</li>
</ol>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675952113900/07bda8dc-255d-4bb4-96af-21b7684f2bc6.png" alt class="image--center mx-auto" /></p>
<h1 id="heading-ah-that-was-a-bouncer-for-me">Ah, that was a bouncer for me 🤯</h1>
<p>Haha, no big deal. Let's understand it using a simple example:</p>
<p>Your smartphone shows you <strong>weather updates</strong>, right? Do you think companies like Oppo, Vivo, Xiaomi, Micromax or Samsung own satellites that relay this information to them for them to deliver it to you on that home screen? <strong>Well, they don't.</strong></p>
<p><strong>Then, where do they get these weather updates from?</strong></p>
<p>The answer to this question is simple - from organizations that have satellites and specialize in meteorology.</p>
<p><strong>But how?</strong></p>
<p>Here's a little diagram to understand how this communication takes place:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1675953991948/5b77925e-848e-4b14-94bc-568b613170b0.png" alt class="image--center mx-auto" /></p>
<p>Satellites owned by meteorological organizations relay the weather data to them, who in turn relay this to the requesting companies - like Samsung, and they further make this data available to their users on their smartphones.</p>
<p><strong>But, where do APIs come into the picture?</strong></p>
<p>Simply putting, everywhere you see <strong>blue arrows</strong> in the above diagram :p</p>
<h1 id="heading-wow-i-think-i-get-it-but-what-do-they-look-like">Wow, I think I get it. But what do they look like? 😍</h1>
<p>Beautiful 🥰</p>
<p>Just kidding (well, not really).</p>
<p>Okay, so there are many different types of APIs: SOAP APIs, RPC APIs, REST APIs, Websocket APIs etc. of which <strong>REST APIs</strong> are the most commonly used ones. You'll find them almost everywhere. They generally use a universally recognized data interchange format/language like <a target="_blank" href="https://en.wikipedia.org/wiki/JSON">JSON (Javascript Object Notation)</a> or <a target="_blank" href="https://en.wikipedia.org/wiki/XML">XML (Extensible Markup Language)</a> which are typically both machine-readable and human-readable to exchange data.</p>
<p>For example, if you'd like to see a real-world weather API, you can check this out: <a target="_blank" href="https://open-meteo.com/en/docs">https://open-meteo.com/en/docs</a>. Whenever anyone requests weather data from them, they return a response that looks something like this:</p>
<pre><code class="lang-json">{
  <span class="hljs-attr">"latitude"</span>: <span class="hljs-number">52.52</span>,
  <span class="hljs-attr">"longitude"</span>: <span class="hljs-number">13.419</span>,
  <span class="hljs-attr">"elevation"</span>: <span class="hljs-number">44.812</span>,
  <span class="hljs-attr">"generationtime_ms"</span>: <span class="hljs-number">2.2119</span>,
  <span class="hljs-attr">"utc_offset_seconds"</span>: <span class="hljs-number">0</span>,
  <span class="hljs-attr">"timezone"</span>: <span class="hljs-string">"Europe/Berlin"</span>,
  <span class="hljs-attr">"timezone_abbreviation"</span>: <span class="hljs-string">"CEST"</span>,
  <span class="hljs-attr">"hourly"</span>: {
    <span class="hljs-attr">"time"</span>: [<span class="hljs-string">"2022-07-01T00:00"</span>, <span class="hljs-string">"2022-07-01T01:00"</span>, <span class="hljs-string">"2022-07-01T02:00"</span>, ...],
    <span class="hljs-attr">"temperature_2m"</span>: [<span class="hljs-number">13</span>, <span class="hljs-number">12.7</span>, <span class="hljs-number">12.7</span>, <span class="hljs-number">12.5</span>, <span class="hljs-number">12.5</span>, <span class="hljs-number">12.8</span>, <span class="hljs-number">13</span>, <span class="hljs-number">12.9</span>, <span class="hljs-number">13.3</span>, ...]
  },
  <span class="hljs-attr">"hourly_units"</span>: {
    <span class="hljs-attr">"temperature_2m"</span>: <span class="hljs-string">"°C"</span>
  },
  <span class="hljs-attr">"current_weather"</span>: {
    <span class="hljs-attr">"time"</span>: <span class="hljs-string">"2022-07-01T09:00"</span>,
    <span class="hljs-attr">"temperature"</span>: <span class="hljs-number">13.3</span>,
    <span class="hljs-attr">"weathercode"</span>: <span class="hljs-number">3</span>,
    <span class="hljs-attr">"windspeed"</span>: <span class="hljs-number">10.3</span>,
    <span class="hljs-attr">"winddirection"</span>: <span class="hljs-number">262</span>
  }
}
</code></pre>
<p>This, by the way, is the JSON format.</p>
<h1 id="heading-final-notes-for-now">Final Notes (for now) 📝</h1>
<p>Don't worry if you don't understand a word in that 😅 We'll take this slow and step-by-step. And by the end of this series, you would have a fair understanding of everything you need to know about APIs.</p>
<p>With that, I hope you have an idea of what APIs are 🤞🏻 In the upcoming posts in this series, we'd be talking more about APIs and their types in detail.</p>
<p>Cheers!</p>
]]></content:encoded></item><item><title><![CDATA[What Are the Top 10 Skills Needed for a Product Management Role? (Written by Notion AI)]]></title><description><![CDATA[So, I recently got access to the feature everyone is talking about these days - Notion's AI Assistant. And I decided to give it a try.
Here was my input to the AI: "A blog post about the top 10 skills needed for a Product Management role". Check out ...]]></description><link>https://harshitbudhraja.com/what-are-the-top-10-skills-needed-for-a-product-management-role-written-by-notion-ai</link><guid isPermaLink="true">https://harshitbudhraja.com/what-are-the-top-10-skills-needed-for-a-product-management-role-written-by-notion-ai</guid><category><![CDATA[notionai]]></category><category><![CDATA[notion]]></category><category><![CDATA[AI]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Thu, 29 Dec 2022 10:30:26 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1672309377337/7eebd23d-d936-49af-950f-c961b092ec8b.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>So, I recently got access to the feature everyone is talking about these days - Notion's AI Assistant. And I decided to give it a try.</p>
<p>Here was my input to the AI: "<strong>A blog post about the top 10 skills needed for a Product Management role</strong>". Check out what it wrote - I was astonished by the quality of the content it generated. Tell me what you think about this in the comments.</p>
<p>Disclaimer: The content of this post is generated, in its entirety, by Notion AI and is untouched.</p>
</blockquote>
<p>Product Managers have the unique role of driving a product from concept to launch and beyond. It requires a broad range of skills to successfully manage a product lifecycle. Here are the top 10 skills needed for a Product Management role:</p>
<ol>
<li><p>Vision: Product Managers need to have a clear vision for the product and be able to articulate it effectively to the team.</p>
</li>
<li><p>Product Strategy: Product Managers need to have a deep understanding of the competitive landscape, customer needs, and how to create a product that meets those needs.</p>
</li>
<li><p>Technical Knowledge: Product Managers need to be familiar with the technical aspects of the product they are managing. They need to understand the architecture, design, and development processes.</p>
</li>
<li><p>Communication: Product Managers need to be able to communicate effectively with both internal and external stakeholders.</p>
</li>
<li><p>Collaboration: Product Managers need to be effective collaborators who can work with a variety of teams, including Engineering, Design, Marketing, and Support.</p>
</li>
<li><p>Problem-solving: Product Managers need to be able to identify and solve problems quickly, efficiently, and effectively.</p>
</li>
<li><p>Analytical Skills: Product Managers need to have strong analytical skills to be able to interpret data and make informed decisions.</p>
</li>
<li><p>Leadership: Product Managers need to have the ability to lead teams and motivate them to reach their goals.</p>
</li>
<li><p>Creativity: Product Managers need to be able to come up with creative solutions to complex problems.</p>
</li>
<li><p>Time Management: Product Managers need to be able to manage their time effectively, set deadlines, and meet them.</p>
</li>
</ol>
<p>These are just some of the skills that are needed for a successful Product Manager role. With these skills, you can be sure to build great products and drive successful product launches.</p>
]]></content:encoded></item><item><title><![CDATA[Reminders on Slack messages (and even snoozing them!!)]]></title><description><![CDATA[What?
I always saved a message on Slack when I wanted to check it out later. Little did I know, Slack has a feature 
to let you add reminders against messages (and even snooze them!).

How?
To add a reminder against a message:

Click the "More action...]]></description><link>https://harshitbudhraja.com/reminders-on-slack-messages-and-even-snoozing-them</link><guid isPermaLink="true">https://harshitbudhraja.com/reminders-on-slack-messages-and-even-snoozing-them</guid><category><![CDATA[slack]]></category><category><![CDATA[Time management]]></category><category><![CDATA[reminder]]></category><category><![CDATA[snooze]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Wed, 10 Aug 2022 10:18:10 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1660126438720/Va0DmfwxHv.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h1 id="heading-what">What?</h1>
<p>I always saved a message on Slack when I wanted to check it out later. Little did I know, Slack has a feature 
to let you add reminders against messages (and even snooze them!).
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1660125250403/Z1-yRkVxG.png" alt="image.png" /></p>
<h1 id="heading-how">How?</h1>
<p>To add a reminder against a message:</p>
<ol>
<li>Click the "More actions" button on the message to open up the actions menu.</li>
<li>Find an action "Remind me about this".</li>
<li>From the list of intervals, select your desired interval or choose a custom date and time.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1660125445034/2Q-etbAAO.png" alt="image.png" /></li>
<li>Once you do that, a reminder will be created for you and you would get a DM from Slackbot at the set date and time. You can choose to delete it, mark it as completed or just snooze it for a later time.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1660125840459/Nn06EVf7S.png" alt="image.png" /></li>
</ol>
]]></content:encoded></item><item><title><![CDATA[I evolved from using an Excel Workbook to using 1Password (for FREE) to store my passwords]]></title><description><![CDATA[When I initially used 1Password at work, I was surprised by the ease with which I can store, retrieve, fill and even share my passwords in case I want to. This was a big shift from my traditional way of

storing them in an Excel Workbook;


securing ...]]></description><link>https://harshitbudhraja.com/using-1password-for-free-to-store-my-passwords</link><guid isPermaLink="true">https://harshitbudhraja.com/using-1password-for-free-to-store-my-passwords</guid><category><![CDATA[free]]></category><category><![CDATA[passwords]]></category><category><![CDATA[Security]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Wed, 23 Feb 2022 07:34:05 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1645598817635/X7NRaUtAL.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>When I initially used 1Password at work, I was surprised by the ease with which I can store, retrieve, fill and even share my passwords in case I want to. This was a big shift from my traditional way of</p>
<ol>
<li><p>storing them in an Excel Workbook;
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645599425835/M9P5ofJ_d.png" alt="image.png" /></p>
</li>
<li><p>securing the file with a master password (and Touch ID);
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645599543100/a0wkVMCaV.png" alt="image.png" /></p>
</li>
<li><p>with dozens of different sheets categorising my credentials;
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645599667867/f6VdqF59V.png" alt="image.png" /></p>
</li>
<li><p>keeping the file in sync with my smartphone through iCloud;
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645599827872/eR_dXovuj.png" alt="image.png" /></p>
</li>
</ol>
<p>It was a lot of work doing all of that, honestly.</p>
<p>1Password was pretty good at what it did, but with the <a target="_blank" href="https://1password.com/sign-up/">pricing structure</a> that they offered for personal and family use, I wasn't sure if it was even worth the $36 or $60 I'd be spending "just to store my passwords".
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645600789620/pAv_LKOer.png" alt="image.png" /></p>
<p>I recently learnt that 1Password started offering <a target="_blank" href="https://support.1password.com/link-family/">free Family Plans to users who use 1Password at work (with a Business plan)</a>, and fortunately my organisation is on one of these plans.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645601079237/Txo82G_Ok.png" alt="image.png" /></p>
<h2 id="heading-well-so-what-next">Well, so what next?</h2>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1645601179965/fjtitVvDZ.png" alt="image.png" /></p>
<p>To experience the full potential of 1Password, I'm migrating all my passwords (stored at various distributed locations - excel workbook, chrome, safari etc.) to my vaults.</p>
<p><strong>The one thing which excites me about 1Password (for now) is how seamless the experience is - it has native Mac app, Windows app, Android app, iOS app, a chrome extension and even a Command Line Utility (😳).</strong></p>
<p>Looking forward to have a better experience now!</p>
]]></content:encoded></item><item><title><![CDATA[How to make your Hashnode blog load faster?]]></title><description><![CDATA[This post talks about the recent "monstrous upgrade" (as they call it) that Hashnode has brought in its architecture and how we can leverage the power of this upgrade to speed up load times of our blogs hosted on Hashnode.
Background

A lot of you mi...]]></description><link>https://harshitbudhraja.com/how-to-make-your-hashnode-blog-load-faster</link><guid isPermaLink="true">https://harshitbudhraja.com/how-to-make-your-hashnode-blog-load-faster</guid><category><![CDATA[Hashnode]]></category><category><![CDATA[dns]]></category><category><![CDATA[HashnodeCommunity]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Tue, 20 Jul 2021 19:26:30 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1641487559739/lKPqxG-pG.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>This post talks about the recent "monstrous upgrade" (as they call it) that Hashnode has brought in its architecture and how we can leverage the power of this upgrade to speed up load times of our blogs hosted on Hashnode.</p>
<h1 id="heading-background">Background</h1>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626802701786/37qERtv6W.png" alt="image.png" /></p>
<p>A lot of you might have received an email from our friendly neighbourhood Spiderman; just kidding; <a class="user-mention" href="https://hashnode.com/@sandeep">Sandeep Panda</a> (Co-founder, Hashnode) with a catchy subject starting with <em>[ACTION REQUIRED]</em> and wondered what is it about. Let's demystify this together!</p>
<h1 id="heading-whats-the-story">What's the story?</h1>
<p>What we understand from the email is that Hashnode's Engineering Team, apparently, had been working on an upgrade that would make all the blogs hosted on their platform load way faster. Well, this was much needed and had been expressed by a large portion of the community in the past, so big kudos to the Engineering Team for finally rolling this out!</p>
<p>Now this email should've been sent to users who are using <em>Custom Domains</em> on Hashnode because that's where the migration is required. The blogs which are hosted on a subdomain under <code>hashnode.com</code> should've been taken care of by Hashnode internally. So, if you're not using a custom domain and you've still received an email, you know whose neck to hold for spamming your inbox 😉</p>
<h1 id="heading-lets-make-our-blogs-faster">Let's make our blogs faster</h1>
<p>Hashnode requires users who're using <em>A records</em> in their domain's DNS configuration to point to them make a minor change to make their blogs use the new platform. This change needs to be done by all users eventually, as Hashnode will stop supporting its legacy platform after <strong>August 20, 2021</strong>.</p>
<p>Let's dive head-first:</p>
<ol>
<li><p><strong>Disable your custom CSS</strong>: One of the breaking changes highlighted in the email was support for <em>non-standard CSS classes</em>. If you're not sure about this, it's recommended to disable your custom CSS feature as a precautionary measure. You can do so by heading over to your Blog Dashboard &gt; Appearance and scrolling down towards the end to find the option under Advanced Settings.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626803953494/zZ6vEFT8AG.png" alt="image.png" /></p>
</li>
<li><p><strong>Grab the IP Address for the new server</strong>: Head over to your Blog Dashboard &gt; Domain and you should see a warning like shown below. This is an indicator that you are required to migrate to the new platform manually. On scrolling down, you should see the new IP Address that Hashnode requires you to update into your DNS configurations.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626804274186/lRPCKOnnV.png" alt="image.png" /></p>
<p> For the purpose of this tutorial, let's assume the IP Address to be <code>XX.XX.XX.XX</code> as shown below. <img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626804607744/0H5cuubYm.png" alt="image.png" /></p>
</li>
<li><p><strong>Find your DNS Console</strong>: So, if you're using a custom domain, you must have purchased the domain from a <strong>domain registrar</strong> like  <a target="_blank" href="https://godaddy.com/">Godaddy</a>,  <a target="_blank" href="https://www.namecheap.com/">Namecheap</a>,  <a target="_blank" href="https://domains.google.com/registrar">Google Domains</a> etc. These domain registrars also provide you with a console to manage your DNS. You should head over to your registrar's website and find the console. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626805149545/WiGQkzjR1.png" alt="image.png" /></p>
</li>
<li><p><strong>Do you see an A record?</strong>: Once you have found the way to your console, you should see all your DNS records listed there. The one we're concerned about is the <strong>A</strong> record which currently points to an IP Address which is the one to Hashnode's legacy platform. This is the one we need to edit.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626805318872/I1aBNvFFd.png" alt="image.png" /></p>
</li>
<li><p><strong>Update this record's IP Address</strong>: This is the most important step where you need to update the IP Address pointer of this <strong>A</strong> record to point to the new IP Address we noted in Step (2) i.e. <code>XX.XX.XX.XX</code>. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626805680988/C3n1LMc30.png" alt="image.png" /></p>
</li>
</ol>
<p>And we're done 🚀 Your blog should now be migrated to Hashnode's new platform.</p>
<h1 id="heading-how-long-does-it-take">How long does it take?</h1>
<p>It may take up to 24 hours for DNS changes to propagate fully. But it's usually pretty quick. You can check the progress by using a  <a target="_blank" href="https://www.whatsmydns.net/">service like this</a>.
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626808876153/gn6KBXNu8.png" alt="image.png" /></p>
<h1 id="heading-what-about-my-ssl-certificate">What about my SSL certificate?</h1>
<p>As usual, Hashnode will continue provisioning and managing an SSL certificate for your domain using Let's Encrypt. 
<img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626809027980/wLYvEZ55C.png" alt="image.png" /></p>
<h1 id="heading-using-cloudflare">Using Cloudflare?</h1>
<p>If you are using something like Cloudflare, remember to bypass it for this route by clicking on the "Orange Cloud". Make sure that it appears grayed out and the "Proxy Status" is "DNS Only".</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1626806508869/-o4mDZfeN.png" alt="image.png" /></p>
<p><a class="user-mention" href="https://hashnode.com/@Catalinpit">Catalin Pit</a> <a class="user-mention" href="https://hashnode.com/@ayushi7rawat">Ayushi Rawat</a> <a class="user-mention" href="https://hashnode.com/@victoria">Victoria Lo</a> You have been the folks who have, unknowingly, motivated me to start a blog on Hashnode. Would love to hear your feedback!</p>
]]></content:encoded></item><item><title><![CDATA[Port a website to the Dark Web in under 2 minutes]]></title><description><![CDATA[What if hosting a website on the dark web was as easy as running a tiny docker container in your own machines or a remote server or merely on your Raspberry Pi? What if I tell you that it actually is, and you can now host your own website on the Tor ...]]></description><link>https://harshitbudhraja.com/port-a-website-to-the-dark-web-in-under-2-minutes</link><guid isPermaLink="true">https://harshitbudhraja.com/port-a-website-to-the-dark-web-in-under-2-minutes</guid><category><![CDATA[nginx]]></category><category><![CDATA[Docker]]></category><category><![CDATA[docker images]]></category><category><![CDATA[proxy]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Thu, 27 May 2021 19:37:12 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1723554530148/967ad95d-aa7a-4c9a-9c59-c120f42a9399.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>What if hosting a website on the dark web was as easy as running a tiny docker container in your own machines or a remote server or merely on your Raspberry Pi? What if I tell you that it actually is, and you can now host your own website on the Tor 🧅 network in less than 2 minutes? ⌛️</p>
<h2 id="heading-what-is-tor-nginx-proxy">What is tor-nginx-proxy?</h2>
<p><a target="_blank" href="https://hub.docker.com/r/harshitbudhraja/tor-nginx-proxy/"><img src="http://dockeri.co/image/harshitbudhraja/tor-nginx-proxy" alt="Docker Hub badge" /></a></p>
<p><a target="_blank" href="https://github.com/harshit-budhraja/tor-nginx-proxy">tor-nginx-proxy</a> is a docker image which helps you to do exactly that ☝🏻</p>
<h2 id="heading-how-does-this-actually-work">How does this actually work?</h2>
<p>What you see is a tiny <a target="_blank" href="https://en.wikipedia.org/wiki/Docker_%28software%29">docker</a> image based on <a target="_blank" href="https://en.wikipedia.org/wiki/Alpine_Linux">alpine</a> which encapsulates <a target="_blank" href="https://en.wikipedia.org/wiki/Tor_%28anonymity_network%29">tor</a> and <a target="_blank" href="https://en.wikipedia.org/wiki/Nginx">nginx</a> in a single container, and enables you to proxy traffic from your <code>.onion</code> url to your website on the <a target="_blank" href="https://en.wikipedia.org/wiki/Clearnet_%28networking%29">clearnet</a>. Too many jargons, eh?</p>
<p>In NSS ("not-so-sophisticated") terms, this can be understood as a simple <a target="_blank" href="https://harshitbudhraja.com/proxy-pass-nginx">proxy_pass</a> happening from your website on the dark web which is being served through tor to your website on the internet, but inside the docker container.</p>
<h2 id="heading-can-i-see-any-website-live-on-tor-which-is-using-this-discontinued">Can I see any website live on Tor which is using this? <code>discontinued</code></h2>
<p>Of course! <a target="_blank" href="https://ipoalerts.in">IPOAlerts.in</a>, <a target="_blank" href="https://www.linkedin.com/posts/harshitbudhraja_ipoalert-trading-startupstory-activity-6787310217878110208-LnLI">a service which was built by me over a weekend</a> last month, is now available over Tor 🎊 And it's using nothing more than <code>tor-nginx-proxy</code> behind-the-scenes. Here's a glance of my docker container which is serving it on Tor.</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1622135951077/TWbEM-N4T.png" alt="tor-nginx-proxy_container.png" /></p>
<p>Check it out on: <code>http://ipoaltnp5be3mvotgap2ohu62py5nyu25cg2uognl7u5kysqxsrezoad.onion/</code> using the <a target="_blank" href="https://www.torproject.org/download/">Tor Browser</a>.</p>
<p>You can also check out the twitter feed to see who else is talking about <a target="_blank" href="https://twitter.com/search?q=%23tor_nginx_proxy&amp;src=typed_query">#tor_nginx_proxy</a>.</p>
<h2 id="heading-why-call-it-tiny">Why call it "tiny"?</h2>
<p>Because, it's less than ~15MB in size 😆
<img src="https://img.shields.io/docker/image-size/harshitbudhraja/tor-nginx-proxy/latest" alt="Docker Image Size (tag)" /></p>
<h2 id="heading-how-can-i-use-it">How can I use it?</h2>
<p>To get started, I recommend checking out the README(s) on either of the following:</p>
<ol>
<li>Github Repository: https://github.com/harshit-budhraja/tor-nginx-proxy</li>
<li>DockerHub Repository: https://hub.docker.com/repository/docker/harshitbudhraja/tor-nginx-proxy/</li>
</ol>
<p>You can possibly use it in any way you'd like to (given that it adheres to the terms of the <a target="_blank" href="https://github.com/harshit-budhraja/tor-nginx-proxy/blob/master/LICENSE">License</a>).</p>
<h2 id="heading-show-some-support">Show some support 🙇🏻‍♂️</h2>
<p>This is my first attempt to really give something back to the open-source community. If you liked this and are currently using (or planning to use) it, please do show some support by <a target="_blank" href="https://github.com/harshit-budhraja/tor-nginx-proxy/stargazers">starring</a> and <a target="_blank" href="https://github.com/harshit-budhraja/tor-nginx-proxy/network/members">forking</a> the repository and / or by following me on Github and Twitter to be updated with more such work by me.</p>
<p><strong>These little actions won't cost you a penny, but they'll boost my motivation and confidence in ways I can't even express 😅
</strong></p>
<p><a target="_blank" href="https://twitter.com/harshitbudhraja"><img src="https://img.shields.io/twitter/follow/harshitbudhraja?style=social" alt="Twitter Follow" /></a>
<a target="_blank" href="https://github.com/harshit-budhraja"><img src="https://img.shields.io/github/followers/harshit-budhraja?style=social" alt="GitHub followers" /></a>
<a target="_blank" href="https://github.com/harshit-budhraja/tor-nginx-proxy"><img src="https://img.shields.io/github/forks/harshit-budhraja/tor-nginx-proxy?style=social" alt="GitHub forks" /></a>
<a target="_blank" href="https://github.com/harshit-budhraja/tor-nginx-proxy"><img src="https://img.shields.io/github/stars/harshit-budhraja/tor-nginx-proxy?style=social" alt="GitHub Repo stars" /></a></p>
<p>Also because I don't have any tracker to see who's using this at all (in-fact, I'm not a supporter of trackers), please don't forget to talk about how you're using <code>tor-nginx-proxy</code> for your use-case with the hashtag: <a target="_blank" href="https://twitter.com/search?q=%23tor_nginx_proxy&amp;src=typed_query">#tor_nginx_proxy</a>.</p>
<h2 id="heading-can-i-contribute-to-maintaining-it">Can I contribute to maintaining it?</h2>
<p>Of course, I'd be glad to have you contribute to this in any way possible. Please feel free to <a target="_blank" href="https://github.com/harshit-budhraja/tor-nginx-proxy/issues/new/choose">open an issue</a> or reach out to me on <a target="_blank" href="https://twitter.com/harshitbudhraja">Twitter</a> to discuss more about it.</p>
<h2 id="heading-have-any-issues">Have any issues?</h2>
<p>Please <a target="_blank" href="https://github.com/harshit-budhraja/tor-nginx-proxy/issues/new/choose">open a new issue</a> on the github issue tracker so that me or anyone from the community can have a look at it and suggest.</p>
<h2 id="heading-support-the-tor-project">Support The Tor Project</h2>
<p>
  <img src="https://upload.wikimedia.org/wikipedia/commons/8/8f/Tor_project_logo_hq.png" />
</p>

<p>For the Tor project sustainability, I strongly encourage you to help <a target="_blank" href="https://trac.torproject.org/projects/tor/wiki/TorRelayGuide">setup Tor bridges/exit nodes</a>(<a target="_blank" href="https://github.com/PeterDaveHello/ubuntu-tor-simply-setup"><strong>script</strong></a>) and <a target="_blank" href="https://donate.torproject.org/">donate</a> money to the Tor project <em>(Not this nginx-proxy project)</em> as and when you have the ability / capacity :))</p>
]]></content:encoded></item><item><title><![CDATA[Proxying to your app running on custom port in NGINX]]></title><description><![CDATA[More than ever, if you're managing a server either as an EC2 instance on AWS, or as a VM instance on GCP, or just working on your local machines, proxying to your app's custom port comes in handy if:

Your app uses a protocol other than HTTP/HTTPS
Yo...]]></description><link>https://harshitbudhraja.com/proxy-pass-nginx</link><guid isPermaLink="true">https://harshitbudhraja.com/proxy-pass-nginx</guid><category><![CDATA[nginx]]></category><category><![CDATA[proxy]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Thu, 13 May 2021 08:04:55 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1641488967696/8haqz-AGw.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>More than ever, if you're managing a server either as an EC2 instance on AWS, or as a VM instance on GCP, or just working on your local machines, proxying to your app's custom port comes in handy if:</p>
<ul>
<li>Your app uses a protocol other than HTTP/HTTPS</li>
<li>You are working towards balancing the load across multiple containers</li>
<li>You want to test new features as canary deployments</li>
<li>and so on...</li>
</ul>
<p>Here's a quick <code>.conf</code> snippet to proxy pass a request coming on port <code>80</code> to port <code>8081</code> where your custom app is running:</p>
<pre><code>server {
    listen <span class="hljs-number">80</span>;
    access_log <span class="hljs-operator">/</span>path<span class="hljs-operator">/</span>to<span class="hljs-operator">/</span>log<span class="hljs-operator">/</span>access.log;
    error_log <span class="hljs-operator">/</span>path<span class="hljs-operator">/</span>to<span class="hljs-operator">/</span>log<span class="hljs-operator">/</span><span class="hljs-keyword">error</span>.log;

    location <span class="hljs-operator">/</span> {
        proxy_pass http:<span class="hljs-comment">//localhost:8081;</span>
        proxy_set_header Host $host:$server_port;
        proxy_set_header X<span class="hljs-operator">-</span>Forwarded<span class="hljs-operator">-</span>For $remote_addr;
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection upgrade;
        proxy_set_header Accept<span class="hljs-operator">-</span>Encoding gzip;
    }
}
</code></pre><p>Of course, you can replace the ports with your own values.</p>
]]></content:encoded></item><item><title><![CDATA[How BigBasket stepped into Open Source]]></title><description><![CDATA[The answer to “why?”
With the fraternity getting fairly scrutinised in the last few years, it would not be wrong to say that the modern tech is indeed driven by open source software. The plethora is so firm and crisp that we typically use certain ope...]]></description><link>https://harshitbudhraja.com/bigbaskets-first-step-towards-open-source</link><guid isPermaLink="true">https://harshitbudhraja.com/bigbaskets-first-step-towards-open-source</guid><category><![CDATA[technology]]></category><category><![CDATA[React]]></category><category><![CDATA[npm]]></category><category><![CDATA[Open Source]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Wed, 17 Mar 2021 13:46:17 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1641489765524/Xr6BH2cxh.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<h3 id="heading-the-answer-to-why">The answer to “why?”</h3>
<p>With the fraternity getting fairly scrutinised in the last few years, it would not be wrong to say that the modern tech is indeed driven by open source software. The plethora is so firm and crisp that we typically use certain open source softwares and tools without even realising that they’re open source. From Python to Node.js to React to Golang to Java to Apache Kafka to Redis to dozens of other recognised languages / frameworks that we all use, we are all constantly taking from the open source community.</p>
<p>And it’s not long before we, at BigBasket Tech, realised that it’d be really good to give something back to the community. And that’s when we made our first-ever mark into giving back to the open source community by sourcing a tiny bit of our code open for the community – a react package called <strong>ra-treemenu</strong>.</p>
<h3 id="heading-a-little-background-eh-sure">A little background, eh? Sure.</h3>
<p>We use an open-source react-based framework called React Admin for our catalog, search engine and review admin portals. While in the early days when we did not have a lot of quick access menu items to be shown on the sidebar, things worked well for us. But gradually with about 20+ items on the quick access sidebar menu already, the layout started overflowing and it was turning out to be inefficient for our administrators to navigate through the portal. Also, this was certainly a bottleneck at the back of our minds for new menu items and features to be added to this admin portal.</p>
<blockquote>
<p>There’s always a way to do it better – one just needs to find it.<br />– Thomas A. Edison</p>
</blockquote>
<p>With that thought in mind, what we needed was a better way to group them and create a multi-level hierarchy and that would solve our problem without over-engineering things.</p>
<h3 id="heading-so-did-we-check-for-existing-open-source-packages-which-we-could-integrate-to-make-this-work">So, did we check for existing open-source packages which we could integrate to make this work?</h3>
<p>Of course, the first idea was to search for a react package (which would be compatible with React Admin) which could do this for us with some tweaks. But unfortunately, we couldn’t find any which worked well. Clearly, the next choice for us was to build one from scratch – extending over the React Admin framework.</p>
<p>Soon after building the package, with the statistics that we had about React Admin’s user-base around the world, we thought it would be a good value addition to the community if we decided to open source it.</p>
<p>And the rest is history! ☺️</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620828387716/qijz1B1v_A.png" alt="ra-demo.png" /></p>
<h3 id="heading-what-now">What now?</h3>
<p>Since August ’20, when we made the package open source (https://github.com/BigBasket/ra-treemenu) and published the first version of it on NPM (https://www.npmjs.com/package/@bb-tech/ra-treemenu), we have had over 2400+ downloads with an average of about 10-12 downloads per day. We’ve released 4 versions till date which had decent contributions from the community as well. Here’s what it looks like:</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620828401780/l3X2DgF8j.png" alt="image.png" /></p>
<p>Detailed stats: https://npm-stat.com/charts.html?package=%40bb-tech%2Fra-treemenu&amp;from=2020-08-01&amp;to=2021-03-17</p>
<p>Now that we have put our foot into open-source and the traction we’ve got in the last few months is keeping us all motivated, it would not be a surprise to see us open sourcing more of such small and big pieces of our work, right?</p>
<p>Do stay tuned to our Github Org (https://github.com/BigBasket).</p>
<p>Cheers!</p>
<p>This article is republished from <a target="_blank" href="https://tech.bigbasket.com/a-first-step-towards-open-source/">BigBasket's Tech Blog</a>.</p>
]]></content:encoded></item><item><title><![CDATA[A tale of strip-typecasting in MySQL]]></title><description><![CDATA[As much as we think we know MySQL, it never fails to surprise us with unusual and weird, yet well-documented, scenarios.

I was perplexed when I learnt about one such thing about MySQL today where it strip-typecasts (as I like to say it) strings to i...]]></description><link>https://harshitbudhraja.com/mysqls-weird-way-of-strip-typecasting-strings-to-integers</link><guid isPermaLink="true">https://harshitbudhraja.com/mysqls-weird-way-of-strip-typecasting-strings-to-integers</guid><category><![CDATA[MySQL]]></category><category><![CDATA[SQL]]></category><category><![CDATA[Databases]]></category><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Fri, 22 Nov 2019 19:30:40 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1641490186581/xVe37KRtL.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<blockquote>
<p>As much as we think we know MySQL, it never fails to surprise us with unusual and weird, yet well-documented, scenarios.</p>
</blockquote>
<p>I was perplexed when I learnt about one such thing about MySQL today where it <strong><em>strip-typecasts </em></strong>(as I like to say it) strings to integers. For example, let’s first have a well-defined table schema and insert some dummy data into it.</p>
<p>Assuming the schema like the one shown below -</p>
<pre><code><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span>
<span class="hljs-operator">|</span> Field   <span class="hljs-operator">|</span> Type     <span class="hljs-operator">|</span> Null   <span class="hljs-operator">|</span> Key   <span class="hljs-operator">|</span> Default   <span class="hljs-operator">|</span> Extra          <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> id      <span class="hljs-operator">|</span> <span class="hljs-keyword">int</span>(<span class="hljs-number">11</span>)  <span class="hljs-operator">|</span> NO     <span class="hljs-operator">|</span> PRI   <span class="hljs-operator">|</span> <span class="hljs-operator">&lt;</span>null<span class="hljs-operator">&gt;</span>    <span class="hljs-operator">|</span> auto_increment <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> name    <span class="hljs-operator">|</span> text     <span class="hljs-operator">|</span> YES    <span class="hljs-operator">|</span>       <span class="hljs-operator">|</span> <span class="hljs-operator">&lt;</span>null<span class="hljs-operator">&gt;</span>    <span class="hljs-operator">|</span>                <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> city    <span class="hljs-operator">|</span> text     <span class="hljs-operator">|</span> YES    <span class="hljs-operator">|</span>       <span class="hljs-operator">|</span> <span class="hljs-operator">&lt;</span>null<span class="hljs-operator">&gt;</span>    <span class="hljs-operator">|</span>                <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> state   <span class="hljs-operator">|</span> text     <span class="hljs-operator">|</span> YES    <span class="hljs-operator">|</span>       <span class="hljs-operator">|</span> <span class="hljs-operator">&lt;</span>null<span class="hljs-operator">&gt;</span>    <span class="hljs-operator">|</span>                <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> country <span class="hljs-operator">|</span> char(<span class="hljs-number">36</span>) <span class="hljs-operator">|</span> YES    <span class="hljs-operator">|</span>       <span class="hljs-operator">|</span> India     <span class="hljs-operator">|</span>                <span class="hljs-operator">|</span>
<span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span>
</code></pre><p>We insert dummy data in the table after which it looks something like -</p>
<pre><code><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span>
<span class="hljs-operator">|</span> id    <span class="hljs-operator">|</span> name    <span class="hljs-operator">|</span> city      <span class="hljs-operator">|</span> state       <span class="hljs-operator">|</span> country   <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> <span class="hljs-number">12345</span> <span class="hljs-operator">|</span> Harshit <span class="hljs-operator">|</span> Bengaluru <span class="hljs-operator">|</span> Karnataka   <span class="hljs-operator">|</span> India     <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> <span class="hljs-number">34213</span> <span class="hljs-operator">|</span> Rahul   <span class="hljs-operator">|</span> New Delhi <span class="hljs-operator">|</span> New Delhi   <span class="hljs-operator">|</span> India     <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> <span class="hljs-number">34256</span> <span class="hljs-operator">|</span> Rohan   <span class="hljs-operator">|</span> Dehradun  <span class="hljs-operator">|</span> Uttarakhand <span class="hljs-operator">|</span> India     <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> <span class="hljs-number">45897</span> <span class="hljs-operator">|</span> Satwik  <span class="hljs-operator">|</span> Mumbai    <span class="hljs-operator">|</span> Maharashtra <span class="hljs-operator">|</span> India     <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> <span class="hljs-number">98364</span> <span class="hljs-operator">|</span> Aayush  <span class="hljs-operator">|</span> Pune      <span class="hljs-operator">|</span> Maharashtra <span class="hljs-operator">|</span> India     <span class="hljs-operator">|</span>
<span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span>
</code></pre><p>Now, what according to you will a query like <code>**SELECT * from table_name where id = 12345;</code>** return? Well yes, you’re right. It will return -</p>
<pre><code><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span>
<span class="hljs-operator">|</span> id    <span class="hljs-operator">|</span> name    <span class="hljs-operator">|</span> city      <span class="hljs-operator">|</span> state     <span class="hljs-operator">|</span> country   <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> <span class="hljs-number">12345</span> <span class="hljs-operator">|</span> Harshit <span class="hljs-operator">|</span> Bengaluru <span class="hljs-operator">|</span> Karnataka <span class="hljs-operator">|</span> India     <span class="hljs-operator">|</span>
<span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span>
</code></pre><p>Let’s tweak that query a bit to something like <code>**SELECT * from table_name where id = '45897siujwehrirc';</code>** and can you now predict the output? And no, as much as you think that MySQL will throw an error or return an empty set, in fact it doesn’t. Here’s the output that you’d get -</p>
<pre><code><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span>
<span class="hljs-operator">|</span> id    <span class="hljs-operator">|</span> name   <span class="hljs-operator">|</span> city   <span class="hljs-operator">|</span> state       <span class="hljs-operator">|</span> country   <span class="hljs-operator">|</span>
<span class="hljs-operator">|</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">|</span>
<span class="hljs-operator">|</span> <span class="hljs-number">45897</span> <span class="hljs-operator">|</span> Satwik <span class="hljs-operator">|</span> Mumbai <span class="hljs-operator">|</span> Maharashtra <span class="hljs-operator">|</span> India     <span class="hljs-operator">|</span>
<span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">-</span><span class="hljs-operator">+</span>
</code></pre><p>So the question is why this? And the answer is quite a cliche one though -</p>
<h2 id="heading-this-is-how-mysql-works">This is how MySQL works!</h2>
<p>What MySQL does is get all the numbers from the start of the string <code>'**45897siujwehrirc**’</code> and strip off any characters following it before typecasting it to integer and querying the table. So, the resultant query which actually gets fired to the table is -</p>
<p><code>SELECT * from table_name where id = 45897;</code></p>
<p>whose expected result matches our result.</p>
<p>Coming to the part where I tell you that MySQL has documented this clearly.
<a target="_blank" href="https://dev.mysql.com/doc/refman/5.7/en/type-conversion.html"><strong>MySQL :: MySQL 5.7 Reference Manual :: 12.2 Type Conversion in Expression Evaluation</strong>
<em>When an operator is used with operands of different types, type conversion occurs to make the operands compatible. Some…</em>dev.mysql.com</a></p>
<p>Weirdly counterintuitive way of casting <code>'45897siujwehrirc'</code> to <code>45897</code>. Ain't it?</p>
]]></content:encoded></item><item><title><![CDATA[Making apt decisions while you code to save money👨‍💻👩‍💻]]></title><description><![CDATA[It’s fairly common to find students coding all through their college and I was one of the lot — played around with a lot of code, services, APIs, hooks, bots and what not. I used to be confident that I’m pretty good at what I do, until now when stepp...]]></description><link>https://harshitbudhraja.com/making-apt-decisions-while-you-code-to-save-money-4bcf1c89dc9c</link><guid isPermaLink="true">https://harshitbudhraja.com/making-apt-decisions-while-you-code-to-save-money-4bcf1c89dc9c</guid><dc:creator><![CDATA[Harshit Budhraja]]></dc:creator><pubDate>Fri, 13 Sep 2019 07:11:00 GMT</pubDate><enclosure url="https://cdn.hashnode.com/res/hashnode/image/upload/v1641490729524/9gHvLQKjy.png" length="0" type="image/jpeg"/><content:encoded><![CDATA[<p>It’s fairly common to find students coding all through their college and I was one of the lot — played around with a lot of code, services, APIs, hooks, bots and what not. I used to be confident that I’m pretty good at what I do, until now when stepping out of that confined water bucket into the ocean made me realise that I’m not at par with practices adopted by the industry. And one of the most underrated yet essential aspect of product design is <strong>making apt decisions</strong>, which I’m going to talk about in this post.</p>
<p>Let me make my point with the help of a small example.</p>
<p>Let’s say we have an architecture like -</p>
<p><img src="https://cdn.hashnode.com/res/hashnode/image/upload/v1620820617262/lEqSMla3-.png" alt="Example architecture" /><em>Example architecture</em></p>
<p>Assuming that each replica of the codebase can do only one job at a time and it takes ‘t’ time for one replica to complete one task, only after which can it take up the next one, consider -</p>
<blockquote>
<p><strong>*Case I</strong> — Where Job #A — {Job #1, Job #2, Job #3} i.e. Job #A is a collective job which strictly needs to be completed sequentially. When the replicas take up jobs, the situation is something like -*</p>
</blockquote>
<p>Replica #1 &lt;= Job #A : Running time = 3t</p>
<p>Replica #2 &lt;= Job #4 : Running time = t</p>
<p>Replica #3 &lt;= Job #5 : Running time = t</p>
<p>In this case, the total time the system will take to complete all the five jobs would be 3t.</p>
<blockquote>
<p><strong>*Case II</strong> — Where all the five jobs are independent. When the replicas take up jobs now, one of the permutations of the possible situations is something like -*</p>
</blockquote>
<p>Replica #1 &lt;= Job #1, Job #4 : Running time = 2t</p>
<p>Replica #2 &lt;= Job #2, Job #5 : Running time = 2t</p>
<p>Replica #3 &lt;= Job #3 : Running time = t</p>
<p>In this case, the total time the system will take to complete all the five jobs would be 2t.</p>
<p>What if you had this situation in a real life scenario — Your user uploads some <strong>“sets of images”</strong> to your app and now while displaying those images, you actually want your UI to display thumbnails of those images and when the user clicks the thumbnail, show him the actual image. Pretty common and relatable example, right? Now, you write an asynchronous service that is called as soon as a set of images uploaded by a user is available and generates the thumbnails for them. Or you write an asynchronous service that is called as soon as an image is uploaded and generates a thumbnail for it. The service is deployed on a three-node kubernetes cluster. For a user, the images are a set, no doubt. But from engineering perspective, it is upto you as an engineer whether you want your service to treat them as a set (Case I of the above example) or you want your service to treat them as individual images (Case II of the above example).</p>
<p>Clearly, from the above example, we can see that one small implementation decision can impact the overall infrastructure cost.And further, with managed services like Google Cloud, AWS, DigitalOcean etc. offering pay-as-you-go plans which are the most popular plans among customers, <strong>optimal use of your resources might just save you a lot of money</strong>.</p>
<p>Just something to ponder over!</p>
<p>Cheers 🍻</p>
<p><em>Originally published at <a target="_blank" href="https://premagious.xyz/making-apt-decisions-while-you-code-to-save-money/">https://premagious.xyz</a> on September 13, 2019.</em></p>
]]></content:encoded></item></channel></rss>