Thach Pham’s Notebook

A Software Engineer’s Practical Notebook
Computer Systems - Distributed Systems - Software Debugging

1. Computer Systems

1.1. Virtual Network Interfaces

Virtual Ethernet Interface (ip veth netns)
Virtual Bridge Interface (ip bridge netns)
Dummy Interface (ip dummy netns)
Bond Interface (ip bond netns)

1.2. Networking

Address Resolution Protocol (arp, arping)
IP Routing (ip route)
Dynamic Host Configuration Protocol (kea-dhcp4)
TIPC Protocol (tipc)
Virtual IP Address (keepalived)

1.3. Infrastructure

Preboot eXecution Environment (dnsmasq)
Lightweight Directory Access Protocol (openldap)
Distributed Replicated Block Device (drbd)

1.4. Administration

Kernel Virtual Machine (kvm)
Disk Manipulation (fdisk)
SystemD Management (systemd)


2. Distributed Systems

2.1. OpenSAF

Build & Install (make)
Setup Cluster    -   1 SC (opensaf cluster)
Setup Cluster    -   2 SCs (opensaf cluster)
Information Model Management (opensaf imm)
Software Management Framework (opensaf smf)
Log Service (opensaf log)
Convert Program to High Availability (amf non sa-aware)
Build High Availability Application (amf sa-aware)
Healthcheck (opensaf amf)


3. Debug

3.1. C/C++

Debug a Program Started by a Script (gdb catch)
Debug A Program Started by SystemD (gdb remote)
Debug a High Availability Program (gdb non-stop)
Find Memory Inside Running Process (gdb find)
Dump & Restore Process Memory (gdb dump restore)
Execute Functions on the Fly (gdb call)
Examine Contents of ELF File (gdb objdump)
Virtual Address & EFL Offset (gdb sharedlibrary)
Inspect C Stack with Assembly (gdb asm reg)
Print Contents of STL Containers (gdb pretty-printer)
Method for Printing Complex Data (gdb pretty-printer)

3.2. Bash

Walkthrough of Bash Script Execution (bashdb)

3.3. Linux Kernel

Build & Run Linux Kernel (kernel buildroot qemu)
Debug Linux Kernel (kernel qemu gdb)


4. Hack

Modify Return Values of Libc Functions (ld_preload dlsym)
Reproduce EAGAIN TIPC Socket Error (tipc overload socket buffer)


5. Tools

5.1. Diagram

PlantUML (uml)
Graphviz (dot)