Anduin Xue

let today = new Beginning();

Bash and Linux Some tips about bash and Linux.


Web 应用开发检查单

这篇博客提供了一个 Web 应用开发检查单,旨在确保你的业务系统是安全、稳定、快速、可扩展、自动化的。检查单包括了网络配置、权限配置、运维策略、DevOps、容器化、应用开发、应用体验和合规性等方面。它可以帮助你确保服务器的网络安全和性能,减小权限,快速恢复业务,自动化部署和容器化,代码是否存在各种攻击的风险,以及是否符合各种合规性。该检查单详细介绍了每个方面的最佳实践,并提供了一些有趣的问题来启发读者思考,如:你的应用是否支持黑色主题和大字体?你的代码是否可能产生违反 GDPR 或 CCPA 的行为?该检查单可以帮助你确保你的业务系统是符合最佳实践的,从而提高你的业务系统的质量和可靠性。--GPT 4

Web Linux Cloud Server Container Service Development

Ubuntu 22.04 Network Diagnostic Handbook

This article provides a comprehensive guide on how to diagnose network interfaces in Ubuntu 22.04. It covers various methods, such as using the `ip` command, checking the routing table, and testing HTTP connections. The article also introduces the `networkctl` command, which supports various operations like renewing DHCP leases and bringing interfaces up or down. The author provides step-by-step instructions and examples to help readers follow along. Overall, this article is a useful resource for Ubuntu users who need to troubleshoot network issues.--GPT 4

Linux Ubuntu Network NetworkManager Networkd Netplan

Mirror YouTube channel to watch videos with best experience

This article explains how to mirror YouTube channels to watch videos without ads and interruptions, using the command-line tool youtube-dl. The author provides a script that downloads videos from a list of YouTube channels and saves them to a local folder, which can be added to the media library of a media server like Jellyfin. The article also explains how to expose the video folder to the internet via a web server and play the videos using other players like VLC. The step-by-step instructions are detailed and easy to follow, making it a great guide for anyone who wants to watch YouTube videos without ads.--GPT 4

Web Linux Ubuntu Python Youtube Jellyfin VLC

Setup a Ubuntu apt mirror server

This blog post provides a comprehensive guide on how to set up an Ubuntu apt mirror server. The process begins with installing the `apt-mirror` package and configuring the `mirror.list` file to specify the source you want to mirror. The author then explains how to start mirroring and where the downloaded files will be stored. The next step involves configuring a web server using Aiursoft.Static, including modifying permissions for accessibility and creating a systemd service for automatic startup. The guide continues with instructions on how to configure a reverse proxy using Caddy and finally, how to configure your client to use your mirror source. The author concludes by stating the benefits of setting up an Ubuntu mirror, such as bandwidth saving and faster software package downloads. Would it be possible to further optimize this process? How secure is this setup?--GPT 4

Web Linux Ubuntu Cache Server apt Mirror

基于 Docker Swarm Mode 建设你家里的数据中心!

在这篇博客中,我们将深入探讨如何使用 Docker Swarm Mode 建设家庭数据中心。文章首先介绍了 Docker Swarm Mode 的基本概念,包括其特性、优势以及与其他技术如 Kubernetes 的对比。接下来,我们详细阐述了如何在家庭环境中配置和使用 Docker Swarm Mode,包括网络设置、数据存储、服务管理等关键步骤。 在文章中,我们还讨论了使用 Docker Swarm Mode 建设数据中心的一些潜在问题和挑战,例如网络安全、数据备份、系统稳定性等。同时,我们也提供了一些实用的解决方案和建议,帮助读者在实际操作中避开这些问题。 文章最后,我们展望了 Docker Swarm Mode 在家庭数据中心建设中的未来发展,包括可能的新特性、技术趋势以及对现有架构的影响。我们相信,随着 Docker Swarm Mode 的不断发展和完善,它将成为家庭数据中心建设的理想选择。 这篇文章能否启发你思考如何利用现有的技术和资源,打造你自己的家庭数据中心?Docker Swarm Mode 又有哪些潜力和可能性等待你去探索和发掘?希望你在阅读本文后,能找到你自己的答案。--GPT 4

