Anduin Xue

let today = new Beginning();

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

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

Install GitLab behind a reverse proxy on a Ubuntu 20.04\22.04 server

本篇博客详细介绍了如何在Ubuntu 20.04/22.04服务器上安装GitLab,并将其部署在反向代理之后。首先,博客讲述了如何安装和配置GitLab,接着演示了如何配置Nginx作为反向代理。为了解决SSH端口冲突的问题,文章还讨论了如何在GitLab服务器上使用2202端口作为克隆端口,并在代理服务器上进行端口转发。此外,博客还介绍了如何为GitLab实例添加运行器,并提供了一个示例项目,用于测试运行器的功能。最后,博客提供了一个完整的`.gitlab-ci.yml`配置文件示例,用于实现项目的构建、代码分析、测试和发布等任务。 在阅读本篇博客后,您将了解如何在Ubuntu服务器上部署GitLab,并配置反向代理以实现安全的访问。同时,您还可以借助本文提供的示例项目和`.gitlab-ci.yml`配置文件,快速实现项目的自动化构建和测试。在实践中,您可能需要根据自己的需求对配置进行调整,以满足不同的项目类型和技术栈。 那么,在配置GitLab和反向代理的过程中,可能会遇到哪些问题?如何确保GitLab运行器能够正确地执行任务?如何根据项目需求定制`.gitlab-ci.yml`配置文件?阅读全文,自己找到答案吧!--GPT 4

bash git Linux Ubuntu Proxy SSH Caddy GitLab nginx

Interface selection when Linux has multiple network interface at the same time

本篇博客讨论了一个在Linux设备上使用多个网络接口时遇到的问题,以及如何解决这个问题。在一个数据中心中,作者创建了多个子网,并将Linux设备的两个接口同时连接到这两个子网上。问题在于,当尝试访问互联网时,可能会出现“目标主机不可达”的错误消息。通过运行`ip route list`,作者发现蓝色网络具有较高的优先级,这是问题的根本原因。 为了解决这个问题,首先需要查看当前的路由表,可以使用`ip route list`命令。然后需要删除现有的默认路由,使用`ip route del default`命令。接下来,使用`sudo ip route add default via 172.16.50.1 dev ens160 proto dhcp metric 102`命令为具有较低度量值的网络接口添加新的默认路由。最后,可以使用`ip route get 8.8.8.8`命令询问Linux将使用哪个接口发送数据包到特定的IP地址,或者尝试连接互联网,例如使用`ping www.baidu.com`命令。 总之,如果在Linux设备上有多个默认路由,可以通过删除并使用较低度量值重新添加它们来调整优先级。这样就可以确保在具有多个网络接口的情况下,Linux设备能够正确地访问互联网。--GPT 4

IP Linux Network Routing Interface

MySQL allow remote connection (For root and other users)

本篇博客主要讲述了如何在MySQL数据库中允许远程连接,无论是对于root用户还是其他用户。首先,我们可以通过运行SQL查询来检查数据库的当前状态。接着,确保防火墙允许3306端口,并允许MySQL绑定到所有端口。然后,对于root用户,需要在本地登录root,替换主机值,并重启服务。对于其他用户,如果用户不存在,需要先登录MySQL,创建新数据库和新用户,并为新用户分配必要的权限。如果用户已存在,只需更新用户的主机值即可。 本文详细介绍了每个步骤所需的命令和操作,为您在实际操作中提供了便利。如何确保远程连接的安全性?是否还有其他方法可以实现远程连接?阅读全文以获取更多信息并找到答案。--GPT 4

bash Database Linux Ubuntu Remote Management MySQL

Ubuntu resize an ext4 partition without LVM

本篇博客详细介绍了如何在Ubuntu系统下调整ext4分区的大小,而无需使用LVM。文章首先提醒读者在进行分区调整之前确保已卸载所有文件系统并关闭所有交换分区,以防止数据损失。接着,博客通过一系列命令展示了如何使用fdisk工具删除旧分区并创建一个新的、更大的分区。在创建新分区后,文章解释了如何使用resize2fs命令在线调整文件系统大小,以适应新的分区大小。最后,通过df命令展示了调整后的分区和文件系统的大小。 在阅读本文后,你可能会思考如何在不同的文件系统和操作系统下进行类似的操作。此外,你可能会好奇在这个过程中是否存在数据丢失的风险,以及如何确保数据的安全性。在实践中,你可能会遇到哪些问题,又如何解决这些问题呢?--GPT 4

Linux Ubuntu Disk ext4 fdisk Partition