Note: The basic usage of Systemd

Systemd is a system and service manager for Linux. In this post, I will document its basic usage. Check if it is installed, or its version in your machine 1 systemctl --version Yes, systemd providers the systemctl command. We always use the systemctl command to deal with our service. The Man page 1 man systemd You can type this command in your Linux server to find the document of systemd

Docker Compose 控制容器启动顺序

在使用 Docker Compose 编排容器时,就涉及到容器启动的先后顺序。 比如一个Laravel应用,需要用到 PHP/Nginx/Mysql/Redis, 那么肯定是需要先启动 Mysql/Redis,然后才是

Tip: Multiprocessors in Shell

Last week, I need to compress more than 20k png pictures in Shell. By use the optipng, it’s easy to do. There command in Shell like this: 1 optipng *.png --dist ./dist But I need to deal with more than 20k pictures, if I use the command above to compress pictures one by one, it’s too slow! So I think, Is there anyway to use multiprocess to speed up? The shell language seems not to provide APIs to deal with multiprocess programming.

The Intel Nuc is a perfect hackintosh machine

I have been using a Macbook Pro 2015 since 2016. It is equipped with 8G of memory, and with a 2.3GHz Intel i5 dual-core processor. Nowadays, it’s a bit out of date. Although it runs a bit slow, and the battery has also decayed, but it is still good for me when I do some lightweight tasks such as write PHP or front-end code. Since October last year, My company started a new project which using Java and Microservice architecture (by spring family).

The environment variable CDPATH

As all *unix system users know, we have a set of environment variables. The most famous is ‘PATH’ which contains a series of directories. When we type a command in the shell, the shell will find each of the directories to find out if there is an executable program named the command we typed. So, what is CDPATH? We all know, cd is a basic command to navigate between directories. When we type cd some-directory, it means that if the current directory has a subdirectory called some-directory, we want entry it.