Moonglade

Modern Markdown blogging with AI-powered localization and search.

Tag: Linux


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 349
Anduin Linux Python X Plane 12 Xbox Series X evdev

Say Goodbye to Ugly Tag Suffixes: Building True Multi-Architecture Images with Docker Buildx

This article provides a comprehensive guide to building dual-architecture images for x86 and ARM64 using Docker buildx and QEMU. It begins with the installation of the base environment and the initialization of the builder, explaining how the `binfmt_misc` mechanism enables cross-platform instruction translation, allowing x86 machines to compile ARM code. The core practical section demonstrates how to use the `--platform` parameter to build multi-architecture images in one step, and explains the Manifest List principle: the builder independently compiles images for each architecture and then generates an index, ensuring that clients only download the layers corresponding to their specific architecture upon pull, thereby avoiding redundancy. The article specifically points out that multi-architecture images cannot be directly loaded into the traditional Docker local image list, recommending direct pushing or exporting in OCI format. For CI/CD scenarios, it recommends injecting QEMU support non-invasively by running the `tonistiigi/binfmt` container to keep the environment clean. Additionally, it covers verifying images using `regctl`, testing ARM images on x86 systems, a guide to avoiding common pitfalls regarding Dockerfile architecture compatibility, and an explanation of the purpose of buildx's background BuildKit containers and their resource management. Mastering these techniques enables efficient building and management of enterprise-level multi-architecture automated release pipelines.

Views 332
ARM64 Container Docker Docker Buildx Linux Multi Arch bash

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


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

Some quick Docker tips

Common Docker Tips and Tricks The following are some useful Docker commands and techniques that can help you manage your containers and images more effectively. Each section includes explanations of when and how to use these commands. Build an Image from a Dockerfile bash docker ...

Views 605
Container Docker Linux Locale bash timezone


Run Linux Desktop experience in Docker container

This article provides an in-depth analysis of the key software package dependencies required to run a Linux desktop environment within a Docker container. It begins by identifying `gnome-shell` as a core component, noting that its dependencies include specific configurations such as the Ubuntu wallpaper. The article then clearly distinguishes between the roles of `gnome-core` and `ubuntu-desktop`, explaining that Ubuntu installs the latter by default rather than the former, and lists core application dependencies, including the file manager, terminal, and settings center. Additionally, it highlights Ubuntu-specific GNOME Shell extensions, such as `ubuntu-dock` for the taskbar, application indicator support, and desktop icon management tools. Finally, it compares the dependency differences between `ubuntu-desktop-minimal` and the standard `ubuntu-desktop`. The former provides a basic environment for minimal installations, while the latter adds more standard components on top of that foundation. By mapping out these dependency chains, readers can clearly understand how to build a fully functional yet lightweight Linux desktop environment in Docker, enabling convenient testing and experience of the desktop system without the need for a local installation.

Views 976
Docker Gnome Linux Remote Management Ubuntu desktop

Web Application Development Checklist

This document comprehensively outlines the best practices framework for building highly available, secure, and efficient web services. At the security level, it emphasizes enabling modern encryption protocols such as TLS 1.3, HSTS, and OCSP Stapling, and strictly configuring CSP, Rate Limiting, and firewall rules to defend against XSS, DDoS, and brute-force attacks. In terms of network and system configuration, it recommends optimizing TCP congestion control algorithms, minimizing port exposure, disabling root password login, and reducing risks through SELinux and file permission controls. From an operations perspective, it is necessary to establish robust monitoring and alerting, snapshot backup, and automated scaling mechanisms to ensure rapid recovery of business continuity during failures or traffic spikes. In the DevOps workflow, static code analysis, unit testing, and containerized deployment should be integrated via CI/CD pipelines, leveraging Docker and Kubernetes for flexible scaling. The core of application development lies in eliminating underlying defects such as memory leaks, deadlocks, and SQL injection to ensure code quality. Additionally, attention must be paid to user experience, including responsive layout, multi-language and timezone support, and PWA compatibility, while strictly adhering to global and local compliance requirements such as GDPR and the Personal Information Protection Law, thereby achieving dual assurance of technical architecture and business value.

Views 545
Cloud Container Development Linux Server Service Web

Ubuntu 22.04 Network Diagnostic Handbook

This article introduces a complete process for troubleshooting unknown network traffic and bandwidth usage issues in an Ubuntu system. First, use `ip link show` to identify the network interface to be monitored. Then, utilize tools such as `dstat`, `iftop`, and `nload` to monitor overall network traffic and bandwidth usage on specific interfaces in real time. To pinpoint the source of resource consumption, the article recommends using `nethogs` to view traffic by process. It also notes that when a process ID appears as unknown (such as processes inside Docker containers), you should switch to using `tcpdump` to capture and analyze specific network packets. Next, use the `ss` command to check the occupancy status of specific ports, and combine it with the `ps` command to confirm the corresponding process ID and the location of the executable file. Finally, for identified anomalous IP addresses, the article guides you to use `iptables` and `ip6tables` commands to block inbound and outbound traffic. It particularly emphasizes that for IPv6 addresses, since attackers can easily change their addresses, it is recommended to block the entire subnet to enhance defense, thereby helping users effectively diagnose and resolve abnormal network bandwidth issues.

Views 2,099
Linux Netplan Network NetworkManager Networkd Ubuntu