I am a big fan of making my applications as light as possible and that means taking advantage of their service dependencies. For me, that looks like pushing as much data handling as possible to the database (usually Postgres) and letting the reverse proxy (usually Nginx) handle whatever network tasks it can. I read this article on fake Googlebots and I was curious about how to use Nginx to block…
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…
I wanted to add a few custom template functions in my first Go web application, which I’m currently building. Something like this // Setup template funcMap := template . FuncMap { 'trim' : strings . Trim , } customTemplate := template . Must ( template . New ( 'test' ). Funcs ( funcMap ). ParseFiles ( 'views/base.html' , 'views/submit.html' )) . . // Call template d := ... . customTemplate .…
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…
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…
My friend and I have been taking some performance engineering courses. One thing we’ve come to realize is how important calculating the maximum Floating-point Operations per second (FLOPs) of a CPU is. It turns out this is a little trickier than it looks. This is a formula I use to calculate this value. The formula is number of cores * peak cpu speed * (max SIMD register size/32) * (fma…
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 .
I’ve encountered several mentions of Wireguard on the net without being curious about its inner workings. I’ve come across multiple mentions of VPNs on the net without (again) ever being curious about their inner workings. This year, I decided to be curious about it. Since Wireguard has been touted as a simple VPN protocol and implementation, it seemed the perfect gateway to finally…
This is a list of things I learned from building the Postgres-redis extension for Postgres in Rust. A retrospective design and implementation article, this is not. It is written here . Building this extension opened my eyes to some of Postgres’s design details and Rust tricks. The things I learned might be ordinary and widely known, but I learned about them on this project. Here’s what…
In the previous article, I wrote about the Shared Memory IPC mechanism. In this article, I will write about a similar IPC mechanism called Memory Mapped Files. To fully understand this article, you’d need to understand virtual memory, which I covered in the Shared Memory article. Let’s talk about how mmap IPC works.
In the previous article, we covered the Message Queues IPC mechanism. This article will cover another one called Shared Memory. Before discussing shared memory and how it can be used for IPC, we must know why such a thing as “Shared Memory” exists since we know that all the processes share the RAM they should be sharing memory. The thing is, they share and don’t share. This…
In the previous article, we covered Unix Signal and its usage for IPC. An implementation of a popular asynchronous communication pattern will be covered in this article.
In the previous article, we covered Unix Socket and how it can be used for Inter-Process Communication. This article discusses a different and limited form of IPC. In the IPC mechanisms we’ve looked at and most other mechanisms, when an application process sends a message to another, an action is taken by the receiving process depending on the message received. The message will most likely…
In the previous article, We discussed the Named Pipes mechanism to achieve Inter-Process Communications. This article will cover another one called Unix Domain Sockets. Sockets are the Unix abstraction of networking. When we think of networking, we imagine communication. The tools that make up the internet are majorly concerned with creating and maintaining communication pipes between computers.…
In the previous article, We introduced Inter-Process Communication and its different mechanisms. We’ll start with the first, Named Pipes or FIFO file! Named pipes are a mechanism that builds upon the structure of anonymous pipes. Your regular Unix pipes are actually Anonymous pipes. To understand named pipes, we need to understand anonymous pipes.
This is part two on how to write an OAuth client and server. If you have not read Part One yet, you should take a look at it. This post covers a lesser-known part of OAuth, which is console-based app authentication. You’ve probably seen it in action with the gcloud and heroku apps. Console-based app OAuth generally follows the same flow as that of a web app (auth code flow) with a few…
OAuth ( O pen A uthorization) is an open standard for access delegation, commonly used for internet users to grant websites or applications access to their information on other websites without giving them the passwords. It’s quite a mouthful, right? That’s the definition from Wikipedia for the specification behind the Login With Facebook , Login With Google , and Login with [Fill In…
This post is for those who are interested in the internal details of the BitTorrent protocol. This post contains all that I’ve learnt about building a BitTorrent Client with C. It’s not a replacement for the BitTorrent Protocol spec. You can find the official spec here though this is not as detailed and thorough as the unofficial spec . I advise you to read both of them for a more…
I mainly build stuff to try out different tools and technologies. The following projects were made for this purpose. A browser-only RSS Reader I love RSS! In other to understand it better, I decided to build a client. This client works entirely in the browser. You can even read already-fetched articles offline. The app’s server component exists only as a CORS proxy. All the main processing…