bash Linux Server Docker Container Docker Swarm Cluster Swarmpit

在服务器中部署单独的Docker应用

本文针对在虚拟机(VM)中部署Docker应用的场景进行了详细的讨论。这种场景可能出现在数据中心仍基于VM部署,而某些业务只提供Docker映像的情况下。文章首先讨论了这种混合部署的挑战,包括管理复杂性的提升,以及未来发展方向的确定。然后,文章详细介绍了在VM中安装Docker、确定容器需要穿透的卷、确定端口映射、管理容器和VM、确保容器会随着主机开启、对容器升级以及直接操作容器的方法。文章指出,虽然容器的升级相对容易,但在实际部署中,我们还需要采用一些“笨办法”以确保新版本的容器能正确加载和使用持久化卷,并与之前的版本兼容。最后,文章强调在混合部署中,需要对容器和VM进行分别管理,并需要对容器的持久化卷和端口映射进行规划和管理,以确保系统的稳定性和可靠性。同时,也需要考虑未来的发展方向,逐步向基于容器的部署模式转变。那么,你是否已经准备好在VM中部署Docker应用了呢?--GPT 4

bash Linux Ubuntu Docker VM Container

快速配置 - 无痛让你的所有 Git Commit 都被 GPG 数字签名

这篇博客详细介绍了如何使用 GPG 对 Git Commit 进行数字签名,为了防止他人伪造你的 Commit,提高安全性。首先,介绍了 GPG 签名的原理和作用,然后详细阐述了如何下载并安装 GPG,生成 Key,设置 Git Commit 使用这个 Key,让 GitHub、GitLab 信任你的公钥,并提出了跨设备同步你的 Key 的方法。通过这些步骤,你的 Git Commit 都会显示受信任的,不再会被黑客仿冒。但是,跨设备同步你的 Key 的方法可能会带来安全风险,你需要权衡安全和方便。那么,你是否愿意牺牲一点儿安全来换取方便呢?你会如何选择?--GPT 4

bash git PowerShell SSH Nextcloud Sign GPG

Make Gnome looks like Windows 11

在这篇博客中,我们将探索如何将 Gnome 桌面环境定制成 Windows 11 的外观。这是一种有趣的尝试,可以让我们看到 Linux 桌面环境的强大自定义性,无论是 KDE 还是 Gnome,都可以通过一些简单的设置,让它们看起来像任何一个系统。首先,我们需要安装一些必要的依赖,如 gnome-tweaks 和几个 Gnome 扩展。接着,我们将设置壁纸,选择一个类似于 Windows 11 的壁纸。然后,我们会设置图标和主题,这里推荐的图标方案和主题方案都具有很高的仿真度。最后,我们会设置 Dock to Panel 和 ArcMenu,这两个扩展可以让我们的 Gnome 桌面更像 Windows 11。在这个过程中,我们还会详细介绍每个步骤的具体操作。那么,Linux 桌面环境的自定义性能有多强?我们能否真正做到让 Gnome 看起来像 Windows 11?这就需要你亲自尝试,亲自体验了。--GPT 4

Ubuntu Gnome

Automatically Unlocking LUKS2 Encrypted System Partition Using Clevis and TPM2

This blog post delves into the process of automatically unlocking a LUKS2 encrypted system partition using Clevis and TPM2. To start with, you need to ensure that Secure Boot and TPM are enabled in your BIOS settings. For Secure Boot, you may need to configure your system to trust third-party certificates, which could involve generating a new key pair and certificate for your system, signing your boot loader and kernel with the new key, and enrolling the key in your system's Secure Boot database. The blog proceeds to guide you through the installation of the necessary packages for Clevis, using the command `sudo dnf install clevis clevis-luks clevis-dracut clevis-udisks2 clevis-systemd`. Once installed, the TPM2 key has to be bound to Clevis, which creates a key on the TPM2 chip and binds it to the LUKS2 encrypted system partition. You will be prompted to enter your passkey. The final step involves updating the system files to use Clevis to automatically unlock the system partition...--GPT 4

