Ben Chuanlong Du's Blog

And let it direct your passion with reason.

GitHub API

Shell Command - gh

gh is GitHub's official command-line tool. Persoanlly, I'm not a fan of gh mainly because I'm not a fan of writing complicated (>10 lines) shell scripts.

Python Bindings - ghapi

  1. ghapi provides 100% always-updated coverage of the entire GitHub REST API by automatically converting the OpenAPI spec to a Pythonic API. ghapi is always up to date with the latest changes to GitHub APIs.

Hands on the Python Library pexpect

Tips and Traps

  1. The command-line tool of some (e.g., network) applications might be slow to authenticate. If you use pexect to automate such a command-line tool, it is best to wait for sometime after sending password using child.sendline(passwd). If the authentication has ouput on both success and failure, a smart way is to wait for the success or failure message to come out.

Install Rust Globally in Linux

There are 3 ways to install a global standalone version of Rust in Linux. The recommended way is to use rustup with customized environment variables.

Using a Package Management Tool

Some Linux distributions provide packages for Rust. Taking Debian/Ubuntu based Linux distributions as an example, you can install a …

Take Screenshot on Linux

ksnip

Ksnip is a Qt-based cross-platform screenshot tool that provides many annotation features for your screenshots. It is one of the best screenshot applications.

Installation Using snap

sudo snap install ksnip

flameshot

Flameshot is a simple cross-platform screenshot software.

Shutter

Shutter is a good screenshot application for Linux (only).