<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xml" href="/feed.xslt.xml"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Shaleen Jain</title>
    <subtitle>Personal and technical musings</subtitle>
    <link href="https://shaleenjain.com/atom.xml" rel="self" type="application/atom+xml"/>
    <link href="https://shaleenjain.com" rel="alternate" type="text/html" />
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-07-11T00:00:00+00:00</updated>
    <id>https://shaleenjain.com/atom.xml</id>

    
    <author>
        <name>Shaleen Jain</name>
      
      
    </author>
    
    <entry xml:lang="en">
        <title>Air Gear Deserves a Reboot</title>
        <link href="https://shaleenjain.com/blog/airgear-reboot/" type="text/html"/>
        <pubDate>2026-07-11T00:00:00+00:00</pubDate>
        <published>2026-07-11T00:00:00+00:00</published>
        <updated>2026-07-11T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/airgear-reboot/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/airgear-reboot/">&lt;h2 id=&quot;why-this-cult-classic-is-ready-for-a-modern-comeback&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#why-this-cult-classic-is-ready-for-a-modern-comeback&quot; aria-label=&quot;Anchor link for: why-this-cult-classic-is-ready-for-a-modern-comeback&quot;&gt;🔗&lt;&#x2F;a&gt;
Why This Cult Classic Is Ready for a Modern Comeback&lt;&#x2F;h2&gt;
&lt;p&gt;Air Gear deserves a reboot not only because it was a visually distinctive cult
anime with unfinished source material, but because its deepest idea still feels
relevant today: the dream of breaking free from lives built around comfort and
security, and reaching toward a boundless sky of possibility.&lt;&#x2F;p&gt;
&lt;p&gt;The sky is Air Gear&#x27;s most enduring metaphor. It is a space that connects us
all, inviting us to rise above our differences against a backdrop of gang
rivalries and conflict. It&#x27;s about riders competing not to conquer others, but
to discover how far they themselves can go.&lt;&#x2F;p&gt;
&lt;p&gt;At its heart, Air Gear is about movement as liberation—about breaking out of the
limits that shrink people and reaching for a larger, more intense freedom.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;That idea matters today because modern life often rewards caution, optimization,
and control. People are more connected than ever, yet many feel boxed in by
routine, pressure, burnout, and the quiet fear of leaving what is safe. Air Gear
speaks directly to that feeling by turning skating into a metaphor for escape,
courage, self-discovery, and trust in motion. A reboot would not just revive a
nostalgic title; it would restore a story about learning how to rise.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-air-gear-still-stands-out&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#why-air-gear-still-stands-out&quot; aria-label=&quot;Anchor link for: why-air-gear-still-stands-out&quot;&gt;🔗&lt;&#x2F;a&gt;
Why Air Gear Still Stands Out&lt;&#x2F;h2&gt;
&lt;p&gt;At its core, Air Gear blends street culture, youth rebellion, and high-speed
action around the idea of Air Treks, motorized inline skates that transform
everyday movement into spectacle. That premise gave the series a distinct
identity even among other action anime, mixing gang rivalry, athletic
performance, exaggerated powers, and fashion-forward design into something
unmistakably its own.&lt;&#x2F;p&gt;
&lt;p&gt;The original anime also understood atmosphere. Its speed, attitude, and visual
energy made the world feel larger than the story it had time to tell. Even
today, the series is remembered less as a conventional battle anime than as one
driven by movement, momentum, and the longing to fly.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-theme-beneath-the-style&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-theme-beneath-the-style&quot; aria-label=&quot;Anchor link for: the-theme-beneath-the-style&quot;&gt;🔗&lt;&#x2F;a&gt;
The Theme Beneath the Style&lt;&#x2F;h2&gt;
&lt;p&gt;What makes Air Gear special is that the skating is never just skating. The idea
of flight runs beneath everything, giving the action emotional weight. The
characters are not simply racing or fighting; they are trying to break free from
invisible cages—from fear, limitation, and the narrow version of life that
comfort can create.&lt;&#x2F;p&gt;
&lt;p&gt;That is why the story still resonates today. Many people live in systems that
feel secure but spiritually small. Work, schedules, social expectations, and
digital habits can become a kind of soft confinement, where the body stays busy
while the soul longs for something more. Air Gear speaks to that longing by
imagining freedom not as escape from responsibility, but as the courage to
move beyond self-imposed limits.&lt;&#x2F;p&gt;
&lt;p&gt;The image of the sky matters here. It suggests openness, connection, and shared
possibility. Flying is not only about escape; it is also about meeting others in
the same vast space. In that sense, Air Gear is less a fantasy of individual
rebellion than a vision of freedom that still leaves room for community.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-the-original-anime-never-reached-its-full-potential&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#why-the-original-anime-never-reached-its-full-potential&quot; aria-label=&quot;Anchor link for: why-the-original-anime-never-reached-its-full-potential&quot;&gt;🔗&lt;&#x2F;a&gt;
Why the Original Anime Never Reached Its Full Potential&lt;&#x2F;h2&gt;
&lt;p&gt;The strongest practical argument for a reboot is also the simplest: the original
anime never had the chance to tell the complete story. Its 25-episode run
introduced the world, the characters, and the exhilaration of Air Treks, but
only hinted at the scale the manga would eventually reach.&lt;&#x2F;p&gt;
&lt;p&gt;As the story unfolds, Air Gear expands far beyond street rivalries. New teams,
philosophies, and competing visions of what it means to &quot;fly&quot; transform what
first appears to be a stylish action series into something much larger. The
anime captured the feeling of takeoff, but never the full journey.&lt;&#x2F;p&gt;
&lt;p&gt;That makes Air Gear an unusual candidate for revival. Most reboots rely
primarily on nostalgia. Air Gear has something more substantial waiting beneath
the surface: a complete story that was never fully adapted.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;why-it-would-resonate-even-more-today&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#why-it-would-resonate-even-more-today&quot; aria-label=&quot;Anchor link for: why-it-would-resonate-even-more-today&quot;&gt;🔗&lt;&#x2F;a&gt;
Why It Would Resonate Even More Today&lt;&#x2F;h2&gt;
&lt;p&gt;Perhaps the biggest surprise is how contemporary Air Gear now feels.&lt;&#x2F;p&gt;
&lt;p&gt;Modern life asks us to optimize almost everything. We measure productivity,
curate our identities, and often mistake efficiency for fulfillment. Security
becomes the goal, while risk slowly becomes something to avoid.&lt;&#x2F;p&gt;
&lt;p&gt;Air Gear argues for the opposite. It celebrates movement over stagnation,
curiosity over certainty, and the willingness to leap before knowing exactly
where you&#x27;ll land. Its characters grow because they keep choosing the harder
path—the one that demands trust in themselves and in the people riding beside
them.&lt;&#x2F;p&gt;
&lt;p&gt;The Air Treks themselves embody that philosophy. They are not merely a clever
piece of science fiction or a flashy gimmick for action scenes. They represent
possibility. Every rooftop crossed and every impossible jump suggests that the
limits people accept are often smaller than the limits they truly possess.&lt;&#x2F;p&gt;
&lt;p&gt;That message feels increasingly rare. In a culture that teaches us to minimize
uncertainty, Air Gear reminds us that the most meaningful experiences often
begin with stepping beyond what feels safe.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;what-a-reboot-should-preserve&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#what-a-reboot-should-preserve&quot; aria-label=&quot;Anchor link for: what-a-reboot-should-preserve&quot;&gt;🔗&lt;&#x2F;a&gt;
What a Reboot Should Preserve&lt;&#x2F;h2&gt;
&lt;p&gt;A new adaptation should resist the temptation to sand away the series&#x27; rough
edges. Air Gear works because it is loud, kinetic, stylish, and slightly
reckless. Its exaggerated fashion, expressive character designs, and relentless
sense of momentum are not superficial quirks; they are inseparable from its
identity.&lt;&#x2F;p&gt;
&lt;p&gt;More importantly, it should preserve the philosophy beneath the spectacle.&lt;&#x2F;p&gt;
&lt;p&gt;The action has always mattered because of what it represents. Every race, every
battle, and every impossible leap expresses the same belief: freedom is not
something we are given. It is something we discover by continuing to move, even
when the destination is uncertain.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;a-story-worth-finishing&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#a-story-worth-finishing&quot; aria-label=&quot;Anchor link for: a-story-worth-finishing&quot;&gt;🔗&lt;&#x2F;a&gt;
A Story Worth Finishing&lt;&#x2F;h2&gt;
&lt;p&gt;Air Gear has always been easy to admire for its artwork, kinetic action, and
unmistakable style. But those qualities are only the surface.&lt;&#x2F;p&gt;
&lt;p&gt;At its heart, it is a story about choosing freedom over comfort, about
discovering yourself through movement, and about finding people who inspire you
to aim higher than you believed possible.&lt;&#x2F;p&gt;
&lt;p&gt;That is why it deserves another chance.&lt;&#x2F;p&gt;
&lt;p&gt;Not because nostalgia sells.&lt;&#x2F;p&gt;
&lt;p&gt;Not because unfinished manga deserve completion.&lt;&#x2F;p&gt;
&lt;p&gt;But because its central idea still speaks to the world we live in.&lt;&#x2F;p&gt;
&lt;p&gt;A reboot would not simply revisit a cult classic. It would finally allow one of
anime&#x27;s most distinctive stories to become what it was always reaching toward: a
celebration of the courage to fly beyond the cages we inherit and toward a sky
wide enough for all of us.&lt;&#x2F;p&gt;
</content>

        
          <category term="air gear, manga, anime, flying, air treks, skating, reboot" />
        

        
          <summary type="html">🔗
Why This Cult Classic Is Ready for a Modern Comeback
Air Gear deserves a reboot not only because it was a visually distinctive cult
anime with unfinished source material, but because its deepest idea still feels
relevant today: the dream of breaking free from lives built around comfort and
security, and reaching toward a boundless sky of possibility.
The sky is Air Gear&#x27;s most enduring metaphor. It is a space that connects us
all, inviting us to rise above our differences against a backdrop of gang
rivalries and conflict. It&#x27;s about riders competing not to conquer others, but
to discover how far they themselves can go.
At its heart, Air Gear is about movement as liberation—about breaking out of the
limits that shrink people and reaching for a larger, more intense freedom.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>NextDNS: A Modern DNS Firewall for Your Whole Network</title>
        <link href="https://shaleenjain.com/blog/nextdns-dns-over-https-openwrt-android/" type="text/html"/>
        <pubDate>2026-07-05T00:00:00+00:00</pubDate>
        <published>2026-07-05T00:00:00+00:00</published>
        <updated>2026-07-05T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/nextdns-dns-over-https-openwrt-android/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/nextdns-dns-over-https-openwrt-android/">&lt;p&gt;I&#x27;ve been using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nextdns.io&#x2F;?from=83bgqgfw&quot;&gt;NextDNS&lt;&#x2F;a&gt; for over a year now and it&#x27;s one of those services that once you set up, you wonder how you lived without it. It&#x27;s a cloud-based DNS resolver with built-in filtering, analytics, and parental controls — think Pi-hole as a hosted service, but with global anycast routing and way more features.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;what-s-wrong-with-plain-dns&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#what-s-wrong-with-plain-dns&quot; aria-label=&quot;Anchor link for: what-s-wrong-with-plain-dns&quot;&gt;🔗&lt;&#x2F;a&gt;
