Posts

How to Add Code Highlighting to Blogger Without Plugins

Most rich-text editors offer a feature that allows you to select specific content and format it as a code block, often with syntax highlighting. However, Blogger's built-in post editor does not provide this functionality, and I really needed it for my technical blog. So, how could I implement code highlighting in Blogger without replacing the existing editor? I initially came up with two ideas: Switch to a different rich-text editor. Add a code block feature to the existing editor. The best solution would have been to replace the editor with another rich-text editor. Unfortunately, Blogger does not provide an option to switch between different editors. The second option was slightly less ideal: modify the existing editor's source code to add a code block button and the logic required to display syntax highlighting. Unfortunately, Blogger does not provide a way to directly modify the editor's source code either. Both approaches had reached a dead end. I asked AI for alternat...

How to Fix PHP 8.2 Fileinfo Installation Failure on Baota (BT) Panel

1. Problem Background Server Environment Item Configuration Operating System Ubuntu 22.04 CPU 2 cores Memory Approximately 2 GiB PHP PHP 8.2.x PHP Build Type NTS Management Panel Baota (BT) Panel PHP Installation Directory /www/server/php/82 Fileinfo Source Directory /www/server/php/82/src/ext/fileinfo The server has limited memory. When installing the PHP Fileinfo extension directly through the Baota panel, the compilation process fails. 2. Error Messages During the Fileinfo installation process in Baota, compilation gets stuck at: libmagic/apprentice.c The following error may then appear: cc: fatal error: Killed signal terminated program cc1 compilation terminated. Eventually, the following error occurs: make: *** [Makefile:xxx: libmagic/apprentice.lo] Error 1 Alternatively, Baota may simply report that the Fileinfo installation failed. 3. Root Cause Although this error appears to be a C compilation error, the actual problem is not necessarily an issue with the Fileinfo source code i...