Ben Chuanlong Du's Blog

And let it direct your passion with reason.

Configure SSH to Use a Proxy Server

Suppose you have a production server that you want to visit via SSH, however, it is not accessible directly. Instead, you have to visit it from a bastion/proxy server. You can configure SSH to use the bastion/proxy server when visiting the production server.

Host <production_server>
ProxyCommand ssh <proxy_server …

Copy SSH Public Key Using "ssh-copy-id"

You can use the following command to copy your SSH public key to a Linux server.

ssh-copy-id -i ~/.ssh/id_rsa.pub host_machine

However, if a Linux server runs the SSH deamon on a non default port (default is 22), you have to specify the port with option -p port. In …

Read CPU Temperature in Linux

First you have to install package "lm-sensors".

wajig install lm-sensors

To detect the cpu temperature, type the following command.

modprobe coretemp
sensors

For more instructions on this top, see nixCraft.

Compare Two Directories on Linux

On the Same Machine

If the two directories are on the same machine, you can use either colordiff (preferred over diff) or git diff to find the differences between them.

colordiff -qr dir_1 dir_2
git diff --no-index dir_1 dir_2

On Different Machines

It is a little bit tricky when the …