Hi everyone, Welcome to issue #172.
This week, I want to introduce starship again. I linked to it in issue 119. Recently my zsh prompt is too slow. I want to have all information like git repo, kube context, cli version etc but I also do not want my prompt takes a few seconds to load. Switching to starship makes it run faster. You also deal with nice config language instead of shell :-).
The Hitchhiker’s Guide to Compression
We used compression every day, in tar, gzip, zip files. What is the exact algorithm to power them?
Today, much of the relevant work to compression is in an obscure corner of the internet between lengthy PhD thesis papers and hard-to-find gems.
Bot Protection with HAProxy
Eventually any large-scale website will have to deal with bot, crawler, who usually just consume your resource without bringing any benefit. How we prevent them?
HAProxy may not well-know like Nginx because it only does load balancing, cannot do static file servering like Nginx. But it does its job very well and supports many primitives for advanced load balancing such as rate-limiting, which is helpful when dealing with bots.
JQuery to React: How we rewrote the HelloSign Editor
DropBox rewrite and 12,000 loc from jQuery to React to solve an issue of rendering pdf different between 3 places.
The lesson is: Don’t fix it in UI, fix what’s behind it. A software engineer’s job is not to write code, it’s to solve problems, by writing code when necessary.
PostgreSQL at Scale: Saving Space (Basically) for Free
A technique that saved BrainTree payment approximately 10% of disk space with very little effort beyond existing processes. In short, carefully choosing column order when creating a table can eliminate padding that would otherwise be needed.
Mastering PostgreSQL Administration(PDF)
This talk is designed for PostgreSQL administrators. It covers all aspects of PostgreSQL administration, including installation, security, file structure, configuration, reporting, backup, daily maintenance, monitoring activity, disk space computations, and disaster recovery. It shows how to control host connectivity, configure the server, find the query being run by each session, and find the disk space used by each database.
Coping with the TCP TIME-WAIT state on busy Linux server
The Linux TCP stack is a finite state machine. So when closing a connection, 2 sides need to coordinate so the state can be advanced.
TIME-WAIT is when the local server close the connection already, the connection is kept around so that any delayed packets can be matched to the connection and handled appropriately. It also helps the remote side know that the connection is closed, so remote can close as well otherwise it is stuck in LAST-ACK state. And it exit this state in 4 minutes.
Needless to say, keeping these around on a busy server is expensive, you need CPU, memory to handle them.
When fonts fall
Have you ever receive a message with square or question mark character while it shows up fine on sender side?
Font fallback is just complex, filled with quirks and unexpected side effects.
Font enthusiast Marcin Wichary decided to dig into the issue and prepare an exhaustive guide to font fallback, its beauty, and all the pitfalls.
A guide to writing a DNS Server from scratch in Rust
Writing DNS server is like hello world for networking to me. DNS is small enough, not massive like HTTP, also relying on UDP, so I think it’s a good exercise to learn UDP and the DNS protocol.
The language is Rust, despite that I’m not a Rust programmer, I only toy with Rust and I was able to follow just fine so I think you can do the same and learn a few thing about Rust and DNS at the same time.
How to Fix PostgreSQL Performance Issues with PG Extras
PG Extras is a tool that allows you to spot common PostgreSQL pitfalls. Ruby, Rails, Elixir, and NodeJS implementations are currently available.
In this blog post, I present a step by step guide on using PG Extras library to spot and resolve common PostgreSQL database performance issues.
Code to read
Parser combinator library for Ruby inspired by Haskell’s Parsec
High performance (de)compression in an 8kB package
A SQL database implemented purely in TypeScript type annotations.
An optimized and cryptographically provable key-value store. Written in C.
A proof-of-concept for WebRTC signaling using sound. Works with all devices that have microphone + speakers. Runs in the browser.
Generate HTTP load and plot the results in real-time
Wireflow - user flow chart real-time collaborative tool
a build automation tool for the post-container era. It allows you to execute all your builds in containers. This makes them self-contained, reproducible, portable and parallel.
Build and deploy Go applications on Kubernetes
measures and compares the execution time of one or more SQL queries.
Copy tabular data between databases, CSV files and cloud storage
A Real-Time Website Privacy Inspector. Open source on Github if you want to see how they peform scanning.
Disk Usage/Free Utility. Kind of like htop but for your du/df.
That's it for this round, have a great day! If you like this newsletter, please tell the world, or
tweet about this