/images/avatar.png

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.

Installing 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. qnap8528 provides a kernel module to support this controller. Gzxiexl created a a more conventient script to build, install and automatically load the kernel module. This script does not support PVE 9 currently, but I’ve created a PR. Before it’s merged, you need to install the kernel headers with apt install proxmox-headers-$(uname -r) and edit the Dockerfile to use debian:13 as base image. Then you can run the sudo build.sh.

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

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.

Kindle Paperwhite 5 Review

I bought a Kindle Paperwhite 1 in 2013, when I still in the university. I like it very much and I’ve read many programming books with it. It still works fine after 10 years, but I want to tries the new model with larger screen and faster fresh speed. So I bought a used Kindle Paperwhite 5 signature version for only 620 Yuan (about $90) recently. Here is my review.

Namespace Package in Python

Recently, there is a GitHub issue about namespace package in Azure CLI. I think it is a good time to write down the knowledge about namespace package.

What is Namespace Package

If several packages share the same root folder, then the root folder is a namespace package. subpackageA and subpackageb can be installed separately, even in different Python path, but they can be imported as importing a single package: import root.

Run Synology in QNAP NAS with PVE

Three years ago, I bought a QNAP TS-453Dmini NAS. Although it has a slow WEB UI and slow restart, it still fits my needs as all of the applications I need are running in Docker.

Recently, I want to move some files from my Mac to NAS to save space. I need a application behave like Dropbox, which can show all the files in the NAS and only download the files I need. I have tried the QSync, but it does not have thumbnails for cloud image and it does not have icons to show the file status. I also tried the Seafile, it’s a powerful application, which requires 4G RAM to run, and there is bug in the thumbnail. I used to have a Synology ARM NAS, the Synology Drive has all the features I need, so I want to run it on my QNAP NAS. After some research, I managed to run Synology and QNAP together on my NAS. Here is the guide.