<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>viveksb007</title><link>http://viveksb.dev/</link><description>Recent content on viveksb007</description><generator>Hugo -- 0.147.8</generator><language>en-us</language><managingEditor>viveksbhadauria007@gmail.com (Vivek Bhadauria)</managingEditor><webMaster>viveksbhadauria007@gmail.com (Vivek Bhadauria)</webMaster><lastBuildDate>Wed, 25 Feb 2026 00:00:00 +0000</lastBuildDate><atom:link href="http://viveksb.dev/index.xml" rel="self" type="application/rss+xml"/><item><title>Life of an EKS Node: From Instance Boot to Ready</title><link>http://viveksb.dev/2026/02/life-of-eks-node/</link><pubDate>Wed, 25 Feb 2026 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2026/02/life-of-eks-node/</guid><description>&lt;p>If you&amp;rsquo;ve ever stared at &lt;code>kubectl get nodes&lt;/code> waiting for a new node to appear and transition to &lt;code>Ready&lt;/code>, you&amp;rsquo;ve probably wondered — what&amp;rsquo;s actually happening behind the scenes? This post traces the complete lifecycle of an EKS worker node, from the moment an EC2 instance is triggered to the point it starts running your pods.&lt;/p>
&lt;h2 id="the-big-picture">The Big Picture&lt;/h2>
&lt;p>Before diving into details, here&amp;rsquo;s a high-level overview of what happens:&lt;/p></description></item><item><title>Kube-proxy network_programming_duration_seconds Metric</title><link>http://viveksb.dev/notes/2026/02/kube-proxy-network-programming-metric/</link><pubDate>Wed, 18 Feb 2026 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/notes/2026/02/kube-proxy-network-programming-metric/</guid><description>&lt;p>The &lt;code>network_programming_duration_seconds&lt;/code> metric tracks how long it takes for a Pod or Service change to show up in the actual network rules (iptables/ipvs/nftables) on each node.&lt;/p>
&lt;h2 id="component-flow">Component Flow&lt;/h2>
&lt;pre tabindex="0">&lt;code>┌─────────────────────────────────────────────────────────────────┐
│ Control Plane │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 1. Pod becomes Ready (or Service changes) │
│ └─&amp;gt; Timestamp: T0 │
│ │
│ 2. Endpoints Controller detects change │
│ └─&amp;gt; Calculates trigger time from Pod condition │
│ └─&amp;gt; Sets annotation on EndpointSlice: │
│ endpoints.kubernetes.io/last-change-trigger-time = T0 │
│ │
└─────────────────────────────────────────────────────────────────┘
│
│ watch/update
▼
┌─────────────────────────────────────────────────────────────────┐
│ Worker Node │
├─────────────────────────────────────────────────────────────────┤
│ │
│ 3. kube-proxy receives updated EndpointSlice │
│ └─&amp;gt; Extracts annotation timestamp: T0 │
│ └─&amp;gt; (EndpointsChangeTracker filters if T0 &amp;lt; trackerStartTime)│
│ │
│ 4. kube-proxy programs iptables/ipvs/nftables rules │
│ └─&amp;gt; Completes at timestamp: T1 │
│ │
│ 5. kube-proxy calculates and emits metric │
│ └─&amp;gt; network_programming_duration_seconds = T1 - T0 │
│ │
└─────────────────────────────────────────────────────────────────┘
&lt;/code>&lt;/pre>&lt;p>&lt;strong>Key Points:&lt;/strong>&lt;/p></description></item><item><title>Deep dive into TCP Protocol</title><link>http://viveksb.dev/2025/12/deep-dive-in-tcp-protocol/</link><pubDate>Sat, 06 Dec 2025 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2025/12/deep-dive-in-tcp-protocol/</guid><description>&lt;p>I recently ran into an issue where connections were mysteriously dropping after periods of inactivity. Debugging it required tracing TCP packets through NAT Gateways and Load Balancers, understanding how each component handles idle connections, and figuring out why keep-alive wasn&amp;rsquo;t working as expected. That investigation prompted me to write (or prompt) this post.&lt;/p>
&lt;p>We&amp;rsquo;ll take a deep dive into the TCP protocol - understanding its fundamentals, exploring TCP options, and then following a TCP packet&amp;rsquo;s journey through real-world networking components like NAT Gateways and Network Load Balancers.&lt;/p></description></item><item><title>Life of a DNS Packet in K8s</title><link>http://viveksb.dev/2025/06/life-of-dns-packet-in-k8s/</link><pubDate>Sat, 21 Jun 2025 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2025/06/life-of-dns-packet-in-k8s/</guid><description>&lt;p>In this post, we want to understand how a DNS request in K8s pod gets resolved. Let&amp;rsquo;s create a mental model before we make a DNS request and see how packet moves through the cluster.&lt;/p>
&lt;h2 id="glossary">Glossary&lt;/h2>
&lt;ul>
&lt;li>&lt;strong>Client Pod&lt;/strong>: This is going to be the pod which will make various kinds of DNS request.&lt;/li>
&lt;li>&lt;strong>CoreDNS&lt;/strong>: This is the DNS server that we will use as DNS provider in our K8s cluster.&lt;/li>
&lt;li>&lt;strong>Service&lt;/strong>: In K8s world, Service is a basically a ClusterIP backed by various Pods.&lt;/li>
&lt;li>&lt;strong>Kube-Proxy&lt;/strong>: This component is responsible to configuring service routing on the Node. It configures the IPTable rules which translates the ServiceIP to PodIPs.&lt;/li>
&lt;/ul>
&lt;h2 id="kubernetes-dns-architecture">Kubernetes DNS Architecture&lt;/h2>
&lt;p>Before diving into the packet flow, let&amp;rsquo;s understand the basic DNS architecture in Kubernetes:&lt;/p></description></item><item><title>Gvisor - User space HTTP(s) Routing to Internet</title><link>http://viveksb.dev/2024/11/gvisor-userspace-routing-to-internet/</link><pubDate>Sat, 09 Nov 2024 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2024/11/gvisor-userspace-routing-to-internet/</guid><description>&lt;p>In this post, we will see how to communicate from gvisor user space network stack to Internet. We will be making a HTTP request to google.com from user space network stack.&lt;/p>
&lt;p>This post is building on top of my previous Gvisor related posts&lt;/p>
&lt;ul>
&lt;li>&lt;a href="https://viveksb007.github.io/2024/10/gvisor-userspace-tcp-server-client/">Gvisor - User space TCP Server and Client&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://viveksb007.github.io/2024/10/gvisor-userspace-http-server-client/">Gvisor - User space HTTP Server and Client&lt;/a>&lt;/li>
&lt;/ul>
&lt;h2 id="routing-using-linux-network-stack">Routing Using Linux Network Stack&lt;/h2>
&lt;p>Lets briefly take a look at how a typical TCP request makes its way from the application to the target address.&lt;/p></description></item><item><title>Gvisor - User space HTTP Server and Client</title><link>http://viveksb.dev/2024/10/gvisor-userspace-http-server-client/</link><pubDate>Sat, 26 Oct 2024 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2024/10/gvisor-userspace-http-server-client/</guid><description>&lt;p>This post is a follow-up from previous post &lt;a href="https://viveksb007.github.io/2024/10/gvisor-userspace-tcp-server-client/">Gvisor - User space TCP Server and Client&lt;/a>. In this post, we are going to build user space HTTP server and client on top of TCP server and client that we created in previous post.&lt;/p>
&lt;p>To take a look at complete code for this, refer - &lt;a href="https://github.com/viveksb007/gvisor-experiment/blob/main/cmd/userspace-http/main.go">https://github.com/viveksb007/gvisor-experiment/blob/main/cmd/userspace-http/main.go&lt;/a>&lt;/p>
&lt;h2 id="creating-a-http-server">Creating a Http Server&lt;/h2>
&lt;p>We are using GoLang standard &lt;code>net/http&lt;/code> package to build the HTTP server. We can create the user space TCP listener and pass that to &lt;code>http.Serve()&lt;/code> method. gvisor implementation adheres the GoLang std interfaces.&lt;/p></description></item><item><title>Gvisor - User space TCP Server and Client</title><link>http://viveksb.dev/2024/10/gvisor-userspace-tcp-server-client/</link><pubDate>Tue, 15 Oct 2024 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2024/10/gvisor-userspace-tcp-server-client/</guid><description>&lt;p>In this post, we will see how to create a simple TCP Server and TCP Client in user space network stack. Both server and client will be in the same network.&lt;/p>
&lt;p>To take a look at complete code for this, refer - &lt;a href="https://github.com/viveksb007/gvisor-experiment/blob/main/cmd/userspace-tcpip/main.go">https://github.com/viveksb007/gvisor-experiment/blob/main/cmd/userspace-tcpip/main.go&lt;/a>&lt;/p>
&lt;h2 id="creating-a-network-stack">Creating a Network stack&lt;/h2>
&lt;p>In this section, we are creating a Network stack specifying which protocols it needs to support, assigning addresses to the network and adding default route table.&lt;/p></description></item><item><title>How to setup NodeLocalDNS in EKS</title><link>http://viveksb.dev/2024/06/how-to-setup-nodelocaldns-in-eks/</link><pubDate>Sat, 01 Jun 2024 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2024/06/how-to-setup-nodelocaldns-in-eks/</guid><description>&lt;p>In this post, we are going to setup NodeLocalDNS in our EKS cluster. There is a clear guide on &lt;a href="https://kubernetes.io/docs/tasks/administer-cluster/nodelocaldns/">kubernetes.io&lt;/a> on how to do so, I am writing this post for my reference with a bunch of k8s related commands to validate that its working as expected.&lt;/p>
&lt;p>I am assuming that you have a EKS cluster running. Before setting up NodeLocalDNS, lets make a DNS query from a pod and see where its getting answered from&lt;/p></description></item><item><title>Moving My Personal Finance Tracking to Paisa</title><link>http://viveksb.dev/2024/05/moving-tracking-to-paisa/</link><pubDate>Sat, 11 May 2024 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2024/05/moving-tracking-to-paisa/</guid><description>&lt;h2 id="introduction">Introduction&lt;/h2>
&lt;p>I have been tracking my personal finances on an excel sheet on an ad-hoc basis. There was no specific system as such, I used to just dump my assets and their current value to calculate Net-Worth. I wanted more insights on how my investments in different asset classes are growing and see their performance over time (not point in time when I am checking it).&lt;/p>
&lt;h2 id="tools-and-methods">Tools and Methods&lt;/h2>
&lt;p>I recently found &lt;a href="https://github.com/ananthakumaran/paisa">&lt;strong>&lt;em>Paisa - Personal Finance Manager&lt;/em>&lt;/strong>&lt;/a> and decided to give it a try. Mainly because your data stays on your system, it&amp;rsquo;s not uploaded to any server. So this tool takes a privacy-first approach. This is a FOSS application, I didn&amp;rsquo;t look any further.&lt;/p></description></item><item><title>AMM Reserve Monitoring</title><link>http://viveksb.dev/2022/06/amm-reserve-monitoring/</link><pubDate>Wed, 01 Jun 2022 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2022/06/amm-reserve-monitoring/</guid><description>&lt;p>In this post, we are going to see how we can set up monitoring for AMM’s. This might be required for use-cases like&lt;/p>
&lt;ul>
&lt;li>Developing an API service which allows clients to query price of some asset in AMM&lt;/li>
&lt;li>Develop an arbitrage bot&lt;/li>
&lt;/ul>
&lt;p>I am referring to AMM&amp;rsquo;s on the Solana blockchain. But the idea should be generally applicable to the AMMs of any blockchain.&lt;/p>
&lt;p>We are going to look into simple CFMM based AMM for example Orca. There are few AMMs whose liquidity is distributed into a pool and orderbook like Serum and Raydium.&lt;/p></description></item><item><title>Understanding Flash Loans</title><link>http://viveksb.dev/2022/03/understanding-flash-loans/</link><pubDate>Sun, 13 Mar 2022 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2022/03/understanding-flash-loans/</guid><description>&lt;p>I was always wondering how Flash loans actually work, how can we get uncollateralized loan on blockchain. I got better understanding of Flash loans while solving &lt;a href="https://www.damnvulnerabledefi.xyz/challenges/10.html">Free Rider problem&lt;/a>. In this post, I tried to explain how Flash loans actually work using pseudo code. If you want to have a look at actual solidity code. See &lt;a href="#references">Reference&lt;/a> section.&lt;/p>
&lt;h2 id="what-are-flash-loans">What are Flash Loans?&lt;/h2>
&lt;p>Flash loans are uncollateralized loans in DeFi. They enable users to borrow liquidity instantly without any collateral. There is a catch, the borrowed amount needs to be paid back in the same transaction, along with some fees which can vary for different protocols. It’s a bit difficult to understand how this actually happens, so we will look at some code examples to understand how this is achieved.&lt;/p></description></item><item><title>Arbitrage Bot Analysis on Solana</title><link>http://viveksb.dev/2022/03/arbitrage-bot-analysis-solana/</link><pubDate>Sat, 05 Mar 2022 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2022/03/arbitrage-bot-analysis-solana/</guid><description>&lt;p>Recently, I came across bots doing arbitrage on Solana. Was reading about wormhole hack and how it created great opportunities for bots to make free money. Note that the wormhole hack was a long tail event. In general, arbitrage is a very competitive space and needs constant improvements in strategy.&lt;/p>
&lt;p>&lt;a href="https://twitter.com/0xMisaka">Misaka&lt;/a> wrote a detailed analysis on bots which made money in the &lt;strong>&amp;ldquo;Golden 30 mins&amp;rdquo;&lt;/strong> just after the hacker dumped stolen ETH into Solana AMM pools. Quoting from the post&lt;/p></description></item><item><title>Damn Vulnerable DeFi Solutions</title><link>http://viveksb.dev/2022/01/damn-vulnerable-defi-solutions/</link><pubDate>Sat, 29 Jan 2022 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2022/01/damn-vulnerable-defi-solutions/</guid><description>&lt;p>I recently came across a post &amp;ldquo;&lt;strong>&lt;a href="https://cmichel.io/how-to-become-a-smart-contract-auditor/">How to become a Smart Contract Auditor&lt;/a>&lt;/strong>&amp;rdquo; by &lt;a href="https://twitter.com/cmichelio">cmichel&lt;/a>. The post breaks down the skills required and points to good resources to get started with Smart Contract security. Before this, I was exploring development on Ethereum using Solidity. Solving these challenges has given me better insights to look at code from a security perspective and improved overall Solidity skills.&lt;/p>
&lt;p>Code solutions can be found on my fork of damn-vulnerable-defi repo. Feel free to suggest/comment some other ways to exploit the challenges or any gas optimizations (I didn&amp;rsquo;t tried to optimize for gas while writing exploits)&lt;/p></description></item><item><title>Decoding Raydium Swaps</title><link>http://viveksb.dev/2021/06/decoding-raydium-swaps/</link><pubDate>Thu, 17 Jun 2021 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2021/06/decoding-raydium-swaps/</guid><description>&lt;p>In this post, we are going to look into how raydium swap works using Serum CLOB (Central limit order book). Before diving into how swap works in raydium, let&amp;rsquo;s have a brief look into &lt;strong>Solana blockchain&lt;/strong> and &lt;strong>Serum DEX&lt;/strong>.&lt;/p>
&lt;h2 id="solana">&lt;a href="https://solana.com/">Solana&lt;/a>&lt;/h2>
&lt;p>It&amp;rsquo;s a layer 1 blockchain similar to ethereum but with improvements like supporting very high TPS, parallel smart contract runtime, etc. If you are interested in finding out what makes Solana great in comparison to other layer 1 solutions out there. Give &lt;a href="https://medium.com/solana-labs/7-innovations-that-make-solana-the-first-web-scale-blockchain-ddc50b1defda">this&lt;/a> post a read by Anatoly Yakovenko.&lt;/p></description></item><item><title>Annotations in Java</title><link>http://viveksb.dev/2021/03/annotations-in-java/</link><pubDate>Fri, 26 Mar 2021 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2021/03/annotations-in-java/</guid><description>&lt;p>Annotations are one of those features of Java whose working is not much clear to the developers. This post is for self reference for annotations in java.&lt;/p>
&lt;p>Some example of annotations below -&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-java" data-lang="java">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">@Retention&lt;/span>(RetentionPolicy.&lt;span style="color:#a6e22e">RUNTIME&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">@Target&lt;/span>(ElementType.&lt;span style="color:#a6e22e">TYPE&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#a6e22e">@interface&lt;/span> FunctionalInterface {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-java" data-lang="java">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">@Target&lt;/span>(ElementType.&lt;span style="color:#a6e22e">METHOD&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#a6e22e">@Retention&lt;/span>(RetentionPolicy.&lt;span style="color:#a6e22e">SOURCE&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#a6e22e">@interface&lt;/span> Override {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Any annotation has a retention policy attached to it. There are 3 types of &lt;strong>&amp;ldquo;Retention Policy&amp;rdquo;&lt;/strong>&lt;/p>
&lt;ul>
&lt;li>
&lt;p>&lt;strong>SOURCE&lt;/strong> -&amp;gt; These annotations are in source code only. When the &lt;em>&lt;strong>“.java”&lt;/strong>&lt;/em> file is compiled to &lt;em>&lt;strong>“.class”&lt;/strong>&lt;/em> these annotations are gone.&lt;/p></description></item><item><title>Generic Segment Tree</title><link>http://viveksb.dev/2021/02/generic-segment-tree/</link><pubDate>Sat, 20 Feb 2021 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2021/02/generic-segment-tree/</guid><description>&lt;p>In this post, we are going to create a Generic Segment Tree. Before creating a Generic Segment Tree, we will try to solve a basic segment tree problem and try to find what part of our code is problem specific and abstract it out i.e there are some things which are common in any segment tree problem like creating the tree, querying the tree, etc.&lt;/p>
&lt;p>We will try to identify the piece of logic which is specific to our problem. Lets take the example of the &amp;ldquo;range sum problem&amp;rdquo;.&lt;/p></description></item><item><title>git rebasing - rewrite history</title><link>http://viveksb.dev/2021/01/git-rebasing-rewrite-history/</link><pubDate>Fri, 08 Jan 2021 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2021/01/git-rebasing-rewrite-history/</guid><description>&lt;p>In this post, I am going to discuss a scenario where I had to use “&lt;strong>&lt;em>git rebasing&lt;/em>&lt;/strong>” for something other than squashing commits.&lt;/p>
&lt;p>Lets build up from the starting, I am going to use a short form “CR” for code review.&lt;/p>
&lt;p>When I have to work on a feature, I generally cut a branch from the mainline and start development on it.&lt;/p>
&lt;p>&lt;code>git checkout -b feature-branch-101&lt;/code>&lt;/p>
&lt;p>The above command will create a branch named “&lt;strong>&lt;em>feature-branch-101&lt;/em>&lt;/strong>” and make it the current branch. I start implementing the feature. Let’s say I made a commit (Commit A) and raised a CR corresponding to that commit. And continued development, till the CR comments came I did 2 more commits (Commit B and C). Now the repository scenario is something like below.&lt;/p></description></item><item><title>Integer Cache in Java</title><link>http://viveksb.dev/2020/06/integer-cache-in-java/</link><pubDate>Sun, 28 Jun 2020 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2020/06/integer-cache-in-java/</guid><description>&lt;p>Before starting with the post, try to find the output for below code snippet:&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-java" data-lang="java">&lt;span style="display:flex;">&lt;span>Integer a &lt;span style="color:#f92672">=&lt;/span> 100;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Integer b &lt;span style="color:#f92672">=&lt;/span> 100;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>System.&lt;span style="color:#a6e22e">out&lt;/span>.&lt;span style="color:#a6e22e">println&lt;/span>(a &lt;span style="color:#f92672">==&lt;/span> b);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Integer c &lt;span style="color:#f92672">=&lt;/span> 1000;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>Integer d &lt;span style="color:#f92672">=&lt;/span> 1000;
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>System.&lt;span style="color:#a6e22e">out&lt;/span>.&lt;span style="color:#a6e22e">println&lt;/span>(c &lt;span style="color:#f92672">==&lt;/span> d);
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Note the answer somewhere, we will come back to it after looking at some concepts which will help in answering this.&lt;/p>
&lt;h2 id="auto-boxing-and-auto-unboxing-in-java">Auto-boxing and Auto-unboxing in Java&lt;/h2>
&lt;p>&lt;code>Integer i = 2&lt;/code> doesn&amp;rsquo;t make sense as &lt;code>i&lt;/code> is an object reference and you are assigning it a literal. But this works because of auto-boxing in Java.&lt;/p></description></item><item><title>Streams in Java</title><link>http://viveksb.dev/2020/06/streams-in-java/</link><pubDate>Fri, 12 Jun 2020 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2020/06/streams-in-java/</guid><description>&lt;p>In this post, we are going to discuss about:&lt;/p>
&lt;ul>
&lt;li>what streams are in context of CS&lt;/li>
&lt;li>their support in Java&lt;/li>
&lt;li>lazy evaluation in streams&lt;/li>
&lt;li>how to create finite and infinite streams&lt;/li>
&lt;li>how streams along with functions help in writing declarative code&lt;/li>
&lt;/ul>
&lt;p>Stream by definition is a sequence of data which can be finite or infinite.&lt;/p>
&lt;blockquote>
&lt;p>&lt;strong>Wikipedia: Stream is a sequence of data elements made available overtime. A Stream can be thought of as items on conveyer belt being processed one at a time rather than in batches.&lt;/strong>&lt;/p></description></item><item><title>Tinkering with Xms in JVM</title><link>http://viveksb.dev/2020/05/tinkering-with-xms-in-jvm/</link><pubDate>Sat, 09 May 2020 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2020/05/tinkering-with-xms-in-jvm/</guid><description>&lt;p>In this post, I am going to share my observation after playing with Xms parameter in JVM on different Operating Systems.&lt;/p>
&lt;p>Initially, my understanding of Xms was that&lt;/p>
&lt;blockquote>
&lt;p>Xms is the minimum heap space the JVM should get before starting the Java process, if this much main memory (RAM) isn&amp;rsquo;t available then program should not start.&lt;/p>&lt;/blockquote>
&lt;p>So I wrote a simple program which just outputs a &lt;code>String&lt;/code>.&lt;/p>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-java" data-lang="java">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e">// Simple program that I ran with different Xms values&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">class&lt;/span> &lt;span style="color:#a6e22e">Test&lt;/span> {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> &lt;span style="color:#66d9ef">public&lt;/span> &lt;span style="color:#66d9ef">static&lt;/span> &lt;span style="color:#66d9ef">void&lt;/span> &lt;span style="color:#a6e22e">main&lt;/span>(String&lt;span style="color:#f92672">[]&lt;/span> args) {
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> System.&lt;span style="color:#a6e22e">out&lt;/span>.&lt;span style="color:#a6e22e">println&lt;/span>(&lt;span style="color:#e6db74">&amp;#34;yo man&amp;#34;&lt;/span>);
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span> }
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>}
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;p>Compiled above program using&lt;/p></description></item><item><title>Add BasicAuth in SparkJava Webapp</title><link>http://viveksb.dev/2019/09/add-basicauth-in-sparkjava-webapp/</link><pubDate>Wed, 25 Sep 2019 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2019/09/add-basicauth-in-sparkjava-webapp/</guid><description>&lt;p>In this post, I am going to show you how to add Basic Authentication to your SparkJava webapp in Kotlin.&lt;/p>
&lt;h3 id="spark-java-">&lt;strong>Spark Java&lt;/strong> :&lt;/h3>
&lt;p>Its a micro-framework for creating web applications in Kotlin and Java 8 with minimal effort.&lt;/p>
&lt;h3 id="basic-authentication-">&lt;strong>Basic Authentication&lt;/strong> :&lt;/h3>
&lt;p>Its simply an &lt;strong>Authorization&lt;/strong> header whose value is &lt;code>Basic base64encode(usename:password)&lt;/code>
So if username and password is &lt;strong>admin&lt;/strong> and &lt;strong>admin&lt;/strong>. Base64 encoding of &lt;strong>admin:admin&lt;/strong> is &lt;strong>YWRtaW46YWRtaW4=&lt;/strong>&lt;br>
Value of header will be&lt;/p></description></item><item><title>Mocking with Mockito</title><link>http://viveksb.dev/2019/07/mocking-with-mockito/</link><pubDate>Fri, 19 Jul 2019 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2019/07/mocking-with-mockito/</guid><description>&lt;p>This is going to be a short post about an issue that I faced in my office project.&lt;/p>
&lt;p>&lt;strong>Context:&lt;/strong> I was working on a project that generates an output file based on the data that is read by some input files. Now the size of the input files can vary and in my case, it went up to 50GB. So when the program was executing on the cloud environment (will call ENV further in post), there wasn&amp;rsquo;t enough space left in the &lt;strong>PVC (Persistant Volume Claim)&lt;/strong> for this file and the program crashed due to full PVC. As output file delivery was a priority thing, so I pulled the file locally and tried to generate the file using Integration test. For local generation, I wrote a test, that stubs the file paths that my batchClient downloads.&lt;/p></description></item><item><title>Use Psiphon on Mac OS And Linux</title><link>http://viveksb.dev/2018/11/use-psiphon-on-mac-and-linux/</link><pubDate>Sun, 18 Nov 2018 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2018/11/use-psiphon-on-mac-and-linux/</guid><description>&lt;p>&lt;a href="https://www.psiphon3.com/en/index.html">Psiphon&lt;/a> is a tool that gives you uncensored access to internet content. Currently Psiphon is available for Android, iOS and Windows. This post will take you through steps to get uncensored access to internet content on you Mac and Linux machines.&lt;/p>
&lt;p>&lt;strong>NOTE : You need an Android Device as we will be routing traffic from MAC and Linux machines to the Android device.&lt;/strong>&lt;/p>
&lt;h2 id="download-psiphon-app-on-your-android-device">&lt;strong>Download Psiphon App on your Android Device&lt;/strong>&lt;/h2>
&lt;p>Go to Play Store and install Psiphon app. If the app is banned in your country, then sideload the app. Here is the &lt;a href="https://www.psiphon3.com/PsiphonAndroid.apk">link&lt;/a> for Psiphon apk.&lt;br>
Play Store Link : &lt;a href="https://play.google.com/store/apps/details?id=com.psiphon3.subscription">https://play.google.com/store/apps/details?id=com.psiphon3.subscription&lt;/a>&lt;/p></description></item><item><title>Using iText To Edit PDF In Android</title><link>http://viveksb.dev/2018/08/using-itext-to-edit-pdf-in-android/</link><pubDate>Mon, 13 Aug 2018 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2018/08/using-itext-to-edit-pdf-in-android/</guid><description>&lt;p>In this article, we are going to learn how to integrate and use &lt;a href="https://github.com/itext/itextpdf">iText&lt;/a> library to edit PDFs in Android. You app idea might require you to create or edit PDF as an intermediate or final step. &lt;a href="https://github.com/itext/itextpdf">iText&lt;/a> is the best library to create or edit PDFs.&lt;/p>
&lt;h2 id="integrate-itext-in-your-project">Integrate iText in your Project&lt;/h2>
&lt;p>Adding iText is similar to adding any other library/dependency in your android project. Add statement below in you &lt;em>&lt;strong>app.gradle&lt;/strong>&lt;/em> file&lt;/p></description></item><item><title>Uploading, Processing and Downloading Files in Flask</title><link>http://viveksb.dev/2018/04/uploading-processing-downloading-files-in-flask/</link><pubDate>Sat, 07 Apr 2018 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2018/04/uploading-processing-downloading-files-in-flask/</guid><description>&lt;p>In this article, we are going to learn how to handle files from server i.e how to facilitate uploading and download for files in Flask. This is quite a common requirement for webapps nowadays. Some examples are :&lt;/p>
&lt;ul>
&lt;li>All the image editing sites online require uploading of image, then process them online and provide processed image for downloading.&lt;/li>
&lt;li>Sites that allow users to edit pdf online require uploading, processing and allowing users to download processed file.&lt;/li>
&lt;/ul>
&lt;p>There are many examples of using this functionality. So in this post we will see :&lt;/p></description></item><item><title>FFmpeg : Automate Filtering and Editing Videos</title><link>http://viveksb.dev/2017/12/ffmpeg-automate-filtering-and-editing-videos/</link><pubDate>Fri, 08 Dec 2017 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2017/12/ffmpeg-automate-filtering-and-editing-videos/</guid><description>&lt;p>Hello again, I am a huge fan of anime, (&lt;strong>Dragon Ball&lt;/strong> and &lt;strong>Naruto&lt;/strong>) in particular. I saw some channels uploading Anime videos bypassing &lt;strong>YouTube&amp;rsquo;s copyright detection&lt;/strong>. So I looked on the ways and mostly involved some video editing software and you have to invest a lot of your time. So I wanted to automate the process that takes in input as a Video and modifies its properties so that it would bypass YouTube&amp;rsquo;s Copyright detection and quality of video should still be watchable.&lt;/p></description></item><item><title>How Snapchat detects when screenshot is taken (Hypothesis)</title><link>http://viveksb.dev/2017/11/how-snapchat-detects-screenshot/</link><pubDate>Fri, 10 Nov 2017 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2017/11/how-snapchat-detects-screenshot/</guid><description>&lt;p>While my friend was playing &lt;strong>&lt;em>&amp;ldquo;That Level Again&amp;rdquo;&lt;/em>&lt;/strong> game he mentioned there was a level in between when he had to take screenshot of Game Screen to pass that level (Weird right!). As I know a little bit about Mobile Development I thought they might be having some special permission to do so. To be sure I went ahead and asked to see all the permissions that game app was taking and it was just taking &lt;strong>&lt;em>READ_STORAGE_SPACE&lt;/em>&lt;/strong> permission. Then he mentioned that &lt;strong>Snapchat&lt;/strong> also detects when you take screenshot of some other person’s story/chat, it notifies that person that you took a screenshot. That’s violating the rights of a stalker. And you could do that in your App too. Now lets see HOW!&lt;/p></description></item><item><title>GSOC - 17 Pocket Science Lab : FOSSASIA</title><link>http://viveksb.dev/2017/10/gsoc-2017-pslab-fossasia/</link><pubDate>Sun, 29 Oct 2017 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2017/10/gsoc-2017-pslab-fossasia/</guid><description>&lt;p>This is a little late for this post but anyways I drafted it during the GSOC-17 only, so I am posting it with some modification.&lt;/p>
&lt;p>My proposal for FOSSASIA PSLab was selected.&lt;/p>
&lt;h3 id="title-develop-an-android-science-app-for-pslab-experiments">Title : Develop an Android Science App for PSLab Experiments.&lt;/h3>
&lt;p>A brief intro about &lt;a href="https://pslab.fossasia.org/">Pocket Science Lab&lt;/a>, its an Open Source Hardware Device which provides a lot of functionality that is required to perform a general scientific experiment. You can do a lot of other activities like monitoring motion using MPU6050 sensor by the add-on sensors which the device support. The device supports many sensors complete list can be seen &lt;a href="https://github.com/fossasia/pslab-android/tree/development/app/src/main/java/org/fossasia/pslab/sensorfragment">here&lt;/a>. Python Client for PSLab supports more sensors, a list can be viewed &lt;a href="https://github.com/fossasia/pslab-python/tree/development/PSL/SENSORS">here&lt;/a>.&lt;/p></description></item><item><title>Flash Fastboot MIUI ROM from Linux</title><link>http://viveksb.dev/2017/09/flash-fastboot-miui-rom-from-linux/</link><pubDate>Mon, 11 Sep 2017 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2017/09/flash-fastboot-miui-rom-from-linux/</guid><description>&lt;p>Sometimes during switching between ROM on your android device, you can do the following things&lt;/p>
&lt;ul>
&lt;li>Stuck in bootloop (phone is stuck on MI logo while booting)&lt;/li>
&lt;li>Brick your device accidentally :P&lt;/li>
&lt;li>Or some other irrecoverable problem during rooting or changing recovery&lt;/li>
&lt;/ul>
&lt;p>When nothing works, you have to flash ROM through fastboot. This post describes how you can flash fastboot MIUI Rom from your Linux system. And it&amp;rsquo;s super easy compared to windows. I would take Redmi 3S Prime (land) ROM for example in the terminal commands, change the ROM name according to your needs.&lt;/p></description></item><item><title>Minor II : At Last</title><link>http://viveksb.dev/2017/03/minor-ii-at-last/</link><pubDate>Tue, 14 Mar 2017 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2017/03/minor-ii-at-last/</guid><description>&lt;p>So its my 6th semester and time to decide some idea to work on as Minor II. After Minor I in which I made Advanced Attendance System ( for which i got way more marks than I should have :P ).&lt;/p>
&lt;h3 id="a-brief-review-ofminor-i--advanced-attendance-system">A brief review of Minor I : &lt;strong>ADVANCED ATTENDANCE SYSTEM&lt;/strong>&lt;/h3>
&lt;p>The project is basically a set of two Applications that run on smartphone. One Called Attendance Server that runs on Teachers phone and other Attendance Client that runs on Students phone.&lt;/p></description></item><item><title>Qualcomm DragonBoard 410C</title><link>http://viveksb.dev/2016/05/dragonboard410c/</link><pubDate>Wed, 04 May 2016 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/2016/05/dragonboard410c/</guid><description>&lt;p>Its about a week since i got my dragonboard410c shipped. Was Reading documentation and stuff so as to not destroy the only MicroProcessor Board i have :P&lt;/p>
&lt;p>Refer &lt;strong>&lt;a href="https://developer.qualcomm.com/hardware/dragonboard-410c">DragonBoard410c&lt;/a>&lt;/strong> for Specs&lt;/p>
&lt;p>DragonBoard410c is shipped with Android Lollipop by default as of now.
So i found three ways to get started with board right out of BOX :&lt;/p>
&lt;ol>
&lt;li>Connect HDMI output port of board with HDMI monitor or LCD TV, Make sure to connect mouse,keyboard and HDMI before powering up the board. A detailed info is given &lt;a href="http://www.96boards.org/forums/topic/short-into-to-start-your-dragonboard-410c-with-hdmi-display/">here&lt;/a>&lt;/li>
&lt;li>By using UART to USB Cable or if you have Mezzanine. Again detailed info &lt;a href="http://www.96boards.org/forums/topic/short-into-to-start-your-dragonboard-410c-with-serial-console/">here&lt;/a>&lt;/li>
&lt;li>For some Devs, using Vysor Worked. But i tried and it didn`t Worked. May be because for Vysor you need to Enable Developers Option and USB Debugging.
&lt;br/>&lt;/li>
&lt;/ol>
&lt;p>&lt;img alt="My DragonBoard410c" loading="lazy" src="http://viveksb.dev/img/db410c.jpg">&lt;/p></description></item><item><title>About me</title><link>http://viveksb.dev/about/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/about/</guid><description>&lt;p>Hey, I&amp;rsquo;m Vivek!&lt;/p>
&lt;p>Welcome to my corner of the web! I&amp;rsquo;m currently working as a Software Development Engineer on the AWS Route53 team in the US, where I&amp;rsquo;m working on DNS (and stuff) on the cloud and on-prem. Before this, I delved into the dynamic realms of cryptocurrency with Coinbase and worked in the banking space for Deutsche Bank.&lt;/p>
&lt;p>I graduated in &lt;strong>Electronics and Communication Engineering&lt;/strong> from &lt;strong>Delhi Technological University (formerly Delhi College of Engineering)&lt;/strong>. During my time as a &lt;strong>Google Summer of Code&lt;/strong> Student Developer under &lt;strong>FOSSASIA&lt;/strong> in 2017, I acquired skills like Android development, open-source contribution process, etc. In GSOC, my work primarily focussed on developing Android clients for the &lt;a href="https://pslab.fossasia.org/">&lt;strong>PSLab Hardware Device&lt;/strong>&lt;/a> and sharing my insights and development journey through technical blog posts on the &lt;a href="https://pslab.io/blog/author/viveksb007/">&lt;strong>Fossasia Blog&lt;/strong>&lt;/a>. You can explore more of my projects on my &lt;a href="https://github.com/viveksb007">&lt;strong>Github profile&lt;/strong>&lt;/a>.&lt;/p></description></item><item><title>Learning Projects</title><link>http://viveksb.dev/learning/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><author>viveksbhadauria007@gmail.com (Vivek Bhadauria)</author><guid>http://viveksb.dev/learning/</guid><description>&lt;p>I believe the best way to learn is by building. This is my running list of project ideas - things that push me to explore general systems, networking and kernel programming. Some of these might never come to reality; I&amp;rsquo;ve mostly picked them up from reading things on the internet. Feel free to steal any of these, build and learn for yourself. If you do, I&amp;rsquo;d love to hear about it - tag me on &lt;a href="https://x.com/viveksb007">X&lt;/a> or &lt;a href="https://github.com/viveksb007">GitHub&lt;/a>!&lt;/p></description></item></channel></rss>