Rust - Cargo Workspaces

This is an example of creating a workspace got from rust offical doc. Create workspace directory. 1 2 $ mkdir add $ cd add create the adder binary crate Add member adder in Cargo.toml 1 2 3 4 5 [workspace] members = [ "adder", ] Generate code by using cargo new 1 2 $ cargo new adder Created binary (application) `adder` package Create the add_one library crate Add member add_one in Cargo.

Arch Linux - systemd/Timers

Timers have built-in support for calendar time events, monotonic time events, and can be run asynchronously. Timers are systemd unit files with a suffix of .timer. For each .timer file, a matching .service file exists (e.g. foo.timer and foo.service). The .timer file activates and controls the .service file. As a cron replacement Timers can be used as an alternative to cron. Here is going to present an example to show how to create a daily running job.

Linux - Check service status and logs (systemctl & journalctl)

systemctl status service-name journalctl -u service-name.service systemctl status 1 2 3 4 5 6 7 8 9 10 11 ➜ systemctl status nginx ● nginx.service - A high performance web server and a reverse proxy server Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: enabled) Active: active (running) since Wed 2022-01-10 15:00:35 XXX; 30min ago Docs: man:nginx(8) Main PID: 754 (nginx) Tasks: 2 (limit: 835) Memory: 10.

Arch Linux - Clean the system

In this article, we're going to learn how to Clean package cache Remove unused packages (orphans) Clean the cache in our /home directory Remove old config files Remove duplicates, empty files, empty directories and broken symlinks Find the largest files and directories Clean Systemd journal NOTE that we may need to backup our linux system before the cleaning work.

Linux - Clear Or Flush DNS Cache

DNS Cache (or DNS resolver cache) is a small temporary database maintained by the operating system. It stores the information about all visited websites and other internet domain. In other words, the DNS cache stores recent DNS lookups. Firefox clear DNS Cache change config network.dnsCacheExpiration about:config, click "I accept the risk!" search for “network.dnsCacheExpiration” -> change it from 60 to 0 about:networking#dns about:networking#dns about:config - network.

Arch Linux - Install Rust

On Arch Linux there are two choices for installing rust. Using pacman supported by Arch Linux Using rustup officially supported by Rust pacman Install Install the rustc compiler and Cargo 1 sudo pacman -S rust Uninstall 1 sudo pacman -Rcns rust rustup Install Download rustup and install rust.

Emacs

Dired C-x d dired C-x 4 d dired-other-window C-x 5 d dired-other-frame C-x C-d list-directory C-x C-f find-file C-x 4 C-f find-file-other-window C-x 5 C-f find-file-other-frame wildcard 1 C-x d ~/**/*/*.el RET Deleteing files with Dired d Flag this file for deletion (dired-flag-file-deletion).

Cosmos SDK based Blockchain Transaction Lifecycle

In this article, we'll majorly talk about the transaction lifecycle and try to explain how the nodes create, transfer, validate and commit transactions in the Cosmos SDK based blockchain. Blockchain Node Basic structure First let's look at the basic structure of the Blockchain node. The cosmos-sdk-based blockchain node consists of two parts, one part is state-machine as an application layer, and the other part is Terndermint core which contains a consensus layer and a networking layer.

Heap Sort

Heap sort is a comparison-based sorting by using max-heap or min-heap. max-heap and min-heap A max-heap is a complete binary tree in which the value of each internal node is greater than or equal to the values of that node's children. Same as max-heap, but in min-heap, the value of the parent node is lesser than or equal to the values of the children nodes. As a complete binary tree, we can represent the max-heap or min-heap as an array.

Hugo Nginx Cerbot(Let's Encrypt)

Here we're going to build secure https website by using Hugo, Nginx, and Cerbot(Let's Encrypt). Hugo Install In most distributions of Linux we can just use one command to install hugo, take examples here for Debian/Unbuntu and Arch Linux here 1 2 3 4 5 # Debian and Ubuntu sudo apt install hugo # Arch Linux sudo pacman -S hugo For more details: https://gohugo.