RSSAmplifier

Blog

Kalyan

namburi.orgRSS feed ↗15 posts

Latest posts

1.5b tokens, 50x output & Claude /insights

1.5 billion! - That’s the approximate amount of tokens I spent on Claude Code, in January! And the number is conservative, for it excludes usage across 4 other machines in the cloud. Not included here is a fair bit of 2x Cursor subscriptions and Codex subscriptions. I recently added Gemini to the repertoire for evals. GitHub Copilot was my first ever sub. They’ve clearly lost the plot, so I…

Death Of Code Monkey

Shock & Awe; Fear & Thrill; Existential crisis & Unbridled optimism - all together and all at once were the emotions that have been rushing through me for the past few years. Early on, it dawned on me that anyone in software who would refuse to get on with the program would be relegated to the past. There are three categories of developers: those who are passionate about building something (as an…

Rust: Sorted Keys In BTreeMap

BTreeMap in rust’s equivalent of C++’s std::map , the former representing a self balancing tree data structure while the latter uses self-balancing binary search tree implementation (in the form of red-black tree). 

 Ordering Limitation 

 BTreeMap only supports ascending order by default and does not provide a built-in descending order, unlike C++. 

…

Platform Fatigue

It started really exciting. Writing code that you can see, touch, and interact with on a device is magical. You are a creator, and you believe you are put on this earth to build awesome things. 

 The prototyping phase is done, but now is the time to publish it, and you step into hell. Developer certificates, entitlements, device registrations, the pain is endless. Yes, I am looking at iOS…

Oddity Engine

One look at Oddmu and I left inspired. The single text box for writing prose just seemed so irresistible, however the feature set, left a void, one that could only be filled by writing my own, for my own perceived notion of control and flexibility. 

 Enter Oddity. 

 Markdown files 

 It retains the idea of using markdown files that has appealed to me for a while.…

Yet Another Blog Engine

Every few years, I migrate the blog to a new engine or software, almost without fail. That time has arrived aright on cue, to rip out the last incarnation in the form of a hugo static site. 

 If I think about this in the right order, the very first iteration was in the form of a flat file cms (which formed the basis of nanocms), and then I moved to wordpress where it stayed there for…

Building Diffs With Go

While writing a new blog/writing/notes engine for myself (I am calling it Oddity , inspired by Oddµ), I wanted the ability to show git style diffs in my text, to primarly track changes I am making. The secondary goal was also to be able to debug content manipulation that the engine itself performs. 

 The diffmatchpatch library while excellent, proved to be a little unintuitive 

…

Postgres Backups with pg_dump, pg_restore & psql

Postgres by default comes with utilities for running backups and restores. Postgres can dump to either a plain sql file or to its own internal format. The advantage of using the internal format is that it allows you to selectively restore data and schema. 

 pg_dump 

 It can dump the database in either sql file format or in postgres’s internal format. 

 Using this…

Left Shift with Float Conversion in Go!

The following piece of code while it looks innocent actually does not compile &#xA;&#xA; return int64(0.5 * float64((1<<n)-1))&#xA; &#xA;&#xA; It produces the following error &#xA;&#xA; exp.go:22:28: invalid operation: 1 << n (shift of type float64)&#xA; &#xA;&#xA; What is happening here? &#xA;&#xA; This is because when you do float64(1<<n) the first instinct of golang&rsquo;s compiler is to…

Postgres Show Table Size on Disk

The following commands allow you to query the size on disk occupied by tables, dbs and other relations. &#xA;&#xA; Table size &#xA;&#xA; SELECT pg_size_pretty( pg_total_relation_size('table_name') );&#xA; &#xA;&#xA; db size &#xA;&#xA; SELECT pg_size_pretty( pg_database_size('dbname') );&#xA; &#xA;

Submit Ajax Form including Button Name

When submitting an ajax from, form.serialize() does not include the clicked button. We need to manually append this from the originalEvent attribute &#xA;&#xA; $("form").on("submit", function(event)) {&#xA; var data = $(this).serialize();&#xA; if(event.originalEvent.submitter) {&#xA; data = s['name'] + "=" + s['value'] + "&" + data&#xA; }&#xA; // continue&#xA;}&#xA; &#xA;

Basic Auth in Go

Code snippet to perform basic auth using go. Every incoming request is required to pass the the username/password combination in the headers and you are expected to validate and return a www-authenticate header response in case of auth failure. &#xA;&#xA; hFunc := func(w http.ResponseWriter, r *http.Request) {&#xA; user, pass, ok := r.BasicAuth()&#xA; if !ok {&#xA; fmt.Println("Error parsing basic…

Network Scans with arp and nmap

Once in a while, I get around running network scans to check what devices and ports are open on my network. The proliferation of IoT devices in my home, combined with lack of VLAN capabilities of my router, has upped my uneasiness in the recent times. &#xA;&#xA; There are two modes of scans I often run &#xA;&#xA; MAC Address scans &#xA;&#xA; All devices on my router have to be manually mac address…

Books in 2019

&#xA;&#xA; As with 2016 , 2017 & 2018 , I spent time lot of time reading in 2019. I managed read a total of 28 books, of which a fair amount ended up being science fiction. &#xA;&#xA; &#xA;&#xA; &#xA;&#xA; &#xA; &#xA;&#xA; Non-fiction &#xA;&#xA; Its good to get the nonfiction list out of the way as its pretty short. I enjoyed every single one of them. They were light, informative and useful.…

Automated Plant Watering System - Part 3 - the software

This is a follow up to Part 2 of my Mark2 design and build of Plant watering system. &#xA;&#xA; Learning &#xA;&#xA; &#xA; The 3.7v LiPo was unable to deliver the required current of about 350 mA for running 2 motors simultaneously. This lead to the batteries dying out prematurely while being perfectly capable of squeezing out juice for just one motor. &#xA; Different plants have different water…