Home avatar

~ Happy Coding ~

Goodbye Google Analytics, Hello Umami

Recently, my open-source project AltGallery was recommended by a popular telegram channel iOS宝藏, and picked up lots of new stars on GitHub. I was glad to see it. Because of this, I also add a few things: a Chinese readme, AltGallery Web and Chinese translation. I was also curioushow many people actualy use it. GitHub Traffic only shows rough numbers like this; I wanted something more accurate.

网上配眼镜

最近在网上配了一副眼镜,感觉挺划算的,记录一下过程。

眼镜选择

目前品牌其实挺多的,贵的有蔡司,依视路,便宜的有万新,明月。我并没有调查所有的品牌,只是看了下市场占有率比较高的蔡司的泽锐和智锐,依视路的爱赞全晰,觉得应该满足要求,只看了这三款的价格。

Resources for Software Engineer Interview

Here are some resources I use to prepare for software engineer interview. I hope these resources will help you too.

LeetCode

LeetCode still plays a important role in the interview process, both in online assessment and onsite interview. I personally think the LeetCode can only test whether one has a good memory or fortune. It can’t judge whether one is a good engineer or not. Before LeetCode is replaced by AI coding interview, we still need to practice it. Here are some resources I found useful.

Control QNAP NAS Fan Speed in PVE

It’s getting hot in summer, the hard disks in my QNAP NAS are overheating. Since I’m using PVE, I can’t control the fan speed. Luckily, somebody has already solved this problem. Here is the guide.

Install the 8528 Kernel Module

First, install the 8528 kernel module to get the fan speed information. In Linux, you can install the lm-sensors package to get the CPU and HDD temperature. You can run sensors command to see the temperature. However, the fan speed information is not shown. As the QNAP uses a ITE8528 embedded controller to control the fan speed, the lm-sensors package does not support it.

Lazy Import in Python 3.15

Python 3.15 will be release in October 2026, and lazy import is my favorite feature. In general, we often import some modules in the beginning of the script, but we just use them in some functions. When performance matters, the global import will slow down the startup time. With lazy import, we can defer the import until the module is actually used.

Basic usage

1
2
3
4
5
6
7
lazy import json
lazy from pathlib import Path

print("Starting up...")  # json and pathlib not loaded yet

data = json.loads('{"key": "value"}')  # json loads here
p = Path(".")  # pathlib loads here

The syntax is pertty easy, just add the lazy keyword before import or from. After this, the module will be loaded when it’s first used. But you can’t use lazy in star import or future import. For example, lazy from module import * and from __future__ import xxx are not allowed.