Ben Chuanlong Du's Blog

It is never too late to learn.

Parse TOML Files in Golang

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Tips and Traps

  1. If the schema of a TOML file is unknown, you can parse it into a generic object (any or map[string]any). When parsing a TOML file into a generic object, map

Tips on Hyper

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Awesome Hyper

Themes for Hyper

verminal is good one

General Tips

  1. Updating the environment variable SHELL (using the command chsh) to change the default shell doesn't work for Hyper. You have …

Tips on Multipass

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

Multipass vs LXD

  1. LXD supports both containers and VMs while multipass supports only (Ubuntu) VMs.

  2. LXD is more lightweight compared to multipass.

  3. LXD does not require CPU virtualization while multipass relies …

Bash Equivalent of the ifmain Pattern in Python

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

#!/usr/bin/env bash

function install_icon.usage() {
    cat << EOF
NAME
    /scripts/sys/install_icon.sh - Download and install icon to /usr/local/bin/.
SYNTAX 
    /scripts/sys/install_icon.sh [-h]
EOF
}

function install_icon …

Format a Disk on Linux

Things on this page are fragmentary and immature notes/thoughts of the author. Please read with your own judgement!

  1. Locate the right disk to operate on. A few commands might help you. For example, you can use the command ls /dev/sd* to list all hard drives and the command …