How do Rails/Golang/Python handle canceling a HTTP request mid transaction? 20 Jul, 2025 Earlier today I saw this tweet : I enjoy asking this question during interviews, as it opens the door to a wide array of engaging technical discussions. It also shines light at the parts of the system that were assumed to be understood. How would you handle the cancellation of an HTTP request that started a……
Vibe Coding My Way To A New Terminal Blog Theme 09 June, 2025 I was very inspired by recent post by Shreya Shankar where she tweeted about vibe coding interfaces to look at the data. In her follow up post she gave some tips about how to get the clean terminal look. Turns out it’s as simple as telling Claude ‘sleek terminal theme’. So last night while lying in bed with my phone I told Claude I want…
ModernBERT 04 May, 2025 My notes on ModernBERT. Source Family of encoder only (input text, output vector) models, with 8192 sequence length. Comes in two sizes: 149M and 395M params. BERT Released in 2018 by Google, 2nd most popular model on HuggingFace. Encoder only transformer architecture makes it ideal for real world problems like retrieval, classification and entity extraction. Using self…
How to test sidekiq_return_in_block? 04 May, 2025 Sidekiq allows specifying behavior when there is an exception. You can choose to use the default exponential backoff algorithm. I needed a way to change the backoff to be slower and more random. The exact backoff algorithm can be anything. class YourWorker include Sidekiq :: Job sidekiq_retry_in do | count , exception , jobhash | case exception…
Logits, Softmax and Temperature in LLMs 03 May, 2025 My notes on Logits and Softmax. Logits and Softmax When LLM processes an input, it generates set of numerical scores (logits) for each possible token in its vocabulary. These logits aren’t probability yet, they can be positive or negative and don’t sum to \(1\). To turn logics into probabilities, model applies softmax function which normalizes…
Search In Postgres 02 May, 2025 It’s inevitable at some point you’ll need to implement user facing search on one of more fields in your database. I had to implement searching file and user given title for the file, but not the contents of the file. Here’s an example table files . CREATE TABLE public . files ( id SERIAL PRIMARY KEY , path text NOT NULL , title text NOT NULL ); INSERT INTO files (…
Rate Limiter In Redis 02 May, 2025 Problem: External APIs limit the number of requests you can send during a time window. We should rate limit ourself instead of sending too many requests and running foul of their limits. Implementation using counter Check if rate limited, if not, increment counter. -1 result indicates there were already rate_limit[:max] number of requests processed in the…
Installing LaTeX-OCR On Osx 11 May, 2024 LaTeX-OCR is a library for converting images to LATEX code. I recently had to reinstall it and ran into some issues. I’m documenting them here so it can help someone else. Install conda brew install miniconda Install conda to start with your shell conda init Activate a new conda environment: conda create -n latexocr python=3.11 . If Install with right qt…
This blog post was generated by ChatGPT 20 March, 2023 A few days ago, I was trying to set up Jasmine to output the description of the tests while running it. It wasn’t as straightforward as passing in a command line argument, so I turned to everyone’s favorite boogeyman, ChatGPT, to help. Here is the complete conversation . TLDR: It helped, but I had to hand-hold it a few times. In the end, I…
ALERTWildfire 08 May, 2020 My past time the last few hours has been switching through the various live webcam feeds on http://www.alertwildfire.org and checking if I can catch a glimpse of smoke or the various fires that are burning up in California right now. The above video was taken two days ago by one of the webcams located south of Boulder Creek, California. You can see the CZU Ligtning…
Dokku powered personal hub 07 May, 2020 Last July 4th weekend I took some time to redo the setup for sent-hil.com. Previously it was Jekyll app running on Github pages. For the amount of blogging I did and traffic it received, it was more than enough. However I wanted to convert sent-hil.com to be a hub for different apps. My first attempt was to use AWS ECS to deploy dockers containers, but after…
sqlite3.h Is Missing When Doing ‘gem install sqlite3’ In Mojave OSX 03 May, 2019 Fetching sqlite3 1.3.12 Installing sqlite3 1.3.12 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension. extconf.rb checking for sqlite3.h... no sqlite3.h is missing. Try 'brew install sqlite3', 'yum install sqlite-devel' or 'apt-get install libsqlite3-dev' and check your shared…
Week-07-links 2018-02-17 ghhook : “Go library that makes working with Github webhooks delivered with AWS APIGateway easier.” NOTE, this is mine :) It started as few one off scripts, run as AWS Lambda function, to help automate some tasks based on Github webhooks at work; eventually extracted out some common functionality into this library. serverless : “Folder specific env variable config;…
Challenge - use api docs more than Google or Stackoverflow 2018-01-16 Few days ago I challenged myself to not use Google or Stackoverflow, but to check the language/api docs whenever I need to lookup something. This is part of my other long running project to remove abstractions and move closer to the core. I’m hoping this lets me better understand the code and be more idiomatic. For Go, there’s…
Programming Arduino with Assembly 23 Oct 2016 Arduino is typically programmed with Arduino IDE with a set of C/C++ functions. The canonical blink sketch which turns a led on/off every 1 second looks like: void setup() { pinMode(13, OUTPUT); // initialize digital pin 13 as an output } void loop() { digitalWrite(13, HIGH); // turn the LED on (HIGH is the voltage level) delay(1000); // wait for a…
Single vs Double dash in cli args 28 May 2016 It all depends on the program. Usually “-“ is used for ‘short’ options (one-letter, -h), and “–” is used for “long”(er) options (–help). Short options can usually be combined (so “-h -a” is same as “-ha”) Source One exception I found was find which uses single dash, but full names like find /usr/src -name CVS . – is not in POSIX, but GNU recommends it…
Links 25 May 2016 This link collection is predominantly filesystems; they have been mostly on my mind the last couple weeks, especially network and virtual filesytems like Camilstore, Infinit Storage and Tahoe-LAFS. There are ton of options, but there is also plenty of oppurtunities. Camlistore - personal storage system for life; stands for Content-Addressable Multi-Layer Indexed Storage, the idea…
The 1 in cat(1) 5 Sept 2015 2.35p When you do man cat , you get an output like: CAT(1) BSD General Commands Manual CAT(1) NAME cat -- concatenate and print files Ever wonder what the 1 in CAT(1) stands for? It’s the section for command as defined in Unix Programmer’s manual . Here’re the sections: 1. Commands 2. System calls 3. Subroutines 4. Special files 5. File formats and conventions 6. Games…
Links 31 Aug 2015 direnv : Folder specific env variable config; especially useful for managing multiple GOPATH and GOBIN . multiconfig : Load configuration from multiple sources in Go; Only thing missing is ability to specify description for various config. Power of Habit : The best self help book isn’t a self help book at all. It’s more of an inquiry into how habits are formed and how to change…
Here we go again 31 Aug 2015 It’s been a while since I’ve maintained a blog seriously. After flirting with Ghost, Medium and even Github’s gists, I settled on Jekyll for its ease of use and customization. This is going to be a more of a braindump, somewhere between Twitter and Medium. Like most Jekyll blog this too is hosted on Github . You can view the source here . The design is originally from…
Consistent hashing, a guide & Go library Consistent hashing is deceptively simple yet very powerful, but I didn’t quite understand what it was till I sat down and worked it out for myself. Before I tell you about consistent hashing, you need to understand the problem we’re trying to solve: How to determine which server to store and retrieve keys in a distributed network? Requirements are: all…