What&#x27;s Wrong with Plain DNS?&lt;&#x2F;h2&gt;
&lt;p&gt;Traditional DNS (port 53, UDP) sends your queries in plaintext. Anyone on your network, your ISP, or anyone snooping on the wire can see every domain you visit. It&#x27;s also trivially easy for ISPs or governments to hijack DNS responses and redirect you to phishing pages or censorship pages.&lt;&#x2F;p&gt;
&lt;p&gt;DNS over HTTPS (DoH) and DNS over TLS (DoT) fix this by encrypting your DNS queries. Instead of plain UDP packets, your queries travel inside an encrypted TLS tunnel (DoT) or are wrapped in HTTPS requests (DoH). This gives you:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Privacy&lt;&#x2F;strong&gt; — your ISP can&#x27;t see what domains you&#x27;re resolving&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Integrity&lt;&#x2F;strong&gt; — nobody can tamper with DNS responses in transit&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Authentication&lt;&#x2F;strong&gt; — you verify you&#x27;re talking to the real DNS server&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;why-nextdns&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#why-nextdns&quot; aria-label=&quot;Anchor link for: why-nextdns&quot;&gt;🔗&lt;&#x2F;a&gt;
Why NextDNS?&lt;&#x2F;h2&gt;
&lt;p&gt;There are other encrypted DNS providers (Cloudflare 1.1.1.1, Quad9, etc.), but NextDNS goes much further:&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;1. Blocking &amp;amp; Filtering&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
You can block malware, tracking domains, adult content, ads, and more — all at the DNS level. It works like Pi-hole but requires no hardware, no configuration on each device, and it applies to every device on your network. It uses multiple blocklists (OISD, Energized, etc.) out of the box.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;2. Analytics&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
The dashboard shows you exactly which domains are being queried, how many were blocked, which devices made the requests, and a timeline of activity. It&#x27;s incredibly useful for spotting rogue IoT phones home or checking if a block is too aggressive.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;3. Allow&#x2F;Deny Lists&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
You can whitelist domains that get falsely blocked and blacklist entire domains or TLDs. Changes propagate in seconds.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;4. Parental Controls&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
Built-in categories for restricting adult content, social media, gaming, etc. You can also schedule when certain categories are blocked (e.g., block social media during school hours).&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;5. Response Policy Zones (RPZ)&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
RPZ is a powerful DNS-level policy mechanism that lets you redirect, block, or log queries based on domain patterns. NextDNS supports it natively, giving you advanced control far beyond simple blocklists — you can, for example, redirect queries for known malware domains to a local sinkhole, override DNS responses for specific domains across your entire network, or quarantine IoT device domains.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;6. Native DoH&#x2F;DoT&#x2F;DoQ&#x2F;DNSCrypt&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
No need to run a local proxy — every device can talk to NextDNS directly over encrypted DNS.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;7. No Hardware Required&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
It Just Works on your existing router, phone, or laptop. You don&#x27;t need a Raspberry Pi or a separate server.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;8. Global Anycast&lt;&#x2F;strong&gt;&lt;br &#x2F;&gt;
NextDNS has servers all over the world. Latency is consistently lower than running a Pi-hole over a VPN or a self-hosted Unbound instance.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;9. Censorship Resistance&lt;&#x2F;strong&gt;
Compatible browsers enable encrypted Server Name
Indication (SNI) on top of DoH to prevent leaking of DNS hostnames and thus
thwarting commonly used internet censorship attempts by ISP&#x27;s and governments.&lt;&#x2F;p&gt;
&lt;p&gt;They have a generous free tier (300,000 queries&#x2F;month) and the paid plan is cheap — $1.99&#x2F;month or $19.90&#x2F;year for unlimited queries and up to 50 devices per configuration.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;setting-up-nextdns-on-openwrt-with-stubby&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#setting-up-nextdns-on-openwrt-with-stubby&quot; aria-label=&quot;Anchor link for: setting-up-nextdns-on-openwrt-with-stubby&quot;&gt;🔗&lt;&#x2F;a&gt;
Setting Up NextDNS on OpenWrt with Stubby&lt;&#x2F;h2&gt;
&lt;p&gt;This is my recommended setup because it protects every device on your network — including smart TVs, IoT devices, game consoles, and guest devices that you can&#x27;t configure individually.&lt;&#x2F;p&gt;
&lt;p&gt;OpenWrt has native support for &lt;code&gt;stubby&lt;&#x2F;code&gt;, a DNS-over-TLS stub resolver. The setup is straightforward.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;step-1-get-your-configuration-id&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#step-1-get-your-configuration-id&quot; aria-label=&quot;Anchor link for: step-1-get-your-configuration-id&quot;&gt;🔗&lt;&#x2F;a&gt;
Step 1: Get Your Configuration ID&lt;&#x2F;h3&gt;
&lt;p&gt;Sign up at &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nextdns.io&#x2F;?from=83bgqgfw&quot;&gt;NextDNS&lt;&#x2F;a&gt;, create a configuration, and note your &lt;strong&gt;Configuration ID&lt;&#x2F;strong&gt; — it looks like &lt;code&gt;abc123&lt;&#x2F;code&gt;. You&#x27;ll find it under the Setup tab.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;step-2-install-stubby-on-openwrt&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#step-2-install-stubby-on-openwrt&quot; aria-label=&quot;Anchor link for: step-2-install-stubby-on-openwrt&quot;&gt;🔗&lt;&#x2F;a&gt;
Step 2: Install Stubby on OpenWrt&lt;&#x2F;h3&gt;
&lt;p&gt;SSH into your router and run:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;opkg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; update&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;opkg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; install stubby luci-app-stubby&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;step-3-configure-stubby&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#step-3-configure-stubby&quot; aria-label=&quot;Anchor link for: step-3-configure-stubby&quot;&gt;🔗&lt;&#x2F;a&gt;
Step 3: Configure Stubby&lt;&#x2F;h3&gt;
&lt;p&gt;Edit &lt;code&gt;&#x2F;etc&#x2F;stubby&#x2F;stubby.yml&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;resolution_type&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; GETDNS_RESOLUTION_STUB&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;dns_transport_list&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; GETDNS_TRANSPORT_TLS&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;tls_authentication&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; GETDNS_AUTHENTICATION_REQUIRED&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;tls_query_padding_blocksize&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt; 128&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;edns_client_subnet_private&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;idle_timeout&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt; 10000&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;listen_addresses&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; 127.0.0.1@5353&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; 0::1@5353&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;round_robin_upstreams&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;upstream_recursive_servers&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; address_data&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt; 45.90.28.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    tls_auth_name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;abc123.dns.nextdns.io&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; address_data&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; 2a07:a8c0::0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    tls_auth_name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;abc123.dns.nextdns.io&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; address_data&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt; 45.90.30.0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    tls_auth_name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;abc123.dns.nextdns.io&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; address_data&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; 2a07:a8c1::0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    tls_auth_name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;abc123.dns.nextdns.io&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Replace &lt;code&gt;abc123&lt;&#x2F;code&gt; with your actual Configuration ID.&lt;&#x2F;p&gt;
&lt;p&gt;The IP addresses are NextDNS&#x27;s anycast servers. Using addresses instead of hostnames avoids a chicken-and-egg problem where DNS needs DNS to resolve the DNS server. The &lt;code&gt;tls_auth_name&lt;&#x2F;code&gt; is what Stubby will validate against the TLS certificate, and it includes your config ID so NextDNS knows which filtering policy to apply.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;step-4-configure-dnsmasq-or-unbound&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#step-4-configure-dnsmasq-or-unbound&quot; aria-label=&quot;Anchor link for: step-4-configure-dnsmasq-or-unbound&quot;&gt;🔗&lt;&#x2F;a&gt;
Step 4: Configure dnsmasq (or unbound)&lt;&#x2F;h3&gt;
&lt;p&gt;In LuCI, go to &lt;strong&gt;Network → DNS → Forwards&lt;&#x2F;strong&gt;, set &quot;DNS forwardings&quot; to &lt;code&gt;127.0.0.1#5353&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Or from the CLI, edit &lt;code&gt;&#x2F;etc&#x2F;config&#x2F;dhcp&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;list server &amp;#39;127.0.0.1#5353&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Then restart the services:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;&#x2F;etc&#x2F;init.d&#x2F;stubby&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; restart&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;&#x2F;etc&#x2F;init.d&#x2F;dnsmasq&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; restart&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;step-5-verify-it-works&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#step-5-verify-it-works&quot; aria-label=&quot;Anchor link for: step-5-verify-it-works&quot;&gt;🔗&lt;&#x2F;a&gt;
Step 5: Verify It Works&lt;&#x2F;h3&gt;
&lt;p&gt;Visit &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nextdns.io&#x2F;?from=83bgqgfw&quot;&gt;NextDNS&#x27;s test page&lt;&#x2F;a&gt; or check the analytics dashboard. You should see queries coming in from your home IP.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;setting-up-nextdns-on-android&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#setting-up-nextdns-on-android&quot; aria-label=&quot;Anchor link for: setting-up-nextdns-on-android&quot;&gt;🔗&lt;&#x2F;a&gt;
Setting Up NextDNS on Android&lt;&#x2F;h2&gt;
&lt;p&gt;Android has supported DNS-over-TLS (DoT) since Android 9 (Pie) and DNS-over-HTTPS (DoH) since Android 11. You don&#x27;t need any third-party app for basic encrypted DNS.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;using-private-dns-dot-android-9&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-private-dns-dot-android-9&quot; aria-label=&quot;Anchor link for: using-private-dns-dot-android-9&quot;&gt;🔗&lt;&#x2F;a&gt;
Using Private DNS (DoT, Android 9+)&lt;&#x2F;h3&gt;
&lt;ol&gt;
&lt;li&gt;Go to &lt;strong&gt;Settings → Network &amp;amp; internet → Private DNS&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Select &lt;strong&gt;Private DNS provider hostname&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Enter: &lt;code&gt;abc123.dns.nextdns.io&lt;&#x2F;code&gt; (replace &lt;code&gt;abc123&lt;&#x2F;code&gt; with your config ID)&lt;&#x2F;li&gt;
&lt;li&gt;Tap &lt;strong&gt;Save&lt;&#x2F;strong&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;That&#x27;s it. All DNS queries from your phone will now be encrypted with TLS and filtered by your NextDNS policy. This works on both Wi-Fi and mobile data.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;using-the-nextdns-app-doh-more-features&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-the-nextdns-app-doh-more-features&quot; aria-label=&quot;Anchor link for: using-the-nextdns-app-doh-more-features&quot;&gt;🔗&lt;&#x2F;a&gt;
Using the NextDNS App (DoH, More Features)&lt;&#x2F;h3&gt;
&lt;p&gt;If you want DoH instead of DoT, or you want per-app filtering, logging, or the ability to pause protection, install the NextDNS app from F-Droid or the Play Store:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Install &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nextdns.io&#x2F;?from=83bgqgfw&quot;&gt;NextDNS&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Open the app and sign in&lt;&#x2F;li&gt;
&lt;li&gt;It will automatically detect your configuration&lt;&#x2F;li&gt;
&lt;li&gt;Enable the VPN-based DNS — this creates a local VPN that intercepts DNS queries and sends them over HTTPS&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;The app approach gives you more visibility (you can see real-time queries on your phone) and works on Android versions older than 9.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;verifying-android-setup&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#verifying-android-setup&quot; aria-label=&quot;Anchor link for: verifying-android-setup&quot;&gt;🔗&lt;&#x2F;a&gt;
Verifying Android Setup&lt;&#x2F;h3&gt;
&lt;p&gt;Visit &lt;code&gt;https:&#x2F;&#x2F;test.nextdns.io&lt;&#x2F;code&gt; in your browser. It will show whether you&#x27;re connected to NextDNS, your config ID, protocol (DoT or DoH), and latency.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;dns-over-https-vs-dns-over-tls-which-to-use&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#dns-over-https-vs-dns-over-tls-which-to-use&quot; aria-label=&quot;Anchor link for: dns-over-https-vs-dns-over-tls-which-to-use&quot;&gt;🔗&lt;&#x2F;a&gt;
DNS-over-HTTPS vs DNS-over-TLS: Which to Use?&lt;&#x2F;h2&gt;
&lt;p&gt;Both achieve the same goal — encrypted DNS. The differences are subtle:&lt;&#x2F;p&gt;
&lt;table&gt;&lt;thead&gt;&lt;tr&gt;&lt;th&gt;Aspect&lt;&#x2F;th&gt;&lt;th&gt;DoT&lt;&#x2F;th&gt;&lt;th&gt;DoH&lt;&#x2F;th&gt;&lt;&#x2F;tr&gt;&lt;&#x2F;thead&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td&gt;Port&lt;&#x2F;td&gt;&lt;td&gt;853 (dedicated)&lt;&#x2F;td&gt;&lt;td&gt;443 (shared with HTTPS)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Protocol&lt;&#x2F;td&gt;&lt;td&gt;TLS over TCP&lt;&#x2F;td&gt;&lt;td&gt;HTTPS&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Ease to block&lt;&#x2F;td&gt;&lt;td&gt;Easy (block port 853)&lt;&#x2F;td&gt;&lt;td&gt;Hard (looks like normal web traffic)&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Performance&lt;&#x2F;td&gt;&lt;td&gt;Slightly lower overhead&lt;&#x2F;td&gt;&lt;td&gt;Slightly more overhead&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;tr&gt;&lt;td&gt;Android support&lt;&#x2F;td&gt;&lt;td&gt;Native (Private DNS)&lt;&#x2F;td&gt;&lt;td&gt;Via app only&lt;&#x2F;td&gt;&lt;&#x2F;tr&gt;
&lt;&#x2F;tbody&gt;&lt;&#x2F;table&gt;
&lt;p&gt;On OpenWrt, I recommend &lt;strong&gt;Stubby (DoT)&lt;&#x2F;strong&gt; because it&#x27;s lightweight and OpenWrt has excellent support for it. On Android, the native &lt;strong&gt;Private DNS (DoT)&lt;&#x2F;strong&gt; is the simplest. If you&#x27;re on a restrictive network that blocks port 853, the NextDNS app with &lt;strong&gt;DoH&lt;&#x2F;strong&gt; will work because it tunnels through port 443.&lt;&#x2F;p&gt;
&lt;hr &#x2F;&gt;
&lt;h2 id=&quot;billing&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#billing&quot; aria-label=&quot;Anchor link for: billing&quot;&gt;🔗&lt;&#x2F;a&gt;
Billing&lt;&#x2F;h2&gt;
&lt;p&gt;If you&#x27;re based in India and trying to signup for their paid plans, note that
their stripe integration for payments does not have OTP authentications (Verified-By-Visa
enabled, thus making all Visa cards fail being charged.&lt;&#x2F;p&gt;
&lt;p&gt;Any MasterCard with international payments enabled should work fine however!&lt;&#x2F;p&gt;
&lt;h2 id=&quot;final-thoughts&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#final-thoughts&quot; aria-label=&quot;Anchor link for: final-thoughts&quot;&gt;🔗&lt;&#x2F;a&gt;
Final Thoughts&lt;&#x2F;h2&gt;
&lt;p&gt;NextDNS is one of those rare services that&#x27;s simultaneously simple enough for non-technical users and powerful enough for network nerds. The OpenWrt setup takes 10 minutes and gives your entire home network ad-blocking, malware protection, and parental controls without any ongoing maintenance.&lt;&#x2F;p&gt;
&lt;p&gt;The free tier covers a typical household, and even the paid plan is cheaper than a coffee. If you&#x27;ve been considering setting up Pi-hole but haven&#x27;t gotten around to it, give &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nextdns.io&#x2F;?from=83bgqgfw&quot;&gt;NextDNS&lt;&#x2F;a&gt; a try instead.&lt;&#x2F;p&gt;
</content>

        
          <category term="nextdns, dns, openwrt, android, privacy, security, doh, dot, dns-over-https, dns-over-tls, privacy, ech, sni" />
        

        
          <summary type="html">I&#x27;ve been using NextDNS for over a year now and it&#x27;s one of those services that once you set up, you wonder how you lived without it. It&#x27;s a cloud-based DNS resolver with built-in filtering, analytics, and parental controls — think Pi-hole as a hosted service, but with global anycast routing and way more features.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Grounding and Trusting Oneself</title>
        <link href="https://shaleenjain.com/blog/grounding-and-trust/" type="text/html"/>
        <pubDate>2025-07-10T00:00:00+00:00</pubDate>
        <published>2025-07-10T00:00:00+00:00</published>
        <updated>2025-07-10T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/grounding-and-trust/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/grounding-and-trust/">&lt;p&gt;While attending a CI workshop in Goa, at a wonderful space under a huge Banyan
Tree with sunlight shimmering through it&#x27;s leaves, after finishing a set of
partner exercises we sat down in a circle to share our experiences and
feelings. Two other participants began the sharing with how they where able
to trust each other letting them both share weight, lift and fly each other
easily.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Having sensed this theme of trust issues within the group, I chimed in with my
perspective on trust. I shared that indeed it is not only about trusting the
other but more so of trusting oneself, to be able to sense, perceive and catch
myself in a fall. Being comfortable in different orientations and knowing your
center of gravity. That in turn lets you work within your limits but also take
risks leading to expansion of your capabilities and limits.&lt;&#x2F;p&gt;
&lt;p&gt;The facilitator resonated with me by adding that indeed trust is not something
that you just give, it comes from within, with awareness of your presence and
body sensations leading to an even greater connection and perception of the
other, navigating tricky spaces, communicating and negotiating each others
limits and boundaries.&lt;&#x2F;p&gt;
&lt;p&gt;The more I practise CI the more I find myself trusting my body and its
sensations to guide me into ways of catching myself from falls, having more
spacial awareness, acknowledging my emotions and reading others intentions.&lt;&#x2F;p&gt;
&lt;p&gt;Essentially being comfortable handling new, unknown and challenging situations.&lt;&#x2F;p&gt;
</content>

        
          <category term="contract improvisation, somatics, dance, yoga, martial arts, space, time, awareness, touch, physical, gravity, soma, trust, grounding, falling, catching, flying" />
        

        
          <summary type="html">While attending a CI workshop in Goa, at a wonderful space under a huge Banyan
Tree with sunlight shimmering through it&#x27;s leaves, after finishing a set of
partner exercises we sat down in a circle to share our experiences and
feelings. Two other participants began the sharing with how they where able
to trust each other letting them both share weight, lift and fly each other
easily.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Values - Mine and New Gaia</title>
        <link href="https://shaleenjain.com/blog/morals-and-values/" type="text/html"/>
        <pubDate>2025-07-09T00:00:00+00:00</pubDate>
        <published>2025-07-09T00:00:00+00:00</published>
        <updated>2025-07-09T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/morals-and-values/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/morals-and-values/">&lt;p&gt;These are the values I&#x27;ve built up for myself over the years
and have served me well to this day. I share them here for the benefit of
others but also as part of the New Earth going forward.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;values&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#values&quot; aria-label=&quot;Anchor link for: values&quot;&gt;🔗&lt;&#x2F;a&gt;
Values&lt;&#x2F;h2&gt;
&lt;p&gt;Values guide our goals and aspiration, they provide a code to operate in the
world in order to co-ordinate and collaborate with the people we live and work
with.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;karma-yoga&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#karma-yoga&quot; aria-label=&quot;Anchor link for: karma-yoga&quot;&gt;🔗&lt;&#x2F;a&gt;
Karma Yoga&lt;&#x2F;h3&gt;
&lt;p&gt;The true essence of Karma Yoga is performing actions without attachment to the
results. Working for work’s sake.
The only duty is to be unattached and to work as free beings.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you can incessantly take that position that you are a giver, that
everything given by you is a free offering to the world, without any thought
of return, that will be work which will not bring attachment. Attachment
only comes when we expect something.&lt;&#x2F;p&gt;
&lt;p&gt;— Swami Vivekananda&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;devotion&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#devotion&quot; aria-label=&quot;Anchor link for: devotion&quot;&gt;🔗&lt;&#x2F;a&gt;
Devotion&lt;&#x2F;h3&gt;
&lt;p&gt;When we work without attachment, the work itself brings us joy and
satisfaction. For that we dedicate and devote the work to a higher energy and
higher force.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;The object is transformation, and the transformation can only be done by a
force infinitely greater than your own; it can only be done by being truly
like a child in the hands of the Divine Mother.&lt;&#x2F;p&gt;
&lt;p&gt;— Sri Aurobindo&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;higher-purpose&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#higher-purpose&quot; aria-label=&quot;Anchor link for: higher-purpose&quot;&gt;🔗&lt;&#x2F;a&gt;
Higher purpose&lt;&#x2F;h3&gt;
&lt;p&gt;Our motives and desires are not for power and everything else, it is for
calmness and serenity and to bring that experience to everyone for our
collective welfare.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;dharma&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#dharma&quot; aria-label=&quot;Anchor link for: dharma&quot;&gt;🔗&lt;&#x2F;a&gt;
Dharma&lt;&#x2F;h3&gt;
&lt;p&gt;Dharma&#x2F;Tao refers not just to external, material and factual truths but also a
sense of inner truth and authenticity. Knowing everyone has their own role,
duty and skills they excel at. We do not value or judge anyone’s work as
higher or lower as far as it is in alignment with the dharma.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;If you want to be a householder hold your life a sacrifice for the welfare
of others, and if you choose the life of renunciation do not even see
beauty, and money, and power. Each is great in his own place, but the duty
of the one is not the duty of the other.&lt;&#x2F;p&gt;
&lt;p&gt;— Swami Vivekananda&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;good-and-evil&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#good-and-evil&quot; aria-label=&quot;Anchor link for: good-and-evil&quot;&gt;🔗&lt;&#x2F;a&gt;
Good and Evil&lt;&#x2F;h3&gt;
&lt;p&gt;Good and Evil are but the two sides of the same coin. Do not impose any
sense of an external morality on ourselves, but know good and evil are just different
perspectives. We rely on our own sense of dharma to guide us, not in
isolation, but together as one community, society and eventually one being.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;We read in the Gîtâ again and again that we must all work incessantly, but
all work must be composed of good and evil; we cannot do any work which has
not some part of good somewhere; there cannot be any work which will not
injure someone somewhere.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;Yet we must do good. It is the highest motive power we have, knowing all the
time it is a privilege to help. Do not stand on a pedestal and take five
cents and say, “Here, my poor man,” but be grateful that the poor man is
there, so that by giving to him you are able to help yourself. It is not the
receiver that is blessed, but the giver.
— Swami Vivekananda&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>

        
          <category term="values, morals, moral compass, new gaia, new earth, principles, guiding values, karma yoga, divine mother, sri aurobindo" />
        

        
          <summary type="html">These are the values I&#x27;ve built up for myself over the years
and have served me well to this day. I share them here for the benefit of
others but also as part of the New Earth going forward.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Dharmalaya - A Dysfunctional Institute</title>
        <link href="https://shaleenjain.com/blog/dharmalaya/" type="text/html"/>
        <pubDate>2025-06-30T00:00:00+00:00</pubDate>
        <published>2025-06-30T00:00:00+00:00</published>
        <updated>2025-06-30T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/dharmalaya/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/dharmalaya/">&lt;figure&gt;



&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;view.f0b0d0b5dc098e37.jpg&quot;  &#x2F;&gt;

&lt;figcaption&gt;View from a village near Dharmalaya&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;dharmalaya.in&#x2F;&quot;&gt;Dharmalaya&lt;&#x2F;a&gt; is 6-acre eco-campus located near a village in Bir, Himachal
Pradesh. The institute is intentioned as an alternate school with their main
focus being on contemplative arts and teachings of the traditional practises
of natural building and agriculture in-addition to now integrating that with
permaculture principles.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;I visited the institute for a 3-month permaculture course led by an Australian
Permaculture teacher Robyn Hewson. The course itself was quite helpful and
enriching however here I will be focusing on sharing my experience with the
community and how it was staying within the campus of Dharmalaya for an
extended period of time.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;community&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#community&quot; aria-label=&quot;Anchor link for: community&quot;&gt;🔗&lt;&#x2F;a&gt;
Community&lt;&#x2F;h3&gt;
&lt;p&gt;Never before have I been in a community so distraught, fractured and
scattered.  So many lost and jaded humans, trying to find a sense of purpose,
respect and self-worth by trying to help others and building a &quot;better world&quot;.
However it all comes from a place of a moral high-ground, a sense of lack and
neediness. Rather instead an overflowing of abundance and love.&lt;&#x2F;p&gt;
&lt;p&gt;The campus is completely isolated, with a lack of collaboration with the
outside world.  The incentives for people staying in and volunteering
long-term are also misaligned. With them having to pay for their lodging and
food while working on the garden beds, providing labour for the natural build
constructions or just doing logistics around the workshops, setting up for the
new people coming in and administering the daily needs and chores of the
community.&lt;&#x2F;p&gt;
&lt;p&gt;There are some elements to the community that are inspiring, especially how
they have the local native villagers integrated and a part of the workings of
Dharmalaya. All of them work full time as staff; helping out with the
maintenance of the buildings with regular plastering work, tending to the
garden beds, planting and growing annuals, growing and caring after many of
the native trees within the land, cooking 3 meals a day in the Kitchen.&lt;&#x2F;p&gt;
&lt;p&gt;Some of the Buddhist cultural influences from the town of Bir, can be seen and
felt within the campus and the way the teachings here are imparted. Like the
&quot;Short Times, Many Times&quot; practise by Yongey Mingyur Rinpoche of meditating
for even just 2 minutes before starting every circle.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;spiritual-materialism&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#spiritual-materialism&quot; aria-label=&quot;Anchor link for: spiritual-materialism&quot;&gt;🔗&lt;&#x2F;a&gt;
Spiritual Materialism&lt;&#x2F;h3&gt;
&lt;p&gt;One of the founder of Dharmalaya, Mai-Linh seems to be a spiritual healer of
sorts, having practised Buddhist philosophy and teachings, she has made a
career out of it.&lt;&#x2F;p&gt;
&lt;p&gt;Undoubtedly, she held a few online sessions with us while I was there, talking
and sharing a Buddhist technique of connecting with the five elements.
Many of these teachings in various spiritual and traditional
lineages are secret and are only passed down when the disciple is ready.
Additionally, they are not taught by just anyone and most definitely not
in a generalised and abstract way.&lt;&#x2F;p&gt;
&lt;p&gt;Unsurprisingly it caused more confusion than help anyone while we were
there. For me it was highly intellectualized and just stories created around
the five elements, no matter how many times she told us to &quot;just experience
it&quot; and not think.&lt;&#x2F;p&gt;
&lt;p&gt;This really made me think of &quot;Spiritual Materialism&quot; as popularized by Chogyam
Trungpa Rinpoche as a trick of the ego. Using the nature, elements and
eventually spiritually as a way of enhancing our ego, not really coming
any closer to truth and reality.&lt;&#x2F;p&gt;
&lt;p&gt;A glimpse of her approach can be inferred from this text she shared with us after
many people requested more information to understand the teachings.&lt;&#x2F;p&gt;



&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;mai-linh.ef397e6b802ec8c6.jpg&quot;  &#x2F;&gt;
&lt;h3 id=&quot;natural-building-and-didi-contractor&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#natural-building-and-didi-contractor&quot; aria-label=&quot;Anchor link for: natural-building-and-didi-contractor&quot;&gt;🔗&lt;&#x2F;a&gt;
Natural Building and Didi Contractor&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Didi_Contractor&quot;&gt;Didi Contractor&lt;&#x2F;a&gt; was a self-taught German-American architect known for her
natural building designs, many of which are seen in the living spaces at
Dharmalaya.&lt;&#x2F;p&gt;
&lt;p&gt;As soon as you enter the campus and spend some time in the Main Building,
you&#x27;ll see her portrait hanging on a wall, adorned with flowers and incense. A
book written on her life by one of her apprentices is visibly kept in a common
space for anyone to read and eventually buy a copy for themselves; there are
always a few in stock at Dharmalaya.&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;s a fanaticism around Didi Contractor at Dharmalaya, as if she were a
pioneer or the greatest architect in the world. Yet, she primarily brought
back traditional building methods that had been used in India for generations
but had lost their appeal due to Western cultural influences.&lt;&#x2F;p&gt;
&lt;p&gt;This isn&#x27;t surprising in India, where a foreigner is often given more respect
and value than an Indian in their own land for the same ideas. It&#x27;s no wonder
then that a Westerner had to start preaching about the values of natural
buildings for people to start paying attention. Of course, she could explain
the benefits in English, combining them with modern architecture principles
and Vastu Shastra—the ancient science of architecture from Hindu Vedic Texts.&lt;&#x2F;p&gt;
&lt;p&gt;Imagine an amateur self-taught Indian telling you to build your house with mud
and the often considered superstitious science of Vastu—such a suggestion might
be dismissed outright!&lt;&#x2F;p&gt;
&lt;p&gt;The fanaticism hasn&#x27;t stopped after she passed away, though. Even today, her
quotes like &quot;The best building is no building&quot; are chanted and taken too
literally by budding architects and professionals.&lt;&#x2F;p&gt;
&lt;p&gt;If you happen to be part of a Natural Design and Contemplative Architecture
course at Dharmalaya, know that it&#x27;s quite unlikely you will get to build a
structure or a building at the site unless it&#x27;s heavily influenced by Didi&#x27;s
previous designs. One of the reasons you&#x27;ll hear for this is that the largest
flat patch of land, the camp grounds, has an energy of its own. It&#x27;s a
community space where people often come together to play, chat, and
contemplate. Building anything there, they say, would only dissipate the
energy and in no way enhance or preserve its essence.&lt;&#x2F;p&gt;
&lt;p&gt;Being a Natural Building or Didi Contractor fanatic can&#x27;t be the worst thing,
right? Well, the thing about fanaticism is that it often appeals to those who
are less grounded. In my conversations with one of the local villagers who has
been working at Dharmalaya for over 10 years, I came across a surprising
story. Hariyali Didi, who has built multiple mud houses and learned the
methods from her grandfathers, says she herself has built her most recent
house with cement and burnt bricks.&lt;&#x2F;p&gt;
&lt;p&gt;In her own words:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;&quot;Cement buildings are all the trend now.&quot; -- Hariyali Devi&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;So, Dharmalaya and all its fanaticism haven&#x27;t done much good if the people
working there themselves don&#x27;t see and understand the benefits of Natural
Buildings, no matter what the prevailing cultural trend is.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;founders&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#founders&quot; aria-label=&quot;Anchor link for: founders&quot;&gt;🔗&lt;&#x2F;a&gt;
Founders&lt;&#x2F;h3&gt;
&lt;p&gt;Mark Moore and Mai-Linh are the two main co-founders of Dharmalaya. However,
they&#x27;ve both stepped back from their roles in stewarding the institute and no
longer stay at the campus to actively grow and thrive with the community.&lt;&#x2F;p&gt;
&lt;p&gt;I see this in many communities: once led purely by the founders&#x27; vision and
drive, they&#x27;re left in a void and chaos, having to reorganize and self-govern
without the continued guidance and vision of the founding members, whether the
founders step back voluntarily or due to other circumstances.&lt;&#x2F;p&gt;
&lt;p&gt;What&#x27;s often overlooked by these communities and their founders is this path
of natural succession. How does a community grow and evolve with a completely
or even a partially non-overlapping shift of community members? Often, there&#x27;s
no governance system in place. While hierarchy is often the most optimal and
efficient organizational structure in human society at a small scale, many
altruistic and well-intentioned founders see it as a point of failure, lacking
redundancy.&lt;&#x2F;p&gt;
&lt;p&gt;However, going straight from a hierarchy to a flat organizational model simply
&lt;strong&gt;does not&lt;&#x2F;strong&gt; work. I don&#x27;t see myself visiting Dharmalaya again, but I do
know how it feels to be in a dysfunctional community now.&lt;&#x2F;p&gt;
</content>

        
          <category term="dharmalaya, dsyfunctional, institute, contemplative, permaculture, natural building, didi contractor, earthville, arts, india, bir, community, himachal pradesh, contemplative arts, vernacular" />
        

        
          <summary type="html">





View from a village near Dharmalaya

Dharmalaya is 6-acre eco-campus located near a village in Bir, Himachal
Pradesh. The institute is intentioned as an alternate school with their main
focus being on contemplative arts and teachings of the traditional practises
of natural building and agriculture in-addition to now integrating that with
permaculture principles.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Contact Improvisation as a Somatics Approach</title>
        <link href="https://shaleenjain.com/blog/ci-somatics/" type="text/html"/>
        <pubDate>2025-06-13T00:00:00+00:00</pubDate>
        <published>2025-06-13T00:00:00+00:00</published>
        <updated>2025-06-13T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/ci-somatics/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/ci-somatics/">&lt;p&gt;Contact Improvisation (CI) is the most modern Somatics practice that I&#x27;ve come
across. It combines elements of Modern dance, Martial Art with Inner physical
and spacial awareness.  It feels like a breath of fresh air among other
popular yet highly specific and isolated approaches like Yoga or Martial Arts,
which were all conceived and developed over more than a thousand years ago.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;CI not only builds on top of the principles of these few ancient somatic
practises (gravity, sense of physical touch, momentum) but also makes it a
social phenomena for human connection, something that is no longer alive with
yoga or martial arts in the modern day.&lt;&#x2F;p&gt;
&lt;p&gt;Sure there are yoga communities and martial art classes where people come
together and practise in groups but the disciple itself doesn&#x27;t have any sense
of an &quot;Open Jam&quot; or a playground where you test your skills and perception
with others in real time. Open Jams are undoubtedly a part of the CI practise
and not tacked-on on top as a social layer.&lt;&#x2F;p&gt;
&lt;p&gt;It is this improvisational aspect of CI, no drills or steps followed in
sequence, which is the essence of Open Jams that makes CI so beautifully new,
deep and a constant mirror of our emotions and our world as we perceive it.&lt;&#x2F;p&gt;
&lt;p&gt;An under discussed aspect of CI Jams is its quality of being a microcosm of
the universe, a reflection of each of our own inner worlds, projected and
played out simultaneously on one screen, in real-time.  A dancer never dances
alone, he&#x27;s always in a world of his own. Dancing with his thoughts, emotions,
questions and conflicts. In a duet, two planets cross the others orbit and
there&#x27;s a merging of their gravitational fields.  They have a play of
spinning, spiraling, colliding and slingshotting into and out of each other.&lt;&#x2F;p&gt;
&lt;figure style=&quot;width:75%;margin:auto;&quot;&gt; 


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;double-planet.fcddcdb2b006903e.jpg&quot;  &#x2F;&gt;
 &lt;figcaption&gt;Two bodies in motion
    sharing an orbital axis&lt;&#x2F;figcaption&gt; &lt;br&#x2F;&gt; &lt;&#x2F;figure&gt;
&lt;p&gt;When there&#x27;s harmony between these two dancers, they sense and exactly match
the gravitational pull of the other, equalizing and reaching an equilibrium of
frequency, energy and force, eventually being in-tune with each other.  The
dance then becomes an exchange of energies and ideas, of motions and emotions,
of presence and perception. The two worlds are no longer separate or isolated
with long distances between them, there&#x27;s a wormhole that opens up between
these two worlds, sometimes it stays open for years, other times just for a
few minutes.&lt;&#x2F;p&gt;
&lt;p&gt;When two same dancers meet again, their landscapes and geographies have
changed, and so it is a constant process of evolving, listening and fine
tuning to match and keep open this wormhole and open up yet more wormholes
between new worlds.&lt;&#x2F;p&gt;
&lt;p&gt;Once in a while you&#x27;re hit by an asteroid, a free falling celestial body that
has no or negligible gravitational force and is pulled in by the nearest
orbit. Though they are far and few in-between it&#x27;s important to acknowledge
and see these asteroids before they trigger a cataclysmic event.&lt;&#x2F;p&gt;
&lt;p&gt;Seeing the dance as a 3rd Person while being in the dance, it becomes possible
to feel the parallels between the inner and the outer world, from microcosmic
to macrocosmic.&lt;&#x2F;p&gt;
</content>

        
          <category term="contract improvisation, somatics, dance, yoga, martial arts, space, time, awareness, touch, physical, gravity, soma" />
        

        
          <summary type="html">Contact Improvisation (CI) is the most modern Somatics practice that I&#x27;ve come
across. It combines elements of Modern dance, Martial Art with Inner physical
and spacial awareness.  It feels like a breath of fresh air among other
popular yet highly specific and isolated approaches like Yoga or Martial Arts,
which were all conceived and developed over more than a thousand years ago.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Being an Adult and the Games we Play</title>
        <link href="https://shaleenjain.com/blog/being-an-adult/" type="text/html"/>
        <pubDate>2025-02-16T00:00:00+00:00</pubDate>
        <published>2025-02-16T00:00:00+00:00</published>
        <updated>2025-02-16T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/being-an-adult/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/being-an-adult/">&lt;p&gt;There&#x27;s a point in our life when we all choose to stop being a child and grow up
to be an adult. A critical situation or a circumstance that forces us to
make the choice of letting go of our innate desires and will to be free,
playful and joyful but instead take on the responsibilities and duties
necessary to survive and live in the world.&lt;&#x2F;p&gt;
&lt;p&gt;This choice however mostly comes as a coping mechanism, when we find ourselves
alone, when suddenly everyone starts pretending to be an adult, when all our
friends are too busy trying to be someone. They all start playing a game we
already know doesn&#x27;t feel fun. Yet, it seems like we have no choice but just
to &quot;grow up&quot; and play this game of life.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;The real maturity of being an adult comes however, when we are again no longer afraid
of being a child, choosing this innocence and playfulness and joy, in
everything we do, even if it means we have to be alone, or we are the only
ones doing it. For us then, fun is again the priority.&lt;&#x2F;p&gt;
&lt;p&gt;We find playfulness and joy in our daily lives, in the seriousness of work and
earning a living, we do not forget the meaning and purpose of life.
We find our role in the grand scheme of life and play it to our best.
We see ourselves as part of the whole where no single part is bigger than the other.
Whatever work we do, we are content knowing we have done our part and
duty and no longer hunger for what others have.&lt;&#x2F;p&gt;
&lt;p&gt;Then when we meet others, who are also not afraid of being their authentic inner
child, then our conversations and connection to people are not so serious, of how to
make money or of trying to prove something. Nor are they of this grandiosity or
childishness of saying &quot;I&#x27;m always right, just do what I say&quot;.
No, as mature adults we then really listen and understand the other.
We play and explore together, what really brings joy to all of us,
what is true and how do we grow together.&lt;&#x2F;p&gt;
&lt;p&gt;We make new games and we set rules of the game, not so that we can find ways of winning
or just to break the rules. But as a baseline for respecting each other and creating
a playground for exploration and fun for everyone playing the game.&lt;&#x2F;p&gt;
&lt;p&gt;As children we played games for fun but as we grow up we&#x27;re taught to compete
with each other, become better than others and ultimately win. It&#x27;s no longer
enough to just play for fun. All sports are a competition.
This creates a false association in our minds that stays for most of our lives.
We think &quot;if I&#x27;m not having fun then I must be losing&quot; or &quot;if I&#x27;m not having fun then I need to beat someone&quot;.
We get caught in a zero-sum game where we&#x27;re always taking from someone else
and not really creating something new.&lt;&#x2F;p&gt;
&lt;p&gt;Dance is one of the few physical activities that is positive-sum. Two or more
people come together, dance and interact, play with gravity, physics and
each other. And all of them leave having had fun in the process, there&#x27;s no
loser or winner.
It&#x27;s a highly creative activity, that is new and fresh every time
one steps into it. Not only is it fun, but it becomes a way for us to grow and
learn with and from each other.&lt;&#x2F;p&gt;
&lt;p&gt;The more mature adults there are, the more positive-sum games we can play and
the more we grow as a society.&lt;&#x2F;p&gt;
</content>

        
          <category term="maturity, being an adult, zero-sum games, positive-sum games, dance, sports, growing up, society, community" />
        

        
          <summary type="html">There&#x27;s a point in our life when we all choose to stop being a child and grow up
to be an adult. A critical situation or a circumstance that forces us to
make the choice of letting go of our innate desires and will to be free,
playful and joyful but instead take on the responsibilities and duties
necessary to survive and live in the world.
This choice however mostly comes as a coping mechanism, when we find ourselves
alone, when suddenly everyone starts pretending to be an adult, when all our
friends are too busy trying to be someone. They all start playing a game we
already know doesn&#x27;t feel fun. Yet, it seems like we have no choice but just
to &quot;grow up&quot; and play this game of life.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Capitalism is Build on Aesthetics</title>
        <link href="https://shaleenjain.com/blog/form-over-function/" type="text/html"/>
        <pubDate>2024-12-03T00:00:00+00:00</pubDate>
        <published>2024-12-03T00:00:00+00:00</published>
        <updated>2024-12-03T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/form-over-function/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/form-over-function/">&lt;p&gt;Contemplating on what defines a products value and its worth?&lt;&#x2F;p&gt;
&lt;p&gt;For years, societies have inherently gauged a products value via the
functionality and utility it provides to its user.
Various aspects affects a products overall utility:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Usability&lt;&#x2F;strong&gt;: In which situation does the product provide value?&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Efficiency&lt;&#x2F;strong&gt;: How best or easily does the product do the job it&#x27;s intended for?&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Durability&lt;&#x2F;strong&gt;: How long does it last?&lt;&#x2F;li&gt;
&lt;li&gt;&lt;strong&gt;Convenience&lt;&#x2F;strong&gt;: How optimal is it, in terms of weight, size, durability or
cost-effectiveness, energy use (both electrical and manual), maintainability,
among others.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Greater the functionality, the higher it&#x27;s value.
No wonder our phones cost higher than a pocket watch (&lt;code&gt;1&lt;&#x2F;code&gt; function vs &lt;code&gt;n+&lt;&#x2F;code&gt; functions.)&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;However, advent of capitalism has trained our society to value aesthetics more than functionality.
&quot;Form over Function&quot; and &quot;Sex Sells&quot; are well known slogans of capitalism.
When we value form over function it gives rise to the concept of perceived
value, then it&#x27;s a slippery slop of trying to outwit the consumer, creating
ever new trends and hype giving rise to unsustainable practises and
industries like fast fashion, fast food, fast cars, fast and cheap
constructions practises all of which leads to a detrimental effect on our
environment, our health and a never ending pursuit of gratification.&lt;&#x2F;p&gt;
&lt;p&gt;And that is frankly the root of all problems perpetuated with capitalism.
Capitalism needs an additional mechanism of checks and balances to re-align it&#x27;s
incentives back to functionality first.&lt;&#x2F;p&gt;
&lt;p&gt;Until then it&#x27;s up to us to consciously choose form over function at every turn.&lt;&#x2F;p&gt;
</content>

        
          <category term="capitalism, aesthetics, incentives, dharma, function over form, functionality, form over function" />
        

        
          <summary type="html">Contemplating on what defines a products value and its worth?
For years, societies have inherently gauged a products value via the
functionality and utility it provides to its user.
Various aspects affects a products overall utility:

Usability: In which situation does the product provide value?
Efficiency: How best or easily does the product do the job it&#x27;s intended for?
Durability: How long does it last?
Convenience: How optimal is it, in terms of weight, size, durability or
cost-effectiveness, energy use (both electrical and manual), maintainability,
among others.

Greater the functionality, the higher it&#x27;s value.
No wonder our phones cost higher than a pocket watch (1 function vs n+ functions.)</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>OSHO International Meditation Resort</title>
        <link href="https://shaleenjain.com/blog/oimr/" type="text/html"/>
        <pubDate>2024-05-14T00:00:00+00:00</pubDate>
        <published>2024-05-14T00:00:00+00:00</published>
        <updated>2024-05-14T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/oimr/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/oimr/">&lt;p&gt;The OSHO International Mediation Resort (OIMR) in Pune is a unique resort which
offers not only the traditional relaxation services of a luxury resort, Basho
Spa, swimming pool, sauna, Jacuzzi, etc. But also, true to it&#x27;s name, offers more
internal ways of relaxation. The various meditation techniques developed by
OSHO himself for the modern man, that are held throughout the day and
facilitated by many in-resident sannyasins or volunteer sannyasins.&lt;&#x2F;p&gt;
&lt;p&gt;If you manage to stay at the resort for more than a week though, you&#x27;ll
quickly see the whole place is stuck in a pattern of some sorts, across it&#x27;s
various aspects, seeping right down to it&#x27;s essential core. It&#x27;s starts from their
mundane weekly schedule of daily meditations, to the food options available at
their Zorba the Buddha restaurant.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Of course this affinity for routine and pattern is reflected by the people
living here or visiting the place often.
You&#x27;ll find the same people visiting the resort every year,
sticking to the same meditation techniques from the
few options, even down to the way people dance at the evening meeting
meditation. Everyone has their own pattern of dancing that they knowingly
repeat every time, no matter the music, their emotions or the circumstances.&lt;&#x2F;p&gt;
&lt;p&gt;A routine or a repeating structure can indeed be useful in certain situations
though. For me, travelling and being in the flow continuously can
lead to a certain exhaustion where I don&#x27;t have a chance to settle down, collect
my thoughts and then turn off my active mind enough to integrate and embody my
experiences.&lt;&#x2F;p&gt;
&lt;p&gt;Staying at the OIMR for a month as part of their Work-as-Meditation program
gave me just that exact chance. Having a set schedule laid out for me, I didn&#x27;t
have to continuously tap into how I&#x27;m feeling or flowing in order to be able
to make any decisions. Letting others, or the existence through others, make the
decisions for me on where to flow.&lt;&#x2F;p&gt;
&lt;p&gt;Letting go at a deeper level and just being aware of my resistances, of them being
intellectual or actually existential?&lt;&#x2F;p&gt;
&lt;p&gt;With no goals or destination in my mind, coupled with a few meditations I was
doing everyday, I was able to completely drop into how I was feeling at the
body-sensations level. Being aware of my emotions, feeling and letting go
of them one by one.&lt;&#x2F;p&gt;
&lt;p&gt;Learning and practising Qi Gong and Tai Chi taught at OIMR by Raj was also
surprisingly quite beneficial in pushing grounding energies throughout my body
more consciously, combining physical and psychic effort.&lt;&#x2F;p&gt;
&lt;p&gt;The few odd jobs I did at the resort, did indeed help me in growing out of my
own cocoon of feelings and energy dynamics and instead being more aware and
sensitive of other peoples energy fields. As well as how much of an effect I
can have on them, especially through my words, in addition to my actions.&lt;&#x2F;p&gt;
&lt;p&gt;Of course OSHO&#x27;s words through his video talks and books throughout my stay,
helped my get an intellectual understanding of what is happening to me as
well.&lt;&#x2F;p&gt;
&lt;p&gt;Not surprisingly, in all the communities and communes I have visited so
far, this one as well is but just a shadow of what it used to be under the
leadership and aliveness of a visionary. Stuck perpetually in a vegetative
state, left as it is by its founder.&lt;&#x2F;p&gt;
</content>

        
          <category term="review, osho, OIMR, feedback, reflections, experience, truth, totality, rajneesh, god, guru, sex, idea" />
        

        
          <summary type="html">The OSHO International Mediation Resort (OIMR) in Pune is a unique resort which
offers not only the traditional relaxation services of a luxury resort, Basho
Spa, swimming pool, sauna, Jacuzzi, etc. But also, true to it&#x27;s name, offers more
internal ways of relaxation. The various meditation techniques developed by
OSHO himself for the modern man, that are held throughout the day and
facilitated by many in-resident sannyasins or volunteer sannyasins.
If you manage to stay at the resort for more than a week though, you&#x27;ll
quickly see the whole place is stuck in a pattern of some sorts, across it&#x27;s
various aspects, seeping right down to it&#x27;s essential core. It&#x27;s starts from their
mundane weekly schedule of daily meditations, to the food options available at
their Zorba the Buddha restaurant.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Sharing Joy and Love</title>
        <link href="https://shaleenjain.com/blog/sharing-joy-love/" type="text/html"/>
        <pubDate>2024-05-13T00:00:00+00:00</pubDate>
        <published>2024-05-13T00:00:00+00:00</published>
        <updated>2024-05-13T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/sharing-joy-love/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/sharing-joy-love/">&lt;p&gt;The pain of not being able to share the joy and love you feel, with anyone,
again feels like a death process. The giving and receiving of love seems like
another duality.&lt;&#x2F;p&gt;
&lt;p&gt;In a world craving for love, we find that love comes from within before it
comes from without, and when we find it within, there&#x27;s an overwhelming sense
of sharing it without.&lt;&#x2F;p&gt;
&lt;p&gt;How do you share it when you finally have it? So far the problem was not
feeling love and compassion, now the problem is how to share it, if the other
is not in a position to receive it?  Both Physically and Energetically?&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Physically, there are space and time constraints to sharing. There are rules,
ideas and our own personal blocks, limitations and boundaries.&lt;&#x2F;p&gt;
&lt;p&gt;Energetically, we can still yet have heart to heart communications beyond
space and time. However it&#x27;s not so easy or natural for us yet to perceive
this energetic connection.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;growing-from-a-two-dimensional-love-between-two-people-to-n-dimensional-love-between-you-and-everyone-else-nature-universe-existence&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#growing-from-a-two-dimensional-love-between-two-people-to-n-dimensional-love-between-you-and-everyone-else-nature-universe-existence&quot; aria-label=&quot;Anchor link for: growing-from-a-two-dimensional-love-between-two-people-to-n-dimensional-love-between-you-and-everyone-else-nature-universe-existence&quot;&gt;🔗&lt;&#x2F;a&gt;
Growing from a two-dimensional love (between two people) to n-dimensional love (between you and everyone else&#x2F;nature&#x2F;universe&#x2F;existence)&lt;&#x2F;h4&gt;
&lt;p&gt;I&#x27;m thrown back to a sense of aloneness and separation from existence.
Important thing here is to feel and accept this yet more deeper level of aloneness
and separation.  Dropping down to a feeling at the core&#x2F;stomach&#x2F;navel of my
being.&lt;&#x2F;p&gt;
&lt;p&gt;A deeper awareness of my mind and thoughts and words and silence. Watching and
waiting. No ideas or expectations, no imagination, no fantasy or dreams can
hold my attention, everything real seems beyond the mind now. This feeling is
unexplained, so unexpected yet so simple.&lt;&#x2F;p&gt;
&lt;p&gt;My energy seems like it is in a dynamic of exchange both inside and out but
I&#x27;m so far unable to completely perceive this dynamic.
There&#x27;s yet again a tendency to attach or be identified with one expression of
this dynamic or play&#x2F;exchange of energy, that felt good while it was alive and
present.&lt;&#x2F;p&gt;
&lt;p&gt;Now that the energy has expanded, one cannot crave or cling to the same
sense of expansion. Being and staying aware of the yet more greater joys and
bliss of expansion to come, in yet more unexpected, unimaginable ways and
synchronicity of energy dynamics and play and interactions.&lt;&#x2F;p&gt;
&lt;p&gt;Being intentional of my magnetic capacity and ability, of my own sense of self-worth
and self-love and what brings me joy and happiness without judging or
comparing myself to an idea of being happy or being in love.&lt;&#x2F;p&gt;
&lt;p&gt;A deeper acceptance of my own reality and facts of my being (aloneness,
sexuality, dreams) and embracing my worthiness though that acceptance.&lt;&#x2F;p&gt;
</content>

        
          <category term="love, pain ,sharing, joy, energy, existence, growth, spiritual, navel, awareness" />
        

        
          <summary type="html">The pain of not being able to share the joy and love you feel, with anyone,
again feels like a death process. The giving and receiving of love seems like
another duality.
In a world craving for love, we find that love comes from within before it
comes from without, and when we find it within, there&#x27;s an overwhelming sense
of sharing it without.
How do you share it when you finally have it? So far the problem was not
feeling love and compassion, now the problem is how to share it, if the other
is not in a position to receive it?  Both Physically and Energetically?</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>What is The Soulful Events Newsletter?</title>
        <link href="https://shaleenjain.com/blog/why-soulfulevents/" type="text/html"/>
        <pubDate>2023-12-06T00:00:00+00:00</pubDate>
        <published>2023-12-06T00:00:00+00:00</published>
        <updated>2023-12-06T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/why-soulfulevents/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/why-soulfulevents/">&lt;p&gt;Living and staying in a city, we often look for things to do on a weekend as a fun
activity, going out or just entertainment to break out of from the work mindset
and schedule.&lt;&#x2F;p&gt;
&lt;p&gt;However most of us end up falling into another set pattern or a repeating schedule,
working on the weekdays and partying or going out on the weekends.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;soulfulevents.org&#x2F;&quot;&gt;Soulful Events Newsletter&lt;&#x2F;a&gt; is as way to find meaningful events and activities to
do, that are enriching and nourishing to the body, mind or the soul
, ideally all of them, instead of just being a activity to pass away the time.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;mission&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#mission&quot; aria-label=&quot;Anchor link for: mission&quot;&gt;🔗&lt;&#x2F;a&gt;
Mission&lt;&#x2F;h2&gt;
&lt;p&gt;Our goal is to create a community of early adopters of the New Earth. People
who are working on themselves and others via technology, products and various
works of arts to raise their and the collective consciousness of the society.&lt;&#x2F;p&gt;
&lt;p&gt;We do this by creating various platforms that act as a bazaar for exchange of
ideas, experiences and knowledge. As well as a place to meet and connect with
fellow travellers.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;vision&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#vision&quot; aria-label=&quot;Anchor link for: vision&quot;&gt;🔗&lt;&#x2F;a&gt;
Vision&lt;&#x2F;h2&gt;
&lt;p&gt;The first vision of coordination is to enable a group of community leaders to
foster a sub-community in their own vicinity, online and&#x2F;or offline, aided by
various tools and blueprints&#x2F;techniques&#x2F;processes curated and distributed
through our core community.&lt;&#x2F;p&gt;
&lt;p&gt;Most of the resources on self-exploration are shrouded by commercial gimmicks
and are out right scams that distract seeks from the true path. We achieve our
vision by mainly separating signal from noise and truths from half-truths.&lt;&#x2F;p&gt;
&lt;p&gt;The greatest tool in our mission is the referrals and recommendations of our
community members since truth itself cannot be shared directly but the ways of
igniting the spark in another can be.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;target-audience&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#target-audience&quot; aria-label=&quot;Anchor link for: target-audience&quot;&gt;🔗&lt;&#x2F;a&gt;
Target Audience&lt;&#x2F;h3&gt;
&lt;p&gt;City dwelling seekers and pilgrims that are living within a society with
integration.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;principles&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#principles&quot; aria-label=&quot;Anchor link for: principles&quot;&gt;🔗&lt;&#x2F;a&gt;
Principles&lt;&#x2F;h3&gt;
&lt;p&gt;Events that have an essences of self-exploration and inquiry. Performances,
workshops and gatherings that, shares&#x2F;creates a space from the experiences of their own journey
towards inner peace and silence expressed through various means (music, dance,
art, poetry, etc) or teaches the way and techniques to others so they may walk
the path and experience on their own.&lt;&#x2F;p&gt;
&lt;p&gt;While selecting&#x2F;curating events it is good to think through various perspectives:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Would you yourself like to go to such an event?&lt;&#x2F;li&gt;
&lt;li&gt;Looking from the readers perspective, does the event page have enough information to make sense to the reader?&lt;&#x2F;li&gt;
&lt;li&gt;Is it a purely commercial or entertaining event? If yes, then it’s most likely does not fit under soulful events&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;get-involved&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#get-involved&quot; aria-label=&quot;Anchor link for: get-involved&quot;&gt;🔗&lt;&#x2F;a&gt;
Get Involved&lt;&#x2F;h3&gt;
&lt;p&gt;If Soulful Events calls to you, sign up for the newsletter over at the
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;soulfulevents.org&#x2F;&quot;&gt;Soulfulevents&lt;&#x2F;a&gt; website.&lt;&#x2F;p&gt;
&lt;p&gt;If there isn&#x27;t a newsletter running for your city or town yet and you&#x27;d like to
lead the curation yourself, reach out to me for ways to contribute.&lt;&#x2F;p&gt;
&lt;p&gt;Described below is the process of how we generally structure a newsletter but
you&#x27;d have the flexibility and space to experiment your own style.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-process&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-process&quot; aria-label=&quot;Anchor link for: the-process&quot;&gt;🔗&lt;&#x2F;a&gt;
The Process&lt;&#x2F;h3&gt;
&lt;p&gt;We create different sections within the soulful events newsletter for other
cities&#x2F;locations and give access to the respective curators of that location.&lt;&#x2F;p&gt;
&lt;p&gt;If there’s multiple people curating for a location it’s recommend to create a
draft of the post on a real-time editing platform like Google docs or
&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;hack.md&quot;&gt;hack.md&lt;&#x2F;a&gt; since the ghost&#x2F;substack editor does not work well for multiple people editing at the same time.&lt;&#x2F;p&gt;
&lt;p&gt;Things to note:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Published every Wednesday&lt;&#x2F;li&gt;
&lt;li&gt;Format:
&lt;ul&gt;
&lt;li&gt;Event title:  Links to the event page, day, date (all in bold)&lt;&#x2F;li&gt;
&lt;li&gt;Description:  Limit to one paragraph that covers the gist of the event.
For more details readers can visit the event page&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>

        
          <category term="soulful events, events, newsletter, soulful, soul, introspection, community, india, bangalore, self-work, inner-work" />
        

        
          <summary type="html">Living and staying in a city, we often look for things to do on a weekend as a fun
activity, going out or just entertainment to break out of from the work mindset
and schedule.
However most of us end up falling into another set pattern or a repeating schedule,
working on the weekdays and partying or going out on the weekends.
Soulful Events Newsletter is as way to find meaningful events and activities to
do, that are enriching and nourishing to the body, mind or the soul
, ideally all of them, instead of just being a activity to pass away the time.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>The Joys of Traveling</title>
        <link href="https://shaleenjain.com/blog/joys-of-traveling/" type="text/html"/>
        <pubDate>2023-11-24T00:00:00+00:00</pubDate>
        <published>2023-11-24T00:00:00+00:00</published>
        <updated>2023-11-24T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/joys-of-traveling/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/joys-of-traveling/">&lt;p&gt;Traveling, the act of going from place to place. It can be such a simple yet magical experience.
You hop on a bus, a train or a airplane
and within a few hours you&#x27;re transported to another microcosm on earth, with
it&#x27;s own weather conditions, set of people, flora and fauna. With different places to see,
be in and do things.&lt;&#x2F;p&gt;
&lt;p&gt;We, as a species have always been travelers first and settlers&#x2F;farmers later.
It was this nomadic nature that allowed Homo Sapiens to
evolve and survive over not so fortunate Neanderthals.
We can see this in children, who naturally want to explore the world around them.
Look at everything in its rawness, taste it, smell it and play with it.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;However, by the time we grow up, we end up justify to ourselves that it&#x27;s not so easy,
there are rules and responsibilities that we must take up in order to survive in this
world and fit in. The more I grew up the more I started to think of traveling
as a privilege and a luxury.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s this fear and scarcity based thinking and in-turn living,
accentuated by the Covid-19 pandemic of 2020 and 2021, that
I&#x27;ve been on a journey to transform into an abundance mindset ever since.&lt;&#x2F;p&gt;
&lt;!-- toc --&gt;
&lt;h3 id=&quot;what-does-traveling-mean-for-you&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#what-does-traveling-mean-for-you&quot; aria-label=&quot;Anchor link for: what-does-traveling-mean-for-you&quot;&gt;🔗&lt;&#x2F;a&gt;
What does traveling mean for You?&lt;&#x2F;h3&gt;
&lt;p&gt;What does it mean to travel today? Is it just crossing a checklist of places and
countries to visit? Taking pictures of yourself at popular destinations as a
badge of accomplishment? Bragging about places you&#x27;ve been to at dinner
conversations? Or is there something more to it.&lt;&#x2F;p&gt;
&lt;p&gt;For me travelling is stepping out of one&#x27;s comfort zone. A journey of
self-discovery that starts with an outward physical journey of exploration and
discovery. Of meeting new people and discovering new places. Travelling off
the beaten path and doing things that you always wanted to do but were
too scared to try. Facing your fears and challenges and not looking for
convenience everywhere you go.&lt;&#x2F;p&gt;
&lt;p&gt;Travelling can also bring up emotions and feelings that you might not have
addressed before in your daily life, it&#x27;s easier to distract yourself in
a routine, finding excuses to keep on moving or blaming people&#x2F;circumstances rather
than taking some time out to rest and introspect.&lt;&#x2F;p&gt;
&lt;p&gt;While travelling, you invariable face situations out of your control and
quickly learn to let go and accept things being out of your control
instead of worrying about it at every turn. It is because of these out of your
control situations, you get a chance to rest and face your emotions.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;traveling-as-a-local&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#traveling-as-a-local&quot; aria-label=&quot;Anchor link for: traveling-as-a-local&quot;&gt;🔗&lt;&#x2F;a&gt;
Traveling as a local&lt;&#x2F;h3&gt;
&lt;p&gt;You&#x27;ve most likely only been exposed to one way of travelling, i.e. &quot;Traveling
as the Rich&quot; that&#x27;s the most common way of traveling that&#x27;s talked about in
media, movies and in general.
However there&#x27;s another approach that I like to describe as
&quot;Traveling as a local&quot;&lt;&#x2F;p&gt;
&lt;p&gt;Traveling as local means you don&#x27;t see
yourself as separate from the place your traveling to, you don&#x27;t try to
shield your self from the grey and not so pleasant areas of a place. You
embrace the people, the language, the food, the culture and the beauty
but also the issues of the area and it&#x27;s inhabitants.&lt;&#x2F;p&gt;
&lt;p&gt;Some of the simplest ways of doing so is by staying at a place for a longer
period of time than your normal hit-and-run travels&#x2F;weekend gateways,
letting you stay in guesthouses and hostels or even rent an apartment,
eating where the locals eat, talking to the locals and traveling as the locals
do.&lt;&#x2F;p&gt;
&lt;p&gt;Travelling by not planning every detail but giving yourself the time and space
to be in the flow, go where you feel and are called to.
Avoid the tourist traps and places, it&#x27;s good to visit them &lt;em&gt;if&lt;&#x2F;em&gt; you
have the time but don&#x27;t make them the main agenda of your travels.
Checkout the natural beauty of a place, hang out where the local hangout and experience
some of the local culture, their art, music, theater and museums.&lt;&#x2F;p&gt;
&lt;p&gt;This is how I was able to connect and resonate with a lot of places and
it&#x27;s people as well as get a sense of the history and the economy of the place.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;lifestyles&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#lifestyles&quot; aria-label=&quot;Anchor link for: lifestyles&quot;&gt;🔗&lt;&#x2F;a&gt;
Lifestyles&lt;&#x2F;h3&gt;
&lt;p&gt;When traveling and living as a local, how do you sustain your lifestyle?
Many locals are able to live and stay at a place for years by working location-dependent jobs.
However, just because you are traveling as a local,
does it mean your only option is to work as a local?&lt;&#x2F;p&gt;
&lt;p&gt;There are various lifestyles that can lets you travel and work across the global,
known as location-independent jobs.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Digital nomad or remote worker&lt;&#x2F;li&gt;
&lt;li&gt;Gig worker&lt;&#x2F;li&gt;
&lt;li&gt;Volunteer&lt;&#x2F;li&gt;
&lt;li&gt;Travelling skilled worker&lt;&#x2F;li&gt;
&lt;li&gt;Artist&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;It&#x27;s up to you to find and create your perfect lifestyle, just know that
there&#x27;s no one way or an only way to do it.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;digital-nomadism&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#digital-nomadism&quot; aria-label=&quot;Anchor link for: digital-nomadism&quot;&gt;🔗&lt;&#x2F;a&gt;
Digital Nomadism&lt;&#x2F;h3&gt;
&lt;p&gt;I have been living and working as a Digital Nomad for over two years now.&lt;&#x2F;p&gt;
&lt;p&gt;A Digital Nomad is someone who works remotely via the internet and travels freely
across jurisdictions and geographies. Being a digital nomad, you get to
leverage things like &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;vadithya.com&#x2F;what-is-longitudinal-arbitrage&#x2F;&quot;&gt;Longitudinal Arbitrage&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nomadcapitalist.com&#x2F;flag-theory&#x2F;&quot;&gt;Flag&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sovereign.cafe&#x2F;embracing-flag-theory-a-comprehensive-guide-to-understanding-and-achieving-global-diversification&#x2F;&quot;&gt;Theory&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;dougantin.com&#x2F;the-sovereign-individual-what-you-need-to-know-why&#x2F;&quot;&gt;Individual
Sovereignty&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;For me it&#x27;s been a progressive journey from having my first remote job, to
embracing the digital nomad lifestyle and then eventually building
companies and owning assets across jurisdictions. I have utilised multiple
tools on my path so far including Estonia&#x27;s &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;shaleenjain.com&#x2F;blog&#x2F;review-e-residency&#x2F;&quot;&gt;E-Residency&lt;&#x2F;a&gt;, cryptocurrencies
and of course SaaS platforms and tools.&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;re various perks of the nomadic life:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Working from café&#x27;s with views and vibes&lt;&#x2F;li&gt;
&lt;li&gt;Living in communities and communes where there&#x27;s a stronger sense of
connection outside of work like Auroville, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;lifeitself.org&#x2F;hubs&#x2F;bergerac&quot;&gt;The Bergerac Praxis Hub&lt;&#x2F;a&gt;, startup hubs like Bangalore and
Lisbon, etc&lt;&#x2F;li&gt;
&lt;li&gt;Purchasing power arbitrage of earning in USD
and living and spending in places with a much lower cost of living like Thailand, India
or others via &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;nomadlist.com&#x2F;&quot;&gt;nomadlist&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;However it&#x27;s quite important to have a balance between remote work and social-life
balance and as well as getting to know your teammate via gatherings and team
retreats.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;my-experience&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#my-experience&quot; aria-label=&quot;Anchor link for: my-experience&quot;&gt;🔗&lt;&#x2F;a&gt;
My Experience&lt;&#x2F;h3&gt;
&lt;p&gt;My first impetus for travelling was to get out of the feeling of suffocation and choking,
quite literally. Living and working remotely from Delhi, I developed a severe
allergic reaction to air pollution causing me to fall sick every few months with
a progressively deteriorating effect on my immunity and mental health.
I was stuck in a prison of my own making, further exaggerated by the Covid-19 induced lockdown.&lt;&#x2F;p&gt;
&lt;p&gt;The first solo travelling trip was a huge step out
of my comfort zone and to start socializing despite my crippling social anxiety
and insecurities around being alone.&lt;&#x2F;p&gt;
&lt;p&gt;Breaking my fear of not fitting in and always being seen as an
outcast or weird person was easier when I met people on my travels who were equally unique and
different and seemed to embrace their uniqueness, at least to a greater level
than me and anyone else I had met before.&lt;&#x2F;p&gt;
&lt;p&gt;Once I had a taste and the confidence to travel
alone without any paranoia or limiting beliefs, my main motivation for
traveling became a quest of finding people like me who were also
on a existential journey of their own.&lt;&#x2F;p&gt;
&lt;p&gt;I went to places that had always called out to me the most but I was too scared
to go, not sure of the logistics, the people, culture, etc.&lt;&#x2F;p&gt;
&lt;p&gt;I visited the Osho Meditation resort in Pune first, not knowing what I was
getting into. However that was a quite normalizing experience. Nothing
remarkable, controversial or mindblowing happened but just being in an
environment where people were freely talking and practising mediation and
spirituality made it so much more easier for me to accept that part of me and
go deeper into my own practise.&lt;&#x2F;p&gt;
&lt;p&gt;Not long after completing my first heart-led trip that led to the expansion
and growth of my inner journey, I soon found what I was looking for. An
encounter with a group of people I couldn&#x27;t have ever expected to meet. The
level of connection and bond we ended up creating and having is now a lifelong bond.&lt;&#x2F;p&gt;
&lt;p&gt;We ended up traveling together to quite a few places but also stayed over at one
city for more that seven months just because of this group of people that
became my friends, business partners, mentors and fellow travellers and
pilgrims on our individual inner journeys.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;people&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#people&quot; aria-label=&quot;Anchor link for: people&quot;&gt;🔗&lt;&#x2F;a&gt;
People&lt;&#x2F;h3&gt;
&lt;p&gt;The most interesting part of traveling is the people you meet. Traveling,
meeting and talking to people really helps you widen your mindset, break out of
your comfort zone and develop social and conversational skills.&lt;&#x2F;p&gt;
&lt;p&gt;All in a low stakes environment, if you mess up there&#x27;s no risk of &quot;destroying your
reputation&quot;, which is an irrational fear, that at least I had growing up.
Of saying something that is not socially accepted or you&#x27;re not good at and
then regret being made fun of because of something you said
casually. That&#x27;s the great thing about traveling, you&#x27;re always temporal in
space, naturally making you de-attached to places, people and expectations.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;relationships&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#relationships&quot; aria-label=&quot;Anchor link for: relationships&quot;&gt;🔗&lt;&#x2F;a&gt;
Relationships&lt;&#x2F;h3&gt;
&lt;p&gt;While traveling you meet and come across people of varied interest and
personalities. As well as people in various kinds of relationships and degrees of
being in love. My own definition of what is love has evolved so much over the
years. No longer do I see it with the same lens that I used to, nor
have a fixed idea of what an &quot;ideal&quot; relationship looks like.&lt;&#x2F;p&gt;
&lt;p&gt;Traveling let&#x27;s you really figure out what is it that you really want with
yourself and in a potential partner. Solo travelling is also a great way to
really be with the feeling of being alone and not always find ways of running away from it.
When I accepted the fact of being alone, I also started seeing the positive
aspects of being alone, starting to enjoy my own company, taking things slow,
setting my own schedule, finding independence and capacity of handing things
on my own. Understanding and acknowledging my needs as well as recognising
what are some of my own gifts and abilities that I can use to fulfill someones
needs.&lt;&#x2F;p&gt;
&lt;p&gt;What I&#x27;ve found is when I&#x27;m capable of being joyful in aloneness,
I am able to share that joy with other fellow solo travellers and pilgrims.&lt;&#x2F;p&gt;
</content>

        
          <category term="traveling, pilgrimage, journey, joys, fun, osho mediation, osho meditation resort, solo traveling, backpacking, how to travel, why travel, covid travel, covid-19, pilgrims, inner journey" />
        

        
          <summary type="html">Traveling, the act of going from place to place. It can be such a simple yet magical experience.
You hop on a bus, a train or a airplane
and within a few hours you&#x27;re transported to another microcosm on earth, with
it&#x27;s own weather conditions, set of people, flora and fauna. With different places to see,
be in and do things.
We, as a species have always been travelers first and settlers&#x2F;farmers later.
It was this nomadic nature that allowed Homo Sapiens to
evolve and survive over not so fortunate Neanderthals.
We can see this in children, who naturally want to explore the world around them.
Look at everything in its rawness, taste it, smell it and play with it.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>My Personal Journey and Why I&#x27;m building a New Earth</title>
        <link href="https://shaleenjain.com/blog/personal-story-and-new-earth/" type="text/html"/>
        <pubDate>2023-09-30T00:00:00+00:00</pubDate>
        <published>2023-09-30T00:00:00+00:00</published>
        <updated>2023-09-30T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/personal-story-and-new-earth/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/personal-story-and-new-earth/">&lt;p&gt;I was born in a middle class family in the centre of Delhi to parents who each had
four and three siblings themselves. Both my parents have struggled to purse higher
education and earn a decent living as professionals. My mother is now a professor
in DU and my father is retired having worked as a bank manager.&lt;&#x2F;p&gt;
&lt;p&gt;Having had a humble beginning, I always asked my parents how as a society
we’ve not managed to ensure 24&#x2F;7 supply of water and electricity.
Even as a child I asked why do we need to pay for water supply.
Isn’t water freely available throughout the earth?&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Fed up with my relentless questions of a society with a better quality of life,
my parents eventually moved us to a condo where we didn’t have to rush out to a
water tanker and wait in the queue for water, just to take a bath early in the morning,
whenever the whole neighbourhoods water supply ran out.&lt;&#x2F;p&gt;
&lt;p&gt;In the condominium we had 24&#x2F;7 ground water supply and power backup, but at a higher cost in terms of maintenance.
This showed me economies of scale work, when we as a society collectively demand a better quality of life.&lt;&#x2F;p&gt;
&lt;p&gt;However this led to me question why is it that not everyone is demanding a better
quality of life, why are people not making sure the government provides everyone
a better quality of life rather than relying on private infrastructure by corporations.
Is it that they don’t want it? Or is it that they feel they don’t deserve it?
Or maybe they’ve tried fighting for their rights and given up? Or rather they feel
it’s easier to improve their own lives than work together with others to better everyone’s lives.&lt;&#x2F;p&gt;
&lt;p&gt;Sitting in the bus or a cab while going and coming back from school, I used to look
at all the different ways people go on about their lives on the street.
First I used to think about economic models, why is there an economic disparity.
Why is a person sitting on the street selling fruits and not doing something better or more productive&#x2F;lucrative?&lt;&#x2F;p&gt;
&lt;p&gt;Is it true that not everyone provides enough value to a society to justify having
equal income and thus hierarchy in a society is natural. Assuming that to be true,
then why does not everyone have an equal level of intelligence or is it just that
not everyone has been given a equal opportunity to develop their intelligence and mind.&lt;&#x2F;p&gt;
&lt;p&gt;Soon I realised it’s not just intelligence a society needs to thrive.
There’s something else that drives people to use their intelligence in a short-sighted manner.
Humans are mostly emotionally driven beings. For the most part of the human history,
humans have been driven by fear. Fear of survival that translates to greed, gluttony, lust, violence, etc.&lt;&#x2F;p&gt;
&lt;p&gt;This is something I saw distinctly in the various instances of me being bullied in school.
My peers trying to show dominance in order to be accepted by their other peers.
Conformance and being part of a group has always made humans feel a sense of safety and control.
More than their peers, it’s their parents and teachers approval that they sought.
And adults seemed to have reached a conclusion that keeping one’s head down and
being conformant to whatever the current society deems normal is the best way of survival.&lt;&#x2F;p&gt;
&lt;p&gt;I was always an outcast, not afraid of speaking my truth. Did what I wanted to do or at least tired to do so.
It was not long before I understood it’s not so easy to share one’s truth,
not until the other is ready or willing to accept a truth.
I accepted this reality and started working on my own, in the shadows,
on ways I though I could best improve the world.
Found the least violent and high leverage way of making a positive impact on the world.&lt;&#x2F;p&gt;
&lt;p&gt;As I embarked on this journey I found a gapping whole in my chest.
Why was I doing this? Why do I need to improve the world?
Who am I to better this society? What is my motivation to do so?&lt;&#x2F;p&gt;
&lt;p&gt;My first realisation was, this was my way of feeling worthy enough of being loved.
If I could make this world a better place, perhaps it would be able to love me or
at least acknowledge me for who I am and I could grow to love it as well.
I would learn much later, that my feeling of abandonment and lack of self-worth
came from a childhood incident that I didn’t feel safe enough to accept and process at that point.&lt;&#x2F;p&gt;
&lt;p&gt;However that was only a part of the reason. I had reached a point in my life where
I felt good enough to be loved, if not by the world, at least one person.
I fell in love but then quickly realised I know nothing about love! What is love?
How do you love? Is it something you do or feel? How do you express that love?&lt;&#x2F;p&gt;
&lt;p&gt;My first love didn’t materialise into anything because I was grossly inept.
This was the phase in college I started going deep into philosophy,
I read multiple books on topics as diverse as spiritualism, love, mysticism, Sufism, consciousness.
I dived head first into spirituality and tried to understand my own inability to love.
My spiritual journey started in 2015 and still continues till this day.&lt;&#x2F;p&gt;
&lt;p&gt;As I read through “The Adventures of Consciousness” By Satprem,
I see now that the earth doesn’t need people with more advanced minds and intellect,
no that’ll still lead to a divided society, beautiful, yet still divided by infinite true perspectives.&lt;&#x2F;p&gt;
&lt;p&gt;What we need is a world led by love, a global consciousness with enough space for
innumerable possibilities, diversity and expressions of life without mutilating it.
This is what I envision as the New Earth.&lt;&#x2F;p&gt;
&lt;p&gt;Follow along at &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;newgaia.earth&quot;&gt;https:&#x2F;&#x2F;newgaia.earth&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
</content>

        
          <category term="new earth, new earth collective, personal journey, personal story, shaleen, newcollective.earth, life journey, shaleen&#x27;s journey, unipeer, founder, motivation, reason, purpose" />
        

        
          <summary type="html">I was born in a middle class family in the centre of Delhi to parents who each had
four and three siblings themselves. Both my parents have struggled to purse higher
education and earn a decent living as professionals. My mother is now a professor
in DU and my father is retired having worked as a bank manager.
Having had a humble beginning, I always asked my parents how as a society
we’ve not managed to ensure 24&#x2F;7 supply of water and electricity.
Even as a child I asked why do we need to pay for water supply.
Isn’t water freely available throughout the earth?</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Getting started with Ethereum and Solidity</title>
        <link href="https://shaleenjain.com/blog/learning-solidity/" type="text/html"/>
        <pubDate>2023-09-29T00:00:00+00:00</pubDate>
        <published>2023-09-29T00:00:00+00:00</published>
        <updated>2023-09-29T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/learning-solidity/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/learning-solidity/">&lt;p&gt;If you&#x27;re just getting started with blockchain and web3 and looking to get
your hands dirty by writing some code, you might be overwhelmed by the
plethora of freely accessible resources around Ethereum, Solidity and
blockchain in general.&lt;&#x2F;p&gt;
&lt;p&gt;Having worked in the blockchain space for 5+ years now and for two startups
writing Solidity smart contracts, I&#x27;ve been asked many times about how does one get
started with learning solidity and even more so writing production quality
smart contracts with no major vulnerabilities.&lt;&#x2F;p&gt;
&lt;p&gt;I attempt to share here a curated list of resources that&#x27;ll not overwhelm you
but gently guide to dipping your toes in the web3 waters.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h3 id=&quot;overview&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#overview&quot; aria-label=&quot;Anchor link for: overview&quot;&gt;🔗&lt;&#x2F;a&gt;
Overview&lt;&#x2F;h3&gt;
&lt;p&gt;Before getting started with learning solidity and diving head first into coding,
it&#x27;ll be much more easier for you to learn, think and debug your code when
you have a deeper understanding of the inner workings of a blockchain and
what happens when you deploy a smart contract.&lt;&#x2F;p&gt;
&lt;p&gt;Lots of initial questions and queries around, &quot;What is a web3 wallet?&quot;, &quot;Why do you sign
messages?&quot;, &quot;What are addresses?&quot;, &quot;Where does the code live?&quot;, etc get
answered when you know what makes blockchain&#x2F;Web3 different from Web2.&lt;&#x2F;p&gt;
&lt;p&gt;The best way to get a better understanding of the architecture of blockchains
in general is to read the OG &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bitcoin.org&#x2F;en&#x2F;bitcoin-paper&quot;&gt;Bitcoin whitepaper&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Bitcoin is what started the blockchain revolution and all the new blockchains are
heavy inspired by it and still use a lot of the same components and concepts.&lt;&#x2F;p&gt;
&lt;p&gt;Ethereum takes it a step further by extending the concepts of Bitcoin to a
finite Turing machine, letting you program any application in the context and
execution environment of a blockchain.&lt;&#x2F;p&gt;
&lt;p&gt;Learn more about Ethereum &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;ethereum.org&#x2F;en&#x2F;learn&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;solidity&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#solidity&quot; aria-label=&quot;Anchor link for: solidity&quot;&gt;🔗&lt;&#x2F;a&gt;
Solidity&lt;&#x2F;h3&gt;
&lt;p&gt;Once you have a nice overview of the inner workings of a blockchain we can
now proceed to learning solidity.&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;s of course the official &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;docs.soliditylang.org&#x2F;en&#x2F;v0.8.21&#x2F;&quot;&gt;Solidity Lang documentation&lt;&#x2F;a&gt; and API reference,
however the solidity ReadTheDocs page isn&#x27;t a great place to start with, it&#x27;s
nice to always have that handy for references and as a source of truth but
I wouldn&#x27;t start with just going through the whole documentation in one go.&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;re beautiful gamified learning courses that the community has created
over the years and one of my favourites is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;cryptozombies.io&#x2F;&quot;&gt;cryptozombies&lt;&#x2F;a&gt;. It&#x27;s created as a
hands-on approach of starting with small modules as projects and builds up to
a complete game all the while introducing you to all the different concepts and
standards of Solidity and Ethereum.&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;s a few other tools and courses in the same vein that you&#x27;ll find listed
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;ethereum.org&#x2F;en&#x2F;developers&#x2F;learning-tools&#x2F;&quot;&gt;here&lt;&#x2F;a&gt; by Ethereum Foundation.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;mastering-solidity&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#mastering-solidity&quot; aria-label=&quot;Anchor link for: mastering-solidity&quot;&gt;🔗&lt;&#x2F;a&gt;
Mastering Solidity&lt;&#x2F;h3&gt;
&lt;p&gt;You should now have a solid base and understanding of solidity. But getting
started is the easy part, mastering solidity and avoiding the common pitfalls
and bugs that can lead to multi-million dollar hacks is the tough part.&lt;&#x2F;p&gt;
&lt;p&gt;Staying up to date with the latest developments and changes in the ecosystem
is the best way to be aware of new kinds of vulnerabilities and security best practises.&lt;&#x2F;p&gt;
&lt;p&gt;However you can quickly catch up to the current state of the art via &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;consensys.github.io&#x2F;smart-contract-best-practices&#x2F;&quot;&gt;Consensys
Smart contract Best Practises&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;consensys.io&#x2F;diligence&#x2F;research&#x2F;&quot;&gt;Consensys Diligence Research&lt;&#x2F;a&gt;. As
well as case studies of &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;OriginProtocol&#x2F;security&#x2F;tree&#x2F;master&#x2F;incidents&quot;&gt;past DeFi hacks&lt;&#x2F;a&gt; curated by Origin Protocol.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;closing&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#closing&quot; aria-label=&quot;Anchor link for: closing&quot;&gt;🔗&lt;&#x2F;a&gt;
Closing&lt;&#x2F;h3&gt;
&lt;p&gt;That&#x27;s it, if you&#x27;ve gone through all the resources here, you&#x27;re a long way
ahead. Of course the learning doesn&#x27;t stop here, there&#x27;s always new protocols
and applications being built on Ethereum and they can come with their own set
of domain expertise and pre-requisite knowledge.&lt;&#x2F;p&gt;
&lt;p&gt;You should now have the tools and resources to tackle those projects or
even go build your own!&lt;&#x2F;p&gt;
</content>

        
          <category term="solidity, ethereum, learning, course, resources, solidity starter, getting started, smart contract, hacking, vulnerability, cryptozombie, solidity course, learning solidity" />
        

        
          <summary type="html">If you&#x27;re just getting started with blockchain and web3 and looking to get
your hands dirty by writing some code, you might be overwhelmed by the
plethora of freely accessible resources around Ethereum, Solidity and
blockchain in general.
Having worked in the blockchain space for 5+ years now and for two startups
writing Solidity smart contracts, I&#x27;ve been asked many times about how does one get
started with learning solidity and even more so writing production quality
smart contracts with no major vulnerabilities.
I attempt to share here a curated list of resources that&#x27;ll not overwhelm you
but gently guide to dipping your toes in the web3 waters.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Why Deploy your Own VPN Server?</title>
        <link href="https://shaleenjain.com/blog/deploy-self-vpn/" type="text/html"/>
        <pubDate>2023-07-28T00:00:00+00:00</pubDate>
        <published>2023-07-28T00:00:00+00:00</published>
        <updated>2023-07-28T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/deploy-self-vpn/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/deploy-self-vpn/">&lt;h3 id=&quot;background-and-motivation&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#background-and-motivation&quot; aria-label=&quot;Anchor link for: background-and-motivation&quot;&gt;🔗&lt;&#x2F;a&gt;
Background and Motivation&lt;&#x2F;h3&gt;
&lt;p&gt;VPNs have become a requirement in many countries and for many professionals across
countries to be able to do their work and maintain a level of safely and anonymity
that&#x27;s increasing disparate with the modern internet.&lt;&#x2F;p&gt;
&lt;p&gt;However, VPN services provided by centralized VPN providers just shifts the
responsibility of maintaining user privacy and safely from decentralized
ISP&#x27;s to centralized entities.&lt;&#x2F;p&gt;
&lt;p&gt;Many VPN providers still record logs of their users, either knowing or unknowing
for the purposes of having an analytical and billing system. As we have seen
time and time again, it is this metadata that many of these centralized entities
can be force to hand over and can successfully be used to reconstruct online
activity and user identity. More over they often provide a degraded user experience
by way of having shared &quot;public&quot; servers that many users are routed through to
the open internet simultaneously.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;With the proliferation and scale of cloud computing providers that provide the
raw resources of a VPN server across geolocations, it no longer makes sense to
pay a specialized service provider for general resources with unit economics with
just a software slapped on top. Especially when the software that does most of the
heavy lifting is a Free and Open Source Software.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;solution&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#solution&quot; aria-label=&quot;Anchor link for: solution&quot;&gt;🔗&lt;&#x2F;a&gt;
Solution&lt;&#x2F;h3&gt;
&lt;p&gt;While it does take some expertise to deploy your own VPN server solution on a
cloud provider, it is a one time cost that truly provides the benefits of a
VPN server and keeps you in control of your privacy and data across multiple
levels of the infrastructure.&lt;&#x2F;p&gt;
&lt;p&gt;Automation and abstraction continue to make it possible to deploy your own
server without increasing expertise and domain knowledge for a wider group of users.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;selfvpn.8bitlabs.tech&#x2F;&quot;&gt;SelfVPN&lt;&#x2F;a&gt; is my attempt at providing a set of tools and guides that lets anyone
DIY their own VPN server while maintaining ownership and sovereignty of their
data and identity.&lt;&#x2F;p&gt;
&lt;video playsinline=&quot;&quot; loop=&quot;&quot; autoplay=&quot;&quot; muted=&quot;&quot; style=&quot;width:100%;height:auto;display:block;margin:0&quot;&gt;
  &lt;source src=&quot;freevpn-algo-x3-take8.mp4&quot; type=&quot;video&#x2F;mp4&quot;&gt;
&lt;&#x2F;video&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;selfvpn.8bitlabs.tech&#x2F;&quot;&gt;SelfVPN&lt;&#x2F;a&gt; deploys a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.wireguard.com&#x2F;&quot;&gt;Wireguard&lt;&#x2F;a&gt; VPN server using the excellent &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;trailofbits&#x2F;algo&quot;&gt;Algo&lt;&#x2F;a&gt; ansible
playbook by Trait of Bits consulting company.
It builds on their work to package the script in a cloud execution
environment with all the prerequisite dependencies and software pre-installed.
As well as bring all documentation together in a step by step manner.&lt;&#x2F;p&gt;
&lt;p&gt;Please give it a shot, and I appreciate any feedback I can get to make the setup
even easier to use.&lt;&#x2F;p&gt;
</content>

        
          <category term="vpn, self-host, self deploy, deploy, selfvpn, self-deploy, algo, wireguard, ansible, google cloud shell, free vpn, free, zero-cost, virtual private network, gumroad" />
        

        
          <summary type="html">🔗
Background and Motivation
VPNs have become a requirement in many countries and for many professionals across
countries to be able to do their work and maintain a level of safely and anonymity
that&#x27;s increasing disparate with the modern internet.
However, VPN services provided by centralized VPN providers just shifts the
responsibility of maintaining user privacy and safely from decentralized
ISP&#x27;s to centralized entities.
Many VPN providers still record logs of their users, either knowing or unknowing
for the purposes of having an analytical and billing system. As we have seen
time and time again, it is this metadata that many of these centralized entities
can be force to hand over and can successfully be used to reconstruct online
activity and user identity. More over they often provide a degraded user experience
by way of having shared &quot;public&quot; servers that many users are routed through to
the open internet simultaneously.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>My Journey with Estonia&#x27;s E-residency program</title>
        <link href="https://shaleenjain.com/blog/review-e-residency/" type="text/html"/>
        <pubDate>2022-10-26T00:00:00+00:00</pubDate>
        <published>2022-10-26T00:00:00+00:00</published>
        <updated>2022-10-26T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/review-e-residency/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/review-e-residency/">&lt;h2 id=&quot;overview&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#overview&quot; aria-label=&quot;Anchor link for: overview&quot;&gt;🔗&lt;&#x2F;a&gt;
Overview&lt;&#x2F;h2&gt;
&lt;p&gt;Estonia has a robust online and digital platform for availing all government
services and accessing gov website by virtue of a digital ID card that is issued to every
citizen.&lt;&#x2F;p&gt;
&lt;p&gt;Estonia&#x27;s &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.e-resident.gov.ee&#x2F;&quot;&gt;E-residency&lt;&#x2F;a&gt; program is an extension of that infrastructure that lets
any non-citizen of Estonia get access to their digital
government services from anywhere across the globe.
This includes being able to incorporate and run a
business, file taxes, etc completely online and remotely.&lt;&#x2F;p&gt;
&lt;p&gt;Here I describe how my experience of being an e-resident and running an online
business has been.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;!-- toc --&gt;
&lt;h2 id=&quot;getting-the-e-residency-card&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#getting-the-e-residency-card&quot; aria-label=&quot;Anchor link for: getting-the-e-residency-card&quot;&gt;🔗&lt;&#x2F;a&gt;
Getting the E-residency card&lt;&#x2F;h2&gt;
&lt;p&gt;To become an e-resident, actually &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.e-resident.gov.ee&#x2F;become-an-e-resident&#x2F;&quot;&gt;applying&lt;&#x2F;a&gt; to the e-residency program is quite straightforward and a
completely online process. You fill up the form and provide a statement of
purpose with your current&#x2F;future business model or services you provide.
With me being an android developer and having a few apps on the play store,
I attached a screenshot of my Play Store Developer page, just to make it
easier for them.&lt;&#x2F;p&gt;
&lt;p&gt;Applications for e-residency are usually quite easily accepted especially if your
business or service is inherently digital, online and location
independent.&lt;&#x2F;p&gt;
&lt;p&gt;Once your application is accepted, you&#x27;ll receive an email with details on how
to collect your ID card from the nearest collection point. Most likely it&#x27;s the
Estonian embassy that&#x27;s near to you. Once there, they&#x27;ll verify your
passport and scan your fingerprints for their records. You should have
now gotten a box on the way out which contains the e-residency ID card, USB card reader,
the cards secret PIN and PIN2 and a few informational documents.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;using-the-digital-id-card&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#using-the-digital-id-card&quot; aria-label=&quot;Anchor link for: using-the-digital-id-card&quot;&gt;🔗&lt;&#x2F;a&gt;
Using the digital-ID card&lt;&#x2F;h2&gt;
&lt;p&gt;Once you have your digital&#x2F;eID smart card in hand, you&#x27;ll require setting up
some software in order to use it.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;web-eid&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#web-eid&quot; aria-label=&quot;Anchor link for: web-eid&quot;&gt;🔗&lt;&#x2F;a&gt;
Web eID&lt;&#x2F;h3&gt;
&lt;p&gt;To log in to websites we need to install the &quot;Web eID&quot; extension:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;chrome.google.com&#x2F;webstore&#x2F;detail&#x2F;web-eid&#x2F;ncibgoaomkmdpilpocfeponihegamlic&quot;&gt;Google Chrome extension&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;addons.mozilla.org&#x2F;en-US&#x2F;firefox&#x2F;addon&#x2F;web-eid-webextension&#x2F;&quot;&gt;Firefox extension&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;For more detail and extensions for other browsers see their official website
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.id.ee&#x2F;en&#x2F;article&#x2F;install-id-software&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;digidoc&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#digidoc&quot; aria-label=&quot;Anchor link for: digidoc&quot;&gt;🔗&lt;&#x2F;a&gt;
DigiDoc&lt;&#x2F;h3&gt;
&lt;p&gt;To be able to sign and read encrypted documents we need to download the
&quot;DigiDoc&quot; desktop application. The download link for your OS can be found &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.id.ee&#x2F;en&#x2F;article&#x2F;install-id-software&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If you&#x27;re on Linux, you need to follow a few additional setup instructions found
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;Electronic_identification#Estonia&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;smart-id&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#smart-id&quot; aria-label=&quot;Anchor link for: smart-id&quot;&gt;🔗&lt;&#x2F;a&gt;
Smart-ID&lt;&#x2F;h3&gt;
&lt;p&gt;Using the smart card ID every time for logging in to your service provider or bank
website can quickly get cumbersome. For quick and simple access to
websites with eID login I recommend setting up and using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.smart-id.com&#x2F;&quot;&gt;Smart-ID&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;choosing-a-service-provider&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#choosing-a-service-provider&quot; aria-label=&quot;Anchor link for: choosing-a-service-provider&quot;&gt;🔗&lt;&#x2F;a&gt;
Choosing a Service Provider&lt;&#x2F;h2&gt;
&lt;p&gt;You&#x27;re now set to be able to sing and carry out all business legal operations
yourself including filing incorporation document, tax reports, annual
report, etc.&lt;&#x2F;p&gt;
&lt;p&gt;However, you&#x27;ll rarely want to or have the time&#x2F;knowledge to do so yourself,
this is where Estonia&#x27;s service
provider &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;marketplace.e-resident.gov.ee&#x2F;&quot;&gt;marketplace&lt;&#x2F;a&gt; comes in. Here you can hire&#x2F;enter into a contract
with professional service providers that handle your company&#x27;s incorporation,
having a legally required contract-person in Estonia and filing your tax&#x2F;annual report
among others.&lt;&#x2F;p&gt;
&lt;p&gt;Check out the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;marketplace.e-resident.gov.ee&#x2F;&quot;&gt;marketplace&lt;&#x2F;a&gt; to select the ones that fit your requirements.&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;ve personally used and talked with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.xolo.io&#x2F;ref&#x2F;SHAJAI1&quot;&gt;Xolo&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;1office.co&#x2F;company-formation-portal&#x2F;&quot;&gt;1Office&lt;&#x2F;a&gt;, so I&#x27;ll be sharing
my review and feedback of using their services.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;xolo&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#xolo&quot; aria-label=&quot;Anchor link for: xolo&quot;&gt;🔗&lt;&#x2F;a&gt;
Xolo&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.xolo.io&#x2F;ref&#x2F;SHAJAI1&quot;&gt;Xolo&#x27;s&lt;&#x2F;a&gt; great in a number of ways:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Has predictable monthly pricing.&lt;&#x2F;li&gt;
&lt;li&gt;Covers any reasonable extra services you might need within the monthly price.&lt;&#x2F;li&gt;
&lt;li&gt;Has excellent FAQ documentation&lt;&#x2F;li&gt;
&lt;li&gt;Quick and responsive support&lt;&#x2F;li&gt;
&lt;li&gt;Assists with setting up an interview for an Estonian Bank account via LHV&lt;&#x2F;li&gt;
&lt;li&gt;Nice and slick dashboard with multiple integrations with Wise, Stripe, etc.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;However, they have a quite strict scope of the type of businesses&#x2F;services they
can accept and service. It&#x27;s mostly so they can automate and scale their
services while keeping the operational overhead low. It&#x27;s how they manage
to keep their prices relatively low.&lt;&#x2F;p&gt;
&lt;p&gt;This means, for example, they don&#x27;t accept businesses
who sell physical goods or services including drop-shipping and e-commerce sites.
Also, they only support Wise or LHV for business banking.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;1office&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#1office&quot; aria-label=&quot;Anchor link for: 1office&quot;&gt;🔗&lt;&#x2F;a&gt;
1Office&lt;&#x2F;h3&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;1office.co&#x2F;company-formation-portal&#x2F;&quot;&gt;1Office&lt;&#x2F;a&gt; on the other hand, is more like a traditional accountant&#x2F;auditing
firm and provide services to any legal business under the sun.&lt;&#x2F;p&gt;
&lt;p&gt;Some benefits I found:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Can mix and match services you explicitly require.&lt;&#x2F;li&gt;
&lt;li&gt;Supports e-commerce and drop-shipping businesses with a specific plan to get
up and running with Shopify Pro&lt;&#x2F;li&gt;
&lt;li&gt;Supports any business banking partner.&lt;&#x2F;li&gt;
&lt;li&gt;Has integrations with &quot;My Money&quot; for business banking with Estonian IBAN
(which I think is the only online payment aggregator that does so)&lt;&#x2F;li&gt;
&lt;li&gt;Supports e-residency across multiple countries and can handle accounting for
any&#x2F;all of them.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;The major downsides I found was they are a bit more expensive and have
a more bespoke payment plan
(they list payment plans on their site however when contacting their sales team,
they ask for your requirements and end up quoting a completely custom payment plan and
tier) and charge individually for every service besides the basics.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;closing&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#closing&quot; aria-label=&quot;Anchor link for: closing&quot;&gt;🔗&lt;&#x2F;a&gt;
Closing&lt;&#x2F;h2&gt;
&lt;p&gt;Here you have it! A quick run down detailing my experience with e-residency.
Hope that helps you in your entrepreneurial journey!&lt;&#x2F;p&gt;
&lt;p&gt;And if you do decide to go with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.xolo.io&#x2F;ref&#x2F;SHAJAI1&quot;&gt;Xolo&lt;&#x2F;a&gt; consider using my referral link &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.xolo.io&#x2F;ref&#x2F;SHAJAI1&quot;&gt;xolo.io&#x2F;ref&#x2F;SHAJAI1&lt;&#x2F;a&gt; in
order to get additional €100 when you sign up and get incorporated with
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.xolo.io&#x2F;ref&#x2F;SHAJAI1&quot;&gt;Xolo&lt;&#x2F;a&gt;!&lt;&#x2F;p&gt;
</content>

        
          <category term="xolo, estonia, e-residency, 100 euro, free euro, €100, xolo referral, estonia e-residency, marketplace, 1office, 1office.co, xolo.io, eID, eID card, .ee, incorporate, digital business, remote business, free €100, xolo.io referral, setup e-residency, setup xolo, xolo vs 1office" />
        

        
          <summary type="html">🔗
Overview
Estonia has a robust online and digital platform for availing all government
services and accessing gov website by virtue of a digital ID card that is issued to every
citizen.
Estonia&#x27;s E-residency program is an extension of that infrastructure that lets
any non-citizen of Estonia get access to their digital
government services from anywhere across the globe.
This includes being able to incorporate and run a
business, file taxes, etc completely online and remotely.
Here I describe how my experience of being an e-resident and running an online
business has been.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Circumventing CG-NAT with Wireguard</title>
        <link href="https://shaleenjain.com/blog/wireguard-cgnat-bypass/" type="text/html"/>
        <pubDate>2022-10-17T00:00:00+00:00</pubDate>
        <published>2022-10-17T00:00:00+00:00</published>
        <updated>2022-10-17T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/wireguard-cgnat-bypass/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/wireguard-cgnat-bypass/">&lt;p&gt;With the increasing exhaustion of IPv4 addresses across the globe, various
ISPs have resorted to implementing IPv4 Carrier Grade Network Address
Translation (CG-NAT) as a solution to this problem.&lt;&#x2F;p&gt;
&lt;p&gt;What this means is ISPs do not assign a publicly accessible IPv4 address to
an end-user&#x27;s router and&#x2F;or modem but rather a private IPv4 address that is behind
a carrier network wide &lt;abbr title=&quot;Network Address Translation&quot;&gt;NAT&lt;&#x2F;abbr&gt; implementation.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;For those who host servers on their home network or for just having remote
access to the home network for CCTV access, etc. CG-NAT prevents this since
one no longer has a publicly accessible IPv4 address and forwarding incoming
requests through CG-NAT is incredibly hard, even if the ISP makes an effort
of supporting extensions that allow this on their NAT implementation.&lt;&#x2F;p&gt;
&lt;p&gt;The saving grace in this situation is that ISPs have at the same time started
rolling out IPv6 addresses across their network which inherently does have
public addressability down to the individual client devices via &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Prefix_delegation&quot;&gt;Prefix
Delegation&lt;&#x2F;a&gt; built-in.&lt;&#x2F;p&gt;
&lt;p&gt;However, we&#x27;re still a far way out from having IPv6 address availability and
accessibility across every network throughout the globe. Especially on mobile
devices with Android&#x27;s non-functioning&#x2F;incompatible IPv6 stack, we need a
fallback IPv4 addressing solution that works around CG-NAT.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;wireguard&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#wireguard&quot; aria-label=&quot;Anchor link for: wireguard&quot;&gt;🔗&lt;&#x2F;a&gt;
Wireguard&lt;&#x2F;h2&gt;
&lt;p&gt;With the invention and implementation of &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.wireguard.com&#x2F;&quot;&gt;Wireguard&lt;&#x2F;a&gt; within the Linux kernel we
don&#x27;t need to rely on complicated setups like NAT64, IPv6in4, IPv4in6, etc.&lt;&#x2F;p&gt;
&lt;p&gt;With Wireguard we can have a setup where, we rent a &lt;abbr title=&quot;Virtual Private Server&quot;&gt;VPS&lt;&#x2F;abbr&gt;
server with a public IPv4 address that we can connect to as
a &lt;abbr title=&quot;Virtual Private Network&quot;&gt;VPN&lt;&#x2F;abbr&gt; client,
and it routes our private home network requests to our actual home router
across the public internet.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;wireguard-vps.svg&quot;&gt;Network Topology&lt;&#x2F;img&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This can be achieved by having our home router connect and establish a
connection with the VPS, since the VPS is the one having a public &lt;strong&gt;and&lt;&#x2F;strong&gt;
static IPv4 address, which works flawlessly with CG-NAT since the router is making an
outgoing connection and not waiting for an incoming connection. This solves a
whole class of issues with CG-NAT, dynamic IP addresses and DDNS.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;vps-configuration&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#vps-configuration&quot; aria-label=&quot;Anchor link for: vps-configuration&quot;&gt;🔗&lt;&#x2F;a&gt;
VPS Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;To install Wireguard related packages and create private keys follow this
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.archlinux.org&#x2F;title&#x2F;WireGuard&quot;&gt;guide&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;For a more automated VPN setup on a cloud provider, checkout this &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;shalzz.gumroad.com&#x2F;l&#x2F;self-host-vpn&quot;&gt;ansible
script and guide&lt;&#x2F;a&gt; with a pre-setup cloud shell environment.&lt;&#x2F;p&gt;
&lt;p&gt;The minimal configuration for getting the above solution working is as follows&lt;&#x2F;p&gt;
&lt;p&gt;Here we are assuming your router creates and uses the 192.168.1.0&#x2F;24 subnet for
your home network. Correspondingly we create and use the 192.168.9.0&#x2F;24 subnet
space for the Wireguard network.&lt;&#x2F;p&gt;
&lt;p&gt;The first peer we have below is our home router that connects with the
&lt;code&gt;192.168.9.1&lt;&#x2F;code&gt; IP address and routes all home network i.e. &lt;code&gt;192.168.1.0&#x2F;24&lt;&#x2F;code&gt; subnet requests
to this peer.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# &#x2F;etc&#x2F;wireguard&#x2F;wg0.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[Interface]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Address = 192.168.9.2&#x2F;32&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;ListenPort = 51871&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PrivateKey = &amp;lt;vps-privkey&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[Peer]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PublicKey = &amp;lt;router-pubkey&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;AllowedIPs = 192.168.9.1&#x2F;32, 192.168.1.0&#x2F;24&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[Peer]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PublicKey = &amp;lt;peer1-pubkey&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;AllowedIPs = 192.168.9.3&#x2F;32&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[Peer]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PublicKey = &amp;lt;peer2-pubkey&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;AllowedIPs = 192.168.9.4&#x2F;32&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can create and add more peers to the above config in the similar fashion.
You can also optionally create and add the &lt;code&gt;PreSharedKey&lt;&#x2F;code&gt; option to each peer
for increased security, particularly quantum resistance.&lt;&#x2F;p&gt;
&lt;p&gt;The peers, other than the home router peer, all directly connect to the VPS and
by the way of IP forwarding can also connect to the home router and all devices on
the home network.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;home-router-configuration&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#home-router-configuration&quot; aria-label=&quot;Anchor link for: home-router-configuration&quot;&gt;🔗&lt;&#x2F;a&gt;
Home Router Configuration&lt;&#x2F;h2&gt;
&lt;p&gt;For the other side of the configuration on the home router, we just need to
set up one peer that connects and persists the connection to the VPS wireguard
server.&lt;&#x2F;p&gt;
&lt;p&gt;This configuration is for the OpenWrt OS, if you&#x27;re using any other router OS
you&#x27;ll have to adapt to its configuration format.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# &#x2F;etc&#x2F;config&#x2F;network&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;config interface &amp;#39;wg0&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        option proto &amp;#39;wireguard&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        option private_key &amp;#39;&amp;lt;router-privkey&amp;gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        option listen_port &amp;#39;51820&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        list addresses &amp;#39;192.168.9.1&#x2F;24&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;config wireguard_wg0 &amp;#39;wgclient1&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        option public_key &amp;#39;&amp;lt;vps-pubkey&amp;gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        list allowed_ips &amp;#39;192.168.9.0&#x2F;24&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        option endpoint_host &amp;#39;&amp;lt;vps-public-ip-address&amp;gt;&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        option endpoint_port &amp;#39;51871&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        option persistent_keepalive &amp;#39;25&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        # set to 0 to disable home clients&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        # from accessing the VPS peers directly&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        option route_allowed_ips &amp;#39;1&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The &lt;code&gt;allowed_ips&lt;&#x2F;code&gt; or &lt;code&gt;AllowedIps&lt;&#x2F;code&gt; option of the wireguard config also acts as
an ACL or access control method. So if we want to allow other peers, other than
just the direct VPS peer &lt;code&gt;192.168.9.2&lt;&#x2F;code&gt;, to access this network we need to allow
their IP addresses as well. We can do that by whilelisting the whole subnet
with &lt;code&gt;192.168.9.0&#x2F;24&lt;&#x2F;code&gt; or allow individual IP&#x27;s one by one.&lt;&#x2F;p&gt;
&lt;p&gt;That last thing to do is to make sure the Wireguard interface (&lt;code&gt;wg0&lt;&#x2F;code&gt; in the example)
is assigned to the &lt;code&gt;LAN&lt;&#x2F;code&gt; firewall zone for letting the wg peers access clients
within the LAN zone (192.168.1.0&#x2F;24).&lt;&#x2F;p&gt;
&lt;p&gt;Run this command to do so on OpenWrt:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;export&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; WG_INTERFACE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;wg0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;uci&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; add_list firewall.lan.network=&amp;quot;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;WG_INTERFACE_NAME&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;ip-forwarding&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#ip-forwarding&quot; aria-label=&quot;Anchor link for: ip-forwarding&quot;&gt;🔗&lt;&#x2F;a&gt;
IP Forwarding&lt;&#x2F;h2&gt;
&lt;p&gt;The most crucial step for this setup is to enable IP forwarding on the VPS
host. This forwards the packets received from the 192.168.1.0&#x2F;24
clients back to the connected peer with Wireguard handling the routing
based on our &lt;code&gt;AllowedIPs&lt;&#x2F;code&gt; config.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;# &#x2F;etc&#x2F;sysctl.conf&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;net.ipv4.ip_forward=1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Reboot the VPS for this to take effect.&lt;&#x2F;p&gt;
&lt;p&gt;You should now be able to access your home router and clients over the public internet!&lt;&#x2F;p&gt;
</content>

        
          <category term="wireguard, cg-nat, openwrt, vps, lan, proxy, wireguard tunnel, bypass, cg-nat bypass, circumvent, ip forwarding, ipv4, ipv6" />
        

        
          <summary type="html">With the increasing exhaustion of IPv4 addresses across the globe, various
ISPs have resorted to implementing IPv4 Carrier Grade Network Address
Translation (CG-NAT) as a solution to this problem.
What this means is ISPs do not assign a publicly accessible IPv4 address to
an end-user&#x27;s router and&#x2F;or modem but rather a private IPv4 address that is behind
a carrier network wide NAT implementation.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Forwarding Calls and Texts Internationally with a VoIP Server and Modem</title>
        <link href="https://shaleenjain.com/blog/asterisk-sip-server/" type="text/html"/>
        <pubDate>2022-06-04T00:00:00+00:00</pubDate>
        <published>2022-06-04T00:00:00+00:00</published>
        <updated>2022-06-04T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/asterisk-sip-server/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/asterisk-sip-server/">&lt;p&gt;&lt;em&gt;Special thanks to Pramey Singh for feedback and review.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;!-- On the path to being a [Sovereign Individual][3], being digitally sovereign --&gt;
&lt;!-- is equally important. Owning and decoupling your digital identity from your mobile --&gt;
&lt;!-- number is a step in that direction. --&gt;
&lt;p&gt;As a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;dougantin.com&#x2F;the-sovereign-individual-what-you-need-to-know-why&#x2F;&quot;&gt;Sovereign Individual&lt;&#x2F;a&gt;, traveling and staying overseas for long periods frequently, switching sim cards&#x2F;numbers can quickly become a pain.
It can be helpful to still retain control over an operational phone number of your home country across geolocations.
Doing so lets you forward and make local home calls and be able to receive your bank&#x27;s account and OTP related text messages.&lt;&#x2F;p&gt;
&lt;p&gt;The solution proposed here isn&#x27;t a location dependent one like using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;fi.google.com&#x2F;about&#x2F;&quot;&gt;Google Fi&lt;&#x2F;a&gt; or relying on expensive international roaming plans.
Instead, it gives you ownership and freedom to retain, switch or dispose of your phone numbers at local rates, across political borders.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;In the same vein, I recently tweeted about taking control of your messaging platforms to have custody over your chat messages.
Helping you maintain a new layer of privacy via isolation as well as improving your quality of life by unifying your chatting platforms.
This article though focuses only on voice and text communication.&lt;&#x2F;p&gt;
&lt;!-- As suggested on https:&#x2F;&#x2F;developer.twitter.com&#x2F;en&#x2F;docs&#x2F;twitter-for-websites&#x2F;javascript-api&#x2F;guides&#x2F;set-up-twitter-for-websites --&gt;
&lt;!-- TODO:
            1) Add all the alignment&#x2F;color modifiers in the conditional templating
            2) Handle the case where uBlock origin is in action: instead of showing just a link, perhaps fetch some small portion of the content?
--&gt;

&lt;script&gt;window.twttr = (function(d, s, id) {
  var js, fjs = d.getElementsByTagName(s)[0],
    t = window.twttr || {};
  if (d.getElementById(id)) return t;
  js = d.createElement(s);
  js.id = id;
  js.src = &quot;https:&#x2F;&#x2F;platform.twitter.com&#x2F;widgets.js&quot;;
  fjs.parentNode.insertBefore(js, fjs);

  t._e = [];
  t.ready = function(f) {
    t._e.push(f);
  };

  return t;
}(document, &quot;script&quot;, &quot;twitter-wjs&quot;));&lt;&#x2F;script&gt;

&lt;div  style=&quot;display: flex; justify-content: center;&quot;&gt;
    &lt;blockquote class=&quot;twitter-tweet&quot;&gt;&lt;a href=&quot;https:&amp;#x2F;&amp;#x2F;twitter.com&amp;#x2F;shalzzj&amp;#x2F;status&amp;#x2F;1499689706367643649&quot;&gt;&lt;&#x2F;a&gt;&lt;&#x2F;blockquote&gt;
&lt;&#x2F;div&gt;
&lt;br&#x2F;&gt;
&lt;!-- toc --&gt;
&lt;h2 id=&quot;overview&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#overview&quot; aria-label=&quot;Anchor link for: overview&quot;&gt;🔗&lt;&#x2F;a&gt;
Overview&lt;&#x2F;h2&gt;
&lt;p&gt;The solution to the above problem is to move onto a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Session_Initiation_Protocol&quot;&gt;SIP&lt;&#x2F;a&gt;&#x2F;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Real-time_Transport_Protocol&quot;&gt;RTP&lt;&#x2F;a&gt; stack for all our voice calls by
switching to a VOIP service provider and possibly relying on our PBX server (depending on the jurisdiction&#x27;s regulation).&lt;&#x2F;p&gt;
&lt;p&gt;When we have our complete VOIP stack in place we&#x27;ll have a pipeline like this:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;PSTN Carrier &amp;lt;-&amp;gt; 3G&#x2F;4G Dongle &amp;lt;-&amp;gt; Asterisk Server &amp;lt;-&amp;gt; Twilio (VOIP Provider) &amp;lt;-&amp;gt; VOIP Softphone&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;benefits&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#benefits&quot; aria-label=&quot;Anchor link for: benefits&quot;&gt;🔗&lt;&#x2F;a&gt;
Benefits&lt;&#x2F;h2&gt;
&lt;p&gt;With this approach, we can redirect traditional PSTN calls over VOIP to us anywhere across
the globe. Plus since there&#x27;s no longer a SIM card required to be tethered to a single device,
we can make and receive calls across multiple devices.&lt;&#x2F;p&gt;
&lt;p&gt;This also mitigates the ever-growing threat of SIM swap attacks.
Both, physical attacks as the SIM card associated with your number is no longer required to be always in your
phone, and operator social engineering attacks since most VOIP providers have a higher
security level than most traditional telecom providers.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;asterisk-pbx-server&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#asterisk-pbx-server&quot; aria-label=&quot;Anchor link for: asterisk-pbx-server&quot;&gt;🔗&lt;&#x2F;a&gt;
Asterisk PBX Server&lt;&#x2F;h2&gt;
&lt;p&gt;While the regulation of some countries like the US allows buying a consumer feature
level number from a VOIP provider like &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.twilio.com&#x2F;&quot;&gt;Twilio&lt;&#x2F;a&gt; with unrestricted functionality for
calls and SMS&#x2F;MMS.
The feature set starts to degrade drastically from what we are used to
when buying local numbers for most other countries.&lt;&#x2F;p&gt;
&lt;p&gt;If you are following this guide with a US number or any other country that allows
first-class support to VOIP providers then you can skip this section on setting up an
Asterisk server.&lt;&#x2F;p&gt;
&lt;p&gt;If however you find yourself with a number from a country that restricts VOIP providers
from providing full feature-set local numbers then we can circumvent that via
a 3G&#x2F;4G USB dongle with voice calling support. This allows us to then bring up
a PBX server connected to the internet with the ability to route traditional PBX calls
via the USB dongle holding your own local number SIM card.&lt;&#x2F;p&gt;
&lt;p&gt;The first step is to then install an &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.asterisk.org&#x2F;&quot;&gt;Asterisk&lt;&#x2F;a&gt; server on a machine that can be left running
24&#x2F;7 for maximum uptime. This guide uses OpenWRT OS and packages in examples
but you can use any machine you have lying around including a Raspberry Pi.&lt;&#x2F;p&gt;
&lt;p&gt;With an already set up OpenWRT router, you&#x27;ll need the following packages to
install Asterisk:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;shellscript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;opkg&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; install Asterisk Asterisk-pjsip Asterisk-bridge-simple Asterisk-codec-alaw Asterisk-codec-ulaw Asterisk-res-rtp-Asterisk Asterisk-res-srtp Asterisk-chan-dongle&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h3 id=&quot;asterisk-chan-dongle&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#asterisk-chan-dongle&quot; aria-label=&quot;Anchor link for: asterisk-chan-dongle&quot;&gt;🔗&lt;&#x2F;a&gt;
Asterisk-chan-dongle&lt;&#x2F;h3&gt;
&lt;p&gt;Now comes the tough part of acquiring and setting up a USB dongle. We&#x27;re
using &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;wdoekes&#x2F;asterisk-chan-dongle&quot;&gt;wdoekes&#x2F;Asterisk-chan-dongle&lt;&#x2F;a&gt; an Asterisk channel driver for interfacing
with the USB dongle from the Asterisk server.&lt;&#x2F;p&gt;
&lt;p&gt;The tricky part here is that the channel driver doesn&#x27;t work with every 3G&#x2F;4G USB
dongle, only Huawei 3G dongles and a few 4G dongles. And even with the dongles that it
does work, not every supported dongle has voice support available or firmware unlocked.&lt;&#x2F;p&gt;
&lt;p&gt;The best way is to look at the list of supported dongles on the project&#x27;s &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;wdoekes&#x2F;asterisk-chan-dongle#chan_dongle-channel-driver-for-huawei-umts-cards&quot;&gt;README&lt;&#x2F;a&gt; file
and try to get your hands on one of them. I bought an E1750 Huawei 3G dongle which
you still find in stock in many online stores. If it&#x27;s unavailable in your local markets&#x2F;
e-commerce sites, try searching it on eBay or AliExpress. I was able to get a
second-hand one from eBay with SIM and voice support unlocked.&lt;&#x2F;p&gt;
&lt;p&gt;Once you have a dongle, insert your SIM card and plug it into the machine you have Asterisk
installed.  Make sure you have the &lt;code&gt;asterisk-chan-dongle&lt;&#x2F;code&gt; package installed.&lt;&#x2F;p&gt;
&lt;p&gt;To configure, we edit the &lt;code&gt;dongle.conf&lt;&#x2F;code&gt; file found in the configuration folder of Asterisk.
The configuration folder is defined via the &lt;code&gt;astetcdir&lt;&#x2F;code&gt; option in the main &lt;code&gt;asterisk.conf&lt;&#x2F;code&gt;
file and is usually &lt;code&gt;&#x2F;etc&#x2F;asterisk&#x2F;&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;If there&#x27;s no &lt;code&gt;dongle.conf&lt;&#x2F;code&gt; file located in the configuration folder, create one.
The default dongle.conf can be found &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;wdoekes&#x2F;asterisk-chan-dongle&#x2F;blob&#x2F;master&#x2F;etc&#x2F;dongle.conf&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Make a note of the &lt;code&gt;context&lt;&#x2F;code&gt; option in &lt;code&gt;dongle.conf&lt;&#x2F;code&gt;, the default value of
&lt;code&gt;context&lt;&#x2F;code&gt; is &lt;code&gt;default&lt;&#x2F;code&gt; which we&#x27;ll be referencing later.
You can change it to something more appropriate like &lt;code&gt;dongle-incoming&lt;&#x2F;code&gt;
to make it easier to remember, which is what we&#x27;re doing in the below example.&lt;&#x2F;p&gt;
&lt;p&gt;The main configuration requirements are specifying the correct audio and data
device ports of the dongle.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[dongle0]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;context&lt;&#x2F;span&gt;&lt;span&gt;   =   dongle-incoming&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;audio&lt;&#x2F;span&gt;&lt;span&gt;     =   &#x2F;dev&#x2F;ttyUSB1       &lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;; tty port for audio connection;    no default value&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;data&lt;&#x2F;span&gt;&lt;span&gt;      =   &#x2F;dev&#x2F;ttyUSB2       &lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;; tty port for AT commands;         no default value&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The exact value here will depend on your dongle and the distribution you&#x27;re running. You might
need to install the &lt;code&gt;usb_modeswitch&lt;&#x2F;code&gt; package to switch the dongle from the initial
CD-ROM&#x2F;mass storage mode to the serial mode. You should then be able to start the Asterisk
server and watch the logs for errors. Make sure there are no dongle-related errors.&lt;&#x2F;p&gt;
&lt;p&gt;Note: To enable logging you might need to edit &lt;code&gt;logger.conf&lt;&#x2F;code&gt; to increase the log
level.
(You can find the &lt;code&gt;messages&lt;&#x2F;code&gt; log file in the &lt;code&gt;astlogdir&lt;&#x2F;code&gt; folder) :&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;console =&amp;gt; notice,warning,error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;messages =&amp;gt; notice,warning,error,debug&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Check the status of your dongle and network registration via these two commands
in the Asterisk console. (You can attach a console to a running Asterisk
server via the command &lt;code&gt;asterisk -r&lt;&#x2F;code&gt;)&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dongle show devices&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;dongle show device state dongle0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If the output shows the device state as &quot;Free&quot;, then you&#x27;re good to go.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;sms-forwarding-optional&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#sms-forwarding-optional&quot; aria-label=&quot;Anchor link for: sms-forwarding-optional&quot;&gt;🔗&lt;&#x2F;a&gt;
SMS Forwarding (Optional)&lt;&#x2F;h3&gt;
&lt;p&gt;The easiest and simplest way to get acquainted with Asterisk and how to configure
it is to set up SMS forwarding from our USB 3G dongle to an email ID.&lt;&#x2F;p&gt;
&lt;p&gt;We can do so by editing &lt;code&gt;extensions.conf&lt;&#x2F;code&gt;. The file is already well documented
via comments (any line preceded by &lt;code&gt;;&lt;&#x2F;code&gt; is a comment and is ignored).&lt;&#x2F;p&gt;
&lt;p&gt;Append the following lines at the end of the file to set up SMS forwarding.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[dongle-incoming]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; sms,1,Verbose(Incoming SMS from &lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;quot;${CALLERID(num)} ${BASE64_DECODE(${SMS_BASE64})}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; sms,n,System(echo &lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;quot;To: user@example.com\nSubject: ${CALLERID(num)}\n\n${STRFTIME(${EPOCH},,%Y-%m-%d %H:%M:%S)} - ${DONGLENAME} - ${CALLERID(num)}: &amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;gt; &#x2F;tmp&#x2F;sms.txt)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; sms,n,System(echo &lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;quot;${BASE64_DECODE(${SMS_BASE64})}&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt; &amp;gt;&amp;gt; &#x2F;tmp&#x2F;sms.txt)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; sms,n,System(msmtp -t &amp;lt; &#x2F;tmp&#x2F;sms.txt)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; sms,n,System(rm -f &#x2F;tmp&#x2F;sms.txt)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; sms,n,Hangup()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; ussd,1,Verbose(Incoming USSD: ${BASE64_DECODE(${USSD_BASE64})})&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; ussd,n,Hangup()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here &lt;code&gt;dongle-incoming&lt;&#x2F;code&gt; is the name of the context we defined in &lt;code&gt;dongle.conf&lt;&#x2F;code&gt;,
and we define extensions within that context for receiving SMS by the way
of &lt;code&gt;exten =&amp;gt; sms&lt;&#x2F;code&gt;.
You can read more about how &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.asterisk.org&#x2F;wiki&#x2F;display&#x2F;AST&#x2F;Contexts%2C+Extensions%2C+and+Priorities&quot;&gt;Context, Extensions, and Priorities&lt;&#x2F;a&gt; work in Asterisk from
their wiki.&lt;&#x2F;p&gt;
&lt;p&gt;Once we craft an email message we defer to a sendmail compatible SMTP client to
send the email. This example uses &lt;code&gt;msmtp&lt;&#x2F;code&gt; here, you can instead use any
other client and configure it accordingly.&lt;&#x2F;p&gt;
&lt;p&gt;The above extension configuration calls a few Asterisk built-in apps and functions that
you might need to install separately. For OpenWRT install the following packages:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;opkg install asterisk-app-system asterisk-app-verbose asterisk-func-base64&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you just want SMS forwarding to your email and don&#x27;t care about PSTN voice calls
then congratulations you should have SMS-to-email forwarding working at this point.
If you want voice call functionality as well, continue reading.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;configuration&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#configuration&quot; aria-label=&quot;Anchor link for: configuration&quot;&gt;🔗&lt;&#x2F;a&gt;
Configuration&lt;&#x2F;h3&gt;
&lt;p&gt;Once we have everything installed and running, it&#x27;s time to configure our
Asterisk PBX server to do two things:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;Set up call extensions so that Asterisk knows how and where to route incoming and outgoing calls&lt;&#x2F;li&gt;
&lt;li&gt;Authenticate and interface with Twilio as a BYOC trunk&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;p&gt;While we don&#x27;t need to use Twilio or a VOIP service provider to act as a
proxy for our PBX server, using one adds a level of security and reliability
to our setup as we don&#x27;t need to whitelist dynamic IP addresses for communicating with
a mobile softphone and Twilio&#x27;s global presence and edge locations enable
much better performance and reliability than just directly talking to our home
Asterisk server from across the globe.&lt;&#x2F;p&gt;
&lt;p&gt;The configuration shared here are just minimal examples that should work for most
cases, you may have to tweak and adjust them to suit your setup and requirements.&lt;&#x2F;p&gt;
&lt;p&gt;There are a few files that we&#x27;ll need to edit mainly, &lt;code&gt;pjsip.conf&lt;&#x2F;code&gt;, &lt;code&gt;pjsip_wizard.conf&lt;&#x2F;code&gt; and &lt;code&gt;extensions.conf&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;The first thing that we need to do is set up a &quot;transport&quot; for Asterisk to use for SIP
signaling in the &lt;code&gt;pjsip.conf&lt;&#x2F;code&gt; file:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[transport-udp]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;type&lt;&#x2F;span&gt;&lt;span&gt;=transport&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;protocol&lt;&#x2F;span&gt;&lt;span&gt;=udp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;bind&lt;&#x2F;span&gt;&lt;span&gt;=0.0.0.0:5060&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;The next step is connecting our PBX to Twilio as a Trunk using their BYOC Trunk option.
There is no direct guide provided by Twilio on how to set up a BYOC Trunk, especially
with Asterisk, but the process is similar to setting up a Twilio Elastic SIP Trunk.&lt;&#x2F;p&gt;
&lt;p&gt;Twilio does, fortunately, provide a good enough guide for setting up an Elastic SIP trunk
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.twilio.com&#x2F;docs&#x2F;sip-trunking&#x2F;sample-configuration#asterisk&quot;&gt;here&lt;&#x2F;a&gt;, from where we can adapt the configuration shared in the &quot;Asterisk Provisioning&quot; section
to work with the BYOC trunk.&lt;&#x2F;p&gt;
&lt;p&gt;For connecting with the Twilio network as a SIP trunk we need to have a user created
with the corresponding credentials in addition to a SIP domain and a BYOC trunk domain.
We can do so via the Twilio console dashboard, the exact steps for which are described
in the &quot;Twilio&quot; section below.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: The values highlighted in bold in the example configuration will be unique to your
environment and needs to be replaced with appropriate values to work correctly.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;&lt;code&gt;pjsip_wizard.conf:&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;pre style=&quot;background-color:#fdf6e3;color:#657b83;&quot;&gt;
&lt;code&gt;&lt;span&gt;[user_defaults](!)
&lt;&#x2F;span&gt;&lt;span&gt;type = wizard
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;context = from-twilio
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;allow = !all,ulaw,alaw
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;dtmf_mode = rfc4733
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;media_encryption = no
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;media_encryption_optimistic = no
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;trust_id_inbound = yes
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;send_pai = yes
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;language = en
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;[&lt;b&gt;+919876543210&lt;&#x2F;b&gt;](user_defaults)
&lt;&#x2F;span&gt;&lt;span&gt;aor&#x2F;max_contacts = 5
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;callerid = &lt;b&gt;Alan Klein &lt;+919876543210&gt;&lt;&#x2F;b&gt;
&lt;&#x2F;span&gt;&lt;span&gt;remote_hosts = &lt;b&gt;byoc.twilio-asteriskpbx.sip.singapore.twilio.com, byoc.twilio-asteriskpbx.sip.tokyo.twilio.com&lt;&#x2F;b&gt;
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;[trunk_defaults](!)
&lt;&#x2F;span&gt;&lt;span&gt;type = wizard
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;transport=transport-udp
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;allow = !all,ulaw,alaw
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;trust_id_inbound=no
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;dtmf_mode=rfc4733
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;allow_subscribe = no
&lt;&#x2F;span&gt;&lt;span&gt;aor&#x2F;qualify_frequency = 60
&lt;&#x2F;span&gt;&lt;span&gt;
&lt;&#x2F;span&gt;&lt;span&gt;[twilio-apac](trunk_defaults)
&lt;&#x2F;span&gt;&lt;span&gt;sends_auth = yes
&lt;&#x2F;span&gt;&lt;span&gt;sends_registrations = yes
&lt;&#x2F;span&gt;&lt;span&gt;remote_hosts = &lt;b&gt;twilio-asteriskpbx.sip.singapore.twilio.com &lt;&#x2F;b&gt;
&lt;&#x2F;span&gt;&lt;span&gt;outbound_auth&#x2F;username = &lt;b style=&quot;color: red;&quot;&gt;myasteriskpbx &lt;&#x2F;b&gt;
&lt;&#x2F;span&gt;&lt;span&gt;outbound_auth&#x2F;password = &lt;b style=&quot;color: red;&quot;&gt;myasteriskpbxzx11%VzX &lt;&#x2F;b&gt;
&lt;&#x2F;span&gt;&lt;span&gt;endpoint&#x2F;context = from-twilio
&lt;&#x2F;span&gt;&lt;span&gt;aor&#x2F;qualify_frequency = 60
&lt;&#x2F;span&gt;
&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Next, we set up the extensions required to receive incoming calls from the PSTN network
and forward them as a SIP call via the Twilio SIP domain to any registered softphones.
And another extension for when we want to make a call from our softphone to then
use the dongle for completing the call to a PSTN number.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;code&gt;extensions.conf&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;ini&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[dongle-incoming]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; +919876543210,1,Dial(PJSIP&#x2F;twilio-apac&#x2F;sip:+919876543210@twilio-asteriskpbx.sip.twilio.com, ,b(dongle-incoming^outbound^1))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; outbound,1,Set(JITTERBUFFER(adaptive)=default)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;same&lt;&#x2F;span&gt;&lt;span&gt;  =&amp;gt; n,Set(AGC(rx)=4000)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;same&lt;&#x2F;span&gt;&lt;span&gt;  =&amp;gt; n,Return()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[from-twilio]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; _X.,1,Set(JITTERBUFFER(adaptive)=2000,1600,120)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;same&lt;&#x2F;span&gt;&lt;span&gt;  =&amp;gt; n,Set(AGC(rx)=4000)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;same&lt;&#x2F;span&gt;&lt;span&gt;  =&amp;gt; n,Dial(Dongle&#x2F;dongle0&#x2F;+91${EXTEN})&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;same&lt;&#x2F;span&gt;&lt;span&gt;  =&amp;gt; n,Hangup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exten&lt;&#x2F;span&gt;&lt;span&gt; =&amp;gt; _+91X.,1,Set(JITTERBUFFER(adaptive)=2000,1600,120)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;same&lt;&#x2F;span&gt;&lt;span&gt;  =&amp;gt; n,Set(AGC(rx)=4000)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;same&lt;&#x2F;span&gt;&lt;span&gt;  =&amp;gt; n,Dial(Dongle&#x2F;dongle0&#x2F;${EXTEN})&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;same&lt;&#x2F;span&gt;&lt;span&gt;  =&amp;gt; n,Hangup&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;blockquote&gt;
&lt;p&gt;Note: Enabling Jitterbuffer and Automatic Gain Control (AGC) may require
additional asterisk packages to be installed.
On OpenWRT the package names are: &lt;code&gt;asterisk-func-jitterbuffer&lt;&#x2F;code&gt; and
&lt;code&gt;asterisk-func-speex&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;nat-settings-optional&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#nat-settings-optional&quot; aria-label=&quot;Anchor link for: nat-settings-optional&quot;&gt;🔗&lt;&#x2F;a&gt;
NAT settings (optional)&lt;&#x2F;h3&gt;
&lt;p&gt;If you&#x27;re running your Asterisk server on a private network and is behind
Network Address Translation (NAT) then you&#x27;ll need to enable additional
configuration options for Asterisk&#x27;s &lt;code&gt;res_pjsip&lt;&#x2F;code&gt; module to work reliably.&lt;&#x2F;p&gt;
&lt;p&gt;The most basic configuration required for networking behind a NAT is specifying
the external media address in the transport configuration section of &lt;code&gt;pjsip.conf&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;[transport-udp]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;type=transport&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;protocol=udp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;bind=0.0.0.0:5060&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+; NAT settings&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+local_net                  = 127.0.0.1&#x2F;24&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+local_net                  = 192.168.1.0&#x2F;24&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+external_media_address     = home.example.com ; or a public static IP&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+external_signaling_address = home.example.com ; or a public static IP&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+allow_reload=no&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You can find more details on how to configure Asterisk behind a NAT from their
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wiki.asterisk.org&#x2F;wiki&#x2F;display&#x2F;AST&#x2F;Configuring+res_pjsip+to+work+through+NAT&quot;&gt;wiki&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;twilio&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#twilio&quot; aria-label=&quot;Anchor link for: twilio&quot;&gt;🔗&lt;&#x2F;a&gt;
Twilio&lt;&#x2F;h2&gt;
&lt;p&gt;The last step in our setup is to configure Twilio SIP domain and BYOC trunk
from the Twilio console. Twilio has a nice tutorial for setting up a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.twilio.com&#x2F;blog&#x2F;registering-sip-phone-twilio-inbound-outbound&quot;&gt;SIP phone&lt;&#x2F;a&gt;
for incoming&#x2F;outgoing calls directly from Twilio&#x27;s SIP domain.&lt;&#x2F;p&gt;
&lt;p&gt;We adapt from the tutorial for setting up two SIP domains:&lt;&#x2F;p&gt;
&lt;p&gt;The first SIP domain will be set up similar to the one in the tutorial but
with a different webhook URL for the &quot;A Call Comes In&quot; configuration option.
The Webhook URL can be the URL of a Twilio Function or self-hosted server of the
following Nodejs script:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;&#x2F;* URL Parameters&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;URL parameters: defaultCountry=[international country code - ISO alpha2]&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;Feel free to remove any console.log statements.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;*&#x2F;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;&#x2F;&#x2F; Require `PhoneNumberFormat`.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; PNF&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; require&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;#39;google-libphonenumber&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;PhoneNumberFormat&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; require&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;#39;url&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;&#x2F;&#x2F; Get an instance of `PhoneNumberUtil`.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; phoneUtil&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; require&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;#39;google-libphonenumber&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;PhoneNumberUtil&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getInstance&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;exports&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;handler&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; function&lt;&#x2F;span&gt;&lt;span&gt;(context, event, callback) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; context&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getTwilioClient&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; twiml&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; = new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; Twilio&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;twiml&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;VoiceResponse&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span&gt; { From:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; fromNumber&lt;&#x2F;span&gt;&lt;span&gt;, To:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; toNumber&lt;&#x2F;span&gt;&lt;span&gt;, SipDomainSid:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; sipDomainSid&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; event&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; mergedAggregatedE164CredentialUsernames&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; [];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; regExNumericSipUri&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;^&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;sip:((&lt;&#x2F;span&gt;&lt;span style=&quot;color: #CB4B16;&quot;&gt;\+&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #CB4B16;&quot;&gt;[0-9]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;)@(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #CB4B16;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;)&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; regAlphaSipUri&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt; &#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;^&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;sip:((&lt;&#x2F;span&gt;&lt;span style=&quot;color: #CB4B16;&quot;&gt;[a-zA-Z][\w]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;)@(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #CB4B16;&quot;&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;*&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;))&#x2F;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Change the defaultCallerId to a phone number in your account&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;    &#x2F;&#x2F; and BYOC_SID to your byoc trunks SID.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; BYOC_SID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;BY6f6abd4dadcf7d0de2ec4f828a167bac&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; DEFAULT_CALLER_ID&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;+919876543210&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;  &#x2F;&#x2F; Also our BYOC number&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; defaultCountry&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; event&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;defaultCountry&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; ||&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;US&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; fromSipCallerId&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;fromNumber&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;regExNumericSipUri&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;    ?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; fromNumber&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;regExNumericSipUri&lt;&#x2F;span&gt;&lt;span&gt;)[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; :&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    fromNumber&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;regAlphaSipUri&lt;&#x2F;span&gt;&lt;span&gt;)[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt;2&lt;&#x2F;span&gt;&lt;span&gt;]);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;    if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;toNumber&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;regExNumericSipUri&lt;&#x2F;span&gt;&lt;span&gt;)) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;        console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;#39;Dialing an alphanumeric SIP User&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;        twiml&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;dial&lt;&#x2F;span&gt;&lt;span&gt;({callerId:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; fromSipCallerId&lt;&#x2F;span&gt;&lt;span&gt;, answerOnBridge:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;})&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;sip&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;toNumber&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;        callback&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt;null&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; twiml&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; normalizedFrom&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;fromNumber&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;regExNumericSipUri&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;    ?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; fromNumber&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;regExNumericSipUri&lt;&#x2F;span&gt;&lt;span&gt;)[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;]&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; :&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; DEFAULT_CALLER_ID&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; normalizedTo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; toNumber&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;regExNumericSipUri&lt;&#x2F;span&gt;&lt;span&gt;)[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt;1&lt;&#x2F;span&gt;&lt;span&gt;];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; sipDomain&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;  toNumber&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;match&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;regExNumericSipUri&lt;&#x2F;span&gt;&lt;span&gt;)[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt;3&lt;&#x2F;span&gt;&lt;span&gt;];&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;`Original From Number: ${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;fromNumber&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}`&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;`Original To Number: ${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;toNumber&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}`&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;`Normalized PSTN From Number: ${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;normalizedFrom&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}`&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;`Normalized To Number: ${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;normalizedTo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}`&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;`SIP CallerID: ${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;fromSipCallerId&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}`&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Parse number with US country code and keep raw input.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; rawFromNumber&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; phoneUtil&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;parseAndKeepRawInput&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;normalizedFrom&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; defaultCountry&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; rawtoNumber&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; phoneUtil&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;parseAndKeepRawInput&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;normalizedTo&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; defaultCountry&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;    &#x2F;&#x2F; Format number in E.164 format&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    fromE164Normalized&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; phoneUtil&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;format&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;rawFromNumber&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; PNF&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;E164&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    toE164Normalized&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; phoneUtil&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;format&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;rawtoNumber&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; PNF&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;E164&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;`E.164 From Number: ${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;fromE164Normalized&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}`&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;`E.164 To Number: ${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;toE164Normalized&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}`&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    function&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; enumerateCredentialLists&lt;&#x2F;span&gt;&lt;span&gt;(sipDomainSid) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; client&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;sip&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;domains&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;sipDomainSid&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;auth&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;registrations&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;credentialListMappings&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;list&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    function&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; getSIPCredentialListUsernames&lt;&#x2F;span&gt;&lt;span&gt;(credList) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;        return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; client&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;sip&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;credentialLists&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;credList&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;credentials&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;list&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    enumerateCredentialLists&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;sipDomainSid&lt;&#x2F;span&gt;&lt;span&gt;).&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;then&lt;&#x2F;span&gt;&lt;span&gt;(credentialLists&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;        Promise&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;all&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;credentialLists&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(credList&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;            return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; getSIPCredentialListUsernames&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;credList&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;sid&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;then&lt;&#x2F;span&gt;&lt;span&gt;(results&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;            results&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;forEach&lt;&#x2F;span&gt;&lt;span&gt;(credentials&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;                &#x2F;&#x2F; Merge together all SIP Domain associated registration&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;                &#x2F;&#x2F; credential list usernames prefixed by + into one array&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;                mergedAggregatedE164CredentialUsernames&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;push&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;apply&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;mergedAggregatedE164CredentialUsernames&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;                credentials&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;filter&lt;&#x2F;span&gt;&lt;span&gt;(record&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; record&lt;&#x2F;span&gt;&lt;span&gt;[&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;quot;username&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;].&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;startsWith&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;#39;+&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;))&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;map&lt;&#x2F;span&gt;&lt;span&gt;(record&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; record&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;username&lt;&#x2F;span&gt;&lt;span&gt;));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            });&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;            console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;mergedAggregatedE164CredentialUsernames&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;            if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;mergedAggregatedE164CredentialUsernames&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;includes&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;toE164Normalized&lt;&#x2F;span&gt;&lt;span&gt;)) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;                console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;#39;Dialing another E.164 SIP User&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;                twiml&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;dial&lt;&#x2F;span&gt;&lt;span&gt;({&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    callerId:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; fromSipCallerId&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    answerOnBridge:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                })&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;sip&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;`sip:${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;toE164Normalized&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}@${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;sipDomain&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;}`&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; else if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;fromE164Normalized&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; ===&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; DEFAULT_CALLER_ID&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;               console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;#39;Dialing a PSTN Number via BYOC&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;               twiml&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;dial&lt;&#x2F;span&gt;&lt;span&gt;({callerId:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; fromE164Normalized&lt;&#x2F;span&gt;&lt;span&gt;, answerOnBridge:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;})&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                 .&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;number&lt;&#x2F;span&gt;&lt;span&gt;({byoc:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; BYOC_SID&lt;&#x2F;span&gt;&lt;span&gt;},&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; toE164Normalized&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; else&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;               console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;#39;Dialing a PSTN Number&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;               twiml&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;dial&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                   {callerId:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; fromE164Normalized&lt;&#x2F;span&gt;&lt;span&gt;, answerOnBridge:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;},&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;                   toE164Normalized&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                );&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;                callback&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt;null&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; twiml&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            }).&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;catch&lt;&#x2F;span&gt;&lt;span&gt;(err&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;                console&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;log&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;err&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;                callback&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;err&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            });&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    });&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;};&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Change the &lt;code&gt;DEFAULT_CALLER_ID&lt;&#x2F;code&gt; variable value to your SIM card number and &lt;code&gt;BYOC_SID&lt;&#x2F;code&gt;
value to the SID you get after creating a BYOC trunk SIP domain described below.&lt;&#x2F;p&gt;
&lt;p&gt;The above script either calls a PSTN number via our BYOC trunk when calling from our
BYOC number or via a Twilio number when calling from a username formatted as an E.164 Twilio number
or makes a SIP call when the To number is a username in our credentials list.&lt;&#x2F;p&gt;
&lt;p&gt;The second SIP domain will have the selection &quot;BYOC trunk&quot; as the configuration
under the &quot;Call Control Configuration&quot; section.
The details for setting up a Twilio BYOC trunk
can be found in Twilio&#x27;s &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.twilio.com&#x2F;docs&#x2F;voice&#x2F;bring-your-own-carrier-byoc&quot;&gt;BYOC trunk&lt;&#x2F;a&gt; documentation.&lt;&#x2F;p&gt;
&lt;p&gt;You can also enable voicemail on incoming calls to your number by adding an &lt;code&gt;action&lt;&#x2F;code&gt;
field to the &lt;code&gt;&amp;lt;Dial&amp;gt;&lt;&#x2F;code&gt; verb followed by the &lt;code&gt;&amp;lt;Sip&amp;gt;&lt;&#x2F;code&gt; noun&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;diff&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;font-style: italic;&quot;&gt;@@ -77,6 +77,7 @@&lt;&#x2F;span&gt;&lt;span&gt; exports.handler = function(context, event, callback) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            if (mergedAggregatedE164CredentialUsernames.includes(toE164Normalized)) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                console.log(&amp;#39;Dialing another E.164 SIP User&amp;#39;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                twiml.dial({&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;+                   action: url.resolve(context.PATH, &amp;#39;voicemail&amp;#39;),&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    callerId: fromSipCallerId,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    record: &amp;quot;record-from-answer&amp;quot;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    answerOnBridge: true&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;You then need to have a &lt;code&gt;&#x2F;voicemail&lt;&#x2F;code&gt; webhook available which then records a message.
Here&#x27;s an example: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;gist.github.com&#x2F;shalzz&#x2F;3046edd4d2dca123875ac84853f1cbc1&quot;&gt;https:&#x2F;&#x2F;gist.github.com&#x2F;shalzz&#x2F;3046edd4d2dca123875ac84853f1cbc1&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Twilio provides a generous amount of trial credits, letting you test and correct your
setup before moving onto a paid plan which is when you start paying for usage.
You can use my &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.twilio.com&#x2F;referral&#x2F;KrXNxn&quot;&gt;Twilio referral link&lt;&#x2F;a&gt; to get $10 in credit when you upgrade.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;softphone&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#softphone&quot; aria-label=&quot;Anchor link for: softphone&quot;&gt;🔗&lt;&#x2F;a&gt;
Softphone&lt;&#x2F;h2&gt;
&lt;p&gt;The last remaining piece of the puzzle is a softphone app through which you&#x27;ll
receive and make calls. There are a few good softphone apps that work across platforms:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;linphone.org&#x2F;&quot;&gt;Linephone&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.acrobits.net&#x2F;sip-client-ios-android&#x2F;&quot;&gt;Acrobits Softphone&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.counterpath.com&#x2F;bria-solo&#x2F;&quot;&gt;Bria&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h2 id=&quot;further-improvements&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#further-improvements&quot; aria-label=&quot;Anchor link for: further-improvements&quot;&gt;🔗&lt;&#x2F;a&gt;
Further Improvements&lt;&#x2F;h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.twilio.com&#x2F;docs&#x2F;voice&#x2F;api&#x2F;secure-media&quot;&gt;SRTP Media transport&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.twilio.com&#x2F;docs&#x2F;global-infrastructure&#x2F;understanding-twilio-regions&quot;&gt;Twilio region&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>

        
          <category term="Asterisk, Asterisk server, sip server, Twilio, openwrt, sms, sip, voip, sip phone, sms to email, email, gsmbox, gsm, modem, rtp, srtp, sms hijacking, sim swap, sim swap attack, mitigate sim swap, gsm box, huawei dongle, Asterisk-chan-dongle, Asterisk-chan-quectel, BYOC trunk, pstn, forwarding" />
        

        
          <summary type="html">Special thanks to Pramey Singh for feedback and review.



As a Sovereign Individual, traveling and staying overseas for long periods frequently, switching sim cards&#x2F;numbers can quickly become a pain.
It can be helpful to still retain control over an operational phone number of your home country across geolocations.
Doing so lets you forward and make local home calls and be able to receive your bank&#x27;s account and OTP related text messages.
The solution proposed here isn&#x27;t a location dependent one like using Google Fi or relying on expensive international roaming plans.
Instead, it gives you ownership and freedom to retain, switch or dispose of your phone numbers at local rates, across political borders.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Should you buy Bitcoin in India? A Buyers Guide</title>
        <link href="https://shaleenjain.com/blog/bitcoin-buying-guide/" type="text/html"/>
        <pubDate>2021-05-26T00:00:00+00:00</pubDate>
        <published>2021-05-26T00:00:00+00:00</published>
        <updated>2021-05-26T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/bitcoin-buying-guide/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/bitcoin-buying-guide/">&lt;p&gt;I&#x27;ve had a bunch of friends approach me recently on ways to invest in bitcoin and
other cryptocurrencies.
In an effort to save myself from answering the same questions again and at the same
time do a decent job explaining the risks and intricacies involved with what
you&#x27;d think to be a simple process of buying bitcoin, I&#x27;m writing this post as a guide on &quot;How to buy bitcoin in India&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;As you can gather from the title, due to the highly regulatory environment of bitcoin, this
post is relevant only for the Indian market. I&#x27;ll make an effort to update this post as
things change however most of the content here should be relevant regardless.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;!-- toc --&gt;
&lt;h2 id=&quot;know-what-you-re-investing-in&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#know-what-you-re-investing-in&quot; aria-label=&quot;Anchor link for: know-what-you-re-investing-in&quot;&gt;🔗&lt;&#x2F;a&gt;
Know What You&#x27;re Investing In&lt;&#x2F;h2&gt;
&lt;p&gt;As with anything you&#x27;re investing in you should make an effort of understanding
what is it you&#x27;re investing in and how it works. For bitcoin, giving the original &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;bitcoin.org&#x2F;en&#x2F;bitcoin-paper&quot;&gt;whitepaper&lt;&#x2F;a&gt;
a read should give you a brief understanding of the ideas behind it even if you don&#x27;t
understand the technical workings of it.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-right-time&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-right-time&quot; aria-label=&quot;Anchor link for: the-right-time&quot;&gt;🔗&lt;&#x2F;a&gt;
The Right Time&lt;&#x2F;h2&gt;
&lt;p&gt;Is this the right time to buy Bitcoin and&#x2F;or Ethereum?
If you&#x27;re long term bullish about Bitcoin and Ethereum like me, it&#x27;s always a good time to
buy using the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.investopedia.com&#x2F;terms&#x2F;d&#x2F;dollarcostaveraging.asp&quot;&gt;Dollar Cost Averaging &lt;&#x2F;a&gt; investing method.&lt;&#x2F;p&gt;
&lt;p&gt;As general rule only invest what you are willing to lose. This is still a highly speculative market and
there are risks involved.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;exchange&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#exchange&quot; aria-label=&quot;Anchor link for: exchange&quot;&gt;🔗&lt;&#x2F;a&gt;
Exchange&lt;&#x2F;h2&gt;
&lt;p&gt;Once you&#x27;re all set to actually buy bitcoin you need to setup an account at a
cryptocurrency exchange. There are various exchanges operating in India and few
come and go regularly. My recommended exchange is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wazirx.com&#x2F;invite&#x2F;d2vccv2n&quot;&gt;WazirX&lt;&#x2F;a&gt;. They have a good
mobile app and offer good prices overall across all Indian exchanges.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;inr-deposits&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#inr-deposits&quot; aria-label=&quot;Anchor link for: inr-deposits&quot;&gt;🔗&lt;&#x2F;a&gt;
INR Deposits&lt;&#x2F;h2&gt;
&lt;p&gt;If it so happens the time you&#x27;re trying to buy bitcoin, Indian banks are blocking deposits
to the exchanges, preventing card purchases of bitcoin or in general being the legacy
obscure institutes in denial of being disrupted and replaced that they are, then congrats
you know what the revolution feels like.&lt;&#x2F;p&gt;
&lt;p&gt;Fortunately &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wazirx.com&#x2F;invite&#x2F;d2vccv2n&quot;&gt;WazirX&lt;&#x2F;a&gt; rose to fame for a feature that works around just this problem.
You can still buy bitcoin by using their P2P buy feature to first buy USDT (a U.S. dollar stable coin)
and then use USDT to buy bitcoin.&lt;&#x2F;p&gt;
&lt;p&gt;You can learn more about WazirX P2P &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;support.wazirx.com&#x2F;hc&#x2F;en-us&#x2F;articles&#x2F;360007205514-WazirX-P2P-How-it-Works-&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;wallet&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#wallet&quot; aria-label=&quot;Anchor link for: wallet&quot;&gt;🔗&lt;&#x2F;a&gt;
Wallet&lt;&#x2F;h2&gt;
&lt;p&gt;Once you have enough bitcoin(s), you might be looking into ways of securely storing
your bitcoin(s) outside of the exchange for long term safekeeping of your investment and gaining custody
of your coin(s).&lt;&#x2F;p&gt;
&lt;p&gt;A bitcoin wallet or any cryptocurrency wallet is an app that stores the private key
that can be used to spent your bitcoin(s). If someone else has access to this private key
then they can transfer the bitcoin(s) without your approval&#x2F;knowledge. Much like the password&#x2F;pin
to your bank account, however with bitcoin there is no one to call and
&lt;del&gt;report theft&lt;&#x2F;del&gt; revert the transaction.&lt;&#x2F;p&gt;
&lt;p&gt;So it&#x27;s important you understand how to secure your bitcoin wallet&#x27;s private key
and it&#x27;s backup (mnemonic seed) and use a good wallet from the start.&lt;&#x2F;p&gt;
&lt;p&gt;Hardware wallets are separate air-gapped devices that store the private key on
a secure element from which the private key can never be extracted once correctly
setup. They are good for making sure viruses and malware can&#x27;t access you&#x27;re private key
even if you&#x27;re not a cyber security expect and can&#x27;t manage to keep your personal PC
free from viruses.&lt;&#x2F;p&gt;
&lt;p&gt;A great starting hardware wallet is the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.etherbit.in&#x2F;products&#x2F;ledger-nano-s?r=061494ec&quot;&gt;Ledger Nano S&lt;&#x2F;a&gt;. It works great
and has good supporting applications for both the desktop and mobile.&lt;&#x2F;p&gt;
&lt;p&gt;Go &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;support.ledger.com&#x2F;hc&#x2F;en-us&#x2F;articles&#x2F;360000380313-Manage-your-private-keys-own-your-crypto&quot;&gt;through&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;support.ledger.com&#x2F;hc&#x2F;en-us&#x2F;articles&#x2F;360002481534&quot;&gt;these&lt;&#x2F;a&gt; &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;support.ledger.com&#x2F;hc&#x2F;en-us&#x2F;articles&#x2F;360005514233&quot;&gt;articles&lt;&#x2F;a&gt; to understand how to properly use a hardware wallet.&lt;&#x2F;p&gt;
&lt;p&gt;If you find hardware wallets are too complicated and have invested only in Ethereum
and Ethereum based assets, then &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;argent.link&#x2F;mpikXeI2P3&quot;&gt;Argent&lt;&#x2F;a&gt; is a good alternative.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;dogecoin&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#dogecoin&quot; aria-label=&quot;Anchor link for: dogecoin&quot;&gt;🔗&lt;&#x2F;a&gt;
Dogecoin?&lt;&#x2F;h2&gt;
&lt;p&gt;Dogecoin is a meme coin. Unless you know what your doing and&#x2F;or are a professional
trader, stick to Bitcoin&#x2F;Ethereum.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;faq&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#faq&quot; aria-label=&quot;Anchor link for: faq&quot;&gt;🔗&lt;&#x2F;a&gt;
FAQ&lt;&#x2F;h2&gt;
&lt;h3 id=&quot;is-bitcoin-illegal-in-india&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#is-bitcoin-illegal-in-india&quot; aria-label=&quot;Anchor link for: is-bitcoin-illegal-in-india&quot;&gt;🔗&lt;&#x2F;a&gt;
Is bitcoin illegal in India?&lt;&#x2F;h3&gt;
&lt;p&gt;No.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;which-bank-do-you-have-an-account-with&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#which-bank-do-you-have-an-account-with&quot; aria-label=&quot;Anchor link for: which-bank-do-you-have-an-account-with&quot;&gt;🔗&lt;&#x2F;a&gt;
Which bank do you have an account with?&lt;&#x2F;h3&gt;
&lt;p&gt;I&#x27;ve had a better experience with public sector banks as compared to private banks
when using an account for buying bitcoin.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;do-i-have-to-pay-taxes-on-bitcoin&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#do-i-have-to-pay-taxes-on-bitcoin&quot; aria-label=&quot;Anchor link for: do-i-have-to-pay-taxes-on-bitcoin&quot;&gt;🔗&lt;&#x2F;a&gt;
Do I have to pay taxes on bitcoin?&lt;&#x2F;h3&gt;
&lt;p&gt;No. Not yet. Only when you sell and book a profit you have to pay capital gains on the profit.
Disclaimer: I&#x27;m not a tax lawyer you should still contact your tax lawyer about this.&lt;&#x2F;p&gt;
</content>

        
          <category term="blockchain, bitcoin, ban, cryptocurrencies, cryptocurrency, ethereum, india, exchange, wazirx, review, buy bitcoin, buy, hardware wallet, buy bitcoin in india, wallet, ledger, ledger nano s, ledger nano, p2p, usdt, wazirx p2p, guide, bank, indian bank, dogecoin, bitcoin tax" />
        

        
          <summary type="html">I&#x27;ve had a bunch of friends approach me recently on ways to invest in bitcoin and
other cryptocurrencies.
In an effort to save myself from answering the same questions again and at the same
time do a decent job explaining the risks and intricacies involved with what
you&#x27;d think to be a simple process of buying bitcoin, I&#x27;m writing this post as a guide on &quot;How to buy bitcoin in India&quot;.
As you can gather from the title, due to the highly regulatory environment of bitcoin, this
post is relevant only for the Indian market. I&#x27;ll make an effort to update this post as
things change however most of the content here should be relevant regardless.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Owning your DNS Stack: Towards a more Decentralized Internet</title>
        <link href="https://shaleenjain.com/blog/decentralized-dns/" type="text/html"/>
        <pubDate>2021-01-08T00:00:00+00:00</pubDate>
        <published>2021-01-08T00:00:00+00:00</published>
        <updated>2021-01-08T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/decentralized-dns/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/decentralized-dns/">&lt;h2 id=&quot;introduction&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#introduction&quot; aria-label=&quot;Anchor link for: introduction&quot;&gt;🔗&lt;&#x2F;a&gt;
Introduction&lt;&#x2F;h2&gt;
&lt;p&gt;Domain Name System (&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Domain_Name_System&quot;&gt;DNS&lt;&#x2F;a&gt;) is a protocol for naming servers on the internet that host
websites. Since computers on the internet are recognizable to each other
only by their IP addresses which is a unique numerical label, for convenience
every website uses a fairly recognizable domain name (www.ietf.org) to
point users to their own servers (4.31.198.44) hosting the website by the means
of the DNS system, where a DNS server provides the mapping between the domain
name and the server IP address.&lt;&#x2F;p&gt;
&lt;p&gt;However the current architecture of DNS servers and domain name issuers is highly
centralized and controlled by a few organizations and corporations of the world.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h2 id=&quot;the-dark-underbelly&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-dark-underbelly&quot; aria-label=&quot;Anchor link for: the-dark-underbelly&quot;&gt;🔗&lt;&#x2F;a&gt;
The Dark Underbelly&lt;&#x2F;h2&gt;
&lt;p&gt;Having such a critical part of the Internet infrastructure be a central point
of failure can have devastating effects and is against the founding principles
of the internet envisioned by its creators.&lt;&#x2F;p&gt;
&lt;p&gt;There have been various instances where websites and user information has been
compromised by hijacked DNS systems and domain names &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#fn-1&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; as well as large scale
internet outages due to design flaws being exploited in the DNS protocol &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#fn-2&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Much of the hierarchy and centralization of the DNS system stems from the need to
have a trusted party between domain&#x2F;website owners and users, mainly TLD root domain
owners (e.g. ICANN for .com) who verify the ownership of domain names and make sure
only authorized personal can update DNS records of a website.&lt;&#x2F;p&gt;
&lt;p&gt;For a long time there hasn&#x27;t been a technically better system available that wouldn&#x27;t
require trusting a third party as a design requirement. That is until now…&lt;&#x2F;p&gt;
&lt;h2 id=&quot;handshake&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#handshake&quot; aria-label=&quot;Anchor link for: handshake&quot;&gt;🔗&lt;&#x2F;a&gt;
Handshake&lt;&#x2F;h2&gt;
&lt;p&gt;With the advent of blockchain and it&#x27;s echoing principles of the early internet
and cypherpunk, it provides a novel socio-economic-cryptographic solution for avoiding
the need to require placing trust in middlemen in inherently peer-to-peer systems.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;handshake.org&#x2F;&quot;&gt;Handshake network&lt;&#x2F;a&gt; is a decentralized, permissionless naming protocol
backed by a blockchain designed to solve the trusted 3rd party
problem with root DNS naming zones (TLD&#x27;s) and Certificate Authorities.&lt;&#x2F;p&gt;
&lt;p&gt;If you are a domain owner wanting to use the Handshake network, owning a
Handshake name involves quite a few steps
for which there are already a lot of good resources available on the internet
(see for example &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.namebase.io&#x2F;register&#x2F;16xmfa&quot;&gt;namebase.io&lt;&#x2F;a&gt;).
So, in this post we are going to focus on how you can use Handshake as an end user
and start relying on handshake for resolving traditional and handshake names.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;setup&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#setup&quot; aria-label=&quot;Anchor link for: setup&quot;&gt;🔗&lt;&#x2F;a&gt;
Setup&lt;&#x2F;h2&gt;
&lt;p&gt;The Handshake networks is made up of nodes acting as peers and exchanging messages
with every other node in the network. To participate in the network you need to
run the node software yourself on a machine or server.&lt;&#x2F;p&gt;
&lt;p&gt;The Handshake org provides open source software that is
built according to the Handshake protocol spec and has mainly two kinds of nodes:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Full node: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;handshake-org&#x2F;hsd&quot;&gt;hsd&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;Light node: &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;handshake-org&#x2F;hnsd&quot;&gt;hnsd&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;We are gonna setup the full node &lt;code&gt;hsd&lt;&#x2F;code&gt; daemon as our DNS resolver.
Since it&#x27;s a full node we are gonna need to maintain the full chain state which
can easily take multiple gigabytes (around 3-4 GB) of storage along with a 24×7 running system
on your home network. The recommended hardware for this is:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A Raspberry Pi or any other single board computer with at least 2 GB of Ram running a Linux OS&lt;&#x2F;li&gt;
&lt;li&gt;A portable&#x2F;external HDD&#x2F;SDD with least a 500GB storage space.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;If you&#x27;d rather not run the full node or don&#x27;t have a device with sufficient storage
space you can setup a light node instead which will only take up a few megabytes
of storage instead of gigabytes. For brevity I&#x27;m only gonna discuss setting up
the full node here.&lt;&#x2F;p&gt;
&lt;p&gt;Once you have the required hardware we can start setting up the software. I&#x27;d
recommend using docker images to avoid dependency hell.&lt;&#x2F;p&gt;
&lt;p&gt;You can build your own docker image from the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;handshake-org&#x2F;hsd&quot;&gt;hsd&lt;&#x2F;a&gt; repo or use a pre-built
one I have over at docker hub at &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;hub.docker.com&#x2F;r&#x2F;shalzz&#x2F;hsd&quot;&gt;shalzz&#x2F;hsd&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;docker pull shalzz&#x2F;hsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Add a volume mapping a folder on your external hdd to &lt;code&gt;&#x2F;root&#x2F;.hsd&lt;&#x2F;code&gt; and expose the
required ports according to the command line
&lt;code&gt;hsd --ns-host 0.0.0.0 --ns-port 5300 --rs-host 0.0.0.0 --rs-port 53&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;Here is the same thing as a &lt;code&gt;docker-compose.yaml&lt;&#x2F;code&gt;:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;yaml&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;services&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;  hsd&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    container_name&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; hsd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    image&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; hsd:2.2.0-a1409dc4&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    volumes&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;&#x2F;media&#x2F;sda1&#x2F;hsd-data:&#x2F;root&#x2F;.hsd&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    ports&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;53:53&#x2F;tcp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;53:53&#x2F;udp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;5300:5300&#x2F;udp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;5300:5300&#x2F;tcp&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    command&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;hsd&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;--ns-host&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;0.0.0.0&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;--ns-port&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;5300&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;--rs-host&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;0.0.0.0&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;--rs-port&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      -&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;53&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    restart&lt;&#x2F;span&gt;&lt;span&gt;:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; unless-stopped&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Once you have the hsd daemon running you can override the DNS server settings for either your
individual devices on your home network
(desktop, Smart TV) but it&#x27;s better and easier to override the DNS server settings in
your Wi-Fi router.&lt;&#x2F;p&gt;
&lt;p&gt;It&#x27;s recommended to setup a static IP&#x2F;lease to your local server to prevent
breakage. Here&#x27;s a guide to do so with the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openwrt.org&#x2F;docs&#x2F;guide-user&#x2F;luci&#x2F;static_ip&quot;&gt;OpenWrt&lt;&#x2F;a&gt; firmware.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;test&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#test&quot; aria-label=&quot;Anchor link for: test&quot;&gt;🔗&lt;&#x2F;a&gt;
Test&lt;&#x2F;h2&gt;
&lt;p&gt;To make sure everything is working as expected you can query your DNS server specifically
by its IP address. For e.g. if the device your hosting the server on has the IP
address &lt;code&gt;192.168.1.224&lt;&#x2F;code&gt; on your home network, you can query it for a name via the
&lt;code&gt;dig&lt;&#x2F;code&gt; program&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ dig @192.168.1.224 example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;; &amp;lt;&amp;lt;&amp;gt;&amp;gt; DiG 9.16.10 &amp;lt;&amp;lt;&amp;gt;&amp;gt; @192.168.1.224 example.com&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;; (1 server found)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; global options: +cmd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; Got answer:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; -&amp;gt;&amp;gt;HEADER&amp;lt;&amp;lt;- opcode: QUERY, status: NOERROR, id: 18916&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; flags: qr rd ra ad; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; OPT PSEUDOSECTION:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;; EDNS: version: 0, flags: do; udp: 4096&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;; COOKIE: b07a0053413fad96 (echoed)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; QUESTION SECTION:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;example.com.                   IN      A&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; ANSWER SECTION:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;example.com.            86396   IN      A       93.184.216.34&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; SIG0 PSEUDOSECTION:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;.                       0       ANY     SIG     0 253 0 0 20210108123100 20210108003100 32465 . 2MVUz5L0LOAi6RO5e2lZJTwmnSvVancyyVdSeAyp3lAxkcCtp7CD8HVx alVG4G&#x2F;MfkUg9GIicKp&#x2F;ZpQyY7BHpQ==&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; Query time: 36 msec&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; SERVER: 192.168.1.224#53(192.168.1.224)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; WHEN: Fri Jan 08 12:01:00 IST 2021&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;;; MSG SIZE  rcvd: 162&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If the status here is &lt;code&gt;NOERROR&lt;&#x2F;code&gt; and you see any entries under the ANSWER Section,
you have successfully setup your own DNS server.&lt;&#x2F;p&gt;
&lt;p&gt;An additional benefit of using handshake network here is now in addition to traditional
domain names you can resolve handshake names as well. Try visiting or resolving &lt;code&gt;http:&#x2F;&#x2F;welcome.nb.&#x2F;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;h2 id=&quot;adguard&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#adguard&quot; aria-label=&quot;Anchor link for: adguard&quot;&gt;🔗&lt;&#x2F;a&gt;
Adguard&lt;&#x2F;h2&gt;
&lt;p&gt;Since you&#x27;ve come this far you might as well setup an Adblocking server as well
that is using your &lt;code&gt;hsd&lt;&#x2F;code&gt; DNS server as an upstream.&lt;&#x2F;p&gt;
&lt;p&gt;There are two good options for adblocking self-hosting server&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;pi-hole.net&#x2F;&quot;&gt;Pihole&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;AdguardTeam&#x2F;AdGuardHome&quot;&gt;Adguard&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;I find Adguard to be much more reliable and that is what I use personally.
If you decide to go ahead with Adguard they already have great documentation
to get up and running with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;AdguardTeam&#x2F;AdGuardHome&#x2F;wiki&#x2F;Docker&quot;&gt;docker&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Once you have Adguard running in addition to &lt;code&gt;hsd&lt;&#x2F;code&gt; you can setup Adguard to use
&lt;code&gt;hsd&lt;&#x2F;code&gt; as an upstream server in the DNS settings page of Adguard.
Make sure you change the port number you used earlier for &lt;code&gt;hsd&lt;&#x2F;code&gt; from &lt;code&gt;53&lt;&#x2F;code&gt; to
something else since there can only be one process listening on a port as here
&lt;code&gt;adguard&lt;&#x2F;code&gt; acts as a filter between clients and the actual DNS resolver.&lt;&#x2F;p&gt;
&lt;p&gt;For e.g. if your device IP address is &lt;code&gt;192.168.1.224&lt;&#x2F;code&gt; and the port of &lt;code&gt;hsd&lt;&#x2F;code&gt; is &lt;code&gt;54&lt;&#x2F;code&gt;
use &lt;code&gt;tcp:&#x2F;&#x2F;192.168.1.224:54&lt;&#x2F;code&gt; as an upstream server address for both
&lt;code&gt;Upstream DNS servers&lt;&#x2F;code&gt; and &lt;code&gt;Bootstrap DNS servers&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;figure&gt; 


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;adguard-dns.a74fa030fdb10490.png&quot;  &#x2F;&gt;

&lt;figcaption&gt; Adguard Dashboard on its DNS settings page &lt;&#x2F;figcaption&gt;
&lt;br&#x2F;&gt;
&lt;&#x2F;figure&gt;
&lt;p&gt;Here is the complete &lt;code&gt;docker-compose.yaml&lt;&#x2F;code&gt; file for setting up both &lt;code&gt;hsd&lt;&#x2F;code&gt; and &lt;code&gt;adguard&lt;&#x2F;code&gt;.
Customize for your setup.&lt;&#x2F;p&gt;
&lt;div &gt;
    &lt;script src=&quot;https:&amp;#x2F;&amp;#x2F;gist.github.com&amp;#x2F;shalzz&amp;#x2F;e30d41403f92feef0d2688d081336dbd.js&quot;&gt;&lt;&#x2F;script&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;fn-1&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;&#x2F;sup&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;krebsonsecurity.com&#x2F;2019&#x2F;02&#x2F;a-deep-dive-on-the-recent-widespread-dns-hijacking-attacks&#x2F;&quot;&gt;A Deep Dive on the Recent Widespread DNS Hijacking Attacks&lt;&#x2F;a&gt;:
&quot;...hijacking the DNS servers for these targets, so that all email and virtual private networking (VPN) traffic was redirected to an Internet address controlled by the attackers...&quot;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;fn-2&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;2&lt;&#x2F;sup&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;2016_Dyn_cyberattack&quot;&gt;2016 Dyn cyberattack&lt;&#x2F;a&gt;: The attack caused major Internet platforms and services to be unavailable to large swathes of users in Europe and North America.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
</content>

        
          <category term="dns, handshake, adguard, pihole, pi-hole, server, dns server, namebase, decentralized, blockchain, proof of work, dns resolver, hsd, hsnd, raspberry pi, jetson nano, rpi, self-host, self host, host, handshake-org, build, setup, run, create" />
        

        
          <summary type="html">🔗
Introduction
Domain Name System (DNS) is a protocol for naming servers on the internet that host
websites. Since computers on the internet are recognizable to each other
only by their IP addresses which is a unique numerical label, for convenience
every website uses a fairly recognizable domain name (www.ietf.org) to
point users to their own servers (4.31.198.44) hosting the website by the means
of the DNS system, where a DNS server provides the mapping between the domain
name and the server IP address.
However the current architecture of DNS servers and domain name issuers is highly
centralized and controlled by a few organizations and corporations of the world.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Home Media Streaming Server with Wireguard and OpenWRT</title>
        <link href="https://shaleenjain.com/blog/streaming-server/" type="text/html"/>
        <pubDate>2019-12-01T00:00:00+00:00</pubDate>
        <published>2019-12-01T00:00:00+00:00</published>
        <updated>2019-12-01T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/streaming-server/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/streaming-server/">&lt;p&gt;&lt;em&gt;Special thanks to Chakradhar Dhulipalla for feedback and review.&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;h3 id=&quot;background-and-motivation&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#background-and-motivation&quot; aria-label=&quot;Anchor link for: background-and-motivation&quot;&gt;🔗&lt;&#x2F;a&gt;
Background and motivation&lt;&#x2F;h3&gt;
&lt;p&gt;Long gone are the good ol&#x27; days when Netflix used to be the only streaming service
you subscribed to and sparingly shared with your friends and family
providing access to virtually every video content out there.
But now if you haven&#x27;t noticed there&#x27;s a new streaming service rolled out by
every other big producer and publisher with their exclusive content as the only selling
point to drive adoption.&lt;&#x2F;p&gt;
&lt;p&gt;In this new world, for some it&#x27;s perfectly reasonable to subscribe to every
service exclusively streaming the new TV series. For others it&#x27;s the constant
juggle between one or two services every month.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;If like me you don&#x27;t have any qualms with piracy and are relatively safe from
law enforcement in your jurisdiction then you might say there&#x27;s an easy solution
and you&#x27;d not be alone. The fragmentation of the streaming market is the single
biggest reason for the subsequent re-rise of the piracy industry (&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.vice.com&#x2F;en_us&#x2F;article&#x2F;d3q45v&#x2F;bittorrent-usage-increases-netflix-streaming-sites&quot;&gt;vice.com&lt;&#x2F;a&gt;).&lt;&#x2F;p&gt;
&lt;p&gt;Pirating leads to some problems of it&#x27;s own though, that of storage space.
Deleting old files to make space for new downloads, being tied down to a single
device, scrubbing to exactly where you left off an episode on another device
after taking the pains to copy the gigabytes of data between devices.&lt;&#x2F;p&gt;
&lt;p&gt;This inspired me to come up with an alternative that solves most if not all
of the paper cuts from pirating.&lt;&#x2F;p&gt;
&lt;!-- toc --&gt;
&lt;h3 id=&quot;abstract&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#abstract&quot; aria-label=&quot;Anchor link for: abstract&quot;&gt;🔗&lt;&#x2F;a&gt;
Abstract&lt;&#x2F;h3&gt;
&lt;p&gt;This is an overview of how you can effectively have your own streaming server
with zero running costs, setup at your home with consumer hardware you most likely
already own, allowing you to stream your entire media library via your WI-FI
connection when you&#x27;re at home and through a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;wireguard.com&quot;&gt;Wireguard&lt;&#x2F;a&gt; VPN connecting to your home
router when you&#x27;re on the move.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;prerequisites&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#prerequisites&quot; aria-label=&quot;Anchor link for: prerequisites&quot;&gt;🔗&lt;&#x2F;a&gt;
Prerequisites&lt;&#x2F;h3&gt;
&lt;p&gt;Most of the hardware used here is pretty standard and should be easy to acquire.
But this whole setup is contingent on having a router with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openwrt.org&quot;&gt;OpenWRT&lt;&#x2F;a&gt; installed
or one that is supported by the OpenWRT project and you are not afraid of tinkering
with you&#x27;re router to install OpenWRT on it yourself.
Besides the hardware requirements, general familiarity with *nix systems and
command line would make this very easy for you.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;disclaimer&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#disclaimer&quot; aria-label=&quot;Anchor link for: disclaimer&quot;&gt;🔗&lt;&#x2F;a&gt;
Disclaimer&lt;&#x2F;h3&gt;
&lt;p&gt;This is not going to be a step-by-step tutorial since the underlying technology
and the CLI is constantly evolving and changing. Rather I&#x27;m going to just
describe the architecture and link to the OpenWRT wiki where necessary.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;ingredients-requirements&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#ingredients-requirements&quot; aria-label=&quot;Anchor link for: ingredients-requirements&quot;&gt;🔗&lt;&#x2F;a&gt;
Ingredients&#x2F;Requirements&lt;&#x2F;h3&gt;
&lt;p&gt;The actual hardware requirements are:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;A recent router with at least one USB port and OpenWRT installed.&lt;&#x2F;li&gt;
&lt;li&gt;A portable USB hard-drive&#x2F;SSD or a NAS box with a USB connection.&lt;&#x2F;li&gt;
&lt;li&gt;An Ethernet cable in case you mess up your WiFi&#x2F;firewall config.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;architecture&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#architecture&quot; aria-label=&quot;Anchor link for: architecture&quot;&gt;🔗&lt;&#x2F;a&gt;
Architecture&lt;&#x2F;h3&gt;
&lt;p&gt;Our Software stack would comprise of mainly these four main technologies
each of which I will explain in detail:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Samba server: Filesystem over the Network.&lt;&#x2F;li&gt;
&lt;li&gt;Wireguard peers: A secure VPN&lt;&#x2F;li&gt;
&lt;li&gt;libtransmission: A torrent client&lt;&#x2F;li&gt;
&lt;li&gt;DDNS: Dynamic DNS to update our router IP address to a DNS record.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;figure style=&quot;width:75%;margin:auto;&quot;&gt;
    


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;streaming-server.238e106a91a2a72b.png&quot;  &#x2F;&gt;

&lt;figcaption style=&quot;text-align:center;&quot;&gt;Fig 1: Network Architecture&lt;&#x2F;figcaption&gt;
&lt;br&#x2F;&gt;
&lt;&#x2F;figure&gt;
&lt;h4 id=&quot;samba&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#samba&quot; aria-label=&quot;Anchor link for: samba&quot;&gt;🔗&lt;&#x2F;a&gt;
Samba&lt;&#x2F;h4&gt;
&lt;p&gt;The premiss of our setup is having a Network Attached Storage (NAS). Off the shelf
NAS boxes are generally more expensive but they do allow you to setup hard-drives
in a RAID configuration providing redundancy and backup. If you already have a
NAS box you can use it instead otherwise if you&#x27;re not doing any content creation
and don&#x27;t need high write throughput then a single drive is more than enough.&lt;&#x2F;p&gt;
&lt;p&gt;There are two main filesystem-over-the-network solutions&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;NFS: the Linux native Network File System.&lt;&#x2F;li&gt;
&lt;li&gt;Server Message Block (SMB): A widely supported protocol with Microsoft&#x27;s
own implementation for Windows.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;Since SMB is a more widely supported protocol and we need to be able to access our
NAS from any client device including Windows and MacOS we will be using Samba,
a SMB implementation for Linux.&lt;&#x2F;p&gt;
&lt;p&gt;You can find the details on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openwrt.org&#x2F;docs&#x2F;guide-user&#x2F;services&#x2F;nas&#x2F;cifs.server&quot;&gt;how to setup Samba&lt;&#x2F;a&gt; on OpenWRT on the wiki.&lt;&#x2F;p&gt;
&lt;p&gt;To Access the Samba drive from a client point it to the IP address of your router.
For example if you router has an IP address &lt;code&gt;192.168.1.1&lt;&#x2F;code&gt; then you can access the
drive at &lt;code&gt;smb:&#x2F;&#x2F;192.168.1.1&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;wireguard&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#wireguard&quot; aria-label=&quot;Anchor link for: wireguard&quot;&gt;🔗&lt;&#x2F;a&gt;
Wireguard&lt;&#x2F;h4&gt;
&lt;p&gt;Wireguard is a new modern and secure VPN in-built into the Linux kernel that is based
on public key cryptography for peer verification and authentication.
Wireguard is simple to setup yet performant making it the ideal VPN
to use on embedded devices like home routers unlike OpenVPN which has a
huge dependency on OpenSSL which takes up a lot more flash storage space
as well as being highly CPU intensive.&lt;&#x2F;p&gt;
&lt;p&gt;Setting up wireguard on OpenWRT is not very different from setting it up on any
other device besides installing the required packages which you can find &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openwrt.org&#x2F;docs&#x2F;guide-user&#x2F;services&#x2F;vpn&#x2F;wireguard&#x2F;start&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;For a better more general guide to configuring wireguard see this excellent &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.stavros.io&#x2F;posts&#x2F;how-to-configure-wireguard&#x2F;&quot;&gt;blog
post&lt;&#x2F;a&gt; by Stavros Korokithakis.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;transmission&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#transmission&quot; aria-label=&quot;Anchor link for: transmission&quot;&gt;🔗&lt;&#x2F;a&gt;
Transmission&lt;&#x2F;h4&gt;
&lt;p&gt;libtransmission is a small library to easily download torrents onto any
device though for it to be useful you often have to pull in at least one
additional library that interacts with libtransmission over RPC.
Only caveat with libtransmission I faced especially on my router was that
it put a non-trivial CPU load while actively downloading a torrent, I&#x27;m not sure
if it&#x27;s because of my CPU not being capable enough or me having something misconfigured.
But it&#x27;s generally not an issue if you don&#x27;t have something downloading 24&#x2F;7.&lt;&#x2F;p&gt;
&lt;p&gt;Details on how to install and configure transmission are &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openwrt.org&#x2F;docs&#x2F;guide-user&#x2F;services&#x2F;downloading_and_filesharing&#x2F;transmission&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Once you have everything setup correctly along with wireguard you can effectively
login from anywhere and queue up a torrent to download with the full bandwidth
of your home connection directly onto the hard drive connected to your router.&lt;&#x2F;p&gt;
&lt;figure style=&quot;width:85%;margin:auto;&quot;&gt;
    


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;transmission-web.03b995cb63608e55.png&quot;  &#x2F;&gt;

&lt;figcaption style=&quot;text-align:center;&quot;&gt;Fig 2: Transmission Web running on a home router&lt;&#x2F;figcaption&gt;
&lt;br&#x2F;&gt;
&lt;&#x2F;figure&gt;
&lt;h4 id=&quot;ddns&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#ddns&quot; aria-label=&quot;Anchor link for: ddns&quot;&gt;🔗&lt;&#x2F;a&gt;
DDNS&lt;&#x2F;h4&gt;
&lt;p&gt;This is something we shouldn&#x27;t really need but alas we require unless you have a static
IP connection for your home!
With the way wireguard works we need to know the IP addresses of all our peers
we wish to connect to. There is some work going on that could make wireguard work
with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;WireGuard&#x2F;wg-dynamic&#x2F;blob&#x2F;master&#x2F;docs&#x2F;idea.md&quot;&gt;dynamic IP address&lt;&#x2F;a&gt; but until that is stabilised we need to use hacks such
as DDNS.&lt;&#x2F;p&gt;
&lt;p&gt;Majority of ISPs allocate a new IP address to home gateways every time it tries
to connect. DDNS is an old and reliable way for to be updated every time the IP address
changes.&lt;&#x2F;p&gt;
&lt;p&gt;Details on how to get DDNS working on OpenWRT can be found &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;openwrt.org&#x2F;docs&#x2F;guide-user&#x2F;base-system&#x2F;ddns&quot;&gt;here&lt;&#x2F;a&gt;.
There are some recommendation of good DDNS providers on the wiki. I personally
prefer to use &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.dynu.com&#x2F;en-US&#x2F;DynamicDNS&quot;&gt;dynu&lt;&#x2F;a&gt; with &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.dnsomatic.com&#x2F;&quot;&gt;DNS-o-Matic&lt;&#x2F;a&gt;.
DNS-o-Matic allows you to multiplex to various DDNS providers making sure you have
backups in case of any DNS outage.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;conclusion&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#conclusion&quot; aria-label=&quot;Anchor link for: conclusion&quot;&gt;🔗&lt;&#x2F;a&gt;
Conclusion&lt;&#x2F;h3&gt;
&lt;p&gt;After this I hope you have a better idea of how you can run your own media streaming
server and tune it to your own liking. If you liked it please share with others
and help spread the decentralization of the internet and be in control of you own
data and preferences.&lt;&#x2F;p&gt;
</content>

        
          <category term="openwrt, wireguard, streaming, video, media, home media, samba server, samba, torrent, transmission, netflix, piracy, netflix alternative, home server, openwrt samba, nas, ddns, network attached storage, home media server, media server, nas with openwrt" />
        

        
          <summary type="html">Special thanks to Chakradhar Dhulipalla for feedback and review.
🔗
Background and motivation
Long gone are the good ol&#x27; days when Netflix used to be the only streaming service
you subscribed to and sparingly shared with your friends and family
providing access to virtually every video content out there.
But now if you haven&#x27;t noticed there&#x27;s a new streaming service rolled out by
every other big producer and publisher with their exclusive content as the only selling
point to drive adoption.
In this new world, for some it&#x27;s perfectly reasonable to subscribe to every
service exclusively streaming the new TV series. For others it&#x27;s the constant
juggle between one or two services every month.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>The Year of Blockchain</title>
        <link href="https://shaleenjain.com/blog/the-year-of-blockchain/" type="text/html"/>
        <pubDate>2019-07-22T00:00:00+00:00</pubDate>
        <published>2019-07-22T00:00:00+00:00</published>
        <updated>2019-07-22T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/the-year-of-blockchain/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/the-year-of-blockchain/">&lt;p&gt;The year of 2019 has been a wild ride for the blockchain industry.
The looming ban on cryptocurrencies by the Indian government and the leak of a
draft bill that proposes a 10 year jail term.
The long awaited end of crypto winter with bitcoin reaching a high of $13,000 and
hovering around $10,000 as of this writing.
The announcement of a &quot;cryptocurrency&quot;
by Facebook and their plans to make it a global stable digital coin.&lt;&#x2F;p&gt;
&lt;p&gt;These all might seem like unrelated events but they all point to one thing,
the blockchain and cryptocurrencies ecosystem has reached a level of maturity
that big tech companies and democratic governments around the world are not only
taking notice but are taking proactive steps to adopt and regulate the industry.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Andreas M. Antonopoulos lists out &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=SMEOKDVXlUo&amp;amp;t=1490s&quot;&gt;three elements&lt;&#x2F;a&gt; to success in this industry:
Market, Timing and Sequencing.&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Market&lt;&#x2F;em&gt;: At this point we can all agree there is a market for cryptocurrencies
and gaps in the financial system that bitcoin and others fill.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Timing&lt;&#x2F;em&gt;: After the 2008 stock market crash and the Nov 2016 demonetisation by the
Indian government, people are seeing the frailty of the traditional
financial systems and their faith that their money is safe is diminishing.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;li&gt;
&lt;p&gt;&lt;em&gt;Sequencing&#x2F;Prerequisites&lt;&#x2F;em&gt;: Andreas describes this as having density of adoption
of the underlying technology. In the case of internet, layer 2 solutions like
Facebook and Google where possible only because email drove the adoption of the
internet to the point where everyone had to have email for work. This insured there
were enough users already on the internet, the infrastructure was already laid out
and people had the technical skills to navigate the internet.&lt;&#x2F;p&gt;
&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;currency-is-the-email-of-blockchain&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#currency-is-the-email-of-blockchain&quot; aria-label=&quot;Anchor link for: currency-is-the-email-of-blockchain&quot;&gt;🔗&lt;&#x2F;a&gt;
Currency is the email of blockchain&lt;&#x2F;h3&gt;
&lt;p&gt;Here I&#x27;ll try and describe how the latest circumstances will help accelerate the
adoption of the blockchain technologies.&lt;&#x2F;p&gt;
&lt;p&gt;First, the Indian governments proposed &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;dea.gov.in&#x2F;sites&#x2F;default&#x2F;files&#x2F;Approved%20and%20Signed%20Report%20and%20Bill%20of%20IMC%20on%20VCs%2028%20Feb%202019.pdf&quot;&gt;draft bill&lt;&#x2F;a&gt; blanket banning the
use and holding of cryptocurrencies of any kind.
This might seem to be disengaging for the use and spread of cryptocurrency within
the Indian economy but unlike the ban by china after which much of the draft bill
is modeled after, the Indian government does not have neither the judicial right
to block any &lt;abbr title=&quot;peer to peer&quot;&gt;p2p&lt;&#x2F;abbr&gt; network traffic nor the technical
infrastructure to implement anything similar to the Great Firewall of China.
Rather the unintended effect of the proposal and approval of this bill will be
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Streisand_effect&quot;&gt;Streisand effect&lt;&#x2F;a&gt;. Where the fact that the government is going out of their
way to block and ban a neural technology. Disallowing it&#x27;s use to the people will
spark interest and widespread awareness about this topic and what probable cause
or justification the government might have to ban such a technology.&lt;&#x2F;p&gt;
&lt;p&gt;The bill will take away any last hope of businesses and startups working
on anything even close to cryptocurrencies and blockchains in India and in the process
lose any strategic and technological superiority against other countries.
Though the government with its limited resources and knowledge about the blockchain
technology and its use cases will not be able to prevent the p2p and decentralized use
of the technology, which are precisely the requirements that bitcoin and
others aim to fulfill. Albeit many business will not be to accept bitcoin upfront
and do not anyways do so due to its currently limited transactional throughput
capabilities, people will not cease to buy and invest in what they will see as
an excellent store of value akin to digital gold and few will even continue to
trade.&lt;&#x2F;p&gt;
&lt;p&gt;The government in its draft bill has effectively proposed a ban on the flow and
storage of information where anyone holding 12 words on a piece of paper representing
their digital wallets private keys will be prosecuted and sentenced to a possible
of 10 years in jail. This is nothing short of a surveillance state trying their
best to siphon and hold onto any control and power they can, withstanding
the title of the worlds largest democracy.&lt;&#x2F;p&gt;
&lt;p&gt;Second, the announcement and launch of &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;libra.org&#x2F;en-US&#x2F;&quot;&gt;libra&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;calibra.com&#x2F;&quot;&gt;calibra&lt;&#x2F;a&gt; by Facebook
which is their own cryptocurrency described as a global digital coin
pegged to a basket of fiat currencies.
A lot of people have rightly said Facebook&#x27;s libra is &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=MmEr2VZrjmE&quot;&gt;not a blockchain&lt;&#x2F;a&gt; with none
of the characteristics and principals that govern a cryptocurrency like
bitcoin. But Facebook&#x27;s libra is close enough to maybe fools regulators and governments
and if they are successful in launching libra, it will bring positive regulations
for cryptocurrencies by complying with the governments KYC and AML requirements
from a wallets point of view but having no such requirements or restrictions on
the protocol or the libra association level.&lt;&#x2F;p&gt;
&lt;p&gt;Facebook&#x27;s libra plans to operate in a grey area where it complies with
traditional laws on the surface but also has enough cracks for people
to slip into the system through its &quot;on and off ramps&quot; that might not
be as well regulated as Facebook&#x27;s own wallet outside the U.S.
Even if we say for arguments sake that all the &quot;on and off ramps&quot; will be properly
regulated, people will still be able to transact in a p2p manner using non-custodial
wallets which will be possible going by the libra&#x27;s testnet software release.&lt;&#x2F;p&gt;
&lt;p&gt;Facebook knows it too big to be banned by any one government and who knows
their current plans may change in the future where they might pull a bait and switch
with the regulators by moving from a permissioned system to a permissionless system
described as part of their roadmap on their site. If that happens they will no
longer be able to exert any definite control on their currency outside of their wallet.&lt;&#x2F;p&gt;
&lt;p&gt;This is obviously good for the adoption of cryptocurrencies and hence blockchains
as a whole. With Libra Facebook will introduce possibly all of their 2.4 billion users to the
world of cryptocurrencies even though it is not exactly a cryptocurrency at this
time, similar to how AOL introduced people to a permissioned&#x2F;walled version of internet.&lt;&#x2F;p&gt;
&lt;p&gt;Third, the continued development and launch of more performant and scalable blockchains,
iterating and innovating on the technology first described in the bitcoin white paper
including the Bitcoin Lightning Network and Ethereum 2.0
will provide the infrastructure to support the influx of more users
and drive the adoption as well as the development, discovery and use of 2nd layer
blockchain solutions, bringing the open and decentralized nature of blockchains
and the decentralized internet to different industries and use cases.&lt;&#x2F;p&gt;
&lt;p&gt;The above events concluding in a scenario with even the slightest similarity might
just result in 2020 being the year of blockchain.&lt;&#x2F;p&gt;
</content>

        
          <category term="blockchain, bitcoin, ban, cryptocurrencies, cryptocurrency, ethereum, india, libra, facebook, crypto ban, calibra" />
        

        
          <summary type="html">The year of 2019 has been a wild ride for the blockchain industry.
The looming ban on cryptocurrencies by the Indian government and the leak of a
draft bill that proposes a 10 year jail term.
The long awaited end of crypto winter with bitcoin reaching a high of $13,000 and
hovering around $10,000 as of this writing.
The announcement of a &quot;cryptocurrency&quot;
by Facebook and their plans to make it a global stable digital coin.
These all might seem like unrelated events but they all point to one thing,
the blockchain and cryptocurrencies ecosystem has reached a level of maturity
that big tech companies and democratic governments around the world are not only
taking notice but are taking proactive steps to adopt and regulate the industry.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Blogging: From Jekyll to Zola</title>
        <link href="https://shaleenjain.com/blog/switching-blog-to-zola/" type="text/html"/>
        <pubDate>2019-02-01T00:00:00+00:00</pubDate>
        <published>2019-02-01T00:00:00+00:00</published>
        <updated>2019-02-01T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/switching-blog-to-zola/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/switching-blog-to-zola/">&lt;p&gt;When I first created this blog I used &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;jekyllrb.com&quot;&gt;Jekyll&lt;&#x2F;a&gt; for my blogging needs mostly
because that was the first
time I had come across the concept of a Static Site Generator (SSG),
generating html from markdown posts
and Jekyll was and still is the most popular SSG to date. Also because of GitHub&#x27;s
free hosting for Jekyll sites.&lt;&#x2F;p&gt;
&lt;p&gt;Jekyll gained its popularity by being a simple yet powerful framework.
It combined the Liquid templating language with a markdown processor to create
an engine that spits out a completely static website with no database or any dependencies.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Once you have or create a theme you can focus on what matters the most,
writing the content, without worrying about the formatting or the layout or the
specifies of a markup language like HTML while you are in the thought process
of writing a blog.&lt;&#x2F;p&gt;
&lt;p&gt;With Markdown you can still control how the text looks and add addition images
and links which makes it a lot better to compose and write than HTML.
A pleasant offline writing experience and ease of development
is what makes Jekyll and SSGs as a whole great.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;performance&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#performance&quot; aria-label=&quot;Anchor link for: performance&quot;&gt;🔗&lt;&#x2F;a&gt;
Performance&lt;&#x2F;h2&gt;
&lt;p&gt;Jekyll has a lot of great themes made by available by generous people which
makes it easy to pick one, customise it and start blogging. It does have
a short learning curve though and once you start writing a lot more posts you have to
consider the performance of how long it&#x27;s taking to actually generate the site
from your posts.&lt;&#x2F;p&gt;
&lt;p&gt;Building 15 pages without LSI and a atom feed generation and jekyll-assets
plugin for image processing takes &lt;code&gt;56.202 seconds&lt;&#x2F;code&gt;. That&#x27;s a long time!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ bundle exec jekyll build&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Configuration file: &#x2F;home&#x2F;shalzz&#x2F;dev&#x2F;shalzz.github.io&#x2F;_config.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            Source: &#x2F;home&#x2F;shalzz&#x2F;dev&#x2F;shalzz.github.io&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;       Destination: &#x2F;home&#x2F;shalzz&#x2F;dev&#x2F;shalzz.github.io&#x2F;_site&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; Incremental build: disabled. Enable with --incremental&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Generating...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;       Jekyll Feed: Generating feed for posts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    done in 56.202 seconds.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; Auto-regeneration: disabled. Use --watch to enable.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;On subsequent builds with incremental build enabled, it takes &lt;code&gt;2.89 seconds&lt;&#x2F;code&gt;.
Much better but still slow.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ bundle exec jekyll build --incremental&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Configuration file: &#x2F;home&#x2F;shalzz&#x2F;dev&#x2F;shalzz.github.io&#x2F;_config.yml&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            Source: &#x2F;home&#x2F;shalzz&#x2F;dev&#x2F;shalzz.github.io&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;       Destination: &#x2F;home&#x2F;shalzz&#x2F;dev&#x2F;shalzz.github.io&#x2F;_site&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; Incremental build: enabled&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Generating...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;       Jekyll Feed: Generating feed for posts&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;                    done in 2.896 seconds.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt; Auto-regeneration: disabled. Use --watch to enable.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;zola&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#zola&quot; aria-label=&quot;Anchor link for: zola&quot;&gt;🔗&lt;&#x2F;a&gt;
Zola&lt;&#x2F;h2&gt;
&lt;p&gt;I recently started learning &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;rust-lang.org&quot;&gt;Rust&lt;&#x2F;a&gt; and when I started looking around for a faster
alternative than Jekyll for my blog, I found &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;getzola.org&quot;&gt;Zola&lt;&#x2F;a&gt; a static site generator written
in Rust that compiles to a binary with performance much better
than Jekyll ( slightly slower than Hugo as of now ) since it&#x27;s a native binary
and has no runtime with no plugins and everything in built, it was perfect.&lt;&#x2F;p&gt;
&lt;p&gt;Compared to Jekyll&#x27;s Liquid template engine Zola uses Tera
as its template engine which is also written in Rust.
It has the same syntax plus the concept of &lt;code&gt;block&lt;&#x2F;code&gt;s that
can be inherited and overridden when you
extend a template from another template. If you are also looking at Hugo, Tera is a huge
step up from it&#x27;s Go based template language syntax.&lt;&#x2F;p&gt;
&lt;p&gt;After making some modifications to my sites layouts&#x2F;templates due to the subtle
difference between the two frameworks and their structuring I had now effectively
extracted my sites templates and CSS to its own &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;shalzz&#x2F;butler&quot;&gt;theme&lt;&#x2F;a&gt; that can be reused by anyone else.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;performance-1&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#performance-1&quot; aria-label=&quot;Anchor link for: performance-1&quot;&gt;🔗&lt;&#x2F;a&gt;
Performance&lt;&#x2F;h3&gt;
&lt;p&gt;Building 16 pages (including this one) with 8 images and no cache with Zola
takes only &lt;code&gt;0.13 seconds&lt;&#x2F;code&gt;.
Zola turns out to be an order of magnitude faster than Jekyll. That&#x27;s a huge improvement.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;$ zola build&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Building site...&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;-&amp;gt; Creating 16 pages (0 orphan), 2 sections, and processing 8 images&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Done in 130ms.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Combining an already fast engine with a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;features&#x2F;actions&quot;&gt;GitHub Action&lt;&#x2F;a&gt; that reuses a cached docker image
in the background, from a git push to being published on GitHub Pages takes on
average only ~20 seconds compared to Jekyll + Travis total time of ~2 minutes.&lt;&#x2F;p&gt;
&lt;p&gt;In the end I&#x27;m quite happy with Zola and it&#x27;s architecture and there&#x27;s more improvements
to come with Zola 0.6 and above.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;further-reading&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#further-reading&quot; aria-label=&quot;Anchor link for: further-reading&quot;&gt;🔗&lt;&#x2F;a&gt;
Further Reading&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.getzola.org&#x2F;documentation&#x2F;getting-started&#x2F;installation&#x2F;&quot;&gt;Zola Docs&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;tera.netlify.com&#x2F;docs&#x2F;templates&#x2F;#templates&quot;&gt;Tera Docs&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h3 id=&quot;more-links&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#more-links&quot; aria-label=&quot;Anchor link for: more-links&quot;&gt;🔗&lt;&#x2F;a&gt;
More Links&lt;&#x2F;h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;shalzz&#x2F;butler&quot;&gt;Zola theme - Butler&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;github.com&#x2F;shalzz&#x2F;zola-deploy-action&quot;&gt;Zola Deploy GitHub Action&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
</content>

        
          <category term="blog, ssg, static-site, jekyll, zola, rust, SSG, static, site, blogging, hackers" />
        

        
          <summary type="html">When I first created this blog I used Jekyll for my blogging needs mostly
because that was the first
time I had come across the concept of a Static Site Generator (SSG),
generating html from markdown posts
and Jekyll was and still is the most popular SSG to date. Also because of GitHub&#x27;s
free hosting for Jekyll sites.
Jekyll gained its popularity by being a simple yet powerful framework.
It combined the Liquid templating language with a markdown processor to create
an engine that spits out a completely static website with no database or any dependencies.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>DLNA&#x2F;UPNP casting support in VLC - Part 2</title>
        <link href="https://shaleenjain.com/blog/vlc-dlna-support-2/" type="text/html"/>
        <pubDate>2019-01-12T00:00:00+00:00</pubDate>
        <published>2019-01-12T00:00:00+00:00</published>
        <updated>2019-01-12T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/vlc-dlna-support-2/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/vlc-dlna-support-2/">&lt;p&gt;DLNA renderers, mainly TV’s are DLNA certified devices that are able to play
any media from the local network and is built upon the UPnP A&#x2F;V Architecture technology.
This allows you to cast any video or audio from any other device to your connected TV.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;!-- toc --&gt;
&lt;h2 id=&quot;discoverying-devices&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#discoverying-devices&quot; aria-label=&quot;Anchor link for: discoverying-devices&quot;&gt;🔗&lt;&#x2F;a&gt;
Discoverying Devices&lt;&#x2F;h2&gt;
&lt;p&gt;The next step in adding DLNA support was adding a &lt;code&gt;renderer_discovery&lt;&#x2F;code&gt;
module responsible for searching and adding devices that are Media Renderers i.e.
capable of playing a video&#x2F;audio stream that we may cast to it.&lt;&#x2F;p&gt;
&lt;p&gt;To do that we use the &lt;code&gt;libupnp&lt;&#x2F;code&gt; library to find the devices and call the
VLC &lt;code&gt;vlc_renderer_item_new()&lt;&#x2F;code&gt; function for each device with relevant information
so that they can be show to the user in a menu and then select which device to cast to.&lt;&#x2F;p&gt;
&lt;p&gt;Someone had partially done this before me but not yet merged, partly due to the problem
I explained and solved in the previous post of this series. After adapting that
patch we were now able to discover and list any DLNA renderers available
on the same network.&lt;&#x2F;p&gt;



&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;vlc-dlna-discover-clip.ac87b31d7a0e6ba3.jpg&quot;  &#x2F;&gt;
&lt;h2 id=&quot;casting-to-the-device&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#casting-to-the-device&quot; aria-label=&quot;Anchor link for: casting-to-the-device&quot;&gt;🔗&lt;&#x2F;a&gt;
Casting to the Device&lt;&#x2F;h2&gt;
&lt;p&gt;Now to actually be able to cast to a device we need to create a &lt;code&gt;stream_out&lt;&#x2F;code&gt;
VLC module with http as the transport method. Much of that logic is similar to
how chromecast creates a &lt;code&gt;stream_out&lt;&#x2F;code&gt; except that we use UPnP Actions represented
as SOAP requests instead of the horror that is Google&#x27;s protobuf to talk to the device.&lt;&#x2F;p&gt;
&lt;p&gt;After going through the DLNA guidelines and the UPnP AV spec, I added functions
that called the actions required to talk to any DLNA device implementing the AVTransport Service
and we had a working implementation of VLC acting as a UPnP control point that
was able to cast to almost all DLNA renderers.&lt;&#x2F;p&gt;
&lt;p&gt;I say almost all because legacy DLNA renderers (below DLNA v1.5) and renderers
not implementing the &lt;code&gt;AVTransport::SetAVTransportURI&lt;&#x2F;code&gt; action are not yet supported.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;device-media-formats&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#device-media-formats&quot; aria-label=&quot;Anchor link for: device-media-formats&quot;&gt;🔗&lt;&#x2F;a&gt;
Device Media Formats&lt;&#x2F;h2&gt;
&lt;p&gt;Having a working tranport is still half of story, another important aspect of casting is to make
sure the device is able to decode the file that you are trying to play.
To solve this I had to call the &lt;code&gt;ConnectionManager::GetProtocolInfo()&lt;&#x2F;code&gt; action
to get a CSV list of all the Media formats supported by the device, maintain
a manual list of all possible Media format profiles defined by DLNA.org and others within VLC,
find a profile that best describes the file the user is trying to play and then
compare that profile to the device profiles to make sure if it can play it.&lt;&#x2F;p&gt;
&lt;p&gt;And if a device does not support the profile of the file we are trying to play
then we transcode the file to a format that the device supports, on the fly,
and stream it to the device.&lt;&#x2F;p&gt;
&lt;p&gt;As you can imagine this is quite an involved process more so with the transcoding
since we had to make sure the transcoding will work in a reasonable amount of time
on every platform VLC is run i.e. on Linux, Windows, MacOS, iOS and android
each of which has different platform APIs and SoCs&#x2F;Processors
and hence took up majority of my time.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;future&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#future&quot; aria-label=&quot;Anchor link for: future&quot;&gt;🔗&lt;&#x2F;a&gt;
Future&lt;&#x2F;h2&gt;
&lt;p&gt;There are still a few things left to add for a seamless experience with DLNA casting
in VLC.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;demux-filter&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#demux-filter&quot; aria-label=&quot;Anchor link for: demux-filter&quot;&gt;🔗&lt;&#x2F;a&gt;
Demux Filter&lt;&#x2F;h3&gt;
&lt;p&gt;Due to the nature of VLC&#x27;s module system and its media processing pipeline, &lt;code&gt;stream_out&lt;&#x2F;code&gt;
modules cannot control the rate at which a video is decoded and sent out for display.
So things like pause, fast-forward and track sync between VLC and the DLNA device doesn&#x27;t
work properly yet.&lt;&#x2F;p&gt;
&lt;p&gt;There&#x27;s a workaround to use &lt;code&gt;demux_filter&lt;&#x2F;code&gt; to control the pacing between the &lt;code&gt;demux&lt;&#x2F;code&gt;
and the &lt;code&gt;access_out&lt;&#x2F;code&gt; module using an IPC mechanisuim between the two modules,
even though they both run in the same process.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;dlna-v1-5&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#dlna-v1-5&quot; aria-label=&quot;Anchor link for: dlna-v1-5&quot;&gt;🔗&lt;&#x2F;a&gt;
DLNA v1.5&lt;&#x2F;h3&gt;
&lt;p&gt;DLNA v1.5 is a legacy DLNA spec version that has very strict requirements and cannot
easily play any supported media from the cloud. These requirements were removed
in later versions of the DLNA spec.&lt;&#x2F;p&gt;
&lt;p&gt;To support DLNA v1.5 Media Renderers (many old Samsung and Sony TVs)
we need a DLNA v1.5 compliant HTTP server with the appropriate DLNA specific headers.
This is related to the &lt;code&gt;demux_filter&lt;&#x2F;code&gt; and can be easily implemented once we have that.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;code&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#code&quot; aria-label=&quot;Anchor link for: code&quot;&gt;🔗&lt;&#x2F;a&gt;
Code&lt;&#x2F;h2&gt;
&lt;p&gt;The merged commits can be found here:&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=0d89fe3fd7d27d7c3f349bb46a915dbae65c02f8&quot;&gt;upnp: add renderer discoverer&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=ec61edc0d0292ab37bb1dbafb23a8aed49e966bb&quot;&gt;chromecast: refactor out encoder option functions&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=7da4464ca093604f2a507e3b39330fed17838e62&quot;&gt;dlna: add a DLNA stream out&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=0a34ce334a7c8b2d3926148be30f5b69fd253e41&quot;&gt;dlna: add GetProtocolInfo action&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=b671d3b3270790fd11aa3bc76cfe42f75ca25c52&quot;&gt;dlna: add PrepareForConnection action&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h2 id=&quot;release&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#release&quot; aria-label=&quot;Anchor link for: release&quot;&gt;🔗&lt;&#x2F;a&gt;
Release&lt;&#x2F;h2&gt;
&lt;p&gt;You can start casting to DLNA compliant devices using the next VLC 4.0 release
or the latest nightly&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#fn-warn&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;
releases for Windows, MacOS and Linux.&lt;&#x2F;p&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;fn-warn&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;&#x2F;sup&gt;
&lt;p&gt;Warning: with any nightly release there may still be bugs that are not yet fixed.&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
</content>

        
          <category term="upnp, dlna, upnp&#x2F;dlna, dlna&#x2F;upnp, vlc, casting, stream, media, media renderer, renderer, dlna renderer" />
        

        
          <summary type="html">DLNA renderers, mainly TV’s are DLNA certified devices that are able to play
any media from the local network and is built upon the UPnP A&#x2F;V Architecture technology.
This allows you to cast any video or audio from any other device to your connected TV.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>DLNA&#x2F;UPNP casting support in VLC - Part 1</title>
        <link href="https://shaleenjain.com/blog/vlc-dlna-support-1/" type="text/html"/>
        <pubDate>2018-08-31T00:00:00+00:00</pubDate>
        <published>2018-08-31T00:00:00+00:00</published>
        <updated>2018-08-31T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/vlc-dlna-support-1/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/vlc-dlna-support-1/">&lt;p&gt;The latest project that I have been working on lately is adding support for
casting to DLNA&#x2F;UPNP renderers in VLC.&lt;&#x2F;p&gt;
&lt;p&gt;DLNA renderers, mainly TV’s are DLNA certified devices that are able to play
any media from the local network and is built upon the UPnP A&#x2F;V Architecture technology.
This allows you to cast any video or audio from any other device to your connected TV.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;This is similar to chromecast but was designed a lot earlier and unlike chromecast it is
a completely open protocol.&lt;&#x2F;p&gt;
&lt;p&gt;A lot of consumer electronics and television sets in the market are already
DLNA certified even though they may not be marketed as a Smart TV.
You can search for existing DLNA certified products &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;spirespark.com&#x2F;dlna&#x2F;products&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;the-approach&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-approach&quot; aria-label=&quot;Anchor link for: the-approach&quot;&gt;🔗&lt;&#x2F;a&gt;
The Approach&lt;&#x2F;h3&gt;
&lt;p&gt;VLC already has support for &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;pupnp.sourceforge.net&#x2F;&quot;&gt;libupnp&lt;&#x2F;a&gt; and playing content from a DLNA&#x2F;UPnP Media Server
through it&#x27;s &lt;code&gt;services_discovery&lt;&#x2F;code&gt; interface. Through the addition of the
&lt;code&gt;renderer_discovery&lt;&#x2F;code&gt; interface it was now also possible to add support for
discovering and casting media to a DLNA&#x2F;UPnP Media Renderer.&lt;&#x2F;p&gt;
&lt;p&gt;Of course possibility and reality as often quite distant.
The upnp module in VLC was quite bloated and had already around 2K lines of code in a single file.
It was impossible to add any more features without some cleaning and refactoring
to make sure the code was maintainable and readable
and any addition did not break existing functionality.&lt;&#x2F;p&gt;
&lt;p&gt;The &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;pupnp.sourceforge.net&#x2F;&quot;&gt;libupnp&lt;&#x2F;a&gt; library provides some nice functions and abstractions over the UPnP
spec but is also highly opinionated which is not necessarily a bad thing.&lt;&#x2F;p&gt;
&lt;p&gt;One of the quirks of &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;pupnp.sourceforge.net&#x2F;&quot;&gt;libupnp&lt;&#x2F;a&gt; since it creates its own server and listens on a port
for all UPnP operations as well as has internal thread management is we cannot initialize
the instance multiple times and hence need to keep track of the SDK state.&lt;&#x2F;p&gt;
&lt;p&gt;One solution that VLC already employed was to have a wrapper class around the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;pupnp.sourceforge.net&#x2F;&quot;&gt;libupnp&lt;&#x2F;a&gt;
SDK and the &lt;code&gt;UpnpClient_Handle&lt;&#x2F;code&gt; that also was a singleton. But it was tightly coupled
with the existing module and had module specific members persist along with the singleton.&lt;&#x2F;p&gt;
&lt;p&gt;I therefore proceeded to refactor out the wrapper class as a standalone singleton
and added methods for anyone interested to listen to callbacks received from the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;pupnp.sourceforge.net&#x2F;&quot;&gt;libupnp&lt;&#x2F;a&gt;
SDK. The patches were merged in the mainline VLC tree and call be found here:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=66839225ff9cea419bd9d578278d35eb3c4db800&quot;&gt;upnp: add and use a callback listener interface&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=da4e3c45c04c7cedc692a5fa09af9c511e000365&quot;&gt;upnp: move UpnpInstanceWrapper to upnp-wrapper&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;This made the code drastically simpler and understandable as well as providing unlimited
scalability towards libupnp. I could now easily write more modules that depend on libupnp
and reside as their own modules in independent and isolated files.&lt;&#x2F;p&gt;
</content>

        
          <category term="upnp, dlna, upnp&#x2F;dlna, dlna&#x2F;upnp, vlc, casting, stream, media, media renderer, renderer, dlna renderer" />
        

        
          <summary type="html">The latest project that I have been working on lately is adding support for
casting to DLNA&#x2F;UPNP renderers in VLC.
DLNA renderers, mainly TV’s are DLNA certified devices that are able to play
any media from the local network and is built upon the UPnP A&#x2F;V Architecture technology.
This allows you to cast any video or audio from any other device to your connected TV.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Protecting Your Privacy in a Post-Aadhar India</title>
        <link href="https://shaleenjain.com/blog/protecting-your-privacy-aadhar/" type="text/html"/>
        <pubDate>2018-08-19T00:00:00+00:00</pubDate>
        <published>2018-08-19T00:00:00+00:00</published>
        <updated>2018-08-19T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/protecting-your-privacy-aadhar/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/protecting-your-privacy-aadhar/">&lt;p&gt;With more and more online and offline services demanding Indian citizens to provide
their Aadhar number for availing their services without any legal basis and
necessity under the pretense of proving your identity, it does raise more than
a few privacy concerns.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;The unique Aadhar number that is assigned to a person and is printed on the Aadhar Card
is a 12 digit number where the first 11 digits are random and the last number is
a checksum based on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Verhoeff_algorithm&quot;&gt;Verhoeff&lt;&#x2F;a&gt;&#x27;s algorithm (&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.quora.com&#x2F;What-is-the-structure-of-ones-Aadhar-Card-UID-number&quot;&gt;source&lt;&#x2F;a&gt;) that can be used to verify the
validity of the complete number.&lt;&#x2F;p&gt;
&lt;p&gt;So to get a valid Aadhar number all you need is 11 random digits and their
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Verhoeff_algorithm&quot;&gt;Verhoeff&lt;&#x2F;a&gt; checksum as the 12th digit.&lt;&#x2F;p&gt;
&lt;p&gt;One example number that passes the above scheme and hence is valid is
&lt;code&gt;999999990019&lt;&#x2F;code&gt;. This is a test number recommend by UIDAI but many more
numbers can be generated using the same scheme.&lt;&#x2F;p&gt;
&lt;p&gt;So if a system just checks the validity of a Aadhar number using the above scheme
you can safely enter &lt;code&gt;999999990019&lt;&#x2F;code&gt; and continue using their services while protecting
you privacy. That&#x27;s what I did for using Amazon Pay :)&lt;&#x2F;p&gt;
&lt;h3 id=&quot;virtual-number&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#virtual-number&quot; aria-label=&quot;Anchor link for: virtual-number&quot;&gt;🔗&lt;&#x2F;a&gt;
Virtual Number&lt;&#x2F;h3&gt;
&lt;p&gt;If you still feel like you have to use a legitimate number but want to minimise infringement
of your right to privacy, consider giving out a &quot;Virtual Number&quot; that is temporary
number that points to your actual Aadhar number without actually revealing your
real Aadhar number. You can use the Virtual Number&#x2F;ID (VID) generator at the
offical UIDAI &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;resident.uidai.gov.in&#x2F;web&#x2F;resident&#x2F;vidgeneration&quot;&gt;website&lt;&#x2F;a&gt; or the android &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;play.google.com&#x2F;store&#x2F;apps&#x2F;details?id=in.gov.uidai.mAadhaarPlus&quot;&gt;mobile app&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Also next time someone asks for a photocopy of your Aadhar card, tell them to f*ck off.&lt;&#x2F;p&gt;
</content>

        
          <category term="aadhar, india, privacy, bharat, dummy, number, test, test number, fake number, fake, generate, aadhar number, uidai, aadhar card, card, protection, circumvent, virtual, virtual number, protect, private, generator, VID, virtual id, id" />
        

        
          <summary type="html">With more and more online and offline services demanding Indian citizens to provide
their Aadhar number for availing their services without any legal basis and
necessity under the pretense of proving your identity, it does raise more than
a few privacy concerns.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Continuous Marketing - Exploiting Insecure REST API&#x27;s</title>
        <link href="https://shaleenjain.com/blog/continuous-marketing/" type="text/html"/>
        <pubDate>2018-07-08T00:00:00+00:00</pubDate>
        <published>2018-07-08T00:00:00+00:00</published>
        <updated>2018-07-08T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/continuous-marketing/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/continuous-marketing/">&lt;p&gt;After I finished refactoring my android app to use a 3rd-party public API for the
user data,
I needed a way to quickly promote my application to users.&lt;&#x2F;p&gt;
&lt;p&gt;The API I used is inherently insecure with virtually no standard REST API security
in place and designed with a top-down approach to suit their own mobile app.
Their whole premise being to secure the mobile app with 2FA and having an API
that&#x27;s quite literally a bunch of wrapper functions around database queries
exposed as endpoints.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;All their CRUD operations are implemented as GET methods (so much for being idempotent)
and their idea of security is just using a users mobile number to get their
unique user ID that they call &quot;encrypturl&quot;. 2FA is just two separate endpoints
added to send and confirm the OTP send to the user&#x27;s mobile, which again just
advance the mobile flow and are completely orthogonal to the API design.&lt;&#x2F;p&gt;
&lt;p&gt;So I exploited their API yet again to get the email ids of every user they have
in their system by trying every 10 digit combination with the 10th digit always
being either 7, 8 or 9 (majority of Indian mobile phone numbers) until I
get a hit and receive the users unique id required to access the rest of the API
endpoints.&lt;&#x2F;p&gt;
&lt;p&gt;Using the user-id I get their email-ID from my own API that I built around their
API to have better object models.
Once I have the email-id I proceed to send them an email promoting my application
designed using the Campaign and Template design editor of &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;sendgrid.com&quot;&gt;Sendgrid&lt;&#x2F;a&gt; with
their awesome developer API and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;sendgrid&#x2F;sendgrid-python&quot;&gt;python&lt;&#x2F;a&gt; library that made programmatically sending
emails a lot more easier.&lt;&#x2F;p&gt;
&lt;p&gt;So with the brute force method I found a new email-id every 5~6 seconds that
translates into a new promotional email sent with every new email discovered.
And my &quot;Continuous Marketing&quot; is still running with over 15000 emails sent already.&lt;&#x2F;p&gt;
&lt;p&gt;If you as well every find and are willing to exploit an insecure API for at least
marketing gains perhaps this python script will make that a lot more easy for you.&lt;&#x2F;p&gt;
&lt;div &gt;
    &lt;script src=&quot;https:&amp;#x2F;&amp;#x2F;gist.github.com&amp;#x2F;shalzz&amp;#x2F;ff60ae09162112db067b9463c76469e0.js&quot;&gt;&lt;&#x2F;script&gt;
&lt;&#x2F;div&gt;
</content>

        
          <category term="api, marketing, rest api, python, sendgrid, sendgrid API, sendgrid python, programmatic, continuous, continuous marketing, exploit, insecure api, email, email promotion, marketing campaign, email campaign, automation, marketing automation" />
        

        
          <summary type="html">After I finished refactoring my android app to use a 3rd-party public API for the
user data,
I needed a way to quickly promote my application to users.
The API I used is inherently insecure with virtually no standard REST API security
in place and designed with a top-down approach to suit their own mobile app.
Their whole premise being to secure the mobile app with 2FA and having an API
that&#x27;s quite literally a bunch of wrapper functions around database queries
exposed as endpoints.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>My First Mechanical Keyboard - A Review of TADA68</title>
        <link href="https://shaleenjain.com/blog/first-mech-keyboard/" type="text/html"/>
        <pubDate>2018-06-03T00:00:00+00:00</pubDate>
        <published>2018-06-03T00:00:00+00:00</published>
        <updated>2018-06-03T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/first-mech-keyboard/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/first-mech-keyboard/">&lt;figure&gt;



&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;tada68-alu-top.e4e87e33e04ecbdf.jpg&quot;  &#x2F;&gt;

&lt;figcaption&gt; TADA68 with the aluminium case&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;h2 id=&quot;why-tada68&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#why-tada68&quot; aria-label=&quot;Anchor link for: why-tada68&quot;&gt;🔗&lt;&#x2F;a&gt;
Why TADA68?&lt;&#x2F;h2&gt;
&lt;p&gt;After first coming across the Keywalker IFD68 on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.massdrop.com&#x2F;buy&#x2F;keywalker-68-bluetooth-mechanical-keyboard#description?referer=8MUP7X&quot;&gt;Massdrop&lt;&#x2F;a&gt; for just $99
I almost bought it. But after trying to find some reviews online I also
found the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.cn&#x2F;products&#x2F;tada68-mechanical-keyboard-gateron-swtich-65-layout-dye-sub-keycaps-cherry-profils?spr_ref=5b12bce&quot;&gt;TADA68&#x2F;SABER68&lt;&#x2F;a&gt; designed by originatives, which is a very similar keyboard
with the exact same 68 key layout and even the type and color of keycaps.&lt;&#x2F;p&gt;
&lt;p&gt;But the few differences that tipped the favor towards me buying the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.cn&#x2F;products&#x2F;tada68-mechanical-keyboard-gateron-swtich-65-layout-dye-sub-keycaps-cherry-profils?spr_ref=5b12bce&quot;&gt;TADA68&lt;&#x2F;a&gt;
were; first the Keywalker being a Bluetooth keyboard with an included battery
the shipping increased to be just too expensive, second the Keywalker uses a proprietary
firmware with a flashing tool to program the keyboard only available for windows
platform.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;With the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.cn&#x2F;products&#x2F;tada68-mechanical-keyboard-gateron-swtich-65-layout-dye-sub-keycaps-cherry-profils?spr_ref=5b12bce&quot;&gt;TADA68&lt;&#x2F;a&gt; even though not having Bluetooth might seem a con it saves me
from the few quirks that Bluetooth generally has. Mainly depleting my laptop
battery faster than normal due to having the Bluetooth being on all the time and
possible input latency inherent in a shared medium communication channel.
Besides I told myself if I ever really wanted Bluetooth in the future I could
always just hack together a adafruit feather 32u4 &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.adafruit.com&#x2F;product&#x2F;2829&quot;&gt;bluefruit&lt;&#x2F;a&gt; which already has existing
support in &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;qmk&#x2F;qmk_firmware&quot;&gt;QMK&lt;&#x2F;a&gt; firmware.&lt;&#x2F;p&gt;
&lt;p&gt;Which leads me to definitely the most important factor
in my decision, the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.cn&#x2F;products&#x2F;tada68-mechanical-keyboard-gateron-swtich-65-layout-dye-sub-keycaps-cherry-profils?spr_ref=5b12bce&quot;&gt;TADA68&lt;&#x2F;a&gt; runs the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;qmk&#x2F;qmk_firmware&quot;&gt;QMK&lt;&#x2F;a&gt; firmware which is an Open Source firmware
(forked from TMK) for keyboards with a myriad of additional features and
has a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;ravicious&#x2F;TADA68&quot;&gt;flashing process&lt;&#x2F;a&gt; that is as simple as it gets with support for all major
platforms.
Also definitely a bonus, the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.cn&#x2F;products&#x2F;tada68-mechanical-keyboard-gateron-swtich-65-layout-dye-sub-keycaps-cherry-profils?spr_ref=5b12bce&quot;&gt;TADA68&lt;&#x2F;a&gt; already has a wide variety of aluminium
and wooden cases available in the market unlike the Keywalker IFD68.&lt;&#x2F;p&gt;
&lt;p&gt;Another major factor was the shipping time. With Massdrop the &lt;em&gt;expected&lt;&#x2F;em&gt; shipping
was after three months! For the TADA68 I found a well reputed vendor,
mentioned by various people on the mechanical keyboards subreddit, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.myshopify.com?spr_ref=5b12bce&quot;&gt;kbdfans.cn&lt;&#x2F;a&gt;
(also sells on aliexpress) who already had the keyboard in stock.&lt;&#x2F;p&gt;
&lt;p&gt;With all these factors it was a no-brainer to buy the TADA68 and so I did!&lt;&#x2F;p&gt;
&lt;figure&gt;
&lt;div class=&quot;image-row&quot;&gt;
    


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;tada68-box.87778fbc216071e5.jpg&quot; class=&quot;image-column&quot; &#x2F;&gt;

    


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;tada68-plastic-top.e79afd52fb5c6a3d.jpg&quot; class=&quot;image-column&quot; &#x2F;&gt;

&lt;&#x2F;div&gt;
&lt;figcaption&gt;TADA68 in its original box and on the right with its stock plastic case&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;h2 id=&quot;the-keyboard-and-the-switches&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-keyboard-and-the-switches&quot; aria-label=&quot;Anchor link for: the-keyboard-and-the-switches&quot;&gt;🔗&lt;&#x2F;a&gt;
The Keyboard and The Switches&lt;&#x2F;h2&gt;
&lt;p&gt;I bought the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.cn&#x2F;products&#x2F;tada68-mechanical-keyboard-gateron-swtich-65-layout-dye-sub-keycaps-cherry-profils?spr_ref=5b12bce&quot;&gt;TADA68&lt;&#x2F;a&gt; keyboard with Gateron brown switches. I had originally planned
to buy a keyboard with Cherry MX brown switches having tested and liked the switch
on a 9 switch tester board with 9 different Cherry MX switches that I had bought
earlier from aliexpress. But kbdfans did not have the board with Cherry switches,
only Gateron switches which are Cherry MX clones by a Chinese company, which I had
never tried before.&lt;&#x2F;p&gt;
&lt;figure&gt;
    


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;tada68-switch.3fddd61d56ebc0c0.jpg&quot;  &#x2F;&gt;

&lt;figcaption&gt;Gateron Brown switches with white leds.&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;Cherry and Gateron switches variants are mainly similar with both companies Blue,
Red, Brown switches having the same travel distance, actuation force, being linear
or tactile and so on. The things that are on spec are same but of course there are
subtle difference between the switches of the two companies due to manufacturing
differences and other advancement and changes they both have made over the years.&lt;&#x2F;p&gt;
&lt;p&gt;Having searched online for comparisons between the Cherry and Gateron Brown
switches mostly were positive reviews for the Gateron Brown with many saying it
does not have the scratchy feeling&#x2F;sound that you get with the Cherry switches
and also it has a somewhat pronounced tactile feedback. So I took a risk in
good faith.
And indeed I feel the same about the Gateron Brown&#x27;s not having that scratchy
sound that I hear with the Cherry Brown switches, kind of a plastic scratching with plastic
sound on every key press. But the tactile feedback did feel quite same to me on both.&lt;&#x2F;p&gt;
&lt;p&gt;The Gateron Brown&#x27;s 45g actuation force does feel a little light when coming from
my laptop&#x27;s membrane switches with what feels like 100g of force,
but they feel good and relaxed after getting some used to. I can also see why
MX Clears with 65g of actuation force with the same tactile feedback as Browns would also
appeal to some people as it is a nice balance between being easy to press
and not having spurious key presses while just resting you fingers (Something
I haven&#x27;t experience with Browns till now).&lt;&#x2F;p&gt;
&lt;p&gt;Along with the keyboard I also bought the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.cn&#x2F;products&#x2F;kbdfans-tada68-aluminum-case?variant=2403415687181&amp;amp;spr_ref=5b12bce&quot;&gt;low-profile silver aluminium case&lt;&#x2F;a&gt;
sold by kbdfans, least it got sold out later. And I am definitely glad I did.
An aluminium case gives any keyboard the rigidity and durability that instantly makes
it a premium product. I particularly like a low-profile case than a high-profile one
giving others a glimpse of the excellent technology and engineering that goes into the switches
and the keyboard as a whole, adding to the mechanical keyboard aura.&lt;&#x2F;p&gt;
&lt;p&gt;


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;tada68-alu-profile.4f9cadb399b125d9.jpg&quot;  &#x2F;&gt;




&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;tada68-alu-profile-angled.4883242e266c4134.jpg&quot;  &#x2F;&gt;
&lt;&#x2F;p&gt;
&lt;p&gt;Switching out the plastic case with the aluminium one I found out that two screws
were &quot;missing&quot; in the sense that they were not screwed into the cases but stuck between
the PCB and the steel plate. Which can definitely happen while screwing if you
do not have a magnetic screw driver. The fact that the aluminium case came with
aluminium screws is certainly not very help since aluminium is a nonferrous metal
and is not attracted to magnets. So I had to fish out the screws stuck between
the plates since they were indeed made of a ferrous metal and used them to replace
the case.&lt;&#x2F;p&gt;
&lt;figure&gt;
    


&lt;img src=&quot;&amp;#x2F;processed_images&amp;#x2F;tada68-alucase-bottomfeet.bbd65dfeb39d8c96.jpg&quot;  &#x2F;&gt;

&lt;figcaption&gt;The bottom of the aluminium case with the anodised feet.&lt;&#x2F;figcaption&gt;
&lt;&#x2F;figure&gt;
&lt;br&#x2F;&gt;
&lt;p&gt;Buying a mechanical keyboard right now is just perfect as I have just finished
setting up &lt;a href=&quot;https:&#x2F;&#x2F;shaleenjain.com&#x2F;blog&#x2F;vim-and-tmux&#x2F;&quot;&gt;vim and tmux&lt;&#x2F;a&gt;, requiring extensive use of a
keyboard.&lt;&#x2F;p&gt;
&lt;p&gt;So far it has been only a day and I am really enjoying my new keyboard and
definitely have had an increase in my productivity, supported
by the fact how long this blog post has already become which I am of course
writing using my new keyboard.&lt;&#x2F;p&gt;
&lt;h2 id=&quot;the-kbdfans-store&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-kbdfans-store&quot; aria-label=&quot;Anchor link for: the-kbdfans-store&quot;&gt;🔗&lt;&#x2F;a&gt;
The KBDfans store&lt;&#x2F;h2&gt;
&lt;p&gt;I have to mention how awesome my experience has been ordering from &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;kbdfans.myshopify.com?spr_ref=5b12bce&quot;&gt;kbdfans.cn&lt;&#x2F;a&gt;.
Even though it is a Chinese company the website is very well made
and has I think only an English version which is very well written. There
are a few details that you may find missing in the product descriptions but they are
generally very active on their FB messenger chat and answer any questions that you may
have.&lt;&#x2F;p&gt;
&lt;p&gt;But perhaps the most amazing thing about them was that after I told them
I am an international customer they happily offered to under declare the product
value for custom duty. Which is something I wasn&#x27;t even aware
the sellers could do! After briefly going through the custom duty laws of my
country and coming across the clause &quot;... satisfaction of the Customs authorities with the truth and
accuracy of the Declared Value.&quot; (&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;www.customsandforeigntrade.com&#x2F;Customs%20Valuation.pdf&quot;&gt;Rule 4.1 of the Customs Valuation&lt;&#x2F;a&gt;) I thought
lets try not be too suspicious and told them to declare a value of around $49.9.
But they anyways declared the value as low as they usually do, I guess, to that of
$15! And guess what? It got through!&lt;&#x2F;p&gt;
&lt;p&gt;So I had to pay ~50% duty (which is the general duty rate on anything for
&quot;personal use&quot;) on $15 and an unsurprisingly surprise ₹500 &quot;Disbursement fee&quot;
by DHL which I didn&#x27;t see (or notice?) the last time I had imported something
and was completely ignorant about imports and custom duty.&lt;&#x2F;p&gt;
&lt;p&gt;Anyhow in the end the total amount I had to pay for &quot;duty&quot; was 10% of the actual
amount I paid which is definitely great considering how expensive mechanical keyboards
are and how there are really no other alternatives (atleast in India) that would
benefit from trade restrictions. Which leads to my next sections and a general
rant about the socio-economic state of my country. (You have been warned!)&lt;&#x2F;p&gt;
&lt;h2 id=&quot;manufacturing-in-india&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#manufacturing-in-india&quot; aria-label=&quot;Anchor link for: manufacturing-in-india&quot;&gt;🔗&lt;&#x2F;a&gt;
Manufacturing in India&lt;&#x2F;h2&gt;
&lt;p&gt;There are no Cherry MX clones being designed and made in India even after the
original Cherry MX &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;patents.google.com&#x2F;patent&#x2F;US4467160&quot;&gt;patent&lt;&#x2F;a&gt; has been expired for years.&lt;&#x2F;p&gt;
&lt;p&gt;There is an Indian manufacture of the original Cherry MX switches which is a
Joint Venture between Cherry (ZF Electronics Corporation) and TVS Group, India
called &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;zftvs.co.in&#x2F;ZFTVS1&#x2F;default.php&quot;&gt;ZF Electronics TVS (India)&lt;&#x2F;a&gt;. Taking a look at their website, it
already &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;zftvs.co.in&#x2F;category&#x2F;uncategorized&#x2F;&quot;&gt;hacked&lt;&#x2F;a&gt; by someone 6 months ago and not yet fixed. There also seems
to be a user flow where you can apparently add the &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;zftvs.co.in&#x2F;product&#x2F;xs-trackball-keyboard-g84-5400&#x2F;&quot;&gt;items&lt;&#x2F;a&gt; to a cart and &quot;checkout&quot;,
which is a completely bogus flow since their is no price information.
So of course don&#x27;t do that unless you want to be spammed and possible be harassed
at your home address.&lt;&#x2F;p&gt;
&lt;p&gt;Assuming the company is still operational with perhaps a lacking IT department, they
are mainly a manufacturing company so it would make sense they only sell in wholesale
and bulk. Their alternate legitimate looking product page for &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;zftvs.co.in&#x2F;ZFTVS1&#x2F;MX.php&quot;&gt;MX switches&lt;&#x2F;a&gt;
has an option to run a product query and they also seem to be active on
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.indiamart.com&#x2F;proddetail&#x2F;key-switch-mx-series-8369799588.html&quot;&gt;IndiaMart&lt;&#x2F;a&gt;. So it should be possible for a consumer&#x2F;e-commerce company
to procure the switches in bulk and offer them to consumers.&lt;&#x2F;p&gt;
&lt;p&gt;Unless of course they keep telling themselves that there is not enough demand
in India for &quot;things like these&quot;.&lt;&#x2F;p&gt;
&lt;p&gt;The only e-commerce site I could find that sells Cherry MX switches is
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.thingbits.net&#x2F;products&#x2F;cherry-mx-switch&quot;&gt;thingbits.net&lt;&#x2F;a&gt; since all their product pages have titles &quot;... in India&quot;
If you look at their price you&#x27;ll see it is way to expensive since they import
all their products and sell it at double the price including the custom duty.&lt;&#x2F;p&gt;
&lt;p&gt;Buying just 68 switches can cost you ₹6,338.96 or $93, at this price just
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.aliexpress.com&#x2F;item&#x2F;Original-Cherry-mx-switch-3-pin-mechanical-keyboard-brown-blue-red-white-clear-silver-slilent-black&#x2F;32839844484.html?spm=2114.search0104.3.3.53614dcejrotv0&amp;amp;ws_ab_test=searchweb0_0,searchweb201602_2_10152_10151_10065_10344_10068_10342_10343_10059_10340_10341_308_10696_100031_10084_10083_10103_10618_10624_10307_10623_10622_10621_10620,searchweb201603_25,ppcSwitch_5&amp;amp;algo_expid=9cf6af5d-4175-436a-8131-544b32d0aa64-0&amp;amp;algo_pvid=9cf6af5d-4175-436a-8131-544b32d0aa64&amp;amp;priceBeautifyAB=0&quot;&gt;buying&lt;&#x2F;a&gt; and importing with the ~50% import duty on 68 switches you can
save more than 1&#x2F;4th of the thingsbit price. Their business model of product
delivery in 3-4 days instead of the 18-28 days (usually faster for the Indian
subcontinent) with free shipping on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;aliexpress.com&quot;&gt;aliexpress&lt;&#x2F;a&gt;,
with 25% premium doesn&#x27;t make a lot of sense.
Especially since aliexpress has the buyer protection and return&#x2F;refund policies like
any other major e-commerce site.&lt;&#x2F;p&gt;
&lt;p&gt;I have sent them an email urging to source locally and pointed to the suppliers
so that they can get them cheap and pass on the benefit to their customers.
But I haven&#x27;t heard anything from them yet.&lt;&#x2F;p&gt;
&lt;p&gt;With the government placing restrictions on trade in order to support
local manufacturers and now the &quot;Make in India&quot; movement, their is still no focus
on the bigger picture of encouraging the development of intellectual property
used in consumer products creating the need for manufacturing.
For example Tata Hitachi and Tata Marcopolo are one of many of the existing Indian breed
industrial companies manufacturing locally but still have JV with Japanese and German
companied providing the patents, technology and products that are actually
manufactured.&lt;&#x2F;p&gt;
&lt;p&gt;For now all we can do is import until there is a boom of the manufacturing industry
in India and the people get over the illusion that skipping over the manufacturing
sector and directly into the service sector by a country as a whole is a good sign of
development.&lt;&#x2F;p&gt;
</content>

        
          <category term="mechanical, mechanical keyboard, cherry mx, gateron brown, tada68, india, in india, review, tada68 review, kbdfans review, kbdfans, cherry mx brown, manufacturing, manufacturing cherry mx in india, low-profile, aluminium case, low profile, aluminium, case, low, profile, keyboard, custom, duty, custom duty, import" />
        

        
          <summary type="html">





 TADA68 with the aluminium case

🔗
Why TADA68?
After first coming across the Keywalker IFD68 on Massdrop for just $99
I almost bought it. But after trying to find some reviews online I also
found the TADA68&#x2F;SABER68 designed by originatives, which is a very similar keyboard
with the exact same 68 key layout and even the type and color of keycaps.
But the few differences that tipped the favor towards me buying the TADA68
were; first the Keywalker being a Bluetooth keyboard with an included battery
the shipping increased to be just too expensive, second the Keywalker uses a proprietary
firmware with a flashing tool to program the keyboard only available for windows
platform.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>My Vim and Tmux Setup</title>
        <link href="https://shaleenjain.com/blog/vim-and-tmux/" type="text/html"/>
        <pubDate>2018-05-27T00:00:00+00:00</pubDate>
        <published>2018-05-27T00:00:00+00:00</published>
        <updated>2018-05-27T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/vim-and-tmux/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/vim-and-tmux/">&lt;p&gt;For the past couple of weeks I have been slowly setting up my &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;shalzz&#x2F;.vim&quot;&gt;Vim&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;shalzz&#x2F;dotfiles&quot;&gt;tmux&lt;&#x2F;a&gt;
config files to just the way I prefer, creating the perfect workflow for working on
C&#x2F;C++ and Rust projects that increases my productivity by not only &lt;em&gt;not&lt;&#x2F;em&gt; having to
constantly switch between the keyboard and the mouse&#x2F;touchpad for every little
task&#x2F;navigation but also to just touch type my way to glory :).
Especially since with C and Rust not having a single canonical IDE and inherently
requiring to interact with the terminal for compiling and debugging, Vim coupled
with a language server (I&#x27;m using cquery for C&#x2F;C++, RLS for Rust) &lt;em&gt;is&lt;&#x2F;em&gt; the
perfect IDE for these languages.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Some of the vim plugins that you definitely need for C++ but are hard to find are
&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;octol&#x2F;vim-cpp-enhanced-highlight&quot;&gt;vim-cpp-enhanced-highlight&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;majutsushi&#x2F;tagbar&quot;&gt;tagbar&lt;&#x2F;a&gt; with ofcourse a decent language server
like &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;cquery-project&#x2F;cquery&quot;&gt;cquery&lt;&#x2F;a&gt;. You can find my complete .vim config file &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;shalzz&#x2F;.vim&quot;&gt;here&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Vim and tmux work perfectly together and with the tmuxline.vim plugin even more
seamlessly.
One thing that does trip you up while setting up both vim&#x2F;nvim and tmux is
enabling true color support, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.cyfyifanchen.com&#x2F;neovim-true-color&#x2F;&quot;&gt;this&lt;&#x2F;a&gt; blog helped me sort that out rather quickly.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;img src=&quot;https:&#x2F;&#x2F;shaleenjain.com&#x2F;blog&#x2F;vim-and-tmux&#x2F;nvim-and-tmux.jpg&quot; alt=&quot;screenshot&quot; title=&quot;screenshot of my vim setup&quot; &#x2F;&gt;&lt;&#x2F;p&gt;
&lt;p&gt;That&#x27;s what my development environment looks like now.&lt;&#x2F;p&gt;
</content>

        
          <category term="vim, tmux, dotfiles, dotconfig, .vimrc, personal, vim config, plugins, cpp, rust, c&#x2F;cpp, c++&#x2F;c, c++ , c, .tmux.conf, nvim, neovim" />
        

        
          <summary type="html">For the past couple of weeks I have been slowly setting up my Vim and tmux
config files to just the way I prefer, creating the perfect workflow for working on
C&#x2F;C++ and Rust projects that increases my productivity by not only not having to
constantly switch between the keyboard and the mouse&#x2F;touchpad for every little
task&#x2F;navigation but also to just touch type my way to glory :).
Especially since with C and Rust not having a single canonical IDE and inherently
requiring to interact with the terminal for compiling and debugging, Vim coupled
with a language server (I&#x27;m using cquery for C&#x2F;C++, RLS for Rust) is the
perfect IDE for these languages.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Mobile and Desktop Wallets with gRPC</title>
        <link href="https://shaleenjain.com/blog/lnd-wallets/" type="text/html"/>
        <pubDate>2018-05-16T00:00:00+00:00</pubDate>
        <published>2018-05-16T00:00:00+00:00</published>
        <updated>2018-05-16T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/lnd-wallets/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/lnd-wallets/">&lt;p&gt;Does anyone else also feel that we need lightning [network] desktop and mobile app wallets that can connect to your remote lnd server with gRPC (using rpc username and password) instead of every app loading and syncing their own chain on device? Leading to multiple wallets and coin fragmentation among those wallets.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;I know the neutrino light client mode exists but hardly any app at this point lets us use this mode with our own server. Especially with mobile wallets like Eclair that use a json api wrapper over the rpc protocol that just connects to only their own server.&lt;&#x2F;p&gt;
&lt;p&gt;And when their [beta] android wallet does happen to work, I did not find any option to connect to my own server even if I am running the eclair server implementation of the lightning network.  If you are like me you might also be thinking this leads to some amount of centralization.&lt;&#x2F;p&gt;
&lt;p&gt;This is the same problem I felt with bitcoin and bitcoin-core where you had to have the full chain node to use a wallet, which lead to creation of cloud custodian wallets and client side encrypted cloud wallets.&lt;&#x2F;p&gt;
&lt;p&gt;With LND being the second layer over the bitcoin blockchain and needing to stay online as much as possible to be able to negotiate and terminate contracts if your channel peer is misbehaving or trying to steal you funds, it makes sense to have one heavily fortified full-node server running 24&#x2F;7 and have the convenience and ease of use of desktop and mobile wallets pointing to your full-node.&lt;&#x2F;p&gt;
&lt;p&gt;What do you think?&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Originally posted on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;yalls.org&#x2F;articles&#x2F;a1264e7f-401d-4c46-97a7-7b14e6b54193:926B20A0-5375-4E8A-BC75-D060BD930D7C&#x2F;e5d7864e-e316-4f4a-9db6-0b72410702c6&quot;&gt;yalls.org&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>

        
          <category term="bitcoin, lnd, lightning network, lightning, network, wallets, gRPC, wallet, bitcoin wallet, lightning wallet" />
        

        
          <summary type="html">Does anyone else also feel that we need lightning [network] desktop and mobile app wallets that can connect to your remote lnd server with gRPC (using rpc username and password) instead of every app loading and syncing their own chain on device? Leading to multiple wallets and coin fragmentation among those wallets.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Prefetching Data with Next.js and Apollo</title>
        <link href="https://shaleenjain.com/blog/nextjs-apollo-prefetch/" type="text/html"/>
        <pubDate>2018-01-08T00:00:00+00:00</pubDate>
        <published>2018-01-08T00:00:00+00:00</published>
        <updated>2018-01-08T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/nextjs-apollo-prefetch/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/nextjs-apollo-prefetch/">&lt;blockquote&gt;
&lt;p&gt;Update: My pull requests implementing the techniques discussed here were merged into the zeit&#x2F;next.js &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&#x2F;tree&#x2F;canary&#x2F;examples&#x2F;with-data-prefetch&quot;&gt;with-data-prefetch&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&#x2F;tree&#x2F;canary&#x2F;examples&#x2F;with-apollo&quot;&gt;with-apollo&lt;&#x2F;a&gt; examples. You can easily combine the various examples (including the above two) to achieve your desired functionality.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;For most modern web apps, network speed and latency is still the biggest constraint for high performance and great UX. Universally rendered Isomorphic applications do a great job to solve that to some extent without sacrificing interactivity by processing the complete DOM of the first request on the server and subsequent requests on the client. But there is a lot more we can do.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Modern web apps already have their core application logic on the client by the time the first request completes. From there on anticipating the user action and selectively prefetching the data can lead to great performance and UX improvements.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.apollographql.com&#x2F;client&#x2F;&quot;&gt;Apollo&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&quot;&gt;Next&lt;&#x2F;a&gt; is the stack of our choice, having the necessary capabilities, to demonstrate our concept.&lt;&#x2F;p&gt;
&lt;p&gt;Adam Soffer&#x27;s &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;dev-blog.apollodata.com&#x2F;whats-next-js-for-apollo-e4dfe835d070&quot;&gt;introduction&lt;&#x2F;a&gt; summarizes &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;www.apollographql.com&#x2F;client&#x2F;&quot;&gt;Apollo&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&quot;&gt;Next&lt;&#x2F;a&gt; with their concerns perfectly:&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Apollo is a GraphQL client that’s concerned exclusively with the data layer of our application; it cares about efficiently fetching our data. Next, on the other hand, is a minimalistic framework for server-rendered React applications that’s concerned exclusively with the UI layer of our application; it cares about efficiently rendering our UI.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h2 id=&quot;tying-together-next-js-and-apollo&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#tying-together-next-js-and-apollo&quot; aria-label=&quot;Anchor link for: tying-together-next-js-and-apollo&quot;&gt;🔗&lt;&#x2F;a&gt;
Tying together Next.js and Apollo&lt;&#x2F;h2&gt;
&lt;p&gt;Next has a unique way of loading data, every page has a lifecycle hook function &lt;code&gt;getInitialProps&lt;&#x2F;code&gt; which is called while loading on the client as well as the server. This is a very nice separation of our data logic from the UI logic and is what enables us to use the full power of Apollo and Next as both of these frameworks make no assumptions about each others layer and provides the perfect abstraction to connects these two layers.&lt;&#x2F;p&gt;
&lt;p&gt;Apollo client&#x27;s react library &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;apollographql&#x2F;react-apollo&quot;&gt;react-apollo&lt;&#x2F;a&gt; provides a helper function &lt;code&gt;getDataFromTree&lt;&#x2F;code&gt; which recursively traverses the supplied React component and executes every &lt;code&gt;graphql()&lt;&#x2F;code&gt; query it finds, storing the result in its local cache (configured by us).&lt;&#x2F;p&gt;
&lt;p&gt;The excellent &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js&#x2F;tree&#x2F;canary&#x2F;examples&#x2F;with-apollo&quot;&gt;example&lt;&#x2F;a&gt; from the Next.js repo shows how we can combine these two functionalities by creating a HOC which wraps &lt;code&gt;getDataFromTree&lt;&#x2F;code&gt; within &lt;code&gt;getInitialProps&lt;&#x2F;code&gt; and returning the cached data as a plain Javascript Object&lt;&#x2F;p&gt;
&lt;p&gt;Here we make sure to use &lt;code&gt;getDataFromTree&lt;&#x2F;code&gt; on both the client and for SSR, altering the example like so:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; React&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;react&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; PropTypes&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;prop-types&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; ApolloProvider&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; getDataFromTree&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;react-apollo&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; Head&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;next&#x2F;head&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; initApollo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;.&#x2F;initApollo&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;export default&lt;&#x2F;span&gt;&lt;span&gt; ComposedComponent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;  return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; class&lt;&#x2F;span&gt;&lt;span style=&quot;color: #CB4B16;&quot;&gt; WithData&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; extends&lt;&#x2F;span&gt;&lt;span style=&quot;color: #CB4B16;&quot;&gt; React&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #6C71C4;&quot;&gt;Component&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    static&lt;&#x2F;span&gt;&lt;span&gt; displayName&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; `WithData(${&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getComponentDisplayName&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;      ComposedComponent&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    )&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;})`&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    static&lt;&#x2F;span&gt;&lt;span&gt; propTypes&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      serverState:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; PropTypes&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;object&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;isRequired&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    static async&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; getInitialProps&lt;&#x2F;span&gt;&lt;span&gt;(ctx) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;      &#x2F;&#x2F; Initial serverState with apollo (empty)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;      let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; serverState&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;      &#x2F;&#x2F; Evaluate the composed component&amp;#39;s getInitialProps()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;      let&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; composedInitialProps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;ComposedComponent&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getInitialProps&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;        composedInitialProps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; = await&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; ComposedComponent&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getInitialProps&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;ctx&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;      &#x2F;&#x2F; Run all GraphQL queries in the component tree&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;      &#x2F;&#x2F; and extract the resulting data&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;      const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; apollo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; initApollo&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      try&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;        &#x2F;&#x2F; Run all GraphQL queries&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;        await&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; getDataFromTree&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt;          &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;ComposedComponent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt; ctx&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;ctx&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;} {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;...&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;composedInitialProps&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt; &#x2F;&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;          {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            router: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;              asPath:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; ctx&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;asPath&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;              pathname:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; ctx&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;pathname&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;              query:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; ctx&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;query&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            },&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;            client:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; apollo&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;          }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; catch&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;error&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;        &#x2F;&#x2F; Prevent Apollo Client GraphQL errors from crashing SSR.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;        &#x2F;&#x2F; Handle them in components via the data.error prop:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;        &#x2F;&#x2F; https:&#x2F;&#x2F;www.apollographql.com&#x2F;docs&#x2F;react&#x2F;basics&#x2F;queries.html#graphql-query-data-error&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;!&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;process&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;browser&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;        &#x2F;&#x2F; getDataFromTree does not call componentWillUnmount&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;        &#x2F;&#x2F; head side effect therefore need to be cleared manually&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;        Head&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;rewind&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;      &#x2F;&#x2F; Extract query data from the Apollo store&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;      serverState&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        apollo: {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;          data:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; apollo&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;cache&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;extract&lt;&#x2F;span&gt;&lt;span&gt;()&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      return&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;        serverState&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;        ...&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;composedInitialProps&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    constructor&lt;&#x2F;span&gt;&lt;span&gt;(props) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;      super&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;props&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;      this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;apollo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; initApollo&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;props&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;serverState&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;apollo&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;data&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    render&lt;&#x2F;span&gt;&lt;span&gt;() {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      return&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt;        &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;ApolloProvider&lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt; client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;{&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;apollo&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt;          &amp;lt;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;ComposedComponent&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;...&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;props&lt;&#x2F;span&gt;&lt;span style=&quot;color: #DC322F;&quot;&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt; &#x2F;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt;        &amp;lt;&#x2F;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;ApolloProvider&lt;&#x2F;span&gt;&lt;span style=&quot;color: #93A1A1;&quot;&gt;&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      )&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;&lt;h2 id=&quot;prefetching-data&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#prefetching-data&quot; aria-label=&quot;Anchor link for: prefetching-data&quot;&gt;🔗&lt;&#x2F;a&gt;
Prefetching Data&lt;&#x2F;h2&gt;
&lt;p&gt;Next has &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;zeit&#x2F;next.js#with-link-1&quot;&gt;in-built&lt;&#x2F;a&gt; support for prefetching pages by adding the &lt;code&gt;prefetch&lt;&#x2F;code&gt; prop to the &lt;code&gt;&amp;lt;Link&amp;gt;&lt;&#x2F;code&gt; component or imperatively calling &lt;code&gt;Router.prefetch(&#x27;&#x2F;dynamic&#x27;)}&lt;&#x2F;code&gt;. However this fetches the page&#x27;s JS code but not its data&#x2F;initial props.&lt;&#x2F;p&gt;
&lt;p&gt;This results in instant page loads but, some would argue even worse, a loading indicator shown for however long it takes to get the relevant page data from your API.&lt;&#x2F;p&gt;
&lt;p&gt;Since we know our stack we can optimise performance using that knowledge. We know that with every call to &lt;code&gt;getInitialProps&lt;&#x2F;code&gt; of a component wrapped in our &lt;code&gt;WithData&lt;&#x2F;code&gt; HOC, our queries are cached in the local ApolloClient store. With that all we have to do is get a reference to our top level page component and manually call its &lt;code&gt;getInitialProps&lt;&#x2F;code&gt; method!&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;javascript&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; Router&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;next&#x2F;router&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;import&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; format&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; resolve&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; parse&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; from&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;url&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;export default&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; prefetch&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; async&lt;&#x2F;span&gt;&lt;span&gt; (href)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; =&amp;gt;&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;  &#x2F;&#x2F; if  we&amp;#39;re running server side do nothing&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;  if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;typeof&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; window&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; ===&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;undefined&amp;#39;&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; return&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;  const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; url&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;    typeof&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; href&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; !==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;string&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      ?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; format&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;href&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      :&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; href&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;  const&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; pathname&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; window&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;location&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;  const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; parsedHref&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; resolve&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;pathname&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; url&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;  const&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; query&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;    typeof&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; href&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; !==&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;#39;string&amp;#39;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      ?&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; href&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;      :&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; parse&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;url&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;  &#x2F;&#x2F; get component reference&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;  const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; Component&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; = await&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; Router&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;prefetch&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;parsedHref&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;  &#x2F;&#x2F; fetch the component props&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #93A1A1;font-style: italic;&quot;&gt;  &#x2F;&#x2F; and cache locally, handled within getInitialProps&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;  if&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;Component&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; &amp;amp;&amp;amp;&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; Component&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getInitialProps&lt;&#x2F;span&gt;&lt;span&gt;) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    const&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; ctx&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span&gt; { pathname:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; href&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; query&lt;&#x2F;span&gt;&lt;span&gt;, isVirtualCall:&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; true&lt;&#x2F;span&gt;&lt;span&gt; }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;    await&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; Component&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getInitialProps&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;ctx&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;  }&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We can then call this throughout our application, like for example:
&lt;code&gt;&amp;lt;a onMouseOver={() =&amp;gt; prefetch(&quot;&#x2F;product?sku=0001&quot;)}&amp;gt;&lt;&#x2F;code&gt;&lt;&#x2F;p&gt;
&lt;p&gt;This will load not only our product.js page but also all the specific graphql queries into the ApolloClient store.&lt;&#x2F;p&gt;
</content>

        
          <category term="nextjs, apollo, apollo-server, next.js, prefetch, performance, graphql, react, react.js, apollo-client" />
        

        
          <summary type="html">
Update: My pull requests implementing the techniques discussed here were merged into the zeit&#x2F;next.js with-data-prefetch and with-apollo examples. You can easily combine the various examples (including the above two) to achieve your desired functionality.

For most modern web apps, network speed and latency is still the biggest constraint for high performance and great UX. Universally rendered Isomorphic applications do a great job to solve that to some extent without sacrificing interactivity by processing the complete DOM of the first request on the server and subsequent requests on the client. But there is a lot more we can do.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Fuzzing libVLC - Final Report</title>
        <link href="https://shaleenjain.com/blog/fuzzing-vlc-4/" type="text/html"/>
        <pubDate>2017-08-28T00:00:00+00:00</pubDate>
        <published>2017-08-28T00:00:00+00:00</published>
        <updated>2018-01-10T00:00:00+05:30</updated>
        <id>https://shaleenjain.com/blog/fuzzing-vlc-4/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/fuzzing-vlc-4/">&lt;blockquote&gt;
&lt;p&gt;Update: My fuzz targets have been merged into the VLC mainline tree by commits &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;74e7bd240d5b239d0eeb3b67a7511b8b83cb6694&quot;&gt;74e7bd2&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;b83e9fe08d12ae798390bfa64c08096801fcd8c1&quot;&gt;b83e9f2&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Introduction to my GSoC project &lt;a href=&quot;https:&#x2F;&#x2F;shaleenjain.com&#x2F;blog&#x2F;why-fuzz-vlc&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;p&gt;Majority of the parsing code of VLC has been successfully setup to be fuzzed by:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;The demux fuzz target which creates an input stream from the fuzzed input provided by libfuzzer,
probes and loads an appropriate demux module and demultiplexes the input into the various output
elementary streams, minimally handling all the ES callbacks and calling various demux_Control&#x27;s to
increase code coverage.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;ul&gt;
&lt;li&gt;The decoder fuzz target by creating a packetizer and a decoder instance while ignoring the
stream out, packetizing the input block and then proceeding to decode the various packetized blocks.
Hardware decoding as been disabled, so that we only test the codecs included in VLC and the module itself
though many of the codecs are provided by 3rd party libraries.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;These two fuzz targets cover over 35 demux modules and 64 different codec modules or 163k lines of code
which is 20.7% of the VLC code base.&lt;&#x2F;p&gt;
&lt;p&gt;Actual code coverage as measured by libFuzzer would be different if not more but since as of now
VLC is unable to build with the clang linker, I do not have that coverage information.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;some-additional-challenges-and-features-were&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#some-additional-challenges-and-features-were&quot; aria-label=&quot;Anchor link for: some-additional-challenges-and-features-were&quot;&gt;🔗&lt;&#x2F;a&gt;
Some additional challenges and features were&lt;&#x2F;h4&gt;
&lt;ul&gt;
&lt;li&gt;adding first class support for sanitizers in the VLC build system.
You can now compile VLC with sanitizers just by using the --with-sanitizer switch.
These changes are merged into the mainline, more details &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=2bc9957c615d9505f89d88511a0d6ef3889b392b&quot;&gt;here&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;finding and adding sample inputs of various video file formats and containers
and elementary streams encoded with different codecs for the fuzz targets&lt;&#x2F;li&gt;
&lt;li&gt;Creating a dictionary of various tokens and FourCC&#x27;s used to separate the various
chunks and atoms in container formats.&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;code&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#code&quot; aria-label=&quot;Anchor link for: code&quot;&gt;🔗&lt;&#x2F;a&gt;
Code&lt;&#x2F;h4&gt;
&lt;p&gt;Since VideoLAN has still not decided whether to use Google&#x27;s OSS-fuzz or agree to their terms
and doesn&#x27;t want this code to be misused by hackers, they have decided not to keep this in
the mainline tree to minimize exposure.&lt;&#x2F;p&gt;
&lt;p&gt;And so here are all of my out of tree patches:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=57949e7a9b9da4d9130db0359199b16fca1b061c&quot;&gt;57949e7a9b9da4d9130db0359199b16fca1b061c&lt;&#x2F;a&gt; (merged)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;git.videolan.org&#x2F;?p=vlc.git;a=commit;h=2bc9957c615d9505f89d88511a0d6ef3889b392b&quot;&gt;2bc9957c615d9505f89d88511a0d6ef3889b392b&lt;&#x2F;a&gt; (merged)&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&#x2F;commit&#x2F;583b4b6ed83e64cf52ab75d0d5163a360d626ec6&quot;&gt;583b4b6ed83e64cf52ab75d0d5163a360d626ec6&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&#x2F;commit&#x2F;89cc31145c47cb3769d9c3258a1d2baa4d563c37&quot;&gt;89cc31145c47cb3769d9c3258a1d2baa4d563c37&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&#x2F;commit&#x2F;c893f6597efc23cf234af12f09d05510c0c744c3&quot;&gt;c893f6597efc23cf234af12f09d05510c0c744c3&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&#x2F;commit&#x2F;ef80ea254005e84589dd310abe87ce0d3d2a0c90&quot;&gt;ef80ea254005e84589dd310abe87ce0d3d2a0c90&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&#x2F;commit&#x2F;f03556549bd074f724d47901bd58d730d12998d6&quot;&gt;f03556549bd074f724d47901bd58d730d12998d6&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&#x2F;commit&#x2F;23f2e30f4a6241bc3476414ac187d1e7e8169dd3&quot;&gt;23f2e30f4a6241bc3476414ac187d1e7e8169dd3&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;My main work repo has been &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&#x2F;&quot;&gt;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&lt;&#x2F;a&gt; with all my commit history
in the master branch and final patches in the &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;code.videolan.org&#x2F;GSoC2017&#x2F;shalzz&#x2F;vlc&#x2F;tree&#x2F;release&quot;&gt;release&lt;&#x2F;a&gt; branch.
There is a clone of the repo on &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;Shalzz&#x2F;vlc&quot;&gt;github&lt;&#x2F;a&gt; as well.&lt;&#x2F;p&gt;
&lt;p&gt;To run the code,&lt;&#x2F;p&gt;
&lt;ol&gt;
&lt;li&gt;clone the repo and build vlc instrumented with one or more of the sanitizers using the new
&lt;code&gt;--with-sanitizer=&lt;&#x2F;code&gt; switch.&lt;&#x2F;li&gt;
&lt;li&gt;Get and build libFuzzer by changing into the test&#x2F;fuzz&#x2F; directory and using the &lt;code&gt;.&#x2F;build-libfuzzer.sh&lt;&#x2F;code&gt; script&lt;&#x2F;li&gt;
&lt;li&gt;Build the fuzz target binaries by running &lt;code&gt;make check&lt;&#x2F;code&gt;.&lt;&#x2F;li&gt;
&lt;li&gt;Run the fuzz targets manually or by using the &lt;code&gt;.&#x2F;run-fuzzer.sh&lt;&#x2F;code&gt; helper script&lt;&#x2F;li&gt;
&lt;&#x2F;ol&gt;
&lt;h4 id=&quot;bug-trophy&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#bug-trophy&quot; aria-label=&quot;Anchor link for: bug-trophy&quot;&gt;🔗&lt;&#x2F;a&gt;
Bug Trophy&lt;&#x2F;h4&gt;
&lt;p&gt;As for the number of bugs found by the initial fuzzing done on my small laptop there have been quite a few, all of which have been fixed, by me and other VLC developers.
Few of them:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;6c947b775d4d6c6ed07ebde140bddd3a2007b41a&quot;&gt;6c947b775d4d6c6ed07ebde140bddd3a2007b41a&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;a672ea060efbb5898e1d80327f5909a43e8b57d8&quot;&gt;a672ea060efbb5898e1d80327f5909a43e8b57d8&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;b2fb79e3201c5ce77a176b52936835ce195aa986&quot;&gt;b2fb79e3201c5ce77a176b52936835ce195aa986&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;1de4047a25cd336d1539ea0867c29180928dd230&quot;&gt;1de4047a25cd336d1539ea0867c29180928dd230&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;7033852e1a8292734e1d5800bec864bb5fb24c30&quot;&gt;7033852e1a8292734e1d5800bec864bb5fb24c30&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;3266d738e906b38b53f7936f58565441d0652713&quot;&gt;3266d738e906b38b53f7936f58565441d0652713&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;4b76784615f74254a7b66e34ff78393b44af2ed5&quot;&gt;4b76784615f74254a7b66e34ff78393b44af2ed5&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;li&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;7eea089393d6fc1de3436b4d486a466d14566a04&quot;&gt;7eea089393d6fc1de3436b4d486a466d14566a04&lt;&#x2F;a&gt;&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;h4 id=&quot;continuous-fuzzing&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#continuous-fuzzing&quot; aria-label=&quot;Anchor link for: continuous-fuzzing&quot;&gt;🔗&lt;&#x2F;a&gt;
Continuous Fuzzing&lt;&#x2F;h4&gt;
&lt;p&gt;One thing that&#x27;s left to do is setting up of a continuous fuzzing server.
Since OSS-fuzz is not in the picture right now, that is something VLC devs
will have to do on their own infrastructure.&lt;&#x2F;p&gt;
</content>

        
          <category term="libfuzzer, libvlc, vlc, fuzzing, gsoc-2017, gsoc" />
        

        
          <summary type="html">
Update: My fuzz targets have been merged into the VLC mainline tree by commits 74e7bd2, b83e9f2.


Introduction to my GSoC project here

Majority of the parsing code of VLC has been successfully setup to be fuzzed by:

The demux fuzz target which creates an input stream from the fuzzed input provided by libfuzzer,
probes and loads an appropriate demux module and demultiplexes the input into the various output
elementary streams, minimally handling all the ES callbacks and calling various demux_Control&#x27;s to
increase code coverage.
</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Fuzzing libVLC - Improvements</title>
        <link href="https://shaleenjain.com/blog/fuzzing-vlc-3/" type="text/html"/>
        <pubDate>2017-07-08T00:00:00+00:00</pubDate>
        <published>2017-07-08T00:00:00+00:00</published>
        <updated>2017-07-08T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/fuzzing-vlc-3/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/fuzzing-vlc-3/">&lt;p&gt;I have been making some few specific improvement to demux fuzz target
and also working on the decoder target side by side which isn&#x27;t done yet.&lt;&#x2F;p&gt;
&lt;p&gt;Some general improvements that I have made for all fuzz targets is
abstracting away and initializing the parent &lt;code&gt;libvlc_instance_t&lt;&#x2F;code&gt; object in
&lt;code&gt;LLVMFuzzerInitialize&lt;&#x2F;code&gt; which obviously has some performance improvements
as it isn&#x27;t created and destroyed on every run of the &lt;code&gt;LLVMFuzzerTestOneInput&lt;&#x2F;code&gt;.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;&lt;h4 id=&quot;fuzzer-common-c&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#fuzzer-common-c&quot; aria-label=&quot;Anchor link for: fuzzer-common-c&quot;&gt;🔗&lt;&#x2F;a&gt;
fuzzer_common.c&lt;&#x2F;h4&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;c&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;#include&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;lt;assert.h&amp;gt;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;#include&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;fuzzer.h&amp;quot;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;static&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; libvlc_instance_t *&lt;&#x2F;span&gt;&lt;span&gt;p_libvlc;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;extern int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; LLVMFuzzerInitialize&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;argc,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; char&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; ***&lt;&#x2F;span&gt;&lt;span&gt;argv)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;	setenv&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt;&amp;quot;VLC_PLUGIN_PATH&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #2AA198;&quot;&gt; &amp;quot;..&#x2F;..&#x2F;modules&amp;quot;&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt; 1&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;	p_libvlc &lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; libvlc_new&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt;0&lt;&#x2F;span&gt;&lt;span&gt;,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; NULL&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;	assert&lt;&#x2F;span&gt;&lt;span&gt;(p_libvlc &lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;!=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; NULL&lt;&#x2F;span&gt;&lt;span&gt;);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;	return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #D33682;&quot;&gt; 0&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;extern int&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; LLVMFuzzerTestOneInput&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;const uint8_t&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; *&lt;&#x2F;span&gt;&lt;span&gt;buf,&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt; size_t&lt;&#x2F;span&gt;&lt;span&gt; len) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;    return&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; FuzzerTestOneInput&lt;&#x2F;span&gt;&lt;span&gt;(buf, len, p_libvlc);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;void&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; FuzzerCleanup&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;void&lt;&#x2F;span&gt;&lt;span&gt;)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;{&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    libvlc_release&lt;&#x2F;span&gt;&lt;span&gt;(p_libvlc);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Another benefit of this abstraction is that our fuzz targets are now completely
agnostic to the fuzzing engine we use which has been &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;llvm.org&#x2F;docs&#x2F;LibFuzzer.html#startup-initialization&quot;&gt;libFuzzer&lt;&#x2F;a&gt; until now.
We can now use the exact same target with &lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;lcamtuf.coredump.cx&#x2F;afl&#x2F;&quot;&gt;AFL&lt;&#x2F;a&gt; by writing a driver,
since AFL expects a main function, here is an &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;llvm-mirror&#x2F;compiler-rt&#x2F;blob&#x2F;58d43607862096aeb32d72173911c9df244a30f1&#x2F;lib&#x2F;fuzzer&#x2F;afl&#x2F;afl_driver.cpp&quot;&gt;example&lt;&#x2F;a&gt; driver.&lt;&#x2F;p&gt;
&lt;h3 id=&quot;dictionaries&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#dictionaries&quot; aria-label=&quot;Anchor link for: dictionaries&quot;&gt;🔗&lt;&#x2F;a&gt;
Dictionaries&lt;&#x2F;h3&gt;
&lt;p&gt;At this point the demux fuzzer had found a few more bugs but it
had kind of reached a saturation point in terms of the line coverage it
had and it just wasn&#x27;t increasing any more significantly with new sample input.&lt;&#x2F;p&gt;
&lt;p&gt;So I decided instead of adding sample files of every possible video
file format with different types of chunks and atoms that VLC supports,
to create a keywords dictionary of magic values of the various file formats
and feed it to the demux target. Libfuzzer has in-built support for
dictionary files and can much more efficiently create structured inputs
with it.&lt;&#x2F;p&gt;
&lt;p&gt;libFuzzer and AFL have the same syntax of dictionary files and the AFL project
even has some excellent dictionaries for &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mcarpenter&#x2F;afl&#x2F;blob&#x2F;master&#x2F;dictionaries&#x2F;jpeg.dict&quot;&gt;JPEG&lt;&#x2F;a&gt;, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mcarpenter&#x2F;afl&#x2F;blob&#x2F;master&#x2F;dictionaries&#x2F;png.dict&quot;&gt;PNG&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;mcarpenter&#x2F;afl&#x2F;blob&#x2F;master&#x2F;dictionaries&#x2F;gif.dict&quot;&gt;GIF&lt;&#x2F;a&gt; file formats.
And you guessed it VLC can actually &quot;Play&quot; those files as well since &lt;code&gt;ffmpeg&lt;&#x2F;code&gt;
provides their codec as well.&lt;&#x2F;p&gt;
&lt;p&gt;I&#x27;m still working on the dictionary and I&#x27;ll maybe post it once it&#x27;s
completed or if it&#x27;s ever merged into the VLC codebase.&lt;&#x2F;p&gt;
</content>

        
          <category term="libfuzzer, libvlc, vlc, fuzzing, gsoc-2017, gsoc" />
        

        
          <summary type="html">I have been making some few specific improvement to demux fuzz target
and also working on the decoder target side by side which isn&#x27;t done yet.
Some general improvements that I have made for all fuzz targets is
abstracting away and initializing the parent libvlc_instance_t object in
LLVMFuzzerInitialize which obviously has some performance improvements
as it isn&#x27;t created and destroyed on every run of the LLVMFuzzerTestOneInput.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Fuzzing libVLC - De-multiplexer</title>
        <link href="https://shaleenjain.com/blog/fuzzing-vlc-2/" type="text/html"/>
        <pubDate>2017-06-24T00:00:00+00:00</pubDate>
        <published>2017-06-24T00:00:00+00:00</published>
        <updated>2017-07-05T00:00:00+05:30</updated>
        <id>https://shaleenjain.com/blog/fuzzing-vlc-2/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/fuzzing-vlc-2/">&lt;p&gt;So, I have been working on writing a fuzz target for the demux API for the past
two weeks and I have reached a point where it has a good code coverage
and has already found some few shallow bugs.&lt;&#x2F;p&gt;
&lt;p&gt;Here are some of the stacktraces libfuzzer spit out and all of them were fixed
rather promptly.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;A Segfault on a null pointer, fixed by adding a &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;6c947b775d4d6c6ed07ebde140bddd3a2007b41a&quot;&gt;null check&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;==25241==ERROR: AddressSanitizer: SEGV on unknown address 0xffffffffffffff68 (pc 0x7f56c19e8ab0 bp 0xffffffffffffff58 sp 0x7ffcdfe59e58 T0)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;==25241==The signal is caused by a READ memory access.&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #0 0x7f56c19e8aaf  (&#x2F;usr&#x2F;lib&#x2F;libpthread.so.0+0x9aaf)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #1 0x7f56c275c5e1 in Lookup misc&#x2F;variables.c:158&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #2 0x7f56c275c5e1 in AddCallback misc&#x2F;variables.c:839&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #3 0x7f56c275c5e1 in var_AddCallback misc&#x2F;variables.c:884&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #4 0x7f56b336a55e in blurayOpen access&#x2F;bluray.c:674&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #5 0x7f56c26df59d in module_load modules&#x2F;modules.c:183&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #6 0x7f56c26dfb43 in vlc_module_load modules&#x2F;modules.c:275&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #7 0x7f56c2704dec in demux_NewAdvanced input&#x2F;demux.c:259&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #8 0x7f56c2705236 in demux_New input&#x2F;demux.c:151&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #9 0x40575b in LLVMFuzzerTestOneInput &#x2F;home&#x2F;shalzz&#x2F;builds&#x2F;vlc&#x2F;test&#x2F;fuzz&#x2F;libvlc_demux_fuzzer.cpp:73&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #10 0x416714 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) FuzzerLoop.cpp:458&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #11 0x416983 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) FuzzerLoop.cpp:397&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #12 0x41714d in fuzzer::Fuzzer::MutateAndTestOne() FuzzerLoop.cpp:596&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #13 0x417397 in fuzzer::Fuzzer::Loop() FuzzerLoop.cpp:624&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #14 0x410438 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) FuzzerDriver.cpp:744&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #15 0x405c40 in main FuzzerMain.cpp:20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #16 0x7f56c0089439 in __libc_start_main (&#x2F;usr&#x2F;lib&#x2F;libc.so.6+0x20439)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #17 0x404ee9 in _start (&#x2F;home&#x2F;shalzz&#x2F;builds&#x2F;vlc&#x2F;test&#x2F;fuzz&#x2F;.libs&#x2F;lt-libvlc_demux_fuzzer+0x404ee9)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Abort due to character conversion without a conversion descriptor, &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;a672ea060efbb5898e1d80327f5909a43e8b57d8&quot;&gt;fixed&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;==32703== ERROR: libFuzzer: deadly signal&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #0 0x7f46cd57fb68 in __sanitizer_print_stack_trace &#x2F;build&#x2F;gcc-multilib&#x2F;src&#x2F;gcc&#x2F;libsanitizer&#x2F;asan&#x2F;asan_stack.cc:36&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #1 0x468961 in fuzzer::Fuzzer::CrashCallback() FuzzerLoop.cpp:195&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #2 0x46892d in fuzzer::Fuzzer::StaticCrashSignalCallback() FuzzerLoop.cpp:179&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #3 0x7f46cc83993f  (&#x2F;usr&#x2F;lib&#x2F;libpthread.so.0+0x1193f)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #4 0x7f46cbf8d66f in raise (&#x2F;usr&#x2F;lib&#x2F;libc.so.6+0x3366f)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #5 0x7f46cbf8ecff in __GI_abort (&#x2F;usr&#x2F;lib&#x2F;libc.so.6+0x34cff)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #6 0x7f46cce9996f in vlc_iconv extras&#x2F;libc.c:391&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #7 0x7f46ccf3e083 in vlc_stream_ReadLine input&#x2F;stream.c:321&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #8 0x7f4690b96342 in peek_Readline demux&#x2F;subtitle_helper.h:38&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #9 0x7f4690b96b02 in Open demux&#x2F;vobsub.c:128&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #10 0x7f46cce9b2dc in generic_start modules&#x2F;modules.c:356&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #11 0x7f46cce9a508 in module_load modules&#x2F;modules.c:183&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #12 0x7f46cce9abd6 in vlc_module_load modules&#x2F;modules.c:279&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #13 0x7f46cce9b42d in module_need modules&#x2F;modules.c:371&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #14 0x7f46cceef2bd in demux_NewAdvanced input&#x2F;demux.c:259&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #15 0x7f46cceeeadd in demux_New input&#x2F;demux.c:151&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #16 0x458a46 in LLVMFuzzerTestOneInput (&#x2F;home&#x2F;shalzz&#x2F;builds&#x2F;vlc-clean&#x2F;test&#x2F;fuzz&#x2F;libvlc_demux_fuzzer+0x458a46)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #17 0x469754 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) FuzzerLoop.cpp:458&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #18 0x4699c3 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) FuzzerLoop.cpp:397&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #19 0x45f421 in fuzzer::RunOneTest(fuzzer::Fuzzer*, char const*, unsigned long) FuzzerDriver.cpp:268&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #20 0x463034 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) FuzzerDriver.cpp:683&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #21 0x458c80 in main FuzzerMain.cpp:20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #22 0x7f46cbf7a439 in __libc_start_main (&#x2F;usr&#x2F;lib&#x2F;libc.so.6+0x20439)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    #23 0x458239 in _start (&#x2F;home&#x2F;shalzz&#x2F;builds&#x2F;vlc-clean&#x2F;test&#x2F;fuzz&#x2F;libvlc_demux_fuzzer+0x458239)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;A heap-use-after-free, fixed by &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;b2fb79e3201c5ce77a176b52936835ce195aa986&quot;&gt;this&lt;&#x2F;a&gt; and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commit&#x2F;1de4047a25cd336d1539ea0867c29180928dd230&quot;&gt;this&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;==26135==ERROR: AddressSanitizer: heap-use-after-free on address 0x613000005a00 at pc 0x7f4549af4c64 bp 0x7ffcb951f110 sp 0x7ffcb951e8b8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    READ of size 4 at 0x613000005a00 thread T0&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #0 0x7f4549af4c63 in __interceptor_memcmp &#x2F;build&#x2F;gcc-multilib&#x2F;src&#x2F;gcc&#x2F;libsanitizer&#x2F;sanitizer_common&#x2F;sanitizer_common_interceptors.inc:626&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #1 0x7f453871981c in Open demux&#x2F;image.c:640&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #2 0x7f4548ffdb26 in generic_start modules&#x2F;modules.c:356&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #3 0x7f4548ffca56 in module_load modules&#x2F;modules.c:183&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #4 0x7f4548ffd2e5 in vlc_module_load modules&#x2F;modules.c:279&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #5 0x7f4548ffdc77 in module_need modules&#x2F;modules.c:371&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #6 0x7f4549076c84 in demux_NewAdvanced input&#x2F;demux.c:259&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #7 0x7f4549075fc2 in demux_New input&#x2F;demux.c:151&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #8 0x405ce5 in LLVMFuzzerTestOneInput &#x2F;home&#x2F;shalzz&#x2F;builds&#x2F;vlc&#x2F;test&#x2F;fuzz&#x2F;libvlc_demux_fuzzer.cpp:68&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #9 0x4169d4 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) FuzzerLoop.cpp:458&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #10 0x416c43 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) FuzzerLoop.cpp:397&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #11 0x41740d in fuzzer::Fuzzer::MutateAndTestOne() FuzzerLoop.cpp:596&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #12 0x417657 in fuzzer::Fuzzer::Loop() FuzzerLoop.cpp:624&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #13 0x4106f8 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) FuzzerDriver.cpp:744&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #14 0x405f00 in main FuzzerMain.cpp:20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #15 0x7f45464b0439 in __libc_start_main (&#x2F;usr&#x2F;lib&#x2F;libc.so.6+0x20439)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #16 0x404e49 in _start (&#x2F;home&#x2F;shalzz&#x2F;builds&#x2F;vlc&#x2F;test&#x2F;fuzz&#x2F;.libs&#x2F;lt-libvlc_demux_fuzzer+0x404e49)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    0x613000005a00 is located 128 bytes inside of 380-byte region [0x613000005980,0x613000005afc)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    freed by thread T0 here:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #0 0x7f4549b234c8 in __interceptor_free &#x2F;build&#x2F;gcc-multilib&#x2F;src&#x2F;gcc&#x2F;libsanitizer&#x2F;asan&#x2F;asan_malloc_linux.cc:45&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #1 0x7f4549193fc7 in block_generic_Release misc&#x2F;block.c:99&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #2 0x7f4549193a3c in block_Release ..&#x2F;include&#x2F;vlc_block.h:184&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #3 0x7f4549194de2 in block_TryRealloc misc&#x2F;block.c:212&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #4 0x7f45490e89bb in vlc_stream_Peek input&#x2F;stream.c:506&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #5 0x7f4538717037 in IsPnm demux&#x2F;image.c:354&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #6 0x7f45387195bd in Open demux&#x2F;image.c:634&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #7 0x7f4548ffdb26 in generic_start modules&#x2F;modules.c:356&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #8 0x7f4548ffca56 in module_load modules&#x2F;modules.c:183&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #9 0x7f4548ffd2e5 in vlc_module_load modules&#x2F;modules.c:279&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #10 0x7f4548ffdc77 in module_need modules&#x2F;modules.c:371&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #11 0x7f4549076c84 in demux_NewAdvanced input&#x2F;demux.c:259&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #12 0x7f4549075fc2 in demux_New input&#x2F;demux.c:151&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #13 0x405ce5 in LLVMFuzzerTestOneInput &#x2F;home&#x2F;shalzz&#x2F;builds&#x2F;vlc&#x2F;test&#x2F;fuzz&#x2F;libvlc_demux_fuzzer.cpp:68&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #14 0x4169d4 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) FuzzerLoop.cpp:458&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #15 0x416c43 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) FuzzerLoop.cpp:397&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #16 0x41740d in fuzzer::Fuzzer::MutateAndTestOne() FuzzerLoop.cpp:596&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #17 0x417657 in fuzzer::Fuzzer::Loop() FuzzerLoop.cpp:624&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #18 0x4106f8 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) FuzzerDriver.cpp:744&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #19 0x405f00 in main FuzzerMain.cpp:20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #20 0x7f45464b0439 in __libc_start_main (&#x2F;usr&#x2F;lib&#x2F;libc.so.6+0x20439)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    previously allocated by thread T0 here:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #0 0x7f4549b23860 in __interceptor_malloc &#x2F;build&#x2F;gcc-multilib&#x2F;src&#x2F;gcc&#x2F;libsanitizer&#x2F;asan&#x2F;asan_malloc_linux.cc:62&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #1 0x7f4549194434 in block_Alloc misc&#x2F;block.c:128&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #2 0x7f4549194c77 in block_TryRealloc misc&#x2F;block.c:205&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #3 0x7f45490e89bb in vlc_stream_Peek input&#x2F;stream.c:506&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #4 0x7f4539fc5e24 in DetectPVRHeadersAndHeaderSize demux&#x2F;mpeg&#x2F;ts.c:256&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #5 0x7f4539fc6272 in Open demux&#x2F;mpeg&#x2F;ts.c:357&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #6 0x7f4548ffdb26 in generic_start modules&#x2F;modules.c:356&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #7 0x7f4548ffca56 in module_load modules&#x2F;modules.c:183&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #8 0x7f4548ffd2e5 in vlc_module_load modules&#x2F;modules.c:279&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #9 0x7f4548ffdc77 in module_need modules&#x2F;modules.c:371&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #10 0x7f4549076c84 in demux_NewAdvanced input&#x2F;demux.c:259&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #11 0x7f4549075fc2 in demux_New input&#x2F;demux.c:151&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #12 0x405ce5 in LLVMFuzzerTestOneInput &#x2F;home&#x2F;shalzz&#x2F;builds&#x2F;vlc&#x2F;test&#x2F;fuzz&#x2F;libvlc_demux_fuzzer.cpp:68&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #13 0x4169d4 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) FuzzerLoop.cpp:458&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #14 0x416c43 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long) FuzzerLoop.cpp:397&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #15 0x41740d in fuzzer::Fuzzer::MutateAndTestOne() FuzzerLoop.cpp:596&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #16 0x417657 in fuzzer::Fuzzer::Loop() FuzzerLoop.cpp:624&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #17 0x4106f8 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) FuzzerDriver.cpp:744&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #18 0x405f00 in main FuzzerMain.cpp:20&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;        #19 0x7f45464b0439 in __libc_start_main (&#x2F;usr&#x2F;lib&#x2F;libc.so.6+0x20439)&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;     &lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    SUMMARY: AddressSanitizer: heap-use-after-free &#x2F;build&#x2F;gcc-multilib&#x2F;src&#x2F;gcc&#x2F;libsanitizer&#x2F;sanitizer_common&#x2F;sanitizer_common_interceptors.inc:626 in __interceptor_memcmp&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Shadow bytes around the buggy address:&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8af0: fa fa fa fa fa fa fa fa 00 00 00 00 00 00 00 00&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b00: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b10: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b20: 00 00 00 00 00 fa fa fa fa fa fa fa fa fa fa fa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b30: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    =&amp;gt;0x0c267fff8b40:[fd]fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b50: fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd fd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b60: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b70: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b80: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      0x0c267fff8b90: fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa fa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    Shadow byte legend (one shadow byte represents 8 application bytes):&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Addressable:           00&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Partially addressable: 01 02 03 04 05 06 07&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Heap left redzone:       fa&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Freed heap region:       fd&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Stack left redzone:      f1&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Stack mid redzone:       f2&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Stack right redzone:     f3&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Stack after return:      f5&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Stack use after scope:   f8&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Global redzone:          f9&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Global init order:       f6&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Poisoned by user:        f7&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Container overflow:      fc&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Array cookie:            ac&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Intra object redzone:    bb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      ASan internal:           fe&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Left alloca redzone:     ca&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;      Right alloca redzone:    cb&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    ==26135==ABORTING&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Unfortunately I cannot publish my source code yet or start integrating with oss-fuzz and cluster fuzz
by Google as VideoLAN&#x2F;Labs is still undecided and would rather do this privately, mostly because they
don&#x27;t want to be bound by Google&#x27;s &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;googleprojectzero.blogspot.in&#x2F;2015&#x2F;02&#x2F;feedback-and-data-driven-updates-to.html&quot;&gt;bug disclosure&lt;&#x2F;a&gt; policy.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;del&gt;I think they are just confused that they have to do a software release within the specified
deadline when it&#x27;s just a bug disclosure, but whatever.&lt;&#x2F;del&gt;
(There&#x27;s no longer any confusion.)&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Update: You can find all my bug fixes and patches &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;github.com&#x2F;videolan&#x2F;vlc&#x2F;commits&#x2F;master?author=Shalzz&quot;&gt;here&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>

        
          <category term="libfuzzer, libvlc, vlc, fuzzing, gsoc-2017, gsoc" />
        

        
          <summary type="html">So, I have been working on writing a fuzz target for the demux API for the past
two weeks and I have reached a point where it has a good code coverage
and has already found some few shallow bugs.
Here are some of the stacktraces libfuzzer spit out and all of them were fixed
rather promptly.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Fuzzing libVLC - The Architecture</title>
        <link href="https://shaleenjain.com/blog/fuzzing-vlc-1/" type="text/html"/>
        <pubDate>2017-06-10T00:00:00+00:00</pubDate>
        <published>2017-06-10T00:00:00+00:00</published>
        <updated>2017-06-24T00:00:00+05:30</updated>
        <id>https://shaleenjain.com/blog/fuzzing-vlc-1/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/fuzzing-vlc-1/">&lt;blockquote&gt;
&lt;p&gt;&lt;em&gt;Introduction to this blog post &lt;a href=&quot;https:&#x2F;&#x2F;shaleenjain.com&#x2F;blog&#x2F;why-fuzz-vlc&#x2F;&quot;&gt;here&lt;&#x2F;a&gt;&lt;&#x2F;em&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
&lt;h3 id=&quot;the-architecture&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#the-architecture&quot; aria-label=&quot;Anchor link for: the-architecture&quot;&gt;🔗&lt;&#x2F;a&gt;
The Architecture&lt;&#x2F;h3&gt;
&lt;p&gt;I met with the VLC developers and my mentor at the VideoLabs office
in Paris and after a few meetings and discussions we had a pretty good
idea on how we could fuzz test libVLC and the VLC core most appropriately.&lt;&#x2F;p&gt;
&lt;p&gt;In VLC, except the core, everything is a module.
There are over 200+ modules in VLC along with libVLCCore and libVLC.&lt;&#x2F;p&gt;
&lt;p&gt;The main module categories that take an input are:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Access&lt;&#x2F;li&gt;
&lt;li&gt;Access-demuxer&lt;&#x2F;li&gt;
&lt;li&gt;Demuxer&lt;&#x2F;li&gt;
&lt;li&gt;Packetizer&lt;&#x2F;li&gt;
&lt;li&gt;Decoder&lt;&#x2F;li&gt;
&lt;li&gt;Video filter&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;The VLC core tries to load the modules of these categories in the following order:&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;Access =&amp;gt; Demux =&amp;gt; [Packetizer] =&amp;gt; Decoder =&amp;gt; [Filter] =&amp;gt; Out&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;We decided we would fuzz test at least the demux
&lt;abbr title=&quot;Application Programming Interface&quot;&gt;API&lt;&#x2F;abbr&gt;, the decoder API,
the packetizer API and possibly the video filter API&#x27;s which loads modules with these
capabilities.&lt;&#x2F;p&gt;
&lt;p&gt;Along with writing the fuzz targets for these API&#x27;s, I also need to provide a
corpus of sample input so that libfuzzer can provide a structured input according
to the video format&#x2F;codec and not trip up the parse just because the basic headers and
magic numbers were not in place.&lt;&#x2F;p&gt;
&lt;p&gt;We have an end goal of eventually setting up an continuous fuzzing server either on ClusterFuzz
by OSS-Fuzz or a server hosted by VideoLan.
Using OSS-Fuzz has a lot of advantages such as their 1000+ CPU infrastructure,
streamlined process, automated issue tracker, well tested and good documentation.
But we have yet to decided which direction we&#x27;ll go from here.&lt;&#x2F;p&gt;
</content>

        
          <category term="libfuzzer, libvlc, vlc, fuzzing, gsoc-2017, gsoc" />
        

        
          <summary type="html">
Introduction to this blog post here

🔗
The Architecture
I met with the VLC developers and my mentor at the VideoLabs office
in Paris and after a few meetings and discussions we had a pretty good
idea on how we could fuzz test libVLC and the VLC core most appropriately.
In VLC, except the core, everything is a module.
There are over 200+ modules in VLC along with libVLCCore and libVLC.
The main module categories that take an input are:

Access
Access-demuxer
Demuxer
Packetizer
Decoder
Video filter
</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>VLC Media Player and Fuzz testing</title>
        <link href="https://shaleenjain.com/blog/why-fuzz-vlc/" type="text/html"/>
        <pubDate>2017-05-15T00:00:00+00:00</pubDate>
        <published>2017-05-15T00:00:00+00:00</published>
        <updated>2017-07-08T00:00:00+05:30</updated>
        <id>https://shaleenjain.com/blog/why-fuzz-vlc/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/why-fuzz-vlc/">&lt;p&gt;Software bugs and vulnerabilities can be difficult to detect and slow to find
even when actively searched for by developers and users who usually look for
superficial functional and visual bugs.&lt;&#x2F;p&gt;
&lt;p&gt;In a large software especially those written in middle level languages like C&#x2F;C++,
security bugs and vulnerabilities can often be used to comprise the whole system.
Mainly because memory management is left to the programmers of the individual software.&lt;&#x2F;p&gt;
&lt;p&gt;One alternative to human Q&amp;amp;A testing is to use automated software testing techniques
like Fuzzing where random, invalid or unexpected data is provided as input to a computer
program.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;Fuzzing is often more cost-effective than systematic testing
techniques&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#fn-cite_report_random_testing&quot;&gt;1&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.
High profile CVE&#x27;s such as &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Heartbleed&quot;&gt;Heartbleed&lt;&#x2F;a&gt; in April 2014
and &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Shellshock_(software_bug)&quot;&gt;Shellshock&lt;&#x2F;a&gt; in September 2014
could have easily been found with fuzzing&lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#fn-cite_heartbleed&quot;&gt;2&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt; &lt;sup class=&quot;footnote-reference&quot;&gt;&lt;a href=&quot;#fn-cite_shellshock&quot;&gt;3&lt;&#x2F;a&gt;&lt;&#x2F;sup&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Media processing is always a complex task and usually contain lots of security and
stability issues, take &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Stagefright_%28bug%29&quot;&gt;Stagefright&lt;&#x2F;a&gt; or &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;security.googleblog.com&#x2F;2014&#x2F;01&#x2F;ffmpeg-and-thousand-fixes.html&quot;&gt;FFmpeg and a thousand fixes&lt;&#x2F;a&gt;, for example.&lt;&#x2F;p&gt;
&lt;p&gt;&lt;strong&gt;Fuzzing VLC&lt;&#x2F;strong&gt;, the most popular desktop and mobile media player should now seem
like a no-brainer.&lt;&#x2F;p&gt;
&lt;p&gt;Indeed, this was one of the project ideas and my proposal to VideoLAN for
Fuzz testing VLC as part of &lt;abbr title=&quot;Google Summer of Code&quot;&gt;GSoC&lt;&#x2F;abbr&gt; 2017.
VideoLAN accepted my &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;summerofcode.withgoogle.com&#x2F;projects&#x2F;#5893995166171136&quot;&gt;proposal&lt;&#x2F;a&gt; and invited me to their office
in Paris for a &quot;GSoC conference&quot; to discuss and help setting up the project
and get me started.&lt;&#x2F;p&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;fn-cite_report_random_testing&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;1&lt;&#x2F;sup&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;dl.acm.org&#x2F;citation.cfm?id=802530&quot;&gt;&quot;A report on random testing&quot;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;fn-cite_heartbleed&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;2&lt;&#x2F;sup&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;blog.hboeck.de&#x2F;archives&#x2F;868-How-Heartbleed-couldve-been-found.html&quot;&gt;&quot;How Heartbleed could&#x27;ve been found (in English)&quot;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
&lt;div class=&quot;footnote-definition&quot; id=&quot;fn-cite_shellshock&quot;&gt;&lt;sup class=&quot;footnote-definition-label&quot;&gt;3&lt;&#x2F;sup&gt;
&lt;p&gt;&lt;a rel=&quot;external&quot; href=&quot;http:&#x2F;&#x2F;lcamtuf.blogspot.in&#x2F;2014&#x2F;10&#x2F;bash-bug-how-we-finally-cracked.html&quot;&gt;&quot;Bash bug: the other two RCEs, or how we chipped away at the original fix (CVE-2014-6277 and &#x27;78)&quot;&lt;&#x2F;a&gt;&lt;&#x2F;p&gt;
&lt;&#x2F;div&gt;
</content>

        
          <category term="libfuzzer, libvlc, vlc, fuzzing, gsoc-2017, gsoc" />
        

        
          <summary type="html">Software bugs and vulnerabilities can be difficult to detect and slow to find
even when actively searched for by developers and users who usually look for
superficial functional and visual bugs.
In a large software especially those written in middle level languages like C&#x2F;C++,
security bugs and vulnerabilities can often be used to comprise the whole system.
Mainly because memory management is left to the programmers of the individual software.
One alternative to human Q&amp;amp;A testing is to use automated software testing techniques
like Fuzzing where random, invalid or unexpected data is provided as input to a computer
program.</summary>
        

    </entry>
    <entry xml:lang="en">
        <title>Trusting a Self-signed SSL Certificate</title>
        <link href="https://shaleenjain.com/blog/ssl-socket-facotry-java/" type="text/html"/>
        <pubDate>2013-12-27T00:00:00+00:00</pubDate>
        <published>2013-12-27T00:00:00+00:00</published>
        <updated>2013-12-27T00:00:00+00:00</updated>
        <id>https://shaleenjain.com/blog/ssl-socket-facotry-java/</id>
        <content type="html" xml:base="https://shaleenjain.com/blog/ssl-socket-facotry-java/">&lt;p&gt;When connecting to a server which has setup their SSL encryption with a self-signed certificate
through a Java or an android app, you&#x27;ll get an SSLException since their certificate isn&#x27;t signed
by a Certificate Authorities (CA) which is a 3rd party who is trusted by everyone.&lt;&#x2F;p&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;plain&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;javax.net.ssl.SSLException: Not trusted server certificate exception&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;If you have access to the server or know the site admin, get them to buy a CA signed SSL certificate.&lt;&#x2F;p&gt;
&lt;p&gt;But in case that is not possible or feasible we can one thing we can do is
configure our HTTP client library to just not verify the site hostname with the certificate.
But then again that is not a good solution and defeats the whole purpose of encryption.&lt;&#x2F;p&gt;
&lt;span id=&quot;continue-reading&quot;&gt;&lt;&#x2F;span&gt;
&lt;p&gt;A more elegant solution is to tell the client library to explicitly trust a certificate.
We&#x27;ll have to manually get a copy of the site&#x27;s self-signed certificate that we can use
to tell our client to trust.&lt;&#x2F;p&gt;
&lt;p&gt;Java has a couple of HTTP clients, mainly:&lt;&#x2F;p&gt;
&lt;ul&gt;
&lt;li&gt;Apache HTTP client&lt;&#x2F;li&gt;
&lt;li&gt;HttpUrlConnection&lt;&#x2F;li&gt;
&lt;&#x2F;ul&gt;
&lt;p&gt;You&#x27;ll find that when using Apache Http client we&#x27;ll have to create a custom SSLSocketFactory to implement the above
functionality.
And for HttpUrlConnection set a custom SSLSocket to the connection as described at &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;developer.android.com&#x2F;training&#x2F;articles&#x2F;security-ssl.html&quot;&gt;developer.android.com&lt;&#x2F;a&gt;.&lt;&#x2F;p&gt;
&lt;p&gt;Here is a reference implementation that does just that.&lt;&#x2F;p&gt;
&lt;div &gt;
    &lt;script src=&quot;https:&amp;#x2F;&amp;#x2F;gist.github.com&amp;#x2F;shalzz&amp;#x2F;8125772.js&quot;&gt;&lt;&#x2F;script&gt;
&lt;&#x2F;div&gt;
&lt;h4 id=&quot;for-httpurlconnection&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#for-httpurlconnection&quot; aria-label=&quot;Anchor link for: for-httpurlconnection&quot;&gt;🔗&lt;&#x2F;a&gt;
For HttpURLConnection&lt;&#x2F;h4&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;java&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;MySSLSocketFactory&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; sslf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; null&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;try&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    KeyStore&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; ks&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; MySSLSocketFactory&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getKeystoreOfCA&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getResources&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;openRawResource&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;R&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;raw&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;myCert&lt;&#x2F;span&gt;&lt;span&gt;));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    sslf &lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;= new&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; MySSLSocketFactory&lt;&#x2F;span&gt;&lt;span&gt;(ks);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; catch&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;Exception&lt;&#x2F;span&gt;&lt;span&gt; e) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    e&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;printStackTrace&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; finally&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    sslf&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;fixHttpsURLConnection&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;Here we create a &lt;code&gt;Keystore&lt;&#x2F;code&gt; containing our certificate, in this case &lt;code&gt;myCert&lt;&#x2F;code&gt;.
Which we then use to get an instance of &lt;code&gt;MySSLSocketFactory&lt;&#x2F;code&gt; and then call its non static &lt;code&gt;fixHttpsURLConnection()&lt;&#x2F;code&gt; method.
This sets the SSLSocketFactory created as the default SSLSocketFactory for HttpURLConnection.&lt;&#x2F;p&gt;
&lt;h4 id=&quot;for-apache-http-client&quot;&gt;&lt;a class=&quot;zola-anchor&quot; href=&quot;#for-apache-http-client&quot; aria-label=&quot;Anchor link for: for-apache-http-client&quot;&gt;🔗&lt;&#x2F;a&gt;
For Apache Http Client&lt;&#x2F;h4&gt;
&lt;pre class=&quot;giallo&quot; style=&quot;color: #657B83; background-color: #FDF6E3;&quot;&gt;&lt;code data-lang=&quot;java&quot;&gt;&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;MySSLSocketFactory&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; sslf&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; null&lt;&#x2F;span&gt;&lt;span&gt;;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;DefaultHttpClient&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; client&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;  =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #B58900;&quot;&gt; null&lt;&#x2F;span&gt;&lt;span&gt; ;&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #859900;&quot;&gt;try&lt;&#x2F;span&gt;&lt;span&gt; {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;    KeyStore&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; ks&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; =&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; MySSLSocketFactory&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getKeystoreOfCA&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;this&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getResources&lt;&#x2F;span&gt;&lt;span&gt;().&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;openRawResource&lt;&#x2F;span&gt;&lt;span&gt;(&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;R&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;raw&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;myCert&lt;&#x2F;span&gt;&lt;span&gt;));&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;    client  &lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt;=&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt; MySSLSocketFactory&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;getNewHttpClient&lt;&#x2F;span&gt;&lt;span&gt;(ks);&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;span style=&quot;color: #859900;&quot;&gt; catch&lt;&#x2F;span&gt;&lt;span&gt; (&lt;&#x2F;span&gt;&lt;span style=&quot;color: #586E75;font-weight: bold;&quot;&gt;Exception&lt;&#x2F;span&gt;&lt;span&gt; e) {&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;    e&lt;&#x2F;span&gt;&lt;span&gt;.&lt;&#x2F;span&gt;&lt;span style=&quot;color: #268BD2;&quot;&gt;printStackTrace&lt;&#x2F;span&gt;&lt;span&gt;();&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;
&lt;span class=&quot;giallo-l&quot;&gt;&lt;span&gt;}&lt;&#x2F;span&gt;&lt;&#x2F;span&gt;&lt;&#x2F;code&gt;&lt;&#x2F;pre&gt;
&lt;p&gt;In this case we get a &lt;code&gt;DefaultHttpClient&lt;&#x2F;code&gt; created with the &lt;code&gt;KeyStore&lt;&#x2F;code&gt; containing our Certificates.&lt;&#x2F;p&gt;
&lt;blockquote&gt;
&lt;p&gt;Originally posted at &lt;a rel=&quot;external&quot; href=&quot;https:&#x2F;&#x2F;coding-euphoria.blogspot.in&#x2F;2013&#x2F;12&#x2F;custom-sslsocketfactory-that-trusts.html&quot;&gt;coding-euphoria.blogspot.in&lt;&#x2F;a&gt;&lt;br &#x2F;&gt;
Edited and updated on 20&#x2F;07&#x2F;2017&lt;&#x2F;p&gt;
&lt;&#x2F;blockquote&gt;
</content>

        
          <category term="java, android, SSL, SSLException, self-signed" />
        

        
          <summary type="html">When connecting to a server which has setup their SSL encryption with a self-signed certificate
through a Java or an android app, you&#x27;ll get an SSLException since their certificate isn&#x27;t signed
by a Certificate Authorities (CA) which is a 3rd party who is trusted by everyone.
javax.net.ssl.SSLException: Not trusted server certificate exception
If you have access to the server or know the site admin, get them to buy a CA signed SSL certificate.
But in case that is not possible or feasible we can one thing we can do is
configure our HTTP client library to just not verify the site hostname with the certificate.
But then again that is not a good solution and defeats the whole purpose of encryption.</summary>
        

    </entry>
</feed>
