Skip to content

Instantly share code, notes, and snippets.

@hstsethi
hstsethi / count-companies.sql
Created November 13, 2026 11:46
Indian states by number of companies on NSE using it's name
WITH states AS (
SELECT state FROM read_csv("states.csv")
),
mainboard_count AS (
SELECT
s.state,
count(*) AS co_count
FROM equity AS e
INNER JOIN states AS s
@hstsethi
hstsethi / extra-lives-dialogues.txt
Created July 26, 2026 03:52
All in-game dialogues and help messages from Extra Lives by Mdickie
"What hurts you so much that you feel"
"the need to hurt me to heal it?"
"Hey, " + this.promoName[1] + ", what\'s your problem?"
"Don\'t touch me unless you want a fight!"
"Hey, " + this.promoName[1] + ", watch who you mess with!"
" happens to be a friend of mine..."
"Hey, " + this.promoName[1] + ", that\'s MY " + this.namer + "!"
"Give me it back or I\'ll show you what it\'s for!"
"That\'s right. Give me what\'s mine before I"
"take something even more valuable from YOU!"
@hstsethi
hstsethi / iptables-ovpn-kill-switch.sh
Last active May 7, 2026 07:52
Strict user level kill switch for openvpn with Iptables. Migrated to NFT. Not in use since 2024.
#!/bin/sh
sudo iptables -P INPUT DROP
sudo iptables -P OUTPUT DROP
sudo iptables -P FORWARD DROP
# Allow all traffic as long its on these ports and these users
sudo iptables -A OUTPUT -m owner --uid-owner 1001 --jump ACCEPT
sudo iptables -A OUTPUT -m owner --uid-owner 1002 --jump ACCEPT
sudo iptables -A OUTPUT -o tun0 -m owner --uid-owner 0 --verbose --jump ACCEPT #root user
@hstsethi
hstsethi / insertdate.lua
Created November 30, 2025 01:15
Micro editor plugin to insert current date in ISO861 format.
local buffer = import("micro/buffer")
local micro = import("micro")
local config = import("micro/config")
function init()
config.MakeCommand("insertDate", insertDate, config.NoComplete)
end
function insertDate(bp)
local buf = bp.Buf
@hstsethi
hstsethi / commentary.md
Last active July 30, 2026 00:36
Dialogues from a Nowhere, a 2007 J2ME game, with character names reverse engineered.

These dialogues are from a 2007 J2ME game Nowhere. They were extracted from a binary file within jar file simply named t.

There were no names, and it only started simply as "@[alphabet]" etc. I have manually replaced that with actual names. I discovered majority of them by searching the names, as many characters introduced themselves through that. For example,

@bI'm Sophia.

This tells us that all occurances of @B are of Sophia.

@a is shared by both Lucas, John, who also share the same sprite hence that is not modified. The modifications I made are as follows:

@hstsethi
hstsethi / termux-sos.sh
Created May 18, 2025 04:05
Shell script for SOS in Termux
for i in {1..3}; do
for j in {1..3}; do
termux-torch on
sleep 0.5
termux-torch off
sleep 0.5
done
sleep 1
done
@hstsethi
hstsethi / unprofitable-high-pe.md
Created May 6, 2025 12:19
Screen for finding unprofitable yet high PE companies

Unprofitable companies with less than 7% 1Y return, which is less than FD, which have PE higher than 20. Doesn't consider market cap.

Everyone screens for good or undervalued stocks, but nobody does the opposite, finding unprofitable yet high PE ratio stocks. It's purely for educational and curiosity purposes, the results might not be good investments.

Why do It?

  • Aids in industry wide analysis
  • Curiosity
  • Differentiate between undervalued and valueless stocks
@hstsethi
hstsethi / bajaj-sbi-fin-commentary.md
Last active May 5, 2025 03:16
My Financial commentary on Q4 2025 results of Bajaj Finance, SBI

Bajaj Finance

The recent Bajaj Twins crash must have left everyone in shambles.

Thankfully not to me. I have been avoiding Bajaj Fin. stock since 6 months due to his high pe ratio, debt.

@hstsethi
hstsethi / crop-sc-status-nav-bar.sh
Created December 19, 2024 04:38
Posix SH Script to bulk crop status and navigation bar from mobile screenshots using ImageMagick/GraphicsMagick
#!/bin/sh
## Date: 2023-05-13
## Author: HstSethi
## Usage: ./crop-sc-status-nav-bar.sh *.png # In my case mobile screenshots are in PNG rest in different
gm mogrify -gravity North -chop 0x50 -gravity South -chop 0x60 "$@"
@hstsethi
hstsethi / get-matrix-messages.sh
Created November 28, 2024 13:46
One Liner To Get Messages From A Matrix Chatroom
#!/bin/sh
# date: 2023-12-17
# author: HstSethi
curl -X GET "https://$client_url/_matrix/client/r0/rooms/$room_id/messages?dir=b&limit=50" -H "Authorization: Bearer $token"
# Replace dir b with f if you want to retrieve events from the start of that chat.