Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Operate Remote Servers Using SSH

General Tips and Traps

  1. The permissions of the directory ~/.ssh and its subcontents on both the local machine and the remote server must be properly set in order for SSH login via public key to work. A good pratice is to set the permission of ~/.ssh to 700 (on both …

Manage Docker Images and Containers

  1. It is suggested that you use osquery or dockeree to query Docker images, containers, etc.

Remove Containers

Note that running containers will NOT be removed by default. This is what users want generally speaking. You can use the option -f to force removing running containers, but use it with caution …

Install Python in macOS

There are a few ways to install Python in Mac.

  1. Install system-wide via the official Python installation package.

  2. Install a Anaconda Python distribution locally.

  3. Install locally using Homebrew (recommended).

A few comments about different ways of installation.

  1. Avoid installing multiple versions of Python in your system. It usually brings more …

Docker in WSL 2

Tips and Traps

  1. Docker on WSL 2 works great. However, the performance of IO is extremely bad if it access the Windows filesystem. For more discussions, please refer to WSL 2 Filesystem .

  2. Docker containers launched from a WSL (e.g., Ubuntu) shell will continue to run after the WSL shell …

Convert PDF to EPS

There are tons of tools for converting PDF pictures to EPS pictures in Linux. The pdf2ps command is a good one. It produces EPS pictures without losing much resolution. The general purpose tools convert (from the ImageMagick package) does not produce as good quality EPS figures.

Schedule Cron Tasks in a Docker Container

Cron tasks work in a Docker container. However, you have to manually start the cron deamon (root or sudo required) using cron or sudo cron if it is not configured (via the Docker entrypoint) to start on the start of the Docker container. For tutorials on crontab, please refer to …