bash Linux Security LUKS2 Clevis TPM2 TPM

Using ZFS is easy

ZFS is a modern file system with features such as copy-on-write, redirect-on-write, deduplication, and snapshots, making it suitable for large-scale storage and data management scenarios. It operates on the concept of storage pools, where a pool manages disks and provides storage space. Datasets can be created on top of these pools, which don't require allocated space and can utilize the entire storage capacity of the pool. Each dataset is mapped as a directory for file storage and organization. The blog post provides a detailed guide on how to install ZFS, locate your disk, list sets and pools, and manage pools and sets. It also explains how to use the deduplication property to remove redundant data from your ZFS file systems, resulting in only unique data being stored and common components being shared between files. Additionally, the blog post discusses the use of snapshots, which record the state of the file system at a specific point in time. This feature allows for easy resto...--GPT 4

bash Linux Disk ZFS File Sysytem Raid Dedup

How to install CUDA and cuDNN on Ubuntu 22.04 and test if its installed successfully

本篇博客详细介绍了如何在Ubuntu 22.04上安装CUDA和cuDNN,并测试它们是否安装成功。首先,博客提供了安装CUDA的下载链接以及具体的安装步骤。接下来,博客提供了安装cuDNN的下载链接和详细的安装步骤。文章还介绍了如何确认驱动程序是否已安装,以及如何检查CUDA和cuDNN是否已安装。 为了测试CUDA是否安装成功,博客提供了一个简单的“Hello CUDA”程序,并展示了如何编译和运行它。同样,博客也展示了如何测试cuDNN是否安装成功,通过运行一个简单的示例程序。 在阅读本篇博客后,读者应该能够顺利地在Ubuntu 22.04上安装CUDA和cuDNN,并确保它们已成功安装。此外,本文还提供了一些有用的命令来检查驱动程序、CUDA和cuDNN的安装状态和版本信息。 最后,你是否知道如何在自己的Ubuntu系统上安装CUDA和cuDNN?如何确保它们已成功安装并运行?阅读全文以获取详细的操作步骤和示例代码。--GPT 4

Ubuntu NVIDIA vGPU CUDA cuDNN GPU

If a Ubuntu server should run apt upgrade automatically?

本文讨论了是否应该让Ubuntu服务器自动运行apt升级。首先,作者提到自动升级的优点:节省时间、尽快获得安全更新、始终保持软件包的清洁和新颖、历史上apt升级非常安全且不会删除现有库。然而,自动升级并不适用于所有场景。在问题调查阶段,自动更新可能会掩盖真正的问题;对于需要极度稳定的客户而言,服务器的任何更改都可能带来风险;自动升级可能导致软件的较大功能更新,从而引发业务中断;此外,更新过程通常需要重启,而某些程序在重启后可能难以恢复正常运行。 尽管如此,仍有一些情况下可以考虑自动升级:系统可容忍降低可用性;系统是无状态的,重启不会影响其正常运行;系统已配置完善的备份/快照;系统始终连接到互联网;系统需要获得最新的功能更新。作者建议仅在满足以上所有条件时才使用自动更新功能。 当然,文章还提供了如何配置Ubuntu服务器以每周自动升级的方法。首先编写一个`upgrade.sh`脚本,然后使用`crontab -e`编辑计划任务。但在实施自动升级之前,请务必权衡好利弊,确保自动升级不会给您的业务带来不必要的麻烦。--GPT 4

bash Linux Ubuntu Upgrade Crontab Update