RSSAmplifier

Blog

The Sharat's

sharats.meRSS feed ↗30 posts

Latest posts

Use a proxy for LLM app development

Most everybody is developing LLM applications these days. New frameworks and libraries show up nearly every week. A common theme is easy switching between LLM providers with minimal code changes. That sounds great, and it is. But, as with all abstractions that make it dead simple to start, they also …

A Tale of Two Forwarded Headers

This is the story of how I handled troubleshooting the redirect URL for OAuth2 in Appsmith, which contained the host as localhost instead of the actual domain name when hosted on Google Cloud Run. This is a story of how Forwarded and X-Forwarded-* headers were propagating through multiple reverse proxies …

Running Docker containers in network isolation with proxied traffic

Several network configurations, especially in large companies and universities, have a proxy configured for all outgoing traffic. Any network traffic that tries to go out bypassing this proxy, will be blocked. For a self-hosted web application, the server will also need to make any and all outgoing connections via this …

Shell Script Best Practices

This article is about a few quick thumb rules I use when writing shell scripts that I’ve come to appreciate over the years. Very opinionated. Things ¶ Use bash . Using zsh or fish or any other, will make it hard for others to understand / collaborate. Among all shells, bash strikes …

Quick insecure TOTP

This is about a Hammerspoon script I have that gives me a super-fast way to fill in TOTP fields in MFA logins. NOTE : This method of doing MFA is very likely, very unsafe. If you are any bit unsure about anything here, please stay away from this document. Hammerspoon ¶ Hammerspoon …

Peeking into HTTPS Traffic with a Proxy

This article is about configuring a web application, Appsmith in this case, to run correctly behind a firewall that does SSL decryption, as a Docker container. Instead of a firewall, we’ll use a proxy, which, for the purpose of the problem statement, should be the same. Table of Contents …

Time is different every time

I love automating things, with shell aliases, global hotkeys, IDE snippets etc. I see this question of have you spent more time automating something, than the time it’s saved you? I’ve seen this question a lot of times over the years, whenever someone sees me using such a …

The Python `print` function

The print function is most likely the first function we encounter when learning Python. That encounter usually looks like print("Hello world!") . After that, we go on to learning more stuff about it like being able to pass any number of arguments or of any type etc. I’m writing …

Dependency Injection In Python

I chose a form of dependency injection (DI) as the solution to a recent problem I needed to solve. This is a quick write-up of how I did it in Python, using the standard library modules. Table of Contents The Problem The Legacy Solution The New DI Solution Conclusion The …

The Magic of AutoHotkey — Part 2

In the previous part of The Magic of AutoHotkey , we looked at automating small pieces of routine tasks with various applications, as well as identifying things that could be done better with a quick hotkey. This is the next chapter of the story. In this article, I’ll show you …

Automating the Vim workplace — Chapter Ⅲ

This is the third installment of my Automate the Vim workplace article series. As always, feel free to grab the ideas in this article or, better yet, take inspiration and inspect your workflow to identify such opportunities. This article is part of a series: Chapter Ⅰ . Chapter Ⅱ . Chapter Ⅲ …

The Weird `global`

Python’s global keyword allows us to change the value of module-level variables inside functions. Sounds so simple and useful, doesn’t it? Well, yeah. I’m going to show you how it can be useful in the simple sense and situations where it can drive people nuts. Simple Usage …

The Magic of AutoHotkey

For the past several years, my primary work station has been Windows 7. After the initial swearing at how things work differently (coming from Linux), I got used to it and started to really like it, in some ways. A big part of the reason for that on Windows is …

Guide to Comprehensions in Python

Comprehensions are a syntax construct used for applying some form of transformations and filtering over streams of data. The problems comprehensions solve can be done without them, using plain old for -loops, but where possible, comprehensions can improve readability and show the intent very well. This article assumes some familiarity …

Automating the Vim workplace — Chapter Ⅱ

