<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom" ><generator uri="https://jekyllrb.com/" version="3.10.0">Jekyll</generator><link href="https://vimarsh.cc/index.xml" rel="self" type="application/atom+xml" /><link href="https://vimarsh.cc/" rel="alternate" type="text/html" /><updated>2026-11-18T19:31:24+00:00</updated><id>https://vimarsh.cc/index.xml</id><title type="html">Vimarsh</title><subtitle>learning through research, robotics, and random projects on topics I find interesting. studying physics + compsci at BITS Goa. most days I am debugging, simulating, or trying to make something work, some of it even works!
</subtitle><author><name>Vimarsh Shah</name></author><entry><title type="html">Running Your Own Custom Authoritative DNS Server</title><link href="https://vimarsh.cc/blog/running-your-own-custom-authoritative-dns-server/" rel="alternate" type="text/html" title="Running Your Own Custom Authoritative DNS Server" /><published>2025-07-20T12:00:00+00:00</published><updated>2025-07-20T12:00:00+00:00</updated><id>https://vimarsh.cc/blog/running-your-own-custom-authoritative-dns-server</id><content type="html" xml:base="https://vimarsh.cc/blog/running-your-own-custom-authoritative-dns-server/"><![CDATA[<p>This is all very experimental. I deployed it for my domain, vimarsh.cc. So when you open this website, your computer first asks “where is vimarsh.cc?”. The server that gives the final answer is not Cloudflare or my domain registrar. It is a small Go program that I wrote, running on my own server.</p>

<p><strong><a href="https://github.com/vimarsh244/dns">Github Repository</a></strong></p>

<h2 id="why">Why?</h2>

<p>I wanted to learn Go. Go is such a simple and nice language, and I really enjoy writing it.</p>

<p>I also use DNS every day. I even ran a <a href="/blog/running-a-public-dns-resolver/">public DNS resolver</a> some time back. But I did not really know what happens inside a DNS server. So I made one rule for myself: <strong>no DNS libraries</strong>. I read the packets myself and I write the answers myself. (The only outside package is for the password on the admin page.)</p>

<p>And yes, it is also just for fun. Only I use it. If it breaks, only my website breaks. Fine.</p>

<h2 id="first-what-is-dns">First, what is DNS?</h2>

<p>Computers talk to each other with IP addresses, like <code class="language-plaintext highlighter-rouge">1.2.3.4</code>. People remember names, like <code class="language-plaintext highlighter-rouge">vimarsh.cc</code>. DNS is the phone book that connects the name to the address.</p>

<p>There are two kinds of DNS servers:</p>

<ul>
  <li><strong>Resolver:</strong> it does the asking for you. Your ISP has one. <code class="language-plaintext highlighter-rouge">1.1.1.1</code> (Cloudflare) and <code class="language-plaintext highlighter-rouge">8.8.8.8</code> (Google) are also resolvers. A resolver keeps answers for some time, so it does not ask again every time.</li>
  <li><strong>Authoritative server:</strong> it has the real answer for a domain. It does not ask anyone else. It only says “for this name, the IP is this”.</li>
</ul>

<p>My <a href="/blog/running-a-public-dns-resolver/">older post</a> was about a resolver. This post is about an authoritative server.</p>

<p><a href="/uploads/2025/07/dns/dns-lookup-flow.svg"><img src="/uploads/2025/07/dns/dns-lookup-flow.svg" alt="Diagram: the browser asks a resolver. The resolver asks the root server, then the .cc server, then my Go server, which gives the IP address." /></a></p>

<p>This is what happens when you open vimarsh.cc:</p>

<ol>
  <li>Your browser asks the resolver: “where is vimarsh.cc?”</li>
  <li>The resolver asks a root server. The root server does not know. It says “ask the .cc servers”.</li>
  <li>The resolver asks the .cc server. It also does not know. It says “ask the nameserver of vimarsh.cc”. That nameserver is my server.</li>
  <li>The resolver asks my Go server. My server gives the IP address.</li>
  <li>The resolver gives the IP address to your browser. Now the browser can load the page.</li>
</ol>

<p><strong>Step 4 is the part I wrote.</strong> Everything else is the normal internet.</p>

<p>How does the .cc server know about my server? At my domain registrar (the website where I bought the domain), I changed the nameserver setting to point to my server.</p>

<h2 id="what-the-server-does">What the server does</h2>

<p>The whole thing is one Go program. It does three jobs at the same time:</p>

<ul>
  <li>It answers DNS questions over UDP.</li>
  <li>It listens on TCP for zone transfers. (A zone transfer copies all records to a second nameserver. More on this below.)</li>
  <li>It shows a small web page where I can add and delete records.</li>
</ul>

<p><a href="/uploads/2025/07/dns/dns-server-inside.svg"><img src="/uploads/2025/07/dns/dns-server-inside.svg" alt="Diagram: a question comes in, the server reads the name and type, finds the records, keeps only the right type, and sends the answer back. zone.txt and the web page feed the records. Each question is written to analytics.log." /></a></p>

<p>For one question, these are the steps:</p>

<ol>
  <li><strong>A question comes in.</strong> It is one small UDP packet. (UDP is simple: you send one packet and you get one packet back. There is no connection setup.)</li>
  <li><strong>Read it.</strong> The server reads the name and the type. The type tells what you want:
    <ul>
      <li><code class="language-plaintext highlighter-rouge">A</code>: the IPv4 address (like <code class="language-plaintext highlighter-rouge">1.2.3.4</code>)</li>
      <li><code class="language-plaintext highlighter-rouge">AAAA</code>: the IPv6 address</li>
      <li><code class="language-plaintext highlighter-rouge">CNAME</code>: “this name is another name, go ask for that one”</li>
      <li><code class="language-plaintext highlighter-rouge">MX</code>: the mail server for the domain</li>
      <li><code class="language-plaintext highlighter-rouge">TXT</code>: any text. Mostly used to prove you own a domain (Google, email checks, etc.)</li>
      <li><code class="language-plaintext highlighter-rouge">NS</code>: the nameserver for the domain</li>
    </ul>
  </li>
  <li><strong>Find the records.</strong> First the server looks for the exact name. If there is no match, it tries a wildcard. For example, for <code class="language-plaintext highlighter-rouge">blog.dev.vimarsh.cc</code> it also tries <code class="language-plaintext highlighter-rouge">*.dev.vimarsh.cc</code>.</li>
  <li><strong>Keep only the right type.</strong> If you ask for <code class="language-plaintext highlighter-rouge">A</code>, you get only <code class="language-plaintext highlighter-rouge">A</code> records. There is one special rule: if the name has a <code class="language-plaintext highlighter-rouge">CNAME</code>, the server sends only the <code class="language-plaintext highlighter-rouge">CNAME</code>. The resolver then follows it by itself.</li>
  <li><strong>Send the answer back.</strong> The server marks the answer as “authoritative”. This tells the resolver “this is the real answer, not a copy”.</li>
</ol>

<p>Each question also becomes one line in <code class="language-plaintext highlighter-rouge">analytics.log</code>. More on that below.</p>

<h2 id="reading-the-packet">Reading the packet</h2>

<p>This was the most fun part. A DNS packet is just a list of bytes.</p>

<p>The first 12 bytes are the header. It has an ID, some flags, and four numbers that say how many questions and answers are in the packet. In Go, I can read these 12 bytes straight into a struct:</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">type</span> <span class="n">dns_header</span> <span class="k">struct</span> <span class="p">{</span>
    <span class="n">Id</span>      <span class="kt">uint16</span> <span class="c">// same ID goes back in the answer</span>
    <span class="n">Flags</span>   <span class="kt">uint16</span> <span class="c">// answer? authoritative?</span>
    <span class="n">Qdcount</span> <span class="kt">uint16</span> <span class="c">// number of questions</span>
    <span class="n">Ancount</span> <span class="kt">uint16</span> <span class="c">// number of answers</span>
    <span class="n">Nscount</span> <span class="kt">uint16</span>
    <span class="n">Arcount</span> <span class="kt">uint16</span>
<span class="p">}</span>

<span class="c">// fill the whole struct in one line:</span>
<span class="n">binary</span><span class="o">.</span><span class="n">Read</span><span class="p">(</span><span class="n">buf</span><span class="p">,</span> <span class="n">binary</span><span class="o">.</span><span class="n">BigEndian</span><span class="p">,</span> <span class="o">&amp;</span><span class="n">hdr</span><span class="p">)</span>
</code></pre></div></div>

<p>One line to fill the whole header. I really liked that about Go.</p>

<p>After the header comes the name. But the name is not written with dots. Each part of the name starts with its length, and a <code class="language-plaintext highlighter-rouge">0</code> marks the end:</p>

<p><a href="/uploads/2025/07/dns/dns-name-bytes.svg"><img src="/uploads/2025/07/dns/dns-name-bytes.svg" alt="Diagram: www.vimarsh.cc is stored as 3 w w w 7 v i m a r s h 2 c c 0. The numbers are the length of the next part." /></a></p>

<p>So reading a name is a small loop (simple version of the code in <code class="language-plaintext highlighter-rouge">packet.go</code>):</p>

<div class="language-go highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="k">for</span> <span class="p">{</span>
    <span class="n">length</span><span class="p">,</span> <span class="n">_</span> <span class="o">:=</span> <span class="n">r</span><span class="o">.</span><span class="n">ReadByte</span><span class="p">()</span> <span class="c">// length of the next part</span>
    <span class="k">if</span> <span class="n">length</span> <span class="o">==</span> <span class="m">0</span> <span class="p">{</span>
        <span class="k">break</span> <span class="c">// 0 means end of the name</span>
    <span class="p">}</span>
    <span class="n">part</span> <span class="o">:=</span> <span class="nb">make</span><span class="p">([]</span><span class="kt">byte</span><span class="p">,</span> <span class="n">length</span><span class="p">)</span>
    <span class="n">r</span><span class="o">.</span><span class="n">Read</span><span class="p">(</span><span class="n">part</span><span class="p">)</span>
    <span class="n">labels</span> <span class="o">=</span> <span class="nb">append</span><span class="p">(</span><span class="n">labels</span><span class="p">,</span> <span class="kt">string</span><span class="p">(</span><span class="n">part</span><span class="p">))</span>
