king-11

Welcome to my blog, where I write about my journey backpacking through terrains of the physical and digital realms.

  • I write about technical things like programming languages, bitcoin, open source software, etc but that’s not all I also write about non-technical things like my life, my thoughts, my experiences, etc.
  • I usually try to be brief, but sometimes it can turn in TL;DR!

!A code full of nulls

I recently switched out to a functional based approach on how we communicate absence of value to the function caller. Given in C hash CSharp it’s usually null but that needs more care than letting the compiler guide us. In this article I will cover the functional equivalent of communicating absence of value functionally using types instead of nulls in languages where its predominant. It will provide you insights into how it’s a more safer way to ensure that when your system crashes the next time it’s definitely not because of a null pointer exception....

January 12, 2025 · 6 min · 1158 words · Lakshya Singh

Around the World - 2024

I personally don’t have any materialistic wants apart from my skin care routine, but there is just one thing that I look forward to the most i.e. exploring new places. When I started 2024 I promised myself as the infamous new year resolution that: I will travel a lot I will go to gym regularly I will progress in my career It’s not a linkedin post ofcourse but am glad that all 3 have been achieved to extents I didn’t even imagine of but let’s focus on travelling for now....

December 31, 2024 · 23 min · 4831 words · Lakshya Singh

Cloudflare Integration

I recently tried to move all my DNS records for web resources deployed over the internet to the unified network of cloudflare as they are just great at what they do with all the services and network protection. I will walk through the setup cloudflare to use as nameserver, DNS record management, and SSL/TLS setup. There is plenty more at cloudflare like rate limiting as well. Let’s get this out of the way first Domain Name System (DNS) is a way to translate domain names like blog....

October 29, 2024 · 7 min · 1462 words · Lakshya Singh

Process Management

A process is the entity which gets created for executing the program when we run the following commands in a shell # compile the program by running gcc gcc program.c -o a.out # run the program itself ./a.out Both the above lines lead to execution of two new processes which lead to completion and return the control back to shell. Shell in itself is a process, so how is that a process creates a new process?...

October 13, 2024 · 7 min · 1279 words · Lakshya Singh

Memory Management

Modern programming languages that we work with these days have made memory management simpler that ever, they manage it on their own using things like garbage collectors, smart pointers, ownership, etc. Creating an empty vector is as simple as let empty_vec: Vec<i32> = Vec::new(); But some questions remain unanswered if you haven’t tried manually doing memory operations like: how is a sized vector created using Vec::with_capacity? how is a vector resized on calling pop_back or push_back?...

September 8, 2024 · 7 min · 1419 words · Lakshya Singh

Git Worktree

When you are working in a large code base comprising of multiple micro services maybe in a single repository your work would require you to make progress on multiple features simultaneously. There comes in a lot of context switching which in git terminology means multiple branches. The flow can become cumbersome when you keep stashing and checking out. Let’s see how that looks like. What is the problem? Let’s say I am working on a long term new feature in my freshly checked out branch lakshyasingh/feature-python....

September 1, 2024 · 5 min · 1020 words · Lakshya Singh

Trying is beautiful

I think people these days are more willing to give up and accept circumstances as fate without treading away from the path they are walking on and just trudging along it for eternity. But you know what is one of the most beautiful thing in today’s world? A person willing to fight against the circumstances for something they believe in, for something that won’t let them sleep through night silently, for something that makes them dream in day light....

August 31, 2024 · 2 min · 395 words · Lakshya Singh

MLFQ CPU Scheduling

Multi-Level Feedback Queue algorithm was designed to address problems associated with existing scheduling algorithms i.e. providing a good response and turnaround time resulting in a balanced scheduling algorithm which can cater to a general purpose CPU requirements. It can do so without needing to have any prior information about the executing processes. It develops its knowledge about them on the fly and hence modifying its approach on how to share the CPU time between them....

July 8, 2024 · 6 min · 1221 words · Lakshya Singh

OpenTelemetry Signals

Observability is the ability to measure the internal states of a system by examining its outputs. A good observability system allows to easily identify problem source and troubleshoot them. Observability extends the concept of monitoring by not just telling when something goes wrong but also providing information about why and how. OpenTelemetry is an open standard for telemetry collection that was created as a successor to previously existing standards OpenTracing and Opencensus by Cloud Native Computing Foundation (CNCF)....

July 3, 2024 · 6 min · 1156 words · Lakshya Singh

Reversing Wheel File

Let’s talk about wheel today, definitely hoping it was a ferris wheel but its going to be python’s wheel for now. A wheel file is a relocatable package format for distribution of python packages for easy, quick and deterministic installations. All the packages published on pypi have under their Download files section a tar file and whl file. For example you can head over to Django and download its wheel file which can then be installed simply by doing...

June 14, 2024 · 4 min · 744 words · Lakshya Singh