small nitpicky things i learnt: some from docs, some from random rabbit holes, some unfortunately from things breaking at 2am.

git doesn't track empty directories

add a .gitkeep file inside to force git to include the folder. warna it’ll just ignore the folder and doesn’t even show up in untracked files.

vaultwarden uses ~10mb ram vs bitwarden's ~150mb

it’s a rust reimplementation of the bitwarden server API, compatible with all official clients. perfect for self-hosting on a raspberry pi or a small VPS.

python operator :=

:= is also called walrus operator (eyes and teeth). very fun.

completableFuture java

CompletableFuture is a structure in java which takes in a bunch of tasks, divides up and performs all of them simultaneously and asynchronously and also has a mutex where they all reach after finishing their tasks. In this way, we don’t need to handle their states. neat stuff.

cloudflare tunnels and non-tcp packets

cloudflare tunnels is only good if you want to send tcp related packets like serving a website or api or db or anything else. You cannot do game streaming or media streaming through it as they are udp and you’ll actually get banned by them as it is against their privacy policy. found that out the hard way. ouch.

ETL vs ELT

in ETL (extract -> transform -> load), you transform and do changes to the data before it lands in the warehouse. in ELT (extract -> load -> transform), raw data lands first in the warehouse, then you transform it inside the warehouse using SQL. ELT is dominant now because modern warehouses like BigQuery, Snowflake and Databricks are cheap at compute. it also means you keep the raw data and can transform differently later without re-ingesting.

EXPLAIN ANALYZE vs EXPLAIN SQL commands

EXPLAIN shows the path the sql query will take and the estimated time and costs of this query in a production setup db. EXPLAIN ANALYZE actually runs the query and shows real timings, but still is not final; kind of a dry run. always using ANALYZE would be accurate when debugging slow queries, as EXPLAIN query estimates are often wrong on large databases.

tailscale is built on top of wireguard

wireguard handles the encrypted tunnels between devices, while tailscale handles peer discovery, key rotation, and NAT traversal.

docker build cache breaks on different order in Dockerfile

In Dockerfile, the order in which you write copy commands matter for faster build times. copy package.json and run npm install before copying the rest of the source code with COPY . .. then it only builds the file changes and doesn’t build node_modules until there is a change in package.json

bad

COPY . .
RUN npm install #builds node_modules everytime there is file change too, instead of only during dependencies change

good

COPY package.json package-lock.json ./ # only for dependencies
RUN npm install
COPY . .

always use lazy regex instead of greedy regex

lazy regex looks for shortest matching substring and stops at the first matched substring. greedy regex scans the whole text and returns the longest matching string. For the word hello, the greedy regex h.+l matches hell but the lazy regex h.+?l stops after matching hel. Generally, lazy regex has ? in them.

ssh local port forwarding with -L

ssh -L 5432:localhost:5432 user@server => forwards the port from the remote machine to your local machine. you can then connect with any local client as if the service running at the port were running locally, provided that port is free. helped me in configuring port forwarding through my ISPs webiste when im offsite.

snowflake default location

..is us-west-2(Oregon). the <host> part of a snowflake request link, is composed of <account-name>.<region>.snowflakecomputing.com. If there is a link called gregheffley.us-west-2.snowflakecomputing.com, it defaults to gregheffley.snowflakecomputing.com

git log --oneline --graph

shows the branch/merge history as an ascii tree, same like how it shows in an ide. handly if you’re sshing into a machine and want to visualise quickly without connecting to an ide. or maybe not.

bunny hopping(bhop) in mice

in most games where speedrunning is common, there is a movement tech in the game where a player can jump the second he hits the ground after jumping to gain additional speed(strafing). this way, the character keeps on hopping and gaining speed, this called bunny hopping. generally, you need to be very precise about this and time the jump button at the correct time the character hits the ground, so speedrunners came up with a genius solution to bind the jump button to the scroll wheel of the mouse. This way, they can keep scrolling and never have to worry about mistiming as it gives multiple inputs per tick. This became so popular with logitech mouses since some of them have infinite scroll wheels so they can keep on spinning, so much that Logitech officially added a BHOP mode to their firmware. cool stuff.

flatpakref vs flatpak

a flatpak file is a containerised application made to run on gnu/linux machines. a flatpakref file is the dame as a flatpak file, with the addition of an app id in the flathub store, metadata of the app in the flathub store, and a key for verification. that way, the app installed through flatpakref can always stay updated when we go to the store, instead of app through flatpak which needs to be manually updated.

ssh requests gss api

There is an attribute in ~/.ssh/sshd_config called GSSAPIAuthentication, which sometimes defaults to yes. This means the Generic Security Service(GSS) API is tried for a handshake by ssh before trying the normal password authentication method. Most of the machines don’t have this setup with this protocol(called Kerberos, mostly common in high performance computing clusters)and it can take a long time to fail, the client to time out and fallback to the password-based auth. So whenever you are facing a long delay in ssh connections, check if GSSAPIAuthentication is set to no or not. that’ll fix it. i faced it while cloning a git repo from forgejo through ssh.

taylor swift's ridiculous trademarks

did you know that taylor swift actually trademarked the number 1989 in her song party like its 1989 for musical purposes? and also the word this sick beat for any kind of music? funny part is, she was born in dec 1989; god knows what kind of party it is. patents are stupid.