Hongmu Notes
Home Summary of pitfalls

Summary of pitfalls

A summary of common mistakes encountered when building websites... This list isn't exhaustive; it merely records the issues I faced during my own development projects.

fidder Grasp the package https link, and the plaintext parse

fidder Grasp the package https link, and the plaintext parse Summary of pitfalls

In the tool here, choose https, install the certificate, you can grab the plaintext https content.
👁 67
MySQL Cursor Query: Say goodbye to slow pagination with `WHERE id> last_id`

MySQL Cursor Query: Say goodbye to slow pagination with `WHERE id> last_id` Summary of pitfalls

When developing applications that handle large volumes of data, it is often necessary to iterate over an entire table for data processing tasks—such as generating sitemaps, exporting data, or performing batch updates. The most common approach is to use LIMIT/OFFSET/SIZE pagination queries. However, when the offset value becomes very large, the query performance degrades significantly, which can even lead to timeouts or a surge in server load. This article introduces a simple yet highly efficient...
👁 164
PHP storage class for DB databases

PHP storage class for DB databases Summary of pitfalls

Create a backup. After researching Bloom filters, it became clear that this approach can handle large datasets and high traffic volumes even for small websites. At its core, it still utilizes text caching – trading inexpensive disk space for costly memory resources. The results are decent; just use it for backup purposes? <br/> PHP: /** * SQLite Database (separated; intended solely for backup or compatibility with legacy code) * If you wish to use it, please manually include this file */ // Define the cache database directory if (!defi...
👁 170
PHP can be executed periodically using the PaTa server or run from the command line.

PHP can be executed periodically using the PaTa server or run from the command line. Summary of pitfalls

这是一个用于在宝塔面板计划任务中自动执行 PHP 迁移脚本的 Bash 脚本.其主要功能是确保迁移脚本只运行一个实例,避免重复执行,并将执行过程和结果记录到日志文件中.#!/bin/bash # 自动迁移脚本 - 配合宝塔计划任务使用 # ===== 配置区域 ===== PHP_PATH="/ww...
👁 127
The command-line command to terminate a PHP process on Linux

The command-line command to terminate a PHP process on Linux Summary of pitfalls

1. Identify all PHP processes: Run `ps aux | grep php`. You will see output similar to the following: `root 197372... php /www/wwwroot/.../1.php` or `root 197928...`. Use `grep--color=auto php` to find the PID of the process associated with `1.php` (e.g., 1973...).
👁 130
Block unnecessary web crawlers from accessing your website by modifying the robots.txt file.

Block unnecessary web crawlers from accessing your website by modifying the robots.txt file. Summary of pitfalls

I created a small website that was constantly being crawled by search engines. As a result, I wrote a robots.txt file to block all unnecessary web crawlers. This was the first step. User-agent: DotBot Disallow: / User-agent: SemrushBot Disallow: / User-agent: SiteAuditBot Disallow...
👁 153
How to block specific web crawlers on a website? How to block GPTBot or ClaudeBot crawlers?

How to block specific web crawlers on a website? How to block GPTBot or ClaudeBot crawlers? Summary of pitfalls

Recently, our website has been overwhelmed by a surge in crawls from two types of spiders—GPTBot and ClaudeBot. Our servers have been running at high load throughout the entire day (over the course of a single month, we've received 7 TB of traffic—absolutely insane!). After reviewing the access logs, we discovered that these two spider types were the source of the issue. As a result, we devised a solution to block them: simply integrate the following code into our website's pseudo-static routing system – if the request originates from GPTBot or ClaudeBot spiders...
👁 143
How can I use the nvm command in VSCode's terminal when it doesn't work directly?

How can I use the nvm command in VSCode's terminal when it doesn't work directly? Summary of pitfalls

NVM is installed on the computer, but it doesn't work when used within VS Code. PS D:\phpstudy_pro\WWW\news> nvm-v nvm: Cannot recognize the item "nvm" as the name of a cmdlet, function, script file, or executable program. Please check the spelling of the name; if the path is included, ensure the path is correct and try again. Location: Line: 1, Character...
👁 136
I've written an HTML file for office document processing, designed to handle the segmentation of AI-generated office texts.

I've written an HTML file for office document processing, designed to handle the segmentation of AI-generated office texts. Language Notes CSS Summary of pitfalls

I've written an HTML file for office document processing, designed to handle the segmentation of AI-generated office texts. <!DOCTYPE html> <html lang="zh-CN"> <head> <meta charset="UTF-8"> <meta name="viewport" c...
👁 152
Online LRC to STR converter/Base64 decoding tool – implemented using HTML and jQuery

Online LRC to STR converter/Base64 decoding tool – implemented using HTML and jQuery Summary of pitfalls Practical Collection Website source code Utility tools

A very useful web application designed primarily to convert LRC lyric files to STR subtitle format, along with a Base64 decoding tool. Main Features: 1. LRC to STR Converter – Input: Users can paste LRC lyrics or upload an LRC file; Conversion: Click the "Convert to STR" button to convert the LRC file to STR format; Output: The converted STR subtitles are displayed; these can be downloaded or saved. 2. Base64 Decoding Tool...
👁 215
1 2 3 4 14