Moonglade

Modern Markdown blogging with AI-powered localization and search.

All Posts


What Should Ordinary People Learn in the AI Era?

In the age of AI, traditional linear learning paths have become obsolete. The core strategy must shift from a “beginning-middle-end” sequence to an “Early-Late-Mid” model. In the early stage, quickly master the basic entry-level skills. The critical step lies in the middle stage: before hands-on implementation, first anchor the late-stage endgame blueprint, clearly defining system architecture, performance bottlenecks, and long-term constraints. The middle stage then becomes a fill-in-the-blank exercise based on the blueprint, rather than blind trial and error. AI, as the most powerful executor in the middle stage, can efficiently generate code and content but lacks holistic contextual awareness and cannot replace humans in defining late-stage constraints. Without a late-stage perspective, AI will actually accelerate the accumulation of technical debt. Therefore, human core competitiveness is no longer about specific implementation, but rather possessing “engineering intuition” and high-level paradigm thinking. We should stop obsessing over outdated syntactic details and instead deeply understand programming paradigms, systems theory, and aesthetic taste to expand our cognitive search space. Only those who have “seen the pig run” can precisely define requirements when directing AI, transforming from craftsmen who look down to fill in blanks into architects who look up to see the endgame.

Views 258
AI Era Engineering Intuition EngineeringIntuition LateGame Learning Strategy Paradigms


Make Blurry Videos Clear

This article introduces a Linux one-click video super-resolution script based on Real-ESRGAN technology, designed to address the limitations of traditional AI super-resolution tools that only support image processing and have cumbersome video processing workflows. The script automates the entire process, including dependency environment detection and download, video frame extraction, GPU-accelerated AI upscaling, H.265 high-definition encoding, and audio merging, while providing real-time progress bar display. The article provides an in-depth analysis of the core principles of Real-ESRGAN, pointing out that it uses "blind super-resolution" technology. By training on purely synthetic data that simulates complex quality degradations such as multiple blurs, noise, and compression artifacts, it can accurately "infer" high-frequency details lost in the real world, such as hair strands and textures. Users should note the hardware requirements: a discrete graphics card supporting Vulkan is required (NVIDIA RTX series recommended), along with sufficient storage space to handle temporary frame files. The script has been verified on AnduinOS with significant results, making it ideal for restoring old home videos or enhancing the quality of classic low-resolution footage. Users simply need to place the video in the designated directory and run the script to generate a 4x high-definition version.

Views 332
AI Super Resolution Bash Script Linux REAL-ESRGAN Video Upscaling bash



Visualize Caddy logs using Clickhouse

This article introduces how to leverage ClickHouse to build a Caddy log analysis system, enabling efficient data querying and visualization. The author first demonstrates that, after importing Caddy logs into ClickHouse, core metrics such as request volumes per business line, crawler IP identification, independent IP distribution, and CPU consumption can be rapidly aggregated through SQL statements. Additionally, the article details multiple practical query scenarios, including Top 100 popular endpoints, error code rankings, latency trend analysis based on P95/P99 percentiles, request size distribution, time-of-day traffic heatmaps, and User-Agent distribution, helping to gain deep insights into service performance and potential bottlenecks. In practice, the author successfully used this system to track and analyze a hacker's flood attack behavior, quickly locating the source of abnormal traffic through time-window filtering. Finally, the article demonstrates how to generate aesthetically pleasing visual reports using ClickHouse's built-in dashboards and the Grafana tool. The conclusion notes that setting up this infrastructure is of moderate difficulty; once established, it enables real-time monitoring of business metrics. For teams unfamiliar with application usage patterns, visualizing traffic data is an indispensable key method for evaluating business development.

Views 411
Caddy CaddyV2 Clickhouse Docker Python Superset

I set up Authentik at home, and I deeply regret not doing it sooner.

This article provides a detailed configuration guide for integrating unified identity authentication into applications such as OpenGist, Gitea, Koel, GitLab, and Nextcloud using Authentik. For applications that support OpenID Connect, configuring OAuth2 client information and environment variables enables anonymous browsing, automatic registration, user merging based on email addresses, and role-based access control based on group memberships. For example, both Gitea and GitLab can implement administrator privilege control by mapping the `groups` field, whereas Nextcloud requires a Python attribute mapping script to handle specific admin roles and user ID matching logic. For Koel, which does not support OIDC, the Caddy Forward Auth mechanism is employed to pass user information via HTTP Headers; however, this approach has limitations, including the inability to automatically merge users and limited permission management capabilities. Although the integration process involves complex attribute mapping, environment variable adjustments, and user data cleansing, and although the cost of merging users registered on different platforms later is extremely high, the benefits in reducing registration barriers and enhancing the user experience are significant. The article strongly recommends deploying Authentik at an early stage when the business scale is small and the user count is manageable, to avoid the substantial operational burden and communication...

Views 1,652
Authentik Docker Linux OAuth OAuth 2.0 OIDC

Set up a local Docker registry mirror

This article introduces how to use a self-hosted Docker registry to mirror images to a local server, thereby resolving network access issues and improving pull speeds. The core content covers the implementation of an automated mirroring script. This script handles the retry mechanism using an exponential backoff algorithm and supports batch synchronization of numerous Docker images, including databases, programming language runtimes, and various applications. The article details two deployment methods: first, installing Python dependencies directly on a Linux host and executing the script; second, building a Docker container that includes cron scheduled tasks to achieve daily automatic synchronization. Finally, the guide provides specific steps for configuring the Docker daemon to trust a local insecure registry, demonstrating how to pull and push images from the local registry. This solution provides an efficient and stable private image source for users who require offline environments or need to optimize image distribution efficiency, effectively reducing reliance on external network services.

Views 647
Automation Docker Mirroring Python Registry Scripting

Reviewing Data Structures - Building a Hash Tree

This article explores a set data structure with O(1) time complexity that is implemented manually without relying on the standard library. The author proposes the BinaryHashTrie (binary hash prefix tree) approach, whose core idea is to hash the input string, then use bit operations to parse the hash value bit by bit, mapping it to the left and right child node paths of a binary tree. Specifically, the implementation determines the traversal direction by checking the least significant bit of the hash value and recurses deeper until reaching a node where the hash value is zero, at which point a termination state is marked to complete the add and lookup operations. This structure avoids the complexity of handling collisions in traditional hash tables. Although there is a risk of false positives due to hash collisions (judging a non-existent element as existing), it offers significant performance advantages in scenarios with low precision requirements (such as quickly checking user registration status). Real-world testing shows that its execution speed is significantly superior to linked list structures, making it suitable for acceleration scenarios that demand extremely high speed and can tolerate a very low error rate.

Views 349
Binary Hash Trie Binary Tree Custom Collection Data Structure Hashing Set Operations