Skip to content

Blog#

Consistent Hashing

This post is an AI-generated summary of the Medium article Advanced Algorithms Every Senior Developer Must Know: Part 2 — Consistent Hashing from Sourav Chaurasia. It is intended as a concise reference to the key ideas.

Consistent hashing solves one problem: when the number of servers changes, not every stored key should have to move to a different server. Here, a key can be a cached object, a user session, or a database record. If almost every key gets remapped after adding or removing one server, caches are invalidated and a lot of data has to be redistributed.

Merkle Trees (Hash Trees)

This post is an AI-generated summary of the Medium article Advanced Algorithms Every Senior Developer Must Know: Part 1 — Merkle Trees from Sourav Chaurasia. It is intended as a concise reference to the key ideas.

What Is a Merkle Tree?

A Merkle tree (also called a hash tree) is a binary tree structure invented by Ralph Merkle in 1979. It recursively hashes and combines data blocks to produce a single root hash, which serves as a cryptographic fingerprint of the entire dataset. It is used in many systems like Bitcoin, Git, IPFS, and Cassandra for efficient data verification and integrity.

Windows 11 WSL2 DNS and OpenVPN Split Tunnel

On modern Windows 11 + WSL 2, the reliable VPN-friendly DNS path is WSL DNS tunneling. If you want Linux tools inside WSL to follow the same DNS policy as Windows apps, keep /etc/resolv.conf auto-generated and let the Windows DNS Client make the routing and suffix decisions.

This post focuses on the current Windows 11 + WSL 2 model, not the older manual resolv.conf workaround. It also shows how to keep OpenVPN in split-tunnel mode while preserving internal DNS resolution in both Windows and WSL.

Running Multiple Apps Under a Single Domain with Vercel

I own the copdips.com domain, and need to point it at several Vercel apps so that:

This is a standard Multi-Tenant Routing with Context Awareness scenario. To serve both the root domain (app1.vercel.app) and the subpath version (apps.copdips.com/app1) from the same deployment, each app must become host-aware-effectively detecting whether the request comes through the main router or directly and adjusting asset URLs and links accordingly.

OIDC (OpenID Connect)

OIDC (OpenID Connect) is an authentication layer (verify identity + obtain profile) built on top of the OAuth2 protocol (authorization layer). It allows Web-based, mobile, and JavaScript clients to verify the identity of end-users based on the authentication performed by an authorization server (aka AS or IdP), as well as to obtain basic profile information about the end-user in an interoperable and REST-like manner. It eliminates storing and managing people's passwords.

Using Pageant with VSCode Remote SSH

While Putty and Pageant are widely used tools for SSH connections, you can also integrate Pageant with VSCode to establish remote SSH connections without administrative privileges. While the default ssh-agent service offers similar functionality, it's disabled by default and requires administrative access to start if disabled, making Pageant a more flexible alternative. Here's how you can set it up: