Moonglade

Modern Markdown blogging with AI-powered localization and search.

Tag: Automation


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



Use Windows as a stateless OS on your devices

This is a tutorial article on automated optimization scripts for the Windows operating system, designed to complete multiple system configurations in one go using PowerShell and CMD commands. The core content covers system cleanup and environment optimization, including emptying the Recycle Bin, removing startup items, deleting 3D objects, and cleaning up desktop files to enhance tidiness. In terms of performance and experience, the script sets the power plan to Ultimate Performance mode, disables sleep on AC power, disables mouse acceleration to optimize control, and forces the use of the dark theme and the Chinese input method. Network and security settings involve setting the network type to Private to enable more features, configuring UAC to the default protection level, and optionally enabling Remote Desktop connections. Additionally, the script addresses the active probing issue in Windows 11, synchronizes to China Standard Time, displays file extensions, pins the code repository to Quick Access, and finally uses Winget to batch upgrade applications and install Windows system updates. This script is suitable for developers or advanced users who want to quickly configure a development environment tailored to their personal preferences. However, some operations, such as emptying the desktop and changing network properties, carry risks and should be executed with caution.

Views 917
Automation Configuration Device PowerShell Reimage Windows Windows 11