
Hello! This is crupest
!
Welcome to my home page! Nice to meet you here! 🥰
If you have something interesting to share with me, feel free to email me at crupest@crupest.life. You can also create an issue in any of my repos on GitHub to talk anything to me.
Recent Posts (all)
Use systemd-nspawn to Create a Development Sandbox
systemd-nspawn is a great tool for creating development sandboxes. Compared to other similar technologies, it’s lightweight, flexible, and easy to use. In this blog, I’ll present a simple guide to using it.
Advantages I’ve been using traditional VMs and Docker for creating development environments. While both work fine, regardless of the performance, they suffer from being overly isolated. Two big headaches for me are host network sharing in traditional VMs and the immutability of Docker container ports and mounts.
systemd-nspawn is much more flexible. Every feature can be configured granularly and dynamically. For example, filesystem sharing can be configured to work like bind mounts, and network isolation can be disabled entirely, which exactly solves the two headaches mentioned above. Additionally, being part of systemd, it has the same excellent design as other systemd components.
Debian has a similar powerful tool called schroot. It is the official tool for automatic package building. Unfortunately, it seems to be a tool specific to Debian.
Usage systemd-nspawn consists of two parts that work together to achieve its VM functionality:
... Read more
Libc/POSIX Function "Extensions"
Recently, I’ve been working on porting libraries to GNU/Hurd. The maintainers of GNU/Hurd have a strong belief that *_MAX macros on POSIX system interfaces are very evil things. This is indeed true as a lot of (old) libraries relying on those macros to determine the buffer size. In modern programming world, it is definitely a bad idea to use fixed values for buffer sizes without considering possible overflow, unless you are certain that size is sufficient.
When you get rid of some old things, you will always meet compatibility problems. In these case, old source codes using these macros just do not compile now. So here are some
... Read more
Use PaddleOCR
I guess OCR is not something new for us. While there are a lot of open source artificial intelligence engines to achieve this, I need a easy-to-use one.
Recently I got a task to convert images into text. The image number is fairly big. So it’s just impossible to OCR them one by one manually. So I wrote a python script to handle this tedious task.
Basic Processing The original images contain a identical useless frame around the part that I need. So a crop is required because it will improve the performance (of course, the image is smaller) and there are unrelated texts in the frame.
Cropping is a easy problem. Just install Pillow package with pip:
1 pip install Pillow Then use Pillow to do the cropping:
... Read more
My Friends (more links are being collected ...)
Always Remember
Die Philosophen haben die Welt nur verschieden interpretiert, es kömmt aber darauf an, sie zu verändern.
Translated from German: The philosophers have only interpreted the world in various ways, the point is to change it.