Moonglade

Modern Markdown blogging with AI-powered localization and search.

Tag: Python


Ultimate Fix: Rudder (Yaw) Axis Conflict for X-Plane 12 on Linux

This article addresses the issue of the rudder failing to return to center when using an Xbox controller in X-Plane 12 on Linux, and proposes a Python-based solution. Due to the long-term lack of updates and compatibility defects in the traditional `xboxdrv` driver, the article introduces a bridging method that uses the `evdev` library to intercept LT/RT signals and create a persistent virtual joystick device. The core logic involves merging the left and right trigger keys into a single axis and mapping the difference to a 16-bit high-precision range, thereby achieving perfect compatibility with advanced add-on aircraft such as the ZIBO 737. The implementation plan includes writing a bridging script for automatic controller detection, configuring a Systemd service for auto-start on boot and reconnection after disconnection, and setting up udev rules to resolve permission issues. Ultimately, users can bind this virtual device in X-Plane to achieve stable control, with calibration information persistently saved, eliminating the need for reconfiguration after every restart, significantly enhancing the flight simulation experience on the Linux platform.

Views 348
Anduin Linux Python X Plane 12 Xbox Series X evdev


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 410
Caddy CaddyV2 Clickhouse Docker Python Superset

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


Put your data center to work with GPU compute power!

This article details the configuration and deployment process for vGPU in a VMware Horizon environment. First, disable cluster DRS/DPM to prevent migration deadlocks. Then, add Q/C series vGPU devices that support CUDA to the virtual machine in VCenter. When installing GRID drivers on the Linux client, you must use deb/rpm packages instead of the runfile. Configure `gridd.conf` and the license Token, and verify the authorization status using `nvidia-smi`. When installing CUDA, strictly avoid using the system package manager. You must install it via the runfile and uncheck `cuda-driver` to prevent overwriting the GRID drivers. Finally, manually configure the PATH environment variable. To ensure cross-host migration capability, plan the GPU memory splitting scheme in advance (such as 1/8 or 1/3 splits), enable the `vGPU.hotmigrate.enabled` option, and ensure that BIOS settings on all hosts (such as ECC, IO MMU, and SR-IOV) remain consistent. After configuration is complete, you can install cuDNN for AI model training or utilize `h264_nvenc` for video hardware-accelerated encoding. Additionally, the article introduces methods for monitoring temperature via `nvidia-smi` to optimize fan noise, and provides a troubleshooting guide for driver version conflicts, license expiration, and BIOS configuration errors, aiming to help users build a stable and efficient GPU computing environment.

Views 948
Ai CUDA NVIDIA Python Server Tesla Ubuntu VMware Vsphere vGPU