GeistHaus
log in · sign up

https://varunksaini.com/index.xml

rss
126 posts
Polling state
Status active
Last polled May 19, 2026 18:23 UTC
Next poll May 20, 2026 16:05 UTC
Poll interval 86400s
ETag W/"6772bcde-86c0"
Last-Modified Mon, 30 Dec 2024 15:31:42 GMT

Posts

Books reading list for December
Project Hail Mary by Andy Weir - I read this book as part of my local book club’s reading. I had known about this book for a long time and wanted to read it. I loved the way Andy Weir added real science to the narrative of the book. I liked that in The Martian and liked that in this book too. It’s a long book, but I read it as a page-turner and couldn’t keep it down.
https://varunksaini.com/books-list-december/
List of books read in November 2024
November 2024 Hatchet by Paulson(Listening): A book about surviving wilderness. It was a good listen. Same as every by Morgan Housel(Listening): Lots of great insight in this book. Had a fun time with this one. Existentialism is humanism by Jean Paul Sartre: I came to know about Sartre after reading The Stranger by Albert Camus. It was interesting to read about a great philospher and thinker. In the beginning..was command line by Neal Stephenson: An ode to command line and old school computing.
https://varunksaini.com/books-list-november/
List of Books read in October 2024
October 2024 Bandit Queens by Parini Shroff: A non-fiction book from my book club. Story of a band of women from a village in India who decide to get rid of their husbands. Nice read with some social commentry. Think Again by Adam Grant: A nice and quick read. The book is divided into three sections. The first section is about Individual Rethinking(Are you a preacher, a politician, or a prosecutor, you should be a scientific thinker instead and embrace Joy of being wrong).
https://varunksaini.com/books-list-october/
Book Review: Clear Thinking by Shane Parrish
Clear Thinking is a book written by Shane Parrish(FS Blog fame). This book talks about the decision making framework and how to use ordinary moments to make big impact. Things I liked I like the detailed overview of decision making framework and how to use it to make real change How mentors/examplars are helpful reversible vs non reversible decisions I am going to utilize some of the frameworks mentioned in the book to make better decisions/choices in my life.
https://varunksaini.com/clear-thinking-shane-parrish/
Book Review: Atomic Habits by James Clear
Atomic Habits is a book written by James Clear. This knowledge and ideas shared in the book are something that can be used by anyone to build habits and improve existing habits. Author provided frameworks to use and multiple resources to build and improve habits. Things I liked Comprehensive guide on habit forming Framework to solidify habits Resources and scientific citations Things that can be improved Some of topics are repetitive Book can be bit shorter and concise Overall a great book that I am using to form new habits and make sense of my eixting habits.
https://varunksaini.com/atomic-habits-james-clear/
Book Review: Shoe Dog - Phil Knight
Shoe Dog is memoir by Nike founder Phil Knight. Book talks about how he founded Blue Ribbons and then fought for the company. How Nike got its signature shoes and what else happened in this journey. Things I liked Book is exhaustive and talks about both successes and failures. Language of the book is easy and there is a flow to the story. Thing I wished were there I wish author talked about whole Jordan saga.
https://varunksaini.com/shoe-dog-phil-knight/
Book Review: The Things We Make: The Unknown History of Invention from Cathedrals to Soda Cans by Bill Hammock
Book Review: The Things We Make: The Unknown History of Invention from Cathedrals to Soda Cans by Bill Hammock In “The Things We Make: The Unknown History of Invention from Cathedrals to Soda Cans,” Bill Hammock, also known as the “Engineer Guy,” takes readers on an intriguing journey through the hidden histories of everyday objects. This book is not just a collection of facts about engineering marvels; it’s a narrative that weaves together the art, science, and human ingenuity behind inventions that have shaped our world.
https://varunksaini.com/book-review-things-we-make/
Book Review: The Subtle Art of Not Giving F**k
I in fact listened to this book. I borrowed book from library using Libby app. I was aware of the app but only started using it recently. This is the first book that I read/listened to. It was not a bad experience, but I still prefer reading physical books and collectiong the good one. Anyway, here is my review of the book, I took some help from ChatGPT for this review.
https://varunksaini.com/book-review-subtle-art-not-giving-fuck/
Reading Summary July October 2023
What If 2: A sequel to What If. Pleasant and informative read. Like the humor and science intermingled in these books. Rag Darbari: Another hindi book that I read this year. I liked this book a lot. A masterpiece in hindi writing. Elon Musk by Walter Issacson: Elon Musk is all the rage now a days and this book added some context to Elon Musk’s story. I didn’t like the writing much in this book though.
https://varunksaini.com/reading-summary-july-september-2023/
South vs North Nilakantan RS
South vs North by Nilakantan RS is a well research and fact based comparison of differences between South side of India and North side of India. This books not only talks about the issues, but gives data abou those problem and then in the end books also suggests way to fix some of these things. India being such a big and populous country, bound to have many issues. This books throws lights on many of these issues and how the socioeconomic differences between South India and North India play a part in it.
https://varunksaini.com/south-vs-north/
Book Review: Everybody Lies by Seth Stevens-Davidowitz
Everybody Lies by Seth Stephens-Davidowitz is an insightful and thought-provoking book that sheds light on the hidden truths of human behavior, using big data analysis. Summary The book explores how the internet and the proliferation of digital technology have given us a window into the true nature of people’s thoughts, desires, and actions. By analyzing data from search engines, social media platforms, and other online sources, the author uncovers surprising insights about what people really think and do, even when they may not want to admit it in public.
https://varunksaini.com/everybody-lies/
Unofficial Books Library From The Seen and The Unseen Podcast by Amit Varma
I am a big fan of The Seen And Unseen Podcast and specially fan of all the great recommendations about book. Amit has mentioned about seen and unseen library multiple times. So I asked chatGPT to give me list of all the books recommended on show, and here it is - ChatGPT generated As an AI language model, I don’t have the capability to provide an exhaustive list of all the books ever mentioned on The Seen and The Unseen podcast.
https://varunksaini.com/books-recommendations-from-seen-unseen-podcast/
Using Workspaces in Go and recent gotcha
Go 1.18 adds workspace mode to Go, which lets you work on multiple modules simultaneously. Workspaces Go workspaces helps to work with several modules in a Go project. When you create a go.work file, Go runs through the list of modules listed in the workspace, and creates a single list of dependencies. If go.mod files have replace directives, Go will also take them into account. The go.work file has use and replace directives that override the individual go.
https://varunksaini.com/using-workspaces-go/
Book Review: Economics in One Lesson - by Henry Hazlitt
I was looking to read a book about economics from some time. I came across this book and immediately picked it up. I am really glad that I decided to read this book. This book is one of the most concise and thoughtful work on economics. summary of the book Thoughts Nobel laureate F.A. Hayek said, there is “no other modern book from which the intelligent layman can learn so much about the basic truths of economics in so short a time.
https://varunksaini.com/economics-in-one-lesson/
Amusing Ourselves to Death: Public Discourse In The Age Of Show Business by Neil Postman
Amusing Ourselves to Death: Public Discourse in the Age of Show Business is a book by educator Neil Postman. I came to know about this book from one of seenunseen episodes. you can see a pattern here, much of my reading recently is inspired by that single podcast. summary of the book: This book takes reader through the history media and how changes in media impacted sociatey in general(good or bad).
https://varunksaini.com/amusing-ourselves-to-death-book/
Masala Lab - The Science Of Indian Cooking by Krish Ashok
I like cooking and try to cook at least 1 time every week. I am not a recipe follower and like to add my own touch to food I am going. I heard about this book on seenunseen and decided to give it a read. I liked tone and structure of book and in fact learned about few things that were just intution eralier. summary of the book: The book is divided into 8 chapters:
https://varunksaini.com/masala-lab-book/
Book review: India after Gandhi by Ramachandra Guha
This book is a comprehensive introduction to recent indian history. As the title says, book looks at history after Mahatama Gandi and how it played out. Book is divided in chapters and there chapters are setup to read as individual units. Author has done really good research and have given a whole lot of citations around interesting events. This is a long a fun read. If you are looking to learn about India’s history around and after indipendence, this is one of the best book.
https://varunksaini.com/india-after-gandhi/
Guessing Game from Rust book in Go
This year I have been finding some time and learning Rust. I am going to write about my learning journey in another post. Today I want to talk about converting Guessing game from Rust book to Go. It was a fun and quick exercise. It’s interesting to see that both programms are almost same in size. Here is Rust code from Book. usestd::io;userand::Rng;usestd::cmp::Ordering;fn main(){println!("Guess the number!!");letsecret_number=rand::thread_rng().gen_range(1..=100);loop{println!("Please input your guess.");letmutguess=String::new();io::stdin().read_line(&mutguess).expect("Failed to read line");letguess: u32 =matchguess.
https://varunksaini.com/guessing-game-rust-and-go/
Reviewing Network Programming With Go by Adam Woodbeck
A good primer on how to write network programs using Go programming language. Author starts by talking about TCP/IP, UDP, and other networking stuff. Once the basic theory is out of way, author builds network services using TCP and UDP. In later chapters, author talks about deployment, cloud, and observability for services. Overall, I liked this book a lot and learned a few things too. Writing style is very approachable and fun.
https://varunksaini.com/network-programming-with-go/
Using Lua filter in Envoy Proxy
In Envoy, HTTP lua filter is used to run Lua scripts during both request and response flow. Envoy uses LuaJIT as Lua runtime. High level design of Lua Filter All Lua environments are per worker thread. There is no truly global data. All scripts are run as coroutines. Do not perform blocking operations from scripts. It is critical for performance that Envoy APIs are used for all IO. Features supported by Lua Filter Inspection of headers, body, and trailers while streaming in either the request flow, response flow, or both.
https://varunksaini.com/http-proxy-lua-filter/
Using Wasm in Envoy Proxy - Part 1
This is my first blog about using Wasm(Web Assembly) with http proxies at edge. In this first post, we are using tinyGo to compile go code to Wasm. In future posts, I am going to use C++ and Rust, and then talk about pros and cons of these approaches. What is WASM According to webassembly website, WebAssembly (abbreviated Wasm) is a binary instruction format for a stack-based virtual machine. Wasm is designed as a portable compilation target for programming languages, enabling deployment on the web for client and server applications.
https://varunksaini.com/wasm-http-proxy-part-1/
Auto Instrumenting a Go server using Open Telemetry
OpenTelemetry is an observability framework – an API, SDK, and tools that are designed to aid in the generation and collection of application telemetry data such as metrics, logs, and traces. There are 2 ways to instrument a Go application. Manual Instrumentation Auto Instrumentation Instrumenting an application generally involves a significant manual effort on developer part. Open Telemetry for Go(and many other popular languages) supports auto instrumentation using wrappers and helper functions around many popular frameworks and libraries in Go programming languages.
https://varunksaini.com/auto-instrument-open-telemetry-go/
A simple tiered Cache in Go
What is Cache? A cache is used to store data or files for faster access. A cache can be a hardware or software component. Data stored in a cache might be the result of an earlier computation or a copy of data stored elsewhere. A cache hit occurs when the requested data can be found in a cache, while a cache miss occurs when data can not be found in cache.
https://varunksaini.com/tiered-cache-in-go/
Go Modules Meetup Talk
I go a chance to speak at Go Banglore meetup recently. My talk was about how we moved from custom dependecy management to go modules at work. Go at Walmart Go is used at edge and many other places in Walmart Edge Foundation - CDN and Proxies There are more than 400 repositories in our github organization Quirks before go modules Most of code in one single repo Module incompatible import paths(“torbit/foo) Big utilities packages that are shared around teams Forks of popular open source repositories Mix of monorepo and multi-repo Custom dependency manager tool - tbget Clone repository locally Run tbget .
https://varunksaini.com/go-modules-meetup-talk/
Can we use slice as Map Keys in Go
Question: Can we use slice as map key in Go? Short answer is No Do you want to know more? Okay, Let’s have a look at spec. From Map spec: The comparison operators == and != must be fully defined for operands of the key type; thus the key type must not be a function, map, or slice. Map spec already tells us that slice can’t be a key, but we can also check it in the comparison spec:
https://varunksaini.com/slice-as-map-keys-in-go/
How to make VScode Go work in a Multi-Module Repo
At work, We have a multi-module(nested go modules) repo and VSCode is always having problem with that. I was chatting with gopls team on slack and came to know about a new feature that helps with multi-module and VSCode + Go. There are 2 ways to fix this issue in VSCode Go extension - Multiple modules if you have multiple modules or nested modules in a single repo, you will need to create a “workspace folder” for each module.
https://varunksaini.com/vscode-multimodule-repo/
Reselect Last Visual Selection in Vim
Vim has three different visual modes to work with characters, lines, or rectangle blocks of text. We can switch between these modes by pressing v, V, or <ctrl-v> respectively. Many a times, we select something and press ESC by mistake, it is annoying to reselect the whole block of text again by pressing v/V. Vim provides a command gv to reselect the range of text that was selected. Command gv works for all the visual modes.
https://varunksaini.com/reselect-last-visual-selection-in-vim/
Increment Decrement Numbers in Vim
Vim is a text editor that keeps surprising you. The more you learn about vim, there is always more to learn. One of the feature that I keep using and find very interesting is incrementing/decrementing a number in current line. Vim has <ctrl-a> to increment a number and <ctrl-x> to decrement a number. Just go to a line with number in it and hit <ctrl-a>/<ctrl-x> to increment/decrement. But because it is vim, there is definitely more to this command.
https://varunksaini.com/increment-decrement-numbers-in-vim/
Book Review - Software Engineering at Google: Lessons Learned from Programming Over Time
The premise of the book is to draw lessons from software engineering at google and present them in a digestible manner, this book does a good job of that. . Chapters in this book are written by a different people from Google(ex-Google) and that brings a fresh perspective to this book. The book reintroduces the term engineering with a new definition: programming integrated over time, or how to make software programs stand the test of time.
https://varunksaini.com/book-review-seag/
2020: My Reading List
These are the books that I have read so far this year. Outlier by Malcolm Gladwell The Gardener and the Carpenter: What the New Science of Child Development Tells Us About the Relationship Between Parents and Children by Alison Gopnik Nudge: Improving Decisions About Health, Wealth, and Happiness by Richard H. Thaler and Cass R. Sunstein Peak: Secrets from the New Science of Expertise by Anders Ericsson
https://varunksaini.com/books-this-year/
My Home Office Setup
I have been working from home for last 4 years. Initially I thought that I can get by a laptop and couch. But that’s not how it played out. Very soon I realized that I need to have a proper home office setup if I want to work from home for a long duration. And here I am after 4 years. I have acquired quite a few things, and this is a running list of that.
https://varunksaini.com/my-home-office-setup/
Work from home and Corona Virus
Every company has been asking its employees to work from home because of ongoing Corona Virus pandemic. Becuase of this, There has been a great influx of articles about pros and cons of working from home. I have been working from home for last 3-4 years and here are some things that have worked fine for me. Having a fixed schedule Having a fixed schedule really help. I start my work day at 9:00 AM and sign-off around 5:15 PM.
https://varunksaini.com/work-from-home-corona-virus/
Running Kafka in Docker on Mac
Running Confluent kafka stack in docker on macOS is little bit hacky. Confluent doesn’t support docker on macOS yet. But here is how I made it work on my local macOS. I am using a docker compose file and it brings up a single node/single broker kafka cluster. Save the below file to docker-compose.yml file on your local. --- version: '2' services: zookeeper: image: confluentinc/cp-zookeeper:latest ports: - 2181:2181 environment: ZOOKEEPER_CLIENT_PORT: 2181 ZOOKEEPER_TICK_TIME: 2000 extra_hosts: - "moby:127.
https://varunksaini.com/running_kafka_in_docker_on_mac/
writing files completely to disk in go
When we write a file, how we make sure that file is written completely to disk. One of the way is write a temporary file first and then rename it, rename operation is atomic, so we get a complete file. tempFile, err := ioutil.TempFile(path, name) if err != nil { return err } defer tempFile.Close() tempname := tempFile.Name() defer os.Remove(tempname) //Write to temp file err = os.Rename(tempname, filename) if err !
https://varunksaini.com/write-file-completely-to-disk-in-go/
backoff and retry in go
Failure is a way of life. Requests(http or others..) can fail for many reasons. Decision to stop or retry can be very critical for applications. backoff algorithms provide a way to backoff and retry on a failure. There are two popular methods to backoff, constant backoff and exponential backoff. I use backoff library, which is a Go port of exponential backoff algorithm from Google’s HTTP Client Library for Java. backoff provides 4 main functionalities.
https://varunksaini.com/backoff-retry-in-golang/
a quick introduction to standard streams, file descriptors, and redirection
standard streams are pre connected input and output communication channels between a program and its environment. The three standard streams are stdin, stdout, and stderr. File descriptors are handles that are used to access an input or output file, stream, pipe, socket, device, network interface etc. File descriptors work by providing a layer of abstraction between an actual hardware device and a special file created by the kernel for the device, populated by udev, and stored in the /dev directory.
https://varunksaini.com/a-quick-introduction-to-standard-streams/
standard bash error codes
Exit codes in bash indicate the previous command’s termination status. 0 indicates that command completion was successful while 1 indicates that command execution failed. We can check the exit code generated by last command by using $? $ echo $? It’s not only 1 that indicates unsuccessful completion, anything greater than 1 is a sign of command failure. Standard error code are listed here: Exit Code Description 0 Successful execution 1 Unsuccessful execution catchall 2 Incorrect use of shell builtin 126 Command can not execute 127 Command not Found 128 Incorrect exit code argument 128 + num Fatal error signal “num” 130 Script killed with CTRL + C 255+ Exit code is out of range Note: Exit code is an integer value between 0 and/or 255.
https://varunksaini.com/standard-bash-error-codes/
Review: The Go Programming language
I have been programming in Go from almost one year. I read The Go Programming Language Specification, went through A Tour of Go and looked at Effective Go many times. But when it was announced that Alan Donovan and Brian Kernighan are writing a book The Go Programming Language on Go, I didn’t think much and pre-ordered the book on Amazon. I received the book on October 20, 2015 and started reading it immediately.
https://varunksaini.com/the-go-programming-language-book-review/
using io.SectionReader in Go
For my last task I was moving to an offset value in huge byte stream using reader.Seek(int64(offset), whence) and reading the bytes there. But it was not good for the performance because I was moving in a big file(~1gigs). Then I came to know about io.SectionReader and it made my life easier and helped me delete a lot of code(isn’t that best). I create the section reader using this function:
https://varunksaini.com/using-sectionreader/
Go Lang notes
I got Go In Action book from William Kennedy. I was reading the book last week and I have a habit of taking some noted while reading. The book takes a very pragmatic approach to teach Go and has very good code examples. I am sharing some of the notes I took while reading the book. If anybody find the notes interesting, he/she can check the book also. The empty interface is an interface implemented by every type.
https://varunksaini.com/notes-from-go-in-action-book/
using io.LimitReader to read a binary file
I was working on a problem and wanted to read a very specific chunck of file. I read Go documentation and came through io.LimitReader. According to official documentation, “A LimitedReader reads from R but limits the amount of data returned to just N bytes. Each call to Read updates N to reflect the new amount remaining.” and this is what I wanted. f, _ := os.Open("largefile.bin") f.Seek(123, 0) b := make([]byte, 150-123) // remaining length after seek f.
https://varunksaini.com/using_io_limitreader/
Working with files in go lang
Go makes working with file very easy and file reading is an operation that is used very frequently. To open a file in Go, we can use “Open” function from the “os” package. package main import ( "fmt" "os" ) func main() { file, err := os.Open("test.txt") if err != nil { fmt.Println("erros is: ", err) return } defer file.Close() size, err := file.Stat() if err != nil { fmt.Println("erros is: ", err) return } fs := make([]byte, size.
https://varunksaini.com/working-with-files-in-go/