This is a follow-up of the Automate the Vim workplace article I published last month. As promised, here’s a follow up with more on how I identified and addressed things in Vim that could be improved to speed me up. Feel free to grab the ideas in this article …

Python's `itertools.groupby` callable

The groupby utility from the itertools module can be used to group contiguous items in a sequence based on some property of the items. Python has several utilities for working with lists and other sequence data types. In addition to a lot of such utilities being directly available as builtins …

The `tar` Command Clipboard

Recently, while doing an experiment with my blog’s rendered output with a VPS instance, I needed to transfer it to the server over SSH. While doing that, I experimented with archiving the folder a bit, so I’m putting the outcome of that experience here, should I need it …

Working with Strings in Python

This article will be a practical rundown of working with strings in Python, made up of things I constantly forget and have to look up on how to do. I hope it will serve as a super-quick reference for me as well as for anybody else who stumbles here. This …

Automating the Vim workplace

I majorly use two tools for my coding workflow and one of them is GVim (on Windows). It’s my primary choice for editing text for ten years now and in that time, I’ve picked up several habits and tricks that made me very productive. This article is part …

Python's `map` builtin function

In this article, we’ll take a look at Python’s stream processing utility function, map . This function can enable us to write powerful list/stream-processing routines that can be easy to read and understand. Let’s go over the basics first so we have context when talking about them …

The Jython Pillow Guide

This is a document with tips and usage details about Jython that I’ve come across. I intend to document handy features of Python as well as some clever inter-op facilities provided by Jython. I’m going to assume you’re not a complete beginner to Java and Python languages …

The Python Dictionary

The Python Dictionary is a key–value style data structure that is tightly integrated with the language syntax and semantics. Understanding them well can help us use them better and investigate subtle problems more efficiently. This is my attempt to document this topic in more depth. Though I included a …

Migrate from Pelican to Hugo

Update: I have now moved to using a self-made Python program that compiles my markdown article documents into the website you see. I’m keeping this article as a journal of my then experience. I recently got around to resurrecting my blog up after around five years of death. As …

The ever useful and neat subprocess module

Python’s subprocess module is one of my favourite modules in the standard library. If you have ever done some decent amount of coding in python, you might have encountered it. This module is used for dealing with external commands, intended to be a replacement to the old os.system …

Serializing python-requests' Session objects for fun and profit

Prepare ¶ If you haven’t checked out @kennethreitz’s excellent python-requests library yet, I suggest you go do that immediately. Go on, I’ll wait for you. Had your candy? That is one of the most beatiful piece of python code I’ve read. And its an excellent library with …

Dependency graph of all installed gems

Every other application written using ruby these days seem to come with this installation instruction: gem install my-super-awesome-app and then going on to describing how awesome the app is. But, installing the app in the above way installs all its bazillion dependencies, which, unfortunately are not uninstalled when you uninstall …

Implementing an expressive search system with clojure

Backstory ¶ I have recently learned Clojure and its the first time I’ve been exposed to lisp and the code-as-data way of life. I was eager to use Clojure to make an app, any app, a simple silly personal tool to help me out with a tedious task. One such …

Vim undo breaks with auto-close plugins

Prelude ¶ If you’ve used IDEs or other heavy editors ever in your life, you’d know how nice it is to have parentheses and brackets to get auto-closed. If you don’t know what I’m talking about, its a feature usually present in IDEs like eclipse and easily …

Installing Crunchbang Linux on my old lappy

I managed to install Crunchbang linux, the recently released Stetler, after reading quite a positive review (I don’t remember where). I am really liking it, especially the Openbox desktop environment. Also, coming from a lot of experience on ubuntu, finding Crunchbang look so bare-bones and simple, yet so customizable …

A tasty vim configuration setup with Vimpire and Pathogen

Managing vim plugins has always been a hassle. Until pathogen came along. If you are using vim with quite a few vim plugins, then you should be using pathogen, if you are not, you are seriously depriving yourself of sanity. No, seriously. You should. So, I assume you are also …