Preface The mobile phone I'm using today is Motorola Edge+ 2023, an Android phone. To better customize my phone's functionalities, I unlocked its bootloader, and obtained root privileges, in order to install LSPosed and various LSPosed based plugins. The root mechanism I'm using is KernelSU , which works by modifying the Linux kernel to grant and only grant root permissions to certain apps. Although KernelSU provides official GKI kernel images that work on most phones, I also flashed LineageOS onto my phone, which is not compatible with GKI images. Therefore, I have to compile my own kernel. Since modifying the kernel's binary image is difficult, we usually obtain the kernel source code under the GPLv2 license from the phone manufacturer, modify it according to KernelSU's official guide ,...
![Illustration for Nix Trigonometric Math Library from Ground Zero](/usr/uploads/202309/trigonometric.png.thumb.png)
Nix Trigonometric Math Library from Ground Zero
(Title image sourced from: Wikipedia - Trigonometry ) Why I wanted to calculate the network latency between all my VPS nodes, and add the latency into the configuration file of Bird BGP daemon, so the network packets are forwarded through the lowest latency route. However, I have 17 nodes as of today, and I didn't want to manually run a ping command between each pair. So I came up with a solution: I can mark the latitudes and longitudes of the physical locations of my nodes, calculate the physical distance, and divide that by half the light speed to get the approximate latencies. I randomly sampled a few node pairs, and found that the Internet routing between them are mostly straightforward, with no significant detours. In this case,...