‹ Goodness Duru

TILS


Localhost Tunneling

Jan 30, 2025

I learned this because of an error. I assumed I couldn’t use http://localhost:[port-no] as a redirect URL when testing the app on my machine. I’m ashamed to say that even though I have written two articles on OAuth, I assumed something wrong. Thankfully, I gained new knowledge something for my error.

Before I corrected myself, I was using localhost.run. Using it requires SSH reverse tunnels. Localhost.run is a good service, but it caused a bug in my app. I needed an alternative.

It turns out that you can run SSH localhost tunneling on your computer. All you need to get a publicly accessible web application running on localhost is a server that is reachable from the Internet via SSH and a domain name/subdomain. Thankfully I had both! All I needed to do was set nginx reverse proxy on my server for the domain name to a particular port number (let’s say 20001) like this

server_name subdomain.domain.com;
.....other lines....
location / {
      proxy_pass http://127.0.0.1:20001;                                        # use a port that you like. 30000 is a good one.
    }
......other lines....

On my computer, I just needed to run ssh -N -T -R 20001:localhost:3000 user@my-machine -i /path/to/keys(my web app is running on port 3000). Like magic, it worked! As a bonus, I added TLS with Let’s Encrypt.

Alex Le’s article was a great help and I encourage you to read it.

Mozilla/5.0

Jan 01, 2025

While reading access logs of my web server, I noticed that almost all browsers’ user agent output started with Mozilla/5.0. I found that curious and decided to dive into the reason why.

It turns out that Gecko, the Firefox rendering engine started it. This was okay because that was Mozilla. Web developers liked Gecko and gave the good website code to it. When KHTML was created for Konqueror, they wanted some of that good code and added Mozilla/5.0 to its user agent string. Apple forked KHTML to create Webkit (Safari and old Chrome) and carried on the tradition. Google continued the tradition when they forked Webkit to create Blink (new Chrome and Edge).

It was interesting following the story. Just a series of newer browser engines seeking acceptance.

Tensor Cores

Dec 31, 2024

I had always thought that the difference between high end CPUs vs GPUs were between 3x to 20x. It turns out that I was totally wrong. Modern GPUs can have up to 100x better performance than CPUs on Machine Learning workloads. This is because of Tensor Cores.

Tensor Cores are parts of the GPUs that specialize in Fused-Multiply Add operations (a*b + c). These operations are common in Machine learning workloads.

I had always wondered why the idea of using lots of CPUs to replace GPUs in ML training and inference isn’t widely used considering the price differences. It turns out Tensor Cores are a big part of that.

Hugo Github

Nov 26, 2024

I finally deployed this Hugo based site on Github. It was surprisingly easy. All I had to do was follow the instruction on the Hugo website.

Adding a custom domain was easy too. You can’t go wrong following this Github documentation.

« Older posts Newer posts »