>

Posts

Docker and Docker Compose Installation Guide on Arch Linux

Motivation Once upon a time, I was trying to install Docker and Docker Compose on my Arch Linux machine. At the time I was using Manjaro, but I think the installation process is the same for Arch Linux-based distros and Manjaro. So I decided to write this article to help me remember how to install Docker and Docker Compose on Arch Linux. Luckily now Docker supports Docker desktop for Linux, so the installation process is much easier than before.

Unordered Notes on Compiler Research

Motivation Recently I’m trying to learn about compilers and programming languages. I want to know how compilers work, how to build a compiler, and how to design a programming language. Therefore, I read some books and papers about compilers and programming languages. I want to keep track of my knowledge and research, so I decided to write this notes. Maybe it’s a very long journey, but I hope I can finish it.

LSM Tree vs B+-Tree

Motivation Recently, Im trying to build a database from scratch for my own, mainly for practicing my Rust skill. In the book I’m following, the author mentioned two types of data structure for storing data in a database: B+-tree and LSM-tree. I want to know the difference between them and which one is better for my database. So I decided to write this article to help me understand the differences and keep track of knowledge and research.

Async building blocks

Differences between async & sync sync programming often has imperative behaviour (hành vi bắt buá»™c, sai khiến) async programming is about constructing a process at runtime and then executing it this process is called the “futures tree” Futures An async fn returns a Future async fn returns a Future type Future is a trait that is implemented by types that can be asynchronously awaited For e.g., this following async fn returns a Future type: use tokio::{fs::File, io::AsyncReadExt}; async fn read_from_disk(path: &str) -> std::io::Result<String> { let mut file = File::open(path).

Debugging Rust code

Debugger (LLDB and GDB) Basically there are 2 debuggers to choose from: LLDB and GDB. LLDB is part of LLVM, which is a set of compiler tools, and GDB is part of the GNU project. If command line is your flavor, you can use rust-gdb. If you use a IDE like VSCode, LLDB is an easy choice. Setup GDB on the command line Rust comes with a command line tool called rust-gdb, which is described here.

eBPF - What is it? WH-questions

Simplify eBPF architecture -- the visualization of eBPF architecture Before being loaded into the kernel, eBPF prog MUST pass a certain set of requirements. Verification involves executing the eBPF program within the VM. Doing so allows the verifier, with 10,000+ lines of code, to perform a series of checks. The verifier will traverse the potential paths the eBPF program may take when executed in the kernel, making sure the program does indeed run to completion without any looping that would cause a kernel lockup.

Interior mutability in Rust - Thread Safety

Single thread Multiple threads Copy value Cell Atomic* Non-copy value RefCell RwLock, Mutex Ref counter Rc Arc References https://ricardomartins.cc/2016/06/08/interior-mutability

setuptools python issue FileNotFoundError: [Errno 2] No such file or directory: ‘requirements.txt’

Root cause It’s caused by the fact that build is copying files to a temporary directory first. But it’s only copying the source/, README.md, setup.py, setup.cfg. It’s not copying requirements/. Solution build does the correct job here. After building the source dist, it checks whether the built result can be actually installed. And without including the files under requirements into the source dist, the source dist can not be installed and is thus unusable.

hnidoaht-101

A 🦀 love open sources. Actually just a pet lover with passion to build the nice things.