Matsu Kaliu

Last month, my wife and I spent about 2 weeks in Matsu, where time seemed to be frozen on the island. The pace was slow enough to ride a bike on the road at 25 km/hr without any other vehicles around, feeling the wind gently brush through the face.

I found it very correct to bring the book “Four Thousand Weeks” to Matsu. I slowly read this book during the travel. The book discusses the concept of “life is enough for everyone”, we just have to enjoy the moment and don’t blame ourselves too much.

Read More...




GPG AES 256 encrypt and decrypt

Encrypt

1
2
3
4
5
gpg --cipher-algo AES256 \
--no-symkey-cache \
--batch --pinentry-mode loopback \
--passphrase "STRONG_PASSWORD" \
--output ENCRYPTED_FILENAME --symmetric FILENAME

Decrypt

1
2
3
4
gpg --no-symkey-cache \
--batch --pinentry-mode loopback \
--passphrase "STRONG_PASSWORD" \
--output DECRYPTED_FILENAME --decrypt ENCRYPTED_FILENAME

Option explanation

If directly using gpg -c XXX and gpg -d XXX the gpg-agent will prompt the password asking dialog.

See GPG manual:

1
2
3
4
If this command is used with --batch, --pinentry-mode has been set to loopback,  and  one  of
the passphrase options (--passphrase, --passphrase-fd, or --passphrase-file) is used, the
supplied passphrase is used for the new key and the agent does not ask for it. To create a
key without any protection --passphrase '' may be used.

So just set it with --batch and --pinentry-mode loopback, then can use the --passphrase.

--no-symkey-cache to disable symmetric key cached and --cipher-algo to set algorithm.

Available algorithms can check by gpg --version.

Hope this save your time! :)



Screenshot of the week 2022/07/29

In the past week, I created a Pomodoro app! Built with next.js and Flask, custom components mimic iOS. Can save to home to launch as web app. It’s happy to build a self-used app! I can now collect my data for analysis!


Next.js shared repository component

These days I’m building several next.js apps and want to share some libraries. In the beginning plain js file without compile just work well. But when it comes to jsx component element with sass component-level module, next.js start to fail.

After several tries, I found a solution:

  1. Create shared package somewhere
  2. Use yarn link to link shared library
  3. Use next-transpile-module to transpile library
  4. Tada!

Read More...


Dyslexia

Yesterday, I met a friend who is incapable of reading Chinese fluently. When he reads, each word is bumping with random wrong orders, so he must pause at each word to understand the meaning. When watching Netflix, it’s impossible for him to read the subtitle, so he has to watch with Chinese dubbing. That is so-called Dyslexia, which affects 3 ~ 7% of the population, and up to 20% have some degree of this disability.

Read More...


JLPT N4

Yesterday I finally took the JLPT N4 exam. It takes me about 100+ hours to study and prepare for this exam this year. I once tried to learn Japanese in my 100 days challenge last year but failed, so this year I set the JLPT N4 as my annual goal.

I don’t have Japanese basic, every time I restart my Japanese study program I almost re-learn the 50 sounds Hiragana and Katakana. Online resource has less systematic, so this time I start with 大家學標準日本語, 3 volumes from easy to hard.

Read More...


蛋白質和熱量

一開始計算蛋白質量的時候,會純粹只看蛋白質多寡

比如說雞胸肉一塊 20g,蛋一顆 7g 之類的

但是這樣其實忽略了蛋白質本身的含量比例

比如說牛肉要吃到 20g 蛋白質,那獲取的脂肪也會要很多

同樣 10g 蛋白質,300ml 無糖豆漿和牛奶都可以,不過無糖豆漿熱量少了一半

蛋白質的熱量佔總食物熱量,這個比例是很重要的!!!

不知道為什麼這個觀念比較少在網路上看到。

附上我自己整理 一些常吃食物的紀錄營養表,有按照蛋白質含量排序。

Read More...