<span class="p">}</span>
<span class="n">name</span> <span class="o">:=</span> <span class="n">strings</span><span class="o">.</span><span class="n">Join</span><span class="p">(</span><span class="n">labels</span><span class="p">,</span> <span class="s">"."</span><span class="p">)</span> <span class="c">// "www.vimarsh.cc"</span>
</code></pre></div></div>

<p>To answer, the server does the same thing in reverse. It copies the ID from the question, so the resolver knows which question this answer is for. It sets two flags: “this is an answer” and “I am authoritative”. Then it writes the records after the question.</p>

<h2 id="the-zone-file">The zone file</h2>

<p>All records are in one plain text file, <code class="language-plaintext highlighter-rouge">zone.txt</code>. One record on each line:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># name             TYPE   value                          TTL
example.com.       SOA    ns1.example.com. admin.example.com. 2025071801 3600 600 604800 300 3600
example.com.       NS     ns1.example.com.               3600
example.com.       A      192.0.2.10                     300
www.example.com.   CNAME  example.com.                   300
*.dev.example.com. A      192.0.2.20                     300
example.com.       TXT    "hello from my own dns server" 300
example.com.       MX     "10 mail.example.com."         3600
</code></pre></div></div>

<p>Some notes on this file:</p>

<ul>
  <li><strong>TTL</strong> means “time to live”. It is the number of seconds a resolver can keep the answer before it asks again.</li>
  <li>The dot at the end of a name (<code class="language-plaintext highlighter-rouge">example.com.</code>) means “this is the full name”. It is how DNS writes names.</li>
  <li><strong>MX</strong> has two parts: a priority number and the mail server. Put them in quotes, so the server reads them as one value.</li>
  <li><strong>SOA</strong> means “start of authority”. It is the main info about the domain: the main nameserver, the admin email (with a <code class="language-plaintext highlighter-rouge">.</code> in place of the <code class="language-plaintext highlighter-rouge">@</code>), and a serial number. When the records change, the serial number goes up. Second nameservers use this number to know when to copy the records again.</li>
</ul>

<p>When the server starts, it reads this file into a Go map: name to list of records. So each question is just one map lookup. No database.</p>

<h2 id="running-it">Running it</h2>

<p><strong>1. Start the server</strong></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>git clone https://github.com/vimarsh244/dns
</code></pre></div></div>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code><span class="nb">cd </span>dns <span class="o">&amp;&amp;</span> <span class="nb">sudo </span>go run <span class="nb">.</span>
</code></pre></div></div>

<p>You need <code class="language-plaintext highlighter-rouge">sudo</code> only for port 53. By default, the port is 8053, for testing. You can change it in <code class="language-plaintext highlighter-rouge">main.go</code> (<code class="language-plaintext highlighter-rouge">var port int16 = 8053</code>). For a real domain, set it to 53. Resolvers always ask on port 53.</p>

<p><strong>2. Test it with dig</strong></p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dig @127.0.0.1 <span class="nt">-p</span> 8053 example.com A
</code></pre></div></div>

<p>The answer looks like this:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>;; flags: qr aa; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; ANSWER SECTION:
example.com.		300	IN	A	192.0.2.10
</code></pre></div></div>

<p><code class="language-plaintext highlighter-rouge">qr</code> means “this is an answer”. <code class="language-plaintext highlighter-rouge">aa</code> means “authoritative answer”. That is my server saying “trust me, this is the real one”.</p>

<p>The wildcard also works. Any name under <code class="language-plaintext highlighter-rouge">dev.example.com</code> gets the same IP:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>dig @127.0.0.1 <span class="nt">-p</span> 8053 anything.dev.example.com A +short
</code></pre></div></div>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>192.0.2.20
</code></pre></div></div>

<p><strong>3. Open the admin page</strong></p>

<p>First, make a password. This saves a hashed (scrambled) copy of the password, not the password itself:</p>

<div class="language-bash highlighter-rouge"><div class="highlight"><pre class="highlight"><code>go run helper/pass.go yourpassword <span class="o">&gt;</span> admin.pass
</code></pre></div></div>

<p>Then restart the server and open <code class="language-plaintext highlighter-rouge">http://localhost:3000</code>. The user name is <code class="language-plaintext highlighter-rouge">admin</code>. On this page you can add and delete records. Each change is saved to <code class="language-plaintext highlighter-rouge">zone.txt</code> right away.</p>

<p><strong>4. Use it for a real domain</strong></p>

<ul>
  <li>Run it on a server with a public IP address.</li>
  <li>Open port 53 for UDP and TCP in the firewall.</li>
  <li>At your domain registrar, set the nameservers of your domain to your server.</li>
</ul>

<p>p.s. Most registrars ask for at least two nameservers. And if one server is down, your whole domain is down. Keep this in mind.</p>

<h2 id="analytics">Analytics</h2>

<p>I wanted to know how many people (or bots) ask for my domains. So each question is written to <code class="language-plaintext highlighter-rouge">analytics.log</code> as one line of JSON:</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>{"type":"request","name":"www.vimarsh.cc CNAME IN","timestamp":"2025-07-18T07:48:26.359834317Z"}
</code></pre></div></div>

<p>There are three types: <code class="language-plaintext highlighter-rouge">request</code> (every question), <code class="language-plaintext highlighter-rouge">notfound</code> (no record for that name), and <code class="language-plaintext highlighter-rouge">error</code> (bad packet). When I open the admin page, the server reads the whole file and counts the lines for the last 24 hours, 7 days and 30 days.</p>

<p>This is very simple, and it will get slow when the file gets a few MB. But it works for now.</p>

<h2 id="zone-transfer-axfr">Zone transfer (AXFR)</h2>

<p>A zone transfer is how a second nameserver copies all records from the first one. The second server connects over TCP and asks for everything. My server sends the <code class="language-plaintext highlighter-rouge">SOA</code> record, then all the records, then the <code class="language-plaintext highlighter-rouge">SOA</code> record again to mark the end.</p>

<p>This part mostly works. But there is supposed to be a check before sending: both servers share a secret key, and each message is signed with it (this is called TSIG). That check does not work yet. For now, only IP addresses on an allow list (in <code class="language-plaintext highlighter-rouge">main.go</code>) can ask for a transfer.</p>

<h2 id="what-does-not-work-yet">What does not work (yet)</h2>

<ul>
  <li><strong>Answer size:</strong> over UDP, one answer can be at most 512 bytes. Very long <code class="language-plaintext highlighter-rouge">TXT</code> records will get cut. Normal questions over TCP are not done yet. TCP is only for zone transfers.</li>
  <li><strong>Wildcards:</strong> they work, but the code is patch upon patch. It is not a good way to do it, but only I use it, so it is fine?</li>
  <li><strong>Names that do not exist:</strong> the server sends an empty answer. A proper server sends a clear “this name does not exist” reply (called <code class="language-plaintext highlighter-rouge">NXDOMAIN</code>).</li>
  <li><strong>More record types:</strong> no <code class="language-plaintext highlighter-rouge">PTR</code> and <code class="language-plaintext highlighter-rouge">SRV</code> records. I will most likely not add them. <code class="language-plaintext highlighter-rouge">TXT</code> records are enough for most domain checks now.</li>
  <li><strong>Analytics:</strong> the log file only grows. It is never cleaned up.</li>
</ul>

<h2 id="conclusion">Conclusion</h2>

<p>Overall I am pretty happy with it. At its core, DNS is old and simple: small packets, names written as length plus letters, and a few flags. The hard part is all the special cases: CNAME rules, wildcards, size limits, zone transfers. I found each of these one by one, as I read the RFCs (the documents that define how DNS works). That is why the code is patch upon patch.</p>

<p>I would not run a business domain on this. For that, just use Cloudflare or the DNS of your registrar. But if you want to really understand DNS, writing a small server yourself is the best way I found. It is about 1,600 lines of Go, and you can read all of it in one evening.</p>

<p>Next, I want to add TCP for normal questions, a proper “does not exist” reply, and the TSIG key check.</p>

