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.

Use Safeincloud instead of 1Password

Some years ago, maybe 2015 or 2016, I bought the 1Password 6 as my password manager. It’s perfect for me to store passwords. Soon after, they changed the price from the single version license model to the subscription model. In the subscription model, you can sync your data with their servers, and could share data with your family or teams. But I prefer to sync data on my own. I buy the office 365 family plan every year with my friends, the Onedrive is good enough for me to sync data between devices.

MySql bing log 简单笔记

上周工作上发生了一次"不可思议"的数据丢失问题,应该存在的数据却不见了,最后通过MySQL bin log 日志成功找了回来。之前只是