From 04256f5fb656a7580d91c68441bb2a78b43b88b1 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 31 Jul 2021 08:39:27 +0800 Subject: [PATCH 001/290] Update 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md --- ...indows 11 Makes Your Hardware Obsolete, Use Linux Instead.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md index 4fc636c134..50c346da3f 100644 --- a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md +++ b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/windows-11-linux/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zd200572) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 16c4be62b2d782e7b1acd3d2ba3cc43946bb6e4e Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 31 Jul 2021 09:18:11 +0800 Subject: [PATCH 002/290] Update 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md --- ...ur Hardware Obsolete, Use Linux Instead.md | 37 ++++++++----------- 1 file changed, 16 insertions(+), 21 deletions(-) diff --git a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md index 50c346da3f..95f8a9e6b5 100644 --- a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md +++ b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md @@ -7,36 +7,36 @@ [#]: publisher: ( ) [#]: url: ( ) -Windows 11 Makes Your Hardware Obsolete, Use Linux Instead! +Windows 11 让你的硬件过时,使用Linux代替吧! ====== -Windows 11 is finally here. We’re not entirely thrilled by it – but it introduces problems for many computer users. +Windows 11终于来了,我们对此并不完全兴奋, – 但是它给许多电脑用户带来了问题。 -And I’m not even talking the privacy aspect or its design choice. But it seems that Windows 11 is demanding newer hardware to work, which makes your old computer obsolete in a way and forces you to upgrade your hardware for no good reason. +我基本不会讨论隐私方面或者它的设计选择。可是Windows 11要求更新的硬件,这会让你的旧电脑在某种程度上过时,没有好的理由却强迫你升级新的硬件。 -What else is a problem with the arrival of Windows 11? What’s so bad about it? +Windows 11发布的其他问题是啥,它为为什么这么坏? -### Only Eligible Devices Can Get the Windows 11 Upgrade +### 只有有资格的设备才能获得Windows 11升级 -To start with, Windows 11 has interestingly added a minimum system requirement which looks good on paper: +起初,Windows 11增加了一个看起来不错的最低系统需求: - * 1 GHz dual-core 64-bit processor - * 4 GB RAM - * 64 GB storage - * UEFI, Secure Boot support - * Trusted Platform Module version 2.0 - * DirectX 12 compatible graphics - * 720p resolution display + * 1GHz双核64位处理器 + * 4GB内存 + * 64GB存储空间 + * 支持 UEFI 安全启动 + * 受信任的平台模块 (TPM) 版本 2.0 + * DirectX 12兼容显卡 + * 720P分辨率显示器 ![][1] -You can check if your system is eligible by downloading the **PC Health Check** app from [Microsoft’s official site][2]. +你可以下载电脑健康状况检查应用[微软官方网站][2]检查你的系统是否有升级的资格。 -Most of the computers from the last decade should meet these criteria – but there’s a catch. +十年内的大多数电脑能达到这些要求,但有一个问题 -The hardware should have a TPM chip, which may not be the case for some PC builds or laptops. Fortunately, it is not all bad, you may just need to enable it from your BIOS settings including the Secure Boot support, to make your PC eligible. There’s a guide on [PCGamer][3] to help you with that. +需要有一个TPM硬件芯片,一些电脑和笔记本可能没有。幸运的是,您可能只需要从BIOS设置(包括安全引导支持)中启用它,就可以使您的PC符合条件。这里有一个向导[PCGamer][3] to help you with that. Technically, processors older than **Intel 8th gen and Ryzen 3000 series** are not officially supported as per Microsoft’s official documentations ([AMD][4] | [Intel][5]). @@ -82,11 +82,6 @@ While Windows 11 plans to force users to upgrade their hardware in the next few So, if you are not happy with Windows 11 release, you may want to start using Linux instead. Fret not, you can refer to our guides on our main web portal [It’s FOSS][11] to learn everything you need to get started using Linux! -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested -------------------------------------------------------------------------------- From a51e271fbac079e1555f15761d23fa67c00fd1d4 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 31 Jul 2021 09:48:28 +0800 Subject: [PATCH 003/290] Update 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md --- ...ur Hardware Obsolete, Use Linux Instead.md | 44 +++++++++---------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md index 95f8a9e6b5..9b18e10c77 100644 --- a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md +++ b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md @@ -36,51 +36,51 @@ Windows 11发布的其他问题是啥,它为为什么这么坏? 十年内的大多数电脑能达到这些要求,但有一个问题 -需要有一个TPM硬件芯片,一些电脑和笔记本可能没有。幸运的是,您可能只需要从BIOS设置(包括安全引导支持)中启用它,就可以使您的PC符合条件。这里有一个向导[PCGamer][3] to help you with that. +需要有一个TPM硬件芯片,一些电脑和笔记本可能没有。幸运的是,您可能只需要从BIOS设置(包括安全引导支持)中启用它,就可以使您的PC符合条件。这里有一个可供帮忙[PCGamer][3]的向导. -Technically, processors older than **Intel 8th gen and Ryzen 3000 series** are not officially supported as per Microsoft’s official documentations ([AMD][4] | [Intel][5]). +技术上说,微软官方文档中不支持比**Intel第8代和Ryzen3000系列**老的处理器([AMD][4] | [Intel][5]). -However, there are a sound number of systems that may not have the support for it. So, what do you do? +可是,有相当数量的电脑失去支持,你该怎么做? -Easy, [**switch to Linux in 2021**][6] before Windows 10 no longer receives updates. This year, it makes more sense than ever for you to try Linux for your personal computer! +简单, [**2021年啦,换成Linux吧**][6],在Windows 10不再收到更新之前. 今年,在你的个人电脑上尝试Linux变得更有意义。 -### Windows 11 Installation Requires Internet Connectivity +### Windows 11安装需要网络 ![][7] -While we do not have enough clarity about this but as per its system requirement specifications, it will require users to have an active Internet connection for Windows 11 installation. +由于我们不太清楚系统要求参数,Windows 11安装过程中将要求用户有可连通的网络连接。 -But, with Linux, you do not need that. +但是,Linux不需要这样. -That’s just one of the [benefits of using Linux over Windows][8] – you get complete control of your operating system. +这只是其中一个[使用Linux而不是Windows][8]的好处 –你对你的操作系统有完全的掌控。 -### No 32-Bit Support +### 不再有32位支持 ![][7] -Windows 10 did support 32-bit systems, but Windows 11 ends that. +Windows 10是支持32位系统的,但是Windows 11终结了相关支持. -This is where Linux shines. +这又是Linux的优势了。 -Even though the 32-bit support is dwindling everywhere, we still have a bunch of [**Linux distributions that support 32-bit systems**][9]. Your 32-bit system may still live for a decade with Linux. +尽管32位支持都在逐渐减少, 我们依然有一系列[**支持32位系统的Linux发行版**][9]. 你的32-bit电脑或许在10年内依然能使用Linux。 -### Windows 10 Support Ends in 2025 +### Windows 10将在2025结束支持 -Well, this was unexpected considering Microsoft initially planned to never have an upgrade after Windows 10 but support it for the foreseeable future. +好吧,这是意料之外的,鉴于微软最初计划 Windows 10将是最后一个Windows版本。 -Now, Windows 10 will be killed in 2025… +现在,Windows 10将会在2025被杀掉… -So, what do you do then? Upgrade your hardware just because it does not support Windows 11? +那么,到那里我们该怎么做呢?升级你的硬件只因为它不支持Windows 11? -Unless there’s a necessity, Linux is your friend forever. +除非有这个必要,否则Linux是你永远的朋友。 -You can try several [**lightweight Linux distributions**][10] that will revive any of your computers that Microsoft considers obsolete! +你可以尝试几个[**轻量级Linux发行版**][10],它们将复活微软认为过时的你的电脑。 -### Wrapping Up +### 总结 -While Windows 11 plans to force users to upgrade their hardware in the next few years, Linux lets you keep your hardware for a long time along with several added benefits. +尽管在未来几年Windows 11计划强迫用户升级他们的硬件,Linux将让你长时间继续使用你的硬件,并有额外的好处。 -So, if you are not happy with Windows 11 release, you may want to start using Linux instead. Fret not, you can refer to our guides on our main web portal [It’s FOSS][11] to learn everything you need to get started using Linux! +因此,如果你对Windows 11不满,你可能想开始使用Linux代替。不要烦恼,你可以参考我们主站的教程[FOSS][11]来学习开始使用Linux的一切! -------------------------------------------------------------------------------- @@ -89,7 +89,7 @@ via: https://news.itsfoss.com/windows-11-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zd200572](https://github.com/zd200572) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c0807884d3d542495d367acc9d4aedaf189951b5 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 31 Jul 2021 10:14:00 +0800 Subject: [PATCH 004/290] Update 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md --- ...ur Hardware Obsolete, Use Linux Instead.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md index 9b18e10c77..96bbebb09e 100644 --- a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md +++ b/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md @@ -10,15 +10,15 @@ Windows 11 让你的硬件过时,使用Linux代替吧! ====== -Windows 11终于来了,我们对此并不完全兴奋, – 但是它给许多电脑用户带来了问题。 +Windows 11终于来了,我们并不完全对此感到兴奋, –-但它给许多电脑用户带来了问题。 -我基本不会讨论隐私方面或者它的设计选择。可是Windows 11要求更新的硬件,这会让你的旧电脑在某种程度上过时,没有好的理由却强迫你升级新的硬件。 +我甚至不会讨论隐私方面或者它的设计选择。可是Windows 11要求更新的硬件,这会让你的旧电脑在某种程度上过时,没有好的理由,却强迫你升级新的硬件。 -Windows 11发布的其他问题是啥,它为为什么这么坏? +Windows 11的到来还有什么问题,有什么不好的? -### 只有有资格的设备才能获得Windows 11升级 +### 只有符合条件的设备才能获得Windows 11升级 -起初,Windows 11增加了一个看起来不错的最低系统需求: +首先,Windows 11有趣在添加了一个看起来不错的最低系统需求: * 1GHz双核64位处理器 * 4GB内存 @@ -32,49 +32,49 @@ Windows 11发布的其他问题是啥,它为为什么这么坏? ![][1] -你可以下载电脑健康状况检查应用[微软官方网站][2]检查你的系统是否有升级的资格。 +你可以在[微软官方网站][2]下载电脑健康状况检查应用检查你的系统是否有升级的资格。 -十年内的大多数电脑能达到这些要求,但有一个问题 +过去十年内的大多数电脑能达到这些标准--但有一个陷阱。 -需要有一个TPM硬件芯片,一些电脑和笔记本可能没有。幸运的是,您可能只需要从BIOS设置(包括安全引导支持)中启用它,就可以使您的PC符合条件。这里有一个可供帮忙[PCGamer][3]的向导. +硬件需要有一个TPM芯片,一些电脑和笔记本可能没有。幸运的是,您可能只需要从BIOS设置(包括安全引导支持)中启用它,就可以使你的PC符合条件。这里有一个[PCGamer][3]的向导可以帮你. -技术上说,微软官方文档中不支持比**Intel第8代和Ryzen3000系列**老的处理器([AMD][4] | [Intel][5]). +技术上说,根据微软官方文档,Windows 11不支持比**Intel第8代和Ryzen3000系列**更老的处理器([AMD][4] | [Intel][5]). 可是,有相当数量的电脑失去支持,你该怎么做? -简单, [**2021年啦,换成Linux吧**][6],在Windows 10不再收到更新之前. 今年,在你的个人电脑上尝试Linux变得更有意义。 +简单, [**2021年啦,换成Linux吧**][6],在Windows 10不再收到更新之前. 今年,在你的个人电脑上尝试Linux变得比任何时候更有意义。 -### Windows 11安装需要网络 +### Windows 11安装需要网络连接 ![][7] -由于我们不太清楚系统要求参数,Windows 11安装过程中将要求用户有可连通的网络连接。 +虽然我们不太清楚,但根据其系统要求规范,Windows 11安装过程中将要求用户有可连通的网络连接。 但是,Linux不需要这样. -这只是其中一个[使用Linux而不是Windows][8]的好处 –你对你的操作系统有完全的掌控。 +这只是其中一个[使用Linux而不是Windows][8]的好处 –-你可以完全的掌控操作系统。 -### 不再有32位支持 +### 没有32位支持 ![][7] -Windows 10是支持32位系统的,但是Windows 11终结了相关支持. +Windows 10确实是支持32位系统的,但是Windows 11终结了相关支持. 这又是Linux的优势了。 -尽管32位支持都在逐渐减少, 我们依然有一系列[**支持32位系统的Linux发行版**][9]. 你的32-bit电脑或许在10年内依然能使用Linux。 +尽管32位支持都在逐渐减少, 我们依然有一系列[**支持32位系统的Linux发行版**][9]. 或许你的32位电脑还能与Linux一起工作10年。 -### Windows 10将在2025结束支持 +### Windows 10将在2025年结束支持 -好吧,这是意料之外的,鉴于微软最初计划 Windows 10将是最后一个Windows版本。 +好吧,这是意料之外的,鉴于微软最初计划Windows 10是其最后一款独立发布的操作系统,这是出乎意料的。 -现在,Windows 10将会在2025被杀掉… +现在,Windows 10将会在2025年被杀死… -那么,到那里我们该怎么做呢?升级你的硬件只因为它不支持Windows 11? +那么,我们该怎么做呢?升级你的硬件,只因为它不支持Windows 11? 除非有这个必要,否则Linux是你永远的朋友。 -你可以尝试几个[**轻量级Linux发行版**][10],它们将复活微软认为过时的你的电脑。 +你可以尝试几个[**轻量级Linux发行版**][10],它们将复活你的微软认为过时的电脑。 ### 总结 From 68f093a2ddaf5af0c2e45414689b8a5ae9912fcd Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 31 Jul 2021 10:18:24 +0800 Subject: [PATCH 005/290] Rename sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md to translated/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md --- ... Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md (100%) diff --git a/sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/translated/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md similarity index 100% rename from sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md rename to translated/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md From 756688b4156763c78a43c541283509a706d3e880 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Aug 2021 05:02:28 +0800 Subject: [PATCH 006/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210811=20?= =?UTF-8?q?Build=20your=20own=20Fedora=20IoT=20Remix?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210811 Build your own Fedora IoT Remix.md --- ...0210811 Build your own Fedora IoT Remix.md | 294 ++++++++++++++++++ 1 file changed, 294 insertions(+) create mode 100644 sources/tech/20210811 Build your own Fedora IoT Remix.md diff --git a/sources/tech/20210811 Build your own Fedora IoT Remix.md b/sources/tech/20210811 Build your own Fedora IoT Remix.md new file mode 100644 index 0000000000..8a552bcb19 --- /dev/null +++ b/sources/tech/20210811 Build your own Fedora IoT Remix.md @@ -0,0 +1,294 @@ +[#]: subject: "Build your own Fedora IoT Remix" +[#]: via: "https://fedoramagazine.org/build-your-own-fedora-iot-remix/" +[#]: author: "Alexander Wellbrock https://fedoramagazine.org/author/w4tsn/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Build your own Fedora IoT Remix +====== + +![][1] + +Background excerpted from photo by [S. Tsuchiya][2] on [Unsplash][3] + +Fedora IoT Edition is aimed at the Internet of Things. It was introduced in the article [How to turn on an LED][4] with Fedora IoT in 2018. It is based on [RPM-OSTree][5] as a core technology to gain some nifty properties and features which will be covered in a moment. + +RPM-OSTree is a high-level tool built on [libostree][6] which is a set of tools establishing a “git-like” model for committing and exchanging filesystem trees, deployment of said trees, bootloader configuration and layered RPM package management. Such a system benefits from the following properties: + + * Transactional upgrade and rollback + * Read-only filesystem areas + * Potentially small updates through deltas + * Branching, including rebase and multiple deployments + * Reproducible filesystem + * Specification of filesystem through version-controlled code + + + +Exchange of filesystem trees and corresponding commits is done through OSTree repositories or remotes. When using one of the Fedora Editions based on RPM-OSTree there are remotes from which the system downloads commits and applies them, rather than downloading and installing separate RPMs. + +A [Remix][7] in the Fedora ecosystem is an altered, opinionated version of the OS. It covers the needs of a specific niche. This article will dive into the world of building your own filesystem commits based on Fedora IoT Edition. You will become acquainted to the tools, terminology, design and processes of such a system. If you follow the directions in this guide you will end up with your own Fedora IoT Remix. + +### Preparations + +You will need some packages to get started. On non-ostree systems install the packages _ostree_ and _rpm-ostree_. Both are available in the Fedora Linux package repositories. Additionally install _git_ to access the Fedora IoT ostree spec sources. + +``` +sudo dnf install ostree rpm-ostree git +``` + +Assuming you have a spare, empty folder laying around to work with, start there by creating some files and folders that will be needed along the way. + +``` +mkdir .cache .build-repo .deploy-repo .tmp custom +``` + +The _.cache_ directory is used by all build commands around rpm-ostree. The folders _build_ and _deploy_ store separate repositories to keep the build environment separate from the actual remix. The _.tmp_ directory is used to combine the git-managed upstream sources (from Fedora IoT, for example) with modifications kept in the _custom_ directory. + +As you build your own OSTree as derivative from Fedora IoT you will need the sources. Clone them into the folder _.fedora-iot-spec_. They contain several configuration files specifying how the ostree filesystem for Fedora IoT is built, what packages to include, etc. + +``` +git clone -b "f34" https://pagure.io/fedora-iot/ostree.git .fedora-iot-spec +``` + +#### OSTree repositories + +Create repositories to build and store an OSTree filesystem and its contents . A place to store commits and manage their metadata. Wait, what? What is an OSTree commit anyway? Glad you ask! With _rpm-ostree_ you build so-called _libostree commits_. The terminology is roughly based on git. They essentially work in similar ways. Those commits store diffs from one state of the filesystem to the next. If you change a binary blob inside the tree, the commit contains this change. You can deploy this specific version of the filesystem at any time. + +Use the _ostree init_ command to create two _ostree repositories_. + +``` +ostree --repo=".build-repo" init --mode=bare-user +ostree --repo=".deploy-repo" init --mode=archive +``` + +The main difference between the repositories is their mode. Create the build repository in “bare-user” mode and the “production” repository in “archive” mode. The _bare*_ mode is well suited for build environments. The “user” portion additionally allows non-root operation and storing extended attributes. Create the other repository in _archive_ mode. It stores objects compressed; making them easy to move around. If all that doesn’t mean a thing to you, don’t worry. The specifics don’t matter for your primary goal here – to build your own Remix. + +Let me share just a little anecdote on this: When I was working on building ostree-based systems on GitLab CI/CD pipelines and we had to move the repositories around different jobs, we once tried to move them uncompressed in _bare-user_ mode via caches. We learned that, while this works with _archive_ repos, it does not with _bare*_ repos. Important filesystem attributes will get corrupted on the way. + +#### Custom flavor + +What’s a Remix without any customization? Not much! Create some configuration files as adjustment for your own OS. Assuming you want to deploy the Remix on a system with a hardware watchdog (a [Raspberry Pi][8], for example) start with a watchdog configuration file: + +``` +./custom/watchdog.conf +watchdog-device = /dev/watchdog +max-load-1 = 24 +max-load-15 = 9 +realtime = yes +priority = 1 +watchdog-timeout = 15 # Broadcom BCM2835 limitation +``` + +The _postprocess-script_ is an arbitrary shell script executed inside the target filesystem tree as part of the build process. It allows for last-minute customization of the filesystem in a restricted and (by default) network-less environment. It’s a good place to ensure the correct file permissions are set for the custom watchdog configuration file. + +``` +./custom/treecompose-post.sh +#!/bin/sh + +set -e + +# Prepare watchdog +chown root:root /etc/watchdog.conf +chmod 0644 /etc/watchdog.conf +``` + +#### Plant a Treefile + +Fedora IoT is pretty minimal and keeps its main focus on security and best-practices. The rest is up to you and your use-case. As a consequence, the watchdog package is not provided from the get-go. In RPM-OSTree the spec file is called [Treefile][9] and encoded in [JSON][10]. In the _Treefile_ you specify what packages to install, files and folders to exclude from packages, _configuration files_ to add to the _filesystem tree_ and _systemd units_ to enable by default. + +``` +./custom/treefile.json +{ + "ref": "OSTreeBeard/stable/x86_64", + "ex-jigdo-spec": "fedora-iot.spec", + "include": "fedora-iot-base.json", + "boot-location": "modules", + "packages": [ + "watchdog" + ], + "remove-files": [ + "etc/watchdog.conf" + ], + "add-files": [ + ["watchdog.conf", "/etc/watchdog.conf"] + ], + "units": [ + "watchdog.service" + ], + "postprocess-script": "treecompose-post.merged.sh" +} +``` + +The _ref_ is basically the branch name within the repository. Use it to refer to this specific spec in _rpm-ostree_ operations. With _ex-jigdo-spec_ and _include_ you link this _Treefile_ to the configuration of the _Fedora IoT sources_. Additionally specify the _Fedora Updates repo_ in the _repos_ section. It is not part of the sources so you will have to add that yourself. More on that in a moment. + +With _packages_ you instruct _rpm-ostree_ to install the _watchdog_ package. Exclude the _watchdog.conf_ file and replace it with the one from the _custom_ directory by using _remove-files_ and _add-files_. Now just enable the _watchdog.service_ and you are good to go. + +All available treefile options are available in the [official RPM-OSTree documentation][11]. + +#### Add another RPM repository + +In it’s initial configuration the OSTree only uses the initial Fedora 34 package repository. Add the Fedora 34 Updates repository as well. To do so, add the following file to your _custom_ directory. + +``` +./custom/fedora-34-updates.repo +[fedora-34-updates] +name=Fedora 34 - $basearch - Updates +#baseurl=http://download.fedoraproject.org/pub/fedora/linux/updates/$releasever/Everything/$basearch/ +metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f34&arch=$basearch +enabled=1 +repo_gpgcheck=0 +type=rpm +gpgcheck=1 +#metadata_expire=7d +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-fedora-34-$basearch +skip_if_unavailable=False +``` + +Now tell rpm-ostree in the spec for your Remix to include this repository. Use the _treefile_‘s _repos_ section. + +``` +./custom/treefile.json +{ + ... + "repos": [ + "fedora-34", + "fedora-34-updates" + ], + ... +} +``` + +### Build your own Fedora IoT Remix + +You have all that need to build your first ostree based filesystem. By now you setup a certain project structure, downloaded the Fedora IoT upstream specs, and added some customization and initialized the ostree repositories. All you need to do now is throw everything together and create a nicely flavored Fedora IoT Remix salsa. + +``` +cp ./.fedora-iot-spec/* .tmp/ +cp ./custom/* .tmp/ +``` + +Combine the _postprocessing-scripts_ of the _Fedora IoT upstream sources_ and your _custom_ directory. + +``` +cat "./.fedora-iot-spec/treecompose-post.sh" "./custom/treecompose-post.sh" > ".tmp/treecompose-post.merged.sh" +chmod +x ".tmp/treecompose-post.merged.sh" +``` + +Remember that you specified _treecompose-post.merged.sh_ as your post-processing script earlier in _treefile.json_? That’s where this file comes from. + +Note that all the files – systemd units, scripts, configurations – mentioned in _ostree.json_ are now available in _.tmp_. This folder is the build context that all the references are relative to. + +You are only one command away from kicking off your first build of a customized Fedora IoT. Now, kick-of the build with _rpm-ostree compose tree_ command. Now grab a cup of coffee, enjoy and wait for the build to finish. That may take between 5 to 10 minutes depending on your host hardware. See you later! + +``` +sudo rpm-ostree compose tree --unified-core --cachedir=".cache" --repo=".build-repo" --write-commitid-to="$COMMIT_FILE" ".tmp/treefile.json" +``` + +#### Prepare for deployment + +Oh, erm, you are back already? Ehem. Good! – The _.build-repo_ now stores a complete filesystem tree of around 700 to 800 MB of compressed data. The last thing to do before you consider putting this on the network and deploying it on your device(s) (at least for now) is to add a _commit_ with an arbitrary _commit subject_ and _metadata_ and to pull the result over to the _deploy-repo_. + +``` +sudo ostree --repo=".deploy-repo" pull-local ".build-repo" "OSTreeBeard/stable/x86_64" +``` + +The _deploy-repo_ can now be placed on any file-serving webserver and then used as a new _ostree remote_ … theoretically. I won’t go through the topic of security for ostree remotes just yet. As an initial advise though: Always sign OSTree commits with GPG to ensure the authenticity of your updates. Apart from that it’s only a matter of adding the remote configuration on your target and using _rpm-ostree rebase_ to switch over to this Remix. + +As a final thing before you leave to do outside stuff (like with fresh air, sun, ice-cream or whatever), take a look around the newly built filesystem to ensure that everything is in place. + +#### Explore the filesystem + +Use _ostree refs_ to list available refs in the repo or on your system. + +``` +$ ostree --repo=".deploy-repo" refs +OSTreeBeard/stable/x86_64 +``` + +Take a look at the commits of a ref with _ostree log_. + +``` +$ ostree --repo=".deploy-repo" log OSTreeBeard/stable/x86_64 +commit 849c0648969c8c2e793e5d0a2f7393e92be69216e026975f437bdc2466c599e9 +ContentChecksum: bcaa54cc9d8ffd5ddfc86ed915212784afd3c71582c892da873147333e441b26 +Date: 2021-07-27 06:45:36 +0000 +Version: 34 +(no subject) +``` + +List the ostree filesystem contents with _ostree ls_. + +``` +$ ostree --repo=".build-repo" ls OSTreeBeard/stable/x86_64 +d00755 0 0 0 / +l00777 0 0 0 /bin -> usr/bin +l00777 0 0 0 /home -> var/home +l00777 0 0 0 /lib -> usr/lib +l00777 0 0 0 /lib64 -> usr/lib64 +l00777 0 0 0 /media -> run/media +l00777 0 0 0 /mnt -> var/mnt +l00777 0 0 0 /opt -> var/opt +l00777 0 0 0 /ostree -> sysroot/ostree +l00777 0 0 0 /root -> var/roothome +l00777 0 0 0 /sbin -> usr/sbin +l00777 0 0 0 /srv -> var/srv +l00777 0 0 0 /tmp -> sysroot/tmp +d00755 0 0 0 /boot +d00755 0 0 0 /dev +d00755 0 0 0 /proc +d00755 0 0 0 /run +d00755 0 0 0 /sys +d00755 0 0 0 /sysroot +d00755 0 0 0 /usr +d00755 0 0 0 /var +$ ostree --repo=".build-repo" ls OSTreeBeard/stable/x86_64 /usr/etc/watchdog.conf +-00644 0 0 208 /usr/etc/watchdog.conf +``` + +Take note that the _watchdog.conf_ file is located under _/usr/etc/watchdog.conf_. On booted deployment this is located at _/etc/watchdog.conf_ as usual. + +### Where to go from here? + +You took a brave step in building a customized Fedora IoT on your local machine. First I introduced you the concepts and vocabulary so you could understand where you were at and where you wanted to go. You then ensured all the tools were in place. You looked at the ostree repository modes and mechanics before analyzing a typical _ostree configuration_. To spice it up and make it a bit more interesting you made an additional service and configuration ready to role out on your device(s). To do that you added the Fedora Updates RPM repository and then kicked off the build process. Last but not least, you packaged the result up in a format ready to be placed somewhere on the network. + +There are a lot more topics to cover. I could explain how to configure an NGINX to serve ostree remotes effectively. Or how to ensure the security and authenticity of the filesystem and updates through GPG signatures. Also, how one manually alters the filesystem and what tooling is available for building the filesystem. There is also more to be explained about how to test the Remix and how to build flashable images and installation media. + +Let me know in the comments what you think and what you care about. Tell me what you’d like to read next. If you already built Fedora IoT, I’m happy to read your stories too. + +### References + + * [Fedora IoT documentation][12] + * [libostree documentation][13] + * [rpm-ostree documentation][5] + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/build-your-own-fedora-iot-remix/ + +作者:[Alexander Wellbrock][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/w4tsn/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/rpi-816x345.jpg +[2]: https://unsplash.com/@s_tsuchiya?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/raspberry-pi?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/turnon-led-fedora-iot/ +[5]: https://coreos.github.io/rpm-ostree/ +[6]: https://ostreedev.github.io/ostree/ +[7]: https://fedoraproject.org/wiki/Remix +[8]: https://en.wikipedia.org/wiki/Raspberry_Pi +[9]: https://rpm-ostree.readthedocs.io/en/stable/manual/treefile/ +[10]: https://en.wikipedia.org/wiki/JSON +[11]: https://coreos.github.io/rpm-ostree/treefile/ +[12]: https://docs.fedoraproject.org/en-US/iot/ +[13]: https://ostreedev.github.io/ostree/introduction/ From 585b70069201e1e3ae021af3885d2d0ee1c8d159 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Aug 2021 05:02:53 +0800 Subject: [PATCH 007/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210811=20?= =?UTF-8?q?Monitor=20your=20Linux=20system=20in=20your=20terminal=20with?= =?UTF-8?q?=20procps-ng?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md --- ... system in your terminal with procps-ng.md | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md diff --git a/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md b/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md new file mode 100644 index 0000000000..8734871b43 --- /dev/null +++ b/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md @@ -0,0 +1,198 @@ +[#]: subject: "Monitor your Linux system in your terminal with procps-ng" +[#]: via: "https://opensource.com/article/21/8/linux-procps-ng" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Monitor your Linux system in your terminal with procps-ng +====== +How to find the process ID (PID) of a program. The most common Linux +tools for this are provided by the procps-ng package, including the ps +and pstree, pidof, and pgrep commands. +![System monitor][1] + +A process, in [POSIX][2] terminology, is an ongoing event being managed by an operating system’s kernel. A process is spawned when you launch an application, although there are many other processes running in the background of your computer, including programs to keep your system time accurate, to monitor for new filesystems, to index files, and so on. + +Most operating systems have a system activity monitor of some kind so you can learn what processes are running at any give moment. Linux has a few for you to choose from, including GNOME System Monitor and KSysGuard. Both are useful applications on the desktop, but Linux also provides the ability to monitor your system in your terminal. Regardless of which you choose, it’s a common task for those who take an active role in managing their computer is to examine a specific process. + +In this article, I demonstrate how to find the process ID (PID) of a program. The most common tools for this are provided by the [procps-ng][3] package, including the `ps` and `pstree`, `pidof`, and `pgrep` commands. + +### Find the PID of a running program + +Sometimes you want to get the process ID (PID) of a specific application you know you have running. The `pidof` and `pgrep` commands find processes by command name. + +The `pidof` command returns the PIDs of a command, searching for the exact command by name: + + +``` +$ pidof bash +1776 5736 +``` + +The `pgrep` command allows for regular expressions (regex): + + +``` +$ pgrep .sh +1605 +1679 +1688 +1776 +2333 +5736 +$ pgrep bash +5736 +``` + +### Find a PID by file + +You can find the PID of the process using a specific file with the `fuser` command. + + +``` +$ fuser --user ~/example.txt                     +/home/tux/example.txt:  3234(tux) +``` + +### Get a process name by PID + +If you have the PID _number_ of a process but not the command that spawned it, you can do a "reverse lookup" with `ps`: + + +``` +$ ps 3234 + PID TTY      STAT   TIME COMMAND +5736 pts/1    Ss     0:00 emacs +``` + +### List all processes + +The `ps` command lists processes. You can list every process on your system with the `-e` option: + + +``` +$ ps -e | less +PID TTY          TIME CMD +  1 ?        00:00:03 systemd +  2 ?        00:00:00 kthreadd +  3 ?        00:00:00 rcu_gp +  4 ?        00:00:00 rcu_par_gp +  6 ?        00:00:00 kworker/0:0H-events_highpri +[...] +5648 ?        00:00:00 gnome-control-c +5656 ?        00:00:00 gnome-terminal- +5736 pts/1    00:00:00 bash +5791 pts/1    00:00:00 ps +5792 pts/1    00:00:00 less +(END) +``` + +### List just your processes + +The output of `ps -e` can be overwhelming, so use `-U` to see the processes of just one user: + + +``` +$ ps -U tux | less + PID TTY          TIME CMD +3545 ?        00:00:00 systemd +3548 ?        00:00:00 (sd-pam) +3566 ?        00:00:18 pulseaudio +3570 ?        00:00:00 gnome-keyring-d +3583 ?        00:00:00 dbus-daemon +3589 tty2     00:00:00 gdm-wayland-ses +3592 tty2     00:00:00 gnome-session-b +3613 ?        00:00:00 gvfsd +3618 ?        00:00:00 gvfsd-fuse +3665 tty2     00:01:03 gnome-shell +[...] +``` + +That produces 200 fewer (give or take a hundred, depending on the system you're running it on) processes to sort through. + +You can view the same output in a different format with the `pstree` command: + + +``` +$ pstree -U tux -u --show-pids +[...] +├─gvfsd-metadata(3921)─┬─{gvfsd-metadata}(3923) +│                      └─{gvfsd-metadata}(3924) +├─ibus-portal(3836)─┬─{ibus-portal}(3840) +│                   └─{ibus-portal}(3842) +├─obexd(5214) +├─pulseaudio(3566)─┬─{pulseaudio}(3640) +│                  ├─{pulseaudio}(3649) +│                  └─{pulseaudio}(5258) +├─tracker-store(4150)─┬─{tracker-store}(4153) +│                     ├─{tracker-store}(4154) +│                     ├─{tracker-store}(4157) +│                     └─{tracker-store}(4178) +└─xdg-permission-(3847)─┬─{xdg-permission-}(3848) +                        └─{xdg-permission-}(3850) +``` + +### List just your processes with context + +You can see extra context for all of the processes you own with the `-u` option. + + +``` +$ ps -U tux -u +USER  PID %CPU %MEM    VSZ   RSS TTY STAT START  TIME COMMAND +tux  3545  0.0  0.0  89656  9708 ?   Ss   13:59  0:00 /usr/lib/systemd/systemd --user +tux  3548  0.0  0.0 171416  5288 ?   S    13:59  0:00 (sd-pam) +tux  3566  0.9  0.1 1722212 17352 ?  S<sl 13:59  0:29 /usr/bin/pulseaudio [...] +tux  3570  0.0  0.0 664736  8036 ?   SLl  13:59  0:00 /usr/bin/gnome-keyring-daemon [...] +[...] +tux  5736  0.0  0.0 235628  6036 pts/1 Ss 14:18  0:00 bash +tux  6227  0.0  0.4 2816872 74512 tty2 Sl+14:30  0:00 /opt/firefox/firefox-bin [...] +tux  6660  0.0  0.0 268524  3996 pts/1 R+ 14:50  0:00 ps -U tux -u +tux  6661  0.0  0.0 219468  2460 pts/1 S+ 14:50  0:00 less +``` + +### Troubleshoot with PIDs + +If you’re having trouble with a specific application, or you’re just curious about what else on your system an application uses, you can see a memory map of the running process with `pmap`: + + +``` +$ pmap 1776 +5736:   bash +000055f9060ec000   1056K r-x-- bash +000055f9063f3000     16K r---- bash +000055f906400000     40K rw---   [ anon ] +00007faf0fa67000   9040K r--s- passwd +00007faf1033b000     40K r-x-- libnss_sss.so.2 +00007faf10345000   2044K ----- libnss_sss.so.2 +00007faf10545000      4K rw--- libnss_sss.so.2 +00007faf10546000 212692K r---- locale-archive +00007faf1d4fb000   1776K r-x-- libc-2.28.so +00007faf1d6b7000   2044K ----- libc-2.28.so +00007faf1d8ba000      8K rw--- libc-2.28.so +[...] +``` + +### Process IDs + +The **procps-ng** package has all the commands you need to investigate and monitor what your system is using at any moment. Whether you’re just curious about how all the disparate parts of a Linux system fit together, or whether you’re investigating an error, or you’re looking to optimize how your computer is performing, learning these commands gives you a significant advantage for understanding your OS. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-procps-ng + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/system-monitor-splash.png?itok=0UqsjuBQ (System monitor) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: https://gitlab.com/procps-ng From 383b980fd3bd29e4b4d656e12fb7771ed1331d42 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Aug 2021 05:03:05 +0800 Subject: [PATCH 008/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210811=20?= =?UTF-8?q?My=20first=20programming=20language=20and=20early=20adventures?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210811 My first programming language and early adventures.md --- ...ogramming language and early adventures.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210811 My first programming language and early adventures.md diff --git a/sources/tech/20210811 My first programming language and early adventures.md b/sources/tech/20210811 My first programming language and early adventures.md new file mode 100644 index 0000000000..529b8ef4f9 --- /dev/null +++ b/sources/tech/20210811 My first programming language and early adventures.md @@ -0,0 +1,116 @@ +[#]: subject: "My first programming language and early adventures" +[#]: via: "https://opensource.com/article/21/8/my-first-programming-language" +[#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My first programming language and early adventures +====== +A student in 1988 in Poland is invited to a computer lab. +![Old UNIX computer][1] + +A few days ago, contributors to Opensource.com were asked to share our personal stories about how we got into programming. Many entertaining and fascinating responses were submitted. It would be interesting to quantify these data in time. Intriguing patterns emerged. The 70s generation was nostalgic about Fortran, punch cards, and dial-up access to shared mainframes. 80s kids (amongst which I qualify) shared stories of C, BASIC, or Pascal and their beloved Atari and Commodore computers. Surprisingly few stories from the 90s arrived. Almost like there's a generation gap. Maybe teenagers were running away in horror from C++, MFC, and the dreaded Hungarian notation, which was the order of the day. Then there's strange silence from the youngest generation. Maybe our young Raspberry Pi enthusiasts are [too busy making things][2]. + +Here's more about my road to programming. + +### My first programming language + +My first programming language was Microsoft BASIC. I learned it on the mighty MSX SpectraVideo 738 home PC. The MSX standard was a home computer architecture based on the Z80 CPU. Developed in the 80s by Microsoft, it was produced by Sony, Philips, Pioneer, Sharp, Yamaha, and many other vendors. My home country is Poland, and we were still under communist rule, and cut off from modern IT technology due to economic sanctions against us. But the winds of change came during the late 80s, and the MSX Spectravideo made it to my school. + +![MSX Specravideo 738][3] + +Image CC BY-SA [Hans Otten][4] + +I was a student at the time, so I wasn't paid. I got so fascinated with programming that I would be willing to pay myself for the pleasure. Thankfully, all schools and universities were free at that time. Imagine you would start your IT career with zero debt! I started during my early high school years, in 1988 in Poland. I had been growing long hair, playing guitar, listening to Black Sabbath, and hoping to have a rock band one day—all the while missing out on computers. And I had a friend, who I'll call Mr. Briefcase. He was another student, and also a computer nerd with a reputation. He entered the room one day and asked _how are you?_ He had to listen to me for a while, because the Polish _will_ tell you how they are, if you ask. Then he said: _"Hey, I'm going to the computer lab. You can join me. There's no one there today except me."_ I jumped excitedly: _"The entire evening?"_ He answered: _"Sure thing. I'll be busy, but you can play games and stuff."_ + +When we first entered the lab, it felt like a Star Destroyer command center from [Star Wars][5]. The following hardware was available: + + * One beautiful IBM PC clone, Spectravideo SVI-838 xPress-16 with an excellent clickety keyboard—no modern mechanical keyboard has yet been able to replicate that experience. Unfortunately, it was off-limits for newcomers like me. + * ZX Spectrums—I was not too fond of these, since they looked like toys with their rubbery keyboards. + * Futuristic MSX SVI-738 computers with color screens and Seikosha dot-matrix printers. + + + +The choice was made. I played for a while but got bored very quickly. I asked Mr. Briefcase: + +**Me**: _So what is it that you’re doing?_  + +**Briefcase**: _Programming._  + +**Me**: _How do you do that?_  + +**Briefcase**: _Here._ + +And he threw a manual at me. + +### Hello world + +I ran through the "hello world!" examples, and then stumbled onto a chapter about computer graphics. It turned out that our MSX had impressive graphic capabilities. After an hour of struggling with English, which was still foreign to me, there it was—my first working computer program, written in BASIC. I was thrilled, flabbergasted, and completely hooked. I could command this computing device to _do things_. Beautiful things. Utterly stupid things. Boring things. And it would do them all, without hesitation, line after line, only sometimes responding with `Syntax error!` + +It was pure magic! The very next day, I signed up for the computer lab. + +### Computer graphics + +In the following months, I had a lot of fun with computer graphics. Those machines were amazingly efficient in educating young people in computing. Programming a language interpreter was the only way to interact with it. It booted, and you had to enter commands to do anything useful. If you were curious enough, you would inevitably ask—are there more commands? In the end, you got sucked into programming without even knowing it. The entry threshold was so low. + +![Code][6] + +Image CC0 Alan Smithee + +For example, to draw a circle on the screen, all I had to do was: + + * Boot the computer and wait a few seconds. Yes, it only took seconds to boot! + * Write `10 CIRCLE 100`,`100`,`50` and press **ENTER**. Yes, we had to number the lines ourselves. + * Write `run` and press **ENTER**. + + + +There was a simplicity to programming in those days. Today, you have choices to make before you write a single line of code. You have to choose your development platform (web, desktop, both), your programming language, your framework, and more. + +Of course there are always choices to make, but it feels simpler when all you need are a few resources, and when your computer has only **64kB** of memory—the usual on 8-bit machines. To give you a sense of scale—a single high-resolution desktop icon on my Pop_OS Linux box can be bigger than that. Yet within this tiny memory, it could run an operating system and an academic-grade compiler. It could run graphic programs with flawless sprite animation and collision detection. It would play percussion tracks through a programmable noise generator. I have to admit, [I know it's possible][7] but I hardly know where to begin with these kinds of activities today. + +### Pascal and beyond + +My MSX had a 3.5" floppy drive—an amazing thing these days. One day we received floppies with the CPM 2.2 operating system and a [Turbo Pascal 3.0 compiler][8]. This is how I tasted my first actual programming language, while avoiding further exposure to BASIC. Turbo Pascal was beautiful: expressive, concise, safe, and structured. There's an anecdotal theory about why programmers from Central and Eastern Europe have such highly valued skills. In western countries, C and C++ were the order of the day, full of fun quirks and idiosyncrasies. Over here though, we started with Pascal. It was a programming language of choice in schools and universities. The differences between these two are substantial, and the theory is that they wired our young minds in a substantially different way. + +![Turbo Pascal][9] + +Image [Public Domain][10] + +Pascal was much more disciplined than C, and it was as "close to the metal" as it gets. Pascal had pointers, direct memory operations, and even `asm ... end` block for assembly code injection. Yet pointers weren't thrown in everywhere like they are in C, and buffer overflow attacks through null-terminated strings were non-existent. Strings in Pascal is just an array of characters, and only the first entry contains the explicit string length. Simple! It also had a proper module system, precompiled libraries, strict type control, and a blazing fast compiler on top of that. + +Turbo Pascal had an enormous impact on the way I think while programming. Eventually it implemented object-oriented programming, and smoothly prepared me for complex software architectures and programming on Windows with Borland Delphi. I touched C and C++ only when I had no other choice. + +Decades later, I've realized that all my career, I have unconsciously followed in the footsteps of [Anders Hejlsberg][11]. He and his team were creators of a highly successful line of Turbo compilers at Borland. Then they created Delphi, which was a relief for Windows programmers struggling with Visual Basic, WFC, MFC, Charles Petzold books, and Hungarian notation. After Borland, he continued at Microsoft and created [.NET][12], which I happily jumped into. Finally, he created TypeScript, which became the backbone of modern enterprise web development. + +Nowadays, I'm busy architecting and developing large web applications for enterprises. JavaScript and TypeScript is the order of the day, with back-ends running on NodeJS, .NET, or Python and writing little utilities and scripts with Python and Bash, and struggling with complexities of cloud computing and [YAML][13]. After all these years, I still enjoy the thrill. I can't imagine a more satisfying job that keeps challenging me and never gets dull and boring. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/my-first-programming-language + +作者:[Tomasz Waraksa][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tomasz +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/retro_old_unix_computer.png?itok=SYAb2xoW (Old UNIX computer) +[2]: https://opensource.com/articles/21/3/raspberry-pi-projects +[3]: https://opensource.com/sites/default/files/svi738.jpg (MSX Specravideo 738) +[4]: http://msx.hansotten.com/special-msx-hardware/svi-738-xpress/ +[5]: https://opensource.com/article/21/5/open-source-star-wars +[6]: https://opensource.com/sites/default/files/basic.jpg (Code) +[7]: https://opensource.com/article/17/10/python-101 +[8]: https://en.wikipedia.org/wiki/Turbo_Pascal +[9]: https://opensource.com/sites/default/files/uploads/turbo-pascal.png (Turbo Pascal) +[10]: https://commons.wikimedia.org/wiki/File:Turbopascal_6.png +[11]: https://en.wikipedia.org/wiki/Anders_Hejlsberg +[12]: https://opensource.com/article/19/9/getting-started-net +[13]: https://www.redhat.com/sysadmin/yaml-beginners From 5729c701506030b734195811b44d8e803f8bf358 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 12 Aug 2021 05:03:15 +0800 Subject: [PATCH 009/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210811=20?= =?UTF-8?q?My=20top=205=20tips=20for=20setting=20up=20Terraform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210811 My top 5 tips for setting up Terraform.md --- ... My top 5 tips for setting up Terraform.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20210811 My top 5 tips for setting up Terraform.md diff --git a/sources/tech/20210811 My top 5 tips for setting up Terraform.md b/sources/tech/20210811 My top 5 tips for setting up Terraform.md new file mode 100644 index 0000000000..143727fb09 --- /dev/null +++ b/sources/tech/20210811 My top 5 tips for setting up Terraform.md @@ -0,0 +1,75 @@ +[#]: subject: "My top 5 tips for setting up Terraform" +[#]: via: "https://opensource.com/article/21/8/terraform-tips" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My top 5 tips for setting up Terraform +====== +These are the lessons I've learned after five years with Terraform. +![Puzzle pieces coming together to form a computer screen][1] + +Working with Terraform for over five years has taught me some key lessons. Five practices have been critical to having a logical and usable Terraform setup regardless of the size of the team or the nature of the project. + +### 1\. Know your target audience. + +This one might seem obvious, but I've seen it go wrong several times. When organizing Terraform code, either standardizing the directory structure or defining naming conventions, it's vital to consider the intended audience. Will your team be using these Terraform scripts and modules? Are you handing the work over to another team? Will new people be joining your team sooner or later? Are you working on this project solo? Will you be using this setup in six months or a year, or will it be assigned to someone else? + +Questions like these affect several decisions. Ideally, you should have [Remote State][2] and [State Locking][3] in place regardless of the team size now or in the future. Remote State will ensure your laptop is not the only place your Terraform works, and State Locking will ensure that only one person at a time is changing the infrastructure. + +The naming convention should make sense to the eventual owners of the project, not just the team that is writing the code. If the project is for another team, make sure they have a say in the naming convention. If non-technical stakeholders or internal security/GCR teams review the code, make sure they check the naming convention. In addition to resource names, you should leverage resource tags to highlight any data classification/privacy requirements (high, medium, low) for more careful examination by reviewers. + +### 2\. Reuse. Reuse. Reuse. + +The [Terraform Registry][4] provides a library of ready-to-use modules for the most common use-cases. I've written about the extensive parameterization available in the VPC module and security groups. Simply calling modules with different parameters is enough to handle most, if not all, potential use cases. Reuse these shared modules as much as possible to avoid endless typing, testing, checking, fixing, and refactoring. + +I've also found that separating modules and resources based on the frequency of use or change is beneficial. For example, infrastructure scaffolding used only once belongs together, such as setting up the VPC, security groups, routing tables, VPC endpoints, and so on. But things like private hosted zone entries, autoscaling groups, target groups, load balancers, etc., might change with every deployment, so separating these from the one-time scaffolding will make code reviews easier and debugging faster. + +### 3\. Be explicit rather than implicit. + +There are common patterns to Terraform code that I have seen lead to incorrect assumptions baked into the design. Teams can assume that the Terraform version used to write the code today will never change, or the external modules won't change, or the providers they are using won't change. These lead to invisible issues a few weeks down the road when these external dependencies inevitably get updated. + +Ensure you explicitly define versions everywhere possible: In the main Terraform block, in the provider block, in the module block, etc. Defining versions ensures that your dependent libraries stay frozen so that you can explicitly update dependencies when required after thorough discussions, reviews, and testing. + +### 4\. Automate everywhere. Your laptop. Your shared VM. Your CI/CD. + +Leveraging automation at every stage of the deployment process can avoid future problems before they even arise. + +Use [Git pre-commit hooks][5] to run `terraform fmt` and `terraform validate` before you commit your code. Pre-commit hooks ensure that code is, at a bare minimum, adequately formatted and syntactically correct. Check-in this pre-commit file to the repo, and everyone on your team can benefit from the same automation. This small but vital quality control at the first step of the process can achieve substantial time savings as your project progresses. + +All modern deployment tools have CI processes. You can use these to run SAST and unit testing tools when pushing your code to origin. I've written on my blog about how [Checkov can test Terraform code for security and compliance and create custom checks][6] for organization-specific conventions. Add these unit testing tools to your CI pipeline to improve code quality and robustness. + +### 5\. Have an awesome README.md. + +We all like to think that Terraform code is self-documenting. Sure it is, but only if your future team already knows your company's naming conventions and guidelines and secret handshakes and inside jokes and whatever else your repo contains besides valid Terraform code. Getting into the habit of having a good `README.md` can be a huge time saver, and it keeps your team honest by holding them accountable for everything explicitly committed to in the README. + +At a minimum, your README should contain the steps to initialize the right Terraform environment on your workstations (Linux, Windows, Mac, and so on), including the Terraform version to install. It should specify the required dependencies (Checkov, TerraGrunt, and others) with versions and any handy Linux aliases your team uses (some people like to define `tff` as a short-hand for `terraform fmt`). Most importantly, the branching and PR review strategy and process, naming conventions, and resource tagging standards should be specified. + +The README should pass a simple test: if a new member joins your team tomorrow, is the README enough to teach them what to do and how to do it correctly? If not, you may find yourself hosting never-ending standards and process meetings repeatedly for the next few months. + +### Wrap up + +After many years of working with Terraform, these are my five best bits of wisdom to pass along. Feel free to share your own best practices below. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/terraform-tips + +作者:[Ayush Sharma][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ayushsharma +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://www.terraform.io/docs/language/state/index.html +[3]: https://www.terraform.io/docs/language/state/locking.html +[4]: https://registry.terraform.io/ +[5]: https://opensource.com/life/16/8/how-construct-your-own-git-server-part-6 +[6]: https://notes.ayushsharma.in/2021/07/cloud-infrastructure-sast-terraform-checkov From 479ae2ff4f7e972b5a4fcc9084accc5477506945 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 12 Aug 2021 10:30:35 +0800 Subject: [PATCH 010/290] Rename sources/tech/20210811 My first programming language and early adventures.md to sources/talk/20210811 My first programming language and early adventures.md --- ...20210811 My first programming language and early adventures.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210811 My first programming language and early adventures.md (100%) diff --git a/sources/tech/20210811 My first programming language and early adventures.md b/sources/talk/20210811 My first programming language and early adventures.md similarity index 100% rename from sources/tech/20210811 My first programming language and early adventures.md rename to sources/talk/20210811 My first programming language and early adventures.md From 4afc4b4980db015760dea8ab1e498646b63bb3c6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 12 Aug 2021 11:01:40 +0800 Subject: [PATCH 011/290] TSL&PRF --- ...Top 7 Linux Laptops You Can Buy in 2021.md | 237 ------------------ ...Top 7 Linux Laptops You Can Buy in 2021.md | 231 +++++++++++++++++ 2 files changed, 231 insertions(+), 237 deletions(-) delete mode 100644 sources/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md create mode 100644 translated/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md diff --git a/sources/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md b/sources/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md deleted file mode 100644 index 07a6bdab60..0000000000 --- a/sources/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md +++ /dev/null @@ -1,237 +0,0 @@ -[#]: subject: (Top 7 Linux Laptops You Can Buy in 2021) -[#]: via: (https://news.itsfoss.com/best-linux-laptops-2021/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Top 7 Linux Laptops You Can Buy in 2021 -====== - -Linux laptops are the perfect alternatives to macOS and Windows-powered laptops. - -Technically, you can turn any laptop of your choice into a Linux machine by choosing to install any Linux distribution available. - -But, here, our focus will be on the laptops that offer Linux out-of-the-box, ensuring the best compatibility and support no matter what kind of budget you have. - -### Linux Laptops by Popular Brands - -It is often the best choice for a consumer to opt for a Linux laptop built by a popular manufacturer. - -You do not have to worry about the after-sales, warranty extensions, and service repairs. - -Dell and Lenovo are usually the ones who provide laptops with Linux pre-installed. - -Do note that everything is subject to availability depending on the country/region. - -*_Pricing mentioned in this article is converted to USD for easy comparison, excluding shipping and other extras._ - -#### 1\. Lenovo Thinkpad X1 Carbon (Gen 8 / Gen 9) - -![][1] - -_**Pricing**: Starts at **$1535**_ - -The entire Thinkpad series by Lenovo is a popular choice among Linux users. It is built to last and offers good compatibility - -However, it stays on the expensive side. - -You will have three choices to go with depending on what you go for. If you are customizing a Gen 9 Thinkpad laptop, you will have Ubuntu 20.04 and Fedora 33 as your options to have installed. - -For Gen 8 models, it seems that Fedora 33 is off the table, and it is Fedora 32 instead, along with Ubuntu 20.04. - -All the variants are powered by Intel chipsets, 10th gen for Gen 8 and 11th gen for Gen 9. - -Most of the other specifications remain similar with a 14-inch display (FHD, WQHD, and UHD options available), up to 32 GB RAM, 1 TB SSD, fingerprint reader, and Wi-Fi 6 support. - -[Thinkpad X1 Carbon (Gen 9)][2] - -[Thinkpad X1 Carbon (Gen 8)][3] - -#### 2\. Dell XPS 13 Developers Edition - -![][4] - -_**Pricing**: Starts at **$1059**_ - -Dell XPS series is an impressive laptop lineup to consider running Linux. - -It has been tailored to run Linux (Ubuntu 20.04) with developers in mind. - -You get a 13.4-inch display (FHD and UHD options available), 11th gen i5/i7 processor, up to 32 GB RAM, 2 TB SSD, fingerprint reader, and Wi-FI 6 support. - -[Dell XPS 13 Developer Edition][5] - -### Laptops by Linux-only Manufacturers - -If you do not want mainstream options but some unique choices to support Linux-only manufacturers in the process, there are a couple of them that you can consider. - -#### 1\. System76 Gazelle - -![][6] - -_**Pricing**: Starts at **$1499**_ - -System76’s laptop will come baked in with their Pop!_OS operating system which is based on Ubuntu but provides a **hassle-free out-of-the-box experience**. - -It is safe to assume that System76 is like the Apple of Linux laptops who try their best to optimize Pop!_OS for their hardware offered. - -They have total control over the software and hardware, so that should be some exciting product integration for end consumers. - -Along with impressive essentials like 144 Hz 16.5-inch display, i7 11th gen processor, up to 8 TB NVMe SSD support—you also get an RTX 3050 GPU which should enable you to tackle a variety of demanding tasks on your laptop. - -While there are some other laptops by System76, it was not available at the time of writing this. So, feel free to check out the official store page and order a customized configuration. - -System76 Gazelle - -#### 2\. Purism Laptop - -![][7] - -![][8] - -_**Pricing**: Starts at **$1599**_ - -A laptop by Purism can be an option if you are a security-conscious user. - -Librem 14 is one of their latest laptops that comes baked in with [PureOS][9] (also built by them). - -While it may not offer the latest generation processors, you should be fine with the i7 10th Gen chip on board. - -It supports up to 64 GB of RAM and features hardware kill switches to disable the webcam, headphone jack, Bluetooth, or wireless audio - -[Librem 14][10] - -#### 3\. TUXEDO Aura 15 - -![][7] - -![][11] - -_**Pricing**: Starts at **$899**_ - -If you want an AMD-powered laptop (with its last-gen processor Ryzen 7 4700U), Aura 15 by TUXEDO Computers is a great pick. - -The key specifications include a Full HD display, up to 64 GB RAM, Wi-Fi 6 support, and an LTE module. - -It comes with either Ubuntu or TUXEDO OS (based on Ubuntu Budgie) as per your customization. - -[TUXEDO Aura 15][12] - -#### 4\. TUXEDO Stellaris 15 - -![][7] - -![][13] - -_**Pricing**: Starts at **$2160**_ - -If you are looking for the latest and greatest powerhouse with options to get RTX 3080 on board, this should be a fantastic option. - -It offers the latest Intel/Ryzen processor with the configuration choices and features a 3K-res display with a 165 Hz refresh rate. - -Definitely not something that you would find convenient to travel with, but if you need the computing power, you can choose to go with it. - -TUXEDO Stellaris 15 - -#### 5\. Slimbook Pro X - -![][14] - -_**Pricing:** Starts at **$1105**_ - -Slimbook focuses on lighter Laptop models that you can conveniently travel with. - -It gives you the option to choose from a variety of distributions that include Ubuntu (_GNOME, KDE, MATE_), KDE Neon, Manjaro, and Fedora. - -You get most of the essential specifications that include up to 2 TB SSD support, 64 GB of RAM, Full HD IPS display, and more. - -While you get options for Intel and Ryzen (last-gen processors) coupled with Nvidia and Vega graphics respectively, only Ryzen was available in stock at the time of writing this. - -Slimbook Pro X - -#### 6\. Slimbook Essential - -![][1] - -_**Pric**__**ing:** Starts at **$646**_ - -An impressive option for a budget-friendly Linux laptop. - -It offers both Ryzen and Intel variants (last-gen) to choose from. You should get the basic specifications that include up to 64 GB RAM, 2 TB SSD support, minus a great screen and dedicated graphics onboard. - -[Slimbook Essential][15] - -#### 7\. Jupiter 14 Pro by Juno Computers - -![][16] - -_**Pricing**: Starts at **$1199**_ - -Featuring the 11th gen Intel processors, Jupiter 14 by Juno Computers is a sweet deal with NVIDIA GTX 1650 on board. - -It comes baked in with Ubuntu 20.04 with no other options to choose from. - -The base configuration includes 16 GB RAM, which could make the value offering slightly better compared to some others. - -You will find the ability to choose your region on their website (UK/Europe or US/Canada), make sure to utilize that. - -[Jupiter Pro 14][17] - -#### Honorable Mention: **PineBook Pro** - -![][18] - -PineBook Pro is an ARM-based laptop (with Manjaro ARM edition) that is budget-friendly and should work fine for a lot of basic tasks on Linux. - -It is out of stock (until further notice) at the time of writing this. However, you might want to check that for yourself when you read this. - -[Pinebook Pro][19] - -### Wrapping Up - -If you do not like the choices presented here, you may check out [other places from where you can by Linux laptops][20]. Depending on your budget, pick what you feel is best for you. - -After all, everything comes with Linux baked in. Some give you the ability to choose from multiple distros but most of them stick to Ubuntu pre-installed. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/best-linux-laptops-2021/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x1/X1-Carbon-G9/p/22TP2X1X1C9 -[3]: https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x1/X1-Carbon-Gen-8-/p/22TP2X1X1C8 -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://www.dell.com/en-us/work/shop/dell-laptops-and-notebooks/new-xps-13-developer-edition/spd/xps-13-9310-laptop/ctox139w10p2c3000u -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/librem14.png?resize=780%2C780&ssl=1 -[9]: https://www.pureos.net -[10]: https://puri.sm/products/librem-14/ -[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/tuxedo-aura-15.jpg?resize=780%2C780&ssl=1 -[12]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks/15-16-inch/TUXEDO-Aura-15-Gen1.tuxedo -[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/tuxedo-stellaris.jpg?resize=780%2C780&ssl=1 -[14]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[15]: https://slimbook.es/en/essential-en -[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[17]: https://junocomputers.com/us/product/jupiter-14-pro/ -[18]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[19]: https://www.pine64.org/pinebook-pro/ -[20]: https://itsfoss.com/get-linux-laptops/ diff --git a/translated/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md b/translated/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md new file mode 100644 index 0000000000..1c2fc8c8e9 --- /dev/null +++ b/translated/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md @@ -0,0 +1,231 @@ +[#]: subject: (Top 7 Linux Laptops You Can Buy in 2021) +[#]: via: (https://news.itsfoss.com/best-linux-laptops-2021/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +2021 年可以购买的 10 大 Linux 笔记本电脑 +====== + +> 想挑选一台安装有 Linux 的新笔记本电脑?这里有几个选项可以考虑。 + +![](https://news.itsfoss.com/wp-content/uploads/2021/07/linux-laptop.webp) + +Linux 笔记本电脑是 MacOS 和 Windows 笔记本电脑的完美替代品。 + +从技术上讲,你可以通过安装任何你能找到的 Linux 发行版,将你选择的任何笔记本电脑变成一台 Linux 机器。 + +但是,在这里,我们的重点将放在提供 Linux 开箱即用体验的笔记本电脑上,确保无论你有什么样的预算,都能获得最佳的兼容性和支持。 + +### 大众品牌的 Linux 笔记本电脑 + +对于消费者来说,选择由大众品牌制造商生产的 Linux 笔记本电脑往往是最好的选择。 + +你不必担心售后、延长保修期和服务维修等问题。 + +戴尔和联想是通常提供预装了 Linux 的笔记本电脑的厂商之一。 + +请注意,这会因国家/地区的情况而定。 + +*本文中提到的价格已转换为美元,以方便比较,不包括运费和其他额外费用。* + +#### 1、联想 Thinkpad X1 Carbon (第 8 代/第 9 代) + +![][1] + +**价格**:起价为 **$1535** + +联想的整个 Thinkpad 系列是 Linux 用户的一个热门选择。它经久耐用,提供了良好的兼容性。 + +然而,它的价格一直偏高。 + +你有三种选择,这取决于你的需求。如果你定制一台第 9 代 Thinkpad 笔记本电脑,你可以选择安装 Ubuntu 20.04 和 Fedora 33。 + +对于第 8 代机型,似乎 Fedora 33 不在考虑之列,而是提供了 Fedora 32 和 Ubuntu 20.04。 + +所有的配置都采用英特尔芯片组,第 8 代采用的是 10 代芯片组,第 9 代采用 11 代芯片组。 + +其他的大部分规格都相似,有 14 英寸显示屏(FHD、WQHD 和 UHD 可供选择)、高达 32GB 的内存、1TB 固态硬盘、指纹识别器和 Wi-Fi 6 支持。 + +- [Thinkpad X1 Carbon (第 9 代)][2] +- [Thinkpad X1 Carbon (第 8 代)][3] + +#### 2、戴尔 XPS 13 开发者版 + +![][4] + +**价格**:起价为 **$1059** + +戴尔 XPS 系列是一个令人印象深刻的、可以考虑运行 Linux 的笔记本电脑系列。 + +它是为开发者运行 Linux(Ubuntu 20.04)而定制的。 + +你可以得到一个 13.4 英寸的显示屏(有 FHD 和 UHD 可选)、第 11 代 i5/i7 处理器、高达 32GB 的内存、2TB 固态硬盘、指纹识别器,以及 Wi-Fi 6 支持。 + +- [戴尔 XPS 13 开发者版][5] + +### 纯 Linux 制造商的笔记本电脑 + +如果你不想要主流的选择,而是想要一些独特的选择,那你可以选择支持纯 Linux 制造商,有几个是你可以考虑的。 + +#### 1、System76 Gazelle + +![][6] + +**价格**:起价为 **$1499** + +System76 的笔记本电脑将内置他们的 Pop!_OS 操作系统,该系统基于 Ubuntu,但提供了**无忧的开箱即用体验**。 + +可以把 System76 视作 Linux 笔记本电脑中的苹果电脑,他们尽力为其提供的硬件优化了 Pop!_OS。 + +他们可以完全控制这些软件和硬件,所以这对终端消费者来说应该是令人兴奋的产品整合。 + +除了 144Hz 的 16.5 英寸显示屏、第 11 代 i7 处理器、高达 8TB 的 NVMe 固态硬盘支持等令人印象深刻的基本配置外,你还会有一个 RTX 3050 GPU,应该可以让你在笔记本电脑上处理各种苛刻的任务。 + +虽然 System76 还有一些其他型号的笔记本电脑,但在写这篇文章时,还没有上市。因此,请随时查看官方商店页面,订购定制的配置。 + +- [System76 Gazelle][7] + +#### 2、Purism 笔记本电脑 + +![][8] + +**价格**:起价为 **$1599** + +如果你是一个有安全意识的用户,Purism 的笔记本电脑可以作为一个选择。 + +Librem 14 是他们最新的笔记本电脑之一,带有 [PureOS][9](也是由他们制造的)。 + +虽然它可能没有提供最新一代的处理器,但你应该对机上的第 10 代 i7 芯片感到满意吧。 + +它支持高达 64GB 的内存,并具有硬件封禁开关,可以禁用网络摄像头、耳机插孔、蓝牙或无线音频。 + +- [Librem 14][10] + +#### 3、TUXEDO Aura 15 + +![][11] + +**价格**:起价为 **$899** + +如果你想要一台 AMD 的笔记本电脑(采用上一代处理器 Ryzen 7 4700U),TUXEDO 计算机公司的 Aura 15 是一个不错的选择。 + +主要规格包括全高清显示屏、高达 64GB 的内存、支持 Wi-Fi 6,以及一个 LTE 模块。 + +它配备了 Ubuntu 或 TUXEDO 操作系统(基于 Ubuntu Budgie),可根据你的定制要求。 + +- [TUXEDO Aura 15][12] + +#### 4、TUXEDO Stellaris 15 + +![][13] + +**价格**:起价为 **$2160** + +如果你正在寻找最新和最强大的笔记本电脑,并希望用上 RTX 3080 显卡,这应该是一个非常好的选择。 + +它提供了最新的英特尔/AMD Ryzen 处理器的配置选择,并具有 165Hz 刷新率的 3K 分辨率显示屏。 + +它绝不是你会觉得在旅行时带着方便的东西,但如果你需要计算能力,你可以选择它。 + +- [TUXEDO Stellaris 15][21] + +#### 5、Slimbook Pro X + +![][14] + +**价格**:起价为 **$1105** + +Slimbook 专注于旅行方便携带的轻薄笔记本电脑型号。 + +你可以选择各种发行版,包括 Ubuntu(GNOME、KDE、MATE)、KDE Neon、Manjaro 和 Fedora。 + +你可以得到大部分的基本规格,包括支持高达 2TB 的固态硬盘、64GB 的内存、全高清 IPS 显示屏等等。 + +虽然你可以选择英特尔和 AMD Ryzen(最新一代处理器),并分别与 Nvidia 和 Vega 图形处理器相结合,但在写这篇文章时只有 Ryzen 型号有库存。 + +- [Slimbook Pro X][22] + +#### 6、Slimbook Essential + +![][23] + +**价格**:起价为 **$646** + +一个令人印象深刻的预算友好型 Linux 笔记本电脑的选择。 + +它提供了 AMD Ryzen 和英特尔的变体(最后一代)供你选择。你得到硬件规格还可以,包括高达 64GB 的内存、2TB 的 SSD 支持,但是要少一个大的屏幕和板载专用显卡。 + +- [Slimbook Essential][15] + +#### 7、Jupiter 14 Pro + +![][16] + +**价格**:起价为 **$1199** + +Juno 计算机公司的 Jupiter 14 采用了第 11 代英特尔处理器,并配备了 NVIDIA GTX 1650,价格诱人。 + +它内置了 Ubuntu 20.04 系统,没有其他系统可供选择。 + +基本配置包括 16GB 内存,与其他一些产品相比,这可能更物超所值一些。 + +你会发现在他们的网站上可以选择你的地区(英国/欧洲或美国/加拿大),请确保利用这一点。 + +- [Jupiter Pro 14][17] + +#### 荣誉奖:PineBook Pro + +![][18] + +PineBook Pro 是一款基于 ARM 的笔记本电脑(采用 Manjaro ARM 版),预算低廉,对于 Linux 上的很多基本任务来说,应该可以正常工作。 + +在写这篇文章的时候,它已经没有库存了(直到进一步通知)。然而,当你看到这篇文章时,可以自己去看看一下。 + +- [Pinebook Pro][19] + +### 总结 + +如果你不喜欢这里的选择,你可以去看看 [其他可以购买 Linux 笔记本电脑的地方][20]。根据你的预算,选择你觉得最适合你的东西。 + +毕竟,所有的东西都有 Linux 的影子。有些可以让你能够从多个发行版中选择,但大多数人都坚持使用预装的 Ubuntu。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/best-linux-laptops-2021/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/thinkpad-x1-carbon.jpg?w=1060&ssl=1 +[2]: https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x1/X1-Carbon-G9/p/22TP2X1X1C9 +[3]: https://www.lenovo.com/us/en/laptops/thinkpad/thinkpad-x1/X1-Carbon-Gen-8-/p/22TP2X1X1C8 +[4]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/dell-xps-13.jpg?w=1200&ssl=1 +[5]: https://www.dell.com/en-us/work/shop/dell-laptops-and-notebooks/new-xps-13-developer-edition/spd/xps-13-9310-laptop/ctox139w10p2c3000u +[6]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/system76-gazelle.jpg?w=1200&ssl=1 +[7]: https://system76.com/laptops/gazelle +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/librem14.png?resize=780%2C780&ssl=1 +[9]: https://www.pureos.net +[10]: https://puri.sm/products/librem-14/ +[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/tuxedo-aura-15.jpg?resize=780%2C780&ssl=1 +[12]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks/15-16-inch/TUXEDO-Aura-15-Gen1.tuxedo +[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/tuxedo-stellaris.jpg?resize=780%2C780&ssl=1 +[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/slimbook-pro.jpg?resize=1568%2C849&ssl=1 +[15]: https://slimbook.es/en/essential-en +[16]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/jupiter-pro.png?w=1314&ssl=1 +[17]: https://junocomputers.com/us/product/jupiter-14-pro/ +[18]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/pinebook-pro.png?w=869&ssl=1 +[19]: https://www.pine64.org/pinebook-pro/ +[20]: https://itsfoss.com/get-linux-laptops/ +[21]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks/15-16-inch/TUXEDO-Stellaris-15-Gen3.tuxedo +[22]: https://slimbook.es/en/store/slimbook-pro-x +[23]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/slimbook-essential.jpg?resize=1568%2C882&ssl=1 \ No newline at end of file From ee38d353ce5a75bcd1222609e2212019269dca72 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 12 Aug 2021 11:04:57 +0800 Subject: [PATCH 012/290] PUB @wxy https://linux.cn/article-13672-1.html --- .../20210725 Top 7 Linux Laptops You Can Buy in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210725 Top 7 Linux Laptops You Can Buy in 2021.md (99%) diff --git a/translated/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md b/published/20210725 Top 7 Linux Laptops You Can Buy in 2021.md similarity index 99% rename from translated/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md rename to published/20210725 Top 7 Linux Laptops You Can Buy in 2021.md index 1c2fc8c8e9..80cecb9d70 100644 --- a/translated/news/20210725 Top 7 Linux Laptops You Can Buy in 2021.md +++ b/published/20210725 Top 7 Linux Laptops You Can Buy in 2021.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13672-1.html) 2021 年可以购买的 10 大 Linux 笔记本电脑 ====== From 972a420fb6a793efa8f52ec5a66002eaac8e2996 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 12 Aug 2021 11:22:41 +0800 Subject: [PATCH 013/290] PRF&PUB @geekpi https://linux.cn/article-13673-1.html --- ... projects to try in Copr from July 2021.md | 48 +++++++++---------- 1 file changed, 24 insertions(+), 24 deletions(-) rename {translated/tech => published}/20210730 4 cool new projects to try in Copr from July 2021.md (68%) diff --git a/translated/tech/20210730 4 cool new projects to try in Copr from July 2021.md b/published/20210730 4 cool new projects to try in Copr from July 2021.md similarity index 68% rename from translated/tech/20210730 4 cool new projects to try in Copr from July 2021.md rename to published/20210730 4 cool new projects to try in Copr from July 2021.md index be897d0a5a..914cf2f52c 100644 --- a/translated/tech/20210730 4 cool new projects to try in Copr from July 2021.md +++ b/published/20210730 4 cool new projects to try in Copr from July 2021.md @@ -3,50 +3,50 @@ [#]: author: (Jakub Kadlčík https://fedoramagazine.org/author/frostyx/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13673-1.html) COPR 仓库中 4 个很酷的新项目(2021.07) ====== ![][1] -COPR 是个人软件仓库[集合][2],它不在 Fedora 中。这是因为某些软件不符合轻松打包的标准;或者它可能不符合其他 Fedora 标准,尽管它是自由而开源的。COPR 可以在 Fedora 套件之外提供这些项目。COPR 中的软件不受 Fedora 基础设施的支持,或者是由项目自己背书的。但是,这是一种尝试新的或实验性的软件的一种巧妙的方式。 +COPR 是个人软件仓库 [集合][2],它不在 Fedora 中。这是因为某些软件不符合轻松打包的标准;或者它可能不符合其他 Fedora 标准,尽管它是自由而开源的。COPR 可以在 Fedora 套件之外提供这些项目。COPR 中的软件不受 Fedora 基础设施的支持,或者是由项目自己背书的。但是,这是一种尝试新的或实验性的软件的一种巧妙的方式。 本文介绍了 COPR 中一些有趣的新项目。如果你第一次使用 COPR,请参阅 [COPR 用户文档][3]。 -## [][4] Wike +### Wike -[Wike][5] 是一个用于 GNOME 桌面的维基百科阅读器,在 GNOME Shell 中集成了搜索功能。它提供了对[在线百科全书][6]的无干扰访问。它的界面很简约,但它支持在多种语言之间切换文章、书签、文章目录、黑暗模式等。 +[Wike][5] 是一个用于 GNOME 桌面的维基百科阅读器,在 GNOME Shell 中集成了搜索功能。它提供了对 [在线百科全书][6] 的无干扰访问。它的界面很简约,但它支持在多种语言之间切换文章、书签、文章目录、黑暗模式等。 ![][7] -### [][8] 安装说明 +#### 安装说明 -该[仓库]][9]目前在 Fedora 33、34 和 Fedora Rawhide 提供 Wike。要安装它,请使用这些命令: +该 [仓库][9] 目前为 Fedora 33、34 和 Fedora Rawhide 提供了 Wike。要安装它,请使用这些命令: ``` sudo dnf copr enable xfgusta/wike sudo dnf install wike ``` -## [][10] DroidCam +### DroidCam 我们正生活在一个混乱的时代,被隔离在家中,我们与朋友和同事的大部分互动都发生在一些视频会议平台上。如果你已经有一部手机,就不要把钱浪费在价格过高的网络摄像头上。[DroidCam][11] 让你将手机与电脑配对,并将其作为专用网络摄像头使用。通过 USB 线或通过 WiFi 进行连接。DroidCam 提供对摄像头的远程控制,并允许缩放、使用自动对焦、切换 LED 灯和其他便利功能。 ![][12] -### [][13] 安装说明 +#### 安装说明 -该[仓库][14]目前为在 Fedora 33 和 34 中提供 DroidCam。在安装之前,请更新你的系统并重新启动,或者确保你运行的是最新的内核版本,并安装了适当版本的 _kernel-headers_。 +该 [仓库][14] 目前为 Fedora 33 和 34 提供了 DroidCam。在安装之前,请更新你的系统并重新启动,或者确保你运行的是最新的内核版本,并安装了适当版本的 `kernel-headers`。 ``` sudo dnf update sudo reboot ``` -Droidcam 依赖 _v4l2loopback_,必须从 [RPM Fusion 免费仓库][15]手动安装。 +Droidcam 依赖 `v4l2loopback`,必须从 [RPM Fusion 自由软件仓库][15] 手动安装。 ``` sudo dnf install https://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm @@ -54,16 +54,16 @@ sudo dnf install v4l2loopback sudo modprobe v4l2loopback ``` -现在安装 _droidcam_ 软件包: +现在安装 `droidcam` 软件包: ``` sudo dnf copr enable meeuw/droidcam sudo dnf install droidcam ``` -## [][16] Nyxt +### Nyxt -[Nyxt][17] 是一个面向键盘、可无限扩展的网络浏览器,专为高级用户设计。它在很大程度上受到 Emacs 的启发,因此用 Common Lisp 实现和配置,提供熟悉的按键绑定([Emacs][18]、[vi][19]、[CUA][20])。 +[Nyxt][17] 是一个面向键盘、可无限扩展的 Web 浏览器,专为高级用户设计。它在很大程度上受到 Emacs 的启发,因此用 Common Lisp 实现和配置,提供熟悉的按键绑定([Emacs][18]、[vi][19]、[CUA][20])。 其他不能错过的杀手锏是一个内置的 REPL、[树形历史][21]、[缓冲区代替标签][22],还有[更多][17]。 @@ -71,33 +71,33 @@ Nyxt 与网络引擎无关,所以不用担心页面会以意外的方式呈现 ![][23] -### [][24] 安装说明 +#### 安装说明 -该[仓库][25]目前为 Fedora 33、34 和 Fedora Rawhide 提供 Nyxt。要安装它,请使用这些命令: +该 [仓库][25] 目前为 Fedora 33、34 和 Fedora Rawhide 提供了 Nyxt。要安装它,请使用这些命令: ``` sudo dnf copr enable teervo/nyxt sudo dnf install nyxt ``` -## [][26] Bottom +### Bottom -[Bottom][27] 是一个具有可定制界面和多种功能的系统监控器,它从 [gtop][28]、[gotop][29] 和 [htop][30] 获得灵感。因此,它支持[进程][31]监控、[CPU][32]、[RAM][33]和[网络][34]使用监控。除了这些,它还提供了更多奇特的小部件,如[磁盘容量][35]使用情况,[温度传感器][36],和[电池][37]使用情况。 +[Bottom][27] 是一个具有可定制界面和多种功能的系统监控器,它从 [gtop][28]、[gotop][29] 和 [htop][30] 获得了灵感。因此,它支持 [进程][31] 监控、[CPU][32]、[RAM][33] 和 [网络][34] 使用监控。除了这些,它还提供了更多奇特的小部件,如 [磁盘容量][35] 使用情况,[温度传感器][36],和 [电池][37] 使用情况。 -由于小部件的可自定义布局以及[可以只关注一个小部件并最大化它][38],Bottom 可以非常有效地利用屏幕空间。 +由于小部件的可自定义布局以及 [可以只关注一个小部件并最大化它][38],Bottom 可以非常有效地利用屏幕空间。 ![][39] -### [][40] 安装说明 +#### 安装说明 -该[仓库][41]提供为 Fedora 33、34 和 Fedora Rawhide 提供 Bottom。它也可用于 EPEL 7 和 8。要安装它,请使用这些命令: +该 [仓库][41] 为 Fedora 33、34 和 Fedora Rawhide 提供了 Bottom。它也可用于 EPEL 7 和 8。要安装它,请使用这些命令: ``` sudo dnf copr enable opuk/bottom sudo dnf install bottom ``` -使用 _btm_ 命令来运行该程序。 +使用 `btm` 命令来运行该程序。 -------------------------------------------------------------------------------- @@ -106,7 +106,7 @@ via: https://fedoramagazine.org/4-cool-new-projects-to-try-in-copr-for-july-2021 作者:[Jakub Kadlčík][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1fc8f480320c4dfc202b08623c8a4162246be1d5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 12 Aug 2021 11:37:07 +0800 Subject: [PATCH 014/290] PUB @piaoshi https://linux.cn/article-13674-1.html --- ...al to navigate throughout your computer.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) rename {translated/tech => published}/20210803 Use the Linux terminal to navigate throughout your computer.md (59%) diff --git a/translated/tech/20210803 Use the Linux terminal to navigate throughout your computer.md b/published/20210803 Use the Linux terminal to navigate throughout your computer.md similarity index 59% rename from translated/tech/20210803 Use the Linux terminal to navigate throughout your computer.md rename to published/20210803 Use the Linux terminal to navigate throughout your computer.md index 2280a68076..303722ad27 100644 --- a/translated/tech/20210803 Use the Linux terminal to navigate throughout your computer.md +++ b/published/20210803 Use the Linux terminal to navigate throughout your computer.md @@ -3,20 +3,22 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (piaoshi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13674-1.html) 使用 Linux 终端浏览你的计算机 ====== -学习在 Linux 终端中从一个目录切换到另一个目录。 -![Move around your computer][1] + +> 学习在 Linux 终端中从一个目录切换到另一个目录。 + +![](https://img.linux.net.cn/data/attachment/album/202108/12/113605d3hp448xm8m18wzw.jpg) 要在图形界面中浏览你的计算机上的文件夹,你可能习惯于打开一个窗口来“进入”你的计算机,然后双击一个文件夹,再双击一个子文件夹,如此反复。你也可以使用箭头按钮或按键来回溯。 -而要在终端中浏览你的计算机,你可以利用 **cd** 命令。你可以使用 **cd ..** 回到 _上一级_ 目录,或者使用 **cd ./另一个/文件夹的/路径** 来跳过许多文件夹进入一个特定的位置。 +而要在终端中浏览你的计算机,你可以利用 `cd` 命令。你可以使用 `cd ..` 回到 _上一级_ 目录,或者使用 `cd ./另一个/文件夹的/路径` 来跳过许多文件夹进入一个特定的位置。 -你在互联网上已经使用的 URL 的概念,实际上直接来自 [POSIX][2]。当你浏览某个网站的一个特定页面时,比如 `http://www.example.com/tutorials/lesson2.html`,你实际上做的是进入 `/var/www/imaginarysite/tutorials/` 目录,并打开一个叫 `classic2.html` 的文件。当然,你是在网络浏览器中打开它的,浏览器会将所有那些看起来奇怪的 HTML 代码解释成漂亮的文本和图片。但这两者的思路是完全一样的。 +你在互联网上已经使用的 URL 的概念,实际上直接来自 [POSIX][2]。当你浏览某个网站的一个特定页面时,比如 `http://www.example.com/tutorials/lesson2.html`,你实际上做的是进入 `/var/www/imaginarysite/tutorials/` 目录,并打开一个叫 `classic2.html` 的文件。当然,你是在 Web 浏览器中打开它的,浏览器会将所有那些看起来奇怪的 HTML 代码解释成漂亮的文本和图片。但这两者的思路是完全一样的。 如果你把你的计算机看成是互联网(或者把互联网看成是计算机会更合适),那么你就能理解如何在你的文件夹和文件中遨游了。如果从你的用户文件夹(你的家目录,或简记为 `~`)开始,那么你想切换到的文件夹都是相对于这个文件夹而言的: @@ -34,7 +36,7 @@ $ pwd ### 用 Tab 键自动补全 -键盘上的 **Tab** 键可以自动补全你开始输入的文件夹和文件的名字。如果你要 **cd** 到 `~/Documents` 文件夹,那么你只需要输入 `cd ~/Doc`,然后按 **Tab** 键即可。你的 Shell 会自动补全 `uments`。这不仅仅是一个令人愉快的便利工具,它也是一种防止错误的方法。如果你按下 **Tab** 键而没有任何东西自动补全,那么可能你 _认为_ 存在于某个位置的文件或文件件实际上并不存在。即使有经验的 Linux 用户也会试图切换到一个当前目录下不存在的文件夹,所以你可以经常使用 **pwd** 和 **ls** 命令来确认你确实在你认为你在的目录、以及你的当前目录确实包含了你认为它包含的文件。 +键盘上的 `Tab` 键可以自动补全你开始输入的文件夹和文件的名字。如果你要 `cd` 到 `~/Documents` 文件夹,那么你只需要输入 `cd ~/Doc`,然后按 `Tab` 键即可。你的 Shell 会自动补全 `uments`。这不仅仅是一个令人愉快的便利工具,它也是一种防止错误的方法。如果你按下 `Tab` 键而没有任何东西自动补全,那么可能你 _认为_ 存在于某个位置的文件或文件件实际上并不存在。即使有经验的 Linux 用户也会试图切换到一个当前目录下不存在的文件夹,所以你可以经常使用 `pwd` 和 `ls` 命令来确认你确实在你认为你在的目录、以及你的当前目录确实包含了你认为它包含的文件。 -------------------------------------------------------------------------------- @@ -43,7 +45,7 @@ via: https://opensource.com/article/21/8/navigate-linux-directories 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[piaoshi](https://github.com/piaoshi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9a1db280d605d153275ed877e71fc029229ba65a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 13 Aug 2021 05:03:28 +0800 Subject: [PATCH 015/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210812=20?= =?UTF-8?q?A=20guide=20to=20the=20Linux=20terminal=20for=20beginners?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210812 A guide to the Linux terminal for beginners.md --- ...ide to the Linux terminal for beginners.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20210812 A guide to the Linux terminal for beginners.md diff --git a/sources/tech/20210812 A guide to the Linux terminal for beginners.md b/sources/tech/20210812 A guide to the Linux terminal for beginners.md new file mode 100644 index 0000000000..7a184b585f --- /dev/null +++ b/sources/tech/20210812 A guide to the Linux terminal for beginners.md @@ -0,0 +1,129 @@ +[#]: subject: "A guide to the Linux terminal for beginners" +[#]: via: "https://opensource.com/article/21/8/linux-terminal" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to the Linux terminal for beginners +====== +Learn the differences between Linux terminal commands, arguments, and +options, and how to use them to control your computer. +![Terminal command prompt on orange background][1] + +There's a café a few streets away from where I live, and I go there every Sunday for a regularly scheduled game of D&D. They have a menu, and the first few times I ordered, I looked over the menu for several minutes to see what my choices were. Being a creature of habit, I eventually stopped referring to the menu because I knew exactly what they have for sale, and I know exactly what I want. Ordering food for the table is now as easy as saying "the usual" and waiting for the cups of coffee and bowls of chips and scones to be delivered (usually inconveniently at just the moment we've rolled for initiative, but that's hardly the staff's fault or problem). + +Similar to a restaurant menu, graphical interfaces for computers offer users a choice of actions. There are icons and windows and buttons, and you hunt for the one you're looking for, click on items, drag other items, and manipulate graphical representations until a task is complete. After a while, though, this can become cumbersome and, worse yet, inefficient. You know exactly what needs to be done, so wouldn't it be nice to just tell the computer exactly what you want to happen, rather than going through the physical and mental motions of hunting for components and repeating a mouse-based dance routine? + +### What is the Linux terminal? + +The Linux terminal is a text-based interface used to control a Linux computer. It's just one of the many tools provided to Linux users for accomplishing any given task, but it's widely considered the most efficient method available. Outside of writing code, it's certainly the most direct method possible. It's so popular, in fact, that Apple changed its foundation to Unix and has gained the [Bash and Z shell][2], and Microsoft developed [PowerShell][3], its very own open source command line. + +### What is a Linux command? + +A **command** is a special keyword you can use in a terminal to tell your computer to perform an action. Most commands are tiny little applications that get installed with the rest of your operating system. You may not realize they're on your computer because they're generally kept in relatively obscure directories like `/bin`, `/sbin`, `/usr/bin`, and `/usr/sbin`, but your terminal knows where to find them (thanks to something called the [PATH][4]). Other commands are built into your terminal. You don't have to worry about whether a command was installed or comes built-in because your terminal knows the commands either way. Better yet, on most Linux distributions, when your terminal can't find a command, it searches the internet for a package to provide that command and then offers to install and run it for you! + +Here's a simple command: + + +``` +`$ ls` +``` + +The `ls` command is short for "list," and it lists the contents of your current directory. Open a terminal and try it out. Then open a file manager window (_Files_ on Linux, _Finder_ on macOS, _Windows Explorer_ on Windows) and compare. It's two different views of the same data. + +### What is an argument in a Linux command? + +An **argument** is any part of a command that isn't the command. For instance, to list the contents of a specific directory, you can provide the name of that directory as an argument: + + +``` +`$ ls Documents` +``` + +In this example, `ls` is the command and `Documents` is the argument. This would render a list of your `Documents` directory's contents. + +### What are options in Linux? + +Command **options**, also called **flags** or **switches**, are part of command arguments. A command argument is anything that follows a command, and an option is usually (but not always) demarcated by a dash or double dashes. For instance: + + +``` +`$ ls --classify Documents` +``` + +In this example, `--classify` is an option. It also has a short version because terminal users tend to prefer the efficiency of less typing: + + +``` +`$ ls -F Documents` +``` + +Short options can usually be combined. Here's an `ls` command combining the `-l` option with the `--human-readable`, `--classify`, and `--ignore-backups` options: + + +``` +`$ ls -lhFB` +``` + +Some options can take arguments themselves. For instance, the `--format` option for `ls` lets you change how information is presented. By default, the contents of directories are provided to you in columns, but if you need them to be listed in a comma-delimited list, you can set `format` to `comma`: + + +``` +$ ls --format=comma Documents +alluvial, android-info.txt, arduinoIntro, dmschema, +headers.snippet, twine, workshop.odt +``` + +The equal sign (`=`) is optional, so this works just as well: + + +``` +$ ls --format comma Documents +alluvial, android-info.txt, arduinoIntro, dmschema, +headers.snippet, twine, workshop.odt +``` + +### Learning to use the Linux terminal + +Learning how to use a terminal can increase efficiency and productivity—and can also make computing a lot of fun. There are few times when I run a carefully crafted command and don't sit back marveling at what I've managed to make happen with just a few words typed into an otherwise blank screen. A terminal is many things—programming, poetry, puzzle, and pragmatism—but no matter how you see it, it's a lasting innovation that's worth learning. + + * [Use the Linux terminal to see what files are on your computer][5] + * [How to open and close directories in the Linux terminal][6] + * [Navigating in the Linux terminal][7] + * [Move a file in the Linux terminal][8] + * [Rename a file in the Linux terminal][9] + * [Copy files and folders in the Linux terminal][10] + * [Remove files and folders in the Linux Terminal][11] + + + +After reading and practicing the lessons in these articles, download our free ebook, [Sysadmin's guide to Bash scripting][12] for even more fun in the terminal. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-terminal + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/terminal_command_linux_desktop_code.jpg?itok=p5sQ6ODE (Terminal command prompt on orange background) +[2]: https://opensource.com/business/16/3/top-linux-shells +[3]: https://opensource.com/article/18/2/powershell-people +[4]: https://opensource.com/article/17/6/set-path-linux +[5]: https://opensource.com/article/21/7/linux-terminal-basics-see-what-files-are-your-computer +[6]: https://opensource.com/article/21/7/linux-terminal-basics-opening-and-closing-directories +[7]: https://opensource.com/article/21/7/terminal-basics-moving-around-your-computer +[8]: https://opensource.com/article/21/7/terminal-basics-moving-files-linux-terminal +[9]: https://opensource.com/article/21/7/terminal-basics-rename-file-linux-terminal +[10]: https://opensource.com/article/21/7/terminal-basics-copying-files-linux-terminal +[11]: https://opensource.com/article/21/7/terminal-basics-removing-files-and-folders-linux-terminal +[12]: https://opensource.com/downloads/bash-scripting-ebook From cdb3db9ea8bd0a1a88728804229794cf34a3e995 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 13 Aug 2021 05:03:38 +0800 Subject: [PATCH 016/290] add done: 20210812 A guide to the Linux terminal for beginners.md --- sources/tech/20210813 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210813 .md diff --git a/sources/tech/20210813 .md b/sources/tech/20210813 .md new file mode 100644 index 0000000000..a0c2d72f9f --- /dev/null +++ b/sources/tech/20210813 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/migrate-centos-8-to-almalinux/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/migrate-centos-8-to-almalinux/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From 8b16dfcc406f9ab7aa58b73a9e21067f7b6f20f9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 13 Aug 2021 05:03:50 +0800 Subject: [PATCH 017/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210812=20?= =?UTF-8?q?Automatically=20create=20multiple=20applications=20in=20Argo=20?= =?UTF-8?q?CD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210812 Automatically create multiple applications in Argo CD.md --- ...create multiple applications in Argo CD.md | 246 ++++++++++++++++++ 1 file changed, 246 insertions(+) create mode 100644 sources/tech/20210812 Automatically create multiple applications in Argo CD.md diff --git a/sources/tech/20210812 Automatically create multiple applications in Argo CD.md b/sources/tech/20210812 Automatically create multiple applications in Argo CD.md new file mode 100644 index 0000000000..31e0b9281c --- /dev/null +++ b/sources/tech/20210812 Automatically create multiple applications in Argo CD.md @@ -0,0 +1,246 @@ +[#]: subject: "Automatically create multiple applications in Argo CD" +[#]: via: "https://opensource.com/article/21/7/automating-argo-cd" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Automatically create multiple applications in Argo CD +====== +In this tutorial, I will show you how to automatically create multiple +applications in Argo CD using Argo CD. +![gears and lightbulb to represent innovation][1] + +In a previous article, I demonstrated how [Argo CD makes pull-based GitOps deployments simple][2]. In this tutorial, I’ll show you how to automatically create multiple applications in Argo CD using Argo CD itself. + +Since Argo CD’s job is to listen to a repo and apply the Manifest files it finds to the cluster, you can use this approach to configure Argo CD internals as well. In my previous example, I used the GUI to create a sample Nginx application with three replicas. This time, I use the same approach as before, but I create an application from the GUI to deploy three separate applications: `app-1`, `app-2`, and `app-3`. + +### Configuring our child applications + +First, start by creating the Manifest files for your three applications. In my `example-assets` [repository][3], I have [created three applications][4] under `argocd/my-apps`. All three applications are Nginx with three replicas. Be sure to create each application in its own folder. + +Create a [YAML file][5] to define the first application and save it as `my-apps/app-1/app.yml`: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: nginx-app-1 +  labels: +    app: nginx-app-1 +spec: +  replicas: 3 +  selector: +    matchLabels: +      app: nginx-app-1 +  template: +    metadata: +      labels: +        app: nginx-app-1 +    spec: +      containers: +      - name: nginx +        image: nginx:latest +        ports: +        - containerPort: 80 +``` + +Create another one for your second application and save it as `my-apps/app-2/app.yml`: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: nginx-app-2 +  labels: +    app: nginx-app-2 +spec: +  replicas: 3 +  selector: +    matchLabels: +      app: nginx-app-2 +  template: +    metadata: +      labels: +        app: nginx-app-2 +    spec: +      containers: +      - name: nginx +        image: nginx:latest +        ports: +        - containerPort: 80 +``` + +Create a third for your final app and save it as `my-apps/app-3/app.yml`: + + +``` +apiVersion: apps/v1 +kind: Deployment +metadata: +  name: nginx-app-3 +  labels: +    app: nginx-app-3 +spec: +  replicas: 3 +  selector: +    matchLabels: +      app: nginx-app-3 +  template: +    metadata: +      labels: +        app: nginx-app-3 +    spec: +      containers: +      - name: nginx +        image: nginx:latest +        ports: +        - containerPort: 80 +``` + +Now that your Manifest files are ready, you must create Argo CD Applications pointing to those Manifests. + +Argo CD can be configured in three different ways: using the GUI, using the CLI, or using Kubernetes Manifest files. In this article, I use the third method. + +Create the following Manifest files in a new folder `argocd/argo-apps`. This is `argocd-apps/app-1.yml`: + + +``` +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: +  name: my-app-1 +  namespace: argocd +  finalizers: +  - resources-finalizer.argocd.argoproj.io +spec: +  destination: +    namespace: argocd +    server: +  project: default +  source: +    path: argocd/my-apps/app-1 +    repoURL: +    targetRevision: HEAD +``` + +This is `argocd-apps/app-2.yml`: + + +``` +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: +  name: my-app-2 +  namespace: argocd +  finalizers: +  - resources-finalizer.argocd.argoproj.io +spec: +  destination: +    namespace: argocd +    server: +  project: default +  source: +    path: argocd/my-apps/app-2 +    repoURL: +    targetRevision: HEAD +``` + +And this is `argocd-apps/app-3.yml`: + + +``` +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: +  name: my-app-3 +  namespace: argocd +  finalizers: +  - resources-finalizer.argocd.argoproj.io +spec: +  destination: +    namespace: argocd +    server: +  project: default +  source: +    path: argocd/my-apps/app-3 +    repoURL: +    targetRevision: HEAD +``` + +As you can see, you are creating a Kubernetes object called `Application` in the `argocd` namespace. This object contains the source Git repository and destination server details. Your Applications are pointing to the Nginx manifest files you created earlier. + +### Configuring our main application + +Now you need some way to tell Argo CD how to find your three Nginx applications. Do this by creating yet another Application. This pattern is called the `App of Apps` pattern, where one Application contains the instructions to deploy multiple child Applications. + +Create a new Application from the GUI called `my-apps` with the following configuration: + + +``` +apiVersion: argoproj.io/v1alpha1 +kind: Application +metadata: +  name: my-apps +spec: +  destination: +    namespace: default +    server: '' +  source: +    path: argocd/argocd-apps +    repoURL: '' +    targetRevision: HEAD +  project: default +  syncPolicy: +    automated: +      prune: true +      selfHeal: true +``` + +Once it has been created, `my-apps` begins syncing in the GUI: + +![Automating ArgoCD with ArgoCD! - Main app.][6] + +Figure 1: Automating ArgoCD with ArgoCD! - Main app. + +After the sync is complete, your three Nginx applications appear in the GUI as well: + +![Automating ArgoCD with ArgoCD! - Dashboard.][7] + +Figure 2: Automating ArgoCD with ArgoCD! - Dashboard. + +Since you didn't enable `AutoSync`, manually sync `app-1`, `app-2`, and `app-3`. Once synced, your Nginx replicas are deployed for all three apps. + +![Automating ArgoCD with ArgoCD! - Deployment.][8] + +Figure 3: Automating ArgoCD with ArgoCD! - Deployment. + +### Conclusion + +Mastering the `App of Apps` pattern is critical to leveraging the full power of Argo CD. This method allows you to manage groups of applications cleanly. For example, deploying Prometheus, Grafana, Loki, and other vital services could be managed by a DevOps Application, while deploying frontend code could be managed by a Frontend Application. Configuring different sync options and repo locations for each gives you precise control over different application groups. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/automating-argo-cd + +作者:[Ayush Sharma][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ayushsharma +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/innovation_lightbulb_gears_devops_ansible.png?itok=TSbmp3_M (gears and lightbulb to represent innovation) +[2]: https://opensource.com/article/21/8/argo-cd +[3]: https://gitlab.com/ayush-sharma/example-assets +[4]: https://gitlab.com/ayush-sharma/example-assets/-/tree/main/argocd/my-apps +[5]: https://www.redhat.com/sysadmin/yaml-beginners +[6]: https://opensource.com/sites/default/files/1automating-argocd-with-argocd-main-app_0.png +[7]: https://opensource.com/sites/default/files/2automating-argocd-with-argocd-dashboard.png +[8]: https://opensource.com/sites/default/files/3automating-argocd-with-argocd-deployment.png From f4ab8aa4d4469a1f5260b8fdd2312261afc7acd2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 13 Aug 2021 05:04:02 +0800 Subject: [PATCH 018/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210812=20?= =?UTF-8?q?A=20Java=20developer's=20guide=20to=20Quarkus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210812 A Java developer-s guide to Quarkus.md --- ...812 A Java developer-s guide to Quarkus.md | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 sources/tech/20210812 A Java developer-s guide to Quarkus.md diff --git a/sources/tech/20210812 A Java developer-s guide to Quarkus.md b/sources/tech/20210812 A Java developer-s guide to Quarkus.md new file mode 100644 index 0000000000..02589104c6 --- /dev/null +++ b/sources/tech/20210812 A Java developer-s guide to Quarkus.md @@ -0,0 +1,51 @@ +[#]: subject: "A Java developer's guide to Quarkus" +[#]: via: "https://opensource.com/article/21/8/java-quarkus-ebook" +[#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A Java developer's guide to Quarkus +====== +A new eBook demonstrates how developers can keep using the Java +framework to build new serverless functions. +![Coffee beans and a cup of coffee][1] + +[Serverless][2] architecture has already become an efficient solution to align overprovisioning and underprovisioning resources (e.g., CPU, memory, disk, networking) with actual workloads regardless of physical servers, virtual machines, and cloud environments. Yet, there is a concern for Java developers when choosing new programming languages to develop serverless applications. The Java framework seems too heavyweight and slow for serverless deployment on the cloud, especially [Kubernetes][3]. + +What if you, Java developer, could keep using the Java framework to build traditional cloud-native microservices as well as new serverless functions at the same time? This approach should be exciting since you don’t have to worry about a steep learning curve for new serverless application frameworks. + +Furthermore, what if the Java framework could not only provide developers the joy of familiar technologies but also optimize Java serverless functions in Kubernetes by milliseconds at startup and offer tiny memory footprints? + +### What is Quarkus? + +[Quarkus][4] is the new Java framework that can provide these features and benefits to Java developers, enterprise architects, and DevOps engineers. It aims to design serverless applications and write cloud-native microservices for running on cloud infrastructures (for example, Kubernetes). + +Quarkus also supports a portable Java API extension named [Funqy][5] for developers to write and deploy serverless functions to heterogeneous serverless runtimes. + +Quarkus Funqy enables developers to bind [CloudEvents][6] for handling reactive streams with serverless functions on the Knative environment. This is beneficial for developers building a common messaging format to describe events and increase interoperability among multi- and hybrid cloud platforms. + +Start your journey with Quarkus with the help of my new eBook, [**A guide to Java serverless functions**][7]. Share your Quarkus experiences with others so everyone can enjoy serverless development with Java and Quarkus. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/java-quarkus-ebook + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) +[2]: https://opensource.com/article/21/1/devapps-strategies +[3]: https://opensource.com/article/19/6/reasons-kubernetes +[4]: https://quarkus.io/ +[5]: https://quarkus.io/guides/funqy +[6]: https://cloudevents.io/ +[7]: https://opensource.com/downloads/java-serverless-ebook From eb3f2185763c7fadb3de1e80162fcd6baadc7e31 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 13 Aug 2021 05:04:28 +0800 Subject: [PATCH 019/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210812=20?= =?UTF-8?q?Thunderbird=2091=20is=20a=20Major=20Upgrade=20That=20Could=20He?= =?UTF-8?q?lp=20Reclaim=20its=20Position=20as=20the=20Default=20Linux=20Ma?= =?UTF-8?q?il=20Client?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md --- ...sition as the Default Linux Mail Client.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md diff --git a/sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md b/sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md new file mode 100644 index 0000000000..9c9cd398fa --- /dev/null +++ b/sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md @@ -0,0 +1,110 @@ +[#]: subject: "Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client" +[#]: via: "https://news.itsfoss.com/thunderbird-91-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client +====== + +Thunderbird, the popular open-source email client, has a major new upgrade. Thunderbird 91 release promises many improvements, some of which we will be looking at here. + +Overall, the release focuses on adding import/export support for Thunderbird profiles, various user-interface improvements, improved Gmail account integration, improved calendar settings, tons of bug fixes, and smaller improvements. + +Read on for a look at all these new features and more. + +### What’s New? + +![][1] + +After more than a year of development since Thunderbird 78, Thunderbird 91 has a lot to offer. With various new features and bug fixes, this release will benefit almost everyone who uses it. + +These new features include: + + * UI improvements to Calendar display + * UI improvements to message compose window and message composer + * Updated printing UI + * Brand-new account setup wizard + * The ability to Import/Export Thunderbird profiles + * Suggesting replacements for discontinued/incompatible add-ons + * Fixes for visibility issues in dark mode and high contrast themes + * Beta-level support for Matrix servers (chat feature) + * CardDAV address book support + * Enable redirect of messages + + + +Between the UI and usability improvements, this release is looking to be a great one. + +#### UI Improvements + +Thunderbird 91 brings multiple UI improvements to the table. It may not be a major visual overhaul, but some adjustments focus on improved accessibility. + +Especially with the calendar supporting .ics files by double-click and remote calendar auto-detection. You will also notice a new UI for adding attachments. + +Finally, users of Dark mode will notice the fixes for the many visibility issues that plagued older releases. + +#### Improved Account Setup Wizard + +![][2] + +This release moves the account setup wizard to a new tab. + +Unlike the old one, the new one follows the same design guidelines used in the settings page and other HTML-based parts of the application. + +Better still, it can automatically detect CalDAV calendars, email signatures, and the ability to connect to an address book during setup. Furthermore, if you are adding a Gmail account, it will ask for permission to access the calendar and address book. Once done, you will not have to re-authorize it. + +This makes the process of getting set up with Thunderbird much more enjoyable, especially when you are also trying to set up calendars and address books. + +#### Other Improvements + +Considering this as a major upgrade, there are several subtle changes and improvements across the board. + +Some of them include the ability to encrypt mail to BCC recipients, a quick-find feature for the multi-message view, and per-calendar notification settings. + +For more information on all the technical changes, you can refer to the [official release notes][3]. + +### Download Thunderbird 91 + +You can get the latest Thunderbird from the [official download page][4] (it may take a while for them to make it available). Also, it would take time to make the update available through repositories/Flathub. + +If you want to avoid waiting, you can directly grab the tar package from their [FTP directory][5], extract it, and run the executable file to get started. + +[Mozilla Thunderbird 91][4] + +### Wrapping Up + +Considering that many Linux distributions have been switching over to the “Evolution” mail client replacing Thunderbird, this was a much-needed upgrade for users who prefer Thunderbird to anything else. + +Of course, you do have the option to explore the [best email clients for Linux][6] if you still do not like Thunderbird. + +_What is your favorite feature in Thunderbird 91? Let me know in the comments below!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/thunderbird-91-release/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYxMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://www.thunderbird.net/en-US/thunderbird/91.0/releasenotes/ +[4]: https://www.thunderbird.net/en-US/ +[5]: https://ftp.mozilla.org/pub/thunderbird/releases/91.0/linux-x86_64/en-US/ +[6]: https://itsfoss.com/best-email-clients-linux/ From 7528b05b20aed880dd7979d3f6e944d8a7357fd2 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 13 Aug 2021 08:33:29 +0800 Subject: [PATCH 020/290] Delete 20210813 .md --- sources/tech/20210813 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210813 .md diff --git a/sources/tech/20210813 .md b/sources/tech/20210813 .md deleted file mode 100644 index a0c2d72f9f..0000000000 --- a/sources/tech/20210813 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/migrate-centos-8-to-almalinux/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/migrate-centos-8-to-almalinux/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 From 9ad21d69ccbd1df1f835121ef188b3ead26da543 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 13 Aug 2021 08:47:07 +0800 Subject: [PATCH 021/290] translated --- ...esktop Wallpaper Every Hour -Here-s How.md | 146 ------------------ ...esktop Wallpaper Every Hour -Here-s How.md | 140 +++++++++++++++++ 2 files changed, 140 insertions(+), 146 deletions(-) delete mode 100644 sources/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md create mode 100644 translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md diff --git a/sources/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md b/sources/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md deleted file mode 100644 index fe9f2fd859..0000000000 --- a/sources/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md +++ /dev/null @@ -1,146 +0,0 @@ -[#]: subject: "Change your Linux Desktop Wallpaper Every Hour [Here’s How]" -[#]: via: "https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Change your Linux Desktop Wallpaper Every Hour [Here’s How] -====== -This shell script styli.sh helps to change your Linux desktop wallpaper -in every hour automatically and with several options.GNOMEXfceKDE -PlasmaSway -A nice wallpaper to start your day with, your desktop is refreshing. But it is very cumbersome to find wallpaper, then saving and eventually set as wallpaper. All these steps can be done by this script called [styli.sh][1]. - -### styli.sh – Change your Linux Desktop Wallpaper Every Hour - -This is a shell script which you can download from GitHub. When runs, it fetches the wallpapers from popular Subreddits from Reddit and set it as your wallpaper. - -This script works with all popular desktop environments such as GNOME, KDE Plasma, Xfce and Sway window manager. - -It is loaded with features, and you can run the script with via crontab in every and get a fresh wallpaper in a specific interval. - -### Download and Install, Run - -Open a terminal and clone the GitHub repo. You need to install [feh][2] and git if not installed. - -``` -git clone https://github.com/thevinter/styli.sh -cd styli.sh -``` - -To set a random wallpaper, run below as per your desktop environment. - -![Change your Linux Desktop Wallpaper Every Hour using styli.sh][3] - -``` -./styli.sh -g -``` - -``` -./styli.sh -x -``` - -``` -./styli.sh -k -``` - -``` -./styli.sh -y -``` - -### Change every hour - -To change background every hour, run the following command – - -``` -crontab -e -``` - -And add the following to the opened file. Don’t forget to change the script path. - -``` -@hourly script/path/styli.sh -``` - -### Change the subreddits - -In the source directory, there is a file called subreddits. It is filled up with some standard subreddits. If you want some more, just add the Subreddit names at the end of the file. - -### More Config options - -The types of wallpapers, size, can also be set. These are some unique configuration option of this script. - -> To set a random 1920×1080 background -> ./styli.sh -> -> To specify a desired width or height -> ./styli.sh -w 1080 -h 720 -> ./styli.sh -w 2560 -> ./styli.sh -h 1440 -> -> To set a wallpaper based on a search term -> ./styli.sh -s island -> ./styli.sh -s “sea sunset” -> ./styli.sh -s sea -w 1080 -> -> To get a random wallpaper from one of the set subreddits -> NOTE: The width/height/search parameters DON’T work with reddit -> ./styli.sh -l reddit -> -> To get a random wallpaper from a custom subreddit -> ./styli.sh -r -> ./styli.sh -r wallpaperdump -> -> To use the builtin feh –bg options -> ./styli.sh -b -> ./styli.sh -b bg-scale -r widescreen-wallpaper -> -> To add custom feh flags -> ./styli.sh -c -> ./styli.sh -c –no-xinerama -r widescreen-wallpaper -> -> To automatically set the terminal colors -> ./styli.sh -p -> -> To use nitrogen instead of feh -> ./styli.sh -n -> -> To update > 1 screens using nitrogen -> ./styli.sh -n -m -> -> Choose a random background from a directory -> ./styli.sh -d /path/to/dir - -### Closing Notes - -A unique and handy script, low on memory and can directly fetch images in an interval – like an hour. And make your desktop look [fresh and productive][4] all the time. If you do not like the wallpaper, you can simply run the script from the terminal again to cycle through. - -[][5] - -SEE ALSO:   List of All Default Ubuntu Official Wallpapers [Gallery] - -Do you like this script? Or do you know anything like this for wallpaper switcher? Let me know in the comment box below. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://github.com/thevinter/styli.sh -[2]: https://feh.finalrewind.org/ -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Change-your-Linux-Desktop-Wallpaper-Every-Hour-using-styli.sh_.jpg -[4]: https://www.debugpoint.com/category/themes -[5]: https://www.debugpoint.com/2019/09/a-list-of-all-default-ubuntu-official-wallpapers-gallery/ diff --git a/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md b/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md new file mode 100644 index 0000000000..a27d1361eb --- /dev/null +++ b/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md @@ -0,0 +1,140 @@ +[#]: subject: "Change your Linux Desktop Wallpaper Every Hour [Here’s How]" +[#]: via: "https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何每小时改变你的 Linux 桌面墙纸 +====== +这个 shell 脚本 styli.sh 可以帮助你每小时自动改变你的 Linux 桌面壁纸,并且有几个选项。 + +用一张漂亮的壁纸来开始你的一天,你的桌面让人耳目一新。但寻找墙纸,然后保存,最终设置为墙纸,是非常麻烦的。所有这些步骤都可以通过这个叫做 [styl.sh][1] 的脚本完成。 + +### styli.sh - 每小时改变你的 Linux 桌面壁纸 + +这是一个 shell 脚本,你可以从 GitHub 上下载。当运行时,它从 Reddit 的热门 Subreddits 中获取壁纸并将其设置为你的壁纸。 + +该脚本适用于所有流行的桌面环境,如 GNOME、KDE Plasma、Xfce 和 Sway 窗口管理器。 + +它有很多功能,你可以通过 crontab 来运行这个脚本,并在特定的时间间隔内得到一张新的墙纸。 + +### 下载并安装、运行 + +打开一个终端,并克隆 GitHub 仓库。如果没有安装的话,你需要安装 [feh][2] 和 git。 + +``` +git clone https://github.com/thevinter/styli.sh +cd styli.sh +``` + +要设置随机墙纸,根据你的桌面环境运行以下内容。 + +![Change your Linux Desktop Wallpaper Every Hour using styli.sh][3] + +``` +./styli.sh -g +``` + +``` +./styli.sh -x +``` + +``` +./styli.sh -k +``` + +``` +./styli.sh -y +``` + +### 每小时改变一次 + +要每小时改变背景,请运行以下命令: + +``` +crontab -e +``` + +并在打开的文件中加入以下内容。不要忘记改变脚本路径。 + +``` +@hourly script/path/styli.sh +``` + +### 改变 subreddits + +在源目录中,有一个名为 subreddits 的文件。它填满了一些标准的 subreddits。如果你想要更多一些,只需在文件末尾添加 subreddit 名称。 + +### 更多配置选项 + +壁纸的类型,大小,也可以设置。以下是这个脚本的一些独特的配置选项。 + +> 设置一个随机的 1920×1080 背景 +> ./styli.sh +> +> 指定一个所需的宽度或高度 +> ./styli.sh -w 1080 -h 720 +> ./styli.sh -w 2560 +> ./styli.sh -h 1440 +> +> 根据搜索词设置墙纸 +> ./styli.sh -s island +> ./styli.sh -s “sea sunset” +> ./styli.sh -s sea -w 1080 +> +> 从设定的一个 subreddits 中获得一个随机壁纸 +> 注意:宽度/高度/搜索参数对 reddit 不起作用。 +> ./styli.sh -l reddit +> +> 从一个自定义的 subreddit 获得随机墙纸 +> ./styli.sh -r +> ./styli.sh -r wallpaperdump +> +> 使用内置的 feh -bg 选项 +> ./styli.sh -b +> ./styli.sh -b bg-scale -r widescreen-wallpaper +> +> 添加自定义的 feh 标志 +> ./styli.sh -c +> ./styli.sh -c –no-xinerama -r widescreen-wallpaper +> +> 自动设置终端的颜色 +> ./styli.sh -p +> +> 使用 nitrogen 而不是 feh +> ./styli.sh -n +> +> 使用 nitrogen 更新 > 1 个屏幕 +> ./styli.sh -n -m +> +> 从一个目录中选择一个随机的背景 +> ./styli.sh -d /path/to/dir + +### 最后说明 + +一个独特且方便的脚本,内存占用小,可以直接在一个时间间隔内比如一个小时获取图片。让你的桌面看起来[新鲜且高效][4]。如果你不喜欢这些壁纸,你可以简单地从终端再次运行脚本来循环使用。 + +你喜欢这个脚本吗?或者你知道有什么像这样的壁纸切换器吗?请在下面的评论栏里告诉我。 + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://github.com/thevinter/styli.sh +[2]: https://feh.finalrewind.org/ +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Change-your-Linux-Desktop-Wallpaper-Every-Hour-using-styli.sh_.jpg +[4]: https://www.debugpoint.com/category/themes \ No newline at end of file From 107217e9bcb8632daa34053fd96003f4f2d8614e Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 13 Aug 2021 08:49:02 +0800 Subject: [PATCH 022/290] translating --- sources/tech/20210812 A Java developer-s guide to Quarkus.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210812 A Java developer-s guide to Quarkus.md b/sources/tech/20210812 A Java developer-s guide to Quarkus.md index 02589104c6..9bb9b7b3ca 100644 --- a/sources/tech/20210812 A Java developer-s guide to Quarkus.md +++ b/sources/tech/20210812 A Java developer-s guide to Quarkus.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/java-quarkus-ebook" [#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 24295b2bae5fac661bd073f493e9d78720b01790 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Fri, 13 Aug 2021 09:03:51 +0800 Subject: [PATCH 023/290] translated by perfiffer --- ...03 Set up a VPN server on your Linux PC.md | 137 ------------------ ...03 Set up a VPN server on your Linux PC.md | 131 +++++++++++++++++ 2 files changed, 131 insertions(+), 137 deletions(-) delete mode 100644 sources/tech/20210803 Set up a VPN server on your Linux PC.md create mode 100644 translated/tech/20210803 Set up a VPN server on your Linux PC.md diff --git a/sources/tech/20210803 Set up a VPN server on your Linux PC.md b/sources/tech/20210803 Set up a VPN server on your Linux PC.md deleted file mode 100644 index fe54a13efb..0000000000 --- a/sources/tech/20210803 Set up a VPN server on your Linux PC.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: subject: (Set up a VPN server on your Linux PC) -[#]: via: (https://opensource.com/article/21/8/openvpn-server-linux) -[#]: author: (D. Greg Scott https://opensource.com/users/greg-scott) -[#]: collector: (lujun9972) -[#]: translator: (perfiffer) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Set up a VPN server on your Linux PC -====== -The first step in building a VPN is setting up a VPN server. -![Person drinking a hot drink at the computer][1] - -Have you been connected to an untrusted network such as a hotel or café WiFi and need to securely browse the internet from your smartphone or laptop? By using a virtual private network (VPN), you can access that untrusted network anonymously and as safely as if you were on a private network. - -VPN is an amazing tool for safeguarding private data. By using a VPN, you can connect to a private network on the internet while maintaining anonymity. - -There are many VPN services available, and many people have found that the preferred option for securing private data when using untrusted networks is [OpenVPN][2]. - -OpenVPN creates an encrypted tunnel between two points, preventing a third party from accessing your network traffic data. By setting up your VPN server, you become your own VPN provider. Many popular VPN services use OpenVPN, so why tie your connection to a specific provider when you can have complete control yourself? - -### Set up a Linux server - -First, install a copy of Linux onto a spare PC. These examples use Fedora, but the steps are mostly the same no matter what Linux distribution you use. - -Download a copy of the most recent Fedora ISO from the [Fedora project][3] website. Make a bootable USB drive, plug it into and boot your PC, and install the operating system. If you've never made a bootable USB drive, read about [Fedora Media Writer][4]. If you've never installed Linux, read about [installing Linux in three steps][5]. - -### Set up networking - -After installing the Fedora operating system, log into the console or SSH session. - -Apply the latest updates and reboot: - - -``` -`$ sudo dnf update -y && reboot` -``` - -Log in again and disable the firewall rules: - - -``` -systemctl disable firewalld.service -systemctl stop firewalld.service -``` - -You may want to add appropriate firewall rules on this system for your internal network. If so, finish setting up and debugging OpenVPN with all firewall rules turned off, and then add your local firewall rules. For more information, read about [setting up firewalls on Linux][6]. - -### Set up IP addresses - -You need a static IP address inside your local network. The commands below assume a Network Manager connection named `ens3` on a device named `ens3`. Your device and connection names might be different, so find them by opening an SSH session or the console and entering: - - -``` -$ sudo nmcli connection show -NAME  UUID                                  TYPE      DEVICE -ens3  39ad55bd-adde-384a-bb09-7f8e83380875  ethernet  ens3 -``` - -You need to ensure that your remote people can find your VPN server. There are two ways to do this. You can set its IP address manually, or you can let your router do most of the work. - -#### Configure an IP address manually - -Set your static IP address, prefix, gateway, and DNS resolver with the following command but substituting your own IP addresses: - - -``` -$ sudo nmcli connection modify ens3 ipv4.addresses 10.10.10.97/24 -$ sudo nmcli connection modify ens3 ipv4.gateway 10.10.10.1 -$ sudo nmcli connection modify ens3 ipv4.dns 10.10.10.10 -$ sudo nmcli connection modify ens3 ipv4.method manual -$ sudo nmcli connection modify ens3 connection.autoconnect yes -``` - -Set a hostname: - - -``` -`$ sudo hostnamectl set-hostname OVPNserver2020` -``` - -If you run a local DNS server, you will want to set up a DNS entry with the hostname pointing to the VPN server IP Address. - -Reboot and make sure the system has the correct networking information. - -#### Configure an IP address in your router - -You probably have a router on your network. You may have purchased it, or you may have gotten one from your internet service provider (ISP). Either way, your router probably has a built-in DHCP server that assigns an IP address to each device on your network. Your new server counts as a device on your network, so you may have noticed an IP address is assigned to it automatically. - -The potential problem here is that your router doesn't guarantee that any device will ever get the same IP address after reconnecting. It does _try_ to keep the IP addresses consistent, but they can change depending on how many devices are connected at the time. - -However, almost all routers have an interface allowing you to intercede and reserve IP addresses for specific devices. - -![Router IP address settings][7] - -(Seth Kenlon, [CC BY-SA 4.0][8]) - -There isn't a universal interface for routers, so search the interface of the router you own for **DHCP** or **Static IP address** options. Assign your server its own reserved IP address so that its network location remains the same no matter what. - -### Access your server - -By default, your router probably has a firewall built into it. This is normally good because you don't want someone outside your network to be able to brute force their way into any of your computers. However, you must allow traffic destined for your VPN server through your firewall, or else your VPN will be unreachable and, therefore, no use to you.  - -You will need at least one public static IP Address from your internet service provider. Set up the public side of your router with its static IP Address, and then put your OpenVPN server on the private side, with its own private static IP Address inside your network. OpenVPN uses UDP port 1194 by default. Configure your router to [port-forward][9] traffic for your public VPN IP Address on UDP port 1194 to UDP port 1194 on your OpenVPN server. If you decide to use a different UDP port, adjust the port number accordingly. - -### Get ready for the next step - -In this article, you installed and configured an operating system on your server, which is approximately half the battle. In the next article, you'll tackle installing and configuring OpenVPN itself. In the meantime, get familiar with your router and make sure you can reach your server from the outside world. But be sure to close the port forwarding after testing until your VPN is up and running. - -* * * - -_Parts of this article were adapted from D. Greg Scott's [blog][10] and have been republished with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/openvpn-server-linux - -作者:[D. Greg Scott][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/greg-scott -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hot drink at the computer) -[2]: https://openvpn.net/ -[3]: http://getfedora.org -[4]: https://opensource.com/article/20/10/fedora-media-writer -[5]: https://opensource.com/article/21/2/linux-installation -[6]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd -[7]: https://opensource.com/sites/default/files/uploads/reserved-ip.jpg (Router IP address settings) -[8]: https://creativecommons.org/licenses/by-sa/4.0/ -[9]: https://opensource.com/article/20/9/firewall -[10]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/ diff --git a/translated/tech/20210803 Set up a VPN server on your Linux PC.md b/translated/tech/20210803 Set up a VPN server on your Linux PC.md new file mode 100644 index 0000000000..26587a4916 --- /dev/null +++ b/translated/tech/20210803 Set up a VPN server on your Linux PC.md @@ -0,0 +1,131 @@ +[#]: subject: (Set up a VPN server on your Linux PC) +[#]: via: (https://opensource.com/article/21/8/openvpn-server-linux) +[#]: author: (D. Greg Scott https://opensource.com/users/greg-scott) +[#]: collector: (lujun9972) +[#]: translator: (perfiffer) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在你的 `Linux` 电脑上安装一个 `VPN` 服务。 + +====== + +想要建立一个 `VPN` 的第一步是安装一个 `VPN` 服务器。 + +![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr) + +你是否已经连接到不受信任的网络,例如酒店或咖啡馆的 `WiFi`,并需要通过智能手机和笔记本电脑安全浏览互联网?通过使用虚拟专用网络(`VPN`),你可以匿名访问不受信任的网络,就像你在专用网络上一样安全。 + +`VPN` 是保护私人数据的绝佳工具。通过使用 `VPN`,你可以在保持匿名的同时连接到互联网上的专用网络。 + +可选的 `VPN` 服务有很多,[`OpenVPN`][2] 依然是很多人在使用不受信任的网络时保护私人数据的第一选择。 + +`OpenVPN` 在两点之间创建一个加密通道,防止第三方访问你的网络流量数据。通过设置你的 `VPN` 服务,你完全可以掌控自己的 `VPN`。许多流行的 `VPN` 服务都使用 `OpenVPN`,所以当你可以掌控自己的网络时,为什么要将你的网络连接绑定到特定的提供商呢? + +### 搭建 `Linux` 服务器 + +首先,在备用 `PC` 上安装一个 `Linux` 拷贝。本例使用 `Fedora`,但是不论你使用的是什么 `Linux` 发行版,步骤基本是相同的。 + +从 [Fedora 项目][3] 网站下载最新的 `Fedora ISO` 副本。制作一个 `USB` 启动盘,将其插入到你的 `PC` 并启动,然后安装操作系统。如果你从未制作过可引导的 `USB` 启动盘,请参照 [Fedora Media Writer][4]。如果您从未安装过 `Linux`,请阅读 [installing Linux in three steps][5]。 + +### 设置网络 + +安装完成 `Fedora` 操作系统后,登录到控制台或者 `SSH` 会话。 + +更新到最新并重新启动: + +``` +$ sudo dnf update -y && reboot +``` + +重新登录并关闭防火墙: + +``` +systemctl disable firewalld.service +systemctl stop firewalld.service +``` + +你可能希望在此系统上为你的内部网络添加适当的防火墙规则。如果是这样,请在关闭所有防火墙规则后完成 `OpenVPN` 的设置和调试,然后添加本地防火墙规则。想要了解更多,请参照 [setting up firewalls on Linux][6]。 + +### 设置 `IP` 地址 + +你需要在你的本地网络设置一个静态 `IP` 地址。下面的命令假设在一个名为 `en3` 的设备上有一个名为 `ens3` 的网络管理器连接。你的设备和连接名称可能不同,你可以通过打开 `SSH` 会话或从控制台输入以下命令: + +``` +$ sudo nmcli connection show +NAME  UUID                                  TYPE      DEVICE +ens3  39ad55bd-adde-384a-bb09-7f8e83380875  ethernet  ens3 +``` + +你需要确保远程用户能够找到你的 `VPN` 服务器。有两种方法可以做到这一点。你可以手动设置它的 `IP` 地址,或者将大部分工作交给你的路由器去完成。 + +#### 手动配置一个 `IP` 地址 + +通过以下命令来设置静态 `IP` 地址、前缀、网关和 `DNS` 解析器,用来替换掉原有的 `IP` 地址: + +``` +$ sudo nmcli connection modify ens3 ipv4.addresses 10.10.10.97/24 +$ sudo nmcli connection modify ens3 ipv4.gateway 10.10.10.1 +$ sudo nmcli connection modify ens3 ipv4.dns 10.10.10.10 +$ sudo nmcli connection modify ens3 ipv4.method manual +$ sudo nmcli connection modify ens3 connection.autoconnect yes +``` + +设置主机名: + + +``` +`$ sudo hostnamectl set-hostname OVPNserver2020` +``` +如果你运行了一个本地的 `DNS` 服务,你需要设置一个 `DNS` 条目,将主机名指向 `VPN` 服务器的 `IP` 地址。 + +重启并确保系统的网络运行正常。 + +#### 在路由器中配置 `IP` 地址 + +在你的网络当中应该有一台路由器。你可能已经购买了它,或者从互联网服务提供商(`ISP`)那里获得了一台。无论哪种方式,你的路由器可能都有一个内置的 `DHCP` 服务,可以为连接到网络上的每台设备分配一个 `IP` 地址。你的新 `VPN` 服务器也是属于网络的一台设备,因此你可能已经注意到它会自动分配一个 `IP` 地址。 + +这里的潜在问题是你的路由器不能保证每台设备都能在重新连接后获取到相同的 `IP` 地址。路由器确实尝试保持 `IP` 地址一致,但这会根据当时连接的设备数量而发生变化。 + +但是,几乎所有的路由器都会保留一个接口,允许你为特定设备调停和保留 `IP` 地址。 + +![Router IP address settings][7] + +路由器没有通用接口,因此请在你的路由器接口中搜索 `DHCP` 或静态 `IP` 地址选项。为你的服务器分配自己的预留 `IP` 地址,使其在网络中保持 `IP` 不变。 + +### 连接到服务器 +默认情况下,你的路由器可能内置了防火墙。这通常很好,因为你不希望网络之外的人能够强行进入你的任何计算机。但是,你必须允许发往 `VPN` 服务器的流量通过防火墙,否则你的 `VPN` 将无法访问,这种情况下你的 `VPN` 服务器将形同虚设。 + +你至少需要一个来自互联网服务提供商的公共静态 `IP` 地址。使用其静态 `IP` 地址设置路由器的公共端,然后将你的 `OpenVPN` 服务器放在私有端,在你的网络中使用私有静态 `IP` 地址。 `OpenVPN` 默认使用 `UDP` 1194 端口。配置你的路由器,将你的公网 `VPN` `IP` 地址的 `UDP` 1194 端口转发到 `OpenVPN` 服务器上的 `UDP` 1194 端口。如果你决定使用不同的 UDP 端口,请相应地调整端口号。 + +### 准备好,我们开始下一步 + +在本文中,你在服务器上安装并配置了一个操作系统,这已经成功了一半。在下一篇文章中,你将解决安装和配置 `OpenVPN` 本身的问题。同时,熟悉你的路由器并确保你可以从外部访问你的服务器。但是请务必在测试后关闭端口转发,直到你的 `VPN` 服务启动并运行。 + +* * * +本文的部分内容改编自 `D. Greg Scott` 的博客,并经许可重新发布。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/openvpn-server-linux + +作者:[D. Greg Scott][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-scott +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr (Person drinking a hot drink at the computer) +[2]: https://openvpn.net/ +[3]: http://getfedora.org +[4]: https://opensource.com/article/20/10/fedora-media-writer +[5]: https://opensource.com/article/21/2/linux-installation +[6]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd +[7]: https://opensource.com/sites/default/files/uploads/reserved-ip.jpg (Router IP address settings) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://opensource.com/article/20/9/firewall +[10]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/ From 9492f4350f1f1511b5f81f3c1fd5de636a675daa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 10:54:42 +0800 Subject: [PATCH 024/290] PUB @geekpi @turbokernel https://linux.cn/article-13676-1.html --- ... ways to manage Kubernetes with kubectl.md | 92 ++++++++++++++++++ ... ways to manage Kubernetes with kubectl.md | 95 ------------------- 2 files changed, 92 insertions(+), 95 deletions(-) create mode 100644 published/20210723 5 useful ways to manage Kubernetes with kubectl.md delete mode 100644 translated/tech/20210723 5 useful ways to manage Kubernetes with kubectl.md diff --git a/published/20210723 5 useful ways to manage Kubernetes with kubectl.md b/published/20210723 5 useful ways to manage Kubernetes with kubectl.md new file mode 100644 index 0000000000..0053ec6a0f --- /dev/null +++ b/published/20210723 5 useful ways to manage Kubernetes with kubectl.md @@ -0,0 +1,92 @@ +[#]: subject: (5 useful ways to manage Kubernetes with kubectl) +[#]: via: (https://opensource.com/article/21/7/kubectl) +[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (turbokernel) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13676-1.html) + +用 kubectl 管理 Kubernetes 的 5 种有用方法 +====== + +> 学习 kubectl,提升你与 Kubernetes 的互动方式。 + +![Ship captain sailing the Kubernetes seas][1] + +Kubernetes 可以帮你编排运行有大量容器的软件。Kubernetes 不仅提供工具来管理(或者说 [编排][2])运行的容器,还帮助这些容器根据需要进行扩展。有了 Kubernetes 作为你的中央控制面板control panel(或称 控制平面control plane),你需要一种方式来管理 Kubernetes,而这项工作的工具就是 kubectl。`kubectl` 命令让你控制、维护、分析和排查 Kubernetes 集群的故障。与许多使用 `ctl`(“控制”的缩写)后缀的工具一样,如 `systemctl` 和 `sysctl`,`kubectl` 拥有大量的功能和任务权限,所以如果你正在运行 Kubernetes,你肯定会经常使用它。它是一个拥有众多选项的命令,所以下面是 `kubectl` 中简单易用的五个常见任务。 + +### 1、列出并描述资源 + +按照设计,容器往往会成倍增加。在某些条件下,它们可以快速增加。如果你只能通过 `podman ps`或 `docker ps` 来查看正在运行的容器,这可能会让你不知所措。通过 `kubectl get` 和 `kubectl describe`,你可以列出正在运行的吊舱pod以及它们正在处理的容器信息。更重要的是,你可以通过使用 `--namespace` 或 `name` 或 `--selector`等选项,只列出所需信息。 + +`get` 子命令不仅仅对吊舱和容器有用。它也有关于节点、命名空间、发布、服务和副本的信息。 + +### 2、创建资源 + +如果你只通过类似 OpenShift、OKD 或 Kubernetes 提供的 Web 用户界面(UI)创建过发布,但你想从 Linux 终端控制你的集群,那么可以使用 `kubectl create`。`kubectl create` 命令并不只是实例化一个新的应用发布。Kubernetes 中还有很多其他组件可以创建,比如服务、配额和 [计划任务][3]。 + +Kubernetes 中的计划任务可以创建一个临时的吊舱,用来在你选择的时间表上执行一些任务。它们并不难设置。下面是一个计划任务,让一个 BusyBox 镜像每分钟打印 “hello world”。 + +``` +$ kubectl create cronjob \ + hello-world \ + --image=busybox \ + --schedule="*/1 * * * *" -- echo "hello world" +``` + +### 3、编辑文件 + +Kubernetes 中的对象都有相应的配置文件,但在文件系统中查找相应的文件较为麻烦。有了 `kubectl edit`,你可以把注意力放在对象上,而不是定义文件上。你可以通过 `kubectl` 找到并打开文件(通过 `KUBE_EDITOR` 环境变量,你可以设置成你喜欢的编辑器)。 + +``` +$ KUBE_EDITOR=emacs \ + kubectl edit cronjob/hello-world +``` + +### 4、容器之间的传输文件 + +初次接触容器的人往往对无法直接访问的共享系统的概念感到困惑。他们可能会在容器引擎或 `kubectl` 中了解到 `exec` 选项,但当他们不能从容器中提取文件或将文件放入容器中时,容器仍然会显得不透明。使用 `kubectl cp` 命令,你可以把容器当做远程服务器,使主机和容器之间文件传输如 SSH 命令一样简单: + +``` +$ kubectl cp foo my-pod:/tmp +``` + +### 5、应用变更 + +对 Kubernetes 对象进行修改,可以通过 `kubectl apply` 命令完成。你所要做的就是将该命令指向一个配置文件: + +``` +$ kubectl apply -f ./mypod.json +``` + +类似于运行 Ansible 剧本或 Bash 脚本,`apply` 使得快速“导入”设置到运行中的 Kubernetes 实例很容易。例如,GitOps 工具 [ArgoCD][4] 由于 `apply` 子命令,安装起来出奇地简单: + +``` +$ kubectl create namespace argocd +$ kubectl apply -n argocd \ + -f https://raw.githubusercontent.com/argoproj/argo-cd/vx.y.z/manifests/install.yaml +``` + +### 使用 kubectl + +Kubectl 是一个强大的工具,由于它是一个终端命令,它可以写成脚本,并能实现用众多 Web UI 无法实现的功能。学习 `kubectl` 是进一步了解 Kubernetes、容器、吊舱以及围绕这些重要的云计算创新技术的一个好方法。[下载我们的 kubectl 速查表][5],以获得快速参考,其中包括命令示例,以帮助你学习,并在为你提供注意细节。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/kubectl + +作者:[Alan Smithee][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[turbokernel](https://github.com/turbokernel) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) +[2]: https://opensource.com/article/20/11/orchestration-vs-automation +[3]: https://opensource.com/article/20/11/kubernetes-jobs-cronjobs +[4]: https://argoproj.github.io/argo-cd/ +[5]: https://opensource.com/downloads/kubectl-cheat-sheet diff --git a/translated/tech/20210723 5 useful ways to manage Kubernetes with kubectl.md b/translated/tech/20210723 5 useful ways to manage Kubernetes with kubectl.md deleted file mode 100644 index e134bfa6a3..0000000000 --- a/translated/tech/20210723 5 useful ways to manage Kubernetes with kubectl.md +++ /dev/null @@ -1,95 +0,0 @@ -[#]: subject: (5 useful ways to manage Kubernetes with kubectl) -[#]: via: (https://opensource.com/article/21/7/kubectl) -[#]: author: (Alan Smithee https://opensource.com/users/alansmithee) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: (turbokernel) -[#]: publisher: ( ) -[#]: url: ( ) - -用 kubectl 管理 Kubernetes 的 5 种有用方法 -====== -学习kubectl,提升你与 Kubernetes 的互动方式。 -![Ship captain sailing the Kubernetes seas][1] - -Kubernetes 可以帮你编排运行大量容器的软件。Kubernetes 不仅提供工具来管理(或[编排][2])运行的容器,还帮助这些容器根据需要进行扩展。有了 Kubernetes 作为你的中央控制平台(或称 _control plane_),你需要一种方式来管理 Kubernetes,而这项工作的工具就是 kubectl。`kubectl` 命令让你控制、维护、分析和排查 Kubernetes 集群的故障。与许多使用 `ctl`(“控制”的缩写)后缀的工具一样,如 systemctl 和 sysctl,kubectl 拥有大量的功能和任务权限,所以如果你正在运行 Kubernetes,你最终会经常使用它。它是一个拥有众多选项的命令,所以下面是 kubectl 中简单易用的五个常见任务。 - -### 1\. 列出并描述资源 - -按照设计,容器往往会成倍增加。在某些条件下,它们可以快速增加。如果你只能通过 `podman ps`或 `docker ps` 来查看正在运行的容器,这可能会让你不知所措。通过 `kubectl get` 和 `kubectl describe`,你可以列出正在运行的 pod 以及它们正在处理的容器信息。更重要的是,你可以通过使用 `--namespace` 或 `name` 或 `--selector`等选项,只列出所需信息。 - -`get` 子命令不仅仅对 pod 和容器有用。它有关于节点、命名空间、发布、服务和副本的信息。 - -### 2\. 创建资源 - -如果你只通过类似 OpenShift、OKD 或 Kubernetes 提供的 Web 用户界面(UI)创建过发布,但你想从 Linux 终端控制你的集群,那么可以使用 `kubectl create`。`kubectl create` 命令并不只是实例化一个新的应用发布。Kubernetes 中还有很多其他组件可以创建,比如服务、配额和 [计划任务][3]。 - -Kubernetes 中的计划任务可以创建一个临时的 pod,用来在你选择的时间表上执行一些任务。它们并不难设置。下面是一个计划任务,让一个 BusyBox 镜像每分钟打印 “hello world”。 - - -``` -$ kubectl create cronjob \ -hello-world \ -\--image=busybox \ -\--schedule="*/1 * * * *" -- echo "hello world" -``` - -### 3\. 编辑文件 - -Kubernetes 中的对象都有相应的配置文件,但在文件系统中查找相应的文件较为麻烦。有了 `kubectl edit`,你可以把注意力放在对象上,而不是定义文件上。你可以通过 `kubectl` 找到并打开文件(关联 `KUBE_EDITOR` 环境变量,你可以设置成你喜欢的编辑器)。 - - -``` -$ KUBE_EDITOR=emacs \ -kubectl edit cronjob/hello-world -``` - -### 4\. 容器之间的传输文件 - -初次接触容器的人往往对无法直接访问的共享系统的概念感到困惑。他们可能会在容器引擎或 kubectl 中了解到 `exec` 选项,但当他们不能从容器中提取文件或将文件放入容器中时,容器仍然会显得不透明。使用 `kubectl cp` 命令,你可以把容器当做远程服务器,使主机和容器之间文件传输如 SSH 命令一样简单: - - -``` -`$ kubectl cp foo my-pod:/tmp` -``` - -### 5\. 应用变更 - -对 Kubernetes 对象进行修改,可以通过 `kubectl apply` 命令完成。你所要做的就是将该命令指向一个配置文件: - - -``` -`$ kubectl apply -f ./mypod.json` -``` - -类似于运行 Ansible playbook 或 Bash 脚本,`apply` 使得快速“导入”设置到运行中的 Kubernetes 实例很容易。例如,GitOps 工具 [ArgoCD][4] 由于 `apply` 子命令,安装起来出奇地简单: - - -``` -$ kubectl create namespace argocd -$ kubectl apply -n argocd \ --f -``` - -### 使用 kubectl - -Kubectl 是一个强大的工具,由于它是一个终端命令,它可以写成脚本,并能实现用众多 Web UI 无法实现的功能。学习 kubectl 是进一步了解 Kubernetes、容器、pod 以及围绕这些重要的云计算创新技术的一个好方法。[下载我们的 kubectl 速查表][5],以获得快速参考,其中包括命令示例,以帮助你学习,并在为你提供注意细节。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/kubectl - -作者:[Alan Smithee][a] -选题:[lujun9972][b] -译者:[geekpi](https://github.com/geekpi) -校对:[turbokernel](https://github.com/turbokernel) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/alansmithee -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/ship_captain_devops_kubernetes_steer.png?itok=LAHfIpek (Ship captain sailing the Kubernetes seas) -[2]: https://opensource.com/article/20/11/orchestration-vs-automation -[3]: https://opensource.com/article/20/11/kubernetes-jobs-cronjobs -[4]: https://argoproj.github.io/argo-cd/ -[5]: https://opensource.com/downloads/kubectl-cheat-sheet From 03986b6c9c42a5b87d44ffe2375822cb345f56f7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 11:23:58 +0800 Subject: [PATCH 025/290] PRF&PUB @geekpi https://linux.cn/article-13677-1.html --- ...210804 Move files in the Linux terminal.md | 52 +++++++++++++++++++ ...210804 Move files in the Linux terminal.md | 52 ------------------- 2 files changed, 52 insertions(+), 52 deletions(-) create mode 100644 published/20210804 Move files in the Linux terminal.md delete mode 100644 translated/tech/20210804 Move files in the Linux terminal.md diff --git a/published/20210804 Move files in the Linux terminal.md b/published/20210804 Move files in the Linux terminal.md new file mode 100644 index 0000000000..c198ff28ea --- /dev/null +++ b/published/20210804 Move files in the Linux terminal.md @@ -0,0 +1,52 @@ +[#]: subject: (Move files in the Linux terminal) +[#]: via: (https://opensource.com/article/21/8/move-files-linux) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13677-1.html) + +基础:在 Linux 终端中移动文件 +====== + +> 使用 mv 命令将一个文件从一个位置移动到另一个位置。 + +![](https://img.linux.net.cn/data/attachment/album/202108/13/112248lnal8a0qz50zqzld.jpg) + +要在有图形界面的计算机上移动一个文件,你要打开该文件当前所在的文件夹,然后打开另一个窗口导航到你想把文件移到的文件夹。最后,你把文件从一个窗口拖到另一个窗口。 + +要在终端中移动文件,你可以使用 `mv` 命令将文件从一个位置移动到另一个位置。 + +``` +$ mv example.txt ~/Documents + +$ ls ~/Documents +example.txt +``` + +在这个例子中,你已经把 `example.txt` 从当前文件夹移到了主目录下的 `Documents` 文件夹中。 + +只要你知道一个文件在 _哪里_,又想把它移到 _哪里_ 去,你就可以把文件从任何地方移动到任何地方,而不管你在哪里。与在一系列窗口中浏览你电脑上的所有文件夹以找到一个文件,然后打开一个新窗口到你想让该文件去的地方,再拖动该文件相比,这可以大大节省时间。 + +默认情况下,`mv` 命令完全按照它被告知的那样做:它将一个文件从一个位置移动到另一个位置。如果在目标位置已经存在一个同名的文件,它将被覆盖。为了防止文件在没有警告的情况下被覆盖,请使用 `--interactive`(或简写 `-i`)选项。 + +``` +$ mv -i example.txt ~/Documents +mv: overwrite '/home/tux/Documents/example.txt'? +``` + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/move-files-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/ch01s05.svg_.png?itok=PgKQEDZ7 (Moving files) diff --git a/translated/tech/20210804 Move files in the Linux terminal.md b/translated/tech/20210804 Move files in the Linux terminal.md deleted file mode 100644 index 6bdce686cd..0000000000 --- a/translated/tech/20210804 Move files in the Linux terminal.md +++ /dev/null @@ -1,52 +0,0 @@ -[#]: subject: (Move files in the Linux terminal) -[#]: via: (https://opensource.com/article/21/8/move-files-linux) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -在 Linux 终端中移动文件 -====== -使用 mv 命令将一个文件从一个位置移动到另一个位置。 -![Moving files][1] - -要在有图形界面的计算机上移动一个文件,你要打开该文件当前所在的文件夹,然后打开另一个窗口到你想把文件移到的文件夹。最后,你把文件从一个窗口拖到另一个窗口。 - -要在终端中移动文件,你可以使用 **mv** 命令将文件从一个位置移动到另一个位置。 - - -``` -$ mv example.txt ~/Documents - -$ ls ~/Documents -example.txt -``` - -在这个例子中,你已经把 **example.txt** 从当前文件夹移到了 **Documents** 文件夹中。 - -只要你知道一个文件在__哪里__,又想把它移到_哪里_去,你就可以把文件从任何地方移动到任何地方,而不管你在哪里。与在一系列窗口中浏览你电脑上的所有文件夹以找到一个文件,然后打开一个新窗口到你想让该文件去的地方,再拖动该文件相比,这可以大大节省时间。 - -默认情况下,**mv** 命令完全按照它被告知的那样做:它将一个文件从一个位置移动到另一个位置。如果在目标位置已经存在一个同名的文件,它将被覆盖。为了防止文件在没有警告的情况下被覆盖,请使用 **\--interactive**(或简写 **-i**)选项。 - - -``` -$ mv -i example.txt ~/Documents -mv: overwrite '/home/tux/Documents/example.txt'? -``` - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/move-files-linux - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/ch01s05.svg_.png?itok=PgKQEDZ7 (Moving files) From 3a1dcb0942c475d7619fba073be6ffe892ea37e1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 12:02:57 +0800 Subject: [PATCH 026/290] APL --- ...0811 Top 11 New Features in elementary OS 6 Linux Release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md b/sources/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md index b06f1a1acf..6fac063ae7 100644 --- a/sources/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md +++ b/sources/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/elementary-os-6-features/" [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From e77d20026c153d2138fb4208f5661852ba4826e6 Mon Sep 17 00:00:00 2001 From: George <40418272+unigeorge@users.noreply.github.com> Date: Fri, 13 Aug 2021 13:16:37 +0800 Subject: [PATCH 027/290] translating --- sources/tech/20210608 Tune your MySQL queries like a pro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210608 Tune your MySQL queries like a pro.md b/sources/tech/20210608 Tune your MySQL queries like a pro.md index 10cf4a15c0..f1b6ac247f 100644 --- a/sources/tech/20210608 Tune your MySQL queries like a pro.md +++ b/sources/tech/20210608 Tune your MySQL queries like a pro.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/mysql-query-tuning) [#]: author: (Dave Stokes https://opensource.com/users/davidmstokes) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (unigeorge) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -95,7 +95,7 @@ via: https://opensource.com/article/21/5/mysql-query-tuning 作者:[Dave Stokes][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[unigeorge](https://github.com/unigeorge) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d0fa97e9881cc3c229b7fb3fcbeeee7807043df1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 14:21:31 +0800 Subject: [PATCH 028/290] TSL&PRF --- ...atures in elementary OS 6 Linux Release.md | 198 ------------------ ...atures in elementary OS 6 Linux Release.md | 174 +++++++++++++++ 2 files changed, 174 insertions(+), 198 deletions(-) delete mode 100644 sources/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md create mode 100644 translated/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md diff --git a/sources/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md b/sources/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md deleted file mode 100644 index 6fac063ae7..0000000000 --- a/sources/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md +++ /dev/null @@ -1,198 +0,0 @@ -[#]: subject: "Top 11 New Features in elementary OS 6 Linux Release" -[#]: via: "https://news.itsfoss.com/elementary-os-6-features/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Top 11 New Features in elementary OS 6 Linux Release -====== - -elementary OS 6 is a major upgrade after a few good years of updates to the 5.x series. - -While the 5.x series has had numerous feature updates and improvements, [elementary OS 6][1] looks to be an exciting endeavor. - -Here, we shall take a look at all the new features and additions that have been introduced with elementary OS 6. - -### 1\. Dark Style & Accent Color - -![][2] - -[elementary OS][3] approaches the dark style theme similar to how mainstream options work, as an opt-in preference. You get to choose it from the Welcome screen right after you install elementary OS 6. - -While the addition of a dark mode may sound like something minor, they seem to have put a great deal of effort to provide a consistent dark mode experience overall. - -All the first-party applications seamlessly support both the dark style and light theme. - -elementary OS will also let the app developers respect the user’s preference in elementary OS 6. So, if the user prefers a dark mode or light mode, the app can adapt to that. - -Along with new accent colors available, there is an automatic accent color preference that picks the color from your current wallpaper. - -### 2\. Improved Notifications & Redesigned Notification Center - -The notifications now support icon badges and action buttons, which should make up for a better experience. - -![][4] - -This could let you quickly open links, mark a message read, along with several other possibilities. - -Urgent notifications have a new look and a unique sound to help you identify them. - -In addition to the notification improvements, the notification center has also been revamped to look better and clean with multiple notifications. - -### 3\. Online Accounts - -Finally, with elementary OS 6, you will be able to add online accounts from the system settings. - -Once signed in, your data will sync across the system apps wherever supported (like Calendar, Tasks). - -It should also show up in the system tray notifications. - -### 4\. First-Party Flatpak Apps & Permissions View - -To improve privacy and security across the platform, elementary OS 6 chose the Flatpak-first approach. - -elementary OS now has its own AppCenter Flatpak repository. Some of the default applications come baked in as Flatpak packages and all the applications listed in AppCenter are available as Flatpaks as well. - -Overall, this means a better sandboxing experience where all of your applications will stay isolated from each other without accessing your sensitive data. - -![][5] - -And, to top it all off, elementary OS 6 adds “Portals” where the applications will request permission to access your files or launch another application. - -You also get to control all the permissions from the System Settings. - -### 5\. Multi-Touch Gestures - -![][6] - -For Laptop and touchpad users, the new multi-touch gestures are going to come in extremely handy. - -From accessing the multitasking view to navigating through the workspaces, you can do it all using multi-touch gestures. - -Not just limited to certain functions on the desktop, you can interact with notifications, swipe through applications, and can have a seamless system-wide experience with the new multi-touch gestures. - -You can customize the gestures or learn more about it from the Gestures section under the System Settings. - -### 6\. Screen Shield - -With elementary OS 5, some noticed an issue with automatic screen locking when you want to run a time-consuming task or simply watch videos. - -However, this changes with elementary OS 6, not only it solves the issue, it brings in a new implementation in the form of “**Screen Shield**” feature. - -So, you can easily keep your system awake without sudden disruptions when watching a video or performing a time-consuming task. - -It utilizes GNOME’s daemon settings to have better compatibility with third-party applications. - -### 7\. New Tasks App - -![][7] - -A new tasks app has been added in elementary OS 6 where you can manage tasks, get reminded of them, and organize them on your system or synchronize it with an online account. - -I may not replace it with Planner just yet, but it is a good addition to have baked in. - -### 8\. Firmware Updates App - -![][5] - -You can get the latest firmware updates for supported devices without fiddling with any other settings. - -Just look for the “Firmware” application from the menu to get started. - -### 9\. App Updates - -Several applications have been updated while introducing new capabilities. - -For instance, Epiphany browser was renamed to “Web” and is now available as a Flatpak to facilitate quick updates. - -It also includes tracking protection and ad blocking built-in. - -Some other notable changes include: - - * The camera app has recieved a new UI overhaul with the ability to switch cameras, mirroring of image, and more. - * AppCenter not just lists Flatpak apps now but also notifies you when an application has completed installation to let you quickly open it. - * Files app has also received improvements in the form a new sidebar and list view. Also, a double-click is now required to open a file and a single click can navigate through folders. - - - -Other applications like Mail, Calendar have also received improvements for better online integrations. - -### 10\. Improved Desktop Workflow & Screenshot Utility - -![][8] - -The multitasking view now helps you clearly distinguish among multiple active windows. And the hot corners view lets you move the window to a new workspace and maximize the window as well. - -![][9] - -The screenshot utility can be moved around in the window, not just stuck to the center of the window. You can also drag and drop the image from the preview without needing to save it. - -### 11\. Improved Installer - -![][10] - -You will notice some new subtle animations, and some efforts have been made to provide a consistent layout of the installer without re-sizing the window. - -![][11] - -![][11] - -![][12] - -![][12] - -![][12] - -![][13] - -![][13] - -![][12] - -![][12] - -It isn’t a major overhaul, but they mention that the new installer comes with an improved disk detection and error handling, which should make the installation seamless. - -### Wrapping Up - -[elementary OS 6][3] is an exciting release with several improvements. Even though the look and feel is not entirely different, it has been polished across the board. - -I like what they are doing to provide a consistent and beautiful user experience. Also, changes like system-wide Flatpak should make things easier and safer for users. - -What do you think about this release? Have you tried it yet? - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/elementary-os-6-features/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/elementary-os-6-release/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://elementary.io -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE4MCIgd2lkdGg9IjcyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU3NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjgxNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY5MiIgd2lkdGg9IjY2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[13]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ5NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= diff --git a/translated/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md b/translated/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md new file mode 100644 index 0000000000..408e76fdc3 --- /dev/null +++ b/translated/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md @@ -0,0 +1,174 @@ +[#]: subject: "Top 11 New Features in elementary OS 6 Linux Release" +[#]: via: "https://news.itsfoss.com/elementary-os-6-features/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +elementary OS 6 Linux 中的 11 个亮点 +====== + +> elementary OS 6 终于来了。让我们看一下这个主要版本中的重要亮点。 + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/elementary-os-6-features.png?w=1200&ssl=1) + +elementary OS 6 是其 5.x 系列经过几年更新后的一次重大升级。 + +虽然 5.x 系列也有许多功能更新和改进,但 [elementary OS 6][1] 的努力成果看起来令人兴奋。 + +在这里,让我们来看看 elementary OS 6 引入的所有新功能和变化。 + +### 1、暗黑风格及强调色 + +![][2] + +[elementary OS][3] 暗黑风格的主题与现在主流的工作方式类似,是一种选择的偏好。你可以在安装 elementary OS 6 之后,在欢迎屏幕上选择它。 + +虽然增加暗黑模式听起来像是小事一桩,但他们似乎投入了大量的精力来提供一个整体一致的暗黑模式体验。 + +所有的第一方应用程序都无缝地支持暗黑风格和浅色主题。 + +elementary OS 还让应用开发者在 elementary OS 6 中遵照用户的偏好。因此,如果用户喜欢暗黑模式或浅色模式,应用程序就可以适应这种模式。 + +伴随着新的强调色的出现,还有一个自动的强调色偏好,可以从你当前的壁纸中挑选出强调的颜色。 + +### 2、改进的通知及重新设计的通知中心 + +通知现在支持图标徽章和行动按钮,这应该能提供更好的体验。 + +![][4] + +这可以让你快速打开链接、标记一条消息已读,以及其他几种可能的操作。 + +紧急通知有了新的外观和独特的声音,以帮助你识别它们。 + +除了通知方面的改进,通知中心也进行了改造,使其看起来更好,并可以对多个通知进行清理。 + +### 3、在线账户 + +终于,在 elementary OS 6 中,你能够从系统设置中添加在线账户了。 + +一旦登录,你的数据将在支持的系统应用程序(如日历、任务)中同步。 + +它也会显示在系统托盘通知中。 + +### 4、第一方 Flatpak 应用及权限查看 + +为了提高整个平台的隐私和安全,elementary OS 6 采用了优先选择 Flatpak 的方式。 + +Elementary OS 现在有自己的应用中心 Flatpak 资源库。一些默认的应用程序以 Flatpak 包的形式出现,应用中心列出的所有应用程序也都有 Flatpak。 + +总的来说,这意味着更好的沙盒体验,你的所有应用程序将保持相互隔离,不会访问你的敏感数据。 + +![][5] + +而且,最重要的是,elementary OS 6 增加了“门户”功能,应用程序会请求权限,以访问你的文件或启动另一个应用程序。 + +你还可以从系统设置中控制所有的权限。 + +### 5、多点触控手势 + +![][6] + +对于笔记本电脑和触摸板用户来说,新的多点触控手势将变得非常方便。 + +从访问多任务视图到浏览工作区,你都可以用多点触摸手势来完成。 + +不仅仅局限于桌面上的某些功能,你还可以与通知互动、滑过应用程序,并可以通过新的多点触控手势获得全系统的顺滑体验。 + +你可以自定义手势或从系统设置下的手势部分了解更多信息。 + +### 6、屏幕盾牌 + +在 elementary OS 5 中,有些人注意到当你想运行一个耗时的任务或简单地观看视频时,会出现自动锁定屏幕的问题。 + +然而,这种情况在 elementary OS 6 中得到了改变,它不仅解决了这个问题,还以 “屏幕盾牌” 功能的形式带来了新的实现方式。 + +因此,在观看视频或执行耗时的任务时,你可以轻松地保持系统的清醒,而不会突然中断。 + +它利用了 GNOME 的守护程序设置,与第三方应用程序有更好的兼容性。 + +### 7、新的任务应用 + +![][7] + +elementary OS 6 中添加了一个新的任务应用,在那里你可以管理任务、收到提醒,并在你的系统上组织任务,或与在线账户同步。 + +我可能还不会用它来取代 Planner,但它是一个很好的补充,因为它打造的很好。 + +### 8、固件更新应用程序 + +![][14] + +你可以为支持的设备获得最新的固件更新,而无需摆弄任何其他设置。 + +只要从菜单中寻找“固件”应用程序就可以开始了。 + +### 9、更新的应用程序 + +一些应用程序已经被更新,同时引入了新的功能。 + +例如,Epiphany 浏览器被重新命名为 “Web”,现在有 Flatpak 包可用,以方便快速更新。 + +它还包括内置的跟踪保护和广告拦截。 + +其他一些值得注意的变化包括: + + * 相机应用获得了一个新的用户界面,可以切换相机、镜像图像等等。 + * 应用中心现在不仅列出了 Flatpak 应用程序,而且还在应用程序完成安装后通知你,让你快速打开它。 + * 文件应用程序也得到了改进,其形式是一个新的侧边栏和列表视图。另外,现在需要双击才能打开一个文件,而单次点击可以在文件夹中导航。 + +其他应用程序如邮件、日历也得到了改进,以便更好地进行在线整合。 + +### 10、改进的桌面工作流程及屏幕截图工具 + +![][8] + +多任务视图现在可以帮助你明确区分多个活动窗口。而热角视图可以让你将窗口移动到新的工作区,也可以将窗口最大化。 + +![][9] + +屏幕截图工具可以在窗口中移动,而不仅仅是停留在窗口的中心。你还可以从预览中拖放图片,而不需要保存。 + +### 11、改进的安装程序 + +![][10] + +你会注意到一些新的微妙的动画,而且还做了一些努力,以便在不重新调整窗口大小的情况下提供一个一致的安装程序布局。 + +这不是一次大修,但他们提到新的安装程序带有改进的磁盘检测和错误处理功能,这应该能使安装顺滑进行。 + +### 总结 + +[elementary OS 6][3] 是一个激动人心的版本,有多项改进。尽管外观和感觉并没有完全改变,但它已被全面精心雕琢。 + +我喜欢他们为提供一致和漂亮的用户体验所做的工作。另外,像全系统的 Flatpak 这样的变化应该使用户更容易和更安全。 + +你对这个版本有什么看法?你试过了吗? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/elementary-os-6-features/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/elementary-os-6-release/ +[2]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/07/dark-style-elementary.jpg?w=1200&ssl=1 +[3]: https://elementary.io +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/notification-badge-elementary-os-6.png?w=724&ssl=1 +[5]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/elementary-os-6-permissions.png?resize=1568%2C1158&ssl=1 +[6]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/multitouch-multitasking.png?resize=1568%2C883&ssl=1 +[7]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/tasks.png?resize=1568%2C1188&ssl=1 +[8]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/window-context-dark.png?w=808&ssl=1 +[9]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/screenshot.png?w=660&ssl=1 +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/installer-progress.png?resize=1568%2C1140&ssl=1 +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/firmware.png?resize=1568%2C1158&ssl=1 \ No newline at end of file From 1ad46b3179a8d7a80f630386c8b3556dc4d9fffa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 14:24:40 +0800 Subject: [PATCH 029/290] PUB @wxy https://linux.cn/article-13678-1.html --- ...11 Top 11 New Features in elementary OS 6 Linux Release.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210811 Top 11 New Features in elementary OS 6 Linux Release.md (99%) diff --git a/translated/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md b/published/20210811 Top 11 New Features in elementary OS 6 Linux Release.md similarity index 99% rename from translated/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md rename to published/20210811 Top 11 New Features in elementary OS 6 Linux Release.md index 408e76fdc3..e43ef67969 100644 --- a/translated/news/20210811 Top 11 New Features in elementary OS 6 Linux Release.md +++ b/published/20210811 Top 11 New Features in elementary OS 6 Linux Release.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13678-1.html" elementary OS 6 Linux 中的 11 个亮点 ====== From 51062e055f23683af52018108f425ae95cbd840d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 21:33:53 +0800 Subject: [PATCH 030/290] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @perfiffer 为清风讳有修改。 另外,不要滥用反撇号 ` 。 --- ...03 Set up a VPN server on your Linux PC.md | 67 +++++++++---------- 1 file changed, 33 insertions(+), 34 deletions(-) diff --git a/translated/tech/20210803 Set up a VPN server on your Linux PC.md b/translated/tech/20210803 Set up a VPN server on your Linux PC.md index 26587a4916..b9881206c6 100644 --- a/translated/tech/20210803 Set up a VPN server on your Linux PC.md +++ b/translated/tech/20210803 Set up a VPN server on your Linux PC.md @@ -3,35 +3,34 @@ [#]: author: (D. Greg Scott https://opensource.com/users/greg-scott) [#]: collector: (lujun9972) [#]: translator: (perfiffer) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -在你的 `Linux` 电脑上安装一个 `VPN` 服务。 - +如何在免费 WiFi 中保护隐私(一) ====== -想要建立一个 `VPN` 的第一步是安装一个 `VPN` 服务器。 +> 第一步是安装一个“虚拟专用网络”服务器。 -![](https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coffee_tea_laptop_computer_work_desk.png?itok=D5yMx_Dr) +![](https://img.linux.net.cn/data/attachment/album/202108/13/213142rclc5htyfahotfas.jpg) -你是否已经连接到不受信任的网络,例如酒店或咖啡馆的 `WiFi`,并需要通过智能手机和笔记本电脑安全浏览互联网?通过使用虚拟专用网络(`VPN`),你可以匿名访问不受信任的网络,就像你在专用网络上一样安全。 +你是否连接到了不受信任的网络,例如酒店或咖啡馆的 WiFi,而又需要通过智能手机和笔记本电脑安全浏览互联网?通过使用虚拟专用网络,你可以匿名访问不受信任的网络,就像你在专用网络上一样安全。 -`VPN` 是保护私人数据的绝佳工具。通过使用 `VPN`,你可以在保持匿名的同时连接到互联网上的专用网络。 +“虚拟专用网络” 是保护私人数据的绝佳工具。通过使用 “虚拟专用网络”,你可以在保持匿名的同时连接到互联网上的专用网络。 -可选的 `VPN` 服务有很多,[`OpenVPN`][2] 依然是很多人在使用不受信任的网络时保护私人数据的第一选择。 +可选的 “虚拟专用网络” 服务有很多,[0penVPN][2] 依然是很多人在使用不受信任的网络时保护私人数据的第一选择。 -`OpenVPN` 在两点之间创建一个加密通道,防止第三方访问你的网络流量数据。通过设置你的 `VPN` 服务,你完全可以掌控自己的 `VPN`。许多流行的 `VPN` 服务都使用 `OpenVPN`,所以当你可以掌控自己的网络时,为什么要将你的网络连接绑定到特定的提供商呢? +0penVPN 在两点之间创建一个加密通道,防止第三方访问你的网络流量数据。通过设置你的 “虚拟专用网络” 服务,你可以成为你自己的 “虚拟专用网络” 服务商。许多流行的 “虚拟专用网络” 服务都使用 0penVPN,所以当你可以掌控自己的网络时,为什么还要将你的网络连接绑定到特定的提供商呢? -### 搭建 `Linux` 服务器 +### 搭建 Linux 服务器 -首先,在备用 `PC` 上安装一个 `Linux` 拷贝。本例使用 `Fedora`,但是不论你使用的是什么 `Linux` 发行版,步骤基本是相同的。 +首先,在备用 PC 上安装一份 Linux。本例使用 Fedora,但是不论你使用的是什么 Linux 发行版,步骤基本是相同的。 -从 [Fedora 项目][3] 网站下载最新的 `Fedora ISO` 副本。制作一个 `USB` 启动盘,将其插入到你的 `PC` 并启动,然后安装操作系统。如果你从未制作过可引导的 `USB` 启动盘,请参照 [Fedora Media Writer][4]。如果您从未安装过 `Linux`,请阅读 [installing Linux in three steps][5]。 +从 [Fedora 项目][3] 网站下载最新的 Fedora ISO 副本。制作一个 USB 启动盘,将其插入到你的 PC 并启动,然后安装操作系统。如果你从未制作过可引导的 USB 启动盘,可以了解一下 [Fedora Media Writer][4]。如果你从未安装过 Linux,请阅读 [三步安装 Linux][5]。 ### 设置网络 -安装完成 `Fedora` 操作系统后,登录到控制台或者 `SSH` 会话。 +安装完成 Fedora 操作系统后,登录到控制台或者 SSH 会话。 更新到最新并重新启动: @@ -46,11 +45,11 @@ systemctl disable firewalld.service systemctl stop firewalld.service ``` -你可能希望在此系统上为你的内部网络添加适当的防火墙规则。如果是这样,请在关闭所有防火墙规则后完成 `OpenVPN` 的设置和调试,然后添加本地防火墙规则。想要了解更多,请参照 [setting up firewalls on Linux][6]。 +你可能希望在此系统上为你的内部网络添加适当的防火墙规则。如果是这样,请在关闭所有防火墙规则后完成 0penVPN 的设置和调试,然后添加本地防火墙规则。想要了解更多,请参照 [在 Linux 上设置防火墙][6]。 -### 设置 `IP` 地址 +### 设置 IP 地址 -你需要在你的本地网络设置一个静态 `IP` 地址。下面的命令假设在一个名为 `en3` 的设备上有一个名为 `ens3` 的网络管理器连接。你的设备和连接名称可能不同,你可以通过打开 `SSH` 会话或从控制台输入以下命令: +你需要在你的本地网络设置一个静态 IP 地址。下面的命令假设在一个名为 `ens3` 的设备上有一个名为 `ens3` 的网络管理器Network Manager连接。你的设备和连接名称可能不同,你可以通过打开 SSH 会话或从控制台输入以下命令: ``` $ sudo nmcli connection show @@ -58,11 +57,11 @@ NAME  UUID                                  TYPE      DEVIC ens3  39ad55bd-adde-384a-bb09-7f8e83380875  ethernet  ens3 ``` -你需要确保远程用户能够找到你的 `VPN` 服务器。有两种方法可以做到这一点。你可以手动设置它的 `IP` 地址,或者将大部分工作交给你的路由器去完成。 +你需要确保远程用户能够找到你的 “虚拟专用网络” 服务器。有两种方法可以做到这一点。你可以手动设置它的 IP 地址,或者将大部分工作交给你的路由器去完成。 -#### 手动配置一个 `IP` 地址 +#### 手动配置一个 IP 地址 -通过以下命令来设置静态 `IP` 地址、前缀、网关和 `DNS` 解析器,用来替换掉原有的 `IP` 地址: +通过以下命令来设置静态 IP 地址、前缀、网关和 DNS 解析器,用来替换掉原有的 IP 地址: ``` $ sudo nmcli connection modify ens3 ipv4.addresses 10.10.10.97/24 @@ -74,37 +73,37 @@ $ sudo nmcli connection modify ens3 connection.autoconnect yes 设置主机名: +``` +$ sudo hostnamectl set-hostname OVPNserver2020 +``` -``` -`$ sudo hostnamectl set-hostname OVPNserver2020` -``` -如果你运行了一个本地的 `DNS` 服务,你需要设置一个 `DNS` 条目,将主机名指向 `VPN` 服务器的 `IP` 地址。 +如果你运行了一个本地的 DNS 服务,你需要设置一个 DNS 条目,将主机名指向 “虚拟专用网络” 服务器的 IP 地址。 重启并确保系统的网络运行正常。 -#### 在路由器中配置 `IP` 地址 +#### 在路由器中配置 IP 地址 -在你的网络当中应该有一台路由器。你可能已经购买了它,或者从互联网服务提供商(`ISP`)那里获得了一台。无论哪种方式,你的路由器可能都有一个内置的 `DHCP` 服务,可以为连接到网络上的每台设备分配一个 `IP` 地址。你的新 `VPN` 服务器也是属于网络的一台设备,因此你可能已经注意到它会自动分配一个 `IP` 地址。 +在你的网络当中应该有一台路由器。你可能已经购买了它,或者从互联网服务提供商(ISP)那里获得了一台。无论哪种方式,你的路由器可能都有一个内置的 DHCP 服务,可以为连接到网络上的每台设备分配一个 IP 地址。你的新 “虚拟专用网络” 服务器也是属于网络的一台设备,因此你可能已经注意到它会自动分配一个 IP 地址。 -这里的潜在问题是你的路由器不能保证每台设备都能在重新连接后获取到相同的 `IP` 地址。路由器确实尝试保持 `IP` 地址一致,但这会根据当时连接的设备数量而发生变化。 +这里的潜在问题是你的路由器不能保证每台设备都能在重新连接后获取到相同的 IP 地址。路由器确实尝试保持 IP 地址一致,但这会根据当时连接的设备数量而发生变化。 -但是,几乎所有的路由器都会保留一个接口,允许你为特定设备调停和保留 `IP` 地址。 +但是,几乎所有的路由器都会有一个界面,允许你为特定设备调停和保留 IP 地址。 ![Router IP address settings][7] -路由器没有通用接口,因此请在你的路由器接口中搜索 `DHCP` 或静态 `IP` 地址选项。为你的服务器分配自己的预留 `IP` 地址,使其在网络中保持 `IP` 不变。 +路由器没有统一的界面,因此请在你的路由器接口中搜索 “DHCP” 或 “Static IP address” 选项。为你的服务器分配自己的预留 IP 地址,使其在网络中保持 IP 不变。 ### 连接到服务器 -默认情况下,你的路由器可能内置了防火墙。这通常很好,因为你不希望网络之外的人能够强行进入你的任何计算机。但是,你必须允许发往 `VPN` 服务器的流量通过防火墙,否则你的 `VPN` 将无法访问,这种情况下你的 `VPN` 服务器将形同虚设。 -你至少需要一个来自互联网服务提供商的公共静态 `IP` 地址。使用其静态 `IP` 地址设置路由器的公共端,然后将你的 `OpenVPN` 服务器放在私有端,在你的网络中使用私有静态 `IP` 地址。 `OpenVPN` 默认使用 `UDP` 1194 端口。配置你的路由器,将你的公网 `VPN` `IP` 地址的 `UDP` 1194 端口转发到 `OpenVPN` 服务器上的 `UDP` 1194 端口。如果你决定使用不同的 UDP 端口,请相应地调整端口号。 +默认情况下,你的路由器可能内置了防火墙。这通常很好,因为你不希望网络之外的人能够强行进入你的任何计算机。但是,你必须允许发往 “虚拟专用网络” 服务器的流量通过防火墙,否则你的 “虚拟专用网络” 将无法访问,这种情况下你的 “虚拟专用网络” 服务器将形同虚设。 + +你至少需要一个来自互联网服务提供商的公共静态 IP 地址。使用其静态 IP 地址设置路由器的公共端,然后将你的 0penVPN 服务器放在专用端,在你的网络中使用专用静态 IP 地址。 0penVPN 默认使用 UDP 1194 端口。配置你的路由器,将你的公网 “虚拟专用网络” IP 地址的 UDP 1194 端口转发到 0penVPN 服务器上的 UDP 1194 端口。如果你决定使用不同的 UDP 端口,请相应地调整端口号。 ### 准备好,我们开始下一步 -在本文中,你在服务器上安装并配置了一个操作系统,这已经成功了一半。在下一篇文章中,你将解决安装和配置 `OpenVPN` 本身的问题。同时,熟悉你的路由器并确保你可以从外部访问你的服务器。但是请务必在测试后关闭端口转发,直到你的 `VPN` 服务启动并运行。 +在本文中,你在服务器上安装并配置了一个操作系统,这已经成功了一半。在下一篇文章中,你将解决安装和配置 0penVPN 本身的问题。同时,请熟悉你的路由器并确保你可以从外部访问你的服务器。但是请务必在测试后关闭端口转发,直到你的 “虚拟专用网络” 服务启动并运行。 -* * * -本文的部分内容改编自 `D. Greg Scott` 的博客,并经许可重新发布。 +本文的部分内容改编自 D. Greg Scott 的博客,并经许可重新发布。 -------------------------------------------------------------------------------- @@ -113,7 +112,7 @@ via: https://opensource.com/article/21/8/openvpn-server-linux 作者:[D. Greg Scott][a] 选题:[lujun9972][b] 译者:[perfiffer](https://github.com/perfiffer) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3caeca13d3e0bc3dbeaf027ef06bcde2edb2563b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 21:34:39 +0800 Subject: [PATCH 031/290] PUB @perfiffer https://linux.cn/article-13680-1.html --- .../20210803 Set up a VPN server on your Linux PC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210803 Set up a VPN server on your Linux PC.md (99%) diff --git a/translated/tech/20210803 Set up a VPN server on your Linux PC.md b/published/20210803 Set up a VPN server on your Linux PC.md similarity index 99% rename from translated/tech/20210803 Set up a VPN server on your Linux PC.md rename to published/20210803 Set up a VPN server on your Linux PC.md index b9881206c6..d310844edb 100644 --- a/translated/tech/20210803 Set up a VPN server on your Linux PC.md +++ b/published/20210803 Set up a VPN server on your Linux PC.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (perfiffer) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13680-1.html) 如何在免费 WiFi 中保护隐私(一) ====== From a63d981c3a75447f46114982148f64fbba0bf1be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 22:07:24 +0800 Subject: [PATCH 032/290] PRF&PUB @geekpi https://linux.cn/article-13681-1.html --- ...eDrive in Linux With OneDriver GUI Tool.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/tech => published}/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md (78%) diff --git a/translated/tech/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md b/published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md similarity index 78% rename from translated/tech/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md rename to published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md index 5c551d6ac8..5681f160c3 100644 --- a/translated/tech/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md +++ b/published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md @@ -3,14 +3,14 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13681-1.html) 用 OneDriver GUI 工具在 Linux 中安装微软 OneDrive ====== -在 Windows 上,微软提供了一个[免费云存储服务][1] OneDrive。它与 Windows 集成,你可以通过你的微软账户获得 5GB 的免费存储空间。 +在 Windows 上,微软提供了一个 [免费云存储服务][1] OneDrive。它与 Windows 集成,你可以通过你的微软账户获得 5GB 的免费存储空间。 这在 Windows 上很好用,但和谷歌一样,微软也没有在 Linux 桌面上提供 OneDrive 的本地客户端。 @@ -24,17 +24,17 @@ ![OneDrive Linux illustration][4] -[OneDriver][5] 是一个免费的开源工具,允许你在 Linux 系统上挂载 OneDrive 文件。 +[OneDriver][5] 是一个自由而开源的工具,允许你在 Linux 系统上挂载 OneDrive 文件。 请记住,它不会像 OneDrive 在 Windows 系统上那样同步文件。它将 OneDrive 文件挂载在本地的挂载点上。你通过网络访问这些文件。 然而,它确实提供了一种混合方法。你在挂载的 OneDrive 中打开的文件也被下载到系统中。这意味着,你也可以离线访问打开的文件。如果你没有连接到互联网,这些文件将成为只读。 -如果你在本地对文件做任何修改,如果你连接到互联网,它就会反映到 OneDrive 上。 +如果你在本地对文件做任何修改,并且连接到互联网,它就会反映到 OneDrive 上。 我注意到,在 GNOME 上的 Nautilus 文件管理器中,它会自动下载当前文件夹中的图像。在我的印象中,它们只有在我打开它们时才会被下载。 -另一件事是,Nautilus 最初建立了缩略图缓存。OneDriver 在开始的时候可能会觉得有点慢,有点耗费资源,但最终会好起来。 +另一件事是,Nautilus 一开始会建立缩略图缓存。OneDriver 在开始的时候可能会觉得有点慢,有点耗费资源,但最终会好起来。 哦!你也可以挂载多个 OneDrive 账户。 @@ -48,7 +48,7 @@ sudo apt update sudo apt install onedriver ``` -对于 Ubuntu 21.04,你可以下载[其 PPA 中的 DEB 文件][6]来使用它。 +对于 Ubuntu 21.04,你可以下载 [其 PPA 中的 DEB 文件][6] 来使用它。 在 Fedora 上,你可以添加这个 COPR: @@ -63,7 +63,7 @@ Arch 用户可以在 AUR 中找到它。 ![Search for OneDriver][7] -首次运行时,它会给出一个奇怪的空界面。点击 “+” 号,选择一个文件夹或创建一个新的文件夹,在那里你将挂载 OneDrive。在我的例子中,我在我的家目录下创建了一个名为 One_drive 的新文件夹。 +首次运行时,它会给出一个奇怪的空界面。点击 “+” 号,选择一个文件夹或创建一个新的文件夹,OneDrive 会挂载在那里。在我的例子中,我在我的家目录下创建了一个名为 `One_drive` 的新文件夹。 ![Click on + sign to add a mount point for OneDrive][8] @@ -73,7 +73,7 @@ Arch 用户可以在 AUR 中找到它。 ![one drive permission][10] -登陆后,你可以在挂载的目录中看到 OneDrive 的文件。 +登录后,你可以在挂载的目录中看到 OneDrive 的文件。 ![OneDrive mounted in Linux][11] @@ -81,9 +81,9 @@ Arch 用户可以在 AUR 中找到它。 ![Autostart OneDriver mounting][12] -总的来说,OneDriver 是一个可以在 Linux 上访问 OneDrive 的不错的免费工具。它可能无法像[高级 Insync 服务][13]那样提供完整的同步设施,但对于有限的需求来说,它做得不错。 +总的来说,OneDriver 是一个可以在 Linux 上访问 OneDrive 的不错的免费工具。它可能无法像 [高级 Insync 服务][13] 那样提供完整的同步设施,但对于有限的需求来说,它做得不错。 -如果你使用这个漂亮的工具,请分享你的使用经验。如果你喜欢这个项目,也许可以给它一个 [GitHub 上的关注][5]。 +如果你使用这个漂亮的工具,请分享你的使用经验。如果你喜欢这个项目,也许可以给它一个 [GitHub 上的星标][5]。 -------------------------------------------------------------------------------- @@ -92,7 +92,7 @@ via: https://itsfoss.com/onedriver/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1d6ec206b2180e94aeed4221c989d800d851323b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 13 Aug 2021 22:09:58 +0800 Subject: [PATCH 033/290] PRF --- ...Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md b/published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md index 5681f160c3..cae17b0138 100644 --- a/published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md +++ b/published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md @@ -7,7 +7,7 @@ [#]: publisher: (wxy) [#]: url: (https://linux.cn/article-13681-1.html) -用 OneDriver GUI 工具在 Linux 中安装微软 OneDrive +用 OneDriver GUI 工具在 Linux 中挂载微软 OneDrive ====== 在 Windows 上,微软提供了一个 [免费云存储服务][1] OneDrive。它与 Windows 集成,你可以通过你的微软账户获得 5GB 的免费存储空间。 From 214dfa616dfffdbeca4baa4b60268c62ad9dd019 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 14 Aug 2021 05:02:27 +0800 Subject: [PATCH 034/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210813=20?= =?UTF-8?q?Use=20dnf=20updateinfo=20to=20read=20update=20changelogs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210813 Use dnf updateinfo to read update changelogs.md --- ...nf updateinfo to read update changelogs.md | 304 ++++++++++++++++++ 1 file changed, 304 insertions(+) create mode 100644 sources/tech/20210813 Use dnf updateinfo to read update changelogs.md diff --git a/sources/tech/20210813 Use dnf updateinfo to read update changelogs.md b/sources/tech/20210813 Use dnf updateinfo to read update changelogs.md new file mode 100644 index 0000000000..02baa78e22 --- /dev/null +++ b/sources/tech/20210813 Use dnf updateinfo to read update changelogs.md @@ -0,0 +1,304 @@ +[#]: subject: "Use dnf updateinfo to read update changelogs" +[#]: via: "https://fedoramagazine.org/use-dnf-updateinfo-to-read-update-changelogs/" +[#]: author: "Mateus Rodrigues Costa https://fedoramagazine.org/author/mateusrodcosta/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use dnf updateinfo to read update changelogs +====== + +![][1] + +Cover image background excerpted from photo by [Fotis Fotopoulos][2] on [Unsplash][3] + +This article will explore how to check the changelogs for the Fedora Linux operating system using the command line and _dnf updateinfo_. Instead of showing the commands running on a real Fedora Linux install, this article will demo running the dnf commands in [toolbox][4]. + +### Introduction + +If you have used any type of computer recently (be it a desktop, laptop or even a smartphone), you most likely have had to deal with software updates. You might have an opinion about them. They might be a “necessary evil”, something that always breaks your setup and makes you waste hours fixing the new problems that appeared, or you might even like them. + +No matter your opinion, there are reasons to update your software: mainly bug fixes, especially security-related bug fixes. After all, you most likely don’t want someone getting your private data by exploiting a bug that happens because of a interaction between the code of your web browser and the code that renders text on your screen. + +If you manage your software updates in a manual or semi-manual fashion (in comparison to letting the operating system auto-update your software), one feature you should be aware of is “changelogs”. + +A changelog is, as the name hints, a big list of changes between two releases of the same software. The changelog content can vary a lot. It may depend on the team, the type of software, its importance, and the number of changes. It can range from a very simple “several small bugs were fixed in this release”-type message, to a list of links to the bugs fixed on a issue tracker with a small description, to a big and detailed list of changes or elaborate blog posts. + +Now, how do you check the changelogs for the updates? + +If you use Fedora Workstation the easy way to see the changelog with a GUI is with Gnome Software. Select the name of the package or name of the software on the updates page and the changelog is displayed. You could also try your favorite GUI package manager, which will most likely show it to you as well. But how does one do the same thing via CLI? + +### How to use dnf updateinfo + +Start by creating a Fedora 34 toolbox called _updateinfo-demo_: + +``` +toolbox create --distro fedora --release f34 updateinfo-demo +``` + +Now, enter the toolbox: + +``` +toolbox enter updateinfo-demo +``` + +The commands from here on can also be used on a normal Fedora install. + +First, check the updates available: + +``` +$ dnf check-update +audit-libs.x86_64 3.0.3-1.fc34 updates +ca-certificates.noarch 2021.2.50-1.0.fc34 updates +coreutils.x86_64 8.32-30.fc34 updates +coreutils-common.x86_64 8.32-30.fc34 updates +curl.x86_64 7.76.1-7.fc34 updates +dnf.noarch 4.8.0-1.fc34 updates +dnf-data.noarch 4.8.0-1.fc34 updates +expat.x86_64 2.4.1-1.fc34 updates +file-libs.x86_64 5.39-6.fc34 updates +glibc.x86_64 2.33-20.fc34 updates +glibc-common.x86_64 2.33-20.fc34 updates +glibc-minimal-langpack.x86_64 2.33-20.fc34 updates +krb5-libs.x86_64 1.19.1-14.fc34 updates +libcomps.x86_64 0.1.17-1.fc34 updates +libcurl.x86_64 7.76.1-7.fc34 updates +libdnf.x86_64 0.63.1-1.fc34 updates +libeconf.x86_64 0.4.0-1.fc34 updates +libedit.x86_64 3.1-38.20210714cvs.fc34 updates +libgcrypt.x86_64 1.9.3-3.fc34 updates +libidn2.x86_64 2.3.2-1.fc34 updates +libmodulemd.x86_64 2.13.0-1.fc34 updates +librepo.x86_64 1.14.1-1.fc34 updates +libsss_idmap.x86_64 2.5.2-1.fc34 updates +libsss_nss_idmap.x86_64 2.5.2-1.fc34 updates +libuser.x86_64 0.63-4.fc34 updates +libxcrypt.x86_64 4.4.23-1.fc34 updates +nano.x86_64 5.8-3.fc34 updates +nano-default-editor.noarch 5.8-3.fc34 updates +nettle.x86_64 3.7.3-1.fc34 updates +openldap.x86_64 2.4.57-5.fc34 updates +pam.x86_64 1.5.1-6.fc34 updates +python-setuptools-wheel.noarch 53.0.0-2.fc34 updates +python-unversioned-command.noarch 3.9.6-2.fc34 updates +python3.x86_64 3.9.6-2.fc34 updates +python3-dnf.noarch 4.8.0-1.fc34 updates +python3-hawkey.x86_64 0.63.1-1.fc34 updates +python3-libcomps.x86_64 0.1.17-1.fc34 updates +python3-libdnf.x86_64 0.63.1-1.fc34 updates +python3-libs.x86_64 3.9.6-2.fc34 updates +python3-setuptools.noarch 53.0.0-2.fc34 updates +sssd-client.x86_64 2.5.2-1.fc34 updates +systemd.x86_64 248.6-1.fc34 updates +systemd-libs.x86_64 248.6-1.fc34 updates +systemd-networkd.x86_64 248.6-1.fc34 updates +systemd-pam.x86_64 248.6-1.fc34 updates +systemd-rpm-macros.noarch 248.6-1.fc34 updates +vim-minimal.x86_64 2:8.2.3182-1.fc34 updates +xkeyboard-config.noarch 2.33-1.fc34 updates +yum.noarch 4.8.0-1.fc34 updates +``` + +OK, so run your first _dnf updateinfo_ command: + +``` +$ dnf updateinfo +Updates Information Summary: available + 5 Security notice(s) + 4 Moderate Security notice(s) + 1 Low Security notice(s) + 11 Bugfix notice(s) + 8 Enhancement notice(s) + 3 other notice(s) +``` + +This is the summary of updates. As you can see there are security updates, bugfix updates, enhancement updates and some which are not specified. + +Look at the list of updates and which types they belong to: + +``` +$ dnf updateinfo list +FEDORA-2021-e4866762d8 enhancement audit-libs-3.0.3-1.fc34.x86_64 +FEDORA-2021-1f32e18471 bugfix ca-certificates-2021.2.50-1.0.fc34.noarch +FEDORA-2021-b09e010a46 bugfix coreutils-8.32-30.fc34.x86_64 +FEDORA-2021-b09e010a46 bugfix coreutils-common-8.32-30.fc34.x86_64 +FEDORA-2021-83fdddca0f Moderate/Sec. curl-7.76.1-7.fc34.x86_64 +FEDORA-2021-3b74285c43 bugfix dnf-4.8.0-1.fc34.noarch +FEDORA-2021-3b74285c43 bugfix dnf-data-4.8.0-1.fc34.noarch +FEDORA-2021-523ee0a81e enhancement expat-2.4.1-1.fc34.x86_64 +FEDORA-2021-07625b9c81 unknown file-libs-5.39-6.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-2.33-20.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-common-2.33-20.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-minimal-langpack-2.33-20.fc34.x86_64 +FEDORA-2021-8b25e4642f Low/Sec. krb5-libs-1.19.1-14.fc34.x86_64 +FEDORA-2021-3b74285c43 bugfix libcomps-0.1.17-1.fc34.x86_64 +FEDORA-2021-83fdddca0f Moderate/Sec. libcurl-7.76.1-7.fc34.x86_64 +FEDORA-2021-3b74285c43 bugfix libdnf-0.63.1-1.fc34.x86_64 +FEDORA-2021-ca22b882a5 enhancement libeconf-0.4.0-1.fc34.x86_64 +FEDORA-2021-f9c139edd8 bugfix libedit-3.1-38.20210714cvs.fc34.x86_64 +FEDORA-2021-31fdc84207 Moderate/Sec. libgcrypt-1.9.3-3.fc34.x86_64 +FEDORA-2021-bc56cf7c1f enhancement libidn2-2.3.2-1.fc34.x86_64 +FEDORA-2021-da2ec14d7f bugfix libmodulemd-2.13.0-1.fc34.x86_64 +FEDORA-2021-3b74285c43 bugfix librepo-1.14.1-1.fc34.x86_64 +FEDORA-2021-1db6330a22 unknown libsss_idmap-2.5.2-1.fc34.x86_64 +FEDORA-2021-1db6330a22 unknown libsss_nss_idmap-2.5.2-1.fc34.x86_64 +FEDORA-2021-8226c82fe9 bugfix libuser-0.63-4.fc34.x86_64 +FEDORA-2021-e6916d6758 bugfix libxcrypt-4.4.22-2.fc34.x86_64 +FEDORA-2021-fed4036fd9 bugfix libxcrypt-4.4.23-1.fc34.x86_64 +FEDORA-2021-3122d2b8d2 unknown nano-5.8-3.fc34.x86_64 +FEDORA-2021-3122d2b8d2 unknown nano-default-editor-5.8-3.fc34.noarch +FEDORA-2021-d1fc0b9d32 Moderate/Sec. nettle-3.7.3-1.fc34.x86_64 +FEDORA-2021-97949d7a4e bugfix openldap-2.4.57-5.fc34.x86_64 +FEDORA-2021-e6916d6758 bugfix pam-1.5.1-6.fc34.x86_64 +FEDORA-2021-07931f7f08 bugfix python-setuptools-wheel-53.0.0-2.fc34.noarch +FEDORA-2021-2056ce89d9 enhancement python-unversioned-command-3.9.6-1.fc34.noarch +FEDORA-2021-d613e00b72 enhancement python-unversioned-command-3.9.6-2.fc34.noarch +FEDORA-2021-2056ce89d9 enhancement python3-3.9.6-1.fc34.x86_64 +FEDORA-2021-d613e00b72 enhancement python3-3.9.6-2.fc34.x86_64 +FEDORA-2021-3b74285c43 bugfix python3-dnf-4.8.0-1.fc34.noarch +FEDORA-2021-3b74285c43 bugfix python3-hawkey-0.63.1-1.fc34.x86_64 +FEDORA-2021-3b74285c43 bugfix python3-libcomps-0.1.17-1.fc34.x86_64 +FEDORA-2021-3b74285c43 bugfix python3-libdnf-0.63.1-1.fc34.x86_64 +FEDORA-2021-2056ce89d9 enhancement python3-libs-3.9.6-1.fc34.x86_64 +FEDORA-2021-d613e00b72 enhancement python3-libs-3.9.6-2.fc34.x86_64 +FEDORA-2021-07931f7f08 bugfix python3-setuptools-53.0.0-2.fc34.noarch +FEDORA-2021-1db6330a22 unknown sssd-client-2.5.2-1.fc34.x86_64 +FEDORA-2021-3141f0eff1 bugfix systemd-248.6-1.fc34.x86_64 +FEDORA-2021-3141f0eff1 bugfix systemd-libs-248.6-1.fc34.x86_64 +FEDORA-2021-3141f0eff1 bugfix systemd-networkd-248.6-1.fc34.x86_64 +FEDORA-2021-3141f0eff1 bugfix systemd-pam-248.6-1.fc34.x86_64 +FEDORA-2021-3141f0eff1 bugfix systemd-rpm-macros-248.6-1.fc34.noarch +FEDORA-2021-b8b1f6e54f enhancement vim-minimal-2:8.2.3182-1.fc34.x86_64 +FEDORA-2021-67645ae09f enhancement xkeyboard-config-2.33-1.fc34.noarch +FEDORA-2021-3b74285c43 bugfix yum-4.8.0-1.fc34.noarch +``` + +The output is in three columns. These show the ID for an update, the type of the update, and the package to which it refers. + +If you want to see the Bodhi page for a specific update, just add the id to the end of this URL: +. + +For example, for _systemd-248.6-1.fc34.x86_64_ or for _coreutils-8.32-30.fc34.x86_64_. + +The next command will list the actual changelog. + +``` +dnf updateinfo info +``` + +The output from this command is quite long. So only a few interesting excerpts are provided below. + +Start with a small one: + +``` +=============================================================================== + ca-certificates-2021.2.50-1.0.fc34 +=============================================================================== + Update ID: FEDORA-2021-1f32e18471 + Type: bugfix + Updated: 2021-06-18 22:08:02 +Description: Update the ca-certificates list to the lastest upstream list. + Severity: Low +``` + +Notice how this info has the update ID, type, updated time, description and severity. Very simple and easy to understand. + +Now look at the _systemd_ update which, in addition to the previous items, has some bugs associated with it in Red Hat Bugzilla, a more elaborate description, and a different severity. + +``` +=============================================================================== + systemd-248.6-1.fc34 +=============================================================================== + Update ID: FEDORA-2021-3141f0eff1 + Type: bugfix + Updated: 2021-07-24 22:00:30 + Bugs: 1963428 - if keyfile >= 1024*4096-1 service "systemd-cryptsetup@" can't start + : 1965815 - 50-udev-default.rules references group "sgx" which does not exist + : 1975564 - systemd-cryptenroll SIGABRT when adding recovery key - buffer overflow + : 1984651 - systemd[1]: Assertion 'a <= b' failed at src/libsystemd/sd-event/sd-event.c:2903, function sleep_between(). Aborting. +Description: - Create 'sgx' group (and also use soft-static uids for input and render, see https://pagure.io/setup/c/df3194a7295c2ca3cfa923981b046f4bd2754825 and https://pagure.io/packaging-committee/issue/1078 (#1965815) + : - Various bugfixes (#1963428, #1975564) + : - Fix for a regression introduced in the previous release with sd-event abort (#1984651) + : + : No need to log out or reboot. + Severity: Moderate +``` + +Next look at a _curl_ update. This has a security update with several [CVE][5]s associated with it. Each CVE has its respective Red Hat Bugzilla bug. + +``` +=============================================================================== + curl-7.76.1-7.fc34 +=============================================================================== + Update ID: FEDORA-2021-83fdddca0f + Type: security + Updated: 2021-07-22 22:03:07 + Bugs: 1984325 - CVE-2021-22922 curl: wrong content via metalink is not being discarded [fedora-all] + : 1984326 - CVE-2021-22923 curl: Metalink download sends credentials [fedora-all] + : 1984327 - CVE-2021-22924 curl: bad connection reuse due to flawed path name checks [fedora-all] + : 1984328 - CVE-2021-22925 curl: Incorrect fix for CVE-2021-22898 TELNET stack contents disclosure [fedora-all] +Description: - fix TELNET stack contents disclosure again (CVE-2021-22925) + : - fix bad connection reuse due to flawed path name checks (CVE-2021-22924) + : - disable metalink support to fix the following vulnerabilities + : CVE-2021-22923 - metalink download sends credentials + : CVE-2021-22922 - wrong content via metalink not discarded + Severity: Moderate +``` + +This item shows a simple enhancement update. + +``` +=============================================================================== + python3-docs-3.9.6-1.fc34 python3.9-3.9.6-1.fc34 +=============================================================================== + Update ID: FEDORA-2021-2056ce89d9 + Type: enhancement + Updated: 2021-07-08 22:00:53 +Description: Update of Python 3.9 and python3-docs to latest release 3.9.6 + Severity: None +``` + +Finally an “unknown” type update. + +``` +=============================================================================== + file-5.39-6.fc34 +=============================================================================== + Update ID: FEDORA-2021-07625b9c81 + Type: unknown + Updated: 2021-06-11 22:16:57 + Bugs: 1963895 - Wrong detection of python bytecode mimetypes +Description: do not classify python bytecode files as text (#1963895) + Severity: None +``` + +### Conclusion + +So, in what situation does dnf updateinfo become handy? + +Well, you could use it if you prefer managing updates fully via the CLI, or if you are unable to successfully use the GUI tools at a specific moment. + +In which case is checking the changelog useful? + +Say you manage the updates yourself, sometimes you might not consider it ideal to stop what you are doing to update your system. Instead of simply installing the updates, you check the changelogs. This allows you to figure out whether you should prioritize your updates (maybe there’s a important security fix?) or whether to postpone a bit longer (no important fix, “I will do it later when I’m not doing anything important”). + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-dnf-updateinfo-to-read-update-changelogs/ + +作者:[Mateus Rodrigues Costa][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mateusrodcosta/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/dnf-updateinfo-816x345.jpg +[2]: https://unsplash.com/@ffstop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/a-quick-introduction-to-toolbox-on-fedora/ +[5]: https://en.wikipedia.org/wiki/Common_Vulnerabilities_and_Exposures From 7556a990a3cc9354d3a882b51b7dc5085eb24860 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 14 Aug 2021 05:02:48 +0800 Subject: [PATCH 035/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210814=20?= =?UTF-8?q?What=20is=20SteamOS=3F=20Everything=20Important=20You=20Need=20?= =?UTF-8?q?to=20Know=20About=20This=20=E2=80=9CGaming=20Distribution?= =?UTF-8?q?=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md --- ...to Know About This -Gaming Distribution.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md diff --git a/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md b/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md new file mode 100644 index 0000000000..7e223b6a0c --- /dev/null +++ b/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md @@ -0,0 +1,138 @@ +[#]: subject: "What is SteamOS? Everything Important You Need to Know About This “Gaming Distribution”" +[#]: via: "https://itsfoss.com/steamos/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is SteamOS? Everything Important You Need to Know About This “Gaming Distribution” +====== + +SteamOS is a Linux-based operating system that aims to provide a seamless gaming experience from Steam’s own game store. + +While it has been in existence for about a decade now, there are a few things that you should know about it. + +In this article, we try to address most of the common questions regarding SteamOS. + +### What is SteamOS? + +SteamOS is a Linux distribution from the game distribution platform Steam. It is not a generic desktop operating system like Debian, Linux Mint or Ubuntu though you could use the desktop features. By default, SteamOS gives you a console like interface because SteamOS is intended to be the operating system on Steam devices like Steam Machine (discontinued) and Steam Deck. + +![SteamOS interface][1] + +While you can install the Steam game client on any Linux distribution and other platforms, SteamOS was developed to provide a console-like experience to play games from the Steam store. + +### Which Linux distribution SteamOS is based on? + +SteamOS is a Linux-based operating system originally based on Debian 8. With Valve’s new [Steam Deck][2] handheld gaming device, SteamOS’s latest version (SteamOS 3.0) uses Arch Linux as its base because of its rolling-release update schedule. + +The developers believe that Arch Linux as a base for SteamOS is useful to push quick updates and optimize SteamOS for Steam Deck. + +![][3] + +### System requirements for SteamOS + +Ideally, any machine with the following minimum requirements should work: + + * Intel or AMD 64-bit capable processor + * 4GB or more memory + * 250GB or larger disk + * NVIDIA, Intel, or AMD graphics card + * USB port or DVD drive for installation + + + +### Will SteamOS Work on your PC? + +SteamOS (version 2.0) comes with drivers and chipsets that support a specific set of hardware. + +It should theoretically work on every PC, but there’s no official support for the latest and greatest hardware. + +### Is SteamOS just another Linux distribution? + +SteamOS is technically one of the [gaming Linux distributions][4] available. But, unlike some others, it is not meant for a full-fledged desktop experience. While you have the ability to install Linux applications, it supports a limited number of packages. + +In short, it is not suitable to replace a desktop Linux OS. + +### Is Steam OS Actively Maintained? + +**Yes** and **No.** + +SteamOS is based on Debian 8 for a long time now with no updates whatsoever. + +So, if you are looking to install it on your personal machine, the version available to the public (SteamOS 2.0) is not actively maintained. + +However, Valve is actively working on SteamOS 3.0 for its Steam Deck hardware. Hence, there is a possibility that you should find it available soon enough for your desktop. + +### Should You Prefer SteamOS for PC Gaming? + +**No.** SteamOS is not a proper replacement for Windows or other Linux distributions. + +While it was primarily tailored to play games, there are many caveats to know before you proceed. + +### Do all games work on SteamOS? + +**No.** SteamOS relies on the Proton compatibility layer to make most of the Windows-exclusive games work. + +Of course, [Gaming on Linux][5] has been made possible with the same underlying tech, but at the time of writing this, you cannot make all the games available in Steam work with it. + +Even though many games should work on it, that does not guarantee that all games you have in your library will work as expected. + +If you are looking to play supported games and Linux-only games, you can consider trying it. + +### Is SteamOS open source? + +**Yes** (SteamOS 2.0). + +The operating system is open-source, and you can find the source code in its [official repo][6]. + +But, the Steam client that you will be using on it is proprietary. + +It is worth noting that SteamOS 3.0 is still a work in progress. So, you cannot find the source code or any progress of it available to the public. + +### Is SteamOS free to use? + +You won’t find the new SteamOS version available to the public yet, but it is essentially free to use. The older version based on Debian is available to download from the [official site][7]. + +### Can I find a gaming system with SteamOS built in? + +![Steam Machine console has been doscontinued][8] + +SteamOS was originally created to be the operating system on Steam’s very own PlayStation/Xbox styled console called Steam Machine. Released around 2015, Steam Machine did not see much success and was eventually discontinued. + +Now the only device to feature SteamOS is the much-anticipated Steam Deck. + +If SteamOS is available to download for other hardware, you may see commercial choices to have SteamOS pre-installed with a gaming machine. + +But, for now, you should not believe any claims by unknown manufacturers to offer SteamOS out of the box. + +### Will Next-gen SteamOS Make Linux a Viable Choice for Gaming? + +Absolutely. Yes. + +Linux may not be the recommended choice for gamers out there. You can explore if [we recommend Linux for gaming][9]. Still, if SteamOS evolves to support every game for its Steam Deck hardware, desktop Linux users can finally experience all unsupported Steam games. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/steamos/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/steamos.jpg?resize=800%2C450&ssl=1 +[2]: https://www.steamdeck.com/en/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/steam-deck.jpg?resize=800%2C479&ssl=1 +[4]: https://itsfoss.com/linux-gaming-distributions/ +[5]: https://itsfoss.com/linux-gaming-guide/ +[6]: https://repo.steampowered.com/steamos/ +[7]: https://store.steampowered.com/steamos/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/valves-steam-machine.jpg?resize=800%2C441&ssl=1 +[9]: https://news.itsfoss.com/linux-for-gaming-opinion/ From 853a9eccad86bff8b0864f983f3ca84c7c2781e0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 14 Aug 2021 05:03:42 +0800 Subject: [PATCH 036/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210813=20?= =?UTF-8?q?Install=20Linux=20with=20LVM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210813 Install Linux with LVM.md --- .../tech/20210813 Install Linux with LVM.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20210813 Install Linux with LVM.md diff --git a/sources/tech/20210813 Install Linux with LVM.md b/sources/tech/20210813 Install Linux with LVM.md new file mode 100644 index 0000000000..169d5bb1fe --- /dev/null +++ b/sources/tech/20210813 Install Linux with LVM.md @@ -0,0 +1,126 @@ +[#]: subject: "Install Linux with LVM" +[#]: via: "https://opensource.com/article/21/8/install-linux-mint-lvm" +[#]: author: "Kenneth Aaron https://opensource.com/users/flyingrhino" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install Linux with LVM +====== +A tutorial on getting Linux Mint 20.2 working with logical volume +manager (LVM). +![Linux keys on the keyboard for a desktop computer][1] + +A couple of weeks ago, the good folks at [Linux Mint][2] released version 20.2 of their open source operating system. The installer built into the live ISO is excellent and only requires a few clicks to install the OS. You even have a built-in partitioner if you want to customize your partitions. + +The installer is mainly focused on a simple install—define your partitions and install into them. For those wanting a more flexible setup—[logical volume manager][3] (LVM) is the way to go—you benefit from setting up volume groups and define your logical volumes within them. + +LVM is a hard drive management system that allows you to create storage space across multiple physical drives. In other words, you could "tether" a few small drives together so your OS treats them as if they were one drive. Beyond that, it has the advantages of live resizing, file system snapshots, and much more. This article isn't a tutorial on LVM (the web is full of [good information on that already][4].) Instead, I aim to keep this page on topic and focus solely on getting Linux Mint 20.2 working with LVM. + +As a desktop OS, the installer is kept simple, and installing LM 20.2 on LVM is slightly more involved but not too complicated. If you select LVM in the installer, you get a setup that's been defined by the Linux Mint devs, and you have no control over the individual volumes at the time of install. + +However, there's a solution—right there in the live ISO—and that solution only requires a few commands in the terminal to set up the LVM, after which you resume the regular installer to complete the job. + +I'm using Linux Mint 20.2 with the [XFCE desktop][5] for my install, but the procedure is similar for the other LM desktops. + +### Partitioning the drive + +In the Linux Mint live ISO, you have access to Linux command-line tools through the terminal and GUI tools. If you need to do any partition work, you can use the command-line `fdisk` or `parted` commands, or the GUI application `gparted`. I want to keep these instructions simple enough for anyone to follow, so I'll use GUI tools where possible and command-line tools where necessary. + +Start by creating a couple of partitions for the install. + +Using `gparted` (launched from the menu), complete the following: + +First, create a partition of 512 MB of type **FAT32** (this is used to ensure the system is bootable.) 512 MB is overkill for most, and you can get away with 256 MB or even less, but with today's big disks, allocating even 512 MB is not a significant concern. + +![Creating a boot partition][6] + +CC BY-SA Seth Kenlon + +Next, create a partition of the rest of the disk of type `lvm2 pv` (this is where your LVM will be.) + +![Partition layout][7] + +CC BY-SA Seth Kenlon + +Now open a terminal window, and escalate your privileges to root: + + +``` +$ sudo -s +# whoami +root +``` + +Next, you must locate the LVM member (the big partition) you created earlier. Use one of the following commands: `lsblk -f` or `pvs` or `pvscan`. + + +``` +# pvs +PV           VG  Fmt   [...] +/dev/sda2        lvm2  [...] +``` + +In my case, the partition is located at `/dev/sda2`, but you should replace this with whatever you get in your output. + +Now that you know what device designation your partition has, you can create an LVM volume group there: + + +``` +`# vgcreate vg /dev/sda2` +``` + +You can see the details of the volume group you created using `vgs `or `vgscan`. + +Create the logical volumes you want to use during install. I'm keeping it simple by creating one for the root partition (`/`) and one for `swap`, but you can create more as needed (for example, a separate partition for `/home`.) + + +``` +# lvcreate -L 80G -n root vg +# lvcreate -L 16G -n swap vg +``` + +The partition sizes in my examples are arbitrary and based on what I have available. Use partition sizes that make sense for your drive. + +You can view the logical volumes with `lvs` or `lvdisplay`. + +That's it for the terminal. + +### Installing Linux + +Now start the installer program from the desktop icon: + + * Once you get to the **Installation type**, select **Something else**. + * Edit the 512 Mb partition and change it to `EFI`. + * Edit the root LV and change it to `ext4` (or a file system of your choice). Select to mount it as root and select to format it. + * Edit the swap partition and set it as `swap`. + * Continue the install process normally—Linux Mint installer puts the files in the correct places and creates the mount points for you. + + + +That's it—enjoy the power of LVM in your Linux Mint install. + +If ever you need to resize partitions or do any advanced work on the system—you'll be thankful for choosing LVM. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/install-linux-mint-lvm + +作者:[Kenneth Aaron][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/flyingrhino +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://linuxmint.com/ +[3]: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) +[4]: https://opensource.com/business/16/9/linux-users-guide-lvm +[5]: https://opensource.com/article/19/12/xfce-linux-desktop +[6]: https://opensource.com/sites/default/files/boot-part.png (Creating a boot partition) +[7]: https://opensource.com/sites/default/files/part-layout.png (Partition layout) From 8acc159f45ba770c6cdd3150e5eeca7e7044246c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 14 Aug 2021 05:03:55 +0800 Subject: [PATCH 037/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210813=20?= =?UTF-8?q?Code=20memory=20safety=20and=20efficiency=20by=20example?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210813 Code memory safety and efficiency by example.md --- ...memory safety and efficiency by example.md | 708 ++++++++++++++++++ 1 file changed, 708 insertions(+) create mode 100644 sources/tech/20210813 Code memory safety and efficiency by example.md diff --git a/sources/tech/20210813 Code memory safety and efficiency by example.md b/sources/tech/20210813 Code memory safety and efficiency by example.md new file mode 100644 index 0000000000..3dc22c5a38 --- /dev/null +++ b/sources/tech/20210813 Code memory safety and efficiency by example.md @@ -0,0 +1,708 @@ +[#]: subject: "Code memory safety and efficiency by example" +[#]: via: "https://opensource.com/article/21/8/memory-programming-c" +[#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Code memory safety and efficiency by example +====== +Learn more about memory safety and efficiency +![Code going into a computer.][1] + +C is a high-level language with close-to-the-metal features that make it seem, at times, more like a portable assembly language than a sibling of Java or Python. Among these features is memory management, which covers an executing program's safe and efficient use of memory. This article goes into the details of memory safety and efficiency through code examples in C and a code segment from the assembly language that a modern C compiler generates. + +Although the code examples are in C, the guidelines for safe and efficient memory management are the same for C++. The two languages differ in various details (e.g., C++ has object-oriented features and generics that C lacks), but these languages share the very same challenges with respect to memory management. + +### Overview of memory for an executing program + +For an executing program (aka _process_), memory is partitioned into three areas: The **stack**, the **heap**, and the **static area**. Here's an overview of each, with full code examples to follow. + +As a backup for general-purpose CPU registers, the _stack_ provides scratchpad storage for the local variables within a code block, such as a function or a loop body. Arguments passed to a function count as local variables in this context. Consider a short example: + + +``` +void some_func(int a, int b) { +   int n; +   ... +} +``` + +Storage for the arguments passed in parameters **a** and **b** and the local variable **n** would come from the stack unless the compiler could find general-purpose registers instead. The compiler favors such registers for scratchpad because CPU access to these registers is fast (one clock tick). However, these registers are few (roughly sixteen) on the standard architectures for desktop, laptop, and handheld machines. + +At the implementation level, which only an assembly-language programmer would see, the stack is organized as a LIFO (Last In, First Out) list with **push** (insert) and **pop** (remove) operations. The **top** pointer can act as a base address for offsets; in this way, stack locations other than **top** become accessible. For example, the expression **top+16** points to a location sixteen bytes above the stack's **top**, and the expression **top-16** points to sixteen bytes below the **top**. Accordingly, stack locations that implement scratchpad storage are accessible through the **top** pointer. On a standard ARM or Intel architecture, the stack grows from high to low memory addresses; hence, to decrement **top** is to grow the stack for a process. + +To use the stack is to use memory effortlessly and efficiently. The compiler, rather than the programmer, writes the code that manages the stack by allocating and deallocating the required scratchpad storage; the programmer declares function arguments and local variables, leaving the implementation to the compiler. Moreover, the very same stack storage can be reused across consecutive function calls and code blocks such as loops. Well-designed modular code makes stack storage the first memory option for scratchpad, with an optimizing compiler using, whenever possible, general-purpose registers instead of the stack. + +The **heap** provides storage allocated explicitly through programmer code, although the syntax for heap allocation differs across languages. In C, a successful call to the library function **malloc** (or variants such as **calloc**) allocates a specified number of bytes. (In languages such as C++ and Java, the **new** operator serves the same purpose.) Programming languages differ dramatically on how heap-allocated storage is deallocated: + + * In languages such as Java, Go, Lisp, and Python, the programmer does not explicitly deallocate dynamically allocated heap storage. + + + +For example, this Java statement allocates heap storage for a string and stores the address of this heap storage in the variable **greeting**: + + +``` +`String greeting = new String("Hello, world!");` +``` + +Java has a garbage collector, a runtime utility that automatically deallocates heap storage that is no longer accessible to the process that allocated the storage. Java heap deallocation is thus automatic through a garbage collector. In the example above, the garbage collector would deallocate the heap storage for the string after the variable **greeting** went out of scope. + + * The Rust compiler writes the heap-deallocation code. This is Rust's pioneering effort to automate heap-deallocation without relying on a garbage collector, which entails runtime complexity and overhead. Hats off to the Rust effort! + * In C (and C++), heap deallocation is a programmer task. The programmer who allocates heap storage through a call to **malloc** is then responsible for deallocating this same storage with a matching call to the library function **free**. (In C++, the **new** operator allocates heap storage, whereas the **delete** and **delete[]** operators free such storage.) Here's a C example: + + + + +``` +char* greeting = malloc(14);       /* 14 heap bytes */ +strcpy(greeting, "Hello, world!"); /* copy greeting into bytes */ +puts(greeting);                    /* print greeting */ +free(greeting);                    /* free malloced bytes */ +``` + +C avoids the cost and complexity of a garbage collector, but only by burdening the programmer with the task of heap deallocation. + +The **static area** of memory provides storage for executable code such as C functions, string literals such as "Hello, world!", and global variables: + + +``` +int n;                       /* global variable */ +int main() {                 /* function */ +   char* msg = "No comment"; /* string literal */ +   ... +} +``` + +This area is static in that its size remains fixed from the start until the end of process execution. Because the static area amounts to a fixed-sized memory footprint for a process, the rule of thumb is to keep this area as small as possible by avoiding, for example, global arrays. + +Code examples in the following sections flesh out this overview. + +### Stack storage + +Imagine a program that has various tasks to perform consecutively, including processing numeric data downloaded every few minutes over a network and stored in a local file. The **stack** program below simplifies the processing (odd integer values are made even) to keep the focus on the benefits of stack storage. + + +``` +#include <stdio.h> +#include <stdlib.h> + +#define Infile   "incoming.dat" +#define Outfile  "outgoing.dat" +#define IntCount 128000  /* 128,000 */ + +void other_task1() { /*...*/ } +void other_task2() { /*...*/ } + +void process_data(const char* infile, +          const char* outfile, +          const unsigned n) { +  int nums[n]; +  FILE* input = [fopen][2](infile, "r"); +  if (NULL == infile) return; +  FILE* output = [fopen][2](outfile, "w"); +  if (NULL == output) { +    [fclose][3](input); +    return; +  } + +  [fread][4](nums, n, sizeof(int), input); /* read input data */ +  unsigned i; +  for (i = 0; i < n; i++) { +    if (1 == (nums[i] & 0x1))  /* odd parity? */ +      nums[i]--;               /* make even */ +  } +  [fclose][3](input);               /* close input file */ + +  [fwrite][5](nums, n, sizeof(int), output); +  [fclose][3](output); +} + +int main() { +  process_data(Infile, Outfile, IntCount); +   +  /** now perform other tasks **/ +  other_task1(); /* automatically released stack storage available */ +  other_task2(); /* ditto */ +   +  return 0; +} +``` + +The **main** function at the bottom first calls the **process_data** function, which creates a stack-based array of a size given by argument **n** (128,000 in the current example). Accordingly, the array holds 128,000 x **sizeof(int)** bytes, which comes to 512,000 bytes on standard devices because an **int** is four bytes on these devices. Data then are read into the array (using library function **fread**), processed in a loop, and saved to the local file **outgoing.dat** (using library function **fwrite**). + +When the **process_data** function returns to its caller **main**, the roughly 500MB of stack scratchpad for the **process_data** function become available for other functions in the **stack** program to use as scratchpad. In this example, **main** next calls the stub functions **other_task1** and **other_task2**. The three functions are called consecutively from **main**, which means that all three can use the same stack storage for scratchpad. Because the compiler rather than the programmer writes the stack-management code, this approach is both efficient and easy on the programmer. + +In C, any variable defined inside a block (e.g., a function's or a loop's body) has an **auto** storage class by default, which means that the variable is stack-based. The storage class **register** is now outdated because C compilers are aggressive, on their own, in trying to use CPU registers whenever possible. Only a variable defined inside a block may be **register**, which the compiler changes to **auto** if no CPU register is available.Stack-based programming may be the preferred way to go, but this style does have its challenges. The **badStack** program below illustrates. + + +``` +#include <stdio.h> + +const int* get_array(const unsigned n) { +  int arr[n]; /* stack-based array */ +  unsigned i; +  for (i = 0; i < n; i++) arr[i] = 1 + 1; + +  return arr;  /** ERROR **/ +} + +int main() { +  const unsigned n = 16; +  const int* ptr = get_array(n); +   +  unsigned i; +  for (i = 0; i < n; i++) [printf][6]("%i ", ptr[i]); +  [puts][7]("\n"); + +  return 0; +} +``` + +The flow of control in the **badStack** program is straightforward. Function **main** calls function **get_array** with an argument of 128, which the called function then uses to create a local array of this size. The **get_array** function initializes the array and returns to **main** the array's identifier **arr**, which is a pointer constant that holds the address of the array's first **int** element. + +The local array **arr** is accessible within the **get_array** function, of course, but this array cannot be legitimately accessed once **get_array** returns. Nonetheless, function **main** tries to print the stack-based array by using the stack address **arr**, which function **get_array** returns. Modern compilers warn about the mistake. For example, here's the warning from the GNU compiler: + + +``` +badStack.c: In function 'get_array': +badStack.c:9:10: warning: function returns address of local variable [-Wreturn-local-addr] +8 |   return arr;  /** ERROR **/ +``` + +The general rule is that stack-based storage should be accessed only within the code block that contains the local variables implemented with stack storage (in this case, the array pointer **arr** and the loop counter **i**). Accordingly, a function should never return a pointer to stack-based storage. + +### Heap storage + +Several code examples highlight the fine points of using heap storage in C. In the first example, heap storage is allocated, used, and then freed in line with best practice. The second example nests heap storage inside other heap storage, which complicates the deallocation operation. + + +``` +#include <stdio.h> +#include <stdlib.h> + +int* get_heap_array(unsigned n) { +  int* heap_nums = [malloc][8](sizeof(int) * n);  +   +  unsigned i; +  for (i = 0; i < n; i++) +    heap_nums[i] = i + 1;  /* initialize the array */ +   +  /* stack storage for variables heap_nums and i released +     automatically when get_num_array returns */ +  return heap_nums; /* return (copy of) the pointer */ +} + +int main() { +  unsigned n = 100, i; +  int* heap_nums = get_heap_array(n); /* save returned address */ +   +  if (NULL == heap_nums) /* malloc failed */ +    [fprintf][9](stderr, "%s\n", "malloc(...) failed..."); +  else { +    for (i = 0; i < n; i++) [printf][6]("%i\n", heap_nums[i]); +    [free][10](heap_nums); /* free the heap storage */ +  } +  return 0;  +} +``` + +The **heap** program above has two functions: **main** calls **get_heap_array** with an argument (currently 100) that specifies how many **int** elements the array should have. Because the heap allocation could fail, **main** checks whether **get_heap_array** has returned **NULL**, which signals failure. If the allocation succeeds, **main** prints the **int** values in the array—and immediately thereafter deallocates, with a call to library function **free**, the heap-allocated storage. This is best practice. + +The **get_heap_array** function opens with this statement, which merits a closer look: + + +``` +`int* heap_nums = malloc(sizeof(int) * n); /* heap allocation */` +``` + +The **malloc** library function and its variants deal with bytes; hence, the argument to **malloc** is the number of bytes required for **n** elements of type **int**. (The **sizeof(int)** is four bytes on a standard modern device.) The **malloc** function returns either the address of the first among the allocated bytes or, in case of failure, **NULL**. + +In a successful call to **malloc**, the returned address is 64-bits in size on a modern desktop machine. On handhelds and earlier desktop machines, the address might be 32-bits in size or, depending on age, even smaller. The elements in the heap-allocated array are of type **int**, a four-byte signed integer. The address of these heap-allocated **int**s is stored in the local variable **heap_nums**, which is stack-based. Here's a depiction: + + +``` +                 heap-based + stack-based        / +     \        +----+----+   +----+ + heap-nums--->|int1|int2|...|intN| +              +----+----+   +----+ +``` + +Once the **get_heap_array** function returns, stack storage for pointer variable **heap_nums** is reclaimed automatically—but the heap storage for the dynamic **int** array persists, which is why the **get_heap_array** function returns (a copy of) this address to **main**, which now is responsible, after printing the array's integers, for explicitly deallocating the heap storage with a call to the library function **free**: + + +``` +`free(heap_nums); /* free the heap storage */` +``` + +The **malloc** function does not initialize heap-allocated storage, which therefore contains random values. By contrast, the **calloc **variant initializes the allocated storage to zeros. Both functions return **NULL** to signal failure. + +In the **heap** example, **main** returns immediately after calling **free**, and the executing program terminates, which allows the system to reclaim any allocated heap storage. Nonetheless, the programmer should develop the habit of explicitly freeing heap storage as soon as it is no longer needed. + +### Nested heap allocation + +The next code example is trickier. C has various library functions that return a pointer to heap storage. Here's a familiar scenario: + +1\. The C program invokes a library function that returns a pointer to heap-based storage, typically an aggregate such as an array or a structure: + + +``` +`SomeStructure* ptr = lib_function(); /* returns pointer to heap storage */` +``` + +2\. The program then uses the allocated storage. + +3\. For cleanup, the issue is whether a simple call to **free** will clean up all of the heap-allocated storage that the library function allocates. For example, the **SomeStructure** instance may have fields that, in turn, point to heap-allocated storage. A particularly troublesome case would be a dynamically allocated array of structures, each of which has a field pointing to more dynamically allocated storage.The following code example illustrates the problem and focuses on designing a library that safely provides heap-allocated storage to clients. + + +``` +#include <stdio.h> +#include <stdlib.h> + +typedef struct { +  unsigned id; +  unsigned len; +  float*   heap_nums; +} HeapStruct; +unsigned structId = 1; + +HeapStruct* get_heap_struct(unsigned n) { +  /* Try to allocate a HeapStruct. */ +  HeapStruct* heap_struct = [malloc][8](sizeof(HeapStruct)); +  if (NULL == heap_struct) /* failure? */ +    return NULL;           /* if so, return NULL */ + +  /* Try to allocate floating-point aggregate within HeapStruct. */ +  heap_struct->heap_nums = [malloc][8](sizeof(float) * n); +  if (NULL == heap_struct->heap_nums) {  /* failure? */ +    [free][10](heap_struct);                   /* if so, first free the HeapStruct */ +    return NULL;                         /* then return NULL */ +  } + +  /* Success: set fields */ +  heap_struct->id = structId++; +  heap_struct->len = n; + +  return heap_struct; /* return pointer to allocated HeapStruct */ +} + +void free_all(HeapStruct* heap_struct) { +  if (NULL == heap_struct) /* NULL pointer? */ +    return;                /* if so, do nothing */ +   +  [free][10](heap_struct->heap_nums); /* first free encapsulated aggregate */ +  [free][10](heap_struct);            /* then free containing structure */   +} + +int main() { +  const unsigned n = 100; +  HeapStruct* hs = get_heap_struct(n); /* get structure with N floats */ + +  /* Do some (meaningless) work for demo. */ +  unsigned i; +  for (i = 0; i < n; i++) hs->heap_nums[i] = 3.14 + (float) i; +  for (i = 0; i < n; i += 10) [printf][6]("%12f\n", hs->heap_nums[i]); + +  free_all(hs); /* free dynamically allocated storage */ +   +  return 0; +} +``` + +The **nestedHeap** example above centers on a structure **HeapStruct** with a pointer field named **heap_nums**: + + +``` +typedef struct { +  unsigned id; +  unsigned len; +  float*   heap_nums; /** pointer **/ +} HeapStruct; +``` + +The function **get_heap_struct** tries to allocate heap storage for a **HeapStruct** instance, which entails allocating heap storage for a specified number of **float** variables to which the field **heap_nums** points. The result of a successful call to **get_heap_struct** can be depicted as follows, with **hs** as the pointer to the heap-allocated structure: + + +``` +hs-->HeapStruct instance +        id +        len +        heap_nums-->N contiguous float elements +``` + +In the **get_heap_struct** function, the first heap allocation is straightforward: + + +``` +HeapStruct* heap_struct = [malloc][8](sizeof(HeapStruct)); +if (NULL == heap_struct) /* failure? */ +  return NULL;           /* if so, return NULL */ +``` + +The **sizeof(HeapStruct)** includes the bytes (four on a 32-bit machine, eight on a 64-bit machine) for the **heap_nums** field, which is a pointer to the **float** elements in a dynamically allocated array. At issue, then, is whether the **malloc** delivers the bytes for this structure or **NULL** to signal failure; if **NULL**, the **get_heap_struct** function returns **NULL** to notify the caller that the heap allocation failed. + +The second attempted heap allocation is more complicated because, at this step, heap storage for the **HeapStruct** has been allocated: + + +``` +heap_struct->heap_nums = [malloc][8](sizeof(float) * n); +if (NULL == heap_struct->heap_nums) {  /* failure? */ +  [free][10](heap_struct);                   /* if so, first free the HeapStruct */ +  return NULL;                         /* and then return NULL */ +} +``` + +The argument **n** sent to the **get_heap_struct** function indicates how many **float** elements should be in the dynamically allocated **heap_nums** array. If the required **float** elements can be allocated, then the function sets the structure's **id** and **len** fields before returning the heap address of the **HeapStruct**. If the attempted allocation fails, however, two steps are necessary to meet best practice: + +1\. The storage for the **HeapStruct** must be freed to avoid memory leakage. Without the dynamic **heap_nums** array, the **HeapStruct** is presumably of no use to the client function that calls **get_heap_struct**; hence, the bytes for the **HeapStruct** instance should be explicitly deallocated so that the system can reclaim these bytes for future heap allocations. + +2\. **NULL** is returned to signal failure. + +If the call to the **get_heap_struct** function succeeds, then freeing the heap storage is also tricky because it involves two **free** operations in the proper order. Accordingly, the program includes a **free_all** function instead of requiring the programmer to figure out the appropriate two-step deallocation. For review, here's the **free_all** function: + + +``` +void free_all(HeapStruct* heap_struct) { +  if (NULL == heap_struct) /* NULL pointer? */ +    return;                /* if so, do nothing */ +   +  [free][10](heap_struct->heap_nums); /* first free encapsulated aggregate */ +  [free][10](heap_struct);            /* then free containing structure */   +} +``` + +After checking that the argument **heap_struct** is not **NULL**, the function first frees the **heap_nums** array, which requires that the **heap_struct** pointer is still valid. It would be an error to release the **heap_struct** first. Once the **heap_nums** have been deallocated, the **heap_struct** can be freed as well. If **heap_struct** were freed, but **heap_nums** were not, then the **float** elements in the array would be leakage: still allocated bytes but with no possibility of access—hence, of deallocation. The leakage would persist until the **nestedHeap** program exited and the system reclaimed the leaked bytes. + +A few cautionary notes on the **free** library function are in order. Recall the sample calls above: + + +``` +[free][10](heap_struct->heap_nums); /* first free encapsulated aggregate */ +[free][10](heap_struct);            /* then free containing structure */ +``` + +These calls free the allocated storage—but they do _not_ set their arguments to **NULL**. (The **free** function gets a copy of an address as an argument; hence, changing the copy to **NULL** would leave the original unchanged.) For example, after a successful call to **free**, the pointer **heap_struct** still holds a heap address of some heap-allocated bytes, but using this address now would be an error because the call to **free** gives the system the right to reclaim and then reuse the allocated bytes. + +Calling **free** with a **NULL** argument is pointless but harmless. Calling **free** repeatedly on a non-**NULL** address is an error with indeterminate results: + + +``` +[free][10](heap_struct);  /* 1st call: ok */ +[free][10](heap_struct);  /* 2nd call: ERROR */ +``` + +### Memory leakage and heap fragmentation + +The phrase "memory leakage" refers to dynamically allocated heap storage that is no longer accessible. Here's a code segment for review: + + +``` +float* nums = [malloc][8](sizeof(float) * 10); /* 10 floats */ +nums[0] = 3.14f;                          /* and so on */ +nums = [malloc][8](sizeof(float) * 25);        /* 25 new floats */ +``` + +Assume that the first **malloc** succeeds. The second **malloc** resets the **nums** pointer, either to **NULL** (allocation failure) or to the address of the first **float** among newly allocated twenty-five. Heap storage for the initial ten **float** elements remains allocated but is now inaccessible because the **nums** pointer either points elsewhere or is **NULL**. The result is forty bytes (**sizeof(float) * 10**) of leakage. + +Before the second call to **malloc**, the initially allocated storage should be freed: + + +``` +float* nums = [malloc][8](sizeof(float) * 10); /* 10 floats */ +nums[0] = 3.14f;                          /* and so on */ +[free][10](nums);                               /** good **/ +nums = [malloc][8](sizeof(float) * 25);        /* no leakage */ +``` + +Even without leakage, the heap can fragment over time, which then requires system defragmentation. For example, suppose that the two biggest heap chunks are currently of sizes 200MB and 100MB. However, the two chunks are not contiguous, and process **P** needs to allocate 250MB of contiguous heap storage. Before the allocation can be made, the system must _defragment_ the heap to provide 250MB contiguous bytes for **P**. Defragmentation is complicated and, therefore, time-consuming. + +Memory leakage promotes fragmentation by creating allocated but inaccessible heap chunks. Freeing no-longer-needed heap storage is, therefore, one way that a programmer can help to reduce the need for defragmentation. + +### Tools to diagnose memory leakage + +Various tools are available for profiling memory efficiency and safety. My favorite is [valgrind][11]. To illustrate how the tool works for memory leaks, here's the **leaky** program: + + +``` +#include <stdio.h> +#include <stdlib.h> + +int* get_ints(unsigned n) { +  int* ptr = [malloc][8](n * sizeof(int)); +  if (ptr != NULL) { +    unsigned i; +    for (i = 0; i < n; i++) ptr[i] = i + 1; +  } +  return ptr; +} + +void print_ints(int* ptr, unsigned n) { +  unsigned i; +  for (i = 0; i < n; i++) [printf][6]("%3i\n", ptr[i]); +} + +int main() { +  const unsigned n = 32; +  int* arr = get_ints(n); +  if (arr != NULL) print_ints(arr, n); + +  /** heap storage not yet freed... **/ +  return 0; +} +``` + +The function **main** calls **get_ints**, which tries to **malloc** thirty-two 4-byte **int**s from the heap and then initializes the dynamic array if the **malloc** succeeds. On success, the **main** function then calls **print_ints**. There is no call to **free** to match the call to **malloc**; hence, memory leaks. + +With the **valgrind** toolbox installed, the command below checks the **leaky** program for memory leaks (**%** is the command-line prompt): + + +``` +`% valgrind --leak-check=full ./leaky` +``` + +Below is most of the output. The number on the left, 207683, is the process identifier of the executing **leaky** program. The report provides details of where the leak occurs, in this case, from the call to **malloc** within the **get_ints** function that **main** calls. + + +``` +==207683== HEAP SUMMARY: +==207683==   in use at exit: 128 bytes in 1 blocks +==207683==   total heap usage: 2 allocs, 1 frees, 1,152 bytes allocated +==207683==  +==207683== 128 bytes in 1 blocks are definitely lost in loss record 1 of 1 +==207683==   at 0x483B7F3: malloc (in /usr/lib/x86_64-linux-gnu/valgrind/vgpreload_memcheck-amd64-linux.so) +==207683==   by 0x109186: get_ints (in /home/marty/gc/leaky) +==207683==   by 0x109236: main (in /home/marty/gc/leaky) +==207683==  +==207683== LEAK SUMMARY: +==207683==   definitely lost: 128 bytes in 1 blocks +==207683==   indirectly lost: 0 bytes in 0 blocks +==207683==   possibly lost: 0 bytes in 0 blocks +==207683==   still reachable: 0 bytes in 0 blocks +==207683==   suppressed: 0 bytes in 0 blocks +``` + +If function **main** is revised to include a call to **free** right after the one to **print_ints**, then **valgrind** gives the **leaky** program a clean bill of health: + + +``` +`==218462== All heap blocks were freed -- no leaks are possible` +``` + +### Static area storage + +In orthodox C, a function must be defined outside all blocks. This rules out having one function defined inside the body of another, a feature that some C compilers support. My examples stick with functions defined outside all blocks. Such a function is either **static** or **extern**, with **extern** as the default. + +C functions and variables with either **static** or **extern** as their storage class reside in what I've been calling the **static area** of memory because this area has a fixed size during program execution. The syntax for these two storage classes is complicated enough to merit a review. After the review, a full code example brings the syntactic details back to life. Functions or variables defined outside all blocks default to **extern**; hence, the storage class **static** must be explicit for both functions and variables: + + +``` +/** file1.c: outside all blocks, five definitions  **/ +int foo(int n) { return n * 2; }     /* extern by default */ +static int bar(int n) { return n; }  /* static */ +extern int baz(int n) { return -n; } /* explicitly extern */ + +int num1;        /* extern */ +static int num2; /* static */ +``` + +The difference between **extern** and **static** comes down to scope: an **extern** function or variable may be visible across files. By contrast, a **static** function is visible only in the file that contains the function's _definition_, and a **static** variable is visible only in the file (or a block therein) that has the variable's _definition_: + + +``` +static int n1;    /* scope is the file */ +void func() { +   static int n2; /* scope is func's body */ +   ... +} +``` + +If a **static** variable such as **n1** above is defined outside all blocks, the variable's scope is the file in which the variable is defined. Wherever a **static** variable may be defined, storage for the variable is in the static area of memory. + +An **extern** function or variable is defined outside all blocks in a given file, but the function or variable so defined then may be declared in some other file. The typical practice is to _declare_ such a function or variable in a header file, which is included wherever needed. Some short examples clarify these tricky points. + +Suppose that the **extern** function **foo** is _defined_ in **file1.c**, with or without the keyword **extern**: + + +``` +/** file1.c **/ +int foo(int n) { return n * 2; } /* definition has a body {...} */ +``` + +This function must be _declared_ with an explicit **extern** in any other file (or block therein) for the function to be visible. Here's the declaration that makes the **extern** function **foo** visible in file **file2.c**: + + +``` +/** file2.c: make function foo visible here **/ +extern int foo(int); /* declaration (no body) */ +``` + +Recall that a function declaration does not have a body enclosed in curly braces, whereas a function definition does have such a body. + +For review, header files typically contain function and variable declarations. Source-code files that require the declarations then **#include** the relevant header file(s). The **staticProg** program in the next section illustrates this approach. + +The rules get trickier (sorry!) with **extern** variables. Any **extern** object—function or variable—must be _defined_ outside all blocks. Also, a variable defined outside all blocks defaults to **extern**: + + +``` +/** outside all blocks **/ +int n; /* defaults to extern */ +``` + +However, the **extern** can be explicit in the variable's _definition_ only if the variable is initialized explicitly there: + + +``` +/** file1.c: outside all blocks **/ +int n1;             /* defaults to extern, initialized by compiler to zero */ +extern int n2 = -1; /* ok, initialized explicitly */ +int n3 = 9876;      /* ok, extern by default and initialized explicitly */ +``` + +For a variable defined as **extern** in **file1.c** to be visible in another file such as **file2.c**, the variable must be _declared_ as explicitly **extern** in **file2.c** and not initialized, which would turn the declaration into a definition: + + +``` +/** file2.c **/ +extern int n1; /* declaration of n1 defined in file1.c */ +``` + +To avoid confusion with **extern** variables, the rule of thumb is to use **extern** explicitly in a _declaration_ (required) but not in a _definition_ (optional and tricky). For functions, the **extern** is optional in a definition but needed for a declaration. The **staticProg** example in the next section brings these points together in a full program. + +### The staticProg example + +The **staticProg** program consists of three files: two C source files (**static1.c** and **static2.c**) together with a header file (**static.h**) that contains two declarations: + + +``` +/** header file static.h **/ +#define NumCount 100               /* macro */ +extern int global_nums[NumCount];  /* array declaration */ +extern void fill_array();          /* function declaration */ +``` + +The **extern** in the two declarations, one for an array and the other for a function, underscores that the objects are _defined_ elsewhere ("externally"): the array **global_nums** is defined in file **static1.c** (without an explicit **extern**) and the function **fill_array** is defined in file **static2.c** (also without an explicit **extern**). Each source file includes the header file **static.h**.The **static1.c** file defines the two arrays that reside in the static area of memory, **global_nums** and **more_nums**. The second array has a **static** storage class, which restricts its scope to the file (**static1.c**) in which the array is defined. As noted, **global_nums** as **extern** can be made visible in multiple files. + + +``` +/** static1.c **/ +#include <stdio.h> +#include <stdlib.h> + +#include "static.h"             /* declarations */ + +int global_nums[NumCount];      /* definition: extern (global) aggregate */ +static int more_nums[NumCount]; /* definition: scope limited to this file */ + +int main() { +  fill_array(); /** defined in file static2.c **/ + +  unsigned i; +  for (i = 0; i < NumCount; i++) +    more_nums[i] = i * -1; + +  /* confirm initialization worked */ +  for (i = 0; i < NumCount; i += 10)  +    [printf][6]("%4i\t%4i\n", global_nums[i], more_nums[i]); +     +  return 0;   +} +``` + +The **static2.c** file below defines the **fill_array** function, which **main** (in the **static1.c** file) invokes; the **fill_array** function populates the **extern** array named **global_nums**, which is defined in file **static1.c**. The sole point of having two files is to underscore that an **extern** variable or function can be visible across files. + + +``` +/** static2.c **/ +#include "static.h" /** declarations **/ + +void fill_array() { /** definition **/ +  unsigned i; +  for (i = 0; i < NumCount; i++) global_nums[i] = i + 2; +} +``` + +The **staticProg** program can be compiled as follows: + + +``` +`% gcc -o staticProg static1.c static2.c` +``` + +### More details from assembly language + +A modern C compiler can handle any mix of C and assembly language. When compiling a C source file, the compiler first translates the C code into assembly language. Here's the command to save the assembly language generated from the **static1.c** file above: + + +``` +`% gcc -S static1.c` +``` + +The resulting file is **static1.s**. Here's a segment from the top, with added line numbers for readability: + + +``` +    .file    "static1.c"          ## line  1 +    .text                         ## line  2 +    .comm    global_nums,400,32   ## line  3 +    .local    more_nums           ## line  4 +    .comm    more_nums,400,32     ## line  5 +    .section    .rodata           ## line  6 +.LC0:                             ## line  7 +    .string    "%4i\t%4i\n"       ## line  8 +    .text                         ## line  9 +    .globl    main                ## line 10 +    .type    main, @function      ## line 11 +main:                             ## line 12 +... +``` + +The assembly-language directives such as **.file** (line 1) begin with a period. As the name suggests, a directive guides the assembler as it translates assembly language into machine code. The **.rodata** directive (line 6) indicates that read-only objects follow, including the string constant **"%4i\t%4i\n"** (line 8), which function **main** (line 12) uses to format output. The function **main** (line 12), introduced as a label (the colon at the end makes it so), is likewise read-only. + +In assembly language, labels are addresses. The label **main:** (line 12) marks the address at which the code for the **main** function begins, and the label **.LC0**: (line 7) marks the address at which the format string begins. + +The definitions of the **global_nums** (line 3) and **more_nums** (line 4) arrays include two numbers: 400 is the total number of bytes in each array, and 32 is the number of bits in each of the 100 **int** elements per array. (The **.comm** directive in line 5 stands for **common name**, which can be ignored.) + +The array definitions differ in that **more_nums** is marked as **.local** (line 4), which means that its scope is restricted to the containing file **static1.s**. By contrast, the **global_nums** array can be made visible across multiple files, including the translations of the **static1.c** and **static2.c** files. + +Finally, the **.text** directive occurs twice (lines 2 and 9) in the assembly code segment. The term "text" suggests "read-only" but also covers read/write variables such as the elements in the two arrays. Although the assembly language shown is for an Intel architecture, Arm6 assembly would be quite similar. For both architectures, variables in the **.text** area (in this case, elements in the two arrays) are initialized automatically to zeros. + +### Wrapping up + +For memory-efficient and memory-safe programming in C, the guidelines are easy to state but may be hard to follow, especially when calls to poorly designed libraries are in play. The guidelines are: + + * Use stack storage whenever possible, thereby encouraging the compiler to optimize with general-purpose registers for scratchpad. Stack storage represents efficient memory use and promotes clean, modular code. Never return a pointer to stack-based storage. + * Use heap storage carefully. The challenge in C (and C++) is to ensure that dynamically allocated storage is deallocated ASAP. Good programming habits and tools (such as **valgrind**) help to meet the challenge. Favor libraries that provide their own deallocation function(s), such as the **free_all** function in the **nestedHeap** code example. + * Use static storage judiciously, as this storage impacts the memory footprint of a process from start to finish. In particular, try to avoid **extern** and **static** arrays. + + + +The C code examples are available at my website (). + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/memory-programming-c + +作者:[Marty Kalin][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/mkalindepauledu +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.) +[2]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[3]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/fread.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/fwrite.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/free.html +[11]: https://www.valgrind.org/ From 4bed47bc428a22b64cff0c085b1a950a371f675a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 14 Aug 2021 05:04:08 +0800 Subject: [PATCH 038/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210813=20?= =?UTF-8?q?Parse=20command=20options=20in=20Java=20with=20commons-cli?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210813 Parse command options in Java with commons-cli.md --- ...ommand options in Java with commons-cli.md | 231 ++++++++++++++++++ 1 file changed, 231 insertions(+) create mode 100644 sources/tech/20210813 Parse command options in Java with commons-cli.md diff --git a/sources/tech/20210813 Parse command options in Java with commons-cli.md b/sources/tech/20210813 Parse command options in Java with commons-cli.md new file mode 100644 index 0000000000..5e20e78c9e --- /dev/null +++ b/sources/tech/20210813 Parse command options in Java with commons-cli.md @@ -0,0 +1,231 @@ +[#]: subject: "Parse command options in Java with commons-cli" +[#]: via: "https://opensource.com/article/21/8/java-commons-cli" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Parse command options in Java with commons-cli +====== +Let your users modify how your Java application runs with command-line +options. +![Learning and studying technology is the key to success][1] + +When you enter a command into your terminal, whether it's to launch a GUI app or just a terminal app, there are often [options][2] (sometimes called _switches_ or _flags_) you can use to modify how the application runs. This is a standard set by the [POSIX specification][3], so it's useful for a Java programmer to know how to detect and parse options. + +There are several ways to parse options in Java. My favorite is the [Apache Commons CLI][4] library, called **commons-cli** for short. + +### Installing commons-cli + +If you're using a project management system like [Maven][5] and an IDE, you can install the Apache Commons CLI library in your project properties (such as `pom.xml` or a configuration screen in Eclipse or NetBeans). + +If you're managing libraries manually, you can download [the latest release][6] from the Apache website. Several JAR files come bundled together. The only required JAR is the `commons-cli-X.Y.jar` (where X and Y are the latest version numbers.) Add that JAR to your project, either manually or in your IDE, and then you can use it in your code. + +### Importing a library into your Java code + +To use the **commons-cli** library in your code, you must import it. For this simple option parsing example, you can populate a file called `Main.java` with the standard minimal code: + + +``` +package com.opensource.myoptparser; + +import org.apache.commons.cli.*; + +public class Main { +    public static void main([String][7][] args) { +    // code  +    } +} +``` + +Now you're set to parse options in Java. + +### Defining Boolean options in Java + +The first thing you must do to parse options is to define the valid options your application can accept. Use the `Option` (singular) class to create option objects and the `Options` (plural) class to help keep track of all the options you've created in your project. + +First, create a group for your options, and call it `options` according to convention: + + +``` +    //code +    Options options = new Options(); +``` + +Next, define your individual options by listing a short option, a long option, a default Boolean value, and a help message. You then set whether the option is required or not, and finally add the option to the `options` object, which contains all of your options. In this example, I create just one option, arbitrarily called `alpha`: + + +``` +    //define options +    [Option][8] alpha = new [Option][8]("a", "alpha", false, "Activate feature alpha"); +    options.addOption(alpha); +``` + +### Defining options with arguments in Java + +Sometimes you want users to provide information other than just **true** or **false** along with an option. You might want to let a user refer to a configuration file, an input file, or any setting like a date or a color. For this, you use the `builder` method, creating attributes for an option based on its short version (for example, `-c` is a short option, `--config` is a long option). Once it's defined, you add the new option to your `options` group: + + +``` +    [Option][8] config = [Option][8].builder("c").longOpt("config") +        .argName("config") +        .hasArg() +        .required(true) +        .desc("set config file").build(); +    options.addOption(config); +``` + +With the `builder` function, you can set the short version, long version, whether it's required (I set this to **true** in this code, so my application can't run unless this option is provided by the user at launch time), the help message, and so on. + +### Parsing options with Java + +With all possible options defined, you can now iterate over arguments provided by the user, checking to see whether any argument matches your approved list of valid short options. To do this, you create an instance of the **CommandLine** itself, which contains all arguments provided by the user (valid options and otherwise.) You also create a **CommandLineParser** object, which I call `parser` in my code, to facilitate interaction over those arguments. Finally, you can create a **HelpFormatter** object (which I call `helper`) to automatically provide helpful messages to the user when either a required option is missing, or the `--help` or `-h` option is used. + + +``` +    // define parser +    CommandLine cmd; +    CommandLineParser parser = new BasicParser(); +    HelpFormatter helper = new HelpFormatter(); +``` + +Finally, add some conditionals to analyze the options provided by the user as command-line input (discovered and stored in the `cmd` variable). This sample application has two different types of options, but in both cases, you can check whether the option exists with the `.hasOption` method plus the short option name. When an option is detected, you can do whatever needs to be done with the data. + + +``` +try { +    cmd = parser.parse(options, args); +    if(cmd.hasOption("a")) { +    [System][9].out.println("Alpha activated"); +    } + +    if (cmd.hasOption("c")) { +    [String][7] opt_config = cmd.getOptionValue("config"); +    [System][9].out.println("Config set to " + opt_config); +    } +} catch ([ParseException][10] e) { +    [System][9].out.println(e.getMessage()); +    helper.printHelp("Usage:", options); +    [System][9].exit(0); +} +``` + +The act of parsing potentially generates an error because sometimes the required `-c` or `--config` option could be missing. In that event, a help message is printed, and the application is immediately ended. Because of this error (an _exception_ in Java terminology), you must amend the start of the main method to declare a possible exception: + + +``` +`public static void main(String[] args) throws ParseException {` +``` + +The sample application is now complete. + +### Test your code + +You can test the application in your IDE by adjusting the default parameters passed to your code or just build a JAR file and run it from your terminal. The process for this differs depending on your IDE. Refer to your IDE documentation, read my article on how to LINK-TO-ARTICLE[build a JAR], or see Daniel Oh's article on how to do the same with [Maven][11]. + +First, confirm the parser exception by omitting the required `-c` or `--config` option: + + +``` +$ java -jar dist/myapp.jar                  +Missing required option: c +usage: Usage: + -a,--alpha             Activate feature alpha + -c,--config <config>   Set config file +``` + +Try it again with the options provided: + + +``` +java -jar dist/myantapp.jar --config foo -a +Alpha activated +Config set to foo +``` + +### Option parsing + +Including options for your users is an important feature for any application. Java and the Apache commons make it easy to do. + +Here's the full demonstration code for your reference: + + +``` +package com.opensource.myapp; + +import org.apache.commons.cli.*; + +public class Main { +     +    /** +     * @param args the command line arguments +     * @throws org.apache.commons.cli.ParseException +     */  +    public static void main([String][7][] args) throws [ParseException][10] { +        // define options +        Options options = new Options(); +         +        [Option][8] alpha = new [Option][8]("a", "alpha", false, "Activate feature alpha"); +        options.addOption(alpha); +         +        [Option][8] config = [Option][8].builder("c").longOpt("config") +                .argName("config") +                .hasArg() +                .required(true) +                .desc("Set config file").build(); +        options.addOption(config); +      +        // define parser +        CommandLine cmd; +        CommandLineParser parser = new BasicParser(); +        HelpFormatter helper = new HelpFormatter(); + +        try { +            cmd = parser.parse(options, args); +            if(cmd.hasOption("a")) { +                [System][9].out.println("Alpha activated"); +            } +           +            if (cmd.hasOption("c")) { +                [String][7] opt_config = cmd.getOptionValue("config"); +                [System][9].out.println("Config set to " + opt_config); +            } +        } catch ([ParseException][10] e) { +            [System][9].out.println(e.getMessage()); +            helper.printHelp("Usage:", options); +            [System][9].exit(0); +        } +    } +} +``` + +### Using Java and options + +Options allow users to modify how commands work. There are many ways to parse options when using Java, and the `commons-cli` is a robust and flexible open source solution. Give it a try in your next Java project. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/java-commons-cli + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/studying-books-java-couch-education.png?itok=C9gasCXr (Learning and studying technology is the key to success) +[2]: https://opensource.com/article/21/8/linux-terminal#options +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: https://commons.apache.org/proper/commons-cli/usage.html +[5]: https://maven.apache.org/ +[6]: https://commons.apache.org/proper/commons-cli/download_cli.cgi +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+option +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+parseexception +[11]: https://developers.redhat.com/blog/2021/04/08/build-even-faster-quarkus-applications-with-fast-jar From b94ca26a5c0868d4671397a089e1cc9dfc3f048c Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 14 Aug 2021 09:10:24 +0800 Subject: [PATCH 039/290] Update 20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md --- ...eb Canary is Now Available to Test Bleeding Edge Features.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md index a53778ce7e..858cc8a703 100644 --- a/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md +++ b/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/gnome-web-canary/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zd200572) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4ff9fd0cd8c35f66bd45778dbeee69873f09e588 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 14 Aug 2021 10:01:09 +0800 Subject: [PATCH 040/290] Update 20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md --- ...vailable to Test Bleeding Edge Features.md | 42 +++++++++---------- 1 file changed, 19 insertions(+), 23 deletions(-) diff --git a/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md index 858cc8a703..320be75236 100644 --- a/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md +++ b/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md @@ -7,55 +7,51 @@ [#]: publisher: ( ) [#]: url: ( ) -GNOME Web Canary is Now Available to Test Bleeding Edge Features +GNOME Web Canary现在可用于测试前沿功能 ====== -Epiphany or [GNOME Web][1] is a minimal and yet capable browser for Linux distributions. You should find it as the default browser for elementary OS. +Epiphany或[GNOME Web][1]是一个Linux发行版上最小且能干的浏览器,你会发现它是elementary OS的默认浏览器。 -With GNOME 40, the Epiphany browser has had some [improvements and additions][2]. +使用GNOME40,Epiphany浏览器有一些[改进和新增功能][2]。 -Behind the scenes, it regularly gets some exciting improvements and feature additions. And for that, you can opt for the Tech Preview version of GNOME Web tailored for early testers. +在幕后,经常有许多令人兴奋的提升和新增特性。因此,你可以选择面向早期测试者的技术预览版。 -Now, a new Canary flavor has been introduced that you can use to test features that are not yet available even in the tech preview build. +现在,一个新的Canary版本发布了,你可以使用来测试甚至在技术预览版中没有的特性。 -### GNOME Web Canary Flavor +### GNOME Web Canary版本 ![][3] -GNOME Web’s “Canary” builds let you test features that are not even available in the latest [WebKitGTK][4] version. +GNOME Web的“Canary”版本让你测试甚至没有出现地最新[WebKitGTK][4]版本的特性。 -Do note that the canary builds are supposed to be extremely unstable, even worse than the development builds available as a tech preview. +注意Canary版本可能相当不稳定,甚至稳定性比开发者技术预览版更差。 -However, with the help of a Canary build, an end-user can test things way early in the process of development that can help find disastrous bugs. +可是,使用Canary版本, 一个终端用户可以在早期开发过程中测试,帮助开发者发现灾难性bugs。 -Not just limited to end-user early testing, a canary build also makes things easier for a GNOME Web developer. +不只是终端用户早期测试,Canary版本还让GNOME Web开发者的工作更轻松。 -They no longer have to build WebKitGTK separately in order to implement and test a new feature. +他们不再需要为了实现和测试一个新特性,单独构建WebKitGTK。 -Even though there was a Flatpak SDK available to ease the process for developers, it was still a time-consuming task. +尽管开发者有一个Flatpak SDK可以方便进行测试,但是这是一个费时的任务。 -Now, with that out of the way, the development pace can potentially improve as well. +现在,没有了这个阻碍,开发节奏也可以提升。 -### How to Get the Canary Build? +### 怎样获得Canary版本? -First, you need to add the WebKit SDK Flatpak remote using the commands below: +首先,你需要使用下面命令远程添加WebKit SDK Flatpak: ``` flatpak --user remote-add --if-not-exists webkit https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref ``` -Once done, you can install the Canary by using the [Flatpakref file][5] provided. +一旦完成,你就可以使用提供的[Flatpakref file][5]安装啦! -Testing a Canary build gives more users the ability to help GNOME Web developers in the process. So, it is definitely a much-needed addition to improve the development of the GNOME Web browser. +测试一个Canary版本让更多的用户有能力来帮助GNOME Web开发者的开发过程。所以,这绝对是一个很需要的新增功能,来促进GNOME Web浏览器的开发。 -For more technical details, you might want to take a look at the [announcement post][6] by one of the developers. +更多技术细节,你或许想看开发者中的一个写的[公告栏][6]。 -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested -------------------------------------------------------------------------------- @@ -63,7 +59,7 @@ via: https://news.itsfoss.com/gnome-web-canary/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zd200572](https://github.com/zd200572) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4033797a34fe1b2c30d43b26feb1b4603bc678cd Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 14 Aug 2021 10:42:33 +0800 Subject: [PATCH 041/290] Update and rename sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md to translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md --- ...vailable to Test Bleeding Edge Features.md | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) rename {sources => translated}/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md (53%) diff --git a/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md similarity index 53% rename from sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md rename to translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md index 320be75236..5c28f1e5e7 100644 --- a/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md +++ b/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md @@ -10,46 +10,46 @@ GNOME Web Canary现在可用于测试前沿功能 ====== -Epiphany或[GNOME Web][1]是一个Linux发行版上最小且能干的浏览器,你会发现它是elementary OS的默认浏览器。 +Epiphany或[GNOME Web][1]是一个Linux发行版上最小但功能强大的浏览器,你会发现它是elementary OS的默认浏览器。 使用GNOME40,Epiphany浏览器有一些[改进和新增功能][2]。 -在幕后,经常有许多令人兴奋的提升和新增特性。因此,你可以选择面向早期测试者的技术预览版。 +在幕后,经常有许多令人兴奋的提升和新增特性。因此,你可以选择为早期测试人员量身定制的GNOME Web技术预览版。 -现在,一个新的Canary版本发布了,你可以使用来测试甚至在技术预览版中没有的特性。 +现在,一个新的Canary版本发布了,你可以使用它来测试甚至在技术预览版中都没有的特性。 ### GNOME Web Canary版本 ![][3] -GNOME Web的“Canary”版本让你测试甚至没有出现地最新[WebKitGTK][4]版本的特性。 +GNOME Web的“Canary”版本允许你测试甚至没有出现地最新[WebKitGTK][4]版本的特性。 -注意Canary版本可能相当不稳定,甚至稳定性比开发者技术预览版更差。 +注意Canary版本应该是极其不稳定的,甚至稳定性比开发者技术预览版更差。 -可是,使用Canary版本, 一个终端用户可以在早期开发过程中测试,帮助开发者发现灾难性bugs。 +可是,使用Canary版本, 一个终端用户可以在开发过程中的早期进行测试,帮助开发者发现灾难性bugs。 -不只是终端用户早期测试,Canary版本还让GNOME Web开发者的工作更轻松。 +不只是终端用户的早期测试,Canary版本还让GNOME Web开发者的工作更轻松。 -他们不再需要为了实现和测试一个新特性,单独构建WebKitGTK。 +他们不再需要为了实现和测试一个新特性,来单独构建WebKitGTK。 -尽管开发者有一个Flatpak SDK可以方便进行测试,但是这是一个费时的任务。 +尽管开发者有一个Flatpak SDK可以简化开发人员的流程,但是这仍然是一项耗时的任务。 -现在,没有了这个阻碍,开发节奏也可以提升。 +现在,没有了这个阻碍,开发速度也有可能提升。 ### 怎样获得Canary版本? -首先,你需要使用下面命令远程添加WebKit SDK Flatpak: +首先,你需要使用以下命令添加WebKit SDK Flatpak remote: ``` flatpak --user remote-add --if-not-exists webkit https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref ``` -一旦完成,你就可以使用提供的[Flatpakref file][5]安装啦! +一旦完成,你就可以使用提供的[Flatpakref文件][5]安装啦! -测试一个Canary版本让更多的用户有能力来帮助GNOME Web开发者的开发过程。所以,这绝对是一个很需要的新增功能,来促进GNOME Web浏览器的开发。 +测试一个Canary版本让更多的用户能够在此过程中帮助GNOME Web开发者的开发人员。所以,这绝对是改进GNOME Web浏览器的开发的急需的补充。 -更多技术细节,你或许想看开发者中的一个写的[公告栏][6]。 +更多技术细节,你可能需要看一位开发者中发布的[公告][6]。 From e900dea0800370bd78fd50a414c741e7dd0278ee Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 14 Aug 2021 10:45:58 +0800 Subject: [PATCH 042/290] Update 20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md --- ... Canary is Now Available to Test Bleeding Edge Features.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md index 5c28f1e5e7..e5177a5d50 100644 --- a/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md +++ b/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md @@ -22,7 +22,7 @@ Epiphany或[GNOME Web][1]是一个Linux发行版上最小但功能强大的浏 ![][3] -GNOME Web的“Canary”版本允许你测试甚至没有出现地最新[WebKitGTK][4]版本的特性。 +GNOME Web的“Canary”版本允许你测试甚至没有出现在最新[WebKitGTK][4]版本中的特性。 注意Canary版本应该是极其不稳定的,甚至稳定性比开发者技术预览版更差。 @@ -47,7 +47,7 @@ flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epipha 一旦完成,你就可以使用提供的[Flatpakref文件][5]安装啦! -测试一个Canary版本让更多的用户能够在此过程中帮助GNOME Web开发者的开发人员。所以,这绝对是改进GNOME Web浏览器的开发的急需的补充。 +测试一个Canary版本让更多的用户能够在此过程中帮助GNOME Web开发者的开发人员。所以,这绝对是改进GNOME Web浏览器开发的急需补充。 更多技术细节,你可能需要看一位开发者中发布的[公告][6]。 From 0d31a734846c74142ccf6d4b3a8d906138249bd1 Mon Sep 17 00:00:00 2001 From: George <40418272+unigeorge@users.noreply.github.com> Date: Sat, 14 Aug 2021 15:00:54 +0800 Subject: [PATCH 043/290] translated --- ...0608 Tune your MySQL queries like a pro.md | 108 ------------------ ...0608 Tune your MySQL queries like a pro.md | 105 +++++++++++++++++ 2 files changed, 105 insertions(+), 108 deletions(-) delete mode 100644 sources/tech/20210608 Tune your MySQL queries like a pro.md create mode 100644 translated/tech/20210608 Tune your MySQL queries like a pro.md diff --git a/sources/tech/20210608 Tune your MySQL queries like a pro.md b/sources/tech/20210608 Tune your MySQL queries like a pro.md deleted file mode 100644 index f1b6ac247f..0000000000 --- a/sources/tech/20210608 Tune your MySQL queries like a pro.md +++ /dev/null @@ -1,108 +0,0 @@ -[#]: subject: (Tune your MySQL queries like a pro) -[#]: via: (https://opensource.com/article/21/5/mysql-query-tuning) -[#]: author: (Dave Stokes https://opensource.com/users/davidmstokes) -[#]: collector: (lujun9972) -[#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Tune your MySQL queries like a pro -====== -Optimizing your queries isn't a dark art; it's just simple engineering. -![woman on laptop sitting at the window][1] - -Many people consider tuning database queries to be some mysterious "dark art" out of a Harry Potter novel; with the wrong incantation, your data turns from a valuable resource into a pile of mush. - -In reality, tuning queries for a relational database system is simple engineering and follows easy-to-understand rules or heuristics. The query optimizer translates the query you send to a [MySQL][2] instance, and then it determines the best way to get the requested data using those heuristics combined with what it knows about your data. Reread the last part of that: _"what it knows about your data_." The less the query optimizer has to guess about where your data is located, the better it can create a plan to deliver your data. - -To give the optimizer better insight about the data, you can use indexes and histograms. Used properly, they can greatly increase the speed of a database query. If you follow the recipe, you will get something you will like. But if you add your own ingredients to that recipe, you may not get what you want. - -### Cost-based optimizer - -Most modern relational databases use a cost-based optimizer to determine how to retrieve your data out of the database. That cost is based on reducing very expensive disk reads as much as possible. The query optimizer code inside the database server keeps statistics on getting that data as it is encountered, and it builds a historical model of what it took to get the data. - -But historical data can be out of date. It's like going to the store to buy your favorite snack and being shocked at a sudden price increase or that the store closed. Your server's optimization process may make a bad assumption based on old information, and that will produce a poor query plan. - -A query's complexity can work against optimization. The optimizer wants to deliver the lowest-cost query of the available options. Joining five different tables means that there are five-factorial or 120 possible combinations about which to join to what. Heuristics are built into the code to try to shortcut evaluating all the possible options. MySQL wants to generate a new query plan every time it sees a query, while other databases such as Oracle can have a query plan locked down. This is why giving detailed information on your data to the optimizer is vital. For consistent performance, it really helps to have up-to-date information for the query optimizer to use when making query plans. - -Also, rules are built into the optimizer with assumptions that probably do not match the reality of your data. The query optimizer will assume all the data in a column is evenly distributed among all the rows unless it has other information. And it will default to the smaller of two possible indexes if it sees no alternative. While the cost-based model for an optimizer can make a lot of good decisions, you can smack into cases where you will not get an optimal query plan. - -### A query plan? - -A query plan is what the optimizer will generate for the server to execute from the query. The way to see the query plan is to prepend the word `EXPLAIN` to your query. For example, the following query asks for the name of a city from the city table and the name of the corresponding country table, and the two tables are linked by the country's unique code. This case is interested only in the top five cities alphabetically from the United Kingdom: - - -``` -SELECT city.name AS 'City', -               country.name AS 'Country' -FROM city -JOIN country ON (city.countrycode = country.code) -WHERE country.code = 'GBR' -LIMIT 5; -``` - -Prepending `EXPLAIN` in front of this query will give the query plan generated by the optimizer. Skipping over all but the end of the output, it is easy to see the optimized query: - - -``` -SELECT `world`.`city`.`Name` AS `City`, -                'United Kingdom' AS `Country` -FROM `world`.`city` -JOIN `world`.`country` -WHERE (`world`.`city`.`CountryCode` = 'GBR') -LIMIT 5; -``` - -The big changes are that `country.name as 'Country'` was changed to `'United Kingdom' AS 'Country'` and the `WHERE` clause went from looking in the country table to the city table. The optimizer determined that these two changes will provide a faster result than the original query. - -### Indexes - -You will hear indexes and keys used interchangeably in the MySQL-verse. However, indexes are made up of keys, and keys are a way to identify a record, hopefully uniquely. If a column is designed as a key, the optimizer can search a list of those keys to find the desired record without having to read the entire table. Without an index, the server has to start at the first row of the first column and read through every row of data. If the column was created as a unique index, then the server can go to that one row of data and ignore the rest. The more unique the value of the index (also known as its cardinality), the better. Remember, we are looking for faster ways of getting to the data. - -The MySQL default InnoDB storage engine wants your table to have a primary key and will store your data in a B+ tree by that key. A recently added MySQL feature is invisible columns—columns that do not return data unless the column is explicitly named in the query. For example, `SELECT * FROM foo;` doesn't provide any columns that are designated as hidden. This feature provides a way to add a  primary key to older tables without recoding all the queries to include that new column. - -To make this even more complicated, there are many types of indexes, such as functional, spatial, and composite. There are even cases where you can create an index that will provide all the requested information for a query so that there is no need to access the data table. - -Describing the various indexes is beyond the scope of this article, so just think of an index as a shortcut to the record or records you desire. You can create an index on one or more columns or part of those columns. My physician's system can look up my records by the first three letters of my last name and birthdate. Using multiple columns requires using the most unique field first, then the second most unique, and so forth. An index on year-month-day works for year-month-day, year-month, and year searches, but it doesn't work for day, month-day, or year-day searches. It helps to design your indexes around how you want to use your data. - -### Histograms - -A histogram is a distribution of your data. If you were alphabetizing people by their last name, you could use a "logical bucket" for the folks with last names starting with the letters A to F, then another for G to J, and so forth. The optimizer assumes that the data is evenly distributed within the column, but this is rarely the case in practical use. - -MySQL provides two types of histograms: equal height, where all the data is divided equally among the buckets, and singleton, where a single value is in a bucket. You can have up to 1,024 buckets. The amount of buckets to choose for your data column depends on many factors, including how many distinct values you have, how skewed your data is, and how high your accuracy really needs to be. After a certain amount of buckets, there are diminishing returns. - -This command will create a histogram of 10 buckets on column c1 of table t: - - -``` -`ANALYZE TABLE t UPDATE HISTOGRAM ON c1 WITH 10 BUCKETS;` -``` - -Imagine you sell small, medium, and large socks, and each size has its own bin for storage. To find the size you need, you go to the bin for that size. MySQL has had histograms since MySQL 8.0 was released three years ago, yet they are not as well-known as indexes. Unlike indexes, there is no overhead for inserting, updating, or deleting a record. To update an index, an `ANALYZE TABLE` command must be updated. This is a good approach when the data does not churn very much and frequent changes to the data will reduce the efficiency. - -### Indexes or histograms? - -Use indexes for unique items where you need to access the data directly. There is overhead for updates, deletes, and inserts, but you get speedy access if your data is properly architected. Use histograms for data that does not get updated frequently, such as quarterly results for the last dozen years. - -### Parting thoughts - -This article grew out of a recent presentation at the [Open Source 101 conference][3]. And that presentation grew out of a workshop at a [PHP UK Conference][4]. Query tuning is a complex subject, and each time I present on indexes and histograms, I find ways to refine my presentation. But each presentation also shows that many folks in the software world are not well-versed on indexes and tend to use them incorrectly. Histograms have not been around long enough (I hope) to have been misused similarly. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/5/mysql-query-tuning - -作者:[Dave Stokes][a] -选题:[lujun9972][b] -译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/davidmstokes -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) -[2]: https://www.mysql.com/ -[3]: https://opensource101.com/ -[4]: https://www.phpconference.co.uk/ diff --git a/translated/tech/20210608 Tune your MySQL queries like a pro.md b/translated/tech/20210608 Tune your MySQL queries like a pro.md new file mode 100644 index 0000000000..1c2d999096 --- /dev/null +++ b/translated/tech/20210608 Tune your MySQL queries like a pro.md @@ -0,0 +1,105 @@ +[#]: subject: (Tune your MySQL queries like a pro) +[#]: via: (https://opensource.com/article/21/5/mysql-query-tuning) +[#]: author: (Dave Stokes https://opensource.com/users/davidmstokes) +[#]: collector: (lujun9972) +[#]: translator: (unigeorge) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如老手一般玩转 MySQL 查询 +====== +优化查询语句不过是一项简单的工程,而非什么高深的黑魔法。 +![woman on laptop sitting at the window][1] + +许多人将数据库查询语句的调优视作哈利波特小说中某种神秘的“黑魔法”;使用错误的咒语,数据就会从宝贵的资源变成一堆糊状物。 + +实际上,对关系数据库系统的查询调优是一项简单的工程,其遵循的规则或启发式方法很容易理解。查询优化器会将你发送的查询指令转换为 [MySQL][2] 实例,然后将这些启发式方法和优化器已知的数据信息结合使用,确定获取所请求数据的最佳方式。再读一下最后一部分:_“优化器已知的数据信息_。”查询优化器需要对数据所在位置的猜测越少(即已知信息越多),它就可以越好地制定交付数据的计划。 + +为了让优化器更好地了解数据,你可以考虑使用索引和直方图。正确使用索引和直方图可以大大提高数据库查询的速度。这就像如果你按照食谱做菜,就可以得到你喜欢吃的东西;但是假如你随意在该食谱中添加材料,最终得到的东西可能就不那么尽如人意了。 + +### 基于成本的优化器 + +大多数现代关系型数据库使用基于成本的优化器(cost-based optimizer)来确定如何从数据库中检索数据。该成本方案是基于尽可能减少非常耗费资源的磁盘读取过程。数据库服务器上的查询优化器代码会在遇到数据时保留有关获取该数据的统计信息,并构建获取数据所需时间的历史模型。 + +但历史数据是可能会过时的。这就好像你去商店买你最喜欢的零食,然后突然发现零食涨价或者商店关门了。服务器的优化进程可能会根据旧信息做出错误的假设,进而制定出低效的查询计划。 + +查询的复杂性可能会影响优化。优化器希望提供可用的最低成本查询方式。连接五个不同的表就意味着有 5 的阶乘即 120 种可能的连接顺序组合。代码中内置了启发式方法,以尝试对所有可能的选项进行快捷评估。 MySQL 每次看到查询时都希望生成一个新的查询计划,而其他数据库(例如 Oracle)则可以锁定查询计划。这就是向优化器提供有关数据的详细信息至关重要的原因。要想获得稳定的性能,在制定查询计划时为查询优化器提供最新信息确实很有效。 + +此外,优化器中内置的规则可能与数据的实际情况并不相符。没有更多有效信息的情况下,查询优化器会假设列中的所有数据均匀分布在所有行中。没有其他选择依据时,它会默认选择两个可能索引中较小的一个。虽然基于成本的优化器模型可以制定出很多好的决策,但最终查询计划并不是最佳方案的情况也是有可能的。 + +### 查询计划是神马? + +查询计划(query plan)是指优化器基于查询语句产生的,提供给服务器执行的计划内容。查看查询计划的方法是在查询语句前加上 `EXPLAIN` 关键字。例如,以下查询要从城市表(city)和相应的国家表(country)中获得城市名称(和所属国家名称),城市表和国家表通过国家唯一代码连接。本例中仅查询了英国的字母顺序前五名的城市: + +``` +SELECT city.name AS 'City', +               country.name AS 'Country' +FROM city +JOIN country ON (city.countrycode = country.code) +WHERE country.code = 'GBR' +LIMIT 5; +``` + +在查询语句前加上 `EXPLAIN` 可以看到优化器生成的查询计划。跳过除输出末尾之外的所有内容,可以看到优化后的查询: + +``` +SELECT `world`.`city`.`Name` AS `City`, +                'United Kingdom' AS `Country` +FROM `world`.`city` +JOIN `world`.`country` +WHERE (`world`.`city`.`CountryCode` = 'GBR') +LIMIT 5; +``` + +看下比较大的几个变化, `country.name as 'Country'` 改成了 `'United Kingdom' AS 'Country'`,`WHERE` 子句从在国家表中查找变成了在城市表中查找。优化器认为这两个改动会提供比原始查询更快的结果。 + +### 索引 + +在MySQL世界中,你会听到索引或键的概念。不过,索引是由键组成的,键是一种识别记录的方式,并且大概率是唯一的。如果将列设计为键,优化器可以搜索这些键的列表以找到所需的记录,而无需读取整个表。如果没有索引,服务器必须从第一列的第一行开始读取每一行数据。如果该列是作为唯一索引创建的,则服务器可以直接读取该行数据并忽略其余数据。索引的值(也称为基数)唯一性越强越好。请记住,我们在寻找更快获取数据的方法。 + +MySQL 默认的 InnoDB 存储引擎希望你的表有一个主键,并将通过该键将你的数据存储在 B+ 树中。不可见列是 MySQL 最近添加的功能——除非在查询中明确指明该不可见列,否则不会返回该列数据。例如,`SELECT * FROM foo;` 就不会返回任何不可见列。这个功能提供了一种向旧表添加主键的方法,且无需为了包含该新列而重写所有查询语句。 + +更复杂的是,有多种类型的索引,例如函数索引、空间索引和复合索引。甚至在某些情况下,你还可以创建这样一个索引:该索引可以为查询提供所有请求的信息,从而无需再去访问数据表。 + +本文不会详细讲解各种索引类型,你只需将索引看作指向要查询的数据记录的快捷方式。你可以在一个或多个列或这些列的一部分上创建索引。我的医师系统就可以通过我姓氏的前三个字母和出生日期来查找我的记录。使用多列时要注意首选唯一性最强的字段,然后是第二强的字段,依此类推。年-月-日的索引可用于年-月-日、年-月和年搜索,但不适用于日、月-日或年-日搜索。考虑这些因素有助于你围绕如何使用数据这一出发点来设计索引。 + +### 直方图 + +直方图就是数据的分布式。如果你将人名按其姓氏的字母顺序排序,就可以对姓氏以字母 A 到 F 开头的人放到一个“逻辑桶”中,然后将 G 到 J 开头的放到另一个中,依此类推。优化器会假定数据在列内均匀分布,但实际使用时多数情况并不是均匀的。 + +MySQL 提供两种类型的直方图:所有数据在桶中平均分配的等高型,以及单个值在单个桶中的等宽型。最多可以设置 1,024 个存储桶。 数据存储桶数量的选择取决于许多因素,包括去重后的数值量、数据倾斜度以及需要的结果准确度。如果桶的数量超过某个阈值,桶机制带来的收益就会开始递减。 + +以下命令将在表 t 的列 c1 上创建 10 个桶的直方图: + +``` +ANALYZE TABLE t UPDATE HISTOGRAM ON c1 WITH 10 BUCKETS; +``` + +想象一下你在售卖小号、中号和大号袜子,每种尺寸的袜子都放在单独的储物箱中。如果你想找某个尺寸的袜子,就可以直接去对应尺寸的箱子里找。MySQL 自从三年前发布 MySQL 8.0 以来就有了直方图功能,但该功能却并没有像索引那样广为人知。与索引不同,使用直方图插入、更新或删除记录都不会产生额外开销。而如果更新索引,就必须更新 `ANALYZE TABLE` 命令。 当数据变动不大并且频繁更改数据会降低效率时,直方图是一种很好的方法。 + +### 选择索引还是直方图? + +对需要直接访问的且具备唯一性的数据项目使用索引。虽然修改、删除和插入操作会产生额外开销,但如果数据架构正确,索引就可以方便你快速访问。对不经常更新的数据则建议使用直方图,例如过去十几年的季度结果。 + +### 结语 + +本文源于最近在 [Open Source 101 会议][3] 上的一次报告。报告的演示文稿源自 [PHP UK Conferenc][4] 的研讨会。查询调优是一个复杂的话题,每次我就索引和直方图作报告时,我都会找到新的可改进点。但是每次报告反馈也表明很多软件界中的人并不精通索引,并且时常使用错误。我想直方图大概由于出现时间较短,还没有出现像索引这种使用错误的情况。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/5/mysql-query-tuning + +作者:[Dave Stokes][a] +选题:[lujun9972][b] +译者:[unigeorge](https://github.com/unigeorge) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/davidmstokes +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://www.mysql.com/ +[3]: https://opensource101.com/ +[4]: https://www.phpconference.co.uk/ From e48779c9d6c535765182ca2d72cd715df8810b14 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 14 Aug 2021 18:46:21 +0800 Subject: [PATCH 044/290] Delete 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md --- ...ur Hardware Obsolete, Use Linux Instead.md | 109 ------------------ 1 file changed, 109 deletions(-) delete mode 100644 translated/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md diff --git a/translated/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/translated/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md deleted file mode 100644 index 96bbebb09e..0000000000 --- a/translated/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md +++ /dev/null @@ -1,109 +0,0 @@ -[#]: subject: (Windows 11 Makes Your Hardware Obsolete, Use Linux Instead!) -[#]: via: (https://news.itsfoss.com/windows-11-linux/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (zd200572) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Windows 11 让你的硬件过时,使用Linux代替吧! -====== - -Windows 11终于来了,我们并不完全对此感到兴奋, –-但它给许多电脑用户带来了问题。 - -我甚至不会讨论隐私方面或者它的设计选择。可是Windows 11要求更新的硬件,这会让你的旧电脑在某种程度上过时,没有好的理由,却强迫你升级新的硬件。 - -Windows 11的到来还有什么问题,有什么不好的? - -### 只有符合条件的设备才能获得Windows 11升级 - -首先,Windows 11有趣在添加了一个看起来不错的最低系统需求: - - * 1GHz双核64位处理器 - * 4GB内存 - * 64GB存储空间 - * 支持 UEFI 安全启动 - * 受信任的平台模块 (TPM) 版本 2.0 - * DirectX 12兼容显卡 - * 720P分辨率显示器 - - - -![][1] - -你可以在[微软官方网站][2]下载电脑健康状况检查应用检查你的系统是否有升级的资格。 - -过去十年内的大多数电脑能达到这些标准--但有一个陷阱。 - -硬件需要有一个TPM芯片,一些电脑和笔记本可能没有。幸运的是,您可能只需要从BIOS设置(包括安全引导支持)中启用它,就可以使你的PC符合条件。这里有一个[PCGamer][3]的向导可以帮你. - -技术上说,根据微软官方文档,Windows 11不支持比**Intel第8代和Ryzen3000系列**更老的处理器([AMD][4] | [Intel][5]). - -可是,有相当数量的电脑失去支持,你该怎么做? - -简单, [**2021年啦,换成Linux吧**][6],在Windows 10不再收到更新之前. 今年,在你的个人电脑上尝试Linux变得比任何时候更有意义。 - -### Windows 11安装需要网络连接 - -![][7] - -虽然我们不太清楚,但根据其系统要求规范,Windows 11安装过程中将要求用户有可连通的网络连接。 - -但是,Linux不需要这样. - -这只是其中一个[使用Linux而不是Windows][8]的好处 –-你可以完全的掌控操作系统。 - -### 没有32位支持 - -![][7] - -Windows 10确实是支持32位系统的,但是Windows 11终结了相关支持. - -这又是Linux的优势了。 - -尽管32位支持都在逐渐减少, 我们依然有一系列[**支持32位系统的Linux发行版**][9]. 或许你的32位电脑还能与Linux一起工作10年。 - -### Windows 10将在2025年结束支持 - -好吧,这是意料之外的,鉴于微软最初计划Windows 10是其最后一款独立发布的操作系统,这是出乎意料的。 - -现在,Windows 10将会在2025年被杀死… - -那么,我们该怎么做呢?升级你的硬件,只因为它不支持Windows 11? - -除非有这个必要,否则Linux是你永远的朋友。 - -你可以尝试几个[**轻量级Linux发行版**][10],它们将复活你的微软认为过时的电脑。 - -### 总结 - -尽管在未来几年Windows 11计划强迫用户升级他们的硬件,Linux将让你长时间继续使用你的硬件,并有额外的好处。 - -因此,如果你对Windows 11不满,你可能想开始使用Linux代替。不要烦恼,你可以参考我们主站的教程[FOSS][11]来学习开始使用Linux的一切! - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/windows-11-linux/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[zd200572](https://github.com/zd200572) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIyNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://www.microsoft.com/en-us/windows/windows-11 -[3]: https://www.pcgamer.com/Windows-11-PC-Health-Check/ -[4]: https://docs.microsoft.com/en-us/windows-hardware/design/minimum/supported/windows-11-supported-amd-processors -[5]: https://docs.microsoft.com/en-us/windows-hardware/design/minimum/supported/windows-11-supported-intel-processors -[6]: https://news.itsfoss.com/switch-to-linux-in-2021/ -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[8]: https://itsfoss.com/linux-better-than-windows/ -[9]: https://itsfoss.com/32-bit-linux-distributions/ -[10]: https://itsfoss.com/lightweight-linux-beginners/ -[11]: https://itsfoss.com From 6825e7f79d2cdc864b502316d05ca70a403888a1 Mon Sep 17 00:00:00 2001 From: Chunibyo Date: Sat, 14 Aug 2021 18:51:04 +0800 Subject: [PATCH 045/290] =?UTF-8?q?=E3=80=90PR=E3=80=91=E7=94=B3=E8=AF=B7?= =?UTF-8?q?=E7=BF=BB=E8=AF=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20200908 Deploy a deep learning model on Kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md b/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md index ca6d98438a..2fb0199735 100644 --- a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md +++ b/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (chunibyo-wly) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From eb49e323fea89de4fe81a9ec1fa5133c1f72c7d2 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 14 Aug 2021 18:52:13 +0800 Subject: [PATCH 046/290] Zd200572 patch 2 (#22895) * Update 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md * Update 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md * Update 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md * Update 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md * Rename sources/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md to translated/news/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md * Update 20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md * Update 20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md * Update and rename sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md to translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md * Update 20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md * Delete 20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md --- ...vailable to Test Bleeding Edge Features.md | 78 ------------------- ...vailable to Test Bleeding Edge Features.md | 74 ++++++++++++++++++ 2 files changed, 74 insertions(+), 78 deletions(-) delete mode 100644 sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md create mode 100644 translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md diff --git a/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md deleted file mode 100644 index a53778ce7e..0000000000 --- a/sources/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md +++ /dev/null @@ -1,78 +0,0 @@ -[#]: subject: (GNOME Web Canary is Now Available to Test Bleeding Edge Features) -[#]: via: (https://news.itsfoss.com/gnome-web-canary/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -GNOME Web Canary is Now Available to Test Bleeding Edge Features -====== - -Epiphany or [GNOME Web][1] is a minimal and yet capable browser for Linux distributions. You should find it as the default browser for elementary OS. - -With GNOME 40, the Epiphany browser has had some [improvements and additions][2]. - -Behind the scenes, it regularly gets some exciting improvements and feature additions. And for that, you can opt for the Tech Preview version of GNOME Web tailored for early testers. - -Now, a new Canary flavor has been introduced that you can use to test features that are not yet available even in the tech preview build. - -### GNOME Web Canary Flavor - -![][3] - -GNOME Web’s “Canary” builds let you test features that are not even available in the latest [WebKitGTK][4] version. - -Do note that the canary builds are supposed to be extremely unstable, even worse than the development builds available as a tech preview. - -However, with the help of a Canary build, an end-user can test things way early in the process of development that can help find disastrous bugs. - -Not just limited to end-user early testing, a canary build also makes things easier for a GNOME Web developer. - -They no longer have to build WebKitGTK separately in order to implement and test a new feature. - -Even though there was a Flatpak SDK available to ease the process for developers, it was still a time-consuming task. - -Now, with that out of the way, the development pace can potentially improve as well. - -### How to Get the Canary Build? - -First, you need to add the WebKit SDK Flatpak remote using the commands below: - -``` -flatpak --user remote-add --if-not-exists webkit https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo -flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref -``` - -Once done, you can install the Canary by using the [Flatpakref file][5] provided. - -Testing a Canary build gives more users the ability to help GNOME Web developers in the process. So, it is definitely a much-needed addition to improve the development of the GNOME Web browser. - -For more technical details, you might want to take a look at the [announcement post][6] by one of the developers. - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/gnome-web-canary/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://wiki.gnome.org/Apps/Web/ -[2]: https://news.itsfoss.com/gnome-web-new-tab/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY0MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://webkitgtk.org -[5]: https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref -[6]: https://base-art.net/Articles/introducing-the-gnome-web-canary-flavor/ diff --git a/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md new file mode 100644 index 0000000000..e5177a5d50 --- /dev/null +++ b/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md @@ -0,0 +1,74 @@ +[#]: subject: (GNOME Web Canary is Now Available to Test Bleeding Edge Features) +[#]: via: (https://news.itsfoss.com/gnome-web-canary/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (zd200572) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +GNOME Web Canary现在可用于测试前沿功能 +====== + +Epiphany或[GNOME Web][1]是一个Linux发行版上最小但功能强大的浏览器,你会发现它是elementary OS的默认浏览器。 + +使用GNOME40,Epiphany浏览器有一些[改进和新增功能][2]。 + +在幕后,经常有许多令人兴奋的提升和新增特性。因此,你可以选择为早期测试人员量身定制的GNOME Web技术预览版。 + +现在,一个新的Canary版本发布了,你可以使用它来测试甚至在技术预览版中都没有的特性。 + +### GNOME Web Canary版本 + +![][3] + +GNOME Web的“Canary”版本允许你测试甚至没有出现在最新[WebKitGTK][4]版本中的特性。 + +注意Canary版本应该是极其不稳定的,甚至稳定性比开发者技术预览版更差。 + +可是,使用Canary版本, 一个终端用户可以在开发过程中的早期进行测试,帮助开发者发现灾难性bugs。 + +不只是终端用户的早期测试,Canary版本还让GNOME Web开发者的工作更轻松。 + +他们不再需要为了实现和测试一个新特性,来单独构建WebKitGTK。 + +尽管开发者有一个Flatpak SDK可以简化开发人员的流程,但是这仍然是一项耗时的任务。 + +现在,没有了这个阻碍,开发速度也有可能提升。 + +### 怎样获得Canary版本? + +首先,你需要使用以下命令添加WebKit SDK Flatpak remote: + +``` +flatpak --user remote-add --if-not-exists webkit https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo +flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref +``` + +一旦完成,你就可以使用提供的[Flatpakref文件][5]安装啦! + +测试一个Canary版本让更多的用户能够在此过程中帮助GNOME Web开发者的开发人员。所以,这绝对是改进GNOME Web浏览器开发的急需补充。 + +更多技术细节,你可能需要看一位开发者中发布的[公告][6]。 + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-web-canary/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[zd200572](https://github.com/zd200572) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.gnome.org/Apps/Web/ +[2]: https://news.itsfoss.com/gnome-web-new-tab/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY0MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://webkitgtk.org +[5]: https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref +[6]: https://base-art.net/Articles/introducing-the-gnome-web-canary-flavor/ From 805eced31c1eb432cc3e41af3727be6dc358fe38 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Sat, 14 Aug 2021 21:43:25 +0800 Subject: [PATCH 047/290] translating by perfiffer --- sources/tech/20210804 Install OpenVPN on your Linux PC.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210804 Install OpenVPN on your Linux PC.md b/sources/tech/20210804 Install OpenVPN on your Linux PC.md index d897ea8e86..4e6a5efeda 100644 --- a/sources/tech/20210804 Install OpenVPN on your Linux PC.md +++ b/sources/tech/20210804 Install OpenVPN on your Linux PC.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/7/openvpn-router" [#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From c8180d6e1d80a0eb0b0068a32f882df980c01b25 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 15 Aug 2021 09:59:55 +0800 Subject: [PATCH 048/290] PRF&PUB @zd200572 https://linux.cn/article-13683-1.html --- ...vailable to Test Bleeding Edge Features.md | 76 +++++++++++++++++++ ...vailable to Test Bleeding Edge Features.md | 74 ------------------ 2 files changed, 76 insertions(+), 74 deletions(-) create mode 100644 published/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md delete mode 100644 translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md diff --git a/published/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/published/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md new file mode 100644 index 0000000000..497171d122 --- /dev/null +++ b/published/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md @@ -0,0 +1,76 @@ +[#]: subject: (GNOME Web Canary is Now Available to Test Bleeding Edge Features) +[#]: via: (https://news.itsfoss.com/gnome-web-canary/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (zd200572) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13683-1.html) + +使用 GNOME Web 的 Canary 版本测试前沿功能 +====== + +> 如果你想测试高度不稳定的 GNOME Web 浏览器的前沿功能,Canary 版本就是为了这个。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/gnome-web-canary.png?w=1200&ssl=1) + +Epiphany(或称 [GNOME Web][1])是一个 Linux 发行版上精简而功能强大的浏览器,你会发现它也是 elementary OS 的默认浏览器。 + +随同 GNOME 40 发布的 Epiphany 浏览器有一些 [改进和新增功能][2]。 + +而在幕后,经常有许多令人兴奋的提升和新增特性。因此,你可以选择为早期测试人员量身定制的 GNOME Web 技术预览版。 + +现在,它发布了一个新的 Canary 版本,你可以使用它来测试甚至在技术预览版中都没有的特性。 + +### GNOME Web Canary 版本 + +![][3] + +GNOME Web 的 Canary 版本允许你测试甚至没有出现在最新 [WebKitGTK][4] 版本中的特性。 + +注意 Canary 版本应该是极其不稳定的,甚至稳定性比开发者技术预览版更差。 + +可是,使用 Canary 版本,终端用户可以在开发过程中的早期进行测试,帮助开发者发现灾难性 bug。 + +不只是终端用户的早期测试,Canary 版本还让 GNOME Web 的开发者的工作更轻松。 + +他们不再需要为了实现和测试一个新特性,来单独构建 WebKitGTK。 + +尽管开发者有一个 Flatpak SDK 可以简化开发人员的流程,但是这仍然是一项耗时的任务。 + +现在,没有了这个阻碍,开发速度也有可能提升。 + +### 怎样获得 Canary 版本? + +首先,你需要使用以下命令添加 WebKit SDK Flatpak 远端仓库: + +``` +flatpak --user remote-add --if-not-exists webkit https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo +flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref +``` + +完成后,你就可以使用提供的 [Flatpakref 文件][5] 安装啦! + +测试 Canary 版本可以让更多的用户能够在此过程中帮助 GNOME Web 的开发人员。所以,这绝对是改进 GNOME Web 浏览器开发的急需补充。 + +更多技术细节,你可能需要看这位开发者发布的 [公告][6]。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-web-canary/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[zd200572](https://github.com/zd200572) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://wiki.gnome.org/Apps/Web/ +[2]: https://news.itsfoss.com/gnome-web-new-tab/ +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/Epiphany-Canary.png?w=940&ssl=1 +[4]: https://webkitgtk.org +[5]: https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref +[6]: https://base-art.net/Articles/introducing-the-gnome-web-canary-flavor/ diff --git a/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md deleted file mode 100644 index e5177a5d50..0000000000 --- a/translated/news/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md +++ /dev/null @@ -1,74 +0,0 @@ -[#]: subject: (GNOME Web Canary is Now Available to Test Bleeding Edge Features) -[#]: via: (https://news.itsfoss.com/gnome-web-canary/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (zd200572) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -GNOME Web Canary现在可用于测试前沿功能 -====== - -Epiphany或[GNOME Web][1]是一个Linux发行版上最小但功能强大的浏览器,你会发现它是elementary OS的默认浏览器。 - -使用GNOME40,Epiphany浏览器有一些[改进和新增功能][2]。 - -在幕后,经常有许多令人兴奋的提升和新增特性。因此,你可以选择为早期测试人员量身定制的GNOME Web技术预览版。 - -现在,一个新的Canary版本发布了,你可以使用它来测试甚至在技术预览版中都没有的特性。 - -### GNOME Web Canary版本 - -![][3] - -GNOME Web的“Canary”版本允许你测试甚至没有出现在最新[WebKitGTK][4]版本中的特性。 - -注意Canary版本应该是极其不稳定的,甚至稳定性比开发者技术预览版更差。 - -可是,使用Canary版本, 一个终端用户可以在开发过程中的早期进行测试,帮助开发者发现灾难性bugs。 - -不只是终端用户的早期测试,Canary版本还让GNOME Web开发者的工作更轻松。 - -他们不再需要为了实现和测试一个新特性,来单独构建WebKitGTK。 - -尽管开发者有一个Flatpak SDK可以简化开发人员的流程,但是这仍然是一项耗时的任务。 - -现在,没有了这个阻碍,开发速度也有可能提升。 - -### 怎样获得Canary版本? - -首先,你需要使用以下命令添加WebKit SDK Flatpak remote: - -``` -flatpak --user remote-add --if-not-exists webkit https://software.igalia.com/flatpak-refs/webkit-sdk.flatpakrepo -flatpak --user install https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref -``` - -一旦完成,你就可以使用提供的[Flatpakref文件][5]安装啦! - -测试一个Canary版本让更多的用户能够在此过程中帮助GNOME Web开发者的开发人员。所以,这绝对是改进GNOME Web浏览器开发的急需补充。 - -更多技术细节,你可能需要看一位开发者中发布的[公告][6]。 - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/gnome-web-canary/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[zd200572](https://github.com/zd200572) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://wiki.gnome.org/Apps/Web/ -[2]: https://news.itsfoss.com/gnome-web-new-tab/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY0MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://webkitgtk.org -[5]: https://nightly.gnome.org/repo/appstream/org.gnome.Epiphany.Canary.flatpakref -[6]: https://base-art.net/Articles/introducing-the-gnome-web-canary-flavor/ From 3059e936f77abd251f3fb82e4b25ecefbd70ae51 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 15 Aug 2021 11:02:00 +0800 Subject: [PATCH 049/290] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @unigeorge 感谢您,完成了第一篇翻译贡献! --- ...0608 Tune your MySQL queries like a pro.md | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/translated/tech/20210608 Tune your MySQL queries like a pro.md b/translated/tech/20210608 Tune your MySQL queries like a pro.md index 1c2d999096..7ec70af50c 100644 --- a/translated/tech/20210608 Tune your MySQL queries like a pro.md +++ b/translated/tech/20210608 Tune your MySQL queries like a pro.md @@ -3,34 +3,36 @@ [#]: author: (Dave Stokes https://opensource.com/users/davidmstokes) [#]: collector: (lujun9972) [#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13684-1.html) 如老手一般玩转 MySQL 查询 ====== -优化查询语句不过是一项简单的工程,而非什么高深的黑魔法。 -![woman on laptop sitting at the window][1] + +> 优化查询语句不过是一项简单的工程,而非什么高深的黑魔法。 + +![](https://img.linux.net.cn/data/attachment/album/202108/15/104728m3e3wefi3bq3qn34.jpg) 许多人将数据库查询语句的调优视作哈利波特小说中某种神秘的“黑魔法”;使用错误的咒语,数据就会从宝贵的资源变成一堆糊状物。 -实际上,对关系数据库系统的查询调优是一项简单的工程,其遵循的规则或启发式方法很容易理解。查询优化器会将你发送的查询指令转换为 [MySQL][2] 实例,然后将这些启发式方法和优化器已知的数据信息结合使用,确定获取所请求数据的最佳方式。再读一下最后一部分:_“优化器已知的数据信息_。”查询优化器需要对数据所在位置的猜测越少(即已知信息越多),它就可以越好地制定交付数据的计划。 +实际上,对关系数据库系统的查询调优是一项简单的工程,其遵循的规则或启发式方法很容易理解。查询优化器会翻译你发送给 [MySQL][2] 实例的查询指令,然后将这些启发式方法和优化器已知的数据信息结合使用,确定获取所请求数据的最佳方式。再读一下后面这半句:_“优化器已知的数据信息_。”查询优化器需要对数据所在位置的猜测越少(即已知信息越多),它就可以越好地制定交付数据的计划。 为了让优化器更好地了解数据,你可以考虑使用索引和直方图。正确使用索引和直方图可以大大提高数据库查询的速度。这就像如果你按照食谱做菜,就可以得到你喜欢吃的东西;但是假如你随意在该食谱中添加材料,最终得到的东西可能就不那么尽如人意了。 ### 基于成本的优化器 -大多数现代关系型数据库使用基于成本的优化器(cost-based optimizer)来确定如何从数据库中检索数据。该成本方案是基于尽可能减少非常耗费资源的磁盘读取过程。数据库服务器上的查询优化器代码会在遇到数据时保留有关获取该数据的统计信息,并构建获取数据所需时间的历史模型。 +大多数现代关系型数据库使用基于成本的优化器cost-based optimizer来确定如何从数据库中检索数据。该成本方案是基于尽可能减少非常耗费资源的磁盘读取过程。数据库服务器内的查询优化器代码会在得到数据时对这些数据的获取进行统计,并构建一个获取数据的历史模型。 但历史数据是可能会过时的。这就好像你去商店买你最喜欢的零食,然后突然发现零食涨价或者商店关门了。服务器的优化进程可能会根据旧信息做出错误的假设,进而制定出低效的查询计划。 -查询的复杂性可能会影响优化。优化器希望提供可用的最低成本查询方式。连接五个不同的表就意味着有 5 的阶乘即 120 种可能的连接顺序组合。代码中内置了启发式方法,以尝试对所有可能的选项进行快捷评估。 MySQL 每次看到查询时都希望生成一个新的查询计划,而其他数据库(例如 Oracle)则可以锁定查询计划。这就是向优化器提供有关数据的详细信息至关重要的原因。要想获得稳定的性能,在制定查询计划时为查询优化器提供最新信息确实很有效。 +查询的复杂性可能会影响优化。优化器希望提供可用的最低成本查询方式。连接五个不同的表就意味着有 5 的阶乘(即 120)种可能的连接组合。代码中内置了启发式方法,以尝试对所有可能的选项进行快捷评估。MySQL 每次看到查询时都希望生成一个新的查询计划,而其他数据库(例如 Oracle)则可以锁定查询计划。这就是向优化器提供有关数据的详细信息至关重要的原因。要想获得稳定的性能,在制定查询计划时为查询优化器提供最新信息确实很有效。 此外,优化器中内置的规则可能与数据的实际情况并不相符。没有更多有效信息的情况下,查询优化器会假设列中的所有数据均匀分布在所有行中。没有其他选择依据时,它会默认选择两个可能索引中较小的一个。虽然基于成本的优化器模型可以制定出很多好的决策,但最终查询计划并不是最佳方案的情况也是有可能的。 -### 查询计划是神马? +### 查询计划是什么? -查询计划(query plan)是指优化器基于查询语句产生的,提供给服务器执行的计划内容。查看查询计划的方法是在查询语句前加上 `EXPLAIN` 关键字。例如,以下查询要从城市表(city)和相应的国家表(country)中获得城市名称(和所属国家名称),城市表和国家表通过国家唯一代码连接。本例中仅查询了英国的字母顺序前五名的城市: +查询计划query plan是指优化器基于查询语句产生的,提供给服务器执行的计划内容。查看查询计划的方法是在查询语句前加上 `EXPLAIN` 关键字。例如,以下查询要从城市表(`city`)和相应的国家表(`country`)中获得城市名称(和所属国家名称),城市表和国家表通过国家唯一代码连接。本例中仅查询了英国的字母顺序前五名的城市: ``` SELECT city.name AS 'City', @@ -56,27 +58,27 @@ LIMIT 5; ### 索引 -在MySQL世界中,你会听到索引或键的概念。不过,索引是由键组成的,键是一种识别记录的方式,并且大概率是唯一的。如果将列设计为键,优化器可以搜索这些键的列表以找到所需的记录,而无需读取整个表。如果没有索引,服务器必须从第一列的第一行开始读取每一行数据。如果该列是作为唯一索引创建的,则服务器可以直接读取该行数据并忽略其余数据。索引的值(也称为基数)唯一性越强越好。请记住,我们在寻找更快获取数据的方法。 +在 MySQL 世界中,你会听到索引或键的概念。不过,索引是由键组成的,键是一种识别记录的方式,并且大概率是唯一的。如果将列设计为键,优化器可以搜索这些键的列表以找到所需的记录,而无需读取整个表。如果没有索引,服务器必须从第一列的第一行开始读取每一行数据。如果该列是作为唯一索引创建的,则服务器可以直接读取该行数据并忽略其余数据。索引的值(也称为基数)唯一性越强越好。请记住,我们在寻找更快获取数据的方法。 -MySQL 默认的 InnoDB 存储引擎希望你的表有一个主键,并将通过该键将你的数据存储在 B+ 树中。不可见列是 MySQL 最近添加的功能——除非在查询中明确指明该不可见列,否则不会返回该列数据。例如,`SELECT * FROM foo;` 就不会返回任何不可见列。这个功能提供了一种向旧表添加主键的方法,且无需为了包含该新列而重写所有查询语句。 +MySQL 默认的 InnoDB 存储引擎希望你的表有一个主键,并按照该键将你的数据存储在 B+ 树中。“不可见列”是 MySQL 最近添加的功能,除非在查询中明确指明该不可见列,否则不会返回该列数据。例如,`SELECT * FROM foo;` 就不会返回任何不可见列。这个功能提供了一种向旧表添加主键的方法,且无需为了包含该新列而重写所有查询语句。 更复杂的是,有多种类型的索引,例如函数索引、空间索引和复合索引。甚至在某些情况下,你还可以创建这样一个索引:该索引可以为查询提供所有请求的信息,从而无需再去访问数据表。 -本文不会详细讲解各种索引类型,你只需将索引看作指向要查询的数据记录的快捷方式。你可以在一个或多个列或这些列的一部分上创建索引。我的医师系统就可以通过我姓氏的前三个字母和出生日期来查找我的记录。使用多列时要注意首选唯一性最强的字段,然后是第二强的字段,依此类推。年-月-日的索引可用于年-月-日、年-月和年搜索,但不适用于日、月-日或年-日搜索。考虑这些因素有助于你围绕如何使用数据这一出发点来设计索引。 +本文不会详细讲解各种索引类型,你只需将索引看作指向要查询的数据记录的快捷方式。你可以在一个或多个列或这些列的一部分上创建索引。我的医师系统就可以通过我姓氏的前三个字母和出生日期来查找我的记录。使用多列时要注意首选唯一性最强的字段,然后是第二强的字段,依此类推。“年-月-日”的索引可用于“年-月-日”、“年-月”和“年”搜索,但不适用于“日”、“月-日”或“年-日”搜索。考虑这些因素有助于你围绕如何使用数据这一出发点来设计索引。 ### 直方图 -直方图就是数据的分布式。如果你将人名按其姓氏的字母顺序排序,就可以对姓氏以字母 A 到 F 开头的人放到一个“逻辑桶”中,然后将 G 到 J 开头的放到另一个中,依此类推。优化器会假定数据在列内均匀分布,但实际使用时多数情况并不是均匀的。 +直方图就是数据的分布形式。如果你将人名按其姓氏的字母顺序排序,就可以对姓氏以字母 A 到 F 开头的人放到一个“逻辑桶”中,然后将 G 到 J 开头的放到另一个中,依此类推。优化器会假定数据在列内均匀分布,但实际使用时多数情况并不是均匀的。 -MySQL 提供两种类型的直方图:所有数据在桶中平均分配的等高型,以及单个值在单个桶中的等宽型。最多可以设置 1,024 个存储桶。 数据存储桶数量的选择取决于许多因素,包括去重后的数值量、数据倾斜度以及需要的结果准确度。如果桶的数量超过某个阈值,桶机制带来的收益就会开始递减。 +MySQL 提供两种类型的直方图:所有数据在桶中平均分配的等高型,以及单个值在单个桶中的等宽型。最多可以设置 1,024 个存储桶。数据存储桶数量的选择取决于许多因素,包括去重后的数值量、数据倾斜度以及需要的结果准确度。如果桶的数量超过某个阈值,桶机制带来的收益就会开始递减。 -以下命令将在表 t 的列 c1 上创建 10 个桶的直方图: +以下命令将在表 `t` 的列 `c1` 上创建 10 个桶的直方图: ``` ANALYZE TABLE t UPDATE HISTOGRAM ON c1 WITH 10 BUCKETS; ``` -想象一下你在售卖小号、中号和大号袜子,每种尺寸的袜子都放在单独的储物箱中。如果你想找某个尺寸的袜子,就可以直接去对应尺寸的箱子里找。MySQL 自从三年前发布 MySQL 8.0 以来就有了直方图功能,但该功能却并没有像索引那样广为人知。与索引不同,使用直方图插入、更新或删除记录都不会产生额外开销。而如果更新索引,就必须更新 `ANALYZE TABLE` 命令。 当数据变动不大并且频繁更改数据会降低效率时,直方图是一种很好的方法。 +想象一下你在售卖小号、中号和大号袜子,每种尺寸的袜子都放在单独的储物箱中。如果你想找某个尺寸的袜子,就可以直接去对应尺寸的箱子里找。MySQL 自从三年前发布 MySQL 8.0 以来就有了直方图功能,但该功能却并没有像索引那样广为人知。与索引不同,使用直方图插入、更新或删除记录都不会产生额外开销。而如果更新索引,就必须更新 `ANALYZE TABLE` 命令。当数据变动不大并且频繁更改数据会降低效率时,直方图是一种很好的方法。 ### 选择索引还是直方图? @@ -93,7 +95,7 @@ via: https://opensource.com/article/21/5/mysql-query-tuning 作者:[Dave Stokes][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cf688852dce2964d8538cc7c32aebce3872639fc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 15 Aug 2021 11:02:55 +0800 Subject: [PATCH 050/290] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @unigeorge 本文首发:https://linux.cn/article-13684-1.html 您的 LCTT 专页:https://linux.cn/lctt/unigeorge --- .../20210608 Tune your MySQL queries like a pro.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20210608 Tune your MySQL queries like a pro.md (100%) diff --git a/translated/tech/20210608 Tune your MySQL queries like a pro.md b/published/20210608 Tune your MySQL queries like a pro.md similarity index 100% rename from translated/tech/20210608 Tune your MySQL queries like a pro.md rename to published/20210608 Tune your MySQL queries like a pro.md From 4dabde10e7f64b4c5d4b056d6f05f9c098cea5ff Mon Sep 17 00:00:00 2001 From: imgradeone <30969327+imgradeone@users.noreply.github.com> Date: Sun, 15 Aug 2021 15:26:18 +0800 Subject: [PATCH 051/290] Update 20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md --- ...mportant You Need to Know About This -Gaming Distribution.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md b/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md index 7e223b6a0c..0251d0e5a8 100644 --- a/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md +++ b/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/steamos/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "imgradeone" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 90fcaa78eb50568445592357f2530a49d2516c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Sun, 15 Aug 2021 16:41:35 +0800 Subject: [PATCH 052/290] translated --- ...to Know About This -Gaming Distribution.md | 116 +++++++++--------- 1 file changed, 58 insertions(+), 58 deletions(-) diff --git a/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md b/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md index 0251d0e5a8..e4d7bc1927 100644 --- a/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md +++ b/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md @@ -7,112 +7,112 @@ [#]: publisher: " " [#]: url: " " -What is SteamOS? Everything Important You Need to Know About This “Gaming Distribution” +SteamOS 是什么?关于这款“游戏发行版”你所要知道的事 ====== -SteamOS is a Linux-based operating system that aims to provide a seamless gaming experience from Steam’s own game store. +SteamOS 是一款基于 Linux 的操作系统,旨在提供来自 Steam 平台自身的无缝游戏体验。 -While it has been in existence for about a decade now, there are a few things that you should know about it. +虽然它已经存在了许久,但有几件事你应该知道。 -In this article, we try to address most of the common questions regarding SteamOS. +在这篇文章中,我们将回答许多 SteamOS 相关的常见问题。 -### What is SteamOS? +### SteamOS 是什么? -SteamOS is a Linux distribution from the game distribution platform Steam. It is not a generic desktop operating system like Debian, Linux Mint or Ubuntu though you could use the desktop features. By default, SteamOS gives you a console like interface because SteamOS is intended to be the operating system on Steam devices like Steam Machine (discontinued) and Steam Deck. +SteamOS 是由游戏分发平台 Steam 开发的 Linux 发行版。它并是一款像 Debian、Linux Mint 或者 Ubuntu 那样的泛用型桌面操作系统,即便你确实可以使用桌面功能。默认情况下,SteamOS 的界面类似于游戏主机,因为 SteamOS 旨在成为专为 Steam 游戏设备(如 Steam Machine(已停产)和 Steam Deck)定制的操作系统。 -![SteamOS interface][1] +![SteamOS 界面][1] -While you can install the Steam game client on any Linux distribution and other platforms, SteamOS was developed to provide a console-like experience to play games from the Steam store. +你确实也可以在任何 Linux 发行版和其他平台安装 Steam 客户端,但 SteamOS 更是为了提供类似游戏主机的体验,方便你玩 Steam 上的游戏。 -### Which Linux distribution SteamOS is based on? +### SteamOS 基于哪个 Linux 发行版? -SteamOS is a Linux-based operating system originally based on Debian 8. With Valve’s new [Steam Deck][2] handheld gaming device, SteamOS’s latest version (SteamOS 3.0) uses Arch Linux as its base because of its rolling-release update schedule. +作为基于 Linux 的系统,SteamOS 最初基于 Debian 8 开发。随着 Valve 的全新 [Steam Deck][2] 掌机发布,SteamOS 的最新版本(SteamOS 3.0)将基于 Arch Linux 开发,因为 Arch 支持滚动更新。 -The developers believe that Arch Linux as a base for SteamOS is useful to push quick updates and optimize SteamOS for Steam Deck. +SteamOS 的开发团队也相信,SteamOS 基于 Arch Linux 更有利于快速推送更新和优化 Steam Deck。 ![][3] -### System requirements for SteamOS +### SteamOS 的系统要求 -Ideally, any machine with the following minimum requirements should work: +理想情况下,符合以下最低要求的设备都应该可以正常运行 SteamOS: - * Intel or AMD 64-bit capable processor - * 4GB or more memory - * 250GB or larger disk - * NVIDIA, Intel, or AMD graphics card - * USB port or DVD drive for installation + * Intel / AMD 的 64 位 CPU + * 4GB 或更高的运行内存(RAM) + * 250GB 或更大的磁盘 + * NVIDIA / Intel / AMD 的显卡 + * 用于安装介质的 USB 或者 DVD +(LCTT 译注:本段内容仅针对 SteamOS 2.0。) +### SteamOS 能否在你的电脑上正常运作? -### Will SteamOS Work on your PC? +SteamOS(2.0 版本)内置了支持特定硬件的驱动程序。 -SteamOS (version 2.0) comes with drivers and chipsets that support a specific set of hardware. +理论上 SteamOS 可以在任何电脑上运行,但目前官方并没有支持最新的硬件。 -It should theoretically work on every PC, but there’s no official support for the latest and greatest hardware. +### SteamOS 只是另外一款 Linux 发行版吗? -### Is SteamOS just another Linux distribution? +SteamOS 严格来说已经是现有的 [适合游戏的 Linux 发行版][4] 之一。但与其他发行版不同的是,SteamOS 并不是为了泛用型桌面而设计的。你确实可以安装 Linux 程序,但 SteamOS 支持的软件包极为有限。 -SteamOS is technically one of the [gaming Linux distributions][4] available. But, unlike some others, it is not meant for a full-fledged desktop experience. While you have the ability to install Linux applications, it supports a limited number of packages. +总之,它并不适合替代普通 Linux 桌面系统。 -In short, it is not suitable to replace a desktop Linux OS. +### SteamOS 现在还在积极维护中吗? -### Is Steam OS Actively Maintained? +**是**,但又**不是**。 -**Yes** and **No.** +SteamOS 基于 Debian 8 许久,目前没有任何更新。 -SteamOS is based on Debian 8 for a long time now with no updates whatsoever. +如果你正期望将 SteamOS 安装到你的个人设备上,那么目前公开发布的版本(SteamOS 2.0)已经处于不再维护的状态。 -So, if you are looking to install it on your personal machine, the version available to the public (SteamOS 2.0) is not actively maintained. +不过,Valve 目前正在为 Steam Deck 维护 SteamOS 3.0。因此,可能不久 SteamOS 就可以用于你的桌面了。 -However, Valve is actively working on SteamOS 3.0 for its Steam Deck hardware. Hence, there is a possibility that you should find it available soon enough for your desktop. +### 你是否推荐使用 SteamOS 来玩电脑游戏吗? -### Should You Prefer SteamOS for PC Gaming? +**不推荐。**在 Windows 和其它 Linux 发行版面前,SteamOS 并不是你应该选择的替代品。 -**No.** SteamOS is not a proper replacement for Windows or other Linux distributions. +虽然 SteamOS 主要是为游戏定制的,但在拿它玩游戏之前,你还需要了解许多注意事项。 -While it was primarily tailored to play games, there are many caveats to know before you proceed. +### 所有游戏都可以在 SteamOS 上玩吗? -### Do all games work on SteamOS? +**不。**SteamOS 需要依赖 Proton 兼容层才能让 Windows 平台的游戏正常运行。 -**No.** SteamOS relies on the Proton compatibility layer to make most of the Windows-exclusive games work. +当然,如今借助同样的底层技术,[在 Linux 里玩游戏][5] 已经成为了可能,但至少在我写这篇文章时,你并不能让 Steam 上架的所有游戏都可以在 Linux 中运行。 -Of course, [Gaming on Linux][5] has been made possible with the same underlying tech, but at the time of writing this, you cannot make all the games available in Steam work with it. +虽然大部分游戏都可以运行,但这并不意味着你游戏库里的所有游戏都能正常游玩。 -Even though many games should work on it, that does not guarantee that all games you have in your library will work as expected. +如果你想玩 Steam 支持的游戏,以及仅限 Linux 平台的游戏,那还是值得一试的。 -If you are looking to play supported games and Linux-only games, you can consider trying it. +### SteamOS 是否开源? -### Is SteamOS open source? +**是的**(SteamOS 2.0)。 -**Yes** (SteamOS 2.0). +SteamOS 操作系统是开源的,你可以在 [官方仓库][6] 中找到源码。 -The operating system is open-source, and you can find the source code in its [official repo][6]. +不过,你用来玩游戏的 Steam 客户端是专有的。 -But, the Steam client that you will be using on it is proprietary. +值得注意的是,SteamOS 3.0 目前仍处于开发阶段,因此你无法获得它的源代码和任何公开进展。 -It is worth noting that SteamOS 3.0 is still a work in progress. So, you cannot find the source code or any progress of it available to the public. +### SteamOS 是否免费使用? -### Is SteamOS free to use? +目前你暂时无法找到可供公众使用的最新版 SteamOS,但它基本上是免费的。基于 Debian 的旧版 SteamOS 可在其 [官方网站][7] 上获取。 -You won’t find the new SteamOS version available to the public yet, but it is essentially free to use. The older version based on Debian is available to download from the [official site][7]. +### 我能找到内置 SteamOS 的游戏主机吗? -### Can I find a gaming system with SteamOS built in? +![Steam Machine 主机,已经停产][8] -![Steam Machine console has been doscontinued][8] +SteamOS 最初是为 Steam Machine 这款 Steam 自家的 PlayStation/Xbox 风格主机定制的操作系统。2015 年 Steam Machine 发布后并没有在市场上获得成功,最终停产。 -SteamOS was originally created to be the operating system on Steam’s very own PlayStation/Xbox styled console called Steam Machine. Released around 2015, Steam Machine did not see much success and was eventually discontinued. +目前,唯一一款预装 SteamOS 的设备是备受瞩目的 Steam Deck。 -Now the only device to feature SteamOS is the much-anticipated Steam Deck. +待到 SteamOS 开放针对其它设备的下载后,你就可以看到有硬件厂商销售预装 SteamOS 的游戏设备了。 -If SteamOS is available to download for other hardware, you may see commercial choices to have SteamOS pre-installed with a gaming machine. +但,至少目前来看,你不应该相信任何不知名的制造商提供开箱即用的 SteamOS。 -But, for now, you should not believe any claims by unknown manufacturers to offer SteamOS out of the box. +### 下一代 SteamOS 能否使 Linux 成为游戏的可行选择? -### Will Next-gen SteamOS Make Linux a Viable Choice for Gaming? +是的,绝对是的。 -Absolutely. Yes. - -Linux may not be the recommended choice for gamers out there. You can explore if [we recommend Linux for gaming][9]. Still, if SteamOS evolves to support every game for its Steam Deck hardware, desktop Linux users can finally experience all unsupported Steam games. +Linux 可能不是外界所推荐的游戏选择,但如果你乐意的话,你也可以查看 [我们所推荐的 Linux 游戏发行版][9]。最后,如果 SteamOS 下了狠心,让每款游戏都能在 Steam Deck 上运行,那么桌面 Linux 用户也将终于可以体验到所有曾经不支持的 Steam 游戏了。 -------------------------------------------------------------------------------- @@ -120,19 +120,19 @@ via: https://itsfoss.com/steamos/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[imgradeone](https://github.com/imgradeone) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://itsfoss.com/author/ankush/ [b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/steamos.jpg?resize=800%2C450&ssl=1 +[1]: https://itsfoss.com/wp-content/uploads/2021/08/steamos.jpg [2]: https://www.steamdeck.com/en/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/steam-deck.jpg?resize=800%2C479&ssl=1 +[3]: https://itsfoss.com/wp-content/uploads/2021/08/steam-deck.jpg [4]: https://itsfoss.com/linux-gaming-distributions/ [5]: https://itsfoss.com/linux-gaming-guide/ [6]: https://repo.steampowered.com/steamos/ [7]: https://store.steampowered.com/steamos/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/valves-steam-machine.jpg?resize=800%2C441&ssl=1 +[8]: https://itsfoss.com/wp-content/uploads/2021/08/valves-steam-machine.jpg [9]: https://news.itsfoss.com/linux-for-gaming-opinion/ From 3218611307b91b63fd3d16e1e0a9e717faaaf06c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Sun, 15 Aug 2021 16:42:13 +0800 Subject: [PATCH 053/290] move file --- ... Important You Need to Know About This -Gaming Distribution.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md (100%) diff --git a/sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md b/translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md similarity index 100% rename from sources/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md rename to translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md From 90364dc39d8de94edc107354d8c70b0e457277a0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 16 Aug 2021 05:05:42 +0800 Subject: [PATCH 054/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210815=20?= =?UTF-8?q?Schedule=20a=20task=20with=20the=20Linux=20at=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210815 Schedule a task with the Linux at command.md --- ...hedule a task with the Linux at command.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20210815 Schedule a task with the Linux at command.md diff --git a/sources/tech/20210815 Schedule a task with the Linux at command.md b/sources/tech/20210815 Schedule a task with the Linux at command.md new file mode 100644 index 0000000000..0b191e2c58 --- /dev/null +++ b/sources/tech/20210815 Schedule a task with the Linux at command.md @@ -0,0 +1,168 @@ +[#]: subject: "Schedule a task with the Linux at command" +[#]: via: "https://opensource.com/article/21/8/linux-at-command" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Schedule a task with the Linux at command +====== +The at command is the Linux terminal's method of allowing you to +schedule one-time jobs for a specific time and date. +![Team checklist][1] + +Computers are good at [automation][2], but not everyone knows how to make automation work. It's a real luxury, though, to be able to schedule a task for a computer at a specific time and then forget about it. Maybe you have a file to upload or download at a specific time, or you need to process a batch of files that don't yet exist but are guaranteed to exist by a certain time or a setting that needs monitoring, or maybe you just need a friendly reminder to pick up bread and butter on the way home from work. + +That's what the `at` command is for. + +### What is the Linux at command? + +The `at` command is the Linux terminal's method of allowing you to schedule one-time jobs for a specific time and date. It's spontaneous automation made easy from the terminal. + +### Installing at + +On Linux, the `at` command is probably already installed. You can verify that it's installed using the `at -V` command. As long as a version is returned, you have `at` installed: + + +``` +$ at -V +at version x.y.z +``` + +Should you try to use `at` and the command isn't found, most modern Linux distributions offer to install the missing `at` package for you. + +### Scheduling a job interactively with at + +When you use the `at` command along with the time you want a task to run, you open an interactive `at` prompt. You can enter commands you want to run at the time you specified. + +If it helps, you can think of this process as a calendaring app, like the one you probably use on your mobile phone—first, you create an event on a day at some time, and then you specify what you want to happen. + +For example, try scheduling a memo to yourself by creating a task for a few minutes in the future. Make the task simple to reduce the likelihood of failure. To exit the `at` prompt, press **Ctrl+D** on your keyboard. + + +``` +$ at 11:20 AM +warning: commands will be executed using /bin/sh +at> echo "hello world" > ~/at-test.txt +at> <EOT> +job 3 at Mon Jul 26 11:20:00 2021 +``` + +As you can see, `at` uses intuitive and natural time definitions. You don't need to know the 24-hour clock or translate times to UTC or a specific ISO format. Generally, you can use whatever notation comes naturally to you, such as _noon_, _1:30 PM_, _13:37_, and so on, to describe when you want a task to happen. + +Wait a few minutes and then verify that your task has run by running the `cat` or the `tac` command on the file you created: + + +``` +$ cat ~/at-test.txt +hello world +``` + +### Scheduling a job with at + +You don't have to use the interactive prompt to schedule jobs with `at`. You can instead pipe commands to it using `echo` or `printf`. In this example, I use the notation _now_ and how many minutes from now I want the task to be delayed: + + +``` +`$ echo "echo 'hello again' >> ~/at-test.txt" | at now +1 minute` +``` + +After a minute, verify that the new command has been executed: + + +``` +$ cat ~/at-test.txt +hello world +hello again +``` + +### Time expressions + +The `at` command is pretty forgiving when interpreting times. You can choose between many formats, depending on which is most convenient for you: + + * `YYMMDDhhmm`[.ss] +(abbreviated year, month, day, hour, minute, and optionally seconds) + * `CCYYMMDDhhmm`[.ss] +(full year, month, day, hour, minute, and optionally seconds) + * `now` + * `midnight` + * `noon` + * `teatime` (4 PM) + * `AM` + * `PM` + + + +Times and dates can be absolute or add a plus sign (_+_) to make them relative to _now_. When specifying relative times, you can use words you probably already use: + + * `minutes` + * `hours` + * `days` + * `weeks` + * `months` + * `years` + + + +### Time and date syntax + +The `at` command is less forgiving in telling times from dates. The time must come first, followed by the day, although the day defaults to the current day and is only required when scheduling a task for someday in the future. + +These are examples of just a few valid expressions: + + +``` +$ echo "rsync -av /home/tux me@myserver:/home/tux/" | at 3:30 AM tomorrow +$ echo "/opt/batch.sh ~/Pictures" | at 3:30 AM 08/01/2022 +$ echo "echo hello" | at now + 3 days +``` + +### Viewing your at queue + +Once you've embraced `at` and are scheduling tasks instead of scribbling notes to yourself on scraps of paper lying around your desk, you may want to review whether you've got jobs still in the queue. + +To view your `at` queue, use the `atq` command: + + +``` +$ atq +10 Thu Jul 29 12:19:00 2021 a tux +9  Tue Jul 27 03:30:00 2021 a tux +7  Tue Jul 27 00:00:00 2021 a tux +``` + +To remove a task from your queue, use the `atrm` command along with the job number. To remove job 7, for instance: + + +``` +$ atrm 7 +$ atq +10 Thu Jul 29 12:19:00 2021 a tux +9  Tue Jul 27 03:30:00 2021 a tux +``` + +To see what's actually in a scheduled job, you have to look at the `at` spool. Only the root user can view the `at` spool, so you must use `sudo` to view the spool or to `cat` the contents of any job. + +### Schedule with Linux at + +The `at` system is an excellent way to avoid forgetting to run a job later in the day or to have your computer run a job for you when you're away. Unlike `cron`, it's free from the expectation that a job must run on a regular schedule from now until perpetuity, and its syntax is consequently a lot simpler than the `cron` syntax. + +Next time you have a small job you want your computer to remember and manage, try the `at` command. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-at-command + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://opensource.com/article/20/11/orchestration-vs-automation From ee4d02862c5384ec3a1d92a2863ea0defb227ea4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 16 Aug 2021 05:06:16 +0800 Subject: [PATCH 055/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210815=20?= =?UTF-8?q?7=20New=20Features=20in=20the=20Newly=20Released=20Debian=2011?= =?UTF-8?q?=20=E2=80=98Bullseye=E2=80=99=20Linux=20Distro?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md --- ...eased Debian 11 ‘Bullseye- Linux Distro.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md diff --git a/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md b/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md new file mode 100644 index 0000000000..7aeccfbc04 --- /dev/null +++ b/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md @@ -0,0 +1,127 @@ +[#]: subject: "7 New Features in the Newly Released Debian 11 ‘Bullseye’ Linux Distro" +[#]: via: "https://news.itsfoss.com/debian-11-feature/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +7 New Features in the Newly Released Debian 11 ‘Bullseye’ Linux Distro +====== + +The much awaited release of Debian 11 codenamed Bullseye is finally here after two years of development. The release will be supported for the next five years like any other Debian stable version release. + +Excited about it? Let’s see what’s new in Debian 11. + +### 1\. New theme + +Debian 11 comes with a new ‘Homeworld’ theme. It is inspired by the [Bauhaus movement][1], an art style born in Germany in the early 20th century and characterized by its unique approach to architecture and design. + +![Debian 11 default wallpaper][2] + +You’ll see this theme everywhere in Debian 11 be it on the login screen, installer or on the Grub menu. + +![Grub screen][3] + +![Installer][4] + +![Login screen][2] + +### 2\. Newer version of desktop environments + +Debian 11 consists of newer version of the desktop flavors it offers: + + * GNOME 3.38 + * KDE Plasma 5.20 + * LXDE 11 + * LXQt 0.16 + * MATE 1.24 + * Xfce 4.16 + + + +If you use cutting-edge distributions like Fedora or Arch/Manjaro, you may find it weird. But here’s the thing. Debian prefers stability, and hence the desktop environment versions are not the latest ones. They are newer in comparison to the previous Debian stable release. + +### 3\. Package updates + +Debian has updates its package repositories. Debian 11 includes over 11294 new packages taking the total to over 59551 packages. Over 42821 software packages have newer versions. Over 9519 packages have been removed for the distribution. + +This means that you should see newer versions of the popular applications like LibreOffice, Emacs, GIMP and various server and programming related tools. + +### 4\. Linux Kernel 5.10 LTS + +Debian 11 features [Kernel 5.10 which is a long term support (LTS) release][5]. Debian 10 Buster used Kernel 4.19 at the time of its release. + +A new kernel obviously means better support for hardware, specially the newer hardware along with performance improvements. + +### 5\. Printer and Scanner improvement + +Debian 11 brings the new package ipp-usb. It uses the vendor-neutral IPP-over-USB protocol supported by many modern printers. This means that many newer printers will be supported by Debian 11 without needing the drivers. + +Similarly, SANE driverless backend allows using scanners painlessly. + +### 6\. ExFAT support + +You no longer need to exfat-fuse package for mounting ExFAT filesystem. Thanks to the Linux kernel 5.10, Debian 11 has support for the exFAT filesystem, and defaults to using it for mounting exFAT filesystems. + +### 7\. Still supports 32 bit + +Is that even a feature? Considering that only a [handful of Linux distributions now support 32-bit architecture][6], I would say yes. + +Apart from 32-bit and 64-bit PC, Debian 11 also supports 64-bit ARM (arm64), ARM EABI (armel), ARMv7 (EABI hard-float ABI, armhf), little-endian MIPS (mipsel), 64-bit little-endian MIPS (mips64el), 64-bit little-endian PowerPC (ppc64el) and IBM System z (s390x). + +Now you know why is it called the ‘universal operating system’ 🙂 + +### Other changes + +There are a few more changes in this release. + + * Systemd defaults to using control groups v2 (cgroupv2). + * New Fcitx 5 is input method for Chinese, Japanese, Korean and many other languages. + * Systemd journal logs are persistent by default. + * A new open command to automatically open files from command-line with a certain app (GUI or CLI). + * Password hashing for local system accounts now uses yescrypt by default instead of SHA-512 for improved security. + + + +More information can be found in the [official release notes][7]. + +### Getting Debian 11 + +Debian 11 is available to download from its website. Just head over to the website and get the ISO from there. + +[Download Debian][8] + +If you are already using Debian 10, you can [easily upgrade to Debian 11 by changing your sources list.][9] + +Enjoy the latest and greatest of the universal operating system 🙂 + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/debian-11-feature/ + +作者:[Abhishek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lujun9972 +[1]: https://mymodernmet.com/what-is-bauhaus-art-movement/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9IjY0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://news.itsfoss.com/kernel-5-10-release/ +[6]: https://itsfoss.com/32-bit-linux-distributions/ +[7]: https://www.debian.org/releases/bullseye/amd64/release-notes/ch-whats-new.en.html +[8]: https://www.debian.org/ +[9]: https://www.debian.org/releases/bullseye/amd64/release-notes/ch-upgrading.en.html From ff07c2563bbfb228fbcdb1cdde0bf46f529f9c93 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 16 Aug 2021 08:49:37 +0800 Subject: [PATCH 056/290] translated --- ...802 Use OpenCV on Fedora Linux - part 1.md | 249 ------------------ ...802 Use OpenCV on Fedora Linux - part 1.md | 249 ++++++++++++++++++ 2 files changed, 249 insertions(+), 249 deletions(-) delete mode 100644 sources/tech/20210802 Use OpenCV on Fedora Linux - part 1.md create mode 100644 translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md diff --git a/sources/tech/20210802 Use OpenCV on Fedora Linux - part 1.md b/sources/tech/20210802 Use OpenCV on Fedora Linux - part 1.md deleted file mode 100644 index 0d3691c5e4..0000000000 --- a/sources/tech/20210802 Use OpenCV on Fedora Linux - part 1.md +++ /dev/null @@ -1,249 +0,0 @@ -[#]: subject: (Use OpenCV on Fedora Linux ‒ part 1) -[#]: via: (https://fedoramagazine.org/use-opencv-on-fedora-linux-part-1/) -[#]: author: (Onuralp SEZER https://fedoramagazine.org/author/thunderbirdtr/) -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Use OpenCV on Fedora Linux ‒ part 1 -====== - -![][1] - -Cover image excerpted from Starry Night by [Vincent van Gogh][2], Public domain, via Wikimedia Commons - -The technology world changes daily and the demands for computer vision, artificial intelligence, and machine learning are increasing. The technology that allows computers and mobile phones to see their surroundings is called [computer vision][3]. Work on re-creating a human eye started in the 50s. Since then, computer vision technology has come a long way. Computer vision has already made its way to our mobile phones via different applications. This article will introduce [OpenCV][4] on Fedora Linux. - -### **What is OpenCV?** - -> OpenCV (Open Source Computer Vision Library) is an open-source computer vision and machine learning software library. OpenCV was built to provide a common infrastructure for computer vision applications and to accelerate the use of machine perception in the commercial products. It has more than 2500 optimized algorithms, which includes a comprehensive set of both classic and state-of-the-art computer vision and machine learning algorithms. These algorithms can be used to detect and recognize faces, identify objects, classify human actions in videos and establish markers to overlay it with augmented reality and much more. -> -> [opencv.org – about][5] - -### Install OpenCV on Fedora Linux - -To get started with OpenCV, install it from the Fedora Linux repositories. - -``` -$ sudo dnf install opencv opencv-contrib opencv-doc python3-opencv python3-matplotlib python3-numpy -``` - -**Note:** On Fedora Silverblue or CoreOs, Python 3.9 is part of the core commit. Layer OpenCV and required tools with: _rpm-ostree install opencv opencv-doc python3-opencv python3-matplotlib python3-numpy_. - -Next, enter the following commands in a terminal to verify that OpenCV is installed (user input shown in bold). - -``` -$ python -Python 3.9.6 (default, Jul 16 2021, 00:00:00) -[GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux -Type "help", "copyright", "credits" or "license" for more information. ->>> import cv2 as cv ->>> print( cv.__version__ ) -4.5.2 ->>> exit() -``` - -The current OpenCV version should be displayed when you enter the _print_ command as shown above. This indicates that OpenCV and the Python-OpenCV libraries have been installed successfully. - -Additionally, if you want to take notes and write code with Jupyter Notebook and learn more about data science tools, check out the earlier Fedora Magazine article: [_Jupyter and Data Science in Fedora_][6]. - -### Get started with OpenCV - -After installation is complete, load a sample image using Python and the OpenCV libraries (press the **S** key to save a copy of the image in _png_ format and finish the program): - -``` -$ cp /usr/share/opencv4/samples/data/starry_night.jpg . -$ python starry_night.py -``` - -Contents of _starry_night.py_: - -``` -import cv2 as cv -import sys -img = cv.imread(cv.samples.findFile("starry_night.jpg")) -if img is None: - sys.exit("Could not read the image.") -cv.imshow("Display window", img) -k = cv.waitKey(0) -if k == ord("s"): - cv.imwrite("starry_night.png", img) -``` - -![][7] - -Gray-scale the image by adding the parameter **0** to the _cv.imread_ function as shown below. - -``` -img = cv.imread(cv.samples.findFile("starry_night.jpg"),0) -``` - -![][8] - -These are some alternative values that can be used for the second parameter of the _cv.imread_ function. - - * **cv2.IMREAD_GRAYSCALE** or **0:** Load the image in grayscale mode. - * **cv2.IMREAD_COLOR** or **1:** Load the image in color mode. Any transparency in the image will be removed. This is the default. - * **cv2.IMREAD_UNCHANGED** or **-1:** Load the image unaltered; including alpha channel. - - - -#### Display image attributes using OpenCV - -Image attributes include the number of rows, columns, and channels; the type of image data; the number of pixels; etc. Suppose you wanted to access the image’s shape and its datatype. This is how you would do it: - -``` -import cv2 as cv - -img = cv.imread(cv.samples.findFile("starry_night.jpg")) -print("Image size is", img.shape) -print("Data type of image is", img.dtype) - -Image size is (600, 752, 3) -Data type of image is uint8 - -print(f"Image 2D numpy array \n {img}") - -Image 2D numpy array - [[[0 0 0] - [0 0 0] - [0 0 0] - ... - [0 0 0] - [0 0 0] - [0 0 0]] - - [[0 0 0] - [0 0 0] - [0 0 0] - ... -``` - - * **img.shape:** return a tuple of the number of rows, columns, and channels (if it is a color image) - * **img.dtype:** return the datatype of the image - - - -Next display image with Matplotlib: - -``` -import cv2 as cv -import matplotlib.pyplot as plt -img = cv.imread(cv.samples.findFile("starry_night.jpg"),0) -plt.imshow(img) -plt.show() -``` - -![][9] - -#### What happened? - -The image was read in as a gray-scale image, however it won’t necessarily display in gray-scale when using Matplotlib’s _imshow_ fucntion. This is because the _imshow_ function uses a different color map by default. To specify that a gray-scale color map should be used, set the second parameter of the _imshow_ function to _cmap=’gray’_ as shown below. - -``` -plt.imshow(img,cmap='gray') -``` - -![][10] - -This problem is also going to happen when opening a picture in color mode because Matplotlib expects the image in RGB (red, green, blue) format whereas OpenCV stores images in BGR (blue, green, red) format. For correct display, you need to reverse the channels of the BGR image. - -``` -import cv2 as cv -import matplotlib.pyplot as plt -img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR) -fig, (ax1, ax2) = plt.subplots(1,2) -ax1.imshow(img) -ax1.set_title('BGR Colormap') -ax2.imshow(img[:,:,::-1]) -ax2.set_title('Reversed BGR Colormap(RGB)') -plt.show() -``` - -![][11] - -#### Splitting and merging color channels - -``` -import cv2 as cv -import matplotlib.pyplot as plt - -img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR) -b,g,r = cv.split(img) - -fig,ax = plt.subplots(2,2) - -ax[0,0].imshow(r,cmap='gray') -ax[0,0].set_title("Red Channel"); -ax[0,1].imshow(g,cmap='gray') -ax[0,1].set_title("Green Channel"); -ax[1,0].imshow(b,cmap='gray') -ax[1,0].set_title("Blue Channel"); - -# Merge the individual channels into a BGR image -imgMerged = cv.merge((b,g,r)) -# Show the merged output -ax[1,1].imshow(imgMerged[:,:,::-1]) -ax[1,1].set_title("Merged Output"); -plt.show() -``` - -![][12] - - * **cv2.split:** Divide a multi-channel array into several single-channel arrays. - * **cv2.merge:** Merge several arrays to make a single multi-channel array. All the input matrices must have the same size. - - - -**Note:** Images with more white have a higher density of color. Contrarily, images with more black have a lower density of color. In the above example the red color has the lowest density. - -#### Converting to different color spaces - -The _cv2.cvtColor_ function converts an input image from one color space to another. When transforming between the RGB and BGR color spaces, the order of the channels should be specified explicitly (_RGB2BGR_ or _BGR2RGB_). **Note that the default color format in OpenCV is often referred to as RGB but it is actually BGR (the bytes are reversed).** So the first byte in a standard (24-bit) color image will be an 8-bit blue component, the second byte will be green, and the third byte will be red. The fourth, fifth, and sixth bytes would then be the second pixel (blue, then green, then red), and so on. - -``` -import cv2 as cv -import matplotlib.pyplot as plt -img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR) -img_rgb = cv.cvtColor(img, cv.COLOR_BGR2RGB) -plt.imshow(img_rgb) -plt.show() -``` - -![][13] - -### Further information - -More details on OpenCV are available in the [online documentation][14]. - -Thank you. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/use-opencv-on-fedora-linux-part-1/ - -作者:[Onuralp SEZER][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/thunderbirdtr/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/starry-night-1-816x345.jpg -[2]: https://commons.wikimedia.org/wiki/File:Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg -[3]: https://en.wikipedia.org/wiki/Computer_vision -[4]: https://en.wikipedia.org/wiki/OpenCV -[5]: https://opencv.org/about/ -[6]: https://fedoramagazine.org/jupyter-and-data-science-in-fedora/ -[7]: https://fedoramagazine.org/wp-content/uploads/2021/06/image.png -[8]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-1.png -[9]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-2.png -[10]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-3.png -[11]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-4.png -[12]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-5.png -[13]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-7.png -[14]: https://docs.opencv.org/4.5.2/index.html diff --git a/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md b/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md new file mode 100644 index 0000000000..8e5c9a5867 --- /dev/null +++ b/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md @@ -0,0 +1,249 @@ +[#]: subject: (Use OpenCV on Fedora Linux ‒ part 1) +[#]: via: (https://fedoramagazine.org/use-opencv-on-fedora-linux-part-1/) +[#]: author: (Onuralp SEZER https://fedoramagazine.org/author/thunderbirdtr/) +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +在 Fedora Linux 上使用 OpenCV ‒ 第一部分 +====== + +![][1] + +封面图片选自[文森特-凡高][2]的《星空》,公共领域,通过维基共享资源发布 + +技术世界每天都在变化,对计算机视觉、人工智能和机器学习的需求也在增加。让计算机和手机能够看到周围环境的技术被称为[计算机视觉][3]。重新创造人眼的工作始于 50 年代。从那时起,计算机视觉技术有了长足的发展。计算机视觉已经通过不同的应用进入了我们的手机。这篇文章将介绍 Fedora Linux 上的[OpenCV][4]。 + +### **什么是 OpenCV?** + +> OpenCV (开源计算机视觉库)是一个开源的计算机视觉和机器学习软件库。OpenCV 的建立是为了给计算机视觉应用提供一个通用的基础设施,并加速机器感知在商业产品中的应用。它有超过 2500 种优化算法,其中包括一套全面的经典和最先进的计算机视觉和机器学习算法。这些算法可用于检测和识别人脸,识别物体,对视频中的人类行为进行分类,并建立标记,将其与增强现实叠加等等。 +> +> [opencv.org – about][5] + +### 在 Fedora Linux 上安装 OpenCV + +要开始使用 OpenCV,请从 Fedora Linux 仓库中安装它。 + +``` +$ sudo dnf install opencv opencv-contrib opencv-doc python3-opencv python3-matplotlib python3-numpy +``` + +**注意:**在 Fedora Silverblue 或 CoreOs 上,Python 3.9 是核心提交的一部分。用以下方法安装 OpenCV 和所需工具:_rpm-ostree install opencv opencv-doc python3-opencv python3-matplotlib python3-numpy_。 + +接下来,在终端输入以下命令,以验证 OpenCV 是否已经安装(用户输入的内容以粗体显示)。 + +``` +$ python +Python 3.9.6 (default, Jul 16 2021, 00:00:00) +[GCC 11.1.1 20210531 (Red Hat 11.1.1-3)] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> import cv2 as cv +>>> print( cv.__version__ ) +4.5.2 +>>> exit() +``` + +当你输入 _print_ 命令时,应该显示当前的 OpenCV 版本,如上图所示。这表明 OpenCV 和 Python-OpenCV 库已经成功安装。 + +此外,如果你想用 Jupyter Notebook 做笔记和写代码,并了解更多关于数据科学工具的信息,请查看早期的 Fedora Magazine 文章:[_Fedora 中的 Jupyter 和数据科学_][6]。 + +### 开始使用 OpenCV + +安装完成后,使用 Python 和 OpenCV 库加载一个样本图像(按 **S** 键以 _png_ 格式保存图像的副本并完成程序): + +``` +$ cp /usr/share/opencv4/samples/data/starry_night.jpg . +$ python starry_night.py +``` + +_starry_night.py_ 的内容: + +``` +import cv2 as cv +import sys +img = cv.imread(cv.samples.findFile("starry_night.jpg")) +if img is None: + sys.exit("Could not read the image.") +cv.imshow("Display window", img) +k = cv.waitKey(0) +if k == ord("s"): + cv.imwrite("starry_night.png", img) +``` + +![][7] + +通过在 _cv.imread_ 函数中添加参数 **0**,对图像进行灰度处理,如下所示。 + +``` +img = cv.imread(cv.samples.findFile("starry_night.jpg"),0) +``` + +![][8] + +这些是一些可以用于 _cv.imread_ 函数的第二个参数的替代值。 + + * **cv2.IMREAD_GRAYSCALE** 或 **0:** 以灰度模式加载图像。 + * **cv2.IMREAD_COLOR** 或 **1:** 以彩色模式载入图像。图像中的任何透明度将被移除。这是默认的。 + * **cv2.IMREAD_UNCHANGED** 或 **-1:**载入未经修改的图像。包括 alpha 通道。 + + + +#### 使用 OpenCV 显示图像属性 + +图像属性包括行、列和通道的数量、图像数据的类型、像素的数量等等。假设你想访问图像的形状和它的数据类型。你可以这样做: + +``` +import cv2 as cv + +img = cv.imread(cv.samples.findFile("starry_night.jpg")) +print("Image size is", img.shape) +print("Data type of image is", img.dtype) + +Image size is (600, 752, 3) +Data type of image is uint8 + +print(f"Image 2D numpy array \n {img}") + +Image 2D numpy array + [[[0 0 0] + [0 0 0] + [0 0 0] + ... + [0 0 0] + [0 0 0] + [0 0 0]] + + [[0 0 0] + [0 0 0] + [0 0 0] + ... +``` + + * **img.shape:** 返回一个行数、列数和通道数的元组(如果是彩色图像)。 + * **img.dtype:** 返回图像的数据类型。 + + + +接下来用 Matplotlib 显示图像: + +``` +import cv2 as cv +import matplotlib.pyplot as plt +img = cv.imread(cv.samples.findFile("starry_night.jpg"),0) +plt.imshow(img) +plt.show() +``` + +![][9] + +#### 发生了什么? + +该图像是作为灰度图像读入的,但是当使用 Matplotlib 的 _imshow_ 函数时,它不一定会以灰度显示。这是因为 _imshow_ 函数默认使用不同的颜色映射。要指定使用灰度颜色映射,请将 _imshow_ 函数的第二个参数设置为 _cmap='gray'_,如下所示。 + +``` +plt.imshow(img,cmap='gray') +``` + +![][10] + +这个问题在以彩色模式打开图片时也会发生,因为 Matplotlib 期望图片为 RGB(红、绿、蓝)格式,而 OpenCV 则以 BGR(蓝、绿、红)格式存储图片。为了正确显示,你需要将 BGR 图像的通道反转。 + +``` +import cv2 as cv +import matplotlib.pyplot as plt +img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR) +fig, (ax1, ax2) = plt.subplots(1,2) +ax1.imshow(img) +ax1.set_title('BGR Colormap') +ax2.imshow(img[:,:,::-1]) +ax2.set_title('Reversed BGR Colormap(RGB)') +plt.show() +``` + +![][11] + +#### 分割和合并颜色通道 + +``` +import cv2 as cv +import matplotlib.pyplot as plt + +img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR) +b,g,r = cv.split(img) + +fig,ax = plt.subplots(2,2) + +ax[0,0].imshow(r,cmap='gray') +ax[0,0].set_title("Red Channel"); +ax[0,1].imshow(g,cmap='gray') +ax[0,1].set_title("Green Channel"); +ax[1,0].imshow(b,cmap='gray') +ax[1,0].set_title("Blue Channel"); + +# Merge the individual channels into a BGR image +imgMerged = cv.merge((b,g,r)) +# Show the merged output +ax[1,1].imshow(imgMerged[:,:,::-1]) +ax[1,1].set_title("Merged Output"); +plt.show() +``` + +![][12] + + * **cv2.split:**将一个多通道数组分割成几个单通道数组。 + * **cv2.merge:** 将几个数组合并成一个多通道数组。所有的输入矩阵必须具有相同的大小。 + + + +**注意:**白色较多的图像具有较高的颜色密度。相反,黑色较多的图像,其颜色密度较低。在上面的例子中,红色的密度是最低的。 + +#### 转换到不同的色彩空间 + +_cv2.cvtColor_ 函数将一个输入图像从一个颜色空间转换到另一个颜色空间。在 RGB 和 BGR 色彩空间之间转换时,应明确指定通道的顺序(_RGB2BGR_ 或 _BGR2RGB_)。**注意,OpenCV 中的默认颜色格式通常被称为 RGB,但它实际上是 BGR(字节是相反的)。**因此,标准(24 位)彩色图像的第一个字节将是一个 8 位蓝色分量,第二个字节是绿色,第三个字节是红色。然后第四、第五和第六个字节将是第二个像素(蓝色,然后是绿色,然后是红色),以此类推。 + +``` +import cv2 as cv +import matplotlib.pyplot as plt +img = cv.imread(cv.samples.findFile("starry_night.jpg"),cv.IMREAD_COLOR) +img_rgb = cv.cvtColor(img, cv.COLOR_BGR2RGB) +plt.imshow(img_rgb) +plt.show() +``` + +![][13] + +### 更多信息 + +关于 OpenCV 的更多细节可以在[在线文档][14]中找到。 + +谢谢。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/use-opencv-on-fedora-linux-part-1/ + +作者:[Onuralp SEZER][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/thunderbirdtr/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/starry-night-1-816x345.jpg +[2]: https://commons.wikimedia.org/wiki/File:Van_Gogh_-_Starry_Night_-_Google_Art_Project.jpg +[3]: https://en.wikipedia.org/wiki/Computer_vision +[4]: https://en.wikipedia.org/wiki/OpenCV +[5]: https://opencv.org/about/ +[6]: https://fedoramagazine.org/jupyter-and-data-science-in-fedora/ +[7]: https://fedoramagazine.org/wp-content/uploads/2021/06/image.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-1.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-2.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-3.png +[11]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-4.png +[12]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-5.png +[13]: https://fedoramagazine.org/wp-content/uploads/2021/06/image-7.png +[14]: https://docs.opencv.org/4.5.2/index.html From ae07bbb2a9a19cf57a72b53d86651e7fd8f1bc65 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 16 Aug 2021 08:52:50 +0800 Subject: [PATCH 057/290] translating --- sources/tech/20210813 Install Linux with LVM.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210813 Install Linux with LVM.md b/sources/tech/20210813 Install Linux with LVM.md index 169d5bb1fe..e34ae93365 100644 --- a/sources/tech/20210813 Install Linux with LVM.md +++ b/sources/tech/20210813 Install Linux with LVM.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/install-linux-mint-lvm" [#]: author: "Kenneth Aaron https://opensource.com/users/flyingrhino" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 66096d5f38512df725c3f8da8c7b8aa0ca2966e6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 16 Aug 2021 11:11:01 +0800 Subject: [PATCH 058/290] PRF&PUB @unigeorge https://linux.cn/article-13687-1.html --- ...files and folders in the Linux terminal.md | 33 +++++++++---------- 1 file changed, 15 insertions(+), 18 deletions(-) rename {translated/tech => published}/20210807 Remove files and folders in the Linux terminal.md (54%) diff --git a/translated/tech/20210807 Remove files and folders in the Linux terminal.md b/published/20210807 Remove files and folders in the Linux terminal.md similarity index 54% rename from translated/tech/20210807 Remove files and folders in the Linux terminal.md rename to published/20210807 Remove files and folders in the Linux terminal.md index 35b9d73659..006cc5e784 100644 --- a/translated/tech/20210807 Remove files and folders in the Linux terminal.md +++ b/published/20210807 Remove files and folders in the Linux terminal.md @@ -3,23 +3,24 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13687-1.html" -在 Linux 终端中删除文件和文件夹 +基础:在 Linux 终端中删除文件和文件夹 ====== -本教程讲述了如何在 Linux 终端中安全地删除文件和文件夹。 -![Removing files][1] + +> 本教程讲述了如何在 Linux 终端中安全地删除文件和文件夹。 + +![](https://img.linux.net.cn/data/attachment/album/202108/16/110943z9boolgobdlyoiyo.jpg) 要想使用图形化界面删除计算机上的文件,你可能会直接将文件或文件夹拖拽到 “垃圾箱” 或 “回收站”。或者你也可以选择要删除的文件或文件夹,右键单击并选择 **删除**。 -而在终端中删除文件或文件夹时并没有垃圾箱一说(至少默认情况下没有)。在图形化桌面上,Trash(即垃圾箱文件夹)是一个受保护的目录,保护机制可以防止用户不小心将该目录删除,或将其从默认位置移动从而导致找不到它。Trash 本质不过是一个被高度管理的文件夹,因此你可以创建自己的 Trash 文件夹以在终端中使用。 +而在终端中删除文件或文件夹时并没有垃圾箱一说(至少默认情况下没有)。在图形化桌面上,`Trash`(即垃圾箱文件夹)是一个受保护的目录,保护机制可以防止用户不小心将该目录删除,或将其从默认位置移动从而导致找不到它。Trash 本质不过是一个被高度管理的文件夹,因此你可以创建自己的 Trash 文件夹以在终端中使用。 ### 为终端设置一个垃圾箱 -在家目录中创建一个名为 **Trash** 的目录: - +在家目录中创建一个名为 `Trash` 的目录: ``` $ mkdir ~/Trash @@ -27,8 +28,7 @@ $ mkdir ~/Trash ### 删除文件 -要删除文件或文件夹时,使用 **mv** 命令将文件或文件夹移至 Trash 中: - +要删除文件或文件夹时,使用 `mv` 命令将文件或文件夹移至 `Trash` 中: ``` $ mv example.txt ~/Trash @@ -36,8 +36,7 @@ $ mv example.txt ~/Trash ### 永久删除文件或文件夹 -当你准备从系统中永久删除某个文件或文件夹时,可以使用 **rm** 命令清除垃圾箱文件夹中的所有数据。通过将 **rm** 命令指向星号(`*`),可以删除 **Trash** 文件夹内的所有文件和文件夹,而不会删除 **Trash** 文件夹本身。因为用户可以方便且自由地创建目录,所以即使不小心删除了 **Trash** 文件夹,你也可以再次新建一个。 - +当你准备从系统中永久删除某个文件或文件夹时,可以使用 `rm` 命令清除垃圾箱文件夹中的所有数据。通过将 `rm` 命令指向星号(`*`),可以删除 `Trash` 文件夹内的所有文件和文件夹,而不会删除 `Trash` 文件夹本身。因为用户可以方便且自由地创建目录,所以即使不小心删除了 `Trash` 文件夹,你也可以再次新建一个。 ``` $ rm --recursive ~/Trash/* @@ -45,8 +44,7 @@ $ rm --recursive ~/Trash/* ### 删除空目录 -删除空目录有一个专门的命令 **rmdir** ,它只能用来删除空目录,从而保护你免受递归删除错误的影响。 - +删除空目录有一个专门的命令 `rmdir`,它只能用来删除空目录,从而保护你免受递归删除错误的影响。 ``` $ mkdir full @@ -60,8 +58,7 @@ $ rmdir empty ### 更好的删除方式 -此外还有一些并没有默认安装在终端上的 [删除文件命令][2],你可以从软件库安装它们。这些命令管理和使用的 **Trash** 文件夹与你在桌面模式使用的是同一个(而非你自己单独创建的),从而使删除文件变得更加方便。 - +此外还有一些并没有默认安装在终端上的 [删除文件命令][2],你可以从软件库安装它们。这些命令管理和使用的 `Trash` 文件夹与你在桌面模式使用的是同一个(而非你自己单独创建的),从而使删除文件变得更加方便。 ``` $ trash ~/example.txt @@ -77,7 +74,7 @@ via: https://opensource.com/article/21/8/remove-files-linux-terminal 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 3e8be6bfcfad1d091d11ab50e62f9dba709bfe2d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 16 Aug 2021 11:34:54 +0800 Subject: [PATCH 059/290] PRF @imgradeone --- ...to Know About This -Gaming Distribution.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md b/translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md index e4d7bc1927..93aa29beb2 100644 --- a/translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md +++ b/translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md @@ -3,14 +3,16 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "imgradeone" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " SteamOS 是什么?关于这款“游戏发行版”你所要知道的事 ====== -SteamOS 是一款基于 Linux 的操作系统,旨在提供来自 Steam 平台自身的无缝游戏体验。 +![](https://img.linux.net.cn/data/attachment/album/202108/16/113402ass3smho7sbmo75b.jpg) + +SteamOS 是一款基于 Linux 的操作系统,旨在提供来自 Steam 自己的游戏商店顺滑的游戏体验。 虽然它已经存在了许久,但有几件事你应该知道。 @@ -18,11 +20,11 @@ SteamOS 是一款基于 Linux 的操作系统,旨在提供来自 Steam 平台 ### SteamOS 是什么? -SteamOS 是由游戏分发平台 Steam 开发的 Linux 发行版。它并是一款像 Debian、Linux Mint 或者 Ubuntu 那样的泛用型桌面操作系统,即便你确实可以使用桌面功能。默认情况下,SteamOS 的界面类似于游戏主机,因为 SteamOS 旨在成为专为 Steam 游戏设备(如 Steam Machine(已停产)和 Steam Deck)定制的操作系统。 +SteamOS 是由游戏分发平台 Steam 开发的 Linux 发行版。它并是一款像 Debian、Linux Mint 或者 Ubuntu 那样的泛用型桌面操作系统,即便你确实可以使用桌面功能。默认情况下,SteamOS 的界面类似于游戏机,因为 SteamOS 旨在成为专为 Steam 游戏设备定制的操作系统,如 Steam Machine(已停产)和 Steam Deck。 ![SteamOS 界面][1] -你确实也可以在任何 Linux 发行版和其他平台安装 Steam 客户端,但 SteamOS 更是为了提供类似游戏主机的体验,方便你玩 Steam 上的游戏。 +你确实也可以在任何 Linux 发行版和其他平台安装 Steam 客户端,但 SteamOS 更是为了提供类似游戏机的体验,方便你玩 Steam 上的游戏。 ### SteamOS 基于哪个 Linux 发行版? @@ -50,7 +52,7 @@ SteamOS(2.0 版本)内置了支持特定硬件的驱动程序。 理论上 SteamOS 可以在任何电脑上运行,但目前官方并没有支持最新的硬件。 -### SteamOS 只是另外一款 Linux 发行版吗? +### SteamOS 只是又一款 Linux 发行版吗? SteamOS 严格来说已经是现有的 [适合游戏的 Linux 发行版][4] 之一。但与其他发行版不同的是,SteamOS 并不是为了泛用型桌面而设计的。你确实可以安装 Linux 程序,但 SteamOS 支持的软件包极为有限。 @@ -80,7 +82,7 @@ SteamOS 基于 Debian 8 许久,目前没有任何更新。 虽然大部分游戏都可以运行,但这并不意味着你游戏库里的所有游戏都能正常游玩。 -如果你想玩 Steam 支持的游戏,以及仅限 Linux 平台的游戏,那还是值得一试的。 +如果你想玩 Steam 支持的游戏,以及仅限于 Linux 平台的游戏,那还是值得一试的。 ### SteamOS 是否开源? @@ -98,9 +100,9 @@ SteamOS 操作系统是开源的,你可以在 [官方仓库][6] 中找到源 ### 我能找到内置 SteamOS 的游戏主机吗? -![Steam Machine 主机,已经停产][8] +![Steam Machine 游戏机,已经停产][8] -SteamOS 最初是为 Steam Machine 这款 Steam 自家的 PlayStation/Xbox 风格主机定制的操作系统。2015 年 Steam Machine 发布后并没有在市场上获得成功,最终停产。 +SteamOS 最初是为 Steam Machine 这款 Steam 自家的 PlayStation/Xbox 风格的游戏机定制的操作系统。2015 年 Steam Machine 发布后并没有在市场上获得成功,最终停产。 目前,唯一一款预装 SteamOS 的设备是备受瞩目的 Steam Deck。 @@ -121,7 +123,7 @@ via: https://itsfoss.com/steamos/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[imgradeone](https://github.com/imgradeone) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 424bf2c463580f43df0791b3afc7fbd1b76a7af1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 16 Aug 2021 11:38:23 +0800 Subject: [PATCH 060/290] PUB @imgradeone https://linux.cn/article-13688-1.html --- ...nt You Need to Know About This -Gaming Distribution.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) rename {translated/tech => published}/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md (95%) diff --git a/translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md b/published/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md similarity index 95% rename from translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md rename to published/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md index 93aa29beb2..223f78ff39 100644 --- a/translated/tech/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md +++ b/published/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "imgradeone" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13688-1.html" SteamOS 是什么?关于这款“游戏发行版”你所要知道的事 ====== @@ -70,13 +70,13 @@ SteamOS 基于 Debian 8 许久,目前没有任何更新。 ### 你是否推荐使用 SteamOS 来玩电脑游戏吗? -**不推荐。**在 Windows 和其它 Linux 发行版面前,SteamOS 并不是你应该选择的替代品。 +**不推荐**。 在 Windows 和其它 Linux 发行版面前,SteamOS 并不是你应该选择的替代品。 虽然 SteamOS 主要是为游戏定制的,但在拿它玩游戏之前,你还需要了解许多注意事项。 ### 所有游戏都可以在 SteamOS 上玩吗? -**不。**SteamOS 需要依赖 Proton 兼容层才能让 Windows 平台的游戏正常运行。 +**不**。 SteamOS 需要依赖 Proton 兼容层才能让 Windows 平台的游戏正常运行。 当然,如今借助同样的底层技术,[在 Linux 里玩游戏][5] 已经成为了可能,但至少在我写这篇文章时,你并不能让 Steam 上架的所有游戏都可以在 Linux 中运行。 From 462d680e4a2e94dfc1d27f59d2725f42fd7a8d02 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Mon, 16 Aug 2021 15:03:22 +0800 Subject: [PATCH 061/290] translating --- ...20210813 Parse command options in Java with commons-cli.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210813 Parse command options in Java with commons-cli.md b/sources/tech/20210813 Parse command options in Java with commons-cli.md index 5e20e78c9e..9b38440225 100644 --- a/sources/tech/20210813 Parse command options in Java with commons-cli.md +++ b/sources/tech/20210813 Parse command options in Java with commons-cli.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/java-commons-cli" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -211,7 +211,7 @@ via: https://opensource.com/article/21/8/java-commons-cli 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[unigeorge](https://github.com/unigeorge) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a524e286b7194da838fa79260c157135613087fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 16 Aug 2021 23:13:19 +0800 Subject: [PATCH 062/290] =?UTF-8?q?=E8=B6=85=E6=9C=9F=E5=9B=9E=E6=94=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @lcf33 @bestony @osu-zxf @zxy-wyx @rakino @wyxplus @Gordon-Deng @hongsofwing @shipsw @chai-yuan 这些文章已经超时了。如果你还希望继续完成,请重新申请。 --- ...data with an Improved UI - Qt 6 Support.md | 2 +- ... Source Tool Will Detect Malicious Code.md | 75 ------------ ...ux Kernel 5.10 LTS and New Applications.md | 113 ------------------ ...sition as the Default Linux Mail Client.md | 110 ----------------- sources/talk/20170928 The Lineage of Man.md | 2 +- .../20191029 5 reasons why I love Python.md | 2 +- ...-center spending will inch up this year.md | 2 +- ...ommand on binary files with this script.md | 2 +- ...les between Linux and Windows computers.md | 2 +- .../tech/20210511 What is fog computing.md | 2 +- ... favorite Windows applications on Linux.md | 2 +- ...0210603 FreeDOS commands for Linux fans.md | 2 +- ...ve programming on FreeDOS with GW-BASIC.md | 2 +- sources/tech/20210720 .md | 25 ---- sources/tech/20210727 .md | 25 ---- 15 files changed, 10 insertions(+), 358 deletions(-) delete mode 100644 sources/news/20210727 GitLab-s New Open Source Tool Will Detect Malicious Code.md delete mode 100644 sources/news/20210803 4MLinux 37.0 Release Packs in Linux Kernel 5.10 LTS and New Applications.md delete mode 100644 sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md delete mode 100644 sources/tech/20210720 .md delete mode 100644 sources/tech/20210727 .md diff --git a/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md b/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md index f73a88e2e3..4898095a65 100644 --- a/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md +++ b/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/pdf-mix-tool-1-0-1-release/) [#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/) [#]: collector: (lujun9972) -[#]: translator: (lcf33) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/news/20210727 GitLab-s New Open Source Tool Will Detect Malicious Code.md b/sources/news/20210727 GitLab-s New Open Source Tool Will Detect Malicious Code.md deleted file mode 100644 index 21adc4e8a2..0000000000 --- a/sources/news/20210727 GitLab-s New Open Source Tool Will Detect Malicious Code.md +++ /dev/null @@ -1,75 +0,0 @@ -[#]: subject: (GitLab’s New Open Source Tool Will Detect Malicious Code) -[#]: via: (https://news.itsfoss.com/gitlab-open-source-tool-malicious-code/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -GitLab’s New Open Source Tool Will Detect Malicious Code -====== - -There are several open-source tools available for security researchers. Now, GitLab has introduced a new one to the arsenal that lets you detect malicious code in dependencies. - -The tool is also known as “Package Hunter” and is an important addition that could help secure every type of software. - -### What is Package Hunter? - -Every software includes some form of dependencies, which makes it possible for a developer to quickly build an app. - -While this facilitates the reuse of code to achieve the task, they often just “trust” the dependencies used without separate review. - -Package Hunter comes to the rescue here and lets you easily detect malicious code in a dependency package. - -### Enhanching Software Supply Chain Security - -Many supply chain attacks involve a compromised dependency package. - -Normally, the attacker injects malicious code in the dependency code available to the public or creates a separate private repository to distribute the malicious dependency that looks safe. - -Even if you are using a package manager to get trusted packages, it can be tricked to download packages from a private repository. And, you will have no idea about it. - -Hence, with an additional check to the supply chain which is as convenient as Package Hunter, the software supply chain security should improve. - -And, especially, if the open-source supply chain security improves, [open source software security][1] will gradually get a boost as well. - -### How Does it Work? How Can You Get it? - -Package Hunter scans for malicious code and keeps an eye on unexpected behavior of the dependencies. - -It installs the dependencies in a sandbox environment to monitor and detect any anomalies. - -As of now, it supports testing NodeJS modules and Ruby Jems. - -GitLab has been using the tool internally for a while. And, now, it seamlessly integrates with GitLab. - -You can learn more about setting it up by referring to the [official documentation][2] and the [Package Hunter CLI instructions][3]. - -It is available as a free and open-source project on [GitLab][4]. - -_What do you think about GitLab’s open-source tool to help detect malicious code? Feel free to share your thoughts in the comments below._ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/gitlab-open-source-tool-malicious-code/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/open-source-software-security/ -[2]: https://gitlab.com/gitlab-org/security-products/package-hunter/-/blob/main/README.md -[3]: https://gitlab.com/gitlab-org/security-products/package-hunter-cli/-/blob/main/README.md#gitlab-ci -[4]: https://gitlab.com/gitlab-org/security-products/package-hunter/activity diff --git a/sources/news/20210803 4MLinux 37.0 Release Packs in Linux Kernel 5.10 LTS and New Applications.md b/sources/news/20210803 4MLinux 37.0 Release Packs in Linux Kernel 5.10 LTS and New Applications.md deleted file mode 100644 index 37911105ac..0000000000 --- a/sources/news/20210803 4MLinux 37.0 Release Packs in Linux Kernel 5.10 LTS and New Applications.md +++ /dev/null @@ -1,113 +0,0 @@ -[#]: subject: (4MLinux 37.0 Release Packs in Linux Kernel 5.10 LTS and New Applications) -[#]: via: (https://news.itsfoss.com/4mlinux-37-0-release/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -4MLinux 37.0 Release Packs in Linux Kernel 5.10 LTS and New Applications -====== - -One of the most lightweight distros, [4MLinux][1], has just announced its 37th major release. This version brings a variety of improvements, of which we shall be looking at here. - -Before that, however, I feel that it would be appropriate to find out more about it, especially since it’s such a niche distro. - -### What Is 4MLinux? - -Despite its somewhat unusual name, it actually is quite logical, especially when you look at the project’s goals: - - * **M**aintenance (system rescue Live CD), - * **M**ultimedia (full support for a huge number of image, audio and video formats), - * **M**iniserver (DNS, FTP, HTTP, MySQL, NFS, Proxy, SMTP, SSH, and Telnet), - * **M**ystery (meaning a collection of classic Linux games). - - - -This is where it gets the “4M” part of the name from. - -One interesting quirk of this distro is that it doesn’t come with a traditional package manager, instead opting for an ecosystem of extensions. The minimum requirements are also quite relaxed, requiring just 32 MB of RAM to run. The result of all this is an incredibly lightweight and fast distro, perfect for those older computers gathering dust in a cupboard. - -### New Features - -This release brings a variety of improvements, most of which are as follows: - - * 4 new applications can be installed - * [Linux 5.10 LTS][2] - * [LibreOffice 7.1.5][3] - * Firefox 90.0.2 - * Thunderbird 78.12 - * Other Updated applications - - - -#### Linux 5.10 LTS - -This release brings in Linux kernel 5.10 LTS, resulting in better hardware support and many small improvements. To be honest, I was actually quite surprised at this addition, as I thought that they may not opt for one of the latest kernels right now. - -If you want to see what other improvements this addition brings, I would suggest reading [our coverage for Linux kernel 5.10 release][2]. - -#### New Applications - -One area that M4Linux struggles in is application support. Due to the lack of a package manager, the list of available apps is very short, making each addition to it extremely meaningful. - -This release brings the Dmidecode tool for reading hardware-related data from SMBIOS, FluidSynth software synthesizer, HandBrake video transcoder, and qBittorrent BitTorrent client. - -These applications should improve the usefulness of this distribution, hopefully helping older computers stay out of landfill. - -#### Updated Applications - -2021 has had a plethora of large app upgrades, including the new interface in Firefox 89 and the vast improvements of LibreOffice 7.1.5. Now, all these improvements are coming to M4Linux with the new release. - -Here’s a list of updated applications with this release: - - * LibreOffice 7.1.5 - * Firefox 90.0.2 - * Mozilla Thunderbird 78.12.0 - * Audacious 4.1 - * VLC 3.0.16 - * MPV 0.33.0 - * AbiWord 3.0.5 - * GIMP 2.10.24 - * Gnumeric 1.12.50 - * Chromium 90.0 - * Mesa 21.0 - - - -In all, these updated applications should provide a much-improved user experience. - -### Final Thoughts - -M4Linux, despite being quite a niche, has made some incredible improvements with this release, especially when considering the incredibly small development team. - -Even though it isn’t targeting the latest hardware, I can still see how this distribution might be perfect for some use cases. - -You can read the [official announcement][4] to learn more. - -_What do you think about M4Linux 37.0? Let me know in the comments below!_ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/4mlinux-37-0-release/ - -作者:[Jacob Crume][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/jacob/ -[b]: https://github.com/lujun9972 -[1]: https://4mlinux.com/index.php?page=home -[2]: https://news.itsfoss.com/kernel-5-10-release/ -[3]: https://news.itsfoss.com/libreoffice-7-1-community/ -[4]: https://4mlinux-releases.blogspot.com/2021/07/4mlinux-370-stable-released.html diff --git a/sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md b/sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md deleted file mode 100644 index 9c9cd398fa..0000000000 --- a/sources/news/20210812 Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: subject: "Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client" -[#]: via: "https://news.itsfoss.com/thunderbird-91-release/" -[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Thunderbird 91 is a Major Upgrade That Could Help Reclaim its Position as the Default Linux Mail Client -====== - -Thunderbird, the popular open-source email client, has a major new upgrade. Thunderbird 91 release promises many improvements, some of which we will be looking at here. - -Overall, the release focuses on adding import/export support for Thunderbird profiles, various user-interface improvements, improved Gmail account integration, improved calendar settings, tons of bug fixes, and smaller improvements. - -Read on for a look at all these new features and more. - -### What’s New? - -![][1] - -After more than a year of development since Thunderbird 78, Thunderbird 91 has a lot to offer. With various new features and bug fixes, this release will benefit almost everyone who uses it. - -These new features include: - - * UI improvements to Calendar display - * UI improvements to message compose window and message composer - * Updated printing UI - * Brand-new account setup wizard - * The ability to Import/Export Thunderbird profiles - * Suggesting replacements for discontinued/incompatible add-ons - * Fixes for visibility issues in dark mode and high contrast themes - * Beta-level support for Matrix servers (chat feature) - * CardDAV address book support - * Enable redirect of messages - - - -Between the UI and usability improvements, this release is looking to be a great one. - -#### UI Improvements - -Thunderbird 91 brings multiple UI improvements to the table. It may not be a major visual overhaul, but some adjustments focus on improved accessibility. - -Especially with the calendar supporting .ics files by double-click and remote calendar auto-detection. You will also notice a new UI for adding attachments. - -Finally, users of Dark mode will notice the fixes for the many visibility issues that plagued older releases. - -#### Improved Account Setup Wizard - -![][2] - -This release moves the account setup wizard to a new tab. - -Unlike the old one, the new one follows the same design guidelines used in the settings page and other HTML-based parts of the application. - -Better still, it can automatically detect CalDAV calendars, email signatures, and the ability to connect to an address book during setup. Furthermore, if you are adding a Gmail account, it will ask for permission to access the calendar and address book. Once done, you will not have to re-authorize it. - -This makes the process of getting set up with Thunderbird much more enjoyable, especially when you are also trying to set up calendars and address books. - -#### Other Improvements - -Considering this as a major upgrade, there are several subtle changes and improvements across the board. - -Some of them include the ability to encrypt mail to BCC recipients, a quick-find feature for the multi-message view, and per-calendar notification settings. - -For more information on all the technical changes, you can refer to the [official release notes][3]. - -### Download Thunderbird 91 - -You can get the latest Thunderbird from the [official download page][4] (it may take a while for them to make it available). Also, it would take time to make the update available through repositories/Flathub. - -If you want to avoid waiting, you can directly grab the tar package from their [FTP directory][5], extract it, and run the executable file to get started. - -[Mozilla Thunderbird 91][4] - -### Wrapping Up - -Considering that many Linux distributions have been switching over to the “Evolution” mail client replacing Thunderbird, this was a much-needed upgrade for users who prefer Thunderbird to anything else. - -Of course, you do have the option to explore the [best email clients for Linux][6] if you still do not like Thunderbird. - -_What is your favorite feature in Thunderbird 91? Let me know in the comments below!_ - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/thunderbird-91-release/ - -作者:[Jacob Crume][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/jacob/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYxMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU5OSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://www.thunderbird.net/en-US/thunderbird/91.0/releasenotes/ -[4]: https://www.thunderbird.net/en-US/ -[5]: https://ftp.mozilla.org/pub/thunderbird/releases/91.0/linux-x86_64/en-US/ -[6]: https://itsfoss.com/best-email-clients-linux/ diff --git a/sources/talk/20170928 The Lineage of Man.md b/sources/talk/20170928 The Lineage of Man.md index b51d67f4f9..de2cc7515e 100644 --- a/sources/talk/20170928 The Lineage of Man.md +++ b/sources/talk/20170928 The Lineage of Man.md @@ -92,7 +92,7 @@ via: https://twobithistory.org/2017/09/28/the-lineage-of-man.html 作者:[Two-Bit History][a] 选题:[lujun9972][b] -译者:[bestony](https://github.com/bestony) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/talk/20191029 5 reasons why I love Python.md b/sources/talk/20191029 5 reasons why I love Python.md index a82429dd9a..5df5be960e 100644 --- a/sources/talk/20191029 5 reasons why I love Python.md +++ b/sources/talk/20191029 5 reasons why I love Python.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (osu-zxf) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md b/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md index f6e3d73fa5..a58dc86acd 100644 --- a/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md +++ b/sources/talk/20200124 Gartner- Data-center spending will inch up this year.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (zxy-wyx) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20200320 Run a command on binary files with this script.md b/sources/tech/20200320 Run a command on binary files with this script.md index d2ec19fd62..a01e3e2ef0 100644 --- a/sources/tech/20200320 Run a command on binary files with this script.md +++ b/sources/tech/20200320 Run a command on binary files with this script.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (rakino) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210428 Share files between Linux and Windows computers.md b/sources/tech/20210428 Share files between Linux and Windows computers.md index 1a0de1a9fa..8ba6282397 100644 --- a/sources/tech/20210428 Share files between Linux and Windows computers.md +++ b/sources/tech/20210428 Share files between Linux and Windows computers.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/4/share-files-linux-windows) [#]: author: (Stephan Avenwedde https://opensource.com/users/hansic99) [#]: collector: (lujun9972) -[#]: translator: (wyxplus) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210511 What is fog computing.md b/sources/tech/20210511 What is fog computing.md index 17f5772340..7d1f54ee22 100644 --- a/sources/tech/20210511 What is fog computing.md +++ b/sources/tech/20210511 What is fog computing.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/5/fog-computing) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: (Gordon-Deng) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210522 Run your favorite Windows applications on Linux.md b/sources/tech/20210522 Run your favorite Windows applications on Linux.md index 7005f98805..b2bdeb221a 100644 --- a/sources/tech/20210522 Run your favorite Windows applications on Linux.md +++ b/sources/tech/20210522 Run your favorite Windows applications on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (hongsofwing) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210603 FreeDOS commands for Linux fans.md b/sources/tech/20210603 FreeDOS commands for Linux fans.md index cdabb2a9a2..522ca199eb 100644 --- a/sources/tech/20210603 FreeDOS commands for Linux fans.md +++ b/sources/tech/20210603 FreeDOS commands for Linux fans.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/freedos-linux-users) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: ( shipsw ) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md b/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md index a8d4ef7b1e..d36b04e6db 100644 --- a/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md +++ b/sources/tech/20210621 Why I love programming on FreeDOS with GW-BASIC.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/freedos-gw-basic) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) [#]: collector: (lujun9972) -[#]: translator: (chai-yuan) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) diff --git a/sources/tech/20210720 .md b/sources/tech/20210720 .md deleted file mode 100644 index 4e3e86794d..0000000000 --- a/sources/tech/20210720 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: () -[#]: via: (https://www.2daygeek.com/save-command-output-to-a-file-linux/) -[#]: author: ( ) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/save-command-output-to-a-file-linux/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 diff --git a/sources/tech/20210727 .md b/sources/tech/20210727 .md deleted file mode 100644 index c2834fe0fb..0000000000 --- a/sources/tech/20210727 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: () -[#]: via: (https://www.2daygeek.com/recover-restore-deleted-logical-volume-linux/) -[#]: author: ( ) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/recover-restore-deleted-logical-volume-linux/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 From c24b0967c291bad8d8f68239077fc88e8fbba89e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 17 Aug 2021 05:04:13 +0800 Subject: [PATCH 063/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210817=20?= =?UTF-8?q?Automatically=20Synchronize=20Subtitle=20With=20Video=20Using?= =?UTF-8?q?=20SubSync?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md --- ...onize Subtitle With Video Using SubSync.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md diff --git a/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md new file mode 100644 index 0000000000..d4fb1fae2d --- /dev/null +++ b/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -0,0 +1,87 @@ +[#]: subject: "Automatically Synchronize Subtitle With Video Using SubSync" +[#]: via: "https://itsfoss.com/subsync/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Automatically Synchronize Subtitle With Video Using SubSync +====== + +Let me share a scenario. You are trying to watch a movie or video and you need subtitles. You download the subtitle only to find that the subtitle is not properly synchronized. There are no other good subtitles available. What to do now? + +You can [synchronize subtitles in VLC by pressing G or H keys][1]. It adds a delay to the subtitles. This could work if the subtitle is out of synch by the same time interval throughout the video. But if that’s not the case, SubSync could be of great help here. + +### SubSync: Subtitle Speech Synchronizer + +[SubSync][2] is a nifty open source utility available for Linux, macOS and Windows. + +It synchronizes the subtitle by listening to the audio track and that’s how it works the magic. It will work even if the audio track and the subtitle are in different languages. If necessary, it could also be translated but I did not test this feature. + +I made a simple test by using a subtitle which was not in synch with the video I was playing. To my surprise, it worked pretty smooth and I got perfectly synched subtitles. + +Using SubSync is simple. You start the application and it asks to add the subtitle file and the video file. + +![User interface for SubSync][3] + +You’ll have to specif the language of the subtitle and the video on the interface. It may download additional assets based on the language in use. + +![SubSync may download additional packages for language support][4] + +Please keep in mind that it takes some time to synchronize the subtitles, depending on the length of the video and subtitle. You may grab your cup of tea/coffee or beer while you wait for the process to complete. + +You can see the synchronization status in progress and even save it before it gets completed. + +![SubSync synchronization in progress][5] + +Once the synchronization completes, you hit the save button and either save the changes to the original file or save it as a new subtitle file. + +![Synchronization completed][6] + +I cannot say that it will work in all the cases but it worked for the sample test I ran. + +### Installing SubSync + +SubSync is a cross-platform application and you can get the installer files for Windows and macOS from its [download page][7]. + +For Linux users, SubSync is available as a Snap package. If your distribution has Snap support enabled, use the following command to install SubSync: + +``` +sudo snap install subsync +``` + +Please keep in mind that it will take some time to download SubSync snap package. So have a good internet connection or plenty of patience. + +### In the end + +Personally, I am addicted to subtitles. Even if I am watching movies in English on Netflix, I keep the subtitles on. It helps understand each dialogue clearly, specially if there is a strong accent. Without subtitles I could never understand a [word from Mickey O’Neil (played by Brad Pitt) in the movie Snatch][8]. Dags!! + +Using SubSync is a lot easier than [using Subtitle Editor][9] for synchronizing subtitles. After [Penguin Subtitle Player][10], this is another great tool for someone like me who searches the entire internet for rare or recommended (mystery) movies from different countries. + +If you are a ‘subtitle user’, I have a feeling you would like this tool. If you do use it, please share your experience with it in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/subsync/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/how-to-synchronize-subtitles-with-movie-quick-tip/ +[2]: https://subsync.online/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-interface.png?resize=593%2C280&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize.png?resize=522%2C189&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize-1.png?resize=424%2C278&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize-2.png?resize=424%2C207&ssl=1 +[7]: https://subsync.online/en/download.html +[8]: https://www.youtube.com/watch?v=tGDO-9hfaiI +[9]: https://itsfoss.com/subtitld/ +[10]: https://itsfoss.com/penguin-subtitle-player/ From f6e09f05e2dd7c47f6dad8ca76a5ec13fb417804 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 17 Aug 2021 05:04:35 +0800 Subject: [PATCH 064/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210816=20?= =?UTF-8?q?What=20was=20your=20first=20programming=20language=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210816 What was your first programming language.md --- ...hat was your first programming language.md | 300 ++++++++++++++++++ 1 file changed, 300 insertions(+) create mode 100644 sources/tech/20210816 What was your first programming language.md diff --git a/sources/tech/20210816 What was your first programming language.md b/sources/tech/20210816 What was your first programming language.md new file mode 100644 index 0000000000..7e13d19ddb --- /dev/null +++ b/sources/tech/20210816 What was your first programming language.md @@ -0,0 +1,300 @@ +[#]: subject: "What was your first programming language?" +[#]: via: "https://opensource.com/article/21/8/first-programming-language" +[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What was your first programming language? +====== +These 24 open source technologists share their programming origin +stories. +![Computer laptop in space][1] + +We asked our contributors _What was your first programming language?_ but the question goes much deeper than that. There are stories to tell about who suggested it or what prompted you to learn it. If you were paid to do so, and what happened next. Then there's a lot it says about your age and what was going on in the world. + +Let's hear a little bit about these 24 technologists' stories. + +* * * + +*What was your first programming language? *BASIC + +*Were you paid to learn it? *Nope. + +*Did you choose it? *Not really. + +*Why? *It was Christmas of 1979, my parents (a school maintenance worker and a public health nurse) scrimped and saved the staggering US$1000 to buy a Tandy/Radio Shack TRS-80. It came with a ring binder that covered the complete BASIC programming language, and my Dad figured getting me to learn to write computer software would be a good way to keep me out of trouble. + +*What happened next? *Mom and Dad would buy me and my younger brother books or subscriptions to popular magazines about "home computing," which included printed source code for a variety of games. We spent hours every weekend painstakingly typing and then debugging line by line with the accompanying checksums to find our typos. When the games got boring, we'd modify them... trivially at first just tweaking strings here and there to turn, say, a roman battle strategy game into a space battle strategy game; but later increasing the complexity of our changes and eventually starting to write terrible games of our own. Soon after that, we were sharing disks by mail and then over BBSes at 110bps. + +Four decades later, I can collaborate on creations with the entire world and home connectivity has increased 7+ orders of magnitude, but part of me still misses those Saturday afternoons hunched over the keyboard, getting thoroughly trounced by my little brother at something truly terrible we created together. —[Jeremy Stanley][2] + +* * * + +*What was your first programming language? *My first language was BASIC, which I learned in 7th grade. + +*Were you paid to learn it? *Not unless you count being allowed to play Wolfenstein 3D, Minecraft, and Sim City in the computer lab at lunch as a perk for being interested enough in computer science to learn BASIC for fun. + +*Did you choose it? *I don't think I was aware enough at the time to realize there might have been alternatives. This was what was available in the computer lab, and some older students knew enough about it to get me into it. I don't remember it even being part of the computer science class curriculum. + +*Why? *At the time, it was just for fun. I used it exclusively to create text-based "Choose Your Own Adventure"-style games. Something about creating something artistic and fun from code and having the computer run it appealed to me.  I'd used computers before, but this was the first time I made it do something for me. + +*What happened next? *Perhaps not-so-coincidentally, I've used "Choose Your Own Adventure"-style games to teach myself every one of the programming languages I've learned the rest of my life. + +This experience and the first exploration of computer games (both commercial and self-written) started me down a path toward getting involved in computers more deeply, always at school until my family bought our first computer when I was in 11th grade.  Three years later, I translated this exploration into my first computer job as an intern for a research company that eventually hired me for my first "real" job out of college—working in their IT Support group. + +I credit BASIC (and Sim City) with starting me down the path toward where I am now as an SRE, writing code and running clusters daily, some 30 years later. —[Chris Collins][3] + +* * * + +*What was your first programming language? *I played with BASIC, but my first formal introduction was PL/I—learned it in my first programming course in college. —[Heidi Ellis][4] + +* * * + +*What was your first programming language? *My first programming language was BASIC. This was in 1981. I learned it because I bought a home computer that booted into a BASIC editor, a TRS-80 Color Computer. It had a whopping 4K of RAM (not a typo) and could store programs on a cassette tape. I wanted to make the computer do things, so I learned how to instruct it using language it understood. Once you tap, for the first time, into that feeling of joy when your program runs successfully, the elation takes over, and you find yourself wanting to experience it again. Next thing you know, 40 years have passed. —[Matthew Helmke][5] + +* * * + +*What was your first programming language? *My first programming language was BASIC. It was part of a computer science class I took in my first semester of college in 1977, so I was not paid to learn it nor did I choose it. But I always thought it was a great first step since it taught me how to think like a computer (and I had a good teacher). It didn't lead to anything right away as I went to graduate school in Economics, but years later I was an IT Project Manager. So I never was a coder, but I managed a few. —[Kevin O'Brien][6] + +* * * + +*What was your first programming language? *BASIC + +*Were you paid to learn it? *No. + +*Did you choose it? *It was built into the Apple ][ computer my Mom brought home for the summer, and my choices were limited. + +*Why? *It was either BASIC or 6502 Assembly, and BASIC seemed more attainable to sixth-grade-me. + +*What happened next? *I went to the public library and found all the back issues of "Byte" magazine with source listings for Apple ][ programs. I spent a lot of time typing in programs that I could barely follow and learning the joys of debugging someone else's code (ok, I'm pretty sure I introduced most of the bugs). I was hooked. Several years later, senior-in-high-school me was very surprised and excited to learn that you could major in something called "computer science." The rest was history. —[Erik O'Shaughnessy][7] + +* * * + +*What was your first programming language? *Fortran IV—tells you something about how long ago this was. + +*Were you paid to learn it? *No, this was part of my first computer science course in college, so I guess that means I paid to learn it. This was on a mainframe, so after writing your program on paper, you bought your blank IBM punchcards, sat down at a keypunch to punch them out, then had to submit your collection of punchcards as a "job." Then the next day, you got your cards back with a printout from a line printer. If your program didn't run, you got nothing, or you might get pages and pages if you managed to create some sort of never-ending loop. + +*What happened next? *At the tail end of college, they began using _Watfor_, a Fortran implementation from the University of Waterloo in Canada. Its advantage was that you could use it on a terminal, saving your programs on the central system, rather than the punchcards we loved so well. So you could run your program yourself and create your never-ending loops right away. Whoopee! + +After Fortran, the next language that caught my eye was BASIC, which was a lot like Fortran, but handled strings much better. Fortran was awful with strings. This was mostly on an Amiga. + +After switching to Linux, my next language was Perl, which oddly enough seemed like a fairly easy transition from BASIC. After Perl, came Python, a language less stiff with syntax. —[Gregory Pittman][8] + +* * * + +*What was your first programming language? *Waterloo Fortran IV in 1974-5, my first computer science course—taken in the second year—back when I was sorta sure I wanted to major in computer science. We also learned a bit about IBM 360/370 assembler later in the year. Back in those days, the lower-year courses at UBC used keypunches, and there was a "student terminal" where you would cue up with your deck of cards and exchange a "blue ticket" for a run of your deck, then walk around behind the IBM line printer to pick up your output. If you were careless or distracted you might put your deck on top of the printer—even though there was a sign saying "don't put your card deck on top of the printer, in case it opens"—and of course if you did, the printer would that very moment run out of paper or have a jam and obligingly raise its lid, which caused your card deck to spill to the floor and become an unorganized mess. + +In my third year, still in computer science, I took a bunch of courses—the mainstream third-year course featuring PL/I, a one-semester 360/370 Assembler course, the two honors courses on computational theory, a numerical analysis course, "the twelve languages of MTS," and a bunch of math courses. + +In my fourth year, I was hired by the applied math institute as a research assistant. At that point, I was getting paid for writing Fortran programs for a small group of mathematicians mostly interested in solving differential equations. Also, by then, I realized that computer science wasn't for me, and I had switched to math. I did continue to take some computer science courses—optimization, more numerical analysis. Looking back, those were my first steps down the data science pathway. + +My first post-university job was programming, mostly in Fortran and in PL/I and SPSS, a statistics language. As well, I learned how to use MPSX, an IBM linear programming utility. —[Chris Hermansen][9] + +* * * + +*What was your first programming language? *In high school, a teacher who had zero experience with computers was asked to teach computer programming as part of an experiment: My school had not tried this before. Xerox Corp. provided the school with a Model-33 teletype and a 110-baud acoustic coupled modem, which gave us access to their XDS Sigma 7 mainframe running the CP-5 time-sharing system. BASIC was the order of the day. + +_Were you paid to learn it?_ Do grades count? + +*What happened next? *A few of us started "poking a stick" at the machine to see what would happen if we didn't type "BASIC" at the prompt... which lead us to discover that there were _other_ languages! And other stuff too! If I recall, there were (at least) three separate Fortran compilers—Fortran, FLAG (Fortran Load And Go—which compiled lightning-quick, or what passed for "quick" in the day), and at the opposite end EFFORT—or possibly EFORT, but pronounced "effort." S-L-O-W to compile, but it did what appeared to be, to our young eyes, amazing optimization of the code. Also, a brief foray with a "weird" keyboard with all sorts of symbols, and APL, where backspace was not used to erase anything but to overstrike operators to make other operators. —[Kevin Cole][10] + +* * * + +*What was your first programming language? *Atari PILOT and Atari BASIC. My family bought an Atari 1200XL when I was a kid, and while I started out just using it for games and some art programs, there were two cartridges that my Dad said were "for adults" and "I wouldn't like them because they're not for kids."  So obviously, I was incredibly curious. One day I decided to check them out. I was totally confused at first but then found the book that he had about them, and I typed in the sample code and thought it was really cool that I could make things happen. I never was able to write anything entirely on my own, but I took the sample code and just changed parts until I either got it to do something else or broke it and had to undo those changes. I've been meaning to try it out again and see how much I remember, but I just haven't had the time. —[JT Pennington][11] + +* * * + +*What was your first programming language? *ELAN. It was a superb language for the time. It is important to note it was tightly coupled with the OS EUMEL so we could do parallel computing. + +_Were you paid to learn it?_ It was an after-school activity. + +*Did you choose it? *No. + +*Why? *I wanted to learn piano, and my parents said I would get one if I take a typewriter course. Next door was the after-school computer club. I thought that was more interesting. Unfortunately, I still don't know how to play the piano as computers kept me busy till today. + +*What happened next? *When I started at the university, they still had punch cards and Fortran. I was lucky as the high school teacher allowed me to use the parallel computer at the high school for programming. In between, I also tried BASIC, but that was just inferior and boring. I then looked at Pascal, which was not any better than ELAN. After C, Modula-2, and Ada, I finally found Occam and did lots of stuff in Occam on transputers. That was exciting as we could do more parallel computing. Having access to 64 of them was pretty cool. Also, plugging in various network configurations was exciting. This was decades ago. I see a difference between yesteryear's high school students and today's. While we initially had few resources (I could not afford a computer till I was in my fourth year at university), today's computers are commodities. Furthermore, the combination of computers and robotics such as FLL (FIRST Lego League) makes it possible to lower the entry barrier. However, today also students are distracted by accessibility to video games and access to very cool graphics. Ready-made products  (videogames, cell phones, tablets) may limit the available "time" today's students have to learn computer science in their free time. I have to admit that if I would have been offered today's video games when I grew up, I may have had a very different outlook on computer science and may not have been labeled by my high schoolmates "nerd,"  but the video gamer. + +Unfortunately, I have no time to do video games as my RTX3090 plays AI algorithms … The toy I really want for me is an A100 and a DGX which I use now remotely. I would argue that due to Google colab and accessibility via Jupyter, access to AI can be lowered to the high school level. However, this all depends on the high school teacher that introduces you to it. If you just have one that teaches you block-programming instead of, for example, Python on the lego robots or one that uses scratch instead of Google colab, then we do not leverage the potential that these students have in their early years and can leverage this superb infrastructure. —[Gregor von Laszewski][12] + +* * * + +*What was your first programming language? *I got into Logo on an Apple, a computer language developed at MIT by Seymour Papert and others in 1967. It was a language designed for education. It's a subset of Lisp. + +I learned it as part of a graduate education program I was involved with at the time. As part of that program, I taught geometry to a fifth-grade student using the Logo programming language. While teaching this student the computer language and the curriculum, I discovered that my own trouble and learned helplessness with mathematics came from an inability to visualize the material. After completing the graduate course, I used the Logo language to teach other students geometry and mathematics using the same curriculum and programming language. The students and I learned math and developed some beautiful graphics in the process, and we actually programmed a 'turtle' robot that drew our images on large pieces of paper on the classroom floor. My experience with programming led me to look for other ways to bring mathematics to life for students, which led me to Python and the "turtle' module. Lately, I've been teaching students how to write Python programs that feature an 'on-screen' turtle robot that can create beautiful graphics while at the same time introducing those students to the Python language and logical thinking skills. —[Donald Watkins][13] + +* * * + +*What was your first programming language? *ZX81 BASIC.  + +I was still at school, probably aged 10 or 11, when a friend got a ZX81—so I taught myself BASIC and wrote a couple of simple programs I could try out on his machine. Christmas 1982, I got my own ZX81 and pretty soon outgrew the hardware and moved onto a ZX Spectrum in late 1993, by which time I was also programming a little in Z80 assembly. + +A couple of years later, I also picked up an early CASIO handheld that ran BASIC. It was one of the PB series, possibly the PB-200, but I can't remember the exact model version. I managed to convince my teachers to let me use it for my O-Level math exam at the age of 16 in the UK. I did take a look at some other languages but didn't really learn any until I started on Ada at university. —[Steven Ellis][14] + +* * * + +*What was your first programming language? *My first ever programming language was BASIC in the early eighties. + +One of my relatives bought a C64 for their kids to get started with learning computers. They only used it for gaming, and I was also invited. But they also had a book about BASIC, and I was curious and gave it a try. I wrote some shortcode, I did not even know how to save it, but it was exciting to see that the computer does what I say to it. This means that I was not paid to learn it, and it was not my choice. It was the language available to me. Obviously, when I got my first computer a few years later, an XT compatible box, I first wrote some code in GW-BASIC, the dialect of BASIC available with DOS. + +*What happened next? *The first time I really choose a programming language was Pascal. I asked around, checked some books, and it seemed to be a good compromise between features and difficulty. First, it was Turbo Pascal, and I coded all kinds of simple games and graphics in it. I loved Pascal, so in my university years, I even used it (well, FreePascal and Lazarus) for measurement automation and modeling how pollution spreads in groundwater. —[Peter Czanik][15] + +* * * + +*What was your first programming language? *The language of the Casio fx-7200G ([a variant of][16]). I don't think it has its own name. + +*Were you paid to learn it? *No. + +*Did you choose it? *No. + +*Why? *I got this programmable calculator (the box said "computer"...) for my 13th birthday. + +*What happened next? *A year later, first high-school year, I studied their Pascal, even though we didn't have books for it—the main Pascal book our teacher recommended was university-level, considered by him to be a bit too hard for us—and the main text we used for theory and exercises was actually using BASIC, so I also learned some BASIC (unintentionally, at least from the teacher's POV). + +I considered myself a latecomer—some kids in my class had computers with BASIC (commodore 64, Spectrum Sinclair, Amstrad) at home, and I already knew a bit of BASIC before high school, and along the first years, there was a semi-tension between us—me, and those who knew BASIC and didn't appreciate the advantages of Pascal. + +Later on, I went to university (math and computer science), where students could use DOS PCs or a few Macintoshes, or terminals (text ones, X Terminals if you were lucky and one was available), mainly to connect to shared SunOS 4 machines. In my second year (in 1993), someone told me about Linux, which I could run at home. I already bought myself a newer PC (an AMD 386SX-compatible. Only after I "decommissioned" it, ~ 8 years later, I realized it was AMD and not an Intel 386, which is what I thought I was buying) before knowing about Linux, learning my 8088 PC isn't suitable for running more modern OSes, and so I tried Linux, which it took me several months to get installed with only 2MB RAM—soon after that, I upgraded to 4MB and then seldom rebooted to DOS (which I kept as a dual-boot option for several years). I still remember my astonishment and excitement at being able to run a UNIX-like OS, even with X windows (after upgrading to 4MB RAM), all at home. + +In terms of languages, in the university, we studied/used Pascal (first intro course), C (intro to systems programming course), and then some course-specific ones—Eiffel (in the OOP course), MatLab (for a workshop), etc. + +My first real job was in a project written on Unix (we used mainly DECstation machines with Ultrix), mainly in Lisp (Lucid Common Lisp) and C, where I studied Lisp, and from which I still have very good memories, even though I never used it later. I managed to make the project semi-work on a PC with Linux, as a personal side project, using a copy of LCL for SCO Unix, which I managed to make work on Linux with the `ibcs2` module and recompiling GNU `libc` with a cross-compiler toolchain (`GCC/as/ld` on Linux to generate COFF binaries for SCO). I was quite proud to demonstrate the application to my manager—something which normally needed a workstation costing ~ $30K, running on a $5K PC. But this never went to production. —[Yedidyah Bar David][17] + +* * * + +*What was your first programming language? *TI-BASIC + +*Were you paid to learn it? *No, but then, I was 10. + +*Did you choose it? *No. + +*Why? *It was the only language available on the TI-99/4A! Well, there was the "Extended Basic," too, but that was just an extended instruction set. You could actually write decent games in 16Kb of RAM. + +*What happened next? *The next step was to type in programs that were shipped in print magazines and record them on audio cassette tapes. But with my brother, we took that one step further—we went live on radio to broadcast the resulting sound for others to record! With a clear recording and enough error correction, you could distribute and download programs wirelessly back in 1985. —[Thierry Carrez][18] + +* * * + +*What was your first programming language? *GW-BASIC + +*Did you choose it? *No. + +_Why?_ It was standard education for beginners. + +*What happened next? *I started in a company for computer hardware specialist. —[Hüseyin GÜÇ][19] + +* * * + +*What was your first programming language? *BASIC, on the VIC-20. + +*Were you paid to learn it? *Nope. + +*Did you choose it? *Only insofar as I chose the computer. + +*Why? *I figured that the VIC would be at least mostly compatible with the PET I had seen in school. Also, it had a decent keyboard. + +*What happened next? *Those were the days of programming because there was no other way to do anything with it—learned a lot. —[Bob Murphy][20] + +* * * + +*What was your first programming language? *It was the year 2004-05 if I recall. I was in school, maybe a fifth-grader, I was introduced to BASIC. Before that, I had learned a little bit of something called "Window Logo." + +*Were you paid to learn it? *My parents paid for my school. + +*Did you choose it? *Not at all. + +*Why? *Part of the curriculum my school decided on. + +*What happened next? *It definitely piqued my interest in programming, and I went on to learn C/C++ through extra-curricular courses outside of my school. My parents encouraged it and managed to pay extra fees somehow. I often ended up as the only "kid" in the entire computer institute. I was the only one learning a programming language while others mostly learned MS Office or PhotoShop etc. LOL. Well, the rest is history. —[Kedar Vijay Kulkarni][21] + +* * * + +*What was your first programming language? *Fortran, because I'm old. + +*Were you paid to learn it? *No, I paid to learn it by taking a computer science class. + +*Did you choose it? *No, it was the only choice. I was lucky that we had terminals to work on instead of the punchcards that my poor husband used when he learned how to program in Fortran. + +*Why? *I was a humanities major (English and Anthropology double major), and I was getting close to graduation and actually having to find a JOB. I figured a computer class might make that possible. As it has turned out, that particular programming class was one of the more valuable ones that I took in terms of marketable skills. It provided a good foundation for learning Python, understanding Git, and editing and writing documentation for Red Hat. + +*What happened next? *I went home and taught myself BASIC on the TI-99 that my parents had bought (I'm not sure why they bought it, though—maybe for my little brother?). That early foundation in Fortran (of all things) made it easier to use the early PCs before Windows existed because I could figure out DOS. A humble beginning for sure. —[Ingrid Towey][22] + +* * * + +*What was your first programming language? *In 2001, I learned Java SE 1.2 by reading the book _Goto Java_ from Addison-Wesley. + +*Were you paid to learn it? *No, I was still in school. + +*Did you choose it? *Yes. + +*Why? *I wanted to create interactive websites with Java Applets. + +*What happened next? *I went to college and got in touch with FOSS and learned ANSI C. —[Joël Krähemann][23] + +* * * + +*What was your first programming language? * + +I was going to write an article for this, but I already wrote that one: [You don't need a computer science degree to work with open source software (6 Aug 2020)][24]. + +Highlights from that article: + +Our parents bought an Apple II+ clone called the Franklin ACE 1000. My brother and I taught ourselves how to program in AppleSoft BASIC. Our parents bought us books, and we devoured them. I learned every corner of BASIC by reading about something in the book, then writing a practice program. My favorite pastime was writing simulations and games. + +I stayed with BASIC for a long time. But I began to learn other programming languages when I entered university. I was a physics student, and as part of our numerical analysis prerequisite, we had to learn Fortran. Having already learned BASIC, I thought Fortran was pretty easy to pick up. Fortran and BASIC were very similar, although Fortran was more limited in my experience. + +My brother was a computer science major at a different university, and he introduced me to the C programming language. I immediately loved working in C! It was a straightforward programming language that gave me a ton of flexibility for writing useful programs. But I didn't have room in my degree program to take a class that didn't apply to my physics major. So, instead, I taught myself C by reading books and combing through the library reference guide. Each time I wanted to learn a new topic, I looked it up in the reference guide and wrote a practice program to exercise my new knowledge. + +Over time, I leveraged what I'd learned to pick up other programming languages. I wrote a ton of Unix Korn shell scripts, Linux Bash scripts, and AWK scripts. I wrote small utilities in Perl, and later wrote Perl CGI and PHP pages for websites. I learned enough LISP to tweak my copy of GNU Emacs, and enough Scheme to work on a project that used GNU Guile. —[Jim Hall][25] + +* * * + +*What was your first programming language? *My first programming language was BASIC, Atari BASIC to be exact. + +My family had an Atari 400 home computer in the early 1980s. I played games on it, but it also came with a cartridge for the BASIC language. It included a cassette recorder (Atari 1010). In those days, programs could be stored on standard audio cassette tapes. The Atari 400 didn't have internal storage, so I learned how to save my programs to cassette and later reload them. In addition to the usual "Hello World" programs, I wrote some that allowed for controlling sound and graphics using a joystick. I still remember the PEEK and POKE commands needed for setting and retrieving certain settings, such as a color or a sound setting. + +_Were you paid to learn it?_ No. + +_Did you choose it?_ Yes, it was the one language included with the Atari, so I decided to give it a try—and I did enjoy programming it. + +*What happened next? *After a while, I guess I lost interest in Atari and computer gaming altogether. It wasn't until the mid-nineties that I became interested in computers and programming again when I attended computer science classes to earn a minor in CS. Those courses taught me languages such as C and Assembly and many general computer and networking skills. I later learned Java as part of my Master's degree. I have only done a small amount of formal coding during my career, mostly a little Java in a ColdFusion environment in the mid-2000s. In terms of coding, shell scripting has been my mainstay, mostly BASH and Windows, but I have coded for specific purposes whenever needed. I've used Job Control Language (JCL) for automating file transfers between mainframe systems. I've also used Python to feed REST API query results back to an enterprise monitoring dashboard. I still think that early experience with BASIC was valuable because I gained a respect for software and programming. —[Alan Formy-Duval][26] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/first-programming-language + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) +[2]: https://opensource.com/users/fungi +[3]: https://opensource.com/users/clcollins +[4]: https://opensource.com/users/heidi-jc-ellis +[5]: https://opensource.com/users/matthew-helmke +[6]: https://opensource.com/users/ahuka +[7]: https://opensource.com/users/jnyjny +[8]: https://opensource.com/users/greg-p +[9]: https://opensource.com/users/clhermansen +[10]: https://opensource.com/users/kjcole +[11]: https://opensource.com/users/jtpennington +[12]: https://opensource.com/users/laszewski +[13]: https://opensource.com/users/don-watkins +[14]: https://opensource.com/users/steven-ellis +[15]: https://opensource.com/users/czanik +[16]: https://en.wikipedia.org/wiki/Casio_fx-7000G +[17]: https://opensource.com/users/didib +[18]: https://opensource.com/users/thierry-carrez +[19]: https://opensource.com/users/hguc +[20]: https://opensource.com/users/murph +[21]: https://opensource.com/users/kkulkarn +[22]: https://opensource.com/users/i-towey +[23]: https://opensource.com/users/joel2001k +[24]: https://opensource.com/article/20/8/learn-open-source +[25]: https://opensource.com/users/jim-hall +[26]: https://opensource.com/users/alanfdoss From 84803e866627541093bfb851f8047cb59467584e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 17 Aug 2021 05:04:53 +0800 Subject: [PATCH 065/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210816=20?= =?UTF-8?q?Parse=20command-line=20arguments=20with=20argparse=20in=20Pytho?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210816 Parse command-line arguments with argparse in Python.md --- ...-line arguments with argparse in Python.md | 168 ++++++++++++++++++ 1 file changed, 168 insertions(+) create mode 100644 sources/tech/20210816 Parse command-line arguments with argparse in Python.md diff --git a/sources/tech/20210816 Parse command-line arguments with argparse in Python.md b/sources/tech/20210816 Parse command-line arguments with argparse in Python.md new file mode 100644 index 0000000000..28ed8e6b4a --- /dev/null +++ b/sources/tech/20210816 Parse command-line arguments with argparse in Python.md @@ -0,0 +1,168 @@ +[#]: subject: "Parse command-line arguments with argparse in Python" +[#]: via: "https://opensource.com/article/21/8/python-argparse" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Parse command-line arguments with argparse in Python +====== +Use the argparse module to enable options in your Python applications. +![Python options][1] + +There are several third-party libraries for command-line argument parsing, but the standard library module `argparse` is no slouch either. + +Without adding any more dependencies, you can write a nifty command-line tool with useful argument parsing. + +### Argument parsing in Python + +When parsing command-line arguments with `argparse`, the first step is to configure an `ArgumentParser` object. This is often done at the global module scope since merely _configuring_ the parser has no side effects. + + +``` +import argparse + +PARSER = argparse.ArgumentParser() +``` + +The most important method on `ArgumentParser` is `.add_argument()`. It has a few variants. By default, it adds an argument that expects a value. + + +``` +`PARSER.add_argument("--value")` +``` + +To see it in action, call the method `.parse_args()`: + + +``` +`PARSER.parse_args(["--value", "some-value"])`[/code] [code]`Namespace(value='some-value')` +``` + +It's also possible to use the syntax with `=`: + + +``` +`PARSER.parse_args(["--value=some-value"])`[/code] [code]`Namespace(value='some-value')` +``` + +You can also specify a short "alias" for a shorter command line when typed into the prompt: + + +``` +`PARSER.add_argument("--thing", "-t")` +``` + +It's possible to pass either the short option: + + +``` +`PARSER.parse_args("-t some-thing".split())`[/code] [code]`Namespace(value=None, thing='some-thing')` +``` + +or the long one: + + +``` +`PARSER.parse_args("--thing some-thing".split())`[/code] [code]`Namespace(value=None, thing='some-thing')` +``` + +### Types + +There are more types of arguments available. The two most popular ones, after the default, are boolean and counting. The booleans come with a variant that defaults to true, and one that defaults to false. + + +``` +PARSER.add_argument("--active", action="store_true") +PARSER.add_argument("--no-dry-run", action="store_false", dest="dry_run") +PARSER.add_argument("--verbose", "-v", action="count") +``` + +This means that `active` is `False` unless `--active` is passed, and `dry_run` is `True` unless `--no-dry-run` is passed. Short options without value can be juxtaposed. + +Passing all the arguments results in a non-default state: + + +``` +`PARSER.parse_args("--active --no-dry-run -vvvv".split())`[/code] [code]`Namespace(value=None, thing=None, active=True, dry_run=False, verbose=4)` +``` + +The default is somewhat less exciting: + + +``` +`PARSER.parse_args("".split())`[/code] [code]`Namespace(value=None, thing=None, active=False, dry_run=True, verbose=None)` +``` + +### Subcommands + +Though classic Unix commands "did one thing, and did it well," the modern tendency is to do "several closely related actions." + +The examples of `git`, `podman`, and `kubectl` can show how popular the paradigm is. The `argparse` library supports that too: + + +``` +MULTI_PARSER = argparse.ArgumentParser() +subparsers = MULTI_PARSER.add_subparsers() +get = subparsers.add_parser("get") +get.add_argument("--name") +get.set_defaults(command="get") +search = subparsers.add_parser("search") +search.add_argument("--query") +search.set_defaults(command="search") + +[/code] [code]`MULTI_PARSER.parse_args("get --name awesome-name".split())`[/code] [code]`Namespace(name='awesome-name', command='get')`[/code] [code]`MULTI_PARSER.parse_args("search --query name~awesome".split())`[/code] [code]`Namespace(query='name~awesome', command='search')` +``` + +### Anatomy of a program + +One way to use `argparse` is to structure the program as follows: + + +``` +## my_package/__main__.py +import argparse +import sys + +from my_package import toplevel + +parsed_arguments = toplevel.PARSER.parse_args(sys.argv[1:]) +toplevel.main(parsed_arguments) + +[/code] [code] + +## my_package/toplevel.py + +PARSER = argparse.ArgumentParser() +## .add_argument, etc. + +def main(parsed_args): + +    ... + +    # do stuff with parsed_args +``` + +In this case, running the command is done with `python -m my_package`. Alternatively, you can use the [`console_scripts`][2] entry points in the package's setup. + +### Summary + +The `argparse` module is a powerful command-line argument parser. There are many more features that have not been covered here. The limit is your imagination. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/python-argparse + +作者:[Moshe Zadka][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/bitmap_0.png?itok=PBXU-cn0 (Python options) +[2]: https://python-packaging.readthedocs.io/en/latest/command-line-scripts.html#the-console-scripts-entry-point From c4211b73ef126dbd271e52e7a352b53ea4614703 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 17 Aug 2021 08:56:50 +0800 Subject: [PATCH 066/290] translated --- ...812 A Java developer-s guide to Quarkus.md | 51 ------------------- ...812 A Java developer-s guide to Quarkus.md | 50 ++++++++++++++++++ 2 files changed, 50 insertions(+), 51 deletions(-) delete mode 100644 sources/tech/20210812 A Java developer-s guide to Quarkus.md create mode 100644 translated/tech/20210812 A Java developer-s guide to Quarkus.md diff --git a/sources/tech/20210812 A Java developer-s guide to Quarkus.md b/sources/tech/20210812 A Java developer-s guide to Quarkus.md deleted file mode 100644 index 9bb9b7b3ca..0000000000 --- a/sources/tech/20210812 A Java developer-s guide to Quarkus.md +++ /dev/null @@ -1,51 +0,0 @@ -[#]: subject: "A Java developer's guide to Quarkus" -[#]: via: "https://opensource.com/article/21/8/java-quarkus-ebook" -[#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -A Java developer's guide to Quarkus -====== -A new eBook demonstrates how developers can keep using the Java -framework to build new serverless functions. -![Coffee beans and a cup of coffee][1] - -[Serverless][2] architecture has already become an efficient solution to align overprovisioning and underprovisioning resources (e.g., CPU, memory, disk, networking) with actual workloads regardless of physical servers, virtual machines, and cloud environments. Yet, there is a concern for Java developers when choosing new programming languages to develop serverless applications. The Java framework seems too heavyweight and slow for serverless deployment on the cloud, especially [Kubernetes][3]. - -What if you, Java developer, could keep using the Java framework to build traditional cloud-native microservices as well as new serverless functions at the same time? This approach should be exciting since you don’t have to worry about a steep learning curve for new serverless application frameworks. - -Furthermore, what if the Java framework could not only provide developers the joy of familiar technologies but also optimize Java serverless functions in Kubernetes by milliseconds at startup and offer tiny memory footprints? - -### What is Quarkus? - -[Quarkus][4] is the new Java framework that can provide these features and benefits to Java developers, enterprise architects, and DevOps engineers. It aims to design serverless applications and write cloud-native microservices for running on cloud infrastructures (for example, Kubernetes). - -Quarkus also supports a portable Java API extension named [Funqy][5] for developers to write and deploy serverless functions to heterogeneous serverless runtimes. - -Quarkus Funqy enables developers to bind [CloudEvents][6] for handling reactive streams with serverless functions on the Knative environment. This is beneficial for developers building a common messaging format to describe events and increase interoperability among multi- and hybrid cloud platforms. - -Start your journey with Quarkus with the help of my new eBook, [**A guide to Java serverless functions**][7]. Share your Quarkus experiences with others so everyone can enjoy serverless development with Java and Quarkus. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/java-quarkus-ebook - -作者:[Daniel Oh][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/daniel-oh -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) -[2]: https://opensource.com/article/21/1/devapps-strategies -[3]: https://opensource.com/article/19/6/reasons-kubernetes -[4]: https://quarkus.io/ -[5]: https://quarkus.io/guides/funqy -[6]: https://cloudevents.io/ -[7]: https://opensource.com/downloads/java-serverless-ebook diff --git a/translated/tech/20210812 A Java developer-s guide to Quarkus.md b/translated/tech/20210812 A Java developer-s guide to Quarkus.md new file mode 100644 index 0000000000..c85f9b6ead --- /dev/null +++ b/translated/tech/20210812 A Java developer-s guide to Quarkus.md @@ -0,0 +1,50 @@ +[#]: subject: "A Java developer's guide to Quarkus" +[#]: via: "https://opensource.com/article/21/8/java-quarkus-ebook" +[#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Quarkus 的 Java 开发者指南 +====== +一本新的展示了开发者如何继续使用 Java 框架来构建新的无服务器功能的电子书。 +![Coffee beans and a cup of coffee][1] + +[无服务器][2]架构已经成为一种高效的解决方案,无论物理服务器、虚拟机还是云环境,都可以根据实际工作负载调整超额配置和不足配置资源(如 CPU、内存、磁盘、网络)。然而,在选择新的编程语言来开发无服务器应用时,Java 开发者有一个担忧。对于云上的无服务器部署,尤其是 [Kubernetes][3],Java 框架似乎过于沉重和缓慢。 + +如果是你,作为 Java 开发者,可以继续使用 Java 框架来构建传统的云原生微服务以及同时构建新的无服务器功能呢?这种方法应该是令人兴奋的,因为你不必担心新的无服务器应用框架的学习曲线会很陡峭。 + +此外,如果 Java 框架不仅可以为开发者提供熟悉技术的乐趣,还可以在启动时以毫秒为单位优化 Kubernetes 中的 Java 无服务器功能,并提供微小的内存足迹,会怎样? + +### 什么是 Quarkus? + +[Quarkus][4] 是一个新的 Java 框架,可以为 Java 开发者、企业架构师和 DevOps 工程师提供这些功能和好处。它旨在设计无服务器应用,并编写云原生微服务,以便在云基础设施(例如 Kubernetes)上运行。 + +Quarkus 还支持一个名为 [Funqy][5] 的可移植 Java API 扩展,供开发者编写和部署无服务器功能到异构无服务器运行时。 + +Quarkus Funqy 使开发者能够将 [CloudEvents][6] 与 Knative 环境中的无服务器函数绑定,以处理反应式流。这有利于开发者建立一个通用的消息传递格式来描述事件,提高多云和混合云平台之间的互操作性。 + +在我的新电子书 [**Java 无服务器功能指南**][7]的帮助下,开始你的 Quarkus 之旅。与他人分享你的 Quarkus 经验,让大家都能享受到用 Java 和 Quarkus 进行的无服务器开发。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/java-quarkus-ebook + +作者:[Daniel Oh][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/daniel-oh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) +[2]: https://opensource.com/article/21/1/devapps-strategies +[3]: https://opensource.com/article/19/6/reasons-kubernetes +[4]: https://quarkus.io/ +[5]: https://quarkus.io/guides/funqy +[6]: https://cloudevents.io/ +[7]: https://opensource.com/downloads/java-serverless-ebook From 52ffee6ece9241ef94eb371b3900516c61a113f7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 17 Aug 2021 08:57:40 +0800 Subject: [PATCH 067/290] Rename sources/tech/20210816 What was your first programming language.md to sources/talk/20210816 What was your first programming language.md --- .../20210816 What was your first programming language.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210816 What was your first programming language.md (100%) diff --git a/sources/tech/20210816 What was your first programming language.md b/sources/talk/20210816 What was your first programming language.md similarity index 100% rename from sources/tech/20210816 What was your first programming language.md rename to sources/talk/20210816 What was your first programming language.md From 5b6704209083e76aa1cbf6e992edd6f524bf794e Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 17 Aug 2021 09:00:09 +0800 Subject: [PATCH 068/290] translating --- .../tech/20210815 Schedule a task with the Linux at command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210815 Schedule a task with the Linux at command.md b/sources/tech/20210815 Schedule a task with the Linux at command.md index 0b191e2c58..dbec0b7ab3 100644 --- a/sources/tech/20210815 Schedule a task with the Linux at command.md +++ b/sources/tech/20210815 Schedule a task with the Linux at command.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-at-command" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 6f366ada5ca4a5fb1f1a776bd21b9a1e8f1409e4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 17 Aug 2021 10:05:41 +0800 Subject: [PATCH 069/290] PRF&PUB @geekpi https://linux.cn/article-13690-1.html --- ...812 A Java developer-s guide to Quarkus.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) rename {translated/tech => published}/20210812 A Java developer-s guide to Quarkus.md (59%) diff --git a/translated/tech/20210812 A Java developer-s guide to Quarkus.md b/published/20210812 A Java developer-s guide to Quarkus.md similarity index 59% rename from translated/tech/20210812 A Java developer-s guide to Quarkus.md rename to published/20210812 A Java developer-s guide to Quarkus.md index c85f9b6ead..cee601ce54 100644 --- a/translated/tech/20210812 A Java developer-s guide to Quarkus.md +++ b/published/20210812 A Java developer-s guide to Quarkus.md @@ -3,20 +3,22 @@ [#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13690-1.html" -Quarkus 的 Java 开发者指南 +下载《Quarkus 的 Java 开发者指南》电子书 ====== -一本新的展示了开发者如何继续使用 Java 框架来构建新的无服务器功能的电子书。 -![Coffee beans and a cup of coffee][1] -[无服务器][2]架构已经成为一种高效的解决方案,无论物理服务器、虚拟机还是云环境,都可以根据实际工作负载调整超额配置和不足配置资源(如 CPU、内存、磁盘、网络)。然而,在选择新的编程语言来开发无服务器应用时,Java 开发者有一个担忧。对于云上的无服务器部署,尤其是 [Kubernetes][3],Java 框架似乎过于沉重和缓慢。 +> 一本新的展示了开发者如何继续使用 Java 框架来构建新的无服务器功能的电子书。 -如果是你,作为 Java 开发者,可以继续使用 Java 框架来构建传统的云原生微服务以及同时构建新的无服务器功能呢?这种方法应该是令人兴奋的,因为你不必担心新的无服务器应用框架的学习曲线会很陡峭。 +![](https://img.linux.net.cn/data/attachment/album/202108/17/100432yslvlw6s2d462w41.jpg) -此外,如果 Java 框架不仅可以为开发者提供熟悉技术的乐趣,还可以在启动时以毫秒为单位优化 Kubernetes 中的 Java 无服务器功能,并提供微小的内存足迹,会怎样? +[无服务器][2] 架构已经成为一种高效的解决方案,无论是物理服务器、虚拟机还是云环境,都可以根据实际工作负载调整超额配置和不足配置资源(如 CPU、内存、磁盘、网络)。然而,在选择新的编程语言来开发无服务器应用时,Java 开发者有一个担忧。对于云上的无服务器部署,尤其是 [Kubernetes][3],Java 框架似乎过于沉重和缓慢。 + +作为 Java 开发者,如果可以继续使用 Java 框架来构建传统的云原生微服务以及同时构建新的无服务器功能呢?这种方法应该是令人兴奋的,因为你不必担心新的无服务器应用框架的学习曲线会很陡峭。 + +此外,如果 Java 框架不仅可以为开发者提供熟悉技术的乐趣,还可以在启动时以毫秒为单位优化 Kubernetes 中的 Java 无服务器功能,并提供微小的内存足迹,又会怎样? ### 什么是 Quarkus? @@ -26,7 +28,7 @@ Quarkus 还支持一个名为 [Funqy][5] 的可移植 Java API 扩展,供开 Quarkus Funqy 使开发者能够将 [CloudEvents][6] 与 Knative 环境中的无服务器函数绑定,以处理反应式流。这有利于开发者建立一个通用的消息传递格式来描述事件,提高多云和混合云平台之间的互操作性。 -在我的新电子书 [**Java 无服务器功能指南**][7]的帮助下,开始你的 Quarkus 之旅。与他人分享你的 Quarkus 经验,让大家都能享受到用 Java 和 Quarkus 进行的无服务器开发。 +在我的新电子书 《[Java 无服务器功能指南][7]》的帮助下,开始你的 Quarkus 之旅。与他人分享你的 Quarkus 经验,让大家都能享受到用 Java 和 Quarkus 进行的无服务器开发。 -------------------------------------------------------------------------------- @@ -35,7 +37,7 @@ via: https://opensource.com/article/21/8/java-quarkus-ebook 作者:[Daniel Oh][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 72504f16f08d1478ea44baa9f3620fef42f5f33f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 17 Aug 2021 10:47:36 +0800 Subject: [PATCH 070/290] PRF @YungeG --- ...ed hardware on Linux with systemd-udevd.md | 54 +++++++++---------- 1 file changed, 24 insertions(+), 30 deletions(-) diff --git a/translated/tech/20200204 Managing your attached hardware on Linux with systemd-udevd.md b/translated/tech/20200204 Managing your attached hardware on Linux with systemd-udevd.md index b09ac2babf..c68a48897d 100644 --- a/translated/tech/20200204 Managing your attached hardware on Linux with systemd-udevd.md +++ b/translated/tech/20200204 Managing your attached hardware on Linux with systemd-udevd.md @@ -1,37 +1,37 @@ [#]: collector: (lujun9972) [#]: translator: (YungeG) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Managing your attached hardware on Linux with systemd-udevd) [#]: via: (https://opensource.com/article/20/2/linux-systemd-udevd) [#]: author: (David Clinton https://opensource.com/users/dbclinton) -在 Linux 使用 systemd-udevd 管理你的附加硬件 + +在 Linux 使用 systemd-udevd 管理你的接入硬件 ====== -使用 udev 管理你的 Linux 系统处理物理设备的方式。 -![collection of hardware on blue backround][1] -Linux 能够出色地自动从不计其数的设备厂商中识别、加载、并暴露硬件设备。事实上,很多年以前,正是这个特性说服我,坚持让我的雇员将整个基础架构转换到 Linux。痛点在于 Redmond 的某家公司不能在我们的 Compaq 台式机加载集成网卡的驱动,而 Linux 可以轻松实现这一点。 +> 使用 udev 管理你的 Linux 系统处理物理设备的方式。 +![](https://img.linux.net.cn/data/attachment/album/202108/17/104654z1evcdx41xfc4zpq.jpg) -从那以后的岁月里,已识别设备的 Linux 库随着驱动加载流程复杂度的增加与日俱增,而 [udev][2] 就是解决这个问题的希望之星。udev 负责监听 Linux 内核发出的改变设备状态的事件。这里的设备可能是一个插入或拔出的新 USB 设备,或者是一个因浸入洒出的咖啡中而脱机的无线鼠标。 +Linux 能够出色地自动识别、加载、并公开接入的无数厂商的硬件设备。事实上,很多年以前,正是这个特性说服我,坚持让我的雇主将整个基础设施转换到 Linux。痛点在于 Redmond 的某家公司(LCTT 译注:指微软)不能在我们的 Compaq 台式机上加载集成网卡的驱动,而 Linux 可以轻松实现这一点。 -In the years since then, Linux's library of recognized devices has grown enormously along with the sophistication of the process. And the star of that show is [udev][2]. Udev's job is to listen for events from the Linux kernel involving changes to the state of a device. It could be a new USB device that's plugged in or pulled out, or it might be a wireless mouse going offline as it's drowned in spilled coffee. +从那以后的岁月里,Linux 的识别设备库随着该过程的复杂化而与日俱增,而 [udev][2] 就是解决这个问题的希望之星。udev 负责监听 Linux 内核发出的改变设备状态的事件。它可能是一个新 USB 设备被插入或拔出,也可能是一个无线鼠标因浸入洒出的咖啡中而脱机。 -udev 负责处理所有状态变更,比如指定访问设备使用的名称和权限。这些更改的记录可以通过 [dmesg][3] 获取。由于 dmesg 的输出通常有几千行,对结果进行过滤通常是聪明的选择。下面的例子说明了 Linux 如何识别我的 WiFi 接口。这个例子展示了我的无线设备使用的芯片组(**ath9k**)、启动过程早期阶段分配的原始名称(**wlan0**)、以及正在使用的又臭又长的永久名称(**wlxec086b1ef0b3**): +udev 负责处理所有的状态变更,比如指定访问设备使用的名称和权限。这些更改的记录可以通过 [dmesg][3] 获取。由于 dmesg 的输出通常有几千行,对结果进行过滤通常是聪明的选择。下面的例子说明了 Linux 如何识别我的 WiFi 接口。这个例子展示了我的无线设备使用的芯片组(`ath9k`)、启动过程早期阶段分配的原始名称(`wlan0`)、以及正在使用的又臭又长的永久名称(`wlxec086b1ef0b3`): ``` $ dmesg | grep wlan [    5.396874] ath9k_htc 1-3:1.0 wlxec086b1ef0b3: renamed from wlan0 ``` -我将在这篇文章中讨论为何每个人都可能想要使用一个类似的名称。在这个过程中,我会探索剖析 udev 的配置文件,然后展示如何更改 udev 的设置,包括编辑系统命名设备的方式。这篇文件基于我的新课程中的一个模块,[Linux 系统优化][4]。 +在这篇文章中,我会讨论为何有人想要使用这样的名称。在这个过程中,我会探索剖析 udev 的配置文件,然后展示如何更改 udev 的设置,包括编辑系统命名设备的方式。这篇文件基于我的新课程中《[Linux 系统优化][4]》的一个模块。 ### 理解 udev 配置系统 -使用 systemd 的机器上,udev 操作由 **systemd-udevd** 守护进程管理,你可以通过常规的 systemd 方式使用 **systemctl status systemd-udevd** 检查 udev 守护进程的状态。 +使用 systemd 的机器上,udev 操作由 `systemd-udevd` 守护进程管理,你可以通过常规的 systemd 方式使用 `systemctl status systemd-udevd` 检查 udev 守护进程的状态。 -严格来说,udev 试图将收到的每个系统事件与 **/lib/udev/rules.d/** 和 **/etc/udev/rules.d/** 目录下找到的规则进行匹配。规则文件包括匹配键和分配键,可用的匹配键包括 **action**、**name**、和 **subsystem**。这意味着如果探测到一个属于某个子系统的、带有特定名称的设备,就会给设备指定一个预设的配置。 +严格来说,udev 的工作方式是试图将它收到的每个系统事件与 `/lib/udev/rules.d/` 和 `/etc/udev/rules.d/` 目录下找到的规则集进行匹配。规则文件包括匹配键和分配键,可用的匹配键包括 `action`、`name` 和 `subsystem`。这意味着如果探测到一个属于某个子系统的、带有特定名称的设备,就会给设备指定一个预设的配置。 接着,“分配”键值对被拿来应用想要的配置。例如,你可以给设备分配一个新名称、将其关联到文件系统中的一个符号链接、或者限制为只能由特定的所有者或组访问。这是从我的工作站摘出的一条规则: @@ -52,9 +52,9 @@ ACTION=="add", SUBSYSTEM=="net", SUBSYSTEMS=="usb", NAME=="", \     IMPORT{builtin}="net_id", NAME="$env{ID_NET_NAME_MAC}" ``` -**add** 动作告诉 udev,只要新插入的设备属于网络子系统,*并且*是一个 USB 设备,就执行操作。此外,如果我理解正确的话,只有设备的 MAC 地址由特定范围内的字符组成,并且 **80-net-setup-link.rules** 和 **99-default.link** 文件*不*存在时,规则才会生效。 +`add` 动作告诉 udev,只要新插入的设备属于网络子系统,*并且*是一个 USB 设备,就执行操作。此外,如果我理解正确的话,只有设备的 MAC 地址由特定范围内的字符组成,并且 `80-net-setup-link.rules` 和 `99-default.link` 文件*不*存在时,规则才会生效。 -假定所有的条件都满足,接口 ID 会变成设备的 MAC 地址。还记得之前的 dmesg 信息显示我的接口名称从 **wlan0** 改成了讨厌的 **wlxec086b1ef0b3** 吗?那都是这条规则的功劳。我怎么知道?因为 **ec:08:6b:1e:f0:b3** 是设备的 MAC 地址(不包括冒号)。 +假定所有的条件都满足,接口 ID 会改变以匹配设备的 MAC 地址。还记得之前的 dmesg 信息显示我的接口名称从 `wlan0` 改成了讨厌的 `wlxec086b1ef0b3` 吗?那都是这条规则的功劳。我怎么知道?因为 `ec:08:6b:1e:f0:b3` 是设备的 MAC 地址(不包括冒号)。 ``` $ ifconfig -a @@ -70,20 +70,15 @@ wlxec086b1ef0b3: flags=4163  mtu 1500 Linux 默认包含这条 udev 规则,我不需要自己写。但是为什么费力进行这样的命名呢——尤其是看到这样的接口命名这么难使用后?仔细看一下包含在规则中的注释: -``` -# Use MAC based names for network interfaces which are directly or indirectly -# on USB and have an universally administered (stable) MAC address (second bit -# is 0). Don't do this when ifnames is disabled via kernel command line or -# customizing/disabling 99-default.link (or previously 80-net-setup-link.rules). -``` +> 对直接或间接插入在 USB 上的网络接口使用基于 MAC 的名称,并且用一个普遍提供的(稳定的)MAC 地址(第二位是 0)。当 ifnames 通过内核命令行或 `customizing/disabling 99-default.link`(或之前的 `80-net-setup-link.rules`)被禁用时,不要这样做。 -留意一下这个规则是如何专为基于 USB 的网络接口设计的。和 PCI 网络接口卡(NICs)不同,USB 设备很可能时不时地被移除或者替换,这意味着无法保证它们的 ID 不变。某一天 ID 可能是 **wlan0**,第二天却变成了 **wlan3**。为了避免迷惑应用程序,指定绝对 ID 给设备——就像分配给我的 USB 接口的 ID。 +注意,这个规则专为基于 USB 的网络接口设计的。和 PCI 网络接口卡(NIC)不同,USB 设备很可能时不时地被移除或者替换,这意味着无法保证它们的 ID 不变。某一天 ID 可能是 `wlan0`,第二天却变成了 `wlan3`。为了避免迷惑应用程序,指定绝对 ID 给设备——就像分配给我的 USB 接口的 ID。 ### 操作 udev 的设置 -下一个示例中,我将从 [VirtualBox][5] 虚拟机里抓取以太网接口的 MAC 地址和当前 ID,然后用这些信息创建一个改变接口 ID 的 udev 新规则。为什么这么做?也许我打算从命令行操作设备,需要输入那么长的名称让人十分烦恼。下面是工作原理。 +下一个示例中,我将从 [VirtualBox][5] 虚拟机里抓取以太网接口的 MAC 地址和当前接口 ID,然后用这些信息创建一个改变接口 ID 的 udev 新规则。为什么这么做?也许我打算从命令行操作设备,需要输入那么长的名称让人十分烦恼。下面是工作原理。 -改变 ID 之前,我需要关闭 [Netplan][6] 当前的网络配置,促使 Linux 使用新的配置。下面是 **/etc/netplan/** 目录下我的当前网络接口配置文件: +改变接口 ID 之前,我需要关闭 [Netplan][6] 当前的网络配置,促使 Linux 使用新的配置。下面是 `/etc/netplan/` 目录下我的当前网络接口配置文件: ``` $ less /etc/netplan/50-cloud-init.yaml @@ -100,12 +95,11 @@ network:     version: 2 ``` - -**50-cloud-init.yaml** 文件包含一个非常基本的接口定义,但是注释中也包含一些关闭配置的重要信息。为此,我将移动到 **/etc/cloud/cloud.cfg.d** 目录,创建一个名为 **/etc/cloud/cloud.cfg.d** 的新文件,插入 **network: {config: disabled}** 字符串。 +`50-cloud-init.yaml` 文件包含一个非常基本的接口定义,但是注释中也包含一些禁用配置的重要信息。为此,我将移动到 `/etc/cloud/cloud.cfg.d` 目录,创建一个名为 `/etc/cloud/cloud.cfg.d` 的新文件,插入 `network: {config: disabled}` 字符串。 尽管我只在 Ubuntu 发行版上测试了这个方法,但它应该在任何一个带有 systemd 的 Linux(几乎所有的 Linux 发行版都有 systemd)上都可以工作。不管你使用哪个,都可以很好地了解编写 udev 配置文件并对其进行测试。 -接下来,我需要收集一些系统信息。执行 **ip** 命令,显示我的以太网接口名为 **enp0s3**,MAC 地址是 **08:00:27:1d:28:10**。 +接下来,我需要收集一些系统信息。执行 `ip` 命令,显示我的以太网接口名为 `enp0s3`,MAC 地址是 `08:00:27:1d:28:10`。 ``` $ ip a @@ -114,22 +108,22 @@ $ ip a     inet 192.168.0.115/24 brd 192.168.0.255 scope global dynamic enp0s3 ``` -现在,我要在 **/etc/udev/rules.d** 目录创建一个名为 **peristent-net.rules** 的新文件。我将给文件一个以较小的数字 10 开头的名称: +现在,我要在 `/etc/udev/rules.d` 目录创建一个名为 `peristent-net.rules` 的新文件。我将给文件一个以较小的数字开头的名称,比如 10: ``` $ cat /etc/udev/rules.d/10-persistent-network.rules ACTION=="add", SUBSYSTEM=="net",ATTR{address}=="08:00:27:1d:28:10",NAME="eth3" ``` -数字越小,Linux 越早执行文件,我想要这个文件早点执行。文件被添加时,包含其中的代码就会分配名称 **eth3** 给网络设备——只要设备的地址能够匹配 **08:00:27:1d:28:10**,即我的接口的 MAC 地址 。 +数字越小,Linux 越早执行文件,我想要这个文件早点执行。文件被添加时,包含其中的代码就会分配名称 `eth3` 给网络设备——只要设备的地址能够匹配 `08:00:27:1d:28:10`,即我的接口的 MAC 地址 。 -保存文件并重启计算机后,我的新接口名应该就会生效。我可能需要直接登陆虚拟机,使用 **dhclient** 手动让 Linux 为这个新命名的网络请求一个 IP 地址。在执行下列命令前,可能无法打开 SSH 会话: +保存文件并重启计算机后,我的新接口名应该就会生效。我可能需要直接登录虚拟机,使用 `dhclient` 手动让 Linux 为这个新命名的网络请求一个 IP 地址。在执行下列命令前,可能无法打开 SSH 会话: ``` $ sudo dhclient eth3 ``` -大功告成。现在你能够促使 udev 控制计算机按照你想要的方式引用一个 NIC,但更重要的是,你拥有了指明怎样处理*任何*发生故障的设备的工具。 +大功告成。现在你能够促使 udev 控制计算机按照你想要的方式指向一个网卡,但更重要的是,你已经有了一些工具,可以弄清楚如何管理任何不听话的设备。 -------------------------------------------------------------------------------- @@ -138,7 +132,7 @@ via: https://opensource.com/article/20/2/linux-systemd-udevd 作者:[David Clinton][a] 选题:[lujun9972][b] 译者:[YungeG](https://github.com/YungeG) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 48accc4786785d255f8e9a63c2d5f791f0110bb7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 17 Aug 2021 10:48:14 +0800 Subject: [PATCH 071/290] PUB @YungeG https://linux.cn/article-13691-1.html --- ...ging your attached hardware on Linux with systemd-udevd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200204 Managing your attached hardware on Linux with systemd-udevd.md (99%) diff --git a/translated/tech/20200204 Managing your attached hardware on Linux with systemd-udevd.md b/published/20200204 Managing your attached hardware on Linux with systemd-udevd.md similarity index 99% rename from translated/tech/20200204 Managing your attached hardware on Linux with systemd-udevd.md rename to published/20200204 Managing your attached hardware on Linux with systemd-udevd.md index c68a48897d..b9fc40090a 100644 --- a/translated/tech/20200204 Managing your attached hardware on Linux with systemd-udevd.md +++ b/published/20200204 Managing your attached hardware on Linux with systemd-udevd.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (YungeG) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13691-1.html) [#]: subject: (Managing your attached hardware on Linux with systemd-udevd) [#]: via: (https://opensource.com/article/20/2/linux-systemd-udevd) [#]: author: (David Clinton https://opensource.com/users/dbclinton) From 24581060cbefdd78cdcac6eefd3627787580fa9d Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Tue, 17 Aug 2021 20:49:59 +0800 Subject: [PATCH 072/290] translated --- ...ommand options in Java with commons-cli.md | 231 ------------------ ...ommand options in Java with commons-cli.md | 226 +++++++++++++++++ 2 files changed, 226 insertions(+), 231 deletions(-) delete mode 100644 sources/tech/20210813 Parse command options in Java with commons-cli.md create mode 100644 translated/tech/20210813 Parse command options in Java with commons-cli.md diff --git a/sources/tech/20210813 Parse command options in Java with commons-cli.md b/sources/tech/20210813 Parse command options in Java with commons-cli.md deleted file mode 100644 index 9b38440225..0000000000 --- a/sources/tech/20210813 Parse command options in Java with commons-cli.md +++ /dev/null @@ -1,231 +0,0 @@ -[#]: subject: "Parse command options in Java with commons-cli" -[#]: via: "https://opensource.com/article/21/8/java-commons-cli" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Parse command options in Java with commons-cli -====== -Let your users modify how your Java application runs with command-line -options. -![Learning and studying technology is the key to success][1] - -When you enter a command into your terminal, whether it's to launch a GUI app or just a terminal app, there are often [options][2] (sometimes called _switches_ or _flags_) you can use to modify how the application runs. This is a standard set by the [POSIX specification][3], so it's useful for a Java programmer to know how to detect and parse options. - -There are several ways to parse options in Java. My favorite is the [Apache Commons CLI][4] library, called **commons-cli** for short. - -### Installing commons-cli - -If you're using a project management system like [Maven][5] and an IDE, you can install the Apache Commons CLI library in your project properties (such as `pom.xml` or a configuration screen in Eclipse or NetBeans). - -If you're managing libraries manually, you can download [the latest release][6] from the Apache website. Several JAR files come bundled together. The only required JAR is the `commons-cli-X.Y.jar` (where X and Y are the latest version numbers.) Add that JAR to your project, either manually or in your IDE, and then you can use it in your code. - -### Importing a library into your Java code - -To use the **commons-cli** library in your code, you must import it. For this simple option parsing example, you can populate a file called `Main.java` with the standard minimal code: - - -``` -package com.opensource.myoptparser; - -import org.apache.commons.cli.*; - -public class Main { -    public static void main([String][7][] args) { -    // code  -    } -} -``` - -Now you're set to parse options in Java. - -### Defining Boolean options in Java - -The first thing you must do to parse options is to define the valid options your application can accept. Use the `Option` (singular) class to create option objects and the `Options` (plural) class to help keep track of all the options you've created in your project. - -First, create a group for your options, and call it `options` according to convention: - - -``` -    //code -    Options options = new Options(); -``` - -Next, define your individual options by listing a short option, a long option, a default Boolean value, and a help message. You then set whether the option is required or not, and finally add the option to the `options` object, which contains all of your options. In this example, I create just one option, arbitrarily called `alpha`: - - -``` -    //define options -    [Option][8] alpha = new [Option][8]("a", "alpha", false, "Activate feature alpha"); -    options.addOption(alpha); -``` - -### Defining options with arguments in Java - -Sometimes you want users to provide information other than just **true** or **false** along with an option. You might want to let a user refer to a configuration file, an input file, or any setting like a date or a color. For this, you use the `builder` method, creating attributes for an option based on its short version (for example, `-c` is a short option, `--config` is a long option). Once it's defined, you add the new option to your `options` group: - - -``` -    [Option][8] config = [Option][8].builder("c").longOpt("config") -        .argName("config") -        .hasArg() -        .required(true) -        .desc("set config file").build(); -    options.addOption(config); -``` - -With the `builder` function, you can set the short version, long version, whether it's required (I set this to **true** in this code, so my application can't run unless this option is provided by the user at launch time), the help message, and so on. - -### Parsing options with Java - -With all possible options defined, you can now iterate over arguments provided by the user, checking to see whether any argument matches your approved list of valid short options. To do this, you create an instance of the **CommandLine** itself, which contains all arguments provided by the user (valid options and otherwise.) You also create a **CommandLineParser** object, which I call `parser` in my code, to facilitate interaction over those arguments. Finally, you can create a **HelpFormatter** object (which I call `helper`) to automatically provide helpful messages to the user when either a required option is missing, or the `--help` or `-h` option is used. - - -``` -    // define parser -    CommandLine cmd; -    CommandLineParser parser = new BasicParser(); -    HelpFormatter helper = new HelpFormatter(); -``` - -Finally, add some conditionals to analyze the options provided by the user as command-line input (discovered and stored in the `cmd` variable). This sample application has two different types of options, but in both cases, you can check whether the option exists with the `.hasOption` method plus the short option name. When an option is detected, you can do whatever needs to be done with the data. - - -``` -try { -    cmd = parser.parse(options, args); -    if(cmd.hasOption("a")) { -    [System][9].out.println("Alpha activated"); -    } - -    if (cmd.hasOption("c")) { -    [String][7] opt_config = cmd.getOptionValue("config"); -    [System][9].out.println("Config set to " + opt_config); -    } -} catch ([ParseException][10] e) { -    [System][9].out.println(e.getMessage()); -    helper.printHelp("Usage:", options); -    [System][9].exit(0); -} -``` - -The act of parsing potentially generates an error because sometimes the required `-c` or `--config` option could be missing. In that event, a help message is printed, and the application is immediately ended. Because of this error (an _exception_ in Java terminology), you must amend the start of the main method to declare a possible exception: - - -``` -`public static void main(String[] args) throws ParseException {` -``` - -The sample application is now complete. - -### Test your code - -You can test the application in your IDE by adjusting the default parameters passed to your code or just build a JAR file and run it from your terminal. The process for this differs depending on your IDE. Refer to your IDE documentation, read my article on how to LINK-TO-ARTICLE[build a JAR], or see Daniel Oh's article on how to do the same with [Maven][11]. - -First, confirm the parser exception by omitting the required `-c` or `--config` option: - - -``` -$ java -jar dist/myapp.jar                  -Missing required option: c -usage: Usage: - -a,--alpha             Activate feature alpha - -c,--config <config>   Set config file -``` - -Try it again with the options provided: - - -``` -java -jar dist/myantapp.jar --config foo -a -Alpha activated -Config set to foo -``` - -### Option parsing - -Including options for your users is an important feature for any application. Java and the Apache commons make it easy to do. - -Here's the full demonstration code for your reference: - - -``` -package com.opensource.myapp; - -import org.apache.commons.cli.*; - -public class Main { -     -    /** -     * @param args the command line arguments -     * @throws org.apache.commons.cli.ParseException -     */  -    public static void main([String][7][] args) throws [ParseException][10] { -        // define options -        Options options = new Options(); -         -        [Option][8] alpha = new [Option][8]("a", "alpha", false, "Activate feature alpha"); -        options.addOption(alpha); -         -        [Option][8] config = [Option][8].builder("c").longOpt("config") -                .argName("config") -                .hasArg() -                .required(true) -                .desc("Set config file").build(); -        options.addOption(config); -      -        // define parser -        CommandLine cmd; -        CommandLineParser parser = new BasicParser(); -        HelpFormatter helper = new HelpFormatter(); - -        try { -            cmd = parser.parse(options, args); -            if(cmd.hasOption("a")) { -                [System][9].out.println("Alpha activated"); -            } -           -            if (cmd.hasOption("c")) { -                [String][7] opt_config = cmd.getOptionValue("config"); -                [System][9].out.println("Config set to " + opt_config); -            } -        } catch ([ParseException][10] e) { -            [System][9].out.println(e.getMessage()); -            helper.printHelp("Usage:", options); -            [System][9].exit(0); -        } -    } -} -``` - -### Using Java and options - -Options allow users to modify how commands work. There are many ways to parse options when using Java, and the `commons-cli` is a robust and flexible open source solution. Give it a try in your next Java project. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/java-commons-cli - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/studying-books-java-couch-education.png?itok=C9gasCXr (Learning and studying technology is the key to success) -[2]: https://opensource.com/article/21/8/linux-terminal#options -[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[4]: https://commons.apache.org/proper/commons-cli/usage.html -[5]: https://maven.apache.org/ -[6]: https://commons.apache.org/proper/commons-cli/download_cli.cgi -[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+option -[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+parseexception -[11]: https://developers.redhat.com/blog/2021/04/08/build-even-faster-quarkus-applications-with-fast-jar diff --git a/translated/tech/20210813 Parse command options in Java with commons-cli.md b/translated/tech/20210813 Parse command options in Java with commons-cli.md new file mode 100644 index 0000000000..f4789d23ea --- /dev/null +++ b/translated/tech/20210813 Parse command options in Java with commons-cli.md @@ -0,0 +1,226 @@ +[#]: subject: "Parse command options in Java with commons-cli" +[#]: via: "https://opensource.com/article/21/8/java-commons-cli" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 commons-cli 解析 Java 中的命令行选项 +====== +让用户学会用命令行选项调整你的 Java 应用程序运行方式。 +![Learning and studying technology is the key to success][1] + +通常向终端中输入命令时,无论是启动 GUI 应用程序还是仅启动终端应用程序,都可以使用 + + [命令行选项][2](options or switches or flags) + + (**以下简称选项**)来修改应用程序的运行方式。这是 [POSIX 规范][3] 设定的标准,因此能够检测和解析选项对 Java 程序员而言是很有用的技能。 + +Java 中有若干种解析选项的方法,其中我最喜欢用的是 [Apache Commons CLI][4] 库,简称 **commons-cli**。 + +### 安装 commons-cli + +如果你使用类似 [Maven][5] 之类的项目管理系统以及集成开发环境(Integrated Development Environment,简称IDE),可以在项目属性(比如 `pom.xml` 配置文件或者 Eclipse 和 NetBeans 的配置选项卡)中安装 Apache Commons CLI 库。 + +而如果你采用手动方式管理库,则可以从 Apache 网站下载 [该库的最新版本][6]。下载到本地的是几个捆绑在一起的 JAR 文件,你只需要其中的一个文件 `commons-cli-X.Y.jar`(其中 X 和 Y 代指最新版本号)。把这个 JAR 文件或手动或使用 IDE 添加到项目,就可以在代码中使用了。 + +### 将库导入至 Java 代码 + +在使用 **commons-cli** 库之前,必须首先导入它。对于本次选项解析的简单示例而言,可以先在 `Main.java` 文件中简单写入以下标准代码: + +``` +package com.opensource.myoptparser; + +import org.apache.commons.cli.*; + +public class Main { +    public static void main([String][7][] args) { +    // code  +    } +} +``` + +至此在 Java 中解析选项的准备工作已经做好了。 + +### 在 Java 中定义布尔选项 + +要实现解析选项,首先要定义应用程序可接收的有效选项。使用 `Option`(注意是单数)类来创建选项对象,使用 `Options`(注意是复数)类来追踪项目中创建的所有选项。 + +首先为选项创建一个组,按照惯例命名为 `options`: + +``` +    //code +    Options options = new Options(); +``` + +接下来,通过列出短选项(即选项名简写)、长选项(即全写)、默认布尔值(译注:设置是否需要选项参数,指定为 false 时此选项不带参,即为布尔选项)和帮助信息来定义选项,然后设置该选项是否为必需项(译注:下方创建 `alpha` 对象的代码中未手动设置此项),最后将该选项添加到包含所有选项的 `options` 组对象中。在下面几行代码中,我只创建了一个选项,命名为 `alpha`: + +``` +    //define options +    [Option][8] alpha = new [Option][8]("a", "alpha", false, "Activate feature alpha"); +    options.addOption(alpha); +``` + +### 在 Java 中定义带参选项 + +有时用户需要通过选项提供 **true** 或 **false** 以外的信息,比如给出配置文件、输入文件或诸如日期、颜色这样的设置项值。这种情况可以使用 `builder` 方法,根据选项名简写为其创建属性(例如,`-c` 是短选项,`--config` 是长选项)。完成定义后,再将定义好的选项添加到 `options` 组中: + +``` +    [Option][8] config = [Option][8].builder("c").longOpt("config") +        .argName("config") +        .hasArg() +        .required(true) +        .desc("set config file").build(); +    options.addOption(config); +``` + +`builder`函数可以用来设置短选项、长选项、是否为必需项(本段代码中必需项设置为 **true**,也就意味着用户启动程序时必须提供此选项,否则应用程序无法运行)、帮助信息等。 + +### 使用 Java 解析选项 + +定义并添加所有可能用到的选项后,需要对用户提供的参数进行迭代处理,检测是否有参数同预设的有效短选项列表中的内容相匹配。为此要创建 **CommandLine** 命令行本身的一个实例,其中包含用户提供的所有参数(包含有效选项和无效选项)。为了处理这些参数,还要创建一个 **CommandLineParser** 对象,我在代码中将其命名为 `parser`。最后,还可以创建一个 **HelpFormatter** 对象(我将其命名为 `helper`),当参数中缺少某些必需项或者用户使用 `--help` 或 `-h` 选项时,此对象可以自动向用户提供一些有用的信息。 + +``` +    // define parser +    CommandLine cmd; +    CommandLineParser parser = new BasicParser(); +    HelpFormatter helper = new HelpFormatter(); +``` + +最后,添加一些条件判断来分析用户提供的选项,我们假设这些选项已经作为命令行输入被获取并存储在 `cmd` 变量中。这个示例应用程序有两种不同类型的选项,但对这两种类型都可以使用 `.hasOption` 方法加上短选项名称来检测选项是否存在。检测到一个存在的选项后,就可以对数据做进一步操作了。 + +``` +try { +    cmd = parser.parse(options, args); +    if(cmd.hasOption("a")) { +    [System][9].out.println("Alpha activated"); +    } + +    if (cmd.hasOption("c")) { +    [String][7] opt_config = cmd.getOptionValue("config"); +    [System][9].out.println("Config set to " + opt_config); +    } +} catch ([ParseException][10] e) { +    [System][9].out.println(e.getMessage()); +    helper.printHelp("Usage:", options); +    [System][9].exit(0); +} +``` + +解析过程有可能会产生错误,因为有时可能缺少某些必需项如本例中的 `-c` 或 `--config` 选项。这时程序会打印一条帮助信息,并立即结束运行。考虑到此错误(Java 术语中称为 _exception_,异常),在 main 方法的开头要添加语句声明可能的异常: + + +``` +public static void main(String[] args) throws ParseException { +``` + +示例程序至此就大功告成了。 + +### 测试代码 + +你可以通过调整传递给代码的默认参数来在 IDE 中测试应用程序,或者创建一个 JAR 文件并在终端运行测试。这个过程可能会因 IDE 的不同而不同。具体请参阅相应的 IDE 文档,以及我写过的关于如何创建 JAR 文件的文章,或者参考 Daniel Oh 的关于如何使用 [Maven][11] 执行同样操作的文章。 + +首先,省略必需项 `-c` 或 `--config` 选项,检测解析器的异常处理: + +``` +$ java -jar dist/myapp.jar                  +Missing required option: c +usage: Usage: + -a,--alpha             Activate feature alpha + -c,--config <config>   Set config file +``` + +然后提供输入选项再进行测试: + +``` +java -jar dist/myantapp.jar --config foo -a +Alpha activated +Config set to foo +``` + +### 选项解析 + +为用户提供选项功能对任何应用程序来说都是很重要的。有了 Java 和 Apache Commons,要实现这个功能并不难。 + +以下是完整的演示代码,供读者参考: + + +``` +package com.opensource.myapp; + +import org.apache.commons.cli.*; + +public class Main { +     +    /** +     * @param args the command line arguments +     * @throws org.apache.commons.cli.ParseException +     */  +    public static void main([String][7][] args) throws [ParseException][10] { +        // define options +        Options options = new Options(); +         +        [Option][8] alpha = new [Option][8]("a", "alpha", false, "Activate feature alpha"); +        options.addOption(alpha); +         +        [Option][8] config = [Option][8].builder("c").longOpt("config") +                .argName("config") +                .hasArg() +                .required(true) +                .desc("Set config file").build(); +        options.addOption(config); +      +        // define parser +        CommandLine cmd; +        CommandLineParser parser = new BasicParser(); +        HelpFormatter helper = new HelpFormatter(); + +        try { +            cmd = parser.parse(options, args); +            if(cmd.hasOption("a")) { +                [System][9].out.println("Alpha activated"); +            } +           +            if (cmd.hasOption("c")) { +                [String][7] opt_config = cmd.getOptionValue("config"); +                [System][9].out.println("Config set to " + opt_config); +            } +        } catch ([ParseException][10] e) { +            [System][9].out.println(e.getMessage()); +            helper.printHelp("Usage:", options); +            [System][9].exit(0); +        } +    } +} +``` + +### 使用 Java 和选项 + +选项使用户可以调整命令的工作方式。使用 Java 时解析选项的方法有很多,其中之一的 `commons-cli` 是一个强大而灵活的开源解决方案。记得在你的下一个 Java 项目中尝试一下哦。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/java-commons-cli + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[unigeorge](https://github.com/unigeorge) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/studying-books-java-couch-education.png?itok=C9gasCXr (Learning and studying technology is the key to success) +[2]: https://opensource.com/article/21/8/linux-terminal#options +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: https://commons.apache.org/proper/commons-cli/usage.html +[5]: https://maven.apache.org/ +[6]: https://commons.apache.org/proper/commons-cli/download_cli.cgi +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[8]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+option +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[10]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+parseexception +[11]: https://developers.redhat.com/blog/2021/04/08/build-even-faster-quarkus-applications-with-fast-jar From ef40463a5bdeb7065be355300c538676037cc48b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 18 Aug 2021 05:02:33 +0800 Subject: [PATCH 073/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210816=20?= =?UTF-8?q?Barrier:=20an=20introduction?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210816 Barrier- an introduction.md --- .../tech/20210816 Barrier- an introduction.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20210816 Barrier- an introduction.md diff --git a/sources/tech/20210816 Barrier- an introduction.md b/sources/tech/20210816 Barrier- an introduction.md new file mode 100644 index 0000000000..a13bb6ce62 --- /dev/null +++ b/sources/tech/20210816 Barrier- an introduction.md @@ -0,0 +1,140 @@ +[#]: subject: "Barrier: an introduction" +[#]: via: "https://fedoramagazine.org/barrier-an-introduction/" +[#]: author: "Matthew Darnell https://fedoramagazine.org/author/zexcon/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Barrier: an introduction +====== + +![][1] + +Background for cover image excerpted from photo by [Peter Hulce][2] on [Unsplash][3] + +### What is barrier? + +To reduce the number of keyboards and mice you can get a physical KVM switch but the down side to the physical KVM switch is it requires you to select a device each time you want to swap. _barrier_ is a virtual KVM switch that allows one keyboard and mouse to control anything from 2-15 computers and you can even have a mix of linux, Windows or Mac. + +Don’t confuse Keyboard, Video and Mouse (KVM) with Kernel Virtual Machine (KVM) they are very different and this article will be covering the former. If the Kernel Virtual Machine topic is of interest to you read through this Red Hat article that provides an overview of the latter type of KVM. + +### Installing barrier on Fedora Linux (KDE Plasma) + +Enter **Alt+Ctrl+T** to display the terminal screen and you will enter the following to download _barrier_ from the Fedora system repository. + +``` +$ sudo dnf install barrier +``` + +### Installing barrier on Windows and Mac + +If you are looking to install on alternate operating systems you can find the Windows and Mac downloads here: . + +### Nuances of version 2.3.3 + + * **barrier does not support Wayland**, the default display protocol used in both Gnome and KDE, so you will need to switch your desktop to use the X11 protocol to use barrier. + * If you are unable to move your mouse from the host to a client computer, make sure you do not have scroll lock enabled. If scroll lock is enabled it will prevent the pointer from moving to a client. + * When using more then one Linux machine, verify you are using the same version of _barrier_ on each one (thanks to @ilikelinux for pointing this requirement out). If you need to check your version enter the following at the terminal. + + + +``` +$ dnf list barrier +``` + +![][4] + +### To use X11 in KDE: + + 1. Select the Fedora icon in the bottom left + 2. Select _Leave_ on the bottom right of the menu + 3. Select _Log Out_ + 4. Select _OK_ + 5. Select _Desktop Session_ on the bottom left side of the screen and select _X11_ + 6. Log back in + + + +### Set up your barrier host + +At the command line type _barrier_ and the main screen will display. + +``` +$ barrier +``` + + 1. Select the check box next to _Server (share this computer’s mouse and keyboard)_ + 2. Click the _Configure Server…_ button + + + +![Barrier][5] + +You should now be on the _Screens and links_ tab. Here you will see a recycle icon on the top left and a blue monitor icon on the top right. + +To add a client, drag the blue monitor icon to the location you want your monitor to be when you move the mouse from your host to client device. Think of this as how you would want a multi-monitor setup to appear. + +If you want to remove one drag the blue monitor to the recycle bin. + +![Barrier Server Configuration][6] + +After you have setup a client in the location grid, double click the same icon to open the _Screen Settings_ dialog box. + +![Barrier Screen Settings][7] + + 1. Fill in the _Screen name_ field with whatever name you would like. + 2. Under _Aliases_ type a different name and select _Add_. + + + +At this point, your host is ready to go and you can click the _Start_ button on the bottom right of the screen. + +![Barrier][8] + +**Note:** Depending on your current [firewall configuration][9], you might need to add an exception for the _synergy_ service so that network connections to that port (24800/tcp) can get through to your barrier server. You probably want to restrict this access to only a select few source IP addresses (barrier clients). + +### Set up your barrier client + +The _barrier_ client side setup is very simple. + + 1. Start _barrier_ on the client machine. + 2. Select the check box next to _Client (use another computer’s mouse and keyboard)_ + 3. From the host computer you can look at the _IP addresses_ field and copy its value to the _Server IP_ field on the client. + 4. Click _Start_ on the bottom right. + + + +![Client on Microsoft Windows 10][10] + +### Conclusion + +From this point on, you can move your mouse between each computer you added and even copy and paste text back and forth just like they are on the same computer. _barrier_ has numerous options you can use to tweak the program under the _Hotkeys_ and _Advanced server settings_ tabs on the host. Now that you are up and running, go ahead and spend time messing around with different options to see what suites you best. + +**Note:** barrier requires that the remote host has a physical display (or perhaps a HDMI dummy plug). Some quick searching suggests that there might be ways to create a “virtual” display such that the remote host can run “headless”. But doing so is an extremely technical process that is beyond the scope of this article. See [here][11] for an example. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/barrier-an-introduction/ + +作者:[Matthew Darnell][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/zexcon/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/barrier-816x345.jpg +[2]: https://unsplash.com/@phd?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/brick-wall?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierInstall-1.png +[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierHostMain.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierHostConfig.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierHostScreenSettings.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierHostMain-1.png +[9]: https://opensource.com/article/18/9/linux-iptables-firewalld +[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierClient-1.png +[11]: https://joonas.fi/2020/12/attach-a-keyboard-to-a-docker-container/ From 1a016737aecc77607dd266a6ce292302b0d64dd0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 18 Aug 2021 05:02:43 +0800 Subject: [PATCH 074/290] add done: 20210816 Barrier- an introduction.md --- sources/tech/20210818 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210818 .md diff --git a/sources/tech/20210818 .md b/sources/tech/20210818 .md new file mode 100644 index 0000000000..8f29ee11e7 --- /dev/null +++ b/sources/tech/20210818 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/migrate-from-centos-8-to-rocky-linux/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/migrate-from-centos-8-to-rocky-linux/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From f996607928b574d937225af46092bfd3e7b72f9b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 18 Aug 2021 05:03:04 +0800 Subject: [PATCH 075/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210817=20?= =?UTF-8?q?4=20alternatives=20to=20cron=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210817 4 alternatives to cron in Linux.md --- ...0210817 4 alternatives to cron in Linux.md | 72 +++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 sources/tech/20210817 4 alternatives to cron in Linux.md diff --git a/sources/tech/20210817 4 alternatives to cron in Linux.md b/sources/tech/20210817 4 alternatives to cron in Linux.md new file mode 100644 index 0000000000..5f2cdc7752 --- /dev/null +++ b/sources/tech/20210817 4 alternatives to cron in Linux.md @@ -0,0 +1,72 @@ +[#]: subject: "4 alternatives to cron in Linux" +[#]: via: "https://opensource.com/article/21/7/alternatives-cron-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 alternatives to cron in Linux +====== +There are a few other open source projects out there that can be used +either in conjunction with cron or instead of cron. +![Alarm clocks with different time][1] + +The [Linux `cron` system][2] is a time-tested and proven technology. However, it's not always the right tool for system automation. There are a few other open source projects out there that can be used either in conjunction with `cron` or instead of `cron`. + +### Linux at command + +`Cron` is intended for long-term repetition. You schedule a job, and it runs at a regular interval from now until the computer is decommissioned. Sometimes you just want to schedule a one-off command to run at a time you happen not to be at your computer. For that, you can use the `at` command. + +The syntax of `at` is far simpler and more flexible than the `cron` syntax, and it has both an interactive and non-interactive method for scheduling (so you could use `at` to create an `at` job if you really wanted to.) + + +``` +`$ echo "rsync -av /home/tux/ me@myserver:/home/tux/" | at 1:30 AM` +``` + +It feels natural, it's easy to use, and you don't have to clean up old jobs because they're entirely forgotten once they've been run. + +Read more about the [at command][3] to get started. + +### Systemd + +In addition to managing processes on your computer, `systemd` can also help you schedule them. Like traditional `cron` jobs, `systemd` timers can trigger events, such as shell scripts and commands, at specified time intervals. This can be once a day on a specific day of the month (and then, perhaps only if it's a Monday, for example), or every 15 minutes during business hours from 09:00 to 17:00. + +Timers can also do some things that `cron` jobs can't. + +For example, a timer can trigger a script or program to run a specific amount of time _after_ an event, such as boot, startup, completion of a previous task, or even the prior completion of the service unit called by the timer itself! + +If your system runs `systemd`, then you're technically using `systemd` timers already. Default timers perform menial tasks like rotating log files, updating the mlocate database, manage the DNF database, and so on. Creating your own is easy, as demonstrated by David Both in his article [Use systemd timers instead of cronjobs][4]. + +### Anacron + +`Cron` specializes in running a command at a specific time. This works well for a server that's never hibernating or powered down. Still, it's pretty common for laptops and desktop workstations to either intentionally or absent-mindedly turn the computer off from time to time. When the computer's not on, `cron` doesn't run, so important jobs (such as backing up data) get skipped. + +The `anacron` system is designed to ensure that jobs are run periodically rather than on a schedule. This means you can leave a computer off for several days and still count on `anacron` to run essential tasks when you boot it up again. `Anacron` works in tandem with `cron`, so it's not strictly an alternative to it, but it's a meaningful alternative way of scheduling tasks. Many a sysadmin has configured a `cron` job to backup data late at night on a remote worker's computer, only to discover that the job's only been run once in the past six months. `Anacron` ensures that important jobs happen _sometime_ when they can rather than _never_ when they were scheduled. + +Read more about [using anacron for a better crontab][5]. + +### Automation + +Computers and technology are meant to make lives better and work easier. Linux provides its users with lots of helpful features to ensure important operating system tasks get done. Take a look at what's available, and start using these features for your own tasks. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/alternatives-cron-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time) +[2]: https://opensource.com/article/21/7/cron-linux +[3]: https://opensource.com/article/21/7/intro-command +[4]: https://opensource.com/article/20/7/systemd-timers +[5]: https://opensource.com/article/21/2/linux-automation From 58a3bc646a9e4301b2d87e88f6d6f83482273a83 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 18 Aug 2021 05:03:30 +0800 Subject: [PATCH 076/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210818=20?= =?UTF-8?q?Top=209=20Features=20in=20the=20Newly=20Released=20Zorin=20OS?= =?UTF-8?q?=2016=20Linux=20Distribution?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210818 Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution.md --- ...Released Zorin OS 16 Linux Distribution.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/news/20210818 Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution.md diff --git a/sources/news/20210818 Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution.md b/sources/news/20210818 Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution.md new file mode 100644 index 0000000000..c5d5dade29 --- /dev/null +++ b/sources/news/20210818 Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution.md @@ -0,0 +1,126 @@ +[#]: subject: "Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution" +[#]: via: "https://news.itsfoss.com/zorin-os-16-features/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution +====== + +Zorin OS 16 is a gorgeous Linux distribution. With the latest release, there are several helpful feature additions to the distribution. + +While we have [highlighted the key updates in our release coverage][1], I shall focus on some of the best features you can find in Zorin OS 16. + +### 1\. Jelly Mode + +![][2] + +Jelly Mode adds an engaging animation when you minimize or move the window on your screen. + +It is more like a wobble effect when you move the windows and a fluid effect when you minimize or launch an app. + +Unlike other animation improvements, this is quite a pleasing effect to enhance the user experience. + +### 2\. Windows 11-like Layout + +![][3] + +Considering that Windows 11 made a lot of buzz for its launch, it only makes sense for Zorin OS to offers a familiar layout. + +After all, it is one of the best Windows-like Linux distributions out there. + +The Windows 11-like layout is only available in the Zorin Appearance settings for Pro users. So, get the Pro edition if you want to support the development and get access to some extra layouts. + +### 3\. Touchpad Gestures + +If you want to get a seamless touch experience with your laptop/touchpad, Zorin OS 16 is here to the rescue. + +A simple three-finger pinch would help you navigate to the activity overview and dabble between active windows. + +And a four-finger swipe up/down will let you switch between workspaces. + +### 4\. Windows Software Detection + +![][4] + +Zorin OS 16 utilizes a database of popular Windows software to detect if you download a .exe file and want to install it. + +This is incredibly useful for beginners considering that it also informs the alternative or the correct way to install the software on Linux. + +Even if it does not have exact instructions for the Windows software you downloaded, it prompts you to install “**Windows App Support**” when trying to access the .exe file. + +![][5] + +### 5\. New Photos App + +![][6] + +The default photos or image viewer is often untouched when a distribution is updated. But, with Zorin OS 16, you get a more straightforward and clean photo management app. + +You get essential options like cropping, adding filters, enhancing the image, and screencasting to the devices connected to your network. + +### 6\. Flathub Apps + +![][7] + +You no longer need to install Flatpak applications from the terminal separately. Flathub is now included with the Software center. + +So, you can effortlessly search for Flatpak applications right from the Software app. + +### 7\. Taskbar and Dash Customization + +With Zorin OS 16, you get a variety of customization options to tweak the appearance of the taskbar, panel, and dock. + +![][8] + +Starting from the transparency to its position, behavior, size, and more. These options should let you tweak your user experience. + +### 8\. Taskbar Unread Icons and Progress bar + +The taskbar is usually static for most of the Linux distributions. Here, you finally get an unread badge counter in the taskbar, and it also supports a new progress bar for tasks like file transfer. + +The progress bar is a helpful addition, given that you do not have to open the app repeatedly to watch the progress. + +### 9\. New Sound Recorder App + +![][9] + +You do not have to opt for a third-party application to record basic voice-overs, podcasts, or voice notes. + +The built-in sound record app offers a clean and easy-to-use interface. So, it should be a breeze to use it. + +### Wrapping Up + +Have you tried Zorin OS 16 yet? What feature did you find the most useful? Let me know your thoughts in the comments down below. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/zorin-os-16-features/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/zorin-os-16-release/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM0MyIgd2lkdGg9Ijc1MiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMiIgd2lkdGg9IjYxNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= From af7bb9e56dd591849b08e861630c5b71a57aa1e7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 18 Aug 2021 05:03:43 +0800 Subject: [PATCH 077/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210818=20?= =?UTF-8?q?Zorin=20OS=2016=20is=20a=20Visual=20Spectacle!=20You=20Can=20Do?= =?UTF-8?q?wnload=20This=20New=20Linux=20Release=20Right=20Now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210818 Zorin OS 16 is a Visual Spectacle- You Can Download This New Linux Release Right Now.md --- ...wnload This New Linux Release Right Now.md | 144 ++++++++++++++++++ 1 file changed, 144 insertions(+) create mode 100644 sources/news/20210818 Zorin OS 16 is a Visual Spectacle- You Can Download This New Linux Release Right Now.md diff --git a/sources/news/20210818 Zorin OS 16 is a Visual Spectacle- You Can Download This New Linux Release Right Now.md b/sources/news/20210818 Zorin OS 16 is a Visual Spectacle- You Can Download This New Linux Release Right Now.md new file mode 100644 index 0000000000..327bd1e4ae --- /dev/null +++ b/sources/news/20210818 Zorin OS 16 is a Visual Spectacle- You Can Download This New Linux Release Right Now.md @@ -0,0 +1,144 @@ +[#]: subject: "Zorin OS 16 is a Visual Spectacle! You Can Download This New Linux Release Right Now" +[#]: via: "https://news.itsfoss.com/zorin-os-16-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Zorin OS 16 is a Visual Spectacle! You Can Download This New Linux Release Right Now +====== + +Zorin OS 16, one of the most anticipated Linux distros, based on Ubuntu 20.04.3 LTS, has arrived. + +With the latest release, they now offer a new “Pro” edition replacing the “Ultimate” edition that comes loaded with a few applications pre-installed and a couple of extra layouts. + +Moreover, you get technical support for installation if you get the Zorin OS 16 Pro to support the developers. + +The base edition is Zorin OS 16 “Core,” is free, which includes all the essentials. + +In this article, I shall highlight the key new additions along with my initial impressions of Zorin OS 16. + +### Zorin OS 16: What’s New? + +Zorin OS 16 may not be as big of an upgrade compared to [elementary OS 6][1], but there are significant improvements across the board. Let us take a look at them. + +### Refined User Interface + +![][2] + +The user interface remains familiar, but they have revamped the default theme and worked on the animations to present a polished look. + +Subtle differences to the default transparency setting, theme, icons, and animations impact the overall user experience. + +While you can notice the differences with Zorin OS 16 Core, the Pro edition takes it up a notch with the stunning new wallpapers and premium layouts available out-of-the-box. + +### Flatpak Enabled + +![][3] + +Previously, Zorin OS supported snap right out of the box with its Software center. Now, with Zorin OS 16, Flathub has been enabled by default. + +So, you can find plenty of applications available, including Flatpak packages in the Software manager. + +You can even select a different package (if it is available) from the dropdown menu available in the top-right corner (as shown in the screenshot above). + +### Improved Tour Screen + +![][4] + +They have also revamped their welcome screen to help you set up all the important things right from the start. + +You get to configure online accounts, connect your smartphone with Zorin Connect, and get a head start on the available layouts to choose from. + +### Windows 11-like Layout + +![][2] + +In my previous [Zorin OS 16 beta][5] coverage, I mentioned a potential Windows 10X-like layout was in the works. + +Considering that Windows 10X no longer exists, the new layout is an alternative to Windows 11 experience. + +Do note that you need to purchase the Zorin OS 16 Pro if you want to access Windows 11-like layout on your system. + +### New Touchpad Gestures + +For laptop or touchpad users, you can now swipe up/down with four fingers to move between workspaces and pinch using three fingers to open the activities overview. + +### New Sound Recorder App + +![][6] + +A clean sound recording app to help you quickly record voice notes or podcasts without worrying about 3rd party applications. + +### Performance Improvements + +Even though I don’t have a figure, I observed some noticeable performance improvements compared to my experience with Zorin OS 15. + +For instance, switching between different layouts is an entirely seamless experience. + +As a side note, I tested Zorin OS 16 Pro on my desktop with **i5-7400, 16 GB RAM,** and **a GTX 1050ti** graphics card. + +I always have my doubts when it comes to Nvidia driver compatibility. But it worked like a charm. + +The boot menu when installing Zorin OS 16 offered a different option for modern NVIDIA drivers, which is what I chose to install. + +So, yes, **Zorin OS 16’s ISO comes with Nvidia driver support out-of-the-box.** + +### Other Improvements + +![][7] + +There are several other additions to the animation, customization settings, and more with Zorin OS 16. Some of them are: + + * Jelly mode to enable a macOS-like animation when minimizing or opening applications. + * Improved taskbar + * Introduction of fractional scaling + * Active directory domain option in the installer + * New photos app + * Disabled telemetry and tracking in Firefox browser for better privacy + + + +To explore more, you can check out [our Zorin OS 16 features list][8] or go through the [official announcement][9]. + +### Get Zorin OS 16 + +You can download Zorin OS 16 Core for free. If you opt for the Pro edition at **$39**, you also get access to a Pro-lite edition, which will be available to install for old computers. + +The free lite edition and the pro lite version is not yet available and should be coming soon. + +[Zorin OS 16 Download][10] + +What do you think about Zorin OS 16? Share your thoughts in the comments down below. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/zorin-os-16-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/elementary-os-6-release/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://news.itsfoss.com/zorin-os-16-beta/ +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQxNSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: https://news.itsfoss.com/zorin-os-16-features/ +[9]: https://blog.zorin.com/2021/08/17/2021-08-17-zorin-os-16-is-released/ +[10]: https://zorin.com/os/download/ From 2aed4ad38a21ae271c6df5b582a846c10f6a21d4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 18 Aug 2021 08:38:25 +0800 Subject: [PATCH 078/290] translated --- .../tech/20210813 Install Linux with LVM.md | 126 ------------------ .../tech/20210813 Install Linux with LVM.md | 126 ++++++++++++++++++ 2 files changed, 126 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20210813 Install Linux with LVM.md create mode 100644 translated/tech/20210813 Install Linux with LVM.md diff --git a/sources/tech/20210813 Install Linux with LVM.md b/sources/tech/20210813 Install Linux with LVM.md deleted file mode 100644 index e34ae93365..0000000000 --- a/sources/tech/20210813 Install Linux with LVM.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: subject: "Install Linux with LVM" -[#]: via: "https://opensource.com/article/21/8/install-linux-mint-lvm" -[#]: author: "Kenneth Aaron https://opensource.com/users/flyingrhino" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Install Linux with LVM -====== -A tutorial on getting Linux Mint 20.2 working with logical volume -manager (LVM). -![Linux keys on the keyboard for a desktop computer][1] - -A couple of weeks ago, the good folks at [Linux Mint][2] released version 20.2 of their open source operating system. The installer built into the live ISO is excellent and only requires a few clicks to install the OS. You even have a built-in partitioner if you want to customize your partitions. - -The installer is mainly focused on a simple install—define your partitions and install into them. For those wanting a more flexible setup—[logical volume manager][3] (LVM) is the way to go—you benefit from setting up volume groups and define your logical volumes within them. - -LVM is a hard drive management system that allows you to create storage space across multiple physical drives. In other words, you could "tether" a few small drives together so your OS treats them as if they were one drive. Beyond that, it has the advantages of live resizing, file system snapshots, and much more. This article isn't a tutorial on LVM (the web is full of [good information on that already][4].) Instead, I aim to keep this page on topic and focus solely on getting Linux Mint 20.2 working with LVM. - -As a desktop OS, the installer is kept simple, and installing LM 20.2 on LVM is slightly more involved but not too complicated. If you select LVM in the installer, you get a setup that's been defined by the Linux Mint devs, and you have no control over the individual volumes at the time of install. - -However, there's a solution—right there in the live ISO—and that solution only requires a few commands in the terminal to set up the LVM, after which you resume the regular installer to complete the job. - -I'm using Linux Mint 20.2 with the [XFCE desktop][5] for my install, but the procedure is similar for the other LM desktops. - -### Partitioning the drive - -In the Linux Mint live ISO, you have access to Linux command-line tools through the terminal and GUI tools. If you need to do any partition work, you can use the command-line `fdisk` or `parted` commands, or the GUI application `gparted`. I want to keep these instructions simple enough for anyone to follow, so I'll use GUI tools where possible and command-line tools where necessary. - -Start by creating a couple of partitions for the install. - -Using `gparted` (launched from the menu), complete the following: - -First, create a partition of 512 MB of type **FAT32** (this is used to ensure the system is bootable.) 512 MB is overkill for most, and you can get away with 256 MB or even less, but with today's big disks, allocating even 512 MB is not a significant concern. - -![Creating a boot partition][6] - -CC BY-SA Seth Kenlon - -Next, create a partition of the rest of the disk of type `lvm2 pv` (this is where your LVM will be.) - -![Partition layout][7] - -CC BY-SA Seth Kenlon - -Now open a terminal window, and escalate your privileges to root: - - -``` -$ sudo -s -# whoami -root -``` - -Next, you must locate the LVM member (the big partition) you created earlier. Use one of the following commands: `lsblk -f` or `pvs` or `pvscan`. - - -``` -# pvs -PV           VG  Fmt   [...] -/dev/sda2        lvm2  [...] -``` - -In my case, the partition is located at `/dev/sda2`, but you should replace this with whatever you get in your output. - -Now that you know what device designation your partition has, you can create an LVM volume group there: - - -``` -`# vgcreate vg /dev/sda2` -``` - -You can see the details of the volume group you created using `vgs `or `vgscan`. - -Create the logical volumes you want to use during install. I'm keeping it simple by creating one for the root partition (`/`) and one for `swap`, but you can create more as needed (for example, a separate partition for `/home`.) - - -``` -# lvcreate -L 80G -n root vg -# lvcreate -L 16G -n swap vg -``` - -The partition sizes in my examples are arbitrary and based on what I have available. Use partition sizes that make sense for your drive. - -You can view the logical volumes with `lvs` or `lvdisplay`. - -That's it for the terminal. - -### Installing Linux - -Now start the installer program from the desktop icon: - - * Once you get to the **Installation type**, select **Something else**. - * Edit the 512 Mb partition and change it to `EFI`. - * Edit the root LV and change it to `ext4` (or a file system of your choice). Select to mount it as root and select to format it. - * Edit the swap partition and set it as `swap`. - * Continue the install process normally—Linux Mint installer puts the files in the correct places and creates the mount points for you. - - - -That's it—enjoy the power of LVM in your Linux Mint install. - -If ever you need to resize partitions or do any advanced work on the system—you'll be thankful for choosing LVM. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/install-linux-mint-lvm - -作者:[Kenneth Aaron][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/flyingrhino -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://linuxmint.com/ -[3]: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) -[4]: https://opensource.com/business/16/9/linux-users-guide-lvm -[5]: https://opensource.com/article/19/12/xfce-linux-desktop -[6]: https://opensource.com/sites/default/files/boot-part.png (Creating a boot partition) -[7]: https://opensource.com/sites/default/files/part-layout.png (Partition layout) diff --git a/translated/tech/20210813 Install Linux with LVM.md b/translated/tech/20210813 Install Linux with LVM.md new file mode 100644 index 0000000000..ead9b1c9d4 --- /dev/null +++ b/translated/tech/20210813 Install Linux with LVM.md @@ -0,0 +1,126 @@ +[#]: subject: "Install Linux with LVM" +[#]: via: "https://opensource.com/article/21/8/install-linux-mint-lvm" +[#]: author: "Kenneth Aaron https://opensource.com/users/flyingrhino" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 LVM 安装 Linux +====== +一个关于让 Linux Mint 20.2 与逻辑卷管理器(LVM)一起工作的教程。 +![Linux keys on the keyboard for a desktop computer][1] + +几周前,[Linux Mint][2] 的人员发布了他们的开源操作系统的 20.2 版本。Live ISO 中内置的安装程序非常好,只需要点击几下就可以安装操作系统。如果你想定制你的分区,你甚至有一个内置的分区器。 + +安装程序主要集中在简单的安装上:定义你的分区并安装到这些分区。对于那些想要更灵活的设置的人来说,[逻辑卷管理器][3] (LVM)是个不错的选择,你可以通过设置卷组并在其中定义你的逻辑卷。 + +LVM 是一个硬盘管理系统,允许你在多个物理驱动器上创建存储空间。换句话说,你可以把几个小驱动器“拴”在一起,这样你的操作系统就会把它们当作一个驱动器。除此之外,它还有实时调整大小、文件系统快照和更多的优点。这篇文章并不是关于 LVM 的教程(网上已经有很多[这方面不错的信息][4]了)。 相反,我的目标是保持这个页面的主题,只关注让 Linux Mint 20.2 与 LVM 一起工作。 + +作为一个桌面操作系统,安装程序很简单,在 LVM 上安装 LM 20.2 略微复杂一些,但不会太复杂。如果你在安装程序中选择了 LVM,你会得到一个由 Linux Mint 开发者定义的设置,而且你在安装时无法控制各个卷。 + +然而,有一个解决方案:在 Live ISO 中,该方案只需要在终端中的几个命令来设置 LVM,然后你继续使用常规安装程序来完成工作。 + +我安装了 Linux Mint 20.2 和 [XFCE 桌面][5],但其他 LM 桌面的过程也类似。 + +### 分区驱动器 + +在 Linux Mint live ISO 中,你可以通过终端和 GUI 工具访问 Linux 命令行工具。如果你需要做任何分区工作,你可以使用命令行 `fdisk` 或 `parted` 命令,或者 GUI 应用 `gparted`。我想让这些说明简单到任何人都能遵循,所以我会在可能的情况下使用 GUI 工具,在必要时使用命令行工具。 + +首先,为安装创建几个分区。 + +使用 `gparted` (从菜单中启动),完成以下工作: + +首先,创建一个 512MB 的分区,类型为 **FAT32**(这是用来确保系统可启动)。512MB 对大多数人来说是多余的,你可以用 256MB 甚至更少,但在今天的大磁盘中,即使分配 512MB 也不是什么大问题。 + +![Creating a boot partition][6] + +CC BY-SA Seth Kenlon + +接下来,在磁盘的其余部分创建一个 `lvm2 pv` 类型的分区(这是你的 LVM 的位置)。 + +![Partition layout][7] + +CC BY-SA Seth Kenlon + +现在打开一个终端窗口,并将你的权限提升到 root: + + +``` +$ sudo -s +# whoami +root +``` + +接下来,你必须找到你之前创建的 LVM 成员(大分区)。使用下列命令之一: `lsblk -f` 或 `pvs` 或 `pvscan`。 + + +``` +# pvs +PV VG Fmt [...] +/dev/sda2 lvm2 [...] +``` + +在我的例子中,该分区位于 `/dev/sda2`,但你应该用你的输出中得到的内容来替换它。 + +现在你知道了你的分区有哪些设备,你可以在那里创建一个 LVM 卷组: + + +``` +`# vgcreate vg /dev/sda2` +``` + +你可以使用 `vgs` 或 `vgscan` 看到你创建的卷组的细节。 + +创建你想在安装时使用的逻辑卷。为了简单,我分别创建了根分区(`/`)和 `swap` 分区,但是你可以根据需要创建更多的分区(例如,为 `/home` 创建一个单独的分区)。 + + +``` +# lvcreate -L 80G -n root vg +# lvcreate -L 16G -n swap vg +``` + +我的例子中的分区大小是任意的,是基于我可用的。使用对你的硬盘有意义的分区大小。 + +你可以用 `lvs` 或 `lvdisplay` 查看逻辑卷。 + +终端到这就结束了。 + +### 安装 Linux + +现在从桌面上的图标启动安装程序: + + * 进入 **Installation type**,选择 **Something else**。 + * 编辑 512Mb 的分区并将其改为 `EFI`。 + * 编辑根 LV,将其改为 `ext4`(或一个你选择的文件系统)。选择将其挂载为根目录,并选择将其格式化。 + * 编辑交换分区并将其设置为`swap`。 + * 继续正常的安装过程。Linux Mint 安装程序会将文件放在正确的位置并为你创建挂载点。 + + + + +完成了。在你的 Linux Mint 安装中享受 LVM 的强大。 + +如果你需要调整分区大小或在系统上做任何高级工作,你会感谢选择 LVM。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/install-linux-mint-lvm + +作者:[Kenneth Aaron][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/flyingrhino +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://linuxmint.com/ +[3]: https://en.wikipedia.org/wiki/Logical_Volume_Manager_(Linux) +[4]: https://opensource.com/business/16/9/linux-users-guide-lvm +[5]: https://opensource.com/article/19/12/xfce-linux-desktop +[6]: https://opensource.com/sites/default/files/boot-part.png (Creating a boot partition) +[7]: https://opensource.com/sites/default/files/part-layout.png (Partition layout) From e79359d74f0ab9a3f1a10d9ea8d0accb19c2ce72 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 18 Aug 2021 08:41:10 +0800 Subject: [PATCH 079/290] translating --- ...Monitor your Linux system in your terminal with procps-ng.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md b/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md index 8734871b43..d2a78f9192 100644 --- a/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md +++ b/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-procps-ng" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 89496e8dd49bdb9e70c363f4c7bdd495b618291d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 18 Aug 2021 09:51:54 +0800 Subject: [PATCH 080/290] =?UTF-8?q?Revert=20"=E8=87=AA=E5=8A=A8=E9=80=89?= =?UTF-8?q?=E9=A2=98[tech]:=2020210816=20Barrier:=20an=20introduction"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../tech/20210816 Barrier- an introduction.md | 140 ------------------ sources/tech/20210818 .md | 25 ---- 2 files changed, 165 deletions(-) delete mode 100644 sources/tech/20210816 Barrier- an introduction.md delete mode 100644 sources/tech/20210818 .md diff --git a/sources/tech/20210816 Barrier- an introduction.md b/sources/tech/20210816 Barrier- an introduction.md deleted file mode 100644 index a13bb6ce62..0000000000 --- a/sources/tech/20210816 Barrier- an introduction.md +++ /dev/null @@ -1,140 +0,0 @@ -[#]: subject: "Barrier: an introduction" -[#]: via: "https://fedoramagazine.org/barrier-an-introduction/" -[#]: author: "Matthew Darnell https://fedoramagazine.org/author/zexcon/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Barrier: an introduction -====== - -![][1] - -Background for cover image excerpted from photo by [Peter Hulce][2] on [Unsplash][3] - -### What is barrier? - -To reduce the number of keyboards and mice you can get a physical KVM switch but the down side to the physical KVM switch is it requires you to select a device each time you want to swap. _barrier_ is a virtual KVM switch that allows one keyboard and mouse to control anything from 2-15 computers and you can even have a mix of linux, Windows or Mac. - -Don’t confuse Keyboard, Video and Mouse (KVM) with Kernel Virtual Machine (KVM) they are very different and this article will be covering the former. If the Kernel Virtual Machine topic is of interest to you read through this Red Hat article that provides an overview of the latter type of KVM. - -### Installing barrier on Fedora Linux (KDE Plasma) - -Enter **Alt+Ctrl+T** to display the terminal screen and you will enter the following to download _barrier_ from the Fedora system repository. - -``` -$ sudo dnf install barrier -``` - -### Installing barrier on Windows and Mac - -If you are looking to install on alternate operating systems you can find the Windows and Mac downloads here: . - -### Nuances of version 2.3.3 - - * **barrier does not support Wayland**, the default display protocol used in both Gnome and KDE, so you will need to switch your desktop to use the X11 protocol to use barrier. - * If you are unable to move your mouse from the host to a client computer, make sure you do not have scroll lock enabled. If scroll lock is enabled it will prevent the pointer from moving to a client. - * When using more then one Linux machine, verify you are using the same version of _barrier_ on each one (thanks to @ilikelinux for pointing this requirement out). If you need to check your version enter the following at the terminal. - - - -``` -$ dnf list barrier -``` - -![][4] - -### To use X11 in KDE: - - 1. Select the Fedora icon in the bottom left - 2. Select _Leave_ on the bottom right of the menu - 3. Select _Log Out_ - 4. Select _OK_ - 5. Select _Desktop Session_ on the bottom left side of the screen and select _X11_ - 6. Log back in - - - -### Set up your barrier host - -At the command line type _barrier_ and the main screen will display. - -``` -$ barrier -``` - - 1. Select the check box next to _Server (share this computer’s mouse and keyboard)_ - 2. Click the _Configure Server…_ button - - - -![Barrier][5] - -You should now be on the _Screens and links_ tab. Here you will see a recycle icon on the top left and a blue monitor icon on the top right. - -To add a client, drag the blue monitor icon to the location you want your monitor to be when you move the mouse from your host to client device. Think of this as how you would want a multi-monitor setup to appear. - -If you want to remove one drag the blue monitor to the recycle bin. - -![Barrier Server Configuration][6] - -After you have setup a client in the location grid, double click the same icon to open the _Screen Settings_ dialog box. - -![Barrier Screen Settings][7] - - 1. Fill in the _Screen name_ field with whatever name you would like. - 2. Under _Aliases_ type a different name and select _Add_. - - - -At this point, your host is ready to go and you can click the _Start_ button on the bottom right of the screen. - -![Barrier][8] - -**Note:** Depending on your current [firewall configuration][9], you might need to add an exception for the _synergy_ service so that network connections to that port (24800/tcp) can get through to your barrier server. You probably want to restrict this access to only a select few source IP addresses (barrier clients). - -### Set up your barrier client - -The _barrier_ client side setup is very simple. - - 1. Start _barrier_ on the client machine. - 2. Select the check box next to _Client (use another computer’s mouse and keyboard)_ - 3. From the host computer you can look at the _IP addresses_ field and copy its value to the _Server IP_ field on the client. - 4. Click _Start_ on the bottom right. - - - -![Client on Microsoft Windows 10][10] - -### Conclusion - -From this point on, you can move your mouse between each computer you added and even copy and paste text back and forth just like they are on the same computer. _barrier_ has numerous options you can use to tweak the program under the _Hotkeys_ and _Advanced server settings_ tabs on the host. Now that you are up and running, go ahead and spend time messing around with different options to see what suites you best. - -**Note:** barrier requires that the remote host has a physical display (or perhaps a HDMI dummy plug). Some quick searching suggests that there might be ways to create a “virtual” display such that the remote host can run “headless”. But doing so is an extremely technical process that is beyond the scope of this article. See [here][11] for an example. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/barrier-an-introduction/ - -作者:[Matthew Darnell][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/zexcon/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/barrier-816x345.jpg -[2]: https://unsplash.com/@phd?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/brick-wall?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierInstall-1.png -[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierHostMain.png -[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierHostConfig.png -[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierHostScreenSettings.png -[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierHostMain-1.png -[9]: https://opensource.com/article/18/9/linux-iptables-firewalld -[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/BarrierClient-1.png -[11]: https://joonas.fi/2020/12/attach-a-keyboard-to-a-docker-container/ diff --git a/sources/tech/20210818 .md b/sources/tech/20210818 .md deleted file mode 100644 index 8f29ee11e7..0000000000 --- a/sources/tech/20210818 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/migrate-from-centos-8-to-rocky-linux/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/migrate-from-centos-8-to-rocky-linux/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972 From e0992778d91caf5e8359fd492c0fefb76239f822 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 18 Aug 2021 10:26:30 +0800 Subject: [PATCH 081/290] PRF&PUB @geekpi https://linux.cn/article-13694-1.html --- ...807 How to Install Java on Fedora Linux.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) rename {translated/tech => published}/20210807 How to Install Java on Fedora Linux.md (74%) diff --git a/translated/tech/20210807 How to Install Java on Fedora Linux.md b/published/20210807 How to Install Java on Fedora Linux.md similarity index 74% rename from translated/tech/20210807 How to Install Java on Fedora Linux.md rename to published/20210807 How to Install Java on Fedora Linux.md index fad8fe25e2..4a158e5714 100644 --- a/translated/tech/20210807 How to Install Java on Fedora Linux.md +++ b/published/20210807 How to Install Java on Fedora Linux.md @@ -3,13 +3,15 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13694-1.html" 如何在 Fedora Linux 上安装 Java ====== +![](https://img.linux.net.cn/data/attachment/album/202108/18/102444nfsktbup4b7bfp88.jpg) + 不管是爱它还是恨它,都很难避开 Java。 Java 仍然是一种非常流行的编程语言,在学校里教,在企业里用。 @@ -18,14 +20,12 @@ Java 仍然是一种非常流行的编程语言,在学校里教,在企业里 这就变得很混乱,因为围绕着 Java 有很多技术术语。 - * Java 开发工具包(JDK)用于创建 Java 程序 - * Java 运行环境(JRE)或 Java 虚拟机(JVM),用于运行 Java 程序。 + * Java 开发工具包Java Development Kit(JDK)用于创建 Java 程序 + * Java 运行环境Java Runtime Environment(JRE)或 Java 虚拟机(JVM),用于运行 Java 程序。 +除此之外,你还会遇到 [OpenJDK][1] 和 [Oracle Java SE][2]。推荐使用 OpenJDK ,因为它是开源的。如果你有专门的需求,那么你应该选择 Oracle Java SE。 - -除此之外,你还会遇到 [OpenJDK][1] 和 [Oracle Java SE][2]。OpenJDK 是被推荐的,因为它是开源的。如果你有专门的需求,那么你只应该选择 Oracle Java SE。 - -这里还有一件事。即使是 OpenJDK 也有几个版本可供选择。在写这篇文章的时候,Fedora 34 有 OpenJDK 1.8、OpenJDK 11 和 OpenJDK 16 可用。 +还有一件事。即使是 OpenJDK 也有几个版本可供选择。在写这篇文章的时候,Fedora 34 有 OpenJDK 1.8、OpenJDK 11 和 OpenJDK 16 可用。 你可以自行决定想要哪个Java版本。 @@ -49,13 +49,13 @@ java -version sudo dnf search openjdk ``` -这里的sudo不是必须的,但它会刷新 sudo 用户的元数据,这在你安装另一个版本的 Java 时会有帮助。 +这里的 `sudo` 不是必须的,但它会刷新 `sudo` 用户的元数据,这在你安装另一个版本的 Java 时会有帮助。 上面的命令将显示很多输出,其中有很多看起来相似的软件包。你必须专注于最初的几个词来理解不同的版本。 ![Available Java versions in Fedora][4] -例如,要安装 Java 8 (OpenJDK 1.8),包的名字应该是 java-1.8.0-openjdk.x86_64 或者 java-1.8.0-openjdk。用它来安装: +例如,要安装 Java 8(OpenJDK 1.8),包的名字应该是 `java-1.8.0-openjdk.x86_64` 或者 `java-1.8.0-openjdk`。用它来安装: ``` sudo dnf install java-1.8.0-openjdk.x86_64 @@ -73,7 +73,7 @@ sudo dnf install java-1.8.0-openjdk.x86_64 sudo alternatives --config java ``` -你会注意到在 Java 版本前有一个数字。Java 版本前的 + 号表示当前正在使用的 Java 版本。 +你会注意到在 Java 版本前有一个数字。Java 版本前的 `+` 号表示当前正在使用的 Java 版本。 你可以指定这个数字来切换 Java 版本。因此,在下面的例子中,如果我输入 2,它将把系统中的 Java 版本从 Java 11 改为 Java 8。 @@ -88,7 +88,7 @@ via: https://itsfoss.com/install-java-fedora/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6f09cb165f7e7086558a7705cfe16ec8257e9a25 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 18 Aug 2021 10:37:16 +0800 Subject: [PATCH 082/290] APL --- ...s in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md b/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md index 7aeccfbc04..7fcdcf53ab 100644 --- a/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md +++ b/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/debian-11-feature/" [#]: author: "Abhishek https://news.itsfoss.com/author/root/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 33a233dae94b523d84f8da8cedbf21ce8956f2e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 18 Aug 2021 13:59:57 +0800 Subject: [PATCH 083/290] TSL&PRF --- ...eased Debian 11 ‘Bullseye- Linux Distro.md | 127 ------------------ ...eased Debian 11 ‘Bullseye- Linux Distro.md | 122 +++++++++++++++++ 2 files changed, 122 insertions(+), 127 deletions(-) delete mode 100644 sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md create mode 100644 translated/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md diff --git a/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md b/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md deleted file mode 100644 index 7fcdcf53ab..0000000000 --- a/sources/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: subject: "7 New Features in the Newly Released Debian 11 ‘Bullseye’ Linux Distro" -[#]: via: "https://news.itsfoss.com/debian-11-feature/" -[#]: author: "Abhishek https://news.itsfoss.com/author/root/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -7 New Features in the Newly Released Debian 11 ‘Bullseye’ Linux Distro -====== - -The much awaited release of Debian 11 codenamed Bullseye is finally here after two years of development. The release will be supported for the next five years like any other Debian stable version release. - -Excited about it? Let’s see what’s new in Debian 11. - -### 1\. New theme - -Debian 11 comes with a new ‘Homeworld’ theme. It is inspired by the [Bauhaus movement][1], an art style born in Germany in the early 20th century and characterized by its unique approach to architecture and design. - -![Debian 11 default wallpaper][2] - -You’ll see this theme everywhere in Debian 11 be it on the login screen, installer or on the Grub menu. - -![Grub screen][3] - -![Installer][4] - -![Login screen][2] - -### 2\. Newer version of desktop environments - -Debian 11 consists of newer version of the desktop flavors it offers: - - * GNOME 3.38 - * KDE Plasma 5.20 - * LXDE 11 - * LXQt 0.16 - * MATE 1.24 - * Xfce 4.16 - - - -If you use cutting-edge distributions like Fedora or Arch/Manjaro, you may find it weird. But here’s the thing. Debian prefers stability, and hence the desktop environment versions are not the latest ones. They are newer in comparison to the previous Debian stable release. - -### 3\. Package updates - -Debian has updates its package repositories. Debian 11 includes over 11294 new packages taking the total to over 59551 packages. Over 42821 software packages have newer versions. Over 9519 packages have been removed for the distribution. - -This means that you should see newer versions of the popular applications like LibreOffice, Emacs, GIMP and various server and programming related tools. - -### 4\. Linux Kernel 5.10 LTS - -Debian 11 features [Kernel 5.10 which is a long term support (LTS) release][5]. Debian 10 Buster used Kernel 4.19 at the time of its release. - -A new kernel obviously means better support for hardware, specially the newer hardware along with performance improvements. - -### 5\. Printer and Scanner improvement - -Debian 11 brings the new package ipp-usb. It uses the vendor-neutral IPP-over-USB protocol supported by many modern printers. This means that many newer printers will be supported by Debian 11 without needing the drivers. - -Similarly, SANE driverless backend allows using scanners painlessly. - -### 6\. ExFAT support - -You no longer need to exfat-fuse package for mounting ExFAT filesystem. Thanks to the Linux kernel 5.10, Debian 11 has support for the exFAT filesystem, and defaults to using it for mounting exFAT filesystems. - -### 7\. Still supports 32 bit - -Is that even a feature? Considering that only a [handful of Linux distributions now support 32-bit architecture][6], I would say yes. - -Apart from 32-bit and 64-bit PC, Debian 11 also supports 64-bit ARM (arm64), ARM EABI (armel), ARMv7 (EABI hard-float ABI, armhf), little-endian MIPS (mipsel), 64-bit little-endian MIPS (mips64el), 64-bit little-endian PowerPC (ppc64el) and IBM System z (s390x). - -Now you know why is it called the ‘universal operating system’ 🙂 - -### Other changes - -There are a few more changes in this release. - - * Systemd defaults to using control groups v2 (cgroupv2). - * New Fcitx 5 is input method for Chinese, Japanese, Korean and many other languages. - * Systemd journal logs are persistent by default. - * A new open command to automatically open files from command-line with a certain app (GUI or CLI). - * Password hashing for local system accounts now uses yescrypt by default instead of SHA-512 for improved security. - - - -More information can be found in the [official release notes][7]. - -### Getting Debian 11 - -Debian 11 is available to download from its website. Just head over to the website and get the ISO from there. - -[Download Debian][8] - -If you are already using Debian 10, you can [easily upgrade to Debian 11 by changing your sources list.][9] - -Enjoy the latest and greatest of the universal operating system 🙂 - -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! - -If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. - -I'm not interested - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/debian-11-feature/ - -作者:[Abhishek][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://news.itsfoss.com/author/root/ -[b]: https://github.com/lujun9972 -[1]: https://mymodernmet.com/what-is-bauhaus-art-movement/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9IjY0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://news.itsfoss.com/kernel-5-10-release/ -[6]: https://itsfoss.com/32-bit-linux-distributions/ -[7]: https://www.debian.org/releases/bullseye/amd64/release-notes/ch-whats-new.en.html -[8]: https://www.debian.org/ -[9]: https://www.debian.org/releases/bullseye/amd64/release-notes/ch-upgrading.en.html diff --git a/translated/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md b/translated/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md new file mode 100644 index 0000000000..04634c409c --- /dev/null +++ b/translated/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md @@ -0,0 +1,122 @@ +[#]: subject: "7 New Features in the Newly Released Debian 11 ‘Bullseye’ Linux Distro" +[#]: via: "https://news.itsfoss.com/debian-11-feature/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +新发布的 Debian 11 “Bullseye” Linux 发行版的 7 大亮点 +====== + +> 这个最新发布的通用操作系统已经来到。 + +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/debian-11-features.png?w=1200&ssl=1) + +期待已久的代号为 “Bullseye” 的 Debian 11 版本在经过两年的开发后终于来了。该版本将在未来五年内得到支持,就像任何其他的 Debian 稳定版版本一样。 + +感到兴奋吗?让我们来看看 Debian 11 的新内容。 + +### 1、新主题 + +Debian 11 带有一个新的 “Homeworld” 主题。它的灵感来自 [包豪斯运动][1],这是一种 20 世纪初诞生于德国的艺术风格,其特点是对建筑和设计的独特处理。 + +![Debian 11 的默认壁纸][2] + +在 Debian 11 中,无论是在登录界面、安装程序还是 Grub 菜单上,你都会看到这个主题。 + +![Grub 屏幕][3] + +![安装程序][4] + +![登录屏幕][10] + +### 2、较新版本的桌面环境 + +Debian 11 包含了它所提供的桌面变体的较新版本: + + * GNOME 3.38 + * KDE Plasma 5.20 + * LXDE 11 + * LXQt 0.16 + * MATE 1.24 + * Xfce 4.16 + +如果你使用 Fedora 或 Arch/Manjaro 等先锐发行版,你可能会觉得很奇怪。但就是这样。Debian 更倾向于稳定,因此桌面环境的版本不是最新的。当然,它们与之前的 Debian 稳定版相比,还是比较新的。 + +### 3、软件包更新 + +Debian 已经更新了它的软件包库。Debian 11 包括了多达 11294 个新软件包,软件包总数多达 59551 个。42821 个软件包有了新的版本。删除了 9519 个软件包。 + +也就是说你应该会看到像 LibreOffice、Emacs、GIMP 以及各种服务器和编程相关工具等流行应用程序的新版本。 + +### 4、Linux 内核 5.10 LTS + +Debian 11 带有 [Linux 5.10 内核,这是一个长期支持(LTS)版本][5]。Debian 10 Buster 在发布时使用的是 Linux 4.19 内核。 + +一个新的内核显然意味着对硬件有更好的支持,特别是较新的硬件以及性能的改进。 + +### 5、打印机和扫描器的改进 + +Debian 11 带来了新的软件包 ipp-usb。它使用了许多现代打印机所支持的供应商中立的 IPP-over-USB 协议。这意味着许多较新的打印机将被 Debian 11 所支持,而不需要驱动程序。 + +同样地,SANE 无驱动后端可以让你轻松使用扫描仪。 + +### 6、支持 exFAT + +你不再需要使用 exfat-fuse 包来挂载 exFAT 文件系统。借助 Linux 5.10 内核,Debian 11 已经支持 exFAT 文件系统,并且默认使用它来挂载 exFAT 文件系统。 + +### 7、仍然支持 32 位 + +这算是一个功能吗?考虑到现在只有 [少数几个 Linux 发行版支持 32 位架构][6],我觉得是。 + +除了 32 位和 64 位 PC,Debian 11 还支持 64 位 ARM(arm64)、ARM EABI(armel)、ARMv7(EABI hard-float ABI,armhf)、小端 MIPS(mipsel)、64 位小端 MIPS(mips64el)、64 位小端 PowerPC(ppc64el)和 IBM System z(s390x)。 + +现在你知道为什么它被称为“通用操作系统”了吧。 🙂 + +### 其他变化 + +在这个版本中还有一些变化: + + * Systemd 默认使用控制组 v2(cgroupv2)。 + * 针对中文、日文、韩文和其他许多语言的新 Fcitx 5 输入法。 + * Systemd 日记日志默认为持久性的。 + * 一个新的打开命令,可以用某个应用程序(GUI 或 CLI)从命令行自动打开文件。 + * 本地系统账户的密码散列现在默认使用 yescrypt 而不是 SHA-512 来提高安全性。 + +更多信息可以在 [官方发布说明][7] 中找到。 + +### 获取 Debian 11 + +Debian 11 可以从其网站下载。只要前往该网站并从那里获得 ISO。 + +- [下载 Debian][8] + +如果你已经在使用 Debian 10,你可以 [通过改变你的源列表轻松升级到 Debian 11][9] 。 + +享受最新和最棒的通用操作系统吧。🙂 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/debian-11-feature/ + +作者:[Abhishek][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lujun9972 +[1]: https://mymodernmet.com/what-is-bauhaus-art-movement/ +[2]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/homeworld_desktop.png?resize=1568%2C882&ssl=1 +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/homeworld_grub.png?w=640&ssl=1 +[4]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/homeworld_installer.png?w=800&ssl=1 +[5]: https://news.itsfoss.com/kernel-5-10-release/ +[6]: https://itsfoss.com/32-bit-linux-distributions/ +[7]: https://www.debian.org/releases/bullseye/amd64/release-notes/ch-whats-new.en.html +[8]: https://www.debian.org/ +[9]: https://www.debian.org/releases/bullseye/amd64/release-notes/ch-upgrading.en.html +[10]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/homeworld_login.png?resize=1568%2C882&ssl=1 \ No newline at end of file From e216f1cc28dd2cdeaad136ef54784457fe80adc2 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Wed, 18 Aug 2021 20:34:49 +0800 Subject: [PATCH 084/290] translating --- sources/tech/20210817 4 alternatives to cron in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210817 4 alternatives to cron in Linux.md b/sources/tech/20210817 4 alternatives to cron in Linux.md index 5f2cdc7752..d82cfd115d 100644 --- a/sources/tech/20210817 4 alternatives to cron in Linux.md +++ b/sources/tech/20210817 4 alternatives to cron in Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/7/alternatives-cron-linux" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -58,7 +58,7 @@ via: https://opensource.com/article/21/7/alternatives-cron-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[unigeorge](https://github.com/unigeorge) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 263a7f7dcb107fa161fc10373b76d38ca596fb3f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 19 Aug 2021 05:02:18 +0800 Subject: [PATCH 085/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210818=20?= =?UTF-8?q?below:=20a=20time=20traveling=20resource=20monitor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210818 below- a time traveling resource monitor.md --- ...elow- a time traveling resource monitor.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20210818 below- a time traveling resource monitor.md diff --git a/sources/tech/20210818 below- a time traveling resource monitor.md b/sources/tech/20210818 below- a time traveling resource monitor.md new file mode 100644 index 0000000000..0b55e8b14b --- /dev/null +++ b/sources/tech/20210818 below- a time traveling resource monitor.md @@ -0,0 +1,111 @@ +[#]: subject: "below: a time traveling resource monitor" +[#]: via: "https://fedoramagazine.org/below-a-time-traveling-resource-monitor/" +[#]: author: "Daniel Xu https://fedoramagazine.org/author/dxuu/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +below: a time traveling resource monitor +====== + +![][1] + +In this article, we introduce _below_: an Apache 2.0 licensed resource monitor for modern Linux systems. _below_ allows you to replay previously recorded data. + +### Background + +One of the kernel’s primary responsibilities is mediating access to resources. Sometimes this might mean parceling out physical memory such that multiple processes can share the same host. Other times it might mean ensuring equitable distribution of CPU time. In all these contexts, the kernel provides the mechanism and leaves the policy to “someone else”. In more recent times, this “someone else” is usually a runtime like systemd or dockerd. The runtime takes input from a scheduler or end user — something along the lines of what to run and how to run it — and turns the right knobs and pulls the right levers on the kernel such that the workload can —well — get to work. + +In a perfect world this would be the end of the story. However, the reality is that resource management is a complex and rather opaque amalgam of technologies that has evolved over decades of computing. Despite some of this technology having various warts and dead ends, the end result — a container — works relatively well. While the user does not usually need to concern themselves with the details, it is crucial for infrastructure operators to have visibility into their stack. Visibility and debuggability are essential for detecting and investigating misconfigurations, bugs, and systemic issues. + +To make matters more complicated, resource outages are often difficult to reproduce. It is not unusual to spend weeks waiting for an issue to reoccur so that the root cause can be investigated. Scale further compounds this issue: one cannot run a custom script on _every_ host in the hopes of logging bits of crucial state if the bug happens again. Therefore, more sophisticated tooling is required. Enter _below_. + +### Motivation + +Historically Facebook has been a heavy user of _atop_ [0]. _atop_ is a performance monitor for Linux that is capable of reporting the activity of all processes as well as various pieces of system level activity. One of the most compelling features _atop_ has over tools like _htop_ is the ability to record historical data as a daemon. This sounds like a simple feature, but in practice this has enabled debugging countless production issues. With long enough data retention, it is possible to go backwards in time and look at the host state before, during, and after the issue or outage. + +Unfortunately, it became clear over the years that _atop_ had certain deficiencies. First, cgroups [1] have emerged as the defacto way to control and monitor resources on a Linux machine. _atop_ still lacks support for this fundamental building block. Second, _atop_ stores data on disk with custom delta compression. This works fine under normal circumstances, but under heavy resource pressure the host is likely to lose data points. Since delta compression is in use, huge swaths of data can be lost for periods of time where the data is most important. Third, the user experience has a steep learning curve. We frequently heard from _atop_ power users that they love the dense layout and numerous keybindings. However, this is a double edged sword. When someone new to the space wants to debug a production issue, they’re solving two problems at once now: the issue at hand and how to use _atop_. + +_below_ was designed and developed by and for the resource control team at Facebook with input from production _atop_ users. The resource control team is responsible for, as the name suggests, resource management at scale. The team is comprised of kernel developers, container runtime developers, and hardware folks. Recognizing the opportunity for a next-generation system monitor, we designed _below_ with the following in mind: + + * Ease of use: _below_ must be both intuitive for new users as well as powerful for daily users + * Opinionated statistics: _below_ displays accurate and useful statistics. We try to avoid collecting and dumping stats just because we can. + * Flexibility: when the default settings are not enough, we allow the user to customize their experience. Examples include configurable keybindings, configurable default view, and a scripting interface (the default being a terminal user interface). + + + +### Install + +To install the package: + +``` +# dnf install -y below +``` + +To turn on the recording daemon: + +``` +# systemctl enable --now below +``` + +### Quick tour + +_below_’s most commonly used mode is replay mode. As the name implies, replay mode replays previously recorded data. Assuming you’ve already started the recording daemon, start a session by running: + +``` +$ below replay --time "5 minutes ago" +``` + +You will then see the cgroup view: + +![][2] + +If you get stuck or forget a keybinding, press **?** to access the help menu. + +The very top of the screen is the status bar. The status bar displays information about the current sample. You can move forwards and backwards through samples by pressing **t** and **T**, respectively. The middle section is the system overview. The system overview contains statistics about the system as a whole that are generally always useful to see. The third and lowest section is the multipurpose view. The image above shows the cgroup view. Additionally, there are process and system views, accessible by pressing **p** and **s**, respectively. + +Press **↑** and **↓** to move the list selection. Press **<Enter>** to collapse and expand cgroups. Suppose you’ve found an interesting cgroup and you want to see what processes are running inside it. To zoom into the process view, select the cgroup and press **z**: + +![][3] + +Press **z** again to return to the cgroup view. The cgroup view can be somewhat long at times. If you have a vague idea of what you’re looking for, you can filter by cgroup name by pressing **/** and entering a filter: + +![][4] + +At this point, you may have noticed a tab system we haven’t explored yet. To cycle forwards and backwards through tabs, press **<Tab>** and **<Shift> \+ <Tab>** respectively. We’ll leave this as an exercise to the reader. + +### Other features + +Under the hood, _below_ has a powerful design and architecture. Facebook is constantly upgrading to newer kernels, so we never assume a data source is available. This tacit assumption enables total backwards and forwards compatibility between kernels and _below_ versions. Furthermore, each data point is zstd compressed and stored in full. This solves the issues with delta compression we’ve seen _atop_ have at scale. Based on our tests, our per-sample compression can achieve on average a 5x compression ratio. + +_below_ also uses eBPF [2] to collect information about short-lived processes (processes that live for shorter than the data collection interval). In contrast, _atop_ implements this feature with BSD process accounting, a known slow and priority-inversion-prone kernel interface. + +For the user, _below_ also supports live-mode and a dump interface. Live mode combines the recording daemon and the TUI session into one process. This is convenient for browsing system state without committing to a long running daemon or disk space for data storage. The dump interface is a scriptable interface to all the data _below_ stores. Dump is both powerful and flexible — detailed data is available in CSV, JSON, and human readable format. + +### Conclusion + +_below_ is an Apache 2.0 licensed open source project that we (the _below_ developers) think offers compelling advantages over existing tools in the resource monitoring space. We’ve spent a great deal of effort preparing _below_ for open source use so we hope that readers and the community get a chance to try _below_ out and report back with bugs and feature requests. + +[0]: +[1]: +[2]: + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/below-a-time-traveling-resource-monitor/ + +作者:[Daniel Xu][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/dxuu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/below_resource_monitor-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2021/08/image-1024x800.png +[3]: https://fedoramagazine.org/wp-content/uploads/2021/08/image-1-1024x800.png +[4]: https://fedoramagazine.org/wp-content/uploads/2021/08/image-2-1024x800.png From 8b06cd30d92674c8fbe792c04e8237a0ac8f88e0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 19 Aug 2021 05:02:37 +0800 Subject: [PATCH 086/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819=20?= =?UTF-8?q?Debian=20vs=20Ubuntu:=20What=E2=80=99s=20the=20Difference=3F=20?= =?UTF-8?q?Which=20One=20Should=20You=20Use=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md --- ...he Difference- Which One Should You Use.md | 182 ++++++++++++++++++ 1 file changed, 182 insertions(+) create mode 100644 sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md diff --git a/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md new file mode 100644 index 0000000000..960be3705b --- /dev/null +++ b/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md @@ -0,0 +1,182 @@ +[#]: subject: "Debian vs Ubuntu: What’s the Difference? Which One Should You Use?" +[#]: via: "https://itsfoss.com/debian-vs-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Debian vs Ubuntu: What’s the Difference? Which One Should You Use? +====== + +You can [use apt-get commands][1] for managing applications in both Debian and Ubuntu. You can install DEB packages in both distributions as well. Many times, you’ll find common package installation instructions for both distributions. + +So, what’s the difference between the two, if they are so similar? + +Debian and Ubuntu belong to the same side of the distribution spectrum. Debian is the original distribution created by Ian Murdock in 1993. Ubuntu was created in 2004 by Mark Shuttleworth and it is based on Debian. + +### Ubuntu is based on Debian: What does it mean? + +While there are hundreds of Linux distributions, only a handful of them are independent ones, created from scratch. [Debian][2], Arch, Red Hat are some of the biggest distributions that do not derive from any other distribution. + +Ubuntu is derived from Debian. It means that Ubuntu uses the same APT packaging system as Debian and shares a huge number of packages and libraries from Debian repositories. It utilizes the Debian infrastructure as base. + +![Ubuntu uses Debian as base][3] + +That’s what most ‘derived’ distributions do. They use the same package management system and share packages as the base distribution. But they also add some packages and changes of their own. And that is how Ubuntu is different from Debian despite being derived from it. + +### Difference between Ubuntu and Debian + +So, Ubuntu is built on Debian architecture and infrastructure and uses .DEB packages same as Debian. + +Does it mean using Ubuntu is the same as using Debian? Not quite so. There are many more factors involved that distinguish one distribution from the other. + +Let me discuss these factors one by one to compare Ubuntu and Debian. Please keep in mind that some comparisons are applicable to desktop editions while some apply to the server editions. + +![][4] + +#### 1\. Release cycle + +Ubuntu has two kinds of releases: LTS and regular. [Ubuntu LTS (long term support) release][5] comes out every two years and they get support for five years. You have the option to upgrade to the next available LTS release. The LTS releases are considered more stable. + +There are also non-LTS releases, every six months. These releases are supported for nine months only, but they have newer software versions and features. You have to upgrade to the next Ubuntu versions when the current on reaches end of life. + +So basically, you have the option to choose between stability and new features based on these releases. + +On the other hand, Debian has three different releases: Stable, Testing and Unstable. Unstable is for actual testing and should be avoided. + +The testing branch is not that unstable. It is used for preparing the next stable branch. Some Debian users prefer the testing branch to get newer features. + +And then comes the stable branch. This is the main Debian release. It may not have the latest software and feature but when it comes to stability, Debian Stable is rock solid. + +There is a new stable release every two years and it is supported for a total of three years. After that, you have to upgrade to the next available stable release. + +#### 2\. Software freshness + +![][6] + +Debian’s focus on stability means that it does not always aim for the latest versions of the software. For example, the latest Debian 11 features GNOME 3.38, not the latest GNOME 3.40. + +The same goes for other software like GIMP, LibreOffice, etc. This is a compromise you have to make with Debian. This is why “Debian stable = Debian stale” joke is popular in the Linux community. + +Ubuntu LTS releases also focus on stability. But they usually have more recent versions of the popular software. + +You should note that for _some software_, installing from developer’s repository is also an option. For example, if you want the latest Docker version, you can add Docker repository in both Debian and Ubuntu. + +Overall, software in Debian Stable often have older versions when compared to Ubuntu. + +#### 3\. Software availability + +Both Debian and Ubuntu has a huge repository of software. However, [Ubuntu also has PPA][7] (Personal Package Archive). With PPA, installing newer software or getting the latest software version becomes a bit more easy. + +![][8] + +You may try using PPA in Debian but it won’t be a smooth experience. You’ll encounter issues most of the time. + +#### 4\. Supported platforms + +Ubuntu is available on 64-bit x86 and ARM platforms. It does not provide 32-bit ISO anymore. + +Debian, on the other hand, supports both 32 bit and 64 bit architecture. Apart from that Debian also supports 64-bit ARM (arm64), ARM EABI (armel), ARMv7 (EABI hard-float ABI, armhf), little-endian MIPS (mipsel), 64-bit little-endian MIPS (mips64el), 64-bit little-endian PowerPC (ppc64el) and IBM System z (s390x). + +No wonder it is called the ‘universal operating system’. + +#### 5\. Installation + +[Installing Ubuntu][9] is a lot easier than installing Debian. I am not kidding. Debian could be confusing even for intermediate Linux user. + +When you download Debian, it provides a minimal ISO by default. This ISO has no non-free (not open source) firmware. You go on to install it and realize that your network adapters and other hardware won’t be recognized. + +There is a separate non-free ISO that contains firmware but it is hidden and if you do not know that, you are in for a bad surprise. + +![Getting non-free firmware is a pain in Debian][10] + +Ubuntu is a lot more forgiving when it comes to including proprietary drivers and firmware in the default ISO. + +Also, the Debian installer looks old whereas Ubuntu installer is modern looking. Ubuntu installer also recognizes other installed operating systems on the disk and gives you the option to install Ubuntu alongside the existing ones (dual boot). I have not noticed it with Debian installer in my testing. + +![Installing Ubuntu is smoother][11] + +#### 6\. Out of the box hardware support + +As mentioned earlier, Debian focuses primarily on [FOSS][12] (free and open source software). This means that the kernel provided by Debian does not include proprietary drivers and firmware. + +It’s not that you cannot make it work but you’ll have to do add/enable additional repositories and install it manually. This could be discouraging, specially for the beginners. + +Ubuntu is not perfect but it is a lot better than Debian for providing drivers and firmware out of the box. This means less hassle and a more complete out-of-the-box experience. + +#### 7\. Desktop environment choices + +Ubuntu uses a customized GNOME desktop environment by default. You may install [other desktop environments][13] on top of it or opt for [various desktop based Ubuntu flavors][14] like Kubuntu (for KDE), Xubuntu (for Xfce) etc. + +Debian also installs GNOME by default. But its installer gives you choice to install desktop environment of your choice during the installation process. + +![][15] + +You may also get [DE specific ISO images from its website][16]. + +#### 8\. Gaming + +Gaming on Linux has improved in general thanks to Steam and its Proton project. Still, gaming depends a lot on hardware. + +And when it comes to hardware compatibility, Ubuntu is better than Debian for supporting proprietary drivers. + +Not that it cannot be done in Debian but it will require some time and effort to achieve that. + +#### 9\. Performance + +There is no clear ‘winner’ in the performance section, whether it is on the server or on the desktop. Both Debian and Ubuntu are popular as desktop as well as server operating systems. + +The performance depends on your system’s hardware and the software component you use. You can tweak and control your system in both operating systems. + +#### 10\. Community and support + +Debian is a true community project. Everything about this project is governed by its community members. + +Ubuntu is backed by [Canonical][17]. However, it is not entirely a corporate project. It does have a community but the final decision on any matter is in Canonical’s hands. + +As far the support goes, both Ubuntu and Debian have dedicated forums where users can seek help and advice. + +Canonical also offers professional support for a fee to its enterprise clients. Debian has no such features. + +### Conclusion + +Both Debian and Ubuntu are solid choices for desktop or server operating systems. The apt package manager and DEB packaging is common to both and thus giving a somewhat similar experience. + +However, Debian still needs a certain level of expertise, specially on the desktop front. If you are new to Linux, sticking with Ubuntu will be a better choice for you. In my opinion, you should gain some experience, get familiar with Linux in general and then try your hands on Debian. + +It’s not that you cannot jump onto the Debian wagon from the start, but it is more likely to be an overwhelming experience for Linux beginners. + +**Your opinion on this Debian vs Ubuntu debate is welcome.** + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-vs-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/apt-get-linux-guide/ +[2]: https://www.debian.org/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-ubuntu-upstream.png?resize=800%2C400&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-vs-ubuntu.png?resize=800%2C450&ssl=1 +[5]: https://itsfoss.com/long-term-support-lts/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/apt-cache-policy.png?resize=795%2C456&ssl=1 +[7]: https://itsfoss.com/ppa-guide/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/ffmpeg_add_ppa.jpg?resize=800%2C222&ssl=1 +[9]: https://itsfoss.com/install-ubuntu/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/choose-something-else-installing-ubuntu.png?resize=800%2C491&ssl=1 +[12]: https://itsfoss.com/what-is-foss/ +[13]: https://itsfoss.com/best-linux-desktop-environments/ +[14]: https://itsfoss.com/which-ubuntu-install/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-install-desktop-environment.png?resize=640%2C479&ssl=1 +[16]: https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/ +[17]: https://canonical.com/ From 6d2b0587492595fed2311f4e21a0d09ef4fab824 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 19 Aug 2021 05:02:59 +0800 Subject: [PATCH 087/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210818=20?= =?UTF-8?q?A=20guide=20to=20database=20replication=20with=20open=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210818 A guide to database replication with open source.md --- ...o database replication with open source.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20210818 A guide to database replication with open source.md diff --git a/sources/tech/20210818 A guide to database replication with open source.md b/sources/tech/20210818 A guide to database replication with open source.md new file mode 100644 index 0000000000..665d18a29e --- /dev/null +++ b/sources/tech/20210818 A guide to database replication with open source.md @@ -0,0 +1,121 @@ +[#]: subject: "A guide to database replication with open source" +[#]: via: "https://opensource.com/article/21/8/database-replication-open-source" +[#]: author: "John Lafleur https://opensource.com/users/john-lafleur" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to database replication with open source +====== +Why choose log-based Change Data Capture (CDC) replication for +databases. Learn about the open source options available to you. +![Cloud and databsae incons][1] + +In the world of constantly evolving data, one question often pops up: How is it possible to seamlessly replicate data that is growing exponentially and coming from an increasing number of sources? This article explains some of the foundational open source technologies that may help commoditize database replication tasks into data warehouses, lakes, or other databases. + +One popular replication technology is **Change Data Capture (CDC)**, a pattern that allows row-level data changes at the source database to be quickly identified, captured, and delivered in real-time to the destination data warehouse, lake, or other database. With CDC, only the data that has changed since the last replication—categorized by insert, update, and delete operations—is in scope. This incremental design approach makes CDC significantly more efficient than other database replication patterns, such as a full-database replication. With full-database replication, the entire source database table with potentially millions of rows is scanned and copied over to the destination. + +### Open source CDC + +[Debezium][2] is an open source distributed CDC platform that leverages Apache Kafka to transport data changes. It continuously monitors databases, ensuring that each row-level change is sent to the destination in exactly the same order they were committed to the database. However, using Debezium in a do-it-yourself replication project can be a heavy lift. It requires a deep understanding of concepts related to the source and destination systems, Kafka, and Debezium internals. For example, just take a look at all the details required for a [Debezium MySQL connector][3]. + +[Airbyte][4] is an open source data integration engine that allows you to consolidate your data in your data warehouses, lakes, and databases. Airbyte leverages Debezium and does all the heavy lifting. Indeed, within Airbyte, Debezium is run as an embedded library. This engineering design allows for using Debezium without needing to use Apache Kafka or another language runtime. This [video][5] shows how you can use CDC to replicate a PostgreSQL database with Airbyte in a matter of minutes. The open source code is available for use with Postgres, MySQL, and MSSQL and will soon be for all other major databases that enable it. + +### What are some typical CDC use cases for databases? + +Databases lie at the core of today's data infrastructures, and several different use cases apply. + +#### 1\. Squash the overhead across your transactional databases and network + +With CDC in place, it's possible to deliver data changes as a continuous stream without placing unnecessary overhead on source database systems. This means that databases can focus on doing the more valuable tasks that they are engineered for, resulting in higher throughput and lower latency for apps. With CDC, only incremental data changes are transferred over the network, reducing data transfer costs, minimizing network saturation, and eliminating the need for fine-tuning the system to handle peak batch traffic. + +#### 2\. Keep transactional and analytical databases synchronized + +With data being generated at dizzying rates, extracting insights from data is key to an organization's success. CDC captures live data changes from the transactional database and ships those regularly to the analytical database or warehouse, where they can be analyzed to extract deeper insights. For example, imagine that you're an online travel company. You can capture real-time online booking activity at the database tier (let's say using PostgreSQL) and send these transactions to your analytical database to learn more about your customer's buying patterns and preferences. + +#### 3\. Migrate data from legacy systems to next-generation data platforms + +With the shift towards modernizing legacy database systems by going to cloud-based database instances, moving data to these newer platforms has become more critical than ever. With CDC, data is synchronized periodically, allowing you to modernize your data platforms at your own pace while maintaining both your legacy and next-generation data platforms in the interim. This setup ensures flexibility and can keep business operational without missing a heartbeat. + +#### 4\. Warm up a dynamic data cache for applications + +Caching is a standard technique for improving application performance, but data caches must be warmed up (or loaded with data) for them to be effective. With a warm data cache, the application can access data quickly, bypassing the core database. For example, this pattern is extremely beneficial for an application that does many data lookups because loading this lookup data in a cache can offload the read workload from the core database. Using CDC, the data cache can be dynamically updated all the time. For example, selective lookup tables in the database can be loaded into a cache during the initial warm-up cycle. Any future modifications in the lookup table data will incrementally be propagated to update the cache. + +### What CDC implementations exist and what database should you pick? + +CDC has been around for quite some time, and over the years, several different widely-used implementations have sprung up across other products. However, not all CDC implementations are created equal, and you need to pick the proper implementation to get a clear picture of the data changes. I summarize some of these implementations and the challenges of using each of them in the list below: + +#### Date modified + +This approach tracks metadata across every row in the table, including who created the row, who recently modified the row, and when the row was created and modified. + +**Challenges**: + + * Not easy to track data deletes since the date_modified field no longer exists for a deleted row. + * Needs additional compute resources to process the date_modified field. If indexing is used on the date_modified field, the index will need additional compute and storage resources. + + + +#### Binary diffs + +This implementation calculates the difference in state between the current data and the previous data. + +**Challenges**: + + * Calculating state differences can be complex and does not scale well when data volumes are large. + * Needs additional compute resources and cannot be done in real-time. + + + +#### Database trigger + +This method needs database triggers to be created with logic to manage the metadata within the same table or in a separate book-keeping table. + +**Challenges**: + + * Triggers must fire for every transaction, and this can slow down the transactional workload. + * The data engineer must write additional complex rollback logic to handle the case of a transaction failure. + * If the table schema is modified, the trigger must be manually updated with the latest schema changes. + * SQL language differences across the different database systems mean that triggers are not easily portable and might need to be re-written. + + + +#### Log-based + +This implementation reads data directly from the database logs and journal files to minimize the impact of the capture process. Since database logs and journal files exist in every transactional database product, the experience is transparent. This means it does not require any logical changes in terms of database objects or the application running on top of the database. + +**Challenges**: + + * If the destination database system is down, the source database system logs will need to be kept intact until the sync happens. + * Database operations that bypass the log file will not be captured. This is a corner case for most relational database use-cases since logs are required to guarantee [ACID][6] behaviors. + * For example, a **TRUNCATE** table statement might not log data, and in this case, forced logging through a query hint or configuration might be required. + + + +When it comes to production databases, the choice is clear: Log-based CDC is the way forward due to its reliability, ability to scale under massive data volumes, and ease of use without requiring any database or app changes. + +### Conclusion + +I hope this article was useful to explain why log-based CDC replication for databases matters and the new open source options available to you. These options provide endless replication possibilities, just as Airbyte made log-based CDC replication much easier. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/database-replication-open-source + +作者:[John Lafleur][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/john-lafleur +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus_cloud_database.png?itok=lhhU42fg (Cloud and databsae incons) +[2]: https://github.com/debezium/ +[3]: https://debezium.io/documentation/reference/1.6/connectors/mysql.html +[4]: https://airbyte.io/ +[5]: https://www.youtube.com/watch?v=NMODvLgZvuE +[6]: https://en.wikipedia.org/wiki/ACID From 25db76b90cba29a808012992987bfbe1b34c7657 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 19 Aug 2021 05:03:13 +0800 Subject: [PATCH 088/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210818=20?= =?UTF-8?q?Build=20a=20JAR=20file=20with=20fastjar=20and=20gjar?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210818 Build a JAR file with fastjar and gjar.md --- ... Build a JAR file with fastjar and gjar.md | 150 ++++++++++++++++++ 1 file changed, 150 insertions(+) create mode 100644 sources/tech/20210818 Build a JAR file with fastjar and gjar.md diff --git a/sources/tech/20210818 Build a JAR file with fastjar and gjar.md b/sources/tech/20210818 Build a JAR file with fastjar and gjar.md new file mode 100644 index 0000000000..6ec8e64ee7 --- /dev/null +++ b/sources/tech/20210818 Build a JAR file with fastjar and gjar.md @@ -0,0 +1,150 @@ +[#]: subject: "Build a JAR file with fastjar and gjar" +[#]: via: "https://opensource.com/article/21/8/fastjar" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Build a JAR file with fastjar and gjar +====== +Utilities like fastjar, gjar, and jar help you manually or +programmatically build JAR files, while other toolchains such as Maven +and Gradle offer features for dependency management. +![Someone wearing a hardhat and carrying code ][1] + +One of the many advantages of Java, in my experience, is its ability to deliver applications in a neat and tidy package (called a JAR, or _Java archive_.) JAR files make it easy for users to download and launch an application they want to try, easy to transfer that application from one computer to another (and Java is cross-platform, so sharing liberally can be encouraged), and easy to understand for new programmers to look inside a JAR to find out what makes a Java app run. + +There are many ways to create a JAR file, including toolchain solutions such as Maven and Gradle, and one-click build features in your IDE. However, there are also stand-alone commands such as `jarfast`, `gjar`, and just plain old `jar`, which are useful for quick and simple builds, and to demonstrate what a JAR file needs to run. + +### Install + +On Linux, you may already have the `fastjar`, `gjar`, or `jar` commands as part of an OpenJDK package, or GCJ (GCC-Java.) You can test whether any of these commands are installed by typing the command with no arguments:  + + +``` +$ fastjar +Try 'fastjar --help' for more information. +$ gjar +jar: must specify one of -t, -c, -u, -x, or -i +jar: Try 'jar --help' for more information +$ jar +Usage: jar [OPTION...] [ [--release VERSION] [-C dir] files] ... +Try `jar --help' for more information. +``` + +I have all of them installed, but you only need one. All of these commands are capable of building a JAR. + +On a modern Linux system such as Fedora, typing a missing command causes your OS to prompt you to install it for you. + +Alternately, you can just [install Java][2] from [AdoptOpenJDK.net][3] for Linux, MacOS, and Windows. + +### Build a JAR  + +First, you need a Java application to build. + +To keep things simple, create a basic "hello world" application in a file called hello.java: + + +``` +class Main { +public static void main([String][4][] args) { +    [System][5].out.println("Hello Java World"); +}} +``` + +It's a simple application that somewhat trivializes the real-world importance of managing external dependencies. Still, it's enough to get started with the basic concepts you need to create a JAR. + +Next, create a manifest file. A manifest file describes the Java environment of the JAR. In this case, the most important information is identifying the main class, so the Java runtime executing the JAR knows where to find the application's entry point.  + + +``` +$ mdir META-INF +$ echo "Main-Class: Main" > META-INF/MANIFEST.MF  +``` + +### Compiling Java bytecode + +Next, compile your Java file into Java bytecode. + + +``` +`$ javac hello.java` +``` + +Alternately, you can use the Java component of GCC to compile: + + +``` +`$ gcj -C hello.java` +``` + +Either way, this produces the file `Main.class`: + + +``` +$ file Main.class +Main.class: compiled Java class data, version XX.Y +``` + +### Creating a JAR  + +You have all the components you need so that you can create the JAR file. + +I often include the Java source code as a reference for curious users, but all that's _required_ is the `META-INF` directory and the class files. + +The `fastjar` command uses syntax similar to the [`tar` command][6]. + + +``` +`$ fastjar cvf hello.jar META-INF Main.class` +``` + +Alternately, you can use `gjar` in much the same way, except that `gjar` requires you to specify your manifest file explicitly: + + +``` +`$ gjar cvf world.jar Main.class -m META-INF/MANIFEST.MF` +``` + +Or you can use the `jar` command. Notice this one doesn't require a Manifest file because it auto-generates one for you, but for safety I define the main class explicitly: + + +``` +`$ jar --create --file hello.jar --main-class=Main Main.class` +``` + +Test your application: + + +``` +$ java -jar hello.jar +Hello Java World +``` + +### Easy packaging + +Utilities like `fastjar`, `gjar`, and `jar` help you manually or programmatically build JAR files, while other toolchains such as Maven and Gradle offer features for dependency management. A good IDE may integrate one or more of these features. + +Whatever solution you use, Java provides an easy and unified target for distributing your application code. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/fastjar + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code ) +[2]: https://opensource.com/article/19/11/install-java-linux +[3]: https://adoptopenjdk.net/ +[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[6]: https://opensource.com/article/17/7/how-unzip-targz-file From 5456c4043e3b1ed9cfbdd0f2c308c34e92377bed Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 19 Aug 2021 05:03:25 +0800 Subject: [PATCH 089/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210818=20?= =?UTF-8?q?Setting=20new=20expectations=20for=20open=20source=20maintainer?= =?UTF-8?q?s?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210818 Setting new expectations for open source maintainers.md --- ...xpectations for open source maintainers.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20210818 Setting new expectations for open source maintainers.md diff --git a/sources/tech/20210818 Setting new expectations for open source maintainers.md b/sources/tech/20210818 Setting new expectations for open source maintainers.md new file mode 100644 index 0000000000..55f4191660 --- /dev/null +++ b/sources/tech/20210818 Setting new expectations for open source maintainers.md @@ -0,0 +1,104 @@ +[#]: subject: "Setting new expectations for open source maintainers" +[#]: via: "https://opensource.com/article/21/8/open-source-maintainers" +[#]: author: "Luis Villa https://opensource.com/users/luis" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Setting new expectations for open source maintainers +====== +The continued maturation of open source has regularly placed new burdens +on maintainers. +![Practicing empathy][1] + +For a long time, there were two basic tests for releasing open source: "Does it do what I need it to do?" and "Does it compile?" + +Sure, it was nice if it did things for others, but more than anything else, it at least needed to be fun for the developer and run at all for others. Then with the rise of package management, things leveled up a bit: "Is it packaged?" Shortly after that, the increasing popularity of [test-driven development][2] added another requirement: "Do the tests pass?" + +Each of these new requirements made more work for open source maintainers, but (by and large) maintainers didn't grump too much about them. I think this happened for two reasons: First, the work was often aligned with skills developers needed to learn for their jobs, and second, they were broadly perceived as beneficial for all users of the software, not just corporate developers. + +But that is changing—and in ways that may not work out so well for open source and enterprises. + +### The new enterprise burdens + +Here in 2021, it's clear that a new set of standards for open source is coalescing. These bring new labor to be done, either by open source developers or as part of a metadata overlay. These new standards include:  + + * **Security information and auditing**: Security assessments of open source packages have traditionally been carried out by third parties, either through in-house security teams or by the distributed process coordinated through the [MITRE Common Vulnerabilities and Exposures][3] database. With new security training like the Linux Foundation's CII badges and projects like OpenSSF and Google's SLSA, the new buzzword is "end to end"—meaning maintainers and projects must make themselves security experts and create security controls. While this is almost certainly a good idea for the industry overall, it's yet more work expectations with no immediate prospect of compensation. + * **Legal metadata**: Traditionally, open source communities like GNU, Debian, and Fedora believed (with good reason) that the default level of mandatory licensing metadata was at the package level, with per-file licensing information often disfavored at best and unrepresentable at worst. SPDX, followed more recently by clearlydefined.io, has decided that license information must be complete, machine-readable, and accurate in every file. This is clearly correct for all users, but the vast majority of the benefit accrues the most deep-pocketed enterprises in practice. In the meantime, if we want accurate global coverage, the vast majority of the burden will fall on maintainers and require intricate legal assessment. (Adding these to the Linux kernel [took literally years][4].) + * **Procurement information**: The newest ask from the industry is to provide Software Bills of Material (SBOM) throughout the software stack—which inevitably includes vast quantities of open source. Again, this is not entirely unreasonable, and indeed open source has long led the way here via the package management techniques that open source language communities pioneered. But the completeness of coverage and depth of information being demanded (including, in some proposals, [information about the identity of developers][5]) is a step-change in what is required—primarily to benefit the governments and massive enterprises that can afford to do the detailed, package-by-package analysis of software provenance. + + + +This new work may be quite different from previous waves of new obligations for open source developers—and we should think about why that is and what we might do about it. + +### Is this work going to work? + +As I suggested in the opening to this piece, the continued maturation of open source has regularly placed new burdens on maintainers. (At Mozilla, we used to call these "table stakes"—a poker term, indicating the things you had to do to even sit at the poker table, or in tech terms, to be considered for enterprise use.) So in some sense, this new wave of obligations is nothing new. But I do want to suggest that in two significant ways, these new mandates are problematic. + +First, this work is increasingly highly specialized and so less helpful for individual maintainers to learn. The strongest open source developers have always had diverse skills (not just coding, but also marketing, people management, etc.). That's been part of the draw of open source—you learn those things along the way, making you a better developer. But when we start adding more and more requirements that specialists (e.g., a legal team or a security team) would cover in a corporate setting, we reduce the additional value to developers of participating in open source. + +To put it another way: Developers clearly serve their self-interest by learning basic programming and people skills. It is less clear that they serve their self-interests by becoming experts in issues that, in their day jobs, are likely delegated to experts, like procurement, legal, and security. This works out fine in open source projects big enough to have large, sophisticated teams, but those are rare (even though they gather the lion's share of press and attention). + +Second, these new and increasingly specialized requirements primarily benefit a specific class of open source users—large enterprises. That isn't necessarily a bad thing—big enterprises are essential in many ways, and indeed, the risks to them deserve to be taken seriously. + +But in a world where hundreds of billions of dollars in enterprise value have been created by open source, and where small educational/hobby projects (and even many small companies) don't really benefit from these new unfunded mandates, developers will likely focus on other things, since few of them got into open source primarily to benefit the Fortune 500.  + +In other words, many open source developers enjoy building things that benefit themselves and their friends and are even willing to give up nights and weekends for that. If meeting these new requirements mostly benefits faceless corporations, we may need to find other carrots to encourage developers to create and maintain new open source projects. + +![Tidelift 2021 maintainer survey results][6] + +According to the Tidelift 2021 open source maintainer survey, open source maintenance work is often stressful, thankless, and financially unrewarding. + ([Tidelift][7]) + +### Why "unfunded mandate?" + +In U.S. politics, an "unfunded mandate" occurs when a government requires someone else (usually a lower-level government) to do new work while not funding the new work. Bradley M. Kuhn gave me the inspiration to use the term "unfunded mandate" in [a recent Twitter post][8]. + +Sometimes, unfunded mandates can be good—many times, they are used to create equity and justice programs, for example, that local governments really should be doing as a matter of course. Arguably, many security initiatives fall into this category—burdensome, yes, but necessary for all of us to use the internet effectively. + +But other times, they just create work for small entities that are already overwhelmed juggling the responsibilities of modern governance. If that sounds familiar to open source developers, no surprise—[they're already burnt out][7], and this is creating more work without creating more time or money. + +![Tidelift survey results showing half of maintainers quit because of burnout.][9] + +According to the Tidelift 2021 managed open source survey, more than half of maintainers have quit or considered quitting because they were experiencing burnout. +([Tidelift][10]) + +### Aligning incentives—by paying the maintainers + +We were pleased to see Google call this issue out in [a recent filing on SBOMs][11] with the National Telecommunications and Information Administration (NTIA). + +> "Unfortunately, much of the burden of maintaining our digital infrastructure falls on the backs of unpaid, volunteer contributors. The NTIA should carefully evaluate ways to fund and assist these communities as they work with industry to comply with new regulations." + +Tidelift's filling to the same NTIA call for comments made similar points about money, scale, and reliability. In response, in [its own summary][12], the NTIA acknowledged that "funding sources" are a challenge and also said:  + +> "Further research is necessary to understand the optimal … incentives for sharing, protecting, and using SBOM data." + +Given the dynamic of increasing professionalization—or to put it more bluntly, increasing work—that I've described above, it is refreshing to see an acknowledgment from significant industry players that developer incentives should be considered as we move into the next era of open source. We, as an industry, must figure out how to address this together, or we'll both fail to reach our goals and burn out developers—the worst of all worlds. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/open-source-maintainers + +作者:[Luis Villa][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/luis +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/practicing-empathy.jpg?itok=-A7fj6NF (Practicing empathy) +[2]: https://opensource.com/article/20/1/test-driven-development +[3]: https://cve.mitre.org/ +[4]: https://lwn.net/Articles/739183/ +[5]: https://security.googleblog.com/2021/02/know-prevent-fix-framework-for-shifting.html +[6]: https://opensource.com/sites/default/files/pictures/tidelift-survey-2021-1.png (Tidelift 2021 maintainer survey results) +[7]: https://blog.tidelift.com/finding-4-open-source-maintenance-work-is-often-stressful-thankless-and-financially-unrewarding +[8]: https://twitter.com/richardfontana/status/1408170067594985474 +[9]: https://opensource.com/sites/default/files/pictures/tidelift-survey-2021-2.png (Tidelift 2021 maintainer survey results about burnout) +[10]: https://blog.tidelift.com/finding-5-more-than-half-of-maintainers-have-quit-or-considered-quitting-and-heres-why +[11]: https://www.ntia.doc.gov/files/ntia/publications/google_-_2021.06.17.pdf +[12]: https://www.ntia.gov/files/ntia/publications/sbom_minimum_elements_report.pdf From 7c72b0f17102deb1df80f87e85940b44cb5963b1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 19 Aug 2021 08:37:49 +0800 Subject: [PATCH 090/290] translated --- ...hedule a task with the Linux at command.md | 168 ----------------- ...hedule a task with the Linux at command.md | 169 ++++++++++++++++++ 2 files changed, 169 insertions(+), 168 deletions(-) delete mode 100644 sources/tech/20210815 Schedule a task with the Linux at command.md create mode 100644 translated/tech/20210815 Schedule a task with the Linux at command.md diff --git a/sources/tech/20210815 Schedule a task with the Linux at command.md b/sources/tech/20210815 Schedule a task with the Linux at command.md deleted file mode 100644 index dbec0b7ab3..0000000000 --- a/sources/tech/20210815 Schedule a task with the Linux at command.md +++ /dev/null @@ -1,168 +0,0 @@ -[#]: subject: "Schedule a task with the Linux at command" -[#]: via: "https://opensource.com/article/21/8/linux-at-command" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Schedule a task with the Linux at command -====== -The at command is the Linux terminal's method of allowing you to -schedule one-time jobs for a specific time and date. -![Team checklist][1] - -Computers are good at [automation][2], but not everyone knows how to make automation work. It's a real luxury, though, to be able to schedule a task for a computer at a specific time and then forget about it. Maybe you have a file to upload or download at a specific time, or you need to process a batch of files that don't yet exist but are guaranteed to exist by a certain time or a setting that needs monitoring, or maybe you just need a friendly reminder to pick up bread and butter on the way home from work. - -That's what the `at` command is for. - -### What is the Linux at command? - -The `at` command is the Linux terminal's method of allowing you to schedule one-time jobs for a specific time and date. It's spontaneous automation made easy from the terminal. - -### Installing at - -On Linux, the `at` command is probably already installed. You can verify that it's installed using the `at -V` command. As long as a version is returned, you have `at` installed: - - -``` -$ at -V -at version x.y.z -``` - -Should you try to use `at` and the command isn't found, most modern Linux distributions offer to install the missing `at` package for you. - -### Scheduling a job interactively with at - -When you use the `at` command along with the time you want a task to run, you open an interactive `at` prompt. You can enter commands you want to run at the time you specified. - -If it helps, you can think of this process as a calendaring app, like the one you probably use on your mobile phone—first, you create an event on a day at some time, and then you specify what you want to happen. - -For example, try scheduling a memo to yourself by creating a task for a few minutes in the future. Make the task simple to reduce the likelihood of failure. To exit the `at` prompt, press **Ctrl+D** on your keyboard. - - -``` -$ at 11:20 AM -warning: commands will be executed using /bin/sh -at> echo "hello world" > ~/at-test.txt -at> <EOT> -job 3 at Mon Jul 26 11:20:00 2021 -``` - -As you can see, `at` uses intuitive and natural time definitions. You don't need to know the 24-hour clock or translate times to UTC or a specific ISO format. Generally, you can use whatever notation comes naturally to you, such as _noon_, _1:30 PM_, _13:37_, and so on, to describe when you want a task to happen. - -Wait a few minutes and then verify that your task has run by running the `cat` or the `tac` command on the file you created: - - -``` -$ cat ~/at-test.txt -hello world -``` - -### Scheduling a job with at - -You don't have to use the interactive prompt to schedule jobs with `at`. You can instead pipe commands to it using `echo` or `printf`. In this example, I use the notation _now_ and how many minutes from now I want the task to be delayed: - - -``` -`$ echo "echo 'hello again' >> ~/at-test.txt" | at now +1 minute` -``` - -After a minute, verify that the new command has been executed: - - -``` -$ cat ~/at-test.txt -hello world -hello again -``` - -### Time expressions - -The `at` command is pretty forgiving when interpreting times. You can choose between many formats, depending on which is most convenient for you: - - * `YYMMDDhhmm`[.ss] -(abbreviated year, month, day, hour, minute, and optionally seconds) - * `CCYYMMDDhhmm`[.ss] -(full year, month, day, hour, minute, and optionally seconds) - * `now` - * `midnight` - * `noon` - * `teatime` (4 PM) - * `AM` - * `PM` - - - -Times and dates can be absolute or add a plus sign (_+_) to make them relative to _now_. When specifying relative times, you can use words you probably already use: - - * `minutes` - * `hours` - * `days` - * `weeks` - * `months` - * `years` - - - -### Time and date syntax - -The `at` command is less forgiving in telling times from dates. The time must come first, followed by the day, although the day defaults to the current day and is only required when scheduling a task for someday in the future. - -These are examples of just a few valid expressions: - - -``` -$ echo "rsync -av /home/tux me@myserver:/home/tux/" | at 3:30 AM tomorrow -$ echo "/opt/batch.sh ~/Pictures" | at 3:30 AM 08/01/2022 -$ echo "echo hello" | at now + 3 days -``` - -### Viewing your at queue - -Once you've embraced `at` and are scheduling tasks instead of scribbling notes to yourself on scraps of paper lying around your desk, you may want to review whether you've got jobs still in the queue. - -To view your `at` queue, use the `atq` command: - - -``` -$ atq -10 Thu Jul 29 12:19:00 2021 a tux -9  Tue Jul 27 03:30:00 2021 a tux -7  Tue Jul 27 00:00:00 2021 a tux -``` - -To remove a task from your queue, use the `atrm` command along with the job number. To remove job 7, for instance: - - -``` -$ atrm 7 -$ atq -10 Thu Jul 29 12:19:00 2021 a tux -9  Tue Jul 27 03:30:00 2021 a tux -``` - -To see what's actually in a scheduled job, you have to look at the `at` spool. Only the root user can view the `at` spool, so you must use `sudo` to view the spool or to `cat` the contents of any job. - -### Schedule with Linux at - -The `at` system is an excellent way to avoid forgetting to run a job later in the day or to have your computer run a job for you when you're away. Unlike `cron`, it's free from the expectation that a job must run on a regular schedule from now until perpetuity, and its syntax is consequently a lot simpler than the `cron` syntax. - -Next time you have a small job you want your computer to remember and manage, try the `at` command. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/linux-at-command - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) -[2]: https://opensource.com/article/20/11/orchestration-vs-automation diff --git a/translated/tech/20210815 Schedule a task with the Linux at command.md b/translated/tech/20210815 Schedule a task with the Linux at command.md new file mode 100644 index 0000000000..a0b6549e4f --- /dev/null +++ b/translated/tech/20210815 Schedule a task with the Linux at command.md @@ -0,0 +1,169 @@ +[#]: subject: "Schedule a task with the Linux at command" +[#]: via: "https://opensource.com/article/21/8/linux-at-command" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 Linux 的命令来安排一个任务 +====== +at 命令是一种在特定时间和日期安排一次性任务的终端方法。 +![Team checklist][1] + +计算机擅长[自动化][2],但不是每个人都知道如何使自动化工作。不过,能够在特定的时间为电脑安排一个任务,然后忘记它,这确实是一种奢侈。也许你有一个文件要在特定的时间上传或下载,或者你需要处理一批还不存在但保证在某个时间存在的文件,或者需要监控的设置,或者你只是需要一个友好的提醒,在下班回家的路上拿起面包和黄油。 + +That's what the `at`command is for. +这就是 `at` 命令的用处。 + +### 什么是 Linux at 命令? + +`at` 命令是 Linux 终端允许你在特定时间和日期安排一次性工作的方法。它是一种自发的自动化,在终端上很容易实现。 + +### 安装 at + +在 Linux 上,`at` 命令可能已经安装了。你可以使用 `at -V` 命令来验证它是否已经安装。只要返回一个版本,就说明你已经安装了 `at`。 + + +``` +$ at -V +at version x.y.z +``` + +如果你试图使用 `at`,但没有找到该命令,大多数现代的 Linux 发行版会提供缺少的 `at` 包。 + +### 用 at 交互式地安排一个作业 + +当你使用 `at` 命令和你希望任务运行的时间时,你会打开一个交互式 `at` 提示。你可以输入你想在你指定的时间运行的命令。 + +如果有帮助的话,你可以把这个过程看作是一个日历应用,就像你可能在你的手机上使用的那样。首先,你在某一天的某个时间创建一个事件,然后指定你想要发生什么。 + +例如,尝试通过创建一个未来几分钟的任务来计划给自己的备忘录。让任务变得简单,以减少失败的可能性。要退出 `at` 提示,请按键盘上的 **Ctrl+D**。 + + +``` +$ at 11:20 AM +warning: commands will be executed using /bin/sh +at> echo "hello world" > ~/at-test.txt +at> <EOT> +job 3 at Mon Jul 26 11:20:00 2021 +``` + +正如你所看到的,`at` 使用直观和自然的时间定义。你不需要知道 24 小时制的时钟,也不需要把时间翻译成 UTC 或特定的 ISO 格式。一般来说,你可以使用你自然想到的任何符号,如 _noon_、_1:30 PM_、_13:37_ 等等,来描述你希望一个任务发生的时间。 + +等待几分钟,然后在你创建的文件上运行 `cat` 或者 `tac` 命令,验证你的任务是否已经运行: + + +``` +$ cat ~/at-test.txt +hello world +``` + +### 用 at 安排一个任务 + +你不必使用 `at` 交互式提示符来安排任务。你可以使用 `echo` 或 `printf` 向它传送命令。在这个例子中,我使用了 _now_ 符号,以及我希望任务从现在开始延迟多少分钟: + + +``` +`$ echo "echo 'hello again' >> ~/at-test.txt" | at now +1 minute` +``` + +一分钟后,验证新的命令是否已被执行: + + +``` +$ cat ~/at-test.txt +hello world +hello again +``` + +### 时间表达式 + +`at` 命令在解释时间时是非常宽容的。你可以在许多格式中选择,这取决于哪一种对你来说最方便: + + * `YYMMDDhhmm`[.ss] +(缩写的年、月、日、小时、分钟,也可选择秒) + * `CCYYMMDDhhmm`[.ss] +(完整的年、月、日、时、分,也可选择的秒) + * `now` + * `midnight` + * `noon` + * `teatime`(4 PM) + * `AM` + * `PM` + + + +时间和日期可以是绝对的,也可以加一个加号(_+_),使其与 _now_ 相对。当指定相对时间时,你可以使用你可能已经使用的词语: + + * `minutes` + * `hours` + * `days` + * `weeks` + * `months` + * `years` + + + +### 时间和日期语法 + +`at` 命令对日期的输入相比日期不那么宽容。时间必须放在第一位,接着是日期,尽管日期默认为当前日期,并且只有在为未来某天安排任务时才需要。 + +这些是一些有效表达式的例子: + + +``` +$ echo "rsync -av /home/tux me@myserver:/home/tux/" | at 3:30 AM tomorrow +$ echo "/opt/batch.sh ~/Pictures" | at 3:30 AM 08/01/2022 +$ echo "echo hello" | at now + 3 days +``` + +### 查看你的 at 队列 + +当你接受了 `at`,并且正在安排任务,而不是在桌子上的废纸上乱写乱画,你可能想查看一下你是否有任务还在队列中。 + + +要查看你的 `at` 队列,使用 `atq` 命令: + + +``` +$ atq +10 Thu Jul 29 12:19:00 2021 a tux +9 Tue Jul 27 03:30:00 2021 a tux +7 Tue Jul 27 00:00:00 2021 a tux +``` + +要从队列中删除一个任务,使用 `atrm` 命令和任务号。例如,要删除任务 7: + + +``` +$ atrm 7 +$ atq +10 Thu Jul 29 12:19:00 2021 a tux +9 Tue Jul 27 03:30:00 2021 a tux +``` + +要看一个计划中的任务的实际内容,你需要查看 `at` spool。只有 root 用户可以查看 `at` spool,所以你必须使用 `sudo` 来查看 spool 或 `cat` 任何任务的内容。 + +### 用 Linux at 安排任务 + +`at` 系统是一个很好的避免忘记在一天中晚些时候运行一个作业,或者在你离开时让你的计算机为你运行一个作业的方法。与 `cron` 不同的是,它不像 `cron` 那样要求任务必须从现在起一直按计划运行到永远,因此它的语法比 `cron` 简单得多。 + +等下次你有一个希望你的计算机记住并管理它的小任务,试试 `at` 命令。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-at-command + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://opensource.com/article/20/11/orchestration-vs-automation From 80a1bc8aba9c79cb3c327f353f6c454689cad157 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 19 Aug 2021 08:41:17 +0800 Subject: [PATCH 091/290] translating --- sources/tech/20210817 4 alternatives to cron in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210817 4 alternatives to cron in Linux.md b/sources/tech/20210817 4 alternatives to cron in Linux.md index 5f2cdc7752..5a42bbec2e 100644 --- a/sources/tech/20210817 4 alternatives to cron in Linux.md +++ b/sources/tech/20210817 4 alternatives to cron in Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/7/alternatives-cron-linux" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 4ba3dc410c5773e07cc5a0914895bff7037d8896 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 19 Aug 2021 08:43:00 +0800 Subject: [PATCH 092/290] Revert "translating" This reverts commit 80a1bc8aba9c79cb3c327f353f6c454689cad157. --- sources/tech/20210817 4 alternatives to cron in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210817 4 alternatives to cron in Linux.md b/sources/tech/20210817 4 alternatives to cron in Linux.md index 5a42bbec2e..5f2cdc7752 100644 --- a/sources/tech/20210817 4 alternatives to cron in Linux.md +++ b/sources/tech/20210817 4 alternatives to cron in Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/7/alternatives-cron-linux" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: "geekpi" +[#]: translator: " " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 1deee199e3b9c40b095856108484dc17a14d1cc9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 19 Aug 2021 08:44:56 +0800 Subject: [PATCH 093/290] translating --- ...tomatically Synchronize Subtitle With Video Using SubSync.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md index d4fb1fae2d..0bd21cdcc0 100644 --- a/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md +++ b/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/subsync/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 6ec41809b43badc470b4a258f785a5746e34b5ac Mon Sep 17 00:00:00 2001 From: SamMa Date: Thu, 19 Aug 2021 09:26:51 +0800 Subject: [PATCH 094/290] Update 20210805 Configure your OpenVPN server on Linux.md --- ...805 Configure your OpenVPN server on Linux.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/translated/tech/20210805 Configure your OpenVPN server on Linux.md b/translated/tech/20210805 Configure your OpenVPN server on Linux.md index 6c997507f6..7e89649e27 100644 --- a/translated/tech/20210805 Configure your OpenVPN server on Linux.md +++ b/translated/tech/20210805 Configure your OpenVPN server on Linux.md @@ -3,7 +3,7 @@ [#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " @@ -12,27 +12,27 @@ 在你安装了 OpenVPN 之后,是时候配置它了。 ![Lock][1] -OpenVPN 在两点之间建立一个加密的隧道,防止第三方访问你的网络流量。通过设置你的虚拟私人网络(VPN)服务器,你就成为你自己的 VPN 供应商。许多流行的 VPN 服务已经使用 [OpenVPN][2],所以当你可以完全控制时,为什么要把你的连接绑定到一个特定的供应商? +OpenVPN 在两点之间建立一条加密的隧道,防止第三方访问你的网络流量。通过设置你的虚拟私人网络(VPN)服务器,你就成为你自己的 VPN 供应商。许多流行的 VPN 服务已支持 [OpenVPN][2],所以当你可以完全控制时,为什么要把你的连接绑定到一个特定的供应商? -本系列中的[第一篇][3]设置了一个 VPN 服务器,[第二篇][4]演示了如何安装和配置 OpenVPN 服务器软件。这第三篇文章展示了如何在认证到位的情况下启动 OpenVPN。 +本系列中的[第一篇][3]设置了一个 VPN 服务器,[第二篇][4]演示了如何安装和配置 OpenVPN 服务器软件。这第三篇文章演示了如何在认证成功的情况下启动 OpenVPN。 要设置一个 OpenVPN 服务器,你必须: * 创建一个配置文件。 * 设置 `sysctl` 值 `net.ipv4.ip_forward = 1` 以启用路由。 - * 为所有的配置和认证文件设置适当的所有权,以便在一个非 root 账户下运行 OpenVPN 服务器守护程序。 - * 设置 OpenVPN 以适当的配置文件启动。 + * 为所有的配置和认证文件设置适当的所有权,以便使用非 root 账户运行 OpenVPN 服务器守护程序。 + * 设置 OpenVPN 加载适当的配置文件启动。 * 配置你的防火墙。 ### 配置文件 -你必须在 `/etc/openvpn/server/` 中创建一个服务器配置文件。如果你想的话,你可以从头开始,OpenVPN 包括了几个样本配置文件,可以作为开始。看看 `/usr/share/doc/openvpn/sample/sample-config-files/` 就知道了。 +你必须在 `/etc/openvpn/server/` 中创建一个服务器配置文件。如果你想的话,你可以从头开始,OpenVPN 包括了几个配置示例示例文件,可以以此作为开始。看看 `/usr/share/doc/openvpn/sample/sample-config-files/` 就知道了。 -如果你想手工建立一个配置文件,从 `server.conf` 或 `roadwarrior-server.conf` 开始(视情况而定),并将你的配置文件放在 `/etc/openvpn/server` 中。这两个文件都有大量的注释,所以请阅读注释并决定哪一个适用你的情况。 +如果你想手工建立一个配置文件,从 `server.conf` 或 `roadwarrior-server.conf` 开始(视情况而定),并将你的配置文件放在 `/etc/openvpn/server` 中。这两个文件都有大量的注释,所以请阅读注释并根据你的情况作出决定。 -你可以通过使用我预先建立的服务器和客户端配置文件模板和 `sysctl` 文件来打开网络路由,从而节省时间和麻烦。这个配置还包括自定义记录连接和断开的情况。它在 OpenVPN 服务器的 `/etc/openvpn/server/logs` 中保存日志。 +你可以使用我预先建立的服务器和客户端配置文件模板和 `sysctl` 文件来打开网络路由,从而节省时间和麻烦。这个配置还包括自定义记录连接和断开的情况。它在 OpenVPN 服务器的 `/etc/openvpn/server/logs` 中保存日志。 如果你使用我的模板,你将需要编辑它们以使用你的 IP 地址和主机名。 From 5d223e0870ae284621711d3950a85bdb01bce8b8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 19 Aug 2021 09:30:33 +0800 Subject: [PATCH 095/290] Rename sources/tech/20210818 Setting new expectations for open source maintainers.md to sources/talk/20210818 Setting new expectations for open source maintainers.md --- ...210818 Setting new expectations for open source maintainers.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210818 Setting new expectations for open source maintainers.md (100%) diff --git a/sources/tech/20210818 Setting new expectations for open source maintainers.md b/sources/talk/20210818 Setting new expectations for open source maintainers.md similarity index 100% rename from sources/tech/20210818 Setting new expectations for open source maintainers.md rename to sources/talk/20210818 Setting new expectations for open source maintainers.md From b3a96c0fe9a820390eaa7056d7dfebdb9bcb6616 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 09:57:20 +0800 Subject: [PATCH 096/290] APL --- sources/tech/20210713 Use VS Code to develop in containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210713 Use VS Code to develop in containers.md b/sources/tech/20210713 Use VS Code to develop in containers.md index d2248aa19d..acaa5665b1 100644 --- a/sources/tech/20210713 Use VS Code to develop in containers.md +++ b/sources/tech/20210713 Use VS Code to develop in containers.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/vs-code-remote-containers-podman) [#]: author: (Brant Evans https://opensource.com/users/branic) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 680b66a474a74ea85d998a2c32b223f9128af7f1 Mon Sep 17 00:00:00 2001 From: SamMa Date: Thu, 19 Aug 2021 10:20:31 +0800 Subject: [PATCH 097/290] Update 20210805 Configure your OpenVPN server on Linux.md --- ...0210805 Configure your OpenVPN server on Linux.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/translated/tech/20210805 Configure your OpenVPN server on Linux.md b/translated/tech/20210805 Configure your OpenVPN server on Linux.md index 7e89649e27..ac78c71494 100644 --- a/translated/tech/20210805 Configure your OpenVPN server on Linux.md +++ b/translated/tech/20210805 Configure your OpenVPN server on Linux.md @@ -34,7 +34,7 @@ OpenVPN 在两点之间建立一条加密的隧道,防止第三方访问你的 你可以使用我预先建立的服务器和客户端配置文件模板和 `sysctl` 文件来打开网络路由,从而节省时间和麻烦。这个配置还包括自定义记录连接和断开的情况。它在 OpenVPN 服务器的 `/etc/openvpn/server/logs` 中保存日志。 -如果你使用我的模板,你将需要编辑它们以使用你的 IP 地址和主机名。 +如果你使用我的模板,你需要使用你的 IP 地址和主机名编辑它们。 要使用我的预建配置模板、脚本和 `sysctl` 来打开 IP 转发,请下载我的脚本: @@ -45,7 +45,7 @@ $ curl \ OVPNdownloads.sh ``` -阅读该脚本,了解它的工作内容。下面是它的行为概述: +阅读该脚本,了解它的工作内容。下面是它的运行概述: * 在你的 OpenVPN 服务器上创建适当的目录 * 从我的网站下载服务器和客户端的配置文件模板 @@ -124,7 +124,7 @@ $ sudo chown -R openvpn.openvpn /etc/openvpn ### 防火墙 -如果你在步骤 1 中决定不禁用 firewalld 服务,那么你的服务器的防火墙服务可能默认不允许 VPN 流量。使用 [`firewall-cmd` 命令][5],你可以启用 OpenVPN 服务,它可以打开必要的端口并根据需要路由流量: +如果你在步骤 1 中启用 firewalld 服务,那么你的服务器的防火墙服务可能默认不允许 VPN 流量。使用 [`firewall-cmd` 命令][5],你可以启用 OpenVPN 服务,它可以打开必要的端口并按需路由流量: ``` @@ -136,7 +136,7 @@ $ sudo firewall-cmd --reload ### 启动你的服务器 -现在你可以启动你的 OpenVPN 服务器了。为了让它在重启后自动启动,使用 `systemctl` 的 `enable` 子命令: +现在你可以启动 OpenVPN 服务器了。为了让它在重启后自动运行,使用 `systemctl` 的 `enable` 子命令: ``` @@ -145,7 +145,7 @@ $ sudo firewall-cmd --reload ### 最后的步骤 -本文的第四篇也是最后一篇文章将演示如何设置客户端,以便从远处连接到你的 OpenVPN。 +本文的第四篇也是最后一篇文章将演示如何设置客户端,以便远程连接到你的 OpenVPN。 * * * @@ -159,7 +159,7 @@ via: https://opensource.com/article/21/7/openvpn-firewall 作者:[D. Greg Scott][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fa8e387eceead9312f633e573288122426d6bb8c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 10:59:03 +0800 Subject: [PATCH 098/290] TSL --- ...13 Use VS Code to develop in containers.md | 138 ------------------ ...13 Use VS Code to develop in containers.md | 124 ++++++++++++++++ 2 files changed, 124 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20210713 Use VS Code to develop in containers.md create mode 100644 translated/tech/20210713 Use VS Code to develop in containers.md diff --git a/sources/tech/20210713 Use VS Code to develop in containers.md b/sources/tech/20210713 Use VS Code to develop in containers.md deleted file mode 100644 index acaa5665b1..0000000000 --- a/sources/tech/20210713 Use VS Code to develop in containers.md +++ /dev/null @@ -1,138 +0,0 @@ -[#]: subject: (Use VS Code to develop in containers) -[#]: via: (https://opensource.com/article/21/7/vs-code-remote-containers-podman) -[#]: author: (Brant Evans https://opensource.com/users/branic) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Use VS Code to develop in containers -====== -Create consistency to avoid problems when you have multiple developers -working on the same project. -![Women programming][1] - -Coding and testing inconsistencies are a risk when you have multiple developers with different development environments working on a project. [Visual Studio Code][2] (VS Code) is an integrated development environment (IDE) that can help minimize these issues. It can be combined with containers to provide separate development environments for each application alongside a consistent development environment. - -VS Code's [Remote - Containers extension][3] enables you to define a container, use that definition to build a container, and develop inside the container. This container definition can be checked into the source code repository along with the application code, which allows all developers to use the same definition to build and develop within a container. - -By default, the Remote - Containers extension uses Docker to build and run the container, but it is easy to use [Podman][4] for container runtimes, and it enables using [rootless containers][5]. - -This article walks you through the setup to develop inside a rootless container using Podman with VS Code and the Remote - Containers extension. - -### Initial configuration - -Before continuing, ensure your Red Hat Enterprise Linux (RHEL) or Fedora workstation is updated with the latest errata and that VS Code and the Remote - Containers extension are installed. (See the [VS Code website][2] for more information on installing.) - -Next, install Podman and its supporting packages with a simple `dnf install` command: - - -``` -`$ sudo dnf install -y podman` -``` - -After you install Podman, configure VS Code to use the Podman executable (instead of Docker) for interacting with the container. Within VS Code, navigate to **File > Preferences > Settings** and click the **>** icon next to **Extensions**. In the dropdown menu that appears, select **Remote - Containers**, and scroll down to find the **Remote > Containers: Docker Path** option. In the text box, replace docker with **podman**. - -![Enter "podman" in the text box][6] - -(Brant Evans, [CC BY-SA 4.0][7]) - -Now that the configurations are done, create and open a new folder or an existing folder for the project in VS Code. - -### Define the container - -This tutorial uses the example of creating a container for Python 3 development. - -The Remote - Containers extension can add the necessary basic configuration files to the project folder. To add these files, open the Command Pallet by entering **Ctrl+Shift+P** on your keyboard, search for **Remote-Containers: Add Development Container Configuration Files**, and select it. - -![Remote-Containers: Add Development Container Configuration Files][8] - -(Brant Evans, [CC BY-SA 4.0][7]) - -In the next pop-up, define the type of development environment you want to set up. For this example configuration, search for the **Python 3** definition and select it. - -![Select Python 3 definition][9] - -(Brant Evans, [CC BY-SA 4.0][7]) - -Next, select the version of Python that will be used in the container. Select the **3 (default)** option to use the latest version. - -![Select the 3 \(default\) option][10] - -(Brant Evans, [CC BY-SA 4.0][7]) - -The Python configuration can also install Node.js, but for this example, **uncheck Install Node.js** and click OK. - -![Uncheck "Install Node.js"][11] - -(Brant Evans, [CC BY-SA 4.0][7]) - -It will create a `.devcontainer` folder containing files named `devcontainer.json` and `Dockerfile`. VS Code automatically opens the `devcontainer.json` file so that you can customize it. - -### Enable rootless containers - -In addition to the obvious security benefits, one of the other reasons to run a container as rootless is that all the files created in the project folder will be owned by the correct user ID (UID) outside the container. To run the development container as a rootless container, modify the `devcontainer.json` file by adding the following lines to the end of it: - - -``` -"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z", -"workspaceFolder": "/workspace", - -"runArgs": ["--userns=keep-id"], -"containerUser": "vscode" -``` - -These options tell VS Code to mount the Workspace with the proper SELinux context, create a user namespace that maps your UID and GID to the same values inside the container, and use `vscode` as your username inside the container. The `devcontainer.json` file should look like this (don't forget the commas at the end of the lines, as indicated): - -![Updated devcontainer.json file][12] - -(Brant Evans, [CC BY-SA 4.0][7]) - -Now that you've set up the container configuration, you can build the container and open the workspace inside it. Reopen the Command Palette (with **Ctrl+Shift+P**), and search for **Remote-Containers: Rebuild and Reopen in Container**. Click on it, and VS Code will start to build the container. Now is a great time to take a break (and get your favorite beverage), as building the container may take several minutes. - -![Building the container][13] - -(Brant Evans, [CC BY-SA 4.0][7]) - -Once the container build completes, the project will open inside the container. Files created or edited within the container will be reflected in the filesystem outside the container with the proper user permissions applied to the files. Now, you can proceed with development within the container. VS Code can even bring your SSH keys and Git configuration into the container so that committing code will work just like it does when editing outside the container. - -### Next steps - -Now that you've completed the basic setup and configuration, you can further enhance the configuration's usefulness. For example: - - * Modify the Dockerfile to install additional software (e.g., required Python modules). - * Use a customized container image. For example, if you're doing Ansible development, you could use Quay.io's [Ansible Toolset][14]. (Be sure to add the `vscode` user to the container image via the Dockerfile.) - * Commit the files in the `.devcontainer` directory to the source code repository so that other developers can take advantage of the container definition for their development efforts. - - - -Developing inside a container helps prevent conflicts between different projects by keeping the dependencies and code for each separate. You can use Podman to run containers in a rootless environment that increases security. By combining VS Code, the Remote - Containers extension, and Podman, you can easily set up a consistent environment for multiple developers, decrease setup time, and reduce bugs from differences in development environments in a secure fashion. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/vs-code-remote-containers-podman - -作者:[Brant Evans][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/branic -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G (Women programming) -[2]: https://code.visualstudio.com/ -[3]: https://code.visualstudio.com/docs/remote/containers -[4]: https://podman.io/ -[5]: https://www.redhat.com/sysadmin/rootless-podman-makes-sense -[6]: https://opensource.com/sites/default/files/uploads/vscode-remote_podman.png (Enter "podman" in the text box) -[7]: https://creativecommons.org/licenses/by-sa/4.0/ -[8]: https://opensource.com/sites/default/files/uploads/adddevelopmentcontainerconfigurationfiles.png (Remote-Containers: Add Development Container Configuration Files) -[9]: https://opensource.com/sites/default/files/uploads/python3.png (Select Python 3 definition) -[10]: https://opensource.com/sites/default/files/uploads/python3default.png (Select the 3 (default) option) -[11]: https://opensource.com/sites/default/files/uploads/unchecknodejs.png (Uncheck "Install Node.js") -[12]: https://opensource.com/sites/default/files/uploads/newdevcontainerjson.png (Updated devcontainer.json file) -[13]: https://opensource.com/sites/default/files/uploads/buildingcontainer.png (Building the container) -[14]: https://quay.io/repository/ansible/toolset diff --git a/translated/tech/20210713 Use VS Code to develop in containers.md b/translated/tech/20210713 Use VS Code to develop in containers.md new file mode 100644 index 0000000000..dfcbbf8640 --- /dev/null +++ b/translated/tech/20210713 Use VS Code to develop in containers.md @@ -0,0 +1,124 @@ +[#]: subject: (Use VS Code to develop in containers) +[#]: via: (https://opensource.com/article/21/7/vs-code-remote-containers-podman) +[#]: author: (Brant Evans https://opensource.com/users/branic) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 VS Code 在容器中开发 +====== + +>创建一致性,以避免当你有多个开发人员开发同一个项目时出现问题。 + +![Women programming][1] + +当你有多个不同开发环境的开发人员在一个项目上工作时,编码和测试的不一致性是一种风险。[Visual Studio Code][2](VS Code)是一个集成开发环境(IDE),可以帮助减少这些问题。它可以和容器结合起来,为每个应用程序提供独立的开发环境,同时提供一个一致的开发环境。 + +VS Code 的 [Remote - Containers 扩展][3] 使你能够定义一个容器,使用该定义来构建一个容器,并在容器内进行开发。这个容器定义可以和应用程序代码一起被签入到源代码库中,这使得所有的开发人员可以使用相同的定义在容器中进行构建和开发。 + +默认情况下,Remote - Containers 扩展使用 Docker 来构建和运行容器,但使用 [Podman][4] 的容器运行环境环境也很容易,它可以让你使用 [免 root 容器][5]。 + +本文将带领你完成设置,通过 Podman 在免 root 容器内使用 VS Code 和 Remote - Containers 扩展进行开发。 + +### 初始配置 + +在继续之前,请确保你的红帽企业 Linux(RHEL)或 Fedora 工作站已经更新了最新的补丁,并且安装了 VS Code 和 Remote - Containers 扩展。(参见 [VS Code 网站][2]了解更多安装信息) + +接下来,用一个简单的 `dnf install` 命令来安装 Podman 和它的支持包: + + +``` +$ sudo dnf install -y podman +``` + +安装完 Podman 后,配置 VS Code 以使用 Podman 的可执行文件(而不是 Docker)与容器进行交互。在 VS Code 中,导航到 “文件 > 首选项 > 设置”,点击 “扩展” 旁边的 “>” 图标。在出现的下拉菜单中,选择 “Remote - Containers”,并向下滚动找到 “Remote - Containers: Docker Path” 选项。在文本框中,用 “podman” 替换 “docker”。 + +![在文本框中输入 “podman”][6] + +现在配置已经完成,在 VS Code 中为该项目创建一个新的文件夹或并打开现有的文件夹。 + +### 定义容器 + +本教程以创建 Python 3 开发的容器为例。 + +Remote - Containers 扩展可以在项目文件夹中添加必要的基本配置文件。要添加这些文件,通过在键盘上输入 `Ctrl+Shift+P` 打开命令面板,搜索 “Remote-Containers: Add Development Container Configuration Files”,并选择它。 + +![Remote-Containers: Add Development Container Configuration Files][8] 。 + +在接下来的弹出窗口中,定义你想设置的开发环境的类型。对于这个例子的配置,搜索 “Python 3” 定义并选择它。 + +![选择 Python 3 定义][9] 。 + + +接下来,选择将在容器中使用的 Python 的版本。选择 “3 (default)” 选项以使用最新的版本。 + +![选择 “3 (default)” 选项][10] + +Python 配置也可以安装 Node.js,但在这个例子中,*取消勾选“Install Node.js”,然后点击 “OK”。 + +![取消勾选 “Install Node.js"][11] + +它将创建一个 `.devcontainer` 文件夹,包含文件`devcontainer.json`和`Dockerfile`。VS Code 会自动打开`devcontainer.json` 文件,这样你就可以对它进行自定义。 + +### 启用免 root 容器 + +除了明显的安全优势外,以免 root 方式运行容器的另一个原因是,在项目文件夹中创建的所有文件将由容器外的正确用户 ID(UID)拥有。要将开发容器作为免 root 容器运行,请修改 `devcontainer.json` 文件,在它的末尾添加以下几行: + + +``` +"workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z", +"workspaceFolder": "/workspace", + +"runArgs": ["--userns=keep-id"], +"containerUser": "vscode" +``` + +这些选项告诉 VS Code 用适当的 SELinux 上下文挂载工作区,创建一个用户命名空间,将你的 UID 和 GID 同样映射到容器内,并在容器内使用 `vscode` 作为你的用户名。`devcontainer.json` 文件应该是这样的(别忘了行末的逗号,如图所示): + +![更新后的 devcontainer.json 文件][12] + +现在你已经设置好了容器的配置,你可以构建容器并打开里面的工作空间。重新打开命令调板(用 `Ctrl+Shift+P`),并搜索 “Remote-Containers: Rebuild and Reopen in Container”。点击它,VS Code 将开始构建容器。现在是休息一下的好时机(拿上你最喜欢的饮料),因为构建容器可能需要几分钟时间: + +![构建容器][13] + +一旦容器构建完成,项目将在容器内打开。在容器内创建或编辑的文件将反映在容器外的文件系统中,并对这些文件应用适当的用户权限。现在,你可以在容器内进行开发。VS Code 甚至可以把你的 SSH 密钥和 Git 配置带入容器中,这样提交代码就会像在容器外编辑时那样工作。 + +### 接下来的步骤 + +现在你已经完成了基本的设置和配置,你可以进一步加强配置的实用性。比如说: + + * 修改 Dockerfile 以安装额外的软件(例如,所需的 Python 模块)。 + * 使用一个定制的容器镜像。例如,如果你正在进行 Ansible 开发,你可以使用 Quay.io 的 [Ansible Toolset][14]。(确保通过 Dockerfile 将 `vscode` 用户添加到容器镜像中)。) + * 将 `.devcontainer` 目录下的文件提交到源代码库,以便其他开发者可以利用容器的定义进行开发工作。 + +在容器内开发有助于防止不同项目之间的冲突,因为不同项目的依赖关系及代码都是分开的。你可以使用 Podman 在免 root 环境下运行容器,从而提高安全性。通过结合 VS Code、Remote - Containers 扩展和 Podman,你可以轻松地为多个开发人员建立一个一致的环境,减少设置时间,并以安全的方式减少开发环境的差异带来的错误。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/vs-code-remote-containers-podman + +作者:[Brant Evans][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/branic +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/collab-team-pair-programming-code-keyboard2.png?itok=WnKfsl-G (Women programming) +[2]: https://code.visualstudio.com/ +[3]: https://code.visualstudio.com/docs/remote/containers +[4]: https://podman.io/ +[5]: https://www.redhat.com/sysadmin/rootless-podman-makes-sense +[6]: https://opensource.com/sites/default/files/uploads/vscode-remote_podman.png (Enter "podman" in the text box) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/adddevelopmentcontainerconfigurationfiles.png (Remote-Containers: Add Development Container Configuration Files) +[9]: https://opensource.com/sites/default/files/uploads/python3.png (Select Python 3 definition) +[10]: https://opensource.com/sites/default/files/uploads/python3default.png (Select the 3 \(default\) option) +[11]: https://opensource.com/sites/default/files/uploads/unchecknodejs.png (Uncheck "Install Node.js") +[12]: https://opensource.com/sites/default/files/uploads/newdevcontainerjson.png (Updated devcontainer.json file) +[13]: https://opensource.com/sites/default/files/uploads/buildingcontainer.png (Building the container) +[14]: https://quay.io/repository/ansible/toolset From 5e364b8d1380acd13c18da8d45856cd9a5ab44a4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 11:11:42 +0800 Subject: [PATCH 099/290] PUB @wxy https://linux.cn/article-13695-1.html --- ...in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md (98%) diff --git a/translated/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md b/published/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md similarity index 98% rename from translated/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md rename to published/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md index 04634c409c..e2190e87dd 100644 --- a/translated/news/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md +++ b/published/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13695-1.html" 新发布的 Debian 11 “Bullseye” Linux 发行版的 7 大亮点 ====== From cf189c0894a3a206208f28e94d9498beca20c6bd Mon Sep 17 00:00:00 2001 From: Mo Date: Thu, 19 Aug 2021 03:22:58 +0000 Subject: [PATCH 100/290] [translating] How to Know if Your System Uses MBR or GPT Partitioning --- ...System Uses MBR or GPT Partitioning -on Windows and Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md b/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md index 5532fd9485..8e9146c51d 100644 --- a/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md +++ b/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/check-mbr-or-gpt/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (alim0x) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 1fdd01a75d3602a1a7cb502e8b7188048ddc5041 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 11:33:35 +0800 Subject: [PATCH 101/290] PRF @geekpi --- ...802 Use OpenCV on Fedora Linux - part 1.md | 64 +++++++++---------- 1 file changed, 31 insertions(+), 33 deletions(-) diff --git a/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md b/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md index 8e5c9a5867..c1f00cc484 100644 --- a/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md +++ b/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md @@ -3,36 +3,40 @@ [#]: author: (Onuralp SEZER https://fedoramagazine.org/author/thunderbirdtr/) [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -在 Fedora Linux 上使用 OpenCV ‒ 第一部分 +在 Fedora Linux 上使用 OpenCV(一) ====== ![][1] -封面图片选自[文森特-凡高][2]的《星空》,公共领域,通过维基共享资源发布 +*封面图片选自[文森特·梵高][2]的《星空》,公共领域,通过维基共享资源发布* -技术世界每天都在变化,对计算机视觉、人工智能和机器学习的需求也在增加。让计算机和手机能够看到周围环境的技术被称为[计算机视觉][3]。重新创造人眼的工作始于 50 年代。从那时起,计算机视觉技术有了长足的发展。计算机视觉已经通过不同的应用进入了我们的手机。这篇文章将介绍 Fedora Linux 上的[OpenCV][4]。 +技术世界每天都在变化,对计算机视觉、人工智能和机器学习的需求也在增加。让计算机和手机能够看到周围环境的技术被称为 [计算机视觉][3]。这个重新创造人眼的工作始于 50 年代。从那时起,计算机视觉技术有了长足的发展。计算机视觉已经通过不同的应用进入了我们的手机。这篇文章将介绍 Fedora Linux 上的 [OpenCV][4]。 -### **什么是 OpenCV?** +### 什么是 OpenCV? -> OpenCV (开源计算机视觉库)是一个开源的计算机视觉和机器学习软件库。OpenCV 的建立是为了给计算机视觉应用提供一个通用的基础设施,并加速机器感知在商业产品中的应用。它有超过 2500 种优化算法,其中包括一套全面的经典和最先进的计算机视觉和机器学习算法。这些算法可用于检测和识别人脸,识别物体,对视频中的人类行为进行分类,并建立标记,将其与增强现实叠加等等。 +> OpenCV(开源计算机视觉库Open Source Computer Vision Library)是一个开源的计算机视觉和机器学习软件库。OpenCV 的建立是为了给计算机视觉应用提供一个通用的基础设施,并加速机器感知在商业产品中的应用。它有超过 2500 种优化后的算法,其中包括一套全面的经典和最先进的计算机视觉和机器学习算法。这些算法可用于检测和识别人脸、识别物体、对视频中的人类行为进行分类,并建立标记,将其与增强现实叠加等等。 > > [opencv.org – about][5] ### 在 Fedora Linux 上安装 OpenCV -要开始使用 OpenCV,请从 Fedora Linux 仓库中安装它。 +要开始使用 OpenCV,请从 Fedora Linux 仓库中安装它: ``` $ sudo dnf install opencv opencv-contrib opencv-doc python3-opencv python3-matplotlib python3-numpy ``` -**注意:**在 Fedora Silverblue 或 CoreOs 上,Python 3.9 是核心提交的一部分。用以下方法安装 OpenCV 和所需工具:_rpm-ostree install opencv opencv-doc python3-opencv python3-matplotlib python3-numpy_。 +**注意:** 在 Fedora Silverblue 或 CoreOS 上,Python 3.9 是核心提交的一部分。用以下方法安装 OpenCV 和所需工具: -接下来,在终端输入以下命令,以验证 OpenCV 是否已经安装(用户输入的内容以粗体显示)。 +``` +rpm-ostree install opencv opencv-doc python3-opencv python3-matplotlib python3-numpy +``` + +接下来,在终端输入以下命令,以验证 OpenCV 是否已经安装: ``` $ python @@ -45,20 +49,20 @@ Type "help", "copyright", "credits" or "license" for more information. >>> exit() ``` -当你输入 _print_ 命令时,应该显示当前的 OpenCV 版本,如上图所示。这表明 OpenCV 和 Python-OpenCV 库已经成功安装。 +当你输入 `print` 命令时,应该显示当前的 OpenCV 版本,如上图所示。这表明 OpenCV 和 Python-OpenCV 库已经成功安装。 -此外,如果你想用 Jupyter Notebook 做笔记和写代码,并了解更多关于数据科学工具的信息,请查看早期的 Fedora Magazine 文章:[_Fedora 中的 Jupyter 和数据科学_][6]。 +此外,如果你想用 Jupyter Notebook 做笔记和写代码,并了解更多关于数据科学工具的信息,请查看早期的 Fedora Magazine 文章:[Fedora 中的 Jupyter 和数据科学][6]。 ### 开始使用 OpenCV -安装完成后,使用 Python 和 OpenCV 库加载一个样本图像(按 **S** 键以 _png_ 格式保存图像的副本并完成程序): +安装完成后,使用 Python 和 OpenCV 库加载一个样本图像(按 `S` 键以 png 格式保存图像的副本并完成程序): ``` $ cp /usr/share/opencv4/samples/data/starry_night.jpg . $ python starry_night.py ``` -_starry_night.py_ 的内容: +`starry_night.py` 的内容: ``` import cv2 as cv @@ -74,7 +78,7 @@ if k == ord("s"): ![][7] -通过在 _cv.imread_ 函数中添加参数 **0**,对图像进行灰度处理,如下所示。 +通过在 `cv.imread` 函数中添加参数 `0`,对图像进行灰度处理,如下所示。 ``` img = cv.imread(cv.samples.findFile("starry_night.jpg"),0) @@ -82,13 +86,11 @@ img = cv.imread(cv.samples.findFile("starry_night.jpg"),0) ![][8] -这些是一些可以用于 _cv.imread_ 函数的第二个参数的替代值。 - - * **cv2.IMREAD_GRAYSCALE** 或 **0:** 以灰度模式加载图像。 - * **cv2.IMREAD_COLOR** 或 **1:** 以彩色模式载入图像。图像中的任何透明度将被移除。这是默认的。 - * **cv2.IMREAD_UNCHANGED** 或 **-1:**载入未经修改的图像。包括 alpha 通道。 - +这些是一些可以用于 `cv.imread` 函数的第二个参数的替代值: + * `cv2.IMREAD_GRAYSCALE` 或 `0`:以灰度模式加载图像。 + * `cv2.IMREAD_COLOR** 或 `1`:以彩色模式载入图像。图像中的任何透明度将被移除。这是默认的。 + * `cv2.IMREAD_UNCHANGED** 或 `-1`:载入未经修改的图像。包括 alpha 通道。 #### 使用 OpenCV 显示图像属性 @@ -121,10 +123,8 @@ Image 2D numpy array ... ``` - * **img.shape:** 返回一个行数、列数和通道数的元组(如果是彩色图像)。 - * **img.dtype:** 返回图像的数据类型。 - - + * `img.shape`:返回一个行数、列数和通道数的元组(如果是彩色图像)。 + * `img.dtype`:返回图像的数据类型。 接下来用 Matplotlib 显示图像: @@ -140,7 +140,7 @@ plt.show() #### 发生了什么? -该图像是作为灰度图像读入的,但是当使用 Matplotlib 的 _imshow_ 函数时,它不一定会以灰度显示。这是因为 _imshow_ 函数默认使用不同的颜色映射。要指定使用灰度颜色映射,请将 _imshow_ 函数的第二个参数设置为 _cmap='gray'_,如下所示。 +该图像是作为灰度图像读入的,但是当使用 Matplotlib 的 `imshow` 函数时,它不一定会以灰度显示。这是因为 `imshow` 函数默认使用不同的颜色映射。要指定使用灰度颜色映射,请将 `imshow` 函数的第二个参数设置为 `cmap='gray'`,如下所示: ``` plt.imshow(img,cmap='gray') @@ -192,16 +192,14 @@ plt.show() ![][12] - * **cv2.split:**将一个多通道数组分割成几个单通道数组。 - * **cv2.merge:** 将几个数组合并成一个多通道数组。所有的输入矩阵必须具有相同的大小。 + * `cv2.split`:将一个多通道数组分割成几个单通道数组。 + * `cv2.merge`:将几个数组合并成一个多通道数组。所有的输入矩阵必须具有相同的大小。 - - -**注意:**白色较多的图像具有较高的颜色密度。相反,黑色较多的图像,其颜色密度较低。在上面的例子中,红色的密度是最低的。 +**注意:** 白色较多的图像具有较高的颜色密度。相反,黑色较多的图像,其颜色密度较低。在上面的例子中,红色的密度是最低的。 #### 转换到不同的色彩空间 -_cv2.cvtColor_ 函数将一个输入图像从一个颜色空间转换到另一个颜色空间。在 RGB 和 BGR 色彩空间之间转换时,应明确指定通道的顺序(_RGB2BGR_ 或 _BGR2RGB_)。**注意,OpenCV 中的默认颜色格式通常被称为 RGB,但它实际上是 BGR(字节是相反的)。**因此,标准(24 位)彩色图像的第一个字节将是一个 8 位蓝色分量,第二个字节是绿色,第三个字节是红色。然后第四、第五和第六个字节将是第二个像素(蓝色,然后是绿色,然后是红色),以此类推。 +`cv2.cvtColor` 函数将一个输入图像从一个颜色空间转换到另一个颜色空间。在 RGB 和 BGR 色彩空间之间转换时,应明确指定通道的顺序(`RGB2BGR` 或 `BGR2RGB`)。**注意,OpenCV 中的默认颜色格式通常被称为 RGB,但它实际上是 BGR(字节是相反的)。** 因此,标准(24 位)彩色图像的第一个字节将是一个 8 位蓝色分量,第二个字节是绿色,第三个字节是红色。然后第四、第五和第六个字节将是第二个像素(蓝色、然后是绿色,然后是红色),以此类推。 ``` import cv2 as cv @@ -218,7 +216,7 @@ plt.show() 关于 OpenCV 的更多细节可以在[在线文档][14]中找到。 -谢谢。 +感谢阅读。 -------------------------------------------------------------------------------- @@ -227,7 +225,7 @@ via: https://fedoramagazine.org/use-opencv-on-fedora-linux-part-1/ 作者:[Onuralp SEZER][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From dfd148ed80b47acf350663b8f5d1b0785f18220e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 11:34:34 +0800 Subject: [PATCH 102/290] PUB @geekpi https://linux.cn/article-13698-1.html --- .../20210802 Use OpenCV on Fedora Linux - part 1.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210802 Use OpenCV on Fedora Linux - part 1.md (99%) diff --git a/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md b/published/20210802 Use OpenCV on Fedora Linux - part 1.md similarity index 99% rename from translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md rename to published/20210802 Use OpenCV on Fedora Linux - part 1.md index c1f00cc484..b1bb746623 100644 --- a/translated/tech/20210802 Use OpenCV on Fedora Linux - part 1.md +++ b/published/20210802 Use OpenCV on Fedora Linux - part 1.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13698-1.html) 在 Fedora Linux 上使用 OpenCV(一) ====== From 8dd6c54e7a738c4adc530b521069858d70865238 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 11:59:41 +0800 Subject: [PATCH 103/290] PRF @unigeorge --- ...ommand options in Java with commons-cli.md | 133 +++++++++--------- 1 file changed, 67 insertions(+), 66 deletions(-) diff --git a/translated/tech/20210813 Parse command options in Java with commons-cli.md b/translated/tech/20210813 Parse command options in Java with commons-cli.md index f4789d23ea..bc0ce01c0c 100644 --- a/translated/tech/20210813 Parse command options in Java with commons-cli.md +++ b/translated/tech/20210813 Parse command options in Java with commons-cli.md @@ -3,14 +3,16 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 使用 commons-cli 解析 Java 中的命令行选项 ====== -让用户学会用命令行选项调整你的 Java 应用程序运行方式。 -![Learning and studying technology is the key to success][1] + +> 让用户用命令行选项调整你的 Java 应用程序运行方式。 + +![](https://img.linux.net.cn/data/attachment/album/202108/19/115907lvjwc1ce5avumaau.jpg) 通常向终端中输入命令时,无论是启动 GUI 应用程序还是仅启动终端应用程序,都可以使用 @@ -22,13 +24,13 @@ Java 中有若干种解析选项的方法,其中我最喜欢用的是 [Apache ### 安装 commons-cli -如果你使用类似 [Maven][5] 之类的项目管理系统以及集成开发环境(Integrated Development Environment,简称IDE),可以在项目属性(比如 `pom.xml` 配置文件或者 Eclipse 和 NetBeans 的配置选项卡)中安装 Apache Commons CLI 库。 +如果你使用类似 [Maven][5] 之类的项目管理系统以及集成开发环境Integrated Development Environment(简称 IDE),可以在项目属性(比如 `pom.xml` 配置文件或者 Eclipse 和 NetBeans 的配置选项卡)中安装 Apache Commons CLI 库。 而如果你采用手动方式管理库,则可以从 Apache 网站下载 [该库的最新版本][6]。下载到本地的是几个捆绑在一起的 JAR 文件,你只需要其中的一个文件 `commons-cli-X.Y.jar`(其中 X 和 Y 代指最新版本号)。把这个 JAR 文件或手动或使用 IDE 添加到项目,就可以在代码中使用了。 ### 将库导入至 Java 代码 -在使用 **commons-cli** 库之前,必须首先导入它。对于本次选项解析的简单示例而言,可以先在 `Main.java` 文件中简单写入以下标准代码: +在使用 `commons-cli` 库之前,必须首先导入它。对于本次选项解析的简单示例而言,可以先在 `Main.java` 文件中简单写入以下标准代码: ``` package com.opensource.myoptparser; @@ -36,7 +38,7 @@ package com.opensource.myoptparser; import org.apache.commons.cli.*; public class Main { -    public static void main([String][7][] args) { +    public static void main(String[] args) {     // code      } } @@ -55,20 +57,20 @@ public class Main {     Options options = new Options(); ``` -接下来,通过列出短选项(即选项名简写)、长选项(即全写)、默认布尔值(译注:设置是否需要选项参数,指定为 false 时此选项不带参,即为布尔选项)和帮助信息来定义选项,然后设置该选项是否为必需项(译注:下方创建 `alpha` 对象的代码中未手动设置此项),最后将该选项添加到包含所有选项的 `options` 组对象中。在下面几行代码中,我只创建了一个选项,命名为 `alpha`: +接下来,通过列出短选项(即选项名简写)、长选项(即全写)、默认布尔值(LCTT 译注:设置是否需要选项参数,指定为 `false` 时此选项不带参,即为布尔选项)和帮助信息来定义选项,然后设置该选项是否为必需项(LCTT 译注:下方创建 `alpha` 对象的代码中未手动设置此项),最后将该选项添加到包含所有选项的 `options` 组对象中。在下面几行代码中,我只创建了一个选项,命名为 `alpha`: ```     //define options -    [Option][8] alpha = new [Option][8]("a", "alpha", false, "Activate feature alpha"); +    Option alpha = new Option("a", "alpha", false, "Activate feature alpha");     options.addOption(alpha); ``` ### 在 Java 中定义带参选项 -有时用户需要通过选项提供 **true** 或 **false** 以外的信息,比如给出配置文件、输入文件或诸如日期、颜色这样的设置项值。这种情况可以使用 `builder` 方法,根据选项名简写为其创建属性(例如,`-c` 是短选项,`--config` 是长选项)。完成定义后,再将定义好的选项添加到 `options` 组中: +有时用户需要通过选项提供 `true` 或 `false` 以外的信息,比如给出配置文件、输入文件或诸如日期、颜色这样的设置项值。这种情况可以使用 `builder` 方法,根据选项名简写为其创建属性(例如,`-c` 是短选项,`--config` 是长选项)。完成定义后,再将定义好的选项添加到 `options` 组中: ``` -    [Option][8] config = [Option][8].builder("c").longOpt("config") +    Option config = Option.builder("c").longOpt("config")         .argName("config")         .hasArg()         .required(true) @@ -76,11 +78,11 @@ public class Main {     options.addOption(config); ``` -`builder`函数可以用来设置短选项、长选项、是否为必需项(本段代码中必需项设置为 **true**,也就意味着用户启动程序时必须提供此选项,否则应用程序无法运行)、帮助信息等。 +`builder` 函数可以用来设置短选项、长选项、是否为必需项(本段代码中必需项设置为 `true`,也就意味着用户启动程序时必须提供此选项,否则应用程序无法运行)、帮助信息等。 ### 使用 Java 解析选项 -定义并添加所有可能用到的选项后,需要对用户提供的参数进行迭代处理,检测是否有参数同预设的有效短选项列表中的内容相匹配。为此要创建 **CommandLine** 命令行本身的一个实例,其中包含用户提供的所有参数(包含有效选项和无效选项)。为了处理这些参数,还要创建一个 **CommandLineParser** 对象,我在代码中将其命名为 `parser`。最后,还可以创建一个 **HelpFormatter** 对象(我将其命名为 `helper`),当参数中缺少某些必需项或者用户使用 `--help` 或 `-h` 选项时,此对象可以自动向用户提供一些有用的信息。 +定义并添加所有可能用到的选项后,需要对用户提供的参数进行迭代处理,检测是否有参数同预设的有效短选项列表中的内容相匹配。为此要创建命令行 `CommandLine` 本身的一个实例,其中包含用户提供的所有参数(包含有效选项和无效选项)。为了处理这些参数,还要创建一个 `CommandLineParser` 对象,我在代码中将其命名为 `parser`。最后,还可以创建一个 `HelpFormatter` 对象(我将其命名为 `helper`),当参数中缺少某些必需项或者用户使用 `--help` 或 `-h` 选项时,此对象可以自动向用户提供一些有用的信息。 ```     // define parser @@ -93,23 +95,23 @@ public class Main { ``` try { -    cmd = parser.parse(options, args); -    if(cmd.hasOption("a")) { -    [System][9].out.println("Alpha activated"); -    } + cmd = parser.parse(options, args); + if(cmd.hasOption("a")) { + System.out.println("Alpha activated"); + } -    if (cmd.hasOption("c")) { -    [String][7] opt_config = cmd.getOptionValue("config"); -    [System][9].out.println("Config set to " + opt_config); -    } -} catch ([ParseException][10] e) { -    [System][9].out.println(e.getMessage()); -    helper.printHelp("Usage:", options); -    [System][9].exit(0); + if (cmd.hasOption("c")) { + String opt_config = cmd.getOptionValue("config"); + System.out.println("Config set to " + opt_config); + } +} catch (ParseException e) { + System.out.println(e.getMessage()); + helper.printHelp("Usage:", options); + System.exit(0); } ``` -解析过程有可能会产生错误,因为有时可能缺少某些必需项如本例中的 `-c` 或 `--config` 选项。这时程序会打印一条帮助信息,并立即结束运行。考虑到此错误(Java 术语中称为 _exception_,异常),在 main 方法的开头要添加语句声明可能的异常: +解析过程有可能会产生错误,因为有时可能缺少某些必需项如本例中的 `-c` 或 `--config` 选项。这时程序会打印一条帮助信息,并立即结束运行。考虑到此错误(Java 术语中称为异常),在 `main` 方法的开头要添加语句声明可能的异常: ``` @@ -146,53 +148,52 @@ Config set to foo 以下是完整的演示代码,供读者参考: - ``` package com.opensource.myapp; import org.apache.commons.cli.*; public class Main { -     -    /** -     * @param args the command line arguments -     * @throws org.apache.commons.cli.ParseException -     */  -    public static void main([String][7][] args) throws [ParseException][10] { -        // define options -        Options options = new Options(); -         -        [Option][8] alpha = new [Option][8]("a", "alpha", false, "Activate feature alpha"); -        options.addOption(alpha); -         -        [Option][8] config = [Option][8].builder("c").longOpt("config") -                .argName("config") -                .hasArg() -                .required(true) -                .desc("Set config file").build(); -        options.addOption(config); -      -        // define parser -        CommandLine cmd; -        CommandLineParser parser = new BasicParser(); -        HelpFormatter helper = new HelpFormatter(); + + /** + * @param args the command line arguments + * @throws org.apache.commons.cli.ParseException + */ + public static void main(String[] args) throws ParseException { + // define options + Options options = new Options(); + + Option alpha = new Option("a", "alpha", false, "Activate feature alpha"); + options.addOption(alpha); + + Option config = Option.builder("c").longOpt("config") + .argName("config") + .hasArg() + .required(true) + .desc("Set config file").build(); + options.addOption(config); + + // define parser + CommandLine cmd; + CommandLineParser parser = new BasicParser(); + HelpFormatter helper = new HelpFormatter(); -        try { -            cmd = parser.parse(options, args); -            if(cmd.hasOption("a")) { -                [System][9].out.println("Alpha activated"); -            } -           -            if (cmd.hasOption("c")) { -                [String][7] opt_config = cmd.getOptionValue("config"); -                [System][9].out.println("Config set to " + opt_config); -            } -        } catch ([ParseException][10] e) { -            [System][9].out.println(e.getMessage()); -            helper.printHelp("Usage:", options); -            [System][9].exit(0); -        } -    } + try { + cmd = parser.parse(options, args); + if(cmd.hasOption("a")) { + System.out.println("Alpha activated"); + } + + if (cmd.hasOption("c")) { + String opt_config = cmd.getOptionValue("config"); + System.out.println("Config set to " + opt_config); + } + } catch (ParseException e) { + System.out.println(e.getMessage()); + helper.printHelp("Usage:", options); + System.exit(0); + } + } } ``` @@ -207,7 +208,7 @@ via: https://opensource.com/article/21/8/java-commons-cli 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9606ad5c974cd8b9c2655c17b2f540fb280b69cf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 12:00:42 +0800 Subject: [PATCH 104/290] PUB @unigeorge https://linux.cn/article-13699-1.html --- ...20210813 Parse command options in Java with commons-cli.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210813 Parse command options in Java with commons-cli.md (99%) diff --git a/translated/tech/20210813 Parse command options in Java with commons-cli.md b/published/20210813 Parse command options in Java with commons-cli.md similarity index 99% rename from translated/tech/20210813 Parse command options in Java with commons-cli.md rename to published/20210813 Parse command options in Java with commons-cli.md index bc0ce01c0c..d0923f6214 100644 --- a/translated/tech/20210813 Parse command options in Java with commons-cli.md +++ b/published/20210813 Parse command options in Java with commons-cli.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13699-1.html" 使用 commons-cli 解析 Java 中的命令行选项 ====== From 99206150b0c5577d69d5297a6d578e62eeec7e51 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Thu, 19 Aug 2021 16:27:41 +0800 Subject: [PATCH 105/290] translated --- ...0210817 4 alternatives to cron in Linux.md | 72 ------------------- ...0210817 4 alternatives to cron in Linux.md | 71 ++++++++++++++++++ 2 files changed, 71 insertions(+), 72 deletions(-) delete mode 100644 sources/tech/20210817 4 alternatives to cron in Linux.md create mode 100644 translated/tech/20210817 4 alternatives to cron in Linux.md diff --git a/sources/tech/20210817 4 alternatives to cron in Linux.md b/sources/tech/20210817 4 alternatives to cron in Linux.md deleted file mode 100644 index d82cfd115d..0000000000 --- a/sources/tech/20210817 4 alternatives to cron in Linux.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: subject: "4 alternatives to cron in Linux" -[#]: via: "https://opensource.com/article/21/7/alternatives-cron-linux" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -4 alternatives to cron in Linux -====== -There are a few other open source projects out there that can be used -either in conjunction with cron or instead of cron. -![Alarm clocks with different time][1] - -The [Linux `cron` system][2] is a time-tested and proven technology. However, it's not always the right tool for system automation. There are a few other open source projects out there that can be used either in conjunction with `cron` or instead of `cron`. - -### Linux at command - -`Cron` is intended for long-term repetition. You schedule a job, and it runs at a regular interval from now until the computer is decommissioned. Sometimes you just want to schedule a one-off command to run at a time you happen not to be at your computer. For that, you can use the `at` command. - -The syntax of `at` is far simpler and more flexible than the `cron` syntax, and it has both an interactive and non-interactive method for scheduling (so you could use `at` to create an `at` job if you really wanted to.) - - -``` -`$ echo "rsync -av /home/tux/ me@myserver:/home/tux/" | at 1:30 AM` -``` - -It feels natural, it's easy to use, and you don't have to clean up old jobs because they're entirely forgotten once they've been run. - -Read more about the [at command][3] to get started. - -### Systemd - -In addition to managing processes on your computer, `systemd` can also help you schedule them. Like traditional `cron` jobs, `systemd` timers can trigger events, such as shell scripts and commands, at specified time intervals. This can be once a day on a specific day of the month (and then, perhaps only if it's a Monday, for example), or every 15 minutes during business hours from 09:00 to 17:00. - -Timers can also do some things that `cron` jobs can't. - -For example, a timer can trigger a script or program to run a specific amount of time _after_ an event, such as boot, startup, completion of a previous task, or even the prior completion of the service unit called by the timer itself! - -If your system runs `systemd`, then you're technically using `systemd` timers already. Default timers perform menial tasks like rotating log files, updating the mlocate database, manage the DNF database, and so on. Creating your own is easy, as demonstrated by David Both in his article [Use systemd timers instead of cronjobs][4]. - -### Anacron - -`Cron` specializes in running a command at a specific time. This works well for a server that's never hibernating or powered down. Still, it's pretty common for laptops and desktop workstations to either intentionally or absent-mindedly turn the computer off from time to time. When the computer's not on, `cron` doesn't run, so important jobs (such as backing up data) get skipped. - -The `anacron` system is designed to ensure that jobs are run periodically rather than on a schedule. This means you can leave a computer off for several days and still count on `anacron` to run essential tasks when you boot it up again. `Anacron` works in tandem with `cron`, so it's not strictly an alternative to it, but it's a meaningful alternative way of scheduling tasks. Many a sysadmin has configured a `cron` job to backup data late at night on a remote worker's computer, only to discover that the job's only been run once in the past six months. `Anacron` ensures that important jobs happen _sometime_ when they can rather than _never_ when they were scheduled. - -Read more about [using anacron for a better crontab][5]. - -### Automation - -Computers and technology are meant to make lives better and work easier. Linux provides its users with lots of helpful features to ensure important operating system tasks get done. Take a look at what's available, and start using these features for your own tasks. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/alternatives-cron-linux - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time) -[2]: https://opensource.com/article/21/7/cron-linux -[3]: https://opensource.com/article/21/7/intro-command -[4]: https://opensource.com/article/20/7/systemd-timers -[5]: https://opensource.com/article/21/2/linux-automation diff --git a/translated/tech/20210817 4 alternatives to cron in Linux.md b/translated/tech/20210817 4 alternatives to cron in Linux.md new file mode 100644 index 0000000000..93aa34a533 --- /dev/null +++ b/translated/tech/20210817 4 alternatives to cron in Linux.md @@ -0,0 +1,71 @@ +[#]: subject: "4 alternatives to cron in Linux" +[#]: via: "https://opensource.com/article/21/7/alternatives-cron-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux 中 cron 命令的 4 种替代方案 +====== + +在 Linux 系统中有一些其他开源项目可以结合或者替代 cron 命令使用。 +![Alarm clocks with different time][1] + +[Linux `cron` 系统][2] 是一项经过时间检验的成熟技术,然而在任何情况下它都是最合适的系统自动化工具吗?答案是否定的。有一些开源项目就可以用来与 `cron` 结合或者直接代替 `cron` 使用。 + +### at 命令 + +`cron` 适用于长期重复任务。如果你设置了一个工作任务,它会从现在开始定期运行,直到计算机报废为止。但有些情况下你可能只想设置一个一次性命令,以备不在计算机旁时该命令可以自动运行。这时你可以选择使用 `at` 命令。 + +`at` 的语法比 `cron` 语法简单和灵活得多,并且兼具交互式和非交互式调度方法。(只要你想,你甚至可以使用 `at` 作业创建一个 `at` 作业。) + +``` +$ echo "rsync -av /home/tux/ me@myserver:/home/tux/" | at 1:30 AM +``` + +该命令语法自然且易用,并且不需要用户清理旧作业,因为它们一旦运行后就完全被计算机遗忘了。 + +阅读有关 [at 命令][3] 的更多信息并开始使用吧。 + +### systemd 命令 + +除了管理计算机上的进程外,`systemd` 还可以帮你调度这些进程。与传统的 `cron` 作业一样,`systemd` 计时器可以在指定的时间间隔触发事件,例如 shell 脚本和命令。时间间隔可以是每月特定日期的一天一次(例如在星期一的时候触发),或者在 09:00 到 17:00 的工作时间内每 15 分钟一次。 + +此外 `systemd` 里的计时器还可以做一些 `cron` 作业不能做的事情。 + +例如,计时器可以在一个事件 _之后_ 触发脚本或程序来运行特定时长,这个事件可以是开机,可以是前置任务的完成,甚至可以是计时器本身调用的服务单元的完成! + +如果你的系统运行着 `systemd` 服务,那么你的机器就已经在技术层面上使用 `systemd` 计时器了。默认计时器会执行一些琐碎的任务,例如滚动日志文件、更新 mlocate 数据库、管理 DNF 数据库等。创建自己的计时器很容易,具体可以参阅 David Both 的文章 [使用 systemd 计时器来代替 cron][4]。 + +### anacron 命令 + +`cron` 专门用于在特定时间运行命令,这适用于从不休眠或断电的服务器。然而对笔记本电脑和台式工作站而言,时常有意或无意地关机是很常见的。当计算机处于关机状态时,`cron` 不会运行,因此设定在这段时间内的一些重要工作(例如备份数据)也就会跳过执行。 + +`anacron` 系统旨在确保作业定期运行,而不是按计划时间点运行。这就意味着你可以将计算机关机几天,再次启动时仍然靠 `anacron` 来运行基本任务。`anacron` 与 `cron` 协同工作,因此严格来说前者不是后者的替代品,而是一种调度任务的有效可选方案。许多系统管理员配置了一个 `cron` 作业来在深夜备份远程工作者计算机上的数据,结果却发现该作业在过去六个月中只运行过一次。`anacron` 确保重要的工作在 _可执行的时候_ 发生,而不是必须在安排好的 _特定时间点_ 发生。 + +点击参阅关于 [使用 anacron 获得更好的 crontab 效果][5] 的更多内容。 + +### 自动化 + +计算机和技术旨在让人们的生活更美好,工作更轻松。Linux 为用户提供了许多有用的功能,以确保完成重要的操作系统任务。查看这些可用的功能,然后试着将这些功能用于你自己的工作任务吧。(LCTT译注:作者本段有些语焉不详,读者可参阅譬如 [Ansible 自动化工具安装、配置和快速入门指南](https://linux.cn/article-13142-1.html) 等关于 Linux 自动化的文章) + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/alternatives-cron-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[unigeorge](https://github.com/unigeorge) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/clocks_time.png?itok=_ID09GDk (Alarm clocks with different time) +[2]: https://opensource.com/article/21/7/cron-linux +[3]: https://opensource.com/article/21/7/intro-command +[4]: https://opensource.com/article/20/7/systemd-timers +[5]: https://opensource.com/article/21/2/linux-automation From fa054a627593cd2df68b9c453e99402d4ae63751 Mon Sep 17 00:00:00 2001 From: YungeGuo Date: Thu, 19 Aug 2021 19:34:01 +0800 Subject: [PATCH 106/290] translated --- ...derstanding systemd at startup on Linux.md | 445 ------------------ ...derstanding systemd at startup on Linux.md | 421 +++++++++++++++++ 2 files changed, 421 insertions(+), 445 deletions(-) delete mode 100644 sources/tech/20200504 Understanding systemd at startup on Linux.md create mode 100644 translated/tech/20200504 Understanding systemd at startup on Linux.md diff --git a/sources/tech/20200504 Understanding systemd at startup on Linux.md b/sources/tech/20200504 Understanding systemd at startup on Linux.md deleted file mode 100644 index 7a2c6ec9ad..0000000000 --- a/sources/tech/20200504 Understanding systemd at startup on Linux.md +++ /dev/null @@ -1,445 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (YungeG) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Understanding systemd at startup on Linux) -[#]: via: (https://opensource.com/article/20/5/systemd-startup) -[#]: author: (David Both https://opensource.com/users/dboth) - -Understanding systemd at startup on Linux -====== -systemd's startup provides important clues to help you solve problems -when they occur. -![People at the start line of a race][1] - -In [_Learning to love systemd_][2], the first article in this series, I looked at systemd's functions and architecture and the controversy around its role as a replacement for the old SystemV init program and startup scripts. In this second article, I'll start exploring the files and tools that manage the Linux startup sequence. I'll explain the systemd startup sequence, how to change the default startup target (runlevel in SystemV terms), and how to manually switch to a different target without going through a reboot. - -I'll also look at two important systemd tools. The first is the **systemctl** command, which is the primary means of interacting with and sending commands to systemd. The second is **journalctl**, which provides access to the systemd journals that contain huge amounts of system history data such as kernel and service messages (both informational and error messages). - -Be sure to use a non-production system for testing and experimentation in this and future articles. Your test system needs to have a GUI desktop (such as Xfce, LXDE, Gnome, KDE, or another) installed. - -I wrote in my previous article that I planned to look at creating a systemd unit and adding it to the startup sequence in this article. Because this article became longer than I anticipated, I will hold that for the next article in this series. - -### Exploring Linux startup with systemd - -Before you can observe the startup sequence, you need to do a couple of things to make the boot and startup sequences open and visible. Normally, most distributions use a startup animation or splash screen to hide the detailed messages that would otherwise be displayed during a Linux host's startup and shutdown. This is called the Plymouth boot screen on Red Hat-based distros. Those hidden messages can provide a great deal of information about startup and shutdown to a sysadmin looking for information to troubleshoot a bug or to just learn about the startup sequence. You can change this using the GRUB (Grand Unified Boot Loader) configuration. - -The main GRUB configuration file is **/boot/grub2/grub.cfg**, but, because this file can be overwritten when the kernel version is updated, you do not want to change it. Instead, modify the **/etc/default/grub** file, which is used to modify the default settings of **grub.cfg**. - -Start by looking at the current, unmodified version of the **/etc/default/grub** file: - - -``` -[root@testvm1 ~]# cd /etc/default ; cat grub -GRUB_TIMEOUT=5 -GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" -GRUB_DEFAULT=saved -GRUB_DISABLE_SUBMENU=true -GRUB_TERMINAL_OUTPUT="console" -GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora_testvm1-swap rd.lvm. -lv=fedora_testvm1/root rd.lvm.lv=fedora_testvm1/swap rd.lvm.lv=fedora_ -testvm1/usr rhgb quiet" -GRUB_DISABLE_RECOVERY="true" -[root@testvm1 default]# -``` - -Chapter 6 of the [GRUB documentation][3] contains a list of all the possible entries in the **/etc/default/grub** file, but I focus on the following: - - * I change **GRUB_TIMEOUT**, the number of seconds for the GRUB menu countdown, from five to 10 to give a bit more time to respond to the GRUB menu before the countdown hits zero. - * I delete the last two parameters on **GRUB_CMDLINE_LINUX**, which lists the command-line parameters that are passed to the kernel at boot time. One of these parameters, **rhgb** stands for Red Hat Graphical Boot, and it displays the little Fedora icon animation during the kernel initialization instead of showing boot-time messages. The other, the **quiet** parameter, prevents displaying the startup messages that document the progress of the startup and any errors that occur. I delete both **rhgb** and **quiet** because sysadmins need to see these messages. If something goes wrong during boot, the messages displayed on the screen can point to the cause of the problem. - - - -After you make these changes, your GRUB file will look like: - - -``` -[root@testvm1 default]# cat grub -GRUB_TIMEOUT=10 -GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" -GRUB_DEFAULT=saved -GRUB_DISABLE_SUBMENU=true -GRUB_TERMINAL_OUTPUT="console" -GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora_testvm1-swap rd.lvm. -lv=fedora_testvm1/root rd.lvm.lv=fedora_testvm1/swap rd.lvm.lv=fedora_ -testvm1/usr" -GRUB_DISABLE_RECOVERY="false" -[root@testvm1 default]# -``` - -The **grub2-mkconfig** program generates the **grub.cfg** configuration file using the contents of the **/etc/default/grub** file to modify some of the default GRUB settings. The **grub2-mkconfig** program sends its output to **STDOUT**. It has a **-o** option that allows you to specify a file to send the datastream to, but it is just as easy to use redirection. Run the following command to update the **/boot/grub2/grub.cfg** configuration file: - - -``` -[root@testvm1 grub2]# grub2-mkconfig > /boot/grub2/grub.cfg -Generating grub configuration file ... -Found linux image: /boot/vmlinuz-4.18.9-200.fc28.x86_64 -Found initrd image: /boot/initramfs-4.18.9-200.fc28.x86_64.img -Found linux image: /boot/vmlinuz-4.17.14-202.fc28.x86_64 -Found initrd image: /boot/initramfs-4.17.14-202.fc28.x86_64.img -Found linux image: /boot/vmlinuz-4.16.3-301.fc28.x86_64 -Found initrd image: /boot/initramfs-4.16.3-301.fc28.x86_64.img -Found linux image: /boot/vmlinuz-0-rescue-7f12524278bd40e9b10a085bc82dc504 -Found initrd image: /boot/initramfs-0-rescue-7f12524278bd40e9b10a085bc82dc504.img -done -[root@testvm1 grub2]# -``` - -Reboot your test system to view the startup messages that would otherwise be hidden behind the Plymouth boot animation. But what if you need to view the startup messages and have not disabled the Plymouth boot animation? Or you have, but the messages stream by too fast to read? (Which they do.) - -There are a couple of options, and both involve log files and systemd journals—which are your friends. You can use the **less** command to view the contents of the **/var/log/messages** file. This file contains boot and startup messages as well as messages generated by the operating system during normal operation. You can also use the **journalctl** command without any options to view the systemd journal, which contains essentially the same information: - - -``` -[root@testvm1 grub2]# journalctl -\-- Logs begin at Sat 2020-01-11 21:48:08 EST, end at Fri 2020-04-03 08:54:30 EDT. -- -Jan 11 21:48:08 f31vm.both.org kernel: Linux version 5.3.7-301.fc31.x86_64 ([mockbuild@bkernel03.phx2.fedoraproject.org][4]) (gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)) #1 SMP Mon Oct > -Jan 11 21:48:08 f31vm.both.org kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.3.7-301.fc31.x86_64 root=/dev/mapper/VG01-root ro resume=/dev/mapper/VG01-swap rd.lvm.lv=VG01/root rd> -Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' -Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' -Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' -Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256 -Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format. -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-provided physical RAM map: -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved -Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000100000000-0x000000041fffffff] usable -Jan 11 21:48:08 f31vm.both.org kernel: NX (Execute Disable) protection: active -Jan 11 21:48:08 f31vm.both.org kernel: SMBIOS 2.5 present. -Jan 11 21:48:08 f31vm.both.org kernel: DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 -Jan 11 21:48:08 f31vm.both.org kernel: Hypervisor detected: KVM -Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 -Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: cpu 0, msr 30ae01001, primary cpu clock -Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: using sched offset of 8250734066 cycles -Jan 11 21:48:08 f31vm.both.org kernel: clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns -Jan 11 21:48:08 f31vm.both.org kernel: tsc: Detected 2807.992 MHz processor -Jan 11 21:48:08 f31vm.both.org kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved -Jan 11 21:48:08 f31vm.both.org kernel: e820: remove [mem 0x000a0000-0x000fffff] usable -<snip> -``` - -I truncated this datastream because it can be hundreds of thousands or even millions of lines long. (The journal listing on my primary workstation is 1,188,482 lines long.) Be sure to try this on your test system. If it has been running for some time—even if it has been rebooted many times—huge amounts of data will be displayed. Explore this journal data because it contains a lot of information that can be very useful when doing problem determination. Knowing what this data looks like for a normal boot and startup can help you locate problems when they occur. - -I will discuss systemd journals, the **journalctl** command, and how to sort through all of that data to find what you want in more detail in a future article in this series. - -After GRUB loads the kernel into memory, it must first extract itself from the compressed version of the file before it can perform any useful work. After the kernel has extracted itself and started running, it loads systemd and turns control over to it. - -This is the end of the boot process. At this point, the Linux kernel and systemd are running but unable to perform any productive tasks for the end user because nothing else is running, there's no shell to provide a command line, no background processes to manage the network or other communication links, and nothing that enables the computer to perform any productive function. - -Systemd can now load the functional units required to bring the system up to a selected target run state. - -### Targets - -A systemd target represents a Linux system's current or desired run state. Much like SystemV start scripts, targets define the services that must be present for the system to run and be active in that state. Figure 1 shows the possible run-state targets of a Linux system using systemd. As seen in the first article of this series and in the systemd bootup man page (man bootup), there are other intermediate targets that are required to enable various necessary services. These can include **swap.target**, **timers.target**, **local-fs.target**, and more. Some targets (like **basic.target**) are used as checkpoints to ensure that all the required services are up and running before moving on to the next-higher level target. - -Unless otherwise changed at boot time in the GRUB menu, systemd always starts the **default.target**. The **default.target** file is a symbolic link to the true target file. For a desktop workstation, this is typically going to be the **graphical.target**, which is equivalent to runlevel 5 in SystemV. For a server, the default is more likely to be the **multi-user.target**, which is like runlevel 3 in SystemV. The **emergency.target** file is similar to single-user mode. Targets and services are systemd units. - -The following table, which I included in the previous article in this series, compares the systemd targets with the old SystemV startup runlevels. The systemd target aliases are provided by systemd for backward compatibility. The target aliases allow scripts—and sysadmins—to use SystemV commands like **init 3** to change runlevels. Of course, the SystemV commands are forwarded to systemd for interpretation and execution. - -**systemd targets** | **SystemV runlevel** | **target aliases** | **Description** ----|---|---|--- -default.target | | | This target is always aliased with a symbolic link to either **multi-user.target** or **graphical.target**. systemd always uses the **default.target** to start the system. The **default.target** should never be aliased to **halt.target**, **poweroff.target**, or **reboot.target**. -graphical.target | 5 | runlevel5.target | **Multi-user.target** with a GUI -| 4 | runlevel4.target | Unused. Runlevel 4 was identical to runlevel 3 in the SystemV world. This target could be created and customized to start local services without changing the default **multi-user.target**. -multi-user.target | 3 | runlevel3.target | All services running, but command-line interface (CLI) only -| 2 | runlevel2.target | Multi-user, without NFS, but all other non-GUI services running -rescue.target | 1 | runlevel1.target | A basic system, including mounting the filesystems with only the most basic services running and a rescue shell on the main console -emergency.target | S | | Single-user mode—no services are running; filesystems are not mounted. This is the most basic level of operation with only an emergency shell running on the main console for the user to interact with the system. -halt.target | | | Halts the system without powering it down -reboot.target | 6 | runlevel6.target | Reboot -poweroff.target | 0 | runlevel0.target | Halts the system and turns the power off - -Each target has a set of dependencies described in its configuration file. systemd starts the required dependencies, which are the services required to run the Linux host at a specific level of functionality. When all of the dependencies listed in the target configuration files are loaded and running, the system is running at that target level. If you want, you can review the systemd startup sequence and runtime targets in the first article in this series, [_Learning to love systemd_][2]. - -### Exploring the current target - -Many Linux distributions default to installing a GUI desktop interface so that the installed systems can be used as workstations. I always install from a Fedora Live boot USB drive with an Xfce or LXDE desktop. Even when I'm installing a server or other infrastructure type of host (such as the ones I use for routers and firewalls), I use one of these installations that installs a GUI desktop. - -I could install a server without a desktop (and that would be typical for data centers), but that does not meet my needs. It is not that I need the GUI desktop itself, but the LXDE installation includes many of the other tools I use that are not in a default server installation. This means less work for me after the initial installation. - -But just because I have a GUI desktop does not mean it makes sense to use it. I have a 16-port KVM that I can use to access the KVM interfaces of most of my Linux systems, but the vast majority of my interaction with them is via a remote SSH connection from my primary workstation. This way is more secure and uses fewer system resources to run **multi-user.target** compared to **graphical.target.** - -To begin, check the default target to verify that it is the **graphical.target**: - - -``` -[root@testvm1 ~]# systemctl get-default -graphical.target -[root@testvm1 ~]# -``` - -Now verify the currently running target. It should be the same as the default target. You can still use the old method, which displays the old SystemV runlevels. Note that the previous runlevel is on the left; it is **N** (which means None), indicating that the runlevel has not changed since the host was booted. The number 5 indicates the current target, as defined in the old SystemV terminology: - - -``` -[root@testvm1 ~]# runlevel -N 5 -[root@testvm1 ~]# -``` - -Note that the runlevel man page indicates that runlevels are obsolete and provides a conversion table. - -You can also use the systemd method. There is no one-line answer here, but it does provide the answer in systemd terms: - - -``` -[root@testvm1 ~]# systemctl list-units --type target -UNIT                   LOAD   ACTIVE SUB    DESCRIPTION                 -basic.target           loaded active active Basic System               -cryptsetup.target      loaded active active Local Encrypted Volumes     -getty.target           loaded active active Login Prompts               -graphical.target       loaded active active Graphical Interface         -local-fs-pre.target    loaded active active Local File Systems (Pre)   -local-fs.target        loaded active active Local File Systems         -multi-user.target      loaded active active Multi-User System           -network-online.target  loaded active active Network is Online           -network.target         loaded active active Network                     -nfs-client.target      loaded active active NFS client services         -nss-user-lookup.target loaded active active User and Group Name Lookups -paths.target           loaded active active Paths                       -remote-fs-pre.target   loaded active active Remote File Systems (Pre)   -remote-fs.target       loaded active active Remote File Systems         -rpc_pipefs.target      loaded active active rpc_pipefs.target           -slices.target          loaded active active Slices                     -sockets.target         loaded active active Sockets                     -sshd-keygen.target     loaded active active sshd-keygen.target         -swap.target            loaded active active Swap                       -sysinit.target         loaded active active System Initialization       -timers.target          loaded active active Timers                     - -LOAD   = Reflects whether the unit definition was properly loaded. -ACTIVE = The high-level unit activation state, i.e. generalization of SUB. -SUB    = The low-level unit activation state, values depend on unit type. - -21 loaded units listed. Pass --all to see loaded but inactive units, too. -To show all installed unit files use 'systemctl list-unit-files'. -``` - -This shows all of the currently loaded and active targets. You can also see the **graphical.target** and the **multi-user.target**. The **multi-user.target** is required before the **graphical.target** can be loaded. In this example, the **graphical.target** is active. - -### Switching to a different target - -Making the switch to the **multi-user.target** is easy: - - -``` -`[root@testvm1 ~]# systemctl isolate multi-user.target` -``` - -The display should now change from the GUI desktop or login screen to a virtual console. Log in and list the currently active systemd units to verify that **graphical.target** is no longer running: - - -``` -`[root@testvm1 ~]# systemctl list-units --type target` -``` - -Be sure to use the **runlevel** command to verify that it shows both previous and current "runlevels": - - -``` -[root@testvm1 ~]# runlevel -5 3 -``` - -### Changing the default target - -Now, change the default target to the **multi-user.target** so that it will always boot into the **multi-user.target** for a console command-line interface rather than a GUI desktop interface. As the root user on your test host, change to the directory where the systemd configuration is maintained and do a quick listing: - - -``` -[root@testvm1 ~]# cd /etc/systemd/system/ ; ll -drwxr-xr-x. 2 root root 4096 Apr 25  2018  basic.target.wants -<snip> -lrwxrwxrwx. 1 root root   36 Aug 13 16:23  default.target -> /lib/systemd/system/graphical.target -lrwxrwxrwx. 1 root root   39 Apr 25  2018  display-manager.service -> /usr/lib/systemd/system/lightdm.service -drwxr-xr-x. 2 root root 4096 Apr 25  2018  getty.target.wants -drwxr-xr-x. 2 root root 4096 Aug 18 10:16  graphical.target.wants -drwxr-xr-x. 2 root root 4096 Apr 25  2018  local-fs.target.wants -drwxr-xr-x. 2 root root 4096 Oct 30 16:54  multi-user.target.wants -<snip> -[root@testvm1 system]# -``` - -I shortened this listing to highlight a few important things that will help explain how systemd manages the boot process. You should be able to see the entire list of directories and links on your virtual machine. - -The **default.target** entry is a symbolic link (symlink, soft link) to the directory **/lib/systemd/system/graphical.target**. List that directory to see what else is there: - - -``` -`[root@testvm1 system]# ll /lib/systemd/system/ | less` -``` - -You should see files, directories, and more links in this listing, but look specifically for **multi-user.target** and **graphical.target**. Now display the contents of **default.target**, which is a link to **/lib/systemd/system/graphical.target**: - - -``` -[root@testvm1 system]# cat default.target -#  SPDX-License-Identifier: LGPL-2.1+ -# -#  This file is part of systemd. -# -#  systemd is free software; you can redistribute it and/or modify it -#  under the terms of the GNU Lesser General Public License as published by -#  the Free Software Foundation; either version 2.1 of the License, or -#  (at your option) any later version. - -[Unit] -Description=Graphical Interface -Documentation=man:systemd.special(7) -Requires=multi-user.target -Wants=display-manager.service -Conflicts=rescue.service rescue.target -After=multi-user.target rescue.service rescue.target display-manager.service -AllowIsolate=yes -[root@testvm1 system]# -``` - -This link to the **graphical.target** file describes all of the prerequisites and requirements that the graphical user interface requires. I will explore at least some of these options in the next article in this series. - -To enable the host to boot to multi-user mode, you need to delete the existing link and create a new one that points to the correct target. Make the [PWD][5] **/etc/systemd/system**, if it is not already: - - -``` -[root@testvm1 system]# rm -f default.target -[root@testvm1 system]# ln -s /lib/systemd/system/multi-user.target default.target -``` - -List the **default.target** link to verify that it links to the correct file: - - -``` -[root@testvm1 system]# ll default.target -lrwxrwxrwx 1 root root 37 Nov 28 16:08 default.target -> /lib/systemd/system/multi-user.target -[root@testvm1 system]# -``` - -If your link does not look exactly like this, delete it and try again. List the content of the **default.target** link: - - -``` -[root@testvm1 system]# cat default.target -#  SPDX-License-Identifier: LGPL-2.1+ -# -#  This file is part of systemd. -# -#  systemd is free software; you can redistribute it and/or modify it -#  under the terms of the GNU Lesser General Public License as published by -#  the Free Software Foundation; either version 2.1 of the License, or -#  (at your option) any later version. - -[Unit] -Description=Multi-User System -Documentation=man:systemd.special(7) -Requires=basic.target -Conflicts=rescue.service rescue.target -After=basic.target rescue.service rescue.target -AllowIsolate=yes -[root@testvm1 system]# -``` - -The **default.target**—which is really a link to the **multi-user.target** at this point—now has different requirements in the **[Unit]** section. It does not require the graphical display manager. - -Reboot. Your virtual machine should boot to the console login for virtual console 1, which is identified on the display as tty1. Now that you know how to change the default target, change it back to the **graphical.target** using a command designed for the purpose. - -First, check the current default target: - - -``` -[root@testvm1 ~]# systemctl get-default -multi-user.target -[root@testvm1 ~]# systemctl set-default graphical.target -Removed /etc/systemd/system/default.target. -Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/graphical.target. -[root@testvm1 ~]# -``` - -Enter the following command to go directly to the **graphical.target** and the display manager login page without having to reboot: - - -``` -`[root@testvm1 system]# systemctl isolate default.target` -``` - -I do not know why the term "isolate" was chosen for this sub-command by systemd's developers. My research indicates that it may refer to running the specified target but "isolating" and terminating all other targets that are not required to support the target. However, the effect is to switch targets from one run target to another—in this case, from the multi-user target to the graphical target. The command above is equivalent to the old init 5 command in SystemV start scripts and the init program. - -Log into the GUI desktop, and verify that it is working as it should. - -### Summing up - -This article explored the Linux systemd startup sequence and started to explore two important systemd tools, **systemctl** and **journalctl**. It also explained how to switch from one target to another and to change the default target. - -The next article in this series will create a new systemd unit and configure it to run during startup. It will also look at some of the configuration options that help determine where in the sequence a particular unit will start, for example, after networking is up and running. - -### Resources - -There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup. - - * The Fedora Project has a good, practical [guide][6] [to systemd][6]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd. - * The Fedora Project also has a good [cheat sheet][7] that cross-references the old SystemV commands to comparable systemd ones. - * For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][8]'s [description of systemd][9]. - * [Linux.com][10]'s "More systemd fun" offers more advanced systemd [information and tips][11]. - - - -There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers. - - * [Rethinking PID 1][12] - * [systemd for Administrators, Part I][13] - * [systemd for Administrators, Part II][14] - * [systemd for Administrators, Part III][15] - * [systemd for Administrators, Part IV][16] - * [systemd for Administrators, Part V][17] - * [systemd for Administrators, Part VI][18] - * [systemd for Administrators, Part VII][19] - * [systemd for Administrators, Part VIII][20] - * [systemd for Administrators, Part IX][21] - * [systemd for Administrators, Part X][22] - * [systemd for Administrators, Part XI][23] - - - -Alison Chiaken, a Linux kernel and systems programmer at Mentor Graphics, offers a preview of her... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/systemd-startup - -作者:[David Both][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/dboth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/start_line.jpg?itok=9reaaW6m (People at the start line of a race) -[2]: https://opensource.com/article/20/4/systemd -[3]: http://www.gnu.org/software/grub/manual/grub -[4]: mailto:mockbuild@bkernel03.phx2.fedoraproject.org -[5]: https://en.wikipedia.org/wiki/Pwd -[6]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html -[7]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet -[8]: http://Freedesktop.org -[9]: http://www.freedesktop.org/wiki/Software/systemd -[10]: http://Linux.com -[11]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ -[12]: http://0pointer.de/blog/projects/systemd.html -[13]: http://0pointer.de/blog/projects/systemd-for-admins-1.html -[14]: http://0pointer.de/blog/projects/systemd-for-admins-2.html -[15]: http://0pointer.de/blog/projects/systemd-for-admins-3.html -[16]: http://0pointer.de/blog/projects/systemd-for-admins-4.html -[17]: http://0pointer.de/blog/projects/three-levels-of-off.html -[18]: http://0pointer.de/blog/projects/changing-roots -[19]: http://0pointer.de/blog/projects/blame-game.html -[20]: http://0pointer.de/blog/projects/the-new-configuration-files.html -[21]: http://0pointer.de/blog/projects/on-etc-sysinit.html -[22]: http://0pointer.de/blog/projects/instances.html -[23]: http://0pointer.de/blog/projects/inetd.html diff --git a/translated/tech/20200504 Understanding systemd at startup on Linux.md b/translated/tech/20200504 Understanding systemd at startup on Linux.md new file mode 100644 index 0000000000..486874df37 --- /dev/null +++ b/translated/tech/20200504 Understanding systemd at startup on Linux.md @@ -0,0 +1,421 @@ +[#]: collector: (lujun9972) +[#]: translator: (YungeG) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Understanding systemd at startup on Linux) +[#]: via: (https://opensource.com/article/20/5/systemd-startup) +[#]: author: (David Both https://opensource.com/users/dboth) + +在 Linux 启动时理解 systemd +====== + +systemd 启动过程提供的重要线索可以在问题出现时助你一臂之力。 +![People at the start line of a race][1] + +在本系列的第一篇文章[_学着爱上 systemd_][2],我考察了 systemd 的功能和架构,以及围绕 systemd 作为古老的 SystemV 初始化程序和启动脚本的替代品的争论。在这第二篇文章中,我将开始探索管理 Linux 启动序列的文件和工具。我会解释 systemd 启动序列、如何更改默认的启动目标(SystemV 术语中的运行级别)、以及在不重启的情况下如何手动切换到不同的目标。 + +我还将考察两个重要的 systemd 工具。第一个 **systemctl** 命令是和 systemd 交互、向其发送命令的基本方式。第二个是 **journalctl**,用于访问 systemd 日志,后者包含了大量系统历史数据,比如内核和服务的消息(包括指示性信息和错误信息)。 + +务必使用一个非生产系统进行本文和后续文章中的测试和实验。你的测试系统需要安装一个 GUI 桌面(比如 Xfce,LXDE,Gnome,KD E或其他)。 + +上一篇文章中我写道计划在这篇文章创建一个 systemd 单元并添加到启动序列。由于这篇文章比我预期中要长,这些内容将留到本系列的下一篇文章。 + +### 使用 systemd 探索 Linux 的启动 + +在观察启动序列之前,你需要做几件事情得使引导和启动序列开放可见。正常情况下,大多数发行版使用一个开机动画或者启动画面隐藏 Linux 启动和关机过程中的显示细节,在基于 Red Hat 的发行版中称作 Plymouth 引导画面。这些隐藏的消息能够向寻找信息以排除程序故障、或者只是学习启动序列的系统管理员提供大量有关系统启动和关闭的信息。你可以通过 GRUB(Grand Unified Boot Loader)配置改变这个设置。 + +主要的 GRUB 配置文件是 **/boot/grub2/grub.cfg** ,但是这个文件在更新内核版本时会被覆盖,你不会想修改它的。相反,修改用于改变 **grub.cfg** 默认设置的 **/etc/default/grub** 文件。 + +从 **/etc/default/grub** 文件当前还未修改的版本看起: + +``` +[root@testvm1 ~]# cd /etc/default ; cat grub +GRUB_TIMEOUT=5 +GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" +GRUB_DEFAULT=saved +GRUB_DISABLE_SUBMENU=true +GRUB_TERMINAL_OUTPUT="console" +GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora_testvm1-swap rd.lvm. +lv=fedora_testvm1/root rd.lvm.lv=fedora_testvm1/swap rd.lvm.lv=fedora_ +testvm1/usr rhgb quiet" +GRUB_DISABLE_RECOVERY="true" +[root@testvm1 default]# +``` + +[GRUB 文档][3]的第 6 章列出了 **/etc/default/grub** 文件的所有可用项,我只关注下面的部分: + + * 我将 GRUB 菜单倒计时的秒数 **GRUB_TIMEOUT**,从 5 改成 10,以便在倒计时达到 0 之前有更多的时间响应 GRUB 菜单。 + * **GRUB_CMDLINE_LINUX** 列出了启动阶段传递给内核的命令行参数,我删除了其中的最后两个参数。其中的一个参数 **rhgb** 代表 Red Hat Graphical Boot,在内核初始化阶段显示一个小小的 Fedora 图标动画,而不是显示启动阶段的信息。另一个参数 **quiet**,屏蔽记录启动进度和发生错误的消息。系统管理员需要这些信息,因此我删除了 **rhgb** 和 **quiet**。如果启动阶段发生了错误,屏幕上显示的信息可以指向故障的原因。 + +更改之后,你的 GRUB 文件将会像下面一样: + +``` +[root@testvm1 default]# cat grub +GRUB_TIMEOUT=10 +GRUB_DISTRIBUTOR="$(sed 's, release .*$,,g' /etc/system-release)" +GRUB_DEFAULT=saved +GRUB_DISABLE_SUBMENU=true +GRUB_TERMINAL_OUTPUT="console" +GRUB_CMDLINE_LINUX="resume=/dev/mapper/fedora_testvm1-swap rd.lvm. +lv=fedora_testvm1/root rd.lvm.lv=fedora_testvm1/swap rd.lvm.lv=fedora_ +testvm1/usr" +GRUB_DISABLE_RECOVERY="false" +[root@testvm1 default]# +``` + +**grub2-mkconfig** 程序使用 **/etc/default/grub** 文件的内容生成 **grub.cfg** 配置文件,从而改变一些默认的 GRUB 设置。**grub2-mkconfig** 输出到 **STDOUT**,你可以使用程序的 **-o** 参数指明数据流输出的文件,不过使用重定向也同样简单。执行下面的命令更新 **/boot/grub2/grub.cfg** 配置文件: + +``` +[root@testvm1 grub2]# grub2-mkconfig > /boot/grub2/grub.cfg +Generating grub configuration file ... +Found linux image: /boot/vmlinuz-4.18.9-200.fc28.x86_64 +Found initrd image: /boot/initramfs-4.18.9-200.fc28.x86_64.img +Found linux image: /boot/vmlinuz-4.17.14-202.fc28.x86_64 +Found initrd image: /boot/initramfs-4.17.14-202.fc28.x86_64.img +Found linux image: /boot/vmlinuz-4.16.3-301.fc28.x86_64 +Found initrd image: /boot/initramfs-4.16.3-301.fc28.x86_64.img +Found linux image: /boot/vmlinuz-0-rescue-7f12524278bd40e9b10a085bc82dc504 +Found initrd image: /boot/initramfs-0-rescue-7f12524278bd40e9b10a085bc82dc504.img +done +[root@testvm1 grub2]# +``` + +重新启动你的测试系统查看本来会隐藏在 Plymouth 开机动画之下的启动信息。但是如果你没有关闭开机动画,又需要查看启动信息的话又该如何操作?或者你关闭了开机动画,而消息流过的速度太快,无法阅读怎么办?(实际情况如此。) + +有两个解决方案,都涉及到日志文件和 systemd 日志——两个都是你的好伙伴。你可以使用 **less** 命令查看 **/var/log/messages** 文件的内容。这个文件包含引导和启动信息,以及操作系统执行正常操作时生成的信息。你也可以使用不加任何参数的 **journalctl** 命令查看 systemd 日志,包含基本相同的信息: + +``` +[root@testvm1 grub2]# journalctl +\-- Logs begin at Sat 2020-01-11 21:48:08 EST, end at Fri 2020-04-03 08:54:30 EDT. -- +Jan 11 21:48:08 f31vm.both.org kernel: Linux version 5.3.7-301.fc31.x86_64 ([mockbuild@bkernel03.phx2.fedoraproject.org][4]) (gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)) #1 SMP Mon Oct > +Jan 11 21:48:08 f31vm.both.org kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.3.7-301.fc31.x86_64 root=/dev/mapper/VG01-root ro resume=/dev/mapper/VG01-swap rd.lvm.lv=VG01/root rd> +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256 +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format. +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-provided physical RAM map: +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x000000000009fc00-0x000000000009ffff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000000f0000-0x00000000000fffff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000000100000-0x00000000dffeffff] usable +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000dfff0000-0x00000000dfffffff] ACPI data +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fec00000-0x00000000fec00fff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fee00000-0x00000000fee00fff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x00000000fffc0000-0x00000000ffffffff] reserved +Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000100000000-0x000000041fffffff] usable +Jan 11 21:48:08 f31vm.both.org kernel: NX (Execute Disable) protection: active +Jan 11 21:48:08 f31vm.both.org kernel: SMBIOS 2.5 present. +Jan 11 21:48:08 f31vm.both.org kernel: DMI: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 +Jan 11 21:48:08 f31vm.both.org kernel: Hypervisor detected: KVM +Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: Using msrs 4b564d01 and 4b564d00 +Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: cpu 0, msr 30ae01001, primary cpu clock +Jan 11 21:48:08 f31vm.both.org kernel: kvm-clock: using sched offset of 8250734066 cycles +Jan 11 21:48:08 f31vm.both.org kernel: clocksource: kvm-clock: mask: 0xffffffffffffffff max_cycles: 0x1cd42e4dffb, max_idle_ns: 881590591483 ns +Jan 11 21:48:08 f31vm.both.org kernel: tsc: Detected 2807.992 MHz processor +Jan 11 21:48:08 f31vm.both.org kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved +Jan 11 21:48:08 f31vm.both.org kernel: e820: remove [mem 0x000a0000-0x000fffff] usable +``` + +由于数据流可能长达几百甚至几百万行,我在这里截断了它。(我的主要工作站上列出的日志长度是 1,188,482 行。)一定要在你的测试系统尝试这个命令。如果系统已经运行了一段时间——即使重启过很多次——还是会显示大量的数据。进行问题诊断时查看这个日志数据,因为其中包含了很多可能十分有用的信息。了解这个数据文件在正常的引导和启动过程中的模样,可以帮助你在问题出现时定位问题。 + +我将在本系列之后的文章讨论 systemd 日志、**journalctl** 命令、以及如何整列输出的日志数据来寻找更详细的信息。 + +内核被 GRUB 加载到内存后,必须先将自己从压缩后的文件中解压出来,才能执行任何有意义的操作。解压自己后,内核开始运行,加载 systemd 并转交控制权。 + +引导阶段到此结束,此时 Linux 内核和 systemd 正在运行,但是无法为用户执行任何生产性任务,因为其他的程序都没有执行,没有命令行解释器提供命令行,没有后台进程管理网络和其他的通信链接,也没有任何东西能够控制计算机执行生产功能。 + +现在 systemd 可以加载所需的功能性单元以便将系统启动到选择的目标运行状态。 + +### 目标 + +一个 systemd 目标代表一个 Linux 系统当前的或期望的运行状态。与 SystemV 启动脚本十分类似,目标定义了系统运行必须存在的服务,以及处于目标状态下必须激活的服务。图片 1 展示了使用 systemd 的 Linux 系统可能的运行状态目标。就像在本系列的第一篇文章以及 systemd 启动的手册页(`man bootup`)所看到的一样,有一些开启不同必要服务的其他中间目标,包括 **swap.target**、**timers.target**、**local-fs.target** 等。一些目标(像 **basic.target**)作为检查点使用,在移动到下一个更高级的目标之前保证所有需要的服务已经启动并运行。 + +除非开机时在 GRUB 菜单进行更改,systemd 总是启动 **default.target**。**default.target** 文件是指向真实的目标文件的符号链接。对于桌面工作站,**default.target** 通常是 **graphical.target**,等同于 SystemV 的运行等级 5。对于服务器,默认目标多半是 **multi-user.target**,就像 SystemV 的运行等级 3。**emergency.target** 文件类似单用户模式。目标和服务都是 systemd 单元。 + +下面的表格,包含在本系列的上一篇文章中,比较了 systemd 目标和古老的 SystemV 启动运行等级。为了向后兼容,systemd 提供了 systemd 目标别名,允许脚本——和系统管理员——使用像 **init 3** 一样的 SystemV 命令改变运行等级。当然,SystemV 命令被转发给 systemd 进行解释和执行。 + +**systemd targets** | **SystemV runlevel** | **target aliases** | **Description** +---|---|---|--- +default.target | | | 这个目标通常是一个符号链接,作为 **multi-user.target** 或 **graphical.target** 的别名。systemd 总是用 **default.target** 启动系统。**default.target** 不能命名为 **halt.target**、**poweroff.target**、和 **reboot.target**。 +graphical.target | 5 | runlevel5.target | 带有 GUI 的 **Multi-user.target** +| 4 | runlevel4.target | 未使用。运行等级 4 和 SystemV 的运行等级 3 一致,可以创建这个目标并进行定制,用于启动本地服务,而不必更改默认的 **multi-user.target**。 +multi-user.target | 3 | runlevel3.target | 运行所有的服务,但是只有命令行接口(command-line interface,CLI) +| 2 | runlevel2.target | 多用户,没有 NFS,但是运行其他所有的非 GUI 服务 +rescue.target | 1 | runlevel1.target | 一个基本的系统,包括挂载文件系统,但是只运行最基础的服务,以及一个主控制台上的救援命令行解释器 +emergency.target | S | | 单用户模式——没有服务运行;文件系统没有挂载。这是最基础级的操作模式,只有一个运行在主控制台的紧急情况命令行解释器,供用户和系统交互。 +halt.target | | | 不断电的情况下停止系统 +reboot.target | 6 | runlevel6.target | 重启 +poweroff.target | 0 | runlevel0.target | 停止系统并关闭电源 + + +每个目标在配置文件中都描述了一组依赖关系。systemd 启动需要的依赖,即 Linux 主机运行在特定功能级别所需的服务。加载目标配置文件中列出的所有依赖并运行后,系统就运行在那个目标等级。如果愿意,你可以在本系列的第一篇文章 [_学着爱上 systemd_][2] 中回顾 systemd 的启动序列和运行时目标。 + +### 探索当前的目标 + +许多 Linux 发行版默认安装一个 GUI 桌面接口,以便安装的系统可以像工作站一样使用。我总是从 Fedora Live USB 引导驱动器安装 Xfce 或 LXDE 桌面。即使是安装一个服务器或者其他基础类型的主机(比如用于路由器和防火墙的主机),我也使用 GUI 桌面的安装方式。 + +我可以安装一个没有桌面的服务器(数据中心的典型做法),但是这样不满足我的需求。原因不是我需要 GUI 桌面本身,而是 LXDE 安装包含了许多其他默认的服务器安装没有提供的工具,这意味着初始安装之后我需要做的工作更少。 + +但是,仅仅因为有一个 GUI 桌面并不意味着我要使用它。我有一个 16 端口的 KVM,可以用于访问我的大部分 Linux 系统的 KVM 接口,但我和它们交互的大部分交互是通过从我的主要工作站建立的远程 SSH 连接。这种方式更安全,而且和 **graphical.target** 相比,运行 **multi-user.target** 使用更少的系统资源。 + +首先,检查默认目标,确认是 **graphical.target**: + +``` +[root@testvm1 ~]# systemctl get-default +graphical.target +[root@testvm1 ~]# +``` + +然后确认当前正在运行的目标,应该和默认目标相同。你仍可以使用老方法,输出古老的 SystemV 运行等级。注意,前一个运行等级在左边,这里是 **N**(意思是 None),表示主机启动后没有修改过运行等级。数字 5 是当前的目标,正如古老的 SystemV 术语中的定义: + +``` +[root@testvm1 ~]# runlevel +N 5 +[root@testvm1 ~]# +``` + +注意,runlevel 的手册页指出运行等级已经被淘汰,并提供了一个转换表。 + +你也可以使用 systemd 方式,命令的输出有很多行,但确实用 systemd 术语提供了答案: + +``` +[root@testvm1 ~]# systemctl list-units --type target +UNIT                   LOAD   ACTIVE SUB    DESCRIPTION                 +basic.target           loaded active active Basic System               +cryptsetup.target      loaded active active Local Encrypted Volumes     +getty.target           loaded active active Login Prompts               +graphical.target       loaded active active Graphical Interface         +local-fs-pre.target    loaded active active Local File Systems (Pre)   +local-fs.target        loaded active active Local File Systems         +multi-user.target      loaded active active Multi-User System           +network-online.target  loaded active active Network is Online           +network.target         loaded active active Network                     +nfs-client.target      loaded active active NFS client services         +nss-user-lookup.target loaded active active User and Group Name Lookups +paths.target           loaded active active Paths                       +remote-fs-pre.target   loaded active active Remote File Systems (Pre)   +remote-fs.target       loaded active active Remote File Systems         +rpc_pipefs.target      loaded active active rpc_pipefs.target           +slices.target          loaded active active Slices                     +sockets.target         loaded active active Sockets                     +sshd-keygen.target     loaded active active sshd-keygen.target         +swap.target            loaded active active Swap                       +sysinit.target         loaded active active System Initialization       +timers.target          loaded active active Timers                     + +LOAD   = Reflects whether the unit definition was properly loaded. +ACTIVE = The high-level unit activation state, i.e. generalization of SUB. +SUB    = The low-level unit activation state, values depend on unit type. + +21 loaded units listed. Pass --all to see loaded but inactive units, too. +To show all installed unit files use 'systemctl list-unit-files'. +``` + +上面列出了当前加载的和激活的目标,你也可以看到 **graphical.target** 和 **multi-user.target**。**multi-user.target** 需要在 **graphical.target** 之前加载。这个例子中,**graphical.target** 是激活的。 + +### 切换到不同的目标 + +切换到 **multi-user.target** 很简单: + +``` +[root@testvm1 ~]# systemctl isolate multi-user.target +``` + +显示器现在应该从 GUI 桌面或登录界面切换到了一个虚拟控制台。登录并列出当前激活的 systemd 单元,确认 **graphical.target** 不再运行: + +``` +[root@testvm1 ~]# systemctl list-units --type target +``` + +务必使用 **runlevel** 确认命令输出了之前的和当前的“运行等级”: + +``` +[root@testvm1 ~]# runlevel +5 3 +``` + +### 更改默认目标 + +现在,将默认目标改为 **multi-user.target**,以便系统总是启动进入 **multi-user.target**,从而使用控制台命令行接口而不是 GUI 桌面接口。使用你的测试主机的根用户,切换到保存 systemd 配置的目录,执行一次快速列出操作: + +``` +[root@testvm1 ~]# cd /etc/systemd/system/ ; ll +drwxr-xr-x. 2 root root 4096 Apr 25  2018  basic.target.wants +<snip> +lrwxrwxrwx. 1 root root   36 Aug 13 16:23  default.target -> /lib/systemd/system/graphical.target +lrwxrwxrwx. 1 root root   39 Apr 25  2018  display-manager.service -> /usr/lib/systemd/system/lightdm.service +drwxr-xr-x. 2 root root 4096 Apr 25  2018  getty.target.wants +drwxr-xr-x. 2 root root 4096 Aug 18 10:16  graphical.target.wants +drwxr-xr-x. 2 root root 4096 Apr 25  2018  local-fs.target.wants +drwxr-xr-x. 2 root root 4096 Oct 30 16:54  multi-user.target.wants +<snip> +[root@testvm1 system]# +``` + +为了强调一些有助于解释 systemd 如何管理启动过程的重要事项,我缩短了这个列表。你应该可以在虚拟机看到完整的目录和链接列表。 + +**default.target** 项是指向目录 **/lib/systemd/system/graphical.target** 的符号链接(软链接),列出那个目录查看目录中的其他内容: + +``` +[root@testvm1 system]# ll /lib/systemd/system/ | less +``` + +你应该在这个列表中看到文件、目录、以及更多链接,但是专门寻找一下 **multi-user.target** 和 **graphical.target**。现在列出 **default.target**——一个指向 **/lib/systemd/system/graphical.target** 的链接——的内容: + +``` +[root@testvm1 system]# cat default.target +#  SPDX-License-Identifier: LGPL-2.1+ +# +#  This file is part of systemd. +# +#  systemd is free software; you can redistribute it and/or modify it +#  under the terms of the GNU Lesser General Public License as published by +#  the Free Software Foundation; either version 2.1 of the License, or +#  (at your option) any later version. + +[Unit] +Description=Graphical Interface +Documentation=man:systemd.special(7) +Requires=multi-user.target +Wants=display-manager.service +Conflicts=rescue.service rescue.target +After=multi-user.target rescue.service rescue.target display-manager.service +AllowIsolate=yes +[root@testvm1 system]# +``` + +**graphical.target** 文件的这个链接描述了图形用户接口需要的所有必备条件。我会在本系列的下一篇文章至少探讨其中的一些选项。 + +为了使主机启动到多用户模式,你需要删除已有的链接,创建一个新链接指向正确目标。如果你的 [PWD][5] 不是 **/etc/systemd/system**,切换过去: + +``` +[root@testvm1 system]# rm -f default.target +[root@testvm1 system]# ln -s /lib/systemd/system/multi-user.target default.target +``` + +列出 **default.target** 链接,确认其指向了正确的文件: + +``` +[root@testvm1 system]# ll default.target +lrwxrwxrwx 1 root root 37 Nov 28 16:08 default.target -> /lib/systemd/system/multi-user.target +[root@testvm1 system]# +``` + +如果你的链接看起来不一样,删除并重试。列出 **default.target** 链接的内容: + +``` +[root@testvm1 system]# cat default.target +#  SPDX-License-Identifier: LGPL-2.1+ +# +#  This file is part of systemd. +# +#  systemd is free software; you can redistribute it and/or modify it +#  under the terms of the GNU Lesser General Public License as published by +#  the Free Software Foundation; either version 2.1 of the License, or +#  (at your option) any later version. + +[Unit] +Description=Multi-User System +Documentation=man:systemd.special(7) +Requires=basic.target +Conflicts=rescue.service rescue.target +After=basic.target rescue.service rescue.target +AllowIsolate=yes +[root@testvm1 system]# +``` + +**default.target**——这里其实是指向 **multi-user.target** 的链接——其中的 **[Unit]** 部分现在有不同的必需条件。这个目标不需要有图形显示管理器。 + +重启,你的虚拟机应该启动到虚拟控制台 1 的控制台登录,虚拟控制台 1 在显示器标识为 tty1。现在你已经知道如何修改默认的目标,使用所需的命令将默认目标改回 **graphical.target**。 + +首先检查当前的默认目标: + +``` +[root@testvm1 ~]# systemctl get-default +multi-user.target +[root@testvm1 ~]# systemctl set-default graphical.target +Removed /etc/systemd/system/default.target. +Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/graphical.target. +[root@testvm1 ~]# +``` + +输入下面的命令直接切换到 **graphical.target** 和显示管理器的登录界面,不需要重启: + +``` +[root@testvm1 system]# systemctl isolate default.target +``` + +我不清楚为何 systemd 的开发者选择了术语 “isolate” 作为这个子命令。我的研究表明指的可能是运行指明的目标,但是“隔离”并终结其他所有启动该目标不需要的目标。然而,命令执行的效果是从一个运行的目标切换到另一个——在这个例子中,从多用户目标切换到图形目标。上面的命令等同于 SystemV 启动脚本和 init 程序中古老的 init 5 命令。 + +登录 GUI 桌面,确认能正常工作。 + +### 总结 + +本文探索了 Linux systemd 启动序列,开始探讨两个重要的 systemd 工具 **systemdctl** 和 **journalctl**,还说明了如何从一个目标切换到另一个目标,以及如何修改默认目标。 + +本系列的下一篇文章中将会创建一个新的 systemd 单元,并配置为启动阶段运行。下一篇文章还会查看一些配置选项,可以帮助确定某个特定的单元在序列中启动的位置,比如在网络启动运行后。 + +### 资源 + +关于 systemd 网络上有大量的信息,但大部分都简短生硬、愚钝、甚至令人误解。除了本文提到的资源,下面的网页提供了关于 systemd 启动更详细可靠的信息。 + + * Fedora 项目有一个优质实用的 [systemd 指南][6],几乎有你使用 systemd 配置、管理、维护一个 Fedora 计算机需要知道的一切。 + * Fedora 项目还有一个好用的[速查表][7],交叉引用了古老的 SystemV 命令和对应的 systemd 命令。 + * 要获取 systemd 的详细技术信息和创立的原因,查看 [Freedesktop.org][8] 的 [systemd 描述][9]。 + * Linux.com 上”systemd 的更多乐趣"提供了更高级的 systemd [信息和提示][11]。 + +还有一系列针对系统管理员的深层技术文章,由 systemd 的设计者和主要开发者 Lennart Poettering 所作。这些文章写于 2010 年 4 月到 2011 年 9 月之间,但在当下仍然像当时一样有价值。关于 systemd 及其生态的许多其他优秀的作品都是基于这些文章的。 + + * [Rethinking PID 1][12] + * [systemd for Administrators, Part I][13] + * [systemd for Administrators, Part II][14] + * [systemd for Administrators, Part III][15] + * [systemd for Administrators, Part IV][16] + * [systemd for Administrators, Part V][17] + * [systemd for Administrators, Part VI][18] + * [systemd for Administrators, Part VII][19] + * [systemd for Administrators, Part VIII][20] + * [systemd for Administrators, Part IX][21] + * [systemd for Administrators, Part X][22] + * [systemd for Administrators, Part XI][23] + +Mentor Graphics 公司的一位 Linux 内核和系统工程师 Alison Chiaken,对 systemd 进行了预展... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/systemd-startup + +作者:[David Both][a] +选题:[lujun9972][b] +译者:[YungeG](https://github.com/YungeG) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/dboth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/start_line.jpg?itok=9reaaW6m (People at the start line of a race) +[2]: https://opensource.com/article/20/4/systemd +[3]: http://www.gnu.org/software/grub/manual/grub +[4]: mailto:mockbuild@bkernel03.phx2.fedoraproject.org +[5]: https://en.wikipedia.org/wiki/Pwd +[6]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html +[7]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet +[8]: http://Freedesktop.org +[9]: http://www.freedesktop.org/wiki/Software/systemd +[10]: http://Linux.com +[11]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/ +[12]: http://0pointer.de/blog/projects/systemd.html +[13]: http://0pointer.de/blog/projects/systemd-for-admins-1.html +[14]: http://0pointer.de/blog/projects/systemd-for-admins-2.html +[15]: http://0pointer.de/blog/projects/systemd-for-admins-3.html +[16]: http://0pointer.de/blog/projects/systemd-for-admins-4.html +[17]: http://0pointer.de/blog/projects/three-levels-of-off.html +[18]: http://0pointer.de/blog/projects/changing-roots +[19]: http://0pointer.de/blog/projects/blame-game.html +[20]: http://0pointer.de/blog/projects/the-new-configuration-files.html +[21]: http://0pointer.de/blog/projects/on-etc-sysinit.html +[22]: http://0pointer.de/blog/projects/instances.html +[23]: http://0pointer.de/blog/projects/inetd.html From 07777d5b372ab0de80c0cb151c88a32c922f1358 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Thu, 19 Aug 2021 19:56:40 +0800 Subject: [PATCH 107/290] translated by perfiffer --- ...210804 Install OpenVPN on your Linux PC.md | 194 ------------------ ...210804 Install OpenVPN on your Linux PC.md | 175 ++++++++++++++++ 2 files changed, 175 insertions(+), 194 deletions(-) delete mode 100644 sources/tech/20210804 Install OpenVPN on your Linux PC.md create mode 100644 translated/tech/20210804 Install OpenVPN on your Linux PC.md diff --git a/sources/tech/20210804 Install OpenVPN on your Linux PC.md b/sources/tech/20210804 Install OpenVPN on your Linux PC.md deleted file mode 100644 index 4e6a5efeda..0000000000 --- a/sources/tech/20210804 Install OpenVPN on your Linux PC.md +++ /dev/null @@ -1,194 +0,0 @@ -[#]: subject: "Install OpenVPN on your Linux PC" -[#]: via: "https://opensource.com/article/21/7/openvpn-router" -[#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Install OpenVPN on your Linux PC -====== -After setting up a VPN server, the next step is installing and -configuring OpenVPN. -![Open ethernet cords.][1] - -OpenVPN creates an encrypted tunnel between two points, preventing a third party from accessing your network traffic. By setting up your virtual private network (VPN) server, you become your own VPN provider. Many popular VPN services already use [OpenVPN][2], so why tie your connection to a specific provider when you can have complete control? - -The [first article][3] in this series demonstrated how to set up and configure a Linux PC to serve as your OpenVPN server. It also discussed how to configure your router so that you can reach your VPN server from an outside network. - -This second article demonstrates how to install the OpenVPN server software using steps customized from the [OpenVPN wiki][4]. - -### Install OpenVPN - -First, install OpenVPN and the `easy-rsa` application (to help you set up authentication on your server) using your package manager. This example uses Fedora Linux; if you've chosen something different, use the appropriate command for your distribution: - - -``` -`$ sudo dnf install openvpn easy-rsa` -``` - -This creates some empty directories: - - * `/etc/openvpn` - * `/etc/openvpn/client` - * `/etc/openvpn/server` - - - -If these aren't created during installation, create them manually. - -### Set up authentication - -OpenVPN depends on the `easy-rsa` scripts and should have its own copy of them. Copy the `easy-rsa` scripts and files: - - -``` -$ sudo mkdir /etc/openvpn/easy-rsa -$ sudo cp -rai /usr/share/easy-rsa/3/* \ -/etc/openvpn/easy-rsa/ -``` - -Authentication is important, and OpenVPN takes it very seriously. The theory is that if Alice needs to access private information inside Bob's company, it's vital that Bob makes sure Alice really is Alice. Likewise, Alice must make sure that Bob is really Bob. We call this mutual authentication. - -Today's best practice checks an attribute from two of three possible factors: - - * Something you have - * Something you know - * Something you are - - - -There are lots of choices. This OpenVPN setup uses: - - * **Certificates:** Something both the client and server have - * **Certificate password:** Something the people know - - - -Alice and Bob need help to mutually authenticate. Since they both trust Cathy, Cathy takes on a role called **certificate authority** (CA). Cathy attests that Alice and Bob both are who they claim to be. Because Alice and Bob both trust Cathy, now they also trust each other. - -But what convinces Cathy that Alice and Bob really are Alice and Bob? Cathy's reputation in the community depends on getting this right, and so if she wants Danielle, Evan, Fiona, Greg, and others to also trust her, she will rigorously test Alice and Bob's claims. After Alice and Bob convince Cathy that they really are Alice and Bob, Cathy signs certificates for them to share with each other and the world. - -How do Alice and Bob know Cathy—and not somebody impersonating her—signed the certificates? They use a technology called **public key cryptography:** - - * Find a cryptography algorithm that encrypts with one key and decrypts with another. - * Declare one key private and share the other key with the public. - * Cathy shares her public key and a clear-text copy of her signature with the world. - * Cathy encrypts her signature with her private key. Anyone can decrypt it with her public key. - * If Cathy's decrypted signature matches the clear-text copy, Alice and Bob can trust Cathy really did sign it. - - - -You use this same technology every time you buy goods and services online. - -### Implement authentication - -OpenVPN's [documentation][5] suggests setting up a CA on a separate system or at least a separate directory on the OpenVPN server. The documentation also suggests generating server and client certificates from the server and clients. Because this is a simple setup, you can use the OpenVPN server as its own CA and put the certificates and keys into specified directories on the server. - -Generate certificates from the server and copy them to each client as part of client setup. - -This implementation uses self-signed certificates. This works because the server trusts itself, and clients trust the server. Therefore, the server is the best CA to sign certificates. - -From the OpenVPN server, set up the CA: - - -``` -$ sudo mkdir /etc/openvpn/ca -$ cd /etc/openvpn/ca -$ sudo /etc/openvpn/easy-rsa/easyrsa init-pki -$ sudo /etc/openvpn/easy-rsa/easyrsa build-ca -``` - -Use an easy-to-remember but hard-to-guess passphrase. - -Set up the server key pair and certificate request: - - -``` -$ cd /etc/openvpn/server -$ sudo /etc/openvpn/easy-rsa/easyrsa init-pki -$ sudo /etc/openvpn/easy-rsa/easyrsa gen-req OVPNserver2020 nopass -``` - -In this example, `OVPNServer2020` is whatever hostname you assigned your OpenVPN server in the first article in this series. - -### Generate and sign certs - -Now you must send a server request to the CA and generate and sign the server certificate. - -This step essentially copies the request file from `/etc/openvpn/server/pki/reqs/OVPNserver2020.req` to `/etc/openvpn/ca/pki/reqs/OVPNserver2020.req` to prepare it for review and signing: - - -``` -$ cd /etc/openvpn/ca -$ sudo /etc/openvpn/easy-rsa/easyrsa \ -import-req /etc/openvpn/server/pki/reqs/OVPNserver2020.req OVPNserver2020 -``` - -### Review and sign the request - -You've generated a request, so now you must review and sign the certs: - - -``` -$ cd /etc/openvpn/ca -$ sudo /etc/openvpn/easy-rsa/easyrsa \ -show-req OVPNserver2020 -``` - -Sign as the server: - - -``` -$ cd /etc/openvpn/ca -$ sudo /etc/openvpn/easy-rsa/easyrsa \ -sign-req server OVPNserver2020 -``` - -Put a copy of the server and CA certificates where they belong for the config file to pick them up: - - -``` -$ sudo cp /etc/openvpn/ca/pki/issued/OVPNserver2020.crt \ -/etc/openvpn/server/pki/ -$ sudo cp /etc/openvpn/ca/pki/ca.crt \ -/etc/openvpn/server/pki/ -``` - -Next, generate [Diffie-Hellman][6] parameters so that clients and the server can exchange session keys: - - -``` -$ cd /etc/openvpn/server -$ sudo /etc/openvpn/easy-rsa/easyrsa gen-dh -``` - -### Almost there - -The next article in this series will demonstrate how to configure and start the OpenVPN server you just built. - -* * * - -_This article is based on D. Greg Scott's [blog][7] and is reused with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/openvpn-router - -作者:[D. Greg Scott][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/greg-scott -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) -[2]: https://openvpn.net/ -[3]: https://opensource.com/article/21/7/vpn-openvpn-part-1 -[4]: https://community.openvpn.net/openvpn/wiki -[5]: https://openvpn.net/community-resources/ -[6]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange -[7]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/ diff --git a/translated/tech/20210804 Install OpenVPN on your Linux PC.md b/translated/tech/20210804 Install OpenVPN on your Linux PC.md new file mode 100644 index 0000000000..272028f609 --- /dev/null +++ b/translated/tech/20210804 Install OpenVPN on your Linux PC.md @@ -0,0 +1,175 @@ +[#]: subject: "Install OpenVPN on your Linux PC" +[#]: via: "https://opensource.com/article/21/7/openvpn-router" +[#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在你的个人 Linux 电脑上安装 `0penVPN` +====== +安装完 “虚拟专用网络” 服务器,下一步就是安装和配置 0penVPN。 +![Open ethernet cords.][1] + +0penVPN 在两点之间创建一个加密通道,阻止第三方访问你的网络流量数据。通过设置你的 “虚拟专用网络” 服务,你可以成为你自己的 “虚拟专用网络” 服务商。许多流行的 “虚拟专用网络” 服务都使用 0penVPN,所以当你可以掌控自己的网络时,为什么还要将你的网络连接绑定到特定的提供商呢? + +本系列的[第一篇文章](https://linux.cn/article-13680-1.html)展示了如何安装和配置一台 Linux 电脑作为你的 0penVPN 服务器。同时也讲述了如何配置你的路由器以便你可以在外部网络连接到你的 VPN 服务器。 + +第二篇文章将演示根据 [0penVPN wiki][4] 给定的步骤安装一个 0penVPN 服务软件。 + +### 安装 0penVPN + +首先,使用包管理器安装 0penVPN 和 `easy-rsa` 应用程序(帮助你在服务器上设置身份验证)。本例使用的是Fedora Linux,如果你选择了不同的发行版,请选用合适的命令。 + +``` +$ sudo dnf install openvpn easy-rsa +``` + +此操作会创建一些空目录: + + * `/etc/openvpn` + * `/etc/openvpn/client` + * `/etc/openvpn/server` + + +如果这些目录在安装的过程中没有创建,请手动创建它们。 + +### 设置身份验证 + +0penVPN 依赖于 `easy-rsa` 脚本,并且应该有自己的副本。复制 `easy-rsa` 脚本和文件: + +``` +$ sudo mkdir /etc/openvpn/easy-rsa +$ sudo cp -rai /usr/share/easy-rsa/3/* \ +/etc/openvpn/easy-rsa/ +``` + +身份验证很重要,0penVPN 非常重视它。身份验证的理论是,如果 Alice 需要访问 Bob 公司内部的私人信息,那么 Bob 确保 Alice 真的是 Alice 就至关重要。同样的,Alice 也必须确保 Bob 是真正的 Bob。我们称之为相互认证。 + +现有的最佳实践是从三个可能因素中的选择两个检查属性: + + * 你拥有的 + * 你知道的 + * 你是谁 + + +选择有很多。0penVPN 安装使用如下: + + * **Certificates:** 客户端和服务端都拥有的东西 + * **Certificate password:** 人们都知道的东西 + + +Alice 和 Bob 需要帮助彼此来验证身份。由于他们都相信 Cathy, Cathy 承担了称为 **证书颁发机构** (CA) 的角色。Cathy 证明 Alice 和 Bob 都是他们自己。因为 Alice 和 Bob 都信任 Cathy,现在他们也相互信任了。 + +但是是什么让 Cathy 相信 Alice 和 Bob 是真的 Alice 和 Bob?Cathy 在社区的声誉取决于如何正确处理这件事,因此如果她希望 Denielle,Evan,Fiona,Greg 和其他人也信任她,她就需要严格测试 Alice 和 Bob 的话。当 Alice 和 Bob 向 Cathy 证明了他们是真的 Alice 和 Bob 之后,Cathy 将向 Alice 和 Bob 签署证书,让他们彼此和全世界分享。 + +Alice 和 Bob 如何知道是 Cathy 签署了证书,而不是某个人冒充她签发了证书?他们使用一项叫做**公钥加密技术:** + + * 找到一种用一个密钥加密并用另一个密钥解密的加密算法。 + * 将其中一个设为私钥,将另外一个设为公钥。 + * Cathy 与全世界分享她的公钥和她签名的明文副本。 + * Cathy 用她的私钥加密她的签名,任何人都可以用她分享的公钥解密。 + * 如果 Cathy 的签名解密后与明文副本匹配,Alice 和 Bob 就可以相信 Cathy 确实签署了它。 + +每次在线购买商品和服务时,使用的就是这种技术。 + +### 认证实现 +0penVPN 的 [文档][5]建议在单独的系统上或者至少在 0penVPN 服务器的单独目录上设置 CA。该文档还建议分别从服务端和客户端生成各自的证书。因为这是一个简单的演示设置,你可以使用 0penVPN 服务器设置 CA,并将证书和密钥放入服务器上的指定目录中。 + +从服务端生成证书,并将证书拷贝到各个客户端,避免客户端再次设置。 + +此实现使用自签名证书。这是因为服务器信任自己,而客户端信任服务器。因此,服务器是签署证书的最佳 CA。 + +在 0penVPN 服务器上设置 CA: + +``` +$ sudo mkdir /etc/openvpn/ca +$ cd /etc/openvpn/ca +$ sudo /etc/openvpn/easy-rsa/easyrsa init-pki +$ sudo /etc/openvpn/easy-rsa/easyrsa build-ca +``` + +使用一个易记难猜的密码。 + +设置服务器密钥对和认证请求: + +``` +$ cd /etc/openvpn/server +$ sudo /etc/openvpn/easy-rsa/easyrsa init-pki +$ sudo /etc/openvpn/easy-rsa/easyrsa gen-req OVPNserver2020 nopass +``` + +在此例中,`0VPNServer2020` 是你在本系列第一篇文章中为 0penVPN 服务器设置的主机名。 + +### 生成和签署证书 + +现在你必须向 CA 发送服务器请求并生成和签署服务器证书。 + +此步骤实质上是将请求文件从 `/etc/openvpn/server/pki/reqs/OVPNserver2020.req` 复制到 `/etc/openvpn/ca/pki/reqs/OVPNserver2020.req` 以准备审查和签名: + +``` +$ cd /etc/openvpn/ca +$ sudo /etc/openvpn/easy-rsa/easyrsa \ +import-req /etc/openvpn/server/pki/reqs/OVPNserver2020.req OVPNserver2020 +``` + +### 审查并签署请求 + +你已经生成了一个请求,所以现在你必须审查并签署证书: + +``` +$ cd /etc/openvpn/ca +$ sudo /etc/openvpn/easy-rsa/easyrsa \ +show-req OVPNserver2020 +``` + +以服务器身份签署请求: + +``` +$ cd /etc/openvpn/ca +$ sudo /etc/openvpn/easy-rsa/easyrsa \ +sign-req server OVPNserver2020 +``` + +将服务器和 CA 证书的副本放在它们所属的位置,以便配置文件获取它们: + +``` +$ sudo cp /etc/openvpn/ca/pki/issued/OVPNserver2020.crt \ +/etc/openvpn/server/pki/ +$ sudo cp /etc/openvpn/ca/pki/ca.crt \ +/etc/openvpn/server/pki/ +``` + +接下来,生成 [Diffie-Hellman][6] 参数,以便客户端和服务器可以交换会话密钥: + +``` +$ cd /etc/openvpn/server +$ sudo /etc/openvpn/easy-rsa/easyrsa gen-dh +``` + +### 快完成了 +本系列的下一篇文章将演示如何配置和启动你刚刚构建的 0penVPN 服务器。 +* * * + +本文的部分内容改编自 D. Greg Scott 的博客,并经许可重新发布。 +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/openvpn-router + +作者:[D. Greg Scott][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-scott +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) +[2]: https://openvpn.net/ +[3]: https://opensource.com/article/21/7/vpn-openvpn-part-1 +[4]: https://community.openvpn.net/openvpn/wiki +[5]: https://openvpn.net/community-resources/ +[6]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange +[7]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/ From 864c6b6099b0fd0f0db6ab708a33258cef6ede45 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 22:33:14 +0800 Subject: [PATCH 108/290] PRF @geekpi --- ...esktop Wallpaper Every Hour -Here-s How.md | 151 +++++++++++------- 1 file changed, 97 insertions(+), 54 deletions(-) diff --git a/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md b/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md index a27d1361eb..6855224659 100644 --- a/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md +++ b/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md @@ -3,23 +3,26 @@ [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -如何每小时改变你的 Linux 桌面墙纸 +如何每小时改变你的 Linux 桌面壁纸 ====== -这个 shell 脚本 styli.sh 可以帮助你每小时自动改变你的 Linux 桌面壁纸,并且有几个选项。 -用一张漂亮的壁纸来开始你的一天,你的桌面让人耳目一新。但寻找墙纸,然后保存,最终设置为墙纸,是非常麻烦的。所有这些步骤都可以通过这个叫做 [styl.sh][1] 的脚本完成。 +![](https://img.linux.net.cn/data/attachment/album/202108/19/223054ga6b8a8paa61u31u.jpg) + +这个 shell 脚本 `styli.sh` 可以帮助你每小时自动改变你的 Linux 桌面壁纸,并且有几个选项。 + +用一张漂亮的壁纸来开始你的一天,你的桌面让人耳目一新。但寻找壁纸,然后保存,最终设置为壁纸,是非常麻烦的。所有这些步骤都可以通过这个叫做 [styli.sh][1] 的脚本完成。 ### styli.sh - 每小时改变你的 Linux 桌面壁纸 -这是一个 shell 脚本,你可以从 GitHub 上下载。当运行时,它从 Reddit 的热门 Subreddits 中获取壁纸并将其设置为你的壁纸。 +这是一个 shell 脚本,你可以从 GitHub 上下载。当运行时,它从 Reddit 的热门版块中获取壁纸并将其设置为你的壁纸。 该脚本适用于所有流行的桌面环境,如 GNOME、KDE Plasma、Xfce 和 Sway 窗口管理器。 -它有很多功能,你可以通过 crontab 来运行这个脚本,并在特定的时间间隔内得到一张新的墙纸。 +它有很多功能,你可以通过 crontab 来运行这个脚本,并在特定的时间间隔内得到一张新的壁纸。 ### 下载并安装、运行 @@ -30,22 +33,30 @@ git clone https://github.com/thevinter/styli.sh cd styli.sh ``` -要设置随机墙纸,根据你的桌面环境运行以下内容。 +要设置随机壁纸,根据你的桌面环境运行以下内容。 ![Change your Linux Desktop Wallpaper Every Hour using styli.sh][3] +GNOME: + ``` ./styli.sh -g ``` +Xfce: + ``` ./styli.sh -x ``` +KDE Plasma: + ``` ./styli.sh -k ``` +Sway: + ``` ./styli.sh -y ``` @@ -64,63 +75,95 @@ crontab -e @hourly script/path/styli.sh ``` -### 改变 subreddits +### 改变版块 -在源目录中,有一个名为 subreddits 的文件。它填满了一些标准的 subreddits。如果你想要更多一些,只需在文件末尾添加 subreddit 名称。 +在源目录中,有一个名为 `subreddits` 的文件。它填满了一些标准的版块。如果你想要更多一些,只需在文件末尾添加版块名称。 ### 更多配置选项 -壁纸的类型,大小,也可以设置。以下是这个脚本的一些独特的配置选项。 +壁纸的类型、大小,也可以设置。以下是这个脚本的一些独特的配置选项。 -> 设置一个随机的 1920×1080 背景 -> ./styli.sh -> -> 指定一个所需的宽度或高度 -> ./styli.sh -w 1080 -h 720 -> ./styli.sh -w 2560 -> ./styli.sh -h 1440 -> -> 根据搜索词设置墙纸 -> ./styli.sh -s island -> ./styli.sh -s “sea sunset” -> ./styli.sh -s sea -w 1080 -> -> 从设定的一个 subreddits 中获得一个随机壁纸 -> 注意:宽度/高度/搜索参数对 reddit 不起作用。 -> ./styli.sh -l reddit -> -> 从一个自定义的 subreddit 获得随机墙纸 -> ./styli.sh -r -> ./styli.sh -r wallpaperdump -> -> 使用内置的 feh -bg 选项 -> ./styli.sh -b -> ./styli.sh -b bg-scale -r widescreen-wallpaper -> -> 添加自定义的 feh 标志 -> ./styli.sh -c -> ./styli.sh -c –no-xinerama -r widescreen-wallpaper -> -> 自动设置终端的颜色 -> ./styli.sh -p -> -> 使用 nitrogen 而不是 feh -> ./styli.sh -n -> -> 使用 nitrogen 更新 > 1 个屏幕 -> ./styli.sh -n -m -> -> 从一个目录中选择一个随机的背景 -> ./styli.sh -d /path/to/dir +设置一个随机的 1920×1080 背景: + +``` +./styli.sh +``` + +指定一个所需的宽度或高度: + +``` +./styli.sh -w 1080 -h 720 +./styli.sh -w 2560 +./styli.sh -h 1440 +``` + +根据搜索词设置壁纸: + +``` +./styli.sh -s island +./styli.sh -s “sea sunset” +./styli.sh -s sea -w 1080 +``` + +从设定的一个版块中获得一个随机壁纸: + +注意:宽度/高度/搜索参数对 reddit 不起作用。 + +``` +./styli.sh -l reddit +``` + +从一个自定义的版块获得随机壁纸: + +``` +./styli.sh -r +./styli.sh -r wallpaperdump +``` + +使用内置的 `feh -bg` 选项: + +``` +./styli.sh -b +./styli.sh -b bg-scale -r widescreen-wallpaper +``` + +添加自定义的 feh 标志: + +``` +./styli.sh -c +./styli.sh -c –no-xinerama -r widescreen-wallpaper +``` + +自动设置终端的颜色: + +``` +./styli.sh -p +``` + +使用 nitrogen 而不是 feh: + +``` +./styli.sh -n +``` + +使用 nitrogen 更新多个屏幕: + +``` +./styli.sh -n -m +``` + +从一个目录中选择一个随机的背景: + +``` +./styli.sh -d /path/to/dir +``` ### 最后说明 -一个独特且方便的脚本,内存占用小,可以直接在一个时间间隔内比如一个小时获取图片。让你的桌面看起来[新鲜且高效][4]。如果你不喜欢这些壁纸,你可以简单地从终端再次运行脚本来循环使用。 +这是一个独特且方便的脚本,内存占用小,可以直接在一个时间间隔内比如一个小时获取图片。让你的桌面看起来 [新鲜且高效][4]。如果你不喜欢这些壁纸,你可以简单地从终端再次运行脚本来循环使用。 你喜欢这个脚本吗?或者你知道有什么像这样的壁纸切换器吗?请在下面的评论栏里告诉我。 -* * * - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/ @@ -128,7 +171,7 @@ via: https://www.debugpoint.com/2021/08/change-wallpaper-every-hour/ 作者:[Arindam][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f92a38398646d161fe1883a228ea1d9a4b1b18ec Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 19 Aug 2021 22:33:50 +0800 Subject: [PATCH 109/290] PUB @geekpi https://linux.cn/article-13701-1.html --- ...nge your Linux Desktop Wallpaper Every Hour -Here-s How.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md (98%) diff --git a/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md b/published/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md similarity index 98% rename from translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md rename to published/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md index 6855224659..ec970dc530 100644 --- a/translated/tech/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md +++ b/published/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13701-1.html" 如何每小时改变你的 Linux 桌面壁纸 ====== From e8362cda38a61396c46c572d00f14140ca876059 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 20 Aug 2021 05:02:26 +0800 Subject: [PATCH 110/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210820=20?= =?UTF-8?q?How=20to=20Download=20Audio=20Only=20Using=20youtube-dl?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210820 How to Download Audio Only Using youtube-dl.md --- ...to Download Audio Only Using youtube-dl.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20210820 How to Download Audio Only Using youtube-dl.md diff --git a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md b/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md new file mode 100644 index 0000000000..4c5ab290b6 --- /dev/null +++ b/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md @@ -0,0 +1,114 @@ +[#]: subject: "How to Download Audio Only Using youtube-dl" +[#]: via: "https://itsfoss.com/youtube-dl-audio-only/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Download Audio Only Using youtube-dl +====== + +[youtube-dl][1] is a versatile command line tool for downloading videos from YouTube and many other websites. I use it for making back up of my own YouTube videos. + +By default, you [use youtube-dl for downloading videos][2]. How about extracting only the audio with youtubde-dl? That’s very simple actually. Let me show you the steps. + +Attention + +Downloading videos from websites could be against their policies. It’s up to you if you choose to download videos or audio. + +### Download only audio with youtube-dl + +Please make sure that you have installed youtube-dl on your Linux distribution first. + +``` +sudo snap install youtube-dl +``` + +If you only want to download audio from a YouTube video, you can use the -x option with youtube-dl. This extract-audio option converts the video files to audio-only files. + +``` +youtube-dl -x video_URL +``` + +The file is saved in the same directory from where you ran the youtube-dl command. + +Here’s an example where I downloaded the voice-over of our Zorin OS 16 review video. + +``` +youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ +[youtube] m_PmLG7HqbQ: Downloading webpage +[download] Destination: Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a +[download] 100% of 4.26MiB in 00:03 +[ffmpeg] Correcting container in "Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a" +[ffmpeg] Post-process file Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a exists, skipping +``` + +Did you notice the audio format? It is in .m4a format. You may specify the audio format to something of your choice. + +Say you want to extract the audio in MP3 format. You can use it like this: + +``` +youtube-dl -x --audio-format mp3 video_URL +``` + +Here’s the same example I showed previously. You can see that it [uses ffmpeg to convert][3] the m4a file into mp3. + +``` +youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=m_PmLG7HqbQ +[youtube] m_PmLG7HqbQ: Downloading webpage +[download] Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a has already been downloaded +[download] 100% of 4.26MiB +[ffmpeg] Correcting container in "Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a" +[ffmpeg] Destination: Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.mp3 +Deleting original file Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a (pass -k to keep) +``` + +### Download entire YouTube playlist in MP3 format + +Yes, you can totally do that. The main thing is to get the URL of the playlist here. It is typically in the following format: + +``` +https://www.youtube.com/playlist?list=XXXXXXXXXXXXXXXXXXX +``` + +To get the URL of a playlist, click on its name when the playlist is being displayed in the right sidebar. + +![Click on the playlist title][4] + +It will take you to the playlist page and you can copy the URL here. + +![Grab the playlist URL][5] + +Now that you have the playlist URL, you can use it to download the audio files in MP3 format in the following fashion: + +``` +youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" playlist_URL +``` + +That scary looking `-o "%(title)s.%(ext)s"` specifies the output file (with option -o) and instructs it to use the title of the video and the extension (mp3 in this case) for naming the audio files. + +![][6] + +I hope you find this quick tip helpful. Enjoy the audio files :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/youtube-dl-audio-only/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://github.com/ytdl-org/youtube-dl +[2]: https://itsfoss.com/download-youtube-linux/ +[3]: https://itsfoss.com/ffmpeg/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/getting-youtube-playlist-url.png?resize=797%2C366&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/youtube-playlist-url.png?resize=800%2C388&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/downloading-youtube-playlist-audio.png?resize=800%2C559&ssl=1 From 6be07842e3df294ec91ff18b3486a0e13f96d044 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 20 Aug 2021 05:02:49 +0800 Subject: [PATCH 111/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819=20?= =?UTF-8?q?Check=20free=20disk=20space=20in=20Linux=20with=20ncdu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210819 Check free disk space in Linux with ncdu.md --- ...heck free disk space in Linux with ncdu.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/tech/20210819 Check free disk space in Linux with ncdu.md diff --git a/sources/tech/20210819 Check free disk space in Linux with ncdu.md b/sources/tech/20210819 Check free disk space in Linux with ncdu.md new file mode 100644 index 0000000000..1319324bdd --- /dev/null +++ b/sources/tech/20210819 Check free disk space in Linux with ncdu.md @@ -0,0 +1,154 @@ +[#]: subject: "Check free disk space in Linux with ncdu" +[#]: via: "https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Check free disk space in Linux with ncdu +====== +Get an interactive report about disk usage with the ncdu Linux command. +![Check disk usage][1] + +Computer users tend to amass a lot of data over the years, whether it's important personal projects, digital photos, videos, music, or code repositories. While hard drives tend to be pretty big these days, sometimes you have to step back and take stock of what you're actually storing on your drives. The classic Linux commands [` df`][2] and [` du`][3] are quick ways to gain insight about what's on your drive, and they provide a reliable report that's easy to parse and process. That's great for scripting and processing, but the human brain doesn't always respond well to hundreds of lines of raw data. In recognition of this, the `ncdu` command aims to provide an interactive report about the space you're using on your hard drive. + +### Installing ncdu on Linux + +On Linux, you can install `ncdu` from your software repository. For instance, on Fedora or CentOS: + + +``` +`$ sudo dnf install ncdu` +``` + +On BSD, you can use [pkgsrc][4]. + +On macOS, you can install from [MacPorts][5] or [HomeBrew][6]. + +Alternately, you can [compile ncdu from source code][7]. + +### Using ncdu + +The interface of `ncdu` uses the ncurses library, which turns your terminal window into a rudimentary graphical application so you can use the Arrow keys to navigate visual menus. + +![ncdu interface][8] + +CC BY-SA Seth Kenlon + +That's one of the main appeals of `ncdu`, and what sets it apart from the original `du` command. + +To get a complete listing of a directory, launch `ncdu`. It defaults to the current directory. + + +``` +$ ncdu +ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help                                                                   +\--- /home/tux ----------------------------------------------- +   22.1 GiB [##################] /.var                                                                                         +   19.0 GiB [###############   ] /Iso +   10.0 GiB [########          ] /.local +    7.9 GiB [######            ] /.cache +    3.8 GiB [###               ] /Downloads +    3.6 GiB [##                ] /.mail +    2.9 GiB [##                ] /Code +    2.8 GiB [##                ] /Documents +    2.3 GiB [#                 ] /Videos +[...] +``` + +The listing shows the largest directory first (in this example, that's the `~/.var` directory, full of many many flatpaks). + +Using the Arrow keys on your keyboard, you can navigate through the listing to move deeper into a directory so you can gain better insight into what's taking up the most space. + +### Get the size of a specific directory + +You can run `ncdu` on an arbitrary directory by providing the path of a folder when launching it: + + +``` +`$ ncdu ~/chromiumos` +``` + +### Excluding directories + +By default, `ncdu` includes everything it can, including symbolic links and pseudo-filesystems such as procfs and sysfs. `You can` exclude these with the `--exclude-kernfs`. + +You can exclude arbitrary files and directories using the --exclude option, followed by a pattern to match. + + +``` +$ ncdu --exclude ".var" +   19.0 GiB [##################] /Iso                                                                                           +   10.0 GiB [#########         ] /.local +    7.9 GiB [#######           ] /.cache +    3.8 GiB [###               ] /Downloads +[...] +``` + +Alternately, you can list files and directories to exclude in a file, and cite the file using the `--exclude-from` option: + + +``` +$ ncdu --exclude-from myexcludes.txt /home/tux                                                                                     +   10.0 GiB [#########         ] /.local +    7.9 GiB [#######           ] /.cache +    3.8 GiB [###               ] /Downloads +[...] +``` + +### Color scheme + +You can add some color to ncdu with the `--color dark` option. + +![ncdu color scheme][9] + +CC BY-SA Seth Kenlon + +### Including symlinks + +The `ncdu` output treats symlinks literally, meaning that a symlink pointing to a 9 GB file takes up just 40 bytes. + + +``` +$ ncdu ~/Iso +    9.3 GiB [##################]  CentOS-Stream-8-x86_64-20210427-dvd1.iso                                                     +@   0.0   B [                  ]  fake.iso +``` + +You can force ncdu to follow symlinks with the `--follow-symlinks` option: + + +``` +$ ncdu --follow-symlinks ~/Iso +    9.3 GiB [##################]  fake.iso                                                                                     +    9.3 GiB [##################]  CentOS-Stream-8-x86_64-20210427-dvd1.iso +``` + +### Disk usage + +It's not fun to run out of disk space, so monitoring your disk usage is important. The `ncdu` command makes it easy and interactive. Try `ncdu` the next time you're curious about what you've got stored on your PC, or just to explore your filesystem in a new way. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/du-splash.png?itok=nRLlI-5A (Check disk usage) +[2]: https://opensource.com/article/21/7/check-disk-space-linux-df +[3]: https://opensource.com/article/21/7/check-disk-space-linux-du +[4]: https://opensource.com/article/19/11/pkgsrc-netbsd-linux +[5]: https://opensource.com/article/20/11/macports +[6]: https://opensource.com/article/20/6/homebrew-mac +[7]: https://dev.yorhel.nl/ncdu +[8]: https://opensource.com/sites/default/files/ncdu.jpg (ncdu interface) +[9]: https://opensource.com/sites/default/files/ncdu-dark.jpg (ncdu color scheme) From c486ed4ed34321efe7ef6c43d814e69c2b03f021 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 20 Aug 2021 05:03:07 +0800 Subject: [PATCH 112/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819=20?= =?UTF-8?q?Short=20option=20parsing=20using=20getopt=20in=20C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210819 Short option parsing using getopt in C.md --- ... Short option parsing using getopt in C.md | 285 ++++++++++++++++++ 1 file changed, 285 insertions(+) create mode 100644 sources/tech/20210819 Short option parsing using getopt in C.md diff --git a/sources/tech/20210819 Short option parsing using getopt in C.md b/sources/tech/20210819 Short option parsing using getopt in C.md new file mode 100644 index 0000000000..de08ce0f53 --- /dev/null +++ b/sources/tech/20210819 Short option parsing using getopt in C.md @@ -0,0 +1,285 @@ +[#]: subject: "Short option parsing using getopt in C" +[#]: via: "https://opensource.com/article/21/8/short-option-parsing-c" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Short option parsing using getopt in C +====== +Use the command line to make your programs more flexible by allowing +users to tell them what to do. +![Person programming on a laptop on a building][1] + +Writing a C program to process files is easy when you already know what files you'll operate on and what actions to take. If you "hard code" the filename into your program, or if your program is coded to do things only one way, then your program will always know what to do. + +But you can make your program much more flexible if it can respond to the user every time the program runs. Let your user tell your program what files to use or how to do things differently. And for that, you need to read the command line. + +### Reading the command line + +When you write a program in C, you might start with the declaration: + + +``` +`int main()` +``` + +That's the simplest way to start a C program. But if you add these standard parameters in the parentheses, your program can read the options given to it on the command line: + + +``` +`int main(int argc, char **argv)` +``` + +The `argc` variable is the argument count or the number of arguments on the command line. This will always be a number that's at least one. + +The `argv` variable is a double pointer, an array of strings, that contains the arguments from the command line. The first entry in the array, `*argv[0]`, is always the name of the program. The other elements of the `**argv` array contain the rest of the command-line arguments. + +I'll write a simple program to echo back the options given to it on the command line. This is similar to the Linux `echo` command, except it also prints the name of the program. It also prints each command-line option on its own line using the `puts` function: + + +``` +#include <stdio.h> + +int +main(int argc, char **argv) +{ +  int i; + +  [printf][2]("argc=%d\n", argc); /* debugging */ + +  for (i = 0; i < argc; i++) { +    [puts][3](argv[i]); +  } + +  return 0; +} +``` + +Compile this program and run it with some command-line options, and you'll see your command line printed back to you, each item on its own line: + + +``` +$ ./echo this program can read the command line +argc=8 +./echo +this +program +can +read +the +command +line +``` + +This command line sets the program's `argc` to `8`, and the `**argv` array contains eight entries: the name of the program, plus the seven words the user entered. And as always in C programs, the array starts at zero, so the elements are numbered 0, 1, 2, 3, 4, 5, 6, 7. That's why you can process the command line with the `for` loop using the comparison `i < argc`. + +You can use this to write your own versions of the Linux `cat` or `cp` commands. The `cat` command's basic functionality displays the contents of one or more files. Here's a simple version of `cat` that reads the filenames from the command line: + + +``` +#include <stdio.h> + +void +copyfile(FILE *in, FILE *out) +{ +  int ch; + +  while ((ch = [fgetc][4](in)) != EOF) { +    [fputc][5](ch, out); +  } +} + +int +main(int argc, char **argv) +{ +  int i; +  FILE *fileptr; + +  for (i = 1; i < argc; i++) { +    fileptr = [fopen][6](argv[i], "r"); + +    if (fileptr != NULL) { +      copyfile(fileptr, stdout); +      [fclose][7](fileptr); +    } +  } + +  return 0; +} +``` + +This simple version of `cat` reads a list of filenames from the command line and displays the contents of each file to the standard output, one character at a time. For example, if I have one file called `hello.txt` that contains a few lines of text, I can display its contents with my own `cat` command: + + +``` +$ ./cat hello.txt +Hi there! +This is a sample text file. +``` + +Using this sample program as a starting point, you can write your own versions of other Linux commands, such as the `cp` program, by reading only two filenames: one file to read from and another file to write the copy. + +### Reading command-line options + +Reading filenames and other text from the command line is great, but what if you want your program to change its behavior based on the _options_ the user gives it? For example, the Linux `cat` command supports several command-line options, including: + + * `-b` Put line numbers next to non-blank lines + * `-E` Show the ends of lines as `$` + * `-n` ` `Put line numbers next to all lines + * `-s` Suppress printing repeated blank lines + * `-T` Show tabs as `^I` + * `-v` ` `Verbose; show non-printing characters using `^x` and `M-x` notation, except for new lines and tabs + + + +These _single-letter_ options are called _short options_, and they always start with a single hyphen character. You usually see these short options written separately, such as `cat -E -n`, but you can also combine the short options into a single _option string_ such as `cat -En`. + +Fortunately, there's an easy way to read these from the command line. All Linux and Unix systems include a special C library called `getopt`, defined in the `unistd.h` header file. You can use `getopt` in your program to read these short options. + +Unlike other Unix systems, `getopt` on Linux will always ensure your short options appear at the front of your command line. For example, say a user types `cat -E file -n`. The `-E` option is upfront, but the `-n` option is after the filename. But if you use Linux `getopt`, your program will always behave as though the user types `cat -E -n file`. That makes processing a breeze because `getopt` can parse the short options, leaving you a list of filenames on the command line that your program can read using the `**argv` array. + +You use `getopt` like this: + + +``` +       #include <unistd.h> + +       int getopt(int argc, char **argv, char *optstring); +``` + +The option string `optstring` contains a list of the valid option characters. If your program only allows the `-E` and `-n` options, you use "`En"` as your option string. + +You usually use `getopt` in a loop to parse the command line for options. At each `getopt` call, the function returns the next short option it finds on the command line or the value `'?'` for any unrecognized short options. When `getopt` can't find any more short options, it returns `-1` and sets the global variable `optind` to the next element in `**argv` after all the short options. + +Let's look at a simple example. This demo program isn't a full replacement of `cat` with all the options, but it can parse its command line. Every time it finds a valid command-line option, it prints a short message to indicate it was found. In your own programs, you might instead set a variable or take some other action that responds to that command-line option: + + +``` +#include <stdio.h> +#include <unistd.h> + +int +main(int argc, char **argv) +{ +  int i; +  int option; + +  /* parse short options */ + +  while ((option = getopt(argc, argv, "bEnsTv")) != -1) { +    switch (option) { +    case 'b': +      [puts][3]("Put line numbers next to non-blank lines"); +      break; +    case 'E': +      [puts][3]("Show the ends of lines as $"); +      break; +    case 'n': +      [puts][3]("Put line numbers next to all lines"); +      break; +    case 's': +      [puts][3]("Suppress printing repeated blank lines"); +      break; +    case 'T': +      [puts][3]("Show tabs as ^I"); +      break; +    case 'v': +      [puts][3]("Verbose"); +      break; +    default:                          /* '?' */ +      [puts][3]("What's that??"); +    } +  } + +  /* print the rest of the command line */ + +  [puts][3]("------------------------------"); + +  for (i = optind; i < argc; i++) { +    [puts][3](argv[i]); +  } + +  return 0; +} +``` + +If you compile this program as `args`, you can try out different command lines to see how they parse the short options and always leave you with the rest of the command line. In the simplest case, with all the options up front, you get this: + + +``` +$ ./args -b -T file1 file2 +Put line numbers next to non-blank lines +Show tabs as ^I +\------------------------------ +file1 +file2 +``` + +Now try the same command line but combine the two short options into a single option string: + + +``` +$ ./args -bT file1 file2 +Put line numbers next to non-blank lines +Show tabs as ^I +\------------------------------ +file1 +file2 +``` + +If necessary, `getopt` can "reorder" the command line to deal with short options that are out of order: + + +``` +$ ./args -E file1 file2 -T +Show the ends of lines as $ +Show tabs as ^I +\------------------------------ +file1 +file2 +``` + +If your user gives an incorrect short option, `getopt` prints a message: + + +``` +$ ./args -s -an file1 file2 +Suppress printing repeated blank lines +./args: invalid option -- 'a' +What's that?? +Put line numbers next to all lines +\------------------------------ +file1 +file2 +``` + +### Download the cheat sheet + +`getopt` can do lots more than what I've shown. For example, short options can take their own options, such as `-s string` or `-f file`. You can also tell `getopt` to not display error messages when it finds unrecognized options. Read the `getopt(3)` manual page using `man 3 getopt` to learn more about what `getopt` can do for you. + +If you're looking for gentle reminders on the syntax and structure of `getopt()` and `getopt_long()`, [download my getopt cheat sheet][8]. One page demonstrates short options, and the other side demonstrates long options with minimum viable code and a listing of the global variables you need to know. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/short-option-parsing-c + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_code_programming_laptop.jpg?itok=ormv35tV (Person programming on a laptop on a building) +[2]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[3]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/fputc.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html +[8]: https://opensource.com/downloads/c-getopt-cheat-sheet From b5dd248c5d89c41c27f607793f5fe206ef7d16bd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 20 Aug 2021 05:03:24 +0800 Subject: [PATCH 113/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819=20?= =?UTF-8?q?A=20guide=20to=20understanding=20your=20team's=20implicit=20val?= =?UTF-8?q?ues=20and=20needs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210819 A guide to understanding your team-s implicit values and needs.md --- ...g your team-s implicit values and needs.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20210819 A guide to understanding your team-s implicit values and needs.md diff --git a/sources/tech/20210819 A guide to understanding your team-s implicit values and needs.md b/sources/tech/20210819 A guide to understanding your team-s implicit values and needs.md new file mode 100644 index 0000000000..3ac22f86fd --- /dev/null +++ b/sources/tech/20210819 A guide to understanding your team-s implicit values and needs.md @@ -0,0 +1,71 @@ +[#]: subject: "A guide to understanding your team's implicit values and needs" +[#]: via: "https://opensource.com/open-organization/21/8/leadership-cultural-social-norms" +[#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to understanding your team's implicit values and needs +====== +To enhance team dynamics, open leaders can study the implicit social +norms that guide members' behaviors and decisions. +![Working meetings can be effective meetings][1] + +Culture matters in [open organizations][2]. But "culture" seems like such a large, complicated concept to address. How can we help open organization teams better understand it? + +One solution might come from [Michele J. Gelfand][3], author of [_Rule Makers, Rule Breakers_][4]_: Tight and Loose Cultures and the Secret Signals That Direct Our Lives_. Gelfand organizes all countries and cultures into two very simple groups: those with "tight" cultures and those with "loose" ones. Then she explains the characteristics and social norms of both, offering their relative strengths and weaknesses. By studying both, one might overcome the divisions and conflicts that separate people in and across teams, organizations, and countries. + +In this two-part review of _Rule Makers, Rule Breakers_, I'll explain Gelfand's argument and discuss the ways it's useful to people working in open organizations. + +### Know your social norms + +Gelfand believes that our behavior is very strongly dependent on whether we live in a "tight" or "loose" community culture, because each of these cultures has social norms that differ from the other. These norms—and the strictness with which they are enforced—will determine our behavior in the community. They give us our identity. They help us coordinate with each other. In short, they're the glue that holds communities together. + +They also impact our worldviews, the ways we build our environments, and even the processing in our brains. "Countless studies have shown that social norms are critical for uniting communities into cooperative, well-coordinated groups that can accomplish great feats," Gelfand writes. Throughout history, communities have put their citizens through the seemingly craziest of rituals for no other reason than to maintain group cohesion and cooperation. The rituals result in greater bonding, which has kept people alive (particularly in times of hunting, foraging, and warfare). + +Social norms include rules we all tend to follow automatically, what Gelfand calls a kind of "normative autopilot." These are things we do without thinking about them—for example, being quiet in libraries, cinemas, elevators, or airplanes. We do these things automatically. "From the outside," Gelfand says, "our social norms often seem bizarre, but from the inside, we take them for granted." She explains that social norms can be codified into regulations and laws ("obey stop signs" and "don't steal"). Others are largely unspoken ("don't stare at people on the train" or "cover your mouth when you sneeze"). And, of course, they vary by context. + +The challenge is that most social norms are invisible, and we don't know how much these social norms control us. + +The challenge is that most social norms are invisible, and we don't know how much these social norms control us. Without knowing it, we often just follow the groups in our surroundings. This is called "groupthink," in which people will follow along with their identifying group, even if the group is wrong. They don't want to stand out. + +### Organizations, tight and loose + +Gelfand organizes social norms into various groupings. She argues that some norms are characteristic of "tight" cultures, while others are characteristic of "loose" cultures. To do this, Gelfand researched and sampled approximately seven thousand people from more than 30 countries across five continents and with a wide range of occupations, genders, ages, religions, sects, and social classes in order to learn where those communities positioned themselves (and how strongly their social norms were enforced officially and by the communities/neighborhoods in general). Differences between tight and loose cultures vary between nations, within countries (like within the United States and its various regions), within organizations, within social classes and even within households. + +Because organizations have cultures, they too have their own social norms (after all, if an organization is unable to coordinate its members and influence their behavior, it won't be able to survive). So organizations can also reflect and instill the "light" or "loose" cultural characteristics Gelfand describes. And if we have a strong ability to identify these differences, we can predict and address conflict more successfully. Then, armed with greater awareness of those social norms, we can put open organization principles to work. + +Gelfand describes the difference between tight and loose cultures this way: + +> Broadly speaking, loose cultures tend to be open, but they're also much more disorderly. On the flip side, tight cultures have a comforting order and predictability, but they're less tolerant. This is the tight-loose trade-off: advantages in one realm coexist with drawbacks in another. + +Tight societies, she concludes, maintain strict social order, synchrony and self-regulation; loose societies take pride in being highly tolerant, creative and open to change. + +Although not true in every case, tight and loose cultures generally exhibit some trade-offs; each has its own strengths and weaknesses. See Figure 1 below. + +![][5] + +The work of successfully applying the five open organization principles in these two environments can vary greatly. To be successful, community commitment is vital, and if the social norms are different, the reasons for commitment would be different as well. Organizational leaders must know what the community's values are. Only then can that person adequately inspire others. + +In the next part of this review, I'll explain more thoroughly the characteristics of tight and loose cultures, so leaders can get a better sense of how they can put open organization principles to work on their teams. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/8/leadership-cultural-social-norms + +作者:[Ron McFarland][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/ron-mcfarland +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/leader-team-laptops-conference-meeting.png?itok=ztoA0E6f (Working meetings can be effective meetings) +[2]: https://theopenorganization.org/definition/ +[3]: https://www.michelegelfand.com/ +[4]: https://www.michelegelfand.com/rule-makers-rule-breakers +[5]: https://opensource.com/sites/default/files/images/open-org/rule-makers-breakers-1.png From 320fd24f26d1a01ee02a3929bf1e08dc97cdbfc4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 20 Aug 2021 05:04:02 +0800 Subject: [PATCH 114/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819=20?= =?UTF-8?q?Zorin=20OS=2016=20Released=20with=20Stunning=20New=20Look=20and?= =?UTF-8?q?=20Array=20of=20Updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ... Stunning New Look and Array of Updates.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md diff --git a/sources/tech/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/sources/tech/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md new file mode 100644 index 0000000000..5802949257 --- /dev/null +++ b/sources/tech/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -0,0 +1,115 @@ +[#]: subject: "Zorin OS 16 Released with Stunning New Look and Array of Updates" +[#]: via: "https://www.debugpoint.com/2021/08/zorin-os-16-release-announcement/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Zorin OS 16 Released with Stunning New Look and Array of Updates +====== +The team announced the release of brand new Zorin OS 16, bringing some +much-needed improvements and updates. We round up the release in this +post.Linux Kernel 5.11Flathub repo by defaultTaskbarperformancenew +appsmulti-touch touchpad gesturesfractional scaling +![Zorin OS 16 Desktop][1] + +The open-source and eye-candy Linux distribution Zorin OS brings its latest stable release version 16 which will be supported with updates and enhancements until 2025. This release brings some unique but useful features, while the team made sure that there is no performance drops. + +Zorin OS uses its own software repository and also uses Ubuntu repo as well. + +Let’s take a look at the important new features. + +### Zorin OS 16 – New Features + +The latest Zorin OS 16 is powered by (hwe stack). This release is based on **Ubuntu 20.04 LTS**. + +The major update in this release is inclusion of in Zorin. With this, Zorin Software Store becomes one of the largest collection of applications available in Linux distribution. Because it can now support Flathub plus earlier supports of Snap Store, Ubuntu repo, Zorin own repo and AppImage support. + +Zorin is known for its looks, mostly. In this release, a handful of improvements arrives. Here’s a quick summary: + + * The default theme is more polished with updated icons and color palette. + * New Artwork and wallpapers are pre-loaded. + * The Lock screen can now show a blurred version of your selected wallpaper, giving you a clean look. + + + +icons are enabled active indicator with notification banner with counts. That means, you can get unread message counts, etc. in taskbar icons for example for messaging apps. Taskbar also received a bunch of standard features such as auto hide, transparency, moving icons around, etc. + +![New Taskbar Notification Bubbles][2] + +Many internal improvement received in this release. The details are not available, however as per the team overall desktop experience in all Zorin flavors is much improved from its predecessor [Zorin 15][3]. + +Two introduces in this release. A Tour app which give you a quick walkthrough of Zorin desktop after first installation. And a new sound recorder app is also introduced. + +If you’re using a laptop, moving between your apps and workspaces is even quicker and easier. Zorin OS 16 introduces , enabled out of the box. Now you can switch between workspaces with fluid 1:1 motion by swiping 4 fingers up or down. Pinch on the touchpad with 3 fingers to open the activities overview and instantly see every app running on your workspaces. + +[][3] + +SEE ALSO:   Zorin OS 15.3 Released with Latest LibreOffice, New Software + +Zorin OS 16 is now supports for high resolution displays + +The installer now includes the NVIDIA drivers which can be selected in the first LIVE disk boot prompt, and the installer now supports encryption. + +A full details of the change is available [here][4]. + +### Zorin OS 16 Minimum System Requirement + +#### Zorin OS Core, Education and Pro + + * CPU – 1 GHz Dual Core – Intel/AMD 64-bit processor + * RAM – 2 GB + * Storage – 15 GB (Core & Education) or 30 GB (Pro) + * Display – 800 × 600 resolution + + + +#### Zorin OS LITE + + * CPU – 700 MHz Single Core – Intel/AMD 64-bit or 32-bit processor + * RAM – 512 MB + * Storage – 10 GB + * Display – 640 × 480 resolution + + + +### Download Zorin OS 16 + +It is worth to mention that Zorin comes with a PRO version which is around $39 with additional features such as Windows 11 style look, etc. However, you can always download the free versions – they are Zorin OS 16 Core and Zorin OS 16 LITE (for low- end hardware). You might want to take a look at their feature [comparison][5]. + +You can download the latest .iso from the below link. Likewise, you can either use [Etcher][6] or any other utility to create a LIVE USB for installation. + +[download zorin os 16][7] + +#### Upgrade from Zorin 15.x + +There is no upgrade path available at the moment from Zorin OS 15. However, as per the team, an upgrade path will be available soon when Zorin 15 users can easily upgrade to the latest version. + +### Closing Notes + +One of the best feature of Zorin is its unique way of handling App ecosystem. It is probably the only Linux desktop distribution which provides out-of-the-box experience to search and install apps from Flathub, Snap Store, AppImage, Ubuntu/Own repo via its Software Store. You do not require to manually configure your system for Snap or Flatpak. That said, It’s still a modified GNOME with additional items. Some may not prefer Zorin and may feel bloated with all these features pre-loaded. In that sense, it is one of the ideal distro for new Linux desktop users who need a ready-made Windows/macOS like feel with all the Linux features. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/zorin-os-16-release-announcement/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Zorin-OS-16-Desktop-1024x576.jpg +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/New-Taskbar-Notification-Bubbles.png +[3]: https://www.debugpoint.com/2020/09/zorin-os-15-3-release/ +[4]: https://blog.zorin.com/2021/08/17/2021-08-17-zorin-os-16-is-released/ +[5]: https://zorin.com/os/pro/#compare +[6]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ +[7]: https://zorin.com/os/download/ From 56c4d9bed211ad7c56fcf30dc7014fa26357c71c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 20 Aug 2021 05:04:19 +0800 Subject: [PATCH 115/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210819=20?= =?UTF-8?q?KaOS=202021.08=20Release=20Focuses=20on=20Visual=20Changes=20an?= =?UTF-8?q?d=20Package=20Updates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210819 KaOS 2021.08 Release Focuses on Visual Changes and Package Updates.md --- ...s on Visual Changes and Package Updates.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/news/20210819 KaOS 2021.08 Release Focuses on Visual Changes and Package Updates.md diff --git a/sources/news/20210819 KaOS 2021.08 Release Focuses on Visual Changes and Package Updates.md b/sources/news/20210819 KaOS 2021.08 Release Focuses on Visual Changes and Package Updates.md new file mode 100644 index 0000000000..2a83d1dec4 --- /dev/null +++ b/sources/news/20210819 KaOS 2021.08 Release Focuses on Visual Changes and Package Updates.md @@ -0,0 +1,96 @@ +[#]: subject: "KaOS 2021.08 Release Focuses on Visual Changes and Package Updates" +[#]: via: "https://news.itsfoss.com/kaos-2021-08-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +KaOS 2021.08 Release Focuses on Visual Changes and Package Updates +====== + +The built-from-scratch Linux distribution KaOS — which uses KDE, Qt, and [pacman][1] as a package manager, has finally received its fifth update this year. This article will highlight the significant changes that have been brought to the distribution. + +Let us get to know about what this new release brings! + +### Desktop Environment Update + +![][2] + +The new Application Launcher, introduced in Plasma 5.22, is now the new home for accessing apps while the traditional cascading app menu is abandoned. + +The default Midna theme has been given a slightly different look, which can be easily noticed from the boot-up to the logout screen. This includes a darker look for the logout screen, combined with a transparent sidebar for the lockscreen and SDDM, and a minimal look for the splash screen. The icon themes have also been customized accordingly for both the light and dark versions of the theme. + +The desktop environment is now based on Plasma 5.22.4 and the latest Frameworks 5.85.0; both are built on Qt 5.15.2+. + +### Application Updates + +#### KDE Apps + +This update brings the latest KDE Gear 21.08. This includes animated previews of folders and an easy method of renaming folders using F2 and TAB in Dolphin file manager, color and image previews, along with an SSH plugin in Konsole. And, a keyframeable effect for altering the speed of clips in Kdenlive, and a party mode in Elisa. + +Plasma mobile apps are now available on KaOS and are promised to be suitable for desktop use. These apps include Angelfish — web browser, Koko – image viewer, Kalk – calculator, and  Kasts – podcasts. + +#### System Apps + +Some Calligra users may be disappointed to learn that LibreOffice is now the default office application. Moreover, other applications like bibletime, speedtest-CLI, and mauikit-accounts have also been added. + +### Calamares installer + +Calamares is now built on QML modules designed specifically for KaOS. This gives it an even and modern look with other apps. This also includes an all-new Users and Summary page. + +![Calamares Summary Page][3] + +You can now select your preferred file system while opting for automated partitioning. + +A handy feature allows the transfer of network settings from the Live system to the newly installed system. Thus, you don’t need to connect your PC to your Wi-Fi again. + +### Other Package Updates + +Several other systems packages have been updated. This should improve the overall compatibility and stability as well. Some package updates include: + + * Systemd 249.3  + * Curl 7.78.0 + * NetworkManager 1.32.8  + * Mesa 21.1.7 + * Vulkan packages 1.2.187 + * Udisks 2.9.3, MLT 7.0.1  + * Openexr 3.1.1 + + + +Do note that this release does not support installation in systems with RAID set up as of now. + +To explore more about the changes, you can refer to the [official announcement][4]. + +With this release, KaOS is focused on giving KDE users a streamlined experience. In addition, the installation has been made easier, and power users can definitely make use of the new apps. + +[Download KaOS 2021.08][5] + +What do you think about the latest KaOS release? Is it turning out to be a promising Linux distribution? Let me know your thoughts in the comments below. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kaos-2021-08-release/ + +作者:[Rishabh Moharir][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/rishabh/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/pacman-command/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://kaosx.us/news/2021/kaos08/ +[5]: https://kaosx.us/pages/download/ From 4a4f2dd6902ea301a087219e70193654ba214223 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 20 Aug 2021 08:43:23 +0800 Subject: [PATCH 116/290] translated --- ... system in your terminal with procps-ng.md | 198 ------------------ ... system in your terminal with procps-ng.md | 196 +++++++++++++++++ 2 files changed, 196 insertions(+), 198 deletions(-) delete mode 100644 sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md create mode 100644 translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md diff --git a/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md b/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md deleted file mode 100644 index d2a78f9192..0000000000 --- a/sources/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md +++ /dev/null @@ -1,198 +0,0 @@ -[#]: subject: "Monitor your Linux system in your terminal with procps-ng" -[#]: via: "https://opensource.com/article/21/8/linux-procps-ng" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Monitor your Linux system in your terminal with procps-ng -====== -How to find the process ID (PID) of a program. The most common Linux -tools for this are provided by the procps-ng package, including the ps -and pstree, pidof, and pgrep commands. -![System monitor][1] - -A process, in [POSIX][2] terminology, is an ongoing event being managed by an operating system’s kernel. A process is spawned when you launch an application, although there are many other processes running in the background of your computer, including programs to keep your system time accurate, to monitor for new filesystems, to index files, and so on. - -Most operating systems have a system activity monitor of some kind so you can learn what processes are running at any give moment. Linux has a few for you to choose from, including GNOME System Monitor and KSysGuard. Both are useful applications on the desktop, but Linux also provides the ability to monitor your system in your terminal. Regardless of which you choose, it’s a common task for those who take an active role in managing their computer is to examine a specific process. - -In this article, I demonstrate how to find the process ID (PID) of a program. The most common tools for this are provided by the [procps-ng][3] package, including the `ps` and `pstree`, `pidof`, and `pgrep` commands. - -### Find the PID of a running program - -Sometimes you want to get the process ID (PID) of a specific application you know you have running. The `pidof` and `pgrep` commands find processes by command name. - -The `pidof` command returns the PIDs of a command, searching for the exact command by name: - - -``` -$ pidof bash -1776 5736 -``` - -The `pgrep` command allows for regular expressions (regex): - - -``` -$ pgrep .sh -1605 -1679 -1688 -1776 -2333 -5736 -$ pgrep bash -5736 -``` - -### Find a PID by file - -You can find the PID of the process using a specific file with the `fuser` command. - - -``` -$ fuser --user ~/example.txt                     -/home/tux/example.txt:  3234(tux) -``` - -### Get a process name by PID - -If you have the PID _number_ of a process but not the command that spawned it, you can do a "reverse lookup" with `ps`: - - -``` -$ ps 3234 - PID TTY      STAT   TIME COMMAND -5736 pts/1    Ss     0:00 emacs -``` - -### List all processes - -The `ps` command lists processes. You can list every process on your system with the `-e` option: - - -``` -$ ps -e | less -PID TTY          TIME CMD -  1 ?        00:00:03 systemd -  2 ?        00:00:00 kthreadd -  3 ?        00:00:00 rcu_gp -  4 ?        00:00:00 rcu_par_gp -  6 ?        00:00:00 kworker/0:0H-events_highpri -[...] -5648 ?        00:00:00 gnome-control-c -5656 ?        00:00:00 gnome-terminal- -5736 pts/1    00:00:00 bash -5791 pts/1    00:00:00 ps -5792 pts/1    00:00:00 less -(END) -``` - -### List just your processes - -The output of `ps -e` can be overwhelming, so use `-U` to see the processes of just one user: - - -``` -$ ps -U tux | less - PID TTY          TIME CMD -3545 ?        00:00:00 systemd -3548 ?        00:00:00 (sd-pam) -3566 ?        00:00:18 pulseaudio -3570 ?        00:00:00 gnome-keyring-d -3583 ?        00:00:00 dbus-daemon -3589 tty2     00:00:00 gdm-wayland-ses -3592 tty2     00:00:00 gnome-session-b -3613 ?        00:00:00 gvfsd -3618 ?        00:00:00 gvfsd-fuse -3665 tty2     00:01:03 gnome-shell -[...] -``` - -That produces 200 fewer (give or take a hundred, depending on the system you're running it on) processes to sort through. - -You can view the same output in a different format with the `pstree` command: - - -``` -$ pstree -U tux -u --show-pids -[...] -├─gvfsd-metadata(3921)─┬─{gvfsd-metadata}(3923) -│                      └─{gvfsd-metadata}(3924) -├─ibus-portal(3836)─┬─{ibus-portal}(3840) -│                   └─{ibus-portal}(3842) -├─obexd(5214) -├─pulseaudio(3566)─┬─{pulseaudio}(3640) -│                  ├─{pulseaudio}(3649) -│                  └─{pulseaudio}(5258) -├─tracker-store(4150)─┬─{tracker-store}(4153) -│                     ├─{tracker-store}(4154) -│                     ├─{tracker-store}(4157) -│                     └─{tracker-store}(4178) -└─xdg-permission-(3847)─┬─{xdg-permission-}(3848) -                        └─{xdg-permission-}(3850) -``` - -### List just your processes with context - -You can see extra context for all of the processes you own with the `-u` option. - - -``` -$ ps -U tux -u -USER  PID %CPU %MEM    VSZ   RSS TTY STAT START  TIME COMMAND -tux  3545  0.0  0.0  89656  9708 ?   Ss   13:59  0:00 /usr/lib/systemd/systemd --user -tux  3548  0.0  0.0 171416  5288 ?   S    13:59  0:00 (sd-pam) -tux  3566  0.9  0.1 1722212 17352 ?  S<sl 13:59  0:29 /usr/bin/pulseaudio [...] -tux  3570  0.0  0.0 664736  8036 ?   SLl  13:59  0:00 /usr/bin/gnome-keyring-daemon [...] -[...] -tux  5736  0.0  0.0 235628  6036 pts/1 Ss 14:18  0:00 bash -tux  6227  0.0  0.4 2816872 74512 tty2 Sl+14:30  0:00 /opt/firefox/firefox-bin [...] -tux  6660  0.0  0.0 268524  3996 pts/1 R+ 14:50  0:00 ps -U tux -u -tux  6661  0.0  0.0 219468  2460 pts/1 S+ 14:50  0:00 less -``` - -### Troubleshoot with PIDs - -If you’re having trouble with a specific application, or you’re just curious about what else on your system an application uses, you can see a memory map of the running process with `pmap`: - - -``` -$ pmap 1776 -5736:   bash -000055f9060ec000   1056K r-x-- bash -000055f9063f3000     16K r---- bash -000055f906400000     40K rw---   [ anon ] -00007faf0fa67000   9040K r--s- passwd -00007faf1033b000     40K r-x-- libnss_sss.so.2 -00007faf10345000   2044K ----- libnss_sss.so.2 -00007faf10545000      4K rw--- libnss_sss.so.2 -00007faf10546000 212692K r---- locale-archive -00007faf1d4fb000   1776K r-x-- libc-2.28.so -00007faf1d6b7000   2044K ----- libc-2.28.so -00007faf1d8ba000      8K rw--- libc-2.28.so -[...] -``` - -### Process IDs - -The **procps-ng** package has all the commands you need to investigate and monitor what your system is using at any moment. Whether you’re just curious about how all the disparate parts of a Linux system fit together, or whether you’re investigating an error, or you’re looking to optimize how your computer is performing, learning these commands gives you a significant advantage for understanding your OS. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/linux-procps-ng - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/system-monitor-splash.png?itok=0UqsjuBQ (System monitor) -[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[3]: https://gitlab.com/procps-ng diff --git a/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md b/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md new file mode 100644 index 0000000000..d7433501be --- /dev/null +++ b/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md @@ -0,0 +1,196 @@ +[#]: subject: "Monitor your Linux system in your terminal with procps-ng" +[#]: via: "https://opensource.com/article/21/8/linux-procps-ng" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 procps-ng 在终端监控你的 Linux 系统 +====== +如何找到一个程序的进程 ID(PID)。最常见的 Linux 工具是由 procps-ng 包提供的,包括 ps、pstree、pidof 和 pgrep 命令。 +![System monitor][1] + +在[POSIX][2]术语中,进程是一个正在进行的事件,由操作系统的内核管理。当你启动一个应用时就会产生一个进程,尽管还有许多其他的进程在你的计算机后台运行,包括保持系统时间准确的程序,监测新的文件系统,索引文件,等等。 + +大多数操作系统都有某种类型的系统活动监视器,因此你可以了解在任何特定时刻有哪些进程在运行。Linux 有一些供你选择,包括 GNOME 系统监视器和 KSysGuard。这两个软件在桌面上都很有用,但 Linux 也提供了在终端监控系统的能力。不管你选择哪一种,对于那些积极管理自己电脑的人来说,检查一个特定的进程是一项常见的任务。 + +在这篇文章中,我演示了如何找到一个程序的进程 ID(PID)。最常见的工具是由 [procps-ng][3] 包提供的,包括 `ps`、`pstree`、`pidof` 和 `pgrep` 命令。 + +### 查找一个正在运行的程序的 PID + +有时你想得到一个你知道正在运行的特定程序的进程 ID(PID)。`pidof` 和 `pgrep` 命令通过命令名称查找进程。 + +`pidof` 命令返回一个命令的 PID,按名称搜索确切的命令: + + +``` +$ pidof bash +1776 5736 +``` + +`pgrep` 命令允许使用正则表达式(regex): + + +``` +$ pgrep .sh +1605 +1679 +1688 +1776 +2333 +5736 +$ pgrep bash +5736 +``` + +### 通过文件查找 PID + +你可以用 `fuser` 命令找到使用特定文件的进程的 PID。 + + +``` +$ fuser --user ~/example.txt +/home/tux/example.txt: 3234(tux) +``` + +### 通过 PID 获得进程名称 + +如果你有一个进程的 PID _编号_,但没有生成它的命令,你可以用 `ps` 做一个“反向查找”: + + +``` +$ ps 3234 +PID TTY STAT TIME COMMAND +5736 pts/1 Ss 0:00 emacs +``` + +### 列出所有进程 + +`ps` 命令列出进程。你可以用 `-e` 选项列出你系统上的每一个进程: + + +``` +$ ps -e | less +PID TTY TIME CMD + 1 ? 00:00:03 systemd + 2 ? 00:00:00 kthreadd + 3 ? 00:00:00 rcu_gp + 4 ? 00:00:00 rcu_par_gp + 6 ? 00:00:00 kworker/0:0H-events_highpri +[...] +5648 ? 00:00:00 gnome-control-c +5656 ? 00:00:00 gnome-terminal- +5736 pts/1 00:00:00 bash +5791 pts/1 00:00:00 ps +5792 pts/1 00:00:00 less +(END) +``` + +### 只列出你的进程 + +`ps -e` 的输出可能会让人不知所措,所以使用 `-U` 来查看一个用户的进程: + + +``` +$ ps -U tux | less +PID TTY TIME CMD +3545 ? 00:00:00 systemd +3548 ? 00:00:00 (sd-pam) +3566 ? 00:00:18 pulseaudio +3570 ? 00:00:00 gnome-keyring-d +3583 ? 00:00:00 dbus-daemon +3589 tty2 00:00:00 gdm-wayland-ses +3592 tty2 00:00:00 gnome-session-b +3613 ? 00:00:00 gvfsd +3618 ? 00:00:00 gvfsd-fuse +3665 tty2 00:01:03 gnome-shell +[...] +``` + +这样就减少了 200 个(可能是 100 个,取决于你运行的系统)需要分类的进程。 + +你可以用 `pstree` 命令以不同的格式查看同样的输出: + + +``` +$ pstree -U tux -u --show-pids +[...] +├─gvfsd-metadata(3921)─┬─{gvfsd-metadata}(3923) +│ └─{gvfsd-metadata}(3924) +├─ibus-portal(3836)─┬─{ibus-portal}(3840) +│ └─{ibus-portal}(3842) +├─obexd(5214) +├─pulseaudio(3566)─┬─{pulseaudio}(3640) +│ ├─{pulseaudio}(3649) +│ └─{pulseaudio}(5258) +├─tracker-store(4150)─┬─{tracker-store}(4153) +│ ├─{tracker-store}(4154) +│ ├─{tracker-store}(4157) +│ └─{tracker-store}(4178) +└─xdg-permission-(3847)─┬─{xdg-permission-}(3848) + └─{xdg-permission-}(3850) +``` + +### 列出进程的上下文 + +你可以用 `-u` 选项查看你拥有的所有进程的额外上下文。 + + +``` +$ ps -U tux -u +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +tux 3545 0.0 0.0 89656 9708 ? Ss 13:59 0:00 /usr/lib/systemd/systemd --user +tux 3548 0.0 0.0 171416 5288 ? S 13:59 0:00 (sd-pam) +tux 3566 0.9 0.1 1722212 17352 ? S<sl 13:59 0:29 /usr/bin/pulseaudio [...] +tux 3570 0.0 0.0 664736 8036 ? SLl 13:59 0:00 /usr/bin/gnome-keyring-daemon [...] +[...] +tux 5736 0.0 0.0 235628 6036 pts/1 Ss 14:18 0:00 bash +tux 6227 0.0 0.4 2816872 74512 tty2 Sl+14:30 0:00 /opt/firefox/firefox-bin [...] +tux 6660 0.0 0.0 268524 3996 pts/1 R+ 14:50 0:00 ps -U tux -u +tux 6661 0.0 0.0 219468 2460 pts/1 S+ 14:50 0:00 less +``` + +### 用 PID 排除故障 + +如果你在某个特定的程序上有问题,或者你只是好奇某个程序在你的系统上还使用了什么,你可以用 `pmap` 查看运行中的进程的内存图。 + + +``` +$ pmap 1776 +5736: bash +000055f9060ec000 1056K r-x-- bash +000055f9063f3000 16K r---- bash +000055f906400000 40K rw--- [ anon ] +00007faf0fa67000 9040K r--s- passwd +00007faf1033b000 40K r-x-- libnss_sss.so.2 +00007faf10345000 2044K ----- libnss_sss.so.2 +00007faf10545000 4K rw--- libnss_sss.so.2 +00007faf10546000 212692K r---- locale-archive +00007faf1d4fb000 1776K r-x-- libc-2.28.so +00007faf1d6b7000 2044K ----- libc-2.28.so +00007faf1d8ba000 8K rw--- libc-2.28.so +[...] +``` + +### 处理进程 ID + +**procps-ng** 软件包有你需要的所有命令,以调查和监控你的系统在任何时候的使用情况。无论你是对 Linux 系统中所有分散的部分如何结合在一起感到好奇,还是对一个错误进行调查,或者你想优化你的计算机的性能,学习这些命令都会为你了解你的操作系统提供一个重要的优势。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-procps-ng + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/system-monitor-splash.png?itok=0UqsjuBQ (System monitor) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: https://gitlab.com/procps-ng From 646fd6af965e87daae40591fad4697e00680431f Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 20 Aug 2021 08:45:52 +0800 Subject: [PATCH 117/290] translating --- sources/tech/20210818 Build a JAR file with fastjar and gjar.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210818 Build a JAR file with fastjar and gjar.md b/sources/tech/20210818 Build a JAR file with fastjar and gjar.md index 6ec8e64ee7..98d6fe7578 100644 --- a/sources/tech/20210818 Build a JAR file with fastjar and gjar.md +++ b/sources/tech/20210818 Build a JAR file with fastjar and gjar.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/fastjar" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 7ed4d93b39ef15704875117c26a1c8c8470a604e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 20 Aug 2021 11:45:39 +0800 Subject: [PATCH 118/290] Rename sources/tech/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md to sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ... OS 16 Released with Stunning New Look and Array of Updates.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md (100%) diff --git a/sources/tech/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md similarity index 100% rename from sources/tech/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md rename to sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md From a03288d9e48225383593ff789bdd99455d0a43ab Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 20 Aug 2021 11:54:05 +0800 Subject: [PATCH 119/290] Rename sources/tech/20210819 A guide to understanding your team-s implicit values and needs.md to sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md --- ...uide to understanding your team-s implicit values and needs.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210819 A guide to understanding your team-s implicit values and needs.md (100%) diff --git a/sources/tech/20210819 A guide to understanding your team-s implicit values and needs.md b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md similarity index 100% rename from sources/tech/20210819 A guide to understanding your team-s implicit values and needs.md rename to sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md From 2443cc5dfd1dd85b5a8b6d271d0f6d691d46c4e9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 20 Aug 2021 12:35:14 +0800 Subject: [PATCH 120/290] PRF @perfiffer --- ...210804 Install OpenVPN on your Linux PC.md | 56 +++++++++---------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/translated/tech/20210804 Install OpenVPN on your Linux PC.md b/translated/tech/20210804 Install OpenVPN on your Linux PC.md index 272028f609..5ad120675f 100644 --- a/translated/tech/20210804 Install OpenVPN on your Linux PC.md +++ b/translated/tech/20210804 Install OpenVPN on your Linux PC.md @@ -3,24 +3,26 @@ [#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -在你的个人 Linux 电脑上安装 `0penVPN` +如何在免费 WiFi 中保护隐私(二) ====== -安装完 “虚拟专用网络” 服务器,下一步就是安装和配置 0penVPN。 -![Open ethernet cords.][1] -0penVPN 在两点之间创建一个加密通道,阻止第三方访问你的网络流量数据。通过设置你的 “虚拟专用网络” 服务,你可以成为你自己的 “虚拟专用网络” 服务商。许多流行的 “虚拟专用网络” 服务都使用 0penVPN,所以当你可以掌控自己的网络时,为什么还要将你的网络连接绑定到特定的提供商呢? +> 安装完服务器之后,下一步就是安装和配置 0penVPN。 -本系列的[第一篇文章](https://linux.cn/article-13680-1.html)展示了如何安装和配置一台 Linux 电脑作为你的 0penVPN 服务器。同时也讲述了如何配置你的路由器以便你可以在外部网络连接到你的 VPN 服务器。 +![](https://img.linux.net.cn/data/attachment/album/202108/20/123417yn554549p92ujt54.jpg) + +0penVPN 在两点之间创建一个加密通道,阻止第三方访问你的网络流量数据。通过设置你的 “虚拟专用网络” 服务,你可以成为你自己的 “虚拟专用网络” 服务商。许多流行的 “虚拟专用网络” 服务都使用 [0penVPN][2],所以当你可以掌控自己的网络时,为什么还要将你的网络连接绑定到特定的提供商呢? + +本系列的 [第一篇文章][3] 展示了如何安装和配置一台作为你的 0penVPN 服务器的 Linux 计算机。同时也讲述了如何配置你的路由器以便你可以在外部网络连接到你的服务器。 第二篇文章将演示根据 [0penVPN wiki][4] 给定的步骤安装一个 0penVPN 服务软件。 ### 安装 0penVPN -首先,使用包管理器安装 0penVPN 和 `easy-rsa` 应用程序(帮助你在服务器上设置身份验证)。本例使用的是Fedora Linux,如果你选择了不同的发行版,请选用合适的命令。 +首先,使用包管理器安装 0penVPN 和 `easy-rsa` 应用程序(帮助你在服务器上设置身份验证)。本例使用的是 Fedora Linux,如果你选择了不同的发行版,请选用合适的命令。 ``` $ sudo dnf install openvpn easy-rsa @@ -32,7 +34,6 @@ $ sudo dnf install openvpn easy-rsa * `/etc/openvpn/client` * `/etc/openvpn/server` - 如果这些目录在安装的过程中没有创建,请手动创建它们。 ### 设置身份验证 @@ -41,8 +42,7 @@ $ sudo dnf install openvpn easy-rsa ``` $ sudo mkdir /etc/openvpn/easy-rsa -$ sudo cp -rai /usr/share/easy-rsa/3/* \ -/etc/openvpn/easy-rsa/ +$ sudo cp -rai /usr/share/easy-rsa/3/* /etc/openvpn/easy-rsa/ ``` 身份验证很重要,0penVPN 非常重视它。身份验证的理论是,如果 Alice 需要访问 Bob 公司内部的私人信息,那么 Bob 确保 Alice 真的是 Alice 就至关重要。同样的,Alice 也必须确保 Bob 是真正的 Bob。我们称之为相互认证。 @@ -53,29 +53,28 @@ $ sudo cp -rai /usr/share/easy-rsa/3/* \ * 你知道的 * 你是谁 - 选择有很多。0penVPN 安装使用如下: - * **Certificates:** 客户端和服务端都拥有的东西 - * **Certificate password:** 人们都知道的东西 + * **证书**:客户端和服务端都拥有的东西 + * **证书口令**:某人知道的东西 +Alice 和 Bob 需要帮助彼此来验证身份。由于他们都相信 Cathy,Cathy 承担了称为 证书颁发机构certificate authority(CA)的角色。Cathy 证明 Alice 和 Bob 都是他们自己。因为 Alice 和 Bob 都信任 Cathy,现在他们也相互信任了。 -Alice 和 Bob 需要帮助彼此来验证身份。由于他们都相信 Cathy, Cathy 承担了称为 **证书颁发机构** (CA) 的角色。Cathy 证明 Alice 和 Bob 都是他们自己。因为 Alice 和 Bob 都信任 Cathy,现在他们也相互信任了。 +但是是什么让 Cathy 相信 Alice 和 Bob 是真的 Alice 和 Bob?Cathy 在社区的声誉取决于如何正确处理这件事,因此如果她希望 Denielle、Evan、Fiona、Greg 和其他人也信任她,她就需要严格测试 Alice 和 Bob 的宣称内容。当 Alice 和 Bob 向 Cathy 证明了他们是真的 Alice 和 Bob 之后,Cathy 将向 Alice 和 Bob 签署证书,让他们彼此和全世界分享。 -但是是什么让 Cathy 相信 Alice 和 Bob 是真的 Alice 和 Bob?Cathy 在社区的声誉取决于如何正确处理这件事,因此如果她希望 Denielle,Evan,Fiona,Greg 和其他人也信任她,她就需要严格测试 Alice 和 Bob 的话。当 Alice 和 Bob 向 Cathy 证明了他们是真的 Alice 和 Bob 之后,Cathy 将向 Alice 和 Bob 签署证书,让他们彼此和全世界分享。 - -Alice 和 Bob 如何知道是 Cathy 签署了证书,而不是某个人冒充她签发了证书?他们使用一项叫做**公钥加密技术:** +Alice 和 Bob 如何知道是 Cathy 签署了证书,而不是某个人冒充她签发了证书?他们使用一项叫做**公钥加密**的技术: * 找到一种用一个密钥加密并用另一个密钥解密的加密算法。 * 将其中一个设为私钥,将另外一个设为公钥。 - * Cathy 与全世界分享她的公钥和她签名的明文副本。 + * Cathy 与全世界分享她的公钥和她的签名的明文副本。 * Cathy 用她的私钥加密她的签名,任何人都可以用她分享的公钥解密。 * 如果 Cathy 的签名解密后与明文副本匹配,Alice 和 Bob 就可以相信 Cathy 确实签署了它。 每次在线购买商品和服务时,使用的就是这种技术。 ### 认证实现 -0penVPN 的 [文档][5]建议在单独的系统上或者至少在 0penVPN 服务器的单独目录上设置 CA。该文档还建议分别从服务端和客户端生成各自的证书。因为这是一个简单的演示设置,你可以使用 0penVPN 服务器设置 CA,并将证书和密钥放入服务器上的指定目录中。 + +0penVPN 的 [文档][5] 建议在单独的系统上或者至少在 0penVPN 服务器的单独目录上设置 CA。该文档还建议分别从服务端和客户端生成各自的证书。因为这是一个简单的演示设置,你可以使用 0penVPN 服务器设置 CA,并将证书和密钥放入服务器上的指定目录中。 从服务端生成证书,并将证书拷贝到各个客户端,避免客户端再次设置。 @@ -100,7 +99,7 @@ $ sudo /etc/openvpn/easy-rsa/easyrsa init-pki $ sudo /etc/openvpn/easy-rsa/easyrsa gen-req OVPNserver2020 nopass ``` -在此例中,`0VPNServer2020` 是你在本系列第一篇文章中为 0penVPN 服务器设置的主机名。 +在此例中,`OVPNServer2020` 是你在本系列第一篇文章中为 0penVPN 服务器设置的主机名。 ### 生成和签署证书 @@ -111,7 +110,7 @@ $ sudo /etc/openvpn/easy-rsa/easyrsa gen-req OVPNserver2020 nopass ``` $ cd /etc/openvpn/ca $ sudo /etc/openvpn/easy-rsa/easyrsa \ -import-req /etc/openvpn/server/pki/reqs/OVPNserver2020.req OVPNserver2020 + import-req /etc/openvpn/server/pki/reqs/OVPNserver2020.req OVPNserver2020 ``` ### 审查并签署请求 @@ -121,7 +120,7 @@ import-req /etc/openvpn/server/pki/reqs/OVPNserver2020.req OVPNserver2020 ``` $ cd /etc/openvpn/ca $ sudo /etc/openvpn/easy-rsa/easyrsa \ -show-req OVPNserver2020 + show-req OVPNserver2020 ``` 以服务器身份签署请求: @@ -129,16 +128,16 @@ show-req OVPNserver2020 ``` $ cd /etc/openvpn/ca $ sudo /etc/openvpn/easy-rsa/easyrsa \ -sign-req server OVPNserver2020 + sign-req server OVPNserver2020 ``` 将服务器和 CA 证书的副本放在它们所属的位置,以便配置文件获取它们: ``` $ sudo cp /etc/openvpn/ca/pki/issued/OVPNserver2020.crt \ -/etc/openvpn/server/pki/ + /etc/openvpn/server/pki/ $ sudo cp /etc/openvpn/ca/pki/ca.crt \ -/etc/openvpn/server/pki/ + /etc/openvpn/server/pki/ ``` 接下来,生成 [Diffie-Hellman][6] 参数,以便客户端和服务器可以交换会话密钥: @@ -149,10 +148,11 @@ $ sudo /etc/openvpn/easy-rsa/easyrsa gen-dh ``` ### 快完成了 + 本系列的下一篇文章将演示如何配置和启动你刚刚构建的 0penVPN 服务器。 -* * * 本文的部分内容改编自 D. Greg Scott 的博客,并经许可重新发布。 + -------------------------------------------------------------------------------- via: https://opensource.com/article/21/7/openvpn-router @@ -160,7 +160,7 @@ via: https://opensource.com/article/21/7/openvpn-router 作者:[D. Greg Scott][a] 选题:[lujun9972][b] 译者:[perfiffer](https://github.com/perfiffer) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -168,7 +168,7 @@ via: https://opensource.com/article/21/7/openvpn-router [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openwires_fromRHT_520_0612LL.png?itok=PqZi55Ab (Open ethernet cords.) [2]: https://openvpn.net/ -[3]: https://opensource.com/article/21/7/vpn-openvpn-part-1 +[3]: https://linux.cn/article-13680-1.html [4]: https://community.openvpn.net/openvpn/wiki [5]: https://openvpn.net/community-resources/ [6]: https://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange From fcc5f13068c329098b950823f87291b538251c81 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 20 Aug 2021 12:36:00 +0800 Subject: [PATCH 121/290] PUB @perfiffer https://linux.cn/article-13702-1.html --- .../20210804 Install OpenVPN on your Linux PC.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210804 Install OpenVPN on your Linux PC.md (99%) diff --git a/translated/tech/20210804 Install OpenVPN on your Linux PC.md b/published/20210804 Install OpenVPN on your Linux PC.md similarity index 99% rename from translated/tech/20210804 Install OpenVPN on your Linux PC.md rename to published/20210804 Install OpenVPN on your Linux PC.md index 5ad120675f..9c444e001e 100644 --- a/translated/tech/20210804 Install OpenVPN on your Linux PC.md +++ b/published/20210804 Install OpenVPN on your Linux PC.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13702-1.html" 如何在免费 WiFi 中保护隐私(二) ====== From bb55961275446baec3f3b43d998e23b460a7f613 Mon Sep 17 00:00:00 2001 From: fisherue <88812040+fisherue@users.noreply.github.com> Date: Fri, 20 Aug 2021 16:20:40 +0800 Subject: [PATCH 122/290] Update 20200107 5 ways to improve your Bash scripts.md fisherue asks to translate this page on 2021/8/20 --- sources/tech/20200107 5 ways to improve your Bash scripts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200107 5 ways to improve your Bash scripts.md b/sources/tech/20200107 5 ways to improve your Bash scripts.md index ae4dd4fcf7..a02248cd4e 100644 --- a/sources/tech/20200107 5 ways to improve your Bash scripts.md +++ b/sources/tech/20200107 5 ways to improve your Bash scripts.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (fisherue ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 3249aa606e85ef8c8676a6e07e22e00bfb7c069a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 21 Aug 2021 05:04:20 +0800 Subject: [PATCH 123/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210820=20?= =?UTF-8?q?MAKE=20MORE=20with=20Inkscape=20=E2=80=93=20G-Code=20Tools?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210820 MAKE MORE with Inkscape - G-Code Tools.md --- ... MAKE MORE with Inkscape - G-Code Tools.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20210820 MAKE MORE with Inkscape - G-Code Tools.md diff --git a/sources/tech/20210820 MAKE MORE with Inkscape - G-Code Tools.md b/sources/tech/20210820 MAKE MORE with Inkscape - G-Code Tools.md new file mode 100644 index 0000000000..1d85c70003 --- /dev/null +++ b/sources/tech/20210820 MAKE MORE with Inkscape - G-Code Tools.md @@ -0,0 +1,166 @@ +[#]: subject: "MAKE MORE with Inkscape – G-Code Tools" +[#]: via: "https://fedoramagazine.org/make-more-with-inkscape-g-code-tools/" +[#]: author: "Sirko Kemter https://fedoramagazine.org/author/gnokii/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +MAKE MORE with Inkscape – G-Code Tools +====== + +![MAKE MORE with Inkscape - GCode Tools][1] + +Inkscape, the most used and loved tool of Fedora’s Design Team, is not just a program for doing nice vector graphics. With vector graphics (in our case SVG) a lot more can be done. Many programs can import this format. Inkscape can also do a lot more than just graphics. This series will show you some things you can do besides graphics with Inkscape. This first article of the series will show how Inkscape’s G-Code Tools extension can be used to produce G-Code. G-Code , in turn, is useful for programming machines such as plotters and laser engravers. + +### What is G-Code and what is it used for + +The construction of machines for the hobby sector is booming. The publication of the source code for [RepRap][2] 3D printers for self-construction and the availability of electronic components, such as [Arduino][3] or [Raspberry Pi][4] are probably some of the causes for this boom. Mechanical engineering as a hobby is finding more and more adopters. This trend hasn’t stopped with 3D printers. There are also [CNC][5] milling machines, plotters, laser engravers, cutters and and even machines that you can build yourself. + +You don’t have to design or build these machines yourself. You can purchase such machines relatively cheaply as a kit or already assembled. All these machines have one thing in common – they are computer-controlled. [Computer Aided Manufacturing (][6][CAM][6]), which has been widespread in the manufacturing industry, is now also taking place at home. + +### G-Code or G programming language + +The most widespread language for programming CAM machines is G-Code. G-Code is also known as the G programming language. This language was developed at MIT in the 1950s. Since then, various organizations have developed versions of this programming language. Keep this in mind when you work with it. Different countries have different standards for this language. The name comes from the fact that many instructions in this code begin with the letter G. This letter is used to transmit travel or path commands to the machine. + +The commands go, in the truest sense of the word, from A (absolute or incremental position around the X-axis; turning around X) to Z (absolute or incrementing in the direction of the Z-axis). Commands prefixed with M (miscellaneous) transmit other instructions to the machine. Switching coolant on/off is an example of an M command. If you want a more complete list of G-Code commands there is a table on [Wikipedia][7]. + +``` +% +G00 X0 Y0 F70 +G01 Z-1 F50 +G01 X0 Y20 F50 +G02 X20 Y0 J-20 +G01 X0 Y0 +G00 Z0 F70 +M30 +% +``` + +This small example would mill a square. You could write this G-Code in any editor of your choice. But when it comes to more complex things, you typically won’t do this sort of low-level coding by hand. When it comes to 3D-Printing the slicer writes the G-Code for you. But what about when you want to use a plotter or a laser engraver? + +### Other Software for writing G-Code + +So you will need a program to do this job for you. Sure, some CAD programs can write G-Code. But not all open source CAD programs can do this. Here are some other open source solutions for this: + + * [dxf2gcode][8], normally a command line tool but has a Python implemented GUI + * [dmap2gcode][9], can import raster graphics and convert them + * [Millcrum][10], a browser-based tool + * [LinuxCNC][11], can import raster graphics and converts them to G-Code + * [TrueTypeTracer][12] or [F-Engrave][13] if you want to engrave fonts + + + +As you can see, there is no problem finding a tool for doing this. What I dislike is the use of raster graphics. I use a CNC machine because it works more precisely than I would be able to by hand. Using raster graphics and tracing it to make a path for G-Code is not precise anymore. I find that the use of vector graphics, which has paths anyway, is much more precise. + +### Inkscape and G-Code Tools installation + +When it comes to vector graphics, there is no way around Inkscape; at least not if you use Linux. There are a few other programs. But they do not have anywhere near the capability that Inkscape has. Or they are designed for other purposes. So the question is, “Can Inkscape be used for creating G-Code?” And the answer is, “Yes!” Since version 0.91, Inkscape has been packaged with an extension called [GCode Tools][14]. This extension does exactly what we want – it converts paths to G-Code. + +So all you have to do, if you have not already done it, is install Inkscape: + +``` +$ sudo dnf install Inkscape +``` + +One thing to note from the start (where light is, is also shadow) – the GCode Tools extension has a lot of functionality that is not well documented. The developer thinks it’s a good idea to use a forum for documentation. Also, basic knowledge about G-Code and CAM is necessary to understand the functions. + +Another point to be aware of is that the development isn’t as vibrant as it was at the time the GCode Tools were packaged with Inkscape. + +### Getting started with Inkscape’s G-Code Tools extension + +The first step is the same as when you would make any other thing in Inkscape – adjust your document properties. So open the document settings with **Shift + Ctrl + D** or by a clicking on the icon on the command bar and set the document properties to the size of your work piece. + +Next, set the orientation points by going to _Extensions > Gcodetools > Orientation points_. You can use the default settings. The default settings will probably give you something similar to what is shown below. + +![Inkscape with document setup and the orientation points ][15] + +#### The Tool library + +The next step is to edit the tool library (_Extensions > Gcodetools > Tools library_). This will open the dialog window for the tool setting. There you choose the tool you will use. The _default_ tool is fine. After you have chosen the tool and hit _Apply_, a rectangle will be on the canvas with the settings for the tool. These settings can be edited with the text tool (**T**). But this is a bit tricky. + +![Inkscape with the default tool library settings added into the document][16] + +The G-Code Tools extension will use these settings later. These tool settings are grouped together with an identifiable name. If you de-group these settings, this name will be lost. + +There are two possibilities to avoid losing the identifier if you ungroup the tool settings. You can use the de-group with 4 clicks with the activated selection tool. Or you can de-group it by using **Shift + Ctrl + G** and then give the group a name later using the XML-editor. + +In the first case you should **watch that the group is restored before you draw anything new**. Otherwise the newly drawn object will be added to this group. + +Now you can draw the paths you want to later convert to G-Code. Objects like rectangles, circles, stars and polygons as well text must be converted to paths (_Path > Object to Path_ or **Shift + Ctrl + C**). + +Keep in mind that this function often does not produce clean paths. You will have to control it and clean it afterwards. You can find an older article [here][17], that describes the process. + +#### Hershey Fonts or Stroke Fonts + +Regarding fonts, keep in mind that TTF and OTF are so called Outline Fonts. This means the contour of the single character is defined and it will be engraved or cut as such. If you do not want this and want to use, for example, a script font then you have to use Stroke Fonts instead. Inkscape itself brings a small collection of them by default (see _Extensions > Text > [Hershey text][18]_). + +![The stroke fonts of the Hershey Text extension][19] + +Another article about how make your own Stroke Fonts will follow. They are not only useful for engraving, but also for embroidery. + +#### The Area Fill Functions + +In some cases it might be necessary to fill paths with a pattern. The G-Code Tools extension has a function which offers two ways to fill objects with patterns – _zig zag_ and _spiral_. There is another function which currently is not working (Inkscape changed some parts for the extensions with the release of version 1.0). The latter function would fill the object with the help of the offset functions in Inkscape. These functions are under _Extensions > Gcodetools > Area_. + +![The Fill Area function of the G-Code Tools extension. Left the pattern fill and right \(currently not working\) the offset filling. The extension will execute the active tab!][20] + +![The area fillings of the G-Code Tool, on top Zig zag and on the bottom Spiral. Note the results will look different, if you apply this function letter-by-letter instead of on the whole path.][21] + +With more and different area fillings you will often have to draw the paths by hand (about 90% of the time). The [EggBot extension][22] has a function for filling regions with hatches. You also can use the [classical hatch patterns][23]. But you will have to convert the fill pattern back to an object. Otherwise the G-Code Tools extension can not convert it. Besides these, [Evilmadscientist has a good wiki page describing fill methods][24]. + +#### Converting paths to G-Code + +To convert drawn paths to G-Code, use the function _Extensions > Gcodetools > Paths to G-Code._ This function will be run on the selected objects. If no object is selected, then on all paths in the document will be converted. + +There is currently no functionality to save G-Code using the file menu. This must be done from within the G-Code Tools extension dialog box when you convert the paths to G-Code. **On the Preferences tab, you have to specify the path and the name for the output file.** + +On the canvas, different colored lines and arrows will be rendered. Blue and green lines show curves (G02 and G03). Red lines show straight lines (G01). When you see this styling, then you know that you are working with G-Code. + +![Fedora’s logo converted to G-Code with the Inkscape G-Code Tools][25] + +### Conclusion + +Opinions differ as to whether Inkscape is the right tool for creating G-Code. If you keep in mind that Inkscape works only in two dimensions and don’t expect too much, you can create G-Code with it. For simple jobs like plotting some lettering or logos, it is definitely enough. The main disadvantage of the G-Code Tools extension is that its documentation is lacking. This makes it difficult to get started with G-Code Tools. Another disadvantage is that there is not currently much active development of G-Code Tools. There are other extensions for Inkscape that also targeted G-Code. But they are already history or are also not being actively developed. The [Makerbot Unicorn GCode Output][26] extension and the [GCode Plot][27] extension are a few examples of the latter case. The need for an easy way to export G-Code directly definitely exists. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/make-more-with-inkscape-g-code-tools/ + +作者:[Sirko Kemter][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/gnokii/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/drawing-1-816x345.png +[2]: https://reprap.org/wiki/RepRap +[3]: https://www.arduino.cc/ +[4]: https://www.raspberrypi.org/ +[5]: https://en.wikipedia.org/wiki/CNC +[6]: https://en.wikipedia.org/wiki/Computer-aided_manufacturing +[7]: https://en.wikipedia.org/wiki/G-code +[8]: https://sourceforge.net/projects/dxf2gcode/ +[9]: https://www.scorchworks.com/Dmap2gcode/dmap2gcode.html +[10]: http://millcrum.com/ +[11]: http://linuxcnc.org/ +[12]: https://github.com/aewallin/truetype-tracer +[13]: https://www.scorchworks.com/Fengrave/fengrave.html +[14]: https://github.com/cnc-club/gcodetools +[15]: https://fedoramagazine.org/wp-content/uploads/2021/07/Bildschirmfoto-vom-2021-07-12-19-02-14-1024x556.png +[16]: https://fedoramagazine.org/wp-content/uploads/2021/07/Bildschirmfoto-vom-2021-07-12-19-10-24-1024x556.png +[17]: https://fedoramagazine.org/design-faster-web-pages-part-2-image-replacement/ +[18]: https://www.evilmadscientist.com/2011/hershey-text-an-inkscape-extension-for-engraving-fonts/ +[19]: https://fedoramagazine.org/wp-content/uploads/2021/07/Bildschirmfoto-vom-2021-07-12-19-16-50.png +[20]: https://fedoramagazine.org/wp-content/uploads/2021/07/fillarea-1024x391.png +[21]: https://fedoramagazine.org/wp-content/uploads/2021/07/Bildschirmfoto-vom-2021-07-12-20-36-51.png +[22]: https://wiki.evilmadscientist.com/Installing_software#Linux +[23]: https://inkscape.org/de/~henkjan_nl/%E2%98%85classical-hatch-patterns-for-mechanical-drawings +[24]: https://wiki.evilmadscientist.com/Creating_filled_regions +[25]: https://fedoramagazine.org/wp-content/uploads/2021/07/Bildschirmfoto-vom-2021-07-12-19-38-34-1024x556.png +[26]: http://makerbot.wikidot.com/unicorn-output-for-inkscape +[27]: https://inkscape.org/de/~arpruss/%E2%98%85gcodeplot From b3356a3934ab8392b9ecd62cec2a2cd0946ceee2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 21 Aug 2021 05:04:48 +0800 Subject: [PATCH 124/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210820=20?= =?UTF-8?q?Check=20file=20status=20on=20Linux=20with=20the=20stat=20comman?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210820 Check file status on Linux with the stat command.md --- ...e status on Linux with the stat command.md | 119 ++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 sources/tech/20210820 Check file status on Linux with the stat command.md diff --git a/sources/tech/20210820 Check file status on Linux with the stat command.md b/sources/tech/20210820 Check file status on Linux with the stat command.md new file mode 100644 index 0000000000..09c762666a --- /dev/null +++ b/sources/tech/20210820 Check file status on Linux with the stat command.md @@ -0,0 +1,119 @@ +[#]: subject: "Check file status on Linux with the stat command" +[#]: via: "https://opensource.com/article/21/8/linux-stat-file-status" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Check file status on Linux with the stat command +====== +All the information you need about any file or file system is just one +Linux command away. +![Hand putting a Linux file folder into a drawer][1] + +The `stat` command, included in the GNU `coreutils` package, provides a variety of metadata, including file size, inode location, access permissions and SELinux context, and creation and modification times, about files and filesystems. It's a convenient way to gather information that you usually need several different commands to acquire. + +### Installing stat on Linux + +On Linux, you probably already have the `stat` command installed because it's part of a core utility package that's generally bundled with Linux distributions by default. + +In the event that you don't have `stat` installed, you can install `coreutils` with your package manager. + +Alternately, you can [compile coreutils from source code][2]. + +### Getting the status of a file + +Running `stat` provides easy to read output about a specific file or directory. + + +``` +$ stat planets.xml +  File: planets.xml +  Size: 325      Blocks: 8     IO Block: 4096   regular file +Device: fd03h/64771d    Inode: 140217      Links: 1 +Access: (0664/-rw-rw-r--)  Uid: (1000/tux)   Gid: (100/users) +Context: unconfined_u:object_r:user_home_t:s0 +Access: 2021-08-17 18:26:57.281330711 +1200 +Modify: 2021-08-17 18:26:58.738332799 +1200 +Change: 2021-08-17 18:26:58.738332799 +1200 + Birth: 2021-08-17 18:26:57.281330711 +1200 +``` + +It may be easy to read, but it's still a lot of information. Here's what `stat` is covering: + + * **File**: the file name + * **Size**: the file size in bytes + * **Blocks**: the number of blocks on the hard drive reserved for this file + * **IO Block**: the size of a block of the filesystem + * **regular file**: the type of file (regular file, directory, filesystem) + * **Device**: the device where the file is located + * **Inode**: the inode number where the file is located + * **Links**: the number of links to the file + * **Access, UID, GID**: file permissions, user, and group owner + * **Context**: SELinux context + * **Access, Modify, Change, Birth**: the timestamp of when the file was accessed, modified, changed status, and created + + + +### Terse output + +For people who know the output well, or want to parse the output with other utilities like [awk][3], there's the `--terse` (`-t` for short) option, which formats the output without headings or line breaks. + + +``` +$ stat --terse planets.xml +planets.xml 325 8 81b4 100977 100 fd03 140217 1 0 0 1629181617 1629181618 1629181618 1629181617 4096 unconfined_u:object_r:user_home_t:s0 +``` + +### Choosing your own format + +You can define your own format for output using the `--printf` option and a syntax similar to [printf][4]. Each attribute reported by `stat` has a format sequence (`%C` for SELinux context, `%n` for file name, and so on), so you can choose what you want to see in a report. + + +``` +$ stat --printf="%n\n%C\n" planets.xml +planets.xml +unconfined_u:object_r:user_home_t:s0 +$ $ stat --printf="Name: %n\nModified: %y\n" planets.xml +Name: planets.xml +Modified: 2021-08-17 18:26:58.738332799 +1200 +``` + +Here are some common format sequences: + + * **%a** access rights + * **%F** file type + * **%n** file name + * **%U** user name + * **%u** user ID + * **%g** group ID + * **%w** time of birth + * **%y** modification time + + + +A full listing of format sequences is available in the `stat` man page and the `coreutils` info pages. + +### File information + +If you've ever tried to parse the output of `ls -l`, then you'll appreciate the flexibility of the `stat` command. You don't always need every bit of the default information that `stat` provides, but the command is invaluable when you do need some or all of it. Whether you read its output in its default format, or you create your own queries, the `stat` command gives you easy access to the data about your data. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-stat-file-status + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/yearbook-haff-rx-linux-file-lead_0.png?itok=-i0NNfDC (Hand putting a Linux file folder into a drawer) +[2]: https://www.gnu.org/software/coreutils/ +[3]: https://opensource.com/article/20/9/awk-ebook +[4]: https://opensource.com/article/20/8/printf From a6464c59cd0f2b6932b31137e14c1902d81c264c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 21 Aug 2021 05:05:08 +0800 Subject: [PATCH 125/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210820=20?= =?UTF-8?q?3=20steps=20for=20managing=20a=20beginner-friendly=20open=20sou?= =?UTF-8?q?rce=20community?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210820 3 steps for managing a beginner-friendly open source community.md --- ...beginner-friendly open source community.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20210820 3 steps for managing a beginner-friendly open source community.md diff --git a/sources/tech/20210820 3 steps for managing a beginner-friendly open source community.md b/sources/tech/20210820 3 steps for managing a beginner-friendly open source community.md new file mode 100644 index 0000000000..ce3df9c7d3 --- /dev/null +++ b/sources/tech/20210820 3 steps for managing a beginner-friendly open source community.md @@ -0,0 +1,143 @@ +[#]: subject: "3 steps for managing a beginner-friendly open source community" +[#]: via: "https://opensource.com/article/21/8/beginner-open-source-community" +[#]: author: "Isabel Costa https://opensource.com/users/isabelcmdcosta" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 steps for managing a beginner-friendly open source community +====== +As a member of an open source project, there's a lot you can do to help +beginners find a way to contribute.  +![Working from home at a laptop][1] + +When someone is new to contributing to open source, the best place to start is often beginner-friendly bugs and issues. But before they can do that, they have to be able to find those kinds of issues. As a member of an open source project, there's a lot you can do to help beginners find a way to contribute.  + +Bearing this in mind, the [AnitaB.org open source community][2] prioritizes making our community beginner-friendly. We have initiatives to ensure that we're inclusive for contributors at different levels of experience and for different types of contributions that don't only relate to coding. + +I recently presented some of the community work we do at the [AnitaB.org][3] community at [Upstream 2021][4], the Tidelift event, which kicked off Maintainer Week, a weeklong celebration of open source maintainers. I discussed how there are three main parts to our strategy: + + * How we communicate + * Projects and issues + * Open source programs + + + +### How we communicate + +Transparency is such an essential part of open source, and we apply transparency principles to our approach to communication. In practical terms, this means that all our community sessions are run openly, affect how we've set up Zulip chat and how we provide documentation. + +#### **Open sessions** + +Anyone can join our sessions and discuss topics related to our community. They can participate in discussions or just listen. These are available for everyone to see in our community calendar. We usually only use audio in these calls, which we've found can make people feel more comfortable participating. + +We host project-focused sessions and a couple of category-related sessions, where people from different areas can discuss the same project and help improve our processes. Occasionally, we have "Ask Me Anything" sessions, where anyone can come and ask questions about anything related to open source. + +We take notes of all sessions in a shared document and share the summary and a document link in [our Zulip][5]. + +#### **Our Zulip chat** + +The open source Zulip chat platform is our primary community communication channel, although we also use the comments section on issues and pull requests on Github. In general, we have disabled private messaging to make sure we are as transparent as possible. We have only a few exceptions to this rule, where we have private streams for admins dealing with the logistics of the programs we run. We've found this approach is more welcoming, and it also enables us to have more visibility into conduct violations in the public chat. + +We share all session summaries on the Zulip chat, including the main points discussed, action items, and documentation. This process might sound like an obvious requirement, but I've been surprised at how many open source projects don't provide notes so that people who did not attend can remain informed. + +On Zulip, we discuss project roadmaps, answer questions and queries from the community, and actively **promote ways for people to contribute and where they can contribute. **Sometimes we celebrate contributors' wins—whether it's to highlight the first PR they have tested, reviewed, or the excellent work our volunteers do. + +#### **Documentation** + +We try to keep **open documentation about our processes**, such as FAQs, so those community members can learn at their own pace and in their own time about the community. This is intended to give them an idea of how we work and what type of work we do before reaching out to us. + +### Projects and issues + +Regarding our projects and issues management, we encourage multiple ways to contribute, create specific issues for first-timers only, and try to have an easy setup for projects. + +#### **Multiple ways to contribute** + +We make an effort to create **issues that require different contributions** such as documentation, testing, design, and outreach. This is to provide ways for anyone to contribute regardless of their experience level and area of interest. It helps the community get involved, and we've found that it enables members to work their way up and contribute to some low-effort but valuable tasks. + +Types of contributions we promote are: + + * Coding tasks that range in complexity. + * Quality assurance tasks—where contributors can test our apps or pull requests and report bugs. + * Design sessions where members can participate in discussions. Also, opportunities to create mock-ups and redesign parts of our apps, and explore user experience improvements. + * Outreach tasks, we primarily promote on Zulip, where we suggest blogging to our Medium publication about their open source experiences and their contributions. + * Documentation tasks that can include general community documentation or our project's documentation on Docusaurus. + + + +#### **First-timers only issues** + +We label some **issues as "first-timers only."** These are for people who have not contributed yet to the issue's repository. Labeling issues also enable us to have work for people beginning their open source journey during times of contributor influx, for example, during [Google Summer of Code (GSoC)][6]. + +Sometimes these might be "low-hanging fruit" that can get them acquainted with the process of contributing and submitting pull requests. + +#### **Easy project setup** + +We also care about having a **beginner-friendly setup **for our projects. We notice that the most active project is generally the easiest to set up. We know that contributing to a project you aren't familiar with can take a lot of effort and make or break the experience of contributing. + +We try to provide instructions on how to run our projects on multiple operating systems. In the past, we had some projects with separate instructions to run on Unix environments, and we noticed contributors having difficulties running these projects on Windows. We've improved since then to avoid confusion among contributors who would ask for help on our Zulip. + +We have been improving the README for one of our most active projects, [mentorship-backend][7], according to contributors' experience. One of the struggles for beginners in this project was setting part of the environment variables related to configuring an email account to enable the backend functionality to send emails. However, because this feature was not critical for local development, by default, we made the email setup optional so that emails, instead of being sent to users, were printed to the terminal. This approach still made the emails visible to the contributor. Similar to this change, we made [the SQLite database][8] the default for local development to avoid additional setup for the Postgres database, even though we use this in our deployed version. + +We have noticed that some contributors have struggled to contribute to one of our projects, [bridge-in-tech-backend][9], where its setup is complicated and includes many more steps than [mentorship-backend][7]. Since we noticed this in one of our open source programs, we have been exploring improving its structure. + +For most of our projects, we also provide a live or bundled version of the apps so that contributors can test the project without setting it up. This helps us provide a way for contributors who are not interested or familiar with the development setup to try the most recent version of our apps and contribute by reporting any bugs found. We have the links to these apps deployed on our [Quality Assurance guide][10]. + +### Open source programs + +We organize two main programs in our community: Open Source Hack (a one-month program) and Open Source Ambassadors (a six-month program). + +#### **Open Source Hack (OSH)** + +In this program, we create issues in multiple categories of contributions—Documentation, Coding, Outreach, Testing, and Design (similar to the [Google Code-in][11] contest). Participants can contribute and receive digital certificates for contributing at least once to each category. One issue may include multiple categories, and the pull requests don't need to be merged for their contributions to be valid. + +We select a few projects for this program, then mentors brainstorm and create issues for participants. When the program starts, participants can claim issues and begin contributing. Mentors support and review their contributions. + +This approach encourages diversity of contributions and welcomes anyone, regardless of their coding ability, to contribute in a friendly and fail-safe environment. + +#### **Open Source Ambassadors** + +In this program, we select ambassadors from the community that ideally will cover each category of contributions we aim to promote. We've run this program twice so far. + +The program aims to have members grow in helping manage projects and initiatives by responding to questions from the community, assisting contributors to get involved, and advocating for their assigned category. + +In the first program we ran, we accepted anyone who applied. We assessed where members' interests lay and provided a structure for people who wanted to contribute but were initially uncomfortable with taking that step. + +This edition was very enlightening for us as a community. It required a lot of management from admins, as we had a mix of experienced and inexperienced open source contributors and community members. Some ambassadors were confident in stepping up and leading initiatives, while others needed more support. For our second program, we decided to scale down the initiative. We only accepted contributors who were already familiar with the community and could lead on initiatives and projects and help us train the less experienced. + +The second program became a positive feedback loop. Ambassadors who started as beginners, contributing to the first program we ran, became comfortable leading after learning from their experience with the program. + +This change of approach enabled admins to focus more on supporting the ambassadors' team, helping them propagate our mission and continue making the community beginner-friendly, and mentoring more people to contribute. + +### Summary + +These programs have helped us bring awareness to different ways to contribute and give back to open source. Through these, we've found volunteers helping by managing projects and hosting open sessions, which contributes to managing the community and providing mentorship to our contributors. + +Even though we have had a good response from contributors and helped people make their first contributions, we still have a lot of room for improvement. We will continue to enhance our project's setup and contribution guidelines to improve contributors' experience. We'll also continue to focus on making sure we always have and promote available issues across the organization and in different categories to promote an inclusive environment so that anyone who wishes to can contribute. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/beginner-open-source-community + +作者:[Isabel Costa][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/isabelcmdcosta +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop) +[2]: https://github.com/anitab-org +[3]: https://anitab.org/ +[4]: https://youtu.be/l8r50jCr-Yo +[5]: https://anitab-org.zulipchat.com/ +[6]: https://summerofcode.withgoogle.com/ +[7]: https://github.com/anitab-org/mentorship-backend#readme +[8]: https://opensource.com/article/21/2/sqlite3-cheat-sheet +[9]: https://github.com/anitab-org/bridge-in-tech-backend +[10]: https://github.com/anitab-org/documentation/blob/master/quality-assurance.md +[11]: https://codein.withgoogle.com/ From 1625b9e59275eb3b4b0947f93094517143ed6efd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 21 Aug 2021 05:05:38 +0800 Subject: [PATCH 126/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210821=20?= =?UTF-8?q?10=20Things=20to=20Do=20After=20Installing=20elementary=20OS=20?= =?UTF-8?q?6=20=E2=80=9COdin=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md --- ... After Installing elementary OS 6 -Odin.md | 185 ++++++++++++++++++ 1 file changed, 185 insertions(+) create mode 100644 sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md diff --git a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md new file mode 100644 index 0000000000..b510e84de4 --- /dev/null +++ b/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -0,0 +1,185 @@ +[#]: subject: "10 Things to Do After Installing elementary OS 6 “Odin”" +[#]: via: "https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 Things to Do After Installing elementary OS 6 “Odin” +====== +A curated list of things to do after installing the latest elementary OS +6 code-named “Odin”._Pre-step_Applications > System Settings > Desktop +The [elementary OS 6 “Odin” released][1] a while back after more than two years in development. It brings a huge set of new features across its core modules, Pantheon desktop, native applications. This release is based on the Ubuntu 20.04 LTS. + +That said, if you already completed the installation, there are certain customization that you might want to try out to personalize your system. The options those described here are generic and may not be useful for you at certain cases, but we feel it’s worth to list down some basics and give you a path to explore more of this beautiful elementary OS. + +### Things to Do After Installing elementary OS 6 “Odin” + +Make sure you connect to the internet first. You can get the list of networks available in the notification area at the top. + +#### 1\. Change hostname + +This might not be the first thing you would like to do. However, I am not sure why an option not given changing the hostname during installation itself. For example, see below terminal prompt, the hostname is the default hardware configuration set by elementary OS. Which is not looking good at all in my opinion. + +![hostname change before][2] + +To change the hostname, open a terminal and run the below command. + +``` +hostnamectl set-hostname your-new-hostname +``` + +example: + +![changing hostname][3] + +![changed hostname][4] + +#### 2\. Update your system + +The very first thing you should do after installing any Linux distribution is to make sure the system is up-to-date with packages and security updates. + +To do that here, you can open App Center and check/install for updates. + +Or, open the Terminal and run the below commands. + +``` +sudo apt update +sudo apt upgrade +``` + +#### 3\. Install Pantheon Tweaks + +Pantheon Tweaks is a must-have application in elementary OS. It provides additional settings and configuration options that is not available via standard system settings app. To install Pantheon Tweaks, open a terminal and run the below commands. Note: The earlier tweak tool was elementary Tweaks, which is renamed with Pantheon Tweaks from Odin onwards. + +``` +sudo apt install software-properties-common +sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks +sudo apt install -y pantheon-tweaks +``` + +After installation, open System Settings and you can find Tweaks option there. + +A detailed installation guide is [available here][5] (if you need more information). + +#### 4\. Configure Dock + +Dock is the center of the desktop. And honestly, the default apps that is included in the dock are not that popular. So, you can always configure the dock items using the below steps. + + * To remove: Right click and uncheck the **Keep in Dock** option. + * To add new items: Click on Application at the top. Then right-click on the application icon which you want in dock. Select **Add to Dock**. + + + +In my opinion, you should add at least – File manager, screenshot tool, Firefox, Calculator – among other things. And remove the ones you don’t need. + +#### 5\. Change the look and feel + +The elementary OS 6 Odin revamped the overall look of the desktop with pre-loaded accent color, native dark mode for entire desktop and applications. Also, pre-loads nice wallpapers. You can customize all these via . There you will have options for Wallpaper, Appearance, Panels and Multitasking. + +![elementary OS 6 Odin settings window – Desktop][6] + +Configure the look as you wish. + +[][7] + +SEE ALSO:   elementary OS 6 Odin: New Features and Release Date + +Oh, you can also schedule the Dark and Light mode based on Sunset and Sunrise! + +#### 6\. Install Additional Applications + +The native AppCenter is great for this OS. I find it one of the best curated app store available in Linux desktop. However, sometimes It’s also better to install necessary applications (mostly the known ones) those are not pre-loaded. Here’s a quick list of applications which you can install in a fresh system. _(Seriously, why LibreOffice is not preloaded?)_ + + * firefox + * gimp + * gedit + * inkscape + * obs-studio + * libreoffice + + + +#### 7\. Some Battery Saver Tips (Laptop) + +There are many ways which you can configure your elementary OS (or Linux desktop in general) to save battery life. Remember that battery life depends on your Laptop hardware, how old the battery/Laptop is among other things. So, following some of the below tips to get the maximum out of your Laptop battery. + + * Install [tlp][8]. The tlp is a simple to use, terminal based utility to help you to save Battery Life in Linux. You need to just install it, and it will take care of the other settings by default. Installation commands: + + + +``` +sudo add-apt-repository ppa:linrunner/tlp +sudo apt update +sudo apt-get install tlp +sudo tlp start +``` + + * Turn off Bluetooth, which is turned on by default. Enable it when required. + + + * Install thermald via below command. This utility (actually a daemon) controls the P-States, T-States of your CPU for temperature and controls the heating. + + + +``` +sudo apt install thermald +``` + + * Control brightness to minimum as per your need. + + + +#### 8\. Install a Disk Utility + +More often, you can find that you need to format a USB or write something to USB. By default, there are no application installed. The best applications with easy usage are the below ones. You can install them. + +``` +gnome-disk-utility +gparted +``` + +#### 9\. Enable Minimize and Maximize Option + +Many users prefer to have the Maximize, Minimize window buttons at the left or right of the window title bar. The elementary OS only gives you close and restore options by default. Which is completely fine because of the way it’s designed. However, you can use Pantheon Tweaks to enable it via Tweaks > Appearance > Window Controls. + +![enable minimize maximize buttons elementary OS][9] + +#### 10\. Learn the new multi-touch gestures in Odin + +If you are a Laptop user, and using elementary OS Odin, then you definitely check out the super cool new gestures. A three-finger swipe up smoothly opens the Multitasking View, exposing open apps and workspaces. A three-finger swipe left or right smoothly switches between the dynamic workspaces, making it even faster to jump between tasks. + +And with two fingers you can achieve similar feature inside native applications as well. + +### Closing Notes + +I hope these 10 things to do after installing elementary OS 6 helps you and get you started with elementary OS 6 Odin. Although, these are completely user preference; hence these may or may not apply to you. But in general, these are expected tweaks that the average user prefers. + +Let me know in the comments below if there are some more tweaks you feel that should be added in the list. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/08/elementary-os-6/ +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/hostname-change-before.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changing-hostname.jpeg +[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changed-hostname.jpeg +[5]: https://www.debugpoint.com/2021/07/elementary-tweaks-install/ +[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/elementary-OS-6-Odin-settings-window-Desktop.jpeg +[7]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/ +[8]: https://linrunner.de/tlp/ +[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS-1024x501.png From 626b6a3364c78d7ecefd346284053231d4f440a8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 21 Aug 2021 05:05:59 +0800 Subject: [PATCH 127/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210820=20?= =?UTF-8?q?Intel=E2=80=99s=20XeSS=20Could=20be=20the=20Open-Source=20Alter?= =?UTF-8?q?native=20to=20Nvidia=E2=80=99s=20DLSS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210820 Intel-s XeSS Could be the Open-Source Alternative to Nvidia-s DLSS.md --- ...pen-Source Alternative to Nvidia-s DLSS.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/news/20210820 Intel-s XeSS Could be the Open-Source Alternative to Nvidia-s DLSS.md diff --git a/sources/news/20210820 Intel-s XeSS Could be the Open-Source Alternative to Nvidia-s DLSS.md b/sources/news/20210820 Intel-s XeSS Could be the Open-Source Alternative to Nvidia-s DLSS.md new file mode 100644 index 0000000000..748552f214 --- /dev/null +++ b/sources/news/20210820 Intel-s XeSS Could be the Open-Source Alternative to Nvidia-s DLSS.md @@ -0,0 +1,123 @@ +[#]: subject: "Intel’s XeSS Could be the Open-Source Alternative to Nvidia’s DLSS" +[#]: via: "https://news.itsfoss.com/intel-xess-open-source/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Intel’s XeSS Could be the Open-Source Alternative to Nvidia’s DLSS +====== + +Over the past year, everyone in the PC gaming community has been talking about DLSS and FidelityFX. However, it seems that Linux gamers have been missing out, with DLSS only working through Proton when combined with a beta Nvidia driver and FidelityFX leaving much to be desired in terms of graphics. + +Fortunately, Intel appears to want to change that with their new XeSS frame rate boosting technology. Launching alongside their upcoming Alchemist range of GPUs, it promises the ease of implementation of FidelityFX while competing in terms of image quality with DLSS. + +Here, we will be exploring how this technology works and the incredible impact it will have on gaming on Linux. + +### Is it like Nvidia’s DLSS? + +![][1] + +Similar to DLSS (Deep Learning Super Sampling), XeSS stands for Xe Super Sampling. AMD’s FidelityFX is a collection of technologies that enable games to run at a much higher frame rate than traditional rendering with minimal loss to visual quality. + +Currently, two different technologies are used to achieve this. These are AI and traditional upscaling, both with various drawbacks and advantages. + +#### Traditional Upscaling + +Unlike AI, this approach has been worked on for many years. Previously, we have seen it being used in many TVs, computer monitors, and even some games to make a lower resolution image (or frame) appear clearer, with decent results. + +This is the technology that AMD has chosen for their FidelityFX. They did this for several reasons; some possible ones include: + + * Easier implementation by game developers + * The capability to run on almost any GPU + * Proven technology + + + +That isn’t to say that it is without its disadvantages, some being: + + * Reduced visual quality compared to AI-based solutions + * More limited in opportunities to improve it in the future + + + +AMD is currently the only major company using this technology for game upscaling. That means that we must move on to the other major upscaling technology: AI. + +#### AI Upscaling + +![][2] + +It is the latest advancement in upscaling technology used by DLSS and XeSS. + +Unlike traditional upscaling, this approach typically depends on some special hardware to run. + +Specifically, it would help if you had a GPU with dedicated AI cores. On Nvidia’s cards, these come in the form of Tensor cores. + +Because these cores are new, they are only available on 20 and 30 series GPUs, meaning that older cards are stuck with traditional upscaling. Additionally, it is much harder for developers to implement as the AI needs to be “trained,” involving feeding the AI thousands of hours of gameplay. + +Yet, these trade-offs are worth it for many people, as AI provides better image quality and performance. + +This is the route Intel has taken for its solution. + +### Open Source and Upscaling + +DLSS is completely closed source in true Nvidia style, like the drivers that annoyed Linus Torvalds so much. + +Fortunately, Intel is following in the footsteps of AMD, and they plan to open-source XeSS once it’s ready for prime time. + +While there is no significant commitment made by them, but multiple reports suggest that they plan to eventually open-source it. + +This allows them to take advantage of the numerous contributions the open-source community will (hopefully) make. The result should be a fascinating GPU landscape with many different technologies and companies constantly fight for the top spot in upscaling. + +### Intel XeSS + +![][3] + +Compared to Nvidia’s DLSS (XeSS’s main competitor), XeSS promises better performance, visual quality, and ease of implementation. + +So far, we have seen demos running at as much as double the native performance, backing up the performance claims. But that’s press material for now. + +As I mentioned, Intel is planning to make it open-source. + +While it may not be open-source at launch, they intend on open-sourcing once it matures. + +![][4] + +If Intel is to be believed, this could be the killer feature of their upcoming Alchemy GPUs, putting them ahead of both AMD and Nvidia in one single scoop. + +### Final Thoughts + +I am incredibly excited about this feature, more so than I was about DLSS and FidelityFX combined. It should be noted that this is still some time away, with it expected to release in early 2022. + +Overall, it looks like a significant step forward for Intel and maybe the key to them coming back from behind AMD and Nvidia. + +_Are you excited about XeSS? Let me know in the comments below!_ + +**Via**: [Videocardz][5] + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/intel-xess-open-source/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4MSIgd2lkdGg9IjY3OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://i2.wp.com/i.ytimg.com/vi/-Dp61_bM948/hqdefault.jpg?w=780&ssl=1 +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMiIgd2lkdGg9Ijc2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://videocardz.com/newz/intel-xess-ai-based-super-sampling-technology-will-be-open-source-once-it-matures From 9062b3807aaf90f40b35d4a4a2c1af0e927a237a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 21 Aug 2021 05:06:21 +0800 Subject: [PATCH 128/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210820=20?= =?UTF-8?q?SparkyLinux=206.0=20Release=20is=20based=20on=20Debian=2011=20a?= =?UTF-8?q?nd=20Includes=20a=20Built-in=20VPN?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210820 SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN.md --- ...n Debian 11 and Includes a Built-in VPN.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/news/20210820 SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN.md diff --git a/sources/news/20210820 SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN.md b/sources/news/20210820 SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN.md new file mode 100644 index 0000000000..a1b233c1af --- /dev/null +++ b/sources/news/20210820 SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN.md @@ -0,0 +1,93 @@ +[#]: subject: "SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN" +[#]: via: "https://news.itsfoss.com/sparkylinux-6-0-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN +====== + +SparkyLinux 6.0 is a major stable update that utilizes Debian 11 ‘Bullseye’ as its base now. + +While you can go through the [features of Debian 11][1], SparkyLinux 6.0 should reflect some of the perks associated with it. + +Here, we shall take a quick look at what SparkyLinux 6.0 has to offer. + +### SparkyLinux 6.0 “Po Tolo”: What’s New? + +The major highlight of the release is the latest Debian 11 ‘Bullseye’ as its base. The repositories have also been updated to get the latest packages. + +SparkyAPTus AppCenter has replaced the original SparkyAPTus, which is no longer developed. + +![][2] + +You can install, reinstall, and remove applications easily. Not just limited to the applications, but you also get the ability to tweak the pre-configured desktops using it. + +In addition to that, you can remove and install Linux Kernels as well. You can choose from Debian Kernel, Liquorix, Sparky, and XanMod. + +![][3] + +It is worth noting that you will still be able to access all the tools from the old APTus. + +To enhance privacy and security, SparkyLinux has decided to include the non-profit [RiseUp VPN][4] application pre-installed. + +It is a VPN service that relies on donations to keep the network alive and comes with cross-platform support. You can also find it available for Android devices. + +So, this makes it an interesting addition to the distribution. If you are not using any VPN service, this should make things easy. + +The FirstRun app has been replaced with an improved welcome app that guides you through some basic pointers. + +![][5] + +### Other Improvements + +With the latest release, you can also find new wallpapers and updated application packages that include: + + * Thunderbird 78.13.0 + * VLC 3.0.16 + * LibreOffice 7.0.4 + * Calamares Installer 3.2.41.1 + + + +To know more about the release, you can refer to the [official announcement][6]. + +### Download Sparky 6.0 + +SparkyLinux 6.0 is available to download with Xfce and KDE Plasma desktop environments. It supports 32-bit systems as well, which is a good thing. + +If you are already running SparkLinux “Po Tolo” rolling release, you need to update your system to get Sparky 6.0. + +Do note that the rolling version will switch to a stable release. So, if you want to stay on the rolling release, you need to wait for a few days. + +[SparkyLinux 6.0][7] + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/sparkylinux-6-0-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/debian-11-feature/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://riseup.net/en/vpn +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://sparkylinux.org/sparky-6-0-po-tolo/ +[7]: https://sparkylinux.org/download/ From af685a09283aa2b7c79ad58b58a09ff1c079a11e Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 21 Aug 2021 09:17:55 +0800 Subject: [PATCH 129/290] Update 20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ...S 16 Released with Stunning New Look and Array of Updates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index 5802949257..ac7b962524 100644 --- a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -2,7 +2,7 @@ [#]: via: "https://www.debugpoint.com/2021/08/zorin-os-16-release-announcement/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "zd200572" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From a41241822c554998b7b7f662792c1b2b269dc9d1 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 21 Aug 2021 09:37:41 +0800 Subject: [PATCH 130/290] Update 20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ... Stunning New Look and Array of Updates.md | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index ac7b962524..b9325683f6 100644 --- a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -7,25 +7,21 @@ [#]: publisher: " " [#]: url: " " -Zorin OS 16 Released with Stunning New Look and Array of Updates +Zorin OS 16发布:惊艳的新外观和一系列更新 ====== -The team announced the release of brand new Zorin OS 16, bringing some -much-needed improvements and updates. We round up the release in this -post.Linux Kernel 5.11Flathub repo by defaultTaskbarperformancenew -appsmulti-touch touchpad gesturesfractional scaling -![Zorin OS 16 Desktop][1] +Zorin OS 16团队宣布了新系统的发布,带来了许多亟需的更新和改进。 我们在这总结了这次发布。Linux内核5.11 lathub repo默认任务栏性能新应用:多点触摸触摸板手势和缩放![Zorin OS 16 桌面版][1] -The open-source and eye-candy Linux distribution Zorin OS brings its latest stable release version 16 which will be supported with updates and enhancements until 2025. This release brings some unique but useful features, while the team made sure that there is no performance drops. +开源和赏心悦目的Linux发行版Zorin OS发布了它的最新稳定版本16,这个版本将在2025年前提供支持和更新。它有一些独特和有用的特性,同时团队确保性能不会下降。 -Zorin OS uses its own software repository and also uses Ubuntu repo as well. +Zorin OS同时使用自有和Ubuntu的软件仓库. -Let’s take a look at the important new features. +让我们看下重要的新特性。 -### Zorin OS 16 – New Features +### Zorin OS 16 – 新特性 -The latest Zorin OS 16 is powered by (hwe stack). This release is based on **Ubuntu 20.04 LTS**. +最新的Zorin OS 16代号为hwe stack,基于**Ubuntu 20.04 LTS**。 -The major update in this release is inclusion of in Zorin. With this, Zorin Software Store becomes one of the largest collection of applications available in Linux distribution. Because it can now support Flathub plus earlier supports of Snap Store, Ubuntu repo, Zorin own repo and AppImage support. +这个版本最主要的更新是加入了Zorin,Zorin应用商店成为了Linux发行版中最大的应用集之一。因为它可以支持Flathub,另外还有早前的Snap商店,Ubuntu软件仓库, Zorin自有仓库和AppImage支持. Zorin is known for its looks, mostly. In this release, a handful of improvements arrives. Here’s a quick summary: @@ -99,7 +95,7 @@ via: https://www.debugpoint.com/2021/08/zorin-os-16-release-announcement/ 作者:[Arindam][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zd200572](https://github.com/zd200572) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 56fb1f4ba74f4b78a542db7cf33e9a7ba19bb72e Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 21 Aug 2021 10:33:56 +0800 Subject: [PATCH 131/290] Update 20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ... Stunning New Look and Array of Updates.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index b9325683f6..e555c44125 100644 --- a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -23,69 +23,67 @@ Zorin OS同时使用自有和Ubuntu的软件仓库. 这个版本最主要的更新是加入了Zorin,Zorin应用商店成为了Linux发行版中最大的应用集之一。因为它可以支持Flathub,另外还有早前的Snap商店,Ubuntu软件仓库, Zorin自有仓库和AppImage支持. -Zorin is known for its looks, mostly. In this release, a handful of improvements arrives. Here’s a quick summary: +Zorin主要因其外观而闻名,在新版中,有一系列改进,这是一个简要的总结: - * The default theme is more polished with updated icons and color palette. - * New Artwork and wallpapers are pre-loaded. - * The Lock screen can now show a blurred version of your selected wallpaper, giving you a clean look. + * 新的图标和调色板,默认主题更加精致。 + * 预装新的艺术和壁纸。 + * 锁屏现在可以展示一系列自选的模糊图片,给你一个更新简洁的视觉效果。 -icons are enabled active indicator with notification banner with counts. That means, you can get unread message counts, etc. in taskbar icons for example for messaging apps. Taskbar also received a bunch of standard features such as auto hide, transparency, moving icons around, etc. +图标可以通过未读消息条数动态提示。这意味着你可以在任务栏中看到你的未读消息计数,例如信息App。任务栏也有一些基本特性,比如自动隐藏、透明度和移动图标等等。 -![New Taskbar Notification Bubbles][2] +![新的任务栏提示气泡][2] -Many internal improvement received in this release. The details are not available, however as per the team overall desktop experience in all Zorin flavors is much improved from its predecessor [Zorin 15][3]. +新版有许多内部提升,细节不清楚,不过 据该团队称,所有Zorin版本的整体桌面体验都比其前身有了很大改进[Zorin 15][3]. -Two introduces in this release. A Tour app which give you a quick walkthrough of Zorin desktop after first installation. And a new sound recorder app is also introduced. - -If you’re using a laptop, moving between your apps and workspaces is even quicker and easier. Zorin OS 16 introduces , enabled out of the box. Now you can switch between workspaces with fluid 1:1 motion by swiping 4 fingers up or down. Pinch on the touchpad with 3 fingers to open the activities overview and instantly see every app running on your workspaces. +引入了两个新特性,首次安装后可以用不用一个Tour应用概览Zorin桌面,另一个是新的录制应用。 +如果你使用笔记本,应用间和工作空间切换变得更加快捷和简便。Zorin OS 16带来了开箱即用,现在你可以通过向上或向下滑动4个手指,可以在平滑1:1运动在工作空间之间。 用3个手指捏一下触摸板,打开活动概述,立即看到您工作区上运行的每个应用程序。 [][3] -SEE ALSO:   Zorin OS 15.3 Released with Latest LibreOffice, New Software +另见:Zorin OS 15.3版本带来了最新的LibreOffice, 新软件 -Zorin OS 16 is now supports for high resolution displays +Zorin OS 16现在支持高分辨率显示器了 -The installer now includes the NVIDIA drivers which can be selected in the first LIVE disk boot prompt, and the installer now supports encryption. +安装器现在包含了NVIDIA驱动,可以在首次LIVE硬盘启动时选择,也支持加密. -A full details of the change is available [here][4]. +详细的更新日志在[这][4]. -### Zorin OS 16 Minimum System Requirement +### Zorin OS 16 最小系统需求 -#### Zorin OS Core, Education and Pro +#### Zorin OS核心, 教育和Pro版本 - * CPU – 1 GHz Dual Core – Intel/AMD 64-bit processor + * CPU – 1 GHz双核处理器 – Intel/AMD 64位处理器 * RAM – 2 GB - * Storage – 15 GB (Core & Education) or 30 GB (Pro) - * Display – 800 × 600 resolution + * 存储 – 15 GB (C核心和教育版本)或30 GB(Pro版本) + * 显示器 – 800 × 600分辨率 -#### Zorin OS LITE +#### Zorin OS LITE版本 - * CPU – 700 MHz Single Core – Intel/AMD 64-bit or 32-bit processor + * CPU – 700 MHz单核 – Intel/AMD 64或32位处理器 * RAM – 512 MB - * Storage – 10 GB - * Display – 640 × 480 resolution + * 存储 – 10 GB + * 显示器 – 640 × 480分辨率 -### Download Zorin OS 16 +### 下载Zorin OS 16 -It is worth to mention that Zorin comes with a PRO version which is around $39 with additional features such as Windows 11 style look, etc. However, you can always download the free versions – they are Zorin OS 16 Core and Zorin OS 16 LITE (for low- end hardware). You might want to take a look at their feature [comparison][5]. - -You can download the latest .iso from the below link. Likewise, you can either use [Etcher][6] or any other utility to create a LIVE USB for installation. +值得一提的是Zorin发布了一个PRO版本,售价$39,有类似Windows 11风格等额外特性。可是,你仍然可以下载免费版本– Zorin OS 16 Core和Zorin OS 16 LITE(对于低配电脑)。你可能想看下它们的区别 [比较][5]. +你可以从以下链接下载最新的.iso文件。然后,你可以使用[Etcher][6]或斯工具来创建地个LIVE USB启动盘来安装。 [download zorin os 16][7] -#### Upgrade from Zorin 15.x +#### 从Zorin 15.x升级 -There is no upgrade path available at the moment from Zorin OS 15. However, as per the team, an upgrade path will be available soon when Zorin 15 users can easily upgrade to the latest version. +现在还没有从Zorin OS 15升级的方法,可是,据该团队称,未来将会有升级到最新版本的简单方法。 -### Closing Notes +### 闭幕词 -One of the best feature of Zorin is its unique way of handling App ecosystem. It is probably the only Linux desktop distribution which provides out-of-the-box experience to search and install apps from Flathub, Snap Store, AppImage, Ubuntu/Own repo via its Software Store. You do not require to manually configure your system for Snap or Flatpak. That said, It’s still a modified GNOME with additional items. Some may not prefer Zorin and may feel bloated with all these features pre-loaded. In that sense, it is one of the ideal distro for new Linux desktop users who need a ready-made Windows/macOS like feel with all the Linux features. +Zorin的特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App.你不需要 为Snap或者Flatpak手动配置系统。That said, It’s still a modified GNOME with additional items. Some may not prefer Zorin and may feel bloated with all these features pre-loaded. In that sense, it is one of the ideal distro for new Linux desktop users who need a ready-made Windows/macOS like feel with all the Linux features. * * * From 70906f0d1aa8a17461cb15ec5233a1ef4b594192 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 21 Aug 2021 10:44:45 +0800 Subject: [PATCH 132/290] PRF @geekpi --- .../tech/20210813 Install Linux with LVM.md | 61 ++++++++----------- 1 file changed, 26 insertions(+), 35 deletions(-) diff --git a/translated/tech/20210813 Install Linux with LVM.md b/translated/tech/20210813 Install Linux with LVM.md index ead9b1c9d4..32d7571f9a 100644 --- a/translated/tech/20210813 Install Linux with LVM.md +++ b/translated/tech/20210813 Install Linux with LVM.md @@ -3,58 +3,54 @@ [#]: author: "Kenneth Aaron https://opensource.com/users/flyingrhino" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -用 LVM 安装 Linux +在 LVM 上安装 Linux Mint ====== -一个关于让 Linux Mint 20.2 与逻辑卷管理器(LVM)一起工作的教程。 -![Linux keys on the keyboard for a desktop computer][1] -几周前,[Linux Mint][2] 的人员发布了他们的开源操作系统的 20.2 版本。Live ISO 中内置的安装程序非常好,只需要点击几下就可以安装操作系统。如果你想定制你的分区,你甚至有一个内置的分区器。 +> 一个关于让 Linux Mint 20.2 与逻辑卷管理器(LVM)一起工作的教程。 -安装程序主要集中在简单的安装上:定义你的分区并安装到这些分区。对于那些想要更灵活的设置的人来说,[逻辑卷管理器][3] (LVM)是个不错的选择,你可以通过设置卷组并在其中定义你的逻辑卷。 +![](https://img.linux.net.cn/data/attachment/album/202108/21/104418yg111cba52caalc5.jpg) -LVM 是一个硬盘管理系统,允许你在多个物理驱动器上创建存储空间。换句话说,你可以把几个小驱动器“拴”在一起,这样你的操作系统就会把它们当作一个驱动器。除此之外,它还有实时调整大小、文件系统快照和更多的优点。这篇文章并不是关于 LVM 的教程(网上已经有很多[这方面不错的信息][4]了)。 相反,我的目标是保持这个页面的主题,只关注让 Linux Mint 20.2 与 LVM 一起工作。 +几周前,[Linux Mint][2] 的人员发布了他们的开源操作系统的 20.2 版本。Live ISO 中内置的安装程序非常好,只需要点击几下就可以安装操作系统。如果你想定制你的分区,你甚至有一个内置的分区软件。 -作为一个桌面操作系统,安装程序很简单,在 LVM 上安装 LM 20.2 略微复杂一些,但不会太复杂。如果你在安装程序中选择了 LVM,你会得到一个由 Linux Mint 开发者定义的设置,而且你在安装时无法控制各个卷。 +安装程序重点关注在简单的安装上:定义你的分区并安装到这些分区。对于那些想要更灵活的设置的人来说,[逻辑卷管理器][3]logical volume manager(LVM)是个不错的选择,你可以通过设置卷组(VG)并在其中定义你的逻辑卷(LV)。 -然而,有一个解决方案:在 Live ISO 中,该方案只需要在终端中的几个命令来设置 LVM,然后你继续使用常规安装程序来完成工作。 +LVM 是一个硬盘管理系统,允许你在多个物理驱动器上创建存储空间。换句话说,你可以把几个小驱动器“拴”在一起,这样你的操作系统就会把它们当作一个驱动器。除此之外,它还有实时调整大小、文件系统快照和更多的优点。这篇文章并不是关于 LVM 的教程(网上已经有很多 [这方面不错的信息][4]了)。相反,我的目标是贴合这篇文章的主题,只关注让 Linux Mint 20.2 与 LVM 一起工作。 -我安装了 Linux Mint 20.2 和 [XFCE 桌面][5],但其他 LM 桌面的过程也类似。 +作为一个桌面操作系统,其安装程序致力于简单化,在 LVM 上安装 Linux Mint 20.2 会略微复杂一些,但不会太复杂。如果你在安装程序中选择了 LVM,你会得到一个由 Linux Mint 开发者定义的设置,而且你在安装时无法控制各个卷。 + +然而,有一个解决方案:在临场 ISO 中,该方案只需要在终端中使用几个命令来设置 LVM,然后你可以继续使用常规安装程序来完成工作。 + +我安装了 Linux Mint 20.2 和 [XFCE 桌面][5],但其他 Linux Mint 桌面的过程也类似。 ### 分区驱动器 -在 Linux Mint live ISO 中,你可以通过终端和 GUI 工具访问 Linux 命令行工具。如果你需要做任何分区工作,你可以使用命令行 `fdisk` 或 `parted` 命令,或者 GUI 应用 `gparted`。我想让这些说明简单到任何人都能遵循,所以我会在可能的情况下使用 GUI 工具,在必要时使用命令行工具。 +在 Linux Mint 临场 ISO 中,你可以通过终端和 GUI 工具访问 Linux 命令行工具。如果你需要做任何分区工作,你可以使用命令行 `fdisk` 或 `parted` 命令,或者 GUI 应用 `gparted`。我想让这些操作简单到任何人都能遵循,所以我会在可能的情况下使用 GUI 工具,在必要时使用命令行工具。 首先,为安装创建几个分区。 -使用 `gparted` (从菜单中启动),完成以下工作: +使用 `gparted`(从菜单中启动),完成以下工作: -首先,创建一个 512MB 的分区,类型为 **FAT32**(这是用来确保系统可启动)。512MB 对大多数人来说是多余的,你可以用 256MB 甚至更少,但在今天的大磁盘中,即使分配 512MB 也不是什么大问题。 +首先,创建一个 512MB 的分区,类型为 FAT32(这是用来确保系统可启动)。512MB 对大多数人来说是富余的,你可以用 256MB 甚至更少,但在今天的大容量磁盘中,即使分配 512MB 也不是什么大问题。 ![Creating a boot partition][6] -CC BY-SA Seth Kenlon - -接下来,在磁盘的其余部分创建一个 `lvm2 pv` 类型的分区(这是你的 LVM 的位置)。 +接下来,在磁盘的其余部分创建一个 `lvm2 pv` 类型(LVM 2 物理卷)的分区(这是你的 LVM 的位置)。 ![Partition layout][7] -CC BY-SA Seth Kenlon - 现在打开一个终端窗口,并将你的权限提升到 root: - ``` $ sudo -s # whoami root ``` -接下来,你必须找到你之前创建的 LVM 成员(大分区)。使用下列命令之一: `lsblk -f` 或 `pvs` 或 `pvscan`。 - +接下来,你必须找到你之前创建的 LVM 成员(那个大分区)。使用下列命令之一:`lsblk -f` 或 `pvs` 或 `pvscan`。 ``` # pvs @@ -64,42 +60,37 @@ PV VG Fmt [...] 在我的例子中,该分区位于 `/dev/sda2`,但你应该用你的输出中得到的内容来替换它。 -现在你知道了你的分区有哪些设备,你可以在那里创建一个 LVM 卷组: - +现在你知道了你的分区有哪些设备,你可以在那里创建一个 LVM 卷组(VG): ``` -`# vgcreate vg /dev/sda2` +# vgcreate vg /dev/sda2 ``` 你可以使用 `vgs` 或 `vgscan` 看到你创建的卷组的细节。 -创建你想在安装时使用的逻辑卷。为了简单,我分别创建了根分区(`/`)和 `swap` 分区,但是你可以根据需要创建更多的分区(例如,为 `/home` 创建一个单独的分区)。 - +创建你想在安装时使用的逻辑卷(LV)。为了简单,我分别创建了 `root` 根分区(`/`)和 `swap` 交换分区,但是你可以根据需要创建更多的分区(例如,为 `/home` 创建一个单独的分区)。 ``` # lvcreate -L 80G -n root vg # lvcreate -L 16G -n swap vg ``` -我的例子中的分区大小是任意的,是基于我可用的。使用对你的硬盘有意义的分区大小。 +我的例子中的分区大小是任意的,是基于我可用的空间。使用对你的硬盘有意义的分区大小。 你可以用 `lvs` 或 `lvdisplay` 查看逻辑卷。 -终端到这就结束了。 +终端操作到这就结束了。 ### 安装 Linux 现在从桌面上的图标启动安装程序: - * 进入 **Installation type**,选择 **Something else**。 + * 进入 “Installation type”,选择 “Something else”。 * 编辑 512Mb 的分区并将其改为 `EFI`。 - * 编辑根 LV,将其改为 `ext4`(或一个你选择的文件系统)。选择将其挂载为根目录,并选择将其格式化。 - * 编辑交换分区并将其设置为`swap`。 + * 编辑根逻辑卷,将其改为 `ext4`(或一个你选择的文件系统)。选择将其挂载为根目录(`/`),并选择将其格式化。 + * 编辑 `swap` 分区并将其设置为交换分区。 * 继续正常的安装过程。Linux Mint 安装程序会将文件放在正确的位置并为你创建挂载点。 - - - 完成了。在你的 Linux Mint 安装中享受 LVM 的强大。 如果你需要调整分区大小或在系统上做任何高级工作,你会感谢选择 LVM。 @@ -111,7 +102,7 @@ via: https://opensource.com/article/21/8/install-linux-mint-lvm 作者:[Kenneth Aaron][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9c0f520278f5fb41c57afde05debf213e18ed8fd Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 21 Aug 2021 10:45:51 +0800 Subject: [PATCH 133/290] Update 20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ...S 16 Released with Stunning New Look and Array of Updates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index e555c44125..59853cda48 100644 --- a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -83,7 +83,7 @@ Zorin OS 16现在支持高分辨率显示器了 ### 闭幕词 -Zorin的特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App.你不需要 为Snap或者Flatpak手动配置系统。That said, It’s still a modified GNOME with additional items. Some may not prefer Zorin and may feel bloated with all these features pre-loaded. In that sense, it is one of the ideal distro for new Linux desktop users who need a ready-made Windows/macOS like feel with all the Linux features. +Zorin的特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App.你不需要 为Snap或者Flatpak手动配置系统。也就是说,它仍然是一个带有附加项目的GNOME修改版。有些人可能不喜欢Zorin,可能会因为预装了所有这些功能而感到臃肿。从这方面说,它是需要功能完善的Windows/macOS系统的Linux桌面新用户的理想发行版之一。 * * * From 87c8af15574f3f468bd5d22ba3fb07ddf71182c7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 21 Aug 2021 10:45:57 +0800 Subject: [PATCH 134/290] PUB @geekpi https://linux.cn/article-13704-1.html --- .../tech => published}/20210813 Install Linux with LVM.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210813 Install Linux with LVM.md (98%) diff --git a/translated/tech/20210813 Install Linux with LVM.md b/published/20210813 Install Linux with LVM.md similarity index 98% rename from translated/tech/20210813 Install Linux with LVM.md rename to published/20210813 Install Linux with LVM.md index 32d7571f9a..1c6d955cb6 100644 --- a/translated/tech/20210813 Install Linux with LVM.md +++ b/published/20210813 Install Linux with LVM.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13704-1.html" 在 LVM 上安装 Linux Mint ====== From 821dc6679d79b08deb6bf4b21a0aa470cc5ed4d8 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 21 Aug 2021 11:12:58 +0800 Subject: [PATCH 135/290] Update and rename sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md to translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ... Stunning New Look and Array of Updates.md | 44 ++++++++++--------- 1 file changed, 24 insertions(+), 20 deletions(-) rename {sources => translated}/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md (56%) diff --git a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md similarity index 56% rename from sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md rename to translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index 59853cda48..31275baa4a 100644 --- a/sources/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -9,9 +9,13 @@ Zorin OS 16发布:惊艳的新外观和一系列更新 ====== -Zorin OS 16团队宣布了新系统的发布,带来了许多亟需的更新和改进。 我们在这总结了这次发布。Linux内核5.11 lathub repo默认任务栏性能新应用:多点触摸触摸板手势和缩放![Zorin OS 16 桌面版][1] +该团队宣布发布全新的Zorin OS 16,带来了许多急需的更新和改进。 我们在这总结了这个版本。 +- Linux内核5.11 +- 默认Flathub软件仓库 +- 任务栏性能新应用:多点触摸触摸板手势和缩放! +[Zorin OS 16 桌面版][1] -开源和赏心悦目的Linux发行版Zorin OS发布了它的最新稳定版本16,这个版本将在2025年前提供支持和更新。它有一些独特和有用的特性,同时团队确保性能不会下降。 +开源和赏心悦目的Linux发行版Zorin OS发布了它的最新稳定版本16,这个版本将在2025年前提供增强支持和更新。它有一些独特和有用的特性,同时团队确保性能不会下降。 Zorin OS同时使用自有和Ubuntu的软件仓库. @@ -19,38 +23,38 @@ Zorin OS同时使用自有和Ubuntu的软件仓库. ### Zorin OS 16 – 新特性 -最新的Zorin OS 16代号为hwe stack,基于**Ubuntu 20.04 LTS**。 +最新的Zorin OS 16由hwe stack提供,基于**Ubuntu 20.04 LTS**。 -这个版本最主要的更新是加入了Zorin,Zorin应用商店成为了Linux发行版中最大的应用集之一。因为它可以支持Flathub,另外还有早前的Snap商店,Ubuntu软件仓库, Zorin自有仓库和AppImage支持. +这个版本最主要的更新在Zorin中,Zorin应用商店成为了Linux发行版中最大的应用程序集合之一。因为它可以支持Flathub,另外还有早前的Snap商店,Ubuntu软件仓库, Zorin自有仓库和AppImage支持. Zorin主要因其外观而闻名,在新版中,有一系列改进,这是一个简要的总结: * 新的图标和调色板,默认主题更加精致。 - * 预装新的艺术和壁纸。 - * 锁屏现在可以展示一系列自选的模糊图片,给你一个更新简洁的视觉效果。 + * 预装新的艺术品图片和壁纸。 + * 锁屏现在可以展示自选的壁纸的模糊效果,给你一个更简洁的视觉效果。 -图标可以通过未读消息条数动态提示。这意味着你可以在任务栏中看到你的未读消息计数,例如信息App。任务栏也有一些基本特性,比如自动隐藏、透明度和移动图标等等。 +图标启用活动指示器,带有计数的通知横幅。这意味着你可以在任务栏图标中获取未读消息计数等信息,例如信息App。任务栏还有一些基本特性,比如自动隐藏、透明度和移动图标等等。 -![新的任务栏提示气泡][2] +![新的任务栏通知气泡][2] -新版有许多内部提升,细节不清楚,不过 据该团队称,所有Zorin版本的整体桌面体验都比其前身有了很大改进[Zorin 15][3]. +新版有许多内部提升,细节不清楚,不过根据团队的整体桌面体验,所有Zorin版本的整体桌面体验都比其前身[Zorin 15][3]有了很大改进. -引入了两个新特性,首次安装后可以用不用一个Tour应用概览Zorin桌面,另一个是新的录制应用。 +此版本中有两个介绍,首次安装后可以用一个Tour应用概览Zorin桌面,另一个是新的录制应用。 -如果你使用笔记本,应用间和工作空间切换变得更加快捷和简便。Zorin OS 16带来了开箱即用,现在你可以通过向上或向下滑动4个手指,可以在平滑1:1运动在工作空间之间。 用3个手指捏一下触摸板,打开活动概述,立即看到您工作区上运行的每个应用程序。 +如果你使用笔记本,应用和工作区间切换变得更加快捷和简便。Zorin OS 16带来了开箱即用,现在你可以通过向上或向下滑动4个手指,以流畅的 1:1 动作在工作区之间切换。 用3个手指在触摸板撮合,打开活动概述,可以看到您工作区中运行的每个应用程序。 [][3] -另见:Zorin OS 15.3版本带来了最新的LibreOffice, 新软件 +另见:Zorin OS 15.3版本随最新的LibreOffice一起发布, 新软件 -Zorin OS 16现在支持高分辨率显示器了 +Zorin OS 16现在支持高分辨率显示器 -安装器现在包含了NVIDIA驱动,可以在首次LIVE硬盘启动时选择,也支持加密. +安装器程序现在包含了NVIDIA驱动,可以在首次LIVE硬盘启动时选择,也支持加密. 详细的更新日志在[这][4]. -### Zorin OS 16 最小系统需求 +### Zorin OS 16 最低系统要求 #### Zorin OS核心, 教育和Pro版本 @@ -72,16 +76,16 @@ Zorin OS 16现在支持高分辨率显示器了 ### 下载Zorin OS 16 -值得一提的是Zorin发布了一个PRO版本,售价$39,有类似Windows 11风格等额外特性。可是,你仍然可以下载免费版本– Zorin OS 16 Core和Zorin OS 16 LITE(对于低配电脑)。你可能想看下它们的区别 [比较][5]. +值得一提的是Zorin发布了一个PRO版本,售价$39,有类似Windows 11风格等额外特性。可是,你仍然可以随时下载免费版本– Zorin OS 16 Core和Zorin OS 16 LITE(对于低配电脑)。你可能想看下它们的功能[比较][5]. -你可以从以下链接下载最新的.iso文件。然后,你可以使用[Etcher][6]或斯工具来创建地个LIVE USB启动盘来安装。 -[download zorin os 16][7] +你可以从以下链接下载最新的.iso文件。然后,你可以使用[Etcher][6]或其他工具来创建LIVE USB启动盘来安装。 +[下载zorin os 16][7] #### 从Zorin 15.x升级 -现在还没有从Zorin OS 15升级的方法,可是,据该团队称,未来将会有升级到最新版本的简单方法。 +现在还没有从Zorin OS 15升级的路径,可是,据该团队称,未来将会有升级到最新版本的简单方法。 -### 闭幕词 +### 结束语 Zorin的特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App.你不需要 为Snap或者Flatpak手动配置系统。也就是说,它仍然是一个带有附加项目的GNOME修改版。有些人可能不喜欢Zorin,可能会因为预装了所有这些功能而感到臃肿。从这方面说,它是需要功能完善的Windows/macOS系统的Linux桌面新用户的理想发行版之一。 From 2e1503261a38ecad744cc00b0f00eb159528c9c0 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 21 Aug 2021 11:23:18 +0800 Subject: [PATCH 136/290] Update 20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ...ased with Stunning New Look and Array of Updates.md | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index 31275baa4a..e62f9ee866 100644 --- a/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -23,7 +23,7 @@ Zorin OS同时使用自有和Ubuntu的软件仓库. ### Zorin OS 16 – 新特性 -最新的Zorin OS 16由hwe stack提供,基于**Ubuntu 20.04 LTS**。 +最新的Zorin OS 16由hwe stack提供支持,基于**Ubuntu 20.04 LTS**。 这个版本最主要的更新在Zorin中,Zorin应用商店成为了Linux发行版中最大的应用程序集合之一。因为它可以支持Flathub,另外还有早前的Snap商店,Ubuntu软件仓库, Zorin自有仓库和AppImage支持. @@ -31,7 +31,7 @@ Zorin主要因其外观而闻名,在新版中,有一系列改进,这是一 * 新的图标和调色板,默认主题更加精致。 * 预装新的艺术品图片和壁纸。 - * 锁屏现在可以展示自选的壁纸的模糊效果,给你一个更简洁的视觉效果。 + * 锁屏现在可以展示自选壁纸的模糊效果,给你一个更简洁的视觉效果。 @@ -60,7 +60,7 @@ Zorin OS 16现在支持高分辨率显示器 * CPU – 1 GHz双核处理器 – Intel/AMD 64位处理器 * RAM – 2 GB - * 存储 – 15 GB (C核心和教育版本)或30 GB(Pro版本) + * 存储 – 15 GB (核心和教育版本)或30 GB(Pro版本) * 显示器 – 800 × 600分辨率 @@ -76,7 +76,7 @@ Zorin OS 16现在支持高分辨率显示器 ### 下载Zorin OS 16 -值得一提的是Zorin发布了一个PRO版本,售价$39,有类似Windows 11风格等额外特性。可是,你仍然可以随时下载免费版本– Zorin OS 16 Core和Zorin OS 16 LITE(对于低配电脑)。你可能想看下它们的功能[比较][5]. +值得一提的是Zorin发布了一个PRO版本,售价大约$39,有类似Windows 11风格等额外特性。可是,你仍然可以随时下载免费版本– Zorin OS 16 Core和Zorin OS 16 LITE(对于低配电脑)。你可能想看下它们的功能[比较][5]. 你可以从以下链接下载最新的.iso文件。然后,你可以使用[Etcher][6]或其他工具来创建LIVE USB启动盘来安装。 [下载zorin os 16][7] @@ -87,7 +87,7 @@ Zorin OS 16现在支持高分辨率显示器 ### 结束语 -Zorin的特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App.你不需要 为Snap或者Flatpak手动配置系统。也就是说,它仍然是一个带有附加项目的GNOME修改版。有些人可能不喜欢Zorin,可能会因为预装了所有这些功能而感到臃肿。从这方面说,它是需要功能完善的Windows/macOS系统的Linux桌面新用户的理想发行版之一。 +Zorin的最佳特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App。你不需要为Snap或者Flatpak手动配置系统。也就是说,它仍然是一个带有附加项目的GNOME修改版。有些人可能不喜欢Zorin,可能会因为它预装了所有这些功能而感到臃肿。从这个意义上说,它是Linux桌面新用户的理想发行版之一,这些用户需要拥有所有 Linux 功能的现成的Windows/macOS系统的。 * * * From 0aa945cbf6b23e1068f170861f758188f758a9bc Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 21 Aug 2021 11:24:23 +0800 Subject: [PATCH 137/290] Update 20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md --- ...S 16 Released with Stunning New Look and Array of Updates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index e62f9ee866..db58829a98 100644 --- a/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -87,7 +87,7 @@ Zorin OS 16现在支持高分辨率显示器 ### 结束语 -Zorin的最佳特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App。你不需要为Snap或者Flatpak手动配置系统。也就是说,它仍然是一个带有附加项目的GNOME修改版。有些人可能不喜欢Zorin,可能会因为它预装了所有这些功能而感到臃肿。从这个意义上说,它是Linux桌面新用户的理想发行版之一,这些用户需要拥有所有 Linux 功能的现成的Windows/macOS系统的。 +Zorin的最佳特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App。你不需要为Snap或者Flatpak手动配置系统。也就是说,它仍然是一个带有附加项目的GNOME修改版。有些人可能不喜欢Zorin,可能会因为它预装了所有这些功能而感到臃肿。从这个意义上说,它是Linux桌面新用户的理想发行版之一,这些用户需要拥有所有现成的Linux功能,类似Windows/macOS系统的感觉。 * * * From f1d90cc795dfabaa694587be134e9841141d595a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 21 Aug 2021 12:19:09 +0800 Subject: [PATCH 138/290] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zd200572 这篇有点赶了,不够细致,下篇加油! --- ... Stunning New Look and Array of Updates.md | 83 +++++++++---------- 1 file changed, 37 insertions(+), 46 deletions(-) diff --git a/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index db58829a98..3cbc554155 100644 --- a/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -3,93 +3,84 @@ [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" [#]: translator: "zd200572" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -Zorin OS 16发布:惊艳的新外观和一系列更新 +Zorin OS 16 发布:惊艳的新外观和一系列更新 ====== -该团队宣布发布全新的Zorin OS 16,带来了许多急需的更新和改进。 我们在这总结了这个版本。 -- Linux内核5.11 -- 默认Flathub软件仓库 -- 任务栏性能新应用:多点触摸触摸板手势和缩放! -[Zorin OS 16 桌面版][1] -开源和赏心悦目的Linux发行版Zorin OS发布了它的最新稳定版本16,这个版本将在2025年前提供增强支持和更新。它有一些独特和有用的特性,同时团队确保性能不会下降。 +![](https://img.linux.net.cn/data/attachment/album/202108/21/121757gvsasswbt28085r6.jpg) -Zorin OS同时使用自有和Ubuntu的软件仓库. +Zorin 团队宣布发布了全新的 Zorin OS 16,带来了许多急需的更新和改进。 我们在这篇文章中对这个版本进行了总结。 + +![Zorin OS 16 桌面版][1] + +开源而赏心悦目的 Linux 发行版 Zorin OS 发布了它的最新稳定的第 16 个版本,这个版本会在 2025 年前提供增强和更新支持。该团队在确保性能不会下降的同时,提供了一些独特和有用的特性。 + +Zorin OS 使用自有的软件参考,同时也可以使用 Ubuntu 的软件仓库。 让我们看下重要的新特性。 ### Zorin OS 16 – 新特性 -最新的Zorin OS 16由hwe stack提供支持,基于**Ubuntu 20.04 LTS**。 +最新的 Zorin OS 16 建立在 Linux 内核 5.11(hwe 栈)的支持上,该版本基于 Ubuntu 20.04 LTS。 -这个版本最主要的更新在Zorin中,Zorin应用商店成为了Linux发行版中最大的应用程序集合之一。因为它可以支持Flathub,另外还有早前的Snap商店,Ubuntu软件仓库, Zorin自有仓库和AppImage支持. +这个版本最主要的变化是在 Zorin 中 **默认包括了 Flathub 软件仓库**。由此,Zorin 应用商店成为了 Linux 发行版中最大的应用程序集合之一。因为它可以支持 Flathub,另外还有早前支持的 Snap 商店、Ubuntu 软件仓库、Zorin 自有仓库,和对 AppImage 的支持。 -Zorin主要因其外观而闻名,在新版中,有一系列改进,这是一个简要的总结: +Zorin 主要因其外观而闻名,在这个版本中,有一系列改进,这是一个简要的总结: - * 新的图标和调色板,默认主题更加精致。 - * 预装新的艺术品图片和壁纸。 + * 新的图标和色彩方案,默认主题更加精致。 + * 预装了新的设计和壁纸。 * 锁屏现在可以展示自选壁纸的模糊效果,给你一个更简洁的视觉效果。 - - -图标启用活动指示器,带有计数的通知横幅。这意味着你可以在任务栏图标中获取未读消息计数等信息,例如信息App。任务栏还有一些基本特性,比如自动隐藏、透明度和移动图标等等。 +任务栏图标启用了活动指示器,以及带有计数的通知气泡。这意味着你可以在任务栏图标中获取信息 App 的未读消息计数等信息。任务栏还有一些基本特性,比如自动隐藏、透明度和移动图标等等。 ![新的任务栏通知气泡][2] -新版有许多内部提升,细节不清楚,不过根据团队的整体桌面体验,所有Zorin版本的整体桌面体验都比其前身[Zorin 15][3]有了很大改进. +新版有许多内部提升,细节尚不清楚,但根据团队的意见,所有 Zorin 风格的整体桌面体验比其前身 [Zorin 15][3] 有了很大改进。 -此版本中有两个介绍,首次安装后可以用一个Tour应用概览Zorin桌面,另一个是新的录制应用。 +此版本中引入两个新应用,首次安装后可以用一个 Tour 应用概览 Zorin 桌面,另一个引入的是新的录音应用。 -如果你使用笔记本,应用和工作区间切换变得更加快捷和简便。Zorin OS 16带来了开箱即用,现在你可以通过向上或向下滑动4个手指,以流畅的 1:1 动作在工作区之间切换。 用3个手指在触摸板撮合,打开活动概述,可以看到您工作区中运行的每个应用程序。 -[][3] +如果你使用笔记本,在应用和工作区间切换变得更加快捷和简便。Zorin OS 16 带来了多点触控手势,开箱即用。现在你可以通过上下滑动 4 个手指,以流畅的 1:1 动作在工作区之间切换。 用 3 个手指在触摸板撮合,可以打开活动概述,看到你工作区中运行的每个应用程序。 -另见:Zorin OS 15.3版本随最新的LibreOffice一起发布, 新软件 +Zorin OS 16 现在支持高分辨率显示器的分数缩放。 -Zorin OS 16现在支持高分辨率显示器 +安装器程序现在包含了 NVIDIA 驱动,可以在首次用临场盘启动时选择,它也支持加密。 -安装器程序现在包含了NVIDIA驱动,可以在首次LIVE硬盘启动时选择,也支持加密. - -详细的更新日志在[这][4]. +详细的更新日志在 [这里][4]。 ### Zorin OS 16 最低系统要求 -#### Zorin OS核心, 教育和Pro版本 +Zorin OS Core、Education 和 Pro - * CPU – 1 GHz双核处理器 – Intel/AMD 64位处理器 + * CPU – 1 GHz 双核处理器,Intel/AMD 64 位处理器 * RAM – 2 GB - * 存储 – 15 GB (核心和教育版本)或30 GB(Pro版本) - * 显示器 – 800 × 600分辨率 + * 存储 – 15 GB(Core & Education)或 30 GB(Pro) + * 显示器 – 800 × 600 分辨率 +Zorin OS LITE - -#### Zorin OS LITE版本 - - * CPU – 700 MHz单核 – Intel/AMD 64或32位处理器 + * CPU – 700 MHz 单核,Intel/AMD 64 或 32 位处理器 * RAM – 512 MB * 存储 – 10 GB - * 显示器 – 640 × 480分辨率 + * 显示器 – 640 × 480 分辨率 +### 下载 Zorin OS 16 +值得一提的是 Zorin 发布了一个 PRO 版本,售价大约 $39,有类似 Windows 11 风格等额外特性。可是,你仍然可以随时下载免费版本:Zorin OS 16 Core 和 Zorin OS 16 LITE(用于低配电脑)。你可能想看下它们的功能 [比较][5]。 -### 下载Zorin OS 16 +你可以从以下链接下载最新的 .iso 文件。然后,你可以使用 [Etcher][6] 或其他工具来创建临场 USB 启动盘来安装。 -值得一提的是Zorin发布了一个PRO版本,售价大约$39,有类似Windows 11风格等额外特性。可是,你仍然可以随时下载免费版本– Zorin OS 16 Core和Zorin OS 16 LITE(对于低配电脑)。你可能想看下它们的功能[比较][5]. +- [下载 zorin os 16][7] -你可以从以下链接下载最新的.iso文件。然后,你可以使用[Etcher][6]或其他工具来创建LIVE USB启动盘来安装。 -[下载zorin os 16][7] +### 从 Zorin 15.x 升级 -#### 从Zorin 15.x升级 - -现在还没有从Zorin OS 15升级的路径,可是,据该团队称,未来将会有升级到最新版本的简单方法。 +现在还没有从 Zorin OS 15 升级的路径,不过据该团队称,未来将会有升级到最新版本的简单方法。 ### 结束语 -Zorin的最佳特性之一是它独特的App生态处理方式。它可能是唯一的提供开箱即用体验的Linux桌面发行版,可以从Flathub, Snap商店, AppImage, Ubuntu/自有软件仓库,通过它的软件商店搜索和安装App。你不需要为Snap或者Flatpak手动配置系统。也就是说,它仍然是一个带有附加项目的GNOME修改版。有些人可能不喜欢Zorin,可能会因为它预装了所有这些功能而感到臃肿。从这个意义上说,它是Linux桌面新用户的理想发行版之一,这些用户需要拥有所有现成的Linux功能,类似Windows/macOS系统的感觉。 - -* * * +Zorin 的最佳特性之一是它独特的应用生态处理方式。它可能是唯一提供开箱即用体验的 Linux 桌面发行版,可以通过它的软件商店从 Flathub、Snap 商店、AppImage、Ubuntu / 自有软件仓库来搜索和安装应用。你不需要为 Snap 或者 Flatpak 手动配置系统。也就是说,它仍然是一个带有附加项目的 GNOME 修改版。可能有些人不喜欢 Zorin,可能会因为它预装了所有这些功能而感到臃肿。从某种意义上说,它是 Linux 桌面新用户的理想发行版之一,这些用户需要拥有类似 Windows/macOS 系统感觉的现成的 Linux 功能。 -------------------------------------------------------------------------------- @@ -98,7 +89,7 @@ via: https://www.debugpoint.com/2021/08/zorin-os-16-release-announcement/ 作者:[Arindam][a] 选题:[lujun9972][b] 译者:[zd200572](https://github.com/zd200572) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 7750dc036daf28a64ba2391faf3b93f654d73c72 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 21 Aug 2021 12:20:31 +0800 Subject: [PATCH 139/290] PUB @zd200572 https://linux.cn/article-13705-1.html --- ...16 Released with Stunning New Look and Array of Updates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md (98%) diff --git a/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/published/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md similarity index 98% rename from translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md rename to published/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md index 3cbc554155..f7003aad4f 100644 --- a/translated/news/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md +++ b/published/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zd200572" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13705-1.html" Zorin OS 16 发布:惊艳的新外观和一系列更新 ====== From b8b10bdcd5c148adbf04012fe417929f158e0824 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Sat, 21 Aug 2021 20:46:33 +0800 Subject: [PATCH 140/290] translating by perfiffer --- sources/tech/20210806 Access OpenVPN from a client computer.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210806 Access OpenVPN from a client computer.md b/sources/tech/20210806 Access OpenVPN from a client computer.md index 8c2b518bea..cc7605a18c 100644 --- a/sources/tech/20210806 Access OpenVPN from a client computer.md +++ b/sources/tech/20210806 Access OpenVPN from a client computer.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/7/openvpn-client" [#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 252410b32fe23b8797f15d02a1392cd3700ab9fa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 22 Aug 2021 05:02:29 +0800 Subject: [PATCH 141/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210822=20?= =?UTF-8?q?Linux=20Phones:=20Here=20are=20Your=20Options?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210822 Linux Phones- Here are Your Options.md --- ...822 Linux Phones- Here are Your Options.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 sources/tech/20210822 Linux Phones- Here are Your Options.md diff --git a/sources/tech/20210822 Linux Phones- Here are Your Options.md b/sources/tech/20210822 Linux Phones- Here are Your Options.md new file mode 100644 index 0000000000..121c32200a --- /dev/null +++ b/sources/tech/20210822 Linux Phones- Here are Your Options.md @@ -0,0 +1,134 @@ +[#]: subject: "Linux Phones: Here are Your Options" +[#]: via: "https://itsfoss.com/linux-phones/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Phones: Here are Your Options +====== + +_**Brief:**_ _Linux phones could be the future to replace Android or iOS, but what are some of your options to give it a try?_ + +While Android is based on a Linux kernel, it has been heavily modified. So, that does not make it a full-fledged Linux-based operating system. + +Google is trying to get the Android kernel close to the mainline Linux kernel, but that is still a distant dream. + +So, in that case, what are some of the options if you are looking for a Linux phone? A smartphone powered by a Linux operating system. + +It is not an easy decision to make because the options are super limited. Hence, I try to highlight some of the best Linux phones and a few different options from the mainstream choices. + +### Top Linux phones you can use today + +It is worth noting that the Linux phones mentioned here may not be able to replace your Android or iOS devices. So, make sure that you do some background research before making a purchase decision. + +**Note:** You need to carefully check the availability, expected shipping date, and risks of using a Linux phone. Most of the options are only suitable for enthusiasts or early adopters. + +#### 1\. PinePhone + +![][1] + +PinePhone is one of the most affordable and popular choices to consider as a promising Linux phone. + +It is not limited to a single operating system. You can try it with Manjaro with Plasma mobile OS, UBports, Sailfish OS, and others. PinePhone packs in some decent specifications that include a Quad-core processor and 2/3 Gigs of RAM. It does support a bootable microSD card to help you with installation, along with 16/32 GB eMMC storage options. + +The display is a basic 1440×720p IPS screen. You also get special privacy protection tweaks like kill switches for Bluetooth, microphones, and cameras. + +PinePhone also gives you an option to add custom hardware extensions using the six pogo pins available. + +The base edition (2 GB RAM and 16 GB storage) comes loaded with Manjaro by default and costs $149. And, the convergence edition (3 GB RAM / 32 GB storage) costs $199. + +[PinePhone][2] + +#### 2\. Fairphone + +![][3] + +Compared to others on the list, Fairphone is a commercial success. It is not a Linux smartphone, but it features a customized version of Android, i.e., Fairphone OS, and the option to opt for [/e/ OS][4], one of the [open-source Android alternatives][5]. Some community ports are available if you want to use the Linux operating system, but it could be a hit and miss. + +The Fairphone offers some decent specs, considering there are two different variants. You will find a 48 MP camera sensor for Fairphone 3+ and a full-HD display. Not to forget, you will also find decent Qualcomm processors powering the device. + +They focus on making smartphones that are sustainable and have been built using some amount of recycled plastic. Fairphone is also meant to be easily repairable. + +So, it is not just an option away from mainstream smartphones, but you will also be helping with protecting the environment if you opt for it. + +[Fairphone][6] + +### 3\. Librem 5 + +![][7] + +[Librem 5][8] is a smartphone that focuses heavily on user privacy while featuring an open-source operating system, i.e., PureOS, not based on Android. + +The specifications offered are decent, with 3 Gigs of RAM and a quad-core Cortex A53 chipset. But, this is not something geared to compete with mainstream options. Hence, you may not find it as a value for money offering. + +It is aimed at enthusiasts who are interested in testing privacy-respecting smartphones in the process. + +Similar to others, Librem 5 also focuses on making the phone easily repairable by offering user-replaceable batteries. + +For privacy, you will notice kill switches for Bluetooth, Cameras, and microphones. They also promise security updates for years to come. + +[Librem 5][9] + +### 4\. Pro 1X + +![][10] + +An interesting smartphone that supports Ubuntu Touch, Lineage OS, and Android as well. + +It is not just a Linux smartphone but a mobile phone with a separate QWERTY keypad, which is rare to find these days. + +The Pro 1 X features a decent specification, including a Snapdragon 662 processor coupled with 6 GB of RAM. You also get a respectable AMOLED Full HD display with the Pro 1 X. + +The camera does not pack in anything crazy, but should be good enough for the most part. + +[Pro 1X][11] + +### 5\. Volla Phone + +![][12] + +An attractive offering that runs on Ubuntu Touch by UBports. + +It comes with a pre-built VPN and focuses on making the user experience easy. The operating system has been customized so that everything essential should be accessible quickly without organizing anything yourself. + +It packs in some impressive specifications that include an Octa-core MediaTek processor along with a 4700 mAh battery. You get a notch design resembling some of the latest smartphones available. + +[Volla Phone][13] + +### Wrapping Up + +Linux smartphones are not readily available and certainly not yet suitable for the masses. + +So, if you are an enthusiast or want to support the development of such phones, you can consider getting one of the devices. + +Do you already own one of these smartphones? Please don’t hesitate to share your experiences in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-phones/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/PinePhone-3.jpg?resize=800%2C800&ssl=1 +[2]: https://www.pine64.org/pinephone/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/fairphone.png?resize=360%2C600&ssl=1 +[4]: https://itsfoss.com/e-os-review/ +[5]: https://itsfoss.com/open-source-alternatives-android/ +[6]: https://shop.fairphone.com/en/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/librem-5.png?resize=800%2C450&ssl=1 +[8]: https://itsfoss.com/librem-linux-phone/ +[9]: https://puri.sm/products/librem-5/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/pro1x.jpg?resize=800%2C542&ssl=1 +[11]: https://www.fxtec.com/pro1x +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/volla-smartphone.jpg?resize=695%2C391&ssl=1 +[13]: https://www.indiegogo.com/projects/volla-phone-free-your-mind-protect-your-privacy#/ From 09cd9a2bce41b1481fb435a8397aad24bd10ff79 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 22 Aug 2021 05:02:51 +0800 Subject: [PATCH 142/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210821=20?= =?UTF-8?q?How=20to=20set=20up=20your=20printer=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210821 How to set up your printer on Linux.md --- ...821 How to set up your printer on Linux.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20210821 How to set up your printer on Linux.md diff --git a/sources/tech/20210821 How to set up your printer on Linux.md b/sources/tech/20210821 How to set up your printer on Linux.md new file mode 100644 index 0000000000..9ca81518bf --- /dev/null +++ b/sources/tech/20210821 How to set up your printer on Linux.md @@ -0,0 +1,109 @@ +[#]: subject: "How to set up your printer on Linux" +[#]: via: "https://opensource.com/article/21/8/add-printer-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to set up your printer on Linux +====== +In the event that your printer isn't auto-detected, this article teaches +you how to add a printer on Linux manually. +![printing on Linux][1] + +Even though it's the future now and we're all supposed to be using e-ink and AR, there are still times when a printer is useful. Printer manufacturers have yet to standardize how their peripherals communicate with computers, so there's a necessary maze of printer drivers out there, regardless of what platform you're on. The IEEE-ISTO Printer Working Group (PWG) and the OpenPrinting.org site are working tirelessly to make printing as easy as possible, though. Today, many printers are autodetected with no interaction from the user. + +In the event that your printer isn't auto-detected, this article teaches you how to add a printer on Linux manually. This article assumes you're on the GNOME desktop, but the basic workflow is the same for KDE and most other desktops. + +### Printer drivers + +Before attempting to interface with a printer from Linux, you should first verify that you have updated printer drivers. + +There are three varieties of printer drivers: + + * Open source [Gutenprint drivers][2] bundled with Linux and as an installable package + * Drivers provided by the printer manufacturer + * Drivers created by a third party + + + +It's worth installing the open source drivers because there are over 700 of them, so having them available increases the chance of attaching a printer and having it automatically configured for you. + +### Installing open source drivers + +Your Linux distribution probably already has these installed, but if not, you can install them with your package manager. For example, on Fedora, CentOS, Mageia, and similar: + + +``` +`$ sudo dnf install gutenprint` +``` + +For HP printers, also install Hewlett-Packard's Linux Imaging and Printing (HPLIP) project. For example, on Debian, Linux Mint, and similar: + + +``` +`$ sudo apt install hplip` +``` + +### Installing vendor drivers + +Sometimes a printer manufacturer uses non-standard protocols, so the open source drivers don't work. Other times, the open source drivers work but may lack special vendor-only features. When that happens, you must visit the manufacturer's website and search for a Linux driver for your printer model. The install process varies, so read the install instructions carefully. + +In the event that your printer isn't supported at all by the vendor, there are [third-party driver authors][3] that may support your printer. These drivers aren't open source, but neither are most vendor drivers. It's frustrating to have to spend an extra $45 to get support for a printer, but the alternative is to throw the printer into the rubbish, and now you know at least one brand to avoid when you purchase your next printer! + +### Common Unix Printing System (CUPS) + +The Common Unix Printing System (CUPS) was developed in 1997 by Easy Software Products, and purchased by Apple in 2007. It's the open source basis for printing on Linux, but most modern distributions provide a customized interface for it. Thanks to CUPS, your computer can find printers attached to it by a USB cable and even a shared printer over a network. + +Once you've gotten the necessary drivers installed, you can add your printer manually. First, attach your printer to your computer and power them both on. Then open the **Printers** application from the **Activities** screen or application menu. + +![printer settings][4] + +CC BY-SA Opensource.com + +There's a possibility that your printer is autodetected by Linux, by way of the drivers you've installed, and that no further configuration is required. + +![printer settings][5] + +CC BY-SA Opensource.com + +Provided that you see your printer listed, you're all set, and you can already print from Linux! + +If you see that you need to add a printer, click the **Unlock** button in the top right corner of the **Printers** window. Enter your administrative password and the button transforms into an **Add** button. + +Click the **Add** button. + +Your computer searches for attached printers (also called a _local_ printer). To have your computer look for a shared network printer, enter the IP address of the printer or its host. + +![searching for a printer][6] + +CC BY-SA Opensource.com + +Select the printer you want to add to your system and click the **Add** button. + +### Print from Linux + +Printing from Linux is as easy as printing can be, whether you're using a local or networked printer. If you're looking for a printer to purchase, then check the [OpenPrinting.org database][7] to confirm that a printer has an open source driver before you spend your money. If you already have a printer, you now know how to use it on your Linux computer. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/add-printer-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/happy-printer.png?itok=9J44YaDs (printing on Linux) +[2]: http://gimp-print.sourceforge.net/ +[3]: https://www.turboprint.info/ +[4]: https://opensource.com/sites/default/files/system-settings-printer_0.png (printer settings) +[5]: https://opensource.com/sites/default/files/settings-printer.png (printer settings) +[6]: https://opensource.com/sites/default/files/printer-search.png (searching for a printer) +[7]: http://www.openprinting.org/printers/ From c7109b80d904b04e6e76132dd584fc31f8acb50e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 22 Aug 2021 05:03:24 +0800 Subject: [PATCH 143/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210821=20?= =?UTF-8?q?SparkyLinux=206.0=20=E2=80=9CPo-Tolo=E2=80=9D=20Released=20Base?= =?UTF-8?q?d=20on=20Debian=2011=20Bullseye?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210821 SparkyLinux 6.0 -Po-Tolo- Released Based on Debian 11 Bullseye.md --- ...o- Released Based on Debian 11 Bullseye.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20210821 SparkyLinux 6.0 -Po-Tolo- Released Based on Debian 11 Bullseye.md diff --git a/sources/tech/20210821 SparkyLinux 6.0 -Po-Tolo- Released Based on Debian 11 Bullseye.md b/sources/tech/20210821 SparkyLinux 6.0 -Po-Tolo- Released Based on Debian 11 Bullseye.md new file mode 100644 index 0000000000..4b8546e70d --- /dev/null +++ b/sources/tech/20210821 SparkyLinux 6.0 -Po-Tolo- Released Based on Debian 11 Bullseye.md @@ -0,0 +1,118 @@ +[#]: subject: "SparkyLinux 6.0 “Po-Tolo” Released Based on Debian 11 Bullseye" +[#]: via: "https://www.debugpoint.com/2021/08/sparky-linux-6-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +SparkyLinux 6.0 “Po-Tolo” Released Based on Debian 11 Bullseye +====== +We review the SparkyLinux 6 “Po-Tolo” and round up the release. +[SparkyLinux][1] is a desktop-based Linux distribution based on Debian and provides almost all major desktop flavors. It is a unique distribution in the sense that it provides both Debian Stable and Debian Testing editions with the latest desktop packages. SparkyLinux also provides a collection of curated applications, with some special editions as well. For example, if you are a Game lover, then the SparkyLinux GameOver edition is there. For system admins, there is a Rescue Edition as well to fix broken systems. All these special editions come with pre-loaded games, utilities with some proprietary packages as well. + +The latest release of SparkyLinux 6 brings the packages from [Debian 11 Bullseye][2], which released a while back. Let’s take a look at what’s new. + +![SparkyLinux 6 desktop \(Xfce\)][3] + +### SparkyLinux 6 – What’s New + + * SparkyLinux 6 is based on Debian 11 Bullseye. + * Powered by Linux Kernel 5.10.x LTS + + + * This distribution maintains its own repo, and it is now updated with Bullseye packages. + * The default and necessary applications are updated to their respective Debian stable version. Here’s a quick update: + + + +– Firefox 78.13.0ESR instead of Firefox (latest) +– Thunderbird 78.13.0 +– VLC 3.0.16 +– LibreOffice 7.0.4 +– Calamares 3.2.41.1 + + * The default AppCenter – APTUS is included in this release which provides you curated 2000+ applications which can be installed via a simple GUI with one-click. This is one of the best feature of SparkyLinux, specially for new users or large deployments. + + + * The APTUS – AppCenter also provides one-click features for the followings – + + + +System upgrade +Search packages +Fix broken packages +Edit repo +Clean up cache +…and more + + * Desktop environments retain their current stable versions with Sparky flavors – + + + +Xfce 4.16 +KDE Plasma 5.22 +LXQt 0.17 + + * Other changes include, the MinimalGUI version changed file manager to PCManFM and browser to Firefox ESR. + + + +Detailed changes with information is available [here][4]. + +### Download, Upgrade and Install + +If you are using an earlier version of SparkyLinux, simple making a system upgrade takes you to SparkyLinux 6.0. No additional steps are required. + +[][5] + +SEE ALSO:   SparkyLinux 2021.03 Gets First-Ever KDE Plasma Edition with Debian 11 + +For fresh installation with respective Desktop environments – refer below link for download. You can use [Etcher][6] or similar utility to create LIVE usb for fresh installation. Do not forget to turn off secure boot if you are installing in UEFI systems. + +[download sparkylinux stable][7] + +### Sparky Linux 6 – Quick Review + + * I ran SparkyLinux in a virtual machine and native install, both with Xfce desktop edition for a quick test. The installation went smooth, thanks to the awesome Calamares installer. No surprises there. + * After initial boot, a welcome screen guides you to go over the important items if you may want to read. SparkyLinux takes care of system configurations based on GUI based utility. For example, you do not need to open terminal and run “sudo apt upgrade” to update your system. It’ll prompt you that an upgrade is available, you give admin password, and it takes care of it. + * SparkyLinux is super stable thanks to Debian and very lightweight. In idle scenario, the Xfce desktop with SparkyLinux was consuming around 600 MB of memory and most of the CPU is used by respective desktop window manager which is at around 5%. + * If you are using KDE Plasma or LXQt – the memory and CPU usage should vary, but they would not fluctuate much. + * The APTUS – AppCenter plus system administration utility is one of the best feature which makes it stand apart among other distributions. + + + +![APTus APPCENTER in SparkyLinux][8] + + * And the good thing is, it gives you flavors of Debian Rolling and Debian Stable both. If you want to use Debian Rolling packages in SparkyLinux, then you can get it out-of-the-box. + + + +That said, it’s a simple, stable and user-friendly distribution. Give it a try if you have not yet; It is a perfect and suitable daily-usage distro. + +Cheers. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/sparky-linux-6-review/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://sparkylinux.org +[2]: https://www.debugpoint.com/2021/05/debian-11-features/ +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/SparkyLinux-6-desktop-Xfce-1024x764.jpeg +[4]: https://sparkylinux.org/sparky-6-0-po-tolo/ +[5]: https://www.debugpoint.com/2021/03/sparkylinux-2021-03-release/ +[6]: https://www.debugpoint.com/2021/01/etcher-bootable-usb-linux/ +[7]: https://sparkylinux.org/download/stable/ +[8]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/APTus-APPCENTER-in-SparkyLinux-1024x781.jpeg From bb5ebac7c8f24903145c4bb1de37ac19a253fa98 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 22 Aug 2021 08:18:14 +0800 Subject: [PATCH 144/290] PUB @geekpi @turbokernel https://linux.cn/article-13707-1.html --- ... Configure your OpenVPN server on Linux.md | 68 ++++++++----------- 1 file changed, 28 insertions(+), 40 deletions(-) rename {translated/tech => published}/20210805 Configure your OpenVPN server on Linux.md (67%) diff --git a/translated/tech/20210805 Configure your OpenVPN server on Linux.md b/published/20210805 Configure your OpenVPN server on Linux.md similarity index 67% rename from translated/tech/20210805 Configure your OpenVPN server on Linux.md rename to published/20210805 Configure your OpenVPN server on Linux.md index ac78c71494..14efcf70ca 100644 --- a/translated/tech/20210805 Configure your OpenVPN server on Linux.md +++ b/published/20210805 Configure your OpenVPN server on Linux.md @@ -4,60 +4,56 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13707-1.html" -在 Linux 上配置你的 OpenVPN 服务器 +如何在免费 WiFi 中保护隐私(三) ====== -在你安装了 OpenVPN 之后,是时候配置它了。 -![Lock][1] -OpenVPN 在两点之间建立一条加密的隧道,防止第三方访问你的网络流量。通过设置你的虚拟私人网络(VPN)服务器,你就成为你自己的 VPN 供应商。许多流行的 VPN 服务已支持 [OpenVPN][2],所以当你可以完全控制时,为什么要把你的连接绑定到一个特定的供应商? +> 在你安装了 0penVPN 之后,是时候配置它了。 -本系列中的[第一篇][3]设置了一个 VPN 服务器,[第二篇][4]演示了如何安装和配置 OpenVPN 服务器软件。这第三篇文章演示了如何在认证成功的情况下启动 OpenVPN。 +![](https://img.linux.net.cn/data/attachment/album/202108/22/081708mvgwwzv8f58vgwqz.jpg) -要设置一个 OpenVPN 服务器,你必须: +0penVPN 在两点之间建立一条加密的隧道,阻止第三方访问你的网络流量。通过设置你的 “虚拟专用网络” 服务,你就成为你自己的 “虚拟专用网络” 供应商。许多流行的 “虚拟专用网络” 服务已支持 [0penVPN][2],所以当你可以掌控自己的网络时,为什么还要将你的网络连接绑定到特定的提供商呢? + +本系列中的 [第一篇][3] 展示了如何安装和配置一台作为你的 0penVPN 服务器的 Linux 计算机。,[第二篇][4] 演示了如何安装和配置 0penVPN 服务器软件。这第三篇文章演示了如何在认证成功的情况下启动 0penVPN。 + +要设置一个 0penVPN 服务器,你必须: * 创建一个配置文件。 - * 设置 `sysctl` 值 `net.ipv4.ip_forward = 1` 以启用路由。 - * 为所有的配置和认证文件设置适当的所有权,以便使用非 root 账户运行 OpenVPN 服务器守护程序。 - * 设置 OpenVPN 加载适当的配置文件启动。 + * 使用 `sysctl` 设置`net.ipv4.ip_forward = 1` 以启用路由。 + * 为所有的配置和认证文件设置适当的所有权,以便使用非 root 账户运行 0penVPN 服务器守护程序。 + * 设置 0penVPN 加载适当的配置文件启动。 * 配置你的防火墙。 - - ### 配置文件 -你必须在 `/etc/openvpn/server/` 中创建一个服务器配置文件。如果你想的话,你可以从头开始,OpenVPN 包括了几个配置示例示例文件,可以以此作为开始。看看 `/usr/share/doc/openvpn/sample/sample-config-files/` 就知道了。 +你必须在 `/etc/openvpn/server/` 中创建一个服务器配置文件。如果你想的话,你可以从头开始,0penVPN 包括了几个配置示例示例文件,可以以此作为开始。看看 `/usr/share/doc/openvpn/sample/sample-config-files/` 就知道了。 -如果你想手工建立一个配置文件,从 `server.conf` 或 `roadwarrior-server.conf` 开始(视情况而定),并将你的配置文件放在 `/etc/openvpn/server` 中。这两个文件都有大量的注释,所以请阅读注释并根据你的情况作出决定。 +如果你想手工建立一个配置文件,可以从 `server.conf` 或 `roadwarrior-server.conf` 开始(视情况而定),并将你的配置文件放在 `/etc/openvpn/server` 中。这两个文件都有大量的注释,所以请阅读注释并根据你的情况作出决定。 -你可以使用我预先建立的服务器和客户端配置文件模板和 `sysctl` 文件来打开网络路由,从而节省时间和麻烦。这个配置还包括自定义记录连接和断开的情况。它在 OpenVPN 服务器的 `/etc/openvpn/server/logs` 中保存日志。 +你可以使用我预先建立的服务器和客户端配置文件模板和 `sysctl` 文件来打开网络路由,从而节省时间和麻烦。这个配置还包括自定义记录连接和断开的情况。它在 0penVPN 服务器的 `/etc/openvpn/server/logs` 中保存日志。 如果你使用我的模板,你需要使用你的 IP 地址和主机名编辑它们。 要使用我的预建配置模板、脚本和 `sysctl` 来打开 IP 转发,请下载我的脚本: - ``` $ curl \ - > \ -OVPNdownloads.sh + https://www.dgregscott.com/ovpn/OVPNdownloads.sh > \ + OVPNdownloads.sh ``` 阅读该脚本,了解它的工作内容。下面是它的运行概述: - * 在你的 OpenVPN 服务器上创建适当的目录 + * 在你的 0penVPN 服务器上创建适当的目录 * 从我的网站下载服务器和客户端的配置文件模板 - * 下载我的自定义脚本,并以正确的权限把它们放到正确的目录中。 - * 下载 `99-ipforward.conf` 并把它放到 `/etc/sysctl.d` 中,以便在下次启动时打开 IP 转发功能。 + * 下载我的自定义脚本,并以正确的权限把它们放到正确的目录中 + * 下载 `99-ipforward.conf` 并把它放到 `/etc/sysctl.d` 中,以便在下次启动时打开 IP 转发功能 * 为 `/etc/openvpn` 中的所有内容设置了所有权 - - 当你确定你理解了这个脚本的作用,就使它可执行并运行它: - ``` $ chmod +x OVPNdownloads.sh $ sudo ./OVPNdownloads.sh @@ -65,7 +61,6 @@ $ sudo ./OVPNdownloads.sh 下面是它复制的文件(注意文件的所有权): - ``` $ ls -al -R /etc/openvpn /etc/openvpn: @@ -104,7 +99,6 @@ drwxr-xr-x. 4 openvpn openvpn 56 Apr 6 20:35 .. 下面是 `99-ipforward.conf` 文件: - ``` # Turn on IP forwarding. OpenVPN servers need to do routing net.ipv4.ip_forward = 1 @@ -114,8 +108,7 @@ net.ipv4.ip_forward = 1 ### 文件所有权 -如果你使用了我网站上的自动脚本,文件所有权就已经到位了。如果没有,你必须确保你的系统有一个叫 `openvpn` 的用户,并且是 `openvpn` 组的成员。你必须将 `/etc/openvpn` 中的所有内容的所有权设置为该用户和组。如果你不确定该用户和组是否已经存在,这样做是安全的,因为 `useradd` 会拒绝创建一个与已经存在的用户同名的用户: - +如果你使用了我网站上的自动脚本,文件所有权就已经到位了。如果没有,你必须确保你的系统有一个叫 `openvpn` 的用户,并且是 `openvpn` 组的成员。你必须将 `/etc/openvpn` 中的所有内容的所有权设置为该用户和组。如果你不确定该用户和组是否已经存在,这样做也是安全的,因为 `useradd` 会拒绝创建一个与已经存在的用户同名的用户: ``` $ sudo useradd openvpn @@ -124,8 +117,7 @@ $ sudo chown -R openvpn.openvpn /etc/openvpn ### 防火墙 -如果你在步骤 1 中启用 firewalld 服务,那么你的服务器的防火墙服务可能默认不允许 VPN 流量。使用 [`firewall-cmd` 命令][5],你可以启用 OpenVPN 服务,它可以打开必要的端口并按需路由流量: - +如果你在步骤 1 中启用 firewalld 服务,那么你的服务器的防火墙服务可能默认不允许 “虚拟专用网络” 流量。使用 [firewall-cmd 命令][5],你可以启用 0penVPN 服务,它可以打开必要的端口并按需路由流量: ``` $ sudo firewall-cmd --add-service openvpn --permanent @@ -136,19 +128,15 @@ $ sudo firewall-cmd --reload ### 启动你的服务器 -现在你可以启动 OpenVPN 服务器了。为了让它在重启后自动运行,使用 `systemctl` 的 `enable` 子命令: - +现在你可以启动 0penVPN 服务器了。为了让它在重启后自动运行,使用 `systemctl` 的 `enable` 子命令: ``` -`systemctl enable --now openvpn-server@OVPNserver2020.service` +systemctl enable --now openvpn-server@OVPNserver2020.service ``` ### 最后的步骤 -本文的第四篇也是最后一篇文章将演示如何设置客户端,以便远程连接到你的 OpenVPN。 - - -* * * +本文的第四篇也是最后一篇文章将演示如何设置客户端,以便远程连接到你的 0penVPN。 _本文基于 D.Greg Scott 的[博客][6],经许可后重新使用。_ @@ -167,7 +155,7 @@ via: https://opensource.com/article/21/7/openvpn-firewall [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/security-lock-password.jpg?itok=KJMdkKum (Lock) [2]: https://openvpn.net/ -[3]: https://opensource.com/article/21/7/vpn-openvpn-part-1 -[4]: https://opensource.com/article/21/7/vpn-openvpn-part-2 +[3]: https://linux.cn/article-13680-1.html +[4]: https://linux.cn/article-13702-1.html [5]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd [6]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/ From 753bb459cb12fc8a1adce8977766c883deddfbc9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 22 Aug 2021 09:04:06 +0800 Subject: [PATCH 145/290] PRF @wxy --- ...13 Use VS Code to develop in containers.md | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/translated/tech/20210713 Use VS Code to develop in containers.md b/translated/tech/20210713 Use VS Code to develop in containers.md index dfcbbf8640..820a5a18a7 100644 --- a/translated/tech/20210713 Use VS Code to develop in containers.md +++ b/translated/tech/20210713 Use VS Code to develop in containers.md @@ -3,32 +3,31 @@ [#]: author: (Brant Evans https://opensource.com/users/branic) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 使用 VS Code 在容器中开发 ====== ->创建一致性,以避免当你有多个开发人员开发同一个项目时出现问题。 +> 一致性可以避免当你有多个开发人员开发同一个项目时出现问题。 -![Women programming][1] +![](https://img.linux.net.cn/data/attachment/album/202108/22/090306jlkzyrw8cytcatw8.jpg) 当你有多个不同开发环境的开发人员在一个项目上工作时,编码和测试的不一致性是一种风险。[Visual Studio Code][2](VS Code)是一个集成开发环境(IDE),可以帮助减少这些问题。它可以和容器结合起来,为每个应用程序提供独立的开发环境,同时提供一个一致的开发环境。 -VS Code 的 [Remote - Containers 扩展][3] 使你能够定义一个容器,使用该定义来构建一个容器,并在容器内进行开发。这个容器定义可以和应用程序代码一起被签入到源代码库中,这使得所有的开发人员可以使用相同的定义在容器中进行构建和开发。 +VS Code 的 [“Remote - Containers” 扩展][3] 使你能够创建一个容器定义,使用该定义来构建一个容器,并在容器内进行开发。这个容器定义可以和应用程序代码一起被签入到源代码库中,这使得所有的开发人员可以使用相同的定义在容器中进行构建和开发。 -默认情况下,Remote - Containers 扩展使用 Docker 来构建和运行容器,但使用 [Podman][4] 的容器运行环境环境也很容易,它可以让你使用 [免 root 容器][5]。 +默认情况下,“Remote - Containers” 扩展使用 Docker 来构建和运行容器,但使用 [Podman][4] 的容器运行环境环境也很容易,它可以让你使用 [免 root 容器][5]。 -本文将带领你完成设置,通过 Podman 在免 root 容器内使用 VS Code 和 Remote - Containers 扩展进行开发。 +本文将带领你完成设置,通过 Podman 在免 root 容器内使用 VS Code 和 “Remote - Containers” 扩展进行开发。 ### 初始配置 -在继续之前,请确保你的红帽企业 Linux(RHEL)或 Fedora 工作站已经更新了最新的补丁,并且安装了 VS Code 和 Remote - Containers 扩展。(参见 [VS Code 网站][2]了解更多安装信息) +在继续之前,请确保你的红帽企业 Linux(RHEL)或 Fedora 工作站已经更新了最新的补丁,并且安装了 VS Code 和 “Remote - Containers” 扩展。(参见 [VS Code 网站][2]了解更多安装信息) 接下来,用一个简单的 `dnf install` 命令来安装 Podman 和它的支持包: - ``` $ sudo dnf install -y podman ``` @@ -37,26 +36,25 @@ $ sudo dnf install -y podman ![在文本框中输入 “podman”][6] -现在配置已经完成,在 VS Code 中为该项目创建一个新的文件夹或并打开现有的文件夹。 +现在配置已经完成,在 VS Code 中为该项目创建一个新的文件夹或打开现有的文件夹。 ### 定义容器 本教程以创建 Python 3 开发的容器为例。 -Remote - Containers 扩展可以在项目文件夹中添加必要的基本配置文件。要添加这些文件,通过在键盘上输入 `Ctrl+Shift+P` 打开命令面板,搜索 “Remote-Containers: Add Development Container Configuration Files”,并选择它。 +“Remote - Containers” 扩展可以在项目文件夹中添加必要的基本配置文件。要添加这些文件,通过在键盘上输入 `Ctrl+Shift+P` 打开命令面板,搜索 “Remote-Containers: Add Development Container Configuration Files”,并选择它。 ![Remote-Containers: Add Development Container Configuration Files][8] 。 在接下来的弹出窗口中,定义你想设置的开发环境的类型。对于这个例子的配置,搜索 “Python 3” 定义并选择它。 -![选择 Python 3 定义][9] 。 - +![选择 Python 3 定义][9] 接下来,选择将在容器中使用的 Python 的版本。选择 “3 (default)” 选项以使用最新的版本。 ![选择 “3 (default)” 选项][10] -Python 配置也可以安装 Node.js,但在这个例子中,*取消勾选“Install Node.js”,然后点击 “OK”。 +Python 配置也可以安装 Node.js,但在这个例子中,取消勾选 “Install Node.js”,然后点击 “OK”。 ![取消勾选 “Install Node.js"][11] @@ -66,7 +64,6 @@ Python 配置也可以安装 Node.js,但在这个例子中,*取消勾选“I 除了明显的安全优势外,以免 root 方式运行容器的另一个原因是,在项目文件夹中创建的所有文件将由容器外的正确用户 ID(UID)拥有。要将开发容器作为免 root 容器运行,请修改 `devcontainer.json` 文件,在它的末尾添加以下几行: - ``` "workspaceMount": "source=${localWorkspaceFolder},target=/workspace,type=bind,Z", "workspaceFolder": "/workspace", @@ -75,7 +72,7 @@ Python 配置也可以安装 Node.js,但在这个例子中,*取消勾选“I "containerUser": "vscode" ``` -这些选项告诉 VS Code 用适当的 SELinux 上下文挂载工作区,创建一个用户命名空间,将你的 UID 和 GID 同样映射到容器内,并在容器内使用 `vscode` 作为你的用户名。`devcontainer.json` 文件应该是这样的(别忘了行末的逗号,如图所示): +这些选项告诉 VS Code 用适当的 SELinux 上下文挂载工作区,创建一个用户命名空间,将你的 UID 和 GID 原样映射到容器内,并在容器内使用 `vscode` 作为你的用户名。`devcontainer.json` 文件应该是这样的(别忘了行末的逗号,如图所示): ![更新后的 devcontainer.json 文件][12] @@ -83,17 +80,17 @@ Python 配置也可以安装 Node.js,但在这个例子中,*取消勾选“I ![构建容器][13] -一旦容器构建完成,项目将在容器内打开。在容器内创建或编辑的文件将反映在容器外的文件系统中,并对这些文件应用适当的用户权限。现在,你可以在容器内进行开发。VS Code 甚至可以把你的 SSH 密钥和 Git 配置带入容器中,这样提交代码就会像在容器外编辑时那样工作。 +一旦容器构建完成,项目将在容器内打开。在容器内创建或编辑的文件将反映在容器外的文件系统中,并对这些文件应用适当的用户权限。现在,你可以在容器内进行开发了。VS Code 甚至可以把你的 SSH 密钥和 Git 配置带入容器中,这样提交代码就会像在容器外编辑时那样工作。 ### 接下来的步骤 现在你已经完成了基本的设置和配置,你可以进一步加强配置的实用性。比如说: * 修改 Dockerfile 以安装额外的软件(例如,所需的 Python 模块)。 - * 使用一个定制的容器镜像。例如,如果你正在进行 Ansible 开发,你可以使用 Quay.io 的 [Ansible Toolset][14]。(确保通过 Dockerfile 将 `vscode` 用户添加到容器镜像中)。) + * 使用一个定制的容器镜像。例如,如果你正在进行 Ansible 开发,你可以使用 Quay.io 的 [Ansible Toolset][14]。(确保通过 Dockerfile 将 `vscode` 用户添加到容器镜像中) * 将 `.devcontainer` 目录下的文件提交到源代码库,以便其他开发者可以利用容器的定义进行开发工作。 -在容器内开发有助于防止不同项目之间的冲突,因为不同项目的依赖关系及代码都是分开的。你可以使用 Podman 在免 root 环境下运行容器,从而提高安全性。通过结合 VS Code、Remote - Containers 扩展和 Podman,你可以轻松地为多个开发人员建立一个一致的环境,减少设置时间,并以安全的方式减少开发环境的差异带来的错误。 +在容器内开发有助于防止不同项目之间的冲突,因为隔离了不同项目的依赖关系及代码。你可以使用 Podman 在免 root 环境下运行容器,从而提高安全性。通过结合 VS Code、“Remote - Containers” 扩展和 Podman,你可以轻松地为多个开发人员建立一个一致的环境,减少设置时间,并以安全的方式减少开发环境的差异带来的错误。 -------------------------------------------------------------------------------- @@ -102,7 +99,7 @@ via: https://opensource.com/article/21/7/vs-code-remote-containers-podman 作者:[Brant Evans][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 075b8a351565805cddb2e9c4d6d2b280fdb22f65 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 22 Aug 2021 09:04:58 +0800 Subject: [PATCH 146/290] PUB @wxy https://linux.cn/article-13708-1.html --- .../20210713 Use VS Code to develop in containers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210713 Use VS Code to develop in containers.md (99%) diff --git a/translated/tech/20210713 Use VS Code to develop in containers.md b/published/20210713 Use VS Code to develop in containers.md similarity index 99% rename from translated/tech/20210713 Use VS Code to develop in containers.md rename to published/20210713 Use VS Code to develop in containers.md index 820a5a18a7..5eb38ba01a 100644 --- a/translated/tech/20210713 Use VS Code to develop in containers.md +++ b/published/20210713 Use VS Code to develop in containers.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13708-1.html) 使用 VS Code 在容器中开发 ====== From 0e94e05734d2ec9f65efcb230b2fda811ea18182 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 22 Aug 2021 09:09:26 +0800 Subject: [PATCH 147/290] PRF --- published/20210713 Use VS Code to develop in containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210713 Use VS Code to develop in containers.md b/published/20210713 Use VS Code to develop in containers.md index 5eb38ba01a..f646962510 100644 --- a/published/20210713 Use VS Code to develop in containers.md +++ b/published/20210713 Use VS Code to develop in containers.md @@ -44,7 +44,7 @@ $ sudo dnf install -y podman “Remote - Containers” 扩展可以在项目文件夹中添加必要的基本配置文件。要添加这些文件,通过在键盘上输入 `Ctrl+Shift+P` 打开命令面板,搜索 “Remote-Containers: Add Development Container Configuration Files”,并选择它。 -![Remote-Containers: Add Development Container Configuration Files][8] 。 +![Remote-Containers: Add Development Container Configuration Files][8] 在接下来的弹出窗口中,定义你想设置的开发环境的类型。对于这个例子的配置,搜索 “Python 3” 定义并选择它。 From d34a17a46102320484e9ee2b8211611d5374f6cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sun, 22 Aug 2021 11:12:01 +0800 Subject: [PATCH 148/290] Update 20200107 5 ways to improve your Bash scripts.md translated page --- ...107 5 ways to improve your Bash scripts.md | 90 +++++++++---------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/sources/tech/20200107 5 ways to improve your Bash scripts.md b/sources/tech/20200107 5 ways to improve your Bash scripts.md index a02248cd4e..418acc8b66 100644 --- a/sources/tech/20200107 5 ways to improve your Bash scripts.md +++ b/sources/tech/20200107 5 ways to improve your Bash scripts.md @@ -1,24 +1,24 @@ -[#]: collector: (lujun9972) -[#]: translator: (fisherue ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (5 ways to improve your Bash scripts) -[#]: via: (https://opensource.com/article/20/1/improve-bash-scripts) -[#]: author: (Alan Formy-Duval https://opensource.com/users/alanfdoss) +[#]: collector: "lujun9972" +[#]: translator: "fisherue " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "5 步提升你的脚本程序" +[#]: via: "https://opensource.com/article/20/1/improve-bash-scripts" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" -5 ways to improve your Bash scripts +5 步提升你的脚本程序 ====== -Find out how Bash can help you tackle the most challenging tasks. -![A person working.][1] +巧用 Bash 脚本程序能帮助你完成很多极具挑战的任务。 +![A person working.工作者图片][1] -A system admin often writes Bash scripts, some short and some quite lengthy, to accomplish various tasks. +系统管理员经常写脚本程序,不论长短,这些脚本可以完成某种任务。 -Have you ever looked at an installation script provided by a software vendor? They often add a lot of functions and logic in order to ensure that the installation works properly and doesn’t result in damage to the customer’s system. Over the years, I’ve amassed a collection of various techniques for enhancing my Bash scripts, and I’d like to share some of them in hopes they can help others. Here is a collection of small scripts created to illustrate these simple examples. +你是否曾经查看过某个软件发行方提供的安装用的脚本 (script) 程序?为了能够适应不同用户的系统配置,顺利完成安装,这些脚本程序经常包含很多函数和逻辑分支。多年来,我已经集合了提升我的脚本程序的一些技巧,这里分享几个技巧,希望能对朋友们也有用。这里列出一组短脚本示例,展示给大家做脚本样本。 -### Starting out +### 初步尝试 -When I was starting out, my Bash scripts were nothing more than a series of commands, usually meant to save time with standard shell operations like deploying web content. One such task was extracting static content into the home directory of an Apache web server. My script went something like this: +我尝试写一个脚本程序时,原始程序往往就是一组命令行,通常就是调用标准命令完成诸如更新网页内容之类的工作,这样可以节省时间。其中一个类似的工作是解压文件到阿帕奇 (Apache) 网站服务器的主目录里,我的最初脚本程序大概是下面这样: ``` @@ -27,13 +27,13 @@ cd /usr/apache/home/calendar/ tar zvxf january_schedule.tar.gz ``` -While this saved me some time and typing, it certainly was not a very interesting or useful script in the long term. Over time, I learned other ways to use Bash scripts to accomplish more challenging tasks, such as creating software packages, installing software, or backing up a file server. +这帮我节省了时间,也减少了键入多条命令操作。时日久了,我掌握了另外的技巧,可以用 Bash 脚本程序完成更难的一些工作,比如说创建软件安装包、安装软件、备份文件系统等工作。 -### 1\. The conditional statement +### 1\. 条件分支结构 -Just as with so many other programming languages, the conditional has been a powerful and common feature. A conditional is what enables logic to be performed by a computer program. Most of my examples are based on conditional logic. +和众多其他编程语言一样,脚本程序的条件分支结构同样是强大的常用技能。条件分支结构赋予了计算机程序逻辑能力,我的很多实例都是基于条件逻辑分支。 -The basic conditional uses an "if" statement. This allows us to test for some condition that we can then use to manipulate how a script performs. For instance, we can check for the existence of a Java bin directory, which would indicate that Java is installed. If found, the executable path can be updated with the location to enable calls by Java applications. +基本的条件分支结构就是 IF 条件分支结构。通过判定是否满足特定条件,可以控制程序选择执行相应的脚本命令段。比如说,想要判断系统是否安装了 Java ,可以通过判断系统有没有一个 Java 库目录;如果找到这个目录,就把这个目录路径添加到可运行程序路径,也就可以调用 Java 库应用了。 ``` @@ -41,13 +41,13 @@ if [ -d "$JAVA_HOME/bin" ] ; then     PATH="$JAVA_HOME/bin:$PATH" ``` -### 2\. Limit execution +### 2\. 限定运行权限 -You might want to limit a script to only be run by a specific user. Although Linux has standard permissions for users and groups, as well as SELinux for enabling this type of protection, you could choose to place logic within a script. Perhaps you want to be sure that only the owner of a particular web application can run its startup script. You could even use code to limit a script to the root user. Linux has a couple of environment variables that we can test in this logic. One is **$USER**, which provides the username. Another is **$UID**, which provides the user’s identification number (UID) and, in the case of a script, the UID of the executing user. +你或许想只允许特定的用户才能执行某个脚本程序。除了 Linux 的权限许可管理,比如对用户和用户组设定权限、通过 SELinux 设定此类的保护权限等,你还可以在脚本里设置逻辑判断来设置执行权限。类似的情况可能是,你需要确保只有网站程序的所有者才能执行相应的网站初始化操作脚本。甚至你可以限定只有根用户才能执行某个脚本。这个可以通过在脚本程序里设置逻辑判断实现, Linux 提供的几个环境变量可以帮忙。其中一个是保存用户名称的变量 **$USER**, 另一个是保存用户识别码的变量 **$UID** 。在脚本程序里,执行用户的 UID 值就保存在 **$UID** 变量里。 -#### User +#### 用户名判别 -The first example shows how I could limit a script to the user jboss1 in a multi-hosting environment with several application server instances. The conditional "if" statement essentially asks, "Is the executing user not jboss1?" When the condition is found to be true, the first echo statement is called, followed by the **exit 1,** which terminates the script. +第一个例子里,我在一个多用户环境里指定只有用户 jboss1 可以执行脚本程序。条件 if 语句猜测判断,‘要求执行这个脚本程序的用户不是 jboss1?’ 如果我猜测的没错,就会输出提示“用户不是 jboss1 ”,然后直接退出这个脚本程序,返回码为1 **exit 1** 。 ``` @@ -58,9 +58,9 @@ fi echo "continue script" ``` -#### Root +#### 根用户判别 -This next example script ensures that only the root user can execute it. Because the UID for root is 0, we can use the **-gt** option in the conditional if statement to prohibit all UIDs greater than zero. +接下来的例子是要求只有根用户才能执行脚本程序。根用户的用户识别码 (UID) 是0,设置的条件判断采用大于操作符 (**-gt**) ,所有 UID 值大于0的用户都被禁止执行该脚本程序。 ``` @@ -71,9 +71,9 @@ fi echo "continue script" ``` -### 3\. Use arguments +### 3\. 带参数执行程序 -Just like any executable program, Bash scripts can take arguments as input. Below are a few examples. But first, you should understand that good programming means that we don’t just write applications that do what we want; we must write applications that _can’t_ do what we _don’t_ want. I like to ensure that a script doesn’t do anything destructive in the case where there is no argument. Therefore, this is the first check that y. The condition checks the number of arguments, **$#**, for a value of zero and terminates the script if true. +可执行程序可以附带参数作为执行选项,命令行脚本程序也是一样,下面给出几个例子。在这之前,我想告诉你,能写出好的程序并不只是写出我们想要它执行什么就执行什么的程序,程序还需要按照我们不想让它执行什么它可以按我们的意愿能够不执行相应操作。如果运行程序时没有提供参数造成程序缺少足够信息,我愿意脚本程序不要做任何破坏性的操作。因而,程序的第一步就是确认命令行是否提供了参数,判定的条件就是参数 **$# **的值是否为 0 ,如果是(意味着没有提供参数),就直接终止脚本程序并退出操作。 ``` @@ -84,36 +84,36 @@ fi echo "arguments found: $#" ``` -#### Multiple arguments +#### 多个运行参数 -You can pass more than one argument to a script. The internal variables that the script uses to reference each argument are simply incremented, such as **$1**, **$2**, **$3**, and so on. I’ll just expand my example above with the following line to echo the first three arguments. Obviously, additional logic will be needed for proper argument handling based on the total number. This example is simple for the sake of demonstration. +可以传递给脚本程序的参数不知一个。脚本使用内部变量指代这些参数,内部变量名用非负整数递增标识,也就是 **$1**,** $2**,** $3 **等等递增。我只是扩展前面的程序,输出显示用户提供的前三个参数。显然,要针对所有的每个参数有对应的响应需要更多的逻辑判断,这里的例子只是简单展示参数的使用。 ``` `echo $1 $2 $3` ``` -While we’re discussing these argument variables, you might have wondered, "Did he skip zero?" +我们在讨论这些参数变量名,你或许有个疑问,“参数变量名怎么跳过了**$0**,(而直接从**$1**开始)?” -Well, yes, I did, but I have a great reason! There is indeed a **$0** variable, and it is very useful. Its value is simply the name of the script being executed. +是的,是这样,这是有原因的。变量名 **$0** 确实存在,也非常有用,它储存的是被执行的脚本程序的名称。 ``` `echo $0` ``` -An important reason to reference the name of the script during execution is to generate a log file that includes the script’s name in its own name. The simplest form might just be an echo statement. +程序执行过程中有一个变量名指代程序名称,很重要的一个原因是,可以在生成的日志文件名称里包含程序名称,最简单的方式应该是调用一个 "echo" 语句。 ``` `echo test >> $0.log` ``` -However, you will probably want to add a bit more code to ensure that the log is written to a location with the name and information that you find helpful to your use case. +当然,你或许要增加一些代码,确保这个日志文件存放在你希望的路径,日志名称包含你认为有用的信息。 -### 4\. User input +### 4\. 交互输入 -Another useful feature to use in a script is its ability to accept input during execution. The simplest is to offer the user some input. +脚本程序的另一个好用的特性是可以在执行过程中接受输入,最简单的情况是让用户可以输入一些信息。 ``` @@ -122,7 +122,7 @@ echo "enter a word please:"  echo $word ``` -This also allows you to provide choices to the user. +这样也可以让用户在程序执行中作出选择。 ``` @@ -133,9 +133,9 @@ read -p "Install Software ?? [Y/n]: " answ    echo "Installation starting..." ``` -### 5\. Exit on failure +### 5\. 出错退出执行 -Some years ago, I wrote a script for installing the latest version of the Java Development Kit (JDK) on my computer. The script extracts the JDK archive to a specific directory, updates a symbolic link, and uses the alternatives utility to make the system aware of the new version. If the extraction of the JDK archive failed, continuing could break Java system-wide. So, I wanted the script to abort in such a situation. I don’t want the script to make the next set of system changes unless the archive was successfully extracted. The following is an excerpt from that script: +几年前,我写了各脚本,想在自己的电脑上安装最新版本的 Java 开发工具包 (JDK) 。这个脚本把 JDK 文件解压到指定目录,创建更新一些符号链接,再做一下设置告诉系统使用这个最新的版本。如果解压过程出现错误,在执行后面的操作就会使 Java 系统破坏不能使用。因而,这种情况下需要终止程序。如果解压过程没有成功,就不应该再继续进行之后的更新操作。下面语句段可以完成这个功能。 ``` @@ -146,20 +146,20 @@ if [ $ec -ne 0 ]; then fi ``` -A quick way for you to demonstrate the usage of the **$?** variable is with this short one-liner: +下面的一行语句组可以快速展示变量 **$?** 的用法。 ``` `ls T; ec=$?; echo $ec` ``` -First, run **touch T** followed by this command. The value of **ec** will be 0. Then, delete **T**, **rm T**, and repeat the command. The value of **ec** will now be 2 because ls reports an error condition since **T** was not found. +先用 **touch T** 命令创建一个文件名为 **T** 的文件,然后执行这个文件行,变量 **ec **的值会是0。然后,用 **rm T **命令删除文件,在执行示例的文件行,变量 **ec** 的值会是2,因为文件 T 不存在,命令 **ls **找不到指定文件报错,相应返回值是2。 -You can take advantage of this error reporting to include logic, as I have above, to control the behavior of your scripts. +在逻辑条件里利用这个出错标识,参照前文我使用的条件判断,可以使脚本文件按需完成设定操作。 -### Takeaway +### 结语 -We might assume that we need to employ languages, such as Python, C, or Java, for higher functionality, but that’s not necessarily true. The Bash scripting language is very powerful. There is a lot to learn to maximize its usefulness. I hope these few examples will shed some light on the potential of coding with Bash. +要完成复杂的功能,或许我们觉得应该使用诸如 Python, C, 或 Java 这类的高级编程语言,然而并不尽然,脚本编程语言也很强大,可以完成类似任务。要充分发挥脚本的作用,有很多需要学习的,希望这里的几个例子能让你意识到脚本编程的功能。 -------------------------------------------------------------------------------- @@ -167,11 +167,11 @@ via: https://opensource.com/article/20/1/improve-bash-scripts 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[fisherue](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://opensource.com/users/alanfdoss [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl (A person working.) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003784_02_os.comcareers_os_rh2x.png?itok=jbRfXinl "工作者图片" From 78b5c9076c2b38ed369716cd8dc201c92516723d Mon Sep 17 00:00:00 2001 From: perfiffer Date: Sun, 22 Aug 2021 16:38:27 +0800 Subject: [PATCH 149/290] translated by perfiffer --- ...6 Access OpenVPN from a client computer.md | 143 ------------------ ...6 Access OpenVPN from a client computer.md | 130 ++++++++++++++++ 2 files changed, 130 insertions(+), 143 deletions(-) delete mode 100644 sources/tech/20210806 Access OpenVPN from a client computer.md create mode 100644 translated/tech/20210806 Access OpenVPN from a client computer.md diff --git a/sources/tech/20210806 Access OpenVPN from a client computer.md b/sources/tech/20210806 Access OpenVPN from a client computer.md deleted file mode 100644 index cc7605a18c..0000000000 --- a/sources/tech/20210806 Access OpenVPN from a client computer.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: subject: "Access OpenVPN from a client computer" -[#]: via: "https://opensource.com/article/21/7/openvpn-client" -[#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Access OpenVPN from a client computer -====== -After building your own VPN on Linux, it's time to finally use it. -![Woman programming][1] - -OpenVPN creates an encrypted tunnel between two points, preventing a third party from accessing your network traffic. By setting up your virtual private network (VPN) server, you become your own VPN provider. Many popular VPN services already use [OpenVPN][2], so why tie your connection to a specific provider when you can have complete control yourself? - -The [first article][3] in this series set up a server for your VPN, the [second article][4] demonstrated how to install and configure the OpenVPN server software, while the [third article][5] explained how to configure your firewall and start the OpenVPN server software. This fourth and final article demonstrates how to use your OpenVPN server from client computers. This is the reason you did all the work in the previous three articles! - -### Create client certificates - -Remember that the method of authentication for OpenVPN requires both the server and the client to _have_ something (certificates) and to _know_ something (a password). It's time to set that up. - -First, create a client certificate and a private key for your client computer. On your OpenVPN server, generate a certificate request. It asks for a passphrase; make sure you remember it: - - -``` -$ cd /etc/openvpn/ca -$ sudo /etc/openvpn/easy-rsa/easyrsa \ -gen-req greglaptop -``` - -In this example, `greglaptop` is the client computer for which this certificate is being created. - -There's no need to import the request into the certificate authority (CA) because it's already there. Review it to make sure: - - -``` -$ cd /etc/openvpn/ca -$ /etc/openvpn/easy-rsa/easyrsa \ -show-req greglaptop -``` - -You can sign as the client, too: - - -``` -$ /etc/openvpn/easy-rsa/easyrsa \ -sign-req client greglaptop -``` - -### Install the OpenVPN client software - -On Linux, Network Manager may already have an OpenVPN client included. If not, you can install the plugin: - - -``` -`$ sudo dnf install NetworkManager-openvpn` -``` - -On Windows, you must download and install the OpenVPN client from the OpenVPN download site. Launch the installer and follow the prompts. - -### Copy certificates and private keys to the client - -Now your client needs the authentication credentials you generated for it. You generated these on the server, so you must transport them over to your client. I tend to use SSH for this. On Linux, that's the `scp` command. On Windows, you can use [WinSCP][6] as administrator to pull the certificates and keys. - -Assuming the client is named `greglaptop`, here are the file names and server locations: - - -``` -/etc/openvpn/ca/pki/issued/greglaptop.crt -/etc/openvpn/ca/pki/private/greglaptop.key -/etc/openvpn/ca/pki/issued/ca.crt -``` - -On Linux, copy these to the `/etc/pki/tls/certs/` directory. On Windows, copy them to the `C:\Program Files\OpenVPN\config` directory. - -### Copy and customize the client configuration file - -On Linux, you can either copy the `/etc/openvpn/client/OVPNclient2020.ovpn` file on the server to `/etc/NetworkManager/system-connections/`, or you can navigate to Network Manager in System Settings and add a VPN connection.  - -For the connection type, select **Certificates**. Point Network Manager to the certificates and keys you copied from the server. - -![VPN displayed in Network Manager][7] - -(Seth Kenlon, [CC BY-SA 4.0][8]) - -On Windows, run WinSCP as administrator to copy the client configuration template `/etc/openvpn/client/OVPNclient2020.ovpn` on the server to `C:\Program Files\OpenVPN\config` on the client. Then: - - * Rename it to match the certificate above. - * Change the names of the CA certificate, client certificate, and key to match the names copied above from the server. - * Edit the IP information to match your network. - - - -You need super administrative permissions to edit the client config files. The easiest way to get this might be to launch a CMD window as administrator and then launch Notepad from the administrator CMD window to edit the files. - -### Connect your client to the server - -On Linux, Network manager displays your VPN. Select it to connect. - -  - -![Add a VPN connection in Network Manager][9] - -(Seth Kenlon, [CC BY-SA 4.0][8]) - -On Windows, start the OpenVPN graphical user interface (GUI). It produces a graphic in the Windows System Tray on the right side of the taskbar, usually in the lower-right corner of your Windows desktop. Right-click the graphic to connect, disconnect, or view the status. - -For the first connection, edit the "remote" line of your client config file to use the _inside IP address_ of your OpenVPN server. Connect to the server from inside your office network by right-clicking on the OpenVPN GUI in the Windows System Tray and clicking **Connect**. Debug this connection. This should find and fix problems without any firewall issues getting in the way because both the client and server are on the same side of the firewall. - -Next, edit the "remote" line of your client config file to use the _public IP address_ for your OpenVPN server. Bring the Windows client to an outside network and connect. Debug any issues. - -### Connect securely - -Congratulations! You have an OpenVPN network ready for your other client systems. Repeat the setup steps for the rest of your clients. You might even use Ansible to distribute certs and keys and keep them up to date.  - -* * * - -_This article is based on D. Greg Scott's [blog][10] and is reused with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/openvpn-client - -作者:[D. Greg Scott][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/greg-scott -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) -[2]: https://openvpn.net/ -[3]: https://opensource.com/article/21/7/vpn-openvpn-part-1 -[4]: https://opensource.com/article/21/7/vpn-openvpn-part-2 -[5]: https://opensource.com/article/21/7/vpn-openvpn-part-3 -[6]: https://winscp.net/eng/index.php -[7]: https://opensource.com/sites/default/files/uploads/network-manager-profile.jpg (VPN displayed in Network Manager) -[8]: https://creativecommons.org/licenses/by-sa/4.0/ -[9]: https://opensource.com/sites/default/files/uploads/network-manager-connect.jpg (Add a VPN connection in Network Manager) -[10]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/ diff --git a/translated/tech/20210806 Access OpenVPN from a client computer.md b/translated/tech/20210806 Access OpenVPN from a client computer.md new file mode 100644 index 0000000000..bd0ea94ca8 --- /dev/null +++ b/translated/tech/20210806 Access OpenVPN from a client computer.md @@ -0,0 +1,130 @@ +[#]: subject: "Access OpenVPN from a client computer" +[#]: via: "https://opensource.com/article/21/7/openvpn-client" +[#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +从客户端计算机连接到 0penVPN +====== + +在 Linux 上安装好 VPN 之后,是时候使用它了。 +![Woman programming][1] + +0penVPN 在两点之间创建一个加密通道,阻止第三方访问你的网络流量数据。通过设置你的 “虚拟专用网络” 服务,你可以成为你自己的 “虚拟专用网络” 服务商。许多流行的 “虚拟专用网络” 服务都使用 0penVPN,所以当你可以掌控自己的网络时,为什么还要将你的网络连接绑定到特定的提供商呢? + +本系列的 [第一篇文章][3] 安装了一个 VPN 的服务器,[第二篇文章][4] 介绍了如何安装和配置一个 0penVPN 服务软件,[第三篇文章][5] 解释了如何配置防火墙并启动你的 0penVPN 服务。第四篇也是最后一篇文章将演示如何从客户端计算机使用你的 0penVPN 服务器。这就是你做了前三篇文章中所有工作的原因! + +### 创建客户端证书 + +请记住,0penVPN 的身份验证方法要求服务器和客户端都拥有某些东西(证书)并知道某些东西(密码)。是时候设置它了。 + +首先,为你的客户端计算机创建一个客户端证书和一个私钥。在你的 0penVPN 服务器上,生成证书请求。它会要求你输入密码;确保你记住它: + +``` +$ cd /etc/openvpn/ca +$ sudo /etc/openvpn/easy-rsa/easyrsa \ +gen-req greglaptop +``` + +本例中,`greglaptop` 是创建证书的客户端计算机主机名。 + +无需将请求导入证书颁发机构(CA),因为它已经存在。审查它以确保请求存在: + +``` +$ cd /etc/openvpn/ca +$ /etc/openvpn/easy-rsa/easyrsa \ +show-req greglaptop +``` + +你也可以以客户端身份签署请求: + +``` +$ /etc/openvpn/easy-rsa/easyrsa \ +sign-req client greglaptop +``` + +### 安装 0penVPN 客户端软件 + +在 Linux 系统上,网络管理器可能已经包含了一个 0penVPN 客户端。如果没有,你可以安装插件: + +``` +$ sudo dnf install NetworkManager-openvpn +``` + +在 Windows 系统上,你必须从 0penVPN 下载网页下载和安装 0penVPN 客户端。启动安装程序并按照提示操作。 + +### 复制证书和私钥到客户端 + +现在你的客户端需要你为其生成的身份验证凭据。你在服务器上生成了这些,因此你必须将它们传输到你的客户端。我推荐使用 SSH 来完成传输。在 Linux 系统上,通过 `scp` 命令实现。在 Windows 系统上,你可以以管理员身份运行 [WinSCP][6] 来推送证书和密钥。 + +假设客户端名称为 `greglaptop`,那么证书和私钥的文件名以及服务的位置如下: + +``` +/etc/openvpn/ca/pki/issued/greglaptop.crt +/etc/openvpn/ca/pki/private/greglaptop.key +/etc/openvpn/ca/pki/issued/ca.crt +``` + +在 Linux 系统上,复制这些文件到 `/etc/pki/tls/certs` 目录。在 Windows 系统上,复制它们到 `C:\Program Files\OpenVPN\config` 目录。 + +### 复制和自定义客户端配置文件 + +在 Linux 系统上,你可以复制服务器上的 `/etc/openvpn/client/OVPNclient2020.ovpn` 文件到 `/etc/NetworkManager/system-connections/` 目录,或者你也可以导航到系统设置中的网络管理器添加一个 VPN 连接。 + +连接类型选择 **证书**。告知网络管理器你从服务器上复制的证书和密钥。 + +![VPN displayed in Network Manager][7] + +在 Windows 系统上,以管理员身份运行 WinSCP,将服务器上的客户端配置模板 `/etc/openvpn/client/OVPNclient2020.ovpn` 文件复制到客户端上的 `C:\Program Files\OpenVPN\config` 目录。然后: + + * 重命名它以匹配上面的证书。 + * 更改 CA 证书、客户端证书和密钥的名称以匹配上面从服务器复制的名称。 + * 修改 IP 信息,以匹配你的网络。 + +你需要超级管理员权限来编辑客户端配置文件。最简单的方式就是以管理员身份启动一个 CMD 窗口,然后从管理员 CMD 窗口启动记事本来编辑此文件。 + +### 将你的客户端连接到服务器 + +在 Linux 系统上,网络管理器会显示你的 VPN 连接。选择它进行连接。 + +![Add a VPN connection in Network Manager][9] + +在 Windows 系统上,启动 0penVPN 图形用户界面 (GUI)。它会在任务栏右侧的 Windows 系统托盘中生成一个图标,通常位于 Windows 桌面的右下角。右键单击图标以连接、断开连接或查看状态。 + +对于第一次连接,编辑客户端配置文件的“remote”行以使用 0penVPN 服务器的内部 IP 地址。通过右键单击 Windows 系统托盘中的 0penVPN GUI 并单击 **连接**,从办公室网络内部连接到服务器。调试此连接。这应该可以找到并解决问题,而不会出现任何防火墙问题,因为客户端和服务器都在防火墙的同一侧。 + +接下来,编辑客户端配置文件的“remote”行以使用 0penVPN 服务器的公共 IP 地址。将 Windows 客户端连接到外部网络并进行连接。调试有可能的问题。 + +### 安全连接 +恭喜!你已经为其他客户端系统准备好了 0penVPN 网络。对其余客户端重复设置步骤。你甚至可以使用 Ansible 来分发证书和密钥并使其保持最新。 + +* * * + +本文基于 D.Greg Scott 的 [博客][10],经许可后重新使用。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/openvpn-client + +作者:[D. Greg Scott][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/greg-scott +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://openvpn.net/ +[3]: https://linux.cn/article-13680-1.html +[4]: https://linux.cn/article-13702-1.html +[5]: https://linux.cn/article-13707-1.html +[6]: https://winscp.net/eng/index.php +[7]: https://opensource.com/sites/default/files/uploads/network-manager-profile.jpg (VPN displayed in Network Manager) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://opensource.com/sites/default/files/uploads/network-manager-connect.jpg (Add a VPN connection in Network Manager) +[10]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/ From 6b6f3b87959ba6c5b4a09e2a20d7018a32782c2a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sun, 22 Aug 2021 17:52:26 +0800 Subject: [PATCH 150/290] Rename sources/tech/20200107 5 ways to improve your Bash scripts.md to translated/tech/20200107 5 ways to prove your Bash scripts.md translated, waiting for merge. --- .../tech/20200107 5 ways to prove your Bash scripts.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/tech/20200107 5 ways to improve your Bash scripts.md => translated/tech/20200107 5 ways to prove your Bash scripts.md (100%) diff --git a/sources/tech/20200107 5 ways to improve your Bash scripts.md b/translated/tech/20200107 5 ways to prove your Bash scripts.md similarity index 100% rename from sources/tech/20200107 5 ways to improve your Bash scripts.md rename to translated/tech/20200107 5 ways to prove your Bash scripts.md From 5a228523e9ecb86d9819685f191bc3884ee68198 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 22 Aug 2021 18:05:31 +0800 Subject: [PATCH 151/290] Rename 20200107 5 ways to prove your Bash scripts.md to 20200107 5 ways to improve your Bash scripts.md --- ...scripts.md => 20200107 5 ways to improve your Bash scripts.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename translated/tech/{20200107 5 ways to prove your Bash scripts.md => 20200107 5 ways to improve your Bash scripts.md} (100%) diff --git a/translated/tech/20200107 5 ways to prove your Bash scripts.md b/translated/tech/20200107 5 ways to improve your Bash scripts.md similarity index 100% rename from translated/tech/20200107 5 ways to prove your Bash scripts.md rename to translated/tech/20200107 5 ways to improve your Bash scripts.md From 42b539f1c14b7f81c390b6062c65a63ae1b42bff Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 22 Aug 2021 18:07:06 +0800 Subject: [PATCH 152/290] Update 20200107 5 ways to improve your Bash scripts.md --- .../tech/20200107 5 ways to improve your Bash scripts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/translated/tech/20200107 5 ways to improve your Bash scripts.md b/translated/tech/20200107 5 ways to improve your Bash scripts.md index 418acc8b66..ac91f424db 100644 --- a/translated/tech/20200107 5 ways to improve your Bash scripts.md +++ b/translated/tech/20200107 5 ways to improve your Bash scripts.md @@ -1,9 +1,9 @@ [#]: collector: "lujun9972" -[#]: translator: "fisherue " +[#]: translator: "fisherue" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " -[#]: subject: "5 步提升你的脚本程序" +[#]: subject: "5 ways to improve your Bash scripts" [#]: via: "https://opensource.com/article/20/1/improve-bash-scripts" [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" From 9352a07404ec8fd73d78a7ec1ef53bc04a695c10 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sun, 22 Aug 2021 18:53:38 +0800 Subject: [PATCH 153/290] Update 20210821 How to set up your printer on Linux.md fisherue wants to tranlate this page --- sources/tech/20210821 How to set up your printer on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210821 How to set up your printer on Linux.md b/sources/tech/20210821 How to set up your printer on Linux.md index 9ca81518bf..3cf166373a 100644 --- a/sources/tech/20210821 How to set up your printer on Linux.md +++ b/sources/tech/20210821 How to set up your printer on Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/add-printer-linux" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "fisherue " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -93,7 +93,7 @@ via: https://opensource.com/article/21/8/add-printer-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[fisherue](https://github.com/fisherue) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 28f6a9d437b02e93640b10bf318ad345052c1456 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 23 Aug 2021 05:03:58 +0800 Subject: [PATCH 154/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210822=20?= =?UTF-8?q?How=20to=20Monitor=20Log=20Files=20in=20Real=20Time=20in=20Linu?= =?UTF-8?q?x=20[Desktop=20and=20Server]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md --- ... Real Time in Linux -Desktop and Server.md | 137 ++++++++++++++++++ 1 file changed, 137 insertions(+) create mode 100644 sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md diff --git a/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md new file mode 100644 index 0000000000..175e98d6b3 --- /dev/null +++ b/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md @@ -0,0 +1,137 @@ +[#]: subject: "How to Monitor Log Files in Real Time in Linux [Desktop and Server]" +[#]: via: "https://www.debugpoint.com/2021/08/monitor-log-files-real-time/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Monitor Log Files in Real Time in Linux [Desktop and Server] +====== +This tutorial explains how you can monitor Linux log files (desktop, +server or applications) in real time for diagnosis and troubleshooting +purpose.Basic SyntaxUsage +When you ran into problems in your Linux desktop, or server or any application, you first look into the respective log files. The log files are generally a stream of text and messages from applications with a timestamp attached to it. It helps you to narrow down specific instances and helps you find the cause of any problem. It can also help to get assistance from the web as well. + +In general, all log files are located in /var/log. This directory contains log files with extension .log for specific applications, services, and it also contains separate other directories which contains their log files. + +![log files in var-log][1] + +So, that said, if you want to monitor a bunch of log files Or, a specific one – here’s are some ways how you can do it. + +### Monitor Log Files in real time – Linux + +#### Using tail command + +Using the tail command is the most basic way of following a log file in real time. Specially, if you are in a server with only just a terminal, no GUI. This is very helpful. + +Examples: + +``` +tail /path/to/log/file +``` + +![Monitoring multiple log files via tail][2] + +Use the switch -f to follow the log file, which updates in real time. For example, if you want to follow syslog, you can use the following command. + +``` +tail -f /var/log/syslog +``` + +You can monitor multiple log files using a single command using – + +``` +tail -f /var/log/syslog /var/log/dmesg +``` + +If you want to monitor http or sftp or any server, you can also their respective log files in this command. + +Remember, above commands requires admin privileges. + +#### Using lnav (The Logfile Navigator) + +![lnav Running][3] + +The lnav is a nice utility which you can use to monitor log files in a more structured way with color coded messages. This is not installed by default in Linux systems. You can install it using the below command: + +``` +sudo apt install lnav (Ubuntu) +sudo dnf install lnav (Fedora) +``` + +The good thing about lnav is, if you do not want to install it, you can just download its pre-compiled executable and run in anywhere. Even from a USB stick. No setup is required, plus loaded with features. Using lnav you can query the log files via SQL among other cool features which you can learn on it [official website][4]. + +[][5] + +SEE ALSO:   This App is An Advanced Log File Viewer - lnav + +Once installed, you can simply run lnav from terminal with admin privilege, and it will show all the logs from /var/log by default and start monitoring in real time. + +#### A note about journalctl of systemd + +All modern Linux distributions today use systemd, mostly. The systemd provides basic framework and components which runs Linux operating system in general. The systemd provides journal services via journalctl which helps to manage logs from all systemd services. You can also monitor respective systemd services and logs in real time using the following command. + +``` +journalctl -f +``` + +Here are some of the specific journalctl commands which you can use for several cases. You can combine these with -f switch above to start monitoring in real time. + + * To emergency system messages use + + + +``` +journalctl -p 0 +``` + + * Show errors with explanations + + + +``` +journalctl -xb -p 3 +``` + + * Use time controls to filter out + + + +``` +journalctl --since "2020-12-04 06:00:00" +journalctl --since "2020-12-03" --until "2020-12-05 03:00:00" +journalctl --since yesterday +journalctl --since 09:00 --until "1 hour ago" +``` + +If you want to learn more about and want to find out details about journalctl – I have written a [guide here][6]. + +### Closing Notes + +I hope these commands and tricks helps you find out the root cause of your problem/errors in your desktop or servers. For more details, you can always refer to the man pages and play around with various switches. Let me know using the comment box below, if you have any comments or what do you think about this article. + +Cheers. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/monitor-log-files-real-time/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/log-files-in-var-log-1024x312.jpeg +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Monitoring-multiple-log-files-via-tail-1024x444.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/lnav-Running-1024x447.jpeg +[4]: https://lnav.org/features +[5]: https://www.debugpoint.com/2016/11/advanced-log-file-viewer-lnav-ubuntu-linux/ +[6]: https://www.debugpoint.com/2020/12/systemd-journalctl/ From ebbdef26e6dd94016ddcc02898d0ef19aacf63d5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 23 Aug 2021 08:38:30 +0800 Subject: [PATCH 155/290] translating --- ...onize Subtitle With Video Using SubSync.md | 87 ------------------- ...onize Subtitle With Video Using SubSync.md | 87 +++++++++++++++++++ 2 files changed, 87 insertions(+), 87 deletions(-) delete mode 100644 sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md create mode 100644 translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md diff --git a/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md deleted file mode 100644 index 0bd21cdcc0..0000000000 --- a/sources/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: "Automatically Synchronize Subtitle With Video Using SubSync" -[#]: via: "https://itsfoss.com/subsync/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Automatically Synchronize Subtitle With Video Using SubSync -====== - -Let me share a scenario. You are trying to watch a movie or video and you need subtitles. You download the subtitle only to find that the subtitle is not properly synchronized. There are no other good subtitles available. What to do now? - -You can [synchronize subtitles in VLC by pressing G or H keys][1]. It adds a delay to the subtitles. This could work if the subtitle is out of synch by the same time interval throughout the video. But if that’s not the case, SubSync could be of great help here. - -### SubSync: Subtitle Speech Synchronizer - -[SubSync][2] is a nifty open source utility available for Linux, macOS and Windows. - -It synchronizes the subtitle by listening to the audio track and that’s how it works the magic. It will work even if the audio track and the subtitle are in different languages. If necessary, it could also be translated but I did not test this feature. - -I made a simple test by using a subtitle which was not in synch with the video I was playing. To my surprise, it worked pretty smooth and I got perfectly synched subtitles. - -Using SubSync is simple. You start the application and it asks to add the subtitle file and the video file. - -![User interface for SubSync][3] - -You’ll have to specif the language of the subtitle and the video on the interface. It may download additional assets based on the language in use. - -![SubSync may download additional packages for language support][4] - -Please keep in mind that it takes some time to synchronize the subtitles, depending on the length of the video and subtitle. You may grab your cup of tea/coffee or beer while you wait for the process to complete. - -You can see the synchronization status in progress and even save it before it gets completed. - -![SubSync synchronization in progress][5] - -Once the synchronization completes, you hit the save button and either save the changes to the original file or save it as a new subtitle file. - -![Synchronization completed][6] - -I cannot say that it will work in all the cases but it worked for the sample test I ran. - -### Installing SubSync - -SubSync is a cross-platform application and you can get the installer files for Windows and macOS from its [download page][7]. - -For Linux users, SubSync is available as a Snap package. If your distribution has Snap support enabled, use the following command to install SubSync: - -``` -sudo snap install subsync -``` - -Please keep in mind that it will take some time to download SubSync snap package. So have a good internet connection or plenty of patience. - -### In the end - -Personally, I am addicted to subtitles. Even if I am watching movies in English on Netflix, I keep the subtitles on. It helps understand each dialogue clearly, specially if there is a strong accent. Without subtitles I could never understand a [word from Mickey O’Neil (played by Brad Pitt) in the movie Snatch][8]. Dags!! - -Using SubSync is a lot easier than [using Subtitle Editor][9] for synchronizing subtitles. After [Penguin Subtitle Player][10], this is another great tool for someone like me who searches the entire internet for rare or recommended (mystery) movies from different countries. - -If you are a ‘subtitle user’, I have a feeling you would like this tool. If you do use it, please share your experience with it in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/subsync/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/how-to-synchronize-subtitles-with-movie-quick-tip/ -[2]: https://subsync.online/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-interface.png?resize=593%2C280&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize.png?resize=522%2C189&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize-1.png?resize=424%2C278&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize-2.png?resize=424%2C207&ssl=1 -[7]: https://subsync.online/en/download.html -[8]: https://www.youtube.com/watch?v=tGDO-9hfaiI -[9]: https://itsfoss.com/subtitld/ -[10]: https://itsfoss.com/penguin-subtitle-player/ diff --git a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md new file mode 100644 index 0000000000..6359d7c616 --- /dev/null +++ b/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -0,0 +1,87 @@ +[#]: subject: "Automatically Synchronize Subtitle With Video Using SubSync" +[#]: via: "https://itsfoss.com/subsync/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 SubSync 自动将字幕与视频同步化 +====== + +让我分享一个场景。你正试图观看一部电影或视频,你需要字幕。你下载了字幕,却发现字幕没有正确同步。没有其他好的字幕可用。现在该怎么做? + +你可以[在 VLC 中按 G 或 H 键来同步字幕][1]。它为字幕增加了一个延迟。如果字幕在整个视频中以相同的时间间隔不同步,这可能会起作用。但如果不是这种情况,SubSync 在这里会有很大帮助。 + +### SubSync: 字幕语音同步器 + +[SubSync][2] 是一个灵巧的开源工具,可用于 Linux、macOS 和 Windows。 + +它通过收听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也可以被翻译,但我没有测试这个功能。 + +我做了一个简单的测试,使用一个与我正在播放的视频不同步的字幕。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 + +使用 SubSync 很简单。你启动应用,它要求你添加字幕文件和视频文件。 + +![User interface for SubSync][3] + +你必须在界面上指定字幕和视频的语言。它可能会根据使用的语言下载额外的资源。 + +![SubSync may download additional packages for language support][4] + +请记住,同步字幕需要一些时间,这取决于视频和字幕的长度。在等待过程完成时,你可以拿起你的茶/咖啡或啤酒。 + +你可以看到正在进行的同步状态,甚至可以在完成之前保存它。 + +![SubSync synchronization in progress][5] + +同步完成后,你就可以点击保存按钮,把修改的内容保存到原文件中,或者把它保存为新的字幕文件。 + +![Synchronization completed][6] + +我不能说它在所有情况下都能工作,但在我运行的样本测试中它是有效的。 + +### 安装 SubSync + +SubSync 是一个跨平台的应用,你可以从它的[下载页面][7]获得 Windows 和 MacOS 的安装文件。 + +对于 Linux 用户,SubSync 是作为一个 Snap 包提供的。如果你的发行版已经启用了 Snap 支持,使用下面的命令来安装 SubSync: + +``` +sudo snap install subsync +``` + +请记住,下载 SubSync snap 包将需要一些时间。所以要有一个良好的网络连接或足够的耐心。 + +### 最后 + +就我个人而言,我对字幕很上瘾。即使我在 Netflix 上看英文电影,我也会把字幕打开。它有助于清楚地理解每段对话,特别是在有强烈口音的情况下。如果没有字幕,我永远无法理解[电影 Snatch 中 Mickey O'Neil(由 Brad Pitt 扮演)的一句话][8]。 + +使用 SubSync 比[使用 Subtitle Editor][9] 同步字幕要容易得多。在[企鹅字幕播放器][10]之后,对于像我这样在整个互联网上搜索不同国家的稀有或推荐(神秘)电影的人来说,这是另一个很棒的工具。 + +如果你是一个“字幕用户”,我感觉你会喜欢这个工具。如果你使用过它,请在评论区分享你的使用经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/subsync/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/how-to-synchronize-subtitles-with-movie-quick-tip/ +[2]: https://subsync.online/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-interface.png?resize=593%2C280&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize.png?resize=522%2C189&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize-1.png?resize=424%2C278&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/subsync-subtitle-synchronize-2.png?resize=424%2C207&ssl=1 +[7]: https://subsync.online/en/download.html +[8]: https://www.youtube.com/watch?v=tGDO-9hfaiI +[9]: https://itsfoss.com/subtitld/ +[10]: https://itsfoss.com/penguin-subtitle-player/ From 0eebf3d691ebd5ed1be237c223fa182634852800 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 23 Aug 2021 08:42:39 +0800 Subject: [PATCH 156/290] translating --- .../tech/20210819 Check free disk space in Linux with ncdu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210819 Check free disk space in Linux with ncdu.md b/sources/tech/20210819 Check free disk space in Linux with ncdu.md index 1319324bdd..0042c50865 100644 --- a/sources/tech/20210819 Check free disk space in Linux with ncdu.md +++ b/sources/tech/20210819 Check free disk space in Linux with ncdu.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 0ae83d09c204caea6953fc3cc1eb4c29cf95b166 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Mon, 23 Aug 2021 08:51:57 +0800 Subject: [PATCH 157/290] translating --- ... beginner-s guide to SSH for remote connection on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/sources/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md index 64c7c297b7..1d43337a11 100644 --- a/sources/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md +++ b/sources/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (unigeorge) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -169,7 +169,7 @@ via: https://opensource.com/article/20/9/ssh 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[unigeorge](https://github.com/unigeorge) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 057234c8ec38437631eff63a80c2a2e853977449 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Aug 2021 14:46:13 +0800 Subject: [PATCH 158/290] PRF @geekpi --- ...hedule a task with the Linux at command.md | 96 +++++++++---------- 1 file changed, 44 insertions(+), 52 deletions(-) diff --git a/translated/tech/20210815 Schedule a task with the Linux at command.md b/translated/tech/20210815 Schedule a task with the Linux at command.md index a0b6549e4f..bd51762b86 100644 --- a/translated/tech/20210815 Schedule a task with the Linux at command.md +++ b/translated/tech/20210815 Schedule a task with the Linux at command.md @@ -3,58 +3,62 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -用 Linux 的命令来安排一个任务 +用 Linux 的 at 命令来安排一个任务 ====== -at 命令是一种在特定时间和日期安排一次性任务的终端方法。 -![Team checklist][1] -计算机擅长[自动化][2],但不是每个人都知道如何使自动化工作。不过,能够在特定的时间为电脑安排一个任务,然后忘记它,这确实是一种奢侈。也许你有一个文件要在特定的时间上传或下载,或者你需要处理一批还不存在但保证在某个时间存在的文件,或者需要监控的设置,或者你只是需要一个友好的提醒,在下班回家的路上拿起面包和黄油。 +> at 命令是一种在特定时间和日期安排一次性任务的 Linux 终端方法。 + +![](https://img.linux.net.cn/data/attachment/album/202108/23/144542rmmyzwxsnanm4wpj.jpg) + +计算机擅长 [自动化][2],但不是每个人都知道如何使自动化工作。不过,能够在特定的时间为电脑安排一个任务,然后忘记它,这确实是一种享受。也许你有一个文件要在特定的时间上传或下载,或者你需要处理一批还不存在但可以保证在某个时间存在的文件,或者需要监控设置,或者你只是需要一个友好的提醒,在下班回家的路上买上面包和黄油。 -That's what the `at`command is for. 这就是 `at` 命令的用处。 ### 什么是 Linux at 命令? -`at` 命令是 Linux 终端允许你在特定时间和日期安排一次性工作的方法。它是一种自发的自动化,在终端上很容易实现。 +`at` 命令是在 Linux 终端让你在特定时间和日期安排一次性工作的方法。它是一种自发的自动化,在终端上很容易实现。 ### 安装 at -在 Linux 上,`at` 命令可能已经安装了。你可以使用 `at -V` 命令来验证它是否已经安装。只要返回一个版本,就说明你已经安装了 `at`。 - +在 Linux 上,`at` 命令可能已经安装了。你可以使用 `at -V` 命令来验证它是否已经安装。只要返回一个版本号,就说明你已经安装了 `at`。 ``` $ at -V at version x.y.z ``` -如果你试图使用 `at`,但没有找到该命令,大多数现代的 Linux 发行版会提供缺少的 `at` 包。 +如果你试图使用 `at`,但没有找到该命令,大多数现代的 Linux 发行版会为你提供缺少的 `at` 软件包。 + +你可能还需要启动 `at` 守护程序,称为 `atd`。在大多数 Linux 系统中,你可以使用 `systemctl` 命令来启用该服务,并将它们设置为从现在开始自动启动: + +``` +$ sudo systemctl enable --now atd +``` ### 用 at 交互式地安排一个作业 -当你使用 `at` 命令和你希望任务运行的时间时,你会打开一个交互式 `at` 提示。你可以输入你想在你指定的时间运行的命令。 +当你使用 `at` 命令并加上你希望任务运行的时间,会打开一个交互式 `at` 提示符。你可以输入你想在指定时间运行的命令。 -如果有帮助的话,你可以把这个过程看作是一个日历应用,就像你可能在你的手机上使用的那样。首先,你在某一天的某个时间创建一个事件,然后指定你想要发生什么。 - -例如,尝试通过创建一个未来几分钟的任务来计划给自己的备忘录。让任务变得简单,以减少失败的可能性。要退出 `at` 提示,请按键盘上的 **Ctrl+D**。 +做个比喻,你可以把这个过程看作是一个日历应用,就像你在你的手机上使用的那样。首先,你在某一天的某个时间创建一个事件,然后指定你想要发生什么。 +例如,可以试试创建一个未来几分钟的任务,来给自己计划一个备忘录。这里运行一个简单的任务,以减少失败的可能性。要退出 `at` 提示符,请按键盘上的 `Ctrl+D`。 ``` $ at 11:20 AM warning: commands will be executed using /bin/sh -at> echo "hello world" > ~/at-test.txt -at> <EOT> +at> echo "hello world" > ~/at-test.txt +at> job 3 at Mon Jul 26 11:20:00 2021 ``` -正如你所看到的,`at` 使用直观和自然的时间定义。你不需要知道 24 小时制的时钟,也不需要把时间翻译成 UTC 或特定的 ISO 格式。一般来说,你可以使用你自然想到的任何符号,如 _noon_、_1:30 PM_、_13:37_ 等等,来描述你希望一个任务发生的时间。 +正如你所看到的,`at` 使用直观和自然的时间定义。你不需要用 24 小时制的时钟,也不需要把时间翻译成 UTC 或特定的 ISO 格式。一般来说,你可以使用你自然想到的任何符号,如 `noon`、`1:30 PM`、`13:37` 等等,来描述你希望一个任务发生的时间。 等待几分钟,然后在你创建的文件上运行 `cat` 或者 `tac` 命令,验证你的任务是否已经运行: - ``` $ cat ~/at-test.txt hello world @@ -62,16 +66,14 @@ hello world ### 用 at 安排一个任务 -你不必使用 `at` 交互式提示符来安排任务。你可以使用 `echo` 或 `printf` 向它传送命令。在这个例子中,我使用了 _now_ 符号,以及我希望任务从现在开始延迟多少分钟: - +你不必使用 `at` 交互式提示符来安排任务。你可以使用 `echo` 或 `printf` 向它传送命令。在这个例子中,我使用了 `now` 符号,以及我希望任务从现在开始延迟多少分钟: ``` -`$ echo "echo 'hello again' >> ~/at-test.txt" | at now +1 minute` +$ echo "echo 'hello again' >> ~/at-test.txt" | at now +1 minute ``` 一分钟后,验证新的命令是否已被执行: - ``` $ cat ~/at-test.txt hello world @@ -82,37 +84,30 @@ hello again `at` 命令在解释时间时是非常宽容的。你可以在许多格式中选择,这取决于哪一种对你来说最方便: - * `YYMMDDhhmm`[.ss] -(缩写的年、月、日、小时、分钟,也可选择秒) - * `CCYYMMDDhhmm`[.ss] -(完整的年、月、日、时、分,也可选择的秒) - * `now` - * `midnight` - * `noon` - * `teatime`(4 PM) - * `AM` - * `PM` - - - -时间和日期可以是绝对的,也可以加一个加号(_+_),使其与 _now_ 相对。当指定相对时间时,你可以使用你可能已经使用的词语: - - * `minutes` - * `hours` - * `days` - * `weeks` - * `months` - * `years` + * `YYMMDDhhmm[.ss]`(两位的年份、月、日、小时、分钟,及可选的秒) + * `CCYYMMDDhhmm[.ss]`(四位的年份、月、日、时、分钟,及可选的秒) + * `now`(现在) + * `midnight`(午夜 00:00) + * `noon`(中午 12:00) + * `teatime`(下午 16 点) + * `AM`(上午) + * `PM`(下午) +时间和日期可以是绝对时间,也可以加一个加号(`+`),使其与 `now` 相对。当指定相对时间时,你可以使用你可能用过的词语: + * `minutes`(分钟) + * `hours`(小时) + * `days`(天) + * `weeks`(星期) + * `months`(月) + * `years`(年) ### 时间和日期语法 -`at` 命令对日期的输入相比日期不那么宽容。时间必须放在第一位,接着是日期,尽管日期默认为当前日期,并且只有在为未来某天安排任务时才需要。 +`at` 命令对时间的输入相比日期不那么宽容。时间必须放在第一位,接着是日期,尽管日期默认为当前日期,并且只有在为未来某天安排任务时才需要。 这些是一些有效表达式的例子: - ``` $ echo "rsync -av /home/tux me@myserver:/home/tux/" | at 3:30 AM tomorrow $ echo "/opt/batch.sh ~/Pictures" | at 3:30 AM 08/01/2022 @@ -121,12 +116,10 @@ $ echo "echo hello" | at now + 3 days ### 查看你的 at 队列 -当你接受了 `at`,并且正在安排任务,而不是在桌子上的废纸上乱写乱画,你可能想查看一下你是否有任务还在队列中。 - +当你爱上了 `at`,并且正在安排任务,而不是在桌子上的废纸上乱写乱画,你可能想查看一下你是否有任务还在队列中。 要查看你的 `at` 队列,使用 `atq` 命令: - ``` $ atq 10 Thu Jul 29 12:19:00 2021 a tux @@ -136,7 +129,6 @@ $ atq 要从队列中删除一个任务,使用 `atrm` 命令和任务号。例如,要删除任务 7: - ``` $ atrm 7 $ atq @@ -144,11 +136,11 @@ $ atq 9 Tue Jul 27 03:30:00 2021 a tux ``` -要看一个计划中的任务的实际内容,你需要查看 `at` spool。只有 root 用户可以查看 `at` spool,所以你必须使用 `sudo` 来查看 spool 或 `cat` 任何任务的内容。 +要看一个计划中的任务的实际内容,你需要查看 `/var/spool/at` 下的内容。只有 root 用户可以查看该目录的内容,所以你必须使用 `sudo` 来查看或 `cat` 任何任务的内容。 ### 用 Linux at 安排任务 -`at` 系统是一个很好的避免忘记在一天中晚些时候运行一个作业,或者在你离开时让你的计算机为你运行一个作业的方法。与 `cron` 不同的是,它不像 `cron` 那样要求任务必须从现在起一直按计划运行到永远,因此它的语法比 `cron` 简单得多。 +`at` 系统是一个很好的方法,可以避免忘记在一天中晚些时候运行一个作业,或者在你离开时让你的计算机为你运行一个作业。与 `cron` 不同的是,它不像 `cron` 那样要求任务必须从现在起一直按计划运行到永远,因此它的语法比 `cron` 简单得多。 等下次你有一个希望你的计算机记住并管理它的小任务,试试 `at` 命令。 @@ -159,7 +151,7 @@ via: https://opensource.com/article/21/8/linux-at-command 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cfe3682f8c4812beee71c33a3243e4e3489d22d3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Aug 2021 14:47:00 +0800 Subject: [PATCH 159/290] PUB @geekpi https://linux.cn/article-13710-1.html --- .../20210815 Schedule a task with the Linux at command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210815 Schedule a task with the Linux at command.md (98%) diff --git a/translated/tech/20210815 Schedule a task with the Linux at command.md b/published/20210815 Schedule a task with the Linux at command.md similarity index 98% rename from translated/tech/20210815 Schedule a task with the Linux at command.md rename to published/20210815 Schedule a task with the Linux at command.md index bd51762b86..f4212f579c 100644 --- a/translated/tech/20210815 Schedule a task with the Linux at command.md +++ b/published/20210815 Schedule a task with the Linux at command.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13710-1.html" 用 Linux 的 at 命令来安排一个任务 ====== From f2fefb6e80568d1dbf7f4e7080eeff8d86ce8f69 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Aug 2021 14:56:50 +0800 Subject: [PATCH 160/290] APL --- sources/tech/20210822 Linux Phones- Here are Your Options.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210822 Linux Phones- Here are Your Options.md b/sources/tech/20210822 Linux Phones- Here are Your Options.md index 121c32200a..d4071ef0b7 100644 --- a/sources/tech/20210822 Linux Phones- Here are Your Options.md +++ b/sources/tech/20210822 Linux Phones- Here are Your Options.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/linux-phones/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 1cba331f01e8f790a0c50408e9d4166644c48007 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Aug 2021 15:53:02 +0800 Subject: [PATCH 161/290] TSL&PRF @wxy --- ...822 Linux Phones- Here are Your Options.md | 134 ------------------ ...822 Linux Phones- Here are Your Options.md | 126 ++++++++++++++++ 2 files changed, 126 insertions(+), 134 deletions(-) delete mode 100644 sources/tech/20210822 Linux Phones- Here are Your Options.md create mode 100644 translated/tech/20210822 Linux Phones- Here are Your Options.md diff --git a/sources/tech/20210822 Linux Phones- Here are Your Options.md b/sources/tech/20210822 Linux Phones- Here are Your Options.md deleted file mode 100644 index d4071ef0b7..0000000000 --- a/sources/tech/20210822 Linux Phones- Here are Your Options.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: "Linux Phones: Here are Your Options" -[#]: via: "https://itsfoss.com/linux-phones/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linux Phones: Here are Your Options -====== - -_**Brief:**_ _Linux phones could be the future to replace Android or iOS, but what are some of your options to give it a try?_ - -While Android is based on a Linux kernel, it has been heavily modified. So, that does not make it a full-fledged Linux-based operating system. - -Google is trying to get the Android kernel close to the mainline Linux kernel, but that is still a distant dream. - -So, in that case, what are some of the options if you are looking for a Linux phone? A smartphone powered by a Linux operating system. - -It is not an easy decision to make because the options are super limited. Hence, I try to highlight some of the best Linux phones and a few different options from the mainstream choices. - -### Top Linux phones you can use today - -It is worth noting that the Linux phones mentioned here may not be able to replace your Android or iOS devices. So, make sure that you do some background research before making a purchase decision. - -**Note:** You need to carefully check the availability, expected shipping date, and risks of using a Linux phone. Most of the options are only suitable for enthusiasts or early adopters. - -#### 1\. PinePhone - -![][1] - -PinePhone is one of the most affordable and popular choices to consider as a promising Linux phone. - -It is not limited to a single operating system. You can try it with Manjaro with Plasma mobile OS, UBports, Sailfish OS, and others. PinePhone packs in some decent specifications that include a Quad-core processor and 2/3 Gigs of RAM. It does support a bootable microSD card to help you with installation, along with 16/32 GB eMMC storage options. - -The display is a basic 1440×720p IPS screen. You also get special privacy protection tweaks like kill switches for Bluetooth, microphones, and cameras. - -PinePhone also gives you an option to add custom hardware extensions using the six pogo pins available. - -The base edition (2 GB RAM and 16 GB storage) comes loaded with Manjaro by default and costs $149. And, the convergence edition (3 GB RAM / 32 GB storage) costs $199. - -[PinePhone][2] - -#### 2\. Fairphone - -![][3] - -Compared to others on the list, Fairphone is a commercial success. It is not a Linux smartphone, but it features a customized version of Android, i.e., Fairphone OS, and the option to opt for [/e/ OS][4], one of the [open-source Android alternatives][5]. Some community ports are available if you want to use the Linux operating system, but it could be a hit and miss. - -The Fairphone offers some decent specs, considering there are two different variants. You will find a 48 MP camera sensor for Fairphone 3+ and a full-HD display. Not to forget, you will also find decent Qualcomm processors powering the device. - -They focus on making smartphones that are sustainable and have been built using some amount of recycled plastic. Fairphone is also meant to be easily repairable. - -So, it is not just an option away from mainstream smartphones, but you will also be helping with protecting the environment if you opt for it. - -[Fairphone][6] - -### 3\. Librem 5 - -![][7] - -[Librem 5][8] is a smartphone that focuses heavily on user privacy while featuring an open-source operating system, i.e., PureOS, not based on Android. - -The specifications offered are decent, with 3 Gigs of RAM and a quad-core Cortex A53 chipset. But, this is not something geared to compete with mainstream options. Hence, you may not find it as a value for money offering. - -It is aimed at enthusiasts who are interested in testing privacy-respecting smartphones in the process. - -Similar to others, Librem 5 also focuses on making the phone easily repairable by offering user-replaceable batteries. - -For privacy, you will notice kill switches for Bluetooth, Cameras, and microphones. They also promise security updates for years to come. - -[Librem 5][9] - -### 4\. Pro 1X - -![][10] - -An interesting smartphone that supports Ubuntu Touch, Lineage OS, and Android as well. - -It is not just a Linux smartphone but a mobile phone with a separate QWERTY keypad, which is rare to find these days. - -The Pro 1 X features a decent specification, including a Snapdragon 662 processor coupled with 6 GB of RAM. You also get a respectable AMOLED Full HD display with the Pro 1 X. - -The camera does not pack in anything crazy, but should be good enough for the most part. - -[Pro 1X][11] - -### 5\. Volla Phone - -![][12] - -An attractive offering that runs on Ubuntu Touch by UBports. - -It comes with a pre-built VPN and focuses on making the user experience easy. The operating system has been customized so that everything essential should be accessible quickly without organizing anything yourself. - -It packs in some impressive specifications that include an Octa-core MediaTek processor along with a 4700 mAh battery. You get a notch design resembling some of the latest smartphones available. - -[Volla Phone][13] - -### Wrapping Up - -Linux smartphones are not readily available and certainly not yet suitable for the masses. - -So, if you are an enthusiast or want to support the development of such phones, you can consider getting one of the devices. - -Do you already own one of these smartphones? Please don’t hesitate to share your experiences in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-phones/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/PinePhone-3.jpg?resize=800%2C800&ssl=1 -[2]: https://www.pine64.org/pinephone/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/fairphone.png?resize=360%2C600&ssl=1 -[4]: https://itsfoss.com/e-os-review/ -[5]: https://itsfoss.com/open-source-alternatives-android/ -[6]: https://shop.fairphone.com/en/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/librem-5.png?resize=800%2C450&ssl=1 -[8]: https://itsfoss.com/librem-linux-phone/ -[9]: https://puri.sm/products/librem-5/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/pro1x.jpg?resize=800%2C542&ssl=1 -[11]: https://www.fxtec.com/pro1x -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/volla-smartphone.jpg?resize=695%2C391&ssl=1 -[13]: https://www.indiegogo.com/projects/volla-phone-free-your-mind-protect-your-privacy#/ diff --git a/translated/tech/20210822 Linux Phones- Here are Your Options.md b/translated/tech/20210822 Linux Phones- Here are Your Options.md new file mode 100644 index 0000000000..53a75676dd --- /dev/null +++ b/translated/tech/20210822 Linux Phones- Here are Your Options.md @@ -0,0 +1,126 @@ +[#]: subject: "Linux Phones: Here are Your Options" +[#]: via: "https://itsfoss.com/linux-phones/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +如何选择一台 Linux 手机 +====== + +![](https://img.linux.net.cn/data/attachment/album/202108/23/155159e5s33xo63tz5jddz.jpg) + +> 未来取代安卓或 iOS 的可能是 Linux 手机,但如今,有哪些选择可以尝试一下呢? + +虽然安卓是基于 Linux 内核的,但它经过了大量修改。因此,这意味着它不是一个完全意义上的基于 Linux 的操作系统。 + +谷歌正在努力使安卓内核更接近主线 Linux 内核,但这仍然是一个遥远的梦想。 + +那么,在这种情况下,如果你正在寻找一款 Linux 手机、一款由 Linux 操作系统驱动的智能手机,有哪些可以选择呢? + +这并不是一个容易做出的决定,因为你的选择非常有限。因此,我试图推荐一些最好的、不同于主流选择的 Linux 手机。 + +### 如今你可以使用的顶级 Linux 手机 + +值得注意的是,这里提到的 Linux 手机或许无法取代你的安卓或 iOS 设备。因此,在做出购买决定之前,请确保你做了一些背景研究。 + +**注意:** 你需要仔细检查这些 Linux 手机是否可以购买到、预期的发货日期和使用风险。它们大多数只适合于发烧友或早期试用者。 + +#### 1、PinePhone + +![][1] + +[PinePhone][2] 是最有性价比和最受欢迎的选择之一,我觉得它是一个有前途的 Linux 手机。 + +它并不局限于单一的操作系统。你可以尝试使用带有 Plasma mobile OS 的 Manjaro、UBports、Sailfish OS 等系统。PinePhone 的配置不错,它包括一个四核处理器和 2G 或3G 的内存。它支持使用可启动的 microSD 卡来帮助你安装系统,还可选 16/32GB eMMC 存储。 + +其显示屏是一个基本的 1440×720p IPS 屏幕。你还可以得到特殊的隐私保护,如蓝牙、麦克风和摄像头的断路开关。 + +PinePhone 还为你提供了使用六个可用的 pogo 引脚添加自定义的硬件扩展的方式。 + +其基本版(2GB 内存和 16GB 存储)默认加载了 Manjaro,价格为 149 美元;而融合版(3GB 内存和 32GB 存储)价格为 199 美元。 + +#### 2、Fairphone + +![][3] + +与这个清单上的其他选择相比,[Fairphone][6] 在商业上是成功的。它不是一款 Linux 智能手机,但它具有定制版的安卓系统,即 Fairphone OS,并且可以选择 [开源安卓系统替代品][5] 之一 [/e/ OS][4]。如果你想使用 Linux 操作系统,也有一些社区移植版本,但可能有点碰运气。 + +Fairphone 有两个不同的版本,提供了一些不错的配置规格。你会发现 Fairphone 3+ 有一个 4800 万像素的相机传感器和一个全高清显示屏。另外,你还会发现先进的高通处理器为该设备提供了动力。 + +他们专注于制造可持续发展的智能手机,并使用了一定量的回收塑料制造。这也为了方便维修。 + +因此,它不仅是一个非主流智能手机的选择,而且如果你选择了它,你也将为保护环境出了力。 + +### 3、Librem 5 + +![][7] + +[Librem 5][9] 是一款非常注重用户隐私的智能手机,同时它采用了开源的操作系统,即 PureOS,并非基于安卓。 + +它所提供的配置规格还不错,有 3GB 内存和四核 Cortex A53 芯片组。但是,这无法与主流选择相竞争。因此,你可能不会觉得它物美价廉。 + +它的目标是那些对尊重隐私的智能手机感兴趣的发烧友。 + +与其他产品类似,Librem 5 也专注于通过提供用户可更换的电池使手机易于维修。 + +在隐私方面,你会注意到有蓝牙、相机和麦克风的断路开关。他们还承诺了未来几年的安全更新。 + +### 4、Pro 1X + +![][10] + +[Pro 1X][11] 是一款有趣的智能手机,同时支持 Ubuntu Touch、Lineage OS 和安卓。 + +它不仅是一款 Linux 智能手机,而且是一款带有独立 QWERTY 键盘的手机,这在现在是很罕见的。 + +Pro 1 X 的配置规格不错,包括了一个骁龙 662 处理器和 6GB 内存。它还带有一块不错的 AMOLED 全高清显示屏。 + +它的相机不是特别强大,但在大多数情况下应该是足够了。 + +### 5、Volla Phone + +![][12] + +[Volla Phone][13] 是一个有吸引力的产品,运行在 UBports 的 Ubuntu Touch。 + +它配备了预制的 “虚拟专用网络” ,并专注于简化用户体验。它的操作系统是定制的,因此,可以快速访问所有重要的东西,而无需自己组织。 + +它的配置规格令人印象深刻,包括了一个八核联发科处理器和 4700 毫安时的电池。你会得到类似于一些最新的智能手机上的设计。 + +### 总结 + +Linux 智能手机不是到处都能买到的,当然也还不适合大众使用。 + +因此,如果你是一个发烧友,或者想支持这种手机的发展,你可以考虑购买一台。 + +你已经拥有一台这种智能手机了吗?请不要犹豫,在下面的评论中分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-phones/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/PinePhone-3.jpg?resize=800%2C800&ssl=1 +[2]: https://www.pine64.org/pinephone/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/fairphone.png?resize=360%2C600&ssl=1 +[4]: https://itsfoss.com/e-os-review/ +[5]: https://itsfoss.com/open-source-alternatives-android/ +[6]: https://shop.fairphone.com/en/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/librem-5.png?resize=800%2C450&ssl=1 +[8]: https://itsfoss.com/librem-linux-phone/ +[9]: https://puri.sm/products/librem-5/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/pro1x.jpg?resize=800%2C542&ssl=1 +[11]: https://www.fxtec.com/pro1x +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/volla-smartphone.jpg?resize=695%2C391&ssl=1 +[13]: https://www.indiegogo.com/projects/volla-phone-free-your-mind-protect-your-privacy#/ From 2eeacdf1b6fd8fdb29c2d3ea7afb459466818539 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 23 Aug 2021 15:54:48 +0800 Subject: [PATCH 162/290] PUB @wxy https://linux.cn/article-13711-1.html --- .../20210822 Linux Phones- Here are Your Options.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210822 Linux Phones- Here are Your Options.md (98%) diff --git a/translated/tech/20210822 Linux Phones- Here are Your Options.md b/published/20210822 Linux Phones- Here are Your Options.md similarity index 98% rename from translated/tech/20210822 Linux Phones- Here are Your Options.md rename to published/20210822 Linux Phones- Here are Your Options.md index 53a75676dd..21375774ba 100644 --- a/translated/tech/20210822 Linux Phones- Here are Your Options.md +++ b/published/20210822 Linux Phones- Here are Your Options.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13711-1.html" 如何选择一台 Linux 手机 ====== From 735ebd692d4dad215c5d77f102e305750e7ef29d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Aug 2021 05:03:19 +0800 Subject: [PATCH 163/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210823=20?= =?UTF-8?q?Apps=20for=20daily=20needs=20part=204:=20audio=20editors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210823 Apps for daily needs part 4- audio editors.md --- ...s for daily needs part 4- audio editors.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20210823 Apps for daily needs part 4- audio editors.md diff --git a/sources/tech/20210823 Apps for daily needs part 4- audio editors.md b/sources/tech/20210823 Apps for daily needs part 4- audio editors.md new file mode 100644 index 0000000000..39d770f224 --- /dev/null +++ b/sources/tech/20210823 Apps for daily needs part 4- audio editors.md @@ -0,0 +1,87 @@ +[#]: subject: "Apps for daily needs part 4: audio editors" +[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/" +[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Apps for daily needs part 4: audio editors +====== + +![][1] + +Photo by [Brooke Cagle][2] on [Unsplash][3] + +Audio editor applications or digital audio workstations (DAW) were only used in the past by professionals, such as record producers, sound engineers, and musicians. But nowadays many people who are not professionals also need them. These tools are used for narration on presentations, video blogs, and even just as a hobby. This is especially true now since there are so many online platforms that facilitate everyone sharing audio works, such as music, songs, podcast, etc. This article will introduce some of the open source audio editors or DAW that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is a list of a few apps for daily needs in the audio editors or DAW category. + +### Audacity + +I’m sure many already know Audacity. It is a popular multi-track audio editor and recorder that can be used for post-processing all types of audio. Most people use Audacity to record their voices, then do editing to make the results better. The results can be used as a podcast or a narration for a video blog. In addition, people also use Audacity to create music and songs. You can record live audio through a microphone or mixer. It also supports 32 bit sound quality. + +Audacity has a lot of features that can support your audio works. It has support for plugins, and you can even write your own plugin. Audacity provides many built-in effects, such as noise reduction, amplification, compression, reverb, echo, limiter, and many more. You can try these effects while listening to the audio directly with the real-time preview feature. The built in plugin-manager lets you manage frequently used plugins and effects. + +![][5] + +More information is available at this link: + +* * * + +### LMMS + +LMMS or Linux MultiMedia Studio is a comprehensive music creation application. You can use LMMS to produce your music from scratch with your computer. You can create melodies and beats according to your creativity, and make it better with selection of sound instruments and various effects. There are several built-in features related to musical instruments and effects, such as 16 built-in sythesizers, embedded ZynAddSubFx, drop-in VST effect plug-in support, bundled graphic and parametric equalizer, built-in analyzer, and many more. LMMS also supports MIDI keyboards and other audio peripherals. + +![][6] + +More information is available at this link: + +* * * + +### Ardour + +Ardour has capabilities similar to LMMS as a comprehensive music creation application. It says on its website that Ardour is a DAW application that is the result of collaboration between musicians, programmers, and professional recording engineers from around the world. Ardour has various functions that are needed by audio engineers, musicians, soundtrack editors, and composers. + +Ardour provides complete features for recording, editing, mixing, and exporting. It has unlimited multichannel tracks, non-linear editor with unlimited undo/redo, a full featured mixer, built-in plugins, and much more. Ardour also comes with video playback tools, so it is also very helpful in the process of creating and editing soundtracks for video projects. + +![][7] + +More information is available at this link: + +* * * + +### TuxGuitar + +TuxGuitar is a tablature and score editor. It comes with a tablature editor, score viewer, multitrack display, time signature management, and tempo management. It includes various effects, such as bend, slide, vibrato, etc. While TuxGuitar focuses on the guitar, it allows you to write scores for other instruments. It can also serve as a basic MIDI editor. You need to have an understanding of tablature and music scoring to be able to use it. + +![][8] + +More information is available at this link: + +* * * + +### Conclusion + +This article presented four audio editors as apps for your daily needs and use on Fedora Linux. Actually there are many other audio editors, or DAW, that you can use on Fedora Linux. You can also use Mixxx, Rosegarden, Kwave, Qtractor, MuseScore, musE, and many more. Hopefully this article can help you investigate and choose the right audio editor or DAW. If you have experience using these applications, please share your experiences in the comments. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/ + +作者:[Arman Arisman][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-4-Audio-816x345.jpg +[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ +[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-audacity-1024x575.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-lmms-1024x575.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-ardour-1024x592.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-tuxguitar-1024x575.png From 9a9fc7f0cb37b7b316b7461f06ef4991386ce881 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Aug 2021 05:03:27 +0800 Subject: [PATCH 164/290] add done: 20210823 Apps for daily needs part 4- audio editors.md --- sources/tech/20210824 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210824 .md diff --git a/sources/tech/20210824 .md b/sources/tech/20210824 .md new file mode 100644 index 0000000000..b04e0acb3f --- /dev/null +++ b/sources/tech/20210824 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/upgrade-opensuse-from-15-2-to-15-3/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/upgrade-opensuse-from-15-2-to-15-3/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From f8e0c2b764b8a448cb984845067266c4bbdbd16f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Aug 2021 05:03:42 +0800 Subject: [PATCH 165/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210824=20?= =?UTF-8?q?Ulauncher:=20A=20Super=20Useful=20Application=20Launcher=20for?= =?UTF-8?q?=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md --- ...r Useful Application Launcher for Linux.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md diff --git a/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md new file mode 100644 index 0000000000..f82caed047 --- /dev/null +++ b/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md @@ -0,0 +1,126 @@ +[#]: subject: "Ulauncher: A Super Useful Application Launcher for Linux" +[#]: via: "https://itsfoss.com/ulauncher/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ulauncher: A Super Useful Application Launcher for Linux +====== + +_**Brief:**_ _Ulauncher is a fast application launcher with extension and shortcut support to help you quickly access application and files in Linux._ + +An application launcher lets you quickly access or open an app without hovering over the application menu icons. + +By default, I found the application launcher with Pop!_OS super handy. But, not every Linux distribution offers an application launcher out-of-the-box. + +Fortunately, there is a solution with which you can add the application launcher to most of the popular distros out there. + +### Ulauncher: Open Source Application Launcher + +![][1] + +Ulauncher is a quick application launcher built using Python while utilizing GTK+. + +It gives a decent amount of customization and control options to tweak. Overall, you can adjust its behavior and experience to suit your taste. + +Let me highlight some of the features that you can expect with it. + +### Ulauncher Features + +The options that you get with Ulauncher are super accessible and easy to customize. Some key highlights include: + + * Fuzzy search algorithm, which lets you find applications even if you misspell them + * Remembers your last searched application in the same session + * Frequently used apps display (optional) + * Custom color themes + * Preset color themes that include a dark theme + * Shortcut to summon the launcher can be easily customized + * Browse files and directories + * Support for extensions to get extra functionality (emoji, weather, speed test, notes, password manager, etc.) + * Shortcuts for browsing sites like Google, Wikipedia, and Stack Overflow + + + +It provides almost every helpful ability that you may expect in an application launcher, and even better. + +### How to Use Ulauncher in Linux? + +By default, you need to press **Ctrl + Space** to get the application launcher after you open it from the application menu for the first time. + +Start typing in to search for an application. And, if you are looking for a file or directory, start typing with “**~**” or “**/**” (ignoring the quotes). + +![][2] + +There are default shortcuts like “**g XYZ**” where XYZ is the search term you want to search for in Google. + +![][3] + +Similarly, you can search for something directly taking you to Wikipedia or Stack Overflow, with “**wiki**” and “**so**” shortcuts, respectively. + +Without any extensions, you can also calculate things on the go and copy the results directly to the keyboard. + +![][4] + +This should come in handy for quick calculations without needing to launch the calculator app separately. + +You can head to its [extensions page][5] and browse for useful extensions along with screenshots that should instruct you how to use it. + +To change how it works, enable frequent applications display, and adjust the theme — click on the gear icon on the right side of the launcher. + +![][6] + +You can set it to auto-start. But, if it does not work on your Systemd enabled distro, you can refer to its GitHub page to add it to the service manager. + +The options are self-explanatory and are easy to customize, as shown in the screenshot below. + +![][7] + +### Installing Ulauncher in Linux + +Ulauncher provides a **.deb** package for Debian or Ubuntu-based distributions. You can explore [how to install Deb][8] [f][8][iles][8] if you’re new to Linux. + +In either case, you can also add its PPA and install it via terminal by following the commands below: + +``` +sudo add-apt-repository ppa:agornostal/ulauncher +sudo apt update +sudo apt install ulauncher +``` + +You can also find it available in the [AUR][9] for Arch and Fedora’s default repositories. + +For more information, you can head to its official website or the [GitHub page][10]. + +[Ulauncher][11] + +Ulauncher should be an impressive addition to any Linux distro. Especially, if you want the functionality of a quick launcher like Pop!_OS offers, this is a fantastic option to consider. + +_Have you tried Ulauncher yet? You are welcome to share your thoughts on how this might help you get things done quickly._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ulauncher/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher.png?resize=800%2C512&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-directory.png?resize=800%2C503&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-google.png?resize=800%2C449&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-calculator.png?resize=800%2C429&ssl=1 +[5]: https://ext.ulauncher.io +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-gear-icon.png?resize=800%2C338&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-settings.png?resize=800%2C492&ssl=1 +[8]: https://itsfoss.com/install-deb-files-ubuntu/ +[9]: https://itsfoss.com/aur-arch-linux/ +[10]: https://github.com/Ulauncher/Ulauncher/ +[11]: https://ulauncher.io From 176b9cd2007f3f3b4ead6f74a18a8397d2a27054 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Aug 2021 05:04:06 +0800 Subject: [PATCH 166/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210823=20?= =?UTF-8?q?Access=20your=20iPhone=20on=20Linux=20with=20this=20open=20sour?= =?UTF-8?q?ce=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210823 Access your iPhone on Linux with this open source tool.md --- ...one on Linux with this open source tool.md | 107 ++++++++++++++++++ 1 file changed, 107 insertions(+) create mode 100644 sources/tech/20210823 Access your iPhone on Linux with this open source tool.md diff --git a/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md b/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md new file mode 100644 index 0000000000..711b822f76 --- /dev/null +++ b/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md @@ -0,0 +1,107 @@ +[#]: subject: "Access your iPhone on Linux with this open source tool" +[#]: via: "https://opensource.com/article/21/8/libimobiledevice-iphone-linux" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Access your iPhone on Linux with this open source tool +====== +Communicate with iOS devices from Linux by using Libimobiledevice. +![A person looking at a phone][1] + +The iPhone and iPad aren't by any means open source, but they're popular devices. Many people who own an iOS device also happen to use a lot of open source, including Linux. Users of Windows and macOS can communicate with an iOS device by using software provided by Apple, but Apple doesn't support Linux users. Open source programmers came to the rescue back in 2007 (just a year after the iPhone's release) with Libimobiledevice (then called libiphone), a cross-platform solution for communicating with iOS. It runs on Linux, Android, Arm systems such as the Raspberry Pi, Windows, and even macOS. + +Libimobiledevice is written in C and uses native protocols to communicate with services running on iOS devices. It doesn't require any libraries from Apple, so it's fully free and open source. + +Libimobiledevice is an object-oriented API, and there are a number of terminal utilities that come bundled with it for your convenience. The library supports Apple's earliest iOS devices all the way up to its latest models. This is the result of years of research and development. Applications in the project include **usbmuxd**, **ideviceinstaller**, **idevicerestore**, **ifuse**, **libusbmuxd**, **libplist**, **libirecovery**, and **libideviceactivation**. + +### Install Libimobiledevice on Linux + +On Linux, you may already have **libimobiledevice** installed by default. You can find out through your package manager or app store, or by running one of the commands included in the project: + + +``` +`$ ifuse --help` +``` + +You can install **libimobiledevice** using your package manager. For instance, on Fedora or CentOS: + + +``` +`$ sudo dnf install libimobiledevice ifuse usbmuxd` +``` + +On Debian and Ubuntu: + + +``` +`$ sudo apt install usbmuxd libimobiledevice6 libimobiledevice-utils` +``` + +Alternatively, you can [download][2] and install **libimobiledevice** from source code. + +### Connecting your device + +Once you have the required packages installed, connect your iOS device to your computer. + +Make a directory as a mount point for your iOS device. + + +``` +`$ mkdir ~/iPhone` +``` + +Next, mount the device: + + +``` +`$ ifuse ~/iPhone` +``` + +Your device prompts you to trust the computer you're using to access it. + +![iphone prompts to trust the computer][3] + +Figure 1: The iPhone prompts you to trust the computer. + +Once the trust issue is resolved, you see new icons on your desktop. + +![iphone icons appear on desktop][4] + +Figure 2: New icons for the iPhone appear on the desktop. + +Click on the **iPhone** icon to reveal the folder structure of your iPhone. + +![iphone folder structure displayed][5] + +Figure 3: The iPhone folder structure is displayed. + +The folder I usually access most frequently is **DCIM**, where my iPhone photos are stored. Sometimes I use these photos in articles I write, and sometimes there are photos I want to enhance with open source applications like Gimp. Having direct access to the images instead of emailing them to myself is one of the benefits of using the Libimobiledevice utilities. I can copy any of these folders to my Linux computer. I can create folders on the iPhone and delete them too. + +### Find out more + +[Martin Szulecki][6] is the lead developer for the project. The project is looking for developers to add to their [community][7]. Libimobiledevice can change the way you use your peripherals, regardless of what platform you're on. It's another win for open source, which means it's a win for everyone. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/libimobiledevice-iphone-linux + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_mobile_phone.png?itok=RqVtvxkd (A person looking at a phone) +[2]: https://github.com/libimobiledevice/libimobiledevice/ +[3]: https://opensource.com/sites/default/files/1trust_0.png +[4]: https://opensource.com/sites/default/files/2docks.png +[5]: https://opensource.com/sites/default/files/2iphoneicon.png +[6]: https://github.com/FunkyM +[7]: https://libimobiledevice.org/#community From bed38d53fda1623eda06f2b14ace566058e97c90 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Aug 2021 05:04:24 +0800 Subject: [PATCH 167/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210823=20?= =?UTF-8?q?Write=20a=20chess=20game=20using=20bit-fields=20and=20masks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210823 Write a chess game using bit-fields and masks.md --- ...a chess game using bit-fields and masks.md | 166 ++++++++++++++++++ 1 file changed, 166 insertions(+) create mode 100644 sources/tech/20210823 Write a chess game using bit-fields and masks.md diff --git a/sources/tech/20210823 Write a chess game using bit-fields and masks.md b/sources/tech/20210823 Write a chess game using bit-fields and masks.md new file mode 100644 index 0000000000..0b0ee7c631 --- /dev/null +++ b/sources/tech/20210823 Write a chess game using bit-fields and masks.md @@ -0,0 +1,166 @@ +[#]: subject: "Write a chess game using bit-fields and masks" +[#]: via: "https://opensource.com/article/21/8/binary-bit-fields-masks" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Write a chess game using bit-fields and masks +====== +Using bit-fields and masks is a common method to combine data without +using structures. +![Chess pieces on a chess board][1] + +Let's say you were writing a chess game in C. One way to track the pieces on the board is by defining a structure that defines each possible piece on the board, and its color, so every square contains an element from that structure. For example, you might have a structure that looks like this: + + +``` +struct chess_pc { +   int piece; +   int is_black; +} +``` + +With this programming structure, your program will know what piece is in every square and its color. You can quickly identify if the piece is a pawn, rook, knight, bishop, queen, or king—and if the piece is black or white. But there's a more straightforward way to track the same information while using less data and memory. Rather than storing a structure of two `int` values for every square on a chessboard, we can store a single `int` value and use binary _bit-fields_ and _masks_ to identify the pieces and color in each square. + +### Bits and binary + +When using bit-fields to represent data, it helps to think like a computer. Let's start by listing the possible chess pieces and assigning a number to each. I'll help us along to the next step by representing the number in its binary form, the way the computer would track it. Remember that binary numbers are made up of _bits_, which are either zero or one. + + * `00000000:` empty (0) + * `00000001:` pawn (1) + * `00000010:` rook (2) + * `00000011:` knight (3) + * `00000100:` bishop (4) + * `00000101:` queen (5) + * `00000110:` king (6) + + + +To list all pieces on a chessboard, we only need the three bits that represent (from right to left) the values 1, 2, and 4. For example, the number 6 is binary `110`. All of the other bits in the binary representation of 6 are zeroes. + +And with a bit of cleverness, we can use one of those extra always-zero bits to track if a piece is black or white. We can use the number 8 (binary `00001000`) to indicate if a piece is black. If this bit is 1, it's black; if it's 0, it's white. That's called a _bit-field_, which we can pull out later using a binary _mask_. + +### Storing data with bit-fields + +To write a chess program using bit-fields and masks, we might start with these definitions: + + +``` +/* game pieces */ + +#define EMPTY 0 +#define PAWN 1 +#define ROOK 2 +#define KNIGHT 3 +#define BISHOP 4 +#define QUEEN 5 +#define KING 6 + +/* piece color (bit-field) */ + +#define BLACK 8 +#define WHITE 0 + +/* piece only (mask) */ + +#define PIECE 7 +``` + +When you assign a value to a square, such as when initializing the chessboard, you can assign a single `int` value to track both the piece and its color. For example, to store a black rook in position 0,0 of an array, you would use this code: + + +``` +  int board[8][8]; + +.. + +  board[0][0] = BLACK | ROOK; +``` + +The `|` is a binary OR, which means the computer will combine the bits from two numbers. For every bit position, if that bit from _either_ number is 1, the result for that bit position is also 1. Binary OR of the value `BLACK` (8, or binary `00001000`) and the value `ROOK` (2, or binary `00000010`) is binary `00001010`, or 10: + + +``` +    00001000 = 8 + OR 00000010 = 2 +    ________ +    00001010 = 10 +``` + +Similarly, to store a white pawn in position 6,0 of the array, you could use this: + + +``` +`  board[6][0] = WHITE | PAWN;` +``` + +This stores the value 1 because the binary OR of `WHITE` (0) and `PAWN` (1) is just 1: + + +``` +    00000000 = 0 + OR 00000001 = 1 +    ________ +    00000001 = 1 +``` + +### Getting data out with masks + +During the chess game, the program will need to know what piece is in a square and its color. We can separate the piece using a binary mask. + +For example, the program might need to know the contents of a specific square on the board during the chess game, such as the array element at `board[5][3]`. What piece is there, and is it black or white? To identify the chess piece, combine the element's value with the `PIECE` mask using the binary AND: + + +``` +  int board[8][8]; +  int piece; + +.. + +  piece = board[5][3] & PIECE; +``` + +The binary AND operator (`&`) combines two binary values so that for any bit position, if that bit in _both_ numbers is 1, then the result is also 1. For example, if the value of `board[5][3]` is 11 (binary `00001011`), then the binary AND of 11 and the mask PIECE (7, or binary `00000111`) is binary `00000011`, or 3. This is a knight, which also has the value 3. + + +``` +    00001011 = 11 +AND 00000111 = 7 +    ________ +    00000011 = 3 +``` + +Separating the piece's color is a simple matter of using binary AND with the value and the `BLACK` bit-field. For example, you might write this as a function called `is_black` to determine if a piece is either black or white: + + +``` +int +is_black(int piece) +{ +  return (piece & BLACK); +} +``` + +This works because the value `BLACK` is 8, or binary `00001000`. And in the C programming language, any non-zero value is treated as True, and zero is always False. So `is_black(board[5][3])` will return a True value (8) if the piece in array element `5,3` is black and will return a False value (0) if it is white. + +### Bit fields + +Using bit-fields and masks is a common method to combine data without using structures. They are worth adding to your programmer's "tool kit." While data structures are a valuable tool for ordered programming where you need to track related data, using separate elements to track single On or Off values (such as the colors of chess pieces) is less efficient. In these cases, consider using bit-fields and masks to combine your data more efficiently. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/binary-bit-fields-masks + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-chess-games.png?itok=U1lWMZ0y (Chess pieces on a chess board) From a8705b6b530f92a919fae6642a5dc924a49fe23e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 24 Aug 2021 05:04:54 +0800 Subject: [PATCH 168/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210823=20?= =?UTF-8?q?KDE=20Plasma=205.23=20=E2=80=93=20New=20Features=20and=20Releas?= =?UTF-8?q?e=20Dates?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210823 KDE Plasma 5.23 - New Features and Release Dates.md --- ...a 5.23 - New Features and Release Dates.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/tech/20210823 KDE Plasma 5.23 - New Features and Release Dates.md diff --git a/sources/tech/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/sources/tech/20210823 KDE Plasma 5.23 - New Features and Release Dates.md new file mode 100644 index 0000000000..0ef83b3f24 --- /dev/null +++ b/sources/tech/20210823 KDE Plasma 5.23 - New Features and Release Dates.md @@ -0,0 +1,118 @@ +[#]: subject: "KDE Plasma 5.23 – New Features and Release Dates" +[#]: via: "https://www.debugpoint.com/2021/08/kde-plasma-5-23/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +KDE Plasma 5.23 – New Features and Release Dates +====== +We round up the features of KDE Plasma 5.23 (upcoming) in this post, +with major highlights and download/testing instructions. +KDE Plasma desktop is the most popular and top class Linux desktop environment today. The main reason is adaptation, rapid iteration of its development, performance improvements. Since the release of [KDE Plasma 5.22][1], the team is busy with merging changes and testing new features for upcoming KDE Plasma 5.23. It is currently under development with a tentative schedule as below. + +### KDE Plasma 5.23 Schedule + +KDE Plasma releases on Oct 7, 2021. Here’s the overall schedule: + + * Beta – Sep 16, 2021 + * Final Release – Oct 7, 2021 + + + +Like every Plasma release, this iteration also promises a wide range of changes to core Plasma Shell, KDE Applications, code cleanups, performance improvements, hundreds of bug fixes, Wayland improvements and more. We collected some important features in this post to give you an idea on what’s incoming. Let’s take a look. + +### KDE Plasma 5.23 – New Features + + * This release is powered by Qt version 5.15, KDE Frameworks version 5.86. + + + +##### Plasma Shell and App Updates + + * The KDE Plasma Kickoff brings a huge set of updates that includes bug fixes, low RAM usage, look and feel updates, keyboard and mouse navigation improvements. + * Kickoff menu can be set to keep open using a pin option. + * Kickoff tabs not changes (from Applications to Places) when you scroll. + * Press CTRL+F to directly focus to the search bar in Kickoff. + * The action button captions in Kickoff (shut down, etc.) can be turned off via an option to show only icons. + * You can now either choose list or grid view for all Kickoff items (not only Favorites). + + + +![New Kickoff Options in KDE Plasma 5.23][2] + +![Changes in kickoff][3] + + * A new QML-based Overview effect is introduced (much like GNOME 3.38 workspace view) which shows the opened windows (have a look at this video). I could not find the merge request no for this for further detail, and it’s still not in unstable. + + + +_Video credit: KDE team_ + + * This overview effect may replace the existing Present Windows effect and the Desktop Grid effect as well (planned). + + + * A more visible ‘No Touchpad found’ message is introduced when there is no touchpad. + * You can now have the Power Profile settings in Plasma UI (Battery and Brightness window). This power profile features landed since Linux Kernel 5.12 for Dell and Lenovo laptops. So, if you have the latest brands of these Laptops, you can now set your power profiles either more performance mode or power saving mode. _[Note: Fedora 35 expected to bring this feature for GNOME 41 (probably)]_ + + + +![New power profiles][4] + + * If you have multiscreen setup with say vertical and landscape screen, then the login screen now properly synced and aligned. This was much needed features. + * A new Breeze theme is expected with style updates. + * A brand-new wallpaper is expected, like prior releases (the competition is still going on). + * A new setting to resize system tray icons when your hardware is changed from Laptop mode to Tablet mode. + * You can now have the ability to choose Bluetooth status on login always enabled, always disabled, or remember the previous status. This status ca be carried over the version upgrades. + * Users can now change the displayed name of sensors on a per-face basis. + * The scrollbar handle in Breeze style is now a little thicker than previous editions. + * A new option in Dolphin file manager enables you to show hidden files first before folders. + * You can delete selected items in clipboard popup using DEL key. + * KDE now enables you to contribute to store.kde.org with your designed icons, themes directly from the Plasma desktop. + + + +##### Wayland Updates + + * When you launch applications, the cursor now shows the animated icon feedback in Wayland sessions. + * Copying text from notification now works. + * Middle click paste now works in Wayland and XWayland applications. + + + +Remember, there are hundreds of bug fixes, improvements that lands in each release. These are merely scratching the surface which I collected. So, make sure to visit GitLab or KDE Planets to learn more in detail about changes in applications and Plasma shell. + +### Unstable Edition Download + +You can experience all the above features right now via KDE Neon Unstable edition via below link. Download the .iso and test. Make sure to report bugs if you found any. This unstable edition is not for serious usage or production deployments. + +[KDE NEON UNSTABLE EDITION][5] + +### Closing Notes + +KDE Plasma 5.23 keeps improving under the hood with new features in every release. Although, this release is not going to be a massive one, but all these optimizations, improvements eventually sums up to the stability, adaptation and better user experience. And more Wayland updates (seriously, Wayland compatibility always seems “work in progress” – like for a decade now. That’s another topic for discussion). + +Cheers. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/kde-plasma-5-23/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/06/kde-plasma-5-22-release/ +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/New-Kickoff-Options-in-KDE-Plasma-5.23.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Changes-in-kickoff.jpeg +[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/New-power-profiles.jpeg +[5]: https://neon.kde.org/download From 857949274b73ca8fb84f4a7d1c96f3f82eba835e Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 24 Aug 2021 08:40:52 +0800 Subject: [PATCH 169/290] translated --- ... Build a JAR file with fastjar and gjar.md | 150 ------------------ ... Build a JAR file with fastjar and gjar.md | 149 +++++++++++++++++ 2 files changed, 149 insertions(+), 150 deletions(-) delete mode 100644 sources/tech/20210818 Build a JAR file with fastjar and gjar.md create mode 100644 translated/tech/20210818 Build a JAR file with fastjar and gjar.md diff --git a/sources/tech/20210818 Build a JAR file with fastjar and gjar.md b/sources/tech/20210818 Build a JAR file with fastjar and gjar.md deleted file mode 100644 index 98d6fe7578..0000000000 --- a/sources/tech/20210818 Build a JAR file with fastjar and gjar.md +++ /dev/null @@ -1,150 +0,0 @@ -[#]: subject: "Build a JAR file with fastjar and gjar" -[#]: via: "https://opensource.com/article/21/8/fastjar" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Build a JAR file with fastjar and gjar -====== -Utilities like fastjar, gjar, and jar help you manually or -programmatically build JAR files, while other toolchains such as Maven -and Gradle offer features for dependency management. -![Someone wearing a hardhat and carrying code ][1] - -One of the many advantages of Java, in my experience, is its ability to deliver applications in a neat and tidy package (called a JAR, or _Java archive_.) JAR files make it easy for users to download and launch an application they want to try, easy to transfer that application from one computer to another (and Java is cross-platform, so sharing liberally can be encouraged), and easy to understand for new programmers to look inside a JAR to find out what makes a Java app run. - -There are many ways to create a JAR file, including toolchain solutions such as Maven and Gradle, and one-click build features in your IDE. However, there are also stand-alone commands such as `jarfast`, `gjar`, and just plain old `jar`, which are useful for quick and simple builds, and to demonstrate what a JAR file needs to run. - -### Install - -On Linux, you may already have the `fastjar`, `gjar`, or `jar` commands as part of an OpenJDK package, or GCJ (GCC-Java.) You can test whether any of these commands are installed by typing the command with no arguments:  - - -``` -$ fastjar -Try 'fastjar --help' for more information. -$ gjar -jar: must specify one of -t, -c, -u, -x, or -i -jar: Try 'jar --help' for more information -$ jar -Usage: jar [OPTION...] [ [--release VERSION] [-C dir] files] ... -Try `jar --help' for more information. -``` - -I have all of them installed, but you only need one. All of these commands are capable of building a JAR. - -On a modern Linux system such as Fedora, typing a missing command causes your OS to prompt you to install it for you. - -Alternately, you can just [install Java][2] from [AdoptOpenJDK.net][3] for Linux, MacOS, and Windows. - -### Build a JAR  - -First, you need a Java application to build. - -To keep things simple, create a basic "hello world" application in a file called hello.java: - - -``` -class Main { -public static void main([String][4][] args) { -    [System][5].out.println("Hello Java World"); -}} -``` - -It's a simple application that somewhat trivializes the real-world importance of managing external dependencies. Still, it's enough to get started with the basic concepts you need to create a JAR. - -Next, create a manifest file. A manifest file describes the Java environment of the JAR. In this case, the most important information is identifying the main class, so the Java runtime executing the JAR knows where to find the application's entry point.  - - -``` -$ mdir META-INF -$ echo "Main-Class: Main" > META-INF/MANIFEST.MF  -``` - -### Compiling Java bytecode - -Next, compile your Java file into Java bytecode. - - -``` -`$ javac hello.java` -``` - -Alternately, you can use the Java component of GCC to compile: - - -``` -`$ gcj -C hello.java` -``` - -Either way, this produces the file `Main.class`: - - -``` -$ file Main.class -Main.class: compiled Java class data, version XX.Y -``` - -### Creating a JAR  - -You have all the components you need so that you can create the JAR file. - -I often include the Java source code as a reference for curious users, but all that's _required_ is the `META-INF` directory and the class files. - -The `fastjar` command uses syntax similar to the [`tar` command][6]. - - -``` -`$ fastjar cvf hello.jar META-INF Main.class` -``` - -Alternately, you can use `gjar` in much the same way, except that `gjar` requires you to specify your manifest file explicitly: - - -``` -`$ gjar cvf world.jar Main.class -m META-INF/MANIFEST.MF` -``` - -Or you can use the `jar` command. Notice this one doesn't require a Manifest file because it auto-generates one for you, but for safety I define the main class explicitly: - - -``` -`$ jar --create --file hello.jar --main-class=Main Main.class` -``` - -Test your application: - - -``` -$ java -jar hello.jar -Hello Java World -``` - -### Easy packaging - -Utilities like `fastjar`, `gjar`, and `jar` help you manually or programmatically build JAR files, while other toolchains such as Maven and Gradle offer features for dependency management. A good IDE may integrate one or more of these features. - -Whatever solution you use, Java provides an easy and unified target for distributing your application code. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/fastjar - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code ) -[2]: https://opensource.com/article/19/11/install-java-linux -[3]: https://adoptopenjdk.net/ -[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string -[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system -[6]: https://opensource.com/article/17/7/how-unzip-targz-file diff --git a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md b/translated/tech/20210818 Build a JAR file with fastjar and gjar.md new file mode 100644 index 0000000000..42f4d45377 --- /dev/null +++ b/translated/tech/20210818 Build a JAR file with fastjar and gjar.md @@ -0,0 +1,149 @@ +[#]: subject: "Build a JAR file with fastjar and gjar" +[#]: via: "https://opensource.com/article/21/8/fastjar" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 fastjar 和 gjar 构建一个 JAR 文件 +====== +fastjar、gjar 和 jar 等工具可以帮助你手动或以编程方式构建 JAR 文件,而其他工具链,如 Maven +和 Gradle 提供了依赖性管理的功能。 +![Someone wearing a hardhat and carrying code ][1] + +JAR 文件使用户很容易下载和启动他们想尝试的应用,很容易将该应用从一台计算机转移到另一台计算机(而且 Java 是跨平台的,所以可以鼓励自由分享),而且对于新的程序员来说,很容易理解 JAR 文件的内容,以找出使 Java 应用运行的原因。 + +创建 JAR 文件的方法有很多,包括 Maven 和 Gradle 等工具链解决方案,以及 IDE 中的一键构建功能。然而,也有一些独立的命令,如 `jarfast`、`gjar` 和普通的 `jar`,它们对于快速和简单的构建是很有用的,并且可以演示 JAR 文件运行所需要的东西。 + +### 安装 + +在 Linux 上,你可能已经有了 `fastjar`、`gjar` 或 `jar` 命令,作为 OpenJDK 包或 GCJ(GCC-Java)的一部分。你可以通过输入不带参数的命令来测试这些命令是否已经安装: + + +``` +$ fastjar +Try 'fastjar --help' for more information. +$ gjar +jar: must specify one of -t, -c, -u, -x, or -i +jar: Try 'jar --help' for more information +$ jar +Usage: jar [OPTION...] [ [--release VERSION] [-C dir] files] ... +Try `jar --help' for more information. +``` + +我安装了所有这些命令,但你只需要一个。所有这些命令都能够构建一个 JAR。 + +在 Fedora 等现代 Linux 系统上,输入一个缺失的命令会使你的操作系统提示安装。 + +另外,你可以直接从 [AdoptOpenJDK.net][3] 为 Linux、MacOS 和 Windows [安装 Java][2]。 + +### 构建 JAR + +首先,你需要构建一个 Java 应用。 + +为了简单起见,在一个名为 hello.java 的文件中创建一个基本的 “hello world” 应用: + + +``` +class Main { +public static void main([String][4][] args) { +[System][5].out.println("Hello Java World"); +}} +``` + +这是一个简单的应用,在某种程度上淡化了管理外部依赖关系在现实世界中的重要性。不过,这也足以让你开始了解创建 JAR 所需的基本概念了。 + +接下来,创建一个清单文件。清单文件描述了 JAR 的 Java 环境。在这种情况下,最重要的信息是识别主类,这样执行 JAR 的 Java 运行时就知道在哪里可以找到应用的入口点。 + + +``` +$ mdir META-INF +$ echo "Main-Class: Main" > META-INF/MANIFEST.MF +``` + +### 编译 Java 字节码 + +接下来,把你的 Java 文件编译成 Java 字节码。 + + +``` +`$ javac hello.java` +``` + +另外,你也可以使用 GCC 的 Java 组件来编译: + + +``` +`$ gcj -C hello.java` +``` + +无论哪种方式,都会产生文件 `Main.class`: + + +``` +$ file Main.class +Main.class: compiled Java class data, version XX.Y +``` + +### 创建 JAR + +你有了所有需要的组件,这样你就可以创建 JAR 文件了。 + +我经常包含 Java 源码给好奇的用户参考,但_所有_需要的只是 `META-INF` 目录和类文件。 + +`fastjar` 命令使用类似于 [`tar` 命令][6]的语法。 + + +``` +`$ fastjar cvf hello.jar META-INF Main.class` +``` + +另外,你也可以用 `gjar`,方法大致相同,只是 `gjar` 需要你明确指定清单文件: + + +``` +`$ gjar cvf world.jar Main.class -m META-INF/MANIFEST.MF` +``` + +或者你可以使用 `jar` 命令。注意这个命令不需要 Manifest 文件,因为它会自动为你生成一个,但为了安全起见,我明确定义了主类: + + +``` +`$ jar --create --file hello.jar --main-class=Main Main.class` +``` + +测试你的应用: + + +``` +$ java -jar hello.jar +Hello Java World +``` + +### 轻松打包 + +像 `fastjar`、`gjar` 和 `jar` 这样的工具可以帮助你手动或以编程方式构建 JAR 文件,而其他工具链如 Maven 和 Gradle 则提供了依赖性管理的功能。一个好的 IDE 可能会集成这些功能中的一个或多个。 + +无论你使用什么解决方案,Java 都为分发你的应用代码提供了一个简单而统一的目标。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/fastjar + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/build_structure_tech_program_code_construction.png?itok=nVsiLuag (Someone wearing a hardhat and carrying code ) +[2]: https://opensource.com/article/19/11/install-java-linux +[3]: https://adoptopenjdk.net/ +[4]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+string +[5]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+system +[6]: https://opensource.com/article/17/7/how-unzip-targz-file From 0a48d6319bf9da53c31306c80b96e13223084214 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 24 Aug 2021 08:43:33 +0800 Subject: [PATCH 170/290] translating --- ...nitor Log Files in Real Time in Linux -Desktop and Server.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md index 175e98d6b3..c8f24da669 100644 --- a/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md +++ b/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md @@ -2,7 +2,7 @@ [#]: via: "https://www.debugpoint.com/2021/08/monitor-log-files-real-time/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d6341be6f21540b2427772cf296262f9088e1457 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 24 Aug 2021 08:52:07 +0800 Subject: [PATCH 171/290] Rename sources/tech/20210823 KDE Plasma 5.23 - New Features and Release Dates.md to sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md --- .../20210823 KDE Plasma 5.23 - New Features and Release Dates.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => news}/20210823 KDE Plasma 5.23 - New Features and Release Dates.md (100%) diff --git a/sources/tech/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md similarity index 100% rename from sources/tech/20210823 KDE Plasma 5.23 - New Features and Release Dates.md rename to sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md From 9b763983abf12890489c372ea8f693178c535f0a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 24 Aug 2021 09:30:24 +0800 Subject: [PATCH 172/290] PRF @geekpi --- ... system in your terminal with procps-ng.md | 124 ++++++++---------- 1 file changed, 58 insertions(+), 66 deletions(-) diff --git a/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md b/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md index d7433501be..1610117ec6 100644 --- a/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md +++ b/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md @@ -3,35 +3,35 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -用 procps-ng 在终端监控你的 Linux 系统 +在终端监控你的 Linux 系统 ====== -如何找到一个程序的进程 ID(PID)。最常见的 Linux 工具是由 procps-ng 包提供的,包括 ps、pstree、pidof 和 pgrep 命令。 -![System monitor][1] -在[POSIX][2]术语中,进程是一个正在进行的事件,由操作系统的内核管理。当你启动一个应用时就会产生一个进程,尽管还有许多其他的进程在你的计算机后台运行,包括保持系统时间准确的程序,监测新的文件系统,索引文件,等等。 +> 如何找到一个程序的进程 ID(PID)。最常见的 Linux 工具是由 procps-ng 包提供的,包括 `ps`、`pstree`、`pidof` 和 `pgrep` 命令。 -大多数操作系统都有某种类型的系统活动监视器,因此你可以了解在任何特定时刻有哪些进程在运行。Linux 有一些供你选择,包括 GNOME 系统监视器和 KSysGuard。这两个软件在桌面上都很有用,但 Linux 也提供了在终端监控系统的能力。不管你选择哪一种,对于那些积极管理自己电脑的人来说,检查一个特定的进程是一项常见的任务。 +![](https://img.linux.net.cn/data/attachment/album/202108/24/092948gyyv6nvbn77x7y6o.jpg) + +在 [POSIX][2] 术语中,进程process是一个正在进行的事件,由操作系统的内核管理。当你启动一个应用时就会产生一个进程,尽管还有许多其他的进程在你的计算机后台运行,包括保持系统时间准确的程序、监测新的文件系统、索引文件,等等。 + +大多数操作系统都有某种类型的系统活动监视器,因此你可以了解在任何特定时刻有哪些进程在运行。Linux 有一些供你选择,包括 GNOME 系统监视器和 KSysGuard。这两个软件在桌面环境都很有用,但 Linux 也提供了在终端监控系统的能力。不管你选择哪一种,对于那些积极管理自己电脑的人来说,检查一个特定的进程是一项常见的任务。 在这篇文章中,我演示了如何找到一个程序的进程 ID(PID)。最常见的工具是由 [procps-ng][3] 包提供的,包括 `ps`、`pstree`、`pidof` 和 `pgrep` 命令。 ### 查找一个正在运行的程序的 PID -有时你想得到一个你知道正在运行的特定程序的进程 ID(PID)。`pidof` 和 `pgrep` 命令通过命令名称查找进程。 - -`pidof` 命令返回一个命令的 PID,按名称搜索确切的命令: +有时你想得到一个你知道正在运行的特定程序的进程 ID(PID)。`pidof` 和 `pgrep` 命令可以通过命令名称查找进程。 +`pidof` 命令返回一个命令的 PID,它按名称搜索确切的命令: ``` $ pidof bash 1776 5736 ``` -`pgrep` 命令允许使用正则表达式(regex): - +`pgrep` 命令允许使用正则表达式: ``` $ pgrep .sh @@ -49,7 +49,6 @@ $ pgrep bash 你可以用 `fuser` 命令找到使用特定文件的进程的 PID。 - ``` $ fuser --user ~/example.txt /home/tux/example.txt: 3234(tux) @@ -57,8 +56,7 @@ $ fuser --user ~/example.txt ### 通过 PID 获得进程名称 -如果你有一个进程的 PID _编号_,但没有生成它的命令,你可以用 `ps` 做一个“反向查找”: - +如果你有一个进程的 PID 编号,但没有生成它的命令,你可以用 `ps` 做一个“反向查找”: ``` $ ps 3234 @@ -70,21 +68,19 @@ PID TTY STAT TIME COMMAND `ps` 命令列出进程。你可以用 `-e` 选项列出你系统上的每一个进程: - ``` -$ ps -e | less -PID TTY TIME CMD - 1 ? 00:00:03 systemd - 2 ? 00:00:00 kthreadd - 3 ? 00:00:00 rcu_gp - 4 ? 00:00:00 rcu_par_gp - 6 ? 00:00:00 kworker/0:0H-events_highpri +PID TTY TIME CMD + 1 ? 00:00:03 systemd + 2 ? 00:00:00 kthreadd + 3 ? 00:00:00 rcu_gp + 4 ? 00:00:00 rcu_par_gp + 6 ? 00:00:00 kworker/0:0H-events_highpri [...] -5648 ? 00:00:00 gnome-control-c -5656 ? 00:00:00 gnome-terminal- -5736 pts/1 00:00:00 bash -5791 pts/1 00:00:00 ps -5792 pts/1 00:00:00 less +5648 ? 00:00:00 gnome-control-c +5656 ? 00:00:00 gnome-terminal- +5736 pts/1 00:00:00 bash +5791 pts/1 00:00:00 ps +5792 pts/1 00:00:00 less (END) ``` @@ -92,28 +88,26 @@ PID TTY TIME CMD `ps -e` 的输出可能会让人不知所措,所以使用 `-U` 来查看一个用户的进程: - ``` $ ps -U tux | less -PID TTY TIME CMD -3545 ? 00:00:00 systemd -3548 ? 00:00:00 (sd-pam) -3566 ? 00:00:18 pulseaudio -3570 ? 00:00:00 gnome-keyring-d -3583 ? 00:00:00 dbus-daemon -3589 tty2 00:00:00 gdm-wayland-ses -3592 tty2 00:00:00 gnome-session-b -3613 ? 00:00:00 gvfsd -3618 ? 00:00:00 gvfsd-fuse -3665 tty2 00:01:03 gnome-shell + PID TTY TIME CMD +3545 ? 00:00:00 systemd +3548 ? 00:00:00 (sd-pam) +3566 ? 00:00:18 pulseaudio +3570 ? 00:00:00 gnome-keyring-d +3583 ? 00:00:00 dbus-daemon +3589 tty2 00:00:00 gdm-wayland-ses +3592 tty2 00:00:00 gnome-session-b +3613 ? 00:00:00 gvfsd +3618 ? 00:00:00 gvfsd-fuse +3665 tty2 00:01:03 gnome-shell [...] ``` -这样就减少了 200 个(可能是 100 个,取决于你运行的系统)需要分类的进程。 +这样就减少了 200 个(可能是 100 个,取决于你运行的系统)需要分类的进程。 你可以用 `pstree` 命令以不同的格式查看同样的输出: - ``` $ pstree -U tux -u --show-pids [...] @@ -137,46 +131,44 @@ $ pstree -U tux -u --show-pids 你可以用 `-u` 选项查看你拥有的所有进程的额外上下文。 - ``` $ ps -U tux -u -USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND -tux 3545 0.0 0.0 89656 9708 ? Ss 13:59 0:00 /usr/lib/systemd/systemd --user -tux 3548 0.0 0.0 171416 5288 ? S 13:59 0:00 (sd-pam) -tux 3566 0.9 0.1 1722212 17352 ? S<sl 13:59 0:29 /usr/bin/pulseaudio [...] -tux 3570 0.0 0.0 664736 8036 ? SLl 13:59 0:00 /usr/bin/gnome-keyring-daemon [...] +USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND +tux 3545 0.0 0.0 89656 9708 ? Ss 13:59 0:00 /usr/lib/systemd/systemd --user +tux 3548 0.0 0.0 171416 5288 ? S 13:59 0:00 (sd-pam) +tux 3566 0.9 0.1 1722212 17352 ? S Date: Tue, 24 Aug 2021 09:31:54 +0800 Subject: [PATCH 173/290] PUB @geekpi https://linux.cn/article-13713-1.html --- ...nitor your Linux system in your terminal with procps-ng.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210811 Monitor your Linux system in your terminal with procps-ng.md (98%) diff --git a/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md b/published/20210811 Monitor your Linux system in your terminal with procps-ng.md similarity index 98% rename from translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md rename to published/20210811 Monitor your Linux system in your terminal with procps-ng.md index 1610117ec6..ebfa999849 100644 --- a/translated/tech/20210811 Monitor your Linux system in your terminal with procps-ng.md +++ b/published/20210811 Monitor your Linux system in your terminal with procps-ng.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13713-1.html" 在终端监控你的 Linux 系统 ====== From b26821b01237261a051fee95a817bc4926ce0dcf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 24 Aug 2021 10:13:00 +0800 Subject: [PATCH 174/290] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @perfiffer 辛苦了,完成了这个非常有意义的系列。 --- ...6 Access OpenVPN from a client computer.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210806 Access OpenVPN from a client computer.md b/translated/tech/20210806 Access OpenVPN from a client computer.md index bd0ea94ca8..759fd9f6c8 100644 --- a/translated/tech/20210806 Access OpenVPN from a client computer.md +++ b/translated/tech/20210806 Access OpenVPN from a client computer.md @@ -3,30 +3,31 @@ [#]: author: "D. Greg Scott https://opensource.com/users/greg-scott" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -从客户端计算机连接到 0penVPN +如何在免费 WiFi 中保护隐私(四) ====== -在 Linux 上安装好 VPN 之后,是时候使用它了。 -![Woman programming][1] +> 在 Linux 上安装好“虚拟专用网络” 之后,是时候使用它了。 -0penVPN 在两点之间创建一个加密通道,阻止第三方访问你的网络流量数据。通过设置你的 “虚拟专用网络” 服务,你可以成为你自己的 “虚拟专用网络” 服务商。许多流行的 “虚拟专用网络” 服务都使用 0penVPN,所以当你可以掌控自己的网络时,为什么还要将你的网络连接绑定到特定的提供商呢? +![](https://img.linux.net.cn/data/attachment/album/202108/24/101214ng2afee2gmefgj5z.jpg) -本系列的 [第一篇文章][3] 安装了一个 VPN 的服务器,[第二篇文章][4] 介绍了如何安装和配置一个 0penVPN 服务软件,[第三篇文章][5] 解释了如何配置防火墙并启动你的 0penVPN 服务。第四篇也是最后一篇文章将演示如何从客户端计算机使用你的 0penVPN 服务器。这就是你做了前三篇文章中所有工作的原因! +0penVPN 在两点之间创建了一个加密通道,以阻止第三方访问你的网络流量数据。通过设置你的 “虚拟专用网络” 服务,你可以成为你自己的 “虚拟专用网络” 服务商。许多流行的 “虚拟专用网络” 服务都使用 0penVPN,所以当你可以掌控自己的网络时,为什么还要将你的网络连接绑定到特定的提供商呢? + +本系列的 [第一篇文章][3] 安装了一个“虚拟专用网络” 的服务器,[第二篇文章][4] 介绍了如何安装和配置一个 0penVPN 服务软件,[第三篇文章][5] 解释了如何配置防火墙并启动你的 0penVPN 服务。第四篇也是最后一篇文章将演示如何从客户端计算机使用你的 0penVPN 服务器。这就是你做了前三篇文章中所有工作的原因! ### 创建客户端证书 -请记住,0penVPN 的身份验证方法要求服务器和客户端都拥有某些东西(证书)并知道某些东西(密码)。是时候设置它了。 +请记住,0penVPN 的身份验证方法要求服务器和客户端都拥有某些东西(证书)并知道某些东西(口令)。是时候设置它了。 首先,为你的客户端计算机创建一个客户端证书和一个私钥。在你的 0penVPN 服务器上,生成证书请求。它会要求你输入密码;确保你记住它: ``` $ cd /etc/openvpn/ca $ sudo /etc/openvpn/easy-rsa/easyrsa \ -gen-req greglaptop + gen-req greglaptop ``` 本例中,`greglaptop` 是创建证书的客户端计算机主机名。 @@ -36,14 +37,14 @@ gen-req greglaptop ``` $ cd /etc/openvpn/ca $ /etc/openvpn/easy-rsa/easyrsa \ -show-req greglaptop + show-req greglaptop ``` 你也可以以客户端身份签署请求: ``` $ /etc/openvpn/easy-rsa/easyrsa \ -sign-req client greglaptop + sign-req client greglaptop ``` ### 安装 0penVPN 客户端软件 @@ -72,9 +73,9 @@ $ sudo dnf install NetworkManager-openvpn ### 复制和自定义客户端配置文件 -在 Linux 系统上,你可以复制服务器上的 `/etc/openvpn/client/OVPNclient2020.ovpn` 文件到 `/etc/NetworkManager/system-connections/` 目录,或者你也可以导航到系统设置中的网络管理器添加一个 VPN 连接。 +在 Linux 系统上,你可以复制服务器上的 `/etc/openvpn/client/OVPNclient2020.ovpn` 文件到 `/etc/NetworkManager/system-connections/` 目录,或者你也可以导航到系统设置中的网络管理器添加一个“虚拟专用网络” 连接。 -连接类型选择 **证书**。告知网络管理器你从服务器上复制的证书和密钥。 +连接类型选择“证书(TLS)Certificates(TLS)”。告知网络管理器你从服务器上复制的证书和密钥。 ![VPN displayed in Network Manager][7] @@ -88,20 +89,19 @@ $ sudo dnf install NetworkManager-openvpn ### 将你的客户端连接到服务器 -在 Linux 系统上,网络管理器会显示你的 VPN 连接。选择它进行连接。 +在 Linux 系统上,网络管理器会显示你的 “虚拟专用网络” 连接。选择它进行连接。 -![Add a VPN connection in Network Manager][9] +![Add a connection in Network Manager][9] -在 Windows 系统上,启动 0penVPN 图形用户界面 (GUI)。它会在任务栏右侧的 Windows 系统托盘中生成一个图标,通常位于 Windows 桌面的右下角。右键单击图标以连接、断开连接或查看状态。 +在 Windows 系统上,启动 0penVPN 图形用户界面。它会在任务栏右侧的 Windows 系统托盘中生成一个图标,通常位于 Windows 桌面的右下角。右键单击图标以连接、断开连接或查看状态。 -对于第一次连接,编辑客户端配置文件的“remote”行以使用 0penVPN 服务器的内部 IP 地址。通过右键单击 Windows 系统托盘中的 0penVPN GUI 并单击 **连接**,从办公室网络内部连接到服务器。调试此连接。这应该可以找到并解决问题,而不会出现任何防火墙问题,因为客户端和服务器都在防火墙的同一侧。 +对于第一次连接,编辑客户端配置文件的 `remote` 行以使用 0penVPN 服务器的内部 IP 地址。通过右键单击 Windows 系统托盘中的 0penVPN 图标并单击“连接Connect”,从办公室网络内部连接到服务器。调试此连接,这应该可以找到并解决问题,而不会出现任何防火墙问题,因为客户端和服务器都在防火墙的同一侧。 -接下来,编辑客户端配置文件的“remote”行以使用 0penVPN 服务器的公共 IP 地址。将 Windows 客户端连接到外部网络并进行连接。调试有可能的问题。 +接下来,编辑客户端配置文件的 `remote` 行以使用 0penVPN 服务器的公共 IP 地址。将 Windows 客户端连接到外部网络并进行连接。调试有可能的问题。 ### 安全连接 -恭喜!你已经为其他客户端系统准备好了 0penVPN 网络。对其余客户端重复设置步骤。你甚至可以使用 Ansible 来分发证书和密钥并使其保持最新。 -* * * +恭喜!你已经为其他客户端系统准备好了 0penVPN 网络。对其余客户端重复设置步骤。你甚至可以使用 Ansible 来分发证书和密钥并使其保持最新。 本文基于 D.Greg Scott 的 [博客][10],经许可后重新使用。 @@ -112,7 +112,7 @@ via: https://opensource.com/article/21/7/openvpn-client 作者:[D. Greg Scott][a] 选题:[lujun9972][b] 译者:[perfiffer](https://github.com/perfiffer) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -126,5 +126,5 @@ via: https://opensource.com/article/21/7/openvpn-client [6]: https://winscp.net/eng/index.php [7]: https://opensource.com/sites/default/files/uploads/network-manager-profile.jpg (VPN displayed in Network Manager) [8]: https://creativecommons.org/licenses/by-sa/4.0/ -[9]: https://opensource.com/sites/default/files/uploads/network-manager-connect.jpg (Add a VPN connection in Network Manager) +[9]: https://opensource.com/sites/default/files/uploads/network-manager-connect.jpg (Add a“虚拟专用网络” connection in Network Manager) [10]: https://www.dgregscott.com/how-to-build-a-vpn-in-four-easy-steps-without-spending-one-penny/ From fc6d5a88052785c5b6f134101231d9db43495309 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 24 Aug 2021 10:13:33 +0800 Subject: [PATCH 175/290] PUB @perfiffer https://linux.cn/article-13714-1.html --- .../20210806 Access OpenVPN from a client computer.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210806 Access OpenVPN from a client computer.md (98%) diff --git a/translated/tech/20210806 Access OpenVPN from a client computer.md b/published/20210806 Access OpenVPN from a client computer.md similarity index 98% rename from translated/tech/20210806 Access OpenVPN from a client computer.md rename to published/20210806 Access OpenVPN from a client computer.md index 759fd9f6c8..b09363db70 100644 --- a/translated/tech/20210806 Access OpenVPN from a client computer.md +++ b/published/20210806 Access OpenVPN from a client computer.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13714-1.html" 如何在免费 WiFi 中保护隐私(四) ====== From 66773f2e507ad626dcf7d235fdd8430de70c7c65 Mon Sep 17 00:00:00 2001 From: Mo Date: Tue, 24 Aug 2021 02:50:29 +0000 Subject: [PATCH 176/290] [translated]How to Know if Your System Uses MBR or GPT Partitioning --- ... GPT Partitioning -on Windows and Linux.md | 114 ------------------ ... GPT Partitioning -on Windows and Linux.md | 114 ++++++++++++++++++ 2 files changed, 114 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md create mode 100644 translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md diff --git a/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md b/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md deleted file mode 100644 index 8e9146c51d..0000000000 --- a/sources/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: subject: (How to Know if Your System Uses MBR or GPT Partitioning [on Windows and Linux]) -[#]: via: (https://itsfoss.com/check-mbr-or-gpt/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (alim0x) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -How to Know if Your System Uses MBR or GPT Partitioning [on Windows and Linux] -====== - -Knowing the correct partitioning scheme of your disk could be crucial when you are installing Linux or any other operating system. - -There are two popular partitioning schemes; the older MBR and the newer GPT. Most computers use GPT these days. - -While creating the live or bootable USB, some tools (like [Rufus][1]) ask you the type of disk partitioning in use. If you choose GPT with an MBR disk, the bootable USB might not work. - -In this tutorial, I’ll show various methods to check the disk partitioning scheme on Windows and Linux systems. - -### Check whether your system uses MBR or GPT on Windows systems - -While there are several ways to check the disk partitioning scheme in Windows including command line ones, I’ll stick with the GUI methods. - -Press the Windows button and search for ‘disk’ and then click on “**Create and format disk partitions**“. - -![][2] - -In here, **right-click on the disk** for which you want to check the partitioning scheme. In the right-click context menu, **select Properties**. - -![Right click on the disk and select properties][3] - -In the Properties, go to **Volumes** tab and look for **Partition style**. - -![In Volumes tab, look for Partition style][4] - -As you can see in the screenshot above, the disk is using GPT partitioning scheme. For some other systems, it could show MBR or MSDOS partitioning scheme. - -Now you know how to check disk partitioning scheme in Windows. In the next section, you’ll learn to do the same in Linux. - -### Check whether your system uses MBR or GPT on Linux - -There are several ways to check whether a disk uses MBR or GPT partitioning scheme in Linux as well. This includes commands and GUI tools. - -Let me first show the command line method and then I’ll show a couple of GUI methods. - -#### Check disk partitioning scheme in Linux command line - -The command line method should work on all Linux distributions. - -Open a terminal and use the following command with sudo: - -``` -sudo parted -l -``` - -The above command is actually a CLI-based [partitioning manager in Linux][5]. With the option -l, it lists the disks on your system along with the details about those disks. It includes partitioning scheme information. - -In the output, look for the line starting with **Partition Table**: - -![][6] - -In the above screenshot, the disk has GPT partitioning scheme. For **MBR**, it would show **msdos**. - -You learned the command line way. But if you are not comfortable with the terminal, you can use graphical tools as well. - -#### Checking disk information with GNOME Disks tool - -Ubuntu and many other GNOME-based distributions have a built-in graphical tool called Disks that lets you handle the disks in your system. - -You can use the same tool for getting the partition type of the disk as well. - -![][7] - -#### Checking disk information with Gparted graphical tool - -If you don’t have the option to use GNOME Disks tool, no worries. There are other tools available. - -One such popular tool is Gparted. You should find it in the repositories of most Linux distributions. If not installed already, [install Gparted][8] using your distribution’s software center or [package manager][9]. - -In Gparted, select the disk and from the menu select **View->Device** Information. It will start showing the disk information in the bottom-left area and this information includes the partitioning scheme. - -![][10] - -See, not too complicated, was it? Now you know multiple ways of figuring our whether the disks in your system use GPT or MBR partitioning scheme. - -On the same note, I would also like to mention that sometimes disks also have a [hybrid partitioning scheme][11]. This is not common and most of the time it is either MBR or GPT. - -Questions? Suggestions? Please leave a comment below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/check-mbr-or-gpt/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://rufus.ie/en_US/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/disc-management-windows.png?resize=800%2C561&ssl=1 -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/gpt-check-windows-1.png?resize=800%2C603&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/gpt-check-windows-2-1.png?resize=800%2C600&ssl=1 -[5]: https://itsfoss.com/partition-managers-linux/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-if-mbr-or-gpt-in-Linux.png?resize=800%2C446&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-if-mbr-or-gpt-in-Linux-gui.png?resize=800%2C548&ssl=1 -[8]: https://itsfoss.com/gparted/ -[9]: https://itsfoss.com/package-manager/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-disk-partitioning-scheme-linux-gparted.jpg?resize=800%2C555&ssl=1 -[11]: https://www.rodsbooks.com/gdisk/hybrid.html diff --git a/translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md b/translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md new file mode 100644 index 0000000000..acca290088 --- /dev/null +++ b/translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md @@ -0,0 +1,114 @@ +[#]: subject: (How to Know if Your System Uses MBR or GPT Partitioning [on Windows and Linux]) +[#]: via: (https://itsfoss.com/check-mbr-or-gpt/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (alim0x) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +如何在 Windows 和 Linux 上确定系统使用 MBR 还是 GPT 分区 +====== + +在你安装 Linux 或任何其他系统的时候,了解你的磁盘的正确分区方案是非常关键的。 + +目前有两种流行的分区方案,老一点的 MBR 和新一些的 GPT。现在大多数的电脑使用 GPT。 + +在制作 live 镜像或可启动 USB 设备时,一些工具(比如 [Rufus][1])会问你在用的磁盘分区情况。如果你在 MBR 分区的磁盘上选择 GPT 方案的话,制作出来的可启动 USB 设备可能会不起作用。 + +在这个教程里,我会展示若干方法,来在 Windows 和 Linux 系统上检查磁盘分区方案。 + +### 在 Windows 上检查系统使用的是 MBR 还是 GPT + +尽管在 Windows 上包括命令行在内有不少方法可以检查磁盘分区方案,这里我还是使用图形界面的方式查看。 + +按下 Windows 按键然后搜索“disk”,然后点击“**创建并格式化硬盘分区**”。 + +![][2] + +在这里,**右键点击**你想要检查分区方案的磁盘。在右键菜单里**选择属性**。 + +![右键点击磁盘并选择属性][3] + +在属性窗口,切换到**卷**标签页,寻找**磁盘分区形式**属性。 + +![在卷标签页寻找磁盘分区形式属性][4] + +正如你在上面截图所看到的,磁盘正在使用 GPT 分区方案。对于一些其他系统,它可能显示的是 MBR 或 MSDOS 分区方案。 + +现在你知道如何在 Windows 下检查磁盘分区方案了。在下一部分,你会学到如何在 Linux 下进行检查。 + +### 在 Linux 上检查系统使用的是 MBR 还是 GPT + +在 Linux 上也有不少方法可以检查磁盘分区方案使用的是 MBR 还是 GPT。既有命令行方法也有图形界面工具。 + +让我先给你演示一下命令行方法,然后再看看一些图形界面的方法。 + +#### 在 Linux 使用命令行检查磁盘分区方案 + +命令行的方法应该在所有 Linux 发行版上都有效。 + +打开终端并使用 sudo 运行下列命令: + +``` +sudo parted -l +``` + +上述命令实际上是一个基于命令行的 [Linux 分区管理器][5]。命令参数 -l 会列出系统中的所有磁盘以及它们的详情,里面包含了分区方案信息。 + +在命令输出中,寻找以 **Partition Table(分区表)**开头的行: + +![][6] + +在上面的截图中,磁盘使用的是 GPT 分区方案。如果是 **MBR**,它会显示为 **msdos**。 + +你已经学会了命令行的方式。但如果你不习惯使用终端,你还可以使用图形界面工具。 + +#### 使用 GNOME Disks 工具检查磁盘信息 + +Ubuntu 和一些其它基于 GNOME 的发行版内置了叫做 Disks 的图形工具,你可以用它管理系统中的磁盘。 + +你也可以使用它来获取磁盘的分区类型。 + +![][7] + +#### 使用 Gparted 图形工具检查磁盘信息 + +如果你没办法使用 GNOME Disks 工具,别担心,还有其它工具可以使用。 + +其中一款流行的工具是 Gparted。你应该可以在大多数 Linux 发行版的软件源中找到它。如果系统中没有安装的话,使用你的发行版的软件中心或[包管理器][9]来[安装 Gparted][8]。 + +在 Gparted 中,通过菜单选择 **View-Device Information(查看—设备信息)**。它会在左下区域显示磁盘信息,这些信息中包含分区方案信息。 + +![][10] + +看吧,也不是太复杂,对吗?现在你了解了好几种途径来确认你的系统使用的是 GPT 还是 MBR 分区方案。 + +同时我还要提一下,有时候磁盘还会有[混合分区方案][11]。这不是很常见,大多数时候分区不是 MBR 就是 GPT。 + +有任何问题或建议?请在下方留下评论。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/check-mbr-or-gpt/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[alim0x](https://github.com/alim0x) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://rufus.ie/en_US/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/03/disc-management-windows.png?resize=800%2C561&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/gpt-check-windows-1.png?resize=800%2C603&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/gpt-check-windows-2-1.png?resize=800%2C600&ssl=1 +[5]: https://itsfoss.com/partition-managers-linux/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-if-mbr-or-gpt-in-Linux.png?resize=800%2C446&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-if-mbr-or-gpt-in-Linux-gui.png?resize=800%2C548&ssl=1 +[8]: https://itsfoss.com/gparted/ +[9]: https://itsfoss.com/package-manager/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/check-disk-partitioning-scheme-linux-gparted.jpg?resize=800%2C555&ssl=1 +[11]: https://www.rodsbooks.com/gdisk/hybrid.html From 1fefd12eea6b040bd880d305b06ad678cf0701e3 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Tue, 24 Aug 2021 23:34:35 +0800 Subject: [PATCH 177/290] translating by perfiffer --- ...s Ubuntu- What-s the Difference- Which One Should You Use.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md index 960be3705b..fc9247ab41 100644 --- a/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md +++ b/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/debian-vs-ubuntu/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 704250de1aa1f938563bb31119a3dfafae8f1b04 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Aug 2021 05:03:16 +0800 Subject: [PATCH 178/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210825=20?= =?UTF-8?q?Icons=20Look=20too=20Small=3F=20Enable=20Fractional=20Scaling?= =?UTF-8?q?=20to=20Enjoy=20Your=20HiDPI=204K=20Screen=20in=20Ubuntu=20Linu?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210825 Icons Look too Small- Enable Fractional Scaling to Enjoy Your HiDPI 4K Screen in Ubuntu Linux.md --- ...oy Your HiDPI 4K Screen in Ubuntu Linux.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20210825 Icons Look too Small- Enable Fractional Scaling to Enjoy Your HiDPI 4K Screen in Ubuntu Linux.md diff --git a/sources/tech/20210825 Icons Look too Small- Enable Fractional Scaling to Enjoy Your HiDPI 4K Screen in Ubuntu Linux.md b/sources/tech/20210825 Icons Look too Small- Enable Fractional Scaling to Enjoy Your HiDPI 4K Screen in Ubuntu Linux.md new file mode 100644 index 0000000000..546be9b8f7 --- /dev/null +++ b/sources/tech/20210825 Icons Look too Small- Enable Fractional Scaling to Enjoy Your HiDPI 4K Screen in Ubuntu Linux.md @@ -0,0 +1,140 @@ +[#]: subject: "Icons Look too Small? Enable Fractional Scaling to Enjoy Your HiDPI 4K Screen in Ubuntu Linux" +[#]: via: "https://itsfoss.com/enable-fractional-scaling-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Icons Look too Small? Enable Fractional Scaling to Enjoy Your HiDPI 4K Screen in Ubuntu Linux +====== + +A few months ago, I bought a Dell XPS laptop with a 4K UHD screen. The screen resolution is 3840×2400 resolution with a 16:10 aspect ratio. + +When I was installing Ubuntu on it, everything looked so small. The desktop icons, applications, menus, items in the top panel, everything. + +It’s because the screen has too many pixels but the desktop icons and rest of the elements remain the same in size (as on a regular screen of 1920×1080). Hence, they look too small on the HiDPI screen. + +![Icons and other elements look too small on a HiDPI screen in Ubuntu][1] + +This is not pretty and makes it very difficult to use your Linux system. Thankfully, there is a solution for GNOME desktop users. + +If you too have a 2K or 4K screen where the desktop icons and other elements look too small, here’s what you need to do. + +### Scale-up display if the screen looks too small + +If you have a 4K screen, you can scale the display to 200%. This means that you are making every element twice its size. + +Press the Windows key and search for Settings: + +![Go to Settings][2] + +In Settings, go to Display settings. + +![Access the Display Settings and look for Scaling][3] + +Here, select 200% as the scale factor and click on Apply button. + +![Scaling the display in Ubuntu][4] + +It will change the display settings and ask you to confirm whether you want to keep the changed settings or revert to the original. If things look good to you, select “Keep Changes.” + +Your display settings will be changed and remain the same even after reboots until you change it again. + +### Enable fractional scaling (suitable for 2K screens) + +200% scaling is good for 4K screens however if you have a 2K screen, the 200% scaling will make the icons look too big for the screen. + +Now you are in the soup. You have the screen looking too small or too big. What about a mid-point? + +Thankfully, [GNOME][5] has a fractional scaling feature that allows you to set the scaling to 125%, 150%, and 175%. + +#### Using fractional scaling on Ubuntu 20.04 and newer versions + +Ubuntu 20.04 and the new versions have newer versions of GNOME desktop environment and it allows you to enable or disable fractional scaling from Display settings itself. + +Just go to the Display settings and look for the Fractional Scaling switch. Toggle it to enable or disable it. + +When you enable the fractional scaling, you’ll see new scaling factors between 100% to 200%. You can choose the one which is suitable for your screen. + +![Enable fractional scaling][6] + +#### Using fractional scaling on Ubuntu 18.04 + +You’ll have to make some additional efforts to make it work on the older Ubuntu 18.04 LTS version. + +First, [switch to Wayland from Xorg][7]. + +Second, enable fractional scaling as an experimental feature using this command: + +``` +gsettings set org.gnome.mutter experimental-features "['scale-monitor-framebuffer']" +``` + +Third, restart your system and then go to the Display settings and you should see the fractional scaling toggle button now. + +#### Disabling fractional scaling on Ubuntu 18.04 + +If you are experiencing issues with fractional scaling, like increased power consumption and mouse lagging, you may want to disable it. Wayland could also be troublesome for some applications. + +First, toggle the fractional scaling switch in the display settings. Now use the following command to disable the experimental feature. + +``` +gsettings reset org.gnome.mutter experimental-features +``` + +Switch back to Xorg from Wayland again. + +### Multi-monitor setup and fractional scaling + +4K screen is good but I prefer a multi-monitor setup for work. The problem here is that I have two Full HD (1080p) monitors. Pairing them with my 4K laptop screen requires little settings change. + +What I do here is to keep the 4K screen at 200% scaling at 3840×2400 resolution. At the same time, I keep the full-HD monitors at 100% scaling with 1920×1080 resolution. + +![HiDPI screen is set at 200%][8] + +![Full HD screens are set at 100%][9] + +![Full HD screens are set at 100%][10] + +To ensure a smooth experience, you should take care of the following: + + * Use Wayland display server: It is a lot better at handling multi-screens and HiDPI screens than the legacy Xorg. + * Even if you use only 100% and 200% scaling, enabling fractional scaling is a must, otherwise, it doesn’t work properly. I know it sounds weird but that’s what I have experienced. + + + +### Did it help? + +HiDPI support in Linux is far from perfect but it is certainly improving. Newer desktop environment versions of GNOME and KDE keep on improving on this front. + +Fractional scaling with Wayland works quite well. It is improving with Xorg as well but it struggles especially on a multi-monitor set up. + +I hope this quick tip helped you to enable fractional scaling in Ubuntu and enjoy your Linux desktop on a UHD screen. + +Please leave your questions and suggestions in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/enable-fractional-scaling-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/wp-content/uploads/2021/08/HiDPI-screen-icons-too-small-in-Ubuntu.webp +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/settings-application-ubuntu.jpg?resize=800%2C247&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/display-settings-scaling-ubuntu.png?resize=800%2C432&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/scale-display-ubuntu.png?resize=800%2C443&ssl=1 +[5]: https://www.gnome.org/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/enable-fractional-scaling.png?resize=800%2C452&ssl=1 +[7]: https://itsfoss.com/switch-xorg-wayland/ +[8]: https://itsfoss.com/wp-content/uploads/2021/08/fractional-scaling-ubuntu-multi-monitor-3.webp +[9]: https://itsfoss.com/wp-content/uploads/2021/08/fractional-scaling-ubuntu-multi-monitor-2.webp +[10]: https://itsfoss.com/wp-content/uploads/2021/08/fractional-scaling-ubuntu-multi-monitor-1.webp From 7d3cc855e99f4034bed875f319a15fb5c37a9299 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Aug 2021 05:03:38 +0800 Subject: [PATCH 179/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210824=20?= =?UTF-8?q?How=20to=20include=20options=20in=20your=20Bash=20shell=20scrip?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210824 How to include options in your Bash shell scripts.md --- ...lude options in your Bash shell scripts.md | 180 ++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 sources/tech/20210824 How to include options in your Bash shell scripts.md diff --git a/sources/tech/20210824 How to include options in your Bash shell scripts.md b/sources/tech/20210824 How to include options in your Bash shell scripts.md new file mode 100644 index 0000000000..b4a07aaf7b --- /dev/null +++ b/sources/tech/20210824 How to include options in your Bash shell scripts.md @@ -0,0 +1,180 @@ +[#]: subject: "How to include options in your Bash shell scripts" +[#]: via: "https://opensource.com/article/21/8/option-parsing-bash" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to include options in your Bash shell scripts +====== +Give your shell scripts options. +![Terminal commands][1] + +Terminal commands usually have [options or switches][2], which you can use to modify how the command does what it does. Options are included in the [POSIX specification][3] for command-line interfaces. It's also a time-honored convention established with the earliest UNIX applications, so it's good to know how to include them in your [Bash scripts][4] when you're creating your own commands. + +As with most languages, there are several ways to solve the problem of parsing options in Bash. To this day, my favorite method remains the one I learned from Patrick Volkerding's Slackware build scripts, which served as my introduction to shell scripting back when I first discovered Linux and dared to venture into the plain text files that shipped with the OS. + +### Option parsing in Bash + +The strategy for parsing options in Bash is to cycle through all arguments passed to your shell script, determine whether they are an option or not, and then shift to the next argument. Repeat this process until no options remain. + +Start with a simple Boolean option (sometimes called a _switch_ or a _flag_): + + +``` +#!/bin/bash + +while [ True ]; do +if [ "$1" = "--alpha" -o "$1" = "-a" ]; then +    ALPHA=1 +    shift 1 +else +    break +fi +done + +echo $ALPHA +``` + +In this code, I create a `while` loop which serves as an infinite loop until there are no further arguments to process. An `if` statement attempts to match whatever argument is found in the first position (`$1`) to either `--alpha` or `-a`. (These are arbitrary option names with no special significance. In an actual script, you might use `--verbose` and `-v` to trigger verbose output). + +The `shift` keyword causes all arguments to shift by 1, such that an argument in position 2 (`$2`) is moved into position 1 (`$1`). The `else` statement is triggered when there are no further arguments to process, which breaks the `while` loop. + +At the end of the script, the value of `$ALPHA` is printed to the terminal. + +Test the script: + + +``` +$ bash ./test.sh --alpha +1 +$ bash ./test.sh + +$ bash ./test.sh -a +1 +``` + +The option is correctly detected. + +### Detecting arguments in Bash + +There is a problem, though: Extra arguments are ignored. + + +``` +$ bash ./test.sh --alpha foo +1 +$ +``` + +To catch arguments that aren't intended as options, you can dump remaining arguments into a [Bash array][5]. + + +``` +#!/bin/bash + +while [ True ]; do +if [ "$1" = "--alpha" -o "$1" = "-a" ]; then +    ALPHA=1 +    shift 1 +else +    break +fi +done + +echo $ALPHA + +ARG=( "${@}" ) +for i in ${ARG[@]}; do +    echo $i +done +``` + +Test the new version of the script: + + +``` +$ bash ./test.sh --alpha foo +1 +foo +$ bash ./test.sh foo + +foo +$ bash ./test.sh --alpha foo bar +1 +foo +bar +``` + +### Options with arguments + +Some options require an argument all their own. For instance, you might want to allow the user to set an attribute such as a color or the resolution of a graphic or to point your application to a custom configuration file. + +To implement this in Bash, you can use the `shift` keyword as you do with Boolean switches but shift the arguments by 2 instead of 1. + + +``` +#!/bin/bash + +while [ True ]; do +if [ "$1" = "--alpha" -o "$1" = "-a" ]; then +    ALPHA=1 +    shift 1 +elif [ "$1" = "--config" -o "$1" = "-c" ]; then +    CONFIG=$2 +    shift 2 +else +    break +fi +done + +echo $ALPHA +echo $CONFIG + +ARG=( "${@}" ) + +for i in ${ARG[@]}; do +    echo $i +done +``` + +In this code, I add an `elif` clause to compare each argument to both `--config` and `-c`. In the event of a match, the value of a variable called `CONFIG` is set to the value of whatever the second argument is (this means that the `--config` option requires an argument). All arguments shift place by 2: 1 to shift `--config` or `-c`, and 1 to move its argument. As usual, the loop repeats until no matching arguments remain. + +Here's a test of the new version of the script: + + +``` +$ bash ./test.sh --config my.conf foo bar +my.conf +foo +bar +$ bash ./test.sh -a --config my.conf baz +1 +my.conf +baz +``` + +### Option parsing made easy + +There are other ways to parse options in Bash. You can alternately use a `case` statement or the `getopt` command. Whatever you choose to use, options for your users are important features for any application, and Bash makes it easy. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/option-parsing-bash + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/terminal-commands_1.png?itok=Va3FdaMB (Terminal commands) +[2]: https://opensource.com/article/21/8/linux-terminal#options +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: https://opensource.com/downloads/bash-scripting-ebook +[5]: https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays From ccc525dddf2f2c0cb86346cf8abf29e4e64b241d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 25 Aug 2021 05:03:55 +0800 Subject: [PATCH 180/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210824=20?= =?UTF-8?q?Solve=20the=20repository=20impedance=20mismatch=20in=20CI/CD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210824 Solve the repository impedance mismatch in CI-CD.md --- ... repository impedance mismatch in CI-CD.md | 207 ++++++++++++++++++ 1 file changed, 207 insertions(+) create mode 100644 sources/tech/20210824 Solve the repository impedance mismatch in CI-CD.md diff --git a/sources/tech/20210824 Solve the repository impedance mismatch in CI-CD.md b/sources/tech/20210824 Solve the repository impedance mismatch in CI-CD.md new file mode 100644 index 0000000000..b47bdfdc67 --- /dev/null +++ b/sources/tech/20210824 Solve the repository impedance mismatch in CI-CD.md @@ -0,0 +1,207 @@ +[#]: subject: "Solve the repository impedance mismatch in CI/CD" +[#]: via: "https://opensource.com/article/21/8/impedance-mismatch-cicd" +[#]: author: "Evan "Hippy" Slatis https://opensource.com/users/hippyod" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Solve the repository impedance mismatch in CI/CD +====== +Aligning deployment images and descriptors can be difficult, but here +are few strategies to streamline the process. +![Tips and gears turning][1] + +An _impedance mismatch_ in software architecture happens when there's a set of conceptual and technical difficulties between two components. It's actually a term borrowed from electrical engineering, where the impedance of electrical input and output must match for the circuit to work. + +In software development, an impedance mismatch exists between images stored in an image repository and its deployment descriptors stored in the SCM. How do you know whether the deployment descriptors stored in the SCM are actually meant for the image in question? The two repositories don't track the data they hold the same way, so matching an image (an immutable binary stored individually in an image repository) to its specific deployment descriptors (text files stored as a series of changes in Git) isn't straightforward. + +**NOTE**: This article assumes at least a passing familiarity with the following concepts: + + * Source Control Management (SCM) systems and branching + * Docker/OCI-compliant images and containers + * Container Orchestration Platforms (COP) such as Kubernetes + * Continuous Integration/Continuous Delivery (CI/CD) + * Software development lifecycle (SDLC) environments + + + +### Impedance mismatch: SCM and image repositories + +To fully understand where this becomes a problem, consider a set of basic Software Development LifeCycle (SDLC) environments typically used in any given project; for example, dev, test, and prod (or release) environments. + +The dev environment does not suffer from an impedance mismatch. Best practices, which today include using CI/CD, dictate that the latest commit to your development branch should reflect what's deployed in the development environment. So, given a typical, successful CI/CD development workflow: + + 1. A commit is made to the development branch in the SCM + 2. The commit triggers an image build + 3. The new, distinct image is pushed to the image repository and tagged as being in dev + 4. The image is deployed to the dev environment in a Container Orchestration Platform (COP) with the latest deployment descriptors pulled from the SCM + + + +In other words, the latest image is always matched to the latest deployment descriptors in the development environment. Rolling back to a previous build isn't an issue, either, because that implies rolling back the SCM, too. + +Eventually, though, development progresses to the point where more formal testing needs to occur, so an image—which implicitly relates to a specific commit in the SCM—is promoted to a test environment. Again, assuming a successful build, this isn't much of a problem because the image promoted from development should reflect the latest in the development branch: + + 1. The latest deployment to development is approved for promotion, and the promotion process is triggered + 2. The latest development image tagged as being in test + 3. The image is pulled and deployed to the test environment using the latest deployment descriptors pulled from the SCM + + + +So far, so good, right? But what happens in either of the following scenarios? + +**Scenario A**. The image is promoted to the next downstream environment, e.g., user acceptance testing (UAT) or even a production environment. + +**Scenario B**. A breaking bug is discovered in the test environment, and the image needs to be rolled back to a known good image. + +In either scenario, it's not as if development has stopped, which means one or more commits to the development branch may have occurred, which in turn means it's possible the latest deployment descriptors have changed, and the latest image isn't the same as what was previously deployed in test. Changes to the deployment descriptors may or may not apply to older versions of an image, but they certainly can't be trusted. If they have changed, they certainly aren't the same deployment descriptors you've been testing with up to now with the image you want to deploy. + +And that's the crux of the problem: I**f the image being deployed isn't the latest from the image repository, how do you identify which deployment descriptors in the SCM apply specifically to the image being deployed?** The short answer is, you can't. The two repositories have an impedance mismatch. The longer answer is that you can, but you have to work for it, which will be the subject of the rest of this article. Note that the following isn't necessarily the only solution to this problem, but it has been put into production and proven to work for dozens of projects that, in turn, have been built and deployed in production for more than a year now. + +### Binaries and deployment descriptors + +A common artifact produced from building source code is a Docker or OCI-compliant image, and that image will typically be deployed to a Container Orchestration Platform (COP) such as Kubernetes. Deploying to a COP requires deployment descriptors defining how the image is to be deployed and run as a container, e.g., [Kubernetes Deployments][2] or [CronJobs][3]. It is because of the fundamental difference between what an image is and its deployment descriptors where the impedance mismatch manifests itself. For this discussion, think of images as immutable binaries stored in an image repository. Any change in the source code does not change the image but rather replaces it with a distinct, new image. + +By contrast, deployment descriptors are text files and thus can be considered source code and mutable. If best practices are being followed, then the deployment descriptors are stored in SCM, and all changes are committed there first to be properly tracked. + +### Solving the impedance mismatch + +The first part of the proposed solution is to ensure that a method exists of matching the image in the image repository to the source commit in the SCM, which holds the deployment descriptors. The most straightforward solution is to tag the image with its source commit hash. This will keep different versions of the image separate, easily identifiable, and provide enough information to find the correct deployment descriptors so that the image can be properly deployed in the COP. + +Reviewing the scenarios above again: + +**Scenario A**. _Promoting an image from one downstream environment to the next_: When the image is promoted from test to UAT, the image's tag tells us from which source commit in the SCM to pull the deployment descriptors. + +**Scenario B**. _When an image needs to be rolled back in a downstream environment_: Whichever image we choose to roll back to will also tell us from which source commit in the SCM to pull the correct deployment descriptors. + +In each case, it doesn't matter how many development branch commits and builds have taken place since a particular image has been deployed in test since every image that's been promoted can find the exact deployment descriptors it was originally deployed with. + +This isn't a complete solution to the impedance mismatch, however. Consider two additional scenarios: + +**Scenario C**. In a load testing environment, different deployment descriptors are tried at various times to see how a particular build performs. + +**Scenario D**. An image is promoted to a downstream environment, and there's an error in the deployment descriptors for that environment. + +In each of these scenarios, changes need to be made to the deployment descriptors, but right now all we have is a source commit hash. Remember that best practices require all source code changes to be committed back to SCM first. The commit at that hash is immutable by itself, so a better solution than just tracking the initial source commit hash is clearly needed. + +The solution here is a new branch created at the original source commit hash. This will be dubbed a **Deployment Branch**. Every time an image is promoted to a downstream test or release environment, you should create a new Deployment Branch **from the head of the previous SDLC environment's Deployment Branch**. + +This will allow the same image to be deployed differently and repeatedly within each SDLC environment and also pick up any changes discovered or applied for that image in each subsequent environment. + +**NOTE:** How changes applied in one environment's deployment descriptors are applied to the next, whether by tools that enable sharing values such as Helm Charts or by manually cutting and pasting across directories, is beyond the scope of this article. + +So, when an image is promoted from one SDLC environment to the next: + + 1. A Deployment Branch is created + 1. If the image is being promoted from the dev environment, the branch is created from the source commit hash that built the image + 2. Otherwise, _the Deployment Branch is created from the head of the current Deployment Branch_ + 2. The image is deployed into the next SDLC environment using the deployment descriptors from the newly created Deployment Branch for that environment + + + +![deployment branching tree][4] + +Figure 1: Deployment branches + + 1. Development branch + 2. First downstream environment's Deployment Branch with a single commit + 3. Second downstream environment's Deployment Branch with a single commit + + + +Revisiting Scenarios C and D from above with Deployment Branches as a solution: + +**Scenario C**. Change the deployment descriptors for an image deployed to a downstream SDLC environment + +**Scenario D**. Fix an error in the deployment descriptors for a particular SDLC environment + +In each scenario, the workflow is as follows: + + 1. Commit the changes to the deployment descriptors to the Deployment Branch for the SLDC environment and image + 2. Redeploy the image into the SLDC environment using the deployment descriptors at the head of the Deployment Branch + + + +Thus, Deployment Branches fully resolve the impedance mismatch between image repositories storing a single, immutable image representing a unique build and SCM repositories storing mutable deployment descriptors for one more downstream SDLC environments. + +### Practical considerations + +While this seems like a workable solution, it also opens up several new practical questions for developers and operations resources alike, such as: + +A. Where should deployment descriptors be kept as source to best facilitate Deployment Branch management, i.e., in the same or a different SCM repository than the source that built the image? + +Up until now, we've avoided speaking about which repository the deployment descriptors should reside. Without going into too much detail, we recommend putting the deployment descriptors for all SDLC environments into the same SCM repository as the image source. As Deployment Branches are created, the source for the images will follow and act as an easy-to-find reference for what is actually running in the container being deployed. + +As mentioned above, images will be associated with the original source commit via their tag. Finding the reference for the source at a particular commit in a separate repository would add a level of difficulty to developers, even with tooling, which is unnecessary by keeping everything in a single repository. + +B. Should the source code that built the image be modified on a Deployment Branch? + +Short answer: **NEVER**. + +Longer answer: No, because images should never be built from Deployment Branches. They're built from development branches. Changing the source that defines an image in a Deployment Branch will destroy the record of what built the image being deployed and doesn't actually modify the functionality of the image. This could also become an issue when comparing two Deployment Branches from different versions. It might give a false positive for differences in functionality between them (a small but additional benefit to using Deployment Branches). + +C. Why an image tag? Couldn't image labels be used? + +Tags are easily readable and searchable for images stored in a repository. Reading and searching for labels with a particular value over a group of images requires pulling the manifest for each image, which adds complexity and reduces performance. Also, tagging images for different versions is still necessary for historical record and finding different versions, so using the source commit hash is the easiest solution that guarantees uniqueness while also containing instantly useful information. + +D. What is the most practical way to create Deployment Branches? + +The first three rules of DevOps are _automate_, _automate_, _automate_. + +Relying on resources to enforce best practices uniformly is hit and miss at best, so when implementing a CI/CD pipeline for image promotion, rollback, etc., incorporate automated Deployment Branching into the script. + +E. Any suggestions for a naming convention for Deployment Branches? + +<_**deployment-branch-identifier**_>-<_**env**_>-<_**src-commit-hash**_> + + * _**deployment-branch-identifier:**_ A unique string used by every Deployment Branch to identify it as a Deployment Branch; e.g. 'deployment' or 'deploy' + * _**env:**_ The SDLC environment the Deployment Branch pertains to; e.g. 'qa', 'stg', or' prod' for the test, staging, and production environments, respectively + * _**src-commit-hash:**_ The source code commit hash that holds the original code that built the image being deployed, which allows developers to easily find the original commit that created the image while ensuring the branch name is unique + + + +For example, _**deployment-qa-asdf78s**_ or _**deployment-stg-asdf78s**_ for Deployment Branches promoted to the QA and STG environments, respectively. + +F. How do you tell which version of the image is running in the environment? + +Our suggestion is to [label][5] all your deployment resources with the latest Deployment Branch commit hash and the source commit hash. These two unique identifiers will allow developers and operations personnel to find everything that was deployed and from where. It also makes cleanup of resources trivial using those selectors on deployments of different versions, e.g., on rollback or roll forward operations. + +G. When is it appropriate to merge changes from Deployment Branches back into the development branch? + +It's completely up to the development team on what makes sense. + +If you're making changes for load testing purposes just to see what will break your application, for example, then those changes may not be the best thing to merge back into the development branch. On the other hand, if you find and fix an error or tune a deployment in a downstream environment, merging the Deployment Branch changes back into the development branch makes sense. + +H. Is there a working example of Deployment Branching to test with first? + +[el-CICD][6] has been successfully using this strategy for a year and a half in production for more than a hundred projects across all SDLC downstream environments, including managing deployments to production. If you have access to an [OKD][7], Red Hat OpenShift lab cluster, or [Red Hat CodeReady Containers][8], you can download the [latest el-CICD version][9] and run through the [tutorial][10] to see how and when Deployment Branches are created and used. + +### Wrap up + +Using the working example above would be a good exercise to help you better understand the issues surrounding impedance mismatches in development processes. Maintaining alignment between images and deployment descriptors is a critical part of successfully managing deployments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/impedance-mismatch-cicd + +作者:[Evan "Hippy" Slatis][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hippyod +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/gears_devops_learn_troubleshooting_lightbulb_tips_520.png?itok=HcN38NOk (Tips and gears turning) +[2]: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/ +[3]: https://kubernetes.io/docs/concepts/workloads/controllers/cron-jobs/ +[4]: https://opensource.com/sites/default/files/picture1.png +[5]: https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/ +[6]: https://github.com/elcicd +[7]: https://www.okd.io/ +[8]: https://cloud.redhat.com/openshift/create/local +[9]: https://github.com/elcicd/el-CICD-RELEASES +[10]: https://github.com/elcicd/el-CICD-docs/blob/master/tutorial.md From 81d6e017fda37a4e1f66813c6c96a51a9cadad6d Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 25 Aug 2021 08:48:10 +0800 Subject: [PATCH 181/290] translating --- ...heck free disk space in Linux with ncdu.md | 154 ------------------ ...heck free disk space in Linux with ncdu.md | 153 +++++++++++++++++ 2 files changed, 153 insertions(+), 154 deletions(-) delete mode 100644 sources/tech/20210819 Check free disk space in Linux with ncdu.md create mode 100644 translated/tech/20210819 Check free disk space in Linux with ncdu.md diff --git a/sources/tech/20210819 Check free disk space in Linux with ncdu.md b/sources/tech/20210819 Check free disk space in Linux with ncdu.md deleted file mode 100644 index 0042c50865..0000000000 --- a/sources/tech/20210819 Check free disk space in Linux with ncdu.md +++ /dev/null @@ -1,154 +0,0 @@ -[#]: subject: "Check free disk space in Linux with ncdu" -[#]: via: "https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Check free disk space in Linux with ncdu -====== -Get an interactive report about disk usage with the ncdu Linux command. -![Check disk usage][1] - -Computer users tend to amass a lot of data over the years, whether it's important personal projects, digital photos, videos, music, or code repositories. While hard drives tend to be pretty big these days, sometimes you have to step back and take stock of what you're actually storing on your drives. The classic Linux commands [` df`][2] and [` du`][3] are quick ways to gain insight about what's on your drive, and they provide a reliable report that's easy to parse and process. That's great for scripting and processing, but the human brain doesn't always respond well to hundreds of lines of raw data. In recognition of this, the `ncdu` command aims to provide an interactive report about the space you're using on your hard drive. - -### Installing ncdu on Linux - -On Linux, you can install `ncdu` from your software repository. For instance, on Fedora or CentOS: - - -``` -`$ sudo dnf install ncdu` -``` - -On BSD, you can use [pkgsrc][4]. - -On macOS, you can install from [MacPorts][5] or [HomeBrew][6]. - -Alternately, you can [compile ncdu from source code][7]. - -### Using ncdu - -The interface of `ncdu` uses the ncurses library, which turns your terminal window into a rudimentary graphical application so you can use the Arrow keys to navigate visual menus. - -![ncdu interface][8] - -CC BY-SA Seth Kenlon - -That's one of the main appeals of `ncdu`, and what sets it apart from the original `du` command. - -To get a complete listing of a directory, launch `ncdu`. It defaults to the current directory. - - -``` -$ ncdu -ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help                                                                   -\--- /home/tux ----------------------------------------------- -   22.1 GiB [##################] /.var                                                                                         -   19.0 GiB [###############   ] /Iso -   10.0 GiB [########          ] /.local -    7.9 GiB [######            ] /.cache -    3.8 GiB [###               ] /Downloads -    3.6 GiB [##                ] /.mail -    2.9 GiB [##                ] /Code -    2.8 GiB [##                ] /Documents -    2.3 GiB [#                 ] /Videos -[...] -``` - -The listing shows the largest directory first (in this example, that's the `~/.var` directory, full of many many flatpaks). - -Using the Arrow keys on your keyboard, you can navigate through the listing to move deeper into a directory so you can gain better insight into what's taking up the most space. - -### Get the size of a specific directory - -You can run `ncdu` on an arbitrary directory by providing the path of a folder when launching it: - - -``` -`$ ncdu ~/chromiumos` -``` - -### Excluding directories - -By default, `ncdu` includes everything it can, including symbolic links and pseudo-filesystems such as procfs and sysfs. `You can` exclude these with the `--exclude-kernfs`. - -You can exclude arbitrary files and directories using the --exclude option, followed by a pattern to match. - - -``` -$ ncdu --exclude ".var" -   19.0 GiB [##################] /Iso                                                                                           -   10.0 GiB [#########         ] /.local -    7.9 GiB [#######           ] /.cache -    3.8 GiB [###               ] /Downloads -[...] -``` - -Alternately, you can list files and directories to exclude in a file, and cite the file using the `--exclude-from` option: - - -``` -$ ncdu --exclude-from myexcludes.txt /home/tux                                                                                     -   10.0 GiB [#########         ] /.local -    7.9 GiB [#######           ] /.cache -    3.8 GiB [###               ] /Downloads -[...] -``` - -### Color scheme - -You can add some color to ncdu with the `--color dark` option. - -![ncdu color scheme][9] - -CC BY-SA Seth Kenlon - -### Including symlinks - -The `ncdu` output treats symlinks literally, meaning that a symlink pointing to a 9 GB file takes up just 40 bytes. - - -``` -$ ncdu ~/Iso -    9.3 GiB [##################]  CentOS-Stream-8-x86_64-20210427-dvd1.iso                                                     -@   0.0   B [                  ]  fake.iso -``` - -You can force ncdu to follow symlinks with the `--follow-symlinks` option: - - -``` -$ ncdu --follow-symlinks ~/Iso -    9.3 GiB [##################]  fake.iso                                                                                     -    9.3 GiB [##################]  CentOS-Stream-8-x86_64-20210427-dvd1.iso -``` - -### Disk usage - -It's not fun to run out of disk space, so monitoring your disk usage is important. The `ncdu` command makes it easy and interactive. Try `ncdu` the next time you're curious about what you've got stored on your PC, or just to explore your filesystem in a new way. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/du-splash.png?itok=nRLlI-5A (Check disk usage) -[2]: https://opensource.com/article/21/7/check-disk-space-linux-df -[3]: https://opensource.com/article/21/7/check-disk-space-linux-du -[4]: https://opensource.com/article/19/11/pkgsrc-netbsd-linux -[5]: https://opensource.com/article/20/11/macports -[6]: https://opensource.com/article/20/6/homebrew-mac -[7]: https://dev.yorhel.nl/ncdu -[8]: https://opensource.com/sites/default/files/ncdu.jpg (ncdu interface) -[9]: https://opensource.com/sites/default/files/ncdu-dark.jpg (ncdu color scheme) diff --git a/translated/tech/20210819 Check free disk space in Linux with ncdu.md b/translated/tech/20210819 Check free disk space in Linux with ncdu.md new file mode 100644 index 0000000000..2367be34a4 --- /dev/null +++ b/translated/tech/20210819 Check free disk space in Linux with ncdu.md @@ -0,0 +1,153 @@ +[#]: subject: "Check free disk space in Linux with ncdu" +[#]: via: "https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 ncdu 检查 Linux 中的可用磁盘空间 +====== +用 ncdu Linux 命令获得关于磁盘使用的交互式报告。 +![Check disk usage][1] + +计算机用户多年来往往积累了大量的数据,无论是重要的个人项目、数码照片、视频、音乐还是代码库。虽然现在的硬盘往往相当大,但有时你必须退一步,评估一下你在硬盘上实际存储了什么。经典的 Linux 命令 [`df`][2] 和 [`du`][3] 是快速了解硬盘上的内容的方法,它们提供了一个可靠的报告,易于解析和处理。这对脚本和处理来说是很好的,但人的大脑对数百行的原始数据并不总是反应良好。认识到这一点,`ncdu` 命令旨在提供一份关于你在硬盘上使用的空间的交互式报告。 + +### 在 Linux 上安装 ncdu + +在 Linux 上,你可以从你的软件仓库安装 `ncdu`。例如,在 Fedora 或 CentOS 上: + + +``` +`$ sudo dnf install ncdu` +``` + +在 BSD 上,你可以使用 [pkgsrc][4]。 + +在 macOS 上,你可以从 [MacPorts][5] 或 [HomeBrew][6] 安装。 + +另外,你也可以[从源码编译 ncdu][7]。 + +### 使用 ncdu + +ncdu 界面使用 ncurses 库,它将你的终端窗口变成一个基本的图形应用,所以你可以使用方向键来浏览菜单。 + +![ncdu interface][8] + +CC BY-SA Seth Kenlon + +这是 `ncdu` 的主要吸引力之一,也是它与最初的 `du` 命令不同的地方。 + +要获得一个目录的完整列表,启动 `ncdu`。它默认为当前目录。 + + +``` +$ ncdu +ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help +\--- /home/tux ----------------------------------------------- + 22.1 GiB [##################] /.var + 19.0 GiB [############### ] /Iso + 10.0 GiB [######## ] /.local + 7.9 GiB [###### ] /.cache + 3.8 GiB [### ] /Downloads + 3.6 GiB [## ] /.mail + 2.9 GiB [## ] /Code + 2.8 GiB [## ] /Documents + 2.3 GiB [# ] /Videos +[...] +``` + +这个列表首先显示了最大的目录(在这个例子中,那是 `~/.var` 目录,充满了很多的 flatpaks)。 + +使用键盘上的方向键,你可以浏览列表,深入到一个目录,这样你就可以更好地了解什么东西占用了最大的空间。 + +### 获取一个特定目录的大小 + +你可以在启动 `ncdu` 时提供任意一个文件夹的路径: + + +``` +`$ ncdu ~/chromiumos` +``` + +### 排除目录 + +默认情况下,`ncdu` 包括一切可以包括的东西,包括符号链接和伪文件系统,如 procfs 和 sysfs。你可以用 `--exclude-kernfs` 来排除这些。 + +你可以使用 --exclude 选项排除任意文件和目录,并在后面加上一个匹配模式。 + + +``` +$ ncdu --exclude ".var" + 19.0 GiB [##################] /Iso + 10.0 GiB [######### ] /.local + 7.9 GiB [####### ] /.cache + 3.8 GiB [### ] /Downloads +[...] +``` + +另外,你可以在文件中列出要排除的文件和目录,并使用 `--exclude-from` 选项来引用该文件: + +``` +$ ncdu --exclude-from myexcludes.txt /home/tux + 10.0 GiB [######### ] /.local + 7.9 GiB [####### ] /.cache + 3.8 GiB [### ] /Downloads +[...] +``` + +### 颜色方案 + +你可以用 `--color dark` 选项给 ncdu 添加一些颜色。 + +![ncdu color scheme][9] + +CC BY-SA Seth Kenlon + +### 包括符号链接 + +`ncdu` 输出按字面意思处理符号链接,这意味着一个指向 9GB 文件的符号链接只占用 40 个字节。 + + +``` +$ ncdu ~/Iso + 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso +@ 0.0 B [ ] fake.iso +``` + +你可以用 `--follow-symlinks` 选项强制 ncdu 跟踪符号链接: + + +``` +$ ncdu --follow-symlinks ~/Iso + 9.3 GiB [##################] fake.iso + 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso +``` + +### 磁盘使用率 + +磁盘空间用完并不有趣,所以监控你的磁盘使用情况很重要。`ncdu` 命令使它变得简单和互动。下次当你对你的电脑上存储的东西感到好奇时,或者只是想以一种新的方式探索你的文件系统时,不妨试试 `ncdu`。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/du-splash.png?itok=nRLlI-5A (Check disk usage) +[2]: https://opensource.com/article/21/7/check-disk-space-linux-df +[3]: https://opensource.com/article/21/7/check-disk-space-linux-du +[4]: https://opensource.com/article/19/11/pkgsrc-netbsd-linux +[5]: https://opensource.com/article/20/11/macports +[6]: https://opensource.com/article/20/6/homebrew-mac +[7]: https://dev.yorhel.nl/ncdu +[8]: https://opensource.com/sites/default/files/ncdu.jpg (ncdu interface) +[9]: https://opensource.com/sites/default/files/ncdu-dark.jpg (ncdu color scheme) From 251e69e21d84956d7d3b7877770029509778cf5f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 25 Aug 2021 08:52:12 +0800 Subject: [PATCH 182/290] translating --- ...23 Access your iPhone on Linux with this open source tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md b/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md index 711b822f76..e5c4093684 100644 --- a/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md +++ b/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/libimobiledevice-iphone-linux" [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 2805f3128403c8bfdab1d3bdb1d3ed8f96ea4baa Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Aug 2021 10:41:11 +0800 Subject: [PATCH 183/290] PRF @unigeorge --- ...0210817 4 alternatives to cron in Linux.md | 31 ++++++++++--------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/translated/tech/20210817 4 alternatives to cron in Linux.md b/translated/tech/20210817 4 alternatives to cron in Linux.md index 93aa34a533..6669b5a770 100644 --- a/translated/tech/20210817 4 alternatives to cron in Linux.md +++ b/translated/tech/20210817 4 alternatives to cron in Linux.md @@ -3,23 +3,24 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -Linux 中 cron 命令的 4 种替代方案 +Linux 中 cron 系统的 4 种替代方案 ====== -在 Linux 系统中有一些其他开源项目可以结合或者替代 cron 命令使用。 -![Alarm clocks with different time][1] +> 在 Linux 系统中有一些其他开源项目可以结合或者替代 cron 系统使用。 -[Linux `cron` 系统][2] 是一项经过时间检验的成熟技术,然而在任何情况下它都是最合适的系统自动化工具吗?答案是否定的。有一些开源项目就可以用来与 `cron` 结合或者直接代替 `cron` 使用。 +![](https://img.linux.net.cn/data/attachment/album/202108/25/104033ro6lasn54lq25r2l.jpg) + +[Linux cron 系统][2] 是一项经过时间检验的成熟技术,然而在任何情况下它都是最合适的系统自动化工具吗?答案是否定的。有一些开源项目就可以用来与 cron 结合或者直接代替 cron 使用。 ### at 命令 -`cron` 适用于长期重复任务。如果你设置了一个工作任务,它会从现在开始定期运行,直到计算机报废为止。但有些情况下你可能只想设置一个一次性命令,以备不在计算机旁时该命令可以自动运行。这时你可以选择使用 `at` 命令。 +cron 适用于长期重复任务。如果你设置了一个工作任务,它会从现在开始定期运行,直到计算机报废为止。但有些情况下你可能只想设置一个一次性命令,以备不在计算机旁时该命令可以自动运行。这时你可以选择使用 `at` 命令。 -`at` 的语法比 `cron` 语法简单和灵活得多,并且兼具交互式和非交互式调度方法。(只要你想,你甚至可以使用 `at` 作业创建一个 `at` 作业。) +`at` 的语法比 cron 语法简单和灵活得多,并且兼具交互式和非交互式调度方法。(只要你想,你甚至可以使用 `at` 作业创建一个 `at` 作业。) ``` $ echo "rsync -av /home/tux/ me@myserver:/home/tux/" | at 1:30 AM @@ -29,27 +30,27 @@ $ echo "rsync -av /home/tux/ me@myserver:/home/tux/" | at 1:30 AM 阅读有关 [at 命令][3] 的更多信息并开始使用吧。 -### systemd 命令 +### systemd -除了管理计算机上的进程外,`systemd` 还可以帮你调度这些进程。与传统的 `cron` 作业一样,`systemd` 计时器可以在指定的时间间隔触发事件,例如 shell 脚本和命令。时间间隔可以是每月特定日期的一天一次(例如在星期一的时候触发),或者在 09:00 到 17:00 的工作时间内每 15 分钟一次。 +除了管理计算机上的进程外,`systemd` 还可以帮你调度这些进程。与传统的 cron 作业一样,systemd 计时器可以在指定的时间间隔触发事件,例如 shell 脚本和命令。时间间隔可以是每月特定日期的一天一次(例如在星期一的时候触发),或者在 09:00 到 17:00 的工作时间内每 15 分钟一次。 -此外 `systemd` 里的计时器还可以做一些 `cron` 作业不能做的事情。 +此外 systemd 里的计时器还可以做一些 cron 作业不能做的事情。 例如,计时器可以在一个事件 _之后_ 触发脚本或程序来运行特定时长,这个事件可以是开机,可以是前置任务的完成,甚至可以是计时器本身调用的服务单元的完成! -如果你的系统运行着 `systemd` 服务,那么你的机器就已经在技术层面上使用 `systemd` 计时器了。默认计时器会执行一些琐碎的任务,例如滚动日志文件、更新 mlocate 数据库、管理 DNF 数据库等。创建自己的计时器很容易,具体可以参阅 David Both 的文章 [使用 systemd 计时器来代替 cron][4]。 +如果你的系统运行着 systemd 服务,那么你的机器就已经在技术层面上使用 systemd 计时器了。默认计时器会执行一些琐碎的任务,例如滚动日志文件、更新 mlocate 数据库、管理 DNF 数据库等。创建自己的计时器很容易,具体可以参阅 David Both 的文章 [使用 systemd 计时器来代替 cron][4]。 ### anacron 命令 -`cron` 专门用于在特定时间运行命令,这适用于从不休眠或断电的服务器。然而对笔记本电脑和台式工作站而言,时常有意或无意地关机是很常见的。当计算机处于关机状态时,`cron` 不会运行,因此设定在这段时间内的一些重要工作(例如备份数据)也就会跳过执行。 +cron 专门用于在特定时间运行命令,这适用于从不休眠或断电的服务器。然而对笔记本电脑和台式工作站而言,时常有意或无意地关机是很常见的。当计算机处于关机状态时,cron 不会运行,因此设定在这段时间内的一些重要工作(例如备份数据)也就会跳过执行。 -`anacron` 系统旨在确保作业定期运行,而不是按计划时间点运行。这就意味着你可以将计算机关机几天,再次启动时仍然靠 `anacron` 来运行基本任务。`anacron` 与 `cron` 协同工作,因此严格来说前者不是后者的替代品,而是一种调度任务的有效可选方案。许多系统管理员配置了一个 `cron` 作业来在深夜备份远程工作者计算机上的数据,结果却发现该作业在过去六个月中只运行过一次。`anacron` 确保重要的工作在 _可执行的时候_ 发生,而不是必须在安排好的 _特定时间点_ 发生。 +anacron 系统旨在确保作业定期运行,而不是按计划时间点运行。这就意味着你可以将计算机关机几天,再次启动时仍然靠 anacron 来运行基本任务。anacron 与 cron 协同工作,因此严格来说前者不是后者的替代品,而是一种调度任务的有效可选方案。许多系统管理员配置了一个 cron 作业来在深夜备份远程工作者计算机上的数据,结果却发现该作业在过去六个月中只运行过一次。anacron 确保重要的工作在 _可执行的时候_ 发生,而不是必须在安排好的 _特定时间点_ 发生。 点击参阅关于 [使用 anacron 获得更好的 crontab 效果][5] 的更多内容。 ### 自动化 -计算机和技术旨在让人们的生活更美好,工作更轻松。Linux 为用户提供了许多有用的功能,以确保完成重要的操作系统任务。查看这些可用的功能,然后试着将这些功能用于你自己的工作任务吧。(LCTT译注:作者本段有些语焉不详,读者可参阅譬如 [Ansible 自动化工具安装、配置和快速入门指南](https://linux.cn/article-13142-1.html) 等关于 Linux 自动化的文章) +计算机和技术旨在让人们的生活更美好,工作更轻松。Linux 为用户提供了许多有用的功能,以确保完成重要的操作系统任务。查看这些可用的功能,然后试着将这些功能用于你自己的工作任务吧。(LCTT 译注:作者本段有些语焉不详,读者可参阅譬如 [Ansible 自动化工具安装、配置和快速入门指南](https://linux.cn/article-13142-1.html) 等关于 Linux 自动化的文章) -------------------------------------------------------------------------------- @@ -58,7 +59,7 @@ via: https://opensource.com/article/21/7/alternatives-cron-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 1a8b07317e2376c3ff5c5b31c4c7a4370adee329 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Aug 2021 10:41:59 +0800 Subject: [PATCH 184/290] PUB @unigeorge https://linux.cn/article-13716-1.html --- .../20210817 4 alternatives to cron in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210817 4 alternatives to cron in Linux.md (98%) diff --git a/translated/tech/20210817 4 alternatives to cron in Linux.md b/published/20210817 4 alternatives to cron in Linux.md similarity index 98% rename from translated/tech/20210817 4 alternatives to cron in Linux.md rename to published/20210817 4 alternatives to cron in Linux.md index 6669b5a770..72b6aae2d7 100644 --- a/translated/tech/20210817 4 alternatives to cron in Linux.md +++ b/published/20210817 4 alternatives to cron in Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13716-1.html" Linux 中 cron 系统的 4 种替代方案 ====== From 9322cf999f1fe48bbf96b169c339994edea376d6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Aug 2021 13:14:33 +0800 Subject: [PATCH 185/290] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @fisherue 感谢您,完成了第一篇翻译贡献! --- ...107 5 ways to improve your Bash scripts.md | 84 +++++++++---------- 1 file changed, 38 insertions(+), 46 deletions(-) diff --git a/translated/tech/20200107 5 ways to improve your Bash scripts.md b/translated/tech/20200107 5 ways to improve your Bash scripts.md index ac91f424db..01a418c293 100644 --- a/translated/tech/20200107 5 ways to improve your Bash scripts.md +++ b/translated/tech/20200107 5 ways to improve your Bash scripts.md @@ -1,25 +1,26 @@ [#]: collector: "lujun9972" [#]: translator: "fisherue" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " [#]: subject: "5 ways to improve your Bash scripts" [#]: via: "https://opensource.com/article/20/1/improve-bash-scripts" [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" -5 步提升你的脚本程序 +改进你的脚本程序的 5 个方法 ====== -巧用 Bash 脚本程序能帮助你完成很多极具挑战的任务。 -![A person working.工作者图片][1] + +> 巧用 Bash 脚本程序能帮助你完成很多极具挑战的任务。 + +![](https://img.linux.net.cn/data/attachment/album/202108/25/131347yblk4jg4r6blebmg.jpg) 系统管理员经常写脚本程序,不论长短,这些脚本可以完成某种任务。 -你是否曾经查看过某个软件发行方提供的安装用的脚本 (script) 程序?为了能够适应不同用户的系统配置,顺利完成安装,这些脚本程序经常包含很多函数和逻辑分支。多年来,我已经集合了提升我的脚本程序的一些技巧,这里分享几个技巧,希望能对朋友们也有用。这里列出一组短脚本示例,展示给大家做脚本样本。 +你是否曾经查看过某个软件发行方提供的安装用的脚本script程序?为了能够适应不同用户的系统配置,顺利完成安装,这些脚本程序经常包含很多函数和逻辑分支。多年来,我积累了一些改进脚本程序的一些技巧,这里分享几个,希望能对朋友们也有用。这里列出一组短脚本示例,展示给大家做脚本样本。 ### 初步尝试 -我尝试写一个脚本程序时,原始程序往往就是一组命令行,通常就是调用标准命令完成诸如更新网页内容之类的工作,这样可以节省时间。其中一个类似的工作是解压文件到阿帕奇 (Apache) 网站服务器的主目录里,我的最初脚本程序大概是下面这样: - +我尝试写一个脚本程序时,原始程序往往就是一组命令行,通常就是调用标准命令完成诸如更新网页内容之类的工作,这样可以节省时间。其中一个类似的工作是解压文件到 Apache 网站服务器的主目录里,我的最初脚本程序大概是下面这样: ``` cp january_schedule.tar.gz /usr/apache/home/calendar/ @@ -29,26 +30,24 @@ tar zvxf january_schedule.tar.gz 这帮我节省了时间,也减少了键入多条命令操作。时日久了,我掌握了另外的技巧,可以用 Bash 脚本程序完成更难的一些工作,比如说创建软件安装包、安装软件、备份文件系统等工作。 -### 1\. 条件分支结构 +### 1、条件分支结构 和众多其他编程语言一样,脚本程序的条件分支结构同样是强大的常用技能。条件分支结构赋予了计算机程序逻辑能力,我的很多实例都是基于条件逻辑分支。 -基本的条件分支结构就是 IF 条件分支结构。通过判定是否满足特定条件,可以控制程序选择执行相应的脚本命令段。比如说,想要判断系统是否安装了 Java ,可以通过判断系统有没有一个 Java 库目录;如果找到这个目录,就把这个目录路径添加到可运行程序路径,也就可以调用 Java 库应用了。 - +基本的条件分支结构就是 `if` 条件分支结构。通过判定是否满足特定条件,可以控制程序选择执行相应的脚本命令段。比如说,想要判断系统是否安装了 Java ,可以通过判断系统有没有一个 Java 库目录;如果找到这个目录,就把这个目录路径添加到可运行程序路径,也就可以调用 Java 库应用了。 ``` if [ -d "$JAVA_HOME/bin" ] ; then     PATH="$JAVA_HOME/bin:$PATH" ``` -### 2\. 限定运行权限 +### 2、限定运行权限 -你或许想只允许特定的用户才能执行某个脚本程序。除了 Linux 的权限许可管理,比如对用户和用户组设定权限、通过 SELinux 设定此类的保护权限等,你还可以在脚本里设置逻辑判断来设置执行权限。类似的情况可能是,你需要确保只有网站程序的所有者才能执行相应的网站初始化操作脚本。甚至你可以限定只有根用户才能执行某个脚本。这个可以通过在脚本程序里设置逻辑判断实现, Linux 提供的几个环境变量可以帮忙。其中一个是保存用户名称的变量 **$USER**, 另一个是保存用户识别码的变量 **$UID** 。在脚本程序里,执行用户的 UID 值就保存在 **$UID** 变量里。 +你或许想只允许特定的用户才能执行某个脚本程序。除了 Linux 的权限许可管理,比如对用户和用户组设定权限、通过 SELinux 设定此类的保护权限等,你还可以在脚本里设置逻辑判断来设置执行权限。类似的情况可能是,你需要确保只有网站程序的所有者才能执行相应的网站初始化操作脚本。甚至你可以限定只有 root 用户才能执行某个脚本。这个可以通过在脚本程序里设置逻辑判断实现,Linux 提供的几个环境变量可以帮忙。其中一个是保存用户名称的变量 `$USER`, 另一个是保存用户识别码的变量 `$UID` 。在脚本程序里,执行用户的 UID 值就保存在 `$UID` 变量里。 #### 用户名判别 -第一个例子里,我在一个多用户环境里指定只有用户 jboss1 可以执行脚本程序。条件 if 语句猜测判断,‘要求执行这个脚本程序的用户不是 jboss1?’ 如果我猜测的没错,就会输出提示“用户不是 jboss1 ”,然后直接退出这个脚本程序,返回码为1 **exit 1** 。 - +第一个例子里,我在一个带有几个应用服务器实例的多用户环境里指定只有用户 `jboss1` 可以执行脚本程序。条件 `if` 语句主要是判断,“要求执行这个脚本程序的用户不是 `jboss1` 吗?”当此条件为真时,就会调用第一个 `echo` 语句,接着是 `exit 1`,即退出这个脚本程序。 ``` if [ "$USER" != 'jboss1' ]; then @@ -60,8 +59,7 @@ echo "continue script" #### 根用户判别 -接下来的例子是要求只有根用户才能执行脚本程序。根用户的用户识别码 (UID) 是0,设置的条件判断采用大于操作符 (**-gt**) ,所有 UID 值大于0的用户都被禁止执行该脚本程序。 - +接下来的例子是要求只有根用户才能执行脚本程序。根用户的用户识别码(UID)是 0,设置的条件判断采用大于操作符(`-gt`),所有 UID 值大于 0 的用户都被禁止执行该脚本程序。 ``` if [ "$UID" -gt 0 ]; then @@ -71,9 +69,9 @@ fi echo "continue script" ``` -### 3\. 带参数执行程序 +### 3、带参数执行程序 -可执行程序可以附带参数作为执行选项,命令行脚本程序也是一样,下面给出几个例子。在这之前,我想告诉你,能写出好的程序并不只是写出我们想要它执行什么就执行什么的程序,程序还需要按照我们不想让它执行什么它可以按我们的意愿能够不执行相应操作。如果运行程序时没有提供参数造成程序缺少足够信息,我愿意脚本程序不要做任何破坏性的操作。因而,程序的第一步就是确认命令行是否提供了参数,判定的条件就是参数 **$# **的值是否为 0 ,如果是(意味着没有提供参数),就直接终止脚本程序并退出操作。 +可执行程序可以附带参数作为执行选项,命令行脚本程序也是一样,下面给出几个例子。在这之前,我想告诉你,能写出好的程序并不只是写出我们想要它执行什么的程序,程序还需要不执行我们不要它执行的操作。如果运行程序时没有提供参数造成程序缺少足够信息,我愿意脚本程序不要做任何破坏性的操作。因而,程序的第一步就是确认命令行是否提供了参数,判定的条件就是参数数量 `$#` 是否为 0 ,如果是(意味着没有提供参数),就直接终止脚本程序并退出操作。 ``` @@ -86,57 +84,52 @@ echo "arguments found: $#" #### 多个运行参数 -可以传递给脚本程序的参数不知一个。脚本使用内部变量指代这些参数,内部变量名用非负整数递增标识,也就是 **$1**,** $2**,** $3 **等等递增。我只是扩展前面的程序,输出显示用户提供的前三个参数。显然,要针对所有的每个参数有对应的响应需要更多的逻辑判断,这里的例子只是简单展示参数的使用。 - +可以传递给脚本程序的参数不止一个。脚本使用内部变量指代这些参数,内部变量名用非负整数递增标识,也就是 `$1`、`$2`、`$3` 等等递增。我只是扩展前面的程序,并在下面一行输出显示用户提供的前三个参数。显然,要针对所有的每个参数有对应的响应需要更多的逻辑判断,这里的例子只是简单展示参数的使用。 ``` -`echo $1 $2 $3` +echo $1 $2 $3 ``` -我们在讨论这些参数变量名,你或许有个疑问,“参数变量名怎么跳过了**$0**,(而直接从**$1**开始)?” - -是的,是这样,这是有原因的。变量名 **$0** 确实存在,也非常有用,它储存的是被执行的脚本程序的名称。 +我们在讨论这些参数变量名,你或许有个疑问,“参数变量名怎么跳过了 `$0`,(而直接从`$1` 开始)?” +是的,是这样,这是有原因的。变量名 `$0` 确实存在,也非常有用,它储存的是被执行的脚本程序的名称。 ``` -`echo $0` +echo $0 ``` -程序执行过程中有一个变量名指代程序名称,很重要的一个原因是,可以在生成的日志文件名称里包含程序名称,最简单的方式应该是调用一个 "echo" 语句。 - +程序执行过程中有一个变量名指代程序名称,很重要的一个原因是,可以在生成的日志文件名称里包含程序名称,最简单的方式应该是调用一个 `echo` 语句。 ``` -`echo test >> $0.log` +echo test >> $0.log ``` 当然,你或许要增加一些代码,确保这个日志文件存放在你希望的路径,日志名称包含你认为有用的信息。 -### 4\. 交互输入 +### 4、交互输入 脚本程序的另一个好用的特性是可以在执行过程中接受输入,最简单的情况是让用户可以输入一些信息。 ``` echo "enter a word please:" - read word - echo $word +read word +echo $word ``` 这样也可以让用户在程序执行中作出选择。 - ``` read -p "Install Software ?? [Y/n]: " answ - if [ "$answ" == 'n' ]; then -   exit 1 - fi -   echo "Installation starting..." +if [ "$answ" == 'n' ]; then +   exit 1 +fi +   echo "Installation starting..." ``` -### 5\. 出错退出执行 - -几年前,我写了各脚本,想在自己的电脑上安装最新版本的 Java 开发工具包 (JDK) 。这个脚本把 JDK 文件解压到指定目录,创建更新一些符号链接,再做一下设置告诉系统使用这个最新的版本。如果解压过程出现错误,在执行后面的操作就会使 Java 系统破坏不能使用。因而,这种情况下需要终止程序。如果解压过程没有成功,就不应该再继续进行之后的更新操作。下面语句段可以完成这个功能。 +### 5、出错退出执行 +几年前,我写了个脚本,想在自己的电脑上安装最新版本的 Java 开发工具包(JDK)。这个脚本把 JDK 文件解压到指定目录,创建更新一些符号链接,再做一下设置告诉系统使用这个最新的版本。如果解压过程出现错误,在执行后面的操作就会使整个系统上的 Java 破坏不能使用。因而,这种情况下需要终止程序。如果解压过程没有成功,就不应该再继续进行之后的更新操作。下面语句段可以完成这个功能。 ``` tar kxzmf jdk-8u221-linux-x64.tar.gz -C /jdk --checkpoint=.500; ec=$? @@ -146,20 +139,19 @@ if [ $ec -ne 0 ]; then fi ``` -下面的一行语句组可以快速展示变量 **$?** 的用法。 - +下面的单行语句可以给你快速展示一下变量 `$?` 的用法。 ``` -`ls T; ec=$?; echo $ec` +ls T; ec=$?; echo $ec ``` -先用 **touch T** 命令创建一个文件名为 **T** 的文件,然后执行这个文件行,变量 **ec **的值会是0。然后,用 **rm T **命令删除文件,在执行示例的文件行,变量 **ec** 的值会是2,因为文件 T 不存在,命令 **ls **找不到指定文件报错,相应返回值是2。 +先用 `touch T` 命令创建一个文件名为 `T` 的文件,然后执行这个单行命令,变量 `ec` 的值会是 0。然后,用 `rm T` 命令删除文件,再执行该单行命令,变量 `ec` 的值会是 2,因为文件 `T` 不存在,命令 `ls` 找不到指定文件报错。 在逻辑条件里利用这个出错标识,参照前文我使用的条件判断,可以使脚本文件按需完成设定操作。 ### 结语 -要完成复杂的功能,或许我们觉得应该使用诸如 Python, C, 或 Java 这类的高级编程语言,然而并不尽然,脚本编程语言也很强大,可以完成类似任务。要充分发挥脚本的作用,有很多需要学习的,希望这里的几个例子能让你意识到脚本编程的功能。 +要完成复杂的功能,或许我们觉得应该使用诸如 Python、C 或 Java 这类的高级编程语言,然而并不尽然,脚本编程语言也很强大,可以完成类似任务。要充分发挥脚本的作用,有很多需要学习的,希望这里的几个例子能让你意识到脚本编程的强大。 -------------------------------------------------------------------------------- @@ -167,8 +159,8 @@ via: https://opensource.com/article/20/1/improve-bash-scripts 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] -译者:[fisherue](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[fisherue](https://github.com/fisherue) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a6f4de2fde67f2bd9245d0616872378ac0be7acb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Aug 2021 13:15:50 +0800 Subject: [PATCH 186/290] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @fisherue 本文首发地址: https://linux.cn/article-13717-1.html 您的 LCTT 专页:https://linux.cn/lctt/fisherue --- .../20200107 5 ways to improve your Bash scripts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200107 5 ways to improve your Bash scripts.md (99%) diff --git a/translated/tech/20200107 5 ways to improve your Bash scripts.md b/published/20200107 5 ways to improve your Bash scripts.md similarity index 99% rename from translated/tech/20200107 5 ways to improve your Bash scripts.md rename to published/20200107 5 ways to improve your Bash scripts.md index 01a418c293..22d5579875 100644 --- a/translated/tech/20200107 5 ways to improve your Bash scripts.md +++ b/published/20200107 5 ways to improve your Bash scripts.md @@ -1,8 +1,8 @@ [#]: collector: "lujun9972" [#]: translator: "fisherue" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13717-1.html" [#]: subject: "5 ways to improve your Bash scripts" [#]: via: "https://opensource.com/article/20/1/improve-bash-scripts" [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" From 67c0fe4644a6f45c2fce6101c2785ce8cc98cd90 Mon Sep 17 00:00:00 2001 From: imgradeone <30969327+imgradeone@users.noreply.github.com> Date: Wed, 25 Aug 2021 16:09:40 +0800 Subject: [PATCH 187/290] Start translating KDE Plasma 5.23 --- ...20210823 KDE Plasma 5.23 - New Features and Release Dates.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md index 0ef83b3f24..6cb0302e72 100644 --- a/sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md +++ b/sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md @@ -2,7 +2,7 @@ [#]: via: "https://www.debugpoint.com/2021/08/kde-plasma-5-23/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "imgradeone" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 73ac8500acd933b51a40b088c35f57166ddc6135 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Wed, 25 Aug 2021 18:27:01 +0800 Subject: [PATCH 188/290] finished translating KDE Plasma 5.23 --- ...a 5.23 - New Features and Release Dates.md | 118 ------------------ ...a 5.23 - New Features and Release Dates.md | 105 ++++++++++++++++ 2 files changed, 105 insertions(+), 118 deletions(-) delete mode 100644 sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md create mode 100644 translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md diff --git a/sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md deleted file mode 100644 index 6cb0302e72..0000000000 --- a/sources/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: subject: "KDE Plasma 5.23 – New Features and Release Dates" -[#]: via: "https://www.debugpoint.com/2021/08/kde-plasma-5-23/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: "imgradeone" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -KDE Plasma 5.23 – New Features and Release Dates -====== -We round up the features of KDE Plasma 5.23 (upcoming) in this post, -with major highlights and download/testing instructions. -KDE Plasma desktop is the most popular and top class Linux desktop environment today. The main reason is adaptation, rapid iteration of its development, performance improvements. Since the release of [KDE Plasma 5.22][1], the team is busy with merging changes and testing new features for upcoming KDE Plasma 5.23. It is currently under development with a tentative schedule as below. - -### KDE Plasma 5.23 Schedule - -KDE Plasma releases on Oct 7, 2021. Here’s the overall schedule: - - * Beta – Sep 16, 2021 - * Final Release – Oct 7, 2021 - - - -Like every Plasma release, this iteration also promises a wide range of changes to core Plasma Shell, KDE Applications, code cleanups, performance improvements, hundreds of bug fixes, Wayland improvements and more. We collected some important features in this post to give you an idea on what’s incoming. Let’s take a look. - -### KDE Plasma 5.23 – New Features - - * This release is powered by Qt version 5.15, KDE Frameworks version 5.86. - - - -##### Plasma Shell and App Updates - - * The KDE Plasma Kickoff brings a huge set of updates that includes bug fixes, low RAM usage, look and feel updates, keyboard and mouse navigation improvements. - * Kickoff menu can be set to keep open using a pin option. - * Kickoff tabs not changes (from Applications to Places) when you scroll. - * Press CTRL+F to directly focus to the search bar in Kickoff. - * The action button captions in Kickoff (shut down, etc.) can be turned off via an option to show only icons. - * You can now either choose list or grid view for all Kickoff items (not only Favorites). - - - -![New Kickoff Options in KDE Plasma 5.23][2] - -![Changes in kickoff][3] - - * A new QML-based Overview effect is introduced (much like GNOME 3.38 workspace view) which shows the opened windows (have a look at this video). I could not find the merge request no for this for further detail, and it’s still not in unstable. - - - -_Video credit: KDE team_ - - * This overview effect may replace the existing Present Windows effect and the Desktop Grid effect as well (planned). - - - * A more visible ‘No Touchpad found’ message is introduced when there is no touchpad. - * You can now have the Power Profile settings in Plasma UI (Battery and Brightness window). This power profile features landed since Linux Kernel 5.12 for Dell and Lenovo laptops. So, if you have the latest brands of these Laptops, you can now set your power profiles either more performance mode or power saving mode. _[Note: Fedora 35 expected to bring this feature for GNOME 41 (probably)]_ - - - -![New power profiles][4] - - * If you have multiscreen setup with say vertical and landscape screen, then the login screen now properly synced and aligned. This was much needed features. - * A new Breeze theme is expected with style updates. - * A brand-new wallpaper is expected, like prior releases (the competition is still going on). - * A new setting to resize system tray icons when your hardware is changed from Laptop mode to Tablet mode. - * You can now have the ability to choose Bluetooth status on login always enabled, always disabled, or remember the previous status. This status ca be carried over the version upgrades. - * Users can now change the displayed name of sensors on a per-face basis. - * The scrollbar handle in Breeze style is now a little thicker than previous editions. - * A new option in Dolphin file manager enables you to show hidden files first before folders. - * You can delete selected items in clipboard popup using DEL key. - * KDE now enables you to contribute to store.kde.org with your designed icons, themes directly from the Plasma desktop. - - - -##### Wayland Updates - - * When you launch applications, the cursor now shows the animated icon feedback in Wayland sessions. - * Copying text from notification now works. - * Middle click paste now works in Wayland and XWayland applications. - - - -Remember, there are hundreds of bug fixes, improvements that lands in each release. These are merely scratching the surface which I collected. So, make sure to visit GitLab or KDE Planets to learn more in detail about changes in applications and Plasma shell. - -### Unstable Edition Download - -You can experience all the above features right now via KDE Neon Unstable edition via below link. Download the .iso and test. Make sure to report bugs if you found any. This unstable edition is not for serious usage or production deployments. - -[KDE NEON UNSTABLE EDITION][5] - -### Closing Notes - -KDE Plasma 5.23 keeps improving under the hood with new features in every release. Although, this release is not going to be a massive one, but all these optimizations, improvements eventually sums up to the stability, adaptation and better user experience. And more Wayland updates (seriously, Wayland compatibility always seems “work in progress” – like for a decade now. That’s another topic for discussion). - -Cheers. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/kde-plasma-5-23/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/2021/06/kde-plasma-5-22-release/ -[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/New-Kickoff-Options-in-KDE-Plasma-5.23.jpeg -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Changes-in-kickoff.jpeg -[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/New-power-profiles.jpeg -[5]: https://neon.kde.org/download diff --git a/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md new file mode 100644 index 0000000000..02803c62bc --- /dev/null +++ b/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md @@ -0,0 +1,105 @@ +[#]: subject: "KDE Plasma 5.23 – New Features and Release Dates" +[#]: via: "https://www.debugpoint.com/2021/08/kde-plasma-5-23/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "imgradeone" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +KDE Plasma 5.23 – 新功能和发布日期 +====== +> 我们在这篇文章中总结了 KDE Plasma 5.23(即将到来)的新功能,包括主要特点和下载 / 测试说明。 + +KDE Plasma 桌面是当今最流行、最顶级的 Linux 桌面环境,而 KDE Plasma 的热度之高主要得益于其适应能力强、迭代发展迅速,以及性能不断提高。[KDE Plasma 5.22][1] 发布以来,KDE 团队一直忙于为即将到来的 KDE Plasma 5.23 合并更改、测试新功能。目前 KDE Plasma 5.23 仍在开发中,如下是暂定的时间表。 + +### KDE Plasma 5.23 发布时间表 + +KDE Plasma 5.23 将于 2021 年 10 月 7 日发布,以下是时间表: + + * Beta 公测 – 2021 年 9 月 16 日 + * 最终发布 – 2021 年 10 月 7 日 + +正如每个 Plasma 版本更新一样,本次更新也同样承诺对核心 Plasma Shell(Plasma 外壳)、KDE 应用、代码清理、性能改进、数百个 bug 修复、Wayland 优化等方面进行大幅更改。我们在本篇文章中收集了一些重要的功能,让你对即将发布的新功能有基本了解。下面就让我们看看。 + +### KDE Plasma 5.23 – 新功能 + + * 本次更新基于 Qt 5.15 版本,KDE 框架(KDE Frameworks)5.86 版本。 + +#### Plasma Shell 和应用程序更新 + + * 本次 KDE Plasma Kickoff 程序启动器将有大幅更新,包括 bug 修复、减少 RAM 占用、视觉更新、键鼠导航优化。 + * Kickoff 程序启动器菜单允许使用固定按钮固定在桌面上,保持开启状态。 + * Kickoff 的标签不会在你滚动时切换(从应用标签到位置标签)。 + * Kickoff 里可以使用 CTRL+F 快捷键直接聚焦到搜索栏。 + * Kickoff 中的操作按钮(如关机等)可以设置为仅显示图标。 + * 现在可以针对所有 Kickoff 项目选择使用网格或列表视图(而不仅仅局限于收藏夹)。 + +![KDE Plasma 5.23 中 Kickoff 程序启动器新增的选项][2] + +![Kickoff 程序启动器的更改][3] + + * 新增基于 QML 的全新概览视图(类似 GNOME 3.38 的工作区视图),用于展示所有打开的窗口(详见此视频)。目前我找不到关于此合并请求(Pull Request)的更多详情,而且这个新视图也很不稳定。 + + + + +_视频作者:KDE 团队_ + + * 该概览效果将替代现有的“展现窗口”特效和“虚拟桌面平铺网格”特效(计划中)。 + * 未连接触控板时将展示更易察觉的“未找到触摸板”提示。 + * “电源配置方案”设置现在呈现于 Plasma UI(电池和亮度窗口)中。电源配置方案功能从 Linux 内核 5.12 版本开始已经登陆戴尔和联想的笔记本电脑了。因此,如果你拥有这些品牌的较新款笔记本电脑,你可以将电源配置方案设置为高性能或省电模式。_[注:Fedora 35(很大可能)会在 GNOME 41 中增加该功能]_ + +![新的“电源配置方案”设置][4] + + * 如果你有多屏幕设置,包括垂直和横向屏幕,那么登录屏幕现在可以正确同步和对齐。这个功能的需求度很高。 + * 新的 Breeze 微风主题预计会有风格上的更新。 + * 如前序版本一样,预计会有全新的壁纸(目前壁纸大赛仍在进行中)。 + * 新增当硬件从笔记本模式切换到平板模式时是否缩放系统托盘图标的设置。 + * 你可以选择在登录时的蓝牙状态:总是启用、总是禁用、记住上一次的状态。该状态在版本升级后仍可保留。 + * 用户现在可以更改传感器的显示名称。 + * Breeze 风格的滚动条现在比之前版本的更粗。 + * Dolphin 文件管理器提供在文件夹前之前优先显示隐藏文件的新选项。 + * 你现在可以使用 DEL 键删除剪贴板弹窗中选中的项目。 + * KDE 现在允许你直接从 Plasma 桌面,向 store.kde.org 提交你制作的图标和主题。 + +#### Wayland 更新 + + * 在 Wayland 会话中,运行程序时光标旁也会展示图标反馈动画。 + * 现在可以从通知中复制文字。 + * 中键单击粘贴功能现在可以在 Wayland 和 XWayland 应用程序中正常使用。 + +请务必牢记,每个版本都有数以百计的 bug 修复和改进。本文仅仅包括了我收集的表面层次的东西。因此,如果想了解应用程序和 Plasma Shell 的变更详情,请访问 GitLab 或 KDE Planet 社区。 + +### 不稳定版本下载 + +您现在可以通过下方的链接下载 KDE neon 的不稳定版本来体验上述全部功能。直接下载 .iso 文件,然后安装测试即可。请务必在发现 bug 后及时反馈。该不稳定版本不适合严肃场合及生产力设备使用。 + +[下载 KDE neon 不稳定版本][5] + +### 结束语 + +KDE Plasma 5.23 每次发布都在改进底层、增加新功能。虽然这个版本不是大更新,但一切优化、改进最终都将累积成稳定性、适应性和更好的用户体验。当然,还有更多的 Wayland 改进(讲真,Wayland 兼容看上去一直都处在“work in progress”(正在进行的工作)的状态 - 就像十年过去了,却还在制作那样。当然这是另一个话题了)。 + +再会。 + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/kde-plasma-5-23/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[imgradeone](https://github.com/imgradeone) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/06/kde-plasma-5-22-release/ +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/New-Kickoff-Options-in-KDE-Plasma-5.23.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Changes-in-kickoff.jpeg +[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/New-power-profiles.jpeg +[5]: https://neon.kde.org/download From b4505408decce46269f2eaaa5afede4b6e8ce91d Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Wed, 25 Aug 2021 19:19:17 +0800 Subject: [PATCH 189/290] translated --- ...e to SSH for remote connection on Linux.md | 183 ------------------ ...e to SSH for remote connection on Linux.md | 173 +++++++++++++++++ 2 files changed, 173 insertions(+), 183 deletions(-) delete mode 100644 sources/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md create mode 100644 translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md diff --git a/sources/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/sources/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md deleted file mode 100644 index 1d43337a11..0000000000 --- a/sources/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (A beginner’s guide to SSH for remote connection on Linux) -[#]: via: (https://opensource.com/article/20/9/ssh) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) - -A beginner’s guide to SSH for remote connection on Linux -====== -Establish connections with remote computers using secure shell. -![woman on laptop sitting at the window][1] - -One of Linux's most appealing features is the ability to skillfully use a computer with nothing but commands entered into the keyboard—and better yet, to be able to do that on computers anywhere in the world. Thanks to OpenSSH, [POSIX][2] users can open a secure shell on any computer they have permission to access and use it from a remote location. It's a daily task for many Linux users, but it can be confusing for someone who has yet to try it. This article explains how to configure two computers for secure shell (SSH) connections, and how to securely connect from one to the other without a password. - -### Terminology - -When discussing more than one computer, it can be confusing to identify one from the other. The IT community has well-established terms to help clarify descriptions of the process of networking computers together. - - * **Service:** A service is software that runs in the background so it can be used by computers other than the one it's installed on. For instance, a web server hosts a web-sharing _service_. The term implies (but does not insist) that it's software without a graphical interface. - * **Host:** A host is any computer. In IT, computers are called a _host_ because technically any computer can host an application that's useful to some other computer. You might not think of your laptop as a "host," but you're likely running some service that's useful to you, your mobile, or some other computer. - * **Local:** The local computer is the one you or some software is using. Every computer refers to itself as `localhost`, for example. - * **Remote:** A remote computer is one you're not physically in front of nor physically using. It's a computer in a _remote_ location. - - - -Now that the terminology is settled, you can begin. - -### Activate SSH on each host - -For two computers to be connected over SSH, each host must have SSH installed. SSH has two components: the command you use on your local machine to start a connection, and a _server_ to accept incoming connection requests. Some computers come with one or both parts of SSH already installed. The commands vary, depending on your system, to verify whether you have both the command and the server installed, so the easiest method is to look for the relevant configuration files: - - -``` -$ file /etc/ssh/ssh_config -/etc/ssh/ssh_config: ASCII text -``` - -Should this return a `No such file or directory` error, then you don't have the SSH command installed. - -Do a similar check for the SSH service (note the `d` in the filename): - - -``` -$ file /etc/ssh/sshd_config -/etc/ssh/sshd_config: ASCII text -``` - -Install one or the other, as needed: - - -``` -`$ sudo dnf install openssh-clients openssh-server` -``` - -On the remote computer, enable the SSH service with systemd: - - -``` -`$ sudo systemctl enable --now sshd` -``` - -Alternately, you can enable the SSH service from within **System Settings** on GNOME or **System Preferences** on macOS. On the GNOME desktop, it's located in the **Sharing** panel: - -![Activate SSH in GNOME System Settings][3] - -(Seth Kenlon, [CC BY-SA 4.0][4]) - -### Start a secure shell - -Now that you've installed and enabled SSH on the remote computer, you can try logging in with a password as a test. To access the remote computer, you must have a user account and a password. - -Your remote user doesn't have to be the same as your local user. You can log in as any user on the remote machine as long as you have that user's password. For instance, I'm `sethkenlon` on my work computer, but I'm `seth` on my personal computer. If I'm on my personal computer (making it my current local machine) and I want to SSH into my work computer, I can do that by identifying myself as `sethkenlon` and using my work password. - -To SSH into the remote computer, you must know its internet protocol (IP) address or its resolvable hostname. To find the remote machine's IP address, use the `ip` command (on the remote computer): - - -``` -$ ip addr show | grep "inet " -inet 127.0.0.1/8 scope host lo -inet 10.1.1.5/27 brd 10.1.1.31 [...] -``` - -If the remote computer doesn't have the `ip` command, try `ifconfig` instead (or even `ipconfig` on Windows). - -The address 127.0.0.1 is a special one and is, in fact, the address of `localhost`. It's a "loopback" address, which your system uses to reach itself. That's not useful when logging into a remote machine, so in this example, the remote computer's correct IP address is 10.1.1.5. In real life, I would know that because my local network uses the 10.1.1.0 subnet. If the remote computer is on a different network, then the IP address could be nearly anything (never 127.0.0.1, though), and some special routing is probably necessary to reach it through various firewalls. Assume your remote computer is on the same network, but if you're interested in reaching computers more remote than your own network, [read my article about opening ports in your firewall][5]. - -If you can ping the remote machine by its IP address _or_ its hostname, and have a login account on it, then you can SSH into it: - - -``` -$ ping -c1 10.1.1.5 -PING 10.1.1.5 (10.1.1.5) 56(84) bytes of data. -64 bytes from 10.1.1.5: icmp_seq=1 ttl=64 time=4.66 ms -$ ping -c1 akiton.local -PING 10.1.1.5 (10.1.1.5) 56(84) bytes of data. -``` - -That's a success. Now use SSH to log in: - - -``` -$ whoami -seth -$ ssh sethkenlon@10.1.1.5 -bash$ whoami -sethkenlon -``` - -The test login works, so now you're ready to activate passwordless login. - -### Create an SSH key - -To log in securely to another computer without a password, you must have an SSH key. You may already have an SSH key, but it doesn't hurt to create a new one. An SSH key begins its life on your local machine. It consists of two components: a private key, which you never share with anyone or anything, and a public one, which you copy onto any remote machine you want to have passwordless access to. - -Some people create one SSH key and use it for everything from remote logins to GitLab authentication. However, I use different keys for different groups of tasks. For instance, I use one key at home to authenticate to local machines, a different key to authenticate to web servers I maintain, a separate one for Git hosts, another for Git repositories I host, and so on. In this example, I'll create a unique key to use on computers within my local area network. - -To create a new SSH key, use the `ssh-keygen` command: - - -``` -`$ ssh-keygen -t ed25519 -f ~/.ssh/lan` -``` - -The `-t` option stands for _type_ and ensures that the encryption used for the key is higher than the default. The `-f` option stands for _file_ and sets the key's file name and location. After running this command, you're left with an SSH private key called `lan` and an SSH public key called `lan.pub`. - -To get the public key over to your remote machine, use the `ssh-copy-id`. For this to work, you must verify that you have SSH access to the remote machine. If you can't log into the remote host with a password, you can't set up passwordless login either: - - -``` -`$ ssh-copy-id -i ~/.ssh/lan.pub sethkenlon@10.1.1.5` -``` - -During this process, you'll be prompted for your login password on the remote host. - -Upon success, try logging in again, but this time using the `-i` option to point the SSH command to the appropriate key (`lan`, in this example): - - -``` -$ ssh -i ~/.ssh/lan sethkenlon@10.1.1.5 -bash$ whoami -sethkenlon -``` - -Repeat this process for all computers on your network, and you'll be able to wander through each host without ever thinking about passwords again. In fact, once you have passwordless authentication set up, you can edit the `/etc/ssh/sshd_config` file to disallow password authentication. This prevents anyone from using SSH to authenticate to a computer unless they have your private key. To do this, open `/etc/ssh/sshd_config` in a text editor with `sudo` permissions and search for the string `PasswordAuthentication`. Change the default line to this: - - -``` -`PasswordAuthentication no` -``` - -Save it and restart the SSH server (or just reboot): - - -``` -$ sudo systemctl restart sshd && echo "OK" -OK -$ -``` - -### Using SSH every day - -OpenSSH changes your view of computing. No longer are you bound to just the computer in front of you. With SSH, you have access to any computer in your house, or servers you have accounts on, and even mobile and Internet of Things devices. Unlocking the power of SSH also unlocks the power of the Linux terminal. If you're not using SSH every day, start now. Get comfortable with it, collect some keys, live more securely, and expand your world. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/9/ssh - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) -[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[3]: https://opensource.com/sites/default/files/uploads/gnome-activate-remote-login.png (Activate SSH in GNOME System Settings) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/article/20/8/open-ports-your-firewall diff --git a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md new file mode 100644 index 0000000000..18734ee12b --- /dev/null +++ b/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: (unigeorge) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (A beginner’s guide to SSH for remote connection on Linux) +[#]: via: (https://opensource.com/article/20/9/ssh) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Linux 远程连接之 SSH 新手指南 +====== +学会使用安全外壳协议连接远程计算机。 +![woman on laptop sitting at the window][1] + +使用 Linux,你只需要在键盘上输入命令,就可以巧妙地使用计算机(甚至这台计算机可以在世界上任何地方),这正是 Linux 最吸引人的特性之一。有了 OpenSSH,[POSIX][2] 用户就可以在有权限连接的计算机上打开安全外壳协议,然后远程使用。这对于许多 Linux 用户来说可能不过是日常任务,但从没操作过的人可能就会感到很困惑。本文介绍了如何为 安全外壳协议secure shell(简称 SSH)连接配置两台计算机,以及如何在没有密码的情况下安全地从一台计算机连接到另一台计算机。 + +### 相关术语 + +在讨论多台计算机时,如何将不同计算机彼此区分开可能会让人头疼。IT 社区拥有完善的术语来描述计算机联网的过程。 + + * **服务service:** + 服务是指在后台运行的软件,因此它不会局限于仅供安装它的计算机使用。例如,Web 服务器通常托管着 Web 共享 _服务_。该术语暗含(但非绝对)它是没有图形界面的软件。 + * **主机host:** + 主机可以是任何计算机。在 IT 中,任何计算机都可以称为 _主机_,因为从技术上讲,任何计算机都可以托管对其他计算机有用的应用程序。你可能不会把自己的笔记本电脑视为 `主机`,但其实上面可能正运行着一些对你、你的手机或其他计算机有用的服务。 + * **本地local:** + 本地计算机是指用户或某些特定软件正在使用的计算机。例如,每台计算机都会把自己称为 `localhost`。 + * **远程remote:** + 远程计算机是指你既没在其面前,也没有在实际使用的计算机,是真正意义上在 _远程_ 位置的计算机。 + +现在术语已经明确好,我们可以开始了。 + +### 在每台主机上激活 SSH + +要通过 SSH 连接两台计算机,每个主机都必须安装 SSH。SSH 有两个组成部分:本地计算机上使用的用于启动连接的命令,以及用于接收连接请求的 _服务器_。有些计算机可能已经安装好了 SSH 的一个或两个部分。验证 SSH 是否完全安装的命令因系统而异,因此最简单的验证方法是查阅相关配置文件: + +``` +$ file /etc/ssh/ssh_config +/etc/ssh/ssh_config: ASCII text +``` + +如果返回 `No such file or directory` 错误,说明没有安装 SSH 命令。 + +SSH 服务的检测与此类似(注意文件名中的 `d`): + +``` +$ file /etc/ssh/sshd_config +/etc/ssh/sshd_config: ASCII text +``` + +根据缺失情况选择安装两个组件: + +``` +$ sudo dnf install openssh-clients openssh-server +``` + +在远程计算机上,使用 systemd 命令启用 SSH 服务: + +``` +$ sudo systemctl enable --now sshd +``` + +你也可以在 GNOME 上的 **系统设置** 或 macOS 上的 **系统首选项** 中启用 SSH 服务。在 GNOME 桌面上,该设置位于 **Sharing** 面板中: + +![在 GNOME 系统设置中激活 SSH][3] + +(Seth Kenlon, [CC BY-SA 4.0][4]) + +### 开启安全外壳协议 + +现在你已经在远程计算机上安装并启用了 SSH,可以尝试使用密码登录作为测试。要访问远程计算机,你需要有用户帐户和密码。 + +远程用户不必与本地用户相同。只要拥有相应用户的密码,你就可以在远程机器上以任何用户的身份登录。例如,我在我的工作计算机上的用户是 `sethkenlon` ,但在我的个人计算机上是 `seth`。如果我正在使用我的个人计算机(即作为当前的本地计算机),并且想通过 SSH 连接到我的工作计算机,我可以通过将自己标识为 `sethkenlon` 并使用我的工作密码来实现连接。 + +要通过 SSH 连接到远程计算机,你必须知道其 因特网协议internet protocol (简称IP) 地址或可解析的主机名。在远程计算机上使用 `ip` 命令可以查看该机器的 IP 地址: + +``` +$ ip addr show | grep "inet " +inet 127.0.0.1/8 scope host lo +inet 10.1.1.5/27 brd 10.1.1.31 [...] +``` + +如果远程计算机没有 `ip` 命令,可以尝试使用 `ifconfig` 命令(甚至可以试试 Windows 上通用的 `ipconfig` 命令)。 + +127.0.0.1 是一个特殊的地址,它实际上是 `localhost` 的地址。这是一个 `环回` 地址,系统使用它来找到自己。这在登录远程计算机时并没有什么用,因此在此示例中,远程计算机的正确 IP 地址为 10.1.1.5。在现实生活中,我的本地网络正在使用 10.1.1.0 子网,进而可得知前述正确的 IP 地址。如果远程计算机在不同的网络上,那么 IP 地址几乎可能是任何地址(但绝不会是 127.0.0.1),并且可能需要一些特殊的路由才能通过各种防火墙到达远程。如果你的远程计算机在同一个网络上,但想要访问比自己的网络更远的计算机,请阅读我之前写的关于 [在防火墙中打开端口][5] 的文章。 + +如果你能通过 IP 地址 _或_ 主机名 ping 到远程机器,并且拥有登录帐户,那么就可以通过 SSH 接入远程机器: + +``` +$ ping -c1 10.1.1.5 +PING 10.1.1.5 (10.1.1.5) 56(84) bytes of data. +64 bytes from 10.1.1.5: icmp_seq=1 ttl=64 time=4.66 ms +$ ping -c1 akiton.local +PING 10.1.1.5 (10.1.1.5) 56(84) bytes of data. +``` + +至此就成功了一小步。再试试使用SSH登录: + +``` +$ whoami +seth +$ ssh sethkenlon@10.1.1.5 +bash$ whoami +sethkenlon +``` + +测试登录有效,下一节会介绍如何激活无密码登录。 + +### 创建 SSH 密钥 + +要在没有密码的情况下安全地登录到另一台计算机,登陆者必须拥有 SSH 密钥。可能你的机器上已经有一个 SSH 密钥,但再多创建一个新密钥也没有什么坏处。SSH 密钥的生命周期是在本地计算机上开始的,它由两部分组成:一个是永远不会与任何人或任何东西共享的私钥,一个是可以复制到任何你想要无密码访问的远程机器上的公钥。 + +有的人可能会创建一个 SSH 密钥,并将其用于从远程登录到 GitLab 身份验证的所有操作,但我会选择对不同的任务组使用不同的密钥。例如,我在家里使用一个密钥对本地机器进行身份验证,使用另一个密钥对我维护的 Web 服务器进行身份验证,再一个单独的密钥用于 Git 主机,以及又一个用于我托管的 Git 存储库,等等。在此示例中,我将只创建一个唯一密钥,以在局域网内的计算机上使用。 + +使用 `ssh-keygen` 命令创建新的 SSH 密钥: + +``` +$ ssh-keygen -t ed25519 -f ~/.ssh/lan +``` + +`-t` 选项代表 _类型_ ,上述代码设置了一个高于默认值的密钥加密级别。`-f` 选项代表 _文件_,指定了密钥的文件名和位置。运行此命令后会生成一个名为 `lan` 的 SSH 私钥和一个名为 `lan.pub` 的 SSH 公钥。 + +使用 `ssh-copy-id` 命令把公钥发送到远程机器上,在此之前要先确保具有远程计算机的 SSH 访问权限。如果你无法使用密码登录远程主机,也就无法设置无密码登录: + +``` +$ ssh-copy-id -i ~/.ssh/lan.pub sethkenlon@10.1.1.5 +``` + +过程中系统会提示你输入远程主机上的登录密码。 + +操作成功后,使用 `-i` 选项将 SSH 命令指向对应的密钥(在本例中为 `lan`)再次尝试登录: + +``` +$ ssh -i ~/.ssh/lan sethkenlon@10.1.1.5 +bash$ whoami +sethkenlon +``` + +对局域网上的所有计算机重复此过程,你就将能够无密码浏览这个局域网上的每台主机。实际上,一旦你设置了无密码认证,你就可以编辑 `/etc/ssh/sshd_config` 文件来禁止密码认证。这有助于防止其他人使用 SSH 对计算机进行身份验证,除非他们拥有你的私钥。要想达到这个效果,可以在有 `sudo` 权限的文本编辑器中打开 `/etc/ssh/sshd_config` 并搜索字符串 `PasswordAuthentication`,将默认行更改为: + +``` +PasswordAuthentication no +``` + +保存并重启 SSH 服务器: + +``` +$ sudo systemctl restart sshd && echo "OK" +OK +$ +``` + +### 日常使用 SSH + +OpenSSH 改变了人们对操作计算机的看法,使用户不再被束缚在面前的计算机上。使用 SSH,你可以访问家中的任何计算机,或者拥有帐户的服务器,甚至是移动和物联网设备。充分利用 SSH 也意味着解锁 Linux 终端的更多用途。如果你还没有习惯使用 SSH,请试一下它吧。试着适应 SSH,创建一些适当的密钥,以此更安全地使用计算机,打破必须与计算机面对面的局限性。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/9/ssh + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[unigeorge](https://github.com/unigeorge) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: https://opensource.com/sites/default/files/uploads/gnome-activate-remote-login.png (Activate SSH in GNOME System Settings) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/article/20/8/open-ports-your-firewall From e0de6a73ef8fb8a49dbf78d69298052b8e41151b Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Wed, 25 Aug 2021 21:51:33 +0800 Subject: [PATCH 190/290] translating --- ...10824 How to include options in your Bash shell scripts.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210824 How to include options in your Bash shell scripts.md b/sources/tech/20210824 How to include options in your Bash shell scripts.md index b4a07aaf7b..d800b4149e 100644 --- a/sources/tech/20210824 How to include options in your Bash shell scripts.md +++ b/sources/tech/20210824 How to include options in your Bash shell scripts.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/option-parsing-bash" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -166,7 +166,7 @@ via: https://opensource.com/article/21/8/option-parsing-bash 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[unigeorge](https://github.com/unigeorge) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d3fdbc9d4b85c8d113337357fb75c90e2f34c019 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Aug 2021 22:30:56 +0800 Subject: [PATCH 191/290] PRF @imgradeone --- ...a 5.23 - New Features and Release Dates.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md index 02803c62bc..3122e75bdf 100644 --- a/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md +++ b/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md @@ -3,15 +3,18 @@ [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" [#]: translator: "imgradeone" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -KDE Plasma 5.23 – 新功能和发布日期 +KDE Plasma 5.23 的新功能和发布日期 ====== -> 我们在这篇文章中总结了 KDE Plasma 5.23(即将到来)的新功能,包括主要特点和下载 / 测试说明。 -KDE Plasma 桌面是当今最流行、最顶级的 Linux 桌面环境,而 KDE Plasma 的热度之高主要得益于其适应能力强、迭代发展迅速,以及性能不断提高。[KDE Plasma 5.22][1] 发布以来,KDE 团队一直忙于为即将到来的 KDE Plasma 5.23 合并更改、测试新功能。目前 KDE Plasma 5.23 仍在开发中,如下是暂定的时间表。 +![](https://img.linux.net.cn/data/attachment/album/202108/25/222802zwhmvv1vwzusevzw.jpg) + +> 我们在这篇文章中总结了 KDE Plasma 5.23(即将到来)的新功能,包括主要特点、下载和 测试说明。 + +KDE Plasma 桌面是当今最流行、最顶级的 Linux 桌面环境,而 KDE Plasma 的热度之高主要得益于其适应能力强、迭代发展迅速,以及性能不断提高。[KDE Plasma 5.22][1] 发布以来,KDE 团队一直忙于为即将到来的 KDE Plasma 5.23 合并更改和测试新功能。目前 KDE Plasma 5.23 仍在开发中,如下是暂定的时间表。 ### KDE Plasma 5.23 发布时间表 @@ -20,18 +23,18 @@ KDE Plasma 5.23 将于 2021 年 10 月 7 日发布,以下是时间表: * Beta 公测 – 2021 年 9 月 16 日 * 最终发布 – 2021 年 10 月 7 日 -正如每个 Plasma 版本更新一样,本次更新也同样承诺对核心 Plasma Shell(Plasma 外壳)、KDE 应用、代码清理、性能改进、数百个 bug 修复、Wayland 优化等方面进行大幅更改。我们在本篇文章中收集了一些重要的功能,让你对即将发布的新功能有基本了解。下面就让我们看看。 +正如每个 Plasma 版本更新一样,本次更新也同样承诺对核心 Plasma Shell 和 KDE 应用进行大幅更改、代码清理、性能改进、数百个 bug 修复、Wayland 优化等。我们在本篇文章中收集了一些重要的功能,让你对即将发布的新功能有基本了解。下面就让我们看看。 ### KDE Plasma 5.23 – 新功能 - * 本次更新基于 Qt 5.15 版本,KDE 框架(KDE Frameworks)5.86 版本。 + * 本次版本更新基于 Qt 5.15 版本,KDE 框架 5.86 版本。 #### Plasma Shell 和应用程序更新 - * 本次 KDE Plasma Kickoff 程序启动器将有大幅更新,包括 bug 修复、减少 RAM 占用、视觉更新、键鼠导航优化。 + * 本次 KDE Plasma 的 Kickoff 程序启动器将有大幅更新,包括 bug 修复、减少内存占用、视觉更新、键鼠导航优化。 * Kickoff 程序启动器菜单允许使用固定按钮固定在桌面上,保持开启状态。 * Kickoff 的标签不会在你滚动时切换(从应用标签到位置标签)。 - * Kickoff 里可以使用 CTRL+F 快捷键直接聚焦到搜索栏。 + * Kickoff 里可以使用 `CTRL+F` 快捷键直接聚焦到搜索栏。 * Kickoff 中的操作按钮(如关机等)可以设置为仅显示图标。 * 现在可以针对所有 Kickoff 项目选择使用网格或列表视图(而不仅仅局限于收藏夹)。 @@ -39,10 +42,9 @@ KDE Plasma 5.23 将于 2021 年 10 月 7 日发布,以下是时间表: ![Kickoff 程序启动器的更改][3] - * 新增基于 QML 的全新概览视图(类似 GNOME 3.38 的工作区视图),用于展示所有打开的窗口(详见此视频)。目前我找不到关于此合并请求(Pull Request)的更多详情,而且这个新视图也很不稳定。 + * 新增基于 QML 的全新概览视图(类似 GNOME 3.38 的工作区视图),用于展示所有打开的窗口(详见如下视频)。目前我找不到关于此合并请求的更多详情,而且这个新视图也很不稳定。 - - +![](https://www.debugpoint.com/blog/wp-content/uploads/2021/08/New-Overview-effect-in-KDE-Plasma-5.23.mp4) _视频作者:KDE 团队_ @@ -53,14 +55,14 @@ _视频作者:KDE 团队_ ![新的“电源配置方案”设置][4] * 如果你有多屏幕设置,包括垂直和横向屏幕,那么登录屏幕现在可以正确同步和对齐。这个功能的需求度很高。 - * 新的 Breeze 微风主题预计会有风格上的更新。 + * 新的 Breeze 主题预计会有风格上的更新。 * 如前序版本一样,预计会有全新的壁纸(目前壁纸大赛仍在进行中)。 * 新增当硬件从笔记本模式切换到平板模式时是否缩放系统托盘图标的设置。 * 你可以选择在登录时的蓝牙状态:总是启用、总是禁用、记住上一次的状态。该状态在版本升级后仍可保留。 * 用户现在可以更改传感器的显示名称。 - * Breeze 风格的滚动条现在比之前版本的更粗。 + * Breeze 风格的滚动条现在比之前版本的更宽。 * Dolphin 文件管理器提供在文件夹前之前优先显示隐藏文件的新选项。 - * 你现在可以使用 DEL 键删除剪贴板弹窗中选中的项目。 + * 你现在可以使用 `DEL` 键删除剪贴板弹窗中选中的项目。 * KDE 现在允许你直接从 Plasma 桌面,向 store.kde.org 提交你制作的图标和主题。 #### Wayland 更新 @@ -73,18 +75,16 @@ _视频作者:KDE 团队_ ### 不稳定版本下载 -您现在可以通过下方的链接下载 KDE neon 的不稳定版本来体验上述全部功能。直接下载 .iso 文件,然后安装测试即可。请务必在发现 bug 后及时反馈。该不稳定版本不适合严肃场合及生产力设备使用。 +你现在可以通过下方的链接下载 KDE neon 的不稳定版本来体验上述全部功能。直接下载 .iso 文件,然后安装测试即可。请务必在发现 bug 后及时反馈。该不稳定版本不适合严肃场合及生产力设备使用。 -[下载 KDE neon 不稳定版本][5] +- [下载 KDE neon 不稳定版本][5] ### 结束语 -KDE Plasma 5.23 每次发布都在改进底层、增加新功能。虽然这个版本不是大更新,但一切优化、改进最终都将累积成稳定性、适应性和更好的用户体验。当然,还有更多的 Wayland 改进(讲真,Wayland 兼容看上去一直都处在“work in progress”(正在进行的工作)的状态 - 就像十年过去了,却还在制作那样。当然这是另一个话题了)。 +KDE Plasma 5.23 每次发布都在改进底层、增加新功能。虽然这个版本不是大更新,但一切优化、改进最终都将累积成稳定性、适应性和更好的用户体验。当然,还有更多的 Wayland 改进(讲真,Wayland 兼容看上去一直都处在“正在进行中”的状态 - 就像十年过去了,却还在制作那样。当然这是另一个话题了)。 再会。 -* * * - -------------------------------------------------------------------------------- via: https://www.debugpoint.com/2021/08/kde-plasma-5-23/ @@ -92,7 +92,7 @@ via: https://www.debugpoint.com/2021/08/kde-plasma-5-23/ 作者:[Arindam][a] 选题:[lujun9972][b] 译者:[imgradeone](https://github.com/imgradeone) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 6cb7c38da3618f2f5b1d9068aaddb06daa3f3a23 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 25 Aug 2021 22:32:04 +0800 Subject: [PATCH 192/290] PUB @imgradeone https://linux.cn/article-13719-1.html --- ...210823 KDE Plasma 5.23 - New Features and Release Dates.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210823 KDE Plasma 5.23 - New Features and Release Dates.md (98%) diff --git a/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/published/20210823 KDE Plasma 5.23 - New Features and Release Dates.md similarity index 98% rename from translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md rename to published/20210823 KDE Plasma 5.23 - New Features and Release Dates.md index 3122e75bdf..43cce08b84 100644 --- a/translated/news/20210823 KDE Plasma 5.23 - New Features and Release Dates.md +++ b/published/20210823 KDE Plasma 5.23 - New Features and Release Dates.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "imgradeone" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13719-1.html" KDE Plasma 5.23 的新功能和发布日期 ====== From e25962c32a9f5ef660e3429a464710d03e86cf12 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Aug 2021 05:02:21 +0800 Subject: [PATCH 193/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210825=20?= =?UTF-8?q?Auto-updating=20podman=20containers=20with=20systemd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210825 Auto-updating podman containers with systemd.md --- ...updating podman containers with systemd.md | 281 ++++++++++++++++++ 1 file changed, 281 insertions(+) create mode 100644 sources/tech/20210825 Auto-updating podman containers with systemd.md diff --git a/sources/tech/20210825 Auto-updating podman containers with systemd.md b/sources/tech/20210825 Auto-updating podman containers with systemd.md new file mode 100644 index 0000000000..6d344fe38d --- /dev/null +++ b/sources/tech/20210825 Auto-updating podman containers with systemd.md @@ -0,0 +1,281 @@ +[#]: subject: "Auto-updating podman containers with systemd" +[#]: via: "https://fedoramagazine.org/auto-updating-podman-containers-with-systemd/" +[#]: author: "Daniel Schier https://fedoramagazine.org/author/danielwtd/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Auto-updating podman containers with systemd +====== + +![][1] + +Auto-Updating containers can be very useful in some cases. Podman provides mechanisms to take care of container updates automatically. This article demonstrates how to use Podman Auto-Updates for your setups. + +### Podman + +Podman is a daemonless Docker replacement that can handle rootfull and rootless containers. It is fully aware of SELinux and Firewalld. Furthermore, it comes pre-installed with Fedora Linux so you can start using it right away. + +If Podman is not installed on your machine, use one of the following commands to install it. Select the appropriate command for your environment. + +``` +# Fedora Workstation / Server / Spins +$ sudo dnf install -y podman + +# Fedora Silverblue, IoT, CoreOS +$ rpm-ostree install podman +``` + +Podman is also available for many other Linux distributions like CentOS, Debian or Ubuntu. Please have a look at the [Podman Install Instructions][2]. + +### Auto-Updating Containers + +Updating the Operating System on a regular basis is somewhat mandatory to get the newest features, bug fixes, and security updates. But what about containers? These are not part of the Operating System. + +#### Why Auto-Updating? + +If you want to update your Operating System, it can be as easy as: + +``` +$ sudo dnf update +``` + +This will not take care of the deployed containers. But why should you take care of these? If you check the content of containers, you will find the application (for example MariaDB in the docker.io/library/mariadb container) and some dependencies, including basic utilities. + +Running updates for containers can be tedious and time-consuming, since you have to: + + 1. pull the new image + 2. stop and remove the running container + 3. start the container with the new image + + + +This procedure must be done for every container. Updating 10 containers can easily end up taking 30-40 commands that must be run. + +Automating these steps will save time and ensure, that everything is up-to-date. + +#### Podman and systemd + +Podman has built-in support for systemd. This means you can start/stop/restart containers via systemd without the need of a separate daemon. The Podman Auto-Update feature requires you to have containers running via systemd. This is the only way to automatically ensure that all desired containers are running properly. Some articles like these for [Bitwarden][3] and [Matrix Server][4] already had a look at this feature. For this article, I will use an even simpler [Apache httpd][5] container. + +First, start the container with the desired settings. + +``` +# Run httpd container with some custom settings +$ sudo podman container run -d -t -p 80:80 --name web -v web-volume:/usr/local/apache2/htdocs/:Z docker.io/library/httpd:2.4 + +# Just a quick check of the container +$ sudo podman container ls +CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES +58e5b07febdf docker.io/library/httpd:2.4 httpd-foreground 4 seconds ago Up 5 seconds ago 0.0.0.0:80->80/tcp web + +# Also check the named volume +$ sudo podman volume ls +DRIVER VOLUME NAME +local web-volume +``` + +Now, set up systemd to handle the deployment. Podman will generated the necessary file. + +``` +# Generate systemd service file +$ sudo podman generate systemd --new --name --files web + +/home/USER/container-web.service +``` + +This will generate the file _container-web service_ in your current directory. Review and edit the file to your liking. Here is the file contents with added newlines and formatting to improve readability. + +``` +# container-web.service + +[Unit] +Description=Podman container-web.service +Documentation=man:podman-generate-systemd(1) +Wants=network.target +After=network-online.target +RequiresMountsFor=%t/containers + +[Service] +Environment=PODMAN_SYSTEMD_UNIT=%n +Restart=on-failure +TimeoutStopSec=70 +ExecStartPre=/bin/rm -f %t/container-web.pid %t/container-web.ctr-id + +ExecStart=/usr/bin/podman container run \ + --conmon-pidfile %t/container-web.pid \ + --cidfile %t/container-web.ctr-id \ + --cgroups=no-conmon \ + --replace \ + -d \ + -t \ + -p 80:80 \ + --name web \ + -v web-volume:/usr/local/apache2/htdocs/ \ + docker.io/library/httpd:2.4 + +ExecStop=/usr/bin/podman container stop \ + --ignore \ + --cidfile %t/container-web.ctr-id \ + -t 10 + +ExecStopPost=/usr/bin/podman container rm \ + --ignore \ + -f \ + --cidfile %t/container-web.ctr-id + +PIDFile=%t/container-web.pid +Type=forking + +[Install] +WantedBy=multi-user.target default.target +``` + +Now, remove the current container, copy the file to the proper systemd directory, and start/enable the service. + +``` +# Remove the temporary container +$ sudo podman container rm -f web + +# Copy the service file +$ sudo cp container-web.service /etc/systemd/system/container-web.service + +# Reload systemd +$ sudo systemctl daemon-reload + +# Enable and start the service +$ sudo systemctl enable --now container-web + +# Another quick check +$ sudo podman container ls +$ sudo systemctl status container-web +``` + +Please be aware, that the container can now only be managed via systemd. Starting and stopping the container with the “podman” command may interfere with systemd. + +Now that the general setup is out of the way, have a look at auto-updating this container. + +#### Manual Auto-Updates + +The first thing to look at is manual auto-updates. Sounds weird? This feature allows you to avoid the 3 steps per container, but you will have full control over the update time and date. This is very useful if you only want to update containers in a maintenance window or on the weekend. + +Edit the _/etc/systemd/system_/_container-web.service_ file and add the label shown below to it. + +``` +--label "io.containers.autoupdate=registry" +``` + +The changed file will have a section appearing like this: + +``` +...snip... + +ExecStart=/usr/bin/podman container run \ + --conmon-pidfile %t/container-web.pid \ + --cidfile %t/container-web.ctr-id \ + --cgroups=no-conmon \ + --replace \ + -d \ + -t \ + -p 80:80 \ + --name web \ + -v web-volume:/usr/local/apache2/htdocs/ \ + --label "io.containers.autoupdate=registry" \ + docker.io/library/httpd:2.4 + +...snip... +``` + +Now reload systemd and restart the container service to apply the changes. + +``` +# Reload systemd +$ sudo systemctl daemon-reload + +# Restart container-web service +$ sudo systemctl restart container-web +``` + +After this setup you can run a simple command to update a running instance to the latest available image for the used tag. In this example case, if a new 2.4 image is available in the registry, Podman will download the image and restart the container automatically with a single command. + +``` +# Update containers +$ sudo podman auto-update +``` + +#### Scheduled Auto-Updates + +Podman also provides a systemd timer unit that enables container updates on a schedule. This can be very useful if you don’t want to handle the updates on your own. If you are running a small home server, this might be the right thing for you, so you are getting the latest updates every week or so. + +Enable the systemd timer for podman as follows: + +``` +# Enable podman auto update timer unit +$ sudo systemctl enable --now podman-auto-update.timer + +Created symlink /etc/systemd/system/timers.target.wants/podman-auto-update.timer → /usr/lib/systemd/system/podman-auto-update.timer. +``` + +Optionally, you can edit the schedule of the timer. By default, the update will run every Monday morning, which is ok for me. Edit the timer module using this command: + +``` +$ sudo systemctl edit podman-auto-update.timer +``` + +This will bring up your default editor. Changing the schedule is beyond the scope of this article but the link to _systemd.timer_ below will help. The Demo section of [Systemd Timers for Scheduling Tasks][6] contains details as well. + +That’s it. Nothing more to do. Podman will now take care of image updates and also prune old images on a schedule. + +### Hints & Tips + +Auto-Updating seems like the perfect solution for container updates, but you should consider some things, before doing so. + + * avoid using the “latest” tag, since it can include major updates + * consider using tags like “2” or “2.4”, if the image provider has them + * test auto-updates beforehand (does the container support updates without additional steps?) + * consider having backups of your Podman volumes, in case something goes sideways + * auto-updates might not be very useful for highly productive setups, where you need full control over the image version in use + * updating a container also restarts the container and prunes the old image + * occasionally check if the updates are being applied + + + +If you take care of the above hints, you should be good to go. + +### Docs & Links + +If you want to learn more about this topic, please check out the links below. There is a lot of useful information in the official documentation and some blogs. + + * + * + * + * + * [Systemd Timers for Scheduling Tasks][6] + + + +### Conclusion + +As you can see, without the use of additional tools, you can easily run auto-updates on Podman containers manually or on a schedule. Scheduling allows unattended updates overnight, and you will get all the latest security updates, features, and bug fixes. Some setups I have tested successfully are: MariaDB, Ghost Blog, WordPress, Gitea, Redis, and PostgreSQL. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/auto-updating-podman-containers-with-systemd/ + +作者:[Daniel Schier][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/danielwtd/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/auto-updating-podman-containers-816x345.jpg +[2]: https://podman.io/getting-started/installation +[3]: https://fedoramagazine.org/manage-your-passwords-with-bitwarden-and-podman/ +[4]: https://fedoramagazine.org/deploy-your-own-matrix-server-on-fedora-coreos/ +[5]: https://hub.docker.com/_/httpd +[6]: https://fedoramagazine.org/systemd-timers-for-scheduling-tasks/ From 1b3fddaf48adef6f74c7a7e67abc3a784d60192d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Aug 2021 05:04:52 +0800 Subject: [PATCH 194/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210825=20?= =?UTF-8?q?Use=20this=20open=20source=20tool=20for=20automated=20unit=20te?= =?UTF-8?q?sting?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210825 Use this open source tool for automated unit testing.md --- ... source tool for automated unit testing.md | 217 ++++++++++++++++++ 1 file changed, 217 insertions(+) create mode 100644 sources/tech/20210825 Use this open source tool for automated unit testing.md diff --git a/sources/tech/20210825 Use this open source tool for automated unit testing.md b/sources/tech/20210825 Use this open source tool for automated unit testing.md new file mode 100644 index 0000000000..83c60fba66 --- /dev/null +++ b/sources/tech/20210825 Use this open source tool for automated unit testing.md @@ -0,0 +1,217 @@ +[#]: subject: "Use this open source tool for automated unit testing" +[#]: via: "https://opensource.com/article/21/8/tackle-test" +[#]: author: "Saurabh Sinha https://opensource.com/users/saurabhsinha" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use this open source tool for automated unit testing +====== +Tackle-test is an automatic generator of unit test cases for Java +applications. +![Looking at a map][1] + +Modernizing and transforming legacy applications is a challenging activity that involves several tasks. One of the key tasks is validating that the modernized application preserves the functionality of the legacy application. Unfortunately, this can be tedious and hard to perform. Legacy applications often do not have automated test cases, or, if available, test coverage might be inadequate, both in general and specifically for covering modernization-related changes. A poorly maintained test suite might also contain many obsolete tests (accumulated over time as the application evolved). Therefore, validation is mainly done manually in most modernization projects—it is a process that is time-consuming and may not test the application sufficiently. In some reported case studies, testing accounted for approximately 70% to 80% of the time spent on modernization projects [1]. Tackle-test is an automated testing tool designed to address this challenge. + +### Overview of Tackle-test + +At its core, Tackle-test is an automatic generator of unit test cases for Java applications. It can generate tests with assertions, which makes the tool especially useful in modernization projects, where application transformation is typically functionality-preserving—thus, useful test assertions can be created by observing runtime states of legacy application versions. This can make differential testing between the legacy and modernized application versions much more effective; test cases without assertions would detect only those differences where the modernized version crashes on a test input on which the legacy version executes successfully. The assertions that Tackle-test generates capture created object values after each code statement, as illustrated in the next section. + +Tackle-test uses a novel test-generation technique that applies combinatorial test design (CTD)—also called combinatorial testing or combinatorial interaction testing [2]—to method interfaces, with the goal of performing rigorous testing of methods with “complex interfaces,” where interface complexity is characterized over the space of parameter-type combinations that a method can be invoked with. CTD is a well-known, effective, and efficient test-design technique. It typically requires a manual definition of the test space in the form of a CTD model, consisting of a set of parameters, their respective values, and constraints on the value combinations. A valid test in the test space is defined as an assignment of one value to each parameter that satisfies the constraints. A CTD algorithm automatically constructs a subset of the set of valid tests to cover all legitimate value combinations of every _t_ parameters, where *t *is usually a user input. + +Although CTD is typically applied to program inputs in a black-box manner and the CTD model is created manually, Tackle-test automatically builds a parameter-type-based white-box CTD model for each method under test. It then generates a test plan consisting of coverage goals from the model and synthesizes test sequences for covering rows of the test plan. The test plan can be generated at different, user-configurable interaction levels, where higher levels result in the generation of more test cases and more thorough testing, but at the cost of increased test-generation time. + +Tackle-test also leverages some existing and commonly used test-generation strategies to maximize code coverage. Specifically, the strategies include feedback-driven random test generation (via the [Randoop][2] open source tool) and evolutionary and constraint-based test generation (via the [EvoSuite][3] open source tool). These tools compute coverage goals in code elements, such as methods, statements, and branches. + +![tackle-test components][4] + +Figure 1: High-level components of Tackle-test. +(Saurabh Sinha and Rachel Tzoref-Brill, [CC BY-SA 4.0][5]) + +Figure 1 presents a high-level view of the main components of Tackle-test. It consists of a Java-based core test generator that generates CTD-driven tests and a Python-based command-line interface (CLI), which is the primary mechanism for user interaction. + +### Getting started with the tool + +Tackle-test is released as open source under the Konveyor organization (). To get started, clone the repo, and follow the instructions for installing and running the tool provided in the repo readme. There are two installation options: using docker/docker-compose or a local installation. + +The CLI provides two main commands: `generate` for generating JUnit test cases and `execute` for executing them. To verify your installation completed successfully, use the sample `irs` application located in the test/data folder to run these two commands. + +The `generate` command is accompanied by a subcommand specifying the test-generation strategy (`ctd-amplified`, `randoop`, or `evosuite`) and creates JUnit test cases. By default, diff assertions are added to the generated test cases. Let’s run the generate command on the `irs` sample, using the CTD-guided strategy. + + +``` +$ tkltest --config-file ./test/data/irs/tkltest_config.toml --verbose generate ctd-amplified +[tkltest|18:00:11.171] Loading config file ./test/data/irs/tkltest_config.toml +[tkltest|18:00:11.175] Computing coverage goals using CTD +* CTD interaction level: 1 +* Total number of classes: 5 +* Targeting 5 classes +* Created a total of 20 test combinations for 20 target methods of 5 target classes +[tkltest|18:00:12.816] Computing test plans with CTD took 1.64 seconds +[tkltest|18:00:12.816] Generating basic block test sequences using CombinedTestGenerator +[tkltest|18:00:12.816] Test generator output will be written to irs_CombinedTestGenerator_output.log +[tkltest|18:01:02.693] Generating basic block test sequences with CombinedTestGenerator took 49.88 seconds +[tkltest|18:01:02.693] Extending sequences to reach coverage goals and generating junit tests +* === total CTD test-plan coverage rate: 90.00% (18/20) +* Added a total of 64 diff assertions across all sequences +* wrote summary file for generation of CTD-amplified tests (JSON) +* wrote 5 test class files to "irs-ctd-amplified-tests/monolithic" with 18 total test methods +* wrote CTD test-plan coverage report (JSON) +[tkltest|18:01:06.694] JUnit tests are saved in ./irs-ctd-amplified-tests +[tkltest|18:01:06.695] Extending test sequences and writing junit tests took 4.0 seconds +[tkltest|18:01:06.700] CTD coverage report is saved in ./irs-tkltest-reports/ctd report/ctdsummary.html +[tkltest|18:01:06.743] Generated Ant build file ./irs-ctd-amplified-tests/build.xml +[tkltest|18:01:06.743] Generated Maven build file ./irs-ctd-amplified-tests/pom.xml +``` + +Test generation takes a couple of minutes on the `irs` sample. By default, the tool spends 10 seconds per class on initial test sequence generation. However, the overall runtime can be longer due to additional steps, as explained in the following section. Note that the time limit per class option is configurable and that for large applications, test generation might take several hours. Therefore, it is a good practice to start with a limited scope of a few classes to get a feel for the tool before performing test generation on all application classes. + +When test generation completes, the test cases are written to a designated directory named `irs-ctd-amplified-tests` as output by the tool, along with Maven and Ant scripts for compiling and executing them. The test cases are in a subdirectory named `monolith`. A separate test file is created for each application class. Each such file contains multiple test approaches for testing the public methods of the class with different combinations of parameter types, as specified by the CTD test plan. A CTD coverage report is created that summarizes the test plan parts for which unit tests could be generated in a directory named `irs-tkltest-reports`. In the above output, we can see that Tackle-test created test cases for 18 of the 20 test-plan rows, resulting in 90% test-plan coverage. + +![amplified tests][6] + +(Saurabh Sinha and Rachel Tzoref-Brill, [CC BY-SA 4.0][5]) + +Now let’s look at one of the generated test methods for the `irs.IRS` class. + + +``` +  @Test     +   public void test1() throws Throwable { +       irs.IRS iRS0 = new irs.IRS(); +       java.util.ArrayList<irs.Salary> salaryList1 = new java.util.ArrayList<irs.Salary>();                  +       irs.Salary salary5 = new irs.Salary(0, 0, (double)100); +       assertEquals(0, ((irs.Salary) salary5).getEmployerId()); +       assertEquals(0, ((irs.Salary) salary5).getEmployeeId()); +       assertEquals(100.0, (double) ((irs.Salary) salary5).getSalary(), 1.0E-4); +       boolean boolean6 = salaryList1.add(salary5); +        assertEquals(true, boolean6); +       iRS0.setSalaryList((java.util.List<irs.Salary>)salaryList1); +    } +``` + +This test method intends to test the `setSalaryList` method of IRS, which receives a list of `irs.Salary` objects as its input. We can see that statements of the test case are followed by calls to the `assertEquals` method, comparing the values of generated objects to the values recorded during the generation of this test. When the test executes again, e.g., on the modernized version of the application, if any value differs from the recorded one, an assertion failure would occur, potentially indicating broken code that did not preserve the functionality of the legacy application. + +Next, we will compile and run the generated test cases using the CLI `execute`command. We note that these are standard JUnit test cases that can be run in an IDE or using any JUnit test runner; they can also be integrated into a CI pipeline. When executed with the CLI, JUnit reports are generated and optionally also code-coverage reports (created using [JaCoCo][7]). + + +``` +$ tkltest --config-file ./test/data/irs/tkltest_config.toml --verbose execute +[tkltest|18:12:46.446] Loading config file ./test/data/irs/tkltest_config.toml +[tkltest|18:12:46.457] Total test classes: 5 +[tkltest|18:12:46.457] Compiling and running tests in ./irs-ctd-amplified-tests +Buildfile: ./irs-ctd-amplified-tests/build.xml + +delete-classes: + +compile-classes_monolithic: +      [javac] Compiling 5 source files + +execute-tests_monolithic: +      [mkdir] Created dir: ./irs-tkltest-reports/junit-reports/monolithic +      [mkdir] Created dir: ./irs-tkltest-reports/junit-reports/monolithic/raw +      [mkdir] Created dir: ./irs-tkltest-reports/junit-reports/monolithic/html +[jacoco:coverage] Enhancing junit with coverage + +... + +BUILD SUCCESSFUL +Total time: 2 seconds +[tkltest|18:12:49.772] JUnit reports are saved in ./irs-tkltest-reports/junit-reports +[tkltest|18:12:49.773] Jacoco code coverage reports are saved in ./irs-tkltest-reports/jacoco-reports +``` + +The Ant script executes the unit tests by default, but the user can configure the tool to use Maven instead. Gradle will also be supported soon. + +Looking at the JUnit report, located in `irs-tkltest-reports`, we can see that all JUnit test methods passed. This is expected because we executed them on the same version of the application on which they were generated. + +![junit report][8] + +(Saurabh Sinha and Rachel Tzoref-Brill, [CC BY-SA 4.0][5]) + +From the JaCoCo code-coverage report, also located in `irs-tkltest-reports`, we can see that CTD-guided test generation achieved overall 71% statement coverage and 94% branch coverage on the irs sample. We can also drill down to the class and method levels to see their coverage rates. The missing coverage is the result of test-plan rows for which the test generator was unable to generate a passing sequence. Increasing the test-generation time limit per class can increase the coverage rate. + +![jacoco][9] + +(Saurabh Sinha and Rachel Tzoref-Brill, [CC BY-SA 4.0][5]) + +### CTD-guided test generation + +Figure 2 illustrates the test-generation flow for CTD-guided test generation, implemented in the core test-generation engine of Tackle-test. The input to the test-generation flow is a specification of (1) the application classes, (2) the library dependencies of the application, and (3) optionally, the set of application classes to target for test generation (if unspecified, all application classes are targeted). This specification is provided via a [TOML][10] configuration file. The output from the flow consists of: (1) JUnit test cases (with or without assertions), (2) Maven and Ant build files, and (3) JSON files containing a summary of test generation and CTD test-plan coverage. + +![ctd-guided test generation][11] + +Figure 2: The process for CTD-guided test generation. +(Saurabh Sinha and Rachel Tzoref-Brill, [CC BY-SA 4.0][5]) + +The flow starts with the generation of the CTD test plan. This involves creating a CTD model for each public method of the targeted classes. The CTD model for each method captures all possible concrete types for every formal parameter of the method, including elements that can be added to collection/map/array parameter types. Tackle-test incorporates lightweight static analysis to deduce the feasible concrete types for each parameter of each method. + +Next, a CTD test plan is generated automatically from the model at a given (user-configurable) interaction level. Each row in the test plan describes a specific combination of concrete parameter types with which the method should be invoked. By default, the interaction level is set to one, which results in one-way testing: each possible concrete parameter type appears in at least one row of the test plan. Setting the Interaction level to two, a.k.a. pairwise testing, would result in a test plan that includes every pair of concrete types for each pair of method parameters in at least one of its rows. + +The CTD test plan provides a set of coverage goals for which test sequences need to be synthesized. Tackle-test does this in two steps. In the first step, it uses Randoop and/or EvoSuite (the user can configure which tools are used) to create base test sequences. The base test sequences are analyzed to generate sequence pools at method and class levels from which the test-generation engine samples sequences to put together a covering sequence for each test-plan row. If a covering sequence is successfully created, the engine executes it to ensure that the sequence is valid in the sense that it does not cause the application to crash. During this execution, runtime states in terms of objects created are also recorded to be used later for assertion generation. Failing sequences are discarded. The engine adds assertions to passing sequences if the user specifies the assertion option. Finally, the engine exports the sequences, grouped by classes, to JUnit class files. The engine also creates Ant `build.xml` and Maven `pom.xml` files, which can be used if needed for running the generated test cases. + +### Other tool features + +Tackle-test is highly configurable and provides several configuration options using which the user can tailor the behavior of the tool: for example, which classes to generate tests for, which tools to use for test generation, how much time to spend on test generation, whether to add assertions to test cases, what interaction level to use for generating CTD test plans, how many executions to perform for extended test sequences, etc. + +### Effectiveness of different test-generation strategies + +Tackle-test has been evaluated on several open source Java applications and is currently being applied to enterprise-grade Java applications as well. + +![instruction coverage results][12] + +Figure 3: Instruction coverage achieved by test cases generated using different strategies and interaction levels for two small open-source Java applications taken from the[ SF110 benchmark][13]. +(Saurabh Sinha and Rachel Tzoref-Brill, [CC BY-SA 4.0][5]) + +Figure 3 presents data about statement coverage achieved by tests generated using different testing strategies on two small open source Java applications. The applications were taken from the [SF110 benchmark][13], a large corpus of open source Java applications created to facilitate empirical studies of automated testing techniques. One of the applications, `jni-inchi`, consists of 24 classes and 74 methods; the other, `gaj`, consists of 14 classes and 17 methods. The box plot shows that targeting CTD test-plan rows by itself can achieve good statement coverage and, compared to test suites of the same size as the CTD-guided test suite sampled out of Randoop- and EvoSuite-generated test cases, the CTD-guided test suite achieves higher statement coverage, making it more efficient. + +A large-scale evaluation of Tackle-test, using more applications from the SF110 benchmark and some proprietary enterprise Java applications, is currently being conducted. + +If you prefer to see a video demonstration, you can watch it [here][14]. + +We encourage you to try out the tool and provide feedback to help us improve it by submitting a pull request. We also invite you to help improve the tool by contributing to the project. + +#### Migrate to Kubernetes with the Konveyor community + +Tackle-test is part of the Konveyor community. This community is helping others modernize and migrate their applications to the hybrid cloud by building tools, identifying patterns, and providing advice on breaking down monoliths, adopting containers, and embracing Kubernetes. + +This community includes open source tools that migrate virtual machines to KubeVirt, Cloud Foundry, or Docker containers to Kubernetes, or namespaces between Kubernetes clusters. These are a few of the use cases we solve for. + +For updates on these tools and invites to meetups where practitioners show how they moved to Kubernetes, [join the community][15]. + +#### References + +[1] COBOL to Java and Newspapers Still Get Delivered, , 2018. + +[2] D. R. Kuhn, R. N. Kacker, and Y. Lei. Introduction to Combinatorial Testing. Chapman & Hall/CRC, 2013. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/tackle-test + +作者:[Saurabh Sinha][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/saurabhsinha +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tips_map_guide_ebook_help_troubleshooting_lightbulb_520.png?itok=L0BQHgjr (Looking at a map) +[2]: https://randoop.github.io/randoop/ +[3]: https://www.evosuite.org/ +[4]: https://opensource.com/sites/default/files/1tackle-test-components.png +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/2amplified-tests.png (amplified tests) +[7]: https://www.eclemma.org/jacoco/ +[8]: https://opensource.com/sites/default/files/3junit-report.png (junit report) +[9]: https://opensource.com/sites/default/files/4jacoco.png (jacoco) +[10]: https://toml.io/en/ +[11]: https://opensource.com/sites/default/files/5ctd-guided-test-generation.png (ctd-guided test generation) +[12]: https://opensource.com/sites/default/files/6instructioncoverage.png (instruction coverage results) +[13]: https://www.evosuite.org/experimental-data/sf110/ +[14]: https://youtu.be/qThqTFh2PM4 +[15]: https://www.konveyor.io/ From 340e6b68937bde598b0465f3d67950842f16fd7b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Aug 2021 05:05:08 +0800 Subject: [PATCH 195/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210825=20?= =?UTF-8?q?10=20steps=20to=20more=20open,=20focused,=20and=20energizing=20?= =?UTF-8?q?meetings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210825 10 steps to more open, focused, and energizing meetings.md --- ... open, focused, and energizing meetings.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210825 10 steps to more open, focused, and energizing meetings.md diff --git a/sources/tech/20210825 10 steps to more open, focused, and energizing meetings.md b/sources/tech/20210825 10 steps to more open, focused, and energizing meetings.md new file mode 100644 index 0000000000..0a5c920d8c --- /dev/null +++ b/sources/tech/20210825 10 steps to more open, focused, and energizing meetings.md @@ -0,0 +1,99 @@ +[#]: subject: "10 steps to more open, focused, and energizing meetings" +[#]: via: "https://opensource.com/open-organization/21/8/10-steps-better-meetings" +[#]: author: "Catherine Louis https://opensource.com/users/catherinelouis" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +10 steps to more open, focused, and energizing meetings +====== +Constructing your meetings with open organization principles in mind can +help you avoid wasted time, effort, and talent. +![Open lightbulbs.][1] + +The negative impact of poorly run meetings is [huge][2]. So leaders face a challenge: how do we turn poorly run meetings—which have a negative impact on team creativity, success, and even cause stress and anxiety—to meetings with positive outcomes? But to make the situation even tougher, we now find most meetings are being held remotely, online, where attendees' cameras are off and you're likely staring at a green dot at the top of your screen. That makes holding genuinely productive and useful meetings an even greater challenge. + +Thinking about your meetings differently—and constructing your meetings with [open organization principles][3] in mind—can help turn your next remote meeting into an energizing experience with positive outcomes. Here are some guidelines to get you started. I'll explain steps you can take as you _prepare for_, _hold_, and _follow up from_ your meetings. + +### Preparing for your meeting: + +#### 1\. Protect everyone's time + +First, you'll need to reflect on the reason you've calling a meeting in the first place. As a meeting leader, you must recognize your role as the person who could kill productivity and destroy the ability for attendees to be mindfully present. By holding a meeting and asking people to be there, you are removing hours from people's days, exhausting the time they have to spend—and time is a non-replenishable resource. So imagine instead that you are a _guardian_ of people's time. You need to treat their time with respect. Consider that the only reason _why_ you're holding a meeting in the first place is to _keep from_ wasting time*.* For example, if you see a group thrashing over a decision again and again because the wrong people were involved in an email chain, instead suggest holding a half-hour meeting to reach a consensus, thereby saving everyone's time in the end. One way to think about this: Treat employees the same way you'd treat your customers. You would never want a customer to feel they were invited to a meeting that was a waste of their time. Adopting this mindset, you'll instantly become sensitive to scheduling meetings over someone's lunch hour. If you commit to becoming a time saver, you'll become more intentional in _all aspects_ of meeting planning, executing, and closing. And you will get better and better at this as a result. + +#### 2\. Use tools to be more inclusive + +Like all meetings, remote meetings can contain their moments of silence, as people think, reflect, or take notes. But don't take silence as an indication of understanding, agreement, or even presence. You want to hear input and feedback from everyone at the meeting—not just those who are most comfortable or chatty. Familiarize yourself with some of the growing list of fantastic apps (Mentimeter, Klaxoon, Sli.do, Meeting pulse, Poll Everywhere, and other [open source tools][4]) designed to help attendees collaborate during meetings, even vote and reach a consensus. Make use of video when you can. Use your chat room technology for attendees to share if they missed something or raise a hand to speak, or even as a second channel of communication. Remote meeting tools are multiplying at an exponential rate; bone up on new ones to keep meetings interesting and help increase engagement. + +#### 3\. Hone your invitation list + +When preparing invitations to your meeting, keep the list as small as possible. The larger the group, the more time you'll need, and the quality of a meeting tends to decrease as the size of the meeting increases. One way to make sure you have the right people: instead of sending out topics for discussion, send a preliminary note to participants you think could add value, and solicit questions. Those who answer the preliminary questions will be those who need to attend, and these are the people who you need to invite. + +Treat employees the same way you'd treat your customers. You would never want a customer to feel they were invited to a meeting that was a waste of their time. + +#### 4\. Time box everything, and adapt + +With our shorter attention spans, [stop defaulting to hour long meetings][5]. Don't hesitate to schedule even just 15 minutes for a meeting. Reducing the meeting length creates positive pressure; [research shows][6] that groups operating under a level of time pressure (using time boxing) perform more optimally due to increased focus. Imagine that after five minutes of one person speaking, everyone else in the meeting will begin to multitask. This means that as a facilitator you have just five minutes to present a concept. Use just these five minutes, then ask for connections: Who knows what about this topic? You'll learn there are experts in the room. Time box this activity, too, to five minutes. Next, break into small groups to discuss concrete practices and steps. Time box this for just 10 minutes, then share how far folks got in that shortened time box. Iterate and adjust for the next time box, and reserve yet another one for takeaways and conclusions. + +#### 5\. Make your agenda transparent + +Make meeting details as transparent as possible to everyone who's invited. The meeting agenda, for example, should have a desired outcome in the subject line. The opening line of the agenda should state clearly why the meeting needs to be held. For example: + +"The choice of go-forward strategy for Product A has been thrashing for two weeks with an estimate of 60 or more hours of back and forth discussion. This meeting is being called with the people involved to agree on our go-forward plan." + +Agenda details should outline the time boxes you've outlined to accomplish the goal. Logistics are critical: if you wish cameras to be on, ask for cameras to be on. And even though you've thought thoroughly about your invitee list, note that you may still have invited someone who doesn't need to be there. Provide an opt-out opportunity. For example: + +"If you feel you cannot contribute to this meeting and someone else should, please reach out to me with their contact information." + +### Conducting your meeting: + +#### 6\. Be punctual + +Start and end the meeting on time! Arrive early to check the technology. As the meeting leader, recognize that your mood will set the tone for your attendees. So consider beginning the meeting with appreciations, recognitions, and statements of gratitude. Beginning a meeting on a positive note establishes a positive mood and promotes creativity, active listening, and participation. You'll find your meeting will be more constructive as a result. + +Like all meetings, remote meetings can contain their moments of silence, as people think, reflect, or take notes. But don't take silence as an indication of understanding, agreement, or even presence. + +#### 7\. Engineer your meeting's culture + +In the meeting itself, use Strategyzer's [Culture map][7] to create the culture you want for the meeting itself. You do this by agreeing the desired outcome of the meeting, asking what can enable or block attendees from achieving this outcome, and identifying the behaviors the group must exhibit to make this happen. Silently brainstorm with post-its on a jamboard, then have folks actively share what can make this meeting successful for all. + +#### 8\. Invite collaboration + +In openly run meetings, the best ideas should emerge. But this can only happen with your help. Recognize your role as a meeting leader who must remain neutral and encourage collaboration. Look for those who aren't participating and provide tools (or encouragement) that will help them get involved. For example, instead of verbal brainstorming, do a silent and anonymous brainstorm using stickies in a jamboard. You'll begin to see participation. Stick to the agenda and its time boxes, and watch for folks that talk over others:  + +"Sara, Fred wasn't finished with his thought. Please let him finish." + +### Closing and and reviewing your meeting: + +#### 9\. Write it down + +Openly run meetings should result in openly recorded outcomes. Be sure your agenda includes time for the group to clarify takeaways, assign action items, and identify stakeholders who'll be responsible for completing work. + +#### 10\. Close the loop + +Finally, review the meeting with a retrospective. Ask for feedback on the meeting itself. What worked in your facilitation? What was lacking? Does anyone have ideas for ways to improve the next meeting? Were any questions unanswered? Any epiphanies reached? Taking in this feedback, actually coming up with a new experiment for the next meeting to address the improvements. Attendees at your next meeting will be more than grateful, and in the long run you'll improve your meeting facilitation skills. + +The path to collaboration is usually paved with the best intentions. We all know too well that this... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/8/10-steps-better-meetings + +作者:[Catherine Louis][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/catherinelouis +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc_520x292_openlightbulbs.png?itok=nrv9hgnH (Open lightbulbs.) +[2]: https://ideas.ted.com/the-economic-impact-of-bad-meetings/ +[3]: https://theopenorganization.org/definition +[4]: https://opensource.com/article/20/3/open-source-working-home +[5]: https://opensource.com/open-organization/18/3/open-approaches-meetings +[6]: https://learn.filtered.com/hubfs/Definitive%20100%20Most%20Useful%20Productivity%20Hacks.pdf +[7]: https://www.strategyzer.com/blog/posts/2015/10/13/the-culture-map-a-systematic-intentional-tool-for-designing-great-company-culture From 0281294211dc0211cc6ee3b967d8489b5a17c361 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Aug 2021 05:05:36 +0800 Subject: [PATCH 196/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210826=20?= =?UTF-8?q?Elementary=20OS=206=20Odin=20Review=20=E2=80=93=20Late=20Arriva?= =?UTF-8?q?l=20but=20a=20Solid=20One?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md --- ...n Review - Late Arrival but a Solid One.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md diff --git a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md new file mode 100644 index 0000000000..9e82b30726 --- /dev/null +++ b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -0,0 +1,87 @@ +[#]: subject: "Elementary OS 6 Odin Review – Late Arrival but a Solid One" +[#]: via: "https://www.debugpoint.com/2021/08/elementary-os-6-odin-review/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Elementary OS 6 Odin Review – Late Arrival but a Solid One +====== +We review the elementary OS 6 Odin and give you some glimpse on how it +went for our test drive. +For almost two years, the elementary OS fans was waiting for elementary OS 6 Odin release. Because, the earlier version elementary OS 5.1 was too old in terms of Kernel, packages in 2021. It was based on Ubuntu 18.04 LTS. So, the users was waiting to get a flavor based on Ubuntu 20.04 LTS – which is already in 2nd year, and we have another LTS coming up. + +You get the idea. Sometimes the wait was too long, probably some users jumped ship to other distributions.  + +However, the release [was done in August][1], and it was a hit among the users and fanboys. + +So, I ran elementary OS 6 Odin for a week on an old hardware (I know newer hardware would do just fine), and this is the review. + +![elementary OS 6 ODIN Desktop][2] + +### Elementary OS 6 Odin review + +Test Hardware + + * CPU – Intel Core i3 with RAM 4GB + * Disk – SSD + * Graphics – Nvidia GeForce (340) + + + +#### Installation + +In this release, the team made some usability changes to the elementary Installer, which is a homegrown tool. It reduced the steps require to begin the installation. Although it still depends on gparted for partition (which is a great tool itself anyway). + +The installation took around 10 minutes in above hardware and went without any error. Post installation, the Grub is updated properly and no surprises there. It was a triple boot system with Legacy Bios. + +#### First Impression + +If you are new to elementary OS or Pantheon desktop, and coming from traditional menu-driven desktops, then you might need a day or two to be familiar to the way this desktop is set up. Otherwise, if you are a long time elementary user, you feel the same with some performance benefits and looks. + +Couple of [new features of elementary OS 6][3] you might notice as they are visible. The accent color, native dark mode, a setup of nice wallpapers. + +[][4] + +SEE ALSO:   elementary OS 6 Odin: New Features and Release Date + +#### Stability and performance + +I have used elementary OS Odin for more than a week. After using it daily, I must say it is very stable. No sudden crash or surprises. Additional applications (those installed separately via apt) are working well with no loss to performance.  + +In almost idle state, the CPU usage is around 5% to 10% and memory is consumed around 900 MB. The CPU/Memory mostly consumed by Gala – Pantheon’s window manager, Wingpanel and AppCenter. + +![System performance of elementary OS 6][5] + +Considering the look and feel it provides, I guess the above numbers are well justified. But remember, if you open more applications such as LibreOffice, Chrome, or Kdenlive for example, it will definitely consume more resources. + +#### Applications and AppCenter + +The application list of elementary OS is well curated and almost all types of apps are available from AppCenter including the Flatpak apps. However, elementary doesn’t include some important applications pre-loaded in default install. For example, Firefox, LibreOffice, Torrent client, disk formatter, photo editor – some important ones you need to manually install after a fresh installation. This is one of the improvement areas for the team, I feel. + +### Final Notes + +I have encountered one bug multiple times in my week long test run. The Wi-Fi was disconnecting randomly sometimes. But that is totally on Ubuntu 20.04 which has weird Wi-Fi problems over the years. Apart from that, it is a very stable and good Linux distribution. I wish there is a rolling-release of elementary, that would have been awesome. That said, it’s a recommended distro for all, specially for those coming from macOS. + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/elementary-os-6-odin-review/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://blog.elementary.io/elementary-os-6-odin-released/ +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpeg +[3]: https://www.debugpoint.com/2021/08/elementary-os-6/ +[4]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/ +[5]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/System-performance-of-elementary-OS-6.jpeg From 6e0dcdfa1671ae7bc5106864409d1a4a44d2dd41 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 26 Aug 2021 05:05:54 +0800 Subject: [PATCH 197/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210825=20?= =?UTF-8?q?When=20Linus=20Torvalds=20Was=20Wrong=20About=20Linux=20(And=20?= =?UTF-8?q?I=20am=20Happy=20He=20Was=20Wrong)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md --- ...out Linux (And I am Happy He Was Wrong).md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/news/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md diff --git a/sources/news/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md b/sources/news/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md new file mode 100644 index 0000000000..08548e553e --- /dev/null +++ b/sources/news/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md @@ -0,0 +1,67 @@ +[#]: subject: "When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong)" +[#]: via: "https://news.itsfoss.com/trovalds-linux-announcement/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong) +====== + +Linus Torvalds, the creator of Linux kernel and Git, needs no introduction. + +A shy geek who does not talk much in public but prefers mailing lists. Loves codes and gadgets more than other things. Prefers working from home than spending time in shiny offices. + +Torvalds expresses his opinion on Linux related things quite vocally. We can’t forget the ‘finger to Nvidia’ moment that forced Nvidia to improve Linux support (it was way worse back in 2012). + +Generally, I agree with his opinion and most often his views have turned out to be correct. Except in this one case (and that’s a good thing). + +### Torvalds’ “incorrect prediction” on Linux + +30 years ago, Torvalds announced the Linux project. He was a university student at that time and wanted to create a UNIX-like operating system because UNIX itself was too costly. + +While announcing the project, Torvalds mentioned that the project was just a hobby and it won’t be big and professional like GNU. + +> I’m doing a (free) operating system (just a hobby, won’t be big and professional like gnu) for 386(486) AT clones. + +Linus Torvalds while announcing the Linux project + +Little did Torvalds knew that his ‘hobby’ will become the backbone of today’s IT world and the face of a successful open source project. + +Here’s the complete message he sent: + +Hello everybody out there using minix – + +I’ve currently ported bash(1.08) and gcc(1.40), and things seem to work. This implies that I’ll get something practical within a few months, and I’d like to know what features most people would want. Any suggestions are welcome, but I won’t promise I’ll implement them 🙂 + +Linus ([torv…@kruuna.helsinki.fi][1]) + +PS. Yes – it’s free of any minix code, and it has a multi-threaded fs. It is NOT protable (uses 386 task switching etc), and it probably never will support anything other than AT-harddisks, as that’s all I have :-(. + +That was on 25th August 1991. Torvalds announced the Linux project and then on 5th October 1991, he released the first Linux kernel. The [interesting fact about Linux][2] is that it was not open source initially. It was released under GPL license a year later. + +The Linux Kernel is 30 years old today. Happy 30th to this amazing open source project. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/trovalds-linux-announcement/ + +作者:[Abhishek][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/root/ +[b]: https://github.com/lujun9972 +[1]: https://groups.google.com/ +[2]: https://itsfoss.com/facts-linux-kernel/ From fba5a67ecb9f3e31d1d621ee7a3f1167fec6a224 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 26 Aug 2021 08:23:44 +0800 Subject: [PATCH 198/290] Rename sources/news/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md to sources/talk/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md --- ...orvalds Was Wrong About Linux (And I am Happy He Was Wrong).md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md (100%) diff --git a/sources/news/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md b/sources/talk/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md similarity index 100% rename from sources/news/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md rename to sources/talk/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md From 337fa40f7bb8017d323778b0c450294713f6250a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 26 Aug 2021 08:25:22 +0800 Subject: [PATCH 199/290] Rename sources/tech/20210825 10 steps to more open, focused, and energizing meetings.md to sources/talk/20210825 10 steps to more open, focused, and energizing meetings.md --- ...825 10 steps to more open, focused, and energizing meetings.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210825 10 steps to more open, focused, and energizing meetings.md (100%) diff --git a/sources/tech/20210825 10 steps to more open, focused, and energizing meetings.md b/sources/talk/20210825 10 steps to more open, focused, and energizing meetings.md similarity index 100% rename from sources/tech/20210825 10 steps to more open, focused, and energizing meetings.md rename to sources/talk/20210825 10 steps to more open, focused, and energizing meetings.md From 6a7a2db25b7e2cef90fc9190bd9a1284250c587a Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 26 Aug 2021 08:37:01 +0800 Subject: [PATCH 200/290] translated --- ... Real Time in Linux -Desktop and Server.md | 137 ------------------ ... Real Time in Linux -Desktop and Server.md | 131 +++++++++++++++++ 2 files changed, 131 insertions(+), 137 deletions(-) delete mode 100644 sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md create mode 100644 translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md diff --git a/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md deleted file mode 100644 index c8f24da669..0000000000 --- a/sources/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md +++ /dev/null @@ -1,137 +0,0 @@ -[#]: subject: "How to Monitor Log Files in Real Time in Linux [Desktop and Server]" -[#]: via: "https://www.debugpoint.com/2021/08/monitor-log-files-real-time/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Monitor Log Files in Real Time in Linux [Desktop and Server] -====== -This tutorial explains how you can monitor Linux log files (desktop, -server or applications) in real time for diagnosis and troubleshooting -purpose.Basic SyntaxUsage -When you ran into problems in your Linux desktop, or server or any application, you first look into the respective log files. The log files are generally a stream of text and messages from applications with a timestamp attached to it. It helps you to narrow down specific instances and helps you find the cause of any problem. It can also help to get assistance from the web as well. - -In general, all log files are located in /var/log. This directory contains log files with extension .log for specific applications, services, and it also contains separate other directories which contains their log files. - -![log files in var-log][1] - -So, that said, if you want to monitor a bunch of log files Or, a specific one – here’s are some ways how you can do it. - -### Monitor Log Files in real time – Linux - -#### Using tail command - -Using the tail command is the most basic way of following a log file in real time. Specially, if you are in a server with only just a terminal, no GUI. This is very helpful. - -Examples: - -``` -tail /path/to/log/file -``` - -![Monitoring multiple log files via tail][2] - -Use the switch -f to follow the log file, which updates in real time. For example, if you want to follow syslog, you can use the following command. - -``` -tail -f /var/log/syslog -``` - -You can monitor multiple log files using a single command using – - -``` -tail -f /var/log/syslog /var/log/dmesg -``` - -If you want to monitor http or sftp or any server, you can also their respective log files in this command. - -Remember, above commands requires admin privileges. - -#### Using lnav (The Logfile Navigator) - -![lnav Running][3] - -The lnav is a nice utility which you can use to monitor log files in a more structured way with color coded messages. This is not installed by default in Linux systems. You can install it using the below command: - -``` -sudo apt install lnav (Ubuntu) -sudo dnf install lnav (Fedora) -``` - -The good thing about lnav is, if you do not want to install it, you can just download its pre-compiled executable and run in anywhere. Even from a USB stick. No setup is required, plus loaded with features. Using lnav you can query the log files via SQL among other cool features which you can learn on it [official website][4]. - -[][5] - -SEE ALSO:   This App is An Advanced Log File Viewer - lnav - -Once installed, you can simply run lnav from terminal with admin privilege, and it will show all the logs from /var/log by default and start monitoring in real time. - -#### A note about journalctl of systemd - -All modern Linux distributions today use systemd, mostly. The systemd provides basic framework and components which runs Linux operating system in general. The systemd provides journal services via journalctl which helps to manage logs from all systemd services. You can also monitor respective systemd services and logs in real time using the following command. - -``` -journalctl -f -``` - -Here are some of the specific journalctl commands which you can use for several cases. You can combine these with -f switch above to start monitoring in real time. - - * To emergency system messages use - - - -``` -journalctl -p 0 -``` - - * Show errors with explanations - - - -``` -journalctl -xb -p 3 -``` - - * Use time controls to filter out - - - -``` -journalctl --since "2020-12-04 06:00:00" -journalctl --since "2020-12-03" --until "2020-12-05 03:00:00" -journalctl --since yesterday -journalctl --since 09:00 --until "1 hour ago" -``` - -If you want to learn more about and want to find out details about journalctl – I have written a [guide here][6]. - -### Closing Notes - -I hope these commands and tricks helps you find out the root cause of your problem/errors in your desktop or servers. For more details, you can always refer to the man pages and play around with various switches. Let me know using the comment box below, if you have any comments or what do you think about this article. - -Cheers. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/monitor-log-files-real-time/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/log-files-in-var-log-1024x312.jpeg -[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Monitoring-multiple-log-files-via-tail-1024x444.jpeg -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/lnav-Running-1024x447.jpeg -[4]: https://lnav.org/features -[5]: https://www.debugpoint.com/2016/11/advanced-log-file-viewer-lnav-ubuntu-linux/ -[6]: https://www.debugpoint.com/2020/12/systemd-journalctl/ diff --git a/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md new file mode 100644 index 0000000000..36b528c326 --- /dev/null +++ b/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md @@ -0,0 +1,131 @@ +[#]: subject: "How to Monitor Log Files in Real Time in Linux [Desktop and Server]" +[#]: via: "https://www.debugpoint.com/2021/08/monitor-log-files-real-time/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Linux 中实时监控日志文件(桌面和服务器) +====== +本教程解释了如何实时监控 Linux 日志文件(桌面、服务器或应用),以进行诊断和故障排除。 + +当你在你的 Linux 桌面、服务器或任何应用中遇到问题时,你会首先查看各自的日志文件。日志文件通常是来自应用的文本和信息流,上面有一个时间戳。它可以帮助你缩小具体的实例,并帮助你找到任何问题的原因。它也可以帮助从网络上获得援助。 + +一般来说,所有的日志文件都位于 /var/log 中。这个目录包含以 .log 为扩展名的特定应用、服务的日志文件,它还包含单独的其他目录,这些目录包含其日志文件。 + +![log files in var-log][1] + +所以说,如果你想监控一堆日志文件或特定的日志文件。这里有一些你可以做到方法。 + +### 实时监控 Linux 日志文件 + +#### 使用 tail 命令 + +使用 tail 命令是实时跟踪日志文件的最基本方法。特别是,如果你所在的服务器只有一个终端,没有 GUI。这是很有帮助的。 + +比如: + +``` +tail /path/to/log/file +``` + +![Monitoring multiple log files via tail][2] + +使用开关 -f 来跟踪日志文件,它是实时更新的。例如,如果你想跟踪 syslog,你可以使用以下命令。 + +``` +tail -f /var/log/syslog +``` + +你可以用一个命令监控多个日志文件,使用: + +``` +tail -f /var/log/syslog /var/log/dmesg +``` + +如果你想监控 http 或 sftp 或任何服务器,你也可以在这个命令中监控它们各自的日志文件。 + +记住,上述命令需要管理员权限。 + +#### 使用 lnav(日志文件浏览器) + +![lnav Running][3] + +lnav 是一个很好的工具,你可以用它来用彩色编码的信息以更有条理的方式监控日志文件。在 Linux 系统中,它不是默认安装的。你可以用下面的命令来安装它: + +``` +sudo apt install lnav (Ubuntu) +sudo dnf install lnav (Fedora) +``` + +lnav 的好处是,如果你不想安装它,你可以直接下载其预编译的可执行文件,然后在任何地方运行。甚至从 U 盘上也可以。它不需要设置,而且有很多功能。使用 lnav,你可以通过 SQL 查询日志文件,以及其他很酷的功能,你可以在它的[官方网站][4]上了解。 + +Once installed, you can simply run lnav from terminal with admin privilege, and it will show all the logs from /var/log by default and start monitoring in real time. + +#### 关于 systemd 的 journalctl 说明 + +今天所有的现代 Linux 发行版大多使用 systemd。systemd 提供了运行 Linux 操作系统的基本框架和组件。systemd 通过 journalctl 提供日志服务,帮助管理所有 systemd 服务的日志。你还可以通过以下命令实时监控各个 systemd 服务和日志。 + +``` +journalctl -f +``` + +下面是一些特定的 journalctl 命令,可以在一些情况下使用。你可以将这些命令与上面的 -f 开关结合起来,开始实时监控。 + + * 对紧急系统信息,使用 + + + +``` +journalctl -p 0 +``` + + * 显示带有解释的错误 + + + +``` +journalctl -xb -p 3 +``` + + * 使用时间控制来过滤输出 + + + +``` +journalctl --since "2020-12-04 06:00:00" +journalctl --since "2020-12-03" --until "2020-12-05 03:00:00" +journalctl --since yesterday +journalctl --since 09:00 --until "1 hour ago" +``` + +如果你想了解更多关于 journalctl 的细节,我已经写了一个[指南][6]。 + +### 结束语 + +我希望这些命令和技巧能帮助你找出桌面或服务器问题/错误的根本原因。对于更多的细节,你可以随时参考手册,玩弄各种开关。如果你对这篇文章有什么意见或看法,请在下面的评论栏告诉我。 + +干杯。 + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/monitor-log-files-real-time/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/log-files-in-var-log-1024x312.jpeg +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Monitoring-multiple-log-files-via-tail-1024x444.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/lnav-Running-1024x447.jpeg +[4]: https://lnav.org/features +[6]: https://www.debugpoint.com/2020/12/systemd-journalctl/ From b7f91b3c1423fd67d5df5a4b2c7964986473734d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 26 Aug 2021 08:39:24 +0800 Subject: [PATCH 201/290] translating --- ... Ulauncher- A Super Useful Application Launcher for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md index f82caed047..11df55dcf1 100644 --- a/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md +++ b/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/ulauncher/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 5115191c44ab6b74f9fe27e4ffffb77db5217c97 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 26 Aug 2021 11:02:52 +0800 Subject: [PATCH 202/290] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @YungeG 辛苦了! --- ...derstanding systemd at startup on Linux.md | 126 +++++++++--------- 1 file changed, 63 insertions(+), 63 deletions(-) diff --git a/translated/tech/20200504 Understanding systemd at startup on Linux.md b/translated/tech/20200504 Understanding systemd at startup on Linux.md index 486874df37..244143a907 100644 --- a/translated/tech/20200504 Understanding systemd at startup on Linux.md +++ b/translated/tech/20200504 Understanding systemd at startup on Linux.md @@ -1,33 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (YungeG) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Understanding systemd at startup on Linux) [#]: via: (https://opensource.com/article/20/5/systemd-startup) [#]: author: (David Both https://opensource.com/users/dboth) -在 Linux 启动时理解 systemd +理解 systemd 启动时在做什么 ====== -systemd 启动过程提供的重要线索可以在问题出现时助你一臂之力。 -![People at the start line of a race][1] +> systemd 启动过程提供的重要线索可以在问题出现时助你一臂之力。 -在本系列的第一篇文章[_学着爱上 systemd_][2],我考察了 systemd 的功能和架构,以及围绕 systemd 作为古老的 SystemV 初始化程序和启动脚本的替代品的争论。在这第二篇文章中,我将开始探索管理 Linux 启动序列的文件和工具。我会解释 systemd 启动序列、如何更改默认的启动目标(SystemV 术语中的运行级别)、以及在不重启的情况下如何手动切换到不同的目标。 +![](https://img.linux.net.cn/data/attachment/album/202108/26/110220piwnicwxvvc1s8io.jpg) -我还将考察两个重要的 systemd 工具。第一个 **systemctl** 命令是和 systemd 交互、向其发送命令的基本方式。第二个是 **journalctl**,用于访问 systemd 日志,后者包含了大量系统历史数据,比如内核和服务的消息(包括指示性信息和错误信息)。 +在本系列的第一篇文章《[学着爱上 systemd][2]》,我考察了 systemd 的功能和架构,以及围绕 systemd 作为古老的 SystemV 初始化程序和启动脚本的替代品的争论。在这第二篇文章中,我将开始探索管理 Linux 启动序列的文件和工具。我会解释 systemd 启动序列、如何更改默认的启动目标(即 SystemV 术语中的运行级别)、以及在不重启的情况下如何手动切换到不同的目标。 -务必使用一个非生产系统进行本文和后续文章中的测试和实验。你的测试系统需要安装一个 GUI 桌面(比如 Xfce,LXDE,Gnome,KD E或其他)。 +我还将考察两个重要的 systemd 工具。第一个 `systemctl` 命令是和 systemd 交互、向其发送命令的基本方式。第二个是 `journalctl`,用于访问 systemd 日志,后者包含了大量系统历史数据,比如内核和服务的消息(包括指示性信息和错误信息)。 + +务必使用一个非生产系统进行本文和后续文章中的测试和实验。你的测试系统需要安装一个 GUI 桌面(比如 Xfce、LXDE、Gnome、KDE 或其他)。 上一篇文章中我写道计划在这篇文章创建一个 systemd 单元并添加到启动序列。由于这篇文章比我预期中要长,这些内容将留到本系列的下一篇文章。 ### 使用 systemd 探索 Linux 的启动 -在观察启动序列之前,你需要做几件事情得使引导和启动序列开放可见。正常情况下,大多数发行版使用一个开机动画或者启动画面隐藏 Linux 启动和关机过程中的显示细节,在基于 Red Hat 的发行版中称作 Plymouth 引导画面。这些隐藏的消息能够向寻找信息以排除程序故障、或者只是学习启动序列的系统管理员提供大量有关系统启动和关闭的信息。你可以通过 GRUB(Grand Unified Boot Loader)配置改变这个设置。 +在观察启动序列之前,你需要做几件事情得使引导和启动序列开放可见。正常情况下,大多数发行版使用一个开机动画或者启动画面隐藏 Linux 启动和关机过程中的显示细节,在基于 Red Hat 的发行版中称作 Plymouth 引导画面。这些隐藏的消息能够向寻找信息以排除程序故障、或者只是学习启动序列的系统管理员提供大量有关系统启动和关闭的信息。你可以通过 GRUB(大统一引导加载器Grand Unified Boot Loader)配置改变这个设置。 -主要的 GRUB 配置文件是 **/boot/grub2/grub.cfg** ,但是这个文件在更新内核版本时会被覆盖,你不会想修改它的。相反,修改用于改变 **grub.cfg** 默认设置的 **/etc/default/grub** 文件。 +主要的 GRUB 配置文件是 `/boot/grub2/grub.cfg` ,但是这个文件在更新内核版本时会被覆盖,你不会想修改它的。相反,应该修改用于改变 `grub.cfg` 默认设置的 `/etc/default/grub` 文件。 -从 **/etc/default/grub** 文件当前还未修改的版本看起: +首先看一下当前未修改的 `/etc/default/grub` 文件的版本: ``` [root@testvm1 ~]# cd /etc/default ; cat grub @@ -43,10 +44,10 @@ GRUB_DISABLE_RECOVERY="true" [root@testvm1 default]# ``` -[GRUB 文档][3]的第 6 章列出了 **/etc/default/grub** 文件的所有可用项,我只关注下面的部分: +[GRUB 文档][3] 的第 6 章列出了 `/etc/default/grub` 文件的所有可用项,我只关注下面的部分: - * 我将 GRUB 菜单倒计时的秒数 **GRUB_TIMEOUT**,从 5 改成 10,以便在倒计时达到 0 之前有更多的时间响应 GRUB 菜单。 - * **GRUB_CMDLINE_LINUX** 列出了启动阶段传递给内核的命令行参数,我删除了其中的最后两个参数。其中的一个参数 **rhgb** 代表 Red Hat Graphical Boot,在内核初始化阶段显示一个小小的 Fedora 图标动画,而不是显示启动阶段的信息。另一个参数 **quiet**,屏蔽记录启动进度和发生错误的消息。系统管理员需要这些信息,因此我删除了 **rhgb** 和 **quiet**。如果启动阶段发生了错误,屏幕上显示的信息可以指向故障的原因。 + * 我将 GRUB 菜单倒计时的秒数 `GRUB_TIMEOUT`,从 5 改成 10,以便在倒计时达到 0 之前有更多的时间响应 GRUB 菜单。 + * `GRUB_CMDLINE_LINUX` 列出了引导阶段传递给内核的命令行参数,我删除了其中的最后两个参数。其中的一个参数 `rhgb` 代表 “红帽图形化引导Red Hat Graphical Boot”,在内核初始化阶段显示一个小小的 Fedora 图标动画,而不是显示引导阶段的信息。另一个参数 `quiet`,屏蔽显示记录了启动进度和发生错误的消息。系统管理员需要这些信息,因此我删除了 `rhgb` 和 `quiet`。如果引导阶段发生了错误,屏幕上显示的信息可以指向故障的原因。 更改之后,你的 GRUB 文件将会像下面一样: @@ -64,7 +65,7 @@ GRUB_DISABLE_RECOVERY="false" [root@testvm1 default]# ``` -**grub2-mkconfig** 程序使用 **/etc/default/grub** 文件的内容生成 **grub.cfg** 配置文件,从而改变一些默认的 GRUB 设置。**grub2-mkconfig** 输出到 **STDOUT**,你可以使用程序的 **-o** 参数指明数据流输出的文件,不过使用重定向也同样简单。执行下面的命令更新 **/boot/grub2/grub.cfg** 配置文件: +`grub2-mkconfig` 程序使用 `/etc/default/grub` 文件的内容生成 `grub.cfg` 配置文件,从而改变一些默认的 GRUB 设置。`grub2-mkconfig` 输出到 `STDOUT`,你可以使用程序的 `-o` 参数指明数据流输出的文件,不过使用重定向也同样简单。执行下面的命令更新 `/boot/grub2/grub.cfg` 配置文件: ``` [root@testvm1 grub2]# grub2-mkconfig > /boot/grub2/grub.cfg @@ -83,17 +84,17 @@ done 重新启动你的测试系统查看本来会隐藏在 Plymouth 开机动画之下的启动信息。但是如果你没有关闭开机动画,又需要查看启动信息的话又该如何操作?或者你关闭了开机动画,而消息流过的速度太快,无法阅读怎么办?(实际情况如此。) -有两个解决方案,都涉及到日志文件和 systemd 日志——两个都是你的好伙伴。你可以使用 **less** 命令查看 **/var/log/messages** 文件的内容。这个文件包含引导和启动信息,以及操作系统执行正常操作时生成的信息。你也可以使用不加任何参数的 **journalctl** 命令查看 systemd 日志,包含基本相同的信息: +有两个解决方案,都涉及到日志文件和 systemd 日志 —— 两个都是你的好伙伴。你可以使用 `less` 命令查看 `/var/log/messages` 文件的内容。这个文件包含引导和启动信息,以及操作系统执行正常操作时生成的信息。你也可以使用不加任何参数的 `journalctl` 命令查看 systemd 日志,包含基本相同的信息: ``` [root@testvm1 grub2]# journalctl -\-- Logs begin at Sat 2020-01-11 21:48:08 EST, end at Fri 2020-04-03 08:54:30 EDT. -- -Jan 11 21:48:08 f31vm.both.org kernel: Linux version 5.3.7-301.fc31.x86_64 ([mockbuild@bkernel03.phx2.fedoraproject.org][4]) (gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)) #1 SMP Mon Oct > -Jan 11 21:48:08 f31vm.both.org kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.3.7-301.fc31.x86_64 root=/dev/mapper/VG01-root ro resume=/dev/mapper/VG01-swap rd.lvm.lv=VG01/root rd> +-- Logs begin at Sat 2020-01-11 21:48:08 EST, end at Fri 2020-04-03 08:54:30 EDT. -- +Jan 11 21:48:08 f31vm.both.org kernel: Linux version 5.3.7-301.fc31.x86_64 (mockbuild@bkernel03.phx2.fedoraproject.org) (gcc version 9.2.1 20190827 (Red Hat 9.2.1-1) (GCC)) #1 SMP Mon Oct > +Jan 11 21:48:08 f31vm.both.org kernel: Command line: BOOT_IMAGE=(hd0,msdos1)/vmlinuz-5.3.7-301.fc31.x86_64 root=/dev/mapper/VG01-root ro resume=/dev/mapper/VG01-swap rd.lvm.lv=VG01/root rd> Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x001: 'x87 floating point registers' Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x002: 'SSE registers' Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Supporting XSAVE feature 0x004: 'AVX registers' -Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: xstate_offset[2]:  576, xstate_sizes[2]:  256 +Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256 Jan 11 21:48:08 f31vm.both.org kernel: x86/fpu: Enabled xstate features 0x7, context size is 832 bytes, using 'standard' format. Jan 11 21:48:08 f31vm.both.org kernel: BIOS-provided physical RAM map: Jan 11 21:48:08 f31vm.both.org kernel: BIOS-e820: [mem 0x0000000000000000-0x000000000009fbff] usable @@ -116,51 +117,51 @@ Jan 11 21:48:08 f31vm.both.org kernel: clocksource: kvm-clock: mask: 0xfffffffff Jan 11 21:48:08 f31vm.both.org kernel: tsc: Detected 2807.992 MHz processor Jan 11 21:48:08 f31vm.both.org kernel: e820: update [mem 0x00000000-0x00000fff] usable ==> reserved Jan 11 21:48:08 f31vm.both.org kernel: e820: remove [mem 0x000a0000-0x000fffff] usable + ``` -由于数据流可能长达几百甚至几百万行,我在这里截断了它。(我的主要工作站上列出的日志长度是 1,188,482 行。)一定要在你的测试系统尝试这个命令。如果系统已经运行了一段时间——即使重启过很多次——还是会显示大量的数据。进行问题诊断时查看这个日志数据,因为其中包含了很多可能十分有用的信息。了解这个数据文件在正常的引导和启动过程中的模样,可以帮助你在问题出现时定位问题。 +由于数据流可能长达几十万甚至几百万行,我在这里截断了它。(我的主要工作站上列出的日志长度是 1,188,482 行。)请确保是在你的测试系统尝试的这个命令。如果系统已经运行了一段时间 —— 即使重启过很多次 —— 还是会显示大量的数据。查看这些日志数据,因为它包含了很多信息,在进行问题判断时可能非常有用。了解这个数据文件在正常的引导和启动过程中的模样,可以帮助你在问题出现时定位问题。 -我将在本系列之后的文章讨论 systemd 日志、**journalctl** 命令、以及如何整列输出的日志数据来寻找更详细的信息。 +我将在本系列之后的文章讨论 systemd 日志、`journalctl` 命令、以及如何整理输出的日志数据来寻找更详细的信息。 内核被 GRUB 加载到内存后,必须先将自己从压缩后的文件中解压出来,才能执行任何有意义的操作。解压自己后,内核开始运行,加载 systemd 并转交控制权。 -引导阶段到此结束,此时 Linux 内核和 systemd 正在运行,但是无法为用户执行任何生产性任务,因为其他的程序都没有执行,没有命令行解释器提供命令行,没有后台进程管理网络和其他的通信链接,也没有任何东西能够控制计算机执行生产功能。 +引导boot阶段到此结束,此时 Linux 内核和 systemd 正在运行,但是无法为用户执行任何生产性任务,因为其他的程序都没有执行,没有命令行解释器提供命令行,没有后台进程管理网络和其他的通信链接,也没有任何东西能够控制计算机执行生产功能。 现在 systemd 可以加载所需的功能性单元以便将系统启动到选择的目标运行状态。 ### 目标 -一个 systemd 目标代表一个 Linux 系统当前的或期望的运行状态。与 SystemV 启动脚本十分类似,目标定义了系统运行必须存在的服务,以及处于目标状态下必须激活的服务。图片 1 展示了使用 systemd 的 Linux 系统可能的运行状态目标。就像在本系列的第一篇文章以及 systemd 启动的手册页(`man bootup`)所看到的一样,有一些开启不同必要服务的其他中间目标,包括 **swap.target**、**timers.target**、**local-fs.target** 等。一些目标(像 **basic.target**)作为检查点使用,在移动到下一个更高级的目标之前保证所有需要的服务已经启动并运行。 +一个 systemd 目标target代表一个 Linux 系统当前的或期望的运行状态。与 SystemV 启动脚本十分类似,目标定义了系统运行必须存在的服务,以及处于目标状态下必须激活的服务。图表 1 展示了使用 systemd 的 Linux 系统可能的运行状态目标。就像在本系列的第一篇文章以及 systemd 启动的手册页(`man bootup`)所看到的一样,有一些开启不同必要服务的其他中间目标,包括 `swap.target`、`timers.target`、`local-fs.target` 等。一些目标(像 `basic.target`)作为检查点使用,在移动到下一个更高级的目标之前保证所有需要的服务已经启动并运行。 -除非开机时在 GRUB 菜单进行更改,systemd 总是启动 **default.target**。**default.target** 文件是指向真实的目标文件的符号链接。对于桌面工作站,**default.target** 通常是 **graphical.target**,等同于 SystemV 的运行等级 5。对于服务器,默认目标多半是 **multi-user.target**,就像 SystemV 的运行等级 3。**emergency.target** 文件类似单用户模式。目标和服务都是 systemd 单元。 +除非开机时在 GRUB 菜单进行更改,systemd 总是启动 `default.target`。`default.target` 文件是指向真实的目标文件的符号链接。对于桌面工作站,`default.target` 通常是 `graphical.target`,等同于 SystemV 的运行等级 5。对于服务器,默认目标多半是 `multi-user.target`,就像 SystemV 的运行等级 3。`emergency.target` 文件类似单用户模式。目标和服务service都是一种 systemd 单元。 -下面的表格,包含在本系列的上一篇文章中,比较了 systemd 目标和古老的 SystemV 启动运行等级。为了向后兼容,systemd 提供了 systemd 目标别名,允许脚本——和系统管理员——使用像 **init 3** 一样的 SystemV 命令改变运行等级。当然,SystemV 命令被转发给 systemd 进行解释和执行。 +下面的图表,包含在本系列的上一篇文章中,比较了 systemd 目标和古老的 SystemV 启动运行等级。为了向后兼容,systemd 提供了 systemd 目标别名,允许脚本和系统管理员使用像 `init 3` 一样的 SystemV 命令改变运行等级。当然,SystemV 命令被转发给 systemd 进行解释和执行。 -**systemd targets** | **SystemV runlevel** | **target aliases** | **Description** +**systemd 目标** | **SystemV 运行级别** | **目标别名** | **描述** ---|---|---|--- -default.target | | | 这个目标通常是一个符号链接,作为 **multi-user.target** 或 **graphical.target** 的别名。systemd 总是用 **default.target** 启动系统。**default.target** 不能命名为 **halt.target**、**poweroff.target**、和 **reboot.target**。 -graphical.target | 5 | runlevel5.target | 带有 GUI 的 **Multi-user.target** -| 4 | runlevel4.target | 未使用。运行等级 4 和 SystemV 的运行等级 3 一致,可以创建这个目标并进行定制,用于启动本地服务,而不必更改默认的 **multi-user.target**。 -multi-user.target | 3 | runlevel3.target | 运行所有的服务,但是只有命令行接口(command-line interface,CLI) -| 2 | runlevel2.target | 多用户,没有 NFS,但是运行其他所有的非 GUI 服务 -rescue.target | 1 | runlevel1.target | 一个基本的系统,包括挂载文件系统,但是只运行最基础的服务,以及一个主控制台上的救援命令行解释器 -emergency.target | S | | 单用户模式——没有服务运行;文件系统没有挂载。这是最基础级的操作模式,只有一个运行在主控制台的紧急情况命令行解释器,供用户和系统交互。 -halt.target | | | 不断电的情况下停止系统 -reboot.target | 6 | runlevel6.target | 重启 -poweroff.target | 0 | runlevel0.target | 停止系统并关闭电源 +| `default.target` | | | 这个目标通常是一个符号链接,作为 `multi-user.target` 或 `graphical.target` 的别名。systemd 总是用 `default.target` 启动系统。`default.target** 不能作为 `halt.target`、`poweroff.target` 和 `reboot.target` 的别名。| +| `graphical.target` | 5 | `runlevel5.target` | 带有 GUI 的 `multi-user.target` 。| +| | 4 | `runlevel4.target` | 未使用。运行等级 4 和 SystemV 的运行等级 3 一致,可以创建这个目标并进行定制,用于启动本地服务,而不必更改默认的 `multi-user.target`。 | +| `multi-user.target` | 3 | `runlevel3.target` | 运行所有的服务,但是只有命令行界面(CLI) 。| +| | 2 | `runlevel2.target` | 多用户,没有 NFS,但是运行其他所有的非 GUI 服务 +| `rescue.target` | 1 | `runlevel1.target` | 一个基本的系统,包括挂载文件系统,但是只运行最基础的服务,以及一个主控制台上的用于救援的命令行解释器。| +| `emergency.target` | S | | 单用户模式 —— 没有服务运行;文件系统没有挂载。这是最基础级的操作模式,只有一个运行在主控制台的用于紧急情况的命令行解释器,供用户和系统交互。 | +| `halt.target` | | | 不断电的情况下停止系统 | +| `reboot.target` | 6 | `runlevel6.target` | 重启 | +| `poweroff.target` | 0 | `runlevel0.target` | 停止系统并关闭电源 | - -每个目标在配置文件中都描述了一组依赖关系。systemd 启动需要的依赖,即 Linux 主机运行在特定功能级别所需的服务。加载目标配置文件中列出的所有依赖并运行后,系统就运行在那个目标等级。如果愿意,你可以在本系列的第一篇文章 [_学着爱上 systemd_][2] 中回顾 systemd 的启动序列和运行时目标。 +每个目标在配置文件中都描述了一组依赖关系。systemd 启动需要的依赖,即 Linux 主机运行在特定功能级别所需的服务。加载目标配置文件中列出的所有依赖并运行后,系统就运行在那个目标等级。如果愿意,你可以在本系列的第一篇文章《[学着爱上 systemd][2]》中回顾 systemd 的启动序列和运行时目标。 ### 探索当前的目标 -许多 Linux 发行版默认安装一个 GUI 桌面接口,以便安装的系统可以像工作站一样使用。我总是从 Fedora Live USB 引导驱动器安装 Xfce 或 LXDE 桌面。即使是安装一个服务器或者其他基础类型的主机(比如用于路由器和防火墙的主机),我也使用 GUI 桌面的安装方式。 +许多 Linux 发行版默认安装一个 GUI 桌面界面,以便安装的系统可以像工作站一样使用。我总是从 Fedora Live USB 引导驱动器安装 Xfce 或 LXDE 桌面。即使是安装一个服务器或者其他基础类型的主机(比如用于路由器和防火墙的主机),我也使用 GUI 桌面的安装方式。 我可以安装一个没有桌面的服务器(数据中心的典型做法),但是这样不满足我的需求。原因不是我需要 GUI 桌面本身,而是 LXDE 安装包含了许多其他默认的服务器安装没有提供的工具,这意味着初始安装之后我需要做的工作更少。 -但是,仅仅因为有一个 GUI 桌面并不意味着我要使用它。我有一个 16 端口的 KVM,可以用于访问我的大部分 Linux 系统的 KVM 接口,但我和它们交互的大部分交互是通过从我的主要工作站建立的远程 SSH 连接。这种方式更安全,而且和 **graphical.target** 相比,运行 **multi-user.target** 使用更少的系统资源。 +但是,仅仅因为有 GUI 桌面并不意味着我要使用它。我有一个 16 端口的 KVM,可以用于访问我的大部分 Linux 系统的 KVM 接口,但我和它们交互的大部分交互是通过从我的主要工作站建立的远程 SSH 连接。这种方式更安全,而且和 `graphical.target` 相比,运行 `multi-user.target` 使用更少的系统资源。 -首先,检查默认目标,确认是 **graphical.target**: +首先,检查默认目标,确认是 `graphical.target`: ``` [root@testvm1 ~]# systemctl get-default @@ -168,7 +169,7 @@ graphical.target [root@testvm1 ~]# ``` -然后确认当前正在运行的目标,应该和默认目标相同。你仍可以使用老方法,输出古老的 SystemV 运行等级。注意,前一个运行等级在左边,这里是 **N**(意思是 None),表示主机启动后没有修改过运行等级。数字 5 是当前的目标,正如古老的 SystemV 术语中的定义: +然后确认当前正在运行的目标,应该和默认目标相同。你仍可以使用老方法,输出古老的 SystemV 运行等级。注意,前一个运行等级在左边,这里是 `N`(意思是 None),表示主机启动后没有修改过运行等级。数字 5 是当前的目标,正如古老的 SystemV 术语中的定义: ``` [root@testvm1 ~]# runlevel @@ -176,7 +177,7 @@ N 5 [root@testvm1 ~]# ``` -注意,runlevel 的手册页指出运行等级已经被淘汰,并提供了一个转换表。 +注意,`runlevel` 的手册页指出运行等级已经被淘汰,并提供了一个转换表。 你也可以使用 systemd 方式,命令的输出有很多行,但确实用 systemd 术语提供了答案: @@ -213,23 +214,23 @@ SUB    = The low-level unit activation state, values depend on unit type. To show all installed unit files use 'systemctl list-unit-files'. ``` -上面列出了当前加载的和激活的目标,你也可以看到 **graphical.target** 和 **multi-user.target**。**multi-user.target** 需要在 **graphical.target** 之前加载。这个例子中,**graphical.target** 是激活的。 +上面列出了当前加载的和激活的目标,你也可以看到 `graphical.target` 和 `multi-user.target`。`multi-user.target` 需要在 `graphical.target` 之前加载。这个例子中,`graphical.target` 是激活的。 ### 切换到不同的目标 -切换到 **multi-user.target** 很简单: +切换到 `multi-user.target` 很简单: ``` [root@testvm1 ~]# systemctl isolate multi-user.target ``` -显示器现在应该从 GUI 桌面或登录界面切换到了一个虚拟控制台。登录并列出当前激活的 systemd 单元,确认 **graphical.target** 不再运行: +显示器现在应该从 GUI 桌面或登录界面切换到了一个虚拟控制台。登录并列出当前激活的 systemd 单元,确认 `graphical.target` 不再运行: ``` [root@testvm1 ~]# systemctl list-units --type target ``` -务必使用 **runlevel** 确认命令输出了之前的和当前的“运行等级”: +务必使用 `runlevel` 确认命令输出了之前的和当前的“运行等级”: ``` [root@testvm1 ~]# runlevel @@ -238,7 +239,7 @@ To show all installed unit files use 'systemctl list-unit-files'. ### 更改默认目标 -现在,将默认目标改为 **multi-user.target**,以便系统总是启动进入 **multi-user.target**,从而使用控制台命令行接口而不是 GUI 桌面接口。使用你的测试主机的根用户,切换到保存 systemd 配置的目录,执行一次快速列出操作: +现在,将默认目标改为 `multi-user.target`,以便系统总是启动进入 `multi-user.target`,从而使用控制台命令行接口而不是 GUI 桌面接口。使用你的测试主机的根用户,切换到保存 systemd 配置的目录,执行一次快速列出操作: ``` [root@testvm1 ~]# cd /etc/systemd/system/ ; ll @@ -256,13 +257,13 @@ drwxr-xr-x. 2 root root 4096 Oct 30 16:54  multi-user.target.wants 为了强调一些有助于解释 systemd 如何管理启动过程的重要事项,我缩短了这个列表。你应该可以在虚拟机看到完整的目录和链接列表。 -**default.target** 项是指向目录 **/lib/systemd/system/graphical.target** 的符号链接(软链接),列出那个目录查看目录中的其他内容: +`default.target` 项是指向目录 `/lib/systemd/system/graphical.target` 的符号链接(软链接),列出那个目录查看目录中的其他内容: ``` [root@testvm1 system]# ll /lib/systemd/system/ | less ``` -你应该在这个列表中看到文件、目录、以及更多链接,但是专门寻找一下 **multi-user.target** 和 **graphical.target**。现在列出 **default.target**——一个指向 **/lib/systemd/system/graphical.target** 的链接——的内容: +你应该在这个列表中看到文件、目录、以及更多链接,但是专门寻找一下 `multi-user.target` 和 `graphical.target`。现在列出 `default.target`(指向 `/lib/systemd/system/graphical.target` 的链接)的内容: ``` [root@testvm1 system]# cat default.target @@ -286,16 +287,16 @@ AllowIsolate=yes [root@testvm1 system]# ``` -**graphical.target** 文件的这个链接描述了图形用户接口需要的所有必备条件。我会在本系列的下一篇文章至少探讨其中的一些选项。 +`graphical.target` 文件的这个链接描述了图形用户接口需要的所有必备条件。我会在本系列的下一篇文章至少探讨其中的一些选项。 -为了使主机启动到多用户模式,你需要删除已有的链接,创建一个新链接指向正确目标。如果你的 [PWD][5] 不是 **/etc/systemd/system**,切换过去: +为了使主机启动到多用户模式,你需要删除已有的链接,创建一个新链接指向正确目标。如果你的 [PWD][5] 不是 `/etc/systemd/system`,切换过去: ``` [root@testvm1 system]# rm -f default.target [root@testvm1 system]# ln -s /lib/systemd/system/multi-user.target default.target ``` -列出 **default.target** 链接,确认其指向了正确的文件: +列出 `default.target` 链接,确认其指向了正确的文件: ``` [root@testvm1 system]# ll default.target @@ -303,7 +304,7 @@ lrwxrwxrwx 1 root root 37 Nov 28 16:08 default.target -> /lib/systemd/system/ [root@testvm1 system]# ``` -如果你的链接看起来不一样,删除并重试。列出 **default.target** 链接的内容: +如果你的链接看起来不一样,删除并重试。列出 `default.target` 链接的内容: ``` [root@testvm1 system]# cat default.target @@ -326,9 +327,9 @@ AllowIsolate=yes [root@testvm1 system]# ``` -**default.target**——这里其实是指向 **multi-user.target** 的链接——其中的 **[Unit]** 部分现在有不同的必需条件。这个目标不需要有图形显示管理器。 +`default.target`(这里其实是指向 `multi-user.target` 的链接)其中的 `[Unit]` 部分现在有不同的必需条件。这个目标不需要有图形显示管理器。 -重启,你的虚拟机应该启动到虚拟控制台 1 的控制台登录,虚拟控制台 1 在显示器标识为 tty1。现在你已经知道如何修改默认的目标,使用所需的命令将默认目标改回 **graphical.target**。 +重启,你的虚拟机应该启动到虚拟控制台 1 的控制台登录,虚拟控制台 1 在显示器标识为 `tty1`。现在你已经知道如何修改默认的目标,使用所需的命令将默认目标改回 `graphical.target`。 首先检查当前的默认目标: @@ -341,19 +342,19 @@ Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/g [root@testvm1 ~]# ``` -输入下面的命令直接切换到 **graphical.target** 和显示管理器的登录界面,不需要重启: +输入下面的命令直接切换到 `graphical.target` 和显示管理器的登录界面,不需要重启: ``` [root@testvm1 system]# systemctl isolate default.target ``` -我不清楚为何 systemd 的开发者选择了术语 “isolate” 作为这个子命令。我的研究表明指的可能是运行指明的目标,但是“隔离”并终结其他所有启动该目标不需要的目标。然而,命令执行的效果是从一个运行的目标切换到另一个——在这个例子中,从多用户目标切换到图形目标。上面的命令等同于 SystemV 启动脚本和 init 程序中古老的 init 5 命令。 +我不清楚为何 systemd 的开发者选择了术语 `isolate` 作为这个子命令。我的研究表明指的可能是运行指明的目标,但是“隔离”并终结其他所有启动该目标不需要的目标。然而,命令执行的效果是从一个运行的目标切换到另一个——在这个例子中,从多用户目标切换到图形目标。上面的命令等同于 SystemV 启动脚本和 `init` 程序中古老的 `init 5` 命令。 登录 GUI 桌面,确认能正常工作。 ### 总结 -本文探索了 Linux systemd 启动序列,开始探讨两个重要的 systemd 工具 **systemdctl** 和 **journalctl**,还说明了如何从一个目标切换到另一个目标,以及如何修改默认目标。 +本文探索了 Linux systemd 启动序列,开始探讨两个重要的 systemd 工具 `systemdctl` 和 `journalctl`,还说明了如何从一个目标切换到另一个目标,以及如何修改默认目标。 本系列的下一篇文章中将会创建一个新的 systemd 单元,并配置为启动阶段运行。下一篇文章还会查看一些配置选项,可以帮助确定某个特定的单元在序列中启动的位置,比如在网络启动运行后。 @@ -362,9 +363,9 @@ Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/g 关于 systemd 网络上有大量的信息,但大部分都简短生硬、愚钝、甚至令人误解。除了本文提到的资源,下面的网页提供了关于 systemd 启动更详细可靠的信息。 * Fedora 项目有一个优质实用的 [systemd 指南][6],几乎有你使用 systemd 配置、管理、维护一个 Fedora 计算机需要知道的一切。 - * Fedora 项目还有一个好用的[速查表][7],交叉引用了古老的 SystemV 命令和对应的 systemd 命令。 + * Fedora 项目还有一个好用的 [速查表][7],交叉引用了古老的 SystemV 命令和对应的 systemd 命令。 * 要获取 systemd 的详细技术信息和创立的原因,查看 [Freedesktop.org][8] 的 [systemd 描述][9]。 - * Linux.com 上”systemd 的更多乐趣"提供了更高级的 systemd [信息和提示][11]。 + * Linux.com 上“systemd 的更多乐趣”提供了更高级的 systemd [信息和提示][11]。 还有一系列针对系统管理员的深层技术文章,由 systemd 的设计者和主要开发者 Lennart Poettering 所作。这些文章写于 2010 年 4 月到 2011 年 9 月之间,但在当下仍然像当时一样有价值。关于 systemd 及其生态的许多其他优秀的作品都是基于这些文章的。 @@ -381,7 +382,6 @@ Created symlink /etc/systemd/system/default.target → /usr/lib/systemd/system/g * [systemd for Administrators, Part X][22] * [systemd for Administrators, Part XI][23] -Mentor Graphics 公司的一位 Linux 内核和系统工程师 Alison Chiaken,对 systemd 进行了预展... -------------------------------------------------------------------------------- @@ -390,7 +390,7 @@ via: https://opensource.com/article/20/5/systemd-startup 作者:[David Both][a] 选题:[lujun9972][b] 译者:[YungeG](https://github.com/YungeG) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b260522be531a70bab209774e4a53b3fb187f029 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 26 Aug 2021 11:03:35 +0800 Subject: [PATCH 203/290] PUB @YungeG https://linux.cn/article-13720-1.html --- .../20200504 Understanding systemd at startup on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200504 Understanding systemd at startup on Linux.md (99%) diff --git a/translated/tech/20200504 Understanding systemd at startup on Linux.md b/published/20200504 Understanding systemd at startup on Linux.md similarity index 99% rename from translated/tech/20200504 Understanding systemd at startup on Linux.md rename to published/20200504 Understanding systemd at startup on Linux.md index 244143a907..59f2c0442c 100644 --- a/translated/tech/20200504 Understanding systemd at startup on Linux.md +++ b/published/20200504 Understanding systemd at startup on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (YungeG) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13720-1.html) [#]: subject: (Understanding systemd at startup on Linux) [#]: via: (https://opensource.com/article/20/5/systemd-startup) [#]: author: (David Both https://opensource.com/users/dboth) From 3d5510bbd54b8c0ea87af8eba7b7fe910c50835f Mon Sep 17 00:00:00 2001 From: imgradeone <30969327+imgradeone@users.noreply.github.com> Date: Thu, 26 Aug 2021 12:33:02 +0800 Subject: [PATCH 204/290] Update 20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md --- ...lementary OS 6 Odin Review - Late Arrival but a Solid One.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index 9e82b30726..baa22699f5 100644 --- a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -2,7 +2,7 @@ [#]: via: "https://www.debugpoint.com/2021/08/elementary-os-6-odin-review/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "imgradeone" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 1922033821d255d3ff473ba7e23670bfe1785f37 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Thu, 26 Aug 2021 13:23:32 +0800 Subject: [PATCH 205/290] Update 20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md --- ...n Review - Late Arrival but a Solid One.md | 58 +++++++++---------- 1 file changed, 28 insertions(+), 30 deletions(-) diff --git a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index baa22699f5..2442c6b6ba 100644 --- a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -7,63 +7,61 @@ [#]: publisher: " " [#]: url: " " -Elementary OS 6 Odin Review – Late Arrival but a Solid One +elementary OS 6 Odin 评测 – 迟到的新版本,但也实至名归 ====== -We review the elementary OS 6 Odin and give you some glimpse on how it -went for our test drive. -For almost two years, the elementary OS fans was waiting for elementary OS 6 Odin release. Because, the earlier version elementary OS 5.1 was too old in terms of Kernel, packages in 2021. It was based on Ubuntu 18.04 LTS. So, the users was waiting to get a flavor based on Ubuntu 20.04 LTS – which is already in 2nd year, and we have another LTS coming up. +> 这篇 elementary OS 6 的评测将为您呈现该系统在旧款测试设备上的表现。 -You get the idea. Sometimes the wait was too long, probably some users jumped ship to other distributions.  +elementary OS 的粉丝们已经焦急等待 elementary OS 6 Odin 发布将近两年了。如此焦急的原因,主要在于早期版本 elementary OS 5.1 的内核和软件包在 2021 年来说实在太旧了。而且,这一旧版本基于 Ubuntu 18.04 LTS 构建。因此,用户都急切地等待着基于 Ubuntu 20.04 LTS 的全新版本 —— 最重要的是,Ubutnu 20.04 LTS 已经发布一年,接下来也将有下一个 LTS 版本发布。 -However, the release [was done in August][1], and it was a hit among the users and fanboys. +你应该也明白的,过长的等待时间,很可能导致用户跳槽到其他发行版。 -So, I ran elementary OS 6 Odin for a week on an old hardware (I know newer hardware would do just fine), and this is the review. +无论如何,新版本终于还是 [在 8 月发布了][1],它也在用户和粉丝群体中引起了很大的轰动。 -![elementary OS 6 ODIN Desktop][2] +于是,我在一周前为一台旧设备(我知道新设备的体验会更好)安装了 elementary OS 6 Odin,下面就是测评。 -### Elementary OS 6 Odin review +![elementary OS 6 Odin 的桌面][2] -Test Hardware +### elementary OS 6 Odin 测评 - * CPU – Intel Core i3 with RAM 4GB - * Disk – SSD - * Graphics – Nvidia GeForce (340) +测试设备 + * CPU – Intel Core i3,4 GB 运行内存 + * 硬盘 – SSD 固态硬盘 + * 显卡 – Nvidia GeForce(340) +#### 安装 -#### Installation +在这一版本中,elementary 团队针对 elementary 安装器做了易用性优化,而这一次的安装器也是自制安装器。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 -In this release, the team made some usability changes to the elementary Installer, which is a homegrown tool. It reduced the steps require to begin the installation. Although it still depends on gparted for partition (which is a great tool itself anyway). +在前述测试设备中,安装过程大约花费了 10 分钟,没有任何报错。初始化之后,GRUB 也正常更新,没有任何意外。这是一个带有 Legacy BIOS 的三系统启动器。 -The installation took around 10 minutes in above hardware and went without any error. Post installation, the Grub is updated properly and no surprises there. It was a triple boot system with Legacy Bios. + -#### First Impression +#### 初见印象 -If you are new to elementary OS or Pantheon desktop, and coming from traditional menu-driven desktops, then you might need a day or two to be familiar to the way this desktop is set up. Otherwise, if you are a long time elementary user, you feel the same with some performance benefits and looks. +如果你刚听说 elementary OS 和 Pantheon 桌面,或者从其他传统菜单型桌面环境迁移过来,你可能需要一两天时间来适应这款桌面。当然,如果你已经是 elementary OS 的老用户的话,那么你将获得一致的体验,外加性能和外观的优化。 -Couple of [new features of elementary OS 6][3] you might notice as they are visible. The accent color, native dark mode, a setup of nice wallpapers. +你应该可以察觉到一些明显可见的 [elementary OS 6 的新特性][3],像是强调色、原生暗黑模式,以及一组不错的新壁纸。 [][4] -SEE ALSO:   elementary OS 6 Odin: New Features and Release Date +#### 稳定性与性能 -#### Stability and performance +我已经使用 elementary OS 6 Odin 超过一周的时间。在日常使用后,我只能说,它很稳定,没有突然的崩溃和意外。其他额外软件(需要从 apt 独立安装)也运作正常,没有性能损耗。 -I have used elementary OS Odin for more than a week. After using it daily, I must say it is very stable. No sudden crash or surprises. Additional applications (those installed separately via apt) are working well with no loss to performance.  +在近乎闲置的情况下,CPU 使用率处在 5%-10% 之间,内存占用约为 900 MB。CPU / 内存的消耗主要分配在 Gala(Pantheon 的窗口管理器)、Wingpanel(顶栏)和应用中心。 -In almost idle state, the CPU usage is around 5% to 10% and memory is consumed around 900 MB. The CPU/Memory mostly consumed by Gala – Pantheon’s window manager, Wingpanel and AppCenter. +![elementary OS 6 的系统性能][5] -![System performance of elementary OS 6][5] +考虑到系统的视觉效果,我认为这些占用数据也十分合理。不过,当你打开更多软件,例如 LibreOffice、Chrome、Kdenlive 之后,消耗的资源肯定会更多。 -Considering the look and feel it provides, I guess the above numbers are well justified. But remember, if you open more applications such as LibreOffice, Chrome, or Kdenlive for example, it will definitely consume more resources. +#### 应用程序与应用中心 -#### Applications and AppCenter +elementary OS 的应用程序列表经过精选,几乎所有类型的软件都可以从应用中心获取,包括 Flatpak 应用。不过,elementary OS 并没有预装一些重要的应用程序,像是 Firefox、LibreOffice、Torrent 客户端、硬盘分区工具、照片编辑器之类 —— 这些重要的程序需要在安装系统后再自行安装。我认为预装软件这一块有很大的改进空间。 -The application list of elementary OS is well curated and almost all types of apps are available from AppCenter including the Flatpak apps. However, elementary doesn’t include some important applications pre-loaded in default install. For example, Firefox, LibreOffice, Torrent client, disk formatter, photo editor – some important ones you need to manually install after a fresh installation. This is one of the improvement areas for the team, I feel. +### 结束语 -### Final Notes - -I have encountered one bug multiple times in my week long test run. The Wi-Fi was disconnecting randomly sometimes. But that is totally on Ubuntu 20.04 which has weird Wi-Fi problems over the years. Apart from that, it is a very stable and good Linux distribution. I wish there is a rolling-release of elementary, that would have been awesome. That said, it’s a recommended distro for all, specially for those coming from macOS. +在这一周的测试中,我也多次遇到了一个 bug,Wi-Fi 有时会突然断开,不过这完全是 Ubuntu 20.04 上游的问题 —— 多年以来,它一直有奇怪的 Wi-Fi 问题。抛开这个问题,elementary OS 确实是一款稳定、优秀的 Linux 发行版。如果 elementary OS 有滚动更新的版本,也许会更好。因此,这是一款值得推荐的发行版,尤其适合 macOS 的迁移者。 * * * From e9c20f281cf1f23b2bf8e13e5b7af47d7325df6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Thu, 26 Aug 2021 13:50:28 +0800 Subject: [PATCH 206/290] Update 20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md --- ...ntary OS 6 Odin Review - Late Arrival but a Solid One.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index 2442c6b6ba..9dc75059d3 100644 --- a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -11,11 +11,11 @@ elementary OS 6 Odin 评测 – 迟到的新版本,但也实至名归 ====== > 这篇 elementary OS 6 的评测将为您呈现该系统在旧款测试设备上的表现。 -elementary OS 的粉丝们已经焦急等待 elementary OS 6 Odin 发布将近两年了。如此焦急的原因,主要在于早期版本 elementary OS 5.1 的内核和软件包在 2021 年来说实在太旧了。而且,这一旧版本基于 Ubuntu 18.04 LTS 构建。因此,用户都急切地等待着基于 Ubuntu 20.04 LTS 的全新版本 —— 最重要的是,Ubutnu 20.04 LTS 已经发布一年,接下来也将有下一个 LTS 版本发布。 +elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近两年了。如此焦急的原因,主要在于早期版本 elementary OS 5.1 的内核和软件包在 2021 年来说过于陈旧。而且,这一旧版本基于 Ubuntu 18.04 LTS 构建。因此,用户都急切地等待着基于 Ubuntu 20.04 LTS 的全新版本 —— 最重要的是,Ubutnu 20.04 LTS 已经发布一年,接下来也将有下一个 LTS 版本发布。 你应该也明白的,过长的等待时间,很可能导致用户跳槽到其他发行版。 -无论如何,新版本终于还是 [在 8 月发布了][1],它也在用户和粉丝群体中引起了很大的轰动。 +但即便如此,新版本终于还是 [在 8 月发布了][1],它也在用户和粉丝群体中引起了很大的轰动。 于是,我在一周前为一台旧设备(我知道新设备的体验会更好)安装了 elementary OS 6 Odin,下面就是测评。 @@ -31,7 +31,7 @@ elementary OS 的粉丝们已经焦急等待 elementary OS 6 Odin 发布将近 #### 安装 -在这一版本中,elementary 团队针对 elementary 安装器做了易用性优化,而这一次的安装器也是自制安装器。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 +在这一版本中,elementary 团队针对 elementary OS 安装器做了易用性优化,而这一次的安装器也是自制安装器。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 在前述测试设备中,安装过程大约花费了 10 分钟,没有任何报错。初始化之后,GRUB 也正常更新,没有任何意外。这是一个带有 Legacy BIOS 的三系统启动器。 From 41e7e8a9a70c1fb45a30634a1f7ae3a803325c4e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?imgradeone=20-=20=E4=B8=80=E5=B9=B4=E7=BA=A7=E4=B9=88?= =?UTF-8?q?=E4=B9=88=E5=93=92?= Date: Thu, 26 Aug 2021 15:17:20 +0800 Subject: [PATCH 207/290] move file --- ... Elementary OS 6 Odin Review - Late Arrival but a Solid One.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md (100%) diff --git a/sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md similarity index 100% rename from sources/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md rename to translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md From cd68a74f4fbb4b6f4d68da882d7a8b869dcbdcc2 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Thu, 26 Aug 2021 19:55:58 +0800 Subject: [PATCH 208/290] translated --- ...lude options in your Bash shell scripts.md | 180 ------------------ ...lude options in your Bash shell scripts.md | 172 +++++++++++++++++ 2 files changed, 172 insertions(+), 180 deletions(-) delete mode 100644 sources/tech/20210824 How to include options in your Bash shell scripts.md create mode 100644 translated/tech/20210824 How to include options in your Bash shell scripts.md diff --git a/sources/tech/20210824 How to include options in your Bash shell scripts.md b/sources/tech/20210824 How to include options in your Bash shell scripts.md deleted file mode 100644 index d800b4149e..0000000000 --- a/sources/tech/20210824 How to include options in your Bash shell scripts.md +++ /dev/null @@ -1,180 +0,0 @@ -[#]: subject: "How to include options in your Bash shell scripts" -[#]: via: "https://opensource.com/article/21/8/option-parsing-bash" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to include options in your Bash shell scripts -====== -Give your shell scripts options. -![Terminal commands][1] - -Terminal commands usually have [options or switches][2], which you can use to modify how the command does what it does. Options are included in the [POSIX specification][3] for command-line interfaces. It's also a time-honored convention established with the earliest UNIX applications, so it's good to know how to include them in your [Bash scripts][4] when you're creating your own commands. - -As with most languages, there are several ways to solve the problem of parsing options in Bash. To this day, my favorite method remains the one I learned from Patrick Volkerding's Slackware build scripts, which served as my introduction to shell scripting back when I first discovered Linux and dared to venture into the plain text files that shipped with the OS. - -### Option parsing in Bash - -The strategy for parsing options in Bash is to cycle through all arguments passed to your shell script, determine whether they are an option or not, and then shift to the next argument. Repeat this process until no options remain. - -Start with a simple Boolean option (sometimes called a _switch_ or a _flag_): - - -``` -#!/bin/bash - -while [ True ]; do -if [ "$1" = "--alpha" -o "$1" = "-a" ]; then -    ALPHA=1 -    shift 1 -else -    break -fi -done - -echo $ALPHA -``` - -In this code, I create a `while` loop which serves as an infinite loop until there are no further arguments to process. An `if` statement attempts to match whatever argument is found in the first position (`$1`) to either `--alpha` or `-a`. (These are arbitrary option names with no special significance. In an actual script, you might use `--verbose` and `-v` to trigger verbose output). - -The `shift` keyword causes all arguments to shift by 1, such that an argument in position 2 (`$2`) is moved into position 1 (`$1`). The `else` statement is triggered when there are no further arguments to process, which breaks the `while` loop. - -At the end of the script, the value of `$ALPHA` is printed to the terminal. - -Test the script: - - -``` -$ bash ./test.sh --alpha -1 -$ bash ./test.sh - -$ bash ./test.sh -a -1 -``` - -The option is correctly detected. - -### Detecting arguments in Bash - -There is a problem, though: Extra arguments are ignored. - - -``` -$ bash ./test.sh --alpha foo -1 -$ -``` - -To catch arguments that aren't intended as options, you can dump remaining arguments into a [Bash array][5]. - - -``` -#!/bin/bash - -while [ True ]; do -if [ "$1" = "--alpha" -o "$1" = "-a" ]; then -    ALPHA=1 -    shift 1 -else -    break -fi -done - -echo $ALPHA - -ARG=( "${@}" ) -for i in ${ARG[@]}; do -    echo $i -done -``` - -Test the new version of the script: - - -``` -$ bash ./test.sh --alpha foo -1 -foo -$ bash ./test.sh foo - -foo -$ bash ./test.sh --alpha foo bar -1 -foo -bar -``` - -### Options with arguments - -Some options require an argument all their own. For instance, you might want to allow the user to set an attribute such as a color or the resolution of a graphic or to point your application to a custom configuration file. - -To implement this in Bash, you can use the `shift` keyword as you do with Boolean switches but shift the arguments by 2 instead of 1. - - -``` -#!/bin/bash - -while [ True ]; do -if [ "$1" = "--alpha" -o "$1" = "-a" ]; then -    ALPHA=1 -    shift 1 -elif [ "$1" = "--config" -o "$1" = "-c" ]; then -    CONFIG=$2 -    shift 2 -else -    break -fi -done - -echo $ALPHA -echo $CONFIG - -ARG=( "${@}" ) - -for i in ${ARG[@]}; do -    echo $i -done -``` - -In this code, I add an `elif` clause to compare each argument to both `--config` and `-c`. In the event of a match, the value of a variable called `CONFIG` is set to the value of whatever the second argument is (this means that the `--config` option requires an argument). All arguments shift place by 2: 1 to shift `--config` or `-c`, and 1 to move its argument. As usual, the loop repeats until no matching arguments remain. - -Here's a test of the new version of the script: - - -``` -$ bash ./test.sh --config my.conf foo bar -my.conf -foo -bar -$ bash ./test.sh -a --config my.conf baz -1 -my.conf -baz -``` - -### Option parsing made easy - -There are other ways to parse options in Bash. You can alternately use a `case` statement or the `getopt` command. Whatever you choose to use, options for your users are important features for any application, and Bash makes it easy. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/option-parsing-bash - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/terminal-commands_1.png?itok=Va3FdaMB (Terminal commands) -[2]: https://opensource.com/article/21/8/linux-terminal#options -[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains -[4]: https://opensource.com/downloads/bash-scripting-ebook -[5]: https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays diff --git a/translated/tech/20210824 How to include options in your Bash shell scripts.md b/translated/tech/20210824 How to include options in your Bash shell scripts.md new file mode 100644 index 0000000000..6cedd174a9 --- /dev/null +++ b/translated/tech/20210824 How to include options in your Bash shell scripts.md @@ -0,0 +1,172 @@ +[#]: subject: "How to include options in your Bash shell scripts" +[#]: via: "https://opensource.com/article/21/8/option-parsing-bash" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Bash shell 脚本中解析命令行选项 +====== +把选项交给你的 shell 脚本吧。 +![Terminal commands][1] + +终端命令通常具有 [选项options or switches][2] 功能,用户可以使用选项来修改命令的执行方式。关于命令行接口的 [POSIX 规范][3] 中就对选项做出了规范,这也是基于最早的 UNIX 应用程序建立的一个由来已久的约定,因此你在创建自己的命令时,最好知道如何将选项包含进 [Bash 脚本][4] 中。 + +与大多数语言一样,有若干种方法可以解决 Bash 中解析选项的问题。但直到今天,我最喜欢的方法仍然是我从 Patrick Volkerding 的 Slackware 构建脚本中学到的方法,当我第一次得知 Linux 并勇于探索操作系统附带的纯文本文件时,它就是我关于 shell 脚本的引路人。 + +### Bash 中的选项解析 + +在 Bash 中解析选项的策略是循环遍历传递给 shell 脚本的所有参数,确定它们是否为选项,然后转移到下一个参数。重复这个过程,直到没有选项为止。 + + +``` +#!/bin/bash + +while [ True ]; do +if [ "$1" = "--alpha" -o "$1" = "-a" ]; then +    ALPHA=1 +    shift 1 +else +    break +fi +done + +echo $ALPHA +``` + +在这段代码中,我创建了一个 `while` 循环,它会一直进行循环操作,直到处理完所有参数。`if` 语句会试着将在第一个位置(`$1`)中找到的参数与 `--alpha` 或 `-a` 匹配。(此处的待匹配项是任意选项名称,并没有特殊意义。在实际的脚本中,你可以使用 `--verbose` 和 `-v` 来触发详细输出)。 + +`shift` 关键字会使所有参数向后移动一位,这样位置 2(`$2`)的参数移动到位置 1(`$1`)。处理完所有参数后会触发 else 语句,进而中断 while 循环。 + +在脚本的末尾,`$ALPHA` 的值会输出到终端。 + +测试一下这个脚本: + +``` +$ bash ./test.sh --alpha +1 +$ bash ./test.sh + +$ bash ./test.sh -a +1 +``` + +可以看到,选项被正确地检测到了。 + +### 在 Bash 中检测参数 + +但上面的脚本还有一个问题:多余的参数被忽略了。 + +``` +$ bash ./test.sh --alpha foo +1 +$ +``` + +要想捕获非选项名的参数,可以将剩余的参数转储到 [Bash 数组][5] 中。 + +``` +#!/bin/bash + +while [ True ]; do +if [ "$1" = "--alpha" -o "$1" = "-a" ]; then +    ALPHA=1 +    shift 1 +else +    break +fi +done + +echo $ALPHA + +ARG=( "${@}" ) +for i in ${ARG[@]}; do +    echo $i +done +``` + +测试一下新版的脚本: + +``` +$ bash ./test.sh --alpha foo +1 +foo +$ bash ./test.sh foo + +foo +$ bash ./test.sh --alpha foo bar +1 +foo +bar +``` + +### 带参选项 + +有一些选项需要传入参数。比如,你可能希望允许用户设置诸如颜色或图形分辨率之类的属性,或者将应用程序指向自定义配置文件。 + +要在 Bash 中实现这一点,你仍然可以像使用布尔选项一样使用 `shift` 关键字,但参数需要向后移动两位而不是一位。 + +``` +#!/bin/bash + +while [ True ]; do +if [ "$1" = "--alpha" -o "$1" = "-a" ]; then +    ALPHA=1 +    shift 1 +elif [ "$1" = "--config" -o "$1" = "-c" ]; then +    CONFIG=$2 +    shift 2 +else +    break +fi +done + +echo $ALPHA +echo $CONFIG + +ARG=( "${@}" ) + +for i in ${ARG[@]}; do +    echo $i +done +``` + +在这段代码中,我添加了一个 `elif` 子句来将每个参数与 `--config` 和 `-c` 进行比较。如果匹配,名为 `CONFIG` 的变量的值就设置为下一个参数的值(这就表示 `--config` 选项需要一个参数)。所有参数都后移两位:其中一位是跳过 `--config` 或 `-c`,另一位是跳过其参数。与上节一样,循环重复直到没有匹配的参数。 + +下面是新版脚本的测试: + +``` +$ bash ./test.sh --config my.conf foo bar +my.conf +foo +bar +$ bash ./test.sh -a --config my.conf baz +1 +my.conf +baz +``` + +### Bash 让选项解析变得简单 + +还有一些其他方法也可以解析 Bash 中的选项。你可以交替使用 `case` 语句或 `getopt` 命令。无论使用什么方法,用户选项都是应用程序的重要功能,而 Bash 让解析选项成为了一件简单的事。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/option-parsing-bash + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[unigeorge](https://github.com/unigeorge) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/terminal-commands_1.png?itok=Va3FdaMB (Terminal commands) +[2]: https://opensource.com/article/21/8/linux-terminal#options +[3]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[4]: https://opensource.com/downloads/bash-scripting-ebook +[5]: https://opensource.com/article/18/5/you-dont-know-bash-intro-bash-arrays From 944d399f796f92ee906a063001f0793ec6633696 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Aug 2021 05:03:19 +0800 Subject: [PATCH 209/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827=20?= =?UTF-8?q?How=20to=20Easily=20Install=20Debian=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210827 How to Easily Install Debian Linux.md --- ...0827 How to Easily Install Debian Linux.md | 252 ++++++++++++++++++ 1 file changed, 252 insertions(+) create mode 100644 sources/tech/20210827 How to Easily Install Debian Linux.md diff --git a/sources/tech/20210827 How to Easily Install Debian Linux.md b/sources/tech/20210827 How to Easily Install Debian Linux.md new file mode 100644 index 0000000000..7940aa2845 --- /dev/null +++ b/sources/tech/20210827 How to Easily Install Debian Linux.md @@ -0,0 +1,252 @@ +[#]: subject: "How to Easily Install Debian Linux" +[#]: via: "https://itsfoss.com/install-debian-easily/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Easily Install Debian Linux +====== + +Installing Debian could be easy or complicated depending upon the ISO you choose. + +If you go with the default ISO provided by the Debian website, you’ll have a hard time installing Debian. You’ll be stuck at a screen that asks for network drivers to be installed from external removable media. + +![Installing Debian from default ISO is problematic for new users][1] + +You may, of course, troubleshoot that, but it makes things unnecessarily complicated. + +Don’t worry. Let me show the steps for installing Debian comfortably and easily. + +### The easy way of installing Debian as a desktop + +Before you see the steps, please have a look at things you need. + + * A USB key (pen drive) with at least 4 GB in size. + * A system with internet connection (could be the same system where it will be installed). + * A system where you’ll be installing Debian. It will wipe out everything on this system so please copy your important data on some other external disk. + + + +What kind of system specification you should have for Debian? It depends on the [desktop environment][2] you are going to use. For example, GNOME desktop environment could work on 4 GB RAM but it will work a lot better on an 8 GB RAM. If you have 4 GB or less, try using KDE, Cinnamon or Xfce desktops. + +Debian also has both [32-bit and 64-bit architecture][3] support. You’ll have to get the Debian ISO according to your processor architecture. + +Your system should have at least 25 GB of disk space to function. The more, the merrier. + +Warning! + +This method removes all the other operating systems along with the data present on the disk. + +You may save your personal files, documents, pictures etc on an external USB disk or cloud storage if you want to use it later. + +In this tutorial, I am going to show the steps for installing Debian 11 Bullseye with GNOME desktop environment. The steps should be the same even if you choose some other desktop environment. + +_**This tutorial is tested on a UEFI system with GPT partitioning. If you have [MBR instead of GPT][4] or [legacy BIOS instead of UEFI][5], the live USB creation step will be different.**_ + +#### Step 1: Getting the correct Debian ISO + +Half of the battle in installing Debian is choosing the correct ISO. Surprisingly, it is really difficult to navigate through its website and find that ISO which is the easiest for a new Debian user. + +If you click the Download button on the [homepage of Debian website][6], it downloads a minimal net install file which will be super complicate for a regular user. Please DO NOT use this. + +Instead, you should go for the live ISO. But here is a catch, there are separate live versions with non-free software (includes drivers for your networking hardware). + +You should download this non-free live ISO. Another problem here is that you won’t get it mentioned prominently on the website and there are various URLs for torrents or direct downloads for various architecture. + +Let me link them here. + +[Main repo for 32 and 64 bit][7] + +[Debian 11 Direct][8] + +[Debian 11 Torrent][9] + +You’ll see several files with the of desktop environment mentioned in the filename. Choose the one with desktop environment of your choice. For direct downloads, click on the links that end with .iso. + +![Downloading the Debian Live Non-free ISO][10] + +Once you have the appropriate ISO downloaded, the rest is standard procedure that you may have experienced with other Linux distributions. + +#### Step 2: Creating live USB of Debian + +Plug in the USB into your system. It will be wise to format it just for the sake of it. It will be formatted anyway. + +You can use any live USB creation tool of your choice. If you are using Windows, go with Rufus. I am going to use Etcher here because it is available for both Windows and Linux. + +Download Etcher from its website. + +[Download Etcher][11] + +I have a dedicated [tutorial on using Etcher in Linux][12] and thus I am not going to go in detail here. Just run the downloaded executable file, browse to the Debian ISO, make sure that correct USB is selected and then hit the Flash button. + +![Creating Live Debian USB with Etcher][13] + +It may take a couple of minutes to create the live USB. Once that is ready, it is time to boot from it. + +#### Step 3: Boot from the live USB + +Restart the system where you want to install Debian. When it is showing the manufacturer’s logo, press F2/F10 or F12 key to access the boot settings. You may also [access the UEFI firmware settings from Windows.][14] + +Some systems do not allow booting from live USB if secure boot is enabled. If that is the case, please [disable secure boot from the BIOS settings][15]. + +The screen may look different for different manufacturers. + +![][16] + +Once you make the change, press F10 to save and exit. Your system will boot once again. + +Again, press F2/F10 or F12 to access the boot settings when it shows the manufacturer’s logo. You should see the option to boot from the USB. Select it. + +![][17] + +It takes a little bit of time and then you should see a screen like this. Go with the first option here. + +![Debian live boot screen][18] + +#### Step 4: Start Debian installation + +When you enter the live Debian session, it may show some welcome screen with option to choose your keyboard and language if you are using GNOME desktop. Just hit next when you see those screens. + +![Debian live welcome screen][19] + +Once you are past the welcome screen, press the Windows/Super key to bring the activity area. You should see the Debian install button here. + +![Start Debian Installation][20] + +It opens the friendly [Calamares graphical installer][21]. Things are pretty straightforward from here. + +![Debian 11 Calamares graphical installer][22] + +It asks you to select your geographical location and time zone. + +![Select your location and time zone][23] + +On the next screen, you’ll be asked to select the keyboard. Please **pay attention** here. Your keyboard is automatically selected based on your location. For example, I had used India as my location and it automatically set the default Indian keyboard with Hindi language. I had to change it to English India. + +![Choosing keyboard layout][24] + +The next screen is about the disk partition and where you would like to install Debian. In this case, you are going to install Debian as the only operating system on your computer. + +The easiest option would to go with ‘Erase disk’ option. Debian will put everything under root except the mandatory ESP partition and Swap space. In fact, it shows what your disk would like after your chosen installation method. + +![Disk partitioning][25] + +If you want to take matter in your hands, you may also opt for manual partitioning and choose how much you want to allot to root, home, boot or swap. Only do that when you know what you are doing. + +On the next screen, you have to provide the username and password. It does not set root password and keeps it empty. + +![Set Username and password][26] + +This also means that you can use sudo with the newly created user. In the ‘complicated Debian install’, you could also set root password but then you’ll have to add the normal user to sudoer list manually. See, this installation method is easier for beginners, right? + +Before it goes on with the actual installation, it presents you with a summary of the choices you have made. If things look good, hit the install button. + +![Summary of your installation choices][27] + +Now it is just a matter of waiting for the installation to finish. + +![Installing Debian][28] + +It takes a few minutes to complete the installation. When the installation finishes, it asks for a restart. + +![Finished Debian installation][29] + +Restart your system and if everything goes well, you should see the grub screen with Debian. + +![Debian boot screen][30] + +### Troubleshooting tip (if your system does not boot into Debian) + +In my case, my Dell system did not recognize any operating system to boot. This was weird because I had see Debian creating an ESP partition. + +If it is the same case with you, go to BIOS settings. Check the boot sequence. If you do not see anything, click on the Add boot option. + +![Add new boot option][31] + +It should give you an option to add an EFI file. + +![Browse to EFi file][32] + +Since Debian created ESP partition during installation, there is an EFI directory created with necessary files. + +![Select EFI directory][33] + +It should show a Debian folder along with some other folders. Select Debian folder. + +![Select Debian][34] + +In this Debian folder, you’ll find files like grubx64.efi, shimx64.efi. Select shimx64.efi. + +![Select shim.efi][35] + +You may give this file an appropriate name. The final screen may look like this. + +![Adding the new boot option with efi file][36] + +Now, you should have this boot option. Since I named it Debian, it shows two Debian boot options (one of them coming from the efi file I guess). Press F10 to save and exit the BIOS settings. + +![New boot option added][37] + +When your system boots now, you should see the grub screen with Debian boot option. You can start enjoying Debian now. + +![][30] + +### Were you able to install Debian? + +I hope I made things simpler here. It is not that you cannot install Debian from the default net installer ISO. It just takes (a lot) more effort. + +Was this tutorial helpful for you in installing Debian? Are you still facing issues? Please let me know in the comment section and I’ll try to help you out. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-debian-easily/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1 +[2]: https://itsfoss.com/what-is-desktop-environment/ +[3]: https://itsfoss.com/32-bit-64-bit-ubuntu/ +[4]: https://itsfoss.com/check-mbr-or-gpt/ +[5]: https://itsfoss.com/check-uefi-or-bios/ +[6]: https://www.debian.org/ +[7]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/ +[8]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/amd64/iso-hybrid/ +[9]: https://cdimage.debian.org/images/unofficial/non-free/images-including-firmware/11.0.0-live+nonfree/amd64/bt-hybrid/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/downloading-Debian-live-non-free-iso.png?resize=800%2C490&ssl=1 +[11]: https://www.balena.io/etcher/ +[12]: https://itsfoss.com/install-etcher-linux/ +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/creating-live-debian-usb-with-etcher-800x518.png?resize=800%2C518&ssl=1 +[14]: https://itsfoss.com/access-uefi-settings-windows-10/ +[15]: https://itsfoss.com/disable-secure-boot-windows/ +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2014/05/Disable_Secure_Boot_Windows8.jpg?resize=700%2C525&ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/04/boot-from-windows-disk-ventoy.jpg?resize=800%2C611&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-live-boot-screen.png?resize=617%2C432&ssl=1 +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-live-welcome-screen.png?resize=800%2C450&ssl=1 +[20]: https://itsfoss.com/wp-content/uploads/2021/08/start-Debian-installation-800x473.webp +[21]: https://calamares.io/ +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-1.png?resize=800%2C441&ssl=1 +[23]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-2-800x441.webp +[24]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-4-800x441.webp +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-5.png?resize=800%2C441&ssl=1 +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-6.png?resize=800%2C441&ssl=1 +[27]: https://itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-7-800x500.webp +[28]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-8.png?resize=800%2C500&ssl=1 +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Installing-Debian-9.png?resize=800%2C500&ssl=1 +[30]: https://itsfoss.com/wp-content/uploads/2021/08/debian-boot-screen.webp +[31]: https://itsfoss.com/wp-content/uploads/2021/08/add-new-boot-option.webp +[32]: https://itsfoss.com/wp-content/uploads/2021/08/add-efi-file-for-boot-option.webp +[33]: https://itsfoss.com/wp-content/uploads/2021/08/select-efi-file-boot-option.webp +[34]: https://itsfoss.com/wp-content/uploads/2021/08/select-debian-folder-for-uefi.webp +[35]: https://itsfoss.com/wp-content/uploads/2021/08/select-shim-boot.webp +[36]: https://itsfoss.com/wp-content/uploads/2021/08/new-boot-option.webp +[37]: https://itsfoss.com/wp-content/uploads/2021/08/new-boot-option-added.webp From a035cc4b88a9b85c3e3520ee9bfb16038ea638c9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Aug 2021 05:05:46 +0800 Subject: [PATCH 210/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210826=20?= =?UTF-8?q?30=20things=20you=20didn't=20know=20about=20the=20Linux=20kerne?= =?UTF-8?q?l?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210826 30 things you didn-t know about the Linux kernel.md --- ... you didn-t know about the Linux kernel.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20210826 30 things you didn-t know about the Linux kernel.md diff --git a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md new file mode 100644 index 0000000000..82a3673941 --- /dev/null +++ b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md @@ -0,0 +1,100 @@ +[#]: subject: "30 things you didn't know about the Linux kernel" +[#]: via: "https://opensource.com/article/21/8/linux-kernel" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +30 things you didn't know about the Linux kernel +====== +The Linux kernel is turning 30 this year. +![30 years][1] + +The Linux kernel is turning 30 this year. That's three decades of pioneering open source software, enabling users to run free software, to learn from the applications they're running, and to share what they've learned with friends. It's argued that without the Linux kernel, the luxuries of [open culture][2] and free software we enjoy today may not have surfaced when they have. It's highly improbable that the parts of Apple and Microsoft and Google that are open would be open at all without Linux as the catalyst. The impact of Linux as a phenomenon for culture, software development, and user experience cannot be overstated, and yet it all started with a kernel. + +A kernel is the software that boots a computer, recognizes—and ensures communication between—all of the components attached to the computer, both inside and outside of the computer case. For code that most users never even think about, much less understand, there are a lot of surprises about the Linux kernel. In no particular order, here's one fact about the kernel for each year of its life: + + 1. Linux was the first operating system to feature USB 3.0 drivers. Sarah Sharp announced on 7 June 2009 that her driver for USB 3.0 devices was available, and her code was included in kernel version 2.6.31 + + 2. The kernel marks itself as `tainted` when some event occurs that could be useful later for troubleshooting. It’s not a problem to run a "tainted" kernel. Should something go wrong, one of the first troubleshooting steps is to try to reproduce the issue on a non-tainted kernel. + + 3. You can specify a hostname or domain name as part of the `ip=` command-line option, Linux preserves it instead of overwriting it with one proposed by DHCP or BOOTP. For instance, `ip=::::myhostname::dhcp` gets the name `myhostname`. + + 4. There's a version of a black-and-white, 16-color, and 224-color Tux logo during text bootup. + + 5. In the entertainment business, DRM is technology used to prevent access to media. However, in the Linux kernel DRM refers to Direct Rendering Manager and refers to library (libdrm) and drivers used to interface with the GPUs of video cards. + + 6. It's possible to patch the Linux kernel without rebooting. + + 7. If you compile your own kernel, you can configure your text console to have more than 80 columns. + + 8. The Linux kernel provides built-in FAT, exFAT, and NTFS (read and write) compatibility. + + 9. Drivers for Wacom tablets and many similar devices are built into the kernel. + + 10. Most kernel hackers use the `git send-email` to submit patches. + + 11. The kernel uses a documentation toolchain called [Sphinx][3], which is written in Python. + + 12. Hamlib provides shared libraries with a standardized API to control amateur radio equipment through your Linux computer. + + 13. Hardware manufacturers are encouraged to help develop the kernel in order to ensure compatibility. The hardware can thus be addressed directly without having to download a driver from the manufacturer. Drivers that are directly part of the kernel also automatically benefit from performance and security improvements in new versions of the kernel. + + 14. There are drivers included in the kernel for many Raspberry Pi modules (Pi Hats). + + 15. The band netcat released an album playable only as a [Linux kernel module.][4] + + 16. Inspired by netcat's album release, a module to [turn your kernel into a music player][5] has also been developed. + + 17. The Linux kernel features supports many CPU architectures: ARM, ARM64, IA-64, m68k, MIPS, Nios II, PA-RISC, OpenRISC, PowerPC, s390, Sparc, x86, Xtensa, and more. + + 18. In 2001, the Linux kernel became the first to [run the x86-64 CPU architecture in long mode][6]. + + 19. Linux version 3.4 introduced the x32 ABI, allowing developers to compile code to run in 64-bit mode while only using 32-bit pointers and data fields. + + 20. The kernel supports many different file systems, including Ext2, Ext3, Ext4, JFS, XFS, GFS2, GCFS2, BtrFS, NILFS2, NFS, Overlay FS, UDF, and more. + + 21. The Virtual File System is a software layer in the kernel providing the filesystem interface to applications users run. It's also an abstraction for the kernel so that different filesystem implementations can coexist. + + 22. The Linux kernel includes a driver for a physical Braille output device. + + 23. For kernel version 2.6.29, the Tux logo during boot was replaced by "Tuz" to raise awareness of an aggressive cancer that was affecting the Tasmanian Devil population in Australia at the time. + + 24. Control Groups (cgroups) are the reason containers (the foundation technology for Docker, Podman, Kubernetes, and much more) can exist. + + 25. It took extensive legal action to liberate it so it could be included, but today the CIFS module is built into the kernel to enable SMB support. This allows Linux to mount Microsoft remote and cloud-based file shares. + + 26. It's notoriously difficult (in fact impossible, so far) for a computer to produce a truly random number. The `hw_random` framework can make use of special hardware features on your CPU or motherboard in an effort to improve random number generation. + + 27. _OS jitter_ is interference experienced by an application caused by conflicts in how background processes are scheduled, and how the system handles asynchronous events (such as interrupts.) Binding tasks to sets of CPUs defined by the kernel, using cgroups, and SMP IRQ affinity are options that the kernel provides programmers for reducing OS jitter. Issues like these are discussed in detail in the kernel documentation, helping programmers targeting Linux can write smarter code. + + 28. The `make menuconfig` command allows you to use a GUI to configure a kernel before compiling. The `Kconfig` language defines kernel config options. + + 29. For essential Linux servers, a _watchdog_ system can be implemented to monitor the health of the server. Between health checks, the watchdog daemon writes data to a special watchdog kernel device, preventing a system reset. Should a watchdog fail to log success, the system is reset. Many implementations of watchdog hardware exist, and they're vital for remote mission critical computers (such as those sent to Mars.) + + 30. Although it was developed on Earth, there's a copy of the Linux kernel on the planet Mars. + + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-kernel + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/kernel-30.png?itok=xmwX2pCQ (30 years) +[2]: https://opensource.com/article/18/1/creative-commons-real-world +[3]: https://opensource.com/article/19/11/document-python-sphinx +[4]: https://github.com/usrbinnc/netcat-cpi-kernel-module +[5]: https://github.com/FlaviaR/Netcat-Music-Kernel-Expansion +[6]: http://www.x86-64.org/pipermail/announce/2001-June/000020.html From 983cce526bd604b16cce1bfdef449c1ae14d3a83 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Aug 2021 05:07:01 +0800 Subject: [PATCH 211/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210826=20?= =?UTF-8?q?=E2=80=9CApps=20for=20GNOME=E2=80=9D=20is=20a=20New=20Web=20Por?= =?UTF-8?q?tal=20to=20Showcase=20Best=20Linux=20Apps=20for=20GNOME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md --- ...l to Showcase Best Linux Apps for GNOME.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md diff --git a/sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md b/sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md new file mode 100644 index 0000000000..6e24a612a3 --- /dev/null +++ b/sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md @@ -0,0 +1,81 @@ +[#]: subject: "“Apps for GNOME” is a New Web Portal to Showcase Best Linux Apps for GNOME" +[#]: via: "https://news.itsfoss.com/apps-for-gnome-portal/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +“Apps for GNOME” is a New Web Portal to Showcase Best Linux Apps for GNOME +====== + +There are several apps built for GNOME. Most of the stock (default) GNOME apps do not get enough spotlight as a separate mention. + +While Flathub as a platform helps highlight some fantastic applications for GNOME, it limits to Flatpak apps only. + +Also, it is not just dedicated to GNOME, of course. + +Hence, there is a new website to focus more on the GNOME ecosystem and highlight the best GNOME apps. + +### Apps for GNOME + +![][1] + +A [blog post][2] by Sophie Herold on Planet GNOME announced the availability of the platform. + +[apps.gnome.org][3] is where you can find all the GNOME apps, both default and third-party applications tailored primarily for the GNOME environment. + +With this portal, they aim to encourage users to participate and contribute to the development of such applications. + +When you head to explore an app on the platform, you will be presented with plenty of information that includes where to submit feedback for the app, help translate, and contribute financially. + +![][4] + +It is not something out-of-the-box, but it presents all the information related to a GNOME app in a single place. + +You get a complete picture for a GNOME app starting with the description, screenshots, latest version, information about the maintainers, and translation status. + +![][5] + +Not just limited to desktop GNOME apps, but you will also find applications marked with a mobile icon if it is supported on GNOME mobile devices. + +In addition to the key GNOME apps, it also aims to feature applications that do not offer a flatpak package but suits well for the GNOME platform. + +[Apps for GNOME][3] + +### Making Information More Accessible + +I find it much more insightful than what Flathub seems to provide. And, I think this is not just going to help highlight GNOME apps, but it should help new users get to know more about the applications they use. + +Of course, it should also encourage users to get involved, which is the primary focus. + +While KDE already had an [application portal][6], it might need an upgrade if they take Apps for GNOME as an example to improve. + +_What do you think about the Apps for GNOME initiative?_ _Feel free to share your thoughts in the comments._ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/apps-for-gnome-portal/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://blogs.gnome.org/sophieh/2021/08/26/apps-gnome-org-is-online/ +[3]: https://apps.gnome.org +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3OSIgd2lkdGg9Ijc0NCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://apps.kde.org From 492f0ce1ebbc2dd6b75eb635617fc3342bb72174 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 27 Aug 2021 05:07:14 +0800 Subject: [PATCH 212/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210826=20?= =?UTF-8?q?Open=20Source=20Video=20Editor=20OpenShot=202.6=20Released=20Wi?= =?UTF-8?q?th=20AI=20Effects=20&=20Major=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md --- ...ed With AI Effects - Major Improvements.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md diff --git a/sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md b/sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md new file mode 100644 index 0000000000..a69fcdee8f --- /dev/null +++ b/sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md @@ -0,0 +1,122 @@ +[#]: subject: "Open Source Video Editor OpenShot 2.6 Released With AI Effects & Major Improvements" +[#]: via: "https://news.itsfoss.com/openshot-2-6-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open Source Video Editor OpenShot 2.6 Released With AI Effects & Major Improvements +====== + +OpenShot is one of the most popular [open-source video editors][1] out there. + +It is not just for Linux, but it is an impressive free video editor for Windows and Mac users as well. + +While it was already a functional, easy-to-use, feature-rich video editor, it stepped up a notch with the latest release. + +Here, we discuss some key additions in OpenShot 2.6.0 release. + +### OpenShot 2.6.0 Released: What’s New? + +![][2] + +The primary highlight of this release is the inclusion of AI and computer vision effects. But, there is more to it than meets the eye. + +Here are the highlights for OpenShot 2.6.0 changes: + + * New AI and computer vision effects + * New audio effects + * New zoom slider + * Improved transform tool + * Improved video effects + * Improved snapping + * More emoji support + * Improved performance + * Bug fixes + + + +Considering the fundamental changes, OpenShot is now a more compelling option for professional video editors. + +![Official YouTube video for OpenShot 2.6][3] + +### AI Effects + +Taking the help of an AI to process images/videos is becoming increasingly common these days. + +Hence, OpenShot adds the support for AI effects to make it easier to enhance and edit videos. + +One of the features includes eliminating any shake/motion in a video by calculating it. + +![][4] + +You can also track particular objects in a video. This is undoubtedly helpful for animation or any other creative work where you need to follow a specific element of the video. + +Like a real-time feed where the camera detects vehicles, it can also identify objects in the video. While this feature is in beta, it should be fun to experiment with it. + +### Audio Effects + +OpenShot video editor featured most of the essential audio effects. And, in this release, some more important audio effects have been added that include: + + * Compressor + * Expander + * Echo + * Delay + * Distortion + * Noise + * EQ + * Robotic voice and whispering voice effects + + + +### New & Improved Tools + +![][5] + +Vital tools in snapping and transform mode have been improved. + +The improved transform tool lets you resize, rotate, and work seamlessly to create complex animations. + +Furthermore, when trimming the clip, the snapping tool allows you better align the edges of the clips. + +A new zoom slider tool has been added to give you better control over the timeline. You can easily drag and work with a specific portion of the timeline as needed. + +### Other Improvements + +In addition to the essential changes, you can find performance improvements and numerous bug fixes. + +You can find the latest version as an AppImage file as of now. It should reflect soon in the Flathub repository and other sources as well. Consider reading [how to use AppImage files][6] if you are not aware of it. + +[Download OpenShot 2.6.0][7] + +To explore more about the release, you may refer to the [official release announcement][8]. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/openshot-2-6-release/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/open-source-video-editors/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://i0.wp.com/i.ytimg.com/vi/06sgvsYB378/hqdefault.jpg?w=780&ssl=1 +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://itsfoss.com/use-appimage-linux/ +[7]: https://www.openshot.org/download/ +[8]: https://www.openshot.org/blog/2021/08/25/new_openshot_release_260/ From 18eaf80ba2f55e240f03a0d6c502856f01eb5263 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 27 Aug 2021 08:37:04 +0800 Subject: [PATCH 213/290] translated --- ...one on Linux with this open source tool.md | 107 ------------------ ...one on Linux with this open source tool.md | 107 ++++++++++++++++++ 2 files changed, 107 insertions(+), 107 deletions(-) delete mode 100644 sources/tech/20210823 Access your iPhone on Linux with this open source tool.md create mode 100644 translated/tech/20210823 Access your iPhone on Linux with this open source tool.md diff --git a/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md b/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md deleted file mode 100644 index e5c4093684..0000000000 --- a/sources/tech/20210823 Access your iPhone on Linux with this open source tool.md +++ /dev/null @@ -1,107 +0,0 @@ -[#]: subject: "Access your iPhone on Linux with this open source tool" -[#]: via: "https://opensource.com/article/21/8/libimobiledevice-iphone-linux" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Access your iPhone on Linux with this open source tool -====== -Communicate with iOS devices from Linux by using Libimobiledevice. -![A person looking at a phone][1] - -The iPhone and iPad aren't by any means open source, but they're popular devices. Many people who own an iOS device also happen to use a lot of open source, including Linux. Users of Windows and macOS can communicate with an iOS device by using software provided by Apple, but Apple doesn't support Linux users. Open source programmers came to the rescue back in 2007 (just a year after the iPhone's release) with Libimobiledevice (then called libiphone), a cross-platform solution for communicating with iOS. It runs on Linux, Android, Arm systems such as the Raspberry Pi, Windows, and even macOS. - -Libimobiledevice is written in C and uses native protocols to communicate with services running on iOS devices. It doesn't require any libraries from Apple, so it's fully free and open source. - -Libimobiledevice is an object-oriented API, and there are a number of terminal utilities that come bundled with it for your convenience. The library supports Apple's earliest iOS devices all the way up to its latest models. This is the result of years of research and development. Applications in the project include **usbmuxd**, **ideviceinstaller**, **idevicerestore**, **ifuse**, **libusbmuxd**, **libplist**, **libirecovery**, and **libideviceactivation**. - -### Install Libimobiledevice on Linux - -On Linux, you may already have **libimobiledevice** installed by default. You can find out through your package manager or app store, or by running one of the commands included in the project: - - -``` -`$ ifuse --help` -``` - -You can install **libimobiledevice** using your package manager. For instance, on Fedora or CentOS: - - -``` -`$ sudo dnf install libimobiledevice ifuse usbmuxd` -``` - -On Debian and Ubuntu: - - -``` -`$ sudo apt install usbmuxd libimobiledevice6 libimobiledevice-utils` -``` - -Alternatively, you can [download][2] and install **libimobiledevice** from source code. - -### Connecting your device - -Once you have the required packages installed, connect your iOS device to your computer. - -Make a directory as a mount point for your iOS device. - - -``` -`$ mkdir ~/iPhone` -``` - -Next, mount the device: - - -``` -`$ ifuse ~/iPhone` -``` - -Your device prompts you to trust the computer you're using to access it. - -![iphone prompts to trust the computer][3] - -Figure 1: The iPhone prompts you to trust the computer. - -Once the trust issue is resolved, you see new icons on your desktop. - -![iphone icons appear on desktop][4] - -Figure 2: New icons for the iPhone appear on the desktop. - -Click on the **iPhone** icon to reveal the folder structure of your iPhone. - -![iphone folder structure displayed][5] - -Figure 3: The iPhone folder structure is displayed. - -The folder I usually access most frequently is **DCIM**, where my iPhone photos are stored. Sometimes I use these photos in articles I write, and sometimes there are photos I want to enhance with open source applications like Gimp. Having direct access to the images instead of emailing them to myself is one of the benefits of using the Libimobiledevice utilities. I can copy any of these folders to my Linux computer. I can create folders on the iPhone and delete them too. - -### Find out more - -[Martin Szulecki][6] is the lead developer for the project. The project is looking for developers to add to their [community][7]. Libimobiledevice can change the way you use your peripherals, regardless of what platform you're on. It's another win for open source, which means it's a win for everyone. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/libimobiledevice-iphone-linux - -作者:[Don Watkins][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/don-watkins -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_mobile_phone.png?itok=RqVtvxkd (A person looking at a phone) -[2]: https://github.com/libimobiledevice/libimobiledevice/ -[3]: https://opensource.com/sites/default/files/1trust_0.png -[4]: https://opensource.com/sites/default/files/2docks.png -[5]: https://opensource.com/sites/default/files/2iphoneicon.png -[6]: https://github.com/FunkyM -[7]: https://libimobiledevice.org/#community diff --git a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md b/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md new file mode 100644 index 0000000000..e10a8683ef --- /dev/null +++ b/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md @@ -0,0 +1,107 @@ +[#]: subject: "Access your iPhone on Linux with this open source tool" +[#]: via: "https://opensource.com/article/21/8/libimobiledevice-iphone-linux" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用这个开源工具在 Linux 上访问你的 iPhone +====== +过使用 Libimobiledevice 从 Linux 与 iOS 设备进行通信。 +![A person looking at a phone][1] + +iPhone 和 iPad 决不是开源的,但它们是流行的设备。许多拥有 iOS 备的人恰好也在使用大量的开源,包括 Linux。Windows 和 macOS 的用户可以通过使用苹果提供的软件与 iOS 设备通信,但苹果不支持 Linux 用户。开源程序员早在 2007 年(就在 iPhone 发布一年后)就以 Libimobiledevice(当时叫 libiphone)来拯救了人们,这是一个与 iOS 通信的跨平台解决方案。它可以在 Linux、Android、Arm 系统(如 Raspberry Pi)、Windows、甚至 macOS 上运行。 + +Libimobiledevice 是用 C 语言编写的,使用原生协议与 iOS 设备上运行的服务进行通信。它不需要苹果公司的任何库,所以它是完全免费和开源的。 + +Libimobiledevice 是一个面向对象的 API,有许多终端工具与它捆绑在一起,以方便你使用。该库支持苹果最早的 iOS 设备,一直到其最新的型号。这是多年来研究和开发的结果。该项目中的应用包括 **usbmuxd**、**ideviceinstaller**、**idevicerestore**、**ifuse**、**libusbmuxd**、**libplist**、**libirecovery**、和 **libideviceactivation**。 + +### 在 Linux 上安装 Libimobiledevice + +在 Linux 上,你可能已经默认安装了 **libimobiledevice**。你可以通过你的软件包管理器或应用商店找到,或者通过运行项目中包含的一个命令: + + +``` +`$ ifuse --help` +``` + +你可以用你的包管理器安装 **libimobiledevice**。例如,在 Fedora 或 CentOS 上: + + +``` +`$ sudo dnf install libimobiledevice ifuse usbmuxd` +``` + +在 Debian 和 Ubuntu 上: + + +``` +`$ sudo apt install usbmuxd libimobiledevice6 libimobiledevice-utils` +``` + +或者,你可以从源代码[下载][2]并安装 **libimobiledevice**。 + +### 连接你的设备 + +当你安装了所需的软件包,将你的 iOS 设备连接到你的电脑。 + +为你的 iOS 设备建立一个目录作为挂载点。 + + +``` +`$ mkdir ~/iPhone` +``` + +接下来,挂载设备: + + +``` +`$ ifuse ~/iPhone` +``` + +你的设备提示你信任你用来访问它的电脑。 + +![iphone prompts to trust the computer][3] + +图 1:iPhone 提示你要信任电脑。 + +信任问题解决后,你会在桌面上看到新的图标。 + +![iphone icons appear on desktop][4] + +图 2:iPhone 的新图标出现在桌面上。 + +点击 **iPhone** 图标,显示出你的 iPhone 的文件夹结构。 + +![iphone folder structure displayed][5] + +图 3:显示了 iPhone 的文件夹结构。 + +我通常最常访问的文件夹是 **DCIM**,那里存放着我的 iPhone 照片。有时我在写文章时使用这些照片,有时有一些照片我想用 Gimp 等开源应用来增强。可以直接访问这些图片,而不是通过电子邮件把它们发给我自己,这是使用 Libimobiledevice 工具的好处之一。我可以把这些文件夹中的任何一个复制到我的 Linux 电脑上。我也可以在 iPhone 上创建文件夹并删除它们。 + +### 发现更多 + +[Martin Szulecki][6] 是该项目的首席开发者。该项目正在寻找开发者加入他们的[社区][7]。Libimobiledevice 可以改变你使用外设的方式,而无论你在什么平台上。这是开源的又一次胜利,这意味着它是所有人的胜利。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/libimobiledevice-iphone-linux + +作者:[Don Watkins][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_mobile_phone.png?itok=RqVtvxkd (A person looking at a phone) +[2]: https://github.com/libimobiledevice/libimobiledevice/ +[3]: https://opensource.com/sites/default/files/1trust_0.png +[4]: https://opensource.com/sites/default/files/2docks.png +[5]: https://opensource.com/sites/default/files/2iphoneicon.png +[6]: https://github.com/FunkyM +[7]: https://libimobiledevice.org/#community From c3457159e19e4fcea1c4b53107c1ad1249f81548 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 27 Aug 2021 08:39:58 +0800 Subject: [PATCH 214/290] translating --- .../tech/20210823 Apps for daily needs part 4- audio editors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210823 Apps for daily needs part 4- audio editors.md b/sources/tech/20210823 Apps for daily needs part 4- audio editors.md index 39d770f224..e3ce8c80df 100644 --- a/sources/tech/20210823 Apps for daily needs part 4- audio editors.md +++ b/sources/tech/20210823 Apps for daily needs part 4- audio editors.md @@ -2,7 +2,7 @@ [#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/" [#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From dd2aaa94636ec3fd44782ec2122e2ebeb5d7d587 Mon Sep 17 00:00:00 2001 From: SamMa Date: Fri, 27 Aug 2021 09:09:49 +0800 Subject: [PATCH 215/290] Update 20210817 Automatically Synchronize Subtitle With Video Using SubSync.md --- ...onize Subtitle With Video Using SubSync.md | 34 +++++++++---------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md index 6359d7c616..a71236acde 100644 --- a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md +++ b/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -3,36 +3,36 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " -使用 SubSync 自动将字幕与视频同步化 +使用 SubSync 自动同步视频字幕 ====== -让我分享一个场景。你正试图观看一部电影或视频,你需要字幕。你下载了字幕,却发现字幕没有正确同步。没有其他好的字幕可用。现在该怎么做? +让我分享一个场景:当你试图观看一部电影或视频时,你需要字幕。你下载字幕后,却发现字幕没有正确同步。没有其他好的字幕可用。现在该怎么做? -你可以[在 VLC 中按 G 或 H 键来同步字幕][1]。它为字幕增加了一个延迟。如果字幕在整个视频中以相同的时间间隔不同步,这可能会起作用。但如果不是这种情况,SubSync 在这里会有很大帮助。 +你可以[在 VLC 中按 G 或 H 键来同步字幕][1]。它为字幕增加了延迟。如果字幕在整个视频中的时间延迟相同,这可能会起作用。否则,SubSync 将提供很大帮助。 ### SubSync: 字幕语音同步器 -[SubSync][2] 是一个灵巧的开源工具,可用于 Linux、macOS 和 Windows。 +[SubSync][2] 是一款实用的开源工具,可用于 Linux、macOS 和 Windows。 -它通过收听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也可以被翻译,但我没有测试这个功能。 +它通过监听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也支持翻译,但我没有测试这个功能。 -我做了一个简单的测试,使用一个与我正在播放的视频不同步的字幕。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 +我通过播放一个视频不同步的字幕进行了一个简单的测试。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 使用 SubSync 很简单。你启动应用,它要求你添加字幕文件和视频文件。 -![User interface for SubSync][3] +![ SubSync 用户界面][3] -你必须在界面上指定字幕和视频的语言。它可能会根据使用的语言下载额外的资源。 +你必须在界面上选择字幕和视频的语言。它可能会根据选择的语言下载额外的资源。 -![SubSync may download additional packages for language support][4] +![SubSync 可下载附加语言支持包][4] 请记住,同步字幕需要一些时间,这取决于视频和字幕的长度。在等待过程完成时,你可以拿起你的茶/咖啡或啤酒。 -你可以看到正在进行的同步状态,甚至可以在完成之前保存它。 +你可以看到正在进行同步的状态,甚至可以在完成之前保存它。 ![SubSync synchronization in progress][5] @@ -40,27 +40,27 @@ ![Synchronization completed][6] -我不能说它在所有情况下都能工作,但在我运行的样本测试中它是有效的。 +我不能保证所有情况下都能正常工作,但在我运行的样本测试中它是正常的。 ### 安装 SubSync SubSync 是一个跨平台的应用,你可以从它的[下载页面][7]获得 Windows 和 MacOS 的安装文件。 -对于 Linux 用户,SubSync 是作为一个 Snap 包提供的。如果你的发行版已经启用了 Snap 支持,使用下面的命令来安装 SubSync: +对于 Linux 用户,SubSync 是作为一个 Snap 包提供的。如果你的发行版已经提供了 Snap 支持,使用下面的命令来安装 SubSync: ``` sudo snap install subsync ``` -请记住,下载 SubSync snap 包将需要一些时间。所以要有一个良好的网络连接或足够的耐心。 +请记住,下载 SubSync snap 包将需要一些时间。所以要有一个稳定的网络连接或足够的耐心。 ### 最后 就我个人而言,我对字幕很上瘾。即使我在 Netflix 上看英文电影,我也会把字幕打开。它有助于清楚地理解每段对话,特别是在有强烈口音的情况下。如果没有字幕,我永远无法理解[电影 Snatch 中 Mickey O'Neil(由 Brad Pitt 扮演)的一句话][8]。 -使用 SubSync 比[使用 Subtitle Editor][9] 同步字幕要容易得多。在[企鹅字幕播放器][10]之后,对于像我这样在整个互联网上搜索不同国家的稀有或推荐(神秘)电影的人来说,这是另一个很棒的工具。 +使用 SubSync 比[ Subtitle Editor][9] 同步字幕要容易得多。在[企鹅字幕播放器][10]之后,对于像我这样在整个互联网上搜索不同国家的冷门或推荐(神秘)电影的人来说,这是另一个很棒的工具。 -如果你是一个“字幕用户”,我感觉你会喜欢这个工具。如果你使用过它,请在评论区分享你的使用经验。 +如果你是一个“字幕用户”,你会喜欢这个工具。如果你使用过它,请在评论区分享你的使用经验。 -------------------------------------------------------------------------------- @@ -69,7 +69,7 @@ via: https://itsfoss.com/subsync/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 875344f1a705f39a9127db8ff3df273dbc068614 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 10:01:16 +0800 Subject: [PATCH 216/290] PUB @geekpi @turbokernel https://linux.cn/article-13722-1.html --- ...onize Subtitle With Video Using SubSync.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) rename {translated/tech => published}/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md (62%) diff --git a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md similarity index 62% rename from translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md rename to published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md index a71236acde..8ab216c61e 100644 --- a/translated/tech/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md +++ b/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -4,33 +4,35 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13722-1.html" 使用 SubSync 自动同步视频字幕 ====== -让我分享一个场景:当你试图观看一部电影或视频时,你需要字幕。你下载字幕后,却发现字幕没有正确同步。没有其他好的字幕可用。现在该怎么做? +![](https://img.linux.net.cn/data/attachment/album/202108/27/100003ts3j0odw05j0ooy3.jpg) -你可以[在 VLC 中按 G 或 H 键来同步字幕][1]。它为字幕增加了延迟。如果字幕在整个视频中的时间延迟相同,这可能会起作用。否则,SubSync 将提供很大帮助。 +让我分享一个场景:当你想要观看一部电影或视频,而又需要字幕时,在你下载字幕后,却发现字幕没有正确同步,也没有其他更好的字幕可用。现在该怎么做? + +你可以 [在 VLC 中按 G 或 H 键来同步字幕][1]。它可以为字幕增加延迟。如果字幕在整个视频中的时间延迟相同,这可能会起作用。但如果不是这种情况,就需要 SubSync 出场了。 ### SubSync: 字幕语音同步器 [SubSync][2] 是一款实用的开源工具,可用于 Linux、macOS 和 Windows。 -它通过监听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也支持翻译,但我没有测试这个功能。 +它通过监听音轨来同步字幕,这就是它的神奇之处。即使音轨和字幕使用的是不同的语言,它也能发挥作用。如果有必要,它也支持翻译,但我没有测试过这个功能。 -我通过播放一个视频不同步的字幕进行了一个简单的测试。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 +我播放一个视频不同步的字幕进行了一个简单的测试。令我惊讶的是,它工作得很顺利,我得到了完美的同步字幕。 -使用 SubSync 很简单。你启动应用,它要求你添加字幕文件和视频文件。 +使用 SubSync 很简单。启动这个应用,它会让你添加字幕文件和视频文件。 -![ SubSync 用户界面][3] +![SubSync 用户界面][3] -你必须在界面上选择字幕和视频的语言。它可能会根据选择的语言下载额外的资源。 +你需要在界面上选择字幕和视频的语言。它可能会根据选择的语言下载额外的资源。 ![SubSync 可下载附加语言支持包][4] -请记住,同步字幕需要一些时间,这取决于视频和字幕的长度。在等待过程完成时,你可以拿起你的茶/咖啡或啤酒。 +请记住,同步字幕需要一些时间,这取决于视频和字幕的长度。在等待过程完成时,你可以喝杯茶/咖啡或啤酒。 你可以看到正在进行同步的状态,甚至可以在完成之前保存它。 @@ -44,7 +46,7 @@ ### 安装 SubSync -SubSync 是一个跨平台的应用,你可以从它的[下载页面][7]获得 Windows 和 MacOS 的安装文件。 +SubSync 是一个跨平台的应用,你可以从它的 [下载页面][7] 获得 Windows 和 MacOS 的安装文件。 对于 Linux 用户,SubSync 是作为一个 Snap 包提供的。如果你的发行版已经提供了 Snap 支持,使用下面的命令来安装 SubSync: @@ -52,13 +54,13 @@ SubSync 是一个跨平台的应用,你可以从它的[下载页面][7]获得 sudo snap install subsync ``` -请记住,下载 SubSync snap 包将需要一些时间。所以要有一个稳定的网络连接或足够的耐心。 +请记住,下载 SubSync Snap 包将需要一些时间。所以要有一个稳定的网络连接或足够的耐心。 ### 最后 -就我个人而言,我对字幕很上瘾。即使我在 Netflix 上看英文电影,我也会把字幕打开。它有助于清楚地理解每段对话,特别是在有强烈口音的情况下。如果没有字幕,我永远无法理解[电影 Snatch 中 Mickey O'Neil(由 Brad Pitt 扮演)的一句话][8]。 +就我个人而言,我很依赖字幕。即使我在 Netflix 上看英文电影,我也会把字幕打开。它有助于我清楚地理解每段对话,特别是在有强烈口音的情况下。如果没有字幕,我永远无法理解 [电影 Snatch 中 Mickey O'Neil(由 Brad Pitt 扮演)的一句话][8]。 -使用 SubSync 比[ Subtitle Editor][9] 同步字幕要容易得多。在[企鹅字幕播放器][10]之后,对于像我这样在整个互联网上搜索不同国家的冷门或推荐(神秘)电影的人来说,这是另一个很棒的工具。 +使用 SubSync 比 [Subtitle Editor][9] 同步字幕要容易得多。对于像我这样在整个互联网上搜索不同国家的冷门或推荐(神秘)电影的人来说,除了 [企鹅字幕播放器][10],这是另一个很棒的工具。 如果你是一个“字幕用户”,你会喜欢这个工具。如果你使用过它,请在评论区分享你的使用经验。 From e94c0079f03ae722eea4a25b04c9f43bb94b42df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 10:05:03 +0800 Subject: [PATCH 217/290] PRF --- ...matically Synchronize Subtitle With Video Using SubSync.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md index 8ab216c61e..367eb80668 100644 --- a/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md +++ b/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md @@ -36,11 +36,11 @@ 你可以看到正在进行同步的状态,甚至可以在完成之前保存它。 -![SubSync synchronization in progress][5] +![SubSync 同步中][5] 同步完成后,你就可以点击保存按钮,把修改的内容保存到原文件中,或者把它保存为新的字幕文件。 -![Synchronization completed][6] +![同步完成][6] 我不能保证所有情况下都能正常工作,但在我运行的样本测试中它是正常的。 From 39b7e53dc0cf791c4e94c96489b3a24590776f6a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 10:53:03 +0800 Subject: [PATCH 218/290] PRF @geekpi --- ... Build a JAR file with fastjar and gjar.md | 53 ++++++++----------- 1 file changed, 22 insertions(+), 31 deletions(-) diff --git a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md b/translated/tech/20210818 Build a JAR file with fastjar and gjar.md index 42f4d45377..ea56ee3e10 100644 --- a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md +++ b/translated/tech/20210818 Build a JAR file with fastjar and gjar.md @@ -3,24 +3,24 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 用 fastjar 和 gjar 构建一个 JAR 文件 ====== -fastjar、gjar 和 jar 等工具可以帮助你手动或以编程方式构建 JAR 文件,而其他工具链,如 Maven -和 Gradle 提供了依赖性管理的功能。 -![Someone wearing a hardhat and carrying code ][1] -JAR 文件使用户很容易下载和启动他们想尝试的应用,很容易将该应用从一台计算机转移到另一台计算机(而且 Java 是跨平台的,所以可以鼓励自由分享),而且对于新的程序员来说,很容易理解 JAR 文件的内容,以找出使 Java 应用运行的原因。 +> fastjar、gjar 和 jar 等工具可以帮助你手动或以编程方式构建 JAR 文件,而其他工具链,如 Maven 和 Gradle 提供了依赖性管理的功能。 + +![](https://img.linux.net.cn/data/attachment/album/202108/27/105207oj4f44t4vbkkv4iq.jpg) + +根据我的经验,Java 的许多优点之一是它能够以整齐方便的包(称为 JAR,或 Java 归档)来提供应用程序。JAR 文件使用户很容易下载并启动他们想尝试的应用,很容易将该应用从一台计算机转移到另一台计算机(而且 Java 是跨平台的,所以可以鼓励自由分享),而且对于新的程序员来说,查看 JAR 文件的内容,以找出使 Java 应用运行的原因是很容易理解的。 创建 JAR 文件的方法有很多,包括 Maven 和 Gradle 等工具链解决方案,以及 IDE 中的一键构建功能。然而,也有一些独立的命令,如 `jarfast`、`gjar` 和普通的 `jar`,它们对于快速和简单的构建是很有用的,并且可以演示 JAR 文件运行所需要的东西。 ### 安装 -在 Linux 上,你可能已经有了 `fastjar`、`gjar` 或 `jar` 命令,作为 OpenJDK 包或 GCJ(GCC-Java)的一部分。你可以通过输入不带参数的命令来测试这些命令是否已经安装: - +在 Linux 上,你可能已经有了 `fastjar`、`gjar` 或作为 OpenJDK 包或 GCJ(GCC-Java)的一部分的 `jar` 命令。你可以通过输入不带参数的命令来测试这些命令是否已经安装: ``` $ fastjar @@ -35,7 +35,7 @@ Try `jar --help' for more information. 我安装了所有这些命令,但你只需要一个。所有这些命令都能够构建一个 JAR。 -在 Fedora 等现代 Linux 系统上,输入一个缺失的命令会使你的操作系统提示安装。 +在 Fedora 等现代 Linux 系统上,输入一个缺失的命令你的操作系统提示安装它。 另外,你可以直接从 [AdoptOpenJDK.net][3] 为 Linux、MacOS 和 Windows [安装 Java][2]。 @@ -43,45 +43,40 @@ Try `jar --help' for more information. 首先,你需要构建一个 Java 应用。 -为了简单起见,在一个名为 hello.java 的文件中创建一个基本的 “hello world” 应用: - +为了简单起见,在一个名为 `hello.java` 的文件中创建一个基本的 “hello world” 应用: ``` class Main { -public static void main([String][4][] args) { -[System][5].out.println("Hello Java World"); +public static void main(String[] args) { + System.out.println("Hello Java World"); }} ``` 这是一个简单的应用,在某种程度上淡化了管理外部依赖关系在现实世界中的重要性。不过,这也足以让你开始了解创建 JAR 所需的基本概念了。 -接下来,创建一个清单文件。清单文件描述了 JAR 的 Java 环境。在这种情况下,最重要的信息是识别主类,这样执行 JAR 的 Java 运行时就知道在哪里可以找到应用的入口点。 - +接下来,创建一个清单文件。清单文件描述了 JAR 的 Java 环境。在这个例子里,最重要的信息是识别主类,这样执行 JAR 的 Java 运行时就知道在哪里可以找到应用的入口点。 ``` $ mdir META-INF -$ echo "Main-Class: Main" > META-INF/MANIFEST.MF +$ echo "Main-Class: Main" > META-INF/MANIFEST.MF ``` ### 编译 Java 字节码 接下来,把你的 Java 文件编译成 Java 字节码。 - ``` -`$ javac hello.java` +$ javac hello.java ``` 另外,你也可以使用 GCC 的 Java 组件来编译: - ``` -`$ gcj -C hello.java` +$ gcj -C hello.java ``` 无论哪种方式,都会产生文件 `Main.class`: - ``` $ file Main.class Main.class: compiled Java class data, version XX.Y @@ -91,32 +86,28 @@ Main.class: compiled Java class data, version XX.Y 你有了所有需要的组件,这样你就可以创建 JAR 文件了。 -我经常包含 Java 源码给好奇的用户参考,但_所有_需要的只是 `META-INF` 目录和类文件。 - -`fastjar` 命令使用类似于 [`tar` 命令][6]的语法。 +我经常包含 Java 源码给好奇的用户参考,这只需 `META-INF` 目录和类文件即可。 +`fastjar` 命令使用类似于 [tar 命令][6]的语法。 ``` -`$ fastjar cvf hello.jar META-INF Main.class` +$ fastjar cvf hello.jar META-INF Main.class ``` 另外,你也可以用 `gjar`,方法大致相同,只是 `gjar` 需要你明确指定清单文件: - ``` -`$ gjar cvf world.jar Main.class -m META-INF/MANIFEST.MF` +$ gjar cvf world.jar Main.class -m META-INF/MANIFEST.MF ``` -或者你可以使用 `jar` 命令。注意这个命令不需要 Manifest 文件,因为它会自动为你生成一个,但为了安全起见,我明确定义了主类: - +或者你可以使用 `jar` 命令。注意这个命令不需要清单文件,因为它会自动为你生成一个,但为了安全起见,我明确定义了主类: ``` -`$ jar --create --file hello.jar --main-class=Main Main.class` +$ jar --create --file hello.jar --main-class=Main Main.class ``` 测试你的应用: - ``` $ java -jar hello.jar Hello Java World @@ -135,7 +126,7 @@ via: https://opensource.com/article/21/8/fastjar 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0ab95e81c9aca6261b2c953c83ebcce98ca5739c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 10:53:40 +0800 Subject: [PATCH 219/290] PUB @geekpi https://linux.cn/article-13723-1.html --- .../20210818 Build a JAR file with fastjar and gjar.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210818 Build a JAR file with fastjar and gjar.md (98%) diff --git a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md b/published/20210818 Build a JAR file with fastjar and gjar.md similarity index 98% rename from translated/tech/20210818 Build a JAR file with fastjar and gjar.md rename to published/20210818 Build a JAR file with fastjar and gjar.md index ea56ee3e10..ce47a73776 100644 --- a/translated/tech/20210818 Build a JAR file with fastjar and gjar.md +++ b/published/20210818 Build a JAR file with fastjar and gjar.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13723-1.html" 用 fastjar 和 gjar 构建一个 JAR 文件 ====== From 599eccf640a78fa3b7ff06d4b6861a037bb41db9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 11:19:57 +0800 Subject: [PATCH 220/290] APL --- ...20210826 30 things you didn-t know about the Linux kernel.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md index 82a3673941..df11664b30 100644 --- a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md +++ b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-kernel" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From f60c86544b33fc92fd656dd13e6f17cfbac35e1d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 15:00:37 +0800 Subject: [PATCH 221/290] TSL&PRF @wxy --- ... you didn-t know about the Linux kernel.md | 100 ------------------ ... you didn-t know about the Linux kernel.md | 70 ++++++++++++ 2 files changed, 70 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20210826 30 things you didn-t know about the Linux kernel.md create mode 100644 translated/tech/20210826 30 things you didn-t know about the Linux kernel.md diff --git a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md b/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md deleted file mode 100644 index df11664b30..0000000000 --- a/sources/tech/20210826 30 things you didn-t know about the Linux kernel.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: subject: "30 things you didn't know about the Linux kernel" -[#]: via: "https://opensource.com/article/21/8/linux-kernel" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -30 things you didn't know about the Linux kernel -====== -The Linux kernel is turning 30 this year. -![30 years][1] - -The Linux kernel is turning 30 this year. That's three decades of pioneering open source software, enabling users to run free software, to learn from the applications they're running, and to share what they've learned with friends. It's argued that without the Linux kernel, the luxuries of [open culture][2] and free software we enjoy today may not have surfaced when they have. It's highly improbable that the parts of Apple and Microsoft and Google that are open would be open at all without Linux as the catalyst. The impact of Linux as a phenomenon for culture, software development, and user experience cannot be overstated, and yet it all started with a kernel. - -A kernel is the software that boots a computer, recognizes—and ensures communication between—all of the components attached to the computer, both inside and outside of the computer case. For code that most users never even think about, much less understand, there are a lot of surprises about the Linux kernel. In no particular order, here's one fact about the kernel for each year of its life: - - 1. Linux was the first operating system to feature USB 3.0 drivers. Sarah Sharp announced on 7 June 2009 that her driver for USB 3.0 devices was available, and her code was included in kernel version 2.6.31 - - 2. The kernel marks itself as `tainted` when some event occurs that could be useful later for troubleshooting. It’s not a problem to run a "tainted" kernel. Should something go wrong, one of the first troubleshooting steps is to try to reproduce the issue on a non-tainted kernel. - - 3. You can specify a hostname or domain name as part of the `ip=` command-line option, Linux preserves it instead of overwriting it with one proposed by DHCP or BOOTP. For instance, `ip=::::myhostname::dhcp` gets the name `myhostname`. - - 4. There's a version of a black-and-white, 16-color, and 224-color Tux logo during text bootup. - - 5. In the entertainment business, DRM is technology used to prevent access to media. However, in the Linux kernel DRM refers to Direct Rendering Manager and refers to library (libdrm) and drivers used to interface with the GPUs of video cards. - - 6. It's possible to patch the Linux kernel without rebooting. - - 7. If you compile your own kernel, you can configure your text console to have more than 80 columns. - - 8. The Linux kernel provides built-in FAT, exFAT, and NTFS (read and write) compatibility. - - 9. Drivers for Wacom tablets and many similar devices are built into the kernel. - - 10. Most kernel hackers use the `git send-email` to submit patches. - - 11. The kernel uses a documentation toolchain called [Sphinx][3], which is written in Python. - - 12. Hamlib provides shared libraries with a standardized API to control amateur radio equipment through your Linux computer. - - 13. Hardware manufacturers are encouraged to help develop the kernel in order to ensure compatibility. The hardware can thus be addressed directly without having to download a driver from the manufacturer. Drivers that are directly part of the kernel also automatically benefit from performance and security improvements in new versions of the kernel. - - 14. There are drivers included in the kernel for many Raspberry Pi modules (Pi Hats). - - 15. The band netcat released an album playable only as a [Linux kernel module.][4] - - 16. Inspired by netcat's album release, a module to [turn your kernel into a music player][5] has also been developed. - - 17. The Linux kernel features supports many CPU architectures: ARM, ARM64, IA-64, m68k, MIPS, Nios II, PA-RISC, OpenRISC, PowerPC, s390, Sparc, x86, Xtensa, and more. - - 18. In 2001, the Linux kernel became the first to [run the x86-64 CPU architecture in long mode][6]. - - 19. Linux version 3.4 introduced the x32 ABI, allowing developers to compile code to run in 64-bit mode while only using 32-bit pointers and data fields. - - 20. The kernel supports many different file systems, including Ext2, Ext3, Ext4, JFS, XFS, GFS2, GCFS2, BtrFS, NILFS2, NFS, Overlay FS, UDF, and more. - - 21. The Virtual File System is a software layer in the kernel providing the filesystem interface to applications users run. It's also an abstraction for the kernel so that different filesystem implementations can coexist. - - 22. The Linux kernel includes a driver for a physical Braille output device. - - 23. For kernel version 2.6.29, the Tux logo during boot was replaced by "Tuz" to raise awareness of an aggressive cancer that was affecting the Tasmanian Devil population in Australia at the time. - - 24. Control Groups (cgroups) are the reason containers (the foundation technology for Docker, Podman, Kubernetes, and much more) can exist. - - 25. It took extensive legal action to liberate it so it could be included, but today the CIFS module is built into the kernel to enable SMB support. This allows Linux to mount Microsoft remote and cloud-based file shares. - - 26. It's notoriously difficult (in fact impossible, so far) for a computer to produce a truly random number. The `hw_random` framework can make use of special hardware features on your CPU or motherboard in an effort to improve random number generation. - - 27. _OS jitter_ is interference experienced by an application caused by conflicts in how background processes are scheduled, and how the system handles asynchronous events (such as interrupts.) Binding tasks to sets of CPUs defined by the kernel, using cgroups, and SMP IRQ affinity are options that the kernel provides programmers for reducing OS jitter. Issues like these are discussed in detail in the kernel documentation, helping programmers targeting Linux can write smarter code. - - 28. The `make menuconfig` command allows you to use a GUI to configure a kernel before compiling. The `Kconfig` language defines kernel config options. - - 29. For essential Linux servers, a _watchdog_ system can be implemented to monitor the health of the server. Between health checks, the watchdog daemon writes data to a special watchdog kernel device, preventing a system reset. Should a watchdog fail to log success, the system is reset. Many implementations of watchdog hardware exist, and they're vital for remote mission critical computers (such as those sent to Mars.) - - 30. Although it was developed on Earth, there's a copy of the Linux kernel on the planet Mars. - - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/linux-kernel - -作者:[Seth Kenlon][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/seth -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/kernel-30.png?itok=xmwX2pCQ (30 years) -[2]: https://opensource.com/article/18/1/creative-commons-real-world -[3]: https://opensource.com/article/19/11/document-python-sphinx -[4]: https://github.com/usrbinnc/netcat-cpi-kernel-module -[5]: https://github.com/FlaviaR/Netcat-Music-Kernel-Expansion -[6]: http://www.x86-64.org/pipermail/announce/2001-June/000020.html diff --git a/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md b/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md new file mode 100644 index 0000000000..92c1014b4d --- /dev/null +++ b/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md @@ -0,0 +1,70 @@ +[#]: subject: "30 things you didn't know about the Linux kernel" +[#]: via: "https://opensource.com/article/21/8/linux-kernel" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +关于 Linux 内核的 30 件你不知道的事 +====== + +> Linux 内核今年 30 岁了。 + +![](https://img.linux.net.cn/data/attachment/album/202108/27/150006o152rdghq0zqr02f.jpg) + +Linux 内核今年 30 岁了。这开创性的开源软件的三个十年,让用户能够运行自由软件,让他们能从运行的应用程序中学习,让他们能与朋友分享他们所学到的知识。有人认为,如果没有 Linux 内核,我们如今所享受的 [开源文化][2] 和自由软件的累累硕果,可能就不会应时而出现。如果没有 Linux 作为催化剂,苹果、微软和谷歌所开源的那些就不可能开源。Linux 作为一种现象,对开源文化、软件开发和用户体验的影响,是怎么强调都不为过的,但所有这一切,都滥觞于一个 Linux 内核。 + +Linux 内核是启动计算机、并识别和确保计算机内外所连接的所有组件之间通信的软件。这些对于大多数用户从未想过,更不用说能理解的代码,Linux 内核有很多令人惊讶的地方。以下是 Linux 内核在其三十年生命中每一年的一件事。顺序无关。 + + 1. Linux 是第一个具有 USB 3.0 驱动的操作系统。Sarah Sharp 在 2009 年 6 月 7 日宣布她的 USB 3.0 设备的驱动程序可以使用了,她的代码被包含在内核 2.6.31 版本中。 + 2. 当某些事件发生时,内核会将自己标记为“受污染”,这在以后的故障排除中可能有用。运行一个“被污染”的内核并不是什么问题。但如果出现错误,首先要做的是在一个没有被污染的内核上重现该问题。 + 3. 你可以指定一个主机名或域名作为 `ip=` 内核命令行选项的一部分,Linux 会保留它,而不是用 DHCP 或 BOOTP 提供的主机名或域名来覆盖它。例如,`ip=::::myhostname::dhcp` 设置主机名 `myhostname`。 + 4. 在文本启动过程中,可以选择显示黑白的、16 色的或 224 色的 Tux 徽标之一。 + 5. 在娱乐业中,DRM 是一种用来防止访问媒介的技术。然而,在 Linux 内核中,DRM 指的是直接渲染管理器Direct Rendering Manager,它指的是用于与对接显卡的 GPU 的库(`libdrm`)和驱动程序。 + 6. 能够在不重启的情况下给 Linux 内核打补丁。 + 7. 如果你自己编译内核,你可以将文本控制台配置为超过 80 列宽。 + 8. Linux 内核提供了内置的 FAT、exFAT 和 NTFS(读和写)支持。 + 9. Wacom 平板电脑和许多类似设备的驱动程序都内置在内核中。 + 10. 大多数内核高手使用 `git send-email` 来提交补丁。 + 11. 内核使用一个叫做 [Sphinx][3] 的文档工具链,它是用 Python 编写的。 + 12. Hamlib 提供了具有标准化 API 的共享库,可以通过你的 Linux 电脑控制业余无线电设备。 + 13. 我们鼓励硬件制造商帮助开发 Linux 内核,以确保兼容性。这样就可以直接处理硬件,而不必从制造商那里下载驱动程序。直接成为内核一部分的驱动程序也会自动从新版本内核的性能和安全改进中受益。 + 14. 内核中包含了许多树莓派模块(Pi Hats)的驱动程序。 + 15. netcat 乐队发布了一张只能作为 [Linux 内核模块][4] 播放的专辑。 + 16. 受 netcat 发布专辑的启发,人们又开发了一个 [把你的内核变成一个音乐播放器][5] 的模块。 + 17. Linux 内核的功能支持许多 CPU 架构:ARM、ARM64、IA-64、 m68k、MIPS、Nios II、PA-RISC、OpenRISC、PowerPC、s390、 Sparc、x86、Xtensa 等等。 + 18. 2001 年,Linux 内核成为第一个 [以长模式运行的 x86-64 CPU 架构][6]。 + 19. Linux 3.4 版引入了 x32 ABI,允许开发者编译在 64 位模式下运行的代码,而同时只使用 32 位指针和数据段。 + 20. 内核支持许多不同的文件系统,包括 Ext2、Ext3、Ext4、JFS、XFS、GFS2、GCFS2、BtrFS、NILFS2、NFS、Overlay FS、UDF 等等。 + 21. 虚拟文件系统Virtual File System(VFS)是 Linux 内核中的一个软件层,为用户运行的应用程序提供文件系统接口。它也是内核的一个抽象层,以便不同的文件系统实现可以共存。 + 22. Linux 内核包括一个实体的盲文输出设备的驱动程序。 + 23. 在 2.6.29 版本的内核中,启动时的 Tux 徽标被替换为 “Tuz”,以提高人们对当时影响澳大利亚的塔斯马尼亚魔鬼Tasmanian Devil(即袋獾)种群的一种侵袭性癌症的认识。 + 24. 控制组Control Groups(cgroups)是容器(Docker、Podman、Kubernetes 等的基础技术)能够存在的原因。 + 25. 曾经花了大量的法律行动来解放 CIFS,以便将其纳入内核中,而今天,CIFS 模块已被内置于内核,以实现对 SMB 的支持。这使得 Linux 可以挂载微软的远程共享和基于云的文件共享。 + 26. 对于计算机来说,产生一个真正的随机数是出了名的困难(事实上,到目前为止是不可能的)。`hw_random` 框架可以利用你的 CPU 或主板上的特殊硬件功能,尽量改进随机数的生成。 + 27. _操作系统抖动_ 是应用程序遇到的干扰,它是由后台进程的调度方式和系统处理异步事件(如中断)的方式的冲突引起的。像这些问题在内核文档中都有详细的讨论,可以帮助面向 Linux 开发的程序员写出更聪明的代码。 + 28. `make menuconfig` 命令可以让你在编译前使用 GUI 来配置内核。`Kconfig` 语言定义了内核配置选项。 + 29. 对于基本的 Linux 服务器,可以实施一个 _看门狗_ 系统来监控服务器的健康状况。在健康检查间隔中,`watchdog` 守护进程将数据写入一个特殊的 `watchdog` 内核设备,以防止系统重置。如果看门狗不能成功记录,系统就会被重置。有许多看门狗硬件的实现,它们对远程任务关键型计算机(如发送到火星上的计算机)至关重要。 + 30. 在火星上有一个 Linux 内核的副本,虽然它是在地球上开发的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-kernel + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/kernel-30.png?itok=xmwX2pCQ (30 years) +[2]: https://opensource.com/article/18/1/creative-commons-real-world +[3]: https://opensource.com/article/19/11/document-python-sphinx +[4]: https://github.com/usrbinnc/netcat-cpi-kernel-module +[5]: https://github.com/FlaviaR/Netcat-Music-Kernel-Expansion +[6]: http://www.x86-64.org/pipermail/announce/2001-June/000020.html From 1b13c9324be21838f1c1a3ca96e3b0484a7b688c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 27 Aug 2021 15:03:02 +0800 Subject: [PATCH 222/290] PUB @wxy https://linux.cn/article-13724-1.html --- ...210826 30 things you didn-t know about the Linux kernel.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210826 30 things you didn-t know about the Linux kernel.md (99%) diff --git a/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md b/published/20210826 30 things you didn-t know about the Linux kernel.md similarity index 99% rename from translated/tech/20210826 30 things you didn-t know about the Linux kernel.md rename to published/20210826 30 things you didn-t know about the Linux kernel.md index 92c1014b4d..0a8360ba4b 100644 --- a/translated/tech/20210826 30 things you didn-t know about the Linux kernel.md +++ b/published/20210826 30 things you didn-t know about the Linux kernel.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13724-1.html" 关于 Linux 内核的 30 件你不知道的事 ====== From c8deba3e8c992f9a371f7b27d72575f7d614db4b Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Fri, 27 Aug 2021 16:31:11 +0800 Subject: [PATCH 223/290] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ... to understanding your team-s implicit values and needs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md index 3ac22f86fd..127f226ab7 100644 --- a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md +++ b/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/open-organization/21/8/leadership-cultural-social-norms" [#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "zz-air" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -57,7 +57,7 @@ via: https://opensource.com/open-organization/21/8/leadership-cultural-social-no 作者:[Ron McFarland][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zz-air](https://github.com/zz-air) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b46cda295eaf5ee23a81aa497d53561e210c9552 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Aug 2021 05:02:26 +0800 Subject: [PATCH 224/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827=20?= =?UTF-8?q?Automatically=20Light=20Up=20a=20Sign=20When=20Your=20Webcam=20?= =?UTF-8?q?is=20in=20Use?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md --- ...ht Up a Sign When Your Webcam is in Use.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md diff --git a/sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md b/sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md new file mode 100644 index 0000000000..ad4e7c8ba3 --- /dev/null +++ b/sources/tech/20210827 Automatically Light Up a Sign When Your Webcam is in Use.md @@ -0,0 +1,80 @@ +[#]: subject: "Automatically Light Up a Sign When Your Webcam is in Use" +[#]: via: "https://fedoramagazine.org/automatically-light-up-a-sign-when-your-webcam-is-in-use/" +[#]: author: "John Boero https://fedoramagazine.org/author/boeroboy/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Automatically Light Up a Sign When Your Webcam is in Use +====== + +![][1] + +Automatic WFH sign tells others when you're in a conference. + +At the beginning of COVID lockdown and multiple people working from home it was obvious there was a need to let others know when I’m in a meeting or on a live webcam. So naturally it took me one year to finally do something about it. Now I’m here to share what I learned along the way. You too can have your very own “do not disturb” sign automatically light up outside your door to tell people not to walk in half-dressed on laundry day. + +At first I was surprised Zoom doesn’t have this kind of feature built in. But then again I might use Teams, Meet, Hangouts, WebEx, Bluejeans, or any number of future video collaboration apps. Wouldn’t it make sense to just use a system-wide watch for active webcams or microphones? Like most problems in life, this one can be helped with the Linux kernel. A simple check of the _uvcvideo_ module will show if a video device is in use. Without using events all that is left is to poll it for changes. I chose to build a taskbar icon for this. I would normally do this with my trusty C++. But I decided to step out of my usual comfort zone and use Python in case someone wanted to port it to other platforms. I also wanted to renew my lesser Python-fu and face my inner white space demons. I came up with the following ~90 lines of practical and simple but insecure Python: + + + +Aside from the icon bits, a daemon thread performs the following basic check every 1s, calling scripts as changed: + +``` +def run(self): + while True: + val=subprocess.check_output(['lsmod | grep \'^uvcvideo\' | awk \'{print $3}\''], shell=True, text=True).strip() + if val != self.status: + self.status = val + if val == '0': + val=subprocess.check_output(['~/bin/webcam_deactivated.sh']) + else: + val=subprocess.check_output(['~/bin/webcam_activated.sh']) + time.sleep(1) +``` + +Rather than implement the parsing of modules, just using a hard-coded shell command got the job done. Now whatever scripts you choose to put in ~/bin/ will be used when at least one webcam activates or deactivates. I recently had a futile go at the kernel maintainers regarding a bug in usb_core triggered by uvcvideo. I would just as soon not go a step further and attempt an events patch to uvcvideo. Also, this leaves room for Mac or Windows users to port their own simple checks. + +Now that I had a happy icon that sits in my KDE system tray I could implement scripts for on and off. This is where things got complicated. At first I was going to stick a magnetic bluetooth LED badge on my door to flash “LIVE” whenvever I was in a call. These things are ubiquitous on the internet and cost about $10 for basically an embedded ARM Cortex-M0 with an LED screen, bluetooth, and battery. They are basically a full Raspberry Pi Pico kit but soldered onto the board. + +![These Bluetooth LED badges with 48Mhz ARM Cortex-M0 chips have a lot of potential, but they need custom firmware to be any use.][2] + +Unfortunately these badges use a fixed firmware that is either listening to Bluetooth transmissions or showing your message – it doesn’t do both which is silly. Many people have posted feedback that they should be so much more. Sure enough someone has already tinkered with [custom firmware][3]. Unfortunately the firmware was for older USB variants and I’m not about to de-solder or buy an ISP programmer to flash eeprom just for this. That would be a super interesting project for later and would be a great Rpi alternative but all I want right now is a remote controlled light outside my door. I looked at everything including WiFi [smart bulbs][4] to replace my recessed lighting bulbs, to [BTLE candles][5] which are an interesting option. Along the way I learned a lot about Bluetooth Low Energy including how a kernel update can waste 4 hours of weekend with bluetooth stack crashes. BTLE is really interesting and makes a lot more sense after reading up on it. Sure enough there is Python that can set the display [message on your LED badge][6] across the room, but once it is set, Bluetooth will stop listening for you to change it or shut it off. Darn. I guess I should just make do with USB, which actually has a standard command to control power to ports. Let’s see if something exists for this already. + +![A programmable Bluetooth LED sign costs £10 or for £30 you can have a single LED up to 59 inches away.][7] + +It looked like there are options out there even if they’re not ideal. Then suddenly I found it. Neon sign “ON AIR” for £15 and it’s as dumb as they come – just using 5v from USB power. Perfect. + +![Bingo – now all I needed to do was control the power to it.][8] + +The command to control USB power is _uhubctl_ which is in Fedora repos. Unfortunately most USB hubs don’t support this command. In fact very few support it [going back 20 years][9] which seems silly. Hubs will happily report that power has been disconnected even though no such disconnection has been made. I assume it’s just a few cents extra to build in this feature but I’m not a USB hub manufacturer. Therefore I needed to source a pre-owned one. In the end I found a BYTECC BT-UH340 from the US. This was all I needed to finalize it. Adding udev rules to allow the _wheel_ group to control USB power, I can now perform a simple _uhubctl -a off -l 1-1 -p 1_ to turn anything off. + +![The BYTECC BT-UH340 is one of few hubs I could actually find to support uhubctl power.][10] + +Now with a spare USB extension cable lead to my door I finally have a complete solution. There is an “ON AIR” sign on the outside of my door that lights up automatically whenever any of my webcams are in use. I would love to see a Mac port or improvements in pull requests. I’m sure it can all be better. Even further I would love to hone my IoT skills and sort out flashing those Bluetooth badges. If anybody wants to replicate this please be my guest, and suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/automatically-light-up-a-sign-when-your-webcam-is-in-use/ + +作者:[John Boero][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/boeroboy/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/onair-1890x800-1-816x345.jpg +[2]: https://fedoramagazine.org/wp-content/uploads/2021/03/IMG_20210322_164346-1024x768.jpg +[3]: https://github.com/Effix/LedBadge +[4]: https://www.amazon.co.uk/AvatarControls-Dimmable-Bluetooth-Connection-2700K-6100K/dp/B08P21MSTW/ref=sr_1_6_mod_primary_lightning_deal?dchild=1&keywords=bluetooth+bulb+spot&qid=1616345349&sbo=Tc8eqSFhUl4VwMzbE4fw%2Fw%3D%3D&smid=A2GE8P68TQ1YXI&sr=8-6 +[5]: http://nilhcem.com/iot/reverse-engineering-simple-bluetooth-devices +[6]: http://nilhcem.com/iot/reverse-engineering-bluetooth-led-name-badge +[7]: https://fedoramagazine.org/wp-content/uploads/2021/03/image-7-1024x416.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/03/IMG_20210322_163624-1024x768.jpg +[9]: https://github.com/mvp/uhubctl#compatible-usb-hubs +[10]: https://c1.neweggimages.com/ProductImage/17-145-089-02.jpg From 5f138153417aec96a7dbd496631439e07351aac4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Aug 2021 05:03:08 +0800 Subject: [PATCH 225/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827=20?= =?UTF-8?q?Calculate=20date=20and=20time=20ranges=20in=20Groovy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210827 Calculate date and time ranges in Groovy.md --- ...alculate date and time ranges in Groovy.md | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 sources/tech/20210827 Calculate date and time ranges in Groovy.md diff --git a/sources/tech/20210827 Calculate date and time ranges in Groovy.md b/sources/tech/20210827 Calculate date and time ranges in Groovy.md new file mode 100644 index 0000000000..4ae46e19a5 --- /dev/null +++ b/sources/tech/20210827 Calculate date and time ranges in Groovy.md @@ -0,0 +1,172 @@ +[#]: subject: "Calculate date and time ranges in Groovy" +[#]: via: "https://opensource.com/article/21/8/groovy-date-time" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Calculate date and time ranges in Groovy +====== +Use Groovy date and time to discover and display time increments. +![clock][1] + +Every so often, I need to do some calculations related to dates. A few days ago, a colleague asked me to set up a new project definition in our (open source, of course!) project management system. This project is to start on the 1st of August and finish on the 31st of December. The service to be provided is budgeted at 10 hours per week. + +So, yeah, I had to figure out how many weeks between 2021-08-01 and 2021-12-31 inclusive. + +This is the perfect sort of problem to solve with a tiny [Groovy][2] script. + +### Install Groovy on Linux + +Groovy is based on Java, so it requires a Java installation. Both a recent and decent version of Java and Groovy might be in your Linux distribution's repositories. Alternately, you can install Groovy by following the instructions on the [groovy-lang.org][2]. + +A nice alternative for Linux users is [SDKMan][3], which can be used to get multiple versions of Java, Groovy, and many other related tools. For this article, I'm using my distro's OpenJDK11 release and SDKMan's latest Groovy release. + +### Solving the problem with Groovy + +Since Java 8, time and date calculations have been folded into a new package called **java.time**, and Groovy provides access to that. Here’s the script: + + +``` +import java.time.* + +import java.time.temporal.* + +def start = LocalDate.parse('2021-08-01','yyyy-MM-dd') + +def end = LocalDate.parse('2022-01-01','yyyy-MM-dd') + +println "${ChronoUnit.WEEKS.between(start,end)} weeks between $start and $end" +``` + +Copy this code into a file called **wb.groovy** and run it on the command line to see the results: + + +``` +$ groovy wb.groovy +21 weeks between 2021-08-01 and 2022-01-01 +``` + +Let’s review what’s going on. + +### Date and time + +The [**java.time.LocalDate** class][4] provides many useful static methods (like **parse()** shown above, which lets us convert from a string to a **LocalDate** instance according to a pattern, in this case, **‘yyyy-MM-dd’**). The format characters are explained in quite a number of places–for example, the documentation for [**java.time.format.DateTimeFormat**][5]. Notice that **M** represents “month,” not **m**, which represents “minute.” So this pattern defines a date formatted as a four-digit year, followed by a hyphen, followed by a two-digit month number (1-12), followed by another hyphen, followed by a two-digit day-of-month number (1-31). + +Notice as well that in Java, **parse()** requires an instance of **DateTimeFormat**: + + +``` +`parse(CharSequence text, DateTimeFormatter formatter)` +``` + +As a result, parsing becomes a two-step operation, whereas Groovy provides an additional version of **parse()** that accepts the format string directly in place of the **DateTimeFormat** instance. + +The [**java.time.temporal.ChronoUnit** class][6], actually an **Enum**, provides several **Enum constants**, like **WEEKS** (or **DAYS**, or **CENTURIES**...) which in turn provide the **between()** method that allows us to calculate the interval of those units between two **LocalDates** (or other similar date or time data types). Note that I used January 1, 2022, as the value for **end**; this is because **between()** spans the time period starting on the first date given up to but not including the second date given. + +### More date arithmetic + +Every so often, I need to know how many working days are in a specific time frame (like, say, a month). This handy script will calculate that for me: + + +``` +import java.time.* + +def holidaySet = [LocalDate.parse('2021-01-01'), LocalDate.parse('2021-04-02'), +    LocalDate.parse('2021-04-03'), LocalDate.parse('2021-05-01'), +    LocalDate.parse('2021-05-15'), LocalDate.parse('2021-05-16'), +    LocalDate.parse('2021-05-21'), LocalDate.parse('2021-06-13'), +    LocalDate.parse('2021-06-21'), LocalDate.parse('2021-06-28'), +    LocalDate.parse('2021-06-16'), LocalDate.parse('2021-06-18'), +    LocalDate.parse('2021-08-15'), LocalDate.parse('2021-09-17'), +    LocalDate.parse('2021-09-18'), LocalDate.parse('2021-09-19'), +    LocalDate.parse('2021-10-11'), LocalDate.parse('2021-10-31'), +    LocalDate.parse('2021-11-01'), LocalDate.parse('2021-11-21'), +    LocalDate.parse('2021-12-08'), LocalDate.parse('2021-12-19'), +    LocalDate.parse('2021-12-25')] as [Set][7] + +def weekendDaySet = [DayOfWeek.SATURDAY,DayOfWeek.SUNDAY] as [Set][7] + +int calcWorkingDays(start, end, holidaySet, weekendDaySet) { +    (start..<end).inject(0) { subtotal, d -> +        if (!(d in holidaySet || DayOfWeek.from(d) in weekendDaySet)) +            subtotal + 1 +        else +            subtotal +    } +} + +def start = LocalDate.parse('2021-08-01') +def end = LocalDate.parse('2021-09-01') + +println "${calcWorkingDays(start,end,holidaySet,weekendDaySet)} working day(s) between $start and $end" +``` + +Copy this code into a file called **wdb.groovy** and run it from the command line to see the results: + + +``` +$ groovy wdb.groovy +22 working day(s) between 2021-08-01 and 2021-09-01 +``` + +Let’s review this. + +First, I create a set of holiday dates (these are Chile’s “días feriados” for 2021, in case you wondered) called holidaySet. Note that the default pattern for **LocalDate.parse()** is ‘**yyyy-MM-dd**’, so I’ve left the pattern out here. Note as well that I’m using the Groovy shorthand **[a,b,c]** to create a **List** and then coercing it to a **Set**. + +Next, I want to skip Saturdays and Sundays, so I create another set incorporating two **enum** values of [**java.time.DayOfWeek**][8]–**SATURDAY** and **SUNDAY**. + +Then I define a method **calcWorkingDays()** that takes as arguments the start date, the end date (which following the previous example of **between()** is the first value outside the range I want to consider), the holiday set, and the weekend day set. Line by line, this method: + + * Defines a range between **start** and **end**, open on the **end**, (that’s what **<end** means) and executes the closure argument passed to the **inject()** method (**inject()** implements the 'reduce' operation on **List** in Groovy) on the successive elements **d** in the range: + * As long as **d** is neither in the **holidaySet** nor in the **weekendDaySet**, increments the **subtotal** by 1 + * Returns the value of the result returned by **inject()** + + + +Next, I define the **start** and **end** dates between which I want to calculate working days. + +Finally, I call **println** using a Groovy [**GString**][9] to evaluate the **calcWorkingDays()** method and display the result. + +Note that I could have used the **each** closure instead of **inject**, or even a **for** loop. I could have also used Java Streams rather than Groovy ranges, lists, and closures. Lots of options. + +### But why not use groovy.Date? + +Some of you old Groovy users may be wondering why I’m not using good old [**groovy.Date**][10]. The answer is, I could use it. But Groovy Date is based on Java Date, and there are some good reasons for moving to **java.time**, even though Groovy Date added quite a few nice things to Java Date. + +For me, the main reason is that there are some not-so-great design decisions buried in the implementation of Java Date, the worst being that it is unnecessarily mutable. I spent a while tracking down a weird bug that arose from my poor understanding of the **clearTime()** method on Groovy Date. I learned it actually clears the time field of the date instance, rather than returning the date value with the time part set to ‘00:00:00’. + +Date instances also aren’t thread-safe, which can be kind of challenging for multithreaded applications. + +Finally, having both date and time wrapped up in a single field isn’t always convenient and can lead to some weird data modeling contortions. Think, for instance, of a day on which multiple events occur: Ideally, the _date_ field would be on the day, and the _time_ field would be on each event; but that’s not easy to do with Groovy Date. + +### Groovy is groovy + +Groovy is an Apache project, and it provides a simplified syntax for Java so you can use it for quick and simple scripts in addition to complex applications. You retain the power of Java, but you access it with an efficient toolset. [Try it soon][11], and see if you find your groove with Groovy. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/groovy-date-time + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/clock_1.png?itok=lbyiCJWV (clock) +[2]: https://groovy-lang.org/ +[3]: https://sdkman.io/ +[4]: https://docs.groovy-lang.org/latest/html/groovy-jdk/java/time/LocalDate.html +[5]: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html +[6]: https://docs.oracle.com/javase/8/docs/api/java/time/temporal/ChronoUnit.html +[7]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+set +[8]: https://docs.oracle.com/javase/8/docs/api/java/time/DayOfWeek.html +[9]: https://docs.groovy-lang.org/latest/html/api/groovy/lang/GString.html +[10]: https://docs.groovy-lang.org/latest/html/groovy-jdk/java/util/Date.html +[11]: https://groovy.apache.org/download.html From 7a11ce663a787b5e564ba4105befa583d0803149 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 28 Aug 2021 05:03:22 +0800 Subject: [PATCH 226/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827=20?= =?UTF-8?q?Linux=20kernel=20modules=20we=20can't=20live=20without?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210827 Linux kernel modules we can-t live without.md --- ...ux kernel modules we can-t live without.md | 121 ++++++++++++++++++ 1 file changed, 121 insertions(+) create mode 100644 sources/tech/20210827 Linux kernel modules we can-t live without.md diff --git a/sources/tech/20210827 Linux kernel modules we can-t live without.md b/sources/tech/20210827 Linux kernel modules we can-t live without.md new file mode 100644 index 0000000000..be68102762 --- /dev/null +++ b/sources/tech/20210827 Linux kernel modules we can-t live without.md @@ -0,0 +1,121 @@ +[#]: subject: "Linux kernel modules we can't live without" +[#]: via: "https://opensource.com/article/21/8/linux-kernel-module" +[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux kernel modules we can't live without +====== +Open source enthusiasts weigh in on the Linux kernel modules they love. +![Linux keys on the keyboard for a desktop computer][1] + +The Linux kernel is turning 30 this year! If you're like us, that's a big deal and we are celebrating Linux this week with a couple of special posts. + +Today we start with a roundup of responses from around the community answering "What Linux kernel module can you not live without? And, why?" Let's hear what these 10 enthusiasts have to say. + +* * * + +I guess some kernel developers will run away screaming when they hear my answer. Still, I list here two of the most controversial modules: + + * First is NVIDIA, as I have an NVIDIA graphics card on my work laptop and my personal desktop. + * The other one probably generates less hatred—the VMNET and VMMON modules from VMware to be able to run VMware Workstation. —[Peter Czanik][2] + + + +* * * + +My favorite is the [zram][3] module. It creates a compressed block device in memory, which can then be used as a swap partition. Using a zram-based swap partition is ideal when memory is limited (for example, on virtual machines) and if you are worried about wearing out your SSD or, even worse, your flash-based storage because of frequent I/O operations. —[Stephan Avenwedde][4] + +* * * + +The most useful kernel module is definitively snd-hda-intel since it supports most integrated sound cards. I listen to music while coding an audio sequencer on the Linux desktop. —[Joël Krähemann][5] + +* * * + +My laptop would be worthless without the kmod-wl that I generate with the Broadcom file. I sometimes get messages about tainting the kernel, but what good is a laptop without wireless? —[Gregory Pittman][6] + +* * * + +I can't live without Bluetooth. Without it, my mouse, keyboard, speakers, and headset would be doorstops. —[Gary Smith][7] + +* * * + +I'm going to go out on a limb and say _all of them_. Seriously, we've gotten to the point where I grab a random piece of hardware, plug it in, and it just works. + + * USB serial adapter just works + * Video card just works (though maybe not at its best) + * Network card just works + * Sound card just works + + + +It's tough not to be utterly impressed with the broad scope of the driver work that all the modules bring to the whole. I remember the bad old days when we used to yell out xrandr magic strings to make projectors work, and now—yeah, it's a genuine rarity when stuff doesn't (mostly) just work. + +If I had to nail it down to one, though, it'd be raid6. —[John 'Warthog9' Hawley][8] + +* * * + +I'm going to go back to the late 1990s for this one. I was a Unix systems administrator (and double duty as IS manager) for a small company. Our tape backup system died, and because of "small company" limited budgets, we didn't have a rush replacement or onsite repair on it. So we had to send it in for repair. + +During those two weeks, we didn't have a way to make tape backups. No systems administrator wants to be in that position. + +But then I remembered reading the [Floppy Tape How-to][9], and we happened to have a tower PC we'd just replaced that had a floppy tape drive. + +So I reinstalled it with Linux, set up the **ftape** kernel driver module, ran a few backup/recovery tests, then ran our most important backups to QIC tapes. For those two weeks, we relied on **ftape** backups of critical data. + +So to the unsung hero out there who made floppy tape drives work on 1990s Linux, you are awesome! —[Jim Hall][10] + +* * * + +Well, that's easy. It's the kvm kernel modules. On a personal front, I cannot imagine doing my day-to-day work without VMs. I'd like to believe that's the case with most of us. The kvm modules also play a big part in making Linux central to the cloud strategy. —[Gaurav Kamathe][11] + +* * * + +For me, it's dm-crypt, which is used for LUKS. See: + + * + * + + + +It's fantastic to know others cannot see what's on your disk, for example, if you lose your notebook or it gets stolen. —[Maximilian Kolb][12] + +* * * + +For cryptography basics, it's hard to beat the crypto module and its C API, which is straightforward. + +For day-to-day life, is there anything more valuable than the plug-and-play that Bluetooth provides? —[Marty Kalin][13] + +* * * + +Share with us in the comments: What Linux kernel module can you not live without? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-kernel-module + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/users/czanik +[3]: https://en.wikipedia.org/wiki/Zram +[4]: https://opensource.com/users/hansic99 +[5]: https://opensource.com/users/joel2001k +[6]: https://opensource.com/users/greg-p +[7]: https://opensource.com/users/greptile +[8]: https://opensource.com/users/warthog9 +[9]: https://tldp.org/HOWTO/Ftape-HOWTO.html +[10]: https://opensource.com/users/jim-hall +[11]: https://opensource.com/users/gkamathe +[12]: https://opensource.com/users/kolb +[13]: https://opensource.com/users/mkalindepauledu From f2448d7090866863f3522d5ecd23a53fb964eadd Mon Sep 17 00:00:00 2001 From: guevaraya Date: Sat, 28 Aug 2021 10:15:07 +0800 Subject: [PATCH 227/290] Update 20210827 How to Easily Install Debian Linux.md --- sources/tech/20210827 How to Easily Install Debian Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210827 How to Easily Install Debian Linux.md b/sources/tech/20210827 How to Easily Install Debian Linux.md index 7940aa2845..9f652f4b40 100644 --- a/sources/tech/20210827 How to Easily Install Debian Linux.md +++ b/sources/tech/20210827 How to Easily Install Debian Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-debian-easily/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "guevaraya " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d22ce17f1e82db7cbc4861e6ab88a9de265e7439 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 10:54:34 +0800 Subject: [PATCH 228/290] PRF @unigeorge --- ...e to SSH for remote connection on Linux.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md index 18734ee12b..b3cdd2d663 100644 --- a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md +++ b/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (A beginner’s guide to SSH for remote connection on Linux) @@ -9,22 +9,24 @@ Linux 远程连接之 SSH 新手指南 ====== -学会使用安全外壳协议连接远程计算机。 -![woman on laptop sitting at the window][1] -使用 Linux,你只需要在键盘上输入命令,就可以巧妙地使用计算机(甚至这台计算机可以在世界上任何地方),这正是 Linux 最吸引人的特性之一。有了 OpenSSH,[POSIX][2] 用户就可以在有权限连接的计算机上打开安全外壳协议,然后远程使用。这对于许多 Linux 用户来说可能不过是日常任务,但从没操作过的人可能就会感到很困惑。本文介绍了如何为 安全外壳协议secure shell(简称 SSH)连接配置两台计算机,以及如何在没有密码的情况下安全地从一台计算机连接到另一台计算机。 +> 学会使用安全外壳协议连接远程计算机。 + +![](https://img.linux.net.cn/data/attachment/album/202108/28/105409ztj7akfjpcluwjp3.jpg) + +使用 Linux,你只需要在键盘上输入命令,就可以巧妙地使用计算机(甚至这台计算机可以在世界上任何地方),这正是 Linux 最吸引人的特性之一。有了 OpenSSH,[POSIX][2] 用户就可以在有权限连接的计算机上打开安全外壳协议,然后远程使用。这对于许多 Linux 用户来说可能不过是日常任务,但从没操作过的人可能就会感到很困惑。本文介绍了如何配置两台计算机的 安全外壳协议secure shell(简称 SSH)连接,以及如何在没有密码的情况下安全地从一台计算机连接到另一台计算机。 ### 相关术语 在讨论多台计算机时,如何将不同计算机彼此区分开可能会让人头疼。IT 社区拥有完善的术语来描述计算机联网的过程。 - * **服务service:** + * 服务service: 服务是指在后台运行的软件,因此它不会局限于仅供安装它的计算机使用。例如,Web 服务器通常托管着 Web 共享 _服务_。该术语暗含(但非绝对)它是没有图形界面的软件。 - * **主机host:** - 主机可以是任何计算机。在 IT 中,任何计算机都可以称为 _主机_,因为从技术上讲,任何计算机都可以托管对其他计算机有用的应用程序。你可能不会把自己的笔记本电脑视为 `主机`,但其实上面可能正运行着一些对你、你的手机或其他计算机有用的服务。 - * **本地local:** + * 主机host: + 主机可以是任何计算机。在 IT 中,任何计算机都可以称为 _主机_,因为从技术上讲,任何计算机都可以托管host对其他计算机有用的应用程序。你可能不会把自己的笔记本电脑视为 **主机**,但其实上面可能正运行着一些对你、你的手机或其他计算机有用的服务。 + * 本地local: 本地计算机是指用户或某些特定软件正在使用的计算机。例如,每台计算机都会把自己称为 `localhost`。 - * **远程remote:** + * 远程remote: 远程计算机是指你既没在其面前,也没有在实际使用的计算机,是真正意义上在 _远程_ 位置的计算机。 现在术语已经明确好,我们可以开始了。 @@ -59,19 +61,17 @@ $ sudo dnf install openssh-clients openssh-server $ sudo systemctl enable --now sshd ``` -你也可以在 GNOME 上的 **系统设置** 或 macOS 上的 **系统首选项** 中启用 SSH 服务。在 GNOME 桌面上,该设置位于 **Sharing** 面板中: +你也可以在 GNOME 上的 **系统设置** 或 macOS 上的 **系统首选项** 中启用 SSH 服务。在 GNOME 桌面上,该设置位于 **共享** 面板中: ![在 GNOME 系统设置中激活 SSH][3] -(Seth Kenlon, [CC BY-SA 4.0][4]) - ### 开启安全外壳协议 现在你已经在远程计算机上安装并启用了 SSH,可以尝试使用密码登录作为测试。要访问远程计算机,你需要有用户帐户和密码。 远程用户不必与本地用户相同。只要拥有相应用户的密码,你就可以在远程机器上以任何用户的身份登录。例如,我在我的工作计算机上的用户是 `sethkenlon` ,但在我的个人计算机上是 `seth`。如果我正在使用我的个人计算机(即作为当前的本地计算机),并且想通过 SSH 连接到我的工作计算机,我可以通过将自己标识为 `sethkenlon` 并使用我的工作密码来实现连接。 -要通过 SSH 连接到远程计算机,你必须知道其 因特网协议internet protocol (简称IP) 地址或可解析的主机名。在远程计算机上使用 `ip` 命令可以查看该机器的 IP 地址: +要通过 SSH 连接到远程计算机,你必须知道其 IP 地址或可解析的主机名。在远程计算机上使用 `ip` 命令可以查看该机器的 IP 地址: ``` $ ip addr show | grep "inet " @@ -81,9 +81,9 @@ inet 10.1.1.5/27 brd 10.1.1.31 [...] 如果远程计算机没有 `ip` 命令,可以尝试使用 `ifconfig` 命令(甚至可以试试 Windows 上通用的 `ipconfig` 命令)。 -127.0.0.1 是一个特殊的地址,它实际上是 `localhost` 的地址。这是一个 `环回` 地址,系统使用它来找到自己。这在登录远程计算机时并没有什么用,因此在此示例中,远程计算机的正确 IP 地址为 10.1.1.5。在现实生活中,我的本地网络正在使用 10.1.1.0 子网,进而可得知前述正确的 IP 地址。如果远程计算机在不同的网络上,那么 IP 地址几乎可能是任何地址(但绝不会是 127.0.0.1),并且可能需要一些特殊的路由才能通过各种防火墙到达远程。如果你的远程计算机在同一个网络上,但想要访问比自己的网络更远的计算机,请阅读我之前写的关于 [在防火墙中打开端口][5] 的文章。 +`127.0.0.1` 是一个特殊的地址,它实际上是 `localhost` 的地址。这是一个环回loopback地址,系统使用它来找到自己。这在登录远程计算机时并没有什么用,因此在此示例中,远程计算机的正确 IP 地址为 `10.1.1.5`。在现实生活中,我的本地网络正在使用 `10.1.1.0` 子网,进而可得知前述正确的 IP 地址。如果远程计算机在不同的网络上,那么 IP 地址几乎可能是任何地址(但绝不会是 `127.0.0.1`),并且可能需要一些特殊的路由才能通过各种防火墙到达远程。如果你的远程计算机在同一个网络上,但想要访问比自己的网络更远的计算机,请阅读我之前写的关于 [在防火墙中打开端口][5] 的文章。 -如果你能通过 IP 地址 _或_ 主机名 ping 到远程机器,并且拥有登录帐户,那么就可以通过 SSH 接入远程机器: +如果你能通过 IP 地址 _或_ 主机名 `ping` 到远程机器,并且拥有登录帐户,那么就可以通过 SSH 接入远程机器: ``` $ ping -c1 10.1.1.5 @@ -93,7 +93,7 @@ $ ping -c1 akiton.local PING 10.1.1.5 (10.1.1.5) 56(84) bytes of data. ``` -至此就成功了一小步。再试试使用SSH登录: +至此就成功了一小步。再试试使用 SSH 登录: ``` $ whoami @@ -107,7 +107,7 @@ sethkenlon ### 创建 SSH 密钥 -要在没有密码的情况下安全地登录到另一台计算机,登陆者必须拥有 SSH 密钥。可能你的机器上已经有一个 SSH 密钥,但再多创建一个新密钥也没有什么坏处。SSH 密钥的生命周期是在本地计算机上开始的,它由两部分组成:一个是永远不会与任何人或任何东西共享的私钥,一个是可以复制到任何你想要无密码访问的远程机器上的公钥。 +要在没有密码的情况下安全地登录到另一台计算机,登录者必须拥有 SSH 密钥。可能你的机器上已经有一个 SSH 密钥,但再多创建一个新密钥也没有什么坏处。SSH 密钥的生命周期是在本地计算机上开始的,它由两部分组成:一个是永远不会与任何人或任何东西共享的私钥,一个是可以复制到任何你想要无密码访问的远程机器上的公钥。 有的人可能会创建一个 SSH 密钥,并将其用于从远程登录到 GitLab 身份验证的所有操作,但我会选择对不同的任务组使用不同的密钥。例如,我在家里使用一个密钥对本地机器进行身份验证,使用另一个密钥对我维护的 Web 服务器进行身份验证,再一个单独的密钥用于 Git 主机,以及又一个用于我托管的 Git 存储库,等等。在此示例中,我将只创建一个唯一密钥,以在局域网内的计算机上使用。 @@ -135,7 +135,7 @@ bash$ whoami sethkenlon ``` -对局域网上的所有计算机重复此过程,你就将能够无密码浏览这个局域网上的每台主机。实际上,一旦你设置了无密码认证,你就可以编辑 `/etc/ssh/sshd_config` 文件来禁止密码认证。这有助于防止其他人使用 SSH 对计算机进行身份验证,除非他们拥有你的私钥。要想达到这个效果,可以在有 `sudo` 权限的文本编辑器中打开 `/etc/ssh/sshd_config` 并搜索字符串 `PasswordAuthentication`,将默认行更改为: +对局域网上的所有计算机重复此过程,你就将能够无密码访问这个局域网上的每台主机。实际上,一旦你设置了无密码认证,你就可以编辑 `/etc/ssh/sshd_config` 文件来禁止密码认证。这有助于防止其他人使用 SSH 对计算机进行身份验证,除非他们拥有你的私钥。要想达到这个效果,可以在有 `sudo` 权限的文本编辑器中打开 `/etc/ssh/sshd_config` 并搜索字符串 `PasswordAuthentication`,将默认行更改为: ``` PasswordAuthentication no @@ -151,7 +151,7 @@ $ ### 日常使用 SSH -OpenSSH 改变了人们对操作计算机的看法,使用户不再被束缚在面前的计算机上。使用 SSH,你可以访问家中的任何计算机,或者拥有帐户的服务器,甚至是移动和物联网设备。充分利用 SSH 也意味着解锁 Linux 终端的更多用途。如果你还没有习惯使用 SSH,请试一下它吧。试着适应 SSH,创建一些适当的密钥,以此更安全地使用计算机,打破必须与计算机面对面的局限性。 +OpenSSH 改变了人们对操作计算机的看法,使用户不再被束缚在面前的计算机上。使用 SSH,你可以访问家中的任何计算机,或者拥有帐户的服务器,甚至是移动和物联网设备。充分利用 SSH 也意味着解锁 Linux 终端的更多用途。如果你还没有使用过 SSH,请试一下它吧。试着适应 SSH,创建一些适当的密钥,以此更安全地使用计算机,打破必须与计算机面对面的局限性。 -------------------------------------------------------------------------------- @@ -160,7 +160,7 @@ via: https://opensource.com/article/20/9/ssh 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 9dfb95841f2e62a3afa3a0b2b66d562edf1a8770 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 10:55:41 +0800 Subject: [PATCH 229/290] PUB @unigeorge https://linux.cn/article-13726-1.html --- ... beginner-s guide to SSH for remote connection on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200907 A beginner-s guide to SSH for remote connection on Linux.md (99%) diff --git a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/published/20200907 A beginner-s guide to SSH for remote connection on Linux.md similarity index 99% rename from translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md rename to published/20200907 A beginner-s guide to SSH for remote connection on Linux.md index b3cdd2d663..1d32280bd6 100644 --- a/translated/tech/20200907 A beginner-s guide to SSH for remote connection on Linux.md +++ b/published/20200907 A beginner-s guide to SSH for remote connection on Linux.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13726-1.html) [#]: subject: (A beginner’s guide to SSH for remote connection on Linux) [#]: via: (https://opensource.com/article/20/9/ssh) [#]: author: (Seth Kenlon https://opensource.com/users/seth) From 35c7d6a192a09b9da7f7d02cdbe33ca6ed7253cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 16:56:43 +0800 Subject: [PATCH 230/290] PRF&PUB @alim0x https://linux.cn/article-13727-1.html --- ... GPT Partitioning -on Windows and Linux.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) rename {translated/tech => published}/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md (80%) diff --git a/translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md b/published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md similarity index 80% rename from translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md rename to published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md index acca290088..b13f856687 100644 --- a/translated/tech/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md +++ b/published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md @@ -3,18 +3,20 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (alim0x) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13727-1.html) -如何在 Windows 和 Linux 上确定系统使用 MBR 还是 GPT 分区 +如何在 Windows 和 Linux 上确定系统使用的是 MBR 还是 GPT 分区 ====== +![](https://img.linux.net.cn/data/attachment/album/202108/28/165508gqjyigp3yz3gy6yy.jpg) + 在你安装 Linux 或任何其他系统的时候,了解你的磁盘的正确分区方案是非常关键的。 目前有两种流行的分区方案,老一点的 MBR 和新一些的 GPT。现在大多数的电脑使用 GPT。 -在制作 live 镜像或可启动 USB 设备时,一些工具(比如 [Rufus][1])会问你在用的磁盘分区情况。如果你在 MBR 分区的磁盘上选择 GPT 方案的话,制作出来的可启动 USB 设备可能会不起作用。 +在制作临场镜像或可启动 USB 设备时,一些工具(比如 [Rufus][1])会问你在用的磁盘分区情况。如果你在 MBR 分区的磁盘上选择 GPT 方案的话,制作出来的可启动 USB 设备可能会不起作用。 在这个教程里,我会展示若干方法,来在 Windows 和 Linux 系统上检查磁盘分区方案。 @@ -48,15 +50,15 @@ 命令行的方法应该在所有 Linux 发行版上都有效。 -打开终端并使用 sudo 运行下列命令: +打开终端并使用 `sudo` 运行下列命令: ``` sudo parted -l ``` -上述命令实际上是一个基于命令行的 [Linux 分区管理器][5]。命令参数 -l 会列出系统中的所有磁盘以及它们的详情,里面包含了分区方案信息。 +上述命令实际上是一个基于命令行的 [Linux 分区管理器][5]。命令参数 `-l` 会列出系统中的所有磁盘以及它们的详情,里面包含了分区方案信息。 -在命令输出中,寻找以 **Partition Table(分区表)**开头的行: +在命令输出中,寻找以 **Partition Table**(分区表)开头的行: ![][6] @@ -76,17 +78,17 @@ Ubuntu 和一些其它基于 GNOME 的发行版内置了叫做 Disks 的图形 如果你没办法使用 GNOME Disks 工具,别担心,还有其它工具可以使用。 -其中一款流行的工具是 Gparted。你应该可以在大多数 Linux 发行版的软件源中找到它。如果系统中没有安装的话,使用你的发行版的软件中心或[包管理器][9]来[安装 Gparted][8]。 +其中一款流行的工具是 Gparted。你应该可以在大多数 Linux 发行版的软件源中找到它。如果系统中没有安装的话,使用你的发行版的软件中心或 [包管理器][9] 来 [安装 Gparted][8]。 -在 Gparted 中,通过菜单选择 **View-Device Information(查看—设备信息)**。它会在左下区域显示磁盘信息,这些信息中包含分区方案信息。 +在 Gparted 中,通过菜单选择 **View->Device Information**(查看—>设备信息)。它会在左下区域显示磁盘信息,这些信息中包含分区方案信息。 ![][10] 看吧,也不是太复杂,对吗?现在你了解了好几种途径来确认你的系统使用的是 GPT 还是 MBR 分区方案。 -同时我还要提一下,有时候磁盘还会有[混合分区方案][11]。这不是很常见,大多数时候分区不是 MBR 就是 GPT。 +同时我还要提一下,有时候磁盘还会有 [混合分区方案][11]。这不是很常见,大多数时候分区不是 MBR 就是 GPT。 -有任何问题或建议?请在下方留下评论。 +有任何问题或建议,请在下方留下评论。 -------------------------------------------------------------------------------- @@ -95,7 +97,7 @@ via: https://itsfoss.com/check-mbr-or-gpt/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[alim0x](https://github.com/alim0x) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d259dd368713e4d6c05331fd9815223608981bec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sat, 28 Aug 2021 20:27:13 +0800 Subject: [PATCH 231/290] Update 20210821 How to set up your printer on Linux.md translated --- ...821 How to set up your printer on Linux.md | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/sources/tech/20210821 How to set up your printer on Linux.md b/sources/tech/20210821 How to set up your printer on Linux.md index 3cf166373a..57929be7dc 100644 --- a/sources/tech/20210821 How to set up your printer on Linux.md +++ b/sources/tech/20210821 How to set up your printer on Linux.md @@ -7,85 +7,80 @@ [#]: publisher: " " [#]: url: " " -How to set up your printer on Linux +如何在 Linux 系统设置打印机 ====== -In the event that your printer isn't auto-detected, this article teaches -you how to add a printer on Linux manually. +如果系统没有自动检测到你的打印机,这篇文章教你任何在 Linux 系统手动添加打印机。 ![printing on Linux][1] -Even though it's the future now and we're all supposed to be using e-ink and AR, there are still times when a printer is useful. Printer manufacturers have yet to standardize how their peripherals communicate with computers, so there's a necessary maze of printer drivers out there, regardless of what platform you're on. The IEEE-ISTO Printer Working Group (PWG) and the OpenPrinting.org site are working tirelessly to make printing as easy as possible, though. Today, many printers are autodetected with no interaction from the user. +即使未来已来,电子墨水 (e-ink) 和 AR 技术可以现实应用,我们还是会用到打印机的。打印机制造商还不能做到让自己的专利打印机可以与各种计算机完全标准化传递信息,以至于我们需要各种打印机驱动程序,在任何操作系统上都是如此。电子电气工程师协会信息科学与技术处 (IEEE-ISTO) 下属的打印机工作组 (PWG) 和开放打印技术组织 (OpenPrinting.org) 长期合作致力于让人们可以(使用任何型号打印机)轻松打印。带来的便利就是,很多打印机可以不需要用户进行配置就可以自动被识别使用。 -In the event that your printer isn't auto-detected, this article teaches you how to add a printer on Linux manually. This article assumes you're on the GNOME desktop, but the basic workflow is the same for KDE and most other desktops. +如果系统没有自动检测到你的打印机,你可以在这篇文章中找到如何在 Linux 系统手动添加打印机。文中假定你使用的是 GNOME 图形桌面系统,其设置流程同样适用于 KDE 或其他多数桌面系统。 -### Printer drivers +### 打印机驱动程序 -Before attempting to interface with a printer from Linux, you should first verify that you have updated printer drivers. +在你尝试用打印机打印文件时,要先确认你的 Linux 系统上是不是已经安装了匹配的打印机驱动程序。 -There are three varieties of printer drivers: +可以尝试安装的打印机驱动程序有三大类: - * Open source [Gutenprint drivers][2] bundled with Linux and as an installable package - * Drivers provided by the printer manufacturer - * Drivers created by a third party + * 在你的 Linux 系统作为安装包提供的开源打印机驱动程序 [Gutenprint drivers][2] + * 打印机制造商提供的专用驱动程序 + * 第三方开发提供的打印机驱动程序 -It's worth installing the open source drivers because there are over 700 of them, so having them available increases the chance of attaching a printer and having it automatically configured for you. +开源打印机驱动程序库可以驱动 700 多种打印机,值得安装,这里面可能就有你的打印机的驱动,说不定可以自动设置好你的打印机(,你就可以使用它了)。 -### Installing open source drivers +### 安装开源驱动程序包(库) -Your Linux distribution probably already has these installed, but if not, you can install them with your package manager. For example, on Fedora, CentOS, Mageia, and similar: +有些 Linux 发行版已经预装了开源打印机驱动程序包,如果没有,你可以用包管理器来安装。比如说,在 Fedora, CentOS, Magela 等类似发行版的 Linux 系统上,执行下面命令来安装: ``` `$ sudo dnf install gutenprint` ``` -For HP printers, also install Hewlett-Packard's Linux Imaging and Printing (HPLIP) project. For example, on Debian, Linux Mint, and similar: +惠普 (HP) 系列的打印机,还需要安装惠普的 Linux 图形及打印系统软件包 (Hewlett-Packard's Linux Imaging and Printing (HPLIP) ). 类似 Debian, Linux Mint 等系列的系统,使用下面的命令: ``` `$ sudo apt install hplip` ``` -### Installing vendor drivers +### 安装制造商提供的驱动程序 -Sometimes a printer manufacturer uses non-standard protocols, so the open source drivers don't work. Other times, the open source drivers work but may lack special vendor-only features. When that happens, you must visit the manufacturer's website and search for a Linux driver for your printer model. The install process varies, so read the install instructions carefully. +很多时候因为打印机制造商使用非标准的接口协议,这种情况开源打印机驱动程序就不能驱动打印机。另外的情况就是,开源驱动程序可以驱动打印机工作,但是会缺少品牌特有的有些性能。这些情况,你需要访问制造商的网站,找到适合你的打印机型号的 Linux 平台驱动。安装过程各异,仔细阅读安装指南逐步安装。 -In the event that your printer isn't supported at all by the vendor, there are [third-party driver authors][3] that may support your printer. These drivers aren't open source, but neither are most vendor drivers. It's frustrating to have to spend an extra $45 to get support for a printer, but the alternative is to throw the printer into the rubbish, and now you know at least one brand to avoid when you purchase your next printer! +即便是厂家的驱动也不能驱动你的打印机工作,你或许也只能尝试第三方提供的该型号打印机的驱动软件 ([third-party driver authors][3]) 了。这类第三方驱动程序不是开源的,和打印机专用驱动程序一样闭源。如果你需要额外花费 45 美元(约 400 员人民币)从供应商那里获取帮助服务才能安装好驱动并使用你的打印机,那是很心疼,或者你索性把这台打印机扔掉,至少你知道下次再也不会购买这个品牌的打印机了。(译者注:国内售后服务收费没有北美那么高,有需要还是先电话咨询售后,有没有 Linux 平台的专用驱动可真是碰运气。) -### Common Unix Printing System (CUPS) +### 统一接口打印驱动系统(CUPS) -The Common Unix Printing System (CUPS) was developed in 1997 by Easy Software Products, and purchased by Apple in 2007. It's the open source basis for printing on Linux, but most modern distributions provide a customized interface for it. Thanks to CUPS, your computer can find printers attached to it by a USB cable and even a shared printer over a network. +统一接口打印驱动系统 (CUPS) 是由 Easy Software Products 公司于 1997 年开发的,2007 年被苹果公司 (Apple) 收购。这是 Linux 平台打印的开源基础软件包,很多改进的发行版本提供定制化的界面。得益于 CUPS 技术,你可以发使用通过 USB 接口连接到电脑的打印机,甚至连接在同一网络的共享打印机。 -Once you've gotten the necessary drivers installed, you can add your printer manually. First, attach your printer to your computer and power them both on. Then open the **Printers** application from the **Activities** screen or application menu. - -![printer settings][4] +一旦你安装了需要的驱动程序包,你就能手工添加你的打印机了。首先,把打印机连接到运行的电脑上,并打开打印机电源。然后从启动器 **(Activities**)或者应用列表中找到并打开打印机设置**(Printers)**。![printer settings][4] CC BY-SA Opensource.com -There's a possibility that your printer is autodetected by Linux, by way of the drivers you've installed, and that no further configuration is required. +基于你已经安装的驱动包,你的 Linux 系统有可能自动检测识别到你的打印机型号,不需要额外的设置就可以使用你的打印机了。 ![printer settings][5] CC BY-SA Opensource.com -Provided that you see your printer listed, you're all set, and you can already print from Linux! +一旦你在列表中找到你的打印机型号,设置使用这个驱动,恭喜你就可以在 Linux 系统上用它打印了。 -If you see that you need to add a printer, click the **Unlock** button in the top right corner of the **Printers** window. Enter your administrative password and the button transforms into an **Add** button. +(如果你的打印机没有被自动识别,)你需要自行添加打印机。在打印机设置界面**(Printers)**,点击右上角的解锁按钮(**Unlock**),输入管理用户密码,按钮转换成**添加打印机**按钮 (**Add**) 。 -Click the **Add** button. - -Your computer searches for attached printers (also called a _local_ printer). To have your computer look for a shared network printer, enter the IP address of the printer or its host. +然后点击这个**添加打印机**按钮 (**Add**) ,电脑会搜索已经连接的本地打印机型号并匹配相应驱动程序。如果要添加网络共享打印机,在搜索框输入打印机或者其服务器机的 IP 地址。 ![searching for a printer][6] CC BY-SA Opensource.com -Select the printer you want to add to your system and click the **Add** button. +选中你想添加的打印机型号,点击**添加**按钮 (**Add**) 把打印机驱动加入系统,就可以使用它了。 -### Print from Linux +### 在 Linux 系统上打印 -Printing from Linux is as easy as printing can be, whether you're using a local or networked printer. If you're looking for a printer to purchase, then check the [OpenPrinting.org database][7] to confirm that a printer has an open source driver before you spend your money. If you already have a printer, you now know how to use it on your Linux computer. +在 Linux 系统上打印很容易,不管你是在使用本地打印机还是网络打印机。如果你计划购买打印机,建议查看开放打印技术组织的(可支持打印机)数据库 ( [OpenPrinting.org database][7] ) ,看看你想购买的打印机是不是有相应的开源驱动程序。如果你已经拥有一台打印机,你现在也知道怎样在你的 Linux 系统上使用你的打印机了。 -------------------------------------------------------------------------------- @@ -100,10 +95,11 @@ via: https://opensource.com/article/21/8/add-printer-linux [a]: https://opensource.com/users/seth [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/happy-printer.png?itok=9J44YaDs (printing on Linux) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/happy-printer.png?itok=9J44YaDs "printing on Linux" [2]: http://gimp-print.sourceforge.net/ [3]: https://www.turboprint.info/ -[4]: https://opensource.com/sites/default/files/system-settings-printer_0.png (printer settings) -[5]: https://opensource.com/sites/default/files/settings-printer.png (printer settings) -[6]: https://opensource.com/sites/default/files/printer-search.png (searching for a printer) +[4]: https://opensource.com/sites/default/files/system-settings-printer_0.png "printer settings" +[5]: https://opensource.com/sites/default/files/settings-printer.png "printer settings" +[6]: https://opensource.com/sites/default/files/printer-search.png "searching for a printer" [7]: http://www.openprinting.org/printers/ + From 3afc723a1bfc314897e3b64534bf424aba41d1c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sat, 28 Aug 2021 20:31:45 +0800 Subject: [PATCH 232/290] Rename sources/tech/20210821 How to set up your printer on Linux.md to translated/tech/20210821 How to set up your printer on Linux.md translated directory allready --- .../tech/20210821 How to set up your printer on Linux.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210821 How to set up your printer on Linux.md (100%) diff --git a/sources/tech/20210821 How to set up your printer on Linux.md b/translated/tech/20210821 How to set up your printer on Linux.md similarity index 100% rename from sources/tech/20210821 How to set up your printer on Linux.md rename to translated/tech/20210821 How to set up your printer on Linux.md From c7a43ce277c0dbdb2b9fbb2371cf699c31e5b0d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Sat, 28 Aug 2021 20:45:19 +0800 Subject: [PATCH 233/290] translating translating by fisherue --- .../20210812 A guide to the Linux terminal for beginners.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210812 A guide to the Linux terminal for beginners.md b/sources/tech/20210812 A guide to the Linux terminal for beginners.md index 7a184b585f..3be4d832de 100644 --- a/sources/tech/20210812 A guide to the Linux terminal for beginners.md +++ b/sources/tech/20210812 A guide to the Linux terminal for beginners.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-terminal" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "fisherue " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -108,7 +108,7 @@ via: https://opensource.com/article/21/8/linux-terminal 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID][c] 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -127,3 +127,4 @@ via: https://opensource.com/article/21/8/linux-terminal [10]: https://opensource.com/article/21/7/terminal-basics-copying-files-linux-terminal [11]: https://opensource.com/article/21/7/terminal-basics-removing-files-and-folders-linux-terminal [12]: https://opensource.com/downloads/bash-scripting-ebook +[c]: https://github.com/fisherue From 91d5d9b18fb1ae08a0df50e0d06e7d2fbd637520 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 22:22:40 +0800 Subject: [PATCH 234/290] APL --- ...- Your Ultimate Browser Choice for Private Web Experience.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md index 0d1379b67a..5375f42b07 100644 --- a/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md +++ b/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/brave-vs-firefox/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 4690deea004d86857d9eedd220aff40453dd23c1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 28 Aug 2021 23:47:53 +0800 Subject: [PATCH 235/290] TSL&PRF --- ...owser Choice for Private Web Experience.md | 247 ------------------ ...owser Choice for Private Web Experience.md | 233 +++++++++++++++++ 2 files changed, 233 insertions(+), 247 deletions(-) delete mode 100644 sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md create mode 100644 translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md diff --git a/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md deleted file mode 100644 index 5375f42b07..0000000000 --- a/sources/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md +++ /dev/null @@ -1,247 +0,0 @@ -[#]: subject: (Brave vs. Firefox: Your Ultimate Browser Choice for Private Web Experience) -[#]: via: (https://itsfoss.com/brave-vs-firefox/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Brave vs. Firefox: Your Ultimate Browser Choice for Private Web Experience -====== - -Web browsers have evolved over the years. From downloading files to accessing a full-fledged web application, we have come a long way. - -For a lot of users, the web browser is the only thing they need to get their work done these days. - -Hence, choosing the right browser becomes an important task that could help improve your workflow over the years. - -### Brave vs. Firefox Browser - -Brave and Mozilla’s Firefox are two of the most popular web browsers for privacy-conscious users and open-source enthusiasts. - -Considering that both focus heavily on privacy and security, let us look at what exactly they have to offer, to help you decide what you should go with. - -Here are the comparison pointers that I’ve used, you can directly navigate to any of them: - - * [User Interface][1] - * [Performance][2] - * [Browser Engine][3] - * [Ad & Tracking Blocking Capabilities][4] - * [Containers][5] - * [Rewards][6] - * [Cross-Platform Availability][7] - * [Synchronization][8] - * [Service Integrations][9] - * [Customizability][10] - * [Extension Support][11] - - - -### User Interface - -The user interface is what makes the biggest difference with the workflow and experience when using the browser. - -Of course, you can have your personal preferences, but the easier, snappier, and cleaner it looks, the better it is. - -![Brave browser][12] - -To start with, Brave shares a similar look and feel to Chrome and Microsoft Edge. It offers a clean experience with minimal UI elements and all the essential options accessible through the browser menu. - -It offers a black theme as well. The subtle animations make the interaction a pleasant experience. - -To customize it, you can choose to use themes available from the chrome web store. - -When it comes to Mozilla Firefox, it has had a couple of major redesigns over the years, and the latest user interface tries to offer a closer experience to Chrome. - -![Firefox browser][13] - -The Firefox design looks impressive and provides a clean user experience. It also lets you opt for a dark theme if needed and there are several theme options to download/apply as well. - -Both web browsers offer a good user experience. - -If you want a familiar experience, but with a pinch of uniqueness, Mozilla’s Firefox can be a good pick. - -But, if you want a snappier experience with a better feel for the animations, Brave gets the edge. - -### Performance - -Practically, I find Brave loading web pages faster. Also, the overall user experience feels snappy. - -Firefox is not terribly slow, but it definitely felt slower than Brave. - -To give you some perspective, I also utilized [Basemark][14] to run a benchmark to see if that is true on paper. - -You can check with other browser benchmark tools available, but Basemark performs a variety of tests, so we’ll go with that for this article. - -![Firefox benchmark score][15] - -![Brave benchmark score][16] - -Firefox managed to score **630** and Brave pulled it off better with ~**792**. - -Do note that these benchmarks were run with default browser settings without any browser extensions installed. - -Of course, synthetic scores may vary depending on what you have going on in the background and the hardware configuration of your system. - -This is what I got with **i5-7400, 16 GB RAM, and GTX 1050ti GPU** on my desktop. - -In general, Brave browser is a fast browser compared to most of the popular options available. - -Both utilize a decent chunk of system resources and that varies to a degree with the number of tabs, types of webpages accessed, and the kind of blocking extension used. - -For instance, Brave blocks aggressively by default but Firefox does not block display advertisements by default. And, this affects the system resource usage. - -### Browser Engine - -Firefox utilizes its own Gecko engine as the foundation and is using components on top of that from [servo research project][17] to improve. - -Currently, it is essentially an improved Gecko engine dubbed by a project name “Quantum” which was introduced with the release of Firefox Quantum. - -On the other hand, Brave uses Chromium’s engine. - -While both are capable enough to handle modern web experiences, Chromium-based engine is just more popular and web developers often tailor their sites for the best experience on Chrome-based browsers - -Also, some services happen to exclusively support Chrome-based browsers. - -### Ad & Tracker Blocking Capabilities - -![][18] - -As I have mentioned before, Brave is aggressive in blocking trackers and advertisements. By default, it comes with the blocking feature enabled. - -Firefox also enables the enhanced privacy protection by default but does not block display advertisements. - -You will have to opt for the “**Strict**” privacy protection mode with Firefox if you want to get rid of display advertisements. - -With that being said, Firefox enforces some unique tracking protection technology that includes Total Cookie Protection which isolates cookies for each site and prevents cross-site cookie tracking. - -![][19] - -This was introduced with [Firefox 86][20] and to use it, you need to enable a strict privacy protection mode. - -Overall, Brave might look like a better option out of the box, and Mozilla Firefox offers better privacy protection features. - -### Containers - -Firefox also offers a way to isolate site activity when you use Facebook with help of a container. In other words, it prevents Facebook from tracking your offsite activity. - -You can also use containers to organize your tabs and separate sessions when needed. - -Brave does not offer anything similar but it does block cross-site trackers and cookies out-of-the-box. - -### Rewards - -![][21] - -Unlike Firefox, Brave offers its own advertising network by blocking other advertisements on the web. - -When you opt in to display privacy-friendly ads by Brave, you get rewarded with tokens to a crypto wallet. And you can use these tokens to give back to your favorite websites. - -While this is a good business strategy to get away from mainstream advertising, for users who do not want any kind of advertisements, it may not be useful. - -So, Brave offers an alternative in the form of rewards to help websites even if you block advertisements. If it is something you appreciate, Brave will be a good pick for you. - -### Cross-Platform Availability - -You will find both Brave and Firefox available for Linux, Windows, and macOS. Mobile apps are also available for iOS and Android. - -For Linux users, Firefox comes baked in with most of the Linux distributions. And, you can also find it available in the software center. In addition to that, there is also a [Flatpak][22] package available. - -Brave is not available through default repositories and the software center. Hence, you need to follow the official instructions to add the private repository and then [get Brave installed in your Linux distro][23]. - -### Synchronization - -With Mozilla Firefox, you get to create a Firefox account to sync all your data cross-platform. - -![][24] - -Brave also lets you sync cross-platform but you need access to one of the devices in order to successfully do it. - -![][25] - -Hence, Firefox sync is more convenient. - -Also, you get access to Firefox’s VPN, data breach monitor, email relay, and password manager with the Firefox account. - -### Service Integrations - -Right off the bat, Firefox offers more service integrations that include Pocket, VPN, password manager, and also some of its new offerings like Firefox relay. - -If you want access to these services through your browser, Firefox will be the convenient option for you. - -While Brave does offer crypto wallets, it is not for everyone. - -![][26] - -Similarly, if you like using [Brave Search][27], you may have a seamless experience when using it with Brave browser because of the user experience. - -### Customizability & Security - -Firefox shines when it comes to customizability. You get more options to tweak the experience and also take control of the privacy/security of your browser. - -The ability to customize lets you make Firefox more secure than the Brave browser. - -While hardening Firefox is a separate topic which we’ll talk about. To give you an example, [Tor Browser][28] is just a customized Firefox browser. - -However, that does not make Brave less secure. It is a secure browser overall but you do get more options with Firefox. - -### Extension Support - -There’s no doubt that the Chrome web store offers way more extensions. - -So, Brave gets a clear edge over Firefox if you are someone who utilizes a lot of extensions (or constantly try new ones). - -Firefox may not have the biggest catalog of extensions, it does support most of the extensions. For common use-cases, you will rarely find an extension that is not available as an addon for Firefox. - -### What Should You Choose? - -If you want the best compatibility with the modern web experience and want access to more extensions, Brave browser seems to make more sense. - -On the other hand, Firefox is an excellent choice for everyday browsing with industry-first privacy features, and a convenient sync option for non-tech savvy users. - -You will have a few trade-offs when selecting either of them. So, your will have to prioritize what you want the most. - -Let me know about your final choice for your use case in the comments down below! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/brave-vs-firefox/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: tmp.5yJseRG2rb#ui -[2]: tmp.5yJseRG2rb#perf -[3]: tmp.5yJseRG2rb#engine -[4]: tmp.5yJseRG2rb#ad -[5]: tmp.5yJseRG2rb#container -[6]: tmp.5yJseRG2rb#reward -[7]: tmp.5yJseRG2rb#cp -[8]: tmp.5yJseRG2rb#sync -[9]: tmp.5yJseRG2rb#service -[10]: tmp.5yJseRG2rb#customise -[11]: tmp.5yJseRG2rb#extensions -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-ui-new.jpg?resize=800%2C450&ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-ui.jpg?resize=800%2C450&ssl=1 -[14]: https://web.basemark.com -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-basemark.png?resize=800%2C598&ssl=1 -[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/basemark-brave.png?resize=800%2C560&ssl=1 -[17]: https://servo.org -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-blocker.png?resize=800%2C556&ssl=1 -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-blocker.png?resize=800%2C564&ssl=1 -[20]: https://news.itsfoss.com/firefox-86-release/ -[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-rewards.png?resize=800%2C560&ssl=1 -[22]: https://itsfoss.com/what-is-flatpak/ -[23]: https://itsfoss.com/brave-web-browser/ -[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-sync.png?resize=800%2C651&ssl=1 -[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-sync.png?resize=800%2C383&ssl=1 -[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-crypto-wallet.png?resize=800%2C531&ssl=1 -[27]: https://itsfoss.com/brave-search-features/ -[28]: https://itsfoss.com/install-tar-browser-linux/ diff --git a/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md new file mode 100644 index 0000000000..9d2391ba56 --- /dev/null +++ b/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md @@ -0,0 +1,233 @@ +[#]: subject: (Brave vs. Firefox: Your Ultimate Browser Choice for Private Web Experience) +[#]: via: (https://itsfoss.com/brave-vs-firefox/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +Brave vs. Firefox:你的私人网络体验的终极浏览器选择 +====== + +Web 浏览器经过多年的发展。从下载文件到访问成熟的Web 应用程序,我们已经走过了很长的路。 + +对于很多用户来说,Web 浏览器是他们如今完成工作的唯一需要。 + +因此,选择合适的浏览器就成为了一项重要的任务,它可以帮助改善你多年来的工作流程。 + +### Brave vs. Firefox + +Brave 和 Mozilla Firefox 是两个最受到关注隐私的用户和开源爱好者欢迎的 Web 浏览器。 + +考虑到两者都非常注重隐私和安全,让我们看看它们到底能提供什么,以帮助你决定应该选择哪一个。 + +以下是我所使用的比较指标: + +### 用户界面 + +用户界面是使用浏览器时的工作流程和体验的最大区别。 + +当然,你会有你的个人偏好,但它看起来越容易使用、越轻快、越干净,就越好。 + +![Brave 浏览器][12] + +首先,Brave 与 Chrome 和微软 Edge 有着相似的外观和感受。它提供了一种简洁的体验,具有精简的 UI 元素,所有的基本选项都可以通过浏览器菜单访问。 + +它也提供了一个暗色主题。恰到好处的动画使得互动成为一种愉快的体验。 + +要定制它,你可以选择使用 Chrome Web 商店中的主题。 + +说到 Mozilla Firefox,多年来它经历了几次重大的重新设计,其最新的用户界面试图提供与 Chrome 更接近的体验。 + +![Firefox 浏览器][13] + +Firefox 浏览器的设计看起来令人印象深刻,并提供了干净利落的用户体验。如果需要的话,你还可以选择一个暗色主题,此外还有几个主题可供下载使用。 + +这两个 Web 浏览器都能提供良好的用户体验。 + +如果你想要一个熟悉的体验,但又具有一丝独特之处,Mozilla Firefox 是一个不错的选择。 + +但是,如果你想获得更快捷的体验、更好的动画感受,Brave 更有优势。 + +### 性能 + +实际上,我发现 Brave 加载网页的速度更快,整体的用户体验感觉很轻快。 + +Firefox 浏览器倒不是非常慢,但它绝对感觉比 Brave 慢。 + +为了给你一些参考,我还利用 [Basemark][14] 运行了一个基准测试,看看事实上是否真的如此。 + +你可以使用其他的浏览器基准测试工具来测试一下,但我用 Basemark 进行了各种测试,所以我们在这篇文章中会用它。 + +![Firefox 基准得分][15] + +![Brave 基准得分][16] + +Firefox 浏览器成功获得了 **630** 的得分,而 Brave 以大约 **792** 的得分取得了更好的成绩。 + +请注意,这些基准测试是在没有安装任何浏览器扩展程序的情况下,以默认的浏览器设置进行的。 + +当然,你的分数可能会有所不同,这取决于你在后台进行的工作和你系统的硬件配置。 + +这是我在 **i5-7400、16GB 内存和 GTX 1050ti GPU** 配置的桌面电脑上得到的结果。 + +一般来说,与大多数流行的浏览器相比,Brave 浏览器是一个快速的浏览器。 + +这两者都占用了相当大的系统资源,而且在一定程度上随着标签数量、访问的网页类型和使用的拦截扩展的种类而变化。 + +例如,Brave 在默认情况下会主动阻止广告,但 Firefox 在默认情况下不会阻止显示广告。而且,这也影响了系统资源的使用。 + +### 浏览器引擎 + +Firefox 浏览器在自己的 Gecko 引擎基础上,使用来自 [servo 研究项目][17] 的组件来进行改进。 + +目前,它基本上是一个改进的 Gecko 引擎,其项目名称是随着 Firefox Quantum 的发布而推出的 “Quantum”。 + +另一方面,Brave 使用 Chromium 的引擎。 + +虽然两者都有足够的能力处理现代 Web 体验,但基于 Chromium 的引擎更受欢迎,Web 开发人员通常会在基于 Chrome 的浏览器上定制他们的网站以获得最佳体验。 + +另外,有些服务恰好只支持基于 Chrome 的浏览器。 + +### 广告 & 追踪器阻止功能 + +![][18] + +正如我之前提到的,Brave 在阻止跟踪器和广告方面非常积极。默认情况下,它已经启用了屏蔽功能。 + +Firefox 浏览器也默认启用了增强的隐私保护功能,但并不阻止显示广告。 + +如果你想摆脱广告,你得选择火狐浏览器的 “严格隐私保护模式”。 + +也就是说,火狐浏览器执行了一些独特的跟踪保护技术,包括“全面 Cookie 保护”,可以为每个网站隔离 Cookie 并防止跨站 Cookie 跟踪。 + +![][19] + +这是在 [Firefox 86][20] 中引入的技术,要使用它,你需要启用“严格隐私保护模式”。 + +总的来说,Brave 可能看起来是一个更好的选择,而 Mozilla Firefox 提供了更好的隐私保护功能。 + +### 容器 + +当你访问 Facebook 时,Firefox 还提供了一种借助容器来隔离网站活动的方法。换句话说,它可以防止 Facebook 跟踪你的站外活动。 + +你还可以使用容器来组织你的标签,并在需要时分离会话。 + +Brave 没有提供任何类似的功能,但它本身可以阻止跨站追踪器和 cookie。 + +### 奖励 + +![][21] + +与 Firefox 不同,Brave 通过屏蔽网络上的其他广告来提供自己的广告网络。 + +当你选择显示 Brave 的隐私友好型广告时,你会得到可以放到加密货币钱包里的通证奖励。而你可以用这些通证来回馈你喜欢的网站。 + +虽然这是摆脱主流广告的一个很好的商业策略,但对于不想要任何形式的广告的用户来说,这可能没有用。 + +因此,Brave 以奖励的形式提供了一个替代方案,即使你屏蔽了广告,也可以帮助网站。如果这是你欣赏的东西,Brave 将是你的一个好选择。 + +### 跨平台可用性 + +你会发现 Brave 和 Firefox 都有 Linux、Windows 和 macOS 版本,也有用于 iOS 和 Android 的移动应用程序。 + +对于 Linux 用户来说,Firefox 浏览器捆绑找大多数的 Linux 发行版中。而且,你也可以在软件中心里找到它。除此之外,还有一个 [Flatpak][22] 包可用。 + +Brave 不能通过默认的软件库和软件中心获得。因此,你需要按照官方的说明来添加私有仓库,然后 [把 Brave 安装在你的 Linux 发行版中][23]。 + +### 同步 + +通过 Mozilla Firefox,你可以创建一个 Firefox 账户来跨平台同步你的所有数据。 + +![][24] + +Brave 也可以让你跨平台同步,但你需要访问其中一个设备才能成功做到这一点。 + +![][25] + +因此,Firefox 的同步更方便。 + +另外,你可以通过 Firefox 的账户访问它的“虚拟专用网络”、数据泄露监控器、电子邮件中继,以及密码管理器。 + +### 服务集成 + +一开始,Firefox 就提供了更多的服务集成,包括 Pocket、“虚拟私有网络”、密码管理器,还有一些新产品,如 Firefox 中继。 + +如果你想通过你的浏览器访问这些服务,Firefox 将是你的方便选择。 + +虽然 Brave 确实提供了加密货币钱包,但它并不适合所有人。 + +![][26] + +同样,如果你喜欢使用 [Brave Search][27],在使用 Brave 浏览器时,由于用户体验的原因,你可能会有顺滑的体验。 + +### 可定制性 & 安全性 + +Firefox 浏览器在可定制性方面大放异彩。你可以通过众多选项来调整体验,也可以控制你的浏览器的隐私/安全。 + +自定义的能力使你可以让 Firefox 比 Brave 浏览器更安全。 + +而加固 Firefox 浏览器是一个我们将讨论的单独话题。略举一例,[Tor 浏览器][28] 只是一个定制的 Firefox 浏览器。 + +然而,这并不意味着 Brave 的安全性降低。总的来说,它是一个安全的浏览器,但你确实可以通过 Firefox 浏览器获得更多的选择。 + +### 扩展支持 + +毫无疑问,Chrome Web 商店提供了更多的扩展。 + +因此,如果你是一个使用大量扩展(或不断尝试新扩展)的人,Brave 明显比 Firefox 更有优势。 + +Firefox 可能扩展目录不是最大的,但它确实支持大多数的扩展。对于常见的使用情况,你很少能找到一个不能作为 Firefox 附加组件的扩展。 + +### 你应该选择那个? + +如果你希望尽量兼容现代的 Web 体验,并希望有更多的扩展,Brave 浏览器似乎更合适。 + +另一方面,Firefox 浏览器是日常浏览的绝佳选择,它具有业界首创的隐私功能,并为不懂技术的用户提供了方便的同步选项。 + +在选择它们中的任何一个时会有一些取舍。因此,你需要优先考虑你最想要的东西。 + +请在下面的评论中告诉我你对你的使用情况的最终选择! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/brave-vs-firefox/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: tmp.5yJseRG2rb#ui +[2]: tmp.5yJseRG2rb#perf +[3]: tmp.5yJseRG2rb#engine +[4]: tmp.5yJseRG2rb#ad +[5]: tmp.5yJseRG2rb#container +[6]: tmp.5yJseRG2rb#reward +[7]: tmp.5yJseRG2rb#cp +[8]: tmp.5yJseRG2rb#sync +[9]: tmp.5yJseRG2rb#service +[10]: tmp.5yJseRG2rb#customise +[11]: tmp.5yJseRG2rb#extensions +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-ui-new.jpg?resize=800%2C450&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-ui.jpg?resize=800%2C450&ssl=1 +[14]: https://web.basemark.com +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-basemark.png?resize=800%2C598&ssl=1 +[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/basemark-brave.png?resize=800%2C560&ssl=1 +[17]: https://servo.org +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-blocker.png?resize=800%2C556&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-blocker.png?resize=800%2C564&ssl=1 +[20]: https://news.itsfoss.com/firefox-86-release/ +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-rewards.png?resize=800%2C560&ssl=1 +[22]: https://itsfoss.com/what-is-flatpak/ +[23]: https://itsfoss.com/brave-web-browser/ +[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/firefox-sync.png?resize=800%2C651&ssl=1 +[25]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-sync.png?resize=800%2C383&ssl=1 +[26]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-crypto-wallet.png?resize=800%2C531&ssl=1 +[27]: https://itsfoss.com/brave-search-features/ +[28]: https://itsfoss.com/install-tar-browser-linux/ From 5cb464ab0218fa4f2e69fb9d98b578769043413e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 29 Aug 2021 05:05:02 +0800 Subject: [PATCH 236/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210828=20?= =?UTF-8?q?Parse=20command-line=20options=20in=20Groovy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210828 Parse command-line options in Groovy.md --- ...28 Parse command-line options in Groovy.md | 184 ++++++++++++++++++ 1 file changed, 184 insertions(+) create mode 100644 sources/tech/20210828 Parse command-line options in Groovy.md diff --git a/sources/tech/20210828 Parse command-line options in Groovy.md b/sources/tech/20210828 Parse command-line options in Groovy.md new file mode 100644 index 0000000000..1985825300 --- /dev/null +++ b/sources/tech/20210828 Parse command-line options in Groovy.md @@ -0,0 +1,184 @@ +[#]: subject: "Parse command-line options in Groovy" +[#]: via: "https://opensource.com/article/21/8/parsing-command-options-groovy" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Parse command-line options in Groovy +====== +Learn to add options to your Groovy applications. +![Woman sitting in front of her computer][1] + +A recent article provided an [introduction to parsing command-line options in Java][2]. Because I really like Groovy, and because Groovy is well suited for scripting, and because it's fun to compare Java and Groovy solutions, I decided to paraphrase Seth's article, but using Groovy. + +### Install Groovy + +Groovy is based on Java, so it requires a Java installation. Both a recent and decent version of Java and Groovy might be in your Linux distribution's repositories. Alternately, you can install Groovy by following the instructions on the [groovy-lang.org][3]. + +A nice alternative for Linux users is [SDKMan][4], which can be used to get multiple versions of Java, Groovy, and many other related tools. For this article, I'm using my distro's OpenJDK11 release and SDKMan's latest Groovy release. + +### Parsing command-line options in Groovy + +When we create a script—a kind of short, often informal program—to be run from the command line, we normally follow the practice of passing arguments to the script on the command line. A good example of this is the `ls` command, used to list all the files and subfolders in a given folder, perhaps showing attributes and sorted in reverse order of last modification date, as in: + + +``` +`$ ls -lt /home/me` +``` + +To show the contents of my home folder like this: + + +``` +total 252 +drwxr-xr-x 5 me me 4096 Aug 10 12:23 Downloads +drwx------ 11 me me 4096 Aug 10 08:59 Dropbox +drwxr-xr-x 27 me me 12288 Aug 9 11:58 Pictures +-rw-rw-r-- 1 me me 235 Jul 28 16:22 wb.groovy +drwxr-xr-x 2 me me 4096 Jul 20 22:04 Desktop +drwxrwxr-x 2 me me 4096 Jul 20 15:16 Fixed +drwxr-xr-x 2 me me 16384 Jul 19 08:49 Music +-rw-rw-r-- 1 me me 433 Jul 7 13:24 foo +drwxr-xr-x 6 me me 4096 Jun 29 10:25 Documents +drwxr-xr-x 2 me me 4096 Jun 14 22:15 Templates +-rw-rw-r-- 1 me me 803 Jun 14 11:33 bar +``` + +Of course, arguments to commands can be handled by inspecting them and deciding what to do in each case; but this ends up being a duplication of effort that can be avoided by using a library designed for that purpose. + +Seth's Java article introduces the [Apache Commons CLI library][5], a great API for handling command-line options. In fact, this library is so great that the good people who develop Groovy make it available by default in the Groovy installation. Therefore, once you have Groovy installed, you have access to this library through [**groovy.cli.picocli.CliBuilder**][6], which is already imported for you by default. + +Here's a Groovy script that uses this CLI builder to achieve the same results as Seth's Java program: + + +``` +1 def cli = new CliBuilder(usage: 'ho.groovy [-a] -c') +2 cli.with { +3    a longOpt: 'alpha', 'Activate feature alpha' +4    c longOpt: 'config', args:1, argName: 'config', required: true, 'Set config file' +5 } +6 def options = cli.parse(args) +7 if (!options) { +8    return +9 } +10 if (options.a) { +11    println' Alpha activated' +12 } +13 if (options.c) { +14    println "Config set to ${options.c}" +15 } +``` + +I've included line numbers here to facilitate the discussion. Save this script without the line numbers in a file called **ho.groovy**. + +On line 1, we define the variable **cli** and set it to a new instance of **CliBuilder** with a defined **usage** attribute. This is a string that will be printed if the **usage()** method is called. + +On lines 2-5, we use [the **with()** method][7] that Groovy adds to objects, together with the DSL defined by **CliBuilder**, to set up the option definitions. + +On line 3, we define the option '**a**', setting its **longOpt** field to '**alpha**' and its description to '**Activate feature alpha**'. + +Similarly, on line 4, we define the option '**c**', setting its **longOpt** field to '**config**' and specifying that this option takes one argument whose name is '**config**'. Moreover, this is a **required** option (sounds funny, I know), and its description is '**Set config file**'. + +Pausing briefly here for a bit of background, you can read all about these various options at the **CliBuilder** link above. More generally, things written in the form **longOpt: 'alpha'** are Groovy notation for key-value entries to be put in a **Map** instance, which you can read about [here][8]. Each key, in this case, corresponds to a method of the same name provided by the CliBuilder. If you're wondering what's going on with a line like: + + +``` +`a longOpt: 'alpha', 'Activate feature alpha'` +``` + +then it may be useful to mention that Groovy allows us to drop parentheses in certain circumstances; so the above is equivalent to: + + +``` +`a(longOpt: 'alpha', 'Activate feature alpha')` +``` + +i.e., it's a method call. Moreover, Groovy allows both positional and named parameters, the latter using that key: value syntax. + +Onward! On lines 6-9, we call the **parse()** method of the **CliBuilder** instance **cli**, passing the **args—**an array of **String** values created by the Groovy run-time and containing the arguments from the command line. This method returns a **Map** of the options where the keys are the short-form of the predefined options—in this case, '**a**' and '**c**'. If the parsing fails, then **parse()** emits the **usage** message, a reasonable error message, and returns a null value, so we don't have to use a try-catch block (which one doesn't see as often in Groovy). So here—line 8—we just return since all our work is done for us. + +On lines 10-12, we check to see if option '_a_' was included on the command line and if it is, print a message saying so. + +Similarly, on lines 13-15, we check to see if option '**c**' was included on the command line and if so, print a message showing the argument provided to it. + +### Running the command + +Let’s run the script a few times; first with no arguments: + + +``` +$ groovy ho.groovy +error: Missing required option: c +usage: ho.groovy [-a] -c + -a,--alpha Activate feature alpha + -c,--config <config> [Set][9] config file +$ +``` + +Notice the complaint about missing the required option '**c**'. + +Then with the '**c**' option but no argument: + + +``` +$ groovy ho.groovy -c +error: Missing argument for option: c +usage: ho.groovy [-a] -c + -a,--alpha +Activate feature alpha + -c,--config <config> [Set][9] config file +$ +``` + +Cool, the **CliBuilder** instance method **parse()** noticed no argument was provided to '**c**'. + +Finally, let's try with both options and an argument to '**c**', in their long form: + + +``` +$ groovy ho.groovy --alpha --config bar +Alpha activated +Config set to bar +$ +``` + +Looks good! + +Since the idea of the '**c**' option is to provide a config file, we could also tell the **CliBuilder** instance that the type of this argument is File, and it will return that instead of a String. But we'll leave that for another day. + +So, there you have it—command-line option parsing in Groovy. + +### Groovy resources + +The Groovy website has a lot of great documentation. Another great Groovy resource is [Mr. Haki][10], and specifically [this lovely article on CliBuilder][11]. + +Another great reason to learn Groovy is [Grails][12], a wonderfully productive full-stack web framework built on top of excellent components like Hibernate, Spring Boot, and Micronaut. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/parsing-command-options-groovy + +作者:[Chris Hermansen][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/clhermansen +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_3.png?itok=qw2A18BM (Woman sitting in front of her computer) +[2]: https://opensource.com/article/21/8/java-commons-cli +[3]: https://groovy-lang.org/ +[4]: https://sdkman.io/ +[5]: https://commons.apache.org/proper/commons-cli/ +[6]: https://docs.groovy-lang.org/latest/html/gapi/groovy/cli/picocli/CliBuilder.html +[7]: https://objectpartners.com/2014/07/09/groovys-with-and-multiple-assignment/ +[8]: https://www.baeldung.com/groovy-maps +[9]: http://www.google.com/search?hl=en&q=allinurl%3Adocs.oracle.com+javase+docs+api+set +[10]: https://blog.mrhaki.com/ +[11]: https://blog.mrhaki.com/2009/09/groovy-goodness-parsing-commandline.html +[12]: https://grails.org/ From 50354bb9be3ac363574529793f08082082fcea37 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Aug 2021 09:59:27 +0800 Subject: [PATCH 237/290] PRF&PUB @geekpi https://linux.cn/article-13729-1.html --- ...heck free disk space in Linux with ncdu.md | 86 +++++++++---------- 1 file changed, 39 insertions(+), 47 deletions(-) rename {translated/tech => published}/20210819 Check free disk space in Linux with ncdu.md (60%) diff --git a/translated/tech/20210819 Check free disk space in Linux with ncdu.md b/published/20210819 Check free disk space in Linux with ncdu.md similarity index 60% rename from translated/tech/20210819 Check free disk space in Linux with ncdu.md rename to published/20210819 Check free disk space in Linux with ncdu.md index 2367be34a4..4d77814c02 100644 --- a/translated/tech/20210819 Check free disk space in Linux with ncdu.md +++ b/published/20210819 Check free disk space in Linux with ncdu.md @@ -3,62 +3,60 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13729-1.html" 用 ncdu 检查 Linux 中的可用磁盘空间 ====== -用 ncdu Linux 命令获得关于磁盘使用的交互式报告。 -![Check disk usage][1] -计算机用户多年来往往积累了大量的数据,无论是重要的个人项目、数码照片、视频、音乐还是代码库。虽然现在的硬盘往往相当大,但有时你必须退一步,评估一下你在硬盘上实际存储了什么。经典的 Linux 命令 [`df`][2] 和 [`du`][3] 是快速了解硬盘上的内容的方法,它们提供了一个可靠的报告,易于解析和处理。这对脚本和处理来说是很好的,但人的大脑对数百行的原始数据并不总是反应良好。认识到这一点,`ncdu` 命令旨在提供一份关于你在硬盘上使用的空间的交互式报告。 +> 用 ncdu Linux 命令获得关于磁盘使用的交互式报告。 + +![](https://img.linux.net.cn/data/attachment/album/202108/29/095819e87oz4ox6p40t6q0.jpg) + +计算机用户多年来往往积累了大量的数据,无论是重要的个人项目、数码照片、视频、音乐还是代码库。虽然现在的硬盘往往相当大,但有时你必须退一步,评估一下你在硬盘上实际存储了什么。经典的 Linux 命令 [df][2] 和 [du][3] 是快速了解硬盘上的内容的方法,它们提供了一个可靠的报告,易于解析和处理。这对脚本和处理来说是很好的,但人的大脑对数百行的原始数据并不总是反应良好。认识到这一点,`ncdu` 命令旨在提供一份关于你在硬盘上使用的空间的交互式报告。 ### 在 Linux 上安装 ncdu 在 Linux 上,你可以从你的软件仓库安装 `ncdu`。例如,在 Fedora 或 CentOS 上: - ``` -`$ sudo dnf install ncdu` +$ sudo dnf install ncdu ``` 在 BSD 上,你可以使用 [pkgsrc][4]。 在 macOS 上,你可以从 [MacPorts][5] 或 [HomeBrew][6] 安装。 -另外,你也可以[从源码编译 ncdu][7]。 +另外,你也可以 [从源码编译 ncdu][7]。 ### 使用 ncdu -ncdu 界面使用 ncurses 库,它将你的终端窗口变成一个基本的图形应用,所以你可以使用方向键来浏览菜单。 +`ncdu` 界面使用 ncurses 库,它将你的终端窗口变成一个基本的图形应用,所以你可以使用方向键来浏览菜单。 ![ncdu interface][8] -CC BY-SA Seth Kenlon - 这是 `ncdu` 的主要吸引力之一,也是它与最初的 `du` 命令不同的地方。 要获得一个目录的完整列表,启动 `ncdu`。它默认为当前目录。 - ``` $ ncdu -ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help -\--- /home/tux ----------------------------------------------- - 22.1 GiB [##################] /.var - 19.0 GiB [############### ] /Iso - 10.0 GiB [######## ] /.local - 7.9 GiB [###### ] /.cache - 3.8 GiB [### ] /Downloads - 3.6 GiB [## ] /.mail - 2.9 GiB [## ] /Code - 2.8 GiB [## ] /Documents - 2.3 GiB [# ] /Videos +ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help +--- /home/tux ----------------------------------------------- + 22.1 GiB [##################] /.var + 19.0 GiB [############### ] /Iso + 10.0 GiB [######## ] /.local + 7.9 GiB [###### ] /.cache + 3.8 GiB [### ] /Downloads + 3.6 GiB [## ] /.mail + 2.9 GiB [## ] /Code + 2.8 GiB [## ] /Documents + 2.3 GiB [# ] /Videos [...] ``` -这个列表首先显示了最大的目录(在这个例子中,那是 `~/.var` 目录,充满了很多的 flatpaks)。 +这个列表首先显示了最大的目录(在这个例子中,那是 `~/.var` 目录,塞满了很多的 flatpak 包)。 使用键盘上的方向键,你可以浏览列表,深入到一个目录,这样你就可以更好地了解什么东西占用了最大的空间。 @@ -66,63 +64,57 @@ ncdu 1.16 ~ Use the arrow keys to navigate, press ? for help 你可以在启动 `ncdu` 时提供任意一个文件夹的路径: - ``` -`$ ncdu ~/chromiumos` +$ ncdu ~/chromiumos ``` ### 排除目录 默认情况下,`ncdu` 包括一切可以包括的东西,包括符号链接和伪文件系统,如 procfs 和 sysfs。你可以用 `--exclude-kernfs` 来排除这些。 -你可以使用 --exclude 选项排除任意文件和目录,并在后面加上一个匹配模式。 - +你可以使用 `--exclude` 选项排除任意文件和目录,并在后面加上一个匹配模式。 ``` $ ncdu --exclude ".var" - 19.0 GiB [##################] /Iso - 10.0 GiB [######### ] /.local - 7.9 GiB [####### ] /.cache - 3.8 GiB [### ] /Downloads + 19.0 GiB [##################] /Iso + 10.0 GiB [######### ] /.local + 7.9 GiB [####### ] /.cache + 3.8 GiB [### ] /Downloads [...] ``` 另外,你可以在文件中列出要排除的文件和目录,并使用 `--exclude-from` 选项来引用该文件: ``` -$ ncdu --exclude-from myexcludes.txt /home/tux - 10.0 GiB [######### ] /.local - 7.9 GiB [####### ] /.cache - 3.8 GiB [### ] /Downloads +$ ncdu --exclude-from myexcludes.txt /home/tux + 10.0 GiB [######### ] /.local + 7.9 GiB [####### ] /.cache + 3.8 GiB [### ] /Downloads [...] ``` ### 颜色方案 -你可以用 `--color dark` 选项给 ncdu 添加一些颜色。 +你可以用 `--color dark` 选项给 `ncdu` 添加一些颜色。 ![ncdu color scheme][9] -CC BY-SA Seth Kenlon - ### 包括符号链接 `ncdu` 输出按字面意思处理符号链接,这意味着一个指向 9GB 文件的符号链接只占用 40 个字节。 - ``` $ ncdu ~/Iso - 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso -@ 0.0 B [ ] fake.iso + 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso +@ 0.0 B [ ] fake.iso ``` 你可以用 `--follow-symlinks` 选项强制 ncdu 跟踪符号链接: - ``` $ ncdu --follow-symlinks ~/Iso - 9.3 GiB [##################] fake.iso - 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso + 9.3 GiB [##################] fake.iso + 9.3 GiB [##################] CentOS-Stream-8-x86_64-20210427-dvd1.iso ``` ### 磁盘使用率 @@ -136,7 +128,7 @@ via: https://opensource.com/article/21/8/ncdu-check-free-disk-space-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ea7c37d1aaa99a432e1f877592c2efdb62ef6900 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 29 Aug 2021 11:10:02 +0800 Subject: [PATCH 238/290] PRF&PUB @unigeorge https://linux.cn/article-13730-1.html --- ...lude options in your Bash shell scripts.md | 29 ++++++++++--------- 1 file changed, 15 insertions(+), 14 deletions(-) rename {translated/tech => published}/20210824 How to include options in your Bash shell scripts.md (70%) diff --git a/translated/tech/20210824 How to include options in your Bash shell scripts.md b/published/20210824 How to include options in your Bash shell scripts.md similarity index 70% rename from translated/tech/20210824 How to include options in your Bash shell scripts.md rename to published/20210824 How to include options in your Bash shell scripts.md index 6cedd174a9..6aa2c9de83 100644 --- a/translated/tech/20210824 How to include options in your Bash shell scripts.md +++ b/published/20210824 How to include options in your Bash shell scripts.md @@ -3,23 +3,24 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13730-1.html" 如何在 Bash shell 脚本中解析命令行选项 ====== -把选项交给你的 shell 脚本吧。 -![Terminal commands][1] -终端命令通常具有 [选项options or switches][2] 功能,用户可以使用选项来修改命令的执行方式。关于命令行接口的 [POSIX 规范][3] 中就对选项做出了规范,这也是基于最早的 UNIX 应用程序建立的一个由来已久的约定,因此你在创建自己的命令时,最好知道如何将选项包含进 [Bash 脚本][4] 中。 +> 给你的 shell 脚本添加选项。 -与大多数语言一样,有若干种方法可以解决 Bash 中解析选项的问题。但直到今天,我最喜欢的方法仍然是我从 Patrick Volkerding 的 Slackware 构建脚本中学到的方法,当我第一次得知 Linux 并勇于探索操作系统附带的纯文本文件时,它就是我关于 shell 脚本的引路人。 +![](https://img.linux.net.cn/data/attachment/album/202108/29/110849lvhr1bjg1r43sfcx.jpg) + +终端命令通常具有 [选项或开关][2],用户可以使用它们来修改命令的执行方式。关于命令行界面的 [POSIX 规范][3] 中就对选项做出了规范,这也是最早的 UNIX 应用程序建立的一个由来已久的惯例,因此你在创建自己的命令时,最好知道如何将选项包含进 [Bash 脚本][4] 中。 + +与大多数语言一样,有若干种方法可以解决 Bash 中解析选项的问题。但直到今天,我最喜欢的方法仍然是我从 Patrick Volkerding 的 Slackware 构建脚本中学到的方法,当我第一次发现 Linux 并敢于冒险探索操作系统所附带的纯文本文件时,这些脚本就是我的 shell 脚本的引路人。 ### Bash 中的选项解析 -在 Bash 中解析选项的策略是循环遍历传递给 shell 脚本的所有参数,确定它们是否为选项,然后转移到下一个参数。重复这个过程,直到没有选项为止。 - +在 Bash 中解析选项的策略是循环遍历所有传递给 shell 脚本的参数,确定它们是否是一个选项,然后转向下一个参数。重复这个过程,直到没有选项为止。 ``` #!/bin/bash @@ -38,7 +39,7 @@ echo $ALPHA 在这段代码中,我创建了一个 `while` 循环,它会一直进行循环操作,直到处理完所有参数。`if` 语句会试着将在第一个位置(`$1`)中找到的参数与 `--alpha` 或 `-a` 匹配。(此处的待匹配项是任意选项名称,并没有特殊意义。在实际的脚本中,你可以使用 `--verbose` 和 `-v` 来触发详细输出)。 -`shift` 关键字会使所有参数向后移动一位,这样位置 2(`$2`)的参数移动到位置 1(`$1`)。处理完所有参数后会触发 else 语句,进而中断 while 循环。 +`shift` 关键字会使所有参数位移一位,这样位置 2(`$2`)的参数移动到位置 1(`$1`)。处理完所有参数后会触发 `else` 语句,进而中断 `while` 循环。 在脚本的末尾,`$ALPHA` 的值会输出到终端。 @@ -106,7 +107,7 @@ bar 有一些选项需要传入参数。比如,你可能希望允许用户设置诸如颜色或图形分辨率之类的属性,或者将应用程序指向自定义配置文件。 -要在 Bash 中实现这一点,你仍然可以像使用布尔选项一样使用 `shift` 关键字,但参数需要向后移动两位而不是一位。 +要在 Bash 中实现这一点,你仍然可以像使用布尔开关一样使用 `shift` 关键字,但参数需要位移两位而不是一位。 ``` #!/bin/bash @@ -133,7 +134,7 @@ for i in ${ARG[@]}; do done ``` -在这段代码中,我添加了一个 `elif` 子句来将每个参数与 `--config` 和 `-c` 进行比较。如果匹配,名为 `CONFIG` 的变量的值就设置为下一个参数的值(这就表示 `--config` 选项需要一个参数)。所有参数都后移两位:其中一位是跳过 `--config` 或 `-c`,另一位是跳过其参数。与上节一样,循环重复直到没有匹配的参数。 +在这段代码中,我添加了一个 `elif` 子句来将每个参数与 `--config` 和 `-c` 进行比较。如果匹配,名为 `CONFIG` 的变量的值就设置为下一个参数的值(这就表示 `--config` 选项需要一个参数)。所有参数都位移两位:其中一位是跳过 `--config` 或 `-c`,另一位是跳过其参数。与上节一样,循环重复直到没有匹配的参数。 下面是新版脚本的测试: @@ -150,7 +151,7 @@ baz ### Bash 让选项解析变得简单 -还有一些其他方法也可以解析 Bash 中的选项。你可以交替使用 `case` 语句或 `getopt` 命令。无论使用什么方法,用户选项都是应用程序的重要功能,而 Bash 让解析选项成为了一件简单的事。 +还有一些其他方法也可以解析 Bash 中的选项。你可以替换使用 `case` 语句或 `getopt` 命令。无论使用什么方法,给你的用户提供选项都是应用程序的重要功能,而 Bash 让解析选项成为了一件简单的事。 -------------------------------------------------------------------------------- @@ -159,7 +160,7 @@ via: https://opensource.com/article/21/8/option-parsing-bash 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 079dce8ec689574d2ea258c0a0a7c62a5d6bce08 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Sun, 29 Aug 2021 15:30:00 +0800 Subject: [PATCH 239/290] Finish translation File name: 20210727 Analyze the Linux kernel with ftrace.md --- ...27 Analyze the Linux kernel with ftrace.md | 404 ------------------ ...27 Analyze the Linux kernel with ftrace.md | 381 +++++++++++++++++ 2 files changed, 381 insertions(+), 404 deletions(-) delete mode 100644 sources/tech/20210727 Analyze the Linux kernel with ftrace.md create mode 100644 translated/tech/20210727 Analyze the Linux kernel with ftrace.md diff --git a/sources/tech/20210727 Analyze the Linux kernel with ftrace.md b/sources/tech/20210727 Analyze the Linux kernel with ftrace.md deleted file mode 100644 index 9759f821ef..0000000000 --- a/sources/tech/20210727 Analyze the Linux kernel with ftrace.md +++ /dev/null @@ -1,404 +0,0 @@ -[#]: subject: (Analyze the Linux kernel with ftrace) -[#]: via: (https://opensource.com/article/21/7/linux-kernel-ftrace) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Analyze the Linux kernel with ftrace -====== -Ftrace is a great way to learn more about the internal workings of the -Linux kernel. -![Linux keys on the keyboard for a desktop computer][1] - -An operating system's kernel is one of the most elusive pieces of software out there. It's always there running in the background from the time your system gets turned on. Every user achieves their computing work with the help of the kernel, yet they never interact with it directly. The interaction with the kernel occurs by making system calls or having those calls made on behalf of the user by various libraries or applications that they use daily. - -I've covered how to trace system calls in an earlier article using `strace`. However, with `strace`, your visibility is limited. It allows you to view the system calls invoked with specific parameters and, after the work gets done, see the return value or status indicating whether they passed or failed. But you had no idea what happened inside the kernel during this time. Besides just serving system calls, there's a lot of other activity happening inside the kernel that you're oblivious to. - -### Ftrace Introduction - -This article aims to shed some light on tracing the kernel functions by using a mechanism called `ftrace`. It makes kernel tracing easily accessible to any Linux user, and with its help you can learn a lot about Linux kernel internals. - -The default output generated by the `ftrace` is often massive, given that the kernel is always busy. To save space, I've kept the output to a minimum and, in many cases truncated the output entirely. - -I am using Fedora for these examples, but they should work on any of the latest Linux distributions. - -### Enabling ftrace - -`Ftrace` is part of the Linux kernel now, and you no longer need to install anything to use it. It is likely that, if you are using a recent Linux OS, `ftrace` is already enabled. To verify that the `ftrace` facility is available, run the mount command and search for `tracefs`. If you see output similar to what is below, `ftrace` is enabled, and you can easily follow the examples in this article: - - -``` -$ sudo mount | grep tracefs -none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) -``` - -To make use of `ftrace`, you first must navigate to the special directory as specified in the mount command above, from where you'll run the rest of the commands in the article: - - -``` -`$ cd /sys/kernel/tracing` -``` - -### General work flow - -First of all, you must understand the general workflow of capturing a trace and obtaining the output. If you're using `ftrace` directly, there isn't any special `ftrace-`specific commands to run. Instead, you basically write to some files and read from some files using standard command-line Linux utilities. - -The general steps: - - 1. Write to some specific files to enable/disable tracing. - 2. Write to some specific files to set/unset filters to fine-tune tracing. - 3. Read generated trace output from files based on 1 and 2. - 4. Clear earlier output or buffer from files. - 5. Narrow down to your specific use case (kernel functions to trace) and repeat steps 1, 2, 3, 4. - - - -### Types of available tracers - -There are several different kinds of tracers available to you. As mentioned earlier, you need to be in a specific directory before running any of these commands because the files of interest are present there. I use relative paths (as opposed to absolute paths) in my examples. - -You can view the contents of the `available_tracers` file to see all the types of tracers available. You can see a few listed below. Don't worry about all of them just yet: - - -``` -$ pwd -/sys/kernel/tracing - -$ sudo cat available_tracers -hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop -``` - -Out of all the given tracers, I focus on three specific ones: `function` and `function_graph` to enable tracing, and `nop` to disable tracing. - -### Identify current tracer - -Usually, by default, the tracer is set to `nop`. That is, "No operation" in the special file `current_tracer`, which usually means tracing is currently off: - - -``` -$ pwd -/sys/kernel/tracing - -$ sudo cat current_tracer -nop -``` - -### View Tracing output - -Before you enable any tracing, take a look at the file where the tracing output gets stored. You can view the contents of the file named `trace` using the [cat][2] command: - - -``` -$ sudo cat trace -# tracer: nop -# -# entries-in-buffer/entries-written: 0/0   #P:8 -# -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -``` - -### Enable function tracer - -You can enable your first tracer called `function` by writing `function` to the file `current_tracer` (its earlier content was `nop`, indicating that tracing was off.) Think of this operation as a way of enabling tracing: - - -``` -$ pwd -/sys/kernel/tracing - -$ sudo cat current_tracer -nop -$ echo function > current_tracer -$ -$ cat current_tracer -function -``` - -### View updated tracing output for function tracer - -Now that you've enabled tracing, it's time to view the output. If you view the contents of the `trace` file, you see a lot of data being written to it continuously. I've piped the output and am currently viewing only the top 20 lines to keep things manageable. If you follow the headers in the output on the left, you can see which task and Process ID are running on which CPU. Toward the right side of the output, you see the exact kernel function running, followed by its parent function. There is also time stamp information in the center: - - -``` -$ sudo cat trace | head -20 -# tracer: function -# -# entries-in-buffer/entries-written: 409936/4276216   #P:8 -# -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -          <idle>-0       [000] d...  2088.841739: tsc_verify_tsc_adjust <-arch_cpu_idle_enter -          <idle>-0       [000] d...  2088.841739: local_touch_nmi <-do_idle -          <idle>-0       [000] d...  2088.841740: rcu_nocb_flush_deferred_wakeup <-do_idle -          <idle>-0       [000] d...  2088.841740: tick_check_broadcast_expired <-do_idle -          <idle>-0       [000] d...  2088.841740: cpuidle_get_cpu_driver <-do_idle -          <idle>-0       [000] d...  2088.841740: cpuidle_not_available <-do_idle -          <idle>-0       [000] d...  2088.841741: cpuidle_select <-do_idle -          <idle>-0       [000] d...  2088.841741: menu_select <-do_idle -          <idle>-0       [000] d...  2088.841741: cpuidle_governor_latency_req <-menu_select -``` - -Remember that tracing is on, which means the output of tracing continues to get written to the trace file until you turn tracing off. - -### Turn off tracing - -Turning off tracing is simple. All you have to do is replace `function` tracer with `nop` in the `current_tracer` file and tracing gets turned off: - - -``` -$ sudo cat current_tracer -function - -$ sudo echo nop > current_tracer - -$ sudo cat current_tracer -nop -``` - -### Enable function_graph tracer - -Now try the second tracer, called `function_graph`. You can enable this using the same steps as before: write `function_graph` to the `current_tracer` file: - - -``` -$ sudo echo function_graph > current_tracer - -$ sudo cat current_tracer -function_graph -``` - -### Tracing output of function_graph tracer - -Notice that the output format of the `trace` file has changed. Now, you can see the CPU ID and the duration of the kernel function execution. Next, you see curly braces indicating the beginning of a function and what other functions were called from inside it: - - -``` -$ sudo cat trace | head -20 -# tracer: function_graph -# -# CPU  DURATION                  FUNCTION CALLS -# |     |   |                     |   |   |   | - 6)               |              n_tty_write() { - 6)               |                down_read() { - 6)               |                  __cond_resched() { - 6)   0.341 us    |                    rcu_all_qs(); - 6)   1.057 us    |                  } - 6)   1.807 us    |                } - 6)   0.402 us    |                process_echoes(); - 6)               |                add_wait_queue() { - 6)   0.391 us    |                  _raw_spin_lock_irqsave(); - 6)   0.359 us    |                  _raw_spin_unlock_irqrestore(); - 6)   1.757 us    |                } - 6)   0.350 us    |                tty_hung_up_p(); - 6)               |                mutex_lock() { - 6)               |                  __cond_resched() { - 6)   0.404 us    |                    rcu_all_qs(); - 6)   1.067 us    |                  } -``` - -### Enable trace settings to increase the depth of tracing - -You can always tweak the tracer slightly to see more depth of the function calls using the steps below. After which, you can view the contents of the `trace` file and see that the output is slightly more detailed. For readability, the output of this example is omitted: - - -``` -$ sudo cat max_graph_depth -0 -$ sudo echo 1 > max_graph_depth -$ # or -$ sudo echo 2 > max_graph_depth - -$ sudo cat trace -``` - -### Finding functions to trace - -The steps above are sufficient to get started with tracing. However, the amount of output generated is enormous, and you can often get lost while trying to find out items of interest. Often you want the ability to trace specific functions only and ignore the rest. But how do you know which processes to trace if you don't know their exact names? There is a file that can help you with this—`available_filter_functions` provides you with a list of available functions for tracing: - - -``` -$ sudo wc -l available_filter_functions   -63165 available_filter_functions -``` - -### Search for general kernel functions - -Now try searching for a simple kernel function that you are aware of. User-space has `malloc` to allocate memory, while the kernel has its `kmalloc` function, which provides similar functionality. Below are all the `kmalloc` related functions: - - -``` -$ sudo grep kmalloc available_filter_functions -debug_kmalloc -mempool_kmalloc -kmalloc_slab -kmalloc_order -kmalloc_order_trace -kmalloc_fix_flags -kmalloc_large_node -__kmalloc -__kmalloc_track_caller -__kmalloc_node -__kmalloc_node_track_caller -[...] -``` - -### Search for kernel module or driver related functions - -From the output of `available_filter_functions`, you can see some lines ending with text in brackets, such as `[kvm_intel]` in the example below. These functions are related to the kernel module `kvm_intel`, which is currently loaded. You can run the `lsmod` command to verify: - - -``` -$ sudo grep kvm available_filter_functions | tail -__pi_post_block [kvm_intel] -vmx_vcpu_pi_load [kvm_intel] -vmx_vcpu_pi_put [kvm_intel] -pi_pre_block [kvm_intel] -pi_post_block [kvm_intel] -pi_wakeup_handler [kvm_intel] -pi_has_pending_interrupt [kvm_intel] -pi_update_irte [kvm_intel] -vmx_dump_dtsel [kvm_intel] -vmx_dump_sel [kvm_intel] - -$ lsmod  | grep -i kvm -kvm_intel             335872  0 -kvm                   987136  1 kvm_intel -irqbypass              16384  1 kvm -``` - -### Trace specific functions only - -To enable tracing of specific functions or patterns, you can make use of the `set_ftrace_filter` file to specify which functions from the above output you want to trace. -This file also accepts the `*` pattern, which expands to include additional functions with the given pattern. As an example, I am using the `ext4` filesystem on my machine. I can specify `ext4` specific kernel functions to trace using the following commands: - - -``` -$ sudo mount | grep home -/dev/mapper/fedora-home on /home type ext4 (rw,relatime,seclabel) - -$ pwd -/sys/kernel/tracing - -$ sudo cat set_ftrace_filter -#### all functions enabled #### -$ -$ echo ext4_* > set_ftrace_filter -$ -$ cat set_ftrace_filter -ext4_has_free_clusters -ext4_validate_block_bitmap -ext4_get_group_number -ext4_get_group_no_and_offset -ext4_get_group_desc -[...] -``` - -Now, when you see the tracing output, you can only see functions `ext4` related to kernel functions for which you had set a filter earlier. All the other output gets ignored: - - -``` -$ sudo cat trace |head -20 -# tracer: function -# -# entries-in-buffer/entries-written: 3871/3871   #P:8 -# -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -           cupsd-1066    [004] ....  3308.989545: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.989547: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.989552: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.989553: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.990097: ext4_file_open <-do_dentry_open -           cupsd-1066    [004] ....  3308.990111: ext4_file_getattr <-vfs_fstat -           cupsd-1066    [004] ....  3308.990111: ext4_getattr <-ext4_file_getattr -           cupsd-1066    [004] ....  3308.990122: ext4_llseek <-ksys_lseek -           cupsd-1066    [004] ....  3308.990130: ext4_file_read_iter <-new_sync_read -``` - -### Exclude functions from being traced - -You don't always know what you want to trace but, you surely know what you don't want to trace. For that, there is this file aptly named `set_ftrace_notrace`—notice the "no" in there. You can write your desired pattern in this file and enable tracing, upon which everything except the mentioned pattern gets traced. This is often helpful to remove common functionality that clutters our output: - - -``` -$ sudo cat set_ftrace_notrace -#### no functions disabled #### -``` - -### Targetted tracing - -So far, you've been tracing everything that has happened in the kernel. But that won't help us if you wish to trace events related to a specific command. To achieve this, you can turn tracing on and off on-demand and, and in between them, run our command of choice so that you do not get extra output in your trace output. You can enable tracing by writing `1` to `tracing_on`, and `0` to turn it off: - - -``` -$ sudo cat tracing_on -0 - -$ sudo echo 1 > tracing_on -$ sudo cat tracing_on -1 - -$ # Run some specific command that we wish to trace here - -$ sudo echo 0 > tracing_on - -$ cat tracing_on -0 -``` - -### Tracing specific PID - -If you want to trace activity related to a specific process that is already running, you can write that PID to a file named `set_ftrace_pid` and then enable tracing. That way, tracing is limited to this PID only, which is very helpful in some instances: - - -``` -`$ sudo echo $PID > set_ftrace_pid` -``` - -### Conclusion - -`Ftrace` is a great way to learn more about the internal workings of the Linux kernel. With some practice, you can learn to fine-tune `ftrace` and narrow down your searches. To understand `ftrace` in more detail and its advanced usage, see these excellent articles written by the core author of `ftrace` himself—Steven Rostedt. - - * [Debugging the Linux kernel, part 1][3] - * [Debugging the Linux kernel, part 2][4] - * [Debugging the Linux kernel, part 3][5] - - - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/linux-kernel-ftrace - -作者:[Gaurav Kamathe][a] -选题:[lujun9972][b] -译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/gkamathe -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/article/19/2/getting-started-cat-command -[3]: https://lwn.net/Articles/365835/ -[4]: https://lwn.net/Articles/366796/ -[5]: https://lwn.net/Articles/370423/ diff --git a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md b/translated/tech/20210727 Analyze the Linux kernel with ftrace.md new file mode 100644 index 0000000000..2e38eac86c --- /dev/null +++ b/translated/tech/20210727 Analyze the Linux kernel with ftrace.md @@ -0,0 +1,381 @@ +[#]: subject: (Analyze the Linux kernel with ftrace) +[#]: via: (https://opensource.com/article/21/7/linux-kernel-ftrace) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +通过 `ftrace` 来分析 Linux 内核 +====== +通过 `ftrace` 来了解 Linux 内核内部工作方式是一个好方法。 +![Linux keys on the keyboard for a desktop computer][1] + +一个操作系统的内核是最难以理解的软件之一。自从你的系统启动后,它会一直在后台运行。尽管每个用户都不与内核直接交互,但他们在内核的帮助下完成自己的计算任务。与内核的交互发生在调用系统调用或者用户日常使用的各种库或应用间接调用了系统调用。 + +在之前的文章里我介绍了如何使用 `strace` 来追踪系统调用。然而,使用 `strace` 时你的可见性是受限的。它允许你查看特定参数的系统调用。并在工作完成后,看到其返回值或状态,来表明是通过还是失败。但是你无法知道内核在这段时间内发生了什么。除了系统调用外,内核中还有很多其他活动发生时却被忽略了。 + +### `ftrace` 介绍 + +本文的目的是通过使用一个名为 `ftrace` 的机制来追踪内核函数。任何 Linux 用户可以通过使用它来轻松地追踪内核,并且了解更多关于 Linux 内核内部如何工作。 + +`ftrace` 默认产生的输出是巨大的,因为内核总是忙的。为了节省空间,很多情况下我会通过截断来给出最小输出。 + +我使用 Fedora 来演示下面的例子,但是它们应该在其他最新的 Linux 发行版上同样可以运行。 + +### 启用 `ftrace` + +`ftrace` 现在已经是内核中的一部分了,你不再需要事先安装它了。也就是说,如果你在使用最近的 Linux 系统,那么 `ftrace` 是已经启动了的。为了验证 `ftrace` 是否可用,运行 `mount` 命令并查找 `tracefs`。如果你看到类似下面的输出,表示 `ftrace` 已经启用,你可以轻松地尝试本文中下面的例子。下面的命令需要在 root 用户下使用(`sudo` 是不够的) + +``` +$ sudo mount | grep tracefs +none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) +``` + +要想使用 `ftrace`,你首先需要进入上面 `mount` 命令中找到的特定目录中,在那个目录下运行文章中的其他命令。 + +``` +`$ cd /sys/kernel/tracing` +``` + +### 一般的工作流程 + +首先,你需要理解捕捉踪迹和获取输出的一般流程。如果你直接运行 `ftrace`,没有任何特定的 `ftrace-` 命令会被运行。相反的,你基本上是通过标准 Linux 命令来写入或读取一些文件。 + +通用的步骤如下: +1. 通过写入一些特定文件来启用/结束追踪 +2. 通过写入一些特定文件来设置/取消追踪时的过滤规则 +3. 读取基于第 1 和 2 步的追踪输出 +4. 清除输出的文件或缓存 +5. 缩小到特定用例(你要追踪的内核函数),重复1,2,3,4 步 + +First of all, you must understand the general workflow of capturing a trace and obtaining the output. If you're using `ftrace` directly, there isn't any special `ftrace-`specific commands to run. Instead, you basically write to some files and read from some files using standard command-line Linux utilities. + +### 可用的追踪器类型 + +有多种不同的追踪器可供你使用。之前提到,在运行任何命令前,你需要进入一个特定的目录下,因为文件在这些目录下。我在我的例子中使用相对路径(与绝对路径相反) + +你可以查看 `available_tracers` 文件内容来查看所有可用的追踪器类型。你可以可以看下面列出了几个。不需要担心有这么多。 + +``` +$ pwd +/sys/kernel/tracing + +$ sudo cat available_tracers +hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop +``` + +在所有输出的追踪器中,我会聚焦于下面三个特殊的:启用追踪的 `function` 和 `function_graph`,以及停止追踪的 `nop` + +### 确认当前的追踪器 + +通常情况默认的追踪器设定为 `nop`。即在特殊文件中 `current_tracer` 中的 “无操作”,这意味着追踪目前是关闭的。 + +``` +$ pwd +/sys/kernel/tracing + +$ sudo cat current_tracer +nop +``` + +### 查看追踪输出 + +在启用任何追踪功能之前,请你看一下保存追踪输出的文件。你可以用 [cat](2) 命令查看名为 `trace` 的文件的内容。 + +``` +$ sudo cat trace +# tracer: nop +# +# entries-in-buffer/entries-written: 0/0   #P:8 +# +#                                _-----=> irqs-off +#                               / _----=> need-resched +#                              | / _---=> hardirq/softirq +#                              || / _--=> preempt-depth +#                              ||| /     delay +#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION +#              | |         |   ||||      |         | +``` + +### 启用 `function` 追踪器 + +你可以通过向 `current_tracer` 文件写入 `function` 来启用第一个追踪器 `function`(文件原本内容为 `nop`,意味着追踪是关闭的)。把这个操作看成是启用追踪的一种方式。 + +``` +$ pwd +/sys/kernel/tracing + +$ sudo cat current_tracer +nop +$ echo function > current_tracer +$ +$ cat current_tracer +function +``` + +### 查看 `function` 追踪器的更新追踪输出 + +现在你已启动追踪,是时候查看输出了。如果你查看 `trace` 文件内容,你将会看到许多被连续写入的内容。我通过管道只展示了文件内容的前 20 行。根据左边输出的标题,你可以看到在某个 CPU 上运行的任务和进程 ID。根据右边输出的内容,你可以看到具体的内核函数和其副函数。中间显示了时间信息。 + +``` +$ sudo cat trace | head -20 +# tracer: function +# +# entries-in-buffer/entries-written: 409936/4276216   #P:8 +# +#                                _-----=> irqs-off +#                               / _----=> need-resched +#                              | / _---=> hardirq/softirq +#                              || / _--=> preempt-depth +#                              ||| /     delay +#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION +#              | |         |   ||||      |         | +          <idle>-0       [000] d...  2088.841739: tsc_verify_tsc_adjust <-arch_cpu_idle_enter +          <idle>-0       [000] d...  2088.841739: local_touch_nmi <-do_idle +          <idle>-0       [000] d...  2088.841740: rcu_nocb_flush_deferred_wakeup <-do_idle +          <idle>-0       [000] d...  2088.841740: tick_check_broadcast_expired <-do_idle +          <idle>-0       [000] d...  2088.841740: cpuidle_get_cpu_driver <-do_idle +          <idle>-0       [000] d...  2088.841740: cpuidle_not_available <-do_idle +          <idle>-0       [000] d...  2088.841741: cpuidle_select <-do_idle +          <idle>-0       [000] d...  2088.841741: menu_select <-do_idle +          <idle>-0       [000] d...  2088.841741: cpuidle_governor_latency_req <-menu_select +``` + +请记住当追踪打开后,这意味着追踪结果会被一直连续写入直至你关闭追踪。 + +### 关闭追踪 + +关闭追踪是简单的。你只需要在 `current_tracer` 文件中用 `nop` 替换 `function` 追踪器即可: + +``` +$ sudo cat current_tracer +function + +$ sudo echo nop > current_tracer + +$ sudo cat current_tracer +nop +``` + +### 启用 `function_graph` 追踪器 + +现在尝试第二个名为 `function_graph` 的追踪器。你可以使用和上面相同的步骤:在 `current_tracer` 文件中写入 `function_graph`: + +``` +$ sudo echo function_graph > current_tracer + +$ sudo cat current_tracer +function_graph +``` + +### `function_tracer` 追踪器的追踪输出 + +注意到目前 `trace` 文件的输出格式已经发生变化。现在,你可以看到 CPU ID 和内核函数的执行时间。接下来,一个花括号表示一个函数的开始,以及它内部调用了哪些其他函数。 + +``` +$ sudo cat trace | head -20 +# tracer: function_graph +# +# CPU  DURATION                  FUNCTION CALLS +# |     |   |                     |   |   |   | + 6)               |              n_tty_write() { + 6)               |                down_read() { + 6)               |                  __cond_resched() { + 6)   0.341 us    |                    rcu_all_qs(); + 6)   1.057 us    |                  } + 6)   1.807 us    |                } + 6)   0.402 us    |                process_echoes(); + 6)               |                add_wait_queue() { + 6)   0.391 us    |                  _raw_spin_lock_irqsave(); + 6)   0.359 us    |                  _raw_spin_unlock_irqrestore(); + 6)   1.757 us    |                } + 6)   0.350 us    |                tty_hung_up_p(); + 6)               |                mutex_lock() { + 6)               |                  __cond_resched() { + 6)   0.404 us    |                    rcu_all_qs(); + 6)   1.067 us    |                  } +``` + +### 启用追踪的设置来增加追踪的深度 + +你可以使用下面的步骤来调整追踪器以看到更深层次的函数调用。完成之后,你可以查看 `trace` 文件的内容并发现输出变得更加详细了。为了文章的可读性,这个例子的输出被省略了: + +``` +$ sudo cat max_graph_depth +0 +$ sudo echo 1 > max_graph_depth +$ # or +$ sudo echo 2 > max_graph_depth + +$ sudo cat trace +``` + +### 查找要追踪的函数 + +上面的步骤足以让你开始追踪。但是它产生的输出内容是巨大的,当你想试图找到自己感兴趣的内容时,往往会很困难。通常你更希望能够之追踪特定的函数,而忽略其他函数。但如果你不知道它们确切的名称,你怎么知道要追踪哪些进程?有一个文件可以帮助你解决这个问题 —— `available_filter_functions` 文件提供了一个可供追踪的函数列表。 + +``` +$ sudo wc -l available_filter_functions   +63165 available_filter_functions +``` + +### 查找一般的内核函数 + +现在试着搜索一个你所知道的简单内核函数。用户空间有 `malloc` 函数用来分配内存,而内核有 `kmalloc` 函数,它提供类似的功能。下面是所有与 `kmalloc` 相关的函数。 + +``` +$ sudo grep kmalloc available_filter_functions +debug_kmalloc +mempool_kmalloc +kmalloc_slab +kmalloc_order +kmalloc_order_trace +kmalloc_fix_flags +kmalloc_large_node +__kmalloc +__kmalloc_track_caller +__kmalloc_node +__kmalloc_node_track_caller +[...] +``` + +### 查找内核模块或者驱动相关函数 + +在 `available_filter_functions` 文件的输出中,你可以看到一些以括号内文字结尾的行,例如下面的例子中的 `[kvm_intel]`。这些函数与当前加载的内核模块 `kvm_intel` 有关。你可以运行 `lsmod` 命令来验证。 + +``` +$ sudo grep kvm available_filter_functions | tail +__pi_post_block [kvm_intel] +vmx_vcpu_pi_load [kvm_intel] +vmx_vcpu_pi_put [kvm_intel] +pi_pre_block [kvm_intel] +pi_post_block [kvm_intel] +pi_wakeup_handler [kvm_intel] +pi_has_pending_interrupt [kvm_intel] +pi_update_irte [kvm_intel] +vmx_dump_dtsel [kvm_intel] +vmx_dump_sel [kvm_intel] + +$ lsmod  | grep -i kvm +kvm_intel             335872  0 +kvm                   987136  1 kvm_intel +irqbypass              16384  1 kvm +``` + +### 仅追踪特定的函数 + +为了实现对特定函数或模式的追踪,你可以利用 `set_ftrace_filter` 文件来指定你要追踪上述输出中的哪些函数。这个文件也接受 `*` 模式,它可以扩展到包括具有给定模式的其他函数。作为一个例子,我在我的机器上使用ext4文件系统。我可以用下面的命令指定ext4的特定内核函数来追踪。 + +``` +$ sudo mount | grep home +/dev/mapper/fedora-home on /home type ext4 (rw,relatime,seclabel) + +$ pwd +/sys/kernel/tracing + +$ sudo cat set_ftrace_filter +#### all functions enabled #### +$ +$ echo ext4_* > set_ftrace_filter +$ +$ cat set_ftrace_filter +ext4_has_free_clusters +ext4_validate_block_bitmap +ext4_get_group_number +ext4_get_group_no_and_offset +ext4_get_group_desc +[...] +``` + +现在当你可以看到追踪输出时,你只能看到与内核函数有关的 `ext4` 函数,而你之前已经为其设置了一个过滤器。所有其他的输出都被忽略了。 + +``` +$ sudo cat trace |head -20 +# tracer: function +# +# entries-in-buffer/entries-written: 3871/3871   #P:8 +# +#                                _-----=> irqs-off +#                               / _----=> need-resched +#                              | / _---=> hardirq/softirq +#                              || / _--=> preempt-depth +#                              ||| /     delay +#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION +#              | |         |   ||||      |         | +           cupsd-1066    [004] ....  3308.989545: ext4_file_getattr <-vfs_fstat +           cupsd-1066    [004] ....  3308.989547: ext4_getattr <-ext4_file_getattr +           cupsd-1066    [004] ....  3308.989552: ext4_file_getattr <-vfs_fstat +           cupsd-1066    [004] ....  3308.989553: ext4_getattr <-ext4_file_getattr +           cupsd-1066    [004] ....  3308.990097: ext4_file_open <-do_dentry_open +           cupsd-1066    [004] ....  3308.990111: ext4_file_getattr <-vfs_fstat +           cupsd-1066    [004] ....  3308.990111: ext4_getattr <-ext4_file_getattr +           cupsd-1066    [004] ....  3308.990122: ext4_llseek <-ksys_lseek +           cupsd-1066    [004] ....  3308.990130: ext4_file_read_iter <-new_sync_read +``` + +### 排除要被追踪的函数 + +你并不总是知道你想追踪什么,但是,你肯定知道你不想追踪什么。因此,有一个 `set_ftrace_notrace` —— 请注意其中的 "no"。你可以在这个文件中写下你想要的模式,并启用追踪。这样除了所提到的模式外,任何其他东西都会被追踪到。这通常有助于删除那些使我们的输出变得混乱的普通功能。 + +``` +$ sudo cat set_ftrace_notrace +#### no functions disabled #### +``` + +### 具有目标性的追踪 + +到目前为止,你一直在追踪内核中发生的一切。但是,他无法帮助你追踪与某个特定命令有关的事件。为了达到这个目的,你可以按需打开和关闭跟踪,并且在它们之间,运行我们选择的命令,这样你就不会在跟踪输出中得到额外的输出。你可以通过向 `tracing_on` 写入 `1` 来启用跟踪,写 `0` 来关闭跟踪。 + +``` +$ sudo cat tracing_on +0 + +$ sudo echo 1 > tracing_on +$ sudo cat tracing_on +1 + +$ # Run some specific command that we wish to trace here + +$ sudo echo 0 > tracing_on + +$ cat tracing_on +0 +``` + +### 追踪特定的 PID + +如果你想追踪与正在运行的特定进程有关的活动,你可以将该 PID 写入一个名为 `set_ftrace_pid` 的文件,然后启用追踪。这样一来,追踪就只限于这个PID,这在某些情况下是非常有帮助的。 + +``` +`$ sudo echo $PID > set_ftrace_pid` +``` + +### 总结 + +`ftrace` 是一个了解 Linux 内核内部工作的很好方式。通过一些练习,你可以学会对 `ftrace` 进行调整以缩小搜索范围。要想更详细地了解 `ftrace` 和它的高级用法,请看 `ftrace` 的核心作者 Steven Rostedt 写的这些优秀文章。 + + * [调试 Linux 内核,第一部分](3) + * [调试 Linux 内核,第二部分](4) + * [调试 Linux 内核,第三部分](5) + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/linux-kernel-ftrace + +作者:[Gaurav Kamathe][a] +选题:[lujun9972][b] +译者:[萌新阿岩](https://github.com/mengxinayan) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/gkamathe +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/article/19/2/getting-started-cat-command +[3]: https://lwn.net/Articles/365835/ +[4]: https://lwn.net/Articles/366796/ +[5]: https://lwn.net/Articles/370423/ From b479f93a342f04d6932b20c98a7f91a412f239b7 Mon Sep 17 00:00:00 2001 From: Chunibyo Date: Sun, 29 Aug 2021 15:31:46 +0800 Subject: [PATCH 240/290] =?UTF-8?q?=E5=AE=8C=E7=A8=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...loy a deep learning model on Kubernetes.md | 126 +++++++++--------- 1 file changed, 64 insertions(+), 62 deletions(-) diff --git a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md b/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md index 2fb0199735..7ba8b0b184 100644 --- a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md +++ b/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md @@ -7,40 +7,40 @@ [#]: via: (https://opensource.com/article/20/9/deep-learning-model-kubernetes) [#]: author: (Chaimaa Zyani https://opensource.com/users/chaimaa) -Deploy a deep learning model on Kubernetes +在 Kubernetes 上部署一个深度学习模型 ====== -Learn how to deploy, scale, and manage a deep learning model that serves -up image recognition predictions with Kubermatic Kubernetes Platform. +了解如何使用 Kubermatic Kubernetes 平台部署、缩放与管理图像识别深度学习模型。 + ![Brain on a computer screen][1] -As enterprises increase their use of artificial intelligence (AI), machine learning (ML), and deep learning (DL), a critical question arises: How can they scale and industrialize ML development? These conversations often focus on the ML model; however, this is only one step along the way to a complete solution. To achieve in-production application and scale, model development must include a repeatable process that accounts for the critical activities that precede and follow development, including getting the model into a public-facing deployment. +随着企业增加了对人工智能(AI)、机器学习(ML)与深度学习(DL)的使用,出现了一个关键问题:如何将机器学习的发展进行规模化与产业化?这些讨论经常聚焦于机器学习模型本身;然而,模型仅仅只是完整解决方案的其中一环。为了达到生产环境的应用和规模,模型的开发过程必须还包括一个可以说明开发前后关键活动以及可公用部署的可重复过程。 -This article demonstrates how to deploy, scale, and manage a deep learning model that serves up image recognition predictions using [Kubermatic Kubernetes Platform][2]. +本文演示了如何使用[Kubermatic Kubernetes Platform][2]对图像识别预测的深度学习模型进行部署,缩放与管理。 -Kubermatic Kubernetes Platform is a production-grade, open source Kubernetes cluster-management tool that offers flexibility and automation to integrate with ML/DL workflows with full cluster lifecycle management. +Kubermatic Kubernetes 平台是一个可以与机器学习/深度学习工作流结合进行完整集群生命周期管理的一个自动且灵活的开源生产级 Kubernetes 集群管理工具。 -### Get started +### 开始 -This example deploys a deep learning model for image recognition. It uses the [CIFAR-10][3] dataset that consists of 60,000 32x32 color images in 10 classes with the [Gluon][4] library in [Apache MXNet][5] and NVIDIA GPUs to accelerate the workload. If you want to use a pre-trained model on the CIFAR-10 dataset, check out the [getting started guide][6]. +这个例子部署了一个图像识别的深度学习模型。它使用了包含 60,000 张分属 10 个类别的 32x32 彩色图 [CIFAR-10][3] 像数据集,同时使用了 [Apache MXNet][5] 的 [Gluon][4] 与 NVIDIA GPUs 进行加速计算。如果你希望使用 CIFAR-10 数据集的预训练模型,可以查阅 [getting started guide][6]。 -The model was trained over a span of 200 epochs, as long as the validation error kept decreasing slowly without causing the model to overfit. This plot shows the training process: +使用训练集中的样本对模型训练 200 次,只要训练误差保持缓慢减少,就可以保证模型不会过拟合。下方图展示了训练的过程: -![Deep learning model training plot][7] +![深度学习模型训练 loss 图][7] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -After training, it's essential to save the model's parameters so they can be loaded later: +训练结束后,必须保存模型训练所得到的参数,以便稍后可以加载它们: -``` +```python file_name = "net.params" net.save_parameters(file_name) ``` -Once the model is ready, wrap your prediction code in a Flask server. This allows the server to accept an image as an argument to its request and return the model's prediction in the response: +一旦你的模型训练好了,就可以用 Flask 服务器来封装它。下方的程序演示了如何接收 request 中的一张图片作为参数并且在 response 中返回模型的预测结果: -``` +```python from gluoncv.model_zoo import get_model import matplotlib.pyplot as plt from mxnet import gluon, nd, image @@ -76,12 +76,12 @@ if __name__ == '__main__':    app.run(host='0.0.0.0') ``` -### Containerize the model +### 容器化模型 -Before you can deploy your model to Kubernetes, you need to install Docker and create a container image with your model. - - 1. Download, install, and start Docker: [code] +在将模型部署到 Kubernetes 前,你需要先安装 Docker 并使用你的模型创建一个镜像。 + 1. 下载、安装并启动 Docker: +```bash sudo yum install -y yum-utils device-mapper-persistent-data lvm2 sudo yum-config-manager --add-repo @@ -91,14 +91,14 @@ sudo yum install docker-ce sudo systemctl start docker ``` - 2. Create a directory where you can organize your code and dependencies: [code] - + 2. 创建一个你用来管理代码与依赖的文件夹: +```bash mkdir kubermatic-dl cd kubermatic-dl ``` - 3. Create a `requirements.txt` file to contain the packages the code needs to run: [code] - + 3. 创建 `requirements.txt` 文件管理代码运行时需要的所有依赖: +``` flask gluoncv matplotlib @@ -107,75 +107,76 @@ requests Pillow ``` - 4. Create the Dockerfile that Docker will read to build and run the model: [code] - + 4. 创建 Dockerfile,Docker 将根据这个文件创建镜像: +``` FROM python:3.6 WORKDIR /app COPY requirements.txt /app RUN pip install -r ./requirements.txt COPY app.py /app -CMD ["python", "app.py"]~ - -[/code] This Dockerfile can be broken down into three steps. First, it creates the Dockerfile and instructs Docker to download a base image of Python 3. Next, it asks Docker to use the Python package manager `pip` to install the packages in `requirements.txt`. Finally, it tells Docker to run your script via `python app.py`. - - 5. Build the Docker container: [code]`sudo docker build -t kubermatic-dl:latest .`[/code] This instructs Docker to build a container for the code in your current working directory, `kubermatic-dl`. - - 6. Check that your container is working by running it on your local machine: [code]`sudo docker run -d -p 5000:5000 kubermatic-dl` +CMD ["python", "app.py"] ``` - 7. Check the status of your container by running `sudo docker ps -a`: +这个 Dockerfile 主要可以分为三个部分。首先,Docker 会下载 Python 的基础镜像。然后,Docker 会使用 Python 的包管理工具 `pip` 安装 `requirements.txt` 记录的包。最后,Docker 会通过执行 `python app.py` 来运行你的脚本。 -![Checking the container's status][9] + + 1. 构建 Docker 容器: `sudo docker build -t kubermatic-dl:latest .` 这条命令使用 `kubermatic-dl` 镜像为你当前工作目录的代码创建了一个容器。 + + 2. 使用 `sudo docker run -d -p 5000:5000 kubermatic-dl` 命令检查你的容器可以在你的主机上正常运行。 + + 3. 使用 `sudo docker ps -a` 命令查看你本地容器的运行状态: + +![查看容器的运行状态][9] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -### Upload the model to Docker Hub +### 将你的模型上传到 Docker Hub -Before you can deploy the model on Kubernetes, it must be publicly available. Do that by adding it to [Docker Hub][10]. (You will need to create a Docker Hub account if you don't have one.) +在向 Kubernetes 上部署模型前,你的镜像首先需要是公开可用的。你可以通过将你的模型上传到 [Docker Hub][10] 来将它公开。(如果你没有 Docker Hub 的账号,你需要先创建一个) - 1. Log into your Docker Hub account: [code]`sudo docker login` -``` - 2. Tag the image so you can refer to it for versioning when you upload it to Docker Hub: [code] + 1. 在终端中登录 Docker Hub 账号:`sudo docker login` + 2. 给你的镜像打上 tag ,这样你的模型上传到 Docker Hub 后也能拥有版本信息 +```bash sudo docker tag <your-image-id> <your-docker-hub-name>/<your-app-name> sudo docker push <your-docker-hub-name>/<your-app-name> ``` -![Tagging the image][11] +![给镜像打上 tag][11] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 3. Check your image ID by running `sudo docker images`. + 3. 使用 `sudo docker images` 命令检查你的镜像的 ID。 -### Deploy the model to a Kubernetes cluster +### 部署你的模型到 Kubernetes 集群 - 1. Create a project on the Kubermatic Kubernetes Platform, then create a Kubernetes cluster using the [quick start tutorial][12]. + 1. 首先在 Kubermatic Kubernetes 平台创建一个项目, 然后根据 [快速开始][12] 创建一个 Kubernetes 集群。 -![Create a Kubernetes cluster][13] +![创建一个 Kubernetes 集群][13] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 2. Download the `kubeconfig` used to configure access to your cluster, change it into the download directory, and export it into your environment: + 2. 下载用于访问你的集群的 `kubeconfig`,将它放置在下载目录中,并记得设置合适的环境变量,使得你的环境能找到它: -![Kubernetes cluster example][14] +![Kubernetes 集群示例][14] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 3. Using `kubectl`, check the cluster information, such as the services that `kube-system` starts on your cluster: [code]`kubectl cluster-info` -``` -![Checking the cluster info][15] + 3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info` + +![查看集群信息][15] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 4. To run the container in the cluster, you need to create a deployment (`deployment.yaml`) and apply it to the cluster: [code] - + 4. 为了在集群中运行容器,你需要创建一个部署用的配置文件(`deployment.yaml`),再运行 `apply` 命令将其应用于集群中: +```yaml apiVersion: apps/v1 kind: Deployment metadata: @@ -197,38 +198,39 @@ spec:        ports:        - containerPort: 8080 -[/code] [code]`kubectl apply -f deployment.yaml` +``` `kubectl apply -f deployment.yaml` ``` - 5. To expose your deployment to the outside world, you need a service object that will create an externally reachable IP for your container: [code]`kubectl expose deployment kubermatic-dl-deployment  --type=LoadBalancer --port 80 --target-port 5000` -``` -6. You're almost there! Check your services to determine the status of your deployment and get the IP address to call your image recognition API: [code]`kubectl get service` -``` + 5. 为了将你的部署开放到公网环境,你需要一个能够给你的容器创建外部可达 IP 地址的服务:`kubectl expose deployment kubermatic-dl-deployment  --type=LoadBalancer --port 80 --target-port 5000` -![Get the IP address to call your image recognition API][16] + 6. 就快大功告成了!首先检查你布署的服务的状态,然后通过 IP 请求的你图像识别 API:`kubectl get service` + + +![获取请求图像识别 API 的 IP 地址][16] (Chaimaa Zyami, [CC BY-SA 4.0][8]) - 7. Test your API with these two images using the external IP: + 7. 最后根据你的外部 IP 使用以下两张图片对你的图像识别服务进行测试: -![Horse][17] +![马][17] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -![Dog][18] +![狗][18] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -![Testing the API][19] +![测试 API][19] (Chaimaa Zyami, [CC BY-SA 4.0][8]) -### Summary +### 总结 -In this tutorial, you created a deep learning model to be served as a [REST API][20] using Flask. It put the application inside a Docker container, uploaded the container to Docker Hub, and deployed it with Kubernetes. Then, with just a few commands, Kubermatic Kubernetes Platform deployed the app and exposed it to the world. + +在这篇教程中,你可以创建一个深度学习模型,并且使用 Flask 提供 [REST API][20] 服务。它介绍了如何将应用放在 Docker 容器中,如何将这个镜像上传到 Docker Hub 中,以及如何使用 Kubernetes 部署你的服务。只需几个简单的命令,你就可以使用 Kubermatic Kubernetes 平台部署该应用程序,并且开放服务给别人使用。 -------------------------------------------------------------------------------- From a619ed357a74e54758279a5ac63b583208054961 Mon Sep 17 00:00:00 2001 From: Chunibyo Date: Sun, 29 Aug 2021 15:35:51 +0800 Subject: [PATCH 241/290] change position --- .../tech/20200908 Deploy a deep learning model on Kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {sources => translated}/tech/20200908 Deploy a deep learning model on Kubernetes.md (99%) diff --git a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md b/translated/tech/20200908 Deploy a deep learning model on Kubernetes.md similarity index 99% rename from sources/tech/20200908 Deploy a deep learning model on Kubernetes.md rename to translated/tech/20200908 Deploy a deep learning model on Kubernetes.md index 7ba8b0b184..5a83fe466b 100644 --- a/sources/tech/20200908 Deploy a deep learning model on Kubernetes.md +++ b/translated/tech/20200908 Deploy a deep learning model on Kubernetes.md @@ -238,7 +238,7 @@ via: https://opensource.com/article/20/9/deep-learning-model-kubernetes 作者:[Chaimaa Zyani][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/chunibyo-wly) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 310614d81c092e6ea5aade47b76210c9a6f36fce Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=90=8C=E6=96=B0=E9=98=BF=E5=B2=A9?= <31788564+mengxinayan@users.noreply.github.com> Date: Sun, 29 Aug 2021 15:44:24 +0800 Subject: [PATCH 242/290] Apply translation File name: 20210728 Kernel tracing with trace-cmd.md --- sources/tech/20210728 Kernel tracing with trace-cmd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210728 Kernel tracing with trace-cmd.md b/sources/tech/20210728 Kernel tracing with trace-cmd.md index edcd7a9564..cd5b549e40 100644 --- a/sources/tech/20210728 Kernel tracing with trace-cmd.md +++ b/sources/tech/20210728 Kernel tracing with trace-cmd.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/7/linux-kernel-trace-cmd) [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (mengxinayan) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -364,7 +364,7 @@ via: https://opensource.com/article/21/7/linux-kernel-trace-cmd 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[萌新阿岩](https://github.com/mengxinayan) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d41af9615df0898c3c73c29adee0f09717bae77e Mon Sep 17 00:00:00 2001 From: New-World-2019 Date: Sun, 29 Aug 2021 18:25:38 +0800 Subject: [PATCH 243/290] translating --- ...20210820 Check file status on Linux with the stat command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210820 Check file status on Linux with the stat command.md b/sources/tech/20210820 Check file status on Linux with the stat command.md index 09c762666a..552bc004bc 100644 --- a/sources/tech/20210820 Check file status on Linux with the stat command.md +++ b/sources/tech/20210820 Check file status on Linux with the stat command.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-stat-file-status" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "New-World-2019" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 16a720de9935ee95ffed2f8073b7daeaf554a9e6 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Sun, 29 Aug 2021 20:03:17 +0800 Subject: [PATCH 244/290] translated by perfiffer --- ...he Difference- Which One Should You Use.md | 182 ------------------ ...he Difference- Which One Should You Use.md | 182 ++++++++++++++++++ 2 files changed, 182 insertions(+), 182 deletions(-) delete mode 100644 sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md create mode 100644 translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md diff --git a/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md deleted file mode 100644 index fc9247ab41..0000000000 --- a/sources/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md +++ /dev/null @@ -1,182 +0,0 @@ -[#]: subject: "Debian vs Ubuntu: What’s the Difference? Which One Should You Use?" -[#]: via: "https://itsfoss.com/debian-vs-ubuntu/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Debian vs Ubuntu: What’s the Difference? Which One Should You Use? -====== - -You can [use apt-get commands][1] for managing applications in both Debian and Ubuntu. You can install DEB packages in both distributions as well. Many times, you’ll find common package installation instructions for both distributions. - -So, what’s the difference between the two, if they are so similar? - -Debian and Ubuntu belong to the same side of the distribution spectrum. Debian is the original distribution created by Ian Murdock in 1993. Ubuntu was created in 2004 by Mark Shuttleworth and it is based on Debian. - -### Ubuntu is based on Debian: What does it mean? - -While there are hundreds of Linux distributions, only a handful of them are independent ones, created from scratch. [Debian][2], Arch, Red Hat are some of the biggest distributions that do not derive from any other distribution. - -Ubuntu is derived from Debian. It means that Ubuntu uses the same APT packaging system as Debian and shares a huge number of packages and libraries from Debian repositories. It utilizes the Debian infrastructure as base. - -![Ubuntu uses Debian as base][3] - -That’s what most ‘derived’ distributions do. They use the same package management system and share packages as the base distribution. But they also add some packages and changes of their own. And that is how Ubuntu is different from Debian despite being derived from it. - -### Difference between Ubuntu and Debian - -So, Ubuntu is built on Debian architecture and infrastructure and uses .DEB packages same as Debian. - -Does it mean using Ubuntu is the same as using Debian? Not quite so. There are many more factors involved that distinguish one distribution from the other. - -Let me discuss these factors one by one to compare Ubuntu and Debian. Please keep in mind that some comparisons are applicable to desktop editions while some apply to the server editions. - -![][4] - -#### 1\. Release cycle - -Ubuntu has two kinds of releases: LTS and regular. [Ubuntu LTS (long term support) release][5] comes out every two years and they get support for five years. You have the option to upgrade to the next available LTS release. The LTS releases are considered more stable. - -There are also non-LTS releases, every six months. These releases are supported for nine months only, but they have newer software versions and features. You have to upgrade to the next Ubuntu versions when the current on reaches end of life. - -So basically, you have the option to choose between stability and new features based on these releases. - -On the other hand, Debian has three different releases: Stable, Testing and Unstable. Unstable is for actual testing and should be avoided. - -The testing branch is not that unstable. It is used for preparing the next stable branch. Some Debian users prefer the testing branch to get newer features. - -And then comes the stable branch. This is the main Debian release. It may not have the latest software and feature but when it comes to stability, Debian Stable is rock solid. - -There is a new stable release every two years and it is supported for a total of three years. After that, you have to upgrade to the next available stable release. - -#### 2\. Software freshness - -![][6] - -Debian’s focus on stability means that it does not always aim for the latest versions of the software. For example, the latest Debian 11 features GNOME 3.38, not the latest GNOME 3.40. - -The same goes for other software like GIMP, LibreOffice, etc. This is a compromise you have to make with Debian. This is why “Debian stable = Debian stale” joke is popular in the Linux community. - -Ubuntu LTS releases also focus on stability. But they usually have more recent versions of the popular software. - -You should note that for _some software_, installing from developer’s repository is also an option. For example, if you want the latest Docker version, you can add Docker repository in both Debian and Ubuntu. - -Overall, software in Debian Stable often have older versions when compared to Ubuntu. - -#### 3\. Software availability - -Both Debian and Ubuntu has a huge repository of software. However, [Ubuntu also has PPA][7] (Personal Package Archive). With PPA, installing newer software or getting the latest software version becomes a bit more easy. - -![][8] - -You may try using PPA in Debian but it won’t be a smooth experience. You’ll encounter issues most of the time. - -#### 4\. Supported platforms - -Ubuntu is available on 64-bit x86 and ARM platforms. It does not provide 32-bit ISO anymore. - -Debian, on the other hand, supports both 32 bit and 64 bit architecture. Apart from that Debian also supports 64-bit ARM (arm64), ARM EABI (armel), ARMv7 (EABI hard-float ABI, armhf), little-endian MIPS (mipsel), 64-bit little-endian MIPS (mips64el), 64-bit little-endian PowerPC (ppc64el) and IBM System z (s390x). - -No wonder it is called the ‘universal operating system’. - -#### 5\. Installation - -[Installing Ubuntu][9] is a lot easier than installing Debian. I am not kidding. Debian could be confusing even for intermediate Linux user. - -When you download Debian, it provides a minimal ISO by default. This ISO has no non-free (not open source) firmware. You go on to install it and realize that your network adapters and other hardware won’t be recognized. - -There is a separate non-free ISO that contains firmware but it is hidden and if you do not know that, you are in for a bad surprise. - -![Getting non-free firmware is a pain in Debian][10] - -Ubuntu is a lot more forgiving when it comes to including proprietary drivers and firmware in the default ISO. - -Also, the Debian installer looks old whereas Ubuntu installer is modern looking. Ubuntu installer also recognizes other installed operating systems on the disk and gives you the option to install Ubuntu alongside the existing ones (dual boot). I have not noticed it with Debian installer in my testing. - -![Installing Ubuntu is smoother][11] - -#### 6\. Out of the box hardware support - -As mentioned earlier, Debian focuses primarily on [FOSS][12] (free and open source software). This means that the kernel provided by Debian does not include proprietary drivers and firmware. - -It’s not that you cannot make it work but you’ll have to do add/enable additional repositories and install it manually. This could be discouraging, specially for the beginners. - -Ubuntu is not perfect but it is a lot better than Debian for providing drivers and firmware out of the box. This means less hassle and a more complete out-of-the-box experience. - -#### 7\. Desktop environment choices - -Ubuntu uses a customized GNOME desktop environment by default. You may install [other desktop environments][13] on top of it or opt for [various desktop based Ubuntu flavors][14] like Kubuntu (for KDE), Xubuntu (for Xfce) etc. - -Debian also installs GNOME by default. But its installer gives you choice to install desktop environment of your choice during the installation process. - -![][15] - -You may also get [DE specific ISO images from its website][16]. - -#### 8\. Gaming - -Gaming on Linux has improved in general thanks to Steam and its Proton project. Still, gaming depends a lot on hardware. - -And when it comes to hardware compatibility, Ubuntu is better than Debian for supporting proprietary drivers. - -Not that it cannot be done in Debian but it will require some time and effort to achieve that. - -#### 9\. Performance - -There is no clear ‘winner’ in the performance section, whether it is on the server or on the desktop. Both Debian and Ubuntu are popular as desktop as well as server operating systems. - -The performance depends on your system’s hardware and the software component you use. You can tweak and control your system in both operating systems. - -#### 10\. Community and support - -Debian is a true community project. Everything about this project is governed by its community members. - -Ubuntu is backed by [Canonical][17]. However, it is not entirely a corporate project. It does have a community but the final decision on any matter is in Canonical’s hands. - -As far the support goes, both Ubuntu and Debian have dedicated forums where users can seek help and advice. - -Canonical also offers professional support for a fee to its enterprise clients. Debian has no such features. - -### Conclusion - -Both Debian and Ubuntu are solid choices for desktop or server operating systems. The apt package manager and DEB packaging is common to both and thus giving a somewhat similar experience. - -However, Debian still needs a certain level of expertise, specially on the desktop front. If you are new to Linux, sticking with Ubuntu will be a better choice for you. In my opinion, you should gain some experience, get familiar with Linux in general and then try your hands on Debian. - -It’s not that you cannot jump onto the Debian wagon from the start, but it is more likely to be an overwhelming experience for Linux beginners. - -**Your opinion on this Debian vs Ubuntu debate is welcome.** - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/debian-vs-ubuntu/ - -作者:[Abhishek Prakash][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/abhishek/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/apt-get-linux-guide/ -[2]: https://www.debian.org/ -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-ubuntu-upstream.png?resize=800%2C400&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-vs-ubuntu.png?resize=800%2C450&ssl=1 -[5]: https://itsfoss.com/long-term-support-lts/ -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/apt-cache-policy.png?resize=795%2C456&ssl=1 -[7]: https://itsfoss.com/ppa-guide/ -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/ffmpeg_add_ppa.jpg?resize=800%2C222&ssl=1 -[9]: https://itsfoss.com/install-ubuntu/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/choose-something-else-installing-ubuntu.png?resize=800%2C491&ssl=1 -[12]: https://itsfoss.com/what-is-foss/ -[13]: https://itsfoss.com/best-linux-desktop-environments/ -[14]: https://itsfoss.com/which-ubuntu-install/ -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-install-desktop-environment.png?resize=640%2C479&ssl=1 -[16]: https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/ -[17]: https://canonical.com/ diff --git a/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md new file mode 100644 index 0000000000..af1de88002 --- /dev/null +++ b/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md @@ -0,0 +1,182 @@ +[#]: subject: "Debian vs Ubuntu: What’s the Difference? Which One Should You Use?" +[#]: via: "https://itsfoss.com/debian-vs-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Debian 和 Ubuntu:有什么不同?应该选择哪一个? +====== + +在 Debian 和 Ubuntu 系统中,你都可以 [使用 apt-get 命令][1] 来管理应用。你也可以在这两个发型版中安装 DEB 安装包。很多时候,你会在这两个发行版中发现同样的包安装介绍。 + +它们两者是如此的相似,那么,它们两者之间有什么区别呢? + +Debian 和 Ubuntu 属于同一系列的发行版。Debain 是由Ian Murdock 在 1993 年创建的最初的发行版。Ubuntu 是 Mark Shuttleworth 在 2004 年基于 Debian 创建的发行版。 + +### Ubuntu 基于 Debian:这意味着什么? + +Linux 发行版虽然有数百个,但其中只有少数是从零开始的独立发行版。 [Debian][2],Arch,Red Hat 是其中几个不派生于其它发行版的使用最广的发行版。 + +Ubuntu 源自 Debian。这意味着 Ubuntu 使用与 Debian 相同的 `APT` 包管理系统,并共享 Debian 库中的大量包和库。它建立在 Debian 基础架构上。 + +![Ubuntu uses Debian as base][3] + +这就是大多数“衍生”发行版所做的。它们使用相同的包管理器,并将包共享为基本发行版。但他们也做了一些改变,添加了一些自己的包。这就是 Ubuntu 和 Debian 的不同之处,尽管它是从 Debian 衍生而来的。 + +### Ubuntu 和 Debian 的不同之处 + +因此,Ubuntu 构建在 Debian 架构和基础设施上,也与 Debian 一样是用 `.DEB` 格式的软件包。 + +这意味着使用 Ubuntu 和使用 Debian 是一样的吗?并不完全如此。有很多因素可以用来区分两个不同的发行版。 + +让我逐一讨论这些因素来比较 Ubuntu 和 Debian。请记住,有些比较适用于桌面版本,而有些比较适用于服务器版本。 + +![][4] + +#### 1\. 发布周期 + +Ubuntu 有两种发布版本:LTS 和 regular。[Ubuntu LTS (长期支持) 版本][5] 每两年发布一次,并且会提供五年的支持。你可以选择升级到下一个可用的 LTS 版本。LTS 版本更稳定。 + +还有一个非 LTS 版本,每六个月发布一次。这些版本仅仅提供九个月的支持,但是它们会有一些新的软件版本和功能。当当前的版本已经不在维护了,你必须升级到下一个 Ubuntu 版本。 + +所以基本上,你可以根据这些版本在稳定性和新特性之间进行选择。 + +另一方面,Debian 有三个不同的版本:稳定版、测试版和非稳定版 。非稳定版是为了实际测试,应该避免使用。 + +测试版并不是非稳定版。它是用来为下一个稳定版做准备。有一些 Debian 用户更倾向于使用测试版来获取新的特性。 + +然后是稳定版。这是 Debian 的主要版本。Debian 稳定版可能没有最新的软件和功能,但在稳定性方面毋庸置疑。 + +每两年 Debian 会发布一个稳定版,并且会提供三年的支持。此后,你必须升级到下一个可用的稳定版。 + +#### 2\. 软件更新 + +![][6] + +Debian 更关注稳定性,这意味着它并不总是使用最新版本的软件。例如,最新的 Debian 11 用的 GNOME 版本为 3.38,并不是最新版的 GNOME 3.40。 + +对于 GIMP、LibreOffice 等其它软件也是如此。这是你必须对 Debian 做出的妥协。这就是“Debian stable = Debian stale”笑话在 Linux 社区流行的原因。 + +Ubuntu LTS 版本也关注稳定性。但是它们通常拥有较新版本的常见软件。 + +你应该注意,对于某些软件,从开发人员仓库安装也是一种选择。例如,如果你想要安装最新版的 Docker,你可以在 Debian 和 Ubuntu 中添加 Docker 仓库。 + +总体来说,相比较于 Ubuntu ,Debian 稳定版的软件版本会更旧。 + +#### 3\. 软件可用性 + +Debian 和 Ubuntu 都拥有一个巨大的软件仓库。然而,[Ubuntu 同时有PPA][7](Personal Package Archive)。通过 `PPA`,安装更新版本的软件或者获取最新版本的软件都将会变的更容易。 + +![][8] + +你可以在 Debian 中尝试使用 PPA,但是体验并不好。大多数时候你都会遇到问题。 + +#### 4\. 支持的平台 + +Ubuntu 可以在 64 位的 x86 和 ARM 平台上使用。它不再提供 32 位的镜像。 + +另一方面,Debian 支持 32 位和 64 位架构。除此之外,Debian 还支持 64 位 ARM(arm64)、ARM EABI(armel)、ARMv7(EABI hard-float ABI,armhf)、little-endian MIPS(mipsel)、64 位 little-endian MIPS(mips64el)、64 位 little-endian PowerPC(ppc64el) 和 IBM System z(s390x)。 + +所以它也被称为 “通用操作系统”。 + +#### 5\. 安装 + +[安装 Ubuntu][9] 比安装 Debian 容易得多。我并不是在骗你。即使对于中级 Linux 用户,Debian 也可能令人困惑。 + +当你下载 Debian 的时候,它默认提供的是最小化镜像。 此镜像没有非免费(非开源)固件。如果你继续安装它,你就可能会发现你的网络适配器和其它硬件将无法识别。 + +有一个单独的非免费镜像包含固件,但它是隐藏的,如果你不知道,你可能会大吃一惊。 + +![Getting non-free firmware is a pain in Debian][10] + +Ubuntu 在默认提供的镜像中包含专有驱动程序和固件时要宽容的多。 + +此外,Debian 安装程序看起来很旧,而 Ubuntu 安装程序看起来就比较现代化。Ubuntu 安装程序还可以识别磁盘上其它已安装的操作系统,并为你提供将 Ubuntu 与现有操作系统一起安装的选项(双引导)。但我在测试时并没有注意到 Debian 有此选项。 + +![Installing Ubuntu is smoother][11] + +#### 6\. 开箱即用的硬件支持 + +就像之前提到的,Debian 主要关注 [FOSS][12](自由和开源软件)。这意味着 Debian 提供的内核不包括专有驱动程序和固件。 + +这并不是说你无法使其工作,而是你必须添加/启动其它存储库并手动安装。这可能令人沮丧,特别是对于初学者来说。 + +Ubuntu 并不完美,但在提供开箱即用的驱动程序和固件方面,它比 Debian 好得多。这意味着更少的麻烦和更完整的开箱即用体验。 + +#### 7\. 桌面环境选择 + +Ubuntu 默认使用定制的 GNOME 桌面环境。你可以在其上安装其它桌面环境,或者选择各种基于桌面的 Ubuntu 风格,如 Kubuntu(使用 KDE 桌面),Xubuntu(使用 Xfce 桌面)等。 + +Debian 也默认使用的 GNOME 桌面。但是它会让你在安装的过程中选择你要安装的桌面环境。 + +![][15] + +你还可以从其网站获取[DE 特定的 ISO 镜像][16]。 + +#### 8\. 游戏性 + +由于 Stream 及其 Proton 项目,Linux 上的游戏总体上有所改善。尽管如此,游戏在很大程度上取决于硬件。 + +在硬件兼容性上,Ubuntu 比 Debian 更好的支持专有驱动程序。 + +并不是说它在 Debian 中不能完成,而是需要一些时间和精力来实现。 + +#### 9\. 性能 + +性能部分没有明显的“赢家”,无论是在服务器版本还是在桌面版本。 Debian 和 Ubuntu 作为桌面和服务器操作系统都很受欢迎。 + +性能取决于你系统的硬件和你所使用的软件组件。你可以在你的操作系统中调整和控制你的系统。 + +#### 10\. 社区和支持 + +Debian 是社区项目。此项目的一切都由其社区成员管理。 + +Ubuntu 由 [Canonical][17] 提供支持。然而,它并不是一个真正意义上的企业项目。它确实有一个社区,但任何事情的最终决定权都掌握在 Canonical 手中。 + +就支持而言,Ubuntu 和 Debian 都有专门的论坛,用户可以在其中寻求帮助和提出建议。 + +Canonical 还为其企业客户提供收费的专业支持。 Debian 没有这样的功能。 + +### 结论 + +Debian 和 Ubuntu 都是桌面或服务器操作系统的可靠选择。 apt 包管理器和 DEB 包对两者都是通用的,因此提供了一些相似的体验。 + +然而,Debian 仍然需要一定程度的专业知识,特别是在桌面方面。如果你是 Linux 新手,坚持使用 Ubuntu 将是你更好的选择。在我看来,你应该获得一些经验,熟悉 Linux,然后尝试使用 Debian。 + +并不是说你不能从一开始就使用 Debian,但对于 Linux 初学者来说,这并不是一种很好的体验。 + +**欢迎你对这场 Debian 与 Ubuntu 辩论发表意见。** + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/debian-vs-ubuntu/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[perfiffer](https://github.com/perfiffer) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/apt-get-linux-guide/ +[2]: https://www.debian.org/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-ubuntu-upstream.png?resize=800%2C400&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-vs-ubuntu.png?resize=800%2C450&ssl=1 +[5]: https://itsfoss.com/long-term-support-lts/ +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/apt-cache-policy.png?resize=795%2C456&ssl=1 +[7]: https://itsfoss.com/ppa-guide/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2019/03/ffmpeg_add_ppa.jpg?resize=800%2C222&ssl=1 +[9]: https://itsfoss.com/install-ubuntu/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/Debian-firmware.png?resize=800%2C600&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/03/choose-something-else-installing-ubuntu.png?resize=800%2C491&ssl=1 +[12]: https://itsfoss.com/what-is-foss/ +[13]: https://itsfoss.com/best-linux-desktop-environments/ +[14]: https://itsfoss.com/which-ubuntu-install/ +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/debian-install-desktop-environment.png?resize=640%2C479&ssl=1 +[16]: https://cdimage.debian.org/debian-cd/current-live/amd64/iso-hybrid/ +[17]: https://canonical.com/ From 57a9451d801cadd31e61335c8ce60b23d1297df3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 30 Aug 2021 05:03:13 +0800 Subject: [PATCH 245/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830=20?= =?UTF-8?q?Linux=20Jargon=20Buster:=20What=20is=20sudo=20rm=20-rf=3F=20Why?= =?UTF-8?q?=20is=20it=20Dangerous=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md --- ...hat is sudo rm -rf- Why is it Dangerous.md | 143 ++++++++++++++++++ 1 file changed, 143 insertions(+) create mode 100644 sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md diff --git a/sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md b/sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md new file mode 100644 index 0000000000..c12d1e5314 --- /dev/null +++ b/sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md @@ -0,0 +1,143 @@ +[#]: subject: "Linux Jargon Buster: What is sudo rm -rf? Why is it Dangerous?" +[#]: via: "https://itsfoss.com/sudo-rm-rf/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Jargon Buster: What is sudo rm -rf? Why is it Dangerous? +====== + +When you are new to Linux, you’ll often come across advice to never run `sudo rm -rf /`. There are so many memes in the Linux world around `sudo rm -rf`. + +![][1] + +But it seems that there are some confusions around it. In the tutorial on [cleaning Ubuntu to make free space][2], I advised running some command that involved sudo and rm -rf. An It’s FOSS reader asked me why I am advising that if sudo rm -rf is a dangerous Linux command that should not be run. + +And thus I thought of writing this chapter of Linux jargon buster and clear the misconceptions. + +### sudo rm -rf: what does it do? + +Let’s learn things in steps. + +The rm command is used for [removing files and directories in Linux command line][3]. + +``` +[email protected]:$ rm agatha +[email protected]:$ +``` + +But some files will not be removed immediate because of read only [file permissions][4]. They have to be forced delete with the option `-f`. + +``` +[email protected]:$ rm books +rm: remove write-protected regular file 'books'? y +[email protected]:$ rm -f christie +[email protected]:$ +``` + +However, rm command cannot be used to delete directories (folders) directly. You have to use the recursive option `-r` with the rm command. + +``` +[email protected]:$ rm new_dir +rm: cannot remove 'new_dir': Is a directory +``` + +And thus ultimately, rm -rf command means recursively force delete the given directory. + +``` +[email protected]:~$ rm -r new_dir +rm: remove write-protected regular file 'new_dir/books'? ^C +[email protected]:$ rm -rf new_dir +[email protected]:$ +``` + +Here’s a screenshot of all the above commands: + +![Example explaining rm command][5] + +If you add sudo to the rm -rf command, you are deleting files with root power. That means you could delete system files owned by [root user][6]. + +### So, sudo rm -rf is a dangerous Linux command? + +Well, any command that deletes something could be dangerous if you are not sure of what you are deleting. + +Consider **rm -rf command** as a knife. Is knife a dangerous thing? Possibly. If you cut vegetables with the knife, it’s good. If you cut your fingers with the knife, it is bad, of course. + +The same goes for rm -rf command. It is not dangerous in itself. It is used for deleting files after all. But if you use it to delete important files unknowingly, then it is a problem. + +Now coming to ‘sudo rm -rf /’. + +You know that with sudo, you run a command as root, which allows you to make any changes to the system. + +/ is the symbol for the root directory. /var means the var directory under root. /var/log/apt means apt directory under log, under root. + +![Linux directory hierarchy representation][7] + +As per [Linux directory hierarchy][8], everything in a Linux file system starts at root. If you delete root, you are basically removing all the files of your system. + +And this is why it is advised to not run `sudo rm -rf /` command because you’ll wipe out your entire Linux system. + +Please note that in some cases, you could be running a command like ‘sudo rm -rf /var/log/apt’ which could be fine. Again, you have to pay attention on what you are deleting, the same as you have to pay attention on what you are cutting with a knife. + +### I play with danger: what if I run sudo rm -rf / to see what happens? + +Most Linux distributions provide a failsafe protection against accidentally deleting the root directory. + +``` +[email protected]:~$ sudo rm -rf / +[sudo] password for abhishek: +rm: it is dangerous to operate recursively on '/' +rm: use --no-preserve-root to override this failsafe +``` + +I mean it is human to make typos and if you accidentally typed “/ var/log/apt” instead of “/var/log/apt” (a space between / and var meaning that you are providing / and var directories to for deletion), you’ll be deleting the root directory. + +![Pay attention when using sudo rm -rf][9] + +That’s quite good. Your Linux system takes care of such accidents. + +Now, what if you are hell-bent on destroying your system with sudo rm -rf /? You’ll have to use It will ask you to use –no-preserve-root with it. + +No, please do not do that on your own. Let me show it to you. + +So, I have elementary OS running in a virtual machine. I run `sudo rm -rf / --no-preserve-root` and you can see the lights going out literally in the video below (around 1 minute). + +[Subscribe to our YouTube channel for more Linux videos][10] + +### Clear or still confused? + +Linux has an active community where most people try to help new users. Most people because there are some evil trolls lurking to mess with the new users. They will often suggest running rm -rf / for the simplest of the problems faced by beginners. These idiots get some sort of supremacist satisfaction I think for such evil acts. I ban them immediately from the forums and groups I administer. + +I hope this article made things clearer for you. It’s possible that you still have some confusion, specially because it involves root, file permissions and other things new users might not be familiar with. If that’s the case, please let me know your doubts in the comment section and I’ll try to clear them. + +In the end, remember. Don’t drink and root. Stay safe while running your Linux system :) + +![][11] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sudo-rm-rf/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2016/04/sudo-rm-rf.gif?resize=400%2C225&ssl=1 +[2]: https://itsfoss.com/free-up-space-ubuntu-linux/ +[3]: https://linuxhandbook.com/remove-files-directories/ +[4]: https://linuxhandbook.com/linux-file-permissions/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/rm-rf-command-example-800x487.png?resize=800%2C487&ssl=1 +[6]: https://itsfoss.com/root-user-ubuntu/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/linux-directory-structure.png?resize=800%2C400&ssl=1 +[8]: https://linuxhandbook.com/linux-directory-structure/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/sudo-rm-rf-example.png?resize=798%2C346&ssl=1 +[10]: https://www.youtube.com/c/itsfoss?sub_confirmation=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/dont-drink-and-root.jpg?resize=800%2C450&ssl=1 From e4d94f6c6ac48508f9f280299a33d19c4af2492a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 30 Aug 2021 05:03:34 +0800 Subject: [PATCH 246/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210829=20?= =?UTF-8?q?Position=20text=20on=20your=20screen=20in=20Linux=20with=20ncur?= =?UTF-8?q?ses?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210829 Position text on your screen in Linux with ncurses.md --- ...xt on your screen in Linux with ncurses.md | 138 ++++++++++++++++++ 1 file changed, 138 insertions(+) create mode 100644 sources/tech/20210829 Position text on your screen in Linux with ncurses.md diff --git a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md new file mode 100644 index 0000000000..997ce16c43 --- /dev/null +++ b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md @@ -0,0 +1,138 @@ +[#]: subject: "Position text on your screen in Linux with ncurses" +[#]: via: "https://opensource.com/article/21/8/ncurses-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Position text on your screen in Linux with ncurses +====== +Use ncurses in Linux to place text at specific locations on the screen +and enable more user-friendly interfaces. +![Person using a laptop][1] + +Most Linux utilities just scroll text from the bottom of the screen. But what if you wanted to position text on the screen, such as for a game or a data display? That's where **ncurses** comes in. + +**curses** is an old Unix library that supports cursor control on a text terminal screen. The name _curses_ comes from the term _cursor control_. Years later, others wrote an improved version of **curses** to add new features, called _new curses_ or **ncurses**. You can find **ncurses** in every modern Linux distribution, although the development libraries, header files, and documentation may not be installed by default. For example, on Fedora, you will need to install the **ncurses-devel** package with this command: + + +``` +`$ sudo dnf install ncurses-devel` +``` + +### Using ncurses in a program + +To directly address the screen, you'll first need to initialize the **ncurses** library. Most programs will do that with these three lines: + + * initscr(); Initialize the screen and the **ncurses** code + * cbreak(); Disable buffering and make typed input immediately available + * noecho(); Turn off echo, so user input is not displayed to the screen + + + +These functions are defined in the **curses.h** header file, which you'll need to include in your program with: + + +``` +`#include ` +``` + +After initializing the terminal, you're free to use any of the **ncurses** functions, some of which we'll explore in a sample program. + +When you're done with **ncurses** and want to go back to regular terminal mode, use **endwin();** to reset everything. This command resets any screen colors, moves the cursor to the lower-left of the screen, and makes the cursor visible. You usually do this right before exiting the program. + +### Addressing the screen + +The first thing to know about **ncurses** is that screen coordinates are _row,col_, and start in the upper-left at 0,0. **ncurses** defines two global variables to help you identify the screen size: LINES is the number of lines on the screen, and COLS is the number of columns. The bottom-right position is LINES-1,COLS-1. + +For example, if you wanted to move the cursor to line 10 and column 30, you could use the move function with those coordinates: + + +``` +`move(10, 30);` +``` + +Any text you display after that will start at that screen location. To display a single character, use the **addch(c)** function with a single character. To display a string, use **addstr(s)** with your string. For formatted output that's similar to **printf**, use **printw(fmt, …)** with the usual options. + +Moving to a screen location and displaying text is such a common thing that **ncurses** provides a shortcut to do both at once. The **mvaddch(row, col, c)** function will display a character at screen location _row,col_. And the **mvaddstr(row, col, s)** function will display a string at that location. For a more direct example, using **mvaddstr(10, 30, "Welcome to ncurses");** in a program will display the text "Welcome to ncurses" starting at row 10 and column 30. And the line **mvaddch(0, 0, '+');** will display a single plus sign in the upper-left corner at row 0 and column 0. + +Drawing text to the terminal screen can have a performance impact on certain systems, especially on older hardware terminals. So **ncurses** lets you "stack up" a bunch of text to display to the screen, then use the **refresh()** function to make all of those changes visible to the user. + +Let's look at a simple example that pulls everything together: + + +``` +#include <curses.h> + +int +main() +{ +  initscr(); +  cbreak(); +  noecho(); + +  mvaddch(0, 0, '+'); +  mvaddch(LINES - 1, 0, '-'); +  mvaddstr(10, 30, "press any key to quit"); +  refresh(); + +  getch(); + +  endwin(); +} +``` + +The program starts by initializing the terminal, then prints a plus sign in the upper-left corner, a minus in the lower-left corner, and the text "press any key to quit" at row 10 and column 30. The program gets a single character from the keyboard using the getch() function, then uses **endwin()** to reset the terminal before the program exits completely. + +**getch()** is a useful function that you could use for many things. I often use it as a way to pause before I quit the program. And as with most **ncurses** functions, there's also a version of **getch()** called **mvgetch(row, col)** to move to screen position _row,col_ before waiting for a character. + +### Compiling with ncurses + +If you tried to compile that sample program in the usual way, such as `gcc pause.c`, you'll probably get a huge list of errors from the linker. That's because the **ncurses** library is not linked automatically by the GNU C Compiler. Instead, you'll need to load it for linking using the `-l ncurses` command-line option. + + +``` +`$ gcc -o pause pause.c -lncurses` +``` + +Running the new program will print a simple "press any key to quit" message that's more or less centered on the screen: + +![centered message in a program window][2] + +Figure 1: A centered "press any key to quit" message in a program. + +### Building better programs with ncurses + +Explore the **ncurses** library functions to learn about other ways to display text to the screen. You can find a list of all **ncurses** functions in the man ncurses manual page. This gives a general overview of **ncurses** and provides a table-like list of the different **ncurses** functions, with a reference to the manual page that has full details. For example, **printw** is described in the _curs_printw(3X)_ manual page, which you can view with: + + +``` +`$ man 3x curs_printw` +``` + +or just: + + +``` +`$ man curs_printw` +``` + +With **ncurses**, you can create more interesting programs. By printing text at specific locations on the screen, you can create games and advanced utilities to run in the terminal. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/ncurses-linux + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/sites/default/files/press-key_0.png From a5425e93b273d24c3c000294e47fc717c7ab040c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Aug 2021 08:27:17 +0800 Subject: [PATCH 247/290] PRF&PUB @geekpi https://linux.cn/article-13733-1.html --- ... Real Time in Linux -Desktop and Server.md | 121 ++++++++++++++++ ... Real Time in Linux -Desktop and Server.md | 131 ------------------ 2 files changed, 121 insertions(+), 131 deletions(-) create mode 100644 published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md delete mode 100644 translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md diff --git a/published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md new file mode 100644 index 0000000000..3fd2befe24 --- /dev/null +++ b/published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md @@ -0,0 +1,121 @@ +[#]: subject: "How to Monitor Log Files in Real Time in Linux [Desktop and Server]" +[#]: via: "https://www.debugpoint.com/2021/08/monitor-log-files-real-time/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13733-1.html" + +如何在 Linux 中实时监控日志文件 +====== + +> 本教程解释了如何实时监控 Linux 日志文件(桌面、服务器或应用),以进行诊断和故障排除。 + +![](https://img.linux.net.cn/data/attachment/album/202108/30/082607bmf6nlud6sdy49rm.jpg) + +当你在你的 Linux 桌面、服务器或任何应用中遇到问题时,你会首先查看各自的日志文件。日志文件通常是来自应用的文本和信息流,上面有一个时间戳。它可以帮助你缩小具体的实例,并帮助你找到任何问题的原因。它也可以帮助从网络上获得援助。 + +一般来说,所有的日志文件都位于 `/var/log` 中。这个目录包含以 `.log` 为扩展名的特定应用、服务的日志文件,它还包含单独的其他目录,这些目录包含其日志文件。 + +![log files in var-log][1] + +所以说,如果你想监控一堆日志文件或特定的日志文件。这里有一些你可以做到方法。 + +### 实时监控 Linux 日志文件 + +#### 使用 tail 命令 + +使用 `tail` 命令是实时跟踪日志文件的最基本方法。特别是,如果你所在的服务器只有一个终端,没有 GUI。这是很有帮助的。 + +比如: + +``` +tail /path/to/log/file +``` + +![Monitoring multiple log files via tail][2] + +使用开关 `-f` 来跟踪日志文件,它是实时更新的。例如,如果你想跟踪 `syslog`,你可以使用以下命令: + +``` +tail -f /var/log/syslog +``` + +你可以用一个命令监控多个日志文件,使用: + +``` +tail -f /var/log/syslog /var/log/dmesg +``` + +如果你想监控 http 或 sftp 或任何服务器,你也可以在这个命令中监控它们各自的日志文件。 + +记住,上述命令需要管理员权限。 + +#### 使用 lnav(日志文件浏览器) + +![lnav Running][3] + +`lnav` 是一个很好的工具,你可以用它来通过彩色编码的信息以更有条理的方式监控日志文件。在 Linux 系统中,它不是默认安装的。你可以用下面的命令来安装它: + +``` +sudo apt install lnav ### Ubuntu +sudo dnf install lnav ### Fedora +``` + +好的是,如果你不想安装它,你可以直接下载其预编译的可执行文件,然后在任何地方运行。甚至从 U 盘上也可以。它不需要设置,而且有很多功能。使用 `lnav`,你可以通过 SQL 查询日志文件,以及其他很酷的功能,你可以在它的 [官方网站][4] 上了解。 + +一旦安装,你可以简单地用管理员权限从终端运行 `lnav`,它将默认显示 `/var/log` 中的所有日志并开始实时监控。 + +#### 关于 systemd 的 journalctl 说明 + +今天所有的现代 Linux 发行版大多使用 systemd。systemd 提供了运行 Linux 操作系统的基本框架和组件。systemd 通过 `journalctl` 提供日志服务,帮助管理所有 systemd 服务的日志。你还可以通过以下命令实时监控各个 systemd 服务和日志。 + +``` +journalctl -f +``` + +下面是一些具体的 `journalctl` 命令,可以在一些情况下使用。你可以将这些命令与上面的 `-f` 开关结合起来,开始实时监控。 + + * 对紧急系统信息,使用: + ``` + journalctl -p 0 + ``` + * 显示带有解释的错误: + ``` + journalctl -xb -p 3 + ``` + * 使用时间控制来过滤输出: + ``` + journalctl --since "2020-12-04 06:00:00" + journalctl --since "2020-12-03" --until "2020-12-05 03:00:00" + journalctl --since yesterday + journalctl --since 09:00 --until "1 hour ago" + ``` + +如果你想了解更多关于 `journalctl` 的细节,我已经写了一个 [指南][6]。 + +### 结束语 + +我希望这些命令和技巧能帮助你找出桌面或服务器问题/错误的根本原因。对于更多的细节,你可以随时参考手册,摆弄各种开关。如果你对这篇文章有什么意见或看法,请在下面的评论栏告诉我。 + +加油。 + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/monitor-log-files-real-time/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[wxy](https://github.com/wxy) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/log-files-in-var-log-1024x312.jpeg +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Monitoring-multiple-log-files-via-tail-1024x444.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/lnav-Running-1024x447.jpeg +[4]: https://lnav.org/features +[6]: https://www.debugpoint.com/2020/12/systemd-journalctl/ diff --git a/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md deleted file mode 100644 index 36b528c326..0000000000 --- a/translated/tech/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: subject: "How to Monitor Log Files in Real Time in Linux [Desktop and Server]" -[#]: via: "https://www.debugpoint.com/2021/08/monitor-log-files-real-time/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -如何在 Linux 中实时监控日志文件(桌面和服务器) -====== -本教程解释了如何实时监控 Linux 日志文件(桌面、服务器或应用),以进行诊断和故障排除。 - -当你在你的 Linux 桌面、服务器或任何应用中遇到问题时,你会首先查看各自的日志文件。日志文件通常是来自应用的文本和信息流,上面有一个时间戳。它可以帮助你缩小具体的实例,并帮助你找到任何问题的原因。它也可以帮助从网络上获得援助。 - -一般来说,所有的日志文件都位于 /var/log 中。这个目录包含以 .log 为扩展名的特定应用、服务的日志文件,它还包含单独的其他目录,这些目录包含其日志文件。 - -![log files in var-log][1] - -所以说,如果你想监控一堆日志文件或特定的日志文件。这里有一些你可以做到方法。 - -### 实时监控 Linux 日志文件 - -#### 使用 tail 命令 - -使用 tail 命令是实时跟踪日志文件的最基本方法。特别是,如果你所在的服务器只有一个终端,没有 GUI。这是很有帮助的。 - -比如: - -``` -tail /path/to/log/file -``` - -![Monitoring multiple log files via tail][2] - -使用开关 -f 来跟踪日志文件,它是实时更新的。例如,如果你想跟踪 syslog,你可以使用以下命令。 - -``` -tail -f /var/log/syslog -``` - -你可以用一个命令监控多个日志文件,使用: - -``` -tail -f /var/log/syslog /var/log/dmesg -``` - -如果你想监控 http 或 sftp 或任何服务器,你也可以在这个命令中监控它们各自的日志文件。 - -记住,上述命令需要管理员权限。 - -#### 使用 lnav(日志文件浏览器) - -![lnav Running][3] - -lnav 是一个很好的工具,你可以用它来用彩色编码的信息以更有条理的方式监控日志文件。在 Linux 系统中,它不是默认安装的。你可以用下面的命令来安装它: - -``` -sudo apt install lnav (Ubuntu) -sudo dnf install lnav (Fedora) -``` - -lnav 的好处是,如果你不想安装它,你可以直接下载其预编译的可执行文件,然后在任何地方运行。甚至从 U 盘上也可以。它不需要设置,而且有很多功能。使用 lnav,你可以通过 SQL 查询日志文件,以及其他很酷的功能,你可以在它的[官方网站][4]上了解。 - -Once installed, you can simply run lnav from terminal with admin privilege, and it will show all the logs from /var/log by default and start monitoring in real time. - -#### 关于 systemd 的 journalctl 说明 - -今天所有的现代 Linux 发行版大多使用 systemd。systemd 提供了运行 Linux 操作系统的基本框架和组件。systemd 通过 journalctl 提供日志服务,帮助管理所有 systemd 服务的日志。你还可以通过以下命令实时监控各个 systemd 服务和日志。 - -``` -journalctl -f -``` - -下面是一些特定的 journalctl 命令,可以在一些情况下使用。你可以将这些命令与上面的 -f 开关结合起来,开始实时监控。 - - * 对紧急系统信息,使用 - - - -``` -journalctl -p 0 -``` - - * 显示带有解释的错误 - - - -``` -journalctl -xb -p 3 -``` - - * 使用时间控制来过滤输出 - - - -``` -journalctl --since "2020-12-04 06:00:00" -journalctl --since "2020-12-03" --until "2020-12-05 03:00:00" -journalctl --since yesterday -journalctl --since 09:00 --until "1 hour ago" -``` - -如果你想了解更多关于 journalctl 的细节,我已经写了一个[指南][6]。 - -### 结束语 - -我希望这些命令和技巧能帮助你找出桌面或服务器问题/错误的根本原因。对于更多的细节,你可以随时参考手册,玩弄各种开关。如果你对这篇文章有什么意见或看法,请在下面的评论栏告诉我。 - -干杯。 - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/monitor-log-files-real-time/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/log-files-in-var-log-1024x312.jpeg -[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Monitoring-multiple-log-files-via-tail-1024x444.jpeg -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/lnav-Running-1024x447.jpeg -[4]: https://lnav.org/features -[6]: https://www.debugpoint.com/2020/12/systemd-journalctl/ From 14f0ae784adf7ce5775a921cbcccb0d5954ab891 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 30 Aug 2021 08:33:38 +0800 Subject: [PATCH 248/290] translated --- ...r Useful Application Launcher for Linux.md | 126 ------------------ ...r Useful Application Launcher for Linux.md | 126 ++++++++++++++++++ 2 files changed, 126 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md create mode 100644 translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md diff --git a/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md deleted file mode 100644 index 11df55dcf1..0000000000 --- a/sources/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: subject: "Ulauncher: A Super Useful Application Launcher for Linux" -[#]: via: "https://itsfoss.com/ulauncher/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ulauncher: A Super Useful Application Launcher for Linux -====== - -_**Brief:**_ _Ulauncher is a fast application launcher with extension and shortcut support to help you quickly access application and files in Linux._ - -An application launcher lets you quickly access or open an app without hovering over the application menu icons. - -By default, I found the application launcher with Pop!_OS super handy. But, not every Linux distribution offers an application launcher out-of-the-box. - -Fortunately, there is a solution with which you can add the application launcher to most of the popular distros out there. - -### Ulauncher: Open Source Application Launcher - -![][1] - -Ulauncher is a quick application launcher built using Python while utilizing GTK+. - -It gives a decent amount of customization and control options to tweak. Overall, you can adjust its behavior and experience to suit your taste. - -Let me highlight some of the features that you can expect with it. - -### Ulauncher Features - -The options that you get with Ulauncher are super accessible and easy to customize. Some key highlights include: - - * Fuzzy search algorithm, which lets you find applications even if you misspell them - * Remembers your last searched application in the same session - * Frequently used apps display (optional) - * Custom color themes - * Preset color themes that include a dark theme - * Shortcut to summon the launcher can be easily customized - * Browse files and directories - * Support for extensions to get extra functionality (emoji, weather, speed test, notes, password manager, etc.) - * Shortcuts for browsing sites like Google, Wikipedia, and Stack Overflow - - - -It provides almost every helpful ability that you may expect in an application launcher, and even better. - -### How to Use Ulauncher in Linux? - -By default, you need to press **Ctrl + Space** to get the application launcher after you open it from the application menu for the first time. - -Start typing in to search for an application. And, if you are looking for a file or directory, start typing with “**~**” or “**/**” (ignoring the quotes). - -![][2] - -There are default shortcuts like “**g XYZ**” where XYZ is the search term you want to search for in Google. - -![][3] - -Similarly, you can search for something directly taking you to Wikipedia or Stack Overflow, with “**wiki**” and “**so**” shortcuts, respectively. - -Without any extensions, you can also calculate things on the go and copy the results directly to the keyboard. - -![][4] - -This should come in handy for quick calculations without needing to launch the calculator app separately. - -You can head to its [extensions page][5] and browse for useful extensions along with screenshots that should instruct you how to use it. - -To change how it works, enable frequent applications display, and adjust the theme — click on the gear icon on the right side of the launcher. - -![][6] - -You can set it to auto-start. But, if it does not work on your Systemd enabled distro, you can refer to its GitHub page to add it to the service manager. - -The options are self-explanatory and are easy to customize, as shown in the screenshot below. - -![][7] - -### Installing Ulauncher in Linux - -Ulauncher provides a **.deb** package for Debian or Ubuntu-based distributions. You can explore [how to install Deb][8] [f][8][iles][8] if you’re new to Linux. - -In either case, you can also add its PPA and install it via terminal by following the commands below: - -``` -sudo add-apt-repository ppa:agornostal/ulauncher -sudo apt update -sudo apt install ulauncher -``` - -You can also find it available in the [AUR][9] for Arch and Fedora’s default repositories. - -For more information, you can head to its official website or the [GitHub page][10]. - -[Ulauncher][11] - -Ulauncher should be an impressive addition to any Linux distro. Especially, if you want the functionality of a quick launcher like Pop!_OS offers, this is a fantastic option to consider. - -_Have you tried Ulauncher yet? You are welcome to share your thoughts on how this might help you get things done quickly._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/ulauncher/ - -作者:[Ankush Das][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher.png?resize=800%2C512&ssl=1 -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-directory.png?resize=800%2C503&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-google.png?resize=800%2C449&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-calculator.png?resize=800%2C429&ssl=1 -[5]: https://ext.ulauncher.io -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-gear-icon.png?resize=800%2C338&ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-settings.png?resize=800%2C492&ssl=1 -[8]: https://itsfoss.com/install-deb-files-ubuntu/ -[9]: https://itsfoss.com/aur-arch-linux/ -[10]: https://github.com/Ulauncher/Ulauncher/ -[11]: https://ulauncher.io diff --git a/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md new file mode 100644 index 0000000000..056a490813 --- /dev/null +++ b/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md @@ -0,0 +1,126 @@ +[#]: subject: "Ulauncher: A Super Useful Application Launcher for Linux" +[#]: via: "https://itsfoss.com/ulauncher/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ulauncher:一个超级实用的 Linux 应用启动器 +====== + +_**简介:**_ _Ulauncher 是一个快速的应用启动器,支持扩展和快捷方式,帮助你在 Linux 中快速访问应用和文件。_ + +一个应用启动器可以让你快速访问或打开一个应用,而无需在应用菜单图标上徘徊。 + +在默认情况下,我发现 Pop!_OS 的应用启动器超级方便。但是,并不是每个 Linux 发行版都提供开箱即用的应用启动器。 + +幸运的是,有一个你可以在大多数流行的发行版中添加应用启动器的方案。 + +### Ulauncher:开源应用启动器 + +![][1] + +Ulauncher 是一个使用 Python 还有 GTK+ 构建的快速应用启动器。 + +它提供了相当数量的自定义和控制选项来进行调整。总的来说,你可以调整它的行为和体验以适应你的喜好。 + +让我来说一下你可以期待它的一些功能。 + +### Ulauncher 功能 + +Ulauncher 中的选项非常非常易于访问且易于定制。一些关键的亮点包括: + + * 模糊搜索算法,让你找到应用,即使你拼错了它们 + * 记住你在同一会话中最后搜索的应用 + * 经常使用的应用显示(可选) + * 自定义颜色主题 + * 预设颜色主题,包括一个黑暗主题 + * 召唤启动器的快捷方式可以轻松定制 + * 浏览文件和目录 + * 支持扩展,以获得额外的功能(表情符号、天气、速度测试、笔记、密码管理器等) + * 浏览谷歌、维基百科和 Stack Overflow 等网站的快捷方式 + + + +它几乎提供了你在一个应用启动器中所期望的所有有用的能力,甚至更好。 + +### 如何在 Linux 中使用 Ulauncher? + +默认情况下,首次从应用菜单打开应用启动器后,你需要按 **Ctrl + Space** 打开应用启动器。 + +开始输入以搜索一个应用。而且,如果你正在寻找一个文件或目录,开始输入 “**~**” 或者 “**/**” (忽略引号)。 + +![][2] + +有一些默认的快捷键,如 “**g XYZ**”,其中 XYZ 是你想在谷歌中搜索的搜索词。 + +![][3] + +同样,你可以通过 “**wiki**” 和 “**so**” 快捷键,直接在维基百科或 Stack Overflow 搜索。 + +在没有任何扩展的情况下,你也可以直接计算内容,并将结果直接复制到键盘上。 + +![][4] + +这在快速计算时应该很方便,不需要单独启动计算器应用。 + +你可以前往它的[扩展页面][5],浏览有用的扩展,以及指导你如何使用它的截图。 + +要改变它的工作方式,启用频繁的应用显示,并调整主题,请点击启动器右侧的齿轮图标。 + +![][6] + +你可以把它设置为自动启动。但是,如果它在你的支持 Systemd 的发行版上不工作,你可以参考它的 GitHub 页面,把它添加到服务管理器中。 + +这些选项是非常只管,且易于定制,如下图所示。 + +![][7] + +### 在 Linux 中安装 Ulauncher + +Ulauncher 为基于 Debian 或 Ubuntu 的发行版提供了一个 **.deb** 包。如果你是 Linux 新手,你可以探索[如何安装 Deb 文件][8] 。 + +在这两种情况下,你也可以添加它的 PPA,并通过终端按照下面的命令来安装它: + +``` +sudo add-apt-repository ppa:agornostal/ulauncher +sudo apt update +sudo apt install ulauncher +``` + +你也可以在 [AUR][9] 中找到它,用于 Arch 和 Fedora 的默认仓库。 + +对于更多信息,你可以前往其官方网站或 [GitHub页面][10]。 + +[Ulauncher][11] + +Ulauncher 应该是任何 Linux 发行版中一个令人印象深刻的补充。特别是,如果你想要一个像 Pop!_OS 提供的快速启动器的功能,这是一个值得考虑的奇妙选择。 + +_你试过 Ulauncher了吗?欢迎你就这如何帮助你快速完成工作分享你的想法。_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ulauncher/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher.png?resize=800%2C512&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-directory.png?resize=800%2C503&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-google.png?resize=800%2C449&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-calculator.png?resize=800%2C429&ssl=1 +[5]: https://ext.ulauncher.io +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-gear-icon.png?resize=800%2C338&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ulauncher-settings.png?resize=800%2C492&ssl=1 +[8]: https://itsfoss.com/install-deb-files-ubuntu/ +[9]: https://itsfoss.com/aur-arch-linux/ +[10]: https://github.com/Ulauncher/Ulauncher/ +[11]: https://ulauncher.io From 5dfa1bab36abcded1e3c4674d8b378bb9e064040 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 30 Aug 2021 08:37:06 +0800 Subject: [PATCH 249/290] translating --- .../tech/20210827 Linux kernel modules we can-t live without.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210827 Linux kernel modules we can-t live without.md b/sources/tech/20210827 Linux kernel modules we can-t live without.md index be68102762..82d66505d7 100644 --- a/sources/tech/20210827 Linux kernel modules we can-t live without.md +++ b/sources/tech/20210827 Linux kernel modules we can-t live without.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/linux-kernel-module" [#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 13b2e04bb45845de532efd1aea173e63221db263 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Mon, 30 Aug 2021 19:58:35 +0800 Subject: [PATCH 250/290] translating --- sources/tech/20200211 Using external libraries in Java.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200211 Using external libraries in Java.md b/sources/tech/20200211 Using external libraries in Java.md index 8367b5ca20..63791df886 100644 --- a/sources/tech/20200211 Using external libraries in Java.md +++ b/sources/tech/20200211 Using external libraries in Java.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (unigeorge) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -292,7 +292,7 @@ via: https://opensource.com/article/20/2/external-libraries-java 作者:[Chris Hermansen][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[unigeorge](https://github.com/unigeorge) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 8489359acf0335e86567ad41e88d53801b0556ac Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 30 Aug 2021 22:32:41 +0800 Subject: [PATCH 251/290] PUB @wxy https://linux.cn/article-13736-1.html --- ...owser Choice for Private Web Experience.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) rename {translated/tech => published}/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md (88%) diff --git a/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md similarity index 88% rename from translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md rename to published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md index 9d2391ba56..78021917e5 100644 --- a/translated/tech/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md +++ b/published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md @@ -4,13 +4,15 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13736-1.html) Brave vs. Firefox:你的私人网络体验的终极浏览器选择 ====== -Web 浏览器经过多年的发展。从下载文件到访问成熟的Web 应用程序,我们已经走过了很长的路。 +![](https://img.linux.net.cn/data/attachment/album/202108/30/223133tqzkg4pjpwwb8u4g.jpg) + +Web 浏览器经过多年的发展,从下载文件到访问成熟的 Web 应用程序,已经有了长足的发展。 对于很多用户来说,Web 浏览器是他们如今完成工作的唯一需要。 @@ -42,7 +44,7 @@ Brave 和 Mozilla Firefox 是两个最受到关注隐私的用户和开源爱好 ![Firefox 浏览器][13] -Firefox 浏览器的设计看起来令人印象深刻,并提供了干净利落的用户体验。如果需要的话,你还可以选择一个暗色主题,此外还有几个主题可供下载使用。 +Firefox 浏览器的设计看起来令人印象深刻,并提供了干净利落的用户体验。如果需要的话,你还可以选择一个暗色主题,此外还有其它几个主题可供下载使用。 这两个 Web 浏览器都能提供良好的用户体验。 @@ -104,7 +106,7 @@ Firefox 浏览器也默认启用了增强的隐私保护功能,但并不阻止 ![][19] -这是在 [Firefox 86][20] 中引入的技术,要使用它,你需要启用“严格隐私保护模式”。 +这是在 [Firefox 86][20] 中引入的技术,要使用它,你需要启用 “严格隐私保护模式”。 总的来说,Brave 可能看起来是一个更好的选择,而 Mozilla Firefox 提供了更好的隐私保护功能。 @@ -122,17 +124,17 @@ Brave 没有提供任何类似的功能,但它本身可以阻止跨站追踪 与 Firefox 不同,Brave 通过屏蔽网络上的其他广告来提供自己的广告网络。 -当你选择显示 Brave 的隐私友好型广告时,你会得到可以放到加密货币钱包里的通证奖励。而你可以用这些通证来回馈你喜欢的网站。 +当你选择显示 Brave 的隐私友好型广告时,你会得到可以放到加密货币钱包里的通证奖励,而你可以用这些通证来回馈你喜欢的网站。 虽然这是摆脱主流广告的一个很好的商业策略,但对于不想要任何形式的广告的用户来说,这可能没有用。 -因此,Brave 以奖励的形式提供了一个替代方案,即使你屏蔽了广告,也可以帮助网站。如果这是你欣赏的东西,Brave 将是你的一个好选择。 +因此,Brave 以奖励的形式提供了一个替代方案,即使你屏蔽了广告,也可以帮助网站发展。如果这是你欣赏的东西,Brave 将是你的一个好选择。 ### 跨平台可用性 你会发现 Brave 和 Firefox 都有 Linux、Windows 和 macOS 版本,也有用于 iOS 和 Android 的移动应用程序。 -对于 Linux 用户来说,Firefox 浏览器捆绑找大多数的 Linux 发行版中。而且,你也可以在软件中心里找到它。除此之外,还有一个 [Flatpak][22] 包可用。 +对于 Linux 用户来说,Firefox 浏览器捆绑在大多数的 Linux 发行版中。而且,你也可以在软件中心里找到它。除此之外,还有一个 [Flatpak][22] 包可用。 Brave 不能通过默认的软件库和软件中心获得。因此,你需要按照官方的说明来添加私有仓库,然后 [把 Brave 安装在你的 Linux 发行版中][23]。 @@ -142,7 +144,7 @@ Brave 不能通过默认的软件库和软件中心获得。因此,你需要 ![][24] -Brave 也可以让你跨平台同步,但你需要访问其中一个设备才能成功做到这一点。 +Brave 也可以让你跨平台同步,但你需要能访问其中一个设备才行。 ![][25] @@ -152,7 +154,7 @@ Brave 也可以让你跨平台同步,但你需要访问其中一个设备才 ### 服务集成 -一开始,Firefox 就提供了更多的服务集成,包括 Pocket、“虚拟私有网络”、密码管理器,还有一些新产品,如 Firefox 中继。 +从一开始 Firefox 就提供了更多的服务集成,包括 Pocket、“虚拟私有网络”、密码管理器,还有一些新产品,如 Firefox 中继。 如果你想通过你的浏览器访问这些服务,Firefox 将是你的方便选择。 @@ -160,7 +162,7 @@ Brave 也可以让你跨平台同步,但你需要访问其中一个设备才 ![][26] -同样,如果你喜欢使用 [Brave Search][27],在使用 Brave 浏览器时,由于用户体验的原因,你可能会有顺滑的体验。 +同样,如果你喜欢使用 [Brave Search][27],在使用 Brave 浏览器时,由于用户体验的原因,你可能体验会更顺滑。 ### 可定制性 & 安全性 @@ -170,7 +172,7 @@ Firefox 浏览器在可定制性方面大放异彩。你可以通过众多选项 而加固 Firefox 浏览器是一个我们将讨论的单独话题。略举一例,[Tor 浏览器][28] 只是一个定制的 Firefox 浏览器。 -然而,这并不意味着 Brave 的安全性降低。总的来说,它是一个安全的浏览器,但你确实可以通过 Firefox 浏览器获得更多的选择。 +然而,这并不意味着 Brave 的安全性更低。总的来说,它是一个安全的浏览器,但你确实可以通过 Firefox 浏览器获得更多的选择。 ### 扩展支持 @@ -178,7 +180,7 @@ Firefox 浏览器在可定制性方面大放异彩。你可以通过众多选项 因此,如果你是一个使用大量扩展(或不断尝试新扩展)的人,Brave 明显比 Firefox 更有优势。 -Firefox 可能扩展目录不是最大的,但它确实支持大多数的扩展。对于常见的使用情况,你很少能找到一个不能作为 Firefox 附加组件的扩展。 +可能 Firefox 的扩展清单不是最大的,但它确实支持大多数的扩展。对于常见的使用情况,你很少能找到一个 Firefox 中没有的扩展。 ### 你应该选择那个? @@ -188,7 +190,7 @@ Firefox 可能扩展目录不是最大的,但它确实支持大多数的扩展 在选择它们中的任何一个时会有一些取舍。因此,你需要优先考虑你最想要的东西。 -请在下面的评论中告诉我你对你的使用情况的最终选择! +请在下面的评论中告诉我你的最终选择! -------------------------------------------------------------------------------- From 80161a267d76f91516b5c03b60de95365e18ee6c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:03:16 +0800 Subject: [PATCH 252/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830=20?= =?UTF-8?q?How=20to=20install=20only=20security=20and=20bugfixes=20updates?= =?UTF-8?q?=20with=20DNF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210830 How to install only security and bugfixes updates with DNF.md --- ... security and bugfixes updates with DNF.md | 232 ++++++++++++++++++ 1 file changed, 232 insertions(+) create mode 100644 sources/tech/20210830 How to install only security and bugfixes updates with DNF.md diff --git a/sources/tech/20210830 How to install only security and bugfixes updates with DNF.md b/sources/tech/20210830 How to install only security and bugfixes updates with DNF.md new file mode 100644 index 0000000000..69d9b5b4e6 --- /dev/null +++ b/sources/tech/20210830 How to install only security and bugfixes updates with DNF.md @@ -0,0 +1,232 @@ +[#]: subject: "How to install only security and bugfixes updates with DNF" +[#]: via: "https://fedoramagazine.org/how-to-install-only-security-and-bugfixes-updates-with-dnf/" +[#]: author: "Mateus Rodrigues Costa https://fedoramagazine.org/author/mateusrodcosta/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to install only security and bugfixes updates with DNF +====== + +![][1] + +Photo by [Scott Webb][2] on [Unsplash][3] + +This article will explore how to filter the updates available to your Fedora Linux system by type. This way you can choose to, for example, only install security or bug fixes updates. This article will demo running the _dnf_ commands inside toolbox instead of using a real Fedora Linux install. + +You might also want to read [Use dnf updateinfo to read update changelogs][4] before reading this article. + +### Introduction + +If you have been managing system updates for Fedora Linux or any other GNU/Linux distro, you might have noticed how, when you run a system update (with _dnf update_, in the case of Fedora Workstation), you usually are not installing only security updates. + +Due to how package management in a GNU/Linux distro works, generally (with the exception of software running in a container, under Flatpak, or similar technologies) you are updating every single package regardless of whether it’s a “system” software or an “app”. + +DNF divides updates in three types: “security”, “bugfix” and “enhancement”. And, as you will see, DNF allows filtering which types you want to operate on. + +But, why would you want to update only a subset of packages? + +Well, this might depend on how you personally choose to deal with system updates. If you are not comfortable at the moment with updating everything, then restricting the current update to only security updates might be a good choice. You could also install bug fix updates as well and only install enhancements and other types of updates during a future opportunity. + +### How to filter security and bug fix updates + +Start by creating a Fedora Linux 34 toolbox: + +``` +toolbox create --distro fedora --release f34 updatefilter-demo +``` + +Then enter that toolbox: + +``` +toolbox enter updatefilter-demo +``` + +From now on commands can be run on a real Fedora Linux install. + +First, run _dnf check-update_ to see the unfiltered list of packages: + +``` +$ dnf check-update +audit-libs.x86_64 3.0.5-1.fc34 updates +avahi.x86_64 0.8-14.fc34 updates +avahi-libs.x86_64 0.8-14.fc34 updates +... +vim-minimal.x86_64 2:8.2.3318-1.fc34 updates +xkeyboard-config.noarch 2.33-1.fc34 updates +yum.noarch 4.8.0-1.fc34 updates +``` + +DNF supports passing the types of updates to operate on as parameter: _‐‐security_ for security updates, _‐‐bugfix_ for bug fix updates and _‐‐enhancement_ for enhancement updates. Those work on commands such as _dnf check-update_, _dnf update_ and _dnf updateinfo_. + +For example, this is how you filter the list of available updates by security updates only: + +``` +$ dnf check-update --security +avahi.x86_64 0.8-14.fc34 updates +avahi-libs.x86_64 0.8-14.fc34 updates +curl.x86_64 7.76.1-7.fc34 updates +... +libgcrypt.x86_64 1.9.3-3.fc34 updates +nettle.x86_64 3.7.3-1.fc34 updates +perl-Encode.x86_64 4:3.12-460.fc34 updates +``` + +And now same thing but by bug fix updates only: + +``` +$ dnf check-update --bugfix +audit-libs.x86_64 3.0.5-1.fc34 updates +ca-certificates.noarch 2021.2.50-1.0.fc34 updates +coreutils.x86_64 8.32-30.fc34 updates +... +systemd-pam.x86_64 248.7-1.fc34 updates +systemd-rpm-macros.noarch 248.7-1.fc34 updates +yum.noarch 4.8.0-1.fc34 updates +``` + +They can even be combined, so you can use two or more of them at the same time. For example, you can filter the list to show both security and bug fix updates: + +``` +$ dnf check-update --security --bugfix +audit-libs.x86_64 3.0.5-1.fc34 updates +avahi.x86_64 0.8-14.fc34 updates +avahi-libs.x86_64 0.8-14.fc34 updates +... +systemd-pam.x86_64 248.7-1.fc34 updates +systemd-rpm-macros.noarch 248.7-1.fc34 updates +yum.noarch 4.8.0-1.fc34 updates +``` + +As mentioned, _dnf updateinfo_ also works with this filtering, so you can filter _dnf updateinfo_, _dnf updateinfo list_ and _dnf updateinfo info_. For example, for the list of security updates and their IDs: + +``` +$ dnf updateinfo list --security +FEDORA-2021-74ebf2f06f Moderate/Sec. avahi-0.8-14.fc34.x86_64 +FEDORA-2021-74ebf2f06f Moderate/Sec. avahi-libs-0.8-14.fc34.x86_64 +FEDORA-2021-83fdddca0f Moderate/Sec. curl-7.76.1-7.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-2.33-20.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-common-2.33-20.fc34.x86_64 +FEDORA-2021-e14e86e40e Moderate/Sec. glibc-minimal-langpack-2.33-20.fc34.x86_64 +FEDORA-2021-8b25e4642f Low/Sec. krb5-libs-1.19.1-14.fc34.x86_64 +FEDORA-2021-83fdddca0f Moderate/Sec. libcurl-7.76.1-7.fc34.x86_64 +FEDORA-2021-31fdc84207 Moderate/Sec. libgcrypt-1.9.3-3.fc34.x86_64 +FEDORA-2021-d1fc0b9d32 Moderate/Sec. nettle-3.7.3-1.fc34.x86_64 +FEDORA-2021-92e07de1dd Important/Sec. perl-Encode-4:3.12-460.fc34.x86_64 +``` + +If desired, you can install only security updates: + +``` +# dnf update --security +================================================================================ + Package Arch Version Repository Size +================================================================================ +Upgrading: + avahi x86_64 0.8-14.fc34 updates 289 k + avahi-libs x86_64 0.8-14.fc34 updates 68 k + curl x86_64 7.76.1-7.fc34 updates 297 k +... + perl-Encode x86_64 4:3.12-460.fc34 updates 1.7 M +Installing weak dependencies: + glibc-langpack-en x86_64 2.33-20.fc34 updates 563 k + +Transaction Summary +================================================================================ +Install 1 Package +Upgrade 11 Packages + +Total download size: 9.7 M +Is this ok [y/N]: +``` + +Or even to install both security and bug fix updates while ignoring enhancement updates: + +``` +# dnf update --security --bugfix +================================================================================ + Package Arch Version Repo Size +================================================================================ +Upgrading: + audit-libs x86_64 3.0.5-1.fc34 updates 116 k + avahi x86_64 0.8-14.fc34 updates 289 k + avahi-libs x86_64 0.8-14.fc34 updates 68 k +... + rpm-plugin-systemd-inhibit x86_64 4.16.1.3-1.fc34 fedora 23 k + shared-mime-info x86_64 2.1-2.fc34 fedora 374 k + sqlite x86_64 3.34.1-2.fc34 fedora 755 k + +Transaction Summary +================================================================================ +Install 11 Packages +Upgrade 45 Packages + +Total download size: 32 M +Is this ok [y/N]: +``` + +### Install only specific updates + +You may also choose to only install the updates with a specific ID, such as _FEDORA-2021-74ebf2f06f_ for avahi by using _–advisory_ and specifying the ID: + +``` +# dnf update --advisory=FEDORA-2021-74ebf2f06f +================================================================================ + Package Architecture Version Repository Size +================================================================================ +Upgrading: + avahi x86_64 0.8-14.fc34 updates 289 k + avahi-libs x86_64 0.8-14.fc34 updates 68 k + +Transaction Summary +================================================================================ +Upgrade 2 Packages + +Total download size: 356 k +Is this ok [y/N]: +``` + +Or even multiple updates, with _‐‐advisories_: + +``` +# dnf update --advisories=FEDORA-2021-74ebf2f06f,FEDORA-2021-83fdddca0f +================================================================================ + Package Architecture Version Repository Size +================================================================================ +Upgrading: + avahi x86_64 0.8-14.fc34 updates 289 k + avahi-libs x86_64 0.8-14.fc34 updates 68 k + curl x86_64 7.76.1-7.fc34 updates 297 k + libcurl x86_64 7.76.1-7.fc34 updates 284 k + +Transaction Summary +================================================================================ +Upgrade 4 Packages + +Total download size: 937 k +Is this ok [y/N]: +``` + +### Conclusion + +In the end it all comes down to how you personally prefer to manage your updates. But if you need, for whichever reason, to only install security updates, then these filters will surely come in handy! + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-install-only-security-and-bugfixes-updates-with-dnf/ + +作者:[Mateus Rodrigues Costa][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/mateusrodcosta/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/how-to-install-only-security-and-bugfixes-updates-with-dnf-816x345.jpg +[2]: https://unsplash.com/@scottwebb?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/security?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/use-dnf-updateinfo-to-read-update-changelogs/ From 101029fbe95ae167d1be48a8ac24315399d5144c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:03:36 +0800 Subject: [PATCH 253/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831=20?= =?UTF-8?q?Zulip:=20An=20Interesting=20Open-Source=20Alternative=20to=20Sl?= =?UTF-8?q?ack?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md --- ...esting Open-Source Alternative to Slack.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md diff --git a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md new file mode 100644 index 0000000000..af9e6da063 --- /dev/null +++ b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -0,0 +1,99 @@ +[#]: subject: "Zulip: An Interesting Open-Source Alternative to Slack" +[#]: via: "https://itsfoss.com/zulip/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Zulip: An Interesting Open-Source Alternative to Slack +====== + +_**Brief:** Zulip is an open-source collaboration platform that pitches itself as a better replacement to Slack. Let us take a closer look._ + +Messaging and collaboration platforms make a big difference when it comes to your work. + +While there are several options available, Slack is a popular one used by many organizations. But, what about an open-source alternative to Slack that you can self-host? + +Zulip is one such software. + +### Zulip: Open Source Collaboration Messaging App + +![][1] + +If you want to explore, I must mention that there are more [open-source alternatives to Slack][2] out there. + +Here, I focus on Zulip. + +Zulip is a free and open-source messaging application with paid hosted options and the ability to self-host. + +It aims to provide a similar experience to Slack while striving to help you improve the effectiveness of conversations using topics. + +In contrast to channels in Slack, Zulip chat adds topics (which are like tags) to quickly filter through the conversations that matter to you. + +### Features of Zulip + +![][3] + +You get most of the essential features with Zulip. To list the key highlights, you can find: + + * Markdown support + * Topics for channels + * Drag and drop file support + * Code blocks + * GitHub integration to track issues + * Email notification support + * Self-host option + * Message editing + * GIPHY integration + * Video calls with Zoom, Jitsi, or BigBlueButton + + + +In addition to the features mentioned, you should expect the basic options that you usually get with Slack and others. + +Also, you can integrate it with Matrix and IRC if you want. + +![][4] + +In my brief test usage, the user interface is good enough for effective communication. However, I failed to find any dark mode or the ability to change a theme. + +It looks more straightforward than Slack so that it can improve the user experience side of things. + +### Install Zulip in Linux + +Zulip is available as an AppImage file from its official website. You may refer to our guide on [using AppImage in Linux][5] in case you need help. + +It is also available as a snap package. So, you can utilize either of them for any Linux distro. + +You can also install it through the terminal for Ubuntu/Debian-based distros using APT. Take a look at its [official instructions][6] if you want that. + +Zulip is available for Windows, Mac, and Linux. You should also find it available for Android and iOS mobile phones. + +[Zulip][7] + +Considering that you can use Zulip on the web, desktop, and smartphones, it is a suitable replacement for Slack. + +_Have you tried it yet? What messaging platform do you use to collaborate for work? Feel free to share your thoughts in the comments._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zulip/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-chat-new.png?resize=800%2C551&ssl=1 +[2]: https://itsfoss.com/open-source-slack-alternative/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-chat-screenshot.png?resize=800%2C550&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/zulip-settings.png?resize=800%2C546&ssl=1 +[5]: https://itsfoss.com/use-appimage-linux/ +[6]: https://zulip.com/help/desktop-app-install-guide +[7]: https://zulip.com/ From 9d5ce11ac958005dae98de94a0ee4c60498cbf36 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:03:58 +0800 Subject: [PATCH 254/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830=20?= =?UTF-8?q?Print=20from=20anywhere=20with=20CUPS=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210830 Print from anywhere with CUPS on Linux.md --- ... Print from anywhere with CUPS on Linux.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20210830 Print from anywhere with CUPS on Linux.md diff --git a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md new file mode 100644 index 0000000000..025dce01e1 --- /dev/null +++ b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md @@ -0,0 +1,113 @@ +[#]: subject: "Print from anywhere with CUPS on Linux" +[#]: via: "https://opensource.com/article/21/8/share-printer-cups" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Print from anywhere with CUPS on Linux +====== +Share your printer with the Common Unix Printing System (CUPS). +![Two hands holding a resume with computer, clock, and desk chair ][1] + +I have a printer in my office, but sometimes I work on my laptop in another room of the house. This isn't a problem for me for two reasons. First of all, I rarely print anything on paper and have gone months without using the printer. Secondly, though, I've set the printer to be shared over my home network, so I can send files to print from anywhere in the house. I didn't need any special equipment for this setup. It's accomplished with just my usual Linux computer and the Common Unix Printing System (CUPS). + +### Installing CUPS on Linux + +If you're running Linux, BSD, or macOS, then you probably already have CUPS installed. CUPS has been the open source solution to Unix printing since 1997. Apple relied on it so heavily for their fledgling Unix-based OS X that they ended up buying it in 2007 to ensure its continued development and maintenance. + +If your system doesn't already have CUPS installed, you can install it with your package manager. For example, on Fedora, Mageia, or CentOS: + + +``` +`$ sudo dnf install cups` +``` + +On Debian, Linux Mint, and similar: + + +``` +`$ sudo apt install cups` +``` + +### Accessing CUPS on Linux and Mac + +To access CUPS, open a web browser and navigate to `localhost:631`, which tells your computer to open whatever's on port 631 on itself (your computer always [refers to itself as localhost][2]). + +Your web browser opens a page providing you access to your system's printer settings. From here, you can add printers, modify printer defaults, monitor queued jobs, and allow printers to be shared over your local network. + +![CUPS web user interface][3] + +Figure 1: The CUPS web user interface. + +### Configuring a printer with CUPS + +You can either add a new printer or modify an existing one from within the CUPS interface. Modifying a printer involves the exact same pages as adding a new one, except that when you're adding a printer, you make new choices, and when you're modifying a printer, you confirm or change existing ones. + +First, click on the **Administration** tab, and then the **Add Printer** button. + +If you're only modifying an existing printer, click **Manage Printers** instead, and then choose the printer you want to change. Choose **Modify Printer** from the **Administration** drop-down menu. + +Regardless of whether you're modifying or adding, you must enter administrative authorization before CUPS allows you to continue. You can either log in as root, if that's available to you, or as your normal user identity, as long as you have `sudo` privileges. + +Next, you're presented with a list of printer interfaces and protocols that you can use for a printer. If your printer is plugged directly into your computer and is on, it's listed as a _Local Printer_. If the printer has networking built into it and is attached to a switch or router on your network, you can usually use the Internet Printing Protocol (ipp) to access it (you may have to look at your router to determine the IP address of the printer, but read your printer's documentation for details). If the printer is a Hewlett-Packard, you may also be able to use HPLIP to access it. + +Use whatever protocol makes sense for your physical setup. If you're unsure of what to use, you can try one, attempt to print a test page, and then try a different one in the case of failure. + +The next screen asks for human-friendly details about the printer. This is mostly for your reference. Enter a name for the printer that makes sense (I usually use the model number, but large organizations sometimes name their printers after things like fictional starships or capital cities), a description, and the location. + +You may also choose to share the printer with other computers on your network. + +![CUPS web UI to share printers][4] + +Figure 2: CUPS web user interface to share printers. + +If sharing is not currently enabled, click the checkbox to enable sharing. + +### Drivers + +On the next screen, you must set your printer driver. Open source drivers for printers can often be found on [openprinting.org][5]. There's a good chance you already have a valid driver, as long as you have the `gutenprint` package installed, or have installed drivers bundled with the printer. If the printer is a PostScript printer (many laser printers are), you may only need a PPD file from [openprinting.org][5] rather than a driver. + +Assuming you have drivers installed, you can choose your printer's make (manufacturer) for a list of available drivers. Select the appropriate driver and continue. + +### Connecting to a shared printer + +Now that you have successfully installed and configured your printer, you can connect to it from any other computer on your network. For example, suppose you have a laptop called **client** that you use around the house. You want to add your shared printer to it. + +On the GNOME and Plasma desktops, you can add a printer from the **Printer** screen of **Settings:** + + * If you have your printer connected to a computer, then you enter the IP address of the _computer_ (because the printer is accessible through its host). + * If you have your printer connected to a switch or router, then enter the IP address of the printer itself. + + + +On macOS, printer settings can be found in **System Preferences**. + +Alternately, you can keep using the CUPS interface on your client computer. The process to access CUPS is the same: Ensure CUPS is installed, open a network, and navigate to `localhost:631`. + +Once you've accessed the CUPS web interface, select the **Administration** tab. Click the **Find New Printers** button in the **Printers** section, and then add the shared printer to your network. You can also set the printer's IP address manually in CUPS by going through the normal **Add Printer** process. + +### Print from anywhere + +It's the 21st century! Put the USB thumb drive down, stop emailing yourself files to print from another computer, and make your printer available to your home network. It's surprisingly easy and supremely convenient. And best of all, you'll look like a networking wizard to all of your housemates! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/share-printer-cups + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/resume_career_document_general.png?itok=JEaFL2XI (Two hands holding a resume with computer, clock, and desk chair ) +[2]: https://opensource.com/article/21/4/network-management +[3]: https://opensource.com/sites/default/files/cups-web-ui.jpeg +[4]: https://opensource.com/sites/default/files/cups-web-ui-share_0.jpeg +[5]: http://openprinting.org From 9aaee6185b0617bded7ae63aba4ba291f0e07842 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:04:14 +0800 Subject: [PATCH 255/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830=20?= =?UTF-8?q?Write=20a=20guessing=20game=20in=20ncurses=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210830 Write a guessing game in ncurses on Linux.md --- ...ite a guessing game in ncurses on Linux.md | 164 ++++++++++++++++++ 1 file changed, 164 insertions(+) create mode 100644 sources/tech/20210830 Write a guessing game in ncurses on Linux.md diff --git a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md new file mode 100644 index 0000000000..06945c55da --- /dev/null +++ b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md @@ -0,0 +1,164 @@ +[#]: subject: "Write a guessing game in ncurses on Linux" +[#]: via: "https://opensource.com/article/21/8/guess-number-game-ncurses-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Write a guessing game in ncurses on Linux +====== +Use the flexibility and power of ncurses to create a guess-the-number +game on Linux. +![question mark in chalk][1] + +In my [last article][2], I gave a brief introduction to using the **ncurses** library to write text-mode interactive applications in C. With **ncurses**, we can control where and how text gets displayed on the terminal. If you explore the **ncurses** library functions by reading the manual pages, you’ll find there are a ton of different ways to display text, including bold text, colors, blinking text, windows, borders, graphic characters, and other features to make your application stand out. + +If you’d like to explore a more advanced program that demonstrates a few of these interesting features, here’s a simple “guess the number” game, updated to use **ncurses**. The program picks a random number in a range, then asks the user to make repeated guesses until they find the secret number. As the user makes their guess, the program lets them know if the guess was too low or too high. + +Note that this program limits the possible numbers from 0 to 7. Keeping the values to a limited range of single-digit numbers makes it easier to use **getch()** to read a single number from the user. I also used the **getrandom** kernel system call to generate random bits, masked with the number 7 to pick a random number from 0 (binary 0000) to 7 (binary 0111). + + +``` +#include <curses.h> +#include <string.h>          /* for strlen */ +#include <sys/random.h>      /* for getrandom */ + +int +random0_7() +{ +   int num; +   getrandom(&num, sizeof(int), GRND_NONBLOCK); +   return (num & 7); /* from 0000 to 0111 */ +} + +int +read_guess() +{ +  int ch; + +  do { +    ch = getch(); +  } while ((ch < '0') || (ch > '7')); + +  return (ch - '0'); /* turn into a number */ +} +``` + +By using **ncurses**, we can add some visual interest. Let’s add functions to display important text at the top of the screen and a message line to display status information at the bottom of the screen. + + +``` +void +print_header(const char *text) +{ +  move(0, 0); +  clrtoeol(); + +  attron(A_BOLD); +  mvaddstr(0, (COLS / 2) - (strlen(text) / 2), text); +  attroff(A_BOLD); +  refresh(); +} + +void +print_status(const char *text) +{ +  move(LINES - 1, 0); +  clrtoeol(); +  +  attron(A_REVERSE); +  mvaddstr(LINES - 1, 0, text); +  attroff(A_REVERSE); +  refresh(); +} +``` + +With these functions, we can construct the main part of our number-guessing game. First, the program sets up the terminal for **ncurses**, then picks a random number from 0 to 7. After displaying a number scale, the program then enters a loop to ask the user for their guess. + +As the user makes their guess, the program provides visual feedback. If the guess is too low, the program prints a left square bracket under the number on the screen. If the guess is too high, the game prints a right square bracket. This helps the user to narrow their choice until they guess the correct number. + + +``` +int +main() +{ +  int number, guess; + +  initscr(); +  cbreak(); +  noecho(); + +  number = random0_7(); +  mvprintw(1, COLS - 1, "%d", number); /* debugging */ + +  print_header("Guess the number 0-7"); + +  mvaddstr(9, (COLS / 2) - 7, "0 1 2 3 4 5 6 7"); + +  print_status("Make a guess..."); + +  do { +    guess = read_guess(); + +    move(10, (COLS / 2) - 7 + (guess * 2)); + +    if (guess < number) { +      addch('['); +      print_status("Too low"); +    } + +    else if (guess > number) { +      addch(']'); +      print_status("Too high"); +    } + +    else { +      addch('^'); +    } +  } while (guess != number); + +  print_header("That's right!"); +  print_status("Press any key to quit"); +  getch(); + +  endwin(); + +  return 0; +} +``` + +Copy this program and compile it for yourself to try it out. Don’t forget that you need to tell GCC to link with the **ncurses** library: + + +``` +`$ gcc -o guess guess.c -lncurses` +``` + +I’ve left the debugging line in there, so you can see the secret number near the upper-right corner of the screen: + +![guess number game interface][3] + +Figure 1: Guess the number game. Notice the secret number in the upper right. + +### Get yourself going with ncurses + +This program uses a bunch of other features of **ncurses** that you can use as a starting point. For example, the print_header function prints a message in bold text centered at the top of the screen, and the print_status function prints a message in reverse text at the bottom-left of the screen. Use this to help you get started with **ncurses** programming. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/guess-number-game-ncurses-linux + +作者:[Jim Hall][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/question-mark_chalkboard.jpg?itok=DaG4tje9 (question mark in chalk) +[2]: https://opensource.com/article/21/8/ncurses-linux +[3]: https://opensource.com/sites/default/files/guessnumber07.png From 659e36f6f2d92e34b09925c68d46af7ca0bb3ed6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 31 Aug 2021 05:06:49 +0800 Subject: [PATCH 256/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210830=20?= =?UTF-8?q?Linux=20Kernel=205.14=20Released=20Right=20After=20the=2030th?= =?UTF-8?q?=20Anniversary=20of=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md --- ...ght After the 30th Anniversary of Linux.md | 154 ++++++++++++++++++ 1 file changed, 154 insertions(+) create mode 100644 sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md diff --git a/sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md b/sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md new file mode 100644 index 0000000000..5f9ffc4f7a --- /dev/null +++ b/sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md @@ -0,0 +1,154 @@ +[#]: subject: "Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux" +[#]: via: "https://news.itsfoss.com/kernel-5-14-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux +====== + +Back in June, I looked at [Linux Kernel 5.13][1], where we received preliminary support for the M1, RISC-V improvements, and support for new GPUs. + +Now, Linux kernel 5.14 is here! Linus Torvalds just [announced it on the kernel mailing list][2]: + +![Kernel 5.14 announcement mail][3] + +While this release is not quite as large as the aforementioned one, it still has many improvements, especially for ARM devices. + +Let us take a quick look at the key highlights of this release. + +### Linux Kernel 5.14: What’s New? + +Linux kernel 5.14 contains a wide variety of new features, especially for ARM-based systems. This is all happening despite Linus Torvalds claiming that this is a relatively small release in the initial [kernel announcement][4]. + +Fast forward to its release candidate v7 before its final release, Linus mentioned: + +> Most of the changes here are drivers (GPU and networking stand out), +> +> and the rest is pretty random stuff: arch, tracing, core networking, a +> +> couple of VM fixes.. + +Linus Torvalds, Linux kernel 5.14 RC7 announcement + +This release contains a variety of new features. Here is a list of the key new features present in Linux kernel 5.14: + + * The [Raspberry Pi 400][5] can now work completely with this kernel, thanks to the work done for the past couple of months. + * The [Rockchip RK3568 SoC][6] is now supported + * Initial support for the Sony Xperia 1/1II and 5/5II + * Various updates added for Microsoft Surface Duo + * Updates to DIY BananaPi M5 board added + * [Important updates][7] for RISC-V + * Improved support for Intel Alder Lake P and Alder Lake M graphics cards + * New hot-unplug support on AMD Radeon graphics cards + * ‘Secret’ memory areas introduced with a new system called ‘memfd_secret’ + * Improvements to [lower the latency of its USB audio driver][8]s + * Improved support for USB4 + * Initial groundwork to support Intel Alder lake processors + + + +In this article, we will be looking at what these features are, and what they mean for the end user. + +#### Raspberry Pi 400 + +Last year, the Raspberry Pi Foundation launched the [Raspberry Pi 400][5], a keyboard computer similar to those of the 1980s. Unfortunately, this computer requires a custom kernel version to function due to non-mainline drivers. + +However, with the kernel 5.14 release, this appears to have changed. After months of development, the Raspberry Pi 400 can now be booted using the Linux kernel 5.14. While it is unfortunate for support to take this long, it is much better late than never. + +#### RK35xx SoC Support + +This year has truly been a glorious year for [Rockchip][9]. They started off by launching their rk35xx series of SoCs, with many manufacturers integrating the newly-released SoCs into their products. + +One of the most notable uses of the RK35xx series is in the Quartz64, an SBC developed by [Pine64][10] (which I am currently helping mainline). And Linux 5.14 brings support for one of these SoCs, the RK3568. + +For all the upcoming boards based on this SoC, this inclusion is extremely important as it greatly simplifies distro porting. + +#### Initial Support for Sony Xperia 1/1II and 5/5II + +[Sony][11] is one of the few mobile phone manufacturers that actively support running Linux on their phones. This is demonstrated through their compatibility with operating systems such as [Sailfish OS][12] and [Ubuntu Touch][13]. + +Now, with the Sony Xperia 1/1II and 5/5II being mainlined, it should be much easier to get an even wider variety of distributions booted. However, it should be also be kept in mind that this is only initial support, much like Linux 5.13’s M1 support. + +#### RISC-V Updates + +One of the trends I have noticed over the past few kernel updates is the ever-improving support for [RISC-V][14] processors. Last update, we got some significant build system improvements, a re-arranged kernel memory map, and support for the kernel debugging module KProbes. + +This time, it appears that this trend is continuing, with the addition of a few RISC-V-specific improvements. These include: + + * Support for transparent huge pages + * An optimized copy_{to,from}_user. + * Generic PCI resources mapping support + * Support for KFENCE (Kernel Electric Fence) for memory safety error detection/validation + + + +While mostly minor, these updates should pave the way for future RISC-V based devices. + +#### Radeon Hot-Unplug + +Perhaps my favorite feature of this release, AMD Radeon cards are getting a new hot-unplug feature. Previously, ripping your GPU out while your system was running would result in a kernel panic. Now, you can remove your (Radeon) GPU at any time and your system will continue to function normally, at least in theory. + +I just hope that this feature works better on Linux than my experience with it on Windows. While I wouldn’t recommend randomly pulling your GPU out of your system mid-update, it is still a nice feature to see, and it will be interesting to see what people do with it. + +#### USB 4 Support + +As we see an increasing number of new laptops shipping with USB 4, it has become more and more important for Linux to start supporting it. Fortunately, the Linux kernel 5.14 has a wide variety of improvements for USB 4 users. + +These include: + + * More USB 4 support added to the thunderbolt core + * Build warning fixes all over the place + * USB-serial driver updates and new device support + * A wide variety of driver updates + * Lots of other tiny things + + + +While not game-changing, these improvements should help many current and future users of USB 4. + +### Wrapping Up + +Between the improved USB support, multitude of updates for ARM and RISC-V devices, and minor GPU upgrades, this release is looking pretty good. As I mentioned before, I am most excited about the Radeon hot-unplug support, as this should make GPU swapping that little bit easier. + +Similarly to last time, I’d recommend waiting for your distribution to offer official updates before upgrading to Linux kernel 5.14. Fortunately, users of distributions such as Arch and Manjaro should receive the updates very shortly. [Advanced Ubuntu users can install the latest mainline Kernel][15] with some effort though it should be avoided. + +_What do you think about the improvements in Linux Kernel 5.14? Let me know down in the comments!_ + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kernel-5-14-release/ + +作者:[Jacob Crume][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/linux-kernel-5-13-release/ +[2]: https://lkml.org/lkml/2021/8/29/382 +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ1NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: http://lkml.iu.edu/hypermail/linux/kernel/2107.1/02943.html +[5]: https://www.raspberrypi.org/products/raspberry-pi-400/ +[6]: https://www.96rocks.com/blog/2020/11/28/introduce-rockchip-rk3568/ +[7]: https://lore.kernel.org/lkml/mhng-423e8bdb-977e-4b99-a1bb-b8c530664a51@palmerdabbelt-glaptop/ +[8]: http://lkml.iu.edu/hypermail/linux/kernel/2107.1/00919.html +[9]: https://www.rock-chips.com/a/en/index.html +[10]: http://pine64.org +[11]: https://electronics.sony.com/c/mobile +[12]: https://sailfishos.org/ +[13]: https://ubuntu-touch.io/ +[14]: https://riscv.org/ +[15]: https://itsfoss.com/upgrade-linux-kernel-ubuntu/ From 2185bc4e467e116f3505bd4fa4b0666f4c8f4ccd Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Aug 2021 08:36:16 +0800 Subject: [PATCH 257/290] translating --- ...s for daily needs part 4- audio editors.md | 87 ------------------- 1 file changed, 87 deletions(-) delete mode 100644 sources/tech/20210823 Apps for daily needs part 4- audio editors.md diff --git a/sources/tech/20210823 Apps for daily needs part 4- audio editors.md b/sources/tech/20210823 Apps for daily needs part 4- audio editors.md deleted file mode 100644 index e3ce8c80df..0000000000 --- a/sources/tech/20210823 Apps for daily needs part 4- audio editors.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: "Apps for daily needs part 4: audio editors" -[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/" -[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Apps for daily needs part 4: audio editors -====== - -![][1] - -Photo by [Brooke Cagle][2] on [Unsplash][3] - -Audio editor applications or digital audio workstations (DAW) were only used in the past by professionals, such as record producers, sound engineers, and musicians. But nowadays many people who are not professionals also need them. These tools are used for narration on presentations, video blogs, and even just as a hobby. This is especially true now since there are so many online platforms that facilitate everyone sharing audio works, such as music, songs, podcast, etc. This article will introduce some of the open source audio editors or DAW that you can use on Fedora Linux. You may need to install the software mentioned. If you are unfamiliar with how to add software packages in Fedora Linux, see my earlier article [Things to do after installing Fedora 34 Workstation][4]. Here is a list of a few apps for daily needs in the audio editors or DAW category. - -### Audacity - -I’m sure many already know Audacity. It is a popular multi-track audio editor and recorder that can be used for post-processing all types of audio. Most people use Audacity to record their voices, then do editing to make the results better. The results can be used as a podcast or a narration for a video blog. In addition, people also use Audacity to create music and songs. You can record live audio through a microphone or mixer. It also supports 32 bit sound quality. - -Audacity has a lot of features that can support your audio works. It has support for plugins, and you can even write your own plugin. Audacity provides many built-in effects, such as noise reduction, amplification, compression, reverb, echo, limiter, and many more. You can try these effects while listening to the audio directly with the real-time preview feature. The built in plugin-manager lets you manage frequently used plugins and effects. - -![][5] - -More information is available at this link: - -* * * - -### LMMS - -LMMS or Linux MultiMedia Studio is a comprehensive music creation application. You can use LMMS to produce your music from scratch with your computer. You can create melodies and beats according to your creativity, and make it better with selection of sound instruments and various effects. There are several built-in features related to musical instruments and effects, such as 16 built-in sythesizers, embedded ZynAddSubFx, drop-in VST effect plug-in support, bundled graphic and parametric equalizer, built-in analyzer, and many more. LMMS also supports MIDI keyboards and other audio peripherals. - -![][6] - -More information is available at this link: - -* * * - -### Ardour - -Ardour has capabilities similar to LMMS as a comprehensive music creation application. It says on its website that Ardour is a DAW application that is the result of collaboration between musicians, programmers, and professional recording engineers from around the world. Ardour has various functions that are needed by audio engineers, musicians, soundtrack editors, and composers. - -Ardour provides complete features for recording, editing, mixing, and exporting. It has unlimited multichannel tracks, non-linear editor with unlimited undo/redo, a full featured mixer, built-in plugins, and much more. Ardour also comes with video playback tools, so it is also very helpful in the process of creating and editing soundtracks for video projects. - -![][7] - -More information is available at this link: - -* * * - -### TuxGuitar - -TuxGuitar is a tablature and score editor. It comes with a tablature editor, score viewer, multitrack display, time signature management, and tempo management. It includes various effects, such as bend, slide, vibrato, etc. While TuxGuitar focuses on the guitar, it allows you to write scores for other instruments. It can also serve as a basic MIDI editor. You need to have an understanding of tablature and music scoring to be able to use it. - -![][8] - -More information is available at this link: - -* * * - -### Conclusion - -This article presented four audio editors as apps for your daily needs and use on Fedora Linux. Actually there are many other audio editors, or DAW, that you can use on Fedora Linux. You can also use Mixxx, Rosegarden, Kwave, Qtractor, MuseScore, musE, and many more. Hopefully this article can help you investigate and choose the right audio editor or DAW. If you have experience using these applications, please share your experiences in the comments. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/ - -作者:[Arman Arisman][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://fedoramagazine.org/author/armanwu/ -[b]: https://github.com/lujun9972 -[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-4-Audio-816x345.jpg -[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText -[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ -[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-audacity-1024x575.png -[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-lmms-1024x575.png -[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-ardour-1024x592.png -[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-tuxguitar-1024x575.png From e3bda7f6fd69b38c0bfaff070e2b74dc6f681a01 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Aug 2021 08:39:19 +0800 Subject: [PATCH 258/290] translating --- ...s for daily needs part 4- audio editors.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 translated/tech/20210823 Apps for daily needs part 4- audio editors.md diff --git a/translated/tech/20210823 Apps for daily needs part 4- audio editors.md b/translated/tech/20210823 Apps for daily needs part 4- audio editors.md new file mode 100644 index 0000000000..8207f167b1 --- /dev/null +++ b/translated/tech/20210823 Apps for daily needs part 4- audio editors.md @@ -0,0 +1,87 @@ +[#]: subject: "Apps for daily needs part 4: audio editors" +[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/" +[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +满足日常需求的应用第四部分:音频编辑器 +====== + +![][1] + +照片由 [Brooke Cagle][2] 在 [Unsplash][3] 上发布。 + +音频编辑应用或数字音频工作站(DAW)在过去只被专业人士使用,如唱片制作人、音响工程师和音乐家。但现在很多不是专业人士的人也需要它们。这些工具被用于演示文稿解说、视频博客,甚至只是作为一种爱好。现在尤其如此,因为有这么多的在线平台,方便大家分享音频作品,如音乐、歌曲、播客等。本文将介绍一些你可以在 Fedora Linux 上使用的开源音频编辑器或 DAW。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。这里列出了音频编辑器或 DAW 类的一些日常需求的应用。 + +### Audacity + +我相信很多人已经知道 Audacity 了。它是一个流行的多轨音频编辑器和录音机,可用于对所有类型的音频进行后期处理。大多数人使用 Audacity 来记录他们的声音,然后进行编辑,使其结果更好。其结果可以作为播客或视频博客的解说词。此外,人们还用 Audacity 来创作音乐和歌曲。你可以通过麦克风或调音台录制现场音频。它还支持 32 位的声音质量。 + +Audacity 有很多功能,可以支持你的音频作品。它有对插件的支持,你甚至可以自己编写插件。Audacity 提供了许多内置效果,如降噪、放大、压缩、混响、回声、限制器等。你可以利用实时预览功能在直接聆听音频的同时尝试这些效果。内置的插件管理器可以让你管理经常使用的插件和效果。 + +![][5] + +更多信息可在此链接中找到: + +* * * + +### LMMS + +LMMS 或 Linux MultiMedia Studio 是一个全面的音乐创作应用。你可以使用 LMMS 用你的电脑从头开始制作你的音乐。你可以根据自己的创意创造旋律和节拍,并通过选择声音乐器和各种效果使其更加完美。有几个与乐器和效果有关的内置功能,如 16 个内置合成器、嵌入式 ZynAddSubFx、支持插入式 VST 效果插件、捆绑图形和参数均衡器、内置分析器等等。LMMS 还支持 MIDI 键盘和其他音频外围设备。 + +![][6] + +更多信息可在此链接中获得: + +* * * + +### Ardour + +Ardour 作为一个全面的音乐创作应用,其功能与 LMMS 相似。它在其网站上说,Ardour 是一个 DAW 应用,是来自世界各地的音乐家、程序员和专业录音工程师合作的结果。Ardour 拥有音频工程师、音乐家、配乐编辑和作曲家需要的各种功能。 + +Ardour 为录音、编辑、混音和输出提供了完整的功能。它有无限的多声道音轨、无限撤销/重做的非线性编辑器、一个全功能的混音器、内置插件等。Ardour 还带有视频播放工具,所以它在为视频项目创建和编辑配乐的过程中也很有帮助。 + +![][7] + +更多信息可在此链接中获得: + +* * * + +### TuxGuitar + +TuxGuitar 是一个指法谱和乐谱编辑器。它配备了指法编辑器、乐谱查看器、多轨显示、拍号管理和速度管理。它包括各种效果,如弯曲、滑动、颤音等。虽然 TuxGuitar 专注于吉他,但它也允许你为其他乐器写乐谱。它也可以作为一个基本的 MIDI 编辑器。你需要对指法谱和乐谱有一定的了解才能使用它。 + +![][8] + +更多的信息可以在这个链接上获得: + +* * * + +### 总结 + +这篇文章介绍了四个音频编辑器,作为你在 Fedora Linux 上的日常需要和使用的应用。实际上,还有许多其他的你可以在 Fedora Linux 上使用的音频编辑器或者 DAW。你也可以使用 Mixxx、Rosegarden、Kwave、Qtractor、MuseScore、musE 等等。希望这篇文章能帮助你调查和选择合适的音频编辑器或者 DAW。如果你有使用这些应用的经验,请在评论中分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-4-audio-editors/ + +作者:[Arman Arisman][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-4-Audio-816x345.jpg +[2]: https://unsplash.com/@brookecagle?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/meeting-on-cafe-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/things-to-do-after-installing-fedora-34-workstation/ +[5]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-audacity-1024x575.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-lmms-1024x575.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-ardour-1024x592.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/audio-tuxguitar-1024x575.png From f94acecd74c698dd14b57f94a5fc4aa843e8317f Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 31 Aug 2021 08:42:21 +0800 Subject: [PATCH 259/290] translating --- .../20210820 How to Download Audio Only Using youtube-dl.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md b/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md index 4c5ab290b6..23ebe4e425 100644 --- a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md +++ b/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/youtube-dl-audio-only/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 37b414d28ed4d72707b808758afcd74973347c02 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Aug 2021 09:29:39 +0800 Subject: [PATCH 260/290] PRF @geekpi --- ...one on Linux with this open source tool.md | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) diff --git a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md b/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md index e10a8683ef..2591119641 100644 --- a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md +++ b/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md @@ -3,45 +3,45 @@ [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 用这个开源工具在 Linux 上访问你的 iPhone ====== -过使用 Libimobiledevice 从 Linux 与 iOS 设备进行通信。 -![A person looking at a phone][1] -iPhone 和 iPad 决不是开源的,但它们是流行的设备。许多拥有 iOS 备的人恰好也在使用大量的开源,包括 Linux。Windows 和 macOS 的用户可以通过使用苹果提供的软件与 iOS 设备通信,但苹果不支持 Linux 用户。开源程序员早在 2007 年(就在 iPhone 发布一年后)就以 Libimobiledevice(当时叫 libiphone)来拯救了人们,这是一个与 iOS 通信的跨平台解决方案。它可以在 Linux、Android、Arm 系统(如 Raspberry Pi)、Windows、甚至 macOS 上运行。 +> 通过使用 Libimobiledevice 从 Linux 与 iOS 设备进行通信。 -Libimobiledevice 是用 C 语言编写的,使用原生协议与 iOS 设备上运行的服务进行通信。它不需要苹果公司的任何库,所以它是完全免费和开源的。 +![](https://img.linux.net.cn/data/attachment/album/202108/31/092907bc26qep3ekc73czl.jpg) -Libimobiledevice 是一个面向对象的 API,有许多终端工具与它捆绑在一起,以方便你使用。该库支持苹果最早的 iOS 设备,一直到其最新的型号。这是多年来研究和开发的结果。该项目中的应用包括 **usbmuxd**、**ideviceinstaller**、**idevicerestore**、**ifuse**、**libusbmuxd**、**libplist**、**libirecovery**、和 **libideviceactivation**。 +iPhone 和 iPad 绝不是开源的,但它们是流行的设备。许多拥有 iOS 备的人恰好也在使用大量的开源软件,包括 Linux。Windows 和 macOS 的用户可以通过使用苹果公司提供的软件与 iOS 设备通信,但苹果公司不支持 Linux 用户。开源程序员早在 2007 年(就在 iPhone 发布一年后)就以 Libimobiledevice(当时叫 libiphone)来拯救了人们,这是一个与 iOS 通信的跨平台解决方案。它可以在 Linux、Android、Arm 系统(如树莓派)、Windows、甚至 macOS 上运行。 + +Libimobiledevice 是用 C 语言编写的,使用原生协议与 iOS 设备上运行的服务进行通信。它不需要苹果公司的任何库,所以它完全是自由而开源的。 + +Libimobiledevice 是一个面向对象的 API,它捆绑了许多便于你使用的终端工具。该库支持苹果从最早到其最新的型号的 iOS 设备。这是多年来研究和开发的结果。该项目中的应用包括 `usbmuxd`、`ideviceinstaller`、`idevicerestore`、`ifuse`、`libusbmuxd`、`libplist`、`libirecovery` 和 `libideviceactivation`。 ### 在 Linux 上安装 Libimobiledevice -在 Linux 上,你可能已经默认安装了 **libimobiledevice**。你可以通过你的软件包管理器或应用商店找到,或者通过运行项目中包含的一个命令: - +在 Linux 上,你可能已经默认安装了 `libimobiledevice`。你可以通过你的软件包管理器或应用商店找到,或者通过运行项目中包含的一个命令: ``` -`$ ifuse --help` +$ ifuse --help ``` -你可以用你的包管理器安装 **libimobiledevice**。例如,在 Fedora 或 CentOS 上: - +你可以用你的包管理器安装 `libimobiledevice`。例如,在 Fedora 或 CentOS 上: ``` -`$ sudo dnf install libimobiledevice ifuse usbmuxd` +$ sudo dnf install libimobiledevice ifuse usbmuxd ``` 在 Debian 和 Ubuntu 上: ``` -`$ sudo apt install usbmuxd libimobiledevice6 libimobiledevice-utils` +$ sudo apt install usbmuxd libimobiledevice6 libimobiledevice-utils ``` -或者,你可以从源代码[下载][2]并安装 **libimobiledevice**。 +或者,你可以从源代码 [下载][2] 并安装 `libimobiledevice`。 ### 连接你的设备 @@ -49,41 +49,39 @@ Libimobiledevice 是一个面向对象的 API,有许多终端工具与它捆 为你的 iOS 设备建立一个目录作为挂载点。 - ``` -`$ mkdir ~/iPhone` +$ mkdir ~/iPhone ``` 接下来,挂载设备: - ``` -`$ ifuse ~/iPhone` +$ ifuse ~/iPhone ``` -你的设备提示你信任你用来访问它的电脑。 +你的设备提示你,是否信任你用来访问它的电脑。 ![iphone prompts to trust the computer][3] -图 1:iPhone 提示你要信任电脑。 +*图 1:iPhone 提示你要信任该电脑。* 信任问题解决后,你会在桌面上看到新的图标。 ![iphone icons appear on desktop][4] -图 2:iPhone 的新图标出现在桌面上。 +*图 2:iPhone 的新图标出现在桌面上。* -点击 **iPhone** 图标,显示出你的 iPhone 的文件夹结构。 +点击 “iPhone” 图标,显示出你的 iPhone 的文件夹结构。 ![iphone folder structure displayed][5] -图 3:显示了 iPhone 的文件夹结构。 +*图 3:显示了 iPhone 的文件夹结构。* -我通常最常访问的文件夹是 **DCIM**,那里存放着我的 iPhone 照片。有时我在写文章时使用这些照片,有时有一些照片我想用 Gimp 等开源应用来增强。可以直接访问这些图片,而不是通过电子邮件把它们发给我自己,这是使用 Libimobiledevice 工具的好处之一。我可以把这些文件夹中的任何一个复制到我的 Linux 电脑上。我也可以在 iPhone 上创建文件夹并删除它们。 +我通常最常访问的文件夹是 `DCIM`,那里存放着我的 iPhone 照片。有时我在写文章时使用这些照片,有时有一些照片我想用 GIMP 等开源应用来增强。可以直接访问这些图片,而不是通过电子邮件把它们发给我自己,这是使用 `libimobiledevice` 工具的好处之一。我可以把这些文件夹中的任何一个复制到我的 Linux 电脑上。我也可以在 iPhone 上创建文件夹并删除它们。 ### 发现更多 -[Martin Szulecki][6] 是该项目的首席开发者。该项目正在寻找开发者加入他们的[社区][7]。Libimobiledevice 可以改变你使用外设的方式,而无论你在什么平台上。这是开源的又一次胜利,这意味着它是所有人的胜利。 +[Martin Szulecki][6] 是该项目的首席开发者。该项目正在寻找开发者加入他们的 [社区][7]。Libimobiledevice 可以改变你使用外设的方式,而无论你在什么平台上。这是开源的又一次胜利,这意味着它是所有人的胜利。 -------------------------------------------------------------------------------- @@ -92,7 +90,7 @@ via: https://opensource.com/article/21/8/libimobiledevice-iphone-linux 作者:[Don Watkins][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From cbd1e35df002aed19be6291b8829ccdfdb334188 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 31 Aug 2021 09:30:23 +0800 Subject: [PATCH 261/290] PUB @geekpi https://linux.cn/article-13737-1.html --- ... Access your iPhone on Linux with this open source tool.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210823 Access your iPhone on Linux with this open source tool.md (98%) diff --git a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md b/published/20210823 Access your iPhone on Linux with this open source tool.md similarity index 98% rename from translated/tech/20210823 Access your iPhone on Linux with this open source tool.md rename to published/20210823 Access your iPhone on Linux with this open source tool.md index 2591119641..f864386b61 100644 --- a/translated/tech/20210823 Access your iPhone on Linux with this open source tool.md +++ b/published/20210823 Access your iPhone on Linux with this open source tool.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13737-1.html" 用这个开源工具在 Linux 上访问你的 iPhone ====== From d0b49412e0c3c4d1a6f60d443a03eea7800defa4 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Tue, 31 Aug 2021 11:51:39 +0800 Subject: [PATCH 262/290] translating by perfiffer --- .../tech/20210830 Write a guessing game in ncurses on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md index 06945c55da..5be4fe1be9 100644 --- a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md +++ b/sources/tech/20210830 Write a guessing game in ncurses on Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/guess-number-game-ncurses-linux" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d3881f4bc1bfb9173b2bd79688fce7c2619e49a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E4=B9=9D?= <2220238842@qq.com> Date: Tue, 31 Aug 2021 23:24:20 +0800 Subject: [PATCH 263/290] Update 20210821 10 Things to Do After Installing elementary OS 6 -Odin.md --- ... 10 Things to Do After Installing elementary OS 6 -Odin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md index b510e84de4..910bf3ad32 100644 --- a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ b/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -2,7 +2,7 @@ [#]: via: "https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/" [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "anine09" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -167,7 +167,7 @@ via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary 作者:[Arindam][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[anine09](https://github.com/anine09) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From bc8bb3493728b1adba7ac33717f5d592b4da05e9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Sep 2021 05:03:08 +0800 Subject: [PATCH 264/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?Ubuntu=20Server=20vs=20Desktop:=20What=E2=80=99s=20the=20Differ?= =?UTF-8?q?ence=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md --- ...erver vs Desktop- What-s the Difference.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md diff --git a/sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md b/sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md new file mode 100644 index 0000000000..603df9ea8f --- /dev/null +++ b/sources/tech/20210901 Ubuntu Server vs Desktop- What-s the Difference.md @@ -0,0 +1,131 @@ +[#]: subject: "Ubuntu Server vs Desktop: What’s the Difference?" +[#]: via: "https://itsfoss.com/ubuntu-server-vs-desktop/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ubuntu Server vs Desktop: What’s the Difference? +====== + +When you click on the download button on the [Ubuntu website][1], it gives you a few options. Two of them are Ubuntu Desktop and Ubuntu Server. + +This could confuse new users. Why are there two (actually 4 of them)? Which one should be downloaded? Ubuntu desktop or server? Are they the same? What is the difference? + +![Ubuntu website gives you multiple options][2] + +I am going to explain the difference between the desktop and server editions of Ubuntu. I’ll also explain which variant you should be using. + +### Ubuntu desktop vs Ubuntu server + +![Ubuntu desktop and server illustartion][3] + +To understand the difference between Ubuntu desktop and server, you should understand the difference between a desktop and a server operating system. + +#### Desktop + +A desktop is referred to a personal computer. A desktop operating system comes with a graphical user interface so that the users can use their mouse and keyboard. The primary purpose of a desktop is to give you a system that can be used for web browsing, document editing, viewing/editing pictures and videos, coding and gaming. Basically, a general purpose computer for individuals, end users, or family members. + +I am using the term desktop here, but this does not mean that it cannot be used on a laptop. Desktop is the generic term for a personal computer. + +#### Server + +On the other hand, a server operating system is specifically created for hosting web services like websites, apps, media servers, databases etc. + +Usually, a server operating system does not come with a graphical interface. If it is Linux based operating system, you’ll have to use the system entirely via commands in terminal. + +The advantage here is that the server OS do not need a lot of RAM and computational power because they do not use [graphical desktop environment][4]. Apart from that, the server operating system has packages configured differently as well. + +Now that you understand the difference between server and desktop a little, let’s see the difference between Ubuntu server and desktop. + +#### The user interface + +The most visible difference between Ubuntu server and desktop is the user interface. + +Ubuntu desktop features a graphical user interface with GNOME desktop environment. This makes it easier to use with the help of mouse clicks. + +![User interface of Ubuntu GNOME edition][5] + +Ubuntu server edition runs headless. You will only see a terminal interface when you are logged in to it. You’ll often manage it remotely from other computers overs SSH. + +![Connecting to remote Ubuntu server via SSH][6] + +#### Installation + +[Installing Ubuntu as a desktop is easy][7] thanks to the graphical installer. You can create a live USB and experience the desktop version without installing. If you like it, you can install it in minutes following the on-screen instructions. + +![Installing Ubuntu desktop via graphical installer][8] + +Installing Ubuntu as a server is not as easy as the desktop edition. You are stuck with terminal interface. Even the simplest tasks like connecting to Wi-Fi could be a difficult task if you are not familiar with the procedure. + +![Ubuntu server installation][9] + +#### Applications + +The default set of applications in Ubuntu desktop is focused on regular computer users. So, you’ll find web browsers, office suite, media players, games etc. + +![Applications in Ubuntu][10] + +Ubuntu server has applications that are more tailored for running web services. And that’s not it. Some applications are also configured differently. Take SSH for example. Ubuntu server has SSH preconfigured so that you can easily connect to it from remote systems. You have to explicitly enable SSH on Ubuntu desktop. + +#### Hardware requirement + +Since the desktop edition features a graphical user interface, you need at least 4 GB of RAM to run Ubuntu desktop. Disk space should be 20 GB at least. + +This is where it gets interesting for Ubuntu server. It does not have a graphical interface. The command line interface does not consume a lot of system resources. As a result, you can easily run Ubuntu server on a machine with 512 MB and 5 GB of disk space. + +The RAM and disk space on the server is subjected to the web service you run. If a web application requires at least 2 GB of RAM, you should have that much of RAM. But in the simplest of scenario, even 512 MB or 1 GB of RAM could work. + +#### Usage + +This is the main differentiator between Ubuntu desktop and server. Ask yourself, for what purpose you want to use Ubuntu? + +If it is specifically for deploying web services, go for Ubuntu server. Keep in mind that you need to have basic Linux command line knowledge to navigate through the terminal. + +If you want to use Ubuntu as a regular computer like Windows, go with Ubuntu desktop. If you want to use it for learning Linux commands, Docker or even simple (but local) LAMP server installation for learning, stay with Ubuntu desktop. + +For a server, Ubuntu server is better than Ubuntu desktop. For regular computing usage, Ubuntu desktop is the better choice. + +#### Should you use Ubuntu desktop for server or install GUI on server? + +Here’s the thing. Both Ubuntu desktop and server are Linux. You can use Ubuntu desktop as server for hosting web services. That works. + +Similarly, [you can install GUI on Ubuntu server][11] and use it graphically. That also works. + +![GUI login on an Ubuntu server][12] + +But just because it works, doesn’t mean you should do it. It defies the entire purpose of creating different editions for server and desktop. + +You have to put extra effort in converting a server to desktop and vice versa. Why take that pain? + +If your purpose of using Ubuntu is clear, download and install the appropriate Ubuntu edition. + +_**I hope this makes things around Ubuntu desktop and server editions a bit more clear now. If you have questions or suggestions, please utilize the comment section.**_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ubuntu-server-vs-desktop/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://ubuntu.com/ +[2]: https://itsfoss.com/wp-content/uploads/2021/08/ubuntu-server-desktop-download-800x338.webp +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ubuntu-desktop-server.png?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/what-is-desktop-environment/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop.png?resize=792%2C597&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/system-restart-required.png?resize=800%2C469&ssl=1 +[7]: https://itsfoss.com/install-ubuntu/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/installing-ubuntu.png?resize=800%2C549&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/ubuntu-server-installation.png?resize=800%2C600&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/09/gnome-app-arranger.jpg?resize=799%2C450&ssl=1 +[11]: https://itsfoss.com/install-gui-ubuntu-server/ +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/installing-gui-ubuntu-server-gnome-desktop-greet.png?resize=798%2C600&ssl=1 From 355185734c891de0d61e3a3a42cdb1d4e5681154 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Sep 2021 05:03:31 +0800 Subject: [PATCH 265/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831=20?= =?UTF-8?q?What=20is=20a=20container=20image=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210831 What is a container image.md --- .../20210831 What is a container image.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20210831 What is a container image.md diff --git a/sources/tech/20210831 What is a container image.md b/sources/tech/20210831 What is a container image.md new file mode 100644 index 0000000000..3d96567fc8 --- /dev/null +++ b/sources/tech/20210831 What is a container image.md @@ -0,0 +1,126 @@ +[#]: subject: "What is a container image?" +[#]: via: "https://opensource.com/article/21/8/container-image" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is a container image? +====== +A container image contains a packaged application, along with its +dependencies, and information on what processes it runs when launched. +![Shipping containers stacked][1] + +Containers are a critical part of today's IT operations. A _container image_ contains a packaged application, along with its dependencies, and information on what processes it runs when launched. + +You create container images by providing a set of specially formatted instructions, either as commits to a registry or as a Dockerfile. For example, this Dockerfile creates a container for a PHP web application: + + +``` +FROM registry.access.redhat.com/ubi8/ubi:8.1 + +RUN yum --disableplugin=subscription-manager -y module enable php:7.3 \ +  && yum --disableplugin=subscription-manager -y install httpd php \ +  && yum --disableplugin=subscription-manager clean all + +ADD index.php /var/www/html + +RUN sed -i 's/Listen 80/Listen 8080/' /etc/httpd/conf/httpd.conf \ +  && sed -i 's/listen.acl_users = apache,nginx/listen.acl_users =/' /etc/php-fpm.d/www.conf \ +  && mkdir /run/php-fpm \ +  && chgrp -R 0 /var/log/httpd /var/run/httpd /run/php-fpm \ +  && chmod -R g=u /var/log/httpd /var/run/httpd /run/php-fpm + +EXPOSE 8080 +USER 1001 +CMD php-fpm & httpd -D FOREGROUND +``` + +Each instruction in this file adds a _layer_ to the container image. Each layer only adds the difference from the layer below it, and then, all these layers are stacked together to form a read-only container image. + +### How does that work? + +You need to know a few things about container images, and it's important to understand the concepts in this order: + + 1. Union file systems + 2. Copy-on-Write + 3. Overlay File Systems + 4. Snapshotters + + + +### Union File Systems (Aufs) + +The Union File System (UnionFS) is built into the Linux kernel, and it allows contents from one file system to be merged with the contents of another, while keeping the "physical" content separate. The result is a unified file system, even though the data is actually structured in branches. + +The idea here is that if you have multiple images with some identical data, instead of having this data copied over again, it's shared by using something called a _layer_. + +![UnionFS][2] + +Image CC BY-SA opensource.com + +Each layer is a file system that can be shared across multiple containers, e.g., The httpd base layer is the official Apache image and can be used across any number of containers. Imagine the disk space we just saved since we are using the same base layer for all our containers. + +These image layers are always read-only, but when we create a new container from this image, we add a thin writable layer on top of it. This writable layer is where you create/modify/delete or make other changes required for each container. + +### Copy-on-write + +When you start a container, it appears as if the container has an entire file system of its own. That means every container you run in the system needs its own copy of the file system. Wouldn't this take up a lot of disk space and also take a lot of time for the containers to boot? No—because every container does not need its own copy of the filesystem! + +Containers and images use a copy-on-write mechanism to achieve this. Instead of copying files, the copy-on-write strategy shares the same instance of data to multiple processes and copies only when a process needs to modify or write data. All other processes would continue to use the original data. Before any write operation is performed in a running container, a copy of the file to be modified is placed on the writeable layer of the container. This is where the _write_ takes place. Now you know why it's called _copy-on-write_. + +This strategy optimizes both image disk space usage and the performance of container start times and works in conjunction with UnionFS. + +### Overlay File System + +An overlay sits on top of an existing filesystem, combines an upper and lower directory tree, and presents them as a single directory. These directories are called _layers_. The lower layer remains unmodified. Each layer adds only the difference (the _diff_, in computing terminology) from the layer below it, and this unification process is referred to as a _union mount_. + +The lowest directory or an Image layer is called _lowerdir_, and the upper directory is called _upperdir_. The final overlayed or unified layer is called _merged._ + +![Layered file system][3] + +Image CC BY-SA opensource.com + +Common terminology consists of these layer definitions: + + * Base layer is where the files of your filesystem are located. In terms of container images, this layer would be your base image. + * Overlay layer is often called the _container layer_, as all the changes that are made to a running container, as adding, deleting, or modifying files, are written to this writable layer. All changes made to this layer are stored in the next layer, and is a _union_ view of the Base and Diff layers. + * Diff layer contains all changes made in the Overlay layer. If you write something that's already in the Base layer, then the overlay file system copies the file to the Diff layer and makes the modifications you intended to write. This is called a _copy-on-write_. + + + +# Snapshotters + +Containers can build, manage, and distribute changes as a part of their container filesystem using layers and graph drivers. But working with graph drivers is really complicated and is error-prone. SnapShotters are different from graph drivers, as they have no knowledge of images or containers. + +Snapshotters work very similar to Git, such as the concept of having trees, and tracking changes to trees for each commit. A _snapshot_ represents a filesystem state. Snapshots have parent-child relationships using a set of directories. A _diff can_ be taken between a parent and its snapshot to create a layer. + +The Snapshotter provides an API for allocating, snapshotting, and mounting abstract, layered file systems. + +### Wrap up + +You now have a good sense of what container images are and how their layered approach makes containers portable. Next up, I'll cover container runtimes and internals. + +* * * + +_This article is based on a [techbeatly][4] article and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/container-image + +作者:[Nived V][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/nivedv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bus-containers.png?itok=d_4QhZxT (Shipping containers stacked) +[2]: https://opensource.com/sites/default/files/unionfs.png (UnionFS) +[3]: https://opensource.com/sites/default/files/rect1036.png (Layered file system) +[4]: https://medium.com/techbeatly/container-part-ii-images-4f2139194775 From 610cd01cb58d50c8bedd099b0bed823c2054b9b1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Sep 2021 05:03:46 +0800 Subject: [PATCH 266/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831=20?= =?UTF-8?q?How=20my=20team=20built=20an=20open=20source=20learning=20exper?= =?UTF-8?q?ience=20platform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210831 How my team built an open source learning experience platform.md --- ...pen source learning experience platform.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/tech/20210831 How my team built an open source learning experience platform.md diff --git a/sources/tech/20210831 How my team built an open source learning experience platform.md b/sources/tech/20210831 How my team built an open source learning experience platform.md new file mode 100644 index 0000000000..b9a8cc6dbc --- /dev/null +++ b/sources/tech/20210831 How my team built an open source learning experience platform.md @@ -0,0 +1,64 @@ +[#]: subject: "How my team built an open source learning experience platform" +[#]: via: "https://opensource.com/article/21/8/open-source-lms" +[#]: author: "Tesh Patel https://opensource.com/users/tesh" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How my team built an open source learning experience platform +====== +Open source powers innovation through community and shared experiences. +![Student desk for open education][1] + +Learning is based on the open exchange of ideas and experiences. By sharing, testing, and practicing what we've learned with others, we're able to develop in our lives and careers. It follows that openness is the ideal state for any successful learning organization.  + +I am passionate about learning, building teams, and technology. At Red Hat, we believe that open source powers innovation and results in better solutions. Five years ago, our learning management system was proprietary and closed. All of our learning platforms existed as islands with limited integration and provided a mediocre user experience. Over the past five years, our team has embraced the open source ethos. We've built and implemented new open source platforms, integrated our disparate learning platforms allowing us to freely exchange data and create a superior user experience. + +If you're a fellow member of a learning organization, I hope you might find it helpful to hear about our experience so far and perhaps even join us as we seek to influence the future of learning.  + +### Unlocking potential + +Our previous LMS served as the primary back-office system, system of record, and front-end experience for our learners. To put it plainly, it didn't serve any of those functions well. Our data was locked up in the vendor's vault. We had to live with the LMS's limited reporting capability or extract the data and manually manipulate it in spreadsheets. Perhaps worst of all, our learners faced a mediocre front-end system with a less-than-intuitive user experience. To live with our LMS, we had to create inefficient processes and workarounds. + +And so, in 2016, we began our journey to open source learning by replacing our proprietary LMS with [Totara Learn, an open source LMS][2].  + +By moving to Totara Learn, we unlocked our data and turned our attention to improving the user experience for our learners.  + +### Identifying the ecosystem + +Our learning ecosystem consists of more than just an LMS. In addition to our own content, we have access to content from third-party libraries, user-generated video content, virtual classroom tools for delivering online classes, and virtualized labs. + +We knew we needed a single interface to disguise our complex learning platforms and tools and deliver one seamless experience to the learner. Initially, we tried customizing Totara Learn for this purpose. It's a great platform, but we eventually realized it wasn't cost-effective for us to remodel it from the ground up. What we needed was a platform designed for our unique requirements. + +### Focusing on the learner + +In 2017, as my team pondered our learning ecosystem challenges, an emerging category of products called learning experience platforms (LXP) emerged. I found several LXP vendors who claimed to solve problems with the learning experience. Many described their platform's experience as the "Netflix of learning."  + +In my experience, I've found that learning isn't suited to a Netflix-like environment. The notion of randomly perusing learning, enrolling in a program, and then abandoning as it gets more challenging or less interesting—as you do with Netflix shows—is the antithesis of what our continuous learning philosophy encourages. Real learning that builds skills and capabilities requires an intentional focus and an ongoing commitment with a learn, practice, reflection, feedback loop.  + +As my team compiled the requirements for an LXP, we quickly realized we were just at the beginning of determining what we'd need to build to create the best learning experience for our users. The requirements would continue to grow and evolve, so we needed a platform that could do the same. The idea for the Open Learning Platform (OLP) was born. + +### Our open invitation + +The OLP is a learning experience platform (LXP) that provides a personalized, online learning experience for users—typically employees at large enterprises. It consolidates disparate learning resources into a single portal. These days, learning can happen anywhere and in many forms. An LXP helps employees discover learning opportunities—offering ways to enhance them and manages their education. We've spent three years developing and building the OLP to meet the learning needs of users and educators. The OLP has come a long way, but we also know we're very much still on the journey.  + +Since the inception of the OLP, we knew we wanted it to be an open source project. Why invest time and energy in open sourcing the platform we've built over several years? Simple. We want to learn from the experiences and innovation of others and form a community that will help determine what the LMS and LXP of the future should be. We want to move past a cost-per-user licensing model and the limitations in thinking when the sole focus is to monetize a product. If even one other learning organization benefits from our open source project, then it will have been worth the investment of our time. We welcome you to join the conversation at[ Open Learning Platform][3]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/open-source-lms + +作者:[Tesh Patel][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/tesh +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolseriesgen_rh_032x_0.png?itok=cApG9aB4 (Student desk for open education) +[2]: https://github.com/totara +[3]: https://www.openlearningplatform.org/ From 8e88814b1550b52a4fb70d16d1c854f9a19fe56d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 1 Sep 2021 05:06:20 +0800 Subject: [PATCH 267/290] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210831=20?= =?UTF-8?q?Ransomware=20Disguised=20as=20Open-Source=20Krita=20Painting=20?= =?UTF-8?q?App=20Promo=20Video?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md --- ...n-Source Krita Painting App Promo Video.md | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md diff --git a/sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md b/sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md new file mode 100644 index 0000000000..80108b8fde --- /dev/null +++ b/sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md @@ -0,0 +1,76 @@ +[#]: subject: "Ransomware Disguised as Open-Source Krita Painting App Promo Video" +[#]: via: "https://news.itsfoss.com/krita-email-scam/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ransomware Disguised as Open-Source Krita Painting App Promo Video +====== + +Ransomware attacks are exponentially increasing. And, the way it gets distributed evolves every day. + +One of the most effective ways is by using reputable brand names to lure users into downloading malicious files that may end up encrypting your files and demand a ransom. + +And, in this case, some scammers have started using Krita’s name to deceive users through email. + +### Spreading Malware via Email as Krita Officials + +The attackers disguise themselves as the team for Krita, one of the best [digital open-source painting app][1]. + +The email mentions that Krita wants to collaborate with your YouTube channel or your social media space to share promotional videos about their software/product. + +And, they mention that this is a paid advertising campaign, so you think you are getting a reward for promoting Krita. + +Here’s how the email looks like (as shared by [Krita on Twitter][2]): + +![][3] + +Once you show interest in promoting Krita, they send you a follow-up mail instructing you to download a press kit containing screenshots, videos, and other materials. + +The link may look similar to the official one like _krita.io, krita.net_, etc. + +In a detailed video shared by a Twitter user, you can see that the link they share is malicious and sometimes goes undetected by Google’s safe browsing feature: + +> Recently, I received the same email. Though I know this is likely a scam, I decided to proceed further just to see how far will they take us. They asked me to download some files and you can watch the full video here: [pic.twitter.com/P1K2tlHiT4][4] +> +> — Inside Electronics (@InsideElectro) [August 29, 2021][5] + +While I agree that this is not the best attempt to distribute malware, not everyone is as attentive as this user here. + +### Never Trust an Email Without Proper Verification + +It is easy for attackers to send you emails that you expect or something that may spark an interest in your work. + +Scammers do their homework to know what you like, but always stay cautious no matter what or who appears to be sending the email. + +If an email explicitly asks to enter your personal information, download an attachment, or visit a website to download a file, you need to double-check if it comes from an official source. + +Generally, officials do not ask you to download any file or personal information unless you took action first. So, it is always wise to think twice and run a background check for what you interact with via emails. + +#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! + +If you like what we do here at It's FOSS, please consider making a donation to support our independent publication. Your support will help us keep publishing content focusing on desktop Linux and open source software. + +I'm not interested + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/krita-email-scam/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/open-source-paint-apps/ +[2]: https://twitter.com/Krita_Painting/status/1432295734074880003 +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI3OSIgd2lkdGg9IjU4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://t.co/P1K2tlHiT4 +[5]: https://twitter.com/InsideElectro/status/1431938502862663680?ref_src=twsrc%5Etfw From e7e17c019315d4f1da17dfa58024eb2f131486f1 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Wed, 1 Sep 2021 08:30:06 +0800 Subject: [PATCH 268/290] translating by perfiffer --- ...210829 Position text on your screen in Linux with ncurses.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md index 997ce16c43..644d88a9ff 100644 --- a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md +++ b/sources/tech/20210829 Position text on your screen in Linux with ncurses.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/ncurses-linux" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 6e3511a65dc9a24697e8f0ebedcc1bb8e3449fb4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 1 Sep 2021 08:39:12 +0800 Subject: [PATCH 269/290] translated --- ...ux kernel modules we can-t live without.md | 121 ----------------- ...ux kernel modules we can-t live without.md | 122 ++++++++++++++++++ 2 files changed, 122 insertions(+), 121 deletions(-) delete mode 100644 sources/tech/20210827 Linux kernel modules we can-t live without.md create mode 100644 translated/tech/20210827 Linux kernel modules we can-t live without.md diff --git a/sources/tech/20210827 Linux kernel modules we can-t live without.md b/sources/tech/20210827 Linux kernel modules we can-t live without.md deleted file mode 100644 index 82d66505d7..0000000000 --- a/sources/tech/20210827 Linux kernel modules we can-t live without.md +++ /dev/null @@ -1,121 +0,0 @@ -[#]: subject: "Linux kernel modules we can't live without" -[#]: via: "https://opensource.com/article/21/8/linux-kernel-module" -[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linux kernel modules we can't live without -====== -Open source enthusiasts weigh in on the Linux kernel modules they love. -![Linux keys on the keyboard for a desktop computer][1] - -The Linux kernel is turning 30 this year! If you're like us, that's a big deal and we are celebrating Linux this week with a couple of special posts. - -Today we start with a roundup of responses from around the community answering "What Linux kernel module can you not live without? And, why?" Let's hear what these 10 enthusiasts have to say. - -* * * - -I guess some kernel developers will run away screaming when they hear my answer. Still, I list here two of the most controversial modules: - - * First is NVIDIA, as I have an NVIDIA graphics card on my work laptop and my personal desktop. - * The other one probably generates less hatred—the VMNET and VMMON modules from VMware to be able to run VMware Workstation. —[Peter Czanik][2] - - - -* * * - -My favorite is the [zram][3] module. It creates a compressed block device in memory, which can then be used as a swap partition. Using a zram-based swap partition is ideal when memory is limited (for example, on virtual machines) and if you are worried about wearing out your SSD or, even worse, your flash-based storage because of frequent I/O operations. —[Stephan Avenwedde][4] - -* * * - -The most useful kernel module is definitively snd-hda-intel since it supports most integrated sound cards. I listen to music while coding an audio sequencer on the Linux desktop. —[Joël Krähemann][5] - -* * * - -My laptop would be worthless without the kmod-wl that I generate with the Broadcom file. I sometimes get messages about tainting the kernel, but what good is a laptop without wireless? —[Gregory Pittman][6] - -* * * - -I can't live without Bluetooth. Without it, my mouse, keyboard, speakers, and headset would be doorstops. —[Gary Smith][7] - -* * * - -I'm going to go out on a limb and say _all of them_. Seriously, we've gotten to the point where I grab a random piece of hardware, plug it in, and it just works. - - * USB serial adapter just works - * Video card just works (though maybe not at its best) - * Network card just works - * Sound card just works - - - -It's tough not to be utterly impressed with the broad scope of the driver work that all the modules bring to the whole. I remember the bad old days when we used to yell out xrandr magic strings to make projectors work, and now—yeah, it's a genuine rarity when stuff doesn't (mostly) just work. - -If I had to nail it down to one, though, it'd be raid6. —[John 'Warthog9' Hawley][8] - -* * * - -I'm going to go back to the late 1990s for this one. I was a Unix systems administrator (and double duty as IS manager) for a small company. Our tape backup system died, and because of "small company" limited budgets, we didn't have a rush replacement or onsite repair on it. So we had to send it in for repair. - -During those two weeks, we didn't have a way to make tape backups. No systems administrator wants to be in that position. - -But then I remembered reading the [Floppy Tape How-to][9], and we happened to have a tower PC we'd just replaced that had a floppy tape drive. - -So I reinstalled it with Linux, set up the **ftape** kernel driver module, ran a few backup/recovery tests, then ran our most important backups to QIC tapes. For those two weeks, we relied on **ftape** backups of critical data. - -So to the unsung hero out there who made floppy tape drives work on 1990s Linux, you are awesome! —[Jim Hall][10] - -* * * - -Well, that's easy. It's the kvm kernel modules. On a personal front, I cannot imagine doing my day-to-day work without VMs. I'd like to believe that's the case with most of us. The kvm modules also play a big part in making Linux central to the cloud strategy. —[Gaurav Kamathe][11] - -* * * - -For me, it's dm-crypt, which is used for LUKS. See: - - * - * - - - -It's fantastic to know others cannot see what's on your disk, for example, if you lose your notebook or it gets stolen. —[Maximilian Kolb][12] - -* * * - -For cryptography basics, it's hard to beat the crypto module and its C API, which is straightforward. - -For day-to-day life, is there anything more valuable than the plug-and-play that Bluetooth provides? —[Marty Kalin][13] - -* * * - -Share with us in the comments: What Linux kernel module can you not live without? - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/linux-kernel-module - -作者:[Jen Wike Huger][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://opensource.com/users/jen-wike -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) -[2]: https://opensource.com/users/czanik -[3]: https://en.wikipedia.org/wiki/Zram -[4]: https://opensource.com/users/hansic99 -[5]: https://opensource.com/users/joel2001k -[6]: https://opensource.com/users/greg-p -[7]: https://opensource.com/users/greptile -[8]: https://opensource.com/users/warthog9 -[9]: https://tldp.org/HOWTO/Ftape-HOWTO.html -[10]: https://opensource.com/users/jim-hall -[11]: https://opensource.com/users/gkamathe -[12]: https://opensource.com/users/kolb -[13]: https://opensource.com/users/mkalindepauledu diff --git a/translated/tech/20210827 Linux kernel modules we can-t live without.md b/translated/tech/20210827 Linux kernel modules we can-t live without.md new file mode 100644 index 0000000000..88935c79b5 --- /dev/null +++ b/translated/tech/20210827 Linux kernel modules we can-t live without.md @@ -0,0 +1,122 @@ +[#]: subject: "Linux kernel modules we can't live without" +[#]: via: "https://opensource.com/article/21/8/linux-kernel-module" +[#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +我们离不开的 Linux 内核模块 +====== +开源爱好者们对他们所喜爱的 Linux 内核模块进行了评价。 +![Linux keys on the keyboard for a desktop computer][1] + +Linux 内核今年就要满 30 岁了! 如果你像我们一样,这是件大事,我们本周将用几个特别的帖子来庆祝 Linux。 + +今天,我们先来看看来自社区的回复,回答“你不能没有哪个 Linux 内核模块?为什么?”让我们听听这 10 位爱好者是怎么说的。 + +* * * + +我猜一些内核开发者听到我的回答后会尖叫着跑开。不过,我还是在这里列出了两个最具争议性的模块“ + + * 第一个是 NVIDIA,因为我的工作笔记本和个人台式机上都有 NVIDIA 显卡。 + * 另一个可能产生的仇恨较少。VMware 的 VMNET 和 VMMON 模块,以便能够运行 VMware Workstation。—[Peter Czanik][2] + + + +* * * + +我最喜欢的是 [zram][3] 模块。它在内存中创建了一个压缩块设备,然后可以作为交换分区使用。在内存有限的情况下(例如,在虚拟机上),还有如果你担心频繁的 I/O 操作会磨损你的 SSD 或者甚至更糟糕的是基于闪存的存储,那么使用基于 zram 的交换分区是非常理想的。—[Stephan Avenwedde][4] 。 + +* * * + +最有用的内核模块无疑是 snd-hda-intel,因为它支持大多数集成声卡。我一边听音乐,一边在 Linux 桌面上编码一个音频编曲器。—[Joël Krähemann][5] + +* * * + +如果没有我用 Broadcom 文件生成的 kmod-wl,我的笔记本就没有价值了。我有时会收到关于内核污染的信息,但没有无线的笔记本电脑有什么用呢?—[Gregory Pittman][6] 。 + +* * * + +我不能没有蓝牙。没有它,我的鼠标、键盘、扬声器和耳机就成了门板。—[Gary Smith][7] + +* * * + +我要冒昧地说_所有这些_都是。 说真的,我们已经到了随机拿一块硬件,插入它,它就可以工作的地步。 + + * USB 串行适配器能正常工作 + * 显卡可以使用(尽管可能不是最好的)。 + * 网卡正常工作 + * 声卡正常工作 + + + +很难不对所有模块为整体带来的广泛的驱动程序工作印象深刻。我记得在过去的坏日子里,我们曾经大喊 xrandr 魔法字符串来使投影仪工作。而现在,是的,当东西(大部分)不能正常工作时,这是一种真正的罕见。 + +如果我不得不把它归结为一个,那就是 raid6。—[John 'Warthog9' Hawley][8] + +* * * + +对于这个问题,我想回到 20 世纪 90 年代末。我是一家小公司的 Unix 系统管理员(兼任 IS 经理)。我们的磁带备份系统死了,由于“小公司”预算有限,我们没有急于更换或现场维修。所以我们不得不把它送去维修。 + +在那两个星期里,我们没有办法进行磁带备份。没有一个系统管理员愿意处于这种境地。 + +但后来我想起了读过的[如何使用软盘磁带机][9],我们刚好有一台刚换下来的塔式电脑,有一个软磁带驱动器。 + +于是我用 Linux 重新安装了它,设置了 **ftape** 内核驱动模块,进行了一些备份/恢复测试,然后将我们最重要的备份运行到 QIC 磁带上。在这两个星期里,我们依靠 **ftape** 备份重要数据。 + +所以,对于那些让软盘磁带机在 1990 年代的 Linux 上工作的无名英雄,你真是太厉害了!—[Jim Hall][10] + +* * * + +嗯,这很简单。是 kvm 内核模块。在个人方面,我无法想象在没有虚拟机的情况下做我的日常工作。我愿意相信我们大多数人都是这样。kvm 模块在使 Linux 成为云战略的核心方面也发挥了很大作用。—[Gaurav Kamathe][11] + +* * * + +对我来说,是 dm-crypt,它是用于 LUKS 的。见: + + * + * + + + +知道别人无法看到你的磁盘上的内容是非常棒的,例如,如果你的笔记本丢失或被盗时。—[Maximilian Kolb][12] + + +* * * + +对于密码学基础,很难超越 crypto 模块和它的 C API,它很简单。 + +在日常生活中,还有什么比蓝牙提供的即插即用更有价值的吗?—[Marty Kalin][13] + +* * * + +在评论中与我们分享。你的生活中不能没有什么 Linux 内核模块? + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-kernel-module + +作者:[Jen Wike Huger][a] +选题:[lujun9972][b] +译者:[geekpi](https://github.com/geekpi) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/jen-wike +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/linux_keyboard_desktop.png?itok=I2nGw78_ (Linux keys on the keyboard for a desktop computer) +[2]: https://opensource.com/users/czanik +[3]: https://en.wikipedia.org/wiki/Zram +[4]: https://opensource.com/users/hansic99 +[5]: https://opensource.com/users/joel2001k +[6]: https://opensource.com/users/greg-p +[7]: https://opensource.com/users/greptile +[8]: https://opensource.com/users/warthog9 +[9]: https://tldp.org/HOWTO/Ftape-HOWTO.html +[10]: https://opensource.com/users/jim-hall +[11]: https://opensource.com/users/gkamathe +[12]: https://opensource.com/users/kolb +[13]: https://opensource.com/users/mkalindepauledu From b761522b35c29cfb1055e234e8aa292e9cbefa9f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 1 Sep 2021 08:40:02 +0800 Subject: [PATCH 270/290] Rename sources/tech/20210831 How my team built an open source learning experience platform.md to sources/talk/20210831 How my team built an open source learning experience platform.md --- ...w my team built an open source learning experience platform.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210831 How my team built an open source learning experience platform.md (100%) diff --git a/sources/tech/20210831 How my team built an open source learning experience platform.md b/sources/talk/20210831 How my team built an open source learning experience platform.md similarity index 100% rename from sources/tech/20210831 How my team built an open source learning experience platform.md rename to sources/talk/20210831 How my team built an open source learning experience platform.md From cc8dab102d67e966bc5389ac8daf6ebecdeac335 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 1 Sep 2021 08:42:45 +0800 Subject: [PATCH 271/290] translating --- ...31 Zulip- An Interesting Open-Source Alternative to Slack.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md index af9e6da063..973cf54ef5 100644 --- a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md +++ b/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/zulip/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From e86ec514a951c1a3123c6b0f6b3a03f651d2455f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 09:52:08 +0800 Subject: [PATCH 272/290] PRF @imgradeone --- ...n Review - Late Arrival but a Solid One.md | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index 9dc75059d3..600d8fcebd 100644 --- a/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -3,19 +3,22 @@ [#]: author: "Arindam https://www.debugpoint.com/author/admin1/" [#]: collector: "lujun9972" [#]: translator: "imgradeone" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -elementary OS 6 Odin 评测 – 迟到的新版本,但也实至名归 +elementary OS 6 Odin 评测:迟到的新版本,但也实至名归 ====== -> 这篇 elementary OS 6 的评测将为您呈现该系统在旧款测试设备上的表现。 + +> 这篇 elementary OS 6 的评测将为你呈现该系统在旧款测试设备上的表现。 + +![](https://img.linux.net.cn/data/attachment/album/202109/01/095116zk73wcc4g5clnvq8.jpg) elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近两年了。如此焦急的原因,主要在于早期版本 elementary OS 5.1 的内核和软件包在 2021 年来说过于陈旧。而且,这一旧版本基于 Ubuntu 18.04 LTS 构建。因此,用户都急切地等待着基于 Ubuntu 20.04 LTS 的全新版本 —— 最重要的是,Ubutnu 20.04 LTS 已经发布一年,接下来也将有下一个 LTS 版本发布。 你应该也明白的,过长的等待时间,很可能导致用户跳槽到其他发行版。 -但即便如此,新版本终于还是 [在 8 月发布了][1],它也在用户和粉丝群体中引起了很大的轰动。 +但即便如此,新版本终于还是 [在 8 月发布了][1],它在用户和粉丝群体很受欢迎。 于是,我在一周前为一台旧设备(我知道新设备的体验会更好)安装了 elementary OS 6 Odin,下面就是测评。 @@ -23,7 +26,7 @@ elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近 ### elementary OS 6 Odin 测评 -测试设备 +测试设备: * CPU – Intel Core i3,4 GB 运行内存 * 硬盘 – SSD 固态硬盘 @@ -31,23 +34,19 @@ elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近 #### 安装 -在这一版本中,elementary 团队针对 elementary OS 安装器做了易用性优化,而这一次的安装器也是自制安装器。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 +在这一版本中,elementary 团队针对他们自制的 elementary OS 安装器做了易用性优化。新安装器减少了安装前的准备步骤,虽然它还是需要依赖 GParted 进行分区操作(当然 GParted 本身是一款不错的工具)。 -在前述测试设备中,安装过程大约花费了 10 分钟,没有任何报错。初始化之后,GRUB 也正常更新,没有任何意外。这是一个带有 Legacy BIOS 的三系统启动器。 - - +在前述测试设备中,安装过程大约花费了 10 分钟,没有任何报错。安装完之后,GRUB 也正常更新,没有任何意外。这是一个安装在老式 BIOS 上多引导系统。 #### 初见印象 -如果你刚听说 elementary OS 和 Pantheon 桌面,或者从其他传统菜单型桌面环境迁移过来,你可能需要一两天时间来适应这款桌面。当然,如果你已经是 elementary OS 的老用户的话,那么你将获得一致的体验,外加性能和外观的优化。 +如果你刚听说 elementary OS 和 Pantheon 桌面,或者从其他传统的菜单型桌面环境迁移过来,你可能需要一两天时间来适应这款桌面。当然,如果你已经是 elementary OS 的老用户的话,那么你将获得一致的体验,外加性能和外观的优化。 你应该可以察觉到一些明显可见的 [elementary OS 6 的新特性][3],像是强调色、原生暗黑模式,以及一组不错的新壁纸。 -[][4] - #### 稳定性与性能 -我已经使用 elementary OS 6 Odin 超过一周的时间。在日常使用后,我只能说,它很稳定,没有突然的崩溃和意外。其他额外软件(需要从 apt 独立安装)也运作正常,没有性能损耗。 +我已经使用 elementary OS 6 Odin 超过一周的时间。在日常使用后,我只能说,它很稳定,没有突然的崩溃和意外。其他(通过 `apt` 单独安装的)额外软件也运作正常,性能也没有降低。 在近乎闲置的情况下,CPU 使用率处在 5%-10% 之间,内存占用约为 900 MB。CPU / 内存的消耗主要分配在 Gala(Pantheon 的窗口管理器)、Wingpanel(顶栏)和应用中心。 @@ -57,13 +56,11 @@ elementary OS 的粉丝们焦急等待 elementary OS 6 Odin 发布已经将近 #### 应用程序与应用中心 -elementary OS 的应用程序列表经过精选,几乎所有类型的软件都可以从应用中心获取,包括 Flatpak 应用。不过,elementary OS 并没有预装一些重要的应用程序,像是 Firefox、LibreOffice、Torrent 客户端、硬盘分区工具、照片编辑器之类 —— 这些重要的程序需要在安装系统后再自行安装。我认为预装软件这一块有很大的改进空间。 +elementary OS 的应用程序列表经过精选,几乎所有类型的软件都可以从应用中心获取,包括 Flatpak 应用。不过,elementary OS 默认并没有预装一些重要的应用程序,像是 Firefox、LibreOffice、Torrent 客户端、硬盘分区工具、照片编辑器之类 —— 这些重要的程序需要在安装系统后再自行安装。我认为预装软件这一块有很大的改进空间。 ### 结束语 -在这一周的测试中,我也多次遇到了一个 bug,Wi-Fi 有时会突然断开,不过这完全是 Ubuntu 20.04 上游的问题 —— 多年以来,它一直有奇怪的 Wi-Fi 问题。抛开这个问题,elementary OS 确实是一款稳定、优秀的 Linux 发行版。如果 elementary OS 有滚动更新的版本,也许会更好。因此,这是一款值得推荐的发行版,尤其适合 macOS 的迁移者。 - -* * * +在这一周的测试中,我也多次遇到了一个 bug,Wi-Fi 有时会突然断开,不过这完全是上游 Ubuntu 20.04 的问题 —— 多年以来,它一直有奇怪的 Wi-Fi 问题。抛开这个问题,elementary OS 确实是一款稳定、优秀的 Linux 发行版。如果 elementary OS 有滚动更新的版本,也许会更好。因此,这是一款值得推荐的发行版,尤其适合那些从 macOS 迁移过来的人。 -------------------------------------------------------------------------------- @@ -71,8 +68,8 @@ via: https://www.debugpoint.com/2021/08/elementary-os-6-odin-review/ 作者:[Arindam][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[imgradeone](https://github.com/imgradeone) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c2d5bdc913a65424826e29ec74908cf92c812a3e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 09:52:56 +0800 Subject: [PATCH 273/290] PUB @imgradeone https://linux.cn/article-13739-1.html --- ...mentary OS 6 Odin Review - Late Arrival but a Solid One.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md (98%) diff --git a/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/published/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md similarity index 98% rename from translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md rename to published/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md index 600d8fcebd..906a2faf90 100644 --- a/translated/tech/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md +++ b/published/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "imgradeone" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13739-1.html" elementary OS 6 Odin 评测:迟到的新版本,但也实至名归 ====== From ec8f8a35a9c43ab60a3b1adc6fc8496e4cca8264 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 10:46:14 +0800 Subject: [PATCH 274/290] PRF @fisherue --- ...821 How to set up your printer on Linux.md | 56 +++++++++---------- 1 file changed, 25 insertions(+), 31 deletions(-) diff --git a/translated/tech/20210821 How to set up your printer on Linux.md b/translated/tech/20210821 How to set up your printer on Linux.md index 57929be7dc..382dd6908e 100644 --- a/translated/tech/20210821 How to set up your printer on Linux.md +++ b/translated/tech/20210821 How to set up your printer on Linux.md @@ -2,85 +2,79 @@ [#]: via: "https://opensource.com/article/21/8/add-printer-linux" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: "fisherue " -[#]: reviewer: " " +[#]: translator: "fisherue" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 如何在 Linux 系统设置打印机 ====== -如果系统没有自动检测到你的打印机,这篇文章教你任何在 Linux 系统手动添加打印机。 -![printing on Linux][1] -即使未来已来,电子墨水 (e-ink) 和 AR 技术可以现实应用,我们还是会用到打印机的。打印机制造商还不能做到让自己的专利打印机可以与各种计算机完全标准化传递信息,以至于我们需要各种打印机驱动程序,在任何操作系统上都是如此。电子电气工程师协会信息科学与技术处 (IEEE-ISTO) 下属的打印机工作组 (PWG) 和开放打印技术组织 (OpenPrinting.org) 长期合作致力于让人们可以(使用任何型号打印机)轻松打印。带来的便利就是,很多打印机可以不需要用户进行配置就可以自动被识别使用。 +> 如果系统没有自动检测到你的打印机,这篇文章教你如何在 Linux 系统手动添加打印机。 -如果系统没有自动检测到你的打印机,你可以在这篇文章中找到如何在 Linux 系统手动添加打印机。文中假定你使用的是 GNOME 图形桌面系统,其设置流程同样适用于 KDE 或其他多数桌面系统。 +![](https://img.linux.net.cn/data/attachment/album/202109/01/104541gvvxvriei677o76v.jpg) + +即使未来已来,电子墨水e-ink和 AR 技术可以现实应用,我们还是会用到打印机的。打印机制造商还不能做到让自己的专利打印机可以与各种计算机完全标准化传递信息,以至于我们需要各种打印机驱动程序,在任何操作系统上都是如此。电子电气工程师协会信息科学与技术处(IEEE-ISTO)下属的打印机工作组(PWG)和开放打印技术组织(OpenPrinting.org)长期合作致力于让人们可以(使用任何型号打印机)轻松打印。带来的便利就是,很多打印机可以不需要用户进行配置就可以自动被识别使用。 + +如果系统没有自动检测到你的打印机,你可以在这篇文章中找到如何在 Linux 系统手动添加打印机。文中假定你使用的是 GNOME 图形桌面系统,其设置流程同样适用于 KDE 或其他大多数桌面系统。 ### 打印机驱动程序 -在你尝试用打印机打印文件时,要先确认你的 Linux 系统上是不是已经安装了匹配的打印机驱动程序。 +在你尝试用打印机打印文件时,要先确认你的 Linux 系统上是不是已经安装了更新的打印机驱动程序。 可以尝试安装的打印机驱动程序有三大类: - * 在你的 Linux 系统作为安装包提供的开源打印机驱动程序 [Gutenprint drivers][2] + * 作为安装包提供的,捆绑在你的 Linux 系统上的开源 [Gutenprint 驱动程序][2] * 打印机制造商提供的专用驱动程序 * 第三方开发提供的打印机驱动程序 - - 开源打印机驱动程序库可以驱动 700 多种打印机,值得安装,这里面可能就有你的打印机的驱动,说不定可以自动设置好你的打印机(,你就可以使用它了)。 ### 安装开源驱动程序包(库) -有些 Linux 发行版已经预装了开源打印机驱动程序包,如果没有,你可以用包管理器来安装。比如说,在 Fedora, CentOS, Magela 等类似发行版的 Linux 系统上,执行下面命令来安装: - +有些 Linux 发行版已经预装了开源打印机驱动程序包,如果没有,你可以用包管理器来安装。比如说,在 Fedora、CentOS、Magela 等类似发行版的 Linux 系统上,执行下面命令来安装: ``` -`$ sudo dnf install gutenprint` +$ sudo dnf install gutenprint ``` -惠普 (HP) 系列的打印机,还需要安装惠普的 Linux 图形及打印系统软件包 (Hewlett-Packard's Linux Imaging and Printing (HPLIP) ). 类似 Debian, Linux Mint 等系列的系统,使用下面的命令: - +惠普(HP)系列的打印机,还需要安装惠普的 Linux 图形及打印系统软件包(HPLIP)。如在 Debian、Linux Mint 等类似的系统上,可以使用下面的命令: ``` -`$ sudo apt install hplip` +$ sudo apt install hplip ``` ### 安装制造商提供的驱动程序 -很多时候因为打印机制造商使用非标准的接口协议,这种情况开源打印机驱动程序就不能驱动打印机。另外的情况就是,开源驱动程序可以驱动打印机工作,但是会缺少品牌特有的有些性能。这些情况,你需要访问制造商的网站,找到适合你的打印机型号的 Linux 平台驱动。安装过程各异,仔细阅读安装指南逐步安装。 +很多时候因为打印机制造商使用了非标准的接口协议,这种情况开源打印机驱动程序就不能驱动打印机。另外的情况就是,开源驱动程序可以驱动打印机工作,但是会缺少供应商特有的某些性能。这些情况,你需要访问制造商的网站,找到适合你的打印机型号的 Linux 平台驱动。安装过程各异,仔细阅读安装指南逐步安装。 -即便是厂家的驱动也不能驱动你的打印机工作,你或许也只能尝试第三方提供的该型号打印机的驱动软件 ([third-party driver authors][3]) 了。这类第三方驱动程序不是开源的,和打印机专用驱动程序一样闭源。如果你需要额外花费 45 美元(约 400 员人民币)从供应商那里获取帮助服务才能安装好驱动并使用你的打印机,那是很心疼,或者你索性把这台打印机扔掉,至少你知道下次再也不会购买这个品牌的打印机了。(译者注:国内售后服务收费没有北美那么高,有需要还是先电话咨询售后,有没有 Linux 平台的专用驱动可真是碰运气。) +如果你的打印机根本不被厂商支持,你或许也只能尝试第三方提供的该型号打印机的驱动软件了。这类第三方驱动程序不是开源的,但大多数打印机的专用驱动程序也不是。如果你需要额外花费从供应商那里获取帮助服务才能安装好驱动并使用你的打印机,那是很心疼,或者你索性把这台打印机扔掉,至少你知道下次再也不会购买这个品牌的打印机了。 -### 统一接口打印驱动系统(CUPS) +### 通用打印驱动系统(CUPS) -统一接口打印驱动系统 (CUPS) 是由 Easy Software Products 公司于 1997 年开发的,2007 年被苹果公司 (Apple) 收购。这是 Linux 平台打印的开源基础软件包,很多改进的发行版本提供定制化的界面。得益于 CUPS 技术,你可以发使用通过 USB 接口连接到电脑的打印机,甚至连接在同一网络的共享打印机。 +通用打印驱动系统Common Unix Printing System(CUPS)是由 Easy Software Products 公司于 1997 年开发的,2007 年被苹果公司收购。这是 Linux 平台打印的开源基础软件包,大多数现代发行版都为它提供了一个定制化的界面。得益于 CUPS 技术,你可以发现通过 USB 接口连接到电脑的打印机,甚至连接在同一网络的共享打印机。 -一旦你安装了需要的驱动程序包,你就能手工添加你的打印机了。首先,把打印机连接到运行的电脑上,并打开打印机电源。然后从启动器 **(Activities**)或者应用列表中找到并打开打印机设置**(Printers)**。![printer settings][4] +一旦你安装了需要的驱动程序包,你就能手工添加你的打印机了。首先,把打印机连接到运行的电脑上,并打开打印机电源。然后从“活动”屏幕或者应用列表中找到并打开“打印机”设置。 -CC BY-SA Opensource.com +![printer settings][4] 基于你已经安装的驱动包,你的 Linux 系统有可能自动检测识别到你的打印机型号,不需要额外的设置就可以使用你的打印机了。 ![printer settings][5] -CC BY-SA Opensource.com - 一旦你在列表中找到你的打印机型号,设置使用这个驱动,恭喜你就可以在 Linux 系统上用它打印了。 -(如果你的打印机没有被自动识别,)你需要自行添加打印机。在打印机设置界面**(Printers)**,点击右上角的解锁按钮(**Unlock**),输入管理用户密码,按钮转换成**添加打印机**按钮 (**Add**) 。 +(如果你的打印机没有被自动识别,)你需要自行添加打印机。在“打印机”设置界面,点击右上角的解锁按钮,输入管理用户密码,按钮转换成“添加打印机”按钮。 -然后点击这个**添加打印机**按钮 (**Add**) ,电脑会搜索已经连接的本地打印机型号并匹配相应驱动程序。如果要添加网络共享打印机,在搜索框输入打印机或者其服务器机的 IP 地址。 +然后点击这个“添加打印机”按钮,电脑会搜索已经连接的本地打印机型号并匹配相应驱动程序。如果要添加网络共享打印机,在搜索框输入打印机或者其服务器机的 IP 地址。 ![searching for a printer][6] -CC BY-SA Opensource.com - -选中你想添加的打印机型号,点击**添加**按钮 (**Add**) 把打印机驱动加入系统,就可以使用它了。 +选中你想添加的打印机型号,点击“添加”按钮把打印机驱动加入系统,就可以使用它了。 ### 在 Linux 系统上打印 -在 Linux 系统上打印很容易,不管你是在使用本地打印机还是网络打印机。如果你计划购买打印机,建议查看开放打印技术组织的(可支持打印机)数据库 ( [OpenPrinting.org database][7] ) ,看看你想购买的打印机是不是有相应的开源驱动程序。如果你已经拥有一台打印机,你现在也知道怎样在你的 Linux 系统上使用你的打印机了。 +在 Linux 系统上打印很容易,不管你是在使用本地打印机还是网络打印机。如果你计划购买打印机,建议查看开放打印技术组织的(可支持打印机)数据库([OpenPrinting.org][7]),看看你想购买的打印机是不是有相应的开源驱动程序。如果你已经拥有一台打印机,你现在也知道怎样在你的 Linux 系统上使用你的打印机了。 -------------------------------------------------------------------------------- @@ -89,7 +83,7 @@ via: https://opensource.com/article/21/8/add-printer-linux 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[fisherue](https://github.com/fisherue) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 57b1727316d4e95ac30d9856c4f58f7477a13609 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 10:47:13 +0800 Subject: [PATCH 275/290] PUB @fisherue https://linux.cn/article-13740-1.html --- .../20210821 How to set up your printer on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210821 How to set up your printer on Linux.md (98%) diff --git a/translated/tech/20210821 How to set up your printer on Linux.md b/published/20210821 How to set up your printer on Linux.md similarity index 98% rename from translated/tech/20210821 How to set up your printer on Linux.md rename to published/20210821 How to set up your printer on Linux.md index 382dd6908e..6e56331207 100644 --- a/translated/tech/20210821 How to set up your printer on Linux.md +++ b/published/20210821 How to set up your printer on Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "fisherue" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13740-1.html" 如何在 Linux 系统设置打印机 ====== From 473246ef4cd422c0b75bf2f168f1148a1f1fd87d Mon Sep 17 00:00:00 2001 From: anine Date: Wed, 1 Sep 2021 12:02:33 +0800 Subject: [PATCH 276/290] =?UTF-8?q?=E6=9C=80=E6=96=B0=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 我重新同步了一遍 现在可以了 --- ... After Installing elementary OS 6 -Odin.md | 185 ----------------- ... After Installing elementary OS 6 -Odin.md | 187 ++++++++++++++++++ 2 files changed, 187 insertions(+), 185 deletions(-) delete mode 100644 sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md create mode 100644 translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md diff --git a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md deleted file mode 100644 index 910bf3ad32..0000000000 --- a/sources/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ /dev/null @@ -1,185 +0,0 @@ -[#]: subject: "10 Things to Do After Installing elementary OS 6 “Odin”" -[#]: via: "https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: "anine09" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -10 Things to Do After Installing elementary OS 6 “Odin” -====== -A curated list of things to do after installing the latest elementary OS -6 code-named “Odin”._Pre-step_Applications > System Settings > Desktop -The [elementary OS 6 “Odin” released][1] a while back after more than two years in development. It brings a huge set of new features across its core modules, Pantheon desktop, native applications. This release is based on the Ubuntu 20.04 LTS. - -That said, if you already completed the installation, there are certain customization that you might want to try out to personalize your system. The options those described here are generic and may not be useful for you at certain cases, but we feel it’s worth to list down some basics and give you a path to explore more of this beautiful elementary OS. - -### Things to Do After Installing elementary OS 6 “Odin” - -Make sure you connect to the internet first. You can get the list of networks available in the notification area at the top. - -#### 1\. Change hostname - -This might not be the first thing you would like to do. However, I am not sure why an option not given changing the hostname during installation itself. For example, see below terminal prompt, the hostname is the default hardware configuration set by elementary OS. Which is not looking good at all in my opinion. - -![hostname change before][2] - -To change the hostname, open a terminal and run the below command. - -``` -hostnamectl set-hostname your-new-hostname -``` - -example: - -![changing hostname][3] - -![changed hostname][4] - -#### 2\. Update your system - -The very first thing you should do after installing any Linux distribution is to make sure the system is up-to-date with packages and security updates. - -To do that here, you can open App Center and check/install for updates. - -Or, open the Terminal and run the below commands. - -``` -sudo apt update -sudo apt upgrade -``` - -#### 3\. Install Pantheon Tweaks - -Pantheon Tweaks is a must-have application in elementary OS. It provides additional settings and configuration options that is not available via standard system settings app. To install Pantheon Tweaks, open a terminal and run the below commands. Note: The earlier tweak tool was elementary Tweaks, which is renamed with Pantheon Tweaks from Odin onwards. - -``` -sudo apt install software-properties-common -sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks -sudo apt install -y pantheon-tweaks -``` - -After installation, open System Settings and you can find Tweaks option there. - -A detailed installation guide is [available here][5] (if you need more information). - -#### 4\. Configure Dock - -Dock is the center of the desktop. And honestly, the default apps that is included in the dock are not that popular. So, you can always configure the dock items using the below steps. - - * To remove: Right click and uncheck the **Keep in Dock** option. - * To add new items: Click on Application at the top. Then right-click on the application icon which you want in dock. Select **Add to Dock**. - - - -In my opinion, you should add at least – File manager, screenshot tool, Firefox, Calculator – among other things. And remove the ones you don’t need. - -#### 5\. Change the look and feel - -The elementary OS 6 Odin revamped the overall look of the desktop with pre-loaded accent color, native dark mode for entire desktop and applications. Also, pre-loads nice wallpapers. You can customize all these via . There you will have options for Wallpaper, Appearance, Panels and Multitasking. - -![elementary OS 6 Odin settings window – Desktop][6] - -Configure the look as you wish. - -[][7] - -SEE ALSO:   elementary OS 6 Odin: New Features and Release Date - -Oh, you can also schedule the Dark and Light mode based on Sunset and Sunrise! - -#### 6\. Install Additional Applications - -The native AppCenter is great for this OS. I find it one of the best curated app store available in Linux desktop. However, sometimes It’s also better to install necessary applications (mostly the known ones) those are not pre-loaded. Here’s a quick list of applications which you can install in a fresh system. _(Seriously, why LibreOffice is not preloaded?)_ - - * firefox - * gimp - * gedit - * inkscape - * obs-studio - * libreoffice - - - -#### 7\. Some Battery Saver Tips (Laptop) - -There are many ways which you can configure your elementary OS (or Linux desktop in general) to save battery life. Remember that battery life depends on your Laptop hardware, how old the battery/Laptop is among other things. So, following some of the below tips to get the maximum out of your Laptop battery. - - * Install [tlp][8]. The tlp is a simple to use, terminal based utility to help you to save Battery Life in Linux. You need to just install it, and it will take care of the other settings by default. Installation commands: - - - -``` -sudo add-apt-repository ppa:linrunner/tlp -sudo apt update -sudo apt-get install tlp -sudo tlp start -``` - - * Turn off Bluetooth, which is turned on by default. Enable it when required. - - - * Install thermald via below command. This utility (actually a daemon) controls the P-States, T-States of your CPU for temperature and controls the heating. - - - -``` -sudo apt install thermald -``` - - * Control brightness to minimum as per your need. - - - -#### 8\. Install a Disk Utility - -More often, you can find that you need to format a USB or write something to USB. By default, there are no application installed. The best applications with easy usage are the below ones. You can install them. - -``` -gnome-disk-utility -gparted -``` - -#### 9\. Enable Minimize and Maximize Option - -Many users prefer to have the Maximize, Minimize window buttons at the left or right of the window title bar. The elementary OS only gives you close and restore options by default. Which is completely fine because of the way it’s designed. However, you can use Pantheon Tweaks to enable it via Tweaks > Appearance > Window Controls. - -![enable minimize maximize buttons elementary OS][9] - -#### 10\. Learn the new multi-touch gestures in Odin - -If you are a Laptop user, and using elementary OS Odin, then you definitely check out the super cool new gestures. A three-finger swipe up smoothly opens the Multitasking View, exposing open apps and workspaces. A three-finger swipe left or right smoothly switches between the dynamic workspaces, making it even faster to jump between tasks. - -And with two fingers you can achieve similar feature inside native applications as well. - -### Closing Notes - -I hope these 10 things to do after installing elementary OS 6 helps you and get you started with elementary OS 6 Odin. Although, these are completely user preference; hence these may or may not apply to you. But in general, these are expected tweaks that the average user prefers. - -Let me know in the comments below if there are some more tweaks you feel that should be added in the list. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/ - -作者:[Arindam][a] -选题:[lujun9972][b] -译者:[anine09](https://github.com/anine09) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: https://www.debugpoint.com/author/admin1/ -[b]: https://github.com/lujun9972 -[1]: https://www.debugpoint.com/2021/08/elementary-os-6/ -[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/hostname-change-before.jpeg -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changing-hostname.jpeg -[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changed-hostname.jpeg -[5]: https://www.debugpoint.com/2021/07/elementary-tweaks-install/ -[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/elementary-OS-6-Odin-settings-window-Desktop.jpeg -[7]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/ -[8]: https://linrunner.de/tlp/ -[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS-1024x501.png diff --git a/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md new file mode 100644 index 0000000000..51e3e2fe86 --- /dev/null +++ b/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -0,0 +1,187 @@ +[#]: subject: "10 Things to Do After Installing elementary OS 6 “Odin”" +[#]: via: "https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/" +[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" +[#]: collector: "lujun9972" +[#]: translator: " anine09" +[#]: reviewer: " " +[#]: publisher: " " + +[#]: url: " " + +安装elementary OS 6 “Odin”后要做的 10 件事 +====== + +一个关于安装 elementary OS 6 “Odin” 后要做的事情的列表。 + +在经过两年多的开发后 [elementary OS 6 “Odin”][1] 于不久前发布,此次版本更新在核心模块、 Pantheon 桌面、本地应用中引入了一系列变化巨大的新特性,elementary OS 6 “Odin” 基于 Ubuntu 20.04 LTS。 + +也就是说,如果你完成了安装,你可能想要尝试通过一些特定的设置来使你的系统更加的个性化。这里描述的选项是通用的,在某些情况下可能对你无效,但是我们觉得有必要列出一些基础知识,让你有合适的方式来探索这个漂亮的 elementary OS。 + +### 安装完 elementary OS 6 “Odin” 后要做的事情 + +***准备步骤*** + +首先确保你已经连上了互联网,你可以在顶部的通知区域查看可用的网络列表 + +#### 1\. 更改 hostname + +这可能不是你想做的第一件事。但是我不知道为什么在安装过程中没有给出更改 hostname 的选项。例如,见下图的终端提示, 这个 hostname 是 elementary OS 的默认硬件配置。在我看来这一点都不好。 + +![hostname 修改之前][2] + +打开终端并运行下列命令以更改 hostname + +```bash +hostnamectl set-hostname your-new-hostname +``` + +示例: + +![修改 hostname][3] + +![hostname 修改之后][4] + +#### 2\. 升级你的系统 + +在安装任何 Linux 发行版后,你应该做的第一件事就是确保系统处于最新的软件包和安全更新状态。 + +你可以通过打开应用中心来检查或者安装更新。 + +或者打开终端运行下列命令。 + +```bash +sudo apt update +sudo apt upgrade +``` + +#### 3\. 安装 Pantheon Tweaks + +Pantheon Tweaks 是 elementary OS 的必备应用。它提供了一些无法通过系统原生设置程序修改的额外的设置和配置选项,请打开终端并运行以下命令以安装 Pantheon Tweaks。注意:先前版本的 Tweak 工具叫做 elementary Tweaks,从 Odin 版本开始更名为 Pantheon Tweaks。 + +```bash +sudo apt install software-properties-common +sudo add-apt-repository -y ppa:philip.scott/pantheon-tweaks +sudo apt install -y pantheon-tweaks +``` + +安装后打开系统设置,你可以在那里找到 Tweaks 选项。 + +[这里][5] 提供了更详细的安装指南(如果你需要了解更多信息) + +### 4. 配置 Dock + +Dock 是整个桌面的中心。老实说,Dock 中默认包含的应用并不常用,因此你是可以通过以下步骤配置 Dock 中的项目的。 + + * 移除:右键单击并取消 **在 Dock 中驻留** 选项。 + * 添加新的项目:单击顶部的应用程序。然后右键单击你想要放在 Dock 的应用图标。选择 **添加到 Dock**。 + + + +在我看来,你应该至少把文件管理、截图工具、Firefox 、计算器,以及其他的一些应用添加到 Dock。然后移除 Dock 上那些你不需要的应用。 + +#### 5\. 更改外观 + +elementary OS 6 Odin 改进了桌面的整体外观,为整个桌面和应用程序提供了自带的强调色和原生的夜间模式,同时,系统自带了许多漂亮的壁纸。你可以通过 **应用 > 系统设置 > 桌面** 来定制壁纸、外观、面板和多任务视图。 + +![elementary OS 6 Odin 桌面设置界面][6] + +按照你希望的样子来配置你系统的外观 + +参见:[elementary OS 6 Odin Promises Complete Dark Style](https://www.debugpoint.com/2020/11/elementary-os-6-odin-dark-style/) + +你也可以基于日出和日落的时间来设置夜间模式。 + +#### 6\. 安装其他的应用 + +自带的应用中心非常适合这个系统,我发现它是 Linux 桌面最好的应用商店之一。然而,有时候需要安装没有预装的必要应用(大多数是知名的应用)。下面是个新系统推荐安装的软件列表。(说真的,为什么 LibreOffice 没有预装?) + + * firefox + * gimp + * gedit + * inkscape + * obs-studio + * libreoffice + + + +#### 7\. 一些针对笔记本电脑的省电贴士 + +有许多方法可以配置你的 elementary OS (或者一般的 Linux 桌面),以达到延长电池寿命的目的。记住,电池寿命取决于你的笔记本硬件,以及电池和笔记本的使用年限。所以,遵循下面的一些建议,最大限度的利用你的笔记本电池。 + + * 安装 [tlp][8]. tlp 是一个简单易用的命令行程序,用来帮你在 Linux 上延长电池寿命。你只需要安装它,默认情况下,它会处理好其他的设置。安装命令: + + + +``` +sudo add-apt-repository ppa:linrunner/tlp +sudo apt update +sudo apt-get install tlp +sudo tlp start +``` + + * 关闭蓝牙,默认情况下,蓝牙是开启状态。在需要的时候再启动它。 + + * 通过下面的命令安装 thermald。这个实用程序(实际是个守护进程)控制着你的 CPU 的 P-States 和 T-States 的温度以及 CPU 发热。 + + + +``` +sudo apt install thermald +``` + + * 根据你的需要将亮度调到最小。 + + + +#### 8\. 安装磁盘实用程序 + +在很多情况下,你发现你需要格式化 USB 或者向 USB 中写入一些东西。默认情况下,系统没有安装任何相关的应用。你可以安装以下这些易用的应用。 + +``` +gnome-disk-utility +gparted +``` + +#### 9\. 启用最大化和最小化选项 + +许多用户喜欢在窗口标题栏左边或者右边使用最大化、最小化的按钮,elementary OS 默认只提供关闭和恢复两个选项。这没什么问题,因为这就是它的设计理念。然而你可以通过使用 Pantheon Tweaks 来开启最大化和最小化按钮,具体的方式是:调整 > 外观 > 窗口控制。 + +![在 elementary OS 中启动最大化和最小化设置][9] + +#### 10\. 在 Odin 中学习新的多点触控手势 + +如果你是笔记本用户,并且使用 elementary OS Odin,那么你一定要看看这些超酷的新触控手势。三根手指向上滑动,就会平滑的打开多任务视图,打开应用程序和工作空间。用三根手指向左或向右滑动,就能在动态工作空间之间流畅的切换,使任务之间的额切换更快。 + +用两根手指也可以再本地应用中实现类似的功能。 + +### 结束语 + +我希望安装elementary OS 6 Odin 后要做的 10 件事能帮助到你,让你开始使用 elementary OS 6 Odin,尽管这些事情完全是用户的偏好,因此这些事情有可能适合你也有可能不适用于你,但总的来说,这些都是一般用户喜欢的预期调整。 + +如果你觉得有更多的东西应该添加到列表中,请在下面的评论中告诉我。 + +* * * + +-------------------------------------------------------------------------------- + +via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary-os-6/ + +作者:[Arindam][a] +选题:[lujun9972][b] +译者:[anine09](https://github.com/anine09) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://www.debugpoint.com/author/admin1/ +[b]: https://github.com/lujun9972 +[1]: https://www.debugpoint.com/2021/08/elementary-os-6/ +[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/hostname-change-before.jpeg +[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changing-hostname.jpeg +[4]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/changed-hostname.jpeg +[5]: https://www.debugpoint.com/2021/07/elementary-tweaks-install/ +[6]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/elementary-OS-6-Odin-settings-window-Desktop.jpeg +[7]: https://www.debugpoint.com/2020/09/elementary-os-6-odin-new-features-release-date/ +[8]: https://linrunner.de/tlp/ +[9]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/enable-minimize-maximize-buttons-elementary-OS-1024x501.png + From a630c3869e062644b6122680bfe10a328565c80d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Wed, 1 Sep 2021 21:30:02 +0800 Subject: [PATCH 277/290] translated by fisherue --- sources/tech/20210830 Print from anywhere with CUPS on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md index 025dce01e1..49853538a3 100644 --- a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md +++ b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/share-printer-cups" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "fisherue " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From f5eefb7d18383cfec4b0d2153629fc083c599151 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=99=A8=E5=85=89?= Date: Wed, 1 Sep 2021 21:34:39 +0800 Subject: [PATCH 278/290] Update 20210830 Print from anywhere with CUPS on Linux.md --- sources/tech/20210830 Print from anywhere with CUPS on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md index 49853538a3..69d7925905 100644 --- a/sources/tech/20210830 Print from anywhere with CUPS on Linux.md +++ b/sources/tech/20210830 Print from anywhere with CUPS on Linux.md @@ -99,7 +99,7 @@ via: https://opensource.com/article/21/8/share-printer-cups 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/fisherue) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fe2562eb7b0073c709542996983918a961971860 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 22:42:19 +0800 Subject: [PATCH 279/290] PRF&PUB @geekpi https://linux.cn/article-13743-1.html --- ...r Useful Application Launcher for Linux.md | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) rename {translated/tech => published}/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md (69%) diff --git a/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/published/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md similarity index 69% rename from translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md rename to published/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md index 056a490813..b6fced4284 100644 --- a/translated/tech/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md +++ b/published/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md @@ -3,16 +3,16 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13743-1.html" Ulauncher:一个超级实用的 Linux 应用启动器 ====== -_**简介:**_ _Ulauncher 是一个快速的应用启动器,支持扩展和快捷方式,帮助你在 Linux 中快速访问应用和文件。_ +> Ulauncher 是一个快速应用启动器,支持扩展和快捷方式,帮助你在 Linux 中快速访问应用和文件。 -一个应用启动器可以让你快速访问或打开一个应用,而无需在应用菜单图标上徘徊。 +应用启动器可以让你快速访问或打开一个应用,而无需在应用菜单图标上徘徊。 在默认情况下,我发现 Pop!_OS 的应用启动器超级方便。但是,并不是每个 Linux 发行版都提供开箱即用的应用启动器。 @@ -32,9 +32,9 @@ Ulauncher 是一个使用 Python 还有 GTK+ 构建的快速应用启动器。 Ulauncher 中的选项非常非常易于访问且易于定制。一些关键的亮点包括: - * 模糊搜索算法,让你找到应用,即使你拼错了它们 - * 记住你在同一会话中最后搜索的应用 - * 经常使用的应用显示(可选) + * 模糊搜索算法可以让你即使拼错了,也能找到应用 + * 可以记住你在同一会话中最后搜索的应用 + * 显示经常使用的应用(可选) * 自定义颜色主题 * 预设颜色主题,包括一个黑暗主题 * 召唤启动器的快捷方式可以轻松定制 @@ -42,45 +42,43 @@ Ulauncher 中的选项非常非常易于访问且易于定制。一些关键的 * 支持扩展,以获得额外的功能(表情符号、天气、速度测试、笔记、密码管理器等) * 浏览谷歌、维基百科和 Stack Overflow 等网站的快捷方式 - - 它几乎提供了你在一个应用启动器中所期望的所有有用的能力,甚至更好。 ### 如何在 Linux 中使用 Ulauncher? -默认情况下,首次从应用菜单打开应用启动器后,你需要按 **Ctrl + Space** 打开应用启动器。 +默认情况下,首次从应用菜单中打开应用启动器后,你需要按 `Ctrl + Space` 打开应用启动器。 -开始输入以搜索一个应用。而且,如果你正在寻找一个文件或目录,开始输入 “**~**” 或者 “**/**” (忽略引号)。 +输入以搜索一个应用。如果你正在寻找一个文件或目录,输入以 `~` 或者 `/` 开始。 ![][2] -有一些默认的快捷键,如 “**g XYZ**”,其中 XYZ 是你想在谷歌中搜索的搜索词。 +有一些默认的快捷键,如 `g XYZ`,其中 “XYZ” 是你想在谷歌中搜索的搜索词。 ![][3] -同样,你可以通过 “**wiki**” 和 “**so**” 快捷键,直接在维基百科或 Stack Overflow 搜索。 +同样,你可以通过 `wiki` 和 `so` 快捷键,直接在维基百科或 Stack Overflow 搜索。 -在没有任何扩展的情况下,你也可以直接计算内容,并将结果直接复制到键盘上。 +在没有任何扩展的情况下,你也可以直接计算内容,并将结果直接复制到剪贴板。 ![][4] 这在快速计算时应该很方便,不需要单独启动计算器应用。 -你可以前往它的[扩展页面][5],浏览有用的扩展,以及指导你如何使用它的截图。 +你可以前往它的 [扩展页面][5],浏览有用的扩展,以及指导你如何使用它的截图。 -要改变它的工作方式,启用频繁的应用显示,并调整主题,请点击启动器右侧的齿轮图标。 +要改变它的工作方式,启用显示经常使用的应用,并调整主题,请点击启动器右侧的齿轮图标。 ![][6] 你可以把它设置为自动启动。但是,如果它在你的支持 Systemd 的发行版上不工作,你可以参考它的 GitHub 页面,把它添加到服务管理器中。 -这些选项是非常只管,且易于定制,如下图所示。 +这些选项是非常直观,且易于定制,如下图所示。 ![][7] ### 在 Linux 中安装 Ulauncher -Ulauncher 为基于 Debian 或 Ubuntu 的发行版提供了一个 **.deb** 包。如果你是 Linux 新手,你可以探索[如何安装 Deb 文件][8] 。 +Ulauncher 为基于 Debian 或 Ubuntu 的发行版提供了一个 deb 包。如果你是 Linux 新手,你可以了解一下 [如何安装 Deb 文件][8] 。 在这两种情况下,你也可以添加它的 PPA,并通过终端按照下面的命令来安装它: @@ -92,13 +90,13 @@ sudo apt install ulauncher 你也可以在 [AUR][9] 中找到它,用于 Arch 和 Fedora 的默认仓库。 -对于更多信息,你可以前往其官方网站或 [GitHub页面][10]。 +对于更多信息,你可以前往其官方网站或 [GitHub 页面][10]。 -[Ulauncher][11] +- [Ulauncher][11] Ulauncher 应该是任何 Linux 发行版中一个令人印象深刻的补充。特别是,如果你想要一个像 Pop!_OS 提供的快速启动器的功能,这是一个值得考虑的奇妙选择。 -_你试过 Ulauncher了吗?欢迎你就这如何帮助你快速完成工作分享你的想法。_ +你试过 Ulauncher了吗?欢迎你就如何帮助你快速完成工作分享你的想法。 -------------------------------------------------------------------------------- @@ -107,7 +105,7 @@ via: https://itsfoss.com/ulauncher/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[geekpi](https://github.com/geekpi) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f3265534be3b4242399e4555be4ab3e0f164a7cd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 23:37:32 +0800 Subject: [PATCH 280/290] PRF&PUB @chunibyo-wly https://linux.cn/article-13744-1.html --- ...loy a deep learning model on Kubernetes.md | 255 +++++++++--------- 1 file changed, 131 insertions(+), 124 deletions(-) rename {translated/tech => published}/20200908 Deploy a deep learning model on Kubernetes.md (51%) diff --git a/translated/tech/20200908 Deploy a deep learning model on Kubernetes.md b/published/20200908 Deploy a deep learning model on Kubernetes.md similarity index 51% rename from translated/tech/20200908 Deploy a deep learning model on Kubernetes.md rename to published/20200908 Deploy a deep learning model on Kubernetes.md index 5a83fe466b..850b5604c0 100644 --- a/translated/tech/20200908 Deploy a deep learning model on Kubernetes.md +++ b/published/20200908 Deploy a deep learning model on Kubernetes.md @@ -1,46 +1,43 @@ [#]: collector: (lujun9972) [#]: translator: (chunibyo-wly) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13744-1.html) [#]: subject: (Deploy a deep learning model on Kubernetes) [#]: via: (https://opensource.com/article/20/9/deep-learning-model-kubernetes) [#]: author: (Chaimaa Zyani https://opensource.com/users/chaimaa) 在 Kubernetes 上部署一个深度学习模型 ====== -了解如何使用 Kubermatic Kubernetes 平台部署、缩放与管理图像识别深度学习模型。 -![Brain on a computer screen][1] +> 了解如何使用 Kubermatic Kubernetes 平台来部署、扩展与管理图像识别预测的深度学习模型。 -随着企业增加了对人工智能(AI)、机器学习(ML)与深度学习(DL)的使用,出现了一个关键问题:如何将机器学习的发展进行规模化与产业化?这些讨论经常聚焦于机器学习模型本身;然而,模型仅仅只是完整解决方案的其中一环。为了达到生产环境的应用和规模,模型的开发过程必须还包括一个可以说明开发前后关键活动以及可公用部署的可重复过程。 +![](https://img.linux.net.cn/data/attachment/album/202109/01/233417ryy87hyza7jmgy33.jpg) -本文演示了如何使用[Kubermatic Kubernetes Platform][2]对图像识别预测的深度学习模型进行部署,缩放与管理。 +随着企业增加了对人工智能(AI)、机器学习(ML)与深度学习(DL)的使用,出现了一个关键问题:如何将机器学习的开发进行规模化与产业化?这些讨论经常聚焦于机器学习模型本身;然而,模型仅仅只是完整解决方案的其中一环。为了达到生产环境的应用和规模,模型的开发过程必须还包括一个可以说明开发前后关键活动以及可公用部署的可重复过程。 -Kubermatic Kubernetes 平台是一个可以与机器学习/深度学习工作流结合进行完整集群生命周期管理的一个自动且灵活的开源生产级 Kubernetes 集群管理工具。 +本文演示了如何使用 [Kubermatic Kubernetes 平台][2] 对图像识别预测的深度学习模型进行部署、扩展与管理。 + +Kubermatic Kubernetes 平台是一个生产级的开源 Kubernetes 集群管理工具,提供灵活性和自动化,与机器学习/深度学习工作流程整合,具有完整的集群生命周期管理。 ### 开始 -这个例子部署了一个图像识别的深度学习模型。它使用了包含 60,000 张分属 10 个类别的 32x32 彩色图 [CIFAR-10][3] 像数据集,同时使用了 [Apache MXNet][5] 的 [Gluon][4] 与 NVIDIA GPUs 进行加速计算。如果你希望使用 CIFAR-10 数据集的预训练模型,可以查阅 [getting started guide][6]。 +这个例子部署了一个用于图像识别的深度学习模型。它使用了 [CIFAR-10][3] 数据集,包含了 60,000 张分属 10 个类别的 32x32 彩色图,同时使用了 [Apache MXNet][5] 的 [Gluon][4] 与 NVIDIA GPU 进行加速计算。如果你希望使用 CIFAR-10 数据集的预训练模型,可以查阅其 [入门指南][6]。 使用训练集中的样本对模型训练 200 次,只要训练误差保持缓慢减少,就可以保证模型不会过拟合。下方图展示了训练的过程: ![深度学习模型训练 loss 图][7] -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - 训练结束后,必须保存模型训练所得到的参数,以便稍后可以加载它们: - -```python +``` file_name = "net.params" net.save_parameters(file_name) ``` -一旦你的模型训练好了,就可以用 Flask 服务器来封装它。下方的程序演示了如何接收 request 中的一张图片作为参数并且在 response 中返回模型的预测结果: +一旦你的模型训练好了,就可以用 Flask 服务器来封装它。下方的程序演示了如何接收请求中的一张图片作为参数,并在响应中返回模型的预测结果: - -```python +``` from gluoncv.model_zoo import get_model import matplotlib.pyplot as plt from mxnet import gluon, nd, image @@ -80,156 +77,166 @@ if __name__ == '__main__': 在将模型部署到 Kubernetes 前,你需要先安装 Docker 并使用你的模型创建一个镜像。 - 1. 下载、安装并启动 Docker: -```bash -sudo yum install -y yum-utils device-mapper-persistent-data lvm2 +1. 下载、安装并启动 Docker: -sudo yum-config-manager --add-repo + ``` + sudo yum install -y yum-utils device-mapper-persistent-data lvm2 + sudo yum-config-manager --add-repo + sudo yum install docker-ce + sudo systemctl start docker + ``` -sudo yum install docker-ce +2. 创建一个你用来管理代码与依赖的文件夹: -sudo systemctl start docker + ``` + mkdir kubermatic-dl + cd kubermatic-dl + ``` -``` - 2. 创建一个你用来管理代码与依赖的文件夹: -```bash -mkdir kubermatic-dl -cd kubermatic-dl -``` +3. 创建 `requirements.txt` 文件管理代码运行时需要的所有依赖: - 3. 创建 `requirements.txt` 文件管理代码运行时需要的所有依赖: -``` -flask -gluoncv -matplotlib -mxnet -requests -Pillow + ``` + flask + gluoncv + matplotlib + mxnet + requests + Pillow + ``` -``` - 4. 创建 Dockerfile,Docker 将根据这个文件创建镜像: -``` -FROM python:3.6 -WORKDIR /app -COPY requirements.txt /app -RUN pip install -r ./requirements.txt -COPY app.py /app -CMD ["python", "app.py"] -``` +4. 创建 `Dockerfile`,Docker 将根据这个文件创建镜像: -这个 Dockerfile 主要可以分为三个部分。首先,Docker 会下载 Python 的基础镜像。然后,Docker 会使用 Python 的包管理工具 `pip` 安装 `requirements.txt` 记录的包。最后,Docker 会通过执行 `python app.py` 来运行你的脚本。 + ``` + FROM python:3.6 + WORKDIR /app + COPY requirements.txt /app + RUN pip install -r ./requirements.txt + COPY app.py /app + CMD ["python", "app.py"] + ``` + 这个 `Dockerfile` 主要可以分为三个部分。首先,Docker 会下载 Python 的基础镜像。然后,Docker 会使用 Python 的包管理工具 `pip` 安装 `requirements.txt` 记录的包。最后,Docker 会通过执行 `python app.py` 来运行你的脚本。 - 1. 构建 Docker 容器: `sudo docker build -t kubermatic-dl:latest .` 这条命令使用 `kubermatic-dl` 镜像为你当前工作目录的代码创建了一个容器。 - - 2. 使用 `sudo docker run -d -p 5000:5000 kubermatic-dl` 命令检查你的容器可以在你的主机上正常运行。 - - 3. 使用 `sudo docker ps -a` 命令查看你本地容器的运行状态: - -![查看容器的运行状态][9] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) +5. 构建 Docker 容器: + + ``` + sudo docker build -t kubermatic-dl:latest . + ``` + 这条命令使用 `kubermatic-dl` 镜像为你当前工作目录的代码创建了一个容器。 +6. 使用 + + ``` + sudo docker run -d -p 5000:5000 kubermatic-dl + ``` + + 命令检查你的容器可以在你的主机上正常运行。 +7. 使用 + + ``` + sudo docker ps -a + ``` + 命令查看你本地容器的运行状态: + ![查看容器的运行状态][9] ### 将你的模型上传到 Docker Hub 在向 Kubernetes 上部署模型前,你的镜像首先需要是公开可用的。你可以通过将你的模型上传到 [Docker Hub][10] 来将它公开。(如果你没有 Docker Hub 的账号,你需要先创建一个) - 1. 在终端中登录 Docker Hub 账号:`sudo docker login` +1. 在终端中登录 Docker Hub 账号: + + ``` + sudo docker login + ``` - 2. 给你的镜像打上 tag ,这样你的模型上传到 Docker Hub 后也能拥有版本信息 -```bash -sudo docker tag <your-image-id> <your-docker-hub-name>/<your-app-name> +2. 给你的镜像打上标签,这样你的模型上传到 Docker Hub 后也能拥有版本信息: -sudo docker push <your-docker-hub-name>/<your-app-name> -``` + ``` + sudo docker tag / -![给镜像打上 tag][11] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - - 3. 使用 `sudo docker images` 命令检查你的镜像的 ID。 + sudo docker push / + ``` + ![给镜像打上 tag][11] +3. 使用 + ``` + sudo docker images + ``` + + 命令检查你的镜像的 ID。 ### 部署你的模型到 Kubernetes 集群 - 1. 首先在 Kubermatic Kubernetes 平台创建一个项目, 然后根据 [快速开始][12] 创建一个 Kubernetes 集群。 +1. 首先在 Kubermatic Kubernetes 平台创建一个项目, 然后根据 [快速开始][12] 创建一个 Kubernetes 集群。 -![创建一个 Kubernetes 集群][13] + ![创建一个 Kubernetes 集群][13] -(Chaimaa Zyami, [CC BY-SA 4.0][8]) +2. 下载用于访问你的集群的 `kubeconfig`,将它放置在下载目录中,并记得设置合适的环境变量,使得你的环境能找到它: - 2. 下载用于访问你的集群的 `kubeconfig`,将它放置在下载目录中,并记得设置合适的环境变量,使得你的环境能找到它: + ![Kubernetes 集群示例][14] -![Kubernetes 集群示例][14] +3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info` -(Chaimaa Zyami, [CC BY-SA 4.0][8]) + ![查看集群信息][15] - 3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info` +4. 为了在集群中运行容器,你需要创建一个部署用的配置文件(`deployment.yaml`),再运行 `apply` 命令将其应用于集群中: -![查看集群信息][15] + ``` + apiVersion: apps/v1 + kind: Deployment + metadata: +   name: kubermatic-dl-deployment + spec: +   selector: +     matchLabels: +       app: kubermatic-dl +   replicas: 3 +   template: +     metadata: +       labels: +         app: kubermatic-dl +     spec: +      containers: +      - name: kubermatic-dl +        image: kubermatic00/kubermatic-dl:latest +        imagePullPolicy: Always +        ports: +        - containerPort: 8080 -(Chaimaa Zyami, [CC BY-SA 4.0][8]) + ``` + + ``` + kubectl apply -f deployment.yaml` + ``` - 4. 为了在集群中运行容器,你需要创建一个部署用的配置文件(`deployment.yaml`),再运行 `apply` 命令将其应用于集群中: -```yaml -apiVersion: apps/v1 -kind: Deployment -metadata: -  name: kubermatic-dl-deployment -spec: -  selector: -    matchLabels: -      app: kubermatic-dl -  replicas: 3 -  template: -    metadata: -      labels: -        app: kubermatic-dl -    spec: -     containers: -     - name: kubermatic-dl -       image: kubermatic00/kubermatic-dl:latest -       imagePullPolicy: Always -       ports: -       - containerPort: 8080 +5. 为了将你的部署开放到公网环境,你需要一个能够给你的容器创建外部可达 IP 地址的服务: + + ``` + kubectl expose deployment kubermatic-dl-deployment  --type=LoadBalancer --port 80 --target-port 5000` + ``` -``` `kubectl apply -f deployment.yaml` -``` +6. 就快大功告成了!首先检查你布署的服务的状态,然后通过 IP 请求的你图像识别 API: + + ``` + kubectl get service + ``` - 5. 为了将你的部署开放到公网环境,你需要一个能够给你的容器创建外部可达 IP 地址的服务:`kubectl expose deployment kubermatic-dl-deployment  --type=LoadBalancer --port 80 --target-port 5000` + ![获取请求图像识别 API 的 IP 地址][16] - 6. 就快大功告成了!首先检查你布署的服务的状态,然后通过 IP 请求的你图像识别 API:`kubectl get service` - - -![获取请求图像识别 API 的 IP 地址][16] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - - 7. 最后根据你的外部 IP 使用以下两张图片对你的图像识别服务进行测试: - -![马][17] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - -![狗][18] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) - -![测试 API][19] - -(Chaimaa Zyami, [CC BY-SA 4.0][8]) +7. 最后根据你的外部 IP 使用以下两张图片对你的图像识别服务进行测试: + ![马][17] + ![狗][18] + ![测试 API][19] ### 总结 - 在这篇教程中,你可以创建一个深度学习模型,并且使用 Flask 提供 [REST API][20] 服务。它介绍了如何将应用放在 Docker 容器中,如何将这个镜像上传到 Docker Hub 中,以及如何使用 Kubernetes 部署你的服务。只需几个简单的命令,你就可以使用 Kubermatic Kubernetes 平台部署该应用程序,并且开放服务给别人使用。 -------------------------------------------------------------------------------- @@ -238,8 +245,8 @@ via: https://opensource.com/article/20/9/deep-learning-model-kubernetes 作者:[Chaimaa Zyani][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/chunibyo-wly) -校对:[校对者ID](https://github.com/校对者ID) +译者:[chunibyo-wly](https://github.com/chunibyo-wly) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 83c8ae1f08fb3ea6cf433fb5ff90d60322861119 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 1 Sep 2021 23:46:47 +0800 Subject: [PATCH 281/290] PRF --- .../20200908 Deploy a deep learning model on Kubernetes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20200908 Deploy a deep learning model on Kubernetes.md b/published/20200908 Deploy a deep learning model on Kubernetes.md index 850b5604c0..cf034c4879 100644 --- a/published/20200908 Deploy a deep learning model on Kubernetes.md +++ b/published/20200908 Deploy a deep learning model on Kubernetes.md @@ -179,7 +179,7 @@ if __name__ == '__main__': ![Kubernetes 集群示例][14] -3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info` +3. 使用 `kubectl` 命令检查集群信息,例如,需要检查 `kube-system` 是否在你的集群正常启动了就可以使用命令 `kubectl cluster-info`: ![查看集群信息][15] From bd5cd00c9978205643e5781d607d05268546b583 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:03:16 +0800 Subject: [PATCH 282/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?Getting=20ready=20for=20Fedora=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 Getting ready for Fedora Linux.md --- ...20210901 Getting ready for Fedora Linux.md | 297 ++++++++++++++++++ 1 file changed, 297 insertions(+) create mode 100644 sources/tech/20210901 Getting ready for Fedora Linux.md diff --git a/sources/tech/20210901 Getting ready for Fedora Linux.md b/sources/tech/20210901 Getting ready for Fedora Linux.md new file mode 100644 index 0000000000..6a8d15ce08 --- /dev/null +++ b/sources/tech/20210901 Getting ready for Fedora Linux.md @@ -0,0 +1,297 @@ +[#]: subject: "Getting ready for Fedora Linux" +[#]: via: "https://fedoramagazine.org/getting-ready-for-fedora-linux/" +[#]: author: "Hanku Lee https://fedoramagazine.org/author/hankuoffroad/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Getting ready for Fedora Linux +====== + +![][1] + +Photo by [Jacques Bopp][2] on [Unsplash][3] + +### Introduction + +Why does Linux remain vastly invisible to ordinary folks who make general use of computers? This article steps through the process to move to Fedora Linux Workstation for non-Linux users. It also describes features of the GUI (Graphic User Interface) and CLI (Command Line Interface) for the newcomer. This is a quick introduction, not an in-depth course. + +### Installation and configuration are straightforward + +Supposedly, a bootable USB drive is the most baffling experience of starting Linux for a beginner. In all fairness, installation with Fedora Media Writer and Anaconda is intuitive. + +##### Step-by-step installation process + + 1. [Make a Fedora USB stick][4]: 5 to 7 minutes depending on USB speed + 2. [Understand disk partitions and Linux file systems][5] + 3. [Boot from a USB device][6] + 4. [Install][7] with the Fedora installer, Anaconda: 15 to 20 minutes + 5. Software updates: 5 minutes + + + +Following this procedure, it is easy to help family and friends install Fedora Linux. + +##### Package management and configuration + +Instead of configuring the OS manually, adding tools and applications you need, you may choose a functional bundle from [Fedora Labs][8] for a specific use case. Design Suite, Scientific, Python Classroom, and more, are available. Plus, all processes are complete without the command line. + +##### Connecting devices and services + + * [Add a USB printer][9]: Fedora Linux detects most printers in a few seconds. Some may require the drivers. + * Configure a USB keyboard: Refer to simple [work-around][10] for a mechanical keyboard. + * [Sync with Google Drive][11]: Add an account either after installation, or at any time afterward. + + + +### Desktop customization is easy + +The default [GNOME desktop][12] is decent and free from distractions. + +A shortlist to highlight desktop benefits: + + * Simplicity: Clean design, fluid and elegant application grid. + * Reduced user effort: No alerts for paid services or long list of user consent. + * Accommodating software: GNOME requires little specialist knowledge or technical ability. + * Neat layout of system _Settings_: Larger icons and a better layout. + + + +The image below shows the applications and desktops currently available. Get here by selecting “Activities” and then the “Show Applications” icon at the bottom of the screen at the far right. There you will find LibreOffice for your document, spreadsheet, and presentation creation. Also available is Firefox for your web browsing. More applications are added using the _Software_ icon (second from right at the bottom of the screen). + +![GNOME desktop][13] + +##### Enable touchpad click (tapping) + +A change for [touchpad settings][14] is required for laptop users. + + 1. Go to _Activies > Show Applications > Settings > Mouse & Touchpad > Touchpad_ + 2. Change the default behavior of touchpad settings (double click) to tap-to-click (single tap) using the built-in touchpad + 3. Select ‘Tap to Click’ + + + +##### Add user accounts using the users settings tool + +During installation, you set up your first login account. For training or demo purposes, it is common to create a new user account. + + 1. Add users: Go to _Settings > Users > Unlock > Authentication> Add user_ + 2. Click at the top of the screen at the far right and then navigate to Power Off / Log out, and Select _Switch User_ to relogin as the new user. + + + +### Fedora Linux is beginner-friendly + +Yes, Fedora Linux caters to a broader selection of users. Since that is the case, why not dip into the shallow end of the Fedora community? + + * [Fedora Docs][15]: Clarity of self-help content is outstanding. + * Ask Fedora: Get help for anything about Fedora Linux. + * Magazine: Useful tips and user story are engaging. Make a suggestion to write about. + * Nest with Fedora: Warm welcome virtually from Fedora Linux community. + * Release parties. + + + +### Command line interface is powerful + +The command line is a way of giving instructions to a computer (shell) using a terminal. To be fair, the real power behind Fedora Linux is the Bash shell that empowers users to be problem solvers. The good news is that the text-based command is universally compatible across different versions of Linux. The Bash shell comes with the Fedora Linux, so there is no need to install it. + +The following will give you a feeling for the command line. However, you can accomplish many if not all day-to-day tasks without using the command line. + +#### How to use commands? + +Access the command line by selecting “Activities” and then the “Show Applications” icon at the bottom of the screen at the far right. Select _Terminal_. + +#### Understand the shell prompt + +The standard shell prompt looks like this: + +``` +[hank@fedora_test ~]$ +``` + +The shell prompt waits for a command. + +It shows the name of the user (hank), the computer being used (fedora_test), and the current working directory within the filesystem (~, meaning the user’s home directory). The last character of the prompt, $, indicates that this is a normal user’s prompt. + +#### Enter commands + +What common tasks should a beginner try out with command lines? + + * Command line information is available from the [Fedora Magazine][16] and [other sites][17]. + * Use _ls_ and _cd_ to list and navigate your file system. + * Make new directories (folders) with _mkdir_. + * Delete files with _rm_. + * Use _lsblk_ command to display partition details. + + + +#### How to deal with the error messages + + * Be attentive to error messages in the terminal. Common errors are missing arguments, typo of file name. + * Pause to think about why that happened. + * Figure out the correct syntax using the _man_ command. For example: +_man ls_ +displays the manual page for the _ls_ command. + + + +#### Perform administration tasks using _sudo_ + +When a user executes commands for installation, removal, or change of software, [the _sudo_ command][18] allows users to gain administrative or root access. The actions that required _sudo_ command are often called ‘the administrative tasks’. Sudo stands for **SuperUser DO**. The syntax for the _sudo_ command is as follows: + +``` +sudo [COMMAND] +``` + + 1. Replace _COMMAND_ with the command to run as the root user. + 2. Enter password + + + +What are the most used _sudo_ commands to start with? + + * List privileges + + + +``` +sudo -l +``` + + * Install a package + + + +``` +sudo dnf install [package name] +``` + + * Update a package + + + +``` +sudo dnf update [package name] +``` + + * List all packages + + + +``` +sudo dnf grouplist [package name] +``` + + * Manage disk partitions + + + +``` +sudo fdisk -l +``` + +### Built-in text editor is light and efficient + +[Nano][19] is the default command-line-based text editor for Fedora Linux. [vi][20] is another one often used on Fedora Linux. Both are light and fast. Which to us is a personal choice, really. Nano and vi remain essential tools for editing config files and writing scripts. Generally, Nano is much simpler to work with than vi but vi can be more powerful when you get used to it. + +##### What does a beginner benefit from a text editor? + + * Learn fundamentals of computing + + + +Linux offers a vast range of customization options and monitoring. Shell scripts make it possible to add new functionality and the editor is used to create the scripts. + + * Build cool things for home automation + + + +Raspberry Pi is a testing ground to build awesome projects for homes. [Fedora can be installed on Raspberry Pi][21]. Schools use the tiny microcomputer for IT training and experiment. Instead of a visual editor, it is easier to use a light and simple Nano editor to write files. + + * Test proof of concept with the public cloud services + + + +Most of the public cloud suppliers offer free sandbox account to spin up a virtual machine or configure the network. Cloud servers run Linux OS, so editing configuration files require a text editor. Without installing additional software, it is easy to invoke Nano on a remote server. + +##### How to use Nano text editor + +Type _nano_ and file name after the shell prompt $ and press Enter. + +``` +[hank@fedora_test ~]$ nano [filename] +``` + +Note that many of the most used commands are displayed at the bottom of the nano screen. The symbol ^ in Nano means to press the Ctrl key. + + * Use the arrow keys on the keyboard to move up and down, left and right. + * Edit file. + * Get built-in help by pressing ^G + * Exit by entering ^X and Y to save your file and return to the shell prompt. + + + +##### Examples of file extensions used for configuration or shell scripts + + * .cfg: User-configurable files in the /etc directory. + * .yaml: A popular type of configuration file with cross-language data portability. + * .json: JSON is a lightweight & open standard format for storing and transporting data. + * .sh: A shell script used universally for Unix/Linux systems. + + + +Above all, this is not a comprehensive guide on Nano or vi. Yet, adventurous learners should be aware of text editors for their next step in becoming accomplished in Fedora Linux. + +### Conclusion + +Does Fedora Workstation simplify the user experience of a beginner with Linux? Yes, absolutely. It is entirely possible to create a desktop quickly and get the job done without installing additional software or extensions. + +Taking it to the next level, how to get more people into Fedora Linux? + + * Make Fedora Linux device available at home. A repurposed computer with the above guide is a starting point. + * Demonstrate [cool things][22] with Fedora Linux. + * Share [power user tips][23] with shell scripts. + * Get involved with Open Source Software community such as the [Fedora project][24]. + + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/getting-ready-for-fedora-linux/ + +作者:[Hanku Lee][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://fedoramagazine.org/author/hankuoffroad/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/ready_for_fedora-816x345.jpg +[2]: https://unsplash.com/@jacquesbopp?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/make-fedora-usb-stick/ +[5]: https://docs.fedoraproject.org/en-US/fedora/rawhide/install-guide/appendixes/Disk_Partitions/ +[6]: https://docs.fedoraproject.org/en-US/fedora/rawhide/install-guide/install/Booting_the_Installation/ +[7]: https://docs.fedoraproject.org/en-US/fedora/rawhide/install-guide/install/Installing_Using_Anaconda/ +[8]: https://labs.fedoraproject.org/ +[9]: https://docs.fedoraproject.org/en-US/Fedora/14/html/User_Guide/chap-User_Guide-Printing.html +[10]: https://venthur.de/2021-04-30-keychron-c1-on-linux.html +[11]: https://fedoramagazine.org/connect-your-google-drive-to-fedora-workstation/ +[12]: https://developer.gnome.org/hig/principles.html +[13]: https://fedoramagazine.org/wp-content/uploads/2021/08/Screenshot-from-2021-08-12-23-27-13-1024x576.png +[14]: https://help.gnome.org/users/gnome-help/stable/mouse-touchpad-click.html.en +[15]: https://docs.fedoraproject.org/en-US/docs/ +[16]: https://fedoramagazine.org/?s=command+line +[17]: https://www.redhat.com/sysadmin/essential-linux-commands +[18]: https://fedoramagazine.org/howto-use-sudo/ +[19]: https://fedoramagazine.org/gnu-nano-minimalist-console-editor/ +[20]: https://www.redhat.com/sysadmin/vim-commands +[21]: https://docs.fedoraproject.org/en-US/quick-docs/raspberry-pi/ +[22]: https://fedoramagazine.org/automatically-light-up-a-sign-when-your-webcam-is-in-use/ +[23]: https://fedoramagazine.org/?s=bash +[24]: https://docs.fedoraproject.org/en-US/project/ From b392e9f938207059fbe98a07434fd3ef83bd12ab Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:03:25 +0800 Subject: [PATCH 283/290] add done: 20210901 Getting ready for Fedora Linux.md --- sources/tech/20210902 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210902 .md diff --git a/sources/tech/20210902 .md b/sources/tech/20210902 .md new file mode 100644 index 0000000000..90bde3e2c1 --- /dev/null +++ b/sources/tech/20210902 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/recover-root-password-rhel-8-centos-8/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/recover-root-password-rhel-8-centos-8/ + +作者:[][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: +[b]: https://github.com/lujun9972 From 984a309365ef55cc60cd5c8ce581ff26ad275083 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:03:43 +0800 Subject: [PATCH 284/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210902=20?= =?UTF-8?q?Best=20Web=20Browsers=20for=20Ubuntu=20and=20Other=20Linux=20Di?= =?UTF-8?q?stributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md --- ...or Ubuntu and Other Linux Distributions.md | 404 ++++++++++++++++++ 1 file changed, 404 insertions(+) create mode 100644 sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md b/sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..26a6d5f941 --- /dev/null +++ b/sources/tech/20210902 Best Web Browsers for Ubuntu and Other Linux Distributions.md @@ -0,0 +1,404 @@ +[#]: subject: "Best Web Browsers for Ubuntu and Other Linux Distributions" +[#]: via: "https://itsfoss.com/best-browsers-ubuntu-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Best Web Browsers for Ubuntu and Other Linux Distributions +====== + +There is no such thing as the perfect web browser. It all depends on what you prefer and what you use it for. + +But, what are your best options when it comes to web browsers for Linux? + +In this article, I try to highlight the best web browsers that you can pick for Ubuntu and other Linux. + +**Note:** We have tried and tested these browsers on Ubuntu. But, you should be able to install it on any Linux distribution of your choice. + +### Top Web Browsers for Linux + +![Illustration for web browser running in Ubuntu Linux][1] + +Every browser offers something unique. And, when it comes to the Linux platform, there are some interesting exclusive choices as well. + +_**Before you see this list, please note that it is not a ranking list. The browser listed at number 1 should not be considered better than the ones at 2, 3 or 10.**_ + +Non-FOSS alert! + +Some applications mentioned here are not open source. They are listed here because they are available on Linux and the article’s focus is on Linux. We have a separate [dedicated list of open source web browsers][2] as well. + +### 1\. Vivaldi + +![][3] + +**Pros** + + * Sidebar for quick web application access + * Calendar and Email integration + * Unique tab management + * Pomodoro feature + * Mobile app available + + + +**Cons** + + * Resource-heavy when using a variety of features + * Not 100% open-source + + + +Vivaldi is an impressive browser that has been getting more attention from Linux users more than ever. + +While it is not 100% open-source, you can find most of its source code (except for its UI) online. + +With [Vivaldi 4.0 release][4], they have been focusing more on improving the experience for Linux users. You can set clock timers to increase your work productivity, use the built-in translation for web pages, track your calendar, add shortcuts to web applications, and multi-task at its peak with this browser. + +Even though it is a fast web browser, I wouldn’t bet on it as the “fastest” or lightest. You need a good amount of memory (RAM) to make use of all the features while you work on stuff. + +Overall, it is a feature-rich web browser. So, if you need something with as many as features possible to multi-task, Vivaldi can be your choice. + +[Vivaldi][5] + +#### How to Install Vivaldi on Linux? + +Vivaldi offers both **.deb** and **.rpm** packages to let you directly install it in your Linux system. + +You can refer to our resources to [install Deb files][6] and [install RPM files][7] in case you are new to Linux. + +### 2\. Mozilla Firefox + +![][8] + +**Pros** + + * Privacy protection + * Not based on Chrome engine + * Open Source + * Firefox Account services + + + +**Cons** + + * User Experience changes with major updates + + + +Firefox is the default web browser for most Linux distributions. Hence, it is an obvious choice to start with. + +In addition to being open-source, it offers some of the best privacy protection features. And, with the right settings, you can turn it into one of the most secure browsers similar to Tor Browser (which is also based on Firefox). + +Not just limited to its security, but Firefox also offers useful integrated features like Pocket (to save web pages and read later), VPN, email alias, breach monitor, and more when you sign in with your Firefox account. + +[Firefox][9] + +#### How to Install Firefox on Linux? + +It should already come pre-installed in your Linux distribution. But, if it is not present, you can search for it in the software center or install it using the terminal with the following command: + +``` +sudo apt install firefox +``` + +### 3\. Chromium + +![][10] + +**Pros** + + * Open Source Chrome alternative + * Similar features to Google Chrome + + + +**Cons** + + * Lacks certain features that Google Chrome offers + + + +Chromium is the open-source alternative and the base for Google Chrome and many other chrome-based browsers. + +If you do not want to use Google Chrome, chromium’s your best bet to get the same experience on Linux. + +Even though Google controls Chromium and [has been locking down Chrome][11], it is a good option for Linux systems. + +[Chromium][12] + +#### How to Install Chromium on Linux? + +You should be able to find it easily in the software center. But, if you need help, refer to our [installation guide for Chromium][13]. + +### 4\. Google Chrome + +![][14] + +**Pros** + + * Seamless integration with Google services + + + +**Cons** + + * Not open-source + + + +Google Chrome is an excellent web browser unless you do not want to opt for a proprietary solution or products by Google. + +You get all the essential features and the ability to integrate all Google services. If you prefer using Google Chrome on Android and want to sync across multiple platforms, it is an obvious choice for desktop Linux. + +If you were looking for a simple and capable web browser while using Google services, Google Chrome can be a great pick. + +[Google Chrome][15] + +#### How to Install Google Chrome on Linux? + +Google Chrome offers both Deb and RPM packages to let you install on any Ubuntu-based or Fedora/openSUSE distribution. + +If you need help with the installation, I should point you to our guide on [installing Google Chrome on Linux][16]. + +### 5\. Brave Browser + +![][17] + +**Pros** + + * Privacy protection features + * Performance + + + +**Cons** + + * No account-based sync + + + +Brrave browser is one of the most popular Linux browsers. + +It is an open-source project and is based on chromium. It offers several useful privacy protection features and is known for its blazing fast performance. + +Unlike any other browsers, you can get rewards even if you block advertisements on websites. The rewards you collect can only be used to give back to your favorite websites. This way, you get to block ads and also support the website. + +You can expect a faster user experience with minimum resource usage.   + +We also have a detailed [comparison article on Brave vs Firefox][18], if you need to decide between the two. + +Brave + +#### How to Install Brave on Linux? + +Unlike some other web browsers, you cannot directly find a package or in the software center. You need to enter some commands in the terminal to install the browser. + +Fret not, you can follow our [instructions to install brave browser][19] to proceed. + +### 6\. Opera + +![][20] + +**Pros** + + * Free VPN in-built + * Extra features + + + +**Cons** + + * Not open source + + + +While Opera is not the most popular choice, it is definitely a useful browser for Linux users. + +It comes with a built-in VPN and adblocker. So, you should have the basic privacy protection sorted with the help of the Opera web browser. + +You can quickly access popular chat messengers right from the sidebar without needing to launch a separate app or window. This is similar to Vivaldi considering the side chat messenger web apps but the user experience is significantly different. + +Overall, it is a good pick if you want a free VPN as an added bonus to other essential browsing features. + +It is worth noting that Opera offers a unique [Opera GX][21] browser which lets you tweak/enforce limit on system resources when using a browser along with gaming activities. This was still in development for Linux at the time of writing, if it is available by the time you read it, that could be a fantastic option! + +[Opera][22] + +#### How to Install Opera? + +Opera provides Deb package for Linux. You just head to its official website to download and install it. + +### 7\. Microsoft Edge + +![][23] + +**Pros** + + * Convenient option for Windows users who also use Linux + + + +**Cons** + + * Not open-source + * Still in Beta + + + +Microsoft Edge has surpassed Mozilla Firefox in terms of its popularity. Not just because it’s the default Windows browser, but it also offers a promising web experience while based on Chrome. + +At the time of writing this article, Microsoft Edge is available as a beta release for Linux. It works fine at the moment, but lacks quite a few features normally available for Windows. + +Overall, you should find most of the essential features available. + +If you use Windows and Linux as your desktop platforms, Microsoft Edge can come in handy as the preferred web browser. + +[Microsoft Edge][24] + +#### How to install Microsoft Edge on Linux? + +It is currently available through Microsoft Insiders channel as a beta. So, this could change once the stable release is out. + +For now, you can get the Deb/RPM file through the Microsoft Edge insiders web page and install it. + +You can also have a look at our how-to article on [installing Microsoft Edge on Linux][25]. + +### Unique Web Browsers for Linux + +Most of the users prefer to stick with the mainstream options because of security updates and future upgrades, but there are some different options as well. And, some exclusive to Linux users. + +### 8\. GNOME Web or Epiphany + +![][26] + +**Pros** + + * Minimal + * Open Source + + + +**Cons** + + * Lacks many features + * No cross-platform support + + + +Epiphany browser is the default GNOME browser. elementary OS utilizes it as its default web browser. + +It is a minimal browser that offers a clean and elegant user experience. You cannot sync your bookmarks or history, so you need to manually export them if you want to back them up or transfer to another browser. + +[GNOME Web][27] + +#### How to Install GNOME Web? + +You may find it pre-installed in some Linux distros. If not, you can check out its [Flatpak package][28] to install the latest version on any Linux distro. + +### 9\. Falkon + +![][29] + +**Pros** + + * Firefox-based alternative + + + +**Cons** + + * Not a replacement to Firefox + * No cross-platform support + + + +Falkon is a Firefox-based browser with privacy in mind. It should be good enough for basic web browsing, but it may not be a solution for your daily driver. + +You can explore more about it and get the installation instructions in our dedicated [article on Falkon browser][30]. + +[Falkon][31] + +### 10\. Nyxt + +![][32] + +**Pros** + + * Highly customizable + * Keyboard use focused + + + +**Cons** + + * Suitable for certain users + * Lack of cross-platform support + + + +Nyxt is an interesting web browser built for power keyboard users. You can browse and navigate the web using keyboard shortcuts. + +To know more about it and the installation instructions, go through our detailed article on [Nyxt browser][33]. + +Nyxt + +### Wrapping Up + +When it comes to Linux, you get a variety of choices available to pick. I have deliberately skipped [command line based web browsers like Lynx][34] here. + +So, what would be your selection for the best web browser? + +Moreover, I’d be curious to know what do you look for when installing a web browser for your system? + +Feel free to share your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-browsers-ubuntu-linux/ + +作者:[Ankush Das][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/web-browser-ubuntu.png?resize=800%2C450&ssl=1 +[2]: https://itsfoss.com/open-source-browsers-linux/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/08/vivaldi-screenshot.png?resize=800%2C502&ssl=1 +[4]: https://news.itsfoss.com/vivaldi-4-0-release/ +[5]: https://vivaldi.com +[6]: https://itsfoss.com/install-deb-files-ubuntu/ +[7]: https://itsfoss.com/install-rpm-files-fedora/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/firefox-proton.png?resize=800%2C450&ssl=1 +[9]: https://www.mozilla.org/en-US/firefox/new/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/chromium-screenshot.png?resize=800%2C558&ssl=1 +[11]: https://news.itsfoss.com/is-google-locking-down-chrome/ +[12]: https://www.chromium.org +[13]: https://itsfoss.com/install-chromium-ubuntu/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/google-chrome-screenshot.png?resize=800%2C557&ssl=1 +[15]: https://www.google.com/chrome/ +[16]: https://itsfoss.com/install-chrome-ubuntu/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/07/brave-ui-new.jpg?resize=800%2C450&ssl=1 +[18]: https://itsfoss.com/brave-vs-firefox/ +[19]: https://itsfoss.com/brave-web-browser/ +[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/opera-screenshot.png?resize=800%2C543&ssl=1 +[21]: https://www.opera.com/gx +[22]: https://www.opera.com/ +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/04/microsoft-edge-on-linux.png?resize=800%2C439&ssl=1 +[24]: https://www.microsoftedgeinsider.com/en-us/ +[25]: https://itsfoss.com/microsoft-edge-linux/ +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/gnome-web.png?resize=800%2C450&ssl=1 +[27]: https://apps.gnome.org/en-GB/app/org.gnome.Epiphany/ +[28]: https://flathub.org/apps/details/org.gnome.Epiphany +[29]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2019/12/falkon-browser-1.png?resize=800%2C450&ssl=1 +[30]: https://itsfoss.com/falkon-browser/ +[31]: https://www.falkon.org +[32]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/nyxt-browser-settings.png?resize=800%2C617&ssl=1 +[33]: https://itsfoss.com/nyxt-browser/ +[34]: https://itsfoss.com/terminal-web-browsers/ From 3b1be902e0d8e976ad1aba073167f80315b1ac2c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:04:05 +0800 Subject: [PATCH 285/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?20=20essential=20Linux=20commands=20for=20every=20user?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 20 essential Linux commands for every user.md --- ...essential Linux commands for every user.md | 255 ++++++++++++++++++ 1 file changed, 255 insertions(+) create mode 100644 sources/tech/20210901 20 essential Linux commands for every user.md diff --git a/sources/tech/20210901 20 essential Linux commands for every user.md b/sources/tech/20210901 20 essential Linux commands for every user.md new file mode 100644 index 0000000000..9bfb9aac60 --- /dev/null +++ b/sources/tech/20210901 20 essential Linux commands for every user.md @@ -0,0 +1,255 @@ +[#]: subject: "20 essential Linux commands for every user" +[#]: via: "https://opensource.com/article/21/9/essential-linux-commands" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +20 essential Linux commands for every user +====== +From new user to power user, here are 20 Linux commands that will make +your life easier. +![Command line prompt][1] + +Typing commands into a darkened terminal window may seem antiquated to some, but for many computer users, it's the most efficient, most accessible, and clearest way to accomplish nearly any task a computer is capable of performing. These days, thanks to all the projects that bring open source commands to non-open platforms like macOS and Windows, terminal commands are relevant to everybody, not just Linux and BSD users. It may surprise you to learn that there are thousands of commands installed on an average [POSIX][2] computer, but of course, a good many of those aren't really intended to be used, at least not directly or regularly. Some commands are more universally useful than others, and still fewer are absolutely essential for effective terminal use. + +Here are the top 20 commands a terminal user might find themselves using: + +### cd + +Outside of a terminal, you click on icons to move from one folder to another, but in the terminal, you use `cd`. The `cd` command, which stands for _change directory_, is how you move through a Linux system. It's the fastest and most direct route from one place to another. + +For instance, on the desktop, when you want to move from your home directory (the place you keep all of your folders) to a folder called `presentations`, then you might first have to open your `Documents` folder, then open a folder called `work`, then a `projects` folder, and then the `conference` folder, and finally the `presentations` folder, which contains your exciting LibreOffice Impress slideshow. That's a lot of double-clicking. It may also be a lot of moving around on the screen, depending on where new windows appear, and a lot of waypoints for your brain to track. Many people circumvent this seemingly minor task by keeping _everything_ on their desktop. + +Terminal users avoid this issue by just typing: + + +``` +`$ cd ~/Documents/work/projects/conference/presentations` +``` + +Experienced terminal users don't even bother typing all of that. They use the **Tab** key to autocomplete the words for them. And sometimes, you don't even have to resort to autocompletion. You can use wildcards instead: + + +``` +`$ cd ~/Doc*/work/*/conf*/p*` +``` + +### pwd + +In the words of Buckaroo Banzai: "No matter where you go, there you are." + +When you need to figure out where exactly that is, you use the `pwd` command. The `pwd` stands for _print working directory,_ and that's exactly what it does. The `--physical` (or just `-P` in some implementations) shows your location with all symlinks resolved. + + +``` +$ pwd +/home/tux/presentation + +$ pwd --physical +/home/tux/Documents/work/projects/conference/presentations +``` + +### sed + +Better known as `sed`, the stream editor is a powerful bulk _find and replace_ command, but it's also a legitimate text editor. You can learn to use it by reading my [introductory article][3], and then become an expert with my [advanced tutorial and cheat sheet][4]. + +### grep + +The `grep` command is so ubiquitous that it's often used as a verb ("I'll grep through some files") and a gerund ("grepping some output"). It's a key component when parsing text in your shell, whether you're looking through log files or parsing the output of some other command. It's a way for the busy user to focus on specific information. Given just how much data there is in the computing world, there's no wonder it's a popular command. Go grok grep by reading my [introductory article][5], and then download the [cheat sheet][6]. + +### file + +Use the `file` command when you need to know what type of data a file contains: + + +``` +$ file example.foo +example.foo: RIFF (little-endian) data, Web/P image [...] + +$ file example.bar +example.bar: ELF 64-bit LSB executable, x86-64 [...] +``` + +The `file` command isn't magic, of course. It only reports based on how a file identifies itself, and files can be wrong, corrupted, or disguised. A rigorous inspection with [`hexdump`][7] provides more certainty, but for casual use, the `file` command is convenient. + +### awk + +Awk isn't just a command; it's a literal [programming language][8]. [Download our free Awk ebook][9], learn it, and you'll be writing scripts you never thought possible. + +### curl + +The `curl` command is a [non-interactive web browser][10] for your terminal. It's a [development tool][11] for web and API developers. It's a complex command for its flexibility, but it's worth learning if you want to interact with network services from your terminal smoothly. + +Download our free [`curl` cheat sheet][12], so you can internalize its many options. + +### ps + +Managing your system's resources is mostly up to the kernel, but when you prefer or require a manual approach, there's the `ps` command. Learn about `ps` in my [monitor your Linux system with procps-ng][13] article. + +### cat + +The [`cat` command][14] is short for _concatenate_, and it was very useful once for joining files that had been split (with a command intuitively called `split`) into several small files due to size limitations. Today, `cat` is mostly used as a way to dump the contents of a text file into your terminal for quick reference, unless you use `head`, `tail`, `more`, or `less` for that. + +Despite its almost deprecated original purpose, and despite that several other commands also perform its secondary function, `cat` is still a useful utility. For instance, it can be a stand-in for the copy (`cp`) command: + + +``` +`$ cat myfile.ogg > /backups/myfile.ogg` +``` + +It can reveal inconvenient invisible characters in files. The **Tab** character, which breaks [YAML][15], shows up as `^I` with the `--show-tabs` option: + + +``` +$ cat --show-tabs my.yaml + +\--- + +\- hosts: all +  tasks: +  - name: Make sure the current version of 'sysstat' is installed. +    dnf: +     name: +^I- sysstat +^I- httpd +^I- mariadb-server +     state: latest +``` + +It can show non-printing characters with `--show-nonprinting`, mark the ends of lines with `--show-ends`, provide line numbers with `--number`, and more. + +### find + +The `find` command helps you find files, but thanks to its many options, it can help you find files with a variety of filters and parameters. Learn the basics from my [introductory article][16]. + +And in case you've been wondering why the most fundamental command of all, the humble [`ls` command][17], isn't on this list, it's because of the flexibility of `find`. Not only can find list files: + + +``` +$ find . +./bar.txt +./baz.xml +./foo.txt +[...] +``` + +It can also provide long listings: + + +``` +$ find . -ls +3014803  464 -rw-rw-r--   1 tux users  473385 Jul 26 07:25 ./foo.txt +3014837  900 -rwxrwxr-x   1 tux users  918217 Nov  6  2019 ./baz.xml +3026891  452 -rw-rw-r--   1 tux users  461354 Aug 10 13:41 ./foo.txt +[...] +``` + +It's a technicality, but a neat trick to know. + +### tar + +People sometimes joke about Linux commands by citing BSD's `tar` syntax. In spite of its reputation, the `tar` command can actually be very intuitive. Read my [how to unzip a tar.gz file][18] article to learn the simple secret to rattling off a `tar` command on demand. + +### more or less or most + +Pagers are like `cat`, except they pause their output at the bottom of your screen until you scroll down for more. It's a simple application, but there's nuance to each implementation. Do you scroll with arrow keys or the spacebar? Do you have to quit manually, or does the pager exit at the end of the file it's displaying? What's your preferred search behavior? Choose your favorite pager and set it in your `.bashrc`! + +### ssh and scp + +OpenSSH not only helps secure connections to remote systems it also enables other commands. For instance, for many users, it's their `.ssh` directory that makes it possible for them to interact smoothly with Git repositories, post updates to a website, or log in to their cloud's control plane. + +### mv + +The `mv` command does double-duty: It both [moves files][19] and it [renames files][20]. It has several available safeguards, including `--interactive` and `--no-clobber` options to avoid clobbering an existing file, a `--backup` command to ensure data is preserved until it is verified at its new location, and the `--update` option to ensure that an older version doesn't replace a newer file. + +### sudo + +When you have a single user with a known user name and _all_ the privileges on a system, that user quickly becomes the target of attacks. By eliminating the need for a literal `root` user, the `sudo` command elegantly removes important information about your system from general knowledge. That's not all it does, though. With `sudo`, you can easily manage privileges down to individual commands, users, and groups. You can enable password-less execution of select commands, record user sessions, verify commands with digest validation, [and more][21]. + +### alias + +Turn long commands into easy-to-remember shortcuts by using the `alias` command: + + +``` +`$ alias ls='ls --classify --almost-all --ignore-backups --color'` +``` + +### clear + +Sometimes your terminal gets cluttered. There's nothing like a nice, fresh screen after typing `clear` (or pressing **Ctrl+L** in some shells). + +### setfacl + +Traditionally, POSIX file permissions were determined by `chown` and `chmod`. Systems have become more complex, though, so there's a command to provide a little more flexibility. The `setfacl` command lets you create an [Access Control List (ACL)][22], granting permissions to arbitrary users and setting default permissions for folders and the contents created within them. + +### netcat + +Not every user needs netcat (`nc`), but few who use it ever want to give it up. The `nc` command is an all-purpose network connection tool. + +It can connect to a port, similar to `telnet`: + + +``` +`$ nc -u 192.168.0.12 80` +``` + +It can ping a port, similar to `ping`: + + +``` +`$ nc -zvn 192.168.0.12 25` +``` + +It can probe for open ports, similar to `nmap`: + + +``` +`$ nc -zv 192.168.0.12 25-80` +``` + +And that's just a small sample. + +### you + +The Linux terminal is, in part, about creative problem-solving. When you learn commands, you're also learning building blocks you can use to create your own commands. Many of the commands in my [shell history][23] are shell scripts I've written myself. The result is that my workflow is customized to how I want to work. Essential commands in your shell can also be the ones you design for your own efficacy and comfort. Spend some time getting to know some great commands, and then build your own. And when you hit upon something really good, make it open source so you can share your ideas with others! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/essential-linux-commands + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/seth +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: https://opensource.com/article/20/12/sed +[4]: https://opensource.com/article/21/3/sed-cheat-sheet +[5]: https://opensource.com/article/21/3/grep-cheat-sheet +[6]: https://opensource.com/downloads/grep-cheat-sheet +[7]: https://opensource.com/article/19/8/dig-binary-files-hexdump +[8]: https://opensource.com/article/21/1/learn-awk +[9]: https://opensource.com/article/20/9/awk-ebook +[10]: https://opensource.com/article/20/5/curl-cheat-sheet +[11]: https://www.redhat.com/sysadmin/use-curl-api +[12]: https://opensource.com/downloads/curl-command-cheat-sheet +[13]: https://opensource.com/article/21/8/linux-procps-ng +[14]: https://opensource.com/article/19/2/getting-started-cat-command +[15]: https://www.redhat.com/sysadmin/yaml-beginners +[16]: https://opensource.com/article/21/8/find-files-and-directories-find +[17]: https://opensource.com/article/19/7/master-ls-command +[18]: https://opensource.com/article/17/7/how-unzip-targz-file +[19]: https://opensource.com/article/21/8/move-files-linux +[20]: https://opensource.com/article/21/8/rename-file-linux-terminal +[21]: https://opensource.com/article/19/10/know-about-sudo +[22]: https://opensource.com/article/20/3/external-drives-linux +[23]: https://opensource.com/article/18/6/history-command From f9d427b042a1fe43949019cf29f8e73b24dd62f2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:04:19 +0800 Subject: [PATCH 286/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?Control=20your=20Raspberry=20Pi=20remotely=20with=20your=20smar?= =?UTF-8?q?tphone?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md --- ...pberry Pi remotely with your smartphone.md | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md diff --git a/sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md b/sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md new file mode 100644 index 0000000000..529b3c7f70 --- /dev/null +++ b/sources/tech/20210901 Control your Raspberry Pi remotely with your smartphone.md @@ -0,0 +1,212 @@ +[#]: subject: "Control your Raspberry Pi remotely with your smartphone" +[#]: via: "https://opensource.com/article/21/9/raspberry-pi-remote-control" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Control your Raspberry Pi remotely with your smartphone +====== +Control the GPIOs of your Raspberry Pi remotely with your smartphone. +![A person looking at a phone][1] + +Wouldn't it be nice to control the general-purpose input/outputs (GPIOs) of the Raspberry Pi remotely with your smartphone? If you can answer the question in the affirmative, I would like to introduce you to a simple way to implement this. Writing this article, I have no specific application in mind, but I can think of combining it with lawn irrigation, any illumination, or a garage door opener. + +Anyway, all you need to get started is a Raspberry Pi and a smartphone. The actual logic is already available on GitHub, so even without programming skills, you will be able to follow the steps described in this article. + +### Architecture + +We do the major work with [Pythonic][2]—a graphical Python programming framework I develop in my leisure. Pythonic brings a [Telegram][3] bot programming element with it, which acts as our smartphone interface. A significant advantage of this setup is that it is scalable regarding the number of clients: You can decide whether you want to control the GPIOs only by yourself, share them with your relatives or friends, or share the control capabilities with the public. Of course, a prerequisite is permanent internet access to communicate between the Telegram server and the client. To establish internet access, you could use either the Ethernet interface or the WiFi functionality of the Raspberry Pi. + +### Install Pythonic + +To get started, you have to install Pythonic on your Raspberry Pi. The easiest way of doing that is to flash the SD card with the preconfigured Pythonic image available on [sourceforge.net][4]. + +Download and unzip the image and flash it to the SD card of the Raspberry Pi. On Windows, you can use [balenaEtcha][5] for it. On Linux, you can do it with the onboard tools. + + 1. Plugin the SD card and check under which device it is showing up by typing `lsblk -p`. + +![Using lsblk -p to check under which device your SD card shows ][6] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + + 2. In the screenshot above, the SD card device is `/dev/sdc`, and my systems automatically mounted two partitions that were found on it. If this is the case, unmount it by typing `umount /dev/sdc1 && umount /dev/sdc2`. + + 3. Flash the SD card with the following command: `dd if=~/Downloads/Pythonic-1.7.img of=/dev/sdc bs=32M, conv=fsync`.  +**Attention***: *This will delete all previous files on the SD card. + + 4. The flashing process will take a while. +Once the process is finished, put the SD card back in your Raspberry Pi and boot it up. + + + + +### Establishing a connection + +The Pythonic image has no pre-installed desktop. The whole configuration is web-based, so you must establish a TCP/IP connection. It is straightforward to connect using an ordinary internet router. If you don't have access to such a router, you can also establish a connection over the onboard universal asynchronous receiver/transmitter ****(UART) device to configure the Ethernet or WiFi interface. + +#### Locale DNS + +By default, the Pythonic image is configured to acquire an IP address by DHCP. Your internet router at home usually runs a DHCP server that distributes IP addresses to connected devices. Make a connection between a free Ethernet port of your internet router and the Ethernet port on your Raspberry Pi and boot it up. + +You can now try to access the web-based GUI from a device within your local network. If the DNS in your local network works properly, open a browser and navigate to http ://PythonicRPI:7000/ to open the programming GUI. + +#### Locale IP + +I assume your router also offers a graphical configuration GUI. The configuration GUI provides information about the devices in your local network. You can find the IP address of your local router by typing `ip route`. + +In my case, the route is available under 192.168.188.1. Now login to your router's configuration page and check which IP was the Raspberry Pi given. + +![Viewing active connections][8] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +In my network, the Raspberry Pi is available under 192.168.188.63, so I can access the GUI at http ://192.168.188.63:7000/. + +#### UART + +Put the SD card back into the card reader and mount the _boot_ partition. Open the _config.txt_ on the _boot_ partition and add the following line to the end: + + +``` +`enable_uart=1` +``` + +Put the SD card back in the Raspberry Pi and boot it up. You can now establish a console connection with a UART-USB converter to set up a static IP address or configure a WiFi connection. + +![Establishing a UART connection][9] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +The default connection parameters are: + + * TxD: GPIO14 + * RxD: GPIO15 + * Ground: Pin 6 or 14 + * Baud rate: 115200 + * Data bits: 8 + * Parity bit: None + * Stop bits: 1 + + + +You can find more information on [elinux.org][10]. + +### Uploading the configuration + +To proceed with the upcoming steps, download the example files from [github][11] to your local hard drive. + +![GitHub example files repository ][12] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +The example consists of several files of two elementary types: + + * `*.py-files`—Contains the actual implementation of specific functionality. + * `current_config.json`—This file describes the configured elements, the links between the elements, and the variable configuration of the elements. + + + +This example is a slightly modified version of the already available reference implementation. You can access it by dragging and dropping the files from the left sidebar to the working area. + +Now upload the configuration to your target: + +![Pythonic GUI overview][13] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +With the blue-marked button, you upload the `current_config.json` to the target. You can upload only valid configuration files. After uploading, you can find the file on the target under `/home/pythonic/Pythonic/current_config.json`. + +With the green-marked button, you upload each `*.py-files`. Afterward, the `*.py-files` can be found under `/home/pythonic/Pythonic/executables`. + +It is possible to upload any kind of file to the `executables` folder because I plan to support binary executables in the future. + +However, so that the configuration works, the actual implementation must be available for each element described in `current_config.json`. + +### Setup a Telegram Bot + +The configuration should now look like this: + +![Pythonic GPIO remote configuration][14] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +Well done! But this setup won't work yet. Try to start this configuration by clicking **Play** on the _ManualScheduler - 0x5f8125f5_ element. The connected Telegram element will start but then immediately quit. This is because the Telegram element needs some additional configuration: Right-click on the Telegram element. You should now see pop-up windows like this: + +![Pop-up for Phythonic GPIO remote Telegram][15] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +You have to provide a Telegram bot token to communicate with the server. The process of creating a bot token is described on [core.telegram.org][16]. + +In a nutshell: Start a chat with the [BotFather][17] and create a bot with the `/newbot` command. At the end of the process, the BotFather will provide you a token that you can copy and paste to the Telegram element. + +That's it. Now you should be able to start the Telegram element by clicking on the play button on the _ManualScheduler - 0x5f8125f5_ element. The Telegram element should now be active, which can be seen from the green frame. + +![ Active RPI Telegram element][18] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +The spinning bar on the bottom info line indicates a working connection with the backend. + +Start a chat with your newly created bot by typing _@<name-of-your-bot>_ in the search field of Telegram. Click **Start** to get the initial state of the GPIOs. I named my bot _RPIremoteIO_: + +![Start RPI Telegram][19] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +### Debugging and Modification + +Open a new tab in your browser and navigate to http ://PythonicRPI:8000/. This will open the pre-installed [code-server][20] IDE. On the left pane, click on the files button and open `telegram_2ca7cd73.py` : + +![RPI code server IDE][21] + +(Stephan Avenwedde, [CC-BY SA 4.0][7]) + +You should now be able to start debugging and follow the path of execution like in the following screen recording: + + + +The Telegram element uses an [inline keyboard][22] which shows the target state of GPIO4 and GPIO5. This way, several users could control the state of GPIOs without disturbing each other because the new target state for the GPIOs is always provided to all subscribers. + +### Conclusion + +With this example, you should get a feeling of how everything connects. You can adapt the example as you like: Change or add additional GPIOs, use the analog features or get the input state on demand. If you connect a suitable relay, you could also drive higher loads with the Raspberry Pi. I am sure you will do something great with it! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/raspberry-pi-remote-control + +作者:[Stephan Avenwedde][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/hansic99 +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/idea_innovation_mobile_phone.png?itok=RqVtvxkd (A person looking at a phone) +[2]: https://github.com/hANSIc99/Pythonic +[3]: https://telegram.org/ +[4]: https://sourceforge.net/projects/pythonicrpi/ +[5]: https://www.balena.io/etcher/ +[6]: https://opensource.com/sites/default/files/uploads/pi_gen_lsblk_mounted_1.png (Using lsblk -p to check under which device your SD card shows ) +[7]: https://creativecommons.org/licenses/by-sa/4.0/ +[8]: https://opensource.com/sites/default/files/uploads/active_connections.png (Viewing active connections) +[9]: https://opensource.com/sites/default/files/uploads/pythonic_rpi_uart.jpg (Establishing a UART connection) +[10]: https://elinux.org/RPi_Serial_Connection +[11]: https://github.com/hANSIc99/Pythonic/tree/master/examples/rpi_telegram_remote_io +[12]: https://opensource.com/sites/default/files/uploads/github_example_remote_gpio.png (GitHub example files repository ) +[13]: https://opensource.com/sites/default/files/uploads/pythonic_gui_overview.png (Pythonic GUI overview) +[14]: https://opensource.com/sites/default/files/uploads/pythonic_gpio_remote_config.png (Pythonic GPIO remote configuration) +[15]: https://opensource.com/sites/default/files/uploads/pythonic_gpio_remote_telegram.png (Pop-up for Phythonic GPIO remote Telegram) +[16]: https://core.telegram.org/bots#6-botfather +[17]: https://t.me/botfather +[18]: https://opensource.com/sites/default/files/uploads/rpi_telegram_active.png (Active RPI Telegram element) +[19]: https://opensource.com/sites/default/files/uploads/rpi_start_telegram.png (Start RPI Telegram) +[20]: https://github.com/cdr/code-server +[21]: https://opensource.com/sites/default/files/uploads/rpi_code-server_ide.png (RPI code server IDE) +[22]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating From 1739676bd01b702a90d2b45c012199906bce5a14 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 2 Sep 2021 05:04:32 +0800 Subject: [PATCH 287/290] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901=20?= =?UTF-8?q?What=20are=20container=20runtimes=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210901 What are container runtimes.md --- .../20210901 What are container runtimes.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20210901 What are container runtimes.md diff --git a/sources/tech/20210901 What are container runtimes.md b/sources/tech/20210901 What are container runtimes.md new file mode 100644 index 0000000000..eaba30fae8 --- /dev/null +++ b/sources/tech/20210901 What are container runtimes.md @@ -0,0 +1,97 @@ +[#]: subject: "What are container runtimes?" +[#]: via: "https://opensource.com/article/21/9/container-runtimes" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What are container runtimes? +====== +Take a deep dive into container runtimes so you can understand how +container environments are built. +![Ships at sea on the web][1] + +In my examination of [container images][2], I discussed container fundamentals, but now it's time to delve deeper into container runtimes so you can understand how container environments are built. The information in this article is in part extracted from the [official documentation][3] of the Open Container Initiative (OCI), the open standard for containers, so this information is relevant regardless of your container engine. + +### Container runtimes + +So what really happens in the backend when you run a command like `podman run` or `docker run` command? Here is a step-by-step overview for you: + + 1. The image is pulled from an image registry if it not available locally + 2. The image is extracted onto a copy-on-write filesystem, and all the container layers overlay each other to create a merged filesystem + 3. A container mount point is prepared + 4. Metadata is set from the container image, including settings like overriding CMD, ENTRYPOINT from user inputs, setting up SECCOMP rules, etc., to ensure container runs as expected + 5. The kernel is alerted to assign some sort of isolation, such as process, networking, and filesystem, to this container (namespaces) + 6. The kernel is also alerted to assign some resource limits like CPU or memory limits to this container (cgroups) + 7. A system call (syscall) is passed to the kernel to start the container + 8. SELinux/AppArmor is set up + + + +Container runtimes take care of all of the above. When we think about container runtimes, the things that come to mind are probably runc, lxc, containerd, rkt, cri-o, and so on. Well, you are not wrong. These are container engines and container runtimes, and each is built for different situations. + +_Container runtimes_ focus more on running containers, setting up namespace and cgroups for containers, and are also called lower-level container runtimes. Higher-level container runtimes or container engines focus on formats, unpacking, management, and image-sharing. They also provide APIs for developers. + +### Open Container Initiative (OCI) + +The Open Container Initiative (OCI) is a Linux Foundation project. Its purpose is to design certain open standards or a structure around how to work with container runtimes and container image formats. It was established in June 2015 by Docker, rkt, CoreOS, and other industry leaders. + +It does this using two specifications: + +#### 1\. Image Specification (image-spec) + +The goal of this specification is to enable the creation of interoperable tools for building, transporting, and preparing a container image to run. + +The high-level components of the spec include: + + * [Image Manifest][4] — a document describing the elements that make up a container image + * [Image Index][5] — an annotated index of image manifests + * [Image Layout][6] — a filesystem layout representing the contents of an image + * [Filesystem Layer][7] — a changeset that describes a container’s filesystem + * [Image Configuration][8] — a document determining layer ordering and configuration of the image suitable for translation into a [runtime bundle][9] + * [Conversion][10] — a document explaining how this translation should occur + * [Descriptor][11] — a reference that describes the type, metadata, and content address of referenced content + + + +#### 2\. Runtime specification (runtime-spec) + +This specification aims to define the configuration, execution environment, and lifecycle of a container. The config.json file provides the container configuration for all supported platforms and details the field that enables the creation of a container. The execution environment is detailed along with the common actions defined for a container’s lifecycle to ensure that applications running inside a container have a consistent environment between runtimes. + +The Linux container specification uses various kernel features, including namespaces, cgroups, capabilities, LSM, and filesystem jails to fulfill the spec. + +### Now you know + +Container runtimes are managed by the OCI specifications to provide consistency and interoperability. Many people use containers without the need to understand how they work, but understanding containers is a valuable advantage when you need to troubleshoot or optimize how you use them. + +* * * + +_This article is based on a [techbeatly][12] article and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/container-runtimes + +作者:[Nived V][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/nivedv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web) +[2]: https://opensource.com/article/21/8/container-fundamentals-2 +[3]: https://github.com/opencontainers +[4]: https://github.com/opencontainers/image-spec/blob/master/manifest.md +[5]: https://github.com/opencontainers/image-spec/blob/master/image-index.md +[6]: https://github.com/opencontainers/image-spec/blob/master/image-layout.md +[7]: https://github.com/opencontainers/image-spec/blob/master/layer.md +[8]: https://github.com/opencontainers/image-spec/blob/master/config.md +[9]: https://github.com/opencontainers/runtime-spec +[10]: https://github.com/opencontainers/image-spec/blob/master/conversion.md +[11]: https://github.com/opencontainers/image-spec/blob/master/descriptor.md +[12]: https://medium.com/techbeatly/container-runtimes-deep-dive-77eb0e511939 From dfc0fd50fa4b2bf60dbb4542bc8e7e44944436f9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 2 Sep 2021 08:36:37 +0800 Subject: [PATCH 288/290] translated --- ...to Download Audio Only Using youtube-dl.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) rename {sources => translated}/tech/20210820 How to Download Audio Only Using youtube-dl.md (55%) diff --git a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md b/translated/tech/20210820 How to Download Audio Only Using youtube-dl.md similarity index 55% rename from sources/tech/20210820 How to Download Audio Only Using youtube-dl.md rename to translated/tech/20210820 How to Download Audio Only Using youtube-dl.md index 23ebe4e425..7fae01b4e2 100644 --- a/sources/tech/20210820 How to Download Audio Only Using youtube-dl.md +++ b/translated/tech/20210820 How to Download Audio Only Using youtube-dl.md @@ -7,34 +7,34 @@ [#]: publisher: " " [#]: url: " " -How to Download Audio Only Using youtube-dl +如何使用 youtube-dl 只下载音频 ====== -[youtube-dl][1] is a versatile command line tool for downloading videos from YouTube and many other websites. I use it for making back up of my own YouTube videos. +[youtube-dl][1] 是一个多功能的命令行工具,用于从 YouTube 和许多其他网站下载视频。我用它来做我自己的 YouTube 视频的备份。 -By default, you [use youtube-dl for downloading videos][2]. How about extracting only the audio with youtubde-dl? That’s very simple actually. Let me show you the steps. +默认情况下,你[使用 youtube-dl 下载视频][2]。用 youtube-dl 只提取音频怎么样? 其实很简单。让我告诉你步骤。 -Attention +注意 -Downloading videos from websites could be against their policies. It’s up to you if you choose to download videos or audio. +从网站下载视频可能违反他们的政策。这取决于你是否选择下载视频或音频。 -### Download only audio with youtube-dl +### 使用 youtube-dl 只下载音频 -Please make sure that you have installed youtube-dl on your Linux distribution first. +请确保你已经在你的 Linux 发行版上安装了 youtube-dl。 ``` sudo snap install youtube-dl ``` -If you only want to download audio from a YouTube video, you can use the -x option with youtube-dl. This extract-audio option converts the video files to audio-only files. +如果你只想从 YouTube 视频中下载音频,你可以使用 youtube-dl 的 -x 选项。这个提取音频的选项将视频文件转换为纯音频文件。 ``` youtube-dl -x video_URL ``` -The file is saved in the same directory from where you ran the youtube-dl command. +该文件被保存在你运行 youtube-dl 命令的同一目录下。 -Here’s an example where I downloaded the voice-over of our Zorin OS 16 review video. +这是我下载 Zorin OS 16 评论视频的画外音的示例。 ``` youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ @@ -45,15 +45,15 @@ youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ [ffmpeg] Post-process file Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a exists, skipping ``` -Did you notice the audio format? It is in .m4a format. You may specify the audio format to something of your choice. +你注意到音频格式了吗?它是 .m4a 格式。你可以把音频格式指定为你所选择的格式。 -Say you want to extract the audio in MP3 format. You can use it like this: +比如你想提取 MP3 格式的音频。你可以像这样使用它: ``` youtube-dl -x --audio-format mp3 video_URL ``` -Here’s the same example I showed previously. You can see that it [uses ffmpeg to convert][3] the m4a file into mp3. +下面是我之前展示的同一个例子。你可以看到它[使用 ffmpeg 转换][3] m4a 文件为 mp3: ``` youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=m_PmLG7HqbQ @@ -65,33 +65,33 @@ youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=m_PmLG7HqbQ Deleting original file Zorin OS 16 Review - It's a Visual Masterpiece-m_PmLG7HqbQ.m4a (pass -k to keep) ``` -### Download entire YouTube playlist in MP3 format +### 以 MP3 格式下载整个 YouTube 播放列表 -Yes, you can totally do that. The main thing is to get the URL of the playlist here. It is typically in the following format: +是的,你完全可以这样做。最主要的是要在这里得到播放列表的 URL。它通常是以下格式: ``` https://www.youtube.com/playlist?list=XXXXXXXXXXXXXXXXXXX ``` -To get the URL of a playlist, click on its name when the playlist is being displayed in the right sidebar. +要获得一个播放列表的 URL,当播放列表显示在右边栏时,点击其名称。 ![Click on the playlist title][4] -It will take you to the playlist page and you can copy the URL here. +它将带你到播放列表页面,你可以在这里复制 URL。 ![Grab the playlist URL][5] -Now that you have the playlist URL, you can use it to download the audio files in MP3 format in the following fashion: +现在你有了播放列表的 URL,你可以用它来下载 MP3 格式的音频文件,方法如下: ``` youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" playlist_URL ``` -That scary looking `-o "%(title)s.%(ext)s"` specifies the output file (with option -o) and instructs it to use the title of the video and the extension (mp3 in this case) for naming the audio files. +那个看起来很可怕的 `-o "%(title)s.%(ext)s"` 指定了输出文件(带选项 -o),并指示它使用视频的标题和扩展名(本例为 mp3)来命名音频文件。 ![][6] -I hope you find this quick tip helpful. Enjoy the audio files :) +我希望你觉得这个技巧对你有帮助。享受音频文件吧 :) -------------------------------------------------------------------------------- @@ -99,7 +99,7 @@ via: https://itsfoss.com/youtube-dl-audio-only/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[geekpi](https://github.com/geekpi) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From ac0b718005cb257acb1201ecaf4474145dbf185f Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 2 Sep 2021 08:44:57 +0800 Subject: [PATCH 289/290] translating --- sources/tech/20210831 What is a container image.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210831 What is a container image.md b/sources/tech/20210831 What is a container image.md index 3d96567fc8..deefbe18d6 100644 --- a/sources/tech/20210831 What is a container image.md +++ b/sources/tech/20210831 What is a container image.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/container-image" [#]: author: "Nived V https://opensource.com/users/nivedv" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From c1d5123b6b43321735768accb3b440798cb5ee68 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 2 Sep 2021 14:36:49 +0800 Subject: [PATCH 290/290] Delete 20210902 .md --- sources/tech/20210902 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210902 .md diff --git a/sources/tech/20210902 .md b/sources/tech/20210902 .md deleted file mode 100644 index 90bde3e2c1..0000000000 --- a/sources/tech/20210902 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/recover-root-password-rhel-8-centos-8/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/recover-root-password-rhel-8-centos-8/ - -作者:[][a] -选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) - -本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 - -[a]: -[b]: https://github.com/lujun9972