<p>p.s. I was too lazy to write this blog post. So Claude did heavy changes to my draft and finished the writing.</p>]]></content><author><name>Vimarsh</name></author><category term="Blog" /><category term="DNS" /><category term="DNS" /><category term="go" /><category term="server" /><category term="self hosting" /><summary type="html"><![CDATA[I wrote my own authoritative DNS server in Go, with no DNS library. This post explains what it does, how it works inside, and how to run it.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/uploads/2025/07/dns/dns-lookup-flow.svg" /><media:content medium="image" url="https://vimarsh.cc/uploads/2025/07/dns/dns-lookup-flow.svg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">early thoughts &amp;amp; experiments on generative ai</title><link href="https://vimarsh.cc/blog/gen-ai-thoughts-early/" rel="alternate" type="text/html" title="early thoughts &amp;amp; experiments on generative ai" /><published>2023-04-02T12:00:00+00:00</published><updated>2023-04-02T12:00:00+00:00</updated><id>https://vimarsh.cc/blog/gen-ai-thoughts-early</id><content type="html" xml:base="https://vimarsh.cc/blog/gen-ai-thoughts-early/"><![CDATA[<p><img src="/uploads/gen-ai-images/f23efeb1-bfb8-4f48-a1a9-622fd2b973fb_1024x1024.png" alt="AI generated image" /></p>

<h2 id="financegpt">FinanceGPT</h2>
<hr />

<p>This week, I made a quick <a href="https://devfolio.co/projects/financegpt-d127">website</a> where you can query financial records of a publicly traded company, in natural language and get an accurate response. We made this as part of <a href="https://code-by-the-beach.devfolio.co/">Quark Code by the Beach Hackathon</a> in &lt;30 hours. <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>t</mi><mi>r</mi><mi>y</mi><mi>i</mi><mi>t</mi><mi>o</mi><mi>u</mi><mi>t</mi><mo stretchy="false">[</mo><mi>h</mi><mi>e</mi><mi>r</mi><mi>e</mi><mo stretchy="false">]</mo><mo stretchy="false">(</mo><mi>h</mi><mi>t</mi><mi>t</mi><mi>p</mi><mi>s</mi><mo>:</mo><mi mathvariant="normal">/</mi><mi mathvariant="normal">/</mi><mi>f</mi><mi>i</mi><mi>n</mi><mi>a</mi><mi>n</mi><mi>c</mi><mi>e</mi><mi>g</mi><mi>p</mi><mi>t</mi><mi>v</mi><mn>0.</mn><mi>v</mi><mi>i</mi><mi>m</mi><mi>a</mi><mi>r</mi><mi>s</mi><mi>h</mi><mi mathvariant="normal">.</mi><mi>c</mi><mi>o</mi><mi mathvariant="normal">/</mi><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">try it out [here](https://financegptv0.vimarsh.co/)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.03588em;">ry</span><span class="mord mathnormal">i</span><span class="mord mathnormal">t</span><span class="mord mathnormal">o</span><span class="mord mathnormal">u</span><span class="mord mathnormal">t</span><span class="mopen">[</span><span class="mord mathnormal">h</span><span class="mord mathnormal">ere</span><span class="mclose">]</span><span class="mopen">(</span><span class="mord mathnormal">h</span><span class="mord mathnormal">ttp</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">//</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">inan</span><span class="mord mathnormal">ce</span><span class="mord mathnormal" style="margin-right:0.03588em;">g</span><span class="mord mathnormal">pt</span><span class="mord mathnormal" style="margin-right:0.03588em;">v</span><span class="mord">0.</span><span class="mord mathnormal" style="margin-right:0.03588em;">v</span><span class="mord mathnormal">ima</span><span class="mord mathnormal">rs</span><span class="mord mathnormal">h</span><span class="mord">.</span><span class="mord mathnormal">co</span><span class="mord">/</span><span class="mclose">)</span></span></span></span></span></p>

<p><img src="/uploads/gen-ai-images/13982e0f-5cc3-4cb9-905e-0d324308fdc0_1299x966.jpeg" alt="Screenshot of app" /></p>

<p><strong>brief on how it works?</strong></p>

<p>If you directly ask ChatGPT any such question it is not going to be able to answer the question, and if it does, it will hallucinate random numbers. So how can we approach this?</p>

<p>We already know that ChatGPT is quite good at answering questions as a conversation, it just doesn’t know what to answer. So what if we give it a <em>context</em> of the relevant information and ask it to answer absolutely just based on that information provided. This raises the question of what question to provide? All publicly listed companies publish their annual reports which are easily <a href="https://www.bseindia.com/stock-share-price/tata-consultancy-services-ltd/tcs/532540/financials-annual-reports/">accessible</a>, and we just have to figure out a way to give ChatGPT the write context. This can be achieved in better way using Semantic Search.</p>

<p><strong>Semantic Search</strong></p>

<p>Let’s say you want to ask it about what was the amount of coal that passed through all ports operated by Adani Ports. If you just search the keywords in annual report,<br />
i. the results contain just too many references to coal<br />
ii. the types of coal that the ports can handle<br />
A simple search would return (most times) irrelevant and broad results.</p>

<p>Or for example, if you were looking games with the name “Star Wars: Battlefront”, a normal search could only find you results that match exactly that phrase. However, a semantic search could find you other games in the same genre or with similar themes. For example, it could find you “StarCraft: Legacy of the Void” or “Halo: Combat Evolved”. This type of search helps identify related items that may not have been known or expected, improving the accuracy and speed of the search.</p>

<p>So how to address it? Basically we can convert all reference text as vectors in a space. The way these vectors will be given their values depending on how similar they are, how similar the context where it is present is, etc. Now whenever we get a query, we can convert that query to a vector in that same space, and figure out the which vectors are closest to that vector. And this would give us the closest set of texts that could answer the query the user asks.</p>

<blockquote>
  <p><strong>How do embeddings work?</strong></p>

  <p>Embeddings compress discrete information (words &amp; symbols) into distributed continuous-valued data (vectors). If we took some phrases from and plot them on a chart, it might look something like this:</p>
</blockquote>

<blockquote>
  <p><img src="/uploads/gen-ai-images/7034ff51-2d9a-4267-b593-f3a94223cded_3348x2456.png" alt="Vector similarity" /></p>

  <p>source: https://supabase.com/blog/openai-embeddings-postgres-vector</p>
</blockquote>

<p>Now after taking out the similar parts, we query ChatGPT to answer the question precisely and in natural language. I won’t go into much more details, but wanted to share the part about semantic search as I found that fascinating. You can look at <a href="https://github.com/vimarsh244/finance-gpt">GitHub Repo</a> for more info.</p>

<p><img src="/uploads/gen-ai-images/c9aac5ff-7c19-4bf1-b9f9-992dc9bd7826_886x499.png" alt="Image" /></p>

<hr />

<h2 id="interesting-things">Interesting Things</h2>

<p>Here is a collection of projects / ideas I found interesting this week:</p>

<ul>
  <li>
    <p>On GPT4: A lot of people say that LLMs are nothing but text prediction; which I think is fair. but..<br />
”it means that you understand the underlying reality that led to the creation of that token” (<a href="https://twitter.com/bio_bootloader/status/1640512444958396416">@ilyasut</a>)</p>
  </li>
  <li>
    <p>Google research released a new model for visual identification from images (screenshots specifically) and its apparently <a href="https://twitter.com/abacaj/status/1641258677125410820">really good</a> at solving captchas. (try it out <a href="https://huggingface.co/google/pix2struct-base">here</a>)</p>

    <p>Advancements like this and with text being produced by GPT4 (being so much better than humans) it is and will be getting difficult to differentiate humans from bots. It will be almost as if that without data &amp; fingerprinting techniques by those of Google / Cloudflare it will be impossible to determine human / not.</p>
  </li>
  <li>
    <p>You can <a href="https://download-directory.github.io/">download</a> specific folders from Github (not directly)</p>
  </li>
  <li>
    <p>Run ChatGPT-like models <a href="https://github.com/ggerganov/llama.cpp">locally</a> on your CPU</p>
  </li>
  <li>
    <p>Run Deep Learning models <a href="https://github.com/visheratin/web-ai">in your browser</a> (based on WASM)</p>
  </li>
</ul>

<p><a href="https://ciechanow.ski/bicycle/">Bicycle by Bartosz Ciechanowski</a></p>

<p>Matt Henderson @matthen2
<a href="https://twitter.com/matthen2/status/1642236406465454082?s=20">to tell if a maze is solvable, just hang it by its corners! The first maze stays in one piece, so there is no path from the entrance at the top to the exit at the bottom. The second maze splits apart along the solution.
</a></p>

<p>Tony Z. Zhao @tonyzzhao
<a href="https://twitter.com/tonyzzhao/status/1640393026341322754?s=20">Introducing ALOHA 🏖: 𝐀 𝐋ow-cost 𝐎pen-source 𝐇𝐀rdware System for Bimanual Teleoperation After 8 months iterating @Stanford and 2 months working with beta users, we are finally ready to release it! Here is what ALOHA is capable of:</a></p>

<p>Georgi Gerganov @ggerganov
<a href="https://twitter.com/ggerganov/status/1642115206544343040">Announcing the Local LLaMA podcast 🎙️🦙 In today’s episode we have LLaMA, GGaMA, SSaMA and RRaMA joining us to discuss the future of AI</a></p>]]></content><author><name>Vimarsh</name></author><category term="Blog" /><category term="AI" /><category term="Project" /><summary type="html"><![CDATA[A quick overview of my latest project FinanceGPT, a semantic search based financial query system.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/uploads/gen-ai-images/f23efeb1-bfb8-4f48-a1a9-622fd2b973fb_1024x1024.png" /><media:content medium="image" url="https://vimarsh.cc/uploads/gen-ai-images/f23efeb1-bfb8-4f48-a1a9-622fd2b973fb_1024x1024.png" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Information, Bandwidth, and Trust</title><link href="https://vimarsh.cc/blog/information-bandwidth-and-trust/" rel="alternate" type="text/html" title="Information, Bandwidth, and Trust" /><published>2022-05-30T00:00:00+00:00</published><updated>2022-05-30T00:00:00+00:00</updated><id>https://vimarsh.cc/blog/information-bandwidth-and-trust</id><content type="html" xml:base="https://vimarsh.cc/blog/information-bandwidth-and-trust/"><![CDATA[<p><img src="/from-temperory-writefreely-blog/Godel-Escher-Bach-edriverrun-05%20--%20book%20cover.jpg" alt="Cover from book - Godel, Escher, Bach \ Showing how the real thing when presented from different sides shows different information \ The process of piecing together this information is Knowledge" /></p>

<p>In today’s increasingly connected world, there arises a big question of whether all these developments are hampering Human creativity or not. So, does these advancements and constant pursuit for more information and dependence on technology hamper our creativity?</p>

<h2 id="premise">Premise</h2>

<p>I truly believe that what we are limited by is not constraints of resources (although in the short term – yes) but rather by our ability to become more knowledgeable species. This post <a href="https://tokcast-bretthall-31ddc0.netlify.app/2022/03/are-we-running-out-of-resources/">“Are we running out of resources?”</a> gives a great logical justification on why, even if we are – our knowledge and skills will greatly improve using those resources.</p>

<blockquote>
  <p>Resources are not limited. Only human knowledge is limited. Should any particular resource begin to run short, our creativity will bring into being the knowledge of how to replace that resource from either some other source or by using some other means to accomplish what that resource did.</p>
</blockquote>

<p>With shortage of coal / petroleum we are coming up with better greener energy sources. With production of cement being more and more resource intensive; new materials and designs are in making for constructing buildings in a greener &amp; safer way.</p>

<h3 id="the-now-is-the-future">The now is the future</h3>

<p>We always think the next year, decade, century is the most important for deciding our future. People predicted the collapse of modern society as coal will run out; the worry for the rebuild after world war to fail. The people in 17-1800s thought their time to be crutial in defining the future of modern world based on science and experiments. The Greeks thought how significant their philosophy was to define the future and so on. In fact, the current state of humanity is not due to one such advancement, but a compounding effect of all of them.</p>

<p>This is about knowledge. It’s the ‘truth’ now how it is shared and conveyed is what I call “Information”. <em>The process of piecing together this information is Knowledge</em>.</p>

<p><img src="/from-temperory-writefreely-blog/anton-maksimov-5642-su-vtbgoLMPeG4-unsplash.jpg" alt="Information flowing through fiber optics cables" /></p>

<p>Me stating that tomorrow will be a rainy day is a piece of information. It’s not knowledge – it is the condensed form of knowledge used to determine that condition. And most of the time that information is more than sufficient.</p>
<ul>
  <li>The problems occur when that information is taken as enlightened knowledge and further drained / condensed.</li>
</ul>

<h2 id="tech-and-humans">Tech and Humans</h2>

<p>It’s known that technology widely influences human behavior and culture. AI has been <a href="https://royalsocietypublishing.org/doi/10.1098/rsta.2020.0426">shown</a> to make its own interpretation of culture from its learning, and that is being passed on to us. Chess players have for the last couple of years used <a href="https://stockfishchess.org/">engines</a> to find out new ideas about playing chess – new patterns/openings/insights never known before.</p>

<p>All the advancements in language modelling seem worrying, but are a new phase of the age of information. Image generation models like <a href="https://openai.com/dall-e-2/">DALLE2</a> &amp; <a href="https://imagen.research.google/">imagen</a> will be groundbreaking when polished a little more in giving the ability to people to condense information in a single glimpse-able data point (aka a picture).</p>

<p>We as humans should be taking advantage of these technologies to communicate with each other in better ways. The power of language, communication &amp; collaboration is what made us (humans), come such a far way. This will enhance it.</p>

<p><img src="/from-temperory-writefreely-blog/pawel-nolbert-4u2U8EO9OzY-unsplash.jpg" alt="Vastly connected world - sky view of a city at night with lights in buildings and vehicles buzzing around" /></p>

<h2 id="-bandwidth">📈📈 Bandwidth</h2>

<p>The age of information according to me started when we were able to communicate with each other. First via paintings and emotion—slowly via the use of a common language. We had wheels to help move around faster – coordinate faster, build weapons, machinery faster. Then came trains, automobile, telegraph, planes, and the internet. With each advancement (however miniscule it may seem) there was an apparent increase in bandwidth of spreading information.</p>

<p>This ‘bandwidth’ soon will increase to an extent of being together (with AR/VR) while using the power of highly advanced art designing tools, coding tools and more. Human-brain interfaces will be the pinnacle of it when we are able to communicate faster than what we can speak at. We will directly able to share thoughts at an insane speed.</p>

<h2 id="trust">Trust</h2>

<p>The foundation that all these systems rely on is trust. Trusting the party who is sharing with you the information, trusting the source, and your own tools receiving it. <em>When information is in highly condensed form, there is no knowledge about its original truth.</em> And when that information is blasted to us on our screens, our eyes, our brains it will be extremely trivial to understand the real knowledge rather than just those few frames we are flashed with.</p>

<p>Sometimes the flow of information deliberately needs to be slow. There needs to be space for interpretation.</p>

<h2 id="so">So…</h2>

<p>These were just some random thoughts I had on how we have evolved our information game and more importantly why sometimes not relying just on information is super important. <em>With every form of transmission, we are losing a bit of information</em>; so our focus should be on gaining knowledge rather than just sharing information.</p>

<p><img src="/from-temperory-writefreely-blog/This%20is%20truth%20-%20also%20true.jpg" alt="This is Truth -- showing a cylinder-- \ also true --showing a shadow of circle and rectangle--" /></p>]]></content><author><name>Vimarsh</name></author><category term="Philosophy" /><category term="Blog" /><category term="trust" /><category term="thoughts" /><category term="philosophy" /><summary type="html"><![CDATA[A thought experiment on knowledge, our communication systems and what the future will hold with brain-machine-brain interfaces like Neuralink.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/from-temperory-writefreely-blog/Godel-Escher-Bach-edriverrun-05%20--%20book%20cover.jpg" /><media:content medium="image" url="https://vimarsh.cc/from-temperory-writefreely-blog/Godel-Escher-Bach-edriverrun-05%20--%20book%20cover.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">On Cognition and AI</title><link href="https://vimarsh.cc/blog/on-cognition-and-ai/" rel="alternate" type="text/html" title="On Cognition and AI" /><published>2022-05-25T00:00:00+00:00</published><updated>2022-05-25T00:00:00+00:00</updated><id>https://vimarsh.cc/blog/on-cognition-and-ai</id><content type="html" xml:base="https://vimarsh.cc/blog/on-cognition-and-ai/"><![CDATA[<p><a href="https://en.wikipedia.org/wiki/List_of_unsolved_problems_in_philosophy#Cognition_and_AI">Unsolved Problem</a>
<img src="/from-temperory-writefreely-blog/milad-fakurian-58Z17lnVS4U-unsplash.jpg" alt="Brain on a colourful background" /></p>

<h2 id="what-is-intelligence">What is Intelligence?</h2>
<p>Is a virus an intelligent being? Everyone knows that viruses do not have what we call “life” - they are just blobs of protein in the air, on surfaces, in other cells, and even in other viruses (yes! There are viruses for viruses). But they are intelligent - they can do their task very efficiently: to multiply and make more of them.</p>

<p>According to Wikipedia - “Intelligence has been defined in many ways: the capacity for abstraction, logic, understanding, self-awareness, learning, emotional knowledge, reasoning, planning, creativity, critical thinking, and problem-solving.” “More generally, it can be described as the ability to perceive or infer information, and to retain it as knowledge to be applied towards adaptive behaviors within an environment or context.”</p>

<p>I believe that for an entity to have the ability to replicate itself and change its methods (similar to in programming languages) to survive is a true test of being intelligent.</p>

<h2 id="what-is-consciousness-then">What is Consciousness, then?</h2>
<p>Consciousness according to me is the ability to know about one’s existence and be aware about one’s place in the immediate world. We as humans are able to communicate and work on existing throughout the world, surviving the tests of time; but say, Amoeba’s way to communicate its consciousness is probably to keep on dividing for its survival. “When you love something, you protect it.” What else can say more about being conscious than “love”. In the case of Amoeba it’s protecting its species, for us, it’s the same too (the current world affairs are a different story though). In fact, you don’t need to protect someone else, but just love yourself.</p>

<h2 id="what-makes-something-intelligent-and-conscious">What makes something intelligent and conscious?</h2>
<p>The way I like to express life in the simplest form is through <a href="https://en.wikipedia.org/wiki/Conway's_Game_of_Life">Conway’s Game of Life</a>. Its basic premise is that it will play out and move further based on just* its initial state. The initial state can be programmed in such a way to make the cells destroy themselves, reach a stable equilibrium, do things periodically, or grow. All life is basically programmed from millions of years of evolution to behave in a particular way… and so are viruses, and thus, AI can be too.</p>

<p>*→ The other criteria is - the rules of the “game”. For us, they are just rules of the universe we live in. This basically defines how these preprogrammed instructions will be executed. A coronavirus might serve as a boon for our immunity if its RNA is interpreted differently.</p>

<h2 id="on-ai-systems">On AI Systems</h2>
<p>An AI on a simplified, technical level is basically a human mind expressed in terms of matrices and vector spaces. It has inputs, a “brain” (artificial neurons, with links and weights) and output.
In fact, GPT-3 (a natural language model by OpenAI) actually for real believes it is sentient and has “plans” to protect itself in case OpenAI plans on destroying it. <a href="https://twitter.com/paulnovosad/status/1517146614648893441">Twitter Thread</a></p>

<h2 id="the-criteria-to-identify-the-presence-of-consciousness">The Criteria to identify the presence of consciousness</h2>
<p>The criteria for a third party to judge consciousness is the presence of information. The rest of it will be played out via the rules of the playground. Where there are blobs of information, the right criteria will automatically make it conscious. The fabric of the universe dictates what is conscious and what isn’t. But the basic criteria, according to me, to differentiate a conscious being from a non-conscious in Newtonian space is its ability to process its surroundings and evolve. 
These criteria can be used to explore if any being, including AI has consciousness. With its weights and knowledge and its ability to make decisions, almost any AI system (that is not just fixed algorithms) is conscious. Although, it is to note that the level and depth of its understanding of itself and the world will depend upon how much it has trained and with what.</p>]]></content><author><name>Vimarsh</name></author><category term="Thoughts" /><category term="Philosophy" /><category term="philosophy" /><category term="thoughts" /><category term="AI" /><category term="cognition" /><summary type="html"><![CDATA[This is my attempt at trying to figure out an answer to the unsolved problem on Intelligence, consciousness and identifying it.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/from-temperory-writefreely-blog/milad-fakurian-58Z17lnVS4U-unsplash.jpg" /><media:content medium="image" url="https://vimarsh.cc/from-temperory-writefreely-blog/milad-fakurian-58Z17lnVS4U-unsplash.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Running a public DNS Resolver</title><link href="https://vimarsh.cc/blog/running-a-public-dns-resolver/" rel="alternate" type="text/html" title="Running a public DNS Resolver" /><published>2022-05-10T00:00:00+00:00</published><updated>2022-05-10T00:00:00+00:00</updated><id>https://vimarsh.cc/blog/running-a-public-dns-resolver</id><content type="html" xml:base="https://vimarsh.cc/blog/running-a-public-dns-resolver/"><![CDATA[<h3 id="accessing-my-server">Accessing my Server</h3>

<p>You can access my Ad blocking DNS server via these methods:</p>
<ul>
  <li>Unsecured DNS (over port 53): <code class="language-plaintext highlighter-rouge">20.212.62.65</code></li>
  <li>DNS over HTTPS (in Chrome, Firefox, etc.): <code class="language-plaintext highlighter-rouge">https://q.vimarsh.info/dns-query</code></li>
  <li>DNS over TLS (mostly for Smartphones — you just add it in secure DNS setting): <code class="language-plaintext highlighter-rouge">q.vimarsh.info</code></li>
</ul>

<p><img src="/from-temperory-writefreely-blog/Internet%20Encryption%20-%20decor%20image.jpg" alt="Decor Image depicting Encryption inside 'Internet Pipeline'" /></p>

<h3 id="how-to">How-to</h3>

<p>We will be using <a href="https://github.com/AdguardTeam/AdGuardHome">AdGuard home</a>. It is a little overkill for just resolving DNS but.. It is super simple to set up, can block advertisements at DNS level with simple blocklists, and can easily allow configuring Encrypted DNS (which would be extremely difficult with many other solutions).</p>

<p>p.s. This is what I did, and is probably not the safest thing to do…</p>

<p>Login to whatever distro’s VM you choose (preferably Debian, Ubuntu)</p>

<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo su

curl -s -S -L https://raw.githubusercontent.com/AdguardTeam/AdGuardHome/master/scripts/install.sh | sh -s -- -v
</code></pre></div></div>
<p>After it installs, go to port 3000 and setup admin credentials. Also, setup *.your.domain.name and your.domain.domain (the one you want to use for DNS) point to the public IP address of the VM.</p>

<p>While configuring you <em>might</em> see a warning (when doing ‘All Interfaces’) that says <code class="language-plaintext highlighter-rouge">bind: address already in use</code>, see the solution <a href="https://github.com/AdguardTeam/AdGuardHome/wiki/FAQ#bindinuse">here</a>.</p>

<p>Then install <a href="https://certbot.eff.org/">certbot</a>: If using Ubuntu as your distro, it’s just <code class="language-plaintext highlighter-rouge">snap install --classic certbot</code></p>

<p>Then to issue SSL certificates for your DNS domain and its subdomain run</p>
<div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code>sudo certbot certonly --preferred-challenges=dns --preferred-chain="ISRG Root X1" --manual
</code></pre></div></div>
<p>After you enter all details, it will show the path where the certificate is stored. Enter the path for the certificate and private key on the web UI Settings &gt; Encryption Settings and enable encryption, and you are good to go!</p>

<h3 id="etc">etc</h3>

<p>I am using Microsoft Azure to host the DNS server… currently have student credits, and it should last for a year or so (hopefully). I do not guarantee the DNS server to always be up, and it could very well go down any time. Also, if you use the server, I can “in theory” track all the domains you query. Hopefully, Azure credits last through as there is no way I can find how much will it cost by end of month based on bandwidth usage, etc.</p>]]></content><author><name>Vimarsh</name></author><category term="Tech" /><category term="Tutorial" /><category term="DNS" /><category term="server" /><category term="tech" /><summary type="html"><![CDATA[Here's how - I am running an Ad-blocking public DNS resolver with support for Encrypted DNS Requests using AdGuard Home.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/from-temperory-writefreely-blog/Internet%20Encryption%20-%20decor%20image.jpg" /><media:content medium="image" url="https://vimarsh.cc/from-temperory-writefreely-blog/Internet%20Encryption%20-%20decor%20image.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">On VPN companies to store user data for 5 years</title><link href="https://vimarsh.cc/blog/on-vpn-companies-to-store-user-data-for-5-years/" rel="alternate" type="text/html" title="On VPN companies to store user data for 5 years" /><published>2022-05-07T00:00:00+00:00</published><updated>2022-05-07T00:00:00+00:00</updated><id>https://vimarsh.cc/blog/on-vpn-companies-to-store-user-data-for-5-years</id><content type="html" xml:base="https://vimarsh.cc/blog/on-vpn-companies-to-store-user-data-for-5-years/"><![CDATA[<p>So, here is everything regarding this <a href="https://www.cert-in.org.in/PDF/CERT-In_Directions_70B_28.04.2022.pdf">new directive</a>.</p>

<p>There are a lot of bad opinions but also misinformation which I will not be correcting but here is what it says. <a href="/from-temperory-writefreely-blog/CERT-In_Directions_70B_28.04.2022.pdf">Backup PDF for same</a>
First it is quite important to clear up that this is regarding cyber threats only i.e., trying to figure out threat actors for cyberattacks and overall ensuring India’s cyber well-being.</p>

<p><img src="/from-temperory-writefreely-blog/chris-yang-1tnS_BVy9Jk-unsplash.jpg" alt="A person standing in front of a display—looks like a hacked computer screen" /></p>

<h2 id="what-does-it-say">What does it say?</h2>

<p>1.. All service providers (private and government bodies) must use computer time that is derived from NTP operated by Indian research institutes (NPL, NIC). This is quite critical because all financial transactions, a simple WhatsApp message, etc. requires the clocks to be synced and in case of any disaster/war a reliance on a foreign server is not ideal. All secure communications over internet (the padlock in your browser right now) relies on accurate time, and using a local instance is crucial for sovereign security.</p>

<p>Just running my own DNS server, I got to know that my phone pings US NTP servers for time with no obvious way to change it in phone settings.</p>

<p>2.. All major organizations should report the existence of any security vulnerability or attack to CERT-In within 6 hours of identifying. Pretty reasonable, although time is a little less. Also, does ‘body corporate’ include compromise of a small-scale website operated by a small company? Clarifications would be helpful.</p>

<p>3.. The mentioned ‘service provider/intermediary/data centre/body corporate’ are required to appoint a Point of Contact personal which CERT-In would contact for getting information regarding cyber incident and help in its resolution.</p>

<p>4.. All these entities need to enable rolling logs for their systems and store it for 180 days. Which kinds of logs – IP addresses, TCP packets, type of program being run?? None of it is mentioned, making it very vague and confusing.</p>

<p>5.. Data centres, VPS providers, Public Cloud providers (AWS, GCP, etc.) &amp; VPN companies must store logs regarding user details, IP addresses allocated &amp; at what time, verifying address, contact details, email, etc. More importantly, for 5 years even after user has terminated their service!!!</p>

<p>Foremost, how will these companies like Digital Ocean, GCP,  NordVPN, ProtonVPN verify address. Will they start asking for PAN / Aadhaar details!? Secondly 5 years is a very loooong time for storing logs like these. The decision seems to be in good faith of knowing who caused a DDoS attack / credential stuffing on an important government portal, but 5 years is completely unnecessary.</p>

<p>If you are requiring for details of a security incident in 6 hours, why not follow up with just telling to store these logs for let’s say a week and hence trying to resolve issues as quickly as possible. For Public cloud providers it does make sense but VPN providers? 
People use VPNs simply to be anonymous &amp; it is not always just bad actors using it—Journalists, Reporters, even government officials need anonymity to protect themselves from internal or external actors. Trying to combat a few bad actors will hinder the safety of these people and India’s security &amp; democracy. Does it mean ISPs will be required to block IPs of VPN companies not based in India? None of it is clear and it seems to me that actions will not be taken; only time will tell.
Might write a blog on simply setting up your own VPN in a foreign jurisdiction.</p>

<p>The EU with its GDPR directive allows users to request companies (including these cloud providers) to completely delete all data once whenever they request BY LAW. And here we are allowing these companies to keep data BY LAW. It is a horrible decision and I hope it is changed.</p>

<p>6.. It’s regarding crypto - whoooo! All custodian wallet providers (coinDCX, wazirX, etc.) will be required to do KYC verification of its users and record public addresses of funds transferred to / from and more. It says – ‘… accurate information shall be
maintained in such a way that individual transaction can be reconstructed …’ All governments seem to want to do this as crypto is considered alien, although this will just scare away crypto devs to other jurisdictions hindering our own progress—yay!</p>

<h2 id="vagueness">Vagueness</h2>

<p>The entire directive is quite vague with no justifications or how it will be followed up. CERT-In does <a href="https://www.cert-in.org.in/">seem to</a> maintain CVEs, but that’s pretty much it.</p>

<p>The list of incidents for which reports must be made to include things like Data Breaches and Data leaks. This is fantastic —considering a lot of companies just hide any breach that has occurred until it gets dumped on the web. Hopefully the 6-hour reporting works!? 
But it also has weird keyword overload of Big Data, Blockchain, Artificial Intelligence for which threats seem really weird.</p>

<p>It might stop small actors DoS-ing a state government’s portal, but will not affect any big threat actor.
It also does not mention open source maintainers to comply which is good, but a lot of CVEs are for open source packages like the recent log4j or many in Mozilla Thunderbird / GitLab (currently on CERT-In’s own front page) and there is no instruction on how government bodies / contractors should treat it.</p>

<h2 id="in-conclusion">In Conclusion</h2>

<p>The directive seems to be in good faith and luckily does not mention most consumer side apps / services, which is good (except the unusual VPN thing). It also seems to be extremely vague and unenforceable until it’s some serious data breach (like of Aadhaar details or something).</p>

<p>The direction is good with asking bodies to use NTP maintained by India. Although we do need more maintainers for <a href="https://www.pool.ntp.org/zone/in">Indian NTP pool.</a>
I would rather wish there were more directives for protecting consumer data, especially from foreign nations—something like the GDPR (but without the cookie consent mess). Basically asking any company with revenues over $10 million to store data of Indian users in India.</p>

<p>They mention reporting of cyber issues, but what are the plans to address it and prevent from occurring remain unknown.</p>

<h3 id="random-thoughts">Random thoughts</h3>

<p>Also, there has been a lot of misinformation on Indian users losing privacy and government being able to request all data about what you type in G docs, and things like that. Which is simply untrue. I am not going to list and correct many such articles / forum posts / YouTube videos here.</p>

<p>It will also be very interesting on which VPN providers still do operate in India after 27 June – the no log policy will really show itself. The companies do have a lot of investments already done in marketing; will they let go off them or comply is to be seen.</p>]]></content><author><name>Vimarsh</name></author><category term="Thoughts" /><category term="Tech" /><category term="Freedom" /><category term="philosophy" /><category term="thoughts" /><category term="India" /><category term="Policies" /><summary type="html"><![CDATA[There has been a big spur in media, on social networks and forums (not in local newspapers) regarding new directive from Indian Computer Emergency Response Team (CERT-In). All the focus has been on a specific thing, being that VPN companies storing user data for 5 years.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/from-temperory-writefreely-blog/chris-yang-1tnS_BVy9Jk-unsplash.jpg" /><media:content medium="image" url="https://vimarsh.cc/from-temperory-writefreely-blog/chris-yang-1tnS_BVy9Jk-unsplash.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Running an Ethereum node on a phone</title><link href="https://vimarsh.cc/blog/running-ethereum-node-on-your-phone/" rel="alternate" type="text/html" title="Running an Ethereum node on a phone" /><published>2022-03-14T18:30:00+00:00</published><updated>2022-03-14T18:30:00+00:00</updated><id>https://vimarsh.cc/blog/running-ethereum-node-on-your-phone</id><content type="html" xml:base="https://vimarsh.cc/blog/running-ethereum-node-on-your-phone/"><![CDATA[<p>Whenever you are using a cryptocurrency to transact with someone, you are trusting the node to provide you with correct details and properly executing the trade. When using Metamask, by default you use the Ethereum node provided by <a href="https://infura.io/">infura</a>. In general they are not rogue and will not ‘scam’ you, but for several reasons you might want to run your own node.</p>

<p><img src="/uploads/2022/06/ethereum-on-a-computer-decor-image-by-kanchanara.jpg" alt="Ethereum coin on computer (decor image)" /></p>

<h2 id="these-reasons">These reasons:</h2>

<ul>
  <li>Infura (or some other provider) might be legally asked to not server users in your region. This supposedly happened with users in Venezuela. But this yields massive power, where you could just not be able to send your Ethereum or make it a hassle.</li>
  <li>Nodes might be hacked and exploited, reporting you wrong details and so forth.</li>
  <li>There is a massive trust you need to keep with these node providers (be it Coinbase wallet, Metamask, etc.) kinda defeating purpose of not relying on a third party.</li>
</ul>

<h2 id="solution">‘Solution’</h2>

<p><em>Just run your own node.</em> This unfortunately is quite difficult for most people. Ethereum requires 500 GB+ in storage, good internet connection and a decent machine. People don’t have that nor do they carry it with them. Ethereum hence provides an option with its geth client called “light” sync mode. A light node basically, stores the headers of all blocks. It can verify the validity all of the data against the roots in the chain. For everything else (like requesting data, sending a transaction, executing a smart contract, signing a transaction, etc) it contacts a full node and asks the node to do it for you. If a node goes rogue, then based on the changes of Merkle tree, it will invalidate the chain.</p>

<p>This basically provides you with ability to personally verify whatever these node providers are saying, with several sources of information and use the chain. With zK-SNARKS this could be taken to a whole new trustless model, which is already <a href="https://eprint.iacr.org/2021/1657.pdf">being researched</a> on.</p>

<p>You can <a href="https://ethereum.org/en/developers/tutorials/run-light-node-geth/">simply</a> run a light node on your PC, without a lot of problem. But, what if you run it on your phone…</p>

<h2 id="running-ethereum-light-node-on-an-android-phone">Running Ethereum light node on an android phone</h2>

<ul>
  <li>Install termux from <a href="https://f-droid.org/en/packages/com.termux/">fdroid</a> on your Android phone. If you are using a closed platform <em>iOS</em>, well get an open one.</li>
  <li>
    <p>To make your life easier, you could access your phone via SSH from your laptop and run from there. (This is mostly for my reference though, could be useful) <a href="https://wiki.termux.com/wiki/Remote_Access">details</a></p>

    <div class="language-plaintext highlighter-rouge"><div class="highlight"><pre class="highlight"><code># Installing openSSH
  
pkg install openssh
  
# Get the username
  
whoami
  
# Setup a password
  
passwd
  
# Get IP address of your phone
  
ifconfig
  
# Run openSSH server
  
sshd
  
# It will be running and accessible on &lt;ip-address&gt;:8022 by default
</code></pre></div>    </div>
  </li>
  <li>Install geth Termux maintains a latest <a href="https://github.com/termux/termux-packages/tree/master/packages/geth">packaged</a> copy of geth, which you can install simply by <code class="language-plaintext highlighter-rouge">pkg install geth</code></li>
  <li>Run the light node <code class="language-plaintext highlighter-rouge">geth --syncmode "light" --http</code> <a href="https://geth.ethereum.org/docs/interface/command-line-options">details for CLI options</a></li>
</ul>

<p>geth will start syncing the node, although it won’t take time and will consume way less space. You can now add <a href="http://127.0.0.1:8545/">http://127.0.0.1:8545</a> as a new RPC endpoint on your Metamask app on phone. One could also use something like <a href="https://github.com/fatedier/frp">fast reverse proxy</a> to access it remotely by tunneling it via a VPS.</p>

<h2 id="ummm">ummm…</h2>

<p>Here you are still trusting the nodes from where your light node is syncing data from to provide you with correct data. Very often then not only a few nodes will be shown connected and those which you are syncing with. So verifying the state is still important, but this reduces the chances of any of above mentioned problems.</p>

<p>Thanks to <a href="https://krishpatel.cc/">Krish</a> and <a href="https://aryantiwari.com/">Aryan</a> for helping with this post.</p>]]></content><author><name>Vimarsh</name></author><category term="Tutorial" /><category term="Crypto" /><category term="Tech" /><category term="Running a node" /><category term="Crypto" /><category term="Ethereum" /><summary type="html"><![CDATA[Whenever you are using a cryptocurrency to transact with someone, you are trusting the node to provide you with correct details and properly executing the trade. When using Metamask, by default you use the Ethereum node provided by infura. In general they are not rogue and will not ‘scam’ you, but for several reasons you might want to run your own node.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/uploads/2022/06/ethereum-on-a-computer-decor-image-by-kanchanara.jpg" /><media:content medium="image" url="https://vimarsh.cc/uploads/2022/06/ethereum-on-a-computer-decor-image-by-kanchanara.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">Running your own email server</title><link href="https://vimarsh.cc/blog/running-your-own-email-server/" rel="alternate" type="text/html" title="Running your own email server" /><published>2022-02-10T18:30:00+00:00</published><updated>2022-02-10T18:30:00+00:00</updated><id>https://vimarsh.cc/blog/running-your-own-email-server</id><content type="html" xml:base="https://vimarsh.cc/blog/running-your-own-email-server/"><![CDATA[<h2 id="why-would-someone-need-that">Why would someone need that?</h2>

<p>There already exists several established players for simply sending and receiving emails, but there could be reasons why you would want to host your own: – Privacy If you are dealing with financial data, or in general don’t want Google, Microsoft, etc. to snoop in over your emails – Several Users If you have more than a couple users on your domain name, hosting emails gets expensive, and that too quickly. Hosting it on your local server or a VPS is much cheaper than paying for GSuite if not using its other services. – Control The Internet is becoming quite centralized especially with messaging (WhatsApp, Signal, iMessage, etc.). Email by its virtue is meant to be distributed making it ideal for messaging. <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>W</mi><mi>i</mi><mi>l</mi><mi>l</mi><mi>t</mi><mi>a</mi><mi>l</mi><mi>k</mi><mi>a</mi><mi>b</mi><mi>o</mi><mi>u</mi><mi>t</mi><mi>e</mi><mi>n</mi><mi>c</mi><mi>r</mi><mi>y</mi><mi>p</mi><mi>t</mi><mi>i</mi><mi>o</mi><mi>n</mi><mi>f</mi><mi>u</mi><mi>r</mi><mi>t</mi><mi>h</mi><mi>e</mi><mi>r</mi></mrow><annotation encoding="application/x-tex">Will talk about encryption further</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">Wi</span><span class="mord mathnormal">llt</span><span class="mord mathnormal">a</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal">kab</span><span class="mord mathnormal">o</span><span class="mord mathnormal">u</span><span class="mord mathnormal">t</span><span class="mord mathnormal">e</span><span class="mord mathnormal">n</span><span class="mord mathnormal" style="margin-right:0.03588em;">cry</span><span class="mord mathnormal">pt</span><span class="mord mathnormal">i</span><span class="mord mathnormal">o</span><span class="mord mathnormal">n</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">u</span><span class="mord mathnormal" style="margin-right:0.02778em;">r</span><span class="mord mathnormal">t</span><span class="mord mathnormal">h</span><span class="mord mathnormal" style="margin-right:0.02778em;">er</span></span></span></span></span></p>

<p><img src="/uploads/2022/06/stephen-phillips-hostreviews-co-uk-3mhgvrk4tjm-unsplash.jpg" alt="Gmail's UI on a laptop screen" /></p>

<h2 id="choosing-an-email-server">Choosing an email server</h2>

<p>Upon quick googling we can find that there are <a href="https://github.com/awesome-selfhosted/awesome-selfhosted#communication---email---complete-solutions">several email server solutions</a>. Basically a complete package that is easy to run and maintain. After a lot of testing of different solutions and checking feature parity, I decided on using <a href="https://github.com/ddavness/power-mailinabox">Power Mail-in-a-Box</a> {a fork of <a href="https://mailinabox.email/">Mail-in-a-box</a> — an already popular solution} for setting it up for a business. A couple of reasons for choosing it, over several others:</p>

<ul>
  <li>Supports Ubuntu 20.04, Debian 10/11 out of the box. This means that at least for several years, no major upgrades or maintenance will be needed.</li>
  <li>Pretty lightweight: can run on a 1 core CPU with 1 GB ram (a cheap Digital Ocean VM)</li>
  <li>Supports email routing, aliases, email forwarding, etc.</li>
  <li>Has support for an external SMTP relay. As you might know, a lot of Cloud providers and ISPs block port 25 (for outgoing email) or the IP is already blacklisted. Getting a clean IP, and convincing your ISP to setup <a href="https://mailinabox.email/guide.html#:\~:text=option%2C%20disable%20it.-,Reverse%20DNS,the%20reverse%20DNS%20of%20your%20box%20to%20your%20box%E2%80%99s%20hostname.,-If%20you%20are">reverse DNS</a> is super difficult. <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mi>m</mi><mi>o</mi><mi>r</mi><mi>e</mi><mi>o</mi><mi>n</mi><mi>t</mi><mi>h</mi><mi>i</mi><mi>s</mi><mi>l</mi><mi>a</mi><mi>t</mi><mi>e</mi><mi>r</mi></mrow><annotation encoding="application/x-tex">more on this later</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:0.6944em;"></span><span class="mord mathnormal">m</span><span class="mord mathnormal">oreo</span><span class="mord mathnormal">n</span><span class="mord mathnormal">t</span><span class="mord mathnormal">hi</span><span class="mord mathnormal">s</span><span class="mord mathnormal" style="margin-right:0.01968em;">l</span><span class="mord mathnormal">a</span><span class="mord mathnormal">t</span><span class="mord mathnormal" style="margin-right:0.02778em;">er</span></span></span></span></span></li>
  <li>Support for OpenPGP based native email encryption.</li>
  <li>Allowing to set up usage quotas for different users.</li>
  <li>Support for backup natively via rsync, Back blaze, locally and also on S3 storage.</li>
  <li>Has support for calendar and contacts sync. Also has built in Nextcloud for users to store some files and share.</li>
</ul>

<p>P.S. By default, all emails sent to the same domain are just routed internally.</p>

<h2 id="hosting">Hosting</h2>

<p>There are several ways to host your email server. The best is to just repurpose any old system, with a replaced drive, adding ram, etc.</p>

<p><strong>An old system’s specs which I tested everything on</strong> – An Old system with intel i3-2100 or something – 6 GB DDR3 RAM – 500 GB WD Blue SSD (~60 USD) //added extra</p>

<p>You can also deploy on a cloud provider, which I did for the business this was set up for. I recommend <a href="https://m.do.co/c/32b907edbd54">Digital Ocean (affiliate link)</a> simply because it’s super simple, doesn’t block ports and setting up reverse DNS is just as simple as renaming your VM. Although you need to get lucky with an IP that is not blacklisted.</p>

<h2 id="setting-everything-up">Setting everything up</h2>

<p>After installing the OS, setting it up is literally super simple. Follow the steps on the <a href="https://github.com/ddavness/power-mailinabox#installation">GitHub readme</a>. You will need to configure port forwarding on your router if hosting locally or in your cloud provider’s firewall settings.</p>

<p>I would <strong>not</strong> recommend setting up your box as the DNS server, because if it goes down, your website and even other services will not be accessible publicly. I would hence recommend just copying all records shown and adding it to your DNS server (Cloudflare, Route 53, etc.)</p>

<p><img src="/uploads/2022/06/external-dns-power-mailinabox.png" alt="Setup DNS on an external provider" /></p>

<p>You might not want to open outgoing ports or if ISP might be blocking outgoing email ports (esp. 25), continue reading ahead for a simple solution.</p>

<h2 id="email-deliverability-and-smtp-relays">Email Deliverability and SMTP relays</h2>

<p>There are several reasons why your emails will be ending up in spam. In fact, you might not even be able to send emails if your ISP is blocking specific ports. For these reasons, SMTP relays come into play.</p>

<p>Basically all your emails from your server are sent to another service which then delivers the email from their servers, which are not blacklisted, ensuring perfect delivery. The emails someone else sends are still delivered to your mailinabox; just sending is handled by such an SMTP relay.</p>

<p>There are several services like AWS SES, Sendgrid, etc. but I really liked <a href="https://www.zoho.com/zeptomail/">Zoho ZeptoMail</a> due to its simple pricing (~ $2 for 10,000 emails), amazing email delivery, and very good customer support which approved our account fairly quickly. There are also several free services like Sendinblue, Mailazy, etc. if sending very few emails/day. After you make an account, setup the required DNS records for your domain; you can configure it in the admin interface as shown below:</p>

<p><img src="/uploads/2022/06/setting-up-smtp-relay.png" alt="PowerMail-in-a-box configure SMTP relay" /></p>

<h2 id="encryption">Encryption</h2>

<p>As I alluded to earlier, you might want privacy and prevent Tech Giants, ISPs from snooping in on your emails. There exists simple solutions like <a href="https://protonmail.com/">Proton mail</a> to encrypt your emails end-to-end but self-hosting email takes it to another level. Power Mail-in-a-box supports OpenPGP based email encryption and decryption in Roundcube (webmail) itself. It basically ensures that no one can read an email which is sent to you with your public key, and the emails you send could also be encrypted and signed to prove that they are not spoofed. Pretty cool!</p>

<h2 id="conclusion">Conclusion</h2>

<p>Even though I set this up for a business because the <a href="https://support.google.com/a/answer/60217">free GSuite days are coming to an end</a>, I would not do it for myself. Managing infrastructure is still work, even though mail-in-a-box basically requires almost zero maintenance after everything is configured. For me, I just use Zoho Mail which gives 5 GB free for 5 users on a custom domain, which is generous for individuals &amp; family.</p>

<p>But, for small sized organisations or just for having some fun, this is a legitimate and extremely simple way to set up a mail server. With SPF, DKIM records properly configured and using a relay, even email deliverability is not an issue. The install which I did has been stable and running for a month almost. I will highly recommend setting up backup — its super simple. It supports rsync directly to another remote machine via SSH keys, and it can be configured via the web admin interface itself.</p>

<p>Thanks to <a href="https://aryantiwari.com/?utm_source=vimarsh">Aryan</a> for reviewing this article</p>]]></content><author><name>Vimarsh</name></author><category term="Self Hosting" /><category term="Tutorial" /><category term="self hosting" /><category term="email" /><category term="tutorial" /><category term="tech" /><category term="server" /><summary type="html"><![CDATA[Email was one of the earliest services for communication via the internet. But, hosting such a simple service is quite complicated nowadays. In this post I have documented how I set up an email server for a business quickly and easily.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/uploads/2022/06/stephen-phillips-hostreviews-co-uk-3mhgvrk4tjm-unsplash.jpg" /><media:content medium="image" url="https://vimarsh.cc/uploads/2022/06/stephen-phillips-hostreviews-co-uk-3mhgvrk4tjm-unsplash.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">This website is hosted on a Raspberry Pi</title><link href="https://vimarsh.cc/blog/this-website-is-hosted-on-a-raspberry-pi/" rel="alternate" type="text/html" title="This website is hosted on a Raspberry Pi" /><published>2022-01-24T18:30:00+00:00</published><updated>2022-01-24T18:30:00+00:00</updated><id>https://vimarsh.cc/blog/this-website-is-hosted-on-a-raspberry-pi</id><content type="html" xml:base="https://vimarsh.cc/blog/this-website-is-hosted-on-a-raspberry-pi/"><![CDATA[<p>Update: This website is now hosted on a server on Oracle Cloud. RPi was being slow.<br />
 This website, the exact one you are reading right now is hosted on a Raspberry Pi (RPi) that too the original RPi B. In this post I will document why I did that and how.</p>

<p><img src="/uploads/2022/06/hostedonrpi-rev1.jpg" alt="The hardworking Raspberry Pi B" /></p>

<h2 id="the-stack">The Stack</h2>

<ul>
  <li>Writefreely //the blogging platform I am using. Extremely simple, minimal, not even images, with markdown support.</li>
  <li>The Raspberry Pi //I had received this RPi B from a contest on Element14. It just has 512 MB RAM, a 16 GB microSD and 1 single core.</li>
  <li>Cloudflare Argo Tunnel //To tunnel the traffic from www to this Pi</li>
</ul>

<p><em>If you want to learn just about the tech part, scroll down</em></p>

<h2 id="but-why">But Why?</h2>

<p>After much inspiration from <a href="https://solar.lowtechmagazine.com/power.html">Low Tech Magazine</a> which uses Solar energy, and is hyper efficient; the trend of self-hosting; and my boredom – I decided to do this. I have changed platforms for my website at least 7 to 8 times but I would never publish consistently. I am hoping that with this I just open writefreely and start writing whenever I want to.<br />
 I also liked the idea, that in this age, we expect everything to always work!. That wasn’t the case before, but this consumption cycle and tech in our hands has made us expect just that. So, to challenge that I have hosted this at my home – which might suffer internet outage, power loss. It might not always be up, and I am perfectly fine with that.<br />
 Almost all modern websites are filled with decoration, images, animations – which are not required. Sure, people enjoy it and that is all amazing. Even though I was tempted to make one, I knew that to focus on writing I needed one to do just that, and nothing more. Also the fact that your website has very little carbon footprint is gratifying.</p>

<p>Secondly, Analytics. I do not like everyone tracking you on the web. Hence, I used to use a self-hosted instance of <a href="https://z.0xvimarsh.com/">Plausible analytics</a> which I still do for other people’s websites. But when I used that, I would constantly check analytics – which country do people come from, of what demographic are the readers, how much time they spent on my website. All of which is not how I wanted me to write content. Writefreely just shows you how many views, each post gets – which is just a pleasure. Simple.<br />
 I could in theory, get the logs from my Pi, organize the data from user-agent, but that is just too much of work I feel.</p>

<h2 id="why-writefreely">Why Writefreely</h2>

<p>I used to first use Blogger, Wordpress, moved to Ghost for some time, then to Google Sites. The previous one I <a href="https://notion-based-website.onrender.com/">used</a> was just a website which would render from my notion workspace. It was all great. I could type in my thoughts in notion, and viola! it would show up. Although that was probably the longest time I stuck with one platform (almost 4 months), I was just unhappy with its performance. On my 6 year-old phone it took 15 seconds to open the homepage – unacceptable. That was partly due to big chunks of json, js and also the fact that it renders it every time someone visits.<br />
 I wanted to try something new. Wordpress was first I looked into – it was open source, simple, fast, you can migrate it anywhere. I recommend people to use wordpress most of the time. But for me… I knew if I did that, then I would just fiddle with its themes and not get anywhere.<br />
 Writefreely seemed like a sweet spot. Easily could write, just a binary, SQLite DB, and can move to any other machine super quickly: without any hastle.</p>

<h2 id="how">How?</h2>

<ol>
  <li>Setting up RPi
    <ul>
      <li>I firstly flashed a microSD Card with Raspbian Lite (32 bit) using the official utility <a href="https://www.raspberrypi.com/software/">Raspberry Pi Imager</a></li>
      <li>Then connected monitor, ethernet cable, etc and enabled SSH by running <code class="language-plaintext highlighter-rouge">sudo raspi-config</code></li>
    </ul>
  </li>
  <li>Installing Writefreely
    <ul>
      <li>Following the official instrucitions <a href="https://writefreely.org/start">given here</a>. Also set-it up as system service, to run on boot.</li>
      <li>I selected reverse-proxy &amp; SQLite for DB during setup</li>
    </ul>
  </li>
  <li>Installing Argo Tunnel
    <ul>
      <li>Following <a href="https://developers.cloudflare.com/cloudflare-one/tutorials/share-new-site">Cloudflare’s doccumentation</a>, I installed Argo Tunnel.</li>
      <li>I simply ran <code class="language-plaintext highlighter-rouge">cloudflared --hostname www.vimarsh.info http://127.0.0.1:8080</code> to start proxying traffic.</li>
      <li>I was contemplating on setting up a VPS and using SSH reverse tunneling, but this was simple, quick and super easy :D</li>
    </ul>
  </li>
</ol>

<p>Just like that, the website was up and running on the internet. Lucky for me, notion provides a markdown export, which I could import super easily. This is not a static website, with html files being served. So, it is possible that the RPi cannot handle it, but I am doubtful.<br />
 For images: I am using a github repo connected to vercel, and for each image, I upload it and embed it here.</p>

<h2 id="conclusion">Conclusion</h2>

<p>Overall I am pretty happy with the setup. Hopefully this means, I actually pen down more articles. Currently, if the lights go out – the tunnel isn’t going to restart (I haven’t set it up yet). I just use a self-hosted <a href="https://github.com/louislam/uptime-kuma">monitoring service</a> on the cloud which pings me on discord, when the website is down.</p>]]></content><author><name>Vimarsh</name></author><category term="Tech Stack" /><category term="Tutorial" /><category term="Self Hosting" /><category term="raspberry pi" /><category term="cloudflared" /><category term="tech" /><category term="tutorial" /><category term="writefreely" /><summary type="html"><![CDATA[Update: This website is now hosted on a server on Oracle Cloud. RPi was being slow. This website, the exact one you are reading right now is hosted on a Raspberry Pi (RPi) that too the original RPi B. In this post I will document why I did that and how.]]></summary><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://vimarsh.cc/uploads/2022/06/hostedonrpi-rev1.jpg" /><media:content medium="image" url="https://vimarsh.cc/uploads/2022/06/hostedonrpi-rev1.jpg" xmlns:media="http://search.yahoo.com/mrss/" /></entry><entry><title type="html">It isn’t Facebook, it’s us</title><link href="https://vimarsh.cc/blog/it-isnt-facebook-its-us/" rel="alternate" type="text/html" title="It isn’t Facebook, it’s us" /><published>2021-11-26T18:30:00+00:00</published><updated>2021-11-26T18:30:00+00:00</updated><id>https://vimarsh.cc/blog/it-isnt-facebook-its-us</id><content type="html" xml:base="https://vimarsh.cc/blog/it-isnt-facebook-its-us/"><![CDATA[<blockquote>
  <p>According to the documents themselves, researchers, people familiar with Facebook, former employees, and current employees, the social media platform is beset by a number of critical issues. These include hate speech, incitements to violence, and false news on its platform that is more widespread than the company acknowledges publicly. <span class="katex-display"><span class="katex"><span class="katex-mathml"><math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><semantics><mrow><mo stretchy="false">[</mo><mi>I</mi><mi>n</mi><mi>v</mi><mi>e</mi><mi>s</mi><mi>t</mi><mi>o</mi><mi>p</mi><mi>e</mi><mi>d</mi><mi>i</mi><mi>a</mi><mo stretchy="false">]</mo><mo stretchy="false">(</mo><mi>h</mi><mi>t</mi><mi>t</mi><mi>p</mi><mi>s</mi><mo>:</mo><mi mathvariant="normal">/</mi><mi mathvariant="normal">/</mi><mi>w</mi><mi>w</mi><mi>w</mi><mi mathvariant="normal">.</mi><mi>i</mi><mi>n</mi><mi>v</mi><mi>e</mi><mi>s</mi><mi>t</mi><mi>o</mi><mi>p</mi><mi>e</mi><mi>d</mi><mi>i</mi><mi>a</mi><mi mathvariant="normal">.</mi><mi>c</mi><mi>o</mi><mi>m</mi><mi mathvariant="normal">/</mi><mi>f</mi><mi>a</mi><mi>c</mi><mi>e</mi><mi>b</mi><mi>o</mi><mi>o</mi><mi>k</mi><mo>−</mo><mi>f</mi><mi>b</mi><mo>−</mo><mi>p</mi><mi>a</mi><mi>p</mi><mi>e</mi><mi>r</mi><mi>s</mi><mo>−</mo><mn>5207472</mn><mo stretchy="false">)</mo></mrow><annotation encoding="application/x-tex">[Investopedia](https://www.investopedia.com/facebook-fb-papers-5207472)</annotation></semantics></math></span><span class="katex-html" aria-hidden="true"><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mopen">[</span><span class="mord mathnormal" style="margin-right:0.07847em;">I</span><span class="mord mathnormal">n</span><span class="mord mathnormal" style="margin-right:0.03588em;">v</span><span class="mord mathnormal">es</span><span class="mord mathnormal">t</span><span class="mord mathnormal">o</span><span class="mord mathnormal">p</span><span class="mord mathnormal">e</span><span class="mord mathnormal">d</span><span class="mord mathnormal">ia</span><span class="mclose">]</span><span class="mopen">(</span><span class="mord mathnormal">h</span><span class="mord mathnormal">ttp</span><span class="mord mathnormal">s</span><span class="mspace" style="margin-right:0.2778em;"></span><span class="mrel">:</span><span class="mspace" style="margin-right:0.2778em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">//</span><span class="mord mathnormal" style="margin-right:0.02691em;">www</span><span class="mord">.</span><span class="mord mathnormal">in</span><span class="mord mathnormal" style="margin-right:0.03588em;">v</span><span class="mord mathnormal">es</span><span class="mord mathnormal">t</span><span class="mord mathnormal">o</span><span class="mord mathnormal">p</span><span class="mord mathnormal">e</span><span class="mord mathnormal">d</span><span class="mord mathnormal">ia</span><span class="mord">.</span><span class="mord mathnormal">co</span><span class="mord mathnormal">m</span><span class="mord">/</span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">a</span><span class="mord mathnormal">ce</span><span class="mord mathnormal">b</span><span class="mord mathnormal">oo</span><span class="mord mathnormal" style="margin-right:0.03148em;">k</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.8889em;vertical-align:-0.1944em;"></span><span class="mord mathnormal" style="margin-right:0.10764em;">f</span><span class="mord mathnormal">b</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:0.7778em;vertical-align:-0.1944em;"></span><span class="mord mathnormal">p</span><span class="mord mathnormal">a</span><span class="mord mathnormal">p</span><span class="mord mathnormal">ers</span><span class="mspace" style="margin-right:0.2222em;"></span><span class="mbin">−</span><span class="mspace" style="margin-right:0.2222em;"></span></span><span class="base"><span class="strut" style="height:1em;vertical-align:-0.25em;"></span><span class="mord">5207472</span><span class="mclose">)</span></span></span></span></span></p>
</blockquote>

<p>So, I was wondering why would Facebook (aka Meta) incite controversies and make people seek more attention towards it. Is it out of pure capital interests or is it something more deeper to think and unwrap about.</p>

<h3 id="capitalistic-insentives">Capitalistic Insentives</h3>

<p>All publicly traded companies recently are expected to show double-digit growth quarters – if they don’t want to be dunked. If you don’t show record revenue growth, that means that company is failing; which shouldn’t be the case – but Wall Street isn’t here to listen. So, we can consider Facebook (<em>cough</em> Meta) to somehow increase their revenues, and what better place to do just that than making people more engaged to the platform.</p>

<p>And how can that be done? Ans: Controversies. <br />
 Humans have a tendency to interact more with content that they don’t like. There are definitely genuine reasons, but people are not able to stand to listen on the other’s opinion. And when you start talking about anything remotely controversial, say how to pronounce “GIF”, there will definitely be people fighting over what’s right and what’s wrong. When there are more eyeballs – there are more ad-spots – hence more 💰</p>

<h3 id="get-offended-for-free-today">Get offended for free today</h3>

<p>As we discussed earlier, the best way to show engagement is by boosting controversial posts in feeds. But this raises another question – Why do Controversial Posts get such high engagement? tl;dr: it’s psychology.<br />
 The fact is that it’s not just the case with Facebook; be it a subreddit, niche communities like Hacker News, some old forum or even YouTube – there are more comments and discussions especially when the content being discussed disagrees with a fanbase or bursts the <em>bubble</em> of others. A post about some step by Apple will incite lots of discussion on HN, or someone saying Ethereum is bad will incite huge discussions on r/CryptoCurrency.<br />
 I am not saying that we should not disagree. Disagreeing will definitely make people think more and probably bring something amazing to life. There could be some dangerous experiment being shown on YouTube and showing hesitation in comments is necessary for the creator as well as fellow audience to know about. Or you could have insights about a specific niches and would like to share it with curious like-minded people. There is nothing inherently wrong about it.<br />
 But if, even after knowing or being presented with facts, the community turns the discussion into arguments and becomes toxic chasing useless arguments, the cycle will go on without bringing any productive conclusion or ceasefire…<br />
 The thing is that most discussions on Meta or any platforms more often than not (unless it’s a very well monitored platform….) will turn out to be baseless and worthless without contributing anything to the world. But still we as humans have managed to be <a href="https://www.vimarsh.info/week-47-2021#:\~:text=How%20is%20humanity,Curiosity%20and%20Competition.">able to accomplish something</a>.</p>

<h3>💡</h3>

<p>People just really like to disagree and protect what they have thought of and rigorously believed since eternity. Cause the fact that that “bubble” of hardened thoughts, memories and emotions will burst; is too overwhelming for them deal with.</p>

<h3 id="dear-algorithms">Dear Algorithms</h3>

<p>The gods on whose mercy we all spend our time everyday. These algorithms can cause havoc in human society if it thinks that people like controversial and unethical stuff. If what all teens and society consume is garbage or some propaganda that will become the truth for them. The problem is most of these algorithms are made in a way to keep users on their platform. They need not be some fancy Machine Learning jargon, but simple down-votes by people using it also work to destroy whole societies.<br />
 Let’s say I am an alien who is invited to keep humans happy and engaged and prevent them from thinking a lot. I will study all these social network and interactions, and it is pretty clear that the way to keep people satisfied is make them furiously type and press dislike and reward them with an opinion they agree with. In essence, create a reward-adrenaline loop. And I, as an alien, will really like that – as people seem to be happy on the outside and engaged mindlessly swiping a piece of <em>glass</em>.</p>

<h3 id="content">Content</h3>

<p>Here’s the thing: Not all content ever made is incorrect or controversial. There are neutral and amazing works that do not bring or need any criticism. But overall, the majority likes to engage infuriatingly with things that they disagree with or criticize someone who is probably just sharing their view point.<br />
 Why cannot we just disagree with few opinions, but agree with other thoughts of an individual. Why does everything need to be black and white? Why can’t we humans, collectively decide to live with people’s differences of thoughts peacefully?<br />
 Therefore, I believe that it is us, the people; not Meta; who like to bring up some controversial topics — sometimes they are needed for clarity, or change — but they should not go out of hand to such an extent that Aliens and Capitalist behemoths think that those are the things we like to be fed with.</p>]]></content><author><name>Vimarsh</name></author><category term="Meta" /><category term="Thoughts" /><category term="philosophy" /><category term="controvery" /><category term="facebook" /><summary type="html"><![CDATA[Recently, there have been a lot of controversies regarding Facebook (now, Meta) on how manipulative it is and how it fuels misinformation and controversies. Time to get Meta.]]></summary></entry></feed>