From 04256f5fb656a7580d91c68441bb2a78b43b88b1 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 31 Jul 2021 08:39:27 +0800 Subject: [PATCH 0001/1588] 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 0002/1588] 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 0003/1588] 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 0004/1588] 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 0005/1588] 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 b94ca26a5c0868d4671397a089e1cc9dfc3f048c Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 14 Aug 2021 09:10:24 +0800 Subject: [PATCH 0006/1588] 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 0007/1588] 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 0008/1588] 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 0009/1588] 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 e48779c9d6c535765182ca2d72cd715df8810b14 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 14 Aug 2021 18:46:21 +0800 Subject: [PATCH 0010/1588] 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 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 0011/1588] 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 0012/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210818?= =?UTF-8?q?=20below:=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 0013/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819?= =?UTF-8?q?=20Debian=20vs=20Ubuntu:=20What=E2=80=99s=20the=20Difference=3F?= =?UTF-8?q?=20Which=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 0014/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210818?= =?UTF-8?q?=20A=20guide=20to=20database=20replication=20with=20open=20sour?= =?UTF-8?q?ce?= 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 0015/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210818?= =?UTF-8?q?=20Build=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 0016/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210818?= =?UTF-8?q?=20Setting=20new=20expectations=20for=20open=20source=20maintai?= =?UTF-8?q?ners?= 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 0017/1588] 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 0018/1588] 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 0019/1588] 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 0020/1588] 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 0021/1588] 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 0022/1588] 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 0023/1588] 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 0024/1588] 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 0025/1588] 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 0026/1588] 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 0027/1588] [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 0028/1588] 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 0029/1588] 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 0030/1588] 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 0031/1588] 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 0032/1588] 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 0033/1588] 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 0034/1588] 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 0035/1588] 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 0036/1588] 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 0037/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210820?= =?UTF-8?q?=20How=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 0038/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819?= =?UTF-8?q?=20Check=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 0039/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819?= =?UTF-8?q?=20Short=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 0040/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819?= =?UTF-8?q?=20A=20guide=20to=20understanding=20your=20team's=20implicit=20?= =?UTF-8?q?values=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 0041/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210819?= =?UTF-8?q?=20Zorin=20OS=2016=20Released=20with=20Stunning=20New=20Look=20?= =?UTF-8?q?and=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 0042/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210819?= =?UTF-8?q?=20KaOS=202021.08=20Release=20Focuses=20on=20Visual=20Changes?= =?UTF-8?q?=20and=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 0043/1588] 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 0044/1588] 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 0045/1588] 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 0046/1588] 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 0047/1588] 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 0048/1588] 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 0049/1588] 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 0050/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210820?= =?UTF-8?q?=20MAKE=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 0051/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210820?= =?UTF-8?q?=20Check=20file=20status=20on=20Linux=20with=20the=20stat=20com?= =?UTF-8?q?mand?= 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 0052/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210820?= =?UTF-8?q?=203=20steps=20for=20managing=20a=20beginner-friendly=20open=20?= =?UTF-8?q?source=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 0053/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210821?= =?UTF-8?q?=2010=20Things=20to=20Do=20After=20Installing=20elementary=20OS?= =?UTF-8?q?=206=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 0054/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210820?= =?UTF-8?q?=20Intel=E2=80=99s=20XeSS=20Could=20be=20the=20Open-Source=20Al?= =?UTF-8?q?ternative=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 0055/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210820?= =?UTF-8?q?=20SparkyLinux=206.0=20Release=20is=20based=20on=20Debian=2011?= =?UTF-8?q?=20and=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 0056/1588] 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 0057/1588] 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 0058/1588] 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 0059/1588] 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 0060/1588] 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 0061/1588] 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 0062/1588] 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 0063/1588] 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 0064/1588] 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 0065/1588] 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 0066/1588] 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 0067/1588] 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 0068/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210822?= =?UTF-8?q?=20Linux=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 0069/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210821?= =?UTF-8?q?=20How=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 0070/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210821?= =?UTF-8?q?=20SparkyLinux=206.0=20=E2=80=9CPo-Tolo=E2=80=9D=20Released=20B?= =?UTF-8?q?ased=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 0071/1588] 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 0072/1588] 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 0073/1588] 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 0074/1588] 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 0075/1588] 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 0076/1588] 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 0077/1588] 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 0078/1588] 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 0079/1588] 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 0080/1588] 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 0081/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210822?= =?UTF-8?q?=20How=20to=20Monitor=20Log=20Files=20in=20Real=20Time=20in=20L?= =?UTF-8?q?inux=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 0082/1588] 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 0083/1588] 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 0084/1588] 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 0085/1588] 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 0086/1588] 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 0087/1588] 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 0088/1588] 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 0089/1588] 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 0090/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210823?= =?UTF-8?q?=20Apps=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 0091/1588] 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 0092/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210824?= =?UTF-8?q?=20Ulauncher:=20A=20Super=20Useful=20Application=20Launcher=20f?= =?UTF-8?q?or=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 0093/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210823?= =?UTF-8?q?=20Access=20your=20iPhone=20on=20Linux=20with=20this=20open=20s?= =?UTF-8?q?ource=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 0094/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210823?= =?UTF-8?q?=20Write=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 0095/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210823?= =?UTF-8?q?=20KDE=20Plasma=205.23=20=E2=80=93=20New=20Features=20and=20Rel?= =?UTF-8?q?ease=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 0096/1588] 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 0097/1588] 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 0098/1588] 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 0099/1588] 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 0100/1588] 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 0101/1588] 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 0102/1588] 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 0103/1588] [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 0104/1588] 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 0105/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210825?= =?UTF-8?q?=20Icons=20Look=20too=20Small=3F=20Enable=20Fractional=20Scalin?= =?UTF-8?q?g=20to=20Enjoy=20Your=20HiDPI=204K=20Screen=20in=20Ubuntu=20Lin?= =?UTF-8?q?ux?= 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 0106/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210824?= =?UTF-8?q?=20How=20to=20include=20options=20in=20your=20Bash=20shell=20sc?= =?UTF-8?q?ripts?= 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 0107/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210824?= =?UTF-8?q?=20Solve=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 0108/1588] 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 0109/1588] 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 0110/1588] 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 0111/1588] 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 0112/1588] 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 0113/1588] 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 0114/1588] 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 0115/1588] 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 0116/1588] 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 0117/1588] 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 0118/1588] 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 0119/1588] 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 0120/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210825?= =?UTF-8?q?=20Auto-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 0121/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210825?= =?UTF-8?q?=20Use=20this=20open=20source=20tool=20for=20automated=20unit?= =?UTF-8?q?=20testing?= 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 0122/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210825?= =?UTF-8?q?=2010=20steps=20to=20more=20open,=20focused,=20and=20energizing?= =?UTF-8?q?=20meetings?= 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 0123/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210826?= =?UTF-8?q?=20Elementary=20OS=206=20Odin=20Review=20=E2=80=93=20Late=20Arr?= =?UTF-8?q?ival=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 0124/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210825?= =?UTF-8?q?=20When=20Linus=20Torvalds=20Was=20Wrong=20About=20Linux=20(And?= =?UTF-8?q?=20I=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 0125/1588] 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 0126/1588] 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 0127/1588] 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 0128/1588] 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 0129/1588] 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 0130/1588] 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 0131/1588] 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 0132/1588] 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 0133/1588] 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 0134/1588] 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 0135/1588] 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 0136/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827?= =?UTF-8?q?=20How=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 0137/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210826?= =?UTF-8?q?=2030=20things=20you=20didn't=20know=20about=20the=20Linux=20ke?= =?UTF-8?q?rnel?= 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 0138/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210826?= =?UTF-8?q?=20=E2=80=9CApps=20for=20GNOME=E2=80=9D=20is=20a=20New=20Web=20?= =?UTF-8?q?Portal=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 0139/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210826?= =?UTF-8?q?=20Open=20Source=20Video=20Editor=20OpenShot=202.6=20Released?= =?UTF-8?q?=20With=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 0140/1588] 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 0141/1588] 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 0142/1588] 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 0143/1588] 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 0144/1588] 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 0145/1588] 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 0146/1588] 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 0147/1588] 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 0148/1588] 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 0149/1588] 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 0150/1588] 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 0151/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827?= =?UTF-8?q?=20Automatically=20Light=20Up=20a=20Sign=20When=20Your=20Webcam?= =?UTF-8?q?=20is=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 0152/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827?= =?UTF-8?q?=20Calculate=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 0153/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210827?= =?UTF-8?q?=20Linux=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 0154/1588] 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 0155/1588] 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 0156/1588] 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 0157/1588] 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 18bedb3d9b627292ac633465b8c77bcbdb7f4084 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sat, 28 Aug 2021 17:49:44 +0800 Subject: [PATCH 0158/1588] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ...de to understanding your team-s implicit values and needs.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 127f226ab7..37a2f15229 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 @@ -7,7 +7,7 @@ [#]: 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. From fd463db40c6c7f42d530f594153f48599ea2cfb1 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sat, 28 Aug 2021 17:55:28 +0800 Subject: [PATCH 0159/1588] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ...e to understanding your team-s implicit values and needs.md | 3 +-- 1 file changed, 1 insertion(+), 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 37a2f15229..ec8924e1f2 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 @@ -9,8 +9,7 @@ 了解团队隐含价值观和需求的指南 ====== -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? From 3cba6d87e8da7be8549801b1119334cfb110c065 Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sat, 28 Aug 2021 20:26:12 +0800 Subject: [PATCH 0160/1588] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ...understanding your team-s implicit values and needs.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 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 ec8924e1f2..b6fb24d3ae 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 @@ -12,13 +12,13 @@ 为了增强团队动力,开放的领导可以研究指导成员行为和决策的隐性社会规范。 ![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? +文化在[开放的组织][2]很重要。 但“文化”似乎是一个如此庞大而复杂的概念。我们该如何帮助开放式的团队组织去理解它呢? -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. +一个解决方案可能来自于 [_Rule Makers, Rule Breakers_][4]_的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号_。Gelfand 把所有的国家和文化分成简单的两类, 一类是“严格的”文化另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。 -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. +In this two-part review of _Rule Makers, Rule Breakers_, 我将解释 Gelfand 的论点,并讨论它对在开放性组织中工作的人们有用的方式。 -### 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. 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 0161/1588] 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 0162/1588] 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 0163/1588] 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 0164/1588] 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 0165/1588] 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 0166/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210828?= =?UTF-8?q?=20Parse=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 0167/1588] 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 0168/1588] 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 0169/1588] 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 0170/1588] =?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 0171/1588] 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 0172/1588] 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 0173/1588] 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 0174/1588] 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 0175/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830?= =?UTF-8?q?=20Linux=20Jargon=20Buster:=20What=20is=20sudo=20rm=20-rf=3F=20?= =?UTF-8?q?Why=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 0176/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210829?= =?UTF-8?q?=20Position=20text=20on=20your=20screen=20in=20Linux=20with=20n?= =?UTF-8?q?curses?= 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 0177/1588] 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 0178/1588] 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 0179/1588] 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 0180/1588] 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 0181/1588] 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 0182/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830?= =?UTF-8?q?=20How=20to=20install=20only=20security=20and=20bugfixes=20upda?= =?UTF-8?q?tes=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 0183/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831?= =?UTF-8?q?=20Zulip:=20An=20Interesting=20Open-Source=20Alternative=20to?= =?UTF-8?q?=20Slack?= 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 0184/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830?= =?UTF-8?q?=20Print=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 0185/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210830?= =?UTF-8?q?=20Write=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 0186/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210830?= =?UTF-8?q?=20Linux=20Kernel=205.14=20Released=20Right=20After=20the=2030t?= =?UTF-8?q?h=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 0187/1588] 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 0188/1588] 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 0189/1588] 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 0190/1588] 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 0191/1588] 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 0192/1588] 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 0193/1588] 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 0194/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901?= =?UTF-8?q?=20Ubuntu=20Server=20vs=20Desktop:=20What=E2=80=99s=20the=20Dif?= =?UTF-8?q?ference=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 0195/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831?= =?UTF-8?q?=20What=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 0196/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210831?= =?UTF-8?q?=20How=20my=20team=20built=20an=20open=20source=20learning=20ex?= =?UTF-8?q?perience=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 0197/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210831?= =?UTF-8?q?=20Ransomware=20Disguised=20as=20Open-Source=20Krita=20Painting?= =?UTF-8?q?=20App=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 0198/1588] 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 0199/1588] 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 0200/1588] 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 0201/1588] 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 0202/1588] 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 0203/1588] 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 0204/1588] 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 0205/1588] 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 0206/1588] =?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 0207/1588] 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 0208/1588] 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 0209/1588] 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 0210/1588] 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 0211/1588] 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 0212/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901?= =?UTF-8?q?=20Getting=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 0213/1588] 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 0214/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210902?= =?UTF-8?q?=20Best=20Web=20Browsers=20for=20Ubuntu=20and=20Other=20Linux?= =?UTF-8?q?=20Distributions?= 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 0215/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901?= =?UTF-8?q?=2020=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 0216/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901?= =?UTF-8?q?=20Control=20your=20Raspberry=20Pi=20remotely=20with=20your=20s?= =?UTF-8?q?martphone?= 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 0217/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210901?= =?UTF-8?q?=20What=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 0218/1588] 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 0219/1588] 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 0220/1588] 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 From 9a664a2d60348bd5ee7e81286ea921a7e763b45b Mon Sep 17 00:00:00 2001 From: YungeGuo Date: Thu, 2 Sep 2021 16:43:04 +0800 Subject: [PATCH 0221/1588] translating --- .../tech/20201029 Managing resources with cgroups in systemd.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201029 Managing resources with cgroups in systemd.md b/sources/tech/20201029 Managing resources with cgroups in systemd.md index 5cb7f5c8c8..f9c03cd94c 100644 --- a/sources/tech/20201029 Managing resources with cgroups in systemd.md +++ b/sources/tech/20201029 Managing resources with cgroups in systemd.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (YungeG) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 6db36780d99dd52691e3a64302758a002a2cf89c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Sep 2021 23:07:39 +0800 Subject: [PATCH 0222/1588] PRF @perfiffer --- ...he Difference- Which One Should You Use.md | 84 ++++++++++--------- 1 file changed, 43 insertions(+), 41 deletions(-) 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 index af1de88002..950edcdf82 100644 --- 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 @@ -3,32 +3,34 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " Debian 和 Ubuntu:有什么不同?应该选择哪一个? ====== -在 Debian 和 Ubuntu 系统中,你都可以 [使用 apt-get 命令][1] 来管理应用。你也可以在这两个发型版中安装 DEB 安装包。很多时候,你会在这两个发行版中发现同样的包安装介绍。 +![](https://img.linux.net.cn/data/attachment/album/202109/02/230706mpahrwpwjjm2jkpu.jpg) + +在 Debian 和 Ubuntu 系统中,你都可以 [使用 apt-get 命令][1] 来管理应用。你也可以在这两个发行版中安装 DEB 安装包。很多时候,你会在这两个发行版中发现同样的包安装命令。 它们两者是如此的相似,那么,它们两者之间有什么区别呢? -Debian 和 Ubuntu 属于同一系列的发行版。Debain 是由Ian Murdock 在 1993 年创建的最初的发行版。Ubuntu 是 Mark Shuttleworth 在 2004 年基于 Debian 创建的发行版。 +Debian 和 Ubuntu 属于同一系列的发行版。Debian 是由 Ian Murdock 在 1993 年创建的最初的发行版。Ubuntu 是 Mark Shuttleworth 在 2004 年基于 Debian 创建的发行版。 ### Ubuntu 基于 Debian:这意味着什么? -Linux 发行版虽然有数百个,但其中只有少数是从零开始的独立发行版。 [Debian][2],Arch,Red Hat 是其中几个不派生于其它发行版的使用最广的发行版。 +Linux 发行版虽然有数百个,但其中只有少数是从零开始的独立发行版。 [Debian][2]、Arch、Red Hat 是其中几个不派生于其它发行版的使用最广的发行版。 -Ubuntu 源自 Debian。这意味着 Ubuntu 使用与 Debian 相同的 `APT` 包管理系统,并共享 Debian 库中的大量包和库。它建立在 Debian 基础架构上。 +Ubuntu 源自 Debian。这意味着 Ubuntu 使用与 Debian 相同的 APT 包管理系统,并共享来自 Debian 库中的大量包和库。它建立在 Debian 基础架构上。 ![Ubuntu uses Debian as base][3] -这就是大多数“衍生”发行版所做的。它们使用相同的包管理器,并将包共享为基本发行版。但他们也做了一些改变,添加了一些自己的包。这就是 Ubuntu 和 Debian 的不同之处,尽管它是从 Debian 衍生而来的。 +这就是大多数“衍生”发行版所做的。它们使用相同的包管理器,并与基础发行版共享包。但它们也做了一些改变,添加了一些自己的包。这就是 Ubuntu 和 Debian 的不同之处,尽管它是从 Debian 衍生而来的。 ### Ubuntu 和 Debian 的不同之处 -因此,Ubuntu 构建在 Debian 架构和基础设施上,也与 Debian 一样是用 `.DEB` 格式的软件包。 +因此,Ubuntu 构建在 Debian 架构和基础设施上,也与 Debian 一样是用 .DEB 格式的软件包。 这意味着使用 Ubuntu 和使用 Debian 是一样的吗?并不完全如此。有很多因素可以用来区分两个不同的发行版。 @@ -36,23 +38,23 @@ Ubuntu 源自 Debian。这意味着 Ubuntu 使用与 Debian 相同的 `APT` 包 ![][4] -#### 1\. 发布周期 +#### 1、发布周期 -Ubuntu 有两种发布版本:LTS 和 regular。[Ubuntu LTS (长期支持) 版本][5] 每两年发布一次,并且会提供五年的支持。你可以选择升级到下一个可用的 LTS 版本。LTS 版本更稳定。 +Ubuntu 有两种发布版本:LTS(长期支持)和常规版本。[Ubuntu LTS 版本][5] 每两年发布一次,并且会提供五年的支持。你可以选择升级到下一个可用的 LTS 版本。LTS 版本被认为更稳定。 -还有一个非 LTS 版本,每六个月发布一次。这些版本仅仅提供九个月的支持,但是它们会有一些新的软件版本和功能。当当前的版本已经不在维护了,你必须升级到下一个 Ubuntu 版本。 +还有一个非 LTS 版本,每六个月发布一次。这些版本仅仅提供九个月的支持,但是它们会有一些新的软件版本和功能。在当前的版本到达维护年限时,你应当升级到下一个 Ubuntu 版本。 所以基本上,你可以根据这些版本在稳定性和新特性之间进行选择。 -另一方面,Debian 有三个不同的版本:稳定版、测试版和非稳定版 。非稳定版是为了实际测试,应该避免使用。 +另一方面,Debian 有三个不同的版本:稳定版、测试版和非稳定版。非稳定版是为了实际测试,应该避免使用。 -测试版并不是非稳定版。它是用来为下一个稳定版做准备。有一些 Debian 用户更倾向于使用测试版来获取新的特性。 +测试版不是那么不稳定。它是用来为下一个稳定版做准备。有一些 Debian 用户更倾向于使用测试版来获取新的特性。 然后是稳定版。这是 Debian 的主要版本。Debian 稳定版可能没有最新的软件和功能,但在稳定性方面毋庸置疑。 -每两年 Debian 会发布一个稳定版,并且会提供三年的支持。此后,你必须升级到下一个可用的稳定版。 +每两年 Debian 会发布一个稳定版,并且会提供三年的支持。此后,你应当升级到下一个可用的稳定版。 -#### 2\. 软件更新 +#### 2、软件更新 ![][6] @@ -62,33 +64,33 @@ Debian 更关注稳定性,这意味着它并不总是使用最新版本的软 Ubuntu LTS 版本也关注稳定性。但是它们通常拥有较新版本的常见软件。 -你应该注意,对于某些软件,从开发人员仓库安装也是一种选择。例如,如果你想要安装最新版的 Docker,你可以在 Debian 和 Ubuntu 中添加 Docker 仓库。 +你应该注意,对于某些软件,从开发者的仓库安装也是一种选择。例如,如果你想要安装最新版的 Docker,你可以在 Debian 和 Ubuntu 中添加 Docker 仓库。 总体来说,相比较于 Ubuntu ,Debian 稳定版的软件版本会更旧。 -#### 3\. 软件可用性 +#### 3、软件可用性 -Debian 和 Ubuntu 都拥有一个巨大的软件仓库。然而,[Ubuntu 同时有PPA][7](Personal Package Archive)。通过 `PPA`,安装更新版本的软件或者获取最新版本的软件都将会变的更容易。 +Debian 和 Ubuntu 都拥有一个巨大的软件仓库。然而,[Ubuntu 还有 PPA][7](个人软件包存档Personal Package Archive)。通过 PPA,安装更新版本的软件或者获取最新版本的软件都将会变的更容易。 ![][8] 你可以在 Debian 中尝试使用 PPA,但是体验并不好。大多数时候你都会遇到问题。 -#### 4\. 支持的平台 +#### 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)。 +另一方面,Debian 支持 32 位和 64 位架构。除此之外,Debian 还支持 64 位 ARM(arm64)、ARM EABI(armel)、ARMv7(EABI hard-float ABI,armhf)、小端 MIPS(mipsel)、64 位小端 MIPS(mips64el)、64 位小端 PowerPC(ppc64el) 和 IBM System z(s390x)。 -所以它也被称为 “通用操作系统”。 +所以它也被称为 “通用操作系统universal operating system”。 -#### 5\. 安装 +#### 5、安装 -[安装 Ubuntu][9] 比安装 Debian 容易得多。我并不是在骗你。即使对于中级 Linux 用户,Debian 也可能令人困惑。 +[安装 Ubuntu][9] 比安装 Debian 容易得多。我并不是在开玩笑。即使对于有经验的 Linux 用户,Debian 也可能令人困惑。 -当你下载 Debian 的时候,它默认提供的是最小化镜像。 此镜像没有非免费(非开源)固件。如果你继续安装它,你就可能会发现你的网络适配器和其它硬件将无法识别。 +当你下载 Debian 的时候,它默认提供的是最小化镜像。此镜像没有非自由(非开源)的固件。如果你继续安装它,你就可能会发现你的网络适配器和其它硬件将无法识别。 -有一个单独的非免费镜像包含固件,但它是隐藏的,如果你不知道,你可能会大吃一惊。 +有一个单独的包含固件的非自由镜像,但它是隐藏的,如果你不知道,你可能会大吃一惊。 ![Getting non-free firmware is a pain in Debian][10] @@ -98,57 +100,57 @@ Ubuntu 在默认提供的镜像中包含专有驱动程序和固件时要宽容 ![Installing Ubuntu is smoother][11] -#### 6\. 开箱即用的硬件支持 +#### 6、开箱即用的硬件支持 就像之前提到的,Debian 主要关注 [FOSS][12](自由和开源软件)。这意味着 Debian 提供的内核不包括专有驱动程序和固件。 -这并不是说你无法使其工作,而是你必须添加/启动其它存储库并手动安装。这可能令人沮丧,特别是对于初学者来说。 +这并不是说你无法使其工作,而是你必须添加/启动额外的存储库并手动安装。这可能令人沮丧,特别是对于初学者来说。 Ubuntu 并不完美,但在提供开箱即用的驱动程序和固件方面,它比 Debian 好得多。这意味着更少的麻烦和更完整的开箱即用体验。 -#### 7\. 桌面环境选择 +#### 7、桌面环境选择 -Ubuntu 默认使用定制的 GNOME 桌面环境。你可以在其上安装其它桌面环境,或者选择各种基于桌面的 Ubuntu 风格,如 Kubuntu(使用 KDE 桌面),Xubuntu(使用 Xfce 桌面)等。 +Ubuntu 默认使用定制的 GNOME 桌面环境。你可以在其上安装 [其它桌面环境][13],或者选择 [各种不同桌面风格的 Ubuntu][14],如 Kubuntu(使用 KDE 桌面)、Xubuntu(使用 Xfce 桌面)等。 -Debian 也默认使用的 GNOME 桌面。但是它会让你在安装的过程中选择你要安装的桌面环境。 +Debian 也默认安装了 GNOME 桌面。但是它会让你在安装的过程中选择你要安装的桌面环境。 ![][15] -你还可以从其网站获取[DE 特定的 ISO 镜像][16]。 +你还可以从其网站获取 [特定桌面环境的 ISO 镜像][16]。 -#### 8\. 游戏性 +#### 8、游戏性 由于 Stream 及其 Proton 项目,Linux 上的游戏总体上有所改善。尽管如此,游戏在很大程度上取决于硬件。 -在硬件兼容性上,Ubuntu 比 Debian 更好的支持专有驱动程序。 +在硬件兼容性上,Ubuntu 比 Debian 在支持专有驱动程序方面要好。 -并不是说它在 Debian 中不能完成,而是需要一些时间和精力来实现。 +并不是说在 Debian 中不能做到这一点,而是需要一些时间和精力来实现。 -#### 9\. 性能 +#### 9、性能 性能部分没有明显的“赢家”,无论是在服务器版本还是在桌面版本。 Debian 和 Ubuntu 作为桌面和服务器操作系统都很受欢迎。 性能取决于你系统的硬件和你所使用的软件组件。你可以在你的操作系统中调整和控制你的系统。 -#### 10\. 社区和支持 +#### 10、社区和支持 -Debian 是社区项目。此项目的一切都由其社区成员管理。 +Debian 是一个真正的社区项目。此项目的一切都由其社区成员管理。 Ubuntu 由 [Canonical][17] 提供支持。然而,它并不是一个真正意义上的企业项目。它确实有一个社区,但任何事情的最终决定权都掌握在 Canonical 手中。 就支持而言,Ubuntu 和 Debian 都有专门的论坛,用户可以在其中寻求帮助和提出建议。 -Canonical 还为其企业客户提供收费的专业支持。 Debian 没有这样的功能。 +Canonical 还为其企业客户提供收费的专业支持。Debian 则没有这样的功能。 ### 结论 -Debian 和 Ubuntu 都是桌面或服务器操作系统的可靠选择。 apt 包管理器和 DEB 包对两者都是通用的,因此提供了一些相似的体验。 +Debian 和 Ubuntu 都是桌面或服务器操作系统的可靠选择。 APT 包管理器和 DEB 包对两者都是通用的,因此提供了一些相似的体验。 -然而,Debian 仍然需要一定程度的专业知识,特别是在桌面方面。如果你是 Linux 新手,坚持使用 Ubuntu 将是你更好的选择。在我看来,你应该获得一些经验,熟悉 Linux,然后尝试使用 Debian。 +然而,Debian 仍然需要一定程度的专业知识,特别是在桌面方面。如果你是 Linux 新手,坚持使用 Ubuntu 将是你更好的选择。在我看来,你应该积累一些经验,熟悉了一般的 Linux,然后再尝试使用 Debian。 并不是说你不能从一开始就使用 Debian,但对于 Linux 初学者来说,这并不是一种很好的体验。 -**欢迎你对这场 Debian 与 Ubuntu 辩论发表意见。** +欢迎你对这场 Debian 与 Ubuntu 辩论发表意见。 -------------------------------------------------------------------------------- @@ -157,7 +159,7 @@ via: https://itsfoss.com/debian-vs-ubuntu/ 作者:[Abhishek Prakash][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 a53e9089a85b677c3b3add760863de43a213cd75 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Sep 2021 23:11:42 +0800 Subject: [PATCH 0223/1588] PRF&PUB @perfiffer https://linux.cn/article-13746-1.html --- ...Ubuntu- What-s the Difference- Which One Should You Use.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md (99%) diff --git a/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/published/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md similarity index 99% rename from translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md rename to published/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md index 950edcdf82..3468fcc4c2 100644 --- a/translated/tech/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md +++ b/published/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13746-1.html" Debian 和 Ubuntu:有什么不同?应该选择哪一个? ====== From f4db49de04f1d1bd9a0167066e7616dd46f0fe5f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 2 Sep 2021 23:19:23 +0800 Subject: [PATCH 0224/1588] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202108?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../{ => 202108}/20200107 5 ways to improve your Bash scripts.md | 0 ...Managing your attached hardware on Linux with systemd-udevd.md | 0 .../20200504 Understanding systemd at startup on Linux.md | 0 ...07 A beginner-s guide to SSH for remote connection on Linux.md | 0 .../{ => 202108}/20210308 How the ARPANET Protocols Worked.md | 0 .../20210414 3 essential Linux cheat sheets for productivity.md | 0 .../20210525 Pen testing with Linux security tools.md | 0 .../{ => 202108}/20210608 Tune your MySQL queries like a pro.md | 0 ... Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md | 0 .../20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md | 0 ...r System Uses MBR or GPT Partitioning -on Windows and Linux.md | 0 .../20210712 Reading and writing files with Python.md | 0 .../{ => 202108}/20210713 Use VS Code to develop in containers.md | 0 .../20210720 How to Upgrade to Debian 11 from Debian 10.md | 0 .../20210720 Install Shutter in Fedora 34 and Above.md | 0 .../20210723 5 useful ways to manage Kubernetes with kubectl.md | 0 .../20210725 Top 7 Linux Laptops You Can Buy in 2021.md | 0 .../20210726 Command line quick tips- wc, sort, sed and tr.md | 0 .../20210726 How to Install elementary Tweaks Tool.md | 0 published/{ => 202108}/20210726 How to use cron on Linux.md | 0 .../20210727 Check used disk space on Linux with du.md | 0 ... to Change Lock and Login Screen Wallpaper in elementary OS.md | 0 .../20210729 Use df to check free disk space on Linux.md | 0 .../20210730 4 cool new projects to try in Copr from July 2021.md | 0 ...ox- Your Ultimate Browser Choice for Private Web Experience.md | 0 ...e the Linux terminal to see what files are on your computer.md | 0 .../{ => 202108}/20210802 Use OpenCV on Fedora Linux - part 1.md | 0 ... Web Canary is Now Available to Test Bleeding Edge Features.md | 0 ...3 How to Install Google Chrome on Linux Mint -Beginners Tip.md | 0 ...3 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md | 0 .../{ => 202108}/20210803 Set up a VPN server on your Linux PC.md | 0 ...Use the Linux terminal to navigate throughout your computer.md | 0 ...x Lost Almost 50 million Users- Here-s Why It is Concerning.md | 0 .../20210804 How to Find and Remove Duplicate Photos in Linux.md | 0 .../{ => 202108}/20210804 Install OpenVPN on your Linux PC.md | 0 .../{ => 202108}/20210804 Move files in the Linux terminal.md | 0 .../20210805 Configure your OpenVPN server on Linux.md | 0 .../20210806 Access OpenVPN from a client computer.md | 0 ... Change your Linux Desktop Wallpaper Every Hour -Here-s How.md | 0 .../{ => 202108}/20210807 How to Install Java on Fedora Linux.md | 0 ...s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md | 0 .../20210807 Remove files and folders in the Linux terminal.md | 0 ...1 Monitor your Linux system in your terminal with procps-ng.md | 0 ...lementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md | 0 ...210811 Top 11 New Features in elementary OS 6 Linux Release.md | 0 .../{ => 202108}/20210812 A Java developer-s guide to Quarkus.md | 0 published/{ => 202108}/20210813 Install Linux with LVM.md | 0 .../20210813 Parse command options in Java with commons-cli.md | 0 ... Important You Need to Know About This -Gaming Distribution.md | 0 ...res in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md | 0 .../20210815 Schedule a task with the Linux at command.md | 0 .../{ => 202108}/20210817 4 alternatives to cron in Linux.md | 0 ...Automatically Synchronize Subtitle With Video Using SubSync.md | 0 .../20210818 Build a JAR file with fastjar and gjar.md | 0 .../20210819 Check free disk space in Linux with ncdu.md | 0 ... OS 16 Released with Stunning New Look and Array of Updates.md | 0 ...Monitor Log Files in Real Time in Linux -Desktop and Server.md | 0 .../{ => 202108}/20210822 Linux Phones- Here are Your Options.md | 0 ...0823 Access your iPhone on Linux with this open source tool.md | 0 .../20210823 KDE Plasma 5.23 - New Features and Release Dates.md | 0 .../20210824 How to include options in your Bash shell scripts.md | 0 .../20210826 30 things you didn-t know about the Linux kernel.md | 0 62 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202108}/20200107 5 ways to improve your Bash scripts.md (100%) rename published/{ => 202108}/20200204 Managing your attached hardware on Linux with systemd-udevd.md (100%) rename published/{ => 202108}/20200504 Understanding systemd at startup on Linux.md (100%) rename published/{ => 202108}/20200907 A beginner-s guide to SSH for remote connection on Linux.md (100%) rename published/{ => 202108}/20210308 How the ARPANET Protocols Worked.md (100%) rename published/{ => 202108}/20210414 3 essential Linux cheat sheets for productivity.md (100%) rename published/{ => 202108}/20210525 Pen testing with Linux security tools.md (100%) rename published/{ => 202108}/20210608 Tune your MySQL queries like a pro.md (100%) rename published/{ => 202108}/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md (100%) rename published/{ => 202108}/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md (100%) rename published/{ => 202108}/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md (100%) rename published/{ => 202108}/20210712 Reading and writing files with Python.md (100%) rename published/{ => 202108}/20210713 Use VS Code to develop in containers.md (100%) rename published/{ => 202108}/20210720 How to Upgrade to Debian 11 from Debian 10.md (100%) rename published/{ => 202108}/20210720 Install Shutter in Fedora 34 and Above.md (100%) rename published/{ => 202108}/20210723 5 useful ways to manage Kubernetes with kubectl.md (100%) rename published/{ => 202108}/20210725 Top 7 Linux Laptops You Can Buy in 2021.md (100%) rename published/{ => 202108}/20210726 Command line quick tips- wc, sort, sed and tr.md (100%) rename published/{ => 202108}/20210726 How to Install elementary Tweaks Tool.md (100%) rename published/{ => 202108}/20210726 How to use cron on Linux.md (100%) rename published/{ => 202108}/20210727 Check used disk space on Linux with du.md (100%) rename published/{ => 202108}/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md (100%) rename published/{ => 202108}/20210729 Use df to check free disk space on Linux.md (100%) rename published/{ => 202108}/20210730 4 cool new projects to try in Copr from July 2021.md (100%) rename published/{ => 202108}/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md (100%) rename published/{ => 202108}/20210801 Use the Linux terminal to see what files are on your computer.md (100%) rename published/{ => 202108}/20210802 Use OpenCV on Fedora Linux - part 1.md (100%) rename published/{ => 202108}/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md (100%) rename published/{ => 202108}/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md (100%) rename published/{ => 202108}/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md (100%) rename published/{ => 202108}/20210803 Set up a VPN server on your Linux PC.md (100%) rename published/{ => 202108}/20210803 Use the Linux terminal to navigate throughout your computer.md (100%) rename published/{ => 202108}/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md (100%) rename published/{ => 202108}/20210804 How to Find and Remove Duplicate Photos in Linux.md (100%) rename published/{ => 202108}/20210804 Install OpenVPN on your Linux PC.md (100%) rename published/{ => 202108}/20210804 Move files in the Linux terminal.md (100%) rename published/{ => 202108}/20210805 Configure your OpenVPN server on Linux.md (100%) rename published/{ => 202108}/20210806 Access OpenVPN from a client computer.md (100%) rename published/{ => 202108}/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md (100%) rename published/{ => 202108}/20210807 How to Install Java on Fedora Linux.md (100%) rename published/{ => 202108}/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md (100%) rename published/{ => 202108}/20210807 Remove files and folders in the Linux terminal.md (100%) rename published/{ => 202108}/20210811 Monitor your Linux system in your terminal with procps-ng.md (100%) rename published/{ => 202108}/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md (100%) rename published/{ => 202108}/20210811 Top 11 New Features in elementary OS 6 Linux Release.md (100%) rename published/{ => 202108}/20210812 A Java developer-s guide to Quarkus.md (100%) rename published/{ => 202108}/20210813 Install Linux with LVM.md (100%) rename published/{ => 202108}/20210813 Parse command options in Java with commons-cli.md (100%) rename published/{ => 202108}/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md (100%) rename published/{ => 202108}/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md (100%) rename published/{ => 202108}/20210815 Schedule a task with the Linux at command.md (100%) rename published/{ => 202108}/20210817 4 alternatives to cron in Linux.md (100%) rename published/{ => 202108}/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md (100%) rename published/{ => 202108}/20210818 Build a JAR file with fastjar and gjar.md (100%) rename published/{ => 202108}/20210819 Check free disk space in Linux with ncdu.md (100%) rename published/{ => 202108}/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md (100%) rename published/{ => 202108}/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md (100%) rename published/{ => 202108}/20210822 Linux Phones- Here are Your Options.md (100%) rename published/{ => 202108}/20210823 Access your iPhone on Linux with this open source tool.md (100%) rename published/{ => 202108}/20210823 KDE Plasma 5.23 - New Features and Release Dates.md (100%) rename published/{ => 202108}/20210824 How to include options in your Bash shell scripts.md (100%) rename published/{ => 202108}/20210826 30 things you didn-t know about the Linux kernel.md (100%) diff --git a/published/20200107 5 ways to improve your Bash scripts.md b/published/202108/20200107 5 ways to improve your Bash scripts.md similarity index 100% rename from published/20200107 5 ways to improve your Bash scripts.md rename to published/202108/20200107 5 ways to improve your Bash scripts.md diff --git a/published/20200204 Managing your attached hardware on Linux with systemd-udevd.md b/published/202108/20200204 Managing your attached hardware on Linux with systemd-udevd.md similarity index 100% rename from published/20200204 Managing your attached hardware on Linux with systemd-udevd.md rename to published/202108/20200204 Managing your attached hardware on Linux with systemd-udevd.md diff --git a/published/20200504 Understanding systemd at startup on Linux.md b/published/202108/20200504 Understanding systemd at startup on Linux.md similarity index 100% rename from published/20200504 Understanding systemd at startup on Linux.md rename to published/202108/20200504 Understanding systemd at startup on Linux.md diff --git a/published/20200907 A beginner-s guide to SSH for remote connection on Linux.md b/published/202108/20200907 A beginner-s guide to SSH for remote connection on Linux.md similarity index 100% rename from published/20200907 A beginner-s guide to SSH for remote connection on Linux.md rename to published/202108/20200907 A beginner-s guide to SSH for remote connection on Linux.md diff --git a/published/20210308 How the ARPANET Protocols Worked.md b/published/202108/20210308 How the ARPANET Protocols Worked.md similarity index 100% rename from published/20210308 How the ARPANET Protocols Worked.md rename to published/202108/20210308 How the ARPANET Protocols Worked.md diff --git a/published/20210414 3 essential Linux cheat sheets for productivity.md b/published/202108/20210414 3 essential Linux cheat sheets for productivity.md similarity index 100% rename from published/20210414 3 essential Linux cheat sheets for productivity.md rename to published/202108/20210414 3 essential Linux cheat sheets for productivity.md diff --git a/published/20210525 Pen testing with Linux security tools.md b/published/202108/20210525 Pen testing with Linux security tools.md similarity index 100% rename from published/20210525 Pen testing with Linux security tools.md rename to published/202108/20210525 Pen testing with Linux security tools.md diff --git a/published/20210608 Tune your MySQL queries like a pro.md b/published/202108/20210608 Tune your MySQL queries like a pro.md similarity index 100% rename from published/20210608 Tune your MySQL queries like a pro.md rename to published/202108/20210608 Tune your MySQL queries like a pro.md diff --git a/published/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md b/published/202108/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md similarity index 100% rename from published/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md rename to published/202108/20210625 Windows 11 Makes Your Hardware Obsolete, Use Linux Instead.md diff --git a/published/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md b/published/202108/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md similarity index 100% rename from published/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md rename to published/202108/20210626 Windows 11 Look Inspired by KDE Plasma and GNOME.md diff --git a/published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md b/published/202108/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md similarity index 100% rename from published/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md rename to published/202108/20210707 How to Know if Your System Uses MBR or GPT Partitioning -on Windows and Linux.md diff --git a/published/20210712 Reading and writing files with Python.md b/published/202108/20210712 Reading and writing files with Python.md similarity index 100% rename from published/20210712 Reading and writing files with Python.md rename to published/202108/20210712 Reading and writing files with Python.md diff --git a/published/20210713 Use VS Code to develop in containers.md b/published/202108/20210713 Use VS Code to develop in containers.md similarity index 100% rename from published/20210713 Use VS Code to develop in containers.md rename to published/202108/20210713 Use VS Code to develop in containers.md diff --git a/published/20210720 How to Upgrade to Debian 11 from Debian 10.md b/published/202108/20210720 How to Upgrade to Debian 11 from Debian 10.md similarity index 100% rename from published/20210720 How to Upgrade to Debian 11 from Debian 10.md rename to published/202108/20210720 How to Upgrade to Debian 11 from Debian 10.md diff --git a/published/20210720 Install Shutter in Fedora 34 and Above.md b/published/202108/20210720 Install Shutter in Fedora 34 and Above.md similarity index 100% rename from published/20210720 Install Shutter in Fedora 34 and Above.md rename to published/202108/20210720 Install Shutter in Fedora 34 and Above.md diff --git a/published/20210723 5 useful ways to manage Kubernetes with kubectl.md b/published/202108/20210723 5 useful ways to manage Kubernetes with kubectl.md similarity index 100% rename from published/20210723 5 useful ways to manage Kubernetes with kubectl.md rename to published/202108/20210723 5 useful ways to manage Kubernetes with kubectl.md diff --git a/published/20210725 Top 7 Linux Laptops You Can Buy in 2021.md b/published/202108/20210725 Top 7 Linux Laptops You Can Buy in 2021.md similarity index 100% rename from published/20210725 Top 7 Linux Laptops You Can Buy in 2021.md rename to published/202108/20210725 Top 7 Linux Laptops You Can Buy in 2021.md diff --git a/published/20210726 Command line quick tips- wc, sort, sed and tr.md b/published/202108/20210726 Command line quick tips- wc, sort, sed and tr.md similarity index 100% rename from published/20210726 Command line quick tips- wc, sort, sed and tr.md rename to published/202108/20210726 Command line quick tips- wc, sort, sed and tr.md diff --git a/published/20210726 How to Install elementary Tweaks Tool.md b/published/202108/20210726 How to Install elementary Tweaks Tool.md similarity index 100% rename from published/20210726 How to Install elementary Tweaks Tool.md rename to published/202108/20210726 How to Install elementary Tweaks Tool.md diff --git a/published/20210726 How to use cron on Linux.md b/published/202108/20210726 How to use cron on Linux.md similarity index 100% rename from published/20210726 How to use cron on Linux.md rename to published/202108/20210726 How to use cron on Linux.md diff --git a/published/20210727 Check used disk space on Linux with du.md b/published/202108/20210727 Check used disk space on Linux with du.md similarity index 100% rename from published/20210727 Check used disk space on Linux with du.md rename to published/202108/20210727 Check used disk space on Linux with du.md diff --git a/published/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md b/published/202108/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md similarity index 100% rename from published/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md rename to published/202108/20210727 How to Change Lock and Login Screen Wallpaper in elementary OS.md diff --git a/published/20210729 Use df to check free disk space on Linux.md b/published/202108/20210729 Use df to check free disk space on Linux.md similarity index 100% rename from published/20210729 Use df to check free disk space on Linux.md rename to published/202108/20210729 Use df to check free disk space on Linux.md diff --git a/published/20210730 4 cool new projects to try in Copr from July 2021.md b/published/202108/20210730 4 cool new projects to try in Copr from July 2021.md similarity index 100% rename from published/20210730 4 cool new projects to try in Copr from July 2021.md rename to published/202108/20210730 4 cool new projects to try in Copr from July 2021.md diff --git a/published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md b/published/202108/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md similarity index 100% rename from published/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md rename to published/202108/20210730 Brave vs. Firefox- Your Ultimate Browser Choice for Private Web Experience.md diff --git a/published/20210801 Use the Linux terminal to see what files are on your computer.md b/published/202108/20210801 Use the Linux terminal to see what files are on your computer.md similarity index 100% rename from published/20210801 Use the Linux terminal to see what files are on your computer.md rename to published/202108/20210801 Use the Linux terminal to see what files are on your computer.md diff --git a/published/20210802 Use OpenCV on Fedora Linux - part 1.md b/published/202108/20210802 Use OpenCV on Fedora Linux - part 1.md similarity index 100% rename from published/20210802 Use OpenCV on Fedora Linux - part 1.md rename to published/202108/20210802 Use OpenCV on Fedora Linux - part 1.md diff --git a/published/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md b/published/202108/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md similarity index 100% rename from published/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md rename to published/202108/20210803 GNOME Web Canary is Now Available to Test Bleeding Edge Features.md diff --git a/published/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md b/published/202108/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md similarity index 100% rename from published/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md rename to published/202108/20210803 How to Install Google Chrome on Linux Mint -Beginners Tip.md diff --git a/published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md b/published/202108/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md similarity index 100% rename from published/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md rename to published/202108/20210803 Mount Microsoft OneDrive in Linux With OneDriver GUI Tool.md diff --git a/published/20210803 Set up a VPN server on your Linux PC.md b/published/202108/20210803 Set up a VPN server on your Linux PC.md similarity index 100% rename from published/20210803 Set up a VPN server on your Linux PC.md rename to published/202108/20210803 Set up a VPN server on your Linux PC.md diff --git a/published/20210803 Use the Linux terminal to navigate throughout your computer.md b/published/202108/20210803 Use the Linux terminal to navigate throughout your computer.md similarity index 100% rename from published/20210803 Use the Linux terminal to navigate throughout your computer.md rename to published/202108/20210803 Use the Linux terminal to navigate throughout your computer.md diff --git a/published/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md b/published/202108/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md similarity index 100% rename from published/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md rename to published/202108/20210804 Firefox Lost Almost 50 million Users- Here-s Why It is Concerning.md diff --git a/published/20210804 How to Find and Remove Duplicate Photos in Linux.md b/published/202108/20210804 How to Find and Remove Duplicate Photos in Linux.md similarity index 100% rename from published/20210804 How to Find and Remove Duplicate Photos in Linux.md rename to published/202108/20210804 How to Find and Remove Duplicate Photos in Linux.md diff --git a/published/20210804 Install OpenVPN on your Linux PC.md b/published/202108/20210804 Install OpenVPN on your Linux PC.md similarity index 100% rename from published/20210804 Install OpenVPN on your Linux PC.md rename to published/202108/20210804 Install OpenVPN on your Linux PC.md diff --git a/published/20210804 Move files in the Linux terminal.md b/published/202108/20210804 Move files in the Linux terminal.md similarity index 100% rename from published/20210804 Move files in the Linux terminal.md rename to published/202108/20210804 Move files in the Linux terminal.md diff --git a/published/20210805 Configure your OpenVPN server on Linux.md b/published/202108/20210805 Configure your OpenVPN server on Linux.md similarity index 100% rename from published/20210805 Configure your OpenVPN server on Linux.md rename to published/202108/20210805 Configure your OpenVPN server on Linux.md diff --git a/published/20210806 Access OpenVPN from a client computer.md b/published/202108/20210806 Access OpenVPN from a client computer.md similarity index 100% rename from published/20210806 Access OpenVPN from a client computer.md rename to published/202108/20210806 Access OpenVPN from a client computer.md diff --git a/published/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md b/published/202108/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md similarity index 100% rename from published/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md rename to published/202108/20210806 Change your Linux Desktop Wallpaper Every Hour -Here-s How.md diff --git a/published/20210807 How to Install Java on Fedora Linux.md b/published/202108/20210807 How to Install Java on Fedora Linux.md similarity index 100% rename from published/20210807 How to Install Java on Fedora Linux.md rename to published/202108/20210807 How to Install Java on Fedora Linux.md diff --git a/published/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md b/published/202108/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md similarity index 100% rename from published/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md rename to published/202108/20210807 It-s Time for Ubuntu to Opt for a Hybrid Rolling Release Model.md diff --git a/published/20210807 Remove files and folders in the Linux terminal.md b/published/202108/20210807 Remove files and folders in the Linux terminal.md similarity index 100% rename from published/20210807 Remove files and folders in the Linux terminal.md rename to published/202108/20210807 Remove files and folders in the Linux terminal.md diff --git a/published/20210811 Monitor your Linux system in your terminal with procps-ng.md b/published/202108/20210811 Monitor your Linux system in your terminal with procps-ng.md similarity index 100% rename from published/20210811 Monitor your Linux system in your terminal with procps-ng.md rename to published/202108/20210811 Monitor your Linux system in your terminal with procps-ng.md diff --git a/published/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md b/published/202108/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md similarity index 100% rename from published/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md rename to published/202108/20210811 The Wait is Over- elementary OS 6 ‘Odin- is Finally Here With Exciting Changes.md diff --git a/published/20210811 Top 11 New Features in elementary OS 6 Linux Release.md b/published/202108/20210811 Top 11 New Features in elementary OS 6 Linux Release.md similarity index 100% rename from published/20210811 Top 11 New Features in elementary OS 6 Linux Release.md rename to published/202108/20210811 Top 11 New Features in elementary OS 6 Linux Release.md diff --git a/published/20210812 A Java developer-s guide to Quarkus.md b/published/202108/20210812 A Java developer-s guide to Quarkus.md similarity index 100% rename from published/20210812 A Java developer-s guide to Quarkus.md rename to published/202108/20210812 A Java developer-s guide to Quarkus.md diff --git a/published/20210813 Install Linux with LVM.md b/published/202108/20210813 Install Linux with LVM.md similarity index 100% rename from published/20210813 Install Linux with LVM.md rename to published/202108/20210813 Install Linux with LVM.md diff --git a/published/20210813 Parse command options in Java with commons-cli.md b/published/202108/20210813 Parse command options in Java with commons-cli.md similarity index 100% rename from published/20210813 Parse command options in Java with commons-cli.md rename to published/202108/20210813 Parse command options in Java with commons-cli.md diff --git a/published/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md b/published/202108/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md similarity index 100% rename from published/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md rename to published/202108/20210814 What is SteamOS- Everything Important You Need to Know About This -Gaming Distribution.md diff --git a/published/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md b/published/202108/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md similarity index 100% rename from published/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md rename to published/202108/20210815 7 New Features in the Newly Released Debian 11 ‘Bullseye- Linux Distro.md diff --git a/published/20210815 Schedule a task with the Linux at command.md b/published/202108/20210815 Schedule a task with the Linux at command.md similarity index 100% rename from published/20210815 Schedule a task with the Linux at command.md rename to published/202108/20210815 Schedule a task with the Linux at command.md diff --git a/published/20210817 4 alternatives to cron in Linux.md b/published/202108/20210817 4 alternatives to cron in Linux.md similarity index 100% rename from published/20210817 4 alternatives to cron in Linux.md rename to published/202108/20210817 4 alternatives to cron in Linux.md diff --git a/published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md b/published/202108/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md similarity index 100% rename from published/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md rename to published/202108/20210817 Automatically Synchronize Subtitle With Video Using SubSync.md diff --git a/published/20210818 Build a JAR file with fastjar and gjar.md b/published/202108/20210818 Build a JAR file with fastjar and gjar.md similarity index 100% rename from published/20210818 Build a JAR file with fastjar and gjar.md rename to published/202108/20210818 Build a JAR file with fastjar and gjar.md diff --git a/published/20210819 Check free disk space in Linux with ncdu.md b/published/202108/20210819 Check free disk space in Linux with ncdu.md similarity index 100% rename from published/20210819 Check free disk space in Linux with ncdu.md rename to published/202108/20210819 Check free disk space in Linux with ncdu.md diff --git a/published/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md b/published/202108/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md similarity index 100% rename from published/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md rename to published/202108/20210819 Zorin OS 16 Released with Stunning New Look and Array of Updates.md diff --git a/published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md b/published/202108/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md similarity index 100% rename from published/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md rename to published/202108/20210822 How to Monitor Log Files in Real Time in Linux -Desktop and Server.md diff --git a/published/20210822 Linux Phones- Here are Your Options.md b/published/202108/20210822 Linux Phones- Here are Your Options.md similarity index 100% rename from published/20210822 Linux Phones- Here are Your Options.md rename to published/202108/20210822 Linux Phones- Here are Your Options.md diff --git a/published/20210823 Access your iPhone on Linux with this open source tool.md b/published/202108/20210823 Access your iPhone on Linux with this open source tool.md similarity index 100% rename from published/20210823 Access your iPhone on Linux with this open source tool.md rename to published/202108/20210823 Access your iPhone on Linux with this open source tool.md diff --git a/published/20210823 KDE Plasma 5.23 - New Features and Release Dates.md b/published/202108/20210823 KDE Plasma 5.23 - New Features and Release Dates.md similarity index 100% rename from published/20210823 KDE Plasma 5.23 - New Features and Release Dates.md rename to published/202108/20210823 KDE Plasma 5.23 - New Features and Release Dates.md diff --git a/published/20210824 How to include options in your Bash shell scripts.md b/published/202108/20210824 How to include options in your Bash shell scripts.md similarity index 100% rename from published/20210824 How to include options in your Bash shell scripts.md rename to published/202108/20210824 How to include options in your Bash shell scripts.md diff --git a/published/20210826 30 things you didn-t know about the Linux kernel.md b/published/202108/20210826 30 things you didn-t know about the Linux kernel.md similarity index 100% rename from published/20210826 30 things you didn-t know about the Linux kernel.md rename to published/202108/20210826 30 things you didn-t know about the Linux kernel.md From 4ffb9640aef0ef963f31283402b3d81d9405b009 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Sep 2021 05:03:44 +0800 Subject: [PATCH 0225/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210903?= =?UTF-8?q?=20How=20to=20Completely=20Uninstall=20Google=20Chrome=20From?= =?UTF-8?q?=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md --- ...ely Uninstall Google Chrome From Ubuntu.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md diff --git a/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md b/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md new file mode 100644 index 0000000000..0abd1eea46 --- /dev/null +++ b/sources/tech/20210903 How to Completely Uninstall Google Chrome From Ubuntu.md @@ -0,0 +1,97 @@ +[#]: subject: "How to Completely Uninstall Google Chrome From Ubuntu" +[#]: via: "https://itsfoss.com/uninstall-chrome-from-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Completely Uninstall Google Chrome From Ubuntu +====== + +So, you managed to [install Google Chrome on Ubuntu][1]. It is the most popular web browser in the world, after all. + +But perhaps you dislike Google products for the heavy tracking and data mining they employ on its users. You decided to opt for [other web browsers on Ubuntu][2], perhaps a [non-Chromium browser][3]. + +Now that you are no longer using it, it would be wise to remove [Google Chrome][4] from Ubuntu. + +How to do that? Let me show you the steps. + +### Remove Google Chrome completely from Ubuntu + +![Illustration for removing Google Chrome from Ubuntu][5] + +You probably installed Google Chrome graphically. Unfortunately, you’ll have to resort to command line for removing it, unless you opt to [use Synaptic Package Manager][6]. + +It is not too difficult. Press the [Ctrl+Alt+T keyboard shortcut in Ubuntu to open a terminal][7]. + +Type the following command in the terminal: + +``` +sudo apt purge google-chrome-stable +``` + +It asks for a password. It is your user account’s password, the one which you use to log in to your Ubuntu system. + +When you type the password, nothing is displayed on the screen. This is normal behavior in Linux. Just type the password blindly and press enter. + +It will ask you to confirm the removal of Google Chrome by entering Y or simply pressing the enter key. + +![Removing Google Chrome for Ubuntu][8] + +This will remove Google Chrome from your Ubuntu Linux system along with most of the system files. + +However, the personal setting files remain in your home directory. This includes things like cookie sessions, bookmarks and other Chrome related settings for your user account. If you install Google Chrome again, the same files could be used by Chrome again. + +![Google Chrome leftover settings in Ubuntu][9] + +If you want to completely uninstall Google Chrome, you may want to remove these files as well. Here’s what you should do. + +Change to the .config directory. _**Mind the dot before config**_. That’s the [way to hide files and folders in Linux][10]. + +``` +cd ~/.config +``` + +And now remove the google-chrome directory: + +``` +rm -rf google-chrome +``` + +![Removing the leftover Google Chrome settings from Ubuntu][11] + +You could have also used rm -rf ~/.config/google-chrome to delete it in one single command. Since this tutorial is focused on absolute beginners, I made it in two steps to reduce the error margin because of a typo. + +Tip + +Want to make your terminal look beautiful like the ones in the screenshot? Use these [terminal customization tips][12]. + +I hope this quick beginner tip helped you to get rid of Google Chrome from Ubuntu Linux. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/uninstall-chrome-from-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/install-chrome-ubuntu/ +[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[3]: https://itsfoss.com/open-source-browsers-linux/ +[4]: https://www.google.com/chrome/index.html +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/removing-google-chrome-ubuntu.png?resize=800%2C450&ssl=1 +[6]: https://itsfoss.com/synaptic-package-manager/ +[7]: https://itsfoss.com/open-terminal-ubuntu/ +[8]: https://itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/google-chrome-ubuntu-leftover-settings.png?resize=800%2C518&ssl=1 +[10]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-leftover-settings-from-Ubuntu.png?resize=800%2C277&ssl=1 +[12]: https://itsfoss.com/customize-linux-terminal/ From d8b0d87738fb6e278fd87d34cea73e2e11ae0045 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Sep 2021 05:04:07 +0800 Subject: [PATCH 0226/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210902?= =?UTF-8?q?=204=20Linux=20technologies=20fundamental=20to=20containers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210902 4 Linux technologies fundamental to containers.md --- ... technologies fundamental to containers.md | 152 ++++++++++++++++++ 1 file changed, 152 insertions(+) create mode 100644 sources/tech/20210902 4 Linux technologies fundamental to containers.md diff --git a/sources/tech/20210902 4 Linux technologies fundamental to containers.md b/sources/tech/20210902 4 Linux technologies fundamental to containers.md new file mode 100644 index 0000000000..8875b5bf95 --- /dev/null +++ b/sources/tech/20210902 4 Linux technologies fundamental to containers.md @@ -0,0 +1,152 @@ +[#]: subject: "4 Linux technologies fundamental to containers" +[#]: via: "https://opensource.com/article/21/8/container-linux-technology" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 Linux technologies fundamental to containers +====== +Namespaces, cgroups, seccomp, and SELinux are the Linux technologies +that make up the foundations of building and running a container process +on your system. +![Penguin driving a car with a yellow background][1] + +In previous articles, I have written about [container images][2] and [runtimes][3]. In this article, I look at how containers are made possible by a foundation of some special Linux technologies, including namespaces and control groups. + +![layers of linux technologies][4] + +Figure 1: Linux technologies that contribute to containers +(Nived Velayudhan, [CC BY-SA 4.0][5]) + +Linux technologies make up the foundations of building and running a container process on your system. Technologies include: + + 1. Namespaces + 2. Control groups (cgroups) + 3. Seccomp + 4. SELinux + + + +### Namespaces + +_Namespaces_ provide a layer of isolation for the containers by giving the container a view of what appears to be its own Linux filesystem. This limits what a process can see and therefore restricts the resources available to it. + +There are several namespaces in the Linux kernel that are used by Docker or Podman and others while creating a container: +  + + +``` +$ docker container run alpine ping 8.8.8.8 +$ sudo lsns -p 29413 +        NS TYPE   NPROCS PID USER COMMAND +4026531835 cgroup   299   1  root /usr/lib/systemd/systemd -- +switched... +4026533105 mnt 1 29413 root ping 8.8.8.8 +4026533106 uts 1 29413 root ping 8.8.8.8 +4026533105 ipc 1 29413 root ping 8.8.8.8 +[...] +``` + +#### **User** + +The user namespace isolates users and groups within a container. This is done by allowing containers to have a different view of UID and GID ranges compared to the host system. The user namespace enables the software to run inside the container as the root user. If an intruder attacks the container and then escapes to the host machine, they're confined to only a non-root identity. + +#### **Mnt** + +The mnt namespace allows the containers to have their own view of the system's file system hierarchy. You can find the mount points for each container process in the _/proc/<PID>/mounts_ location in your Linux system. + +#### **UTS** + +The Unix Timesharing System (UTS) namespace allows containers to have a unique hostname and domain name. When you run a container, a random ID is used as the hostname even when using the `— name` tag. You can use the [`unshare` command][6] to get an idea of how this works. + + +``` +$ docker container run -it --name nived alpine sh +/ # hostname +9c9a5edabdd6 +/ # +$ sudo unshare -u sh +# hostname isolated.hostname +# hostname +# exit +$ hostname +homelab.redhat.com +``` + +#### **IPC** + +The Inter-Process Communication (IPC) namespace allows different container processes to communicate by accessing a shared range of memory or using a shared message queue. +  + + +``` +# ipcmk -M 10M +Shared memory id: 0 +# ipcmk -M 20M +Shared memory id: 1 +# ipcs +\---- Message Queues ---- +key  msqid  owner  perms  used-bytes  messages + +\---- Shared Memory Segments +key        shmid owner perms bytes    nattch status +0xd1df416a 0     root  644   10485760 0 +0xbd487a9d 1     root  644   20971520 0 +[...] +``` + +#### **PID** + +The Process ID (PID) namespace ensures that the processes running inside a container are isolated from the external world. When you run a `ps` command inside a container, you only see the processes running inside the container and not on the host machine because of this namespace. + +#### **Net** + +The network namespace allows the container to have its own view of network interface, IP addresses, routing tables, port numbers, and so on. How does a container able to communicate to the external world? All containers you create get attached to a special virtual network interface for communication. + +### Control groups (cgroups) + +Cgroups are fundamental blocks of making a container. A cgroup allocates and limits resources such as CPU, memory, network I/O that are used by containers. The container engine automatically creates a cgroup filesystem of each type, and sets values for each container when the container is run. + +### SECCOMP + +Seccomp basically stands for _secure computing_. It is a Linux feature used to restrict the set of system calls that an application is allowed to make. The default seccomp profile for Docker, for example, disables around 44 syscalls (over 300 are available). + +The idea here is to provide containers access to only those resources which the container might need. For example, if you don't need the container to change the clock time on your host machine, you probably have no use for the _clock_adjtime_ and _clock_settime_ syscalls, and it makes sense to block them out. Similarly, you don't want the containers to change the kernel modules, so there is no need for them to make _create_module, delete_module_ syscalls. + +### SELinux + +SELinux stands for _security-enhanced Linux_. If you are running a Red Hat distribution on your hosts, then SELinux is enabled by default. SELinux lets you limit an application to have access only to its own files and prevent any other processes from accessing them. So, if an application is compromised, it would limit the number of files that it can affect or control. It does this by setting up contexts for files and processes and by defining policies that would enforce what a process can see and make changes to. + +SELinux policies for containers are defined by the `container-selinux` package. By default, containers are run with the **container_t** label and are allowed to read (r) and execute (x) under the _/usr_ directory and read most content from the _/etc_ directory. The label **container_var_lib_t** is common for files relating to containers. + +### Wrap up + +Containers are a critical part of today's IT infrastructure and a pretty interesting technology, too. Even if your role doesn't involve containerization directly, understanding a few fundamental container concepts and approaches gives you an appreciation for how they can help your organization. The fact that containers are built on open source Linux technologies makes them even better! + +* * * + +_This article is based on a [techbeatly][7] article and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/container-linux-technology + +作者:[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/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://opensource.com/article/21/8/container-fundamentals-2 +[3]: https://opensource.com/article/21/8/deep-dive-container-runtimes +[4]: https://opensource.com/sites/default/files/1linuxtechs.png (layers of linux technologies) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/19/10/namespaces-and-containers-linux +[7]: https://nivedv.medium.com/container-internals-deep-dive-5cc424957413 From 9a68606d74221f0940c852b851e19fe1188c5250 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Sep 2021 05:04:25 +0800 Subject: [PATCH 0227/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210902?= =?UTF-8?q?=20Get=20started=20programming=20with=20DOS=20conio?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210902 Get started programming with DOS conio.md --- ... Get started programming with DOS conio.md | 341 ++++++++++++++++++ 1 file changed, 341 insertions(+) create mode 100644 sources/tech/20210902 Get started programming with DOS conio.md diff --git a/sources/tech/20210902 Get started programming with DOS conio.md b/sources/tech/20210902 Get started programming with DOS conio.md new file mode 100644 index 0000000000..33e8819bd6 --- /dev/null +++ b/sources/tech/20210902 Get started programming with DOS conio.md @@ -0,0 +1,341 @@ +[#]: subject: "Get started programming with DOS conio" +[#]: via: "https://opensource.com/article/21/9/programming-dos-conio" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Get started programming with DOS conio +====== +Create various practical and exciting applications by programming with +conio. +![Person using a laptop][1] + +One of the reasons so many DOS applications sported a text user interface (or TUI) is because it was so easy to do. The standard way to control **con**sole **i**nput and **o**utput (**conio**) was with the `conio` library for many C programmers. This is a de-facto standard library on DOS, which gained popularity as implemented by Borland's proprietary C compiler as `conio.h`. You can also find a similar `conio` implementation in TK Chia's IA-16 DOS port of the GNU C Compiler in the `libi86` library of non-standard routines. The library includes implementations of `conio.h` functions that mimic Borland Turbo C++ to set video modes, display colored text, move the cursor, and so on. + +For years, FreeDOS included the OpenWatcom C Compiler in the standard distributions. OpenWatcom supports its own version of `conio`, implemented in `conio.h` for particular console input and output functions, and in `graph.h` to set colors and perform other manipulation. Because the OpenWatcom C Compiler has been used for a long time by many developers, this `conio` implementation is also quite popular. Let's get started with the OpenWatcom `conio` functions. + +### Setting the video mode + +Everything you do is immediately displayed on-screen via hardware. This is different from the `ncurses` library on Linux, where everything is displayed through terminal emulation. On DOS, everything is running on hardware. And that means DOS `conio` programs can easily access video modes and leverage screen regions in ways that are difficult using Linux `ncurses`. + +To start, you need to set the _video mode_. On OpenWatcom, you do this with the `_setvideomode` function. This function takes one of several possible values, but for most programs that run in color mode in a standard 80x25 screen, use `_TEXTC80` as the mode. + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +  _setvideomode(_TEXTC80); +  …  +``` + +When you're done with your program and ready to exit back to DOS, you should reset the video mode back to whatever values it had before. For that, you can use `_DEFAULTMODE` as the mode. + + +``` + _setvideomode(_DEFAULTMODE); +  return 0; +} +``` + +### Setting the colors + +Every PC built after 1981's Color/Graphics Adapter supports [16 text colors and 8 background colors][2]. Background colors are addressed with color indices 0 through 7, and text colors can be any value from 0 to 15: + +| | | | | | | --------- | | ----------------- | | | 0 Black | | 8 Bright Black | | | 1 Blue | | 9 Bright Blue | | | 2 Green | | 10 Bright Green | | | 3 Cyan | | 11 Bright Cyan | | | 4 Red | | 12 Bright Red | | | 5 Magenta | | 13 Bright Magenta | | | 6 Brown | | 14 Yellow | | | 7 White | | 15 Bright White | + +You can set both the text color and the color behind it. Use the `_settextcolor` function to set the text "foreground" color and `_setbkcolor` to set the text "background" color. For example, to set the colors to yellow text on a red background, you would use this pair of functions: + + +``` + _settextcolor(14); + _setbkcolor(4); +``` + +### Positioning text + +In `conio`, screen coordinates are always _row_,_col_ and start with 1,1 in the upper-left corner. For a standard 80-column display with 25 lines, the bottom-right corner is 25,80. + +Use the `_settextposition` function to move the cursor to a specific screen coordinate, then use `_outtext` to print the text you want to display. If you've set the colors, your text will use the colors you last defined, regardless of what's already on the screen. + +For example, to print the text "FreeDOS" at line 12 and column 36 (which is more or less centered on the screen) use these two functions: + + +``` +  _settextposition(12, 36); +  _outtext("FreeDOS"); +``` + +Here's a small example program: + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +    _setvideomode(_TEXTC80); + +    _settextcolor(14); +    _setbkcolor(4); + +    _settextposition(12, 36); +    _outtext("FreeDOS"); + +    [getch][3](); + +    _setvideomode(_DEFAULTMODE); + +    return 0; +} +``` + +Compile and run the program to see this output: + +![Print to the screen with conio][4] + +(Jim Hall, [CC BY-SA 4.0][5]) + +### Text windows + +The trick to unleashing the power of `conio` is to leverage a feature of the PC video display where a program can control the video hardware by region. These are called text windows and are a really cool feature of `conio`. + +A text window is just an area of the screen, defined as a rectangle starting at a particular _row_,_col_ and ending at a different _row_,_col_. These regions can take up the whole screen or be as small as a single line. Once you define a window, you can clear it with a background color and position text in it. + +To define a text window starting at row 5 and column 10, and extending to row 15 and column 70, you use the `_settextwindow` function like this: + + +``` +`  _settextwindow(5, 10, 15, 70);` +``` + +Now that you've defined the window, any text you draw in it uses 1,1 as the upper-left corner of the text window. Placing text at 1,1 will actually position that text at row 5 and column 10, where the window starts on the screen. + +You can also clear the window with a background color. The `_clearscreen` function does double duty to clear either the full screen or just the window that's currently defined. To clear the entire screen, give the value `_GCLEARSCREEN` to the function. To clear just the window, use `_GWINDOW`. With either usage, you'll fill that region with whatever background color you last set. For example, to clear the whole screen with cyan (color 3) and a smaller text window with blue (color 1) you could use this code: + + +``` +  _clearscreen(_GCLEARSCREEN); +  _setbkcolor(3); +  _settextwindow(5, 10, 15, 70); +  _setbkcolor(1); +  _clearscreen(_GWINDOW); +``` + +This makes it really easy to fill in certain areas of the screen. In fact, defining a window and filling it with color is such a common thing to do that I often create a function to do both at once. Many of my `conio` programs include some variation of these two functions to clear the screen or window: + + +``` +#include <conio.h> +#include <graph.h> + +void +clear_color(int fg, int bg) +{ +  _settextcolor(fg); +  _setbkcolor(bg); +  _clearscreen(_GCLEARSCREEN); +} + +void +textwindow_color(int top, int left, int bottom, int right, int fg, int bg) +{ +  _settextwindow(top, left, bottom, right); +  _settextcolor(fg); +  _setbkcolor(bg); +  _clearscreen(_GWINDOW); +} +``` + +A text window can be any size, even a single line. This is handy to define a title bar at the top of the screen or a status line at the bottom of the screen. Again, I find this to be such a useful addition to my programs that I'll frequently write functions to do it for me: + + +``` +#include <conio.h> +#include <graph.h> + +#include <string.h>                    /* for strlen */ + +void +clear_color(int fg, int bg) +{ +  …  +} + +void +textwindow_color(int top, int left, int bottom, int right, int fg, int bg) +{ +  …  +} + +void +print_header(int fg, int bg, const char *text) +{ +  textwindow_color(1, 1, 1, 80, fg, bg); + +  _settextposition(1, 40 - (strlen(text) / 2)); +  _outtext(text); +} + +void +print_status(int fg, int bg, const char *text) +{ +  textwindow_color(25, 1, 25, 80, fg, bg); + +  _settextposition(1, 1); +  _outtext(text); +} +``` + +### Putting it all together + +With this introduction to `conio`, and with the set of functions we've defined above, you can create the outlines of almost any program. Let's write a quick example that demonstrates how text windows work with `conio`. We'll clear the screen with a color, then print some sample text on the second line. That leaves room to put a title line at the top of the screen. We'll also print a status line at the bottom of the screen. + +This is the basics of many kinds of applications. Placing a text window towards the right of the screen could be useful if you were writing a "monitor" program, such as part of a control system, like this: + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +  _setvideomode(_TEXTC80); + +  clear_color(7, 1);                   /* white on blue */ +  _settextposition(2, 1); +  _outtext("test"); + +  print_header(0, 7, "MONITOR");       /* black on white */ + +  textwindow_color(3, 60, 23, 79, 15, 3);       /* br white on cyan */ +  _settextposition(3, 2); +  _outtext("hi mom"); + +  print_status(0, 7, "press any key to quit...");       /* black on white */ +  getch(); + +  _setvideomode(_DEFAULTMODE); + +  return 0; +} +``` + +Having already written our own window functions to do most of the repetitive work, this program becomes very straightforward: clear the screen with a blue background, then print "test" on the second line. There's a header line and a status line, but the interesting part is in the middle where the program defines a text window near the right edge of the screen and prints some sample text. The `getch()` function waits for the user to press a key on the keyboard, useful when you need to wait until the user is ready: + +![Conio mon][6] + +(Jim Hall, [CC BY-SA 4.0][5]) + +We can change only a few values to completely change the look and function of this program. By setting the background to green and red text on a white window, we have the start of a solitaire card game: + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +  _setvideomode(_TEXTC80); + +  clear_color(7, 2);                   /* white on green */ +  _settextposition(2, 1); +  _outtext("test"); + +  print_header(14, 4, "SOLITAIRE");    /* br yellow on red */ + +  textwindow_color(10, 10, 17, 22, 4, 7);       /* red on white */ +  _settextposition(3, 2); +  _outtext("hi mom"); + +  print_status(7, 6, "press any key to quit...");       /* white on brown */ +  getch(); + +  _setvideomode(_DEFAULTMODE); + +  return 0; +} +``` + +You could add other code to this sample program to print card values and suits, place cards on top of other cards, and other functionality to create a complete game. But for this demo, we'll just draw a single "card" displaying some text: + +![Conio solitaire][7] + +(Jim Hall, [CC BY-SA 4.0][5]) + +You can create other effects using text windows. For example, before drawing a message window, you could first draw a black window that's offset by one row and one column. The text window will appear to create a shadow over that area of the screen to the user. And we can do it all by changing only a few values in our sample program: + + +``` +#include <conio.h> +#include <graph.h> + +int +main() +{ +  _setvideomode(_TEXTC80); + +  clear_color(7, 1);                   /* white on blue */ +  _settextposition(2, 1); +  _outtext("test"); + +  print_header(15, 3, "PROGRAMMING IN CONIO");  /* br white on cyan */ + +  textwindow_color(11, 36, 16, 46, 7, 0);       /* shadow */ +  textwindow_color(10, 35, 15, 45, 7, 4);       /* white on red */ +  _settextposition(3, 2); +  _outtext("hi mom"); + +  print_status(0, 7, "press any key to quit...");       /* black on white */ +  getch(); + +  _setvideomode(_DEFAULTMODE); + +  return 0; +} +``` + +You often see this "shadow" effect used in DOS programs as a way to add some visual flair: + +![Conio Window with shadow][8] + +(Jim Hall, [CC BY-SA 4.0][5]) + +The DOS `conio` functions can do much more than I've shown here, but with this introduction to `conio` programming, you can create various practical and exciting applications. Direct screen access means your programs can be more interactive than a simple command-line utility that scrolls text from the bottom of the screen. Leverage the flexibility of `conio` programming and make your next DOS program a great one. + +### Download the conio cheat sheet + +As you explore programming with `conio`, it's helpful to have a list of common functions close at hand. I've created a double-sided cheat sheet with all the basics of `conio`, so **[download it][9]** and use it on your next `conio` project. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/programming-dos-conio + +作者:[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/article/21/6/freedos-sixteen-colors +[3]: http://www.opengroup.org/onlinepubs/009695399/functions/getch.html +[4]: https://opensource.com/sites/default/files/conio-hello.png (Print to the screen with conio) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/conio-mon.png (Conio mon) +[7]: https://opensource.com/sites/default/files/uploads/conio-sol.png (Conio solitaire) +[8]: https://opensource.com/sites/default/files/uploads/conio-win.png (Conio Window with shadow) +[9]: https://opensource.com/downloads/dos-conio-cheat-sheet From c87ea94ec8809346ee9f3523384c4397d3ed4cbe Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 3 Sep 2021 05:04:53 +0800 Subject: [PATCH 0228/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210902?= =?UTF-8?q?=20Linux=20Lite=20Moves=20to=20Pay=20What=20You=20Want=20Model?= =?UTF-8?q?=20With=20Version=205.6=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md --- ...You Want Model With Version 5.6 Release.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md diff --git a/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md b/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md new file mode 100644 index 0000000000..e0e534f26f --- /dev/null +++ b/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md @@ -0,0 +1,77 @@ +[#]: subject: "Linux Lite Moves to Pay What You Want Model With Version 5.6 Release" +[#]: via: "https://news.itsfoss.com/linux-lite-5-6-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Lite Moves to Pay What You Want Model With Version 5.6 Release +====== + +[Linux Lite][1] has just announced Linux lite 5.6, the fourth installment in their 5.x series of releases. This release brings some major changes, especially in the download process. Other, more subtle tweaks are also shown throughout the OS. + +Here, we will be looking at what is new, what has changed, and how these changes may affect the future of Linux Lite. + +### What Has Changed in Linux Lite 5.6? + +![][2] + +Alongside the new download model, there a few key changes. These include: + + * New features in the Lite Tweaks app + * Updated icon theme + * New wallpapers + + + +While this list is relatively short, there are a couple of meaningful changes. + +### Pay Want You Want Download Model + +Definitely the most impactful change, Linux Lite has moved to a “Pay what you want” download model. For those not familiar with the term, it is a system where the user is encouraged to pay to obtain a download link. Users can still enter $0 to get the download link for free, but it is not immediately clear and does not support the distro. + +This move follows the footsteps of other popular distros, including ElementryOS. While I can see many users being annoyed at this change, it has also been made clear that Linux Lite would die without this change. + +> “This is a road I’d never thought I’d go down, but we have no choice. Either we stagnate and accept the big G’s ever-changing algorithms, or we boldly go where others have dared.” + +Jerry Bezencon + +In hindsight, this change was inevitable, as there is almost no other way for distributions to reasonably sustain themselves (aside from donations). Now we need to see how this change pays off for the developers of Linux Lite. + +### Updated Lite Tweaks App + +With this update, the Lite Tweaks app gets a few improvements. One of these is the ability to completely clear the cache of the Brave web browser. It also has a new option to set Brave as the default web browser. + +The second update within the Lite Tweaks app is a fix for GRUB. This tweak changes the grub entry from “Ubuntu” to “Linux Lite”. However, it should be noted that this option is only available when GRUB is controlled by Linux Lite. + +### Wrapping Up + +If you want to try Linux Lite for yourself, you can [download it from its website][3]. If you are already running Linux Lite, you can update to version 5.6 using the instructions found on the [release announcement][4]. + +While minor, this release does have a few improvements scattered around the OS. Most importantly, however, is the fact that Linux Lite can now be self-sustaining, meaning that we will continue to see more features added with every release. I think this is much better that the distro dying, don’t you? + +#### 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/linux-lite-5-6-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://www.linuxliteos.com/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://www.linuxliteos.com/download.php +[4]: https://www.linuxliteos.com/forums/release-announcements/linux-lite-5-6-final-released/ From 3cd08edea8b9e19c6cf9ed599e094d66da009e66 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Sep 2021 06:57:21 +0800 Subject: [PATCH 0229/1588] PRF @geekpi --- ...ux kernel modules we can-t live without.md | 91 +++++++++++-------- 1 file changed, 52 insertions(+), 39 deletions(-) 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 index 88935c79b5..8788ac1828 100644 --- 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 @@ -3,94 +3,107 @@ [#]: author: "Jen Wike Huger https://opensource.com/users/jen-wike" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 我们离不开的 Linux 内核模块 ====== -开源爱好者们对他们所喜爱的 Linux 内核模块进行了评价。 -![Linux keys on the keyboard for a desktop computer][1] -Linux 内核今年就要满 30 岁了! 如果你像我们一样,这是件大事,我们本周将用几个特别的帖子来庆祝 Linux。 +> 开源爱好者们对他们所喜爱的 Linux 内核模块进行了评价。 -今天,我们先来看看来自社区的回复,回答“你不能没有哪个 Linux 内核模块?为什么?”让我们听听这 10 位爱好者是怎么说的。 +![](https://img.linux.net.cn/data/attachment/album/202109/03/065649hik5hjiiy3htj589.jpg) -* * * +Linux 内核今年就要满 30 岁了! 如果你像我们一样对此特别重视,那么让我们本周用几个特别的文章来庆祝 Linux。 -我猜一些内核开发者听到我的回答后会尖叫着跑开。不过,我还是在这里列出了两个最具争议性的模块“ +今天,我们先来看看来自社区对“**你不能没有哪个 Linux 内核模块?为什么?**”的回答,让我们听听这 10 位爱好者是怎么说的。 + +### #1 + +我猜一些内核开发者听到我的回答后会尖叫着跑开。不过,我还是在这里列出了两个最具争议性的模块: * 第一个是 NVIDIA,因为我的工作笔记本和个人台式机上都有 NVIDIA 显卡。 - * 另一个可能产生的仇恨较少。VMware 的 VMNET 和 VMMON 模块,以便能够运行 VMware Workstation。—[Peter Czanik][2] + * 另一个可能产生的仇恨较少。VMware 的 VMNET 和 VMMON 模块,以便能够运行 VMware Workstation。 +— [Peter Czanik][2] +### #2 -* * * +我最喜欢的是 [zram][3] 模块。它在内存中创建了一个压缩块设备,然后它可以作为交换分区使用。在内存有限的情况下(例如,在虚拟机上),还有如果你担心频繁的 I/O 操作会磨损你的 SSD 或者甚至更糟糕的基于闪存的存储,那么使用基于 zram 的交换分区是非常理想的。 -我最喜欢的是 [zram][3] 模块。它在内存中创建了一个压缩块设备,然后可以作为交换分区使用。在内存有限的情况下(例如,在虚拟机上),还有如果你担心频繁的 I/O 操作会磨损你的 SSD 或者甚至更糟糕的是基于闪存的存储,那么使用基于 zram 的交换分区是非常理想的。—[Stephan Avenwedde][4] 。 +— [Stephan Avenwedde][4] -* * * +### #3 -最有用的内核模块无疑是 snd-hda-intel,因为它支持大多数集成声卡。我一边听音乐,一边在 Linux 桌面上编码一个音频编曲器。—[Joël Krähemann][5] +最有用的内核模块无疑是 snd-hda-intel,因为它支持大多数集成声卡。我可以一边听音乐,一边在 Linux 桌面上编码一个音频编曲器。 -* * * +— [Joël Krähemann][5] -如果没有我用 Broadcom 文件生成的 kmod-wl,我的笔记本就没有价值了。我有时会收到关于内核污染的信息,但没有无线的笔记本电脑有什么用呢?—[Gregory Pittman][6] 。 +### #4 -* * * +如果没有我用 Broadcom 文件生成的 kmod-wl,我的笔记本就没有价值了。我有时会收到关于内核污染的信息,但没有无线网络的笔记本电脑有什么用呢? -我不能没有蓝牙。没有它,我的鼠标、键盘、扬声器和耳机就成了门板。—[Gary Smith][7] +— [Gregory Pittman][6] -* * * +### #5 -我要冒昧地说_所有这些_都是。 说真的,我们已经到了随机拿一块硬件,插入它,它就可以工作的地步。 +我不能没有蓝牙。没有它,我的鼠标、键盘、扬声器和耳机除了用来挡住门板还有啥用? + +— [Gary Smith][7] + +### #6 + +我要冒昧地说 _全_ 都是。 说真的,我们已经到了随机拿一块硬件,插入它,它就可以工作的地步。 * USB 串行适配器能正常工作 - * 显卡可以使用(尽管可能不是最好的)。 + * 显卡可以使用(尽管可能不是最好的) * 网卡正常工作 * 声卡正常工作 +所有这些模块整体带来大量可以工作的驱动程序,令人印象深刻。我记得在过去那些糟糕的日子里,我们曾经大喊 xrandr 魔法字符串才能来使投影仪工作。而现在,是的,当设备基本不能正常工作时,才真的罕见。 +如果我不得不把它归结为一个,那就是 raid6。 -很难不对所有模块为整体带来的广泛的驱动程序工作印象深刻。我记得在过去的坏日子里,我们曾经大喊 xrandr 魔法字符串来使投影仪工作。而现在,是的,当东西(大部分)不能正常工作时,这是一种真正的罕见。 +— [John 'Warthog9' Hawley][8] -如果我不得不把它归结为一个,那就是 raid6。—[John 'Warthog9' Hawley][8] +### #7 -* * * - -对于这个问题,我想回到 20 世纪 90 年代末。我是一家小公司的 Unix 系统管理员(兼任 IS 经理)。我们的磁带备份系统死了,由于“小公司”预算有限,我们没有急于更换或现场维修。所以我们不得不把它送去维修。 +对于这个问题,我想回到 20 世纪 90 年代末。我是一家小公司的 Unix 系统管理员(兼任 IS 经理)。我们的磁带备份系统死了,由于“小公司”预算有限,我们没有急于更换或现场维修。所以我们必须得把它送去维修。 在那两个星期里,我们没有办法进行磁带备份。没有一个系统管理员愿意处于这种境地。 -但后来我想起了读过的[如何使用软盘磁带机][9],我们刚好有一台刚换下来的塔式电脑,有一个软磁带驱动器。 +但后来我想起了读过的 [如何使用软盘磁带机][9],我们刚好有一台刚换下来的塔式电脑,它有一个软盘磁带机。 -于是我用 Linux 重新安装了它,设置了 **ftape** 内核驱动模块,进行了一些备份/恢复测试,然后将我们最重要的备份运行到 QIC 磁带上。在这两个星期里,我们依靠 **ftape** 备份重要数据。 +于是我用 Linux 重新安装了它,设置了 ftape 内核驱动模块,进行了一些备份/恢复测试,然后将我们最重要的备份运行到 QIC 磁带上。在这两个星期里,我们依靠 ftape 备份重要数据。 -所以,对于那些让软盘磁带机在 1990 年代的 Linux 上工作的无名英雄,你真是太厉害了!—[Jim Hall][10] +所以,对于那些让软盘磁带机在 1990 年代的 Linux 上工作的无名英雄,你真是太厉害了! -* * * +— [Jim Hall][10] -嗯,这很简单。是 kvm 内核模块。在个人方面,我无法想象在没有虚拟机的情况下做我的日常工作。我愿意相信我们大多数人都是这样。kvm 模块在使 Linux 成为云战略的核心方面也发挥了很大作用。—[Gaurav Kamathe][11] +### #8 -* * * +嗯,这很简单。是 kvm 内核模块。就个人而言,我无法想象在没有虚拟机的情况下完成日常工作。我愿意相信我们大多数人都是这样。kvm 模块在使 Linux 成为云战略的核心方面也发挥了很大作用。 -对我来说,是 dm-crypt,它是用于 LUKS 的。见: +— [Gaurav Kamathe][11] + +### #9 + +对我来说,是 dm-crypt,它是用于 LUKS 的。参见: * * +知道别人无法看到你的磁盘上的内容是非常棒的,例如,如果你的笔记本丢失或被盗时。 +— [Maximilian Kolb][12] -知道别人无法看到你的磁盘上的内容是非常棒的,例如,如果你的笔记本丢失或被盗时。—[Maximilian Kolb][12] +### #10 +对于密码学基础,很难超越 crypto 模块和它的 C API,它是如此简洁明了。 -* * * +在日常生活中,还有什么比蓝牙提供的即插即用更有价值的吗? -对于密码学基础,很难超越 crypto 模块和它的 C API,它很简单。 - -在日常生活中,还有什么比蓝牙提供的即插即用更有价值的吗?—[Marty Kalin][13] - -* * * +— [Marty Kalin][13] 在评论中与我们分享。你的生活中不能没有什么 Linux 内核模块? @@ -101,7 +114,7 @@ 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) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From a04df20b0f601d95475fe6df5df409d0b9917efc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 3 Sep 2021 06:58:07 +0800 Subject: [PATCH 0230/1588] PUB @geekpi https://linux.cn/article-13747-1.html --- .../20210827 Linux kernel modules we can-t live without.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210827 Linux kernel modules we can-t live without.md (98%) diff --git a/translated/tech/20210827 Linux kernel modules we can-t live without.md b/published/20210827 Linux kernel modules we can-t live without.md similarity index 98% rename from translated/tech/20210827 Linux kernel modules we can-t live without.md rename to published/20210827 Linux kernel modules we can-t live without.md index 8788ac1828..ddcdd82d5c 100644 --- a/translated/tech/20210827 Linux kernel modules we can-t live without.md +++ b/published/20210827 Linux kernel modules we can-t live without.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13747-1.html" 我们离不开的 Linux 内核模块 ====== From 8b60cbeb5bb36d4a287b490ca5b6cc7cba854a34 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Fri, 3 Sep 2021 08:09:04 +0800 Subject: [PATCH 0231/1588] translated by perfiffer --- ...xt on your screen in Linux with ncurses.md | 138 ------------------ ...xt on your screen in Linux with ncurses.md | 130 +++++++++++++++++ 2 files changed, 130 insertions(+), 138 deletions(-) delete mode 100644 sources/tech/20210829 Position text on your screen in Linux with ncurses.md create mode 100644 translated/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 deleted file mode 100644 index 644d88a9ff..0000000000 --- a/sources/tech/20210829 Position text on your screen in Linux with ncurses.md +++ /dev/null @@ -1,138 +0,0 @@ -[#]: 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: "perfiffer" -[#]: 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 diff --git a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md b/translated/tech/20210829 Position text on your screen in Linux with ncurses.md new file mode 100644 index 0000000000..acaf808c82 --- /dev/null +++ b/translated/tech/20210829 Position text on your screen in Linux with ncurses.md @@ -0,0 +1,130 @@ +[#]: sub·ject: "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: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 ncurses 在你的 Linux 屏幕上定位文本 +====== +使用 ncurses 在 Linux 屏幕上的特定位置放置文本,可以带来更友好的用户界面体验。 +![Person using a laptop][1] + +大多数的 Linux 实用程序仅仅只在屏幕的底部滚动文本。如果你想在屏幕中放置你的文本,例如一个游戏或者一个数据展示,你可以试试 **ncurses**。 + +**curses** 是一个旧的 Unix 库,它可以在文本终端界面控制光标。curses 的名称就来自于术语 cursor control。多年以后,其他人编写了新的 **curses** 版本用来添加新的功能,新版本被叫做 new curses 或者 **ncurses**。你可以在每个流行的 Linux 发行版中找到 ncurses。尽管默认情况下可能未安装开发库、头文件和文档。例如,在 Fedora 上,你需要使用以下命令安装 **ncurses-devel** 包: + + +``` +$ sudo dnf install ncurses-devel +``` + +### 在程序中使用 ncurses + +要在屏幕上直接寻址,你首先需要初始化 **ncurses** 库。大部分程序会通过以下三行来做到这一点: + + * initscr(); 初始化窗口对象和 ncurses 代码,返回代表整个屏幕的窗口对象 + * cbreak(); 禁用缓冲并使键入的输入立即可用 + * noecho(); 关闭回显,因此用户输入不会显示在屏幕上 + + +这些函数定义在 **curses.h** 头文件中,你需要在你的程序中通过以下方式将其包含进来: + +``` +#include +``` + +初始化终端后,你可以自由使用任何 **ncurses** 函数,我们将在示例程序中探讨其中的一些函数。 + +当你使用完 **ncurses** 并想返回到常规终端模式下时,使用 **endwin();** 重置一切。此命令可以重置任何屏幕颜色,将光标移动到屏幕的左下角,并使光标可见。通常在退出程序之前执行此操作。 + +### 在屏幕上寻址 + +关于 **ncurses** 首先需要知道的是屏幕的坐标分为行和列,左上角的是 0,0 点。**ncurses** 定义了两个全局变量来帮助你识别屏幕:LINES 是屏幕的行数,COLS 是屏幕的列数。屏幕右下角的位置是 LINES-1,COLS-1。 +例如,如果你想要移动光标到第 10 行和第 30 列,你可以使用移动函数,移动到此坐标: + +``` +move(10, 30); +``` + +之后显示的任何文本都将从屏幕的该位置开始。要显示单个字符,请对单个字符使用 **addch(c)** 函数。要显示字符串,将对字符串使用 **addstr(s)** 函数。对于类似于 **printf** 的格式化输出,请使用带有常用选项的 **printw(fmt, …)**。 + +移动到屏幕指定位置和显示文本是一件很常见的事情,**ncurses** 提供了同时执行这两项操作的快捷方式。**mvaddch(row, col, c)** 函数将在屏幕第 row 行,第 col 列的位置显示一个字符。而 **mvaddstr(row, col, s)** 函数将在屏幕第 row 行,第 col 列的位置显示一个字符串。更直接的例子,在程序中使用 **mvaddstr(10, 30, "Welcome to ncurses");** 函数将从屏幕的第 10 行和第 30 列开始显示文本 "Welcome to ncurses"。使用 **mvaddch(0, 0, '+');** 函数将在屏幕的左上角第 0 行和第 0 列处显示一个加号。 + +在终端屏幕上绘制文本会对某些系统产生性能影响,尤其是在较旧的硬件终端上。因此 **ncurses** 允许你“堆叠”一堆文本以显示在屏幕上,然后使用 **refresh()** 函数使所有这些更改对用户可见。 + +让我们来看一个将以上所有内容整合在一起的简单示例: + +``` +#include + +int +main() +{ +  initscr(); +  cbreak(); +  noecho(); + +  mvaddch(0, 0, '+'); +  mvaddch(LINES - 1, 0, '-'); +  mvaddstr(10, 30, "press any key to quit"); +  refresh(); + +  getch(); + +  endwin(); +} +``` + +程序的开始初始化了一个终端窗口,然后在屏幕的左上角打印了一个加号,在左下角打印了一个减号,在第 10 行和第 30 列打印了 “press any key to quit” 文本。程序通过使用 getch() 函数接收了键盘输入的单个字符,接着,使用 **endwin()** 函数在程序完全退出前重置了终端。 + +**getch()** 是一个很有用的函数,你可以使用它来做很多事情。我经常使用它在我退出程序前用来暂停。与大多数 **ncurses** 函数一样,还有一个名为 **mvgetch(row, col)** 的 **getch()** 版本,用于在等待字符输入之前移动到屏幕位置的第 row 行,第 col 列。 + +### 使用 ncurses 编译 + +如果你尝试以通常的方式编译该示例程序,例如 `gcc pause.c`,你可能会从链接器中获得大量错误列表。那是因为 GNU C 编译器不会自动链接 **ncurses** 库。相反,你需要使用 `-l ncurses` 命令行选项加载它以进行链接。 + +``` +$ gcc -o pause pause.c -lncurses +``` + +运行新程序将打印一条简单的 “press any key to quit” 消息,该消息差不多位于屏幕中央: + +![centered message in a program window][2] + +图 1:程序中居中的 “press any key to quit” 消息。 + +### 使用 ncurses 构建更好的程序 + +探索 **ncurses** 库函数以了解在屏幕上显示文本的其它方法。你可以在 ncurses 的 man 手册页中找到所有 **ncurses** 函数的列表。这给出了 **ncurses** 的一般概述,并提供了不同 **ncurses** 函数的类似表格的列表,并参考了包含完整详细信息的手册页。例如,在 curs_printw(3X) 手册页中描述了 **printw**,您可以通过以下方式查看: + +``` +$ man 3x curs_printw +``` + +更简单点: + + +``` +$ man curs_printw +``` + +使用 **ncurses**,你可以创建更多有趣的程序。通过在屏幕上的特定位置打印文本,你可以创建在终端中运行的游戏和高级实用程序。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/ncurses-linux + +作者:[Jim Hall][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/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 16ed72bf609398570dacc2dee08e4731a29890c0 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 3 Sep 2021 08:54:39 +0800 Subject: [PATCH 0232/1588] translated --- ...esting Open-Source Alternative to Slack.md | 99 ------------------- ...esting Open-Source Alternative to Slack.md | 99 +++++++++++++++++++ 2 files changed, 99 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md create mode 100644 translated/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 deleted file mode 100644 index 973cf54ef5..0000000000 --- a/sources/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: 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: "geekpi" -[#]: 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/ diff --git a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md new file mode 100644 index 0000000000..780348c7c7 --- /dev/null +++ b/translated/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: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Zulip:一个有趣的开源的 Slack 替代品 +====== + +_**简介:** Zulip 是一个开源的协作平台,它把自己定位为 Slack 的一个更好的替代品。让我们仔细看看。_ + +当涉及到你的工作时,消息和协作平台有很大的不同。 + +虽然有几个选择,但 Slack 是许多组织使用的一个流行选择。但是,你可以自托管的 Slack 的开源替代方案如何呢? + +Zulip 就是这样一个软件。 + +### Zulip:开源的协作消息应用 + +![][1] + +如果你想探索,我必须提到还有更多的 [Slack 开源替代品][2]。 + +在这里,我重点介绍 Zulip。 + +Zulip 是一个免费开源的消息应用,有付费托管选项和自我托管的能力。 + +它旨在提供与 Slack 类似的体验,同时努力帮助你利用话题提高对话的有效性。 + +与 Slack 中的频道相比,Zulip 聊天添加了话题(类似标签),以快速过滤与你有关的对话。 + +### Zulip 的特点 + +![][3] + +你可以通过 Zulip 获得大部分的基本功能。这里列出主要的亮点,你可以发现: + + * 支持 Markdown + * 频道的主题 + * 支持拖放文件 + * 代码块 + * 集成 GitHub 来跟踪问题 + * 支持电子邮件通知 + * 自我托管选项 + * 信息编辑 + * GIPHY 集成 + * 用 Zoom、Jitsi 或 BigBlueButton 进行视频通话 + + + +除了上述功能外,你应该期待你通常在 Slack 和其他方面得到的基本选项。 + +此外,如果你愿意,你还可以将它与 Matrix 和 IRC 整合。 + +![][4] + +在我简短的测试使用中,用户界面对于有效的沟通来说是足够好的。然而,我没能找到任何黑暗模式或改变主题的能力。 + +它看起来比 Slack 更直接,这样可以改善用户体验方面的问题。 + +### 在 Linux 中安装 Zulip + +Zulip 在其官方网站上以 AppImage 文件的形式提供。如果你需要帮助,可以参考我们关于[在 Linux 中使用 AppImage][5] 的指南。 + +它也有一个 snap 包。所以,你可以在任何一个 Linux 发行版上使用它们中的任何一个。 + +你也可以使用 APT 通过终端为基于 Ubuntu/Debian 的发行版安装它。如果你想这样做,请看它的[官方说明][6]。 + +Zulip 可用于 Windows、Mac 和 Linux。你也应该发现它可用于 Android 和 iOS 手机。 + +[Zulip][7] + +考虑到你可以在网络、桌面和智能手机上使用 Zulip,它是 Slack 的合适替代品。 + +_你试过了吗?你用什么消息平台来进行工作协作?欢迎在评论中分享你的想法。_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/zulip/ + +作者:[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://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 938f951d78a4830b1af48e9352544f38344cbf09 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 3 Sep 2021 08:58:16 +0800 Subject: [PATCH 0233/1588] translating --- sources/tech/20210901 What are container runtimes.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210901 What are container runtimes.md b/sources/tech/20210901 What are container runtimes.md index eaba30fae8..56f3b32fe8 100644 --- a/sources/tech/20210901 What are container runtimes.md +++ b/sources/tech/20210901 What are container runtimes.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/container-runtimes" [#]: author: "Nived V https://opensource.com/users/nivedv" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d8aecbd176e59d49783267806355267ef1c2488c Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Fri, 3 Sep 2021 17:22:18 +0800 Subject: [PATCH 0234/1588] translated --- ...200211 Using external libraries in Java.md | 99 +++++++++---------- 1 file changed, 44 insertions(+), 55 deletions(-) rename {sources => translated}/tech/20200211 Using external libraries in Java.md (57%) diff --git a/sources/tech/20200211 Using external libraries in Java.md b/translated/tech/20200211 Using external libraries in Java.md similarity index 57% rename from sources/tech/20200211 Using external libraries in Java.md rename to translated/tech/20200211 Using external libraries in Java.md index 63791df886..f852e55ce6 100644 --- a/sources/tech/20200211 Using external libraries in Java.md +++ b/translated/tech/20200211 Using external libraries in Java.md @@ -7,63 +7,58 @@ [#]: via: (https://opensource.com/article/20/2/external-libraries-java) [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) -Using external libraries in Java +在 Java 中使用外部库 ====== -External libraries fill gaps in the Java core libraries. +外部库填补了 Java 核心库中的一些功能空白。 ![books in a library, stacks][1] -Java comes with a core set of libraries, including those that define commonly used data types and related behavior, like **String** or **Date**; utilities to interact with the host operating system, such as **System** or **File**; and useful subsystems to manage security, deal with network communications, and create or parse XML. Given the richness of this core set of libraries, it's often easy to find the necessary bits and pieces to reduce the amount of code a programmer must write to solve a problem. +Java 自带有一组核心库,其中包含了定义常用数据类型和相关行为的库(例如 **String** 和 **Date**)、与主机操作系统交互的实用程序(例如 **System** 和 **File**),以及一些用来管理安全性、处理网络通信、创建或解析 XML的有用的子系统。鉴于核心库的丰富性,程序员通常很容易在其中找到有用的组件,以减少需要编写的代码量。 -Even so, there are a lot of interesting Java libraries created by people who find gaps in the core libraries. For example, [Apache Commons][2] "is an Apache project focused on all aspects of reusable Java components" and provides a collection of some 43 open source libraries (as of this writing) covering a range of capabilities either outside the Java core (such as [geometry][3] or [statistics][4]) or that enhance or replace capabilities in the Java core (such as [math][5] or [numbers][6]). +即便如此,核心库仍有一些功能上的不足,因此发现这些不足的程序员们还额外创建了很多有趣的 Java 库。例如,[Apache Commons][2] 是一个专注于可重用 Java 组件所有方面的 Apache 项目,提供了大约 43 个开源库的集合(截至撰写本文时),涵盖了 Java 核心库之外的一系列功能 (例如 [geometry][3] 或 [statistics][4]),并增强或替换了 Java 核心库中的原有功能(例如 [math][5] 或 [numbers][6])。 -Another common type of Java library is an interface to a system component—for example, to a database system. This article looks at using such an interface to connect to a [PostgreSQL][7] database and get some interesting information. But first, I'll review the important bits and pieces of a library. +另一种常见的 Java 库类型是系统组件的接口(例如数据库系统接口),本文会着眼于使用此类接口连接到 [PostgreSQL][7] 数据库,并得到一些有趣的信息。首先,我们来回顾一下库的重要部分。 -### What is a library? +### 什么是库? -A library, of course, must contain some useful code. But to be useful, that code needs to be organized in such a way that the Java programmer can access the components to solve the problem at hand. +库里自然包含的是一些有用的代码。但为了发挥用处,代码需要以特定方式进行组织,特定的方式使 Java 程序员可以访问其中组件来解决手头问题。 -I'll boldly claim that the most important part of a library is its application programming interface (API) documentation. This kind of documentation is familiar to many and is most often produced by [Javadoc][8], which reads structured comments in the code and produces HTML output that displays the API's packages in the panel in the top-left corner of the page; its classes in the bottom-left corner; and the detailed documentation at the library, package, or class level (depending on what is selected in the main panel) on the right. For example, the [top level of API documentation for Apache Commons Math][9] looks like: +可以说,一个库最重要的部分是它的应用程序编程接口 (API) 文档。这种文档很多人都熟悉,通常是由 [Javadoc][8] 生成的。Javadoc 读取代码中的结构化注释并以 HTML 格式输出文档,通常 API 的 (pacage) 在页面左上角的面板中显示,(class) 在左下角显示,同时右侧会有库、包或类级别的详细文档(具体取决于在主面板中选择的内容)。例如,[Apache Commons Math 的顶级 API 文档][9] 如下所示: ![API documentation for Apache Commons Math][10] -Clicking on a package in the main panel shows the Java classes and interfaces defined in that package. For example, **[org.apache.commons.math4.analysis.solvers][11]** shows classes like **BisectionSolver** for finding zeros of univariate real functions using the bisection algorithm. And clicking on the [BisectionSolver][12] link lists all the methods of the class **BisectionSolver**. +单击主面板中的包会显示该包中定义的 Java 类和接口。例如,**[org.apache.commons.math4.analysis.solvers][11]** 显示了诸如 **BisectionSolver** 这样的类,该类用于使用二分算法查找单变量实函数的零点。单击 [BisectionSolver][12] 链接会列出 **BisectionSolver** 类的所有方法。 -This type of documentation is useful as reference information; it's not intended as a tutorial for learning how to use the library. For example, if you know what a univariate real function is and look at the package **org.apache.commons.math4.analysis.function**, you can imagine using that package to compose a function definition and then using the **org.apache.commons.math4.analysis.solvers** package to look for zeros of the just-created function. But really, you probably need more learning-oriented documentation to bridge to the reference documentation. Maybe even an example! +这类文档可用作参考文档,不适合作为学习如何使用库的教程。比如,如果你知道什么是单变量实函数并查看包 **org.apache.commons.math4.analysis.function**,就可以试着使用该包来组合函数定义,然后使用 **org.apache.commons.math4.analysis.solvers** 包来查找刚刚创建的函数的零点。但如果你不知道,就可能需要更多学习向的文档,也许甚至是一个实际例子,来读懂参考文档。 -This documentation structure also helps clarify the meaning of _package_—a collection of related Java class and interface definitions—and shows what packages are bundled in a particular library. +这种文档结构还有助于阐明 _package_(相关 Java 类和接口定义的集合)的含义,并显示特定库中捆绑了哪些包。 -The code for such a library is most commonly found in a [**.jar** file][13], which is basically a .zip file created by the Java **jar** command that contains some other useful information. **.jar** files are typically created as the endpoint of a build process that compiles all the **.java** files in the various packages defined. +这种库的代码通常是在 [**.jar** 文件][13] 中,它基本上是由 Java 的 **jar** 命令创建的 .zip 文件,其中还包含一些其他有用的信息。**.jar** 文件通常被创建为构建过程的端点,该构建过程编译了所定义包中的所有 **.java** 文件。 -There are two main steps to accessing the functionality provided by an external library: +要访问外部库提供的功能,有两个主要步骤: - 1. Make sure the library is available to the Java compilation step—[**javac**][14]—and the execution step—**java**—via the classpath (either the **-cp** argument on the command line or the **CLASSPATH** environment variable). - 2. Use the appropriate **import** statements to access the package and class in the program source code. + 1. 确保通过类路径(或者命令行中的 **-cp** 参数或者 **CLASSPATH** 环境变量),库可用于 Java 编译步骤([**javac**][14])和执行步骤(**java**)。 + 2. 使用恰当的 **import** 语句访问程序源代码中的包和类。 +其余的步骤就与使用 **String** 等 Java核心类相同,使用库提供的类和接口定义来编写代码。很简单对吧?不过也没那么简单。首先,你需要了解库组件的预期使用模式,然后才能编写代码。 +### 示例:连接 PostgreSQL 数据库 -The rest is just like coding with Java core classes, such as **String**—write the code using the class and interface definitions provided by the library. Easy, eh? Well, maybe not quite that easy; first, you need to understand the intended use pattern for the library components, and then you can write code. +在数据库系统中访问数据的典型使用步骤是: -### An example: Connect to a PostgreSQL database + 1. 访问正在使用的特定数据库软件代码。 + 2. 连接到数据库服务器。 + 3. 构建查询字符串。 + 4. 执行查询字符串。 + 5. 针对返回的结果,做需要的处理。 + 6. 断开与数据库服务器的连接。 -The typical use pattern for accessing data in a database system is: +所有这些面向程序员的部分由接口包 **[java.sql][15]** 提供,它独立于数据库,定义了核心客户端 Java 数据库连接 (JDBC) API。**java.sql** 包是 Java 核心库的一部分,因此无需提供 **.jar** 文件即可编译。但每个数据库提供者都会创建自己的 **java.sql** 接口实现(例如 **Connection** 接口),并且必须在运行步骤中提供这些实现。 - 1. Gain access to the code specific to the database software being used. - 2. Connect to the database server. - 3. Build a query string. - 4. Execute the query string. - 5. Do something with the results returned. - 6. Disconnect from the database server. +接下来我们使用 PostgreSQL,看看这一过程是如何进行的。 +#### 访问特定数据库的代码 - -The programmer-facing part of all of this is provided by a database-independent interface package, **[java.sql][15]**, which defines the core client-side Java Database Connectivity (JDBC) API. The **java.sql** package is part of the core Java libraries, so there is no need to supply a **.jar** file to the compile step. However, each database provider creates its own implementation of the **java.sql** interfaces—for example, the **Connection** interface—and those implementations must be provided on the run step. - -Let's see how this works, using PostgreSQL. - -#### Gain access to the database-specific code - -The following code uses the [Java class loader][16] (the **Class.forName()** call) to bring the PostgreSQL driver code into the executing virtual machine: - +以下代码使用 [Java 类加载器][16](**Class.forName()** 调用)将 PostgreSQL 驱动程序代码加载到正在执行的虚拟机中: ``` import java.sql.*; @@ -90,10 +85,9 @@ public class Test1 { } ``` -Because the class loader can fail, and therefore can throw an exception when failing, surround the call to **Class.forName()** in a try-catch block. - -If you compile the above code with **javac** and run it with Java: +因为类加载器可能失败,失败时会抛出异常,所以将对 **Class.forName()** 的调用放在 try-catch 代码块中。 +如果你使用 **javac** 编译上面的代码,然后用 Java 运行,会报异常: ``` me@mymachine:~/Test$ javac Test1.java @@ -103,8 +97,7 @@ java.lang.ClassNotFoundException: org.postgresql.Driver me@mymachine:~/Test$ ``` -The class loader needs the **.jar** file containing the PostgreSQL JDBC driver implementation to be on the classpath: - +类加载器要求类路径中有包含 PostgreSQL JDBC 驱动程序实现的 **.jar** 文件: ``` me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test1 @@ -113,10 +106,9 @@ done. me@mymachine:~/Test$ ``` -#### Connect to the database server - -The following code loads the JDBC driver and creates a connection to the PostgreSQL database: +#### 连接到数据库服务器 +以下代码实现了加载 JDBC 驱动程序和创建到 PostgreSQL 数据库的连接: ``` import java.sql.*; @@ -161,8 +153,7 @@ public class Test2 { } ``` -Compile and run it: - +编译并运行上述代码: ``` me@mymachine:~/Test$ javac Test2.java @@ -174,19 +165,18 @@ done. me@mymachine:~/Test$ ``` -Some notes on the above: +关于上述的一些注意事项: - * The code following comment [2] uses system properties to set up connection parameters—in this case, the PostgreSQL username and password. This allows for grabbing those parameters from the Java command line and passing all the parameters in as an argument bundle. There are other **Driver.getConnection()** options for passing in the parameters individually. - * JDBC requires a URL for defining the database, which is declared above as **String database** and passed into the **Driver.getConnection()** method along with the connection parameters. - * The code uses try-with-resources, which auto-closes the connection upon completion of the code in the try-catch block. There is a lengthy discussion of this approach on [Stack Overflow][23]. - * The try-with-resources provides access to the **Connection** instance and can execute SQL statements there; any errors will be caught by the same **catch** statement. + * 注释 [2] 后面的代码使用系统属性来设置连接参数(在本例中参数为 PostgreSQL 用户名和密码)。代码也可以从 Java 命令行获取这些参数并将所有参数作为参数包传递,同时还有一些其他 **Driver.getConnection()** 选项可用于单独传递参数。 + * JDBC 需要一个用于定义数据库的 URL,它在上述代码中被声明为 **String database** 并与连接参数一起传递给 **Driver.getConnection()** 方法。 + * 代码使用 try-with-resources 语句,它会在 try-catch 块中的代码完成后自动关闭连接。[Stack Overflow][23] 上对这种方法进行了长期的讨论。 + * try-with-resources 语句提供对 **Connection** 实例的访问,并可以在其中执行 SQL 语句;所有错误都会被同一个 **catch** 语句捕获。 - - -#### Do something fun with the database connection +#### 用数据库的连接处理一些有趣的事情 In my day job, I often need to know what users have been defined for a given database server instance, and I use this [handy piece of SQL][24] for grabbing a list of all users: +日常工作中,我经常需要知道为给定的数据库服务器实例定义了哪些用户,这里我使用这个 [简便的 SQL][24] 来获取所有用户的列表: ``` import java.sql.*; @@ -264,10 +254,9 @@ public class Test3 { } ``` -In the above, once it has the **Connection** instance, it defines a query string (comment [4] above), creates a **Statement** instance and uses it to execute the query string, then puts its results in a **ResultSet** instance, which it can iterate through to analyze the results returned, and ends by closing both the **ResultSet** and **Statement** instances (comment [5] above). - -Compiling and executing the program produces the following output: +在上述代码中,一旦有了 **Connection** 实例,它就会定义一个查询字符串(上面的注释 [4]),创建一个 **Statement** 实例并用其来执行查询字符串,然后将其结果放入一个 **ResultSet** 实例。程序可以遍历该 **ResultSet** 实例来分析返回的结果,并以关闭 **ResultSet** 和 **Statement** 实例结束(上面的注释 [5])。 +编译和执行程序会产生以下输出: ``` me@mymachine:~/Test$ javac Test3.java @@ -284,7 +273,7 @@ done. me@mymachine:~/Test$ ``` -This is a (very simple) example of using the PostgreSQL JDBC library in a simple Java application. It's worth emphasizing that it didn't need to use a Java import statement like **import org.postgresql.jdbc.*;** in the code because of the way the **java.sql** library is designed. Because of that, there's no need to specify the classpath at compile time. Instead, it uses the Java class loader to bring in the PostgreSQL code at run time. +这是在一个简单的 Java 应用程序中使用 PostgreSQL JDBC 库的(非常简单的)示例。要注意的是,由于 **java.sql** 库的设计方式,它不需要在代码中使用像 **import org.postgresql.jdbc.*;** 这样的 Java 导入语句,而是使用 Java 类加载器在运行时引入 PostgreSQL 代码的方式,也正因此无需在代码编译时指定类路径。 -------------------------------------------------------------------------------- From 7a61fcb0b8c37bcabb468f14cbc5d4e74f33b57f Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Fri, 3 Sep 2021 22:17:42 +0800 Subject: [PATCH 0235/1588] Update 20210819 A guide to understanding your team-s implicit values and needs.md --- ...g your team-s implicit values and needs.md | 31 +++++++++---------- 1 file changed, 14 insertions(+), 17 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 b6fb24d3ae..39d7e1cbf2 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 @@ -14,41 +14,38 @@ 文化在[开放的组织][2]很重要。 但“文化”似乎是一个如此庞大而复杂的概念。我们该如何帮助开放式的团队组织去理解它呢? -一个解决方案可能来自于 [_Rule Makers, Rule Breakers_][4]_的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号_。Gelfand 把所有的国家和文化分成简单的两类, 一类是“严格的”文化另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。 +一个解决方案可能来自于 [_Rule Makers, Rule Breakers_][4]_的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号_。Gelfand 把所有的国家和文化分成简单的两类, 一类是“紧密的”文化另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。 In this two-part review of _Rule Makers, Rule Breakers_, 我将解释 Gelfand 的论点,并讨论它对在开放性组织中工作的人们有用的方式。 ### 了解你的社会规范 -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. +Gelfand 认为,我们的行为很大程度上取决于我们是生活在 "紧密的" 还是 "松散的" 社区文化中,因为这些文化有不同于其他文化的社会规范。这些规范————以及强制执行的严格程度————将决定我们在社会中的行为。 它们给了我们身份。它们帮助我们彼此协调,简而言之,这些价值使社区团结在一起。 -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). +它们也会影响我们的世界观,影响我们构造环境的方式,甚至影响我们大脑的处理过程。 Gelfand 写道:“无数研究表明,社会规范对于将社区团结成合作、协调良好的团体,从而实现伟大成就至关重要。” 纵观历史,社区让其公民参加看似最疯狂的仪式,除了维持群体凝聚力和合作外,别无其他原因。 这些仪式产生了更紧密的联系,使人们得以生存(特别是在狩猎、觅食和战争时期)。 -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. +社会规范包括我们所有人都会自动遵守的规则, Gelfand 称之为一种 “规范性自动驾驶仪。” 这些是我们不需要思考就能做的事情————例如,在图书馆、电影院、电梯或飞机上保持安静。 我们会自动的做这些事。 “从外面看,” Gelfand 说, “我们的社会规范通常看起来很奇怪。但在内心深处,我们认为这是理所当然的。” 她解释到,社会规范可以被编入法规和法律(“遵守停车标志”和“不要偷窃”)。还有一些基本上是默不作声的(“不要盯着火车上的人看”或“打喷嚏时捂住嘴”)。当然,它们因环境而异。 -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 将社会规范组织成不同的群体。她认为,一些规范具有“紧密”文化的特征,而另一些规范则具有“松散”文化的特征。为此, Gelfand 对来自五大洲 30 多个国家的约 7000 人进行了研究和抽样,他们的职业、性别、年龄、宗教、教派,以及社会阶层,以了解这些社区将自己定位在何处(以及他们的社会规范在官方和社区/社区总体上的执行力度)。 紧密和松散文化之间的差异在国家之间、国家内部(如美国及其各个地区)、组织内部、社会阶层内部甚至家庭内部都有所不同。 -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. +因为组织有文化,它们也有自己的社会规范(毕竟,如果一个组织无法协调其成员并影响其行为,它将无法生存)。 因此,组织也可以反映和灌输 Gelfand 所描述的轻松”或“松散”的文化特征。 并且如果我们有很强的能力识别这些差异,我们就能更成功地预测和解决冲突。然后,在对这些社会规范有了更高认识的情况下,我们可以将开放式组织原则付诸实践。 -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 这样描述紧密和松散文化的区别: -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. +她总结说,紧密的社会保持着严格的社会秩序、同步性和自律性;宽松的社会以高度宽容、富有创造力和对变化持开放态度而自豪。 +虽然并非所有情况都是如此,但紧密和松散的文化通常会表现出一些权衡;每个人都有自己的长处和短处。参见下面的图 1 。 ![][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. +在本综述的下一部分中,我将更彻底地解释紧密文化和松散文化的特征,以便领导者能够更好地了解如何将开放式组织原则运用到团队中。 -------------------------------------------------------------------------------- From 53aea13e4f2da9cf4b2dc2b177321550a2c2dd94 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Sep 2021 05:03:10 +0800 Subject: [PATCH 0236/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210903?= =?UTF-8?q?=20Install=20ONLYOFFICE=20Docs=20on=20Fedora=20Linux=20with=20P?= =?UTF-8?q?odman=20and=20connect=20it=20with=20Nextcloud?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md --- ...th Podman and connect it with Nextcloud.md | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md diff --git a/sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md b/sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md new file mode 100644 index 0000000000..10d78e60bd --- /dev/null +++ b/sources/tech/20210903 Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud.md @@ -0,0 +1,211 @@ +[#]: subject: "Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud" +[#]: via: "https://fedoramagazine.org/instal-onlyoffice-docs-on-fedora-linux-with-podman/" +[#]: author: "kseniya_fedoruk https://fedoramagazine.org/author/kseniya_fedoruk/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install ONLYOFFICE Docs on Fedora Linux with Podman and connect it with Nextcloud +====== + +![][1] + +Photo by [Chris Leggat][2] on [Unsplash][3] + +If you need a reliable office suite for online editing and collaboration within your sync & share platform, you can try ONLYOFFICE Docs. In this tutorial, we learn how to install it on your Fedora Linux with Podman and discover the ONLYOFFICE-Nextcloud integration. + +### What is ONLYOFFICE Docs + +[ONLYOFFICE Docs][4] (Document Server) is an open-source office suite distributed under GNU AGPL v3.0. It is comprised of web-based viewers and collaborative editors for text documents, spreadsheets, and presentations. The suite is highly compatible with OOXML formats (docx, xlsx, pptx). + +A brief features overview includes: + + * Full set of editing and styling tools, operations with fonts and styles, paragraph and text formatting. + * Inserting and customizing all kinds of objects: shapes, charts, text art, text boxes, etc. + * Academic formatting and navigation: endnotes, footnotes, table of contents, bookmarks. + * Content Controls for creating digital forms and templates. + * Extending functionality with plugins, building your own plugins using API. + * Collaborative features: real-time and paragraph-locking co-editing modes, review and track changes, comments and mentions, integrated chat, version history. + * Flexible access permissions: edit, view, comment, fill forms, review, restriction on copying, downloading, and printing, custom filter for spreadsheets. + + + +![][5] + +You can integrate ONLYOFFICE Docs with various cloud services such as Nextcloud, ownCloud, Seafile, Alfresco, Plone, etc. What’s more, developers can embed the editors into their own solutions.  + +You can also use the suite together with [ONLYOFFICE Groups][6], a free open-source collaboration platform distributed under Apache 2.0. The complete solution is available as [ONLYOFFICE Workspace.][7] + +### What is Podman + +Podman is a daemonless container engine for developing, managing, and running OCI containers on your Linux system. Users can run containers either as root or in rootless mode.  + +It is available by default on Fedora Workstation. If it’s not the case, install podman with the command: + +``` +sudo dnf install podman +``` + +### What you need for ONLYOFFICE Docs installation + + * CPU: single core 2 GHz or better + * RAM: 2 GB or more + * HDD: at least 40 GB of free space + * At least 4 GB of swap + + + +### Install and run ONLYOFFICE Docs + +Start with the following commands for the root-privileged deployment. This creates directories for mounting from the container to the host system: + +``` +$ sudo mkdir -p /app/onlyoffice/DocumentServer/logs \ + /app/onlyoffice/DocumentServer/data \ + /app/onlyoffice/DocumentServer/lib \ + /app/onlyoffice/DocumentServer/db +``` + +Now mount these directories via podman. When prompted, select the image from docker.io): + +``` +$ sudo podman run -i -t -d -p 80:80 -p 443:443 --restart=always \ + -v /app/onlyoffice/DocumentServer/logs:/var/log/onlyoffice:Z \ + -v /app/onlyoffice/DocumentServer/data:/var/www/onlyoffice/Data:Z \ + -v /app/onlyoffice/DocumentServer/lib:/var/lib/onlyoffice:Z \ + -v /app/onlyoffice/DocumentServer/db:/var/lib/postgresql:Z \ + -u root onlyoffice/documentserver:latest +``` + +Please note that rootless deployment is NOT recommended for ONLYOFFICE Docs. + +To check that ONLYOFFICE is working correctly, run: + +``` +$ sudo podman exec $(sudo podman ps -q) sudo supervisorctl start ds:example +``` + +Then, open  and click the word “here” in the line _Once started the example will be available here_. Or look for the orange “button” that says “GO TO TEST EXAMPLE”. This opensthe test example where you can create a document. + +Alternatively, to install ONLYOFFICE Docs, you can build an image in podman: + +``` +$ git clone https://github.com/ONLYOFFICE/Docker-DocumentServer.git +$ cd Docker-DocumentServer/ +$ sudo podman build --tag oods6.2.0:my -f ./Dockerfile +``` + +Or build an image from the Docker file in buildah (you need root access): + +``` +$ buildah bud --tag oods6.2.0buildah:mybuildah -f ./Dockerfile +``` + +### Activate HTTPS + +To secure the application via SSL basically two things are needed: + + * Private key (.key) + * SSL certificate (.crt) + + + +So you need to create and install the following files: + +``` +/app/onlyoffice/DocumentServer/data/certs/onlyoffice.key +/app/onlyoffice/DocumentServer/data/certs/onlyoffice.crt +``` + +You can get certificates in several ways depending on your requirements: buy from certification centers, request from [Let’s Encrypt,][8] or create a [self-signed certificate][9] through OpenSSL (note that self-signed certificates are not recommended for production use). + +Secure ONLYOFFICE Docs switching to the HTTPS protocol: + +``` +$ sudo mkdir /app/onlyoffice/DocumentServer/data/certs +$ sudo cp onlyoffice.crt /app/onlyoffice/DocumentServer/data/certs/ +$ sudo cp onlyoffice.key /app/onlyoffice/DocumentServer/data/certs/ +$ sudo chown -R 100108:100111 /app/onlyoffice/DocumentServer/data/certs/ +# find the podman container id +$ sudo podman ps -a +# restart the container to use the new certificate +$ sudo podman restart {container_id} +``` + +Now you can integrate ONLYOFFICE Docs with the platform you already use and start working with your documents. + +### ONLYOFFICE-Nextcloud integration example + +To connect ONLYOFFICE Docs and Nextcloud (or any other DMS), you need a connector. This is an integration app that functions like a bridge between two services.   + +In case you’re new to Nextcloud, you can install it with Podman following [this tutorial][10].    + +If you already have Nextcloud installed, you just need to install and activate the connector. Do this with the following steps: + + 1. launch your Nextcloud as an admin, + 2. click your user icon in the upper right corner, + 3. switch to + Apps, + 4. find ONLYOFFICE in the list of available applications in the section “Office & text”, + 5. click the Download and enable button.  + + + +ONLYOFFICE now appears in the Active apps section and you can go ahead with the configuration.  + +Select your user icon again in the upper right corner -> Settings -> Administration -> ONLYOFFICE. On the settings page, you can configure: + + * The address of the machine with ONLYOFFICE installed + * Secret key (JWT that protects docs from unauthorized access) + * ONLYOFFICE and Nextcloud addresses for internal requests + + + +![][11] + +You can also adjust additional settings which are not mandatory but will make your user experience more comfortable: + + * Restrict access to the editors to user groups + * Enable/disable the Open file in the same tab option + * Select file formats that will be opened by default with ONLYOFFICE + * Customize editor interface + * Enable watermarking + + + +![][12] + +### Conclusion + +Installing ONLYOFFICE Docs on Fedora Linux with Podman is quite easy. It will give you a powerful office suite for integration into any Document Managemet System. +``` + +``` + + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/instal-onlyoffice-docs-on-fedora-linux-with-podman/ + +作者:[kseniya_fedoruk][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/kseniya_fedoruk/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/onlyoffice-podman-nextcloud-816x345.jpg +[2]: https://unsplash.com/@chris_legs?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/sharing-writing?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://www.onlyoffice.com/office-suite.aspx +[5]: https://fedoramagazine.org/wp-content/uploads/2021/07/ONLYOFFICE-Docs-dark-theme-1024x585.png +[6]: https://www.onlyoffice.com/collaboration-platform.aspx +[7]: https://www.onlyoffice.com/workspace.aspx +[8]: https://letsencrypt.org/ +[9]: https://www.server-world.info/en/note?os=Fedora_31&p=ssl&f=1 +[10]: https://fedoramagazine.org/nextcloud-20-on-fedora-linux-with-podman/ +[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/1-server-settings-1024x611.png +[12]: https://fedoramagazine.org/wp-content/uploads/2021/07/nc-settings-1-1024x574.png From 5878db0a6e5bd9b2da00dc8bf3e0b0a4a6876f68 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Sep 2021 05:03:30 +0800 Subject: [PATCH 0237/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210904?= =?UTF-8?q?=20How=20to=20Install=20Dropbox=20on=20Ubuntu=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md --- ... How to Install Dropbox on Ubuntu Linux.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md diff --git a/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md new file mode 100644 index 0000000000..4b1d7195ad --- /dev/null +++ b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md @@ -0,0 +1,116 @@ +[#]: subject: "How to Install Dropbox on Ubuntu Linux" +[#]: via: "https://itsfoss.com/install-dropbox-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Dropbox on Ubuntu Linux +====== + +Dropbox is one of the [most popular cloud storage services available for Linux][1] and other operating systems. + +In fact, Dropbox is one of the earliest services to provide a native Linux application. It still [supports 32-bit Linux systems][2] that is also a commendable job. + +In this beginner’s tutorial, I’ll show the steps for installing Dropbox on Ubuntu. The steps are really simple but some websites make it unnecessarily complicated. + +### Install Dropbox on Ubuntu desktop + +Let’s see the installation procedure, step by step. + +#### Step 1: Get Dropbox installer for Ubuntu + +Dropbox offers DEB files for its installer. Go to the download section of its website: + +[Dropbox Download][3] + +And download the appropriate DEB file. Considering that you are using 64 bit Ubuntu, get the deb file for 64-bit version. + +![Download the Dropbox installer][4] + +#### Step 2: Install Dropbox installer + +The deb file you downloaded is just an installer for Dropbox. Actual Dropbox installation starts later, similar to [installing Steam on Ubuntu][5]. + +To [install the downloaded deb file][6], either double click on it or right click and select open with Software Install. + +![Installing the downloaded Dropbox deb file][7] + +It will open the software center and you can click the install button. + +![Installing Dropbox deb file][8] + +Wait for the installation to finish. + +#### Step 3: Start Dropbox installation + +Dropbox installer is now installed. Press the Windows key (also known as super key) and search for Dropbox and click on it. + +![Start Dropbox for installation][9] + +On the first launch, it shows two popups. One about restarting Nautilus (the file explorer in Ubuntu) and the other about Dropbox installation. + +![Starting Dropbox installation][10] + +Clicking either Restart Nautilus/Close (on the Nautilus popup) or OK (on the installation popup) starts the actual Dropbox client download and installation. If the ‘Nautilus Restart’ does not close on clicking Close button, click the x button. + +Wait for the Dropbox installation to finish. + +![Installing Dropbox][11] + +Oh! Nautilus restart is required because Dropbox adds some extra features like showing the synchronization status in the file explorer. + +Once Dropbox is installed, it should either take you to the Dropbox login page automatically or you can hit the Dropbox icon at the top and select sign in option. + +![Sign in to Dropbox after installation][12] + +In fact, this is how you would be accessing Dropbox settings in the future. + +#### Step 4: Start using Dropbox on Ubuntu + +![Sign in into Dropbox][13] + +**Note**: Dropbox won’t work until you successfully sign in. Here’s a catch. The free version of Dropbox limits the number of devices you can link to your account. **If you already have 3 linked devices, you should remove some of the older ones that you do not use.** + +Once you are successfully signed in, you should see a Dropbox folder created in your home directory and your files from the cloud starts appearing here. + +![Dropbox folder is created under home directory][14] + +If you want to save disk space or bandwidth, you can go to the Preferences and choose the Selective Sync option. The selective sync option allows you only sync selected folders from Dropbox cloud on your local system. + +![Using selective sync in Dropbox][15] + +Dropbox automatically starts at each boot. This is the behavior you should expect from any cloud service, I believe. + +That’s all you need to get started with Dropbox on Ubuntu. I hope you find this tutorial helpful. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-dropbox-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/cloud-services-linux/ +[2]: https://itsfoss.com/32-bit-linux-distributions/ +[3]: https://www.dropbox.com/install-linux +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-dropbox-for-ubuntu.png?resize=800%2C294&ssl=1 +[5]: https://itsfoss.com/install-steam-ubuntu-linux/ +[6]: https://itsfoss.com/install-deb-files-ubuntu/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-installer-ubuntu.png?resize=797%2C476&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-dropbox-deb-file.png?resize=800%2C346&ssl=1 +[9]: https://itsfoss.com/wp-content/uploads/2021/09/start-drobox-ubuntu.webp +[10]: https://itsfoss.com/wp-content/uploads/2021/09/starting-dropbox-installation-800x599.webp +[11]: https://itsfoss.com/wp-content/uploads/2021/09/installing-dropbox.webp +[12]: https://itsfoss.com/wp-content/uploads/2021/09/sign-in-to-dropbox-after-first-installation.webp +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/sign-in-dropbox.png?resize=800%2C409&ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-folder-ubuntu.png?resize=800%2C491&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Dropbox-selective-sync.png?resize=800%2C399&ssl=1 From 59ccf6a854709ec0429217abe8e707d18e7edc8d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Sep 2021 05:03:52 +0800 Subject: [PATCH 0238/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210903?= =?UTF-8?q?=20Monitor=20your=20Linux=20server=20with=20Checkmk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210903 Monitor your Linux server with Checkmk.md --- ... Monitor your Linux server with Checkmk.md | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 sources/tech/20210903 Monitor your Linux server with Checkmk.md diff --git a/sources/tech/20210903 Monitor your Linux server with Checkmk.md b/sources/tech/20210903 Monitor your Linux server with Checkmk.md new file mode 100644 index 0000000000..d35d7e7611 --- /dev/null +++ b/sources/tech/20210903 Monitor your Linux server with Checkmk.md @@ -0,0 +1,191 @@ +[#]: subject: "Monitor your Linux server with Checkmk" +[#]: via: "https://opensource.com/article/21/8/monitor-linux-server-checkmk" +[#]: author: "Ferdinand https://opensource.com/users/ferdinand-kunz" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Monitor your Linux server with Checkmk +====== +Install Checkmk, the monitoring tool from tribe29, to monitor servers +and network devices +![People work on a computer server with devices][1] + +Monitoring IT assets is an essential task for any IT department. Still, due to the growing number of devices in corporate networks, it is getting more and more challenging to find an approach that is flexible enough to monitor the wide range of available systems properly. It's essential to have a monitoring tool that is flexible, scalable, and easy to use. + +In this article, I demonstrate how to install [Checkmk][2], the monitoring tool from [tribe29][3], and how to monitor servers and network devices with it. + +### Install Checkmk on Linux + +For this article, I use the [Checkmk Raw Edition,][4] the community GPLv2 edition (the enterprise edition has extra features and paid support), and installing it on a Linux server. Checkmk runs on Linux, including RHEL, CentOS, Debian, and others, as well as in a container, or as a virtual appliance. You can download the latest Checkmk version for all platforms from the official [Checkmk website][2].  + +### Getting started + +It doesn't take long to get started because Checkmk already supports most monitoring use cases thanks to its almost 2,000 plug-ins. Checkmk also provides preconfigured thresholds for alerts and warnings, so you don't have to waste time configuring these yourself, and of course, you can customize these as required.  + +Besides these official integrations, you can also use monitoring expansions created and shared by other users on the [Checkmk Exchange][5]. If you want to know more about the Checkmk tool or contribute to it, you can check out the [GitHub repository][6]. + +This tutorial does not require any monitoring experience. If you do want to follow this procedure, though, you must have root access to the server you're using as the host.  + +#### Select and download the Checkmk Raw Edition + + 1. [Download][7] either the Checkmk Raw Edition (it's free and open source) or the Checkmk Free Edition* *of the Enterprise Edition. + + 2. Next, send the installer file to the server you want to host Checkmk on. I use the scp command. In this tutorial, the IP address for my host is 10.0.2.15. [code]`$ scp check-mk-raw-X.Y.Zp8_0.focal_amd64.deb tux@10.0.2.15:/tmp` +``` +All further actions in this tutorial are performed on the host server.  + + 3. Log in to your host using `ssh`. [code]`​$ ssh tux@10.0.2.15` +``` + + + + +#### Install the Checkmk package  + + 1. Now you must install the package including all of its dependencies. This can be done with your distribution's package manager, such as `apt` or `dnf`: [code]`​$ sudo apt install /tmp/check-mk-raw-X.Y.Zp8_0.focal_amd64.deb` +``` +2. Once the installation is complete, you can perform a test using the `omd` command. [code]`​$ omd version` +``` + + + +The `omd` command for [Open Monitoring Distribution][8] is an open source project created by Mathias Kettner, the founder of Checkmk. It helps you install a monitoring solution assembled from various open source components.  + +#### Create a Checkmk monitoring site + + 1. The next step is to start an initial monitoring site (a "site" is an _instance_). Use `omd create` to create a new Checkmk site and name it as you wish. In this example, I use `checkmk_demo`. [code]`$ sudo omd create checkmk_demo` +``` +2. As a response, you're provided with helpful information about how to start and access your Checkmk site. You could follow the steps to change your admin password right now, but I prefer to do that in the Checkmk user interface. So, for now, copy the randomly generated password (you need it in the next step) and start your monitoring site. [code]`$ sudo omd start checkmk_demo` +``` + + + +Should you want to drill deeper into Checkmk later on, it is important to understand what has just taken place. + + * You created a new user, known as the _site user_, and a group with the site's name on your server. + * A directory for the site has been created under `/omd/sites`, (for example, `/omd/sites/checkmk_demo`). +Checkmk also copied its default configuration into the new directory. + * A user with the name _cmkadmin_ was created for the Checkmk web interface.  + + + +#### Start monitoring with Checkmk + +It's time to switch to the Checkmk user interface in your web browser. Every Checkmk site has its own URL, composed of the IP address or hostname of your monitoring server and the name of the Checkmk site. In this example, my Checkmk install is located at _monitoring-host-server/checkmk_demo/_. + + 1. Open the link to your Checkmk site in your browser. You can open the link shown on your terminal. + 2. Log in as the _cmkadmin_ user, using the password you copied from the terminal. +Once you're logged in, you see an empty dashboard. + 3. Click on the **User** category in the sidebar on the left, and then click on **Change password** under **Profile**. Here, you can change your password. + + + +### Monitoring setup + +Checkmk supports several ways of monitoring servers, and the best method for server monitoring is usually by using the Checkmk agents. Before adding a server, you need to install the agent.  + + 1. In the sidebar on the left, click **Setup** (the button with a gearwheel). +This is the control panel where you perform all of the configurations and find monitoring agents. There are some UI differences between the Raw Edition and the Enterprise Edition, but all screenshots in this article are from the open source Raw Edition. + + 2. Click on **Agents** and select the appropriate package for your operating system. +The packaged agents for Linux are provided in both RPM and DEB file formats. + +![Select an agent][9] + +(Ferdinand Kunz, [CC-BY SA 4.0][10]) + + 3. Download and install the agent on your monitoring host. + + + + +You can test whether the agent works correctly by executing the `check_mk_agent` command in the terminal on your server. + +### Adding a host + +Once the agent has been installed, return to the **Setup** screen and select **Hosts**.  + + 1. Click on **Add host**.  + + 2. Add the name of your server under **Hostname***. * +If you have DNS set up in your network, Checkmk resolves the IP address for your hostname automatically. Otherwise, add the IP address by clicking the checkbox next to** IPv4 Address**. If you add an IP address, you can choose any hostname you like. Leave the other areas unchanged. +  + +![Add host][11] + +(Ferdinand Kunz, [CC-BY SA 4.0][10]) + + 3. Click on **Save & go to service configuration**. Checkmk now automatically discovers any relevant monitoring services on that host and lists them as _Undecided services_. Also, as you can see in the screenshot, Checkmk automatically adds labels depending on the type of device. + + 4. Click on **Fix all*** _to monitor all of these. This adds all detected services and host labels to your monitoring dashboard and removes services that have vanished. Of course, you can manage the services manually, but the_* Fix all **function makes it a lot easier.  + +![Host monitoring fix all][12] + +(Ferdinand Kunz, [CC-BY SA 4.0][10]) + + 5. Next, activate your changes by clicking on the highlighted field with the yellow exclamation point (**!)** at the top right corner. Click on **Activate on selected sites**, and you've successfully added the first server to your monitor. + + + + +Requiring explicit activation for changes is a safety mechanism. All changes made are listed first under **Pending changes** so you can review any changes before they affect your monitoring. Checkmk differentiates between _Setup_ as a configuration environment, in which you manage the hosts, services, and settings, and the area called _Monitor_, in which the actual operational monitoring takes place. New hosts and other changes in the configuration initially do not affect the monitoring. You must activate these before they go into production.  + +### SNMP monitoring + +Besides server monitoring, another essential monitoring task is network monitoring. As an example, I would like to show you how to monitor a switch over SNMP. All you need to do is make sure the SNMP agent on the device you aim to monitor is activated and that your Checkmk server can reach this device. + + 1. Go to _**Setup > Hosts**_ and click on **Add host**. + + 2. Type in the hostname and the IP address (as needed). +By default, Checkmk assumes you use a Checkmk agent, so you need to edit that under **Monitoring agents**.  + + 3. Activate the check box next to _SNMP_ and switch the box to your SNMP version (very likely ʻSNMP v2 or v3ʼ). +Checkmk also assumes by default that your SNMP Community is _public_ because it is also the default on most SNMP devices. If that is the case, you can leave the box _SNMP credentials_ unchecked (like I have). Otherwise, you have to check this box and add your SNMP credentials here.  + +![Add SNMP host][13] + +(Ferdinand Kunz, [CC-BY SA 4.0][10]) + + 4. As before, click on **Save & go to service configuration**, and Checkmk discovers all of the currently online interfaces, the uptime, and the SNMP Info check. +If a monitoring plug-in for a particular type of device exists, Checkmk detects more monitoring services automatically.  + + 5. Click on **Fix all** and accept the changes. + + + + +### Happy monitoring + +Now you will have your Checkmk site up and running and have added two hosts. This tutorial ends here, but your real monitoring experience has only just started. You may have noticed that Checkmk provides agents for almost all operating systems so that you can add more hosts. The procedure is similar to other systems. Checkmk also supports SNMP, IPMI, HTML, and many other standards, so you always have an efficient method available for monitoring a particular system. Have a look at the [Checkmk][14] [handbook][14], as well as in the [official Checkmk forum][15]. Happy monitoring! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/monitor-linux-server-checkmk + +作者:[Ferdinand][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/ferdinand-kunz +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003499_01_linux11x_cc.png?itok=XMDOouJR (People work on a computer server with devices) +[2]: https://checkmk.com/ +[3]: https://tribe29.com/ +[4]: https://checkmk.com/product/raw-edition +[5]: https://exchange.checkmk.com/ +[6]: https://github.com/tribe29/checkmk +[7]: https://checkmk.com/download?edition=cre&version=stable&dist=ubuntu&os=focal +[8]: https://checkmk.com/guides/open-monitoring-distribution +[9]: https://opensource.com/sites/default/files/uploads/checkmk_agent.png (Select an agent) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://opensource.com/sites/default/files/uploads/checkmk_hosts.png (Add host) +[12]: https://opensource.com/sites/default/files/uploads/checkmk_fix-all.png (Host monitoring fix all) +[13]: https://opensource.com/sites/default/files/uploads/checkmk_add-host-snmp.png (Add SNMP host) +[14]: https://docs.checkmk.com/latest/en/ +[15]: https://forum.checkmk.com/ From d1358ae8f27bca92714ca06fcc9b41498e50c677 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 4 Sep 2021 05:04:09 +0800 Subject: [PATCH 0239/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210903?= =?UTF-8?q?=20Print=20files=20from=20your=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210903 Print files from your Linux terminal.md --- ...03 Print files from your Linux terminal.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20210903 Print files from your Linux terminal.md diff --git a/sources/tech/20210903 Print files from your Linux terminal.md b/sources/tech/20210903 Print files from your Linux terminal.md new file mode 100644 index 0000000000..e105539732 --- /dev/null +++ b/sources/tech/20210903 Print files from your Linux terminal.md @@ -0,0 +1,161 @@ +[#]: subject: "Print files from your Linux terminal" +[#]: via: "https://opensource.com/article/21/9/print-files-linux" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Print files from your Linux terminal +====== +To print a file from your terminal, use the lpr command. +![Typewriter with hands][1] + +[Printing on Linux is easy][2], but sometimes it feels like a lot of work to launch an application, open a file, find the **Print** selection in the menu, click a confirmation button, and so on. When you're a Linux terminal user, you often want to perform complex actions with simple triggers. Printing is complex, and there's little as simple as the `lpr` command. + +### Print using the lpr command + +To print a file from your terminal, use the `lpr` command: + + +``` +`$ lpr myfile.odt` +``` + +Should that fail, you need to set a default printer or specify a printer manually. + +### Setting a default printer + +According to my well-worn copy of a Berkeley 4.2 manual printed in 1984, the `lpr` command paginated and sent a file to a printer spool, which streamed data to something called a _line printer_. + +![book page displaying lpr command information][3] + +The lpr command. + +These days, the actual `lpr` command is insufficient because modern computers are likely to have access to several printers, and certainly to printers a lot more complex than a dot-matrix line printer. Now there's a subsystem, called the Common Unix Printing System (CUPS), to keep track of all the printers that you want your computer to access, which driver your computer should use to communicate with each printer, which printer to use by default, and so on. The `lpr.cups` or `lpr-cups` commands, bundled with CUPS and usually symlinked to `lpr`, allow you to print from a terminal by referencing your Common Unix Printing System (CUPS) configuration first. + +To print a file with `lpr`, you should first set a default printer. You can set a default printer in your system's printer settings: + +![dialog box to set default printer][4] + +Set a default printer. + +Alternately, you can mark a printer as the default with the `lpadmin` command: + + +``` +$ sudo lpadmin -d HP_LaserJet_P2015_Series +$ lpstat -v +device for HP_LaserJet_P2015_Series: ipp://10.0.1.222:631/printers/HP_LaserJet_P2015_Series +``` + +### Setting a default destination with environment variables + +You aren't permitted to set your own default printer on systems you don't have an admin account on because changing print destinations is considered a privileged task. Before `lpr` references CUPS for a destination, it queries your system for the **PRINTER** [environment variable][5]. + +In this example, `HP_LaserJet_P2015_Series` is the human-readable name given to the printer. Set **PRINTER** to that value: + + +``` +$ PRINTER=HP_LaserJet_P2015_Series +$ export PRINTER +``` + +Once the **PRINTER** variable has been set, you can print: + + +``` +`$ lpr myfile.pdf` +``` + +### Get a list of attached printers + +You can see all the printers that are accepting print jobs and that are attached to your system with the `lpstat` command: + + +``` +$ lpstat -a +HP_LaserJet_P2015_Series accepting requests since Sun 1 Aug 2021 10:11:02 PM NZST +r1060 accepting requests since Wed 18 Aug 2021 04:43:57 PM NZST +``` + +### Printing to an arbitrary printer + +Once you have added printers to your system, and now that you know how to identify them, you can print to any one of them, whether you have a default destination set or not: + + +``` +`$ lpr -P HP_LaserJet_P2015_Series myfile.txt` +``` + +### How printers are defined + +CUPS has a user-friendly front-end accessible through a web browser such as Firefox. Even though it uses a web browser as its user interface, it's actually a service running locally on your computer (a location called **localhost**) on port 631. CUPS manages printers attached to your computer, and it stores its configuration in `/etc/cups/printers.conf`. + +The `printers.conf` file consists of definitions detailing the printing devices your computer can access. You're not meant to edit it directly, but if you do, then you must stop the `cupsd` daemon first. + +A typical entry looks something like this: + + +``` +<Printer r1060> +  Info Ricoh 1060 +  Location Downstairs +  MakeModel Ricoh Aficio 1060 - CUPS+Gutenprint v5.2.6 +  DeviceURI lpd://192.168.4.8 +  State Idle +  StateTime 1316011347 +  Type 12308 +  Filter application/vnd.cups-raw 0 - +  Filter application/vnd.cups-raster 100 rastertogutenprint.5.2 +  Accepting Yes +  Shared No +  JobSheets none none +  QuotaPeriod 0 +  PageLimit 0 +  KLimit 0 +  OpPolicy default +  ErrorPolicy stop-printer +</Printer> +``` + +In this example, the printer's name is `r1060`, a human-readable identifier for a Ricoh Aficio 1060. + +The _MakeModel_ attribute is pulled from the `lpinfo` command, which lists all available printer drivers on your system. Assuming you know that you have a Ricoh Aficio 1060 that you want to print to, then you would issue this command: + + +``` +$ lpinfo -m | grep 1060 +gutenprint.5.2://brother-hl-1060/expert Brother HL-1060 - CUPS+Gutenprint v5.2.11 +gutenprint.5.2://ricoh-afc_1060/expert Ricoh Aficio 1060 - CUPS+Gutenprint v5.2.11 +``` + +This command lists the relevant drivers you have installed. + +The _MakeModel_ is the last half of the result. In this example, that's `Ricoh Aficio 1060 - CUPS+Gutenprint v5.2.11`. + +The _DeviceURI_ attribute identifies where the printer is found on the network (or physical location, such as the USB port). In this example, the _DeviceURI_ is `lpd://192.168.4.8` because I'm using the `lpd` (line printer daemon) protocol to send data to a networked printer. On a different system, I have an HP LaserJet attached by a USB cable, so the _DeviceURI_ is DeviceURI `hp:/usb/HP_LaserJet_P2015_Series?serial=00CNCJM26429`. + +### Printing from the terminal + +Sending a job to a printer is an easy process, as long as you understand the devices attached to your system and how to identify them. Printing from the terminal is fast, efficient, and easily scripted or done as a batch job. Try it out! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/print-files-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/typewriter-hands.jpg?itok=oPugBzgv (Typewriter with hands) +[2]: https://opensource.com/article/21/8/setup-your-printer-linux +[3]: https://opensource.com/sites/default/files/berkeley-1984-lpr.jpeg +[4]: https://opensource.com/sites/default/files/printer-default.jpeg +[5]: https://opensource.com/article/19/8/what-are-environment-variables From ca0a7dc617f27602b34bcf30a3da14089b2ae2bf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:15:18 +0800 Subject: [PATCH 0240/1588] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @anine09 感谢您,完成了第一篇翻译贡献! --- ... After Installing elementary OS 6 -Odin.md | 119 ++++++++---------- 1 file changed, 52 insertions(+), 67 deletions(-) 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 index 51e3e2fe86..bb431076f8 100644 --- 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 @@ -2,36 +2,37 @@ [#]: 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: " " +[#]: translator: "anine09" +[#]: reviewer: "wxy" [#]: publisher: " " - [#]: url: " " -安装elementary OS 6 “Odin”后要做的 10 件事 +安装 elementary OS 6 “Odin” 后要做的 10 件事 ====== -一个关于安装 elementary OS 6 “Odin” 后要做的事情的列表。 +> 一个精心准备的在安装 elementary OS 6 “Odin” 后要做的事情的列表。 -在经过两年多的开发后 [elementary OS 6 “Odin”][1] 于不久前发布,此次版本更新在核心模块、 Pantheon 桌面、本地应用中引入了一系列变化巨大的新特性,elementary OS 6 “Odin” 基于 Ubuntu 20.04 LTS。 +![](https://img.linux.net.cn/data/attachment/album/202109/04/081345bf9co7ot40szdytg.jpg) -也就是说,如果你完成了安装,你可能想要尝试通过一些特定的设置来使你的系统更加的个性化。这里描述的选项是通用的,在某些情况下可能对你无效,但是我们觉得有必要列出一些基础知识,让你有合适的方式来探索这个漂亮的 elementary OS。 +在经过两年多的开发后 [elementary OS 6 “Odin”][1] 于不久前发布,此次版本更新在核心模块、 Pantheon 桌面、原生应用方面带来了一大批新特性。elementary OS 6 “Odin” 是基于 Ubuntu 20.04 LTS 的。 + +如果你完成了安装,你可能想要尝试通过一些特定的设置来使你的系统更加的个性化。这里描述的选项是通用的,在某些情况下可能对你没有用,但是我们觉得有必要列出一些基本的东西,让你有合适的方式来探索这个漂亮的 elementary OS。 ### 安装完 elementary OS 6 “Odin” 后要做的事情 -***准备步骤*** +准备步骤: 首先确保你已经连上了互联网,你可以在顶部的通知区域查看可用的网络列表 -#### 1\. 更改 hostname +#### 1、更改主机名 -这可能不是你想做的第一件事。但是我不知道为什么在安装过程中没有给出更改 hostname 的选项。例如,见下图的终端提示, 这个 hostname 是 elementary OS 的默认硬件配置。在我看来这一点都不好。 +这可能不是你想做的第一件事。但是我不知道为什么在安装过程中没有给出更改主机名的选项。例如,见下图的终端提示, 这个主机名是 elementary OS 的默认硬件配置。在我看来这一点都不好。 -![hostname 修改之前][2] +![主机名修改之前][2] -打开终端并运行下列命令以更改 hostname +打开终端并运行下列命令以更改主机名: -```bash +``` hostnamectl set-hostname your-new-hostname ``` @@ -41,57 +42,53 @@ hostnamectl set-hostname your-new-hostname ![hostname 修改之后][4] -#### 2\. 升级你的系统 +#### 2、升级你的系统 在安装任何 Linux 发行版后,你应该做的第一件事就是确保系统处于最新的软件包和安全更新状态。 你可以通过打开应用中心来检查或者安装更新。 -或者打开终端运行下列命令。 +或者打开终端运行下列命令: -```bash +``` sudo apt update sudo apt upgrade ``` -#### 3\. 安装 Pantheon Tweaks +#### 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 选项。 +安装后打开系统设置,你可以在那里找到 “调整Tweaks” 选项。 -[这里][5] 提供了更详细的安装指南(如果你需要了解更多信息) +[这里][5] 提供了更详细的安装指南(如果你需要了解更多信息)。 -### 4. 配置 Dock - -Dock 是整个桌面的中心。老实说,Dock 中默认包含的应用并不常用,因此你是可以通过以下步骤配置 Dock 中的项目的。 - - * 移除:右键单击并取消 **在 Dock 中驻留** 选项。 - * 添加新的项目:单击顶部的应用程序。然后右键单击你想要放在 Dock 的应用图标。选择 **添加到 Dock**。 +### 4、配置 Dock +Dock 是整个桌面的中心。老实说,Dock 中默认包含的应用并不常用,因此你可以通过以下步骤配置 Dock 中的项目。 + * 移除:右键单击并取消 “在 Dock 中驻留Keep in Dock” 选项。 + * 添加新的项目:单击顶部的应用程序。然后右键单击你想要放在 Dock 的应用图标。选择 “添加到 DockAdd to Dock”。 在我看来,你应该至少把文件管理、截图工具、Firefox 、计算器,以及其他的一些应用添加到 Dock。然后移除 Dock 上那些你不需要的应用。 -#### 5\. 更改外观 +#### 5、更改外观 -elementary OS 6 Odin 改进了桌面的整体外观,为整个桌面和应用程序提供了自带的强调色和原生的夜间模式,同时,系统自带了许多漂亮的壁纸。你可以通过 **应用 > 系统设置 > 桌面** 来定制壁纸、外观、面板和多任务视图。 +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\. 安装其他的应用 +#### 6、安装其他的应用 自带的应用中心非常适合这个系统,我发现它是 Linux 桌面最好的应用商店之一。然而,有时候需要安装没有预装的必要应用(大多数是知名的应用)。下面是个新系统推荐安装的软件列表。(说真的,为什么 LibreOffice 没有预装?) @@ -102,66 +99,54 @@ elementary OS 6 Odin 改进了桌面的整体外观,为整个桌面和应用 * obs-studio * libreoffice +#### 7、一些针对笔记本电脑的省电贴士 +有许多方法可以配置你的 elementary OS(或者一般的 Linux 桌面),以达到延长电池寿命的目的。记住,电池寿命取决于你的笔记本硬件,以及电池和笔记本的使用年限。所以,遵循下面的一些建议,最大限度的利用你的笔记本电池。 -#### 7\. 一些针对笔记本电脑的省电贴士 + * 安装 [tlp][8]。`tlp` 是一个简单易用的命令行程序,用来帮你在 Linux 上延长电池寿命。你只需要安装它,默认情况下,它会处理好其他的设置。安装命令: -有许多方法可以配置你的 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 -``` + ``` + 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 发热。 + * 通过下面的命令安装 `thermald`。这个实用程序(实际是个守护进程)控制着你的 CPU 的 P-States 和 T-States 的温度以及 CPU 发热。 - - -``` -sudo apt install thermald -``` + ``` + sudo apt install thermald + ``` * 根据你的需要将亮度调到最小。 - - -#### 8\. 安装磁盘实用程序 +#### 8、安装磁盘实用程序 在很多情况下,你发现你需要格式化 USB 或者向 USB 中写入一些东西。默认情况下,系统没有安装任何相关的应用。你可以安装以下这些易用的应用。 -``` -gnome-disk-utility -gparted -``` + * gnome-disk-utility + * gparted -#### 9\. 启用最大化和最小化选项 +#### 9、启用最大化和最小化选项 -许多用户喜欢在窗口标题栏左边或者右边使用最大化、最小化的按钮,elementary OS 默认只提供关闭和恢复两个选项。这没什么问题,因为这就是它的设计理念。然而你可以通过使用 Pantheon Tweaks 来开启最大化和最小化按钮,具体的方式是:调整 > 外观 > 窗口控制。 +许多用户喜欢在窗口标题栏左边或者右边使用最大化、最小化的按钮,elementary OS 默认只提供关闭和恢复两个选项。这没什么问题,因为这就是它的设计理念。然而你可以通过使用 Pantheon Tweaks 来开启最大化和最小化按钮,具体的方式是:“调整 > 外观 > 窗口控制”。 ![在 elementary OS 中启动最大化和最小化设置][9] -#### 10\. 在 Odin 中学习新的多点触控手势 +#### 10、在 Odin 中学习新的多点触控手势 -如果你是笔记本用户,并且使用 elementary OS Odin,那么你一定要看看这些超酷的新触控手势。三根手指向上滑动,就会平滑的打开多任务视图,打开应用程序和工作空间。用三根手指向左或向右滑动,就能在动态工作空间之间流畅的切换,使任务之间的额切换更快。 +如果你是笔记本用户,并且使用 elementary OS “Odin”,那么你一定要看看这些超酷的新触控手势。三根手指向上滑动,就会平滑的打开多任务视图,展示打开的应用程序和工作空间。用三根手指向左或向右滑动,就能在动态工作空间之间流畅的切换,使任务之间的切换更快。 -用两根手指也可以再本地应用中实现类似的功能。 +用两根手指也可以在原生应用中实现类似的功能。 ### 结束语 -我希望安装elementary OS 6 Odin 后要做的 10 件事能帮助到你,让你开始使用 elementary OS 6 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/ @@ -169,7 +154,7 @@ via: https://www.debugpoint.com/2021/08/10-things-to-do-after-install-elementary 作者:[Arindam][a] 选题:[lujun9972][b] 译者:[anine09](https://github.com/anine09) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 32acd8522040f24b2dc6d9cbe04f6344beaeb94f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:16:23 +0800 Subject: [PATCH 0241/1588] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @anine09 本文首发:https://linux.cn/article-13749-1.html 您的 LCTT 专页:https://linux.cn/lctt/anine09 --- ... 10 Things to Do After Installing elementary OS 6 -Odin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md (99%) diff --git a/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md similarity index 99% rename from translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md rename to published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md index bb431076f8..bb881f9bc2 100644 --- a/translated/tech/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ b/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "anine09" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13749-1.html" 安装 elementary OS 6 “Odin” 后要做的 10 件事 ====== From a29bb37cc3b61919328e498c3dcaad9bb764b491 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:20:15 +0800 Subject: [PATCH 0242/1588] PRF --- ... 10 Things to Do After Installing elementary OS 6 -Odin.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md index bb881f9bc2..b713a04e1a 100644 --- a/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md +++ b/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md @@ -38,9 +38,9 @@ hostnamectl set-hostname your-new-hostname 示例: -![修改 hostname][3] +![修改主机名][3] -![hostname 修改之后][4] +![主机名修改之后][4] #### 2、升级你的系统 From 8608f1ef16eb54161b2dac585a80d60a16c991fa Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sat, 4 Sep 2021 08:22:34 +0800 Subject: [PATCH 0243/1588] translating --- .../20210901 20 essential Linux commands for every user.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index 9bfb9aac60..842dd7aded 100644 --- a/sources/tech/20210901 20 essential Linux commands for every user.md +++ b/sources/tech/20210901 20 essential Linux commands for every user.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/essential-linux-commands" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -223,7 +223,7 @@ via: https://opensource.com/article/21/9/essential-linux-commands 作者:[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 2e0a05a9155f36fcf5352e5fbecf343f0025721b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:38:10 +0800 Subject: [PATCH 0244/1588] PRF @geekpi --- ...esting Open-Source Alternative to Slack.md | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md index 780348c7c7..185da537b8 100644 --- a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md +++ b/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -3,18 +3,20 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -Zulip:一个有趣的开源的 Slack 替代品 +Zulip:一个不错的开源的 Slack 替代品 ====== -_**简介:** Zulip 是一个开源的协作平台,它把自己定位为 Slack 的一个更好的替代品。让我们仔细看看。_ +> Zulip 是一个开源的协作平台,它把自己定位为一个更好的 Slack 替代品。让我们来了解一下。 + +![](https://img.linux.net.cn/data/attachment/album/202109/04/083746lbheeynx13jmn3xn.jpg) 当涉及到你的工作时,消息和协作平台有很大的不同。 -虽然有几个选择,但 Slack 是许多组织使用的一个流行选择。但是,你可以自托管的 Slack 的开源替代方案如何呢? +虽然有几个选择,但 Slack 是许多组织使用的一个流行选择。但是,可以自托管的 Slack 的开源替代方案如何呢? Zulip 就是这样一个软件。 @@ -22,11 +24,11 @@ Zulip 就是这样一个软件。 ![][1] -如果你想探索,我必须提到还有更多的 [Slack 开源替代品][2]。 +如果你想多了解,我必须提到还有更多的 [Slack 开源替代品][2]。 -在这里,我重点介绍 Zulip。 +但在这里,我重点介绍 Zulip。 -Zulip 是一个免费开源的消息应用,有付费托管选项和自我托管的能力。 +Zulip 是一个自由而开源的消息应用,有付费托管选项和自托管的能力。 它旨在提供与 Slack 类似的体验,同时努力帮助你利用话题提高对话的有效性。 @@ -44,38 +46,36 @@ Zulip 是一个免费开源的消息应用,有付费托管选项和自我托 * 代码块 * 集成 GitHub 来跟踪问题 * 支持电子邮件通知 - * 自我托管选项 + * 自托管选项 * 信息编辑 - * GIPHY 集成 + * 集成 GIPHY * 用 Zoom、Jitsi 或 BigBlueButton 进行视频通话 - - -除了上述功能外,你应该期待你通常在 Slack 和其他方面得到的基本选项。 +除了上述功能外,你可以预期得到你通常在 Slack 和其他方面得到的基本选项。 此外,如果你愿意,你还可以将它与 Matrix 和 IRC 整合。 ![][4] -在我简短的测试使用中,用户界面对于有效的沟通来说是足够好的。然而,我没能找到任何黑暗模式或改变主题的能力。 +在我简短的测试使用中,其用户界面对于有效的沟通来说是足够好的。然而,我没能找到任何黑暗模式或改变主题的能力。 -它看起来比 Slack 更直接,这样可以改善用户体验方面的问题。 +它看起来比 Slack 更简单直白,这样可以改善用户体验方面的问题。 ### 在 Linux 中安装 Zulip -Zulip 在其官方网站上以 AppImage 文件的形式提供。如果你需要帮助,可以参考我们关于[在 Linux 中使用 AppImage][5] 的指南。 +Zulip 在其官方网站上以 AppImage 文件的形式提供。如果你需要帮助,可以参考我们关于 [在 Linux 中使用 AppImage][5] 的指南。 -它也有一个 snap 包。所以,你可以在任何一个 Linux 发行版上使用它们中的任何一个。 +它也有一个 Snap 包。所以,你可以在任何一个 Linux 发行版上使用它们中的任何一个。 -你也可以使用 APT 通过终端为基于 Ubuntu/Debian 的发行版安装它。如果你想这样做,请看它的[官方说明][6]。 +你也可以使用 APT 通过终端为基于 Ubuntu/Debian 的发行版安装它。如果你想这样做,请看它的 [官方说明][6]。 Zulip 可用于 Windows、Mac 和 Linux。你也应该发现它可用于 Android 和 iOS 手机。 -[Zulip][7] +- [Zulip][7] -考虑到你可以在网络、桌面和智能手机上使用 Zulip,它是 Slack 的合适替代品。 +你可以在网络、桌面和智能手机上使用 Zulip,所以可以把它当做 Slack 的合适替代品。 -_你试过了吗?你用什么消息平台来进行工作协作?欢迎在评论中分享你的想法。_ +你试过了吗?你用什么消息平台来进行工作协作?欢迎在评论中分享你的想法。 -------------------------------------------------------------------------------- @@ -84,7 +84,7 @@ via: https://itsfoss.com/zulip/ 作者:[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 fdbebf9cfae985580730d6051504e5f3bd9fdd86 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 4 Sep 2021 08:39:06 +0800 Subject: [PATCH 0245/1588] PRF&PUB @geekpi https://linux.cn/article-13750-1.html --- ... Zulip- An Interesting Open-Source Alternative to Slack.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md (98%) diff --git a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/published/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md similarity index 98% rename from translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md rename to published/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md index 185da537b8..edbf0cdbbe 100644 --- a/translated/tech/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md +++ b/published/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13750-1.html" Zulip:一个不错的开源的 Slack 替代品 ====== From 2ec4ae9b8db5d6e661e674450fb25b5e48e1964e Mon Sep 17 00:00:00 2001 From: New-World-2019 Date: Sat, 4 Sep 2021 10:37:55 +0800 Subject: [PATCH 0246/1588] translated --- ...e status on Linux with the stat command.md | 119 ------------------ ...e status on Linux with the stat command.md | 118 +++++++++++++++++ 2 files changed, 118 insertions(+), 119 deletions(-) delete mode 100644 sources/tech/20210820 Check file status on Linux with the stat command.md create mode 100644 translated/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 deleted file mode 100644 index 552bc004bc..0000000000 --- a/sources/tech/20210820 Check file status on Linux with the stat command.md +++ /dev/null @@ -1,119 +0,0 @@ -[#]: 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: "New-World-2019" -[#]: 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 diff --git a/translated/tech/20210820 Check file status on Linux with the stat command.md b/translated/tech/20210820 Check file status on Linux with the stat command.md new file mode 100644 index 0000000000..c89b1c0883 --- /dev/null +++ b/translated/tech/20210820 Check file status on Linux with the stat command.md @@ -0,0 +1,118 @@ +[#]: 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: "New-World-2019" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 Linux 上使用 stat 命令查看文件状态 +====== +只需要一个 Linux 命令,你就可以获取到任何文件或文件系统的所有信息。 +![Hand putting a Linux file folder into a drawer][1] + +命令 `stat` 被包含在 GNU `coreutils` 软件包里,它提供了关于文件和文件系统的各种元数据,包括文件大小、结点位置、访问权限和 SELinux 上下文以及创建和修改时间。通常情况下,你需要多个不同命令获取的信息,这一个命令就可以实现。 + +### 在 Linux 上安装 stat 命令 + +在 Linux 系统中,可能早已安装了 `state` 命令,因为它是核心功能软件包的一部分,默认情况下,通常包含在 Linux 发行版里。 + +如果系统中没有安装 `stat` 命令,你可以使用包管理器安装 `coreutils` 软件包。 + +另外,你可以 [ 使用源码编译 coreutils 包 ][2]。 + +### 获取文件状态 + +运行 `stat` 命令可以获取指定文件或目录易于理解的输出。 + + +``` +$ 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 +``` + +输出的信息很容易理解,但是包含了很多的信息,这里是 `stat` 所包含的项: + + * **File**: 文件名 + * **Size**: 文件大小,以字节表示 + * **Blocks**: 在硬盘驱动器上为文件保留的数据块的数量 + * **IO Block**: 文件系统块大小 + * **regular file**: 文件类型(普通文件,目录,文件系统) + * **Device**: 文件所在的设备 + * **Inode**: 文件所在的 Inode 号 + * **Links**: 文件的链接数 + * **Access, UID, GID**: 文件权限,用户和组的所有者 + * **Context**: SELinux 上下文 + * **Access, Modify, Change, Birth**: 文件被访问、修改、更改状态以及创建时的时间戳 + + + +### 精简输出 + +对于非常了解输出或者想要使用其它工具(例如:[awk][3])解析输出的人,这里可以使用 `--terse`(短参数为 `-t`) 参数,实现没有标题或换行符的格式化输出。 + + +``` +$ 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 +``` + +### 选择自己的格式 + +你可以使用 `--printf` 参数以及与 [printf][4] 类似的语法定义自己的输出格式。`stat` 的每一个属性都有一个格式序列(`%C` 表示 SELinux 上下文,`%n` 表示文件名等等),所以,你可以选择你想要的输出格式。 + + +``` +$ 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 +``` + +下面是一些常见的格式序列: + + * **%a** 访问权限 + * **%F** 文件类型 + * **%n** 文件名 + * **%U** 用户名 + * **%u** 用户 ID + * **%g** 组 ID + * **%w** 创建时间 + * **%y** 修改时间 + + + +在 `stat` 手册和 `coreutils` 信息页中都有完整的格式化序列列表。 + +### 文件信息 + +如果你曾经尝试解析过 `ls -l` 的输出,那么,你会很喜欢 `stat` 命令的灵活性。你并不是每次都需要 `stat` 提供的所有信息,但是,当你需要其中一些或全部的时候它是非常有用的。不管你是读取默认输出,还是你自己创建的查询输出,`stat` 命令都可以让你访问想要的数据。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/linux-stat-file-status + +作者:[Seth Kenlon][a] +选题:[lujun9972][b] +译者:[New-World-2019](https://github.com/New-World-2019) +校对:[校对者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 \ No newline at end of file From de53fa737ea370f9d81dc7b9e90dfc609fe70cef Mon Sep 17 00:00:00 2001 From: zz-air <78247237+zz-air@users.noreply.github.com> Date: Sat, 4 Sep 2021 16:32:12 +0800 Subject: [PATCH 0247/1588] Rename sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md to translated/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 => translated}/talk/20210819 A guide to understanding your team-s implicit values and needs.md (100%) diff --git a/sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md similarity index 100% rename from sources/talk/20210819 A guide to understanding your team-s implicit values and needs.md rename to translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md From 0327d0cd211fe8b26e7da693bc3674c8e6a10412 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 5 Sep 2021 05:02:19 +0800 Subject: [PATCH 0248/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210905?= =?UTF-8?q?=20Neither=20Windows,=20nor=20Linux!=20Shrine=20is=20=E2=80=98G?= =?UTF-8?q?od=E2=80=99s=20Operating=20System=E2=80=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md --- ...inux- Shrine is ‘God-s Operating System.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md diff --git a/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md b/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md new file mode 100644 index 0000000000..07676c2130 --- /dev/null +++ b/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md @@ -0,0 +1,80 @@ +[#]: subject: "Neither Windows, nor Linux! Shrine is ‘God’s Operating System’" +[#]: via: "https://itsfoss.com/shrine-os/" +[#]: author: "John Paul https://itsfoss.com/author/john/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Neither Windows, nor Linux! Shrine is ‘God’s Operating System’ +====== + +We’ve all used multiple operating systems in our lives. Some were good and some were bad. But can you say that you’ve ever used an operating system designed by God? Today, I’d like to introduce you to Shrine. + +### What is Shrine? + +![Shrine interface][1] + +From that introduction, you’re probably wondering what the heck is going on. Well, it all started with a guy named Terry Davis. Before we go any further, I’d better warn you that Terry suffered from schizophrenia during his life and often didn’t take his medication. Because of this, he said or did things during his life that were not quite socially acceptable. + +Anyway, back to the story line. In the early 2000s, Terry released a simple operating system. Over the years, it went through several names, including J Operating System, LoseThos, and SparrowOS. He finally settled on the name [TempleOS][2]. He chose that name because this operating system would be God’s temple. As such. God gave Terry the following [specifications][3] for the operating system: + + * It would have 640×480 16 color graphics + * It would use “a single-voice 8-bit signed MIDI-like sample for sound”. + * It would follow the Commodore 64, i.e. “a non-networked, simple machine where programming was the goal, not just a means to an end”. + * It would only support one file system (named “Red Sea”). + * It would be limited to 100,000 lines of code to make it “easy to learn the whole thing”. + * “Ring-0-only. Everything runs in kernel mode, including user applications” + * The font would be limited to “one 8×8 fixed-width font”. + * The use would have “full access to everything. All memory, I/O ports, instructions, and similar things must never be off limits. All functions, variables and class members will be accessible.” + * It would only support one platform, 64-bit PCs. + + + +Terry wrote this operating system using in a programming language that he called HolyC. TechRepublic called it a “modified version of C++ (“more than C, less than C++”)”. If you are interested in getting a flavor of HolyC, I would recommend, [this article][4] and the HolyC entry on [RosettaCode][5]. + +In 2013, Terry announced on his website that TempleOS was complete. Tragically, Terry died a few years later in August of 2018 when he was hit by a train. He was homeless at the time. Over the years, many people followed Terry through his work on the operating system. Most were impressed at his ability to write an operating system in such a small package. + +Now, you are probably wondering what all this talk of TempleOS has to do with Shrine. Well, as the [GitHub page][6] for Shrine states, it is “A TempleOS distro for heretics”. GitHub user [minexew][7] created Shrine to add features to TempleOS that Terry had neglected. These features include: + + * 99% compatibility with TempleOS programs + * Ships with Lambda Shell, which feels a bit like a classic Unix command interpreter + * TCP/IP stack & internet access out of the box + * Includes a package downloader + + + +minexew is planning to add more features in the future, but hasn’t announced what exactly will be included. He has plans to make a full TempleOS environment for Linux. + +### Experience + +It’s fairly easy to get Shrine virtualized. All you need to do is install your virtualizing software of choice. (Mine is VirtualBox.) When you create a virtual machine for Shrine, make sure that it is 64-bit and has at least 512 MB of RAM. + +Once you boot into Shrine, you will be asked if you want to install to your (virtual) hard drive. Once that is finished (or not, if you choose), you will be offered a tour of the operating system. From there you can explore. + +### Final Thoughts + +Temple OS and (Shrine) is obviously not intended to be a replacement for Windows or Linux. Even though Terry referred to it as “God’s temple”, I’m sure in his more lucid moments, he would have acknowledged that it was more of a hobby operating system. With that in mind, the finished product is fairly [impressive][8]. Over a twelve-year period, Terry created an operating system in a little over 100,000 lines of code, using a language that he had created himself. He also wrote his own compiler, graphics library and several games. All this while fighting his own personal demons. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/shrine-os/ + +作者:[John Paul][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/john/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/shrine.jpg?resize=800%2C600&ssl=1 +[2]: https://templeos.org/ +[3]: https://web.archive.org/web/20170508181026/http://www.templeos.org:80/Wb/Doc/Charter.html +[4]: https://harrisontotty.github.io/p/a-lang-design-analysis-of-holyc +[5]: https://rosettacode.org/wiki/Category:HolyC +[6]: https://github.com/minexew/Shrine +[7]: https://github.com/minexew +[8]: http://www.codersnotes.com/notes/a-constructive-look-at-templeos/ From 6c6f681b78649dd0a33b763d352251cd63ea2127 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 5 Sep 2021 05:02:42 +0800 Subject: [PATCH 0249/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210904?= =?UTF-8?q?=20Essential=20open=20source=20tools=20for=20an=20academic=20or?= =?UTF-8?q?ganization?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210904 Essential open source tools for an academic organization.md --- ...urce tools for an academic organization.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/tech/20210904 Essential open source tools for an academic organization.md diff --git a/sources/tech/20210904 Essential open source tools for an academic organization.md b/sources/tech/20210904 Essential open source tools for an academic organization.md new file mode 100644 index 0000000000..805718836b --- /dev/null +++ b/sources/tech/20210904 Essential open source tools for an academic organization.md @@ -0,0 +1,64 @@ +[#]: subject: "Essential open source tools for an academic organization" +[#]: via: "https://opensource.com/article/21/9/open-source-tools-ospo" +[#]: author: "Quinn Foster https://opensource.com/users/quinn-foster" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Essential open source tools for an academic organization +====== +A look into the digital infrastructure of an academic open source +programs office (OSPO). +![Wratchet set tools][1] + +As an academic open source programs office (OSPO), [Open @RIT][2]'s mission is to assist faculty, staff, and students at the Rochester Institute of Technology in creating and maintaining communities for their open projects. We accomplish this by offering consultation and documents that teach our clients the best ways to operate their communities and projects. None of this would be feasible, however, if not for the systems of digital infrastructure we have created and adopted to facilitate these interactions. + +Whether you're starting your own academic OSPO or an open source project, finding the right tools and methods for managing your unique community can be challenging if you don't know where to look. Therefore, in the spirit of openness, the Open @RIT team is happy to share the experiences and strategies used to build our digital infrastructure right here. + +To begin, much of what we have built is thanks to our collaboration with the open source experts at the Institute of Electrical and Electronics Engineers ([IEEE][3]). Founded back in the 19th century during the advent of widespread electricity use, IEEE remains the largest technical professional organization globally and strives to advance technology for the benefit of humanity. The utilization of open source is an integral part of this goal. [IEEE SA OPEN][4], the IEEE sub-group which has created a dedicated open source collaboration platform, aims to create a unified infrastructure stack for open source communities. + +As a participant in IEEE SA OPEN's open technical advisory group, Open @RIT has worked with the group by advising in selecting and approving a variety of software tools they are considering supporting in their standards. + +> "We're trying to learn about how they operate within the academic sector, and then because they're open source, we can really easily contribute back and contribute these findings," +> +> Mike Nolan, assistant director of Open @RIT. + +The tools IEEE SA OPEN and Open @RIT select help develop Open @RIT's digital infrastructure and assist its clients in an academic environment. In turn, Open @RIT provides feedback and even technical contributions to IEEE SA OPEN to extend their infrastructure effectively. Each tool, all of which are open source, carries out a key role: + + * [Mattermost][5] is a collaboration platform built with project developers in mind. We've been using Mattermost to communicate and share work, and we highly recommend it for anybody developing an open source project. + * [Gitlab][6] allows you to store files of code and develop them collaboratively with your team. + * [Nextcloud][7] is a cloud-based file hosting service where you can create and share documents with your team and manage projects and deadlines. Adapting Nextcloud into the standards is still in process and not yet approved, but it holds tremendous potential for IEEE SA OPEN. + + + +A crucial benefit we've experienced using these tools alongside IEEE SA OPEN is finding ways to interact with each other. For example, Mattermost's ChatOps function allows you to install a Gitlab plugin into your Mattermost servers, allowing notifications of issues, merge requests, direct mentions, and other changes made in Gitlab to appear in your message boards. This, among potential future additions, demonstrates how these tools can become a cohesive standard in building open infrastructure. + +In addition to working with IEEE SA OPEN, we have also made inroads with CHAOSS Software and utilized their community analysis software, [GrimoireLab.][8] Their tool is a community health analytics software that calculates and reports metrics of open source project communities. This includes things like the time it takes to resolve reported issues, contributor affiliations, code management, and more. + +Open @RIT uses GrimoireLab and provides feedback and contributions to the CHAOSS community based upon our unique position of monitoring community health in academia. One of our more significant contributions is Mystic, a digital portal and dashboard of our design. Anyone at RIT can submit their open source projects and receive generated community health statistics. Mystic leverages GrimoireLab to take these projects and reports the community metrics and analytics back to the user. Using GrimoireLab in this way helps build the open source community at RIT while contributing back to CHAOSS to make their tools more applicable to academic institutions. + +We hope the information shared here has provided you with the tips and tricks to kickstart your open source project. Whether it's academic in nature or not, these tools can be great additions to the digital infrastructure holding your project community together. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/open-source-tools-ospo + +作者:[Quinn Foster][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/quinn-foster +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/tools_osyearbook2016_sysadmin_cc.png?itok=Y1AHCKI4 (Wratchet set tools) +[2]: https://www.rit.edu/research/open +[3]: https://www.ieee.org/ +[4]: https://saopen.ieee.org/ +[5]: https://mattermost.com/ +[6]: https://about.gitlab.com/ +[7]: https://opensource.com/tags/nextcloud +[8]: https://chaoss.github.io/grimoirelab/ From b0f78ba7cde09a47d842f0e8e85d6bcfa9db7cca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 15:20:46 +0800 Subject: [PATCH 0250/1588] PRF @mengxinayan --- ...27 Analyze the Linux kernel with ftrace.md | 260 +++++++++--------- 1 file changed, 134 insertions(+), 126 deletions(-) diff --git a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md b/translated/tech/20210727 Analyze the Linux kernel with ftrace.md index 2e38eac86c..f9a1ee0806 100644 --- a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md +++ b/translated/tech/20210727 Analyze the Linux kernel with ftrace.md @@ -3,60 +3,61 @@ [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -通过 `ftrace` 来分析 Linux 内核 +通过 ftrace 来分析 Linux 内核 ====== -通过 `ftrace` 来了解 Linux 内核内部工作方式是一个好方法。 -![Linux keys on the keyboard for a desktop computer][1] -一个操作系统的内核是最难以理解的软件之一。自从你的系统启动后,它会一直在后台运行。尽管每个用户都不与内核直接交互,但他们在内核的帮助下完成自己的计算任务。与内核的交互发生在调用系统调用或者用户日常使用的各种库或应用间接调用了系统调用。 +> 通过 `ftrace` 来了解 Linux 内核内部工作方式是一个好方法。 -在之前的文章里我介绍了如何使用 `strace` 来追踪系统调用。然而,使用 `strace` 时你的可见性是受限的。它允许你查看特定参数的系统调用。并在工作完成后,看到其返回值或状态,来表明是通过还是失败。但是你无法知道内核在这段时间内发生了什么。除了系统调用外,内核中还有很多其他活动发生时却被忽略了。 +![](https://img.linux.net.cn/data/attachment/album/202109/05/151954cb5z5rg7zqa9lbzu.jpg) -### `ftrace` 介绍 +操作系统的内核是最难以理解的软件之一。自从你的系统启动后,它会一直在后台运行。尽管每个用户都不与内核直接交互,但他们在内核的帮助下完成自己的计算任务。与内核的交互发生在调用系统调用或者用户日常使用的各种库或应用间接调用了系统调用。 -本文的目的是通过使用一个名为 `ftrace` 的机制来追踪内核函数。任何 Linux 用户可以通过使用它来轻松地追踪内核,并且了解更多关于 Linux 内核内部如何工作。 +在之前的文章里我介绍了如何使用 [strace][6] 来追踪系统调用。然而,使用 `strace` 时你的视野是有限的。它允许你查看特定参数的系统调用。并在工作完成后,看到其返回值或状态,以表明是成功还是失败。但是你无法知道内核在这段时间内发生了什么。除了系统调用外,还有很多其他活动内核中发生,而你却视而不见。 -`ftrace` 默认产生的输出是巨大的,因为内核总是忙的。为了节省空间,很多情况下我会通过截断来给出最小输出。 +### ftrace 介绍 + +本文的旨在通过使用一个名为 `ftrace` 的机制来阐明追踪内核函数的一些情况。它使得任何 Linux 用户可以轻松地追踪内核,并且了解更多关于 Linux 内核内部如何工作。 + +`ftrace` 默认产生的输出往往是巨大的,因为内核总是忙碌的。为了节省空间,很多情况下我会通过截断来给出尽量小的输出。 我使用 Fedora 来演示下面的例子,但是它们应该在其他最新的 Linux 发行版上同样可以运行。 -### 启用 `ftrace` +### 启用 ftrace -`ftrace` 现在已经是内核中的一部分了,你不再需要事先安装它了。也就是说,如果你在使用最近的 Linux 系统,那么 `ftrace` 是已经启动了的。为了验证 `ftrace` 是否可用,运行 `mount` 命令并查找 `tracefs`。如果你看到类似下面的输出,表示 `ftrace` 已经启用,你可以轻松地尝试本文中下面的例子。下面的命令需要在 root 用户下使用(`sudo` 是不够的) +`ftrace` 现在已经是内核中的一部分了,你不再需要事先安装它了。也就是说,如果你在使用最近的 Linux 系统,那么 `ftrace` 是已经启用了的。为了验证 `ftrace` 是否可用,运行 `mount` 命令并查找 `tracefs`。如果你看到类似下面的输出,表示 `ftrace` 已经启用,你可以轻松地尝试本文中下面的例子。下面有些命令需要在 root 用户下使用(用 `sudo` 执行是不够的)。 ``` -$ sudo mount | grep tracefs +# mount | grep tracefs none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) ``` 要想使用 `ftrace`,你首先需要进入上面 `mount` 命令中找到的特定目录中,在那个目录下运行文章中的其他命令。 ``` -`$ cd /sys/kernel/tracing` +# cd /sys/kernel/tracing ``` ### 一般的工作流程 -首先,你需要理解捕捉踪迹和获取输出的一般流程。如果你直接运行 `ftrace`,没有任何特定的 `ftrace-` 命令会被运行。相反的,你基本上是通过标准 Linux 命令来写入或读取一些文件。 +首先,你需要理解捕捉踪迹和获取输出的一般流程。如果你直接运行 `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. +3. 从文件中读取基于第 1 和 2 步的追踪输出 +4. 从文件中清除早期输出或缓冲区 +5. 缩小到你的特定用例(你要追踪的内核函数),重复 1、2、3、4 步 ### 可用的追踪器类型 -有多种不同的追踪器可供你使用。之前提到,在运行任何命令前,你需要进入一个特定的目录下,因为文件在这些目录下。我在我的例子中使用相对路径(与绝对路径相反) +有多种不同的追踪器可供使用。之前提到,在运行任何命令前,你需要进入一个特定的目录下,因为需要的文件在这些目录下。我在我的例子中使用了相对路径(而不是绝对路径)。 -你可以查看 `available_tracers` 文件内容来查看所有可用的追踪器类型。你可以可以看下面列出了几个。不需要担心有这么多。 +你可以查看 `available_tracers` 文件内容来查看所有可用的追踪器类型。你可以看下面列出了几个。不需要担心这些: ``` $ pwd @@ -66,11 +67,11 @@ $ sudo cat available_tracers hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop ``` -在所有输出的追踪器中,我会聚焦于下面三个特殊的:启用追踪的 `function` 和 `function_graph`,以及停止追踪的 `nop` +在所有输出的追踪器中,我会聚焦于下面三个特殊的:启用追踪的 `function` 和 `function_graph`,以及停止追踪的 `nop`。 ### 确认当前的追踪器 -通常情况默认的追踪器设定为 `nop`。即在特殊文件中 `current_tracer` 中的 “无操作”,这意味着追踪目前是关闭的。 +通常情况默认的追踪器设定为 `nop`。即在特殊文件中 `current_tracer` 中的 “无操作”,这意味着追踪目前是关闭的: ``` $ pwd @@ -82,26 +83,27 @@ nop ### 查看追踪输出 -在启用任何追踪功能之前,请你看一下保存追踪输出的文件。你可以用 [cat](2) 命令查看名为 `trace` 的文件的内容。 +在启用任何追踪功能之前,请你看一下保存追踪输出的文件。你可以用 [cat][2] 命令查看名为 `trace` 的文件的内容: ``` -$ sudo cat trace +# cat trace + # tracer: nop # -# entries-in-buffer/entries-written: 0/0   #P:8 +# entries-in-buffer/entries-written: 0/0 #P:8 # -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | +# _-----=> irqs-off +# / _----=> need-resched +# | / _---=> hardirq/softirq +# || / _--=> preempt-depth +# ||| / delay +# TASK-PID CPU# |||| TIMESTAMP FUNCTION +# | | | |||| | | ``` -### 启用 `function` 追踪器 +### 启用 function 追踪器 -你可以通过向 `current_tracer` 文件写入 `function` 来启用第一个追踪器 `function`(文件原本内容为 `nop`,意味着追踪是关闭的)。把这个操作看成是启用追踪的一种方式。 +你可以通过向 `current_tracer` 文件写入 `function` 来启用第一个追踪器 `function`(文件原本内容为 `nop`,意味着追踪是关闭的)。把这个操作看成是启用追踪的一种方式: ``` $ pwd @@ -109,38 +111,39 @@ $ pwd $ sudo cat current_tracer nop -$ echo function > current_tracer +$ echo function > current_tracer $ $ cat current_tracer function ``` -### 查看 `function` 追踪器的更新追踪输出 +### 查看 function 追踪器的更新追踪输出 -现在你已启动追踪,是时候查看输出了。如果你查看 `trace` 文件内容,你将会看到许多被连续写入的内容。我通过管道只展示了文件内容的前 20 行。根据左边输出的标题,你可以看到在某个 CPU 上运行的任务和进程 ID。根据右边输出的内容,你可以看到具体的内核函数和其副函数。中间显示了时间信息。 +现在你已启用追踪,是时候查看输出了。如果你查看 `trace` 文件内容,你将会看到许多被连续写入的内容。我通过管道只展示了文件内容的前 20 行。根据左边输出的标题,你可以看到在某个 CPU 上运行的任务和进程 ID。根据右边输出的内容,你可以看到具体的内核函数和其父函数。中间显示了时间戳信息: ``` -$ sudo cat trace | head -20 +# sudo cat trace | head -20 + # tracer: function # -# entries-in-buffer/entries-written: 409936/4276216   #P:8 +# 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 +# _-----=> irqs-off +# / _----=> need-resched +# | / _---=> hardirq/softirq +# || / _--=> preempt-depth +# ||| / delay +# TASK-PID CPU# |||| TIMESTAMP FUNCTION +# | | | |||| | | + -0 [000] d... 2088.841739: tsc_verify_tsc_adjust <-arch_cpu_idle_enter + -0 [000] d... 2088.841739: local_touch_nmi <-do_idle + -0 [000] d... 2088.841740: rcu_nocb_flush_deferred_wakeup <-do_idle + -0 [000] d... 2088.841740: tick_check_broadcast_expired <-do_idle + -0 [000] d... 2088.841740: cpuidle_get_cpu_driver <-do_idle + -0 [000] d... 2088.841740: cpuidle_not_available <-do_idle + -0 [000] d... 2088.841741: cpuidle_select <-do_idle + -0 [000] d... 2088.841741: menu_select <-do_idle + -0 [000] d... 2088.841741: cpuidle_governor_latency_req <-menu_select ``` 请记住当追踪打开后,这意味着追踪结果会被一直连续写入直至你关闭追踪。 @@ -159,7 +162,7 @@ $ sudo cat current_tracer nop ``` -### 启用 `function_graph` 追踪器 +### 启用 function_graph 追踪器 现在尝试第二个名为 `function_graph` 的追踪器。你可以使用和上面相同的步骤:在 `current_tracer` 文件中写入 `function_graph`: @@ -170,32 +173,33 @@ $ sudo cat current_tracer function_graph ``` -### `function_tracer` 追踪器的追踪输出 +### function_tracer 追踪器的追踪输出 -注意到目前 `trace` 文件的输出格式已经发生变化。现在,你可以看到 CPU ID 和内核函数的执行时间。接下来,一个花括号表示一个函数的开始,以及它内部调用了哪些其他函数。 +注意到目前 `trace` 文件的输出格式已经发生变化。现在,你可以看到 CPU ID 和内核函数的执行时长。接下来,一个花括号表示一个函数的开始,以及它内部调用了哪些其他函数: ``` -$ sudo cat trace | head -20 +# 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    |                  } +# 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 | } ``` ### 启用追踪的设置来增加追踪的深度 @@ -203,18 +207,18 @@ $ sudo cat trace | head -20 你可以使用下面的步骤来调整追踪器以看到更深层次的函数调用。完成之后,你可以查看 `trace` 文件的内容并发现输出变得更加详细了。为了文章的可读性,这个例子的输出被省略了: ``` -$ sudo cat max_graph_depth +# cat max_graph_depth 0 -$ sudo echo 1 > max_graph_depth -$ # or -$ sudo echo 2 > max_graph_depth -$ sudo cat trace +# echo 1 > max_graph_depth ## or: +# echo 2 > max_graph_depth + +# sudo cat trace ``` ### 查找要追踪的函数 -上面的步骤足以让你开始追踪。但是它产生的输出内容是巨大的,当你想试图找到自己感兴趣的内容时,往往会很困难。通常你更希望能够之追踪特定的函数,而忽略其他函数。但如果你不知道它们确切的名称,你怎么知道要追踪哪些进程?有一个文件可以帮助你解决这个问题 —— `available_filter_functions` 文件提供了一个可供追踪的函数列表。 +上面的步骤足以让你开始追踪。但是它产生的输出内容是巨大的,当你想试图找到自己感兴趣的内容时,往往会很困难。通常你更希望能够只追踪特定的函数,而忽略其他函数。但如果你不知道它们确切的名称,你怎么知道要追踪哪些进程?有一个文件可以帮助你解决这个问题 —— `available_filter_functions` 文件提供了一个可供追踪的函数列表: ``` $ sudo wc -l available_filter_functions   @@ -223,7 +227,7 @@ $ sudo wc -l available_filter_functions   ### 查找一般的内核函数 -现在试着搜索一个你所知道的简单内核函数。用户空间有 `malloc` 函数用来分配内存,而内核有 `kmalloc` 函数,它提供类似的功能。下面是所有与 `kmalloc` 相关的函数。 +现在试着搜索一个你所知道的简单内核函数。用户空间由 `malloc` 函数用来分配内存,而内核由 `kmalloc` 函数,它提供类似的功能。下面是所有与 `kmalloc` 相关的函数: ``` $ sudo grep kmalloc available_filter_functions @@ -243,7 +247,7 @@ __kmalloc_node_track_caller ### 查找内核模块或者驱动相关函数 -在 `available_filter_functions` 文件的输出中,你可以看到一些以括号内文字结尾的行,例如下面的例子中的 `[kvm_intel]`。这些函数与当前加载的内核模块 `kvm_intel` 有关。你可以运行 `lsmod` 命令来验证。 +在 `available_filter_functions` 文件的输出中,你可以看到一些以括号内文字结尾的行,例如下面的例子中的 `[kvm_intel]`。这些函数与当前加载的内核模块 `kvm_intel` 有关。你可以运行 `lsmod` 命令来验证: ``` $ sudo grep kvm available_filter_functions | tail @@ -266,19 +270,20 @@ irqbypass              16384  1 kvm ### 仅追踪特定的函数 -为了实现对特定函数或模式的追踪,你可以利用 `set_ftrace_filter` 文件来指定你要追踪上述输出中的哪些函数。这个文件也接受 `*` 模式,它可以扩展到包括具有给定模式的其他函数。作为一个例子,我在我的机器上使用ext4文件系统。我可以用下面的命令指定ext4的特定内核函数来追踪。 +为了实现对特定函数或模式的追踪,你可以利用 `set_ftrace_filter` 文件来指定你要追踪上述输出中的哪些函数。这个文件也接受 `*` 模式,它可以扩展到包括具有给定模式的其他函数。作为一个例子,我在我的机器上使用 ext4 文件系统。我可以用下面的命令指定 ext4 的特定内核函数来追踪: ``` -$ sudo mount | grep home +# mount | grep home /dev/mapper/fedora-home on /home type ext4 (rw,relatime,seclabel) -$ pwd +# pwd /sys/kernel/tracing -$ sudo cat set_ftrace_filter +# cat set_ftrace_filter + #### all functions enabled #### $ -$ echo ext4_* > set_ftrace_filter +$ echo ext4_* > set_ftrace_filter $ $ cat set_ftrace_filter ext4_has_free_clusters @@ -289,35 +294,36 @@ ext4_get_group_desc [...] ``` -现在当你可以看到追踪输出时,你只能看到与内核函数有关的 `ext4` 函数,而你之前已经为其设置了一个过滤器。所有其他的输出都被忽略了。 +现在当你可以看到追踪输出时,你只能看到与内核函数有关的 `ext4` 函数,而你之前已经为其设置了一个过滤器。所有其他的输出都被忽略了: ``` -$ sudo cat trace |head -20 -# tracer: function +# cat trace |head -20 + +## tracer: function # -# entries-in-buffer/entries-written: 3871/3871   #P:8 +# 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 +# _-----=> 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"。你可以在这个文件中写下你想要的模式,并启用追踪。这样除了所提到的模式外,任何其他东西都会被追踪到。这通常有助于删除那些使我们的输出变得混乱的普通功能。 +你并不总是知道你想追踪什么,但是,你肯定知道你不想追踪什么。因此,有一个 `set_ftrace_notrace` —— 请注意其中的 “no”。你可以在这个文件中写下你想要的模式,并启用追踪。这样除了所提到的模式外,任何其他东西都会被追踪到。这通常有助于删除那些使我们的输出变得混乱的普通功能: ``` $ sudo cat set_ftrace_notrace @@ -326,39 +332,40 @@ $ sudo cat set_ftrace_notrace ### 具有目标性的追踪 -到目前为止,你一直在追踪内核中发生的一切。但是,他无法帮助你追踪与某个特定命令有关的事件。为了达到这个目的,你可以按需打开和关闭跟踪,并且在它们之间,运行我们选择的命令,这样你就不会在跟踪输出中得到额外的输出。你可以通过向 `tracing_on` 写入 `1` 来启用跟踪,写 `0` 来关闭跟踪。 +到目前为止,你一直在追踪内核中发生的一切。但是,它无法帮助你追踪与某个特定命令有关的事件。为了达到这个目的,你可以按需打开和关闭跟踪,并且在它们之间,运行我们选择的命令,这样你就不会在跟踪输出中得到额外的输出。你可以通过向 `tracing_on` 写入 `1` 来启用跟踪,写 `0` 来关闭跟踪。 ``` -$ sudo cat tracing_on +# cat tracing_on 0 -$ sudo echo 1 > tracing_on -$ sudo cat tracing_on +# echo 1 > tracing_on + +# cat tracing_on 1 -$ # Run some specific command that we wish to trace here +### Run some specific command that we wish to trace here ### -$ sudo echo 0 > tracing_on +# echo 0 > tracing_on -$ cat tracing_on +# cat tracing_on 0 ``` ### 追踪特定的 PID -如果你想追踪与正在运行的特定进程有关的活动,你可以将该 PID 写入一个名为 `set_ftrace_pid` 的文件,然后启用追踪。这样一来,追踪就只限于这个PID,这在某些情况下是非常有帮助的。 +如果你想追踪与正在运行的特定进程有关的活动,你可以将该 PID 写入一个名为 `set_ftrace_pid` 的文件,然后启用追踪。这样一来,追踪就只限于这个 PID,这在某些情况下是非常有帮助的。 ``` -`$ sudo echo $PID > set_ftrace_pid` +$ sudo echo $PID > set_ftrace_pid ``` ### 总结 `ftrace` 是一个了解 Linux 内核内部工作的很好方式。通过一些练习,你可以学会对 `ftrace` 进行调整以缩小搜索范围。要想更详细地了解 `ftrace` 和它的高级用法,请看 `ftrace` 的核心作者 Steven Rostedt 写的这些优秀文章。 - * [调试 Linux 内核,第一部分](3) - * [调试 Linux 内核,第二部分](4) - * [调试 Linux 内核,第三部分](5) + * [调试 Linux 内核,第一部分][3] + * [调试 Linux 内核,第二部分][4] + * [调试 Linux 内核,第三部分][5] -------------------------------------------------------------------------------- @@ -368,7 +375,7 @@ via: https://opensource.com/article/21/7/linux-kernel-ftrace 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] 译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -379,3 +386,4 @@ via: https://opensource.com/article/21/7/linux-kernel-ftrace [3]: https://lwn.net/Articles/365835/ [4]: https://lwn.net/Articles/366796/ [5]: https://lwn.net/Articles/370423/ +[6]: https://linux.cn/article-11545-1.html \ No newline at end of file From df1f9be0893f957e39b33343d8ae0731b01967bb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 15:21:17 +0800 Subject: [PATCH 0251/1588] PUB @mengxinayan https://linux.cn/article-13752-1.html --- .../20210727 Analyze the Linux kernel with ftrace.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210727 Analyze the Linux kernel with ftrace.md (99%) diff --git a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md b/published/20210727 Analyze the Linux kernel with ftrace.md similarity index 99% rename from translated/tech/20210727 Analyze the Linux kernel with ftrace.md rename to published/20210727 Analyze the Linux kernel with ftrace.md index f9a1ee0806..41e8595022 100644 --- a/translated/tech/20210727 Analyze the Linux kernel with ftrace.md +++ b/published/20210727 Analyze the Linux kernel with ftrace.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13752-1.html) 通过 ftrace 来分析 Linux 内核 ====== From 9e908307ce865a775ab8be1b3714da503726e981 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 15:33:23 +0800 Subject: [PATCH 0252/1588] PRF&PUB @geekpi https://linux.cn/article-13753-1.html --- ...to Download Audio Only Using youtube-dl.md | 32 ++++++++++--------- 1 file changed, 17 insertions(+), 15 deletions(-) rename {translated/tech => published}/20210820 How to Download Audio Only Using youtube-dl.md (77%) diff --git a/translated/tech/20210820 How to Download Audio Only Using youtube-dl.md b/published/20210820 How to Download Audio Only Using youtube-dl.md similarity index 77% rename from translated/tech/20210820 How to Download Audio Only Using youtube-dl.md rename to published/20210820 How to Download Audio Only Using youtube-dl.md index 7fae01b4e2..fd70c1524c 100644 --- a/translated/tech/20210820 How to Download Audio Only Using youtube-dl.md +++ b/published/20210820 How to Download Audio Only Using youtube-dl.md @@ -3,38 +3,40 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13753-1.html" 如何使用 youtube-dl 只下载音频 ====== +![](https://img.linux.net.cn/data/attachment/album/202109/05/153110dkamc1kv0173ggc3.jpg) + [youtube-dl][1] 是一个多功能的命令行工具,用于从 YouTube 和许多其他网站下载视频。我用它来做我自己的 YouTube 视频的备份。 -默认情况下,你[使用 youtube-dl 下载视频][2]。用 youtube-dl 只提取音频怎么样? 其实很简单。让我告诉你步骤。 +默认情况下,你会 [使用 youtube-dl 下载视频][2]。用 youtube-dl 只提取音频怎么样? 其实很简单。让我告诉你步骤。 -注意 - -从网站下载视频可能违反他们的政策。这取决于你是否选择下载视频或音频。 +> **注意** +> +> 从网站下载视频可能违反他们的政策。这取决于你是否选择下载视频或音频。 ### 使用 youtube-dl 只下载音频 -请确保你已经在你的 Linux 发行版上安装了 youtube-dl。 +请确保你已经在你的 Linux 发行版上安装了 `youtube-dl`。 ``` sudo snap install youtube-dl ``` -如果你只想从 YouTube 视频中下载音频,你可以使用 youtube-dl 的 -x 选项。这个提取音频的选项将视频文件转换为纯音频文件。 +如果你只想从 YouTube 视频中下载音频,你可以使用 `youtube-dl` 的 `-x` 选项。这个提取音频的选项将视频文件转换为纯音频文件。 ``` youtube-dl -x video_URL ``` -该文件被保存在你运行 youtube-dl 命令的同一目录下。 +该文件被保存在你运行 `youtube-dl` 命令的同一目录下。 -这是我下载 Zorin OS 16 评论视频的画外音的示例。 +这是我下载 Zorin OS 16 评论视频的画外音的示例: ``` youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ @@ -53,7 +55,7 @@ youtube-dl -x https://www.youtube.com/watch?v=m_PmLG7HqbQ youtube-dl -x --audio-format mp3 video_URL ``` -下面是我之前展示的同一个例子。你可以看到它[使用 ffmpeg 转换][3] m4a 文件为 mp3: +下面是我之前展示的同一个例子。你可以看到它 [使用 ffmpeg 转换][3] m4a 文件为 mp3: ``` youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=m_PmLG7HqbQ @@ -87,11 +89,11 @@ https://www.youtube.com/playlist?list=XXXXXXXXXXXXXXXXXXX youtube-dl --extract-audio --audio-format mp3 -o "%(title)s.%(ext)s" playlist_URL ``` -那个看起来很可怕的 `-o "%(title)s.%(ext)s"` 指定了输出文件(带选项 -o),并指示它使用视频的标题和扩展名(本例为 mp3)来命名音频文件。 +那个看起来很可怕的 `-o "%(title)s.%(ext)s"` 指定了输出文件(选项 `-o`),并指示它使用视频的标题和扩展名(本例为 mp3)来命名音频文件。 ![][6] -我希望你觉得这个技巧对你有帮助。享受音频文件吧 :) +我希望你觉得这个技巧对你有帮助。享受音频文件吧。 -------------------------------------------------------------------------------- @@ -100,7 +102,7 @@ via: https://itsfoss.com/youtube-dl-audio-only/ 作者:[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 d3e3d25b8dcdbe5dca5dc214d1a8ffff100213b4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 15:39:22 +0800 Subject: [PATCH 0253/1588] PRF --- published/20210727 Analyze the Linux kernel with ftrace.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/published/20210727 Analyze the Linux kernel with ftrace.md b/published/20210727 Analyze the Linux kernel with ftrace.md index 41e8595022..673661c1b3 100644 --- a/published/20210727 Analyze the Linux kernel with ftrace.md +++ b/published/20210727 Analyze the Linux kernel with ftrace.md @@ -156,7 +156,7 @@ function $ sudo cat current_tracer function -$ sudo echo nop > current_tracer +$ sudo echo nop > current_tracer $ sudo cat current_tracer nop @@ -167,7 +167,7 @@ nop 现在尝试第二个名为 `function_graph` 的追踪器。你可以使用和上面相同的步骤:在 `current_tracer` 文件中写入 `function_graph`: ``` -$ sudo echo function_graph > current_tracer +$ sudo echo function_graph > current_tracer $ sudo cat current_tracer function_graph From d3791cd6b65ff7fbd2725b708eb0e1ad129a0cba Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sun, 5 Sep 2021 19:12:28 +0800 Subject: [PATCH 0254/1588] translated --- ...essential Linux commands for every user.md | 255 ------------------ ...essential Linux commands for every user.md | 242 +++++++++++++++++ 2 files changed, 242 insertions(+), 255 deletions(-) delete mode 100644 sources/tech/20210901 20 essential Linux commands for every user.md create mode 100644 translated/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 deleted file mode 100644 index 842dd7aded..0000000000 --- a/sources/tech/20210901 20 essential Linux commands for every user.md +++ /dev/null @@ -1,255 +0,0 @@ -[#]: 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: "unigeorge" -[#]: 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] -译者:[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/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 diff --git a/translated/tech/20210901 20 essential Linux commands for every user.md b/translated/tech/20210901 20 essential Linux commands for every user.md new file mode 100644 index 0000000000..65eb1115a2 --- /dev/null +++ b/translated/tech/20210901 20 essential Linux commands for every user.md @@ -0,0 +1,242 @@ +[#]: 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: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用户必会的 20 个 Linux 命令 +====== +无论新手老手,这 20 个 Linux 命令都能让你的操作更轻松。 +![Command line prompt][1] + +在黝黑的终端窗口中输入命令,这样的方式对某些人群来说可能好像过时了,但对许多专业计算机用户来说,这几乎是计算机完成能够执行的所有任务的最有效、最简便和最清晰的方式。如今,一些项目将开源命令引入了 macOS 和 Windows 等非开放平台,因此终端命令不仅仅是针对 Linux 和 BSD 用户,更是与每个人都息息相关。你可能会惊讶地发现,在一台普通的 [POSIX][2] 计算机上安装了数千个命令,当然,其中很多命令并不是真的有用,至少不是直接或定期性被使用。而其中的一部分命令虽然不是有效终端必须使用的命令,但相比其他命令而言使用频率较高,值得大家学习一下。 + +以下是终端用户最可能会使用的前 20 个命令: + +### cd + +在终端外,你可以单击图标从一个文件夹移动到另一个文件夹,但在终端中,你需要使用 `cd`。`cd` 命令代表 _change directory_(变更目录),是用户在 Linux 系统中移动的方式。这是 Linux 中从一个地方到另一个地方最快、最直接的路线。 + +例如,在桌面上,当你想从你的主目录(你保存所有文件夹的地方)移动到一个名为 `presentations` 的文件夹时,你首先要打开你的 `Documents` 文件夹,然后打开一个名叫 `work` 的文件夹,然后是 `projects` 文件夹,然后是`conference` 文件夹,最后是 `presentations` 文件夹,里面存放的是 LibreOffice Impress 幻灯片。这个过程包含了很多次的双击操作。同时屏幕上还需要许多移动动作,这取决于新窗口出现的位置,以及大脑需要跟踪的许多路径点。许多人通过将 _所有文件_ 都放在桌面上来避免这个看似微不足道的任务。 + +而终端用户只需键入以下内容即可避免此问题: + +``` +$ cd ~/Documents/work/projects/conference/presentations +``` + +一些有经验的终端用户甚至都懒得输入所有这些,而是使用 **Tab** 键自动完成单词填充。更甚者,有时你都不必依赖自动完成,而是改用通配符: + +``` +$ cd ~/Doc*/work/*/conf*/p* +``` + +### pwd + +用 Buckaroo Banzai 的话来说:“无论你走到哪里,你就在那里。” + +当你想弄清楚确切位置时,就可以使用 `pwd` 命令。`pwd` 代表 _print working directory_(打印工作目录),这正是它的作用。`--physical`(在某些情况时缩写为 `-P`)显示解析所有符号链接后的确切位置。 + +``` +$ pwd +/home/tux/presentation + +$ pwd --physical +/home/tux/Documents/work/projects/conference/presentations +``` + +### sed + +流编辑器 `sed` 更广为人知的是一个强大的批量 _查找和替换_ 命令,但它同时也是一个合法的文本编辑器。你可以通过阅读我的 [介绍性文章][3] 来学习使用它,然后通过我的 [高级教程和备忘录][4] 成为老手。 + +### grep + +`grep` 命令使用很普遍,以至于经常被用作动词(例如“我会通过一些文件 grep”)和动名词(例如“grep 一些输出”)。无论是查看日志文件还是解析其他命令的输出,它都是在 shell 中解析文本时的关键组件。这是忙碌的用户专注于特定信息的一种方式。考虑一下计算世界中的数据量,grep 命令的流行就见怪不怪了。你可以通过阅读我的 [介绍性文章][5] 了解 grep,然后下载 [备忘录][6] 学习。 + +### file + +当你需要知道文件包含什么类型的数据时,请使用 `file` 命令: + +``` +$ file example.foo +example.foo: RIFF (little-endian) data, Web/P image [...] + +$ file example.bar +example.bar: ELF 64-bit LSB executable, x86-64 [...] +``` + +当然,`file` 命令并不神奇。它不过是根据文件如何识别自身进行输出,并且文件可能是错误的、损坏的或伪装的。使用 [`hexdump`][7] 进行严格检查的方式确定性更强,但对于日常使用而言,`file` 命令非常方便。 + +### awk + +awk 不仅仅是一个命令,它还是一种文字 [编程语言][8]。[点此下载我们的免费 Awk 电子书][9] 进行学习,你可能会写出远超你想象的脚本。 + +### curl + +`curl` 命令是用于终端的 [非交互式 Web 浏览器][10]。它是面向 Web 和 API 开发人员的 [开发工具][11]。因为灵活性,它是一个复杂的命令,但如果你想从你的终端顺利地与网络服务交互,该命令是很值得学习的。 + +下载我们免费的 [`curl` 备忘录][12],你可以从中学会 `curl` 的许多选项。 + +### ps + +管理系统资源主要由内核负责,当你更喜欢或更需要手动管理时,可以使用 `ps` 命令。读者可以在我的 [使用 procps-ng 监控 Linux 系统][13] 文章中了解 `ps`。 + +### cat + +[`cat` 命令][14] 是 _concatenate_(连接)的缩写,它曾因为能将由于大小限制而被(使用 `split` 命令)拆分成的若干小文件合并而非常有用。如今,`cat` 主要是用来将文本文件的内容转储到终端中以供快速阅读,除非你为此专门去使用 `head`、`tail`、`more` 或 `less` 等命令。 + +尽管它的原始用途几乎已被弃用,并且其他几个命令也主要是执行其次要功能,但 `cat` 仍然是一个有用的工具。例如,它可以是复制 (`cp`) 命令的替代品: + +``` +$ cat myfile.ogg > /backups/myfile.ogg +``` + +它可以显示文件中不便观察的隐形字符。例如,使用 `--show-tabs` 选项,分割 [YAML][15] 的 **Tab** 字符就会显示为 `^I`: + +``` +$ 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 +``` + +它还可以用 `--show-nonprinting` 显示非打印字符,用 `--show-ends` 标记行尾,用 `--number` 提供行号,等等。 + +### find + +`find` 命令可以用来查找文件,但它还有许多选项,这些选项可以帮助你查找具有各种过滤器和参数的文件。读者可以从我的 [介绍性文章][16] 中学习该命令的基础知识。 + +如果你一直想知道为什么最基本的,不起眼的 [`ls` 命令][17],不在本文列表中,那是因为 `find` 的灵活性。它不仅可以找到列表文件: + +``` +$ find . +./bar.txt +./baz.xml +./foo.txt +[...] +``` + +它还可以提供包含详细信息的长列表功能: + +``` +$ 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 +[...] +``` + +这是一个技术问题,但也是很一个巧妙的技巧。 + +### tar + +人们有时会引用 BSD 的 `tar` 语法来拿 Linux 命令开玩笑。尽管广为人赞,但 `tar` 命令实际上非常直观。读者可以阅读我的 [如何解压缩 tar.gz 文件][18] 文章,了解按需使用 `tar` 命令的简单知识。 + +### more or less or most + +这些统称为 pager 命令。pager 命令与 `cat` 类似,但前者会在屏幕底部暂停输出,直到你向下滚动查看更多内容。这些命令比较简单,但每个之间都有细微差别。用户是用箭头键还是空格键滚动?是必须手动退出,还是在显示的文件末尾自动退出?用户的首选搜索行为是什么样的?选择你最喜欢的 pager 命令并将其设置在 `.bashrc` 中吧! + +### ssh and scp + +OpenSSH 不仅有助于保护与远程系统的连接安全,还可以用于启用其他命令。例如,对于许多用户来说,有了 `.ssh` 目录,他们才能与 Git 存储库顺利交互、将更新发布到网站、登录云控制平面。 + +### mv + +`mv` 命令有双重作用:它既 [移动文件][19] 又 [重命名文件][20]。它有几个可用的保护措施,例如 `--interactive` 和 `--no-clobber` 选项避免破坏现有文件,`--backup` 命令确保数据在新位置验证之前被保留,以及 `--update` 选项确保旧版本不会替换新版本文件。 + +### sudo + +当某个用户账户的用户名已知,且具有 _全部_ 系统权限时,该用户很快就会成为黑客攻击的目标。`sudo` 命令消除了对字面上 `root` 用户的需求,从而优雅地移除了有关系统的重要信息。不过这还不是全部,使用 `sudo` 你还可以轻松地将权限管理到单个命令、用户和组。你可以启用选择命令的无密码执行、记录用户会话、使用摘要验证验证命令,[以及更多操作][21]。 + +### alias + +使用 `alias` 命令将长命令变成易于记忆的快捷方式: + +``` +`$ alias ls='ls --classify --almost-all --ignore-backups --color'` +``` + +### clear + +有时终端会显得很混乱,输入 `clear`(或在某些 shell 中按 **Ctrl+L**)后,你就能得到漂亮、全新的屏幕了。 + +### setfacl + +传统上,POSIX 文件权限由 `chown` 和 `chmod` 决定。然而,如今系统变得更加复杂,因此有一个灵活性更高的命令。`setfacl` 命令允许创建一个 [访问控制列表 (ACL)][22],可以配置任意用户所需权限,并可以为文件夹及其中创建的内容设置默认权限。 + +### netcat + +可能需要使用 netcat (`nc`) 的人不多,但这些使用人对它的依赖度会很高。`nc` 命令是一个通用的网络连接工具。 + +它可以连接到一个端口,类似于 `telnet` 命令: + +``` +$ nc -u 192.168.0.12 80 +``` + +它可以 ping 一个端口,类似于 `ping` 命令: + +``` +$ nc -zvn 192.168.0.12 25 +``` + +它可以探测开放端口,类似于 `nmap` 命令: + +``` +$ nc -zv 192.168.0.12 25-80 +``` + +以上仅是该命令的一小部分用途。 + +### 你自己构建的命令 + +在某种程度上,Linux 终端是关于创造性解决问题的平台。当你学习命令时,你也在学习可用于创建自己的命令的构造块。我的 [shell history][23] 中的许多命令都是自己编写的 shell 脚本,从而我实现了根据自己想要的工作方式定制工作流程。你为自己的效率和舒适度而设计的命令也可以作为 shell 中的基本命令。花些时间了解一些很棒的命令,然后试着构建自己的命令吧。当你构建出的命令非常好用时,把它开源,这样就可以与他人分享你的想法啦! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/essential-linux-commands + +作者:[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/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 2636436f5f9ee26a38b6931c4ad99c89b10e2205 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 22:39:35 +0800 Subject: [PATCH 0255/1588] APL --- .../tech/20210719 Apps for daily needs part 2- office suites.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210719 Apps for daily needs part 2- office suites.md b/sources/tech/20210719 Apps for daily needs part 2- office suites.md index d5a84fe848..015760bf74 100644 --- a/sources/tech/20210719 Apps for daily needs part 2- office suites.md +++ b/sources/tech/20210719 Apps for daily needs part 2- office suites.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/) [#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 0e88919fc4a649a7637454193b29d737ff5fcc94 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 23:19:01 +0800 Subject: [PATCH 0256/1588] TSL&PRF --- ...s for daily needs part 2- office suites.md | 124 ------------------ ...s for daily needs part 2- office suites.md | 116 ++++++++++++++++ 2 files changed, 116 insertions(+), 124 deletions(-) delete mode 100644 sources/tech/20210719 Apps for daily needs part 2- office suites.md create mode 100644 translated/tech/20210719 Apps for daily needs part 2- office suites.md diff --git a/sources/tech/20210719 Apps for daily needs part 2- office suites.md b/sources/tech/20210719 Apps for daily needs part 2- office suites.md deleted file mode 100644 index 015760bf74..0000000000 --- a/sources/tech/20210719 Apps for daily needs part 2- office suites.md +++ /dev/null @@ -1,124 +0,0 @@ -[#]: subject: (Apps for daily needs part 2: office suites) -[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/) -[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Apps for daily needs part 2: office suites -====== - -![][1] - -Photo by [Brooke Cagle][2] on [Unsplash][3] - -Today, almost every family has a desktop computer or laptop. That’s because the computer has become a very important requirement. Moreover, many people have to create documents and presentations in digital format for work or study. Therefore, the office suites are must-have application on almost all computers. This article will introduce some of the open source office suites 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 the list of apps for daily needs in the office suites category. - -### LibreOffice - -LibreOffice is the most popular office suite among GNU/Linux users. It has a user interface and user experience similar to Microsoft Office. This makes LibreOffice easy to learn for those who have just migrated from Microsoft Office. LibreOffice has complete features to meet your needs working on documents and presentations. It consists of six applications: Writer, Calc, Impress, Draw, Math, and Base. - -The first application is Writer that is used to create various kinds of documents, such as letters, faxes, agendas, minutes, etc. It is a full-featured word processing and desktop publishing tool. The second application is Calc which is a spreadsheet program that is perfect for presenting data and documenting it in tabular format. Calc can create simple tables or do professional data analysis. The third application is Impress which is an easy-to-use presentation application. You can easily choose what you features want in your presentation slides, such as text, images, tables, diagrams, etc. - -![LibreOffice Writer][5] - -![LibreOffice Calc][6] - -![LibreOffice Impress][7] - -The three LibreOffice applications mentioned earlier are the most commonly used applications in creating documents and presentations. However, LibreOffice provides three other applications that are also very useful. The first is Draw which can be used to create drawings and diagrams, ranging from simple to complex. The next application is Math which can help us make perfectly formatted mathematical and scientific formulas. The last is Base which is an application for processing databases. - -![LibreOffice Draw][8] - -![LibreOffice Math][9] - -![LibreOffice Base][10] - -More information is available at this link: - -* * * - -### ONLYOFFICE - -ONLYOFFICE is an office suite application that is highly compatible with Microsoft Office. Therefore we do not have to worry about collaborating with colleagues who use Microsoft Office because it can read various file formats such as docx, xlsx, and pptx. - -ONLYOFFICE provides three applications with a clean and modern look. We can easily find the features and tools that we need. Although the features are not as complete as LibreOffice, they are very sufficient to help us create good documents and presentations. - -The first application is Documents Editor which has the same function as Writer from LibreOffice. It has all the basic features needed in a word processor, such as managing fonts and styles, formatting text, adjusting line and paragraph spacing, inserting headers and footers, customizing page layout, and setting margins. The second application is Spreadsheet Editor which is an application for processing data and creating it as a document in tabular format. It is an application with the same functionality as Calc. The last one is Presentations Editor which is a presentation application with functions similar to Impress. - -Unfortunately ONLYOFFICE is not available in the official Fedora Linux repositories. But you can still install it on Fedora Linux using Flatpak or Appimages. - -![ONLYOFFICE Documents Editor][11] - -![ONLYOFFICE Spreadsheets Editor][12] - -![ONLYOFFICE Presentations Editor][13] - -More information is available at this link: - -* * * - -### Calligra - -Calligra is an office suite created by KDE. Therefore, this application is actually more suitable for users of the KDE Plasma desktop environment. But it can still run well on other desktop environments, such as Fedora Workstation using GNOME. - -Calligra provides several applications with a slightly different look from LibreOffice or ONLYOFFICE. It may take some adjustment for those who are used to mainstream office suite applications. However, Calligra is still a reliable office suite to support our daily needs. - -The first application is Words which is an intuitive word processor with desktop publishing features. It has a full range of features to help us in document creation. The second application is Sheets which has the same functionality as Calc and Spreadsheet Editors as a fully-featured spreadsheet application. The third application is Stage which can help us in making presentation slides. - -![Calligra Words][14] - -![Calligra Sheets][15] - -![Calligra Stage][16] - -The three Calligra applications are the most commonly used applications for creating documents and presentations. There are three other applications that are also very useful. The first is Karbon which can be used to create drawings and diagrams, ranging from simple to complex. The next application is Plan which is project management application that can help in managing moderately large projects with multiple resources. The last is KEXI which is a visual database application creator. - -![Calligra Karbon][17] - -![Calligra Plan][18] - -![Calligra Kexi][19] - -More information is available at this link: - -* * * - -### Conclusion - -This article presented 3 office suites for your daily needs that you can use on Fedora Linux. If you want a complete set of features in your office suite, then LibreOffice may be the right choice. For good compatibility with Microsoft Office, then you may choose ONLYOFFICE. However, if you want a different user interface and experience in creating documents and presentations, you can try Calligra. Hopefully this article can help you to choose the right office suite. If you have experience in using these applications, please share your experience in the comments. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/ - -作者:[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-2-Office-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/07/office-libre-writer-1-1024x575.png -[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-calc-1-1024x575.png -[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-impress-1-1024x575.png -[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-draw-1-1024x575.png -[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-math-1-1024x575.png -[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-base-1-1024x575.png -[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-doc-1024x575.png -[12]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-sheet-1024x575.png -[13]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-presentation-1024x575.png -[14]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-words-1024x575.png -[15]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-sheets-1024x575.png -[16]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-stage-1024x575.png -[17]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-karbon-1-1024x575.png -[18]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-plan-1024x575.png -[19]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-kexi-1024x575.png diff --git a/translated/tech/20210719 Apps for daily needs part 2- office suites.md b/translated/tech/20210719 Apps for daily needs part 2- office suites.md new file mode 100644 index 0000000000..d1d3378ab3 --- /dev/null +++ b/translated/tech/20210719 Apps for daily needs part 2- office suites.md @@ -0,0 +1,116 @@ +[#]: subject: (Apps for daily needs part 2: office suites) +[#]: via: (https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/) +[#]: author: (Arman Arisman https://fedoramagazine.org/author/armanwu/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +满足日常需求的应用(二):办公套件 +====== + +![][1] + +今天,几乎每个家庭都有一台台式电脑或笔记本电脑。这是因为计算机已经成为一个非常重要的要求。此外,不管是为了工作还是学习,许多人需要创建电子版的文档和演示文稿。因此,办公套件是几乎所有计算机上的必备应用程序。本文将介绍一些你可以在 Fedora Linux 上使用的开源办公套件。这些软件你可能需要安装。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章 [安装 Fedora 34 工作站后要做的事情][4]。下面是满足日常需求的办公套件类的应用程序列表。 + +### LibreOffice + +LibreOffice 是 GNU/Linux 用户中最流行的办公套件。它的用户界面和用户体验类似于微软 Office。这使得 LibreOffice 对于那些刚刚从微软 Office 迁移过来的人来说很容易学习。LibreOffice 有完整的功能,可以满足你在文档和演示方面的工作需要。它由六个应用程序组成:Writer、Calc、Impress、Draw、Math 和 Base。 + +第一个应用程序是 Writer,用于创建各种类型的文档,如信件、传真、议程、会议记录等。它是一个全功能的文字处理和桌面出版工具。第二个应用程序是 Calc,它是一个电子表格程序,非常适合以表格形式呈现数据和记录数据。Calc 可以创建简单的表格或进行专业的数据分析。第三个应用程序是 Impress,它是一个易于使用的演示应用程序。你可以很容易地选择你在演示幻灯片中想要的功能,如文本、图像、表格、图表等。 + +![LibreOffice Writer][5] + +![LibreOffice Calc][6] + +![LibreOffice Impress][7] + +前面提到的三个 LibreOffice 应用程序是创建文档和演示文稿中最常用的应用程序。然而,LibreOffice 提供的其他三个应用程序也非常有用。第一个是 Draw,它可以用来创建从简单到复杂的图纸和图表。下一个应用程序是 Math,它可以帮助我们做出完美格式的数学和科学公式。最后一个是 Base,这是一个用于处理数据库的应用程序。 + +![LibreOffice Draw][8] + +![LibreOffice Math][9] + +![LibreOffice Base][10] + +更多信息请见此链接: + +### ONLYOFFICE + +ONLYOFFICE 是一款与微软 Office 高度兼容的办公套件应用程序。因此,我们与使用微软 Office 的同事协作时就不必担心了,因为它可以读取各种文件格式,如 docx、xlsx 和 pptx。 + +ONLYOFFICE 提供了三种具有简洁和现代外观的应用程序。我们可以很容易地找到我们需要的功能和工具。虽然功能没有 LibreOffice 那么齐全,但也足以帮助我们创建良好的文档和演示文稿。 + +第一个应用程序是文档编辑器,它的功能与 LibreOffice 的 Writer 相同。它具有文字处理器所需的所有基本功能,如管理字体和样式、格式化文本、调整行距和段距、插入页眉和页脚、自定义页面布局和设置页边距。第二个应用程序是电子表格编辑器,它是一个用于处理数据并将其创建为表格格式的文件的应用程序。它是一个具有与 Calc 相同功能的应用程序。最后一个是演示文稿编辑器,它是一个演示文稿应用程序,其功能类似于 Impress。 + +不幸的是,ONLYOFFICE 在官方的 Fedora Linux 软件库中并没有提供。但是你仍然可以使用 Flatpak 或 Appimages 在 Fedora Linux 上安装它。 + +![ONLYOFFICE Documents Editor][11] + +![ONLYOFFICE Spreadsheets Editor][12] + +![ONLYOFFICE Presentations Editor][13] + +更多信息请见此链接: + +### Calligra + +Calligra 是一个由 KDE 创建的办公套件。因此,这个应用程序实际上更适合于 KDE Plasma 桌面环境的用户。但它仍然可以在其他桌面环境中良好运行,例如使用 GNOME 的 Fedora 工作站。 + +Calligra 提供的几个应用程序的外观与 LibreOffice 或 ONLYOFFICE 略有不同。对于那些习惯于主流办公套件应用程序的人来说,可能需要一些适应。然而,Calligra 仍然是一个可靠的办公套件,足以支持我们的日常需求。 + +第一个应用程序是 Words,它是一个具有桌面出版功能的直观的文字处理器。它具有帮助我们进行文档创作的全面功能。第二个应用程序是 Sheets,它具有与 Calc 和电子表格编辑器相同的功能,是一个功能齐全的电子表格应用程序。第三个应用程序是 Stage,它可以帮助我们制作演示幻灯片。 + +![Calligra Words][14] + +![Calligra Sheets][15] + +![Calligra Stage][16] + +这三个 Calligra 应用程序是创建文档和演示文稿最常用的应用程序。另外还有三个应用程序也非常有用。第一个是 Karbon,它可以用来创建从简单到复杂的图纸和图表。下一个应用程序是 Plan,这是一个项目管理应用程序,可以帮助管理具有多种资源的中等规模的项目。最后一个是 KEXI,它是一个可视化数据库应用程序的创建器。 + +![Calligra Karbon][17] + +![Calligra Plan][18] + +![Calligra Kexi][19] + +更多信息请见此链接: + +### 总结 + +这篇文章介绍了 3 个可以在 Fedora Linux 上使用的办公套件,以满足你的日常需要。如果你想拥有具有一套完整功能的办公套件,那么 LibreOffice 可能是正确的选择。如果想与微软 Office 有良好的兼容性,那么你可以选择 ONLYOFFICE。然而,如果你想要一个不同的用户界面和创建文档和演示文稿的体验,你可以试试 Calligra。希望这篇文章能帮助你选择合适的办公套件。如果你有使用这些应用程序的经验,请在评论中分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-2-office-suites/ + +作者:[Arman Arisman][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://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-2-Office-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/07/office-libre-writer-1-1024x575.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-calc-1-1024x575.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-impress-1-1024x575.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-draw-1-1024x575.png +[9]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-math-1-1024x575.png +[10]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-libre-base-1-1024x575.png +[11]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-doc-1024x575.png +[12]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-sheet-1024x575.png +[13]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-only-presentation-1024x575.png +[14]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-words-1024x575.png +[15]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-sheets-1024x575.png +[16]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-stage-1024x575.png +[17]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-karbon-1-1024x575.png +[18]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-plan-1024x575.png +[19]: https://fedoramagazine.org/wp-content/uploads/2021/07/office-calligra-kexi-1024x575.png From a9050b78720219623c02f9ef4f1732b1f1e40650 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 5 Sep 2021 23:22:09 +0800 Subject: [PATCH 0257/1588] PUB @wxy https://linux.cn/article-13755-1.html --- .../20210719 Apps for daily needs part 2- office suites.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210719 Apps for daily needs part 2- office suites.md (99%) diff --git a/translated/tech/20210719 Apps for daily needs part 2- office suites.md b/published/20210719 Apps for daily needs part 2- office suites.md similarity index 99% rename from translated/tech/20210719 Apps for daily needs part 2- office suites.md rename to published/20210719 Apps for daily needs part 2- office suites.md index d1d3378ab3..eb2f6ecbcf 100644 --- a/translated/tech/20210719 Apps for daily needs part 2- office suites.md +++ b/published/20210719 Apps for daily needs part 2- office suites.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13755-1.html) 满足日常需求的应用(二):办公套件 ====== From d114231cb5ec1b5a46f746200d8a6be21ac6be87 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 6 Sep 2021 05:02:35 +0800 Subject: [PATCH 0258/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210906?= =?UTF-8?q?=20Getting=20the=20Top=20Indicator=20Panel=20Back=20in=20GNOME?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md --- ...g the Top Indicator Panel Back in GNOME.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md diff --git a/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md b/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md new file mode 100644 index 0000000000..efeb2a3dad --- /dev/null +++ b/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md @@ -0,0 +1,82 @@ +[#]: subject: "Getting the Top Indicator Panel Back in GNOME" +[#]: via: "https://itsfoss.com/enable-applet-indicator-gnome/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Getting the Top Indicator Panel Back in GNOME +====== + +GNOME is the popular desktop environment that thrives to give Linux a modern desktop experience. + +While it works for the most part, some of their decisions has left the user fuming and questioning. + +You cannot have icons and files on the desktop, [new document option has been removed][1] from the right click context menu. In addition to that, GNOME has also removed the applet indicator functionality. + +You know what indicator applets are, don’t you? Those little icons that let you access additional features of the given application. I have plenty of them in my Ubuntu system. + +![Indicator applets][2] + +And this creates a problem, specially for applications that rely completely on these applet indicators to function. Take [Dropbox][3] for example. The only way to access Dropbox settings is through the app-indicator and you won’t find it in GNOME. + +That’s a problem, but thankfully, there is a workaround for that. + +### Enabling applet indicator in GNOME via extension + +If you are using GNOME, you probably already know what GNOME Extension is. These are basically small add-ons developed by enthusiastic, independent developers. + +If not done already, [enable GNOME extensions][4]. It’s actually quite simple. Go to any GNOME extension’s page using Firefox or Chrome and it will suggest downloading a browser extension. Install it and you are good to go. + +![Enabling GNOME Extension browser add-on][5] + +Now, there are several GNOME extensions available that allow adding applet indicators in the top panel. At the time of writing this tutorial, [AppIndicator and KStatusNotifierItem Support][6] extension is well developed and supported for the recent GNOME versions. + +Go to its webpage: + +[AppIndicator Extension][6] + +On the page, you should see a toggle button. Click it to install it. + +![][7] + +There will be a pop-up. Hit install when you see it. + +![Install the extension][8] + +The results won’t be seen immediately. You’ll have to restart GNOME. On Xorg, you could just use Alt+F2 and enter r but that does not work in Wayland. + +Log out of the system and log back in. Applet indicator should be activated now. If you have any applications installed that provides an indicator applet, you should see it on the top panel. + +In my case, I had Dropbox already installed and hence it started showing the icon in the top panel. + +![Dropbox indicator working in GNOME][9] + +I hope this little tip help you gain access to the app indicators in the top panel of GNOME again. + +I do not know why the GNOME developers though that dropping this essential feature was a good idea. Anyway, if one door closes, another opens (usually). Enjoy GNOME to your liking. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/enable-applet-indicator-gnome/ + +作者:[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/add-new-document-option/ +[2]: https://itsfoss.com/wp-content/uploads/2021/09/indicator-applet-linux.webp +[3]: https://www.dropbox.com +[4]: https://itsfoss.com/gnome-shell-extensions/ +[5]: https://itsfoss.com/wp-content/uploads/2021/09/installing-gnome-extension-add-on-800x355.webp +[6]: https://extensions.gnome.org/extension/615/appindicator-support/ +[7]: https://itsfoss.com/wp-content/uploads/2021/09/appindicator-extension-800x329.webp +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-appindicator-extension.png?resize=800%2C269&ssl=1 +[9]: https://itsfoss.com/wp-content/uploads/2021/09/gnome-dropbox-indicator-800x561.webp From 55ba06686d72063d0fa323c715fa5ffecc9f3e07 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 6 Sep 2021 05:02:58 +0800 Subject: [PATCH 0259/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210905?= =?UTF-8?q?=20Create=20a=20photo=20collage=20from=20the=20Linux=20command?= =?UTF-8?q?=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210905 Create a photo collage from the Linux command line.md --- ...oto collage from the Linux command line.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/tech/20210905 Create a photo collage from the Linux command line.md diff --git a/sources/tech/20210905 Create a photo collage from the Linux command line.md b/sources/tech/20210905 Create a photo collage from the Linux command line.md new file mode 100644 index 0000000000..02b48cb3c0 --- /dev/null +++ b/sources/tech/20210905 Create a photo collage from the Linux command line.md @@ -0,0 +1,91 @@ +[#]: subject: "Create a photo collage from the Linux command line" +[#]: via: "https://opensource.com/article/21/9/photo-montage-imagemagick" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Create a photo collage from the Linux command line +====== +Here's how I use ImageMagick to make photo grids for my social media +posts. +![Polaroids and palm trees][1] + +ImageMagick is the "Swiss Army knife" of manipulating images on the command line. While you could use a desktop graphics program like GIMP or GLIMPSE to adjust or combine photos and graphics, sometimes it's just easier to use one of the almost dozen tools from ImageMagick. + +For example, I frequently find myself creating image montages to share on social media. Let's say I wanted to share a montage or "image grid" of several screenshots. To do that, I use the ImageMagick `montage` command.  + +ImageMagick is a full suite of tools, and the one I use here is the `montage` command. The general syntax of the `montage` command looks like this: + + +``` +`montage {input} {actions} {output}` +``` + +In my case, my screenshots are already the same size: 320x240 pixels.  To create a montage of six of these images, in a grid that's two screenshots wide by three tall, I can use this command: + + +``` +$ montage acronia.png \ +ascii-table.png \ +music.png \ +programming-chess.png \ +petra.png \ +amb.png \ +-tile 2x3 -geometry +1+1 \  +screenshot-montage.png +``` + +This creates an image that's composed of the six screenshots, with a 1-pixel border around each. Doing the math, that's 644 pixels wide and 726 pixels high. + +Note the order of the images: ImageMagick montage arranges the images from left-to-right and top-to-bottom. + +![Screenshot montage][2] + +(Jim Hall, [CC BY-SA 4.0][3]) + +In my example, the first row of images shows the open source 2D shooter Acronia and an ASCII programming example, the middle row is an open source music player and a chess programming example, and the third row shows the open source game Post Apocalyptic Petra and the FreeDOS AMB Help reader. + +### Install ImageMagick on Linux + +On Linux, you can install ImageMagick using your package manager. For instance, on Fedora or similar: + + +``` +`$ sudo dnf install imagemagick` +``` + +On Debian and similar: + + +``` +`$ sudo apt install imagemagick` +``` + +On macOS, use [MacPorts][4] or [Homebrew][5]. + +On Windows, use [Chocolatey][6]. + +These open source photo libraries help you stay organized while making your pictures look great. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/photo-montage-imagemagick + +作者:[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/design_photo_art_polaroids.png?itok=SqPLgWxJ (Polaroids and palm trees) +[2]: https://opensource.com/sites/default/files/uploads/screenshot-montage_0.png (Screenshot montage) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey From b458be012622923785e6005108195efb4d37024d Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 Sep 2021 08:46:29 +0800 Subject: [PATCH 0260/1588] translated --- .../20210831 What is a container image.md | 126 ------------------ .../20210831 What is a container image.md | 126 ++++++++++++++++++ 2 files changed, 126 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20210831 What is a container image.md create mode 100644 translated/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 deleted file mode 100644 index deefbe18d6..0000000000 --- a/sources/tech/20210831 What is a container image.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: 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: "geekpi" -[#]: 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 diff --git a/translated/tech/20210831 What is a container image.md b/translated/tech/20210831 What is a container image.md new file mode 100644 index 0000000000..596520f951 --- /dev/null +++ b/translated/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: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +什么是容器镜像? +====== +容器镜像包含一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。 + +![Shipping containers stacked][1] + +容器是当今 IT 运维的一个关键部分。一个_容器镜像_包含了一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。 + +你通过提供一组特殊格式的指令来创建容器镜像,可以是提交给 Registry,或者是 Dockerfile。 例如,这个 Dockerfile 为 PHP Web 应用创建了一个容器: + + +``` +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 +``` + +这个文件中的每条指令都会在容器镜像中增加一个_层_。每一层只增加与下面一层的区别,然后,所有这些层叠在一起,形成一个只读的容器镜像。 + +### 这是怎么做到的? + +你需要知道一些关于容器镜像的事情,按照这个顺序理解这些概念很重要: + + 1. Union 文件系统 + 2. 写入时复制 + 3. Overlay 文件系统 + 4. SnapShotters + + + +### Union 文件系统(Aufs) + +Union 文件系统(UnionFS)内置于 Linux 内核中,它允许将一个文件系统的内容与另一个文件系统的内容合并,同时保持“物理”内容的分离。其结果是一个统一的文件系统,即使数据实际上是以分支形式组织。 + +这里的想法是,如果你有多个镜像有一些相同的数据,不是让这些数据再次复制过来,而是通过使用一个叫做_层_的东西来共享。 + +![UnionFS][2] + +图片 CC BY-SA opensource.com + +每一层都是一个可以在多个容器中共享的文件系统,例如,httpd 基础层是 Apache 的官方镜像,可以在任何数量的容器中使用。想象一下,由于我们在所有的容器中使用相同的基础层,我们节省了多少磁盘空间。 + +这些镜像层总是只读的,但是当我们用这个镜像创建一个新的容器时,我们会在它上面添加一个薄的可写层。这个可写层是你创建/修改/删除或进行每个容器所需的其他修改的地方。 + +### 写时复制 + +当你启动一个容器时,看起来好像这个容器有自己的整个文件系统。这意味着你在系统中运行的每个容器都需要自己的文件系统副本。这岂不是要占用大量的磁盘空间,而且还要花费大量的时间让容器启动?不是的,因为每个容器都不需要它自己的文件系统副本! + +容器和镜像使用写时复制机制来实现这一点。写时复制策略不是复制文件,而是将同一个数据实例分享给多个进程,并且只在一个进程需要修改或写入数据时进行复制。所有其他进程将继续使用原始数据。在运行中的容器中执行任何写操作之前,要修改的文件的副本被放在容器的可写层上。这就是发生_写_的地方。现在你知道为什么它被称为“写时复制”了么。 + +这种策略既优化了镜像磁盘空间的使用,也优化了容器启动时间的性能,并与 UnionFS 一起工作。 + +### Overlay 文件系统 + +Overlay 文件系统位于现有文件系统的顶部,结合了上层和下层的目录树,并将它们作为一个单一的目录来呈现。这些目录被称为_层_。下层保持不被修改。每一层只增加与下一层的差异(计算术语为 _diff_),这种统一的过程被称为 _union 挂载_。 + +最低的目录或镜像层被称为 _lowerdir_,上面的目录被称为 _upperdir_。最后的覆盖层或统一层被称为 _merged_。 + +![Layered file system][3] + +图片 CC BY-SA opensource.com + +常见的术语包括这些层的定义: + + * 基础层是你的文件系统的文件所在的地方。就容器镜像而言,这个层就是你的基础镜像。 + * Overlay 层通常被称为_容器层_,因为对运行中的容器所做的所有改变,如添加、删除或修改文件,都会写到这个可写层。对这一层所做的所有修改都存储在下一层,是基础层和 Diff 层的 _union_ 视图。 + * Diff 层包含了在 Overlay 层所作的所有修改。如果你写的东西已经在基础层了,那么 Overlay 文件系统就会把文件复制到 Diff层,并做出你想写的修改。这被称为_写时复制_。 + + + +# SnapShotters + +容器可以使用层和图形驱动程序构建、管理和分发更改作为其容器文件系统的一部分。。但是使用图形驱动的工作真的很复杂,而且容易出错。SnapShotters 与图形驱动不同,因为它们不了解镜像或容器。 + +Snapshotters 的工作方式与 Git 非常相似,比如有树的概念,并跟踪每次提交对树的改变。一个_快照_代表一个文件系统状态。快照有父子关系,使用一组目录。可以在父级和其快照之间进行 _diff_,以创建一个层。 + +Snapshotter 提供了一个用于分配、快照和挂载抽象的分层文件系统的 API。 + +### 总结 + +你现在对什么是容器镜像以及它们的分层方法如何使容器可移植有了很好的认识。接下来,我将介绍容器的运行机制和内部结构。 + +* * * + +_本文基于 [techbeatly][4] 的文章,经许可后改编。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/container-image + +作者:[Nived V][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/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 184cb1f62062b2e4ee97678031d5215e515b7811 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 6 Sep 2021 08:51:22 +0800 Subject: [PATCH 0261/1588] translated --- sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md index 4b1d7195ad..5426cce22e 100644 --- a/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md +++ b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-dropbox-ubuntu/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 118f11c15a25e580eaf2146bce0f99ed31e15800 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Sep 2021 08:59:46 +0800 Subject: [PATCH 0262/1588] PRF @perfiffer --- ...xt on your screen in Linux with ncurses.md | 54 +++++++++---------- 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md b/translated/tech/20210829 Position text on your screen in Linux with ncurses.md index acaf808c82..5fb564e1e0 100644 --- a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md +++ b/translated/tech/20210829 Position text on your screen in Linux with ncurses.md @@ -3,19 +3,20 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 使用 ncurses 在你的 Linux 屏幕上定位文本 ====== -使用 ncurses 在 Linux 屏幕上的特定位置放置文本,可以带来更友好的用户界面体验。 -![Person using a laptop][1] -大多数的 Linux 实用程序仅仅只在屏幕的底部滚动文本。如果你想在屏幕中放置你的文本,例如一个游戏或者一个数据展示,你可以试试 **ncurses**。 +> 使用 ncurses 在 Linux 屏幕上的特定位置放置文本,可以带来更友好的用户界面体验。 -**curses** 是一个旧的 Unix 库,它可以在文本终端界面控制光标。curses 的名称就来自于术语 cursor control。多年以后,其他人编写了新的 **curses** 版本用来添加新的功能,新版本被叫做 new curses 或者 **ncurses**。你可以在每个流行的 Linux 发行版中找到 ncurses。尽管默认情况下可能未安装开发库、头文件和文档。例如,在 Fedora 上,你需要使用以下命令安装 **ncurses-devel** 包: +![](https://img.linux.net.cn/data/attachment/album/202109/06/085908qrdrrv5dru6pcucr.jpg) +大多数的 Linux 实用程序仅仅只在屏幕的底部滚动文本。如果你想在屏幕中放置你的文本,例如一个游戏或者一个数据展示,你可以试试 ncurses。 + +curses 是一个旧的 Unix 库,它可以在文本终端界面控制光标。curses 的名称就来自于术语 “光标控制cursor control”。多年以后,其他人编写了新的 curses 版本用来添加新的功能,新版本被叫做 “new curses” 或者 “ncurses”。你可以在每个流行的 Linux 发行版中找到 ncurses。尽管默认情况下可能未安装开发库、头文件和文档。例如,在 Fedora 上,你需要使用以下命令安装 `ncurses-devel` 包: ``` $ sudo dnf install ncurses-devel @@ -23,37 +24,37 @@ $ sudo dnf install ncurses-devel ### 在程序中使用 ncurses -要在屏幕上直接寻址,你首先需要初始化 **ncurses** 库。大部分程序会通过以下三行来做到这一点: +要在屏幕上直接寻址,你首先需要初始化 `ncurses` 库。大部分程序会通过以下三行来做到这一点: - * initscr(); 初始化窗口对象和 ncurses 代码,返回代表整个屏幕的窗口对象 - * cbreak(); 禁用缓冲并使键入的输入立即可用 - * noecho(); 关闭回显,因此用户输入不会显示在屏幕上 + * `initscr()`:初始化窗口对象和 ncurses 代码,返回代表整个屏幕的窗口对象 + * `cbreak()`:禁用缓冲并使键入的输入立即可用 + * `noecho()`:关闭回显,因此用户输入不会显示在屏幕上 - -这些函数定义在 **curses.h** 头文件中,你需要在你的程序中通过以下方式将其包含进来: +这些函数定义在 `curses.h` 头文件中,你需要在你的程序中通过以下方式将其包含进来: ``` #include ``` -初始化终端后,你可以自由使用任何 **ncurses** 函数,我们将在示例程序中探讨其中的一些函数。 +初始化终端后,你可以自由使用任何 ncurses 函数,我们将在示例程序中探讨其中的一些函数。 -当你使用完 **ncurses** 并想返回到常规终端模式下时,使用 **endwin();** 重置一切。此命令可以重置任何屏幕颜色,将光标移动到屏幕的左下角,并使光标可见。通常在退出程序之前执行此操作。 +当你使用完 ncurses 并想返回到常规终端模式下时,使用 `endwin()` 重置一切。此命令可以重置任何屏幕颜色,将光标移动到屏幕的左下角,并使光标可见。通常在退出程序之前执行此操作。 ### 在屏幕上寻址 -关于 **ncurses** 首先需要知道的是屏幕的坐标分为行和列,左上角的是 0,0 点。**ncurses** 定义了两个全局变量来帮助你识别屏幕:LINES 是屏幕的行数,COLS 是屏幕的列数。屏幕右下角的位置是 LINES-1,COLS-1。 -例如,如果你想要移动光标到第 10 行和第 30 列,你可以使用移动函数,移动到此坐标: +关于 ncurses 首先需要知道的是屏幕的坐标分为行和列,左上角的是 `0,0` 点。ncurses 定义了两个全局变量来帮助你识别屏幕:`LINES` 是屏幕的行数,`COLS` 是屏幕的列数。屏幕右下角的位置是 `LINES-1,COLS-1`。 + +例如,如果你想要移动光标到第 10 行和第 30 列,你可以使用 `move()` 函数,移动到此坐标: ``` move(10, 30); ``` -之后显示的任何文本都将从屏幕的该位置开始。要显示单个字符,请对单个字符使用 **addch(c)** 函数。要显示字符串,将对字符串使用 **addstr(s)** 函数。对于类似于 **printf** 的格式化输出,请使用带有常用选项的 **printw(fmt, …)**。 +之后显示的任何文本都将从屏幕的该位置开始。要显示单个字符,请对单个字符使用 `addch(c)` 函数。要显示字符串,将对字符串使用 `addstr(s)` 函数。对于类似于 `printf` 的格式化输出,请使用带有常用选项的 `printw(fmt, ...)`。 -移动到屏幕指定位置和显示文本是一件很常见的事情,**ncurses** 提供了同时执行这两项操作的快捷方式。**mvaddch(row, col, c)** 函数将在屏幕第 row 行,第 col 列的位置显示一个字符。而 **mvaddstr(row, col, s)** 函数将在屏幕第 row 行,第 col 列的位置显示一个字符串。更直接的例子,在程序中使用 **mvaddstr(10, 30, "Welcome to ncurses");** 函数将从屏幕的第 10 行和第 30 列开始显示文本 "Welcome to ncurses"。使用 **mvaddch(0, 0, '+');** 函数将在屏幕的左上角第 0 行和第 0 列处显示一个加号。 +移动到屏幕指定位置和显示文本是一件很常见的事情,ncurses 提供了同时执行这两项操作的快捷方式。`mvaddch(row, col, c)` 函数将在屏幕第 `row` 行,第 `col` 列的位置显示一个字符。而 `mvaddstr(row, col, s)` 函数将在屏幕第 `row` 行,第 `col` 列的位置显示一个字符串。举个更直接的例子,在程序中使用 `mvaddstr(10, 30, "Welcome to ncurses");` 函数将从屏幕的第 `10` 行和第 `30` 列开始显示文本 `Welcome to ncurses`。使用 `mvaddch(0, 0, '+')` 函数将在屏幕的左上角第 `0` 行和第 `0` 列处显示一个加号(`+`)。 -在终端屏幕上绘制文本会对某些系统产生性能影响,尤其是在较旧的硬件终端上。因此 **ncurses** 允许你“堆叠”一堆文本以显示在屏幕上,然后使用 **refresh()** 函数使所有这些更改对用户可见。 +在终端屏幕上绘制文本会对某些系统产生性能影响,尤其是在较旧的硬件终端上。因此 ncurses 允许你“堆叠”一堆文本以显示在屏幕上,然后使用 `refresh()` 函数使所有这些更改对用户可见。 让我们来看一个将以上所有内容整合在一起的简单示例: @@ -78,27 +79,27 @@ main() } ``` -程序的开始初始化了一个终端窗口,然后在屏幕的左上角打印了一个加号,在左下角打印了一个减号,在第 10 行和第 30 列打印了 “press any key to quit” 文本。程序通过使用 getch() 函数接收了键盘输入的单个字符,接着,使用 **endwin()** 函数在程序完全退出前重置了终端。 +程序的开始初始化了一个终端窗口,然后在屏幕的左上角打印了一个加号,在左下角打印了一个减号,在第 `10` 行和第 `30` 列打印了 `press any key to quit` 文本。程序通过使用 `getch()` 函数接收了键盘输入的单个字符,接着,使用 `endwin()` 函数在程序完全退出前重置了终端。 -**getch()** 是一个很有用的函数,你可以使用它来做很多事情。我经常使用它在我退出程序前用来暂停。与大多数 **ncurses** 函数一样,还有一个名为 **mvgetch(row, col)** 的 **getch()** 版本,用于在等待字符输入之前移动到屏幕位置的第 row 行,第 col 列。 +`getch()` 是一个很有用的函数,你可以使用它来做很多事情。我经常使用它在我退出程序前用来暂停。与大多数 ncurses 函数一样,还有一个名为 `mvgetch(row, col)` 的 `getch()` 版本,用于在等待字符输入之前移动到屏幕位置的第 `row` 行,第 `col` 列。 ### 使用 ncurses 编译 -如果你尝试以通常的方式编译该示例程序,例如 `gcc pause.c`,你可能会从链接器中获得大量错误列表。那是因为 GNU C 编译器不会自动链接 **ncurses** 库。相反,你需要使用 `-l ncurses` 命令行选项加载它以进行链接。 +如果你尝试以通常的方式编译该示例程序,例如 `gcc pause.c`,你可能会从链接器中获得大量错误列表。那是因为 GNU C 编译器不会自动链接 `ncurses` 库。相反,你需要使用 `-l ncurses` 命令行选项加载它以进行链接。 ``` $ gcc -o pause pause.c -lncurses ``` -运行新程序将打印一条简单的 “press any key to quit” 消息,该消息差不多位于屏幕中央: +运行新程序将打印一条简单的 `press any key to quit`消息,该消息差不多位于屏幕中央: ![centered message in a program window][2] -图 1:程序中居中的 “press any key to quit” 消息。 +*图 1:程序中居中的 “press any key to quit” 消息。* ### 使用 ncurses 构建更好的程序 -探索 **ncurses** 库函数以了解在屏幕上显示文本的其它方法。你可以在 ncurses 的 man 手册页中找到所有 **ncurses** 函数的列表。这给出了 **ncurses** 的一般概述,并提供了不同 **ncurses** 函数的类似表格的列表,并参考了包含完整详细信息的手册页。例如,在 curs_printw(3X) 手册页中描述了 **printw**,您可以通过以下方式查看: +探索 `ncurses` 库函数以了解在屏幕上显示文本的其它方法。你可以在 `ncurses` 的手册页中找到所有 `ncurses` 函数的列表。这给出了 ncurses 的一般概述,并提供了不同 `ncurses` 函数的类似表格的列表,并参考了包含完整详细信息的手册页。例如,在 `curs_printw(3X)` 手册页中描述了 `printw`,可以通过以下方式查看: ``` $ man 3x curs_printw @@ -106,12 +107,11 @@ $ man 3x curs_printw 更简单点: - ``` $ man curs_printw ``` -使用 **ncurses**,你可以创建更多有趣的程序。通过在屏幕上的特定位置打印文本,你可以创建在终端中运行的游戏和高级实用程序。 +使用 ncurses,你可以创建更多有趣的程序。通过在屏幕上的特定位置打印文本,你可以创建在终端中运行的游戏和高级实用程序。 -------------------------------------------------------------------------------- @@ -120,7 +120,7 @@ via: https://opensource.com/article/21/8/ncurses-linux 作者:[Jim Hall][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 c05741da04b54a008d05d74432785534e331e032 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 6 Sep 2021 09:00:23 +0800 Subject: [PATCH 0263/1588] PUB @perfiffer https://linux.cn/article-13756-1.html --- ...0829 Position text on your screen in Linux with ncurses.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210829 Position text on your screen in Linux with ncurses.md (98%) diff --git a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md b/published/20210829 Position text on your screen in Linux with ncurses.md similarity index 98% rename from translated/tech/20210829 Position text on your screen in Linux with ncurses.md rename to published/20210829 Position text on your screen in Linux with ncurses.md index 5fb564e1e0..7e1d61b25f 100644 --- a/translated/tech/20210829 Position text on your screen in Linux with ncurses.md +++ b/published/20210829 Position text on your screen in Linux with ncurses.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13756-1.html" 使用 ncurses 在你的 Linux 屏幕上定位文本 ====== From ac7622da423ae247ffeb335a64f20632b7f84b59 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Mon, 6 Sep 2021 18:41:48 +0800 Subject: [PATCH 0264/1588] translated by perfiffer --- ...ite a guessing game in ncurses on Linux.md | 164 ------------------ ...ite a guessing game in ncurses on Linux.md | 158 +++++++++++++++++ 2 files changed, 158 insertions(+), 164 deletions(-) delete mode 100644 sources/tech/20210830 Write a guessing game in ncurses on Linux.md create mode 100644 translated/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 deleted file mode 100644 index 5be4fe1be9..0000000000 --- a/sources/tech/20210830 Write a guessing game in ncurses on Linux.md +++ /dev/null @@ -1,164 +0,0 @@ -[#]: 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: "perfiffer" -[#]: 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 diff --git a/translated/tech/20210830 Write a guessing game in ncurses on Linux.md b/translated/tech/20210830 Write a guessing game in ncurses on Linux.md new file mode 100644 index 0000000000..978348b8ac --- /dev/null +++ b/translated/tech/20210830 Write a guessing game in ncurses on Linux.md @@ -0,0 +1,158 @@ +[#]: 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: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +通过 ncurses 在 Linux 上写一个猜谜游戏 +====== +使用 ncurses 的灵活性和强大功能在 Linux 上创建一个猜数字游戏。 +![question mark in chalk][1] + +在我的[上一篇文章][2],我简要介绍了使用 ncurses 库通过 C 语言编写文本模式交互式应用程序。使用 `ncurses`,我们可以控制文本在终端上的显示位置和方式。如果你通过阅读手册页探索 `ncurses` 库函数,你会发现有很多不同的方式来显示文本,包括粗体文本、颜色、闪烁文本、窗口、边框、图形字符和其它功能,这些都可以使你的应用脱颖而出。 + +如果你想探索一个更高级的程序来演示其中一些有趣的功能,这里有一个简单的“猜数字”游戏,已更新为使用 `ncurses`。该程序在一个范围内选择一个随机数,然后要求用户进行重复猜测,直到他们猜到秘密数字。当用户进行猜测时,程序会告知他们猜测的数字是太低还是太高。 + +请注意,程序限定可能的数字范围是 0 到 7。将值保持在有限的个位数数字范围内,可以更轻松的使用 `getch()` 函数从用户读取单个数字。我还使用了 `getrandom` 内核系统调用来生成随机数,设定数字最大值为 7,以从 0 (二进制 0000)到 7 (二进制0111)中选择一个随机数。 + +``` +#include ; +#include ;          /* for strlen */ +#include ;      /* 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 */ +} +``` + +通过使用 `ncurses`,我们可以增加一些有趣的视觉体验。通过添加函数,我们可以在屏幕顶部显示重要的文本信息,在屏幕底部显示状态消息行。 + +``` +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(); +} +``` + +通过这些函数,我们就可以构建猜数字游戏的主要部分。首先,程序为 `ncurses` 设置终端,然后从 0 到 7 中选择一个随机数。显示数字刻度后,程序启动一个循环,询问用户的猜测。 + +当用户进行猜测时,程序会在屏幕上提供反馈。如果猜测太低,程序会在屏幕上的数字下方打印一个左方括号。如果猜测太高,程序会在屏幕上的数字下方打印一个右方括号。这有助于用户缩小他们的选择范围,直到他们猜出正确的数字。 + +``` +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; +} +``` + +复制这个程序,自己尝试编译它。不要忘记你需要告诉 GCC 编译器链接到 `ncurses` 库: + +``` +$ gcc -o guess guess.c -lncurses +``` +我留下了一个调试行,所以你可以看到屏幕右上角附近的秘密数字: + +![guess number game interface][3] + +图1:猜数字游戏。注意右上角的秘密数字。 + +### 开始使用 ncurses + +该程序使用了 `ncurses` 的许多其它功能,你可以从这些功能开始。例如,`print_header` 函数在屏幕顶部居中以粗体文本打印消息,`print_status` 函数在屏幕左下角以反向文本打印消息。使用它来帮助你开始使用 `ncurses` 编程。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/guess-number-game-ncurses-linux + +作者:[Jim Hall][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/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://linux.cn/article-13756-1.html +[3]: https://opensource.com/sites/default/files/guessnumber07.png From 5aa8c30040fd607e78fc011a8d0a6bfbdfd7b8bf Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Sep 2021 05:03:08 +0800 Subject: [PATCH 0265/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210907?= =?UTF-8?q?=20Run=20Web=20Applications=20in=20Linux=20Using=20Tangram=20Br?= =?UTF-8?q?owser?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md --- ...ications in Linux Using Tangram Browser.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md diff --git a/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md new file mode 100644 index 0000000000..36e7b67827 --- /dev/null +++ b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md @@ -0,0 +1,93 @@ +[#]: subject: "Run Web Applications in Linux Using Tangram Browser" +[#]: via: "https://itsfoss.com/tangram/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Run Web Applications in Linux Using Tangram Browser +====== + +_**Brief:** Tangram is a browser that aims to help you run and manage web applications in Linux_. _Let’s take a look at how it works._ + +Even if we have native Linux applications available for several tools, many end up using web applications. + +Maybe in the form of an electron app or directly through a web browser, native experiences are becoming an old-school thing. + +Of course, running web applications, no matter the platform, needs more system resources. And, considering every service is going for a web-based approach instead of a native experience, we need solutions to manage the web apps efficiently. + +An open-source Linux app, Tangram, could be the solution. + +### Tangram: A Browser Tailored to Run Web Applications + +![][1] + +You can choose to use some of the [best Linux web browsers][2] to run web applications. But, if you want something that entirely focuses on web application experience, Tangram is an exciting option. + +The developer took inspiration from GNOME Web, [Franz][3], and [Rambox][4]. + +You do not get any fancy features but just the ability to change the user agent and manage the web applications you have logged in to. + +It can be used to access multiple social media platforms, chat messengers, work collaboration applications, and more. + +### Features of Tangram + +![][5] + +Considering it is a minimal browser based on WebKitGTK, not much you can do here. To list some of the essentials, here’s what you can do: + + * Re-order tabs in the sidebar + * Easily add any web service as a web app + * Ability to tweak the user agent (Desktop/mobile) + * Keyboard shortcuts + * Change position of the sidebar (tab bar) + + + +All you need to do is load up a web service, log in, and click on “**Done**” to add it as a web application. + +![][6] + +### Installing Tangram in Linux + +Tangram is available as a Flatpak for every Linux distribution, and you can also find it in [AUR][7]. + +If you want to install it via the terminal, type in the following command: + +``` +flatpak install flathub re.sonny.Tangram +``` + +You may refer to our [Flatpak guide][8] if you do not have it enabled on your system. + +To explore more about it, you can check out its [GitHub page][9]. + +[Tangram Browser][10] + +Have you tried this yet? Do you prefer web applications or native applications? Feel free to share your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/tangram/ + +作者:[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/09/tangram-web-app-browser.png?resize=800%2C611&ssl=1 +[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[3]: https://itsfoss.com/franz-messaging-app/ +[4]: https://itsfoss.com/rambox/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-settings.png?resize=530%2C290&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-whatsapp.png?resize=800%2C431&ssl=1 +[7]: https://itsfoss.com/aur-arch-linux/ +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://github.com/sonnyp/Tangram +[10]: https://flathub.org/apps/details/re.sonny.Tangram From 889dbd148d07c14aaaee017487f305fc46ddccd8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Sep 2021 05:03:25 +0800 Subject: [PATCH 0266/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210907?= =?UTF-8?q?=20How=20to=20Stop=20a=20Program=20in=20Linux=20Terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210907 How to Stop a Program in Linux Terminal.md --- ...How to Stop a Program in Linux Terminal.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20210907 How to Stop a Program in Linux Terminal.md diff --git a/sources/tech/20210907 How to Stop a Program in Linux Terminal.md b/sources/tech/20210907 How to Stop a Program in Linux Terminal.md new file mode 100644 index 0000000000..0db2f82279 --- /dev/null +++ b/sources/tech/20210907 How to Stop a Program in Linux Terminal.md @@ -0,0 +1,97 @@ +[#]: subject: "How to Stop a Program in Linux Terminal" +[#]: via: "https://itsfoss.com/stop-program-linux-terminal/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Stop a Program in Linux Terminal +====== + +It’s amusing how the simplest of the things could be complicated when you are new to something. + +The other day, I found my friend could not figure out how to exit the top command. Instead of stopping the command, he closed the entire terminal application. + +That’s not only unnecessary, it is a not good thing to do. + +### Stopping programs in Linux + +In Linux, you can use the Ctrl+C keys to stop a running program in the terminal. This works for Ubuntu as well as any other Linux distribution. + +Take the ping command for example. If you do not stop it, it will keep on displaying the result. + +Hold the Ctrl button and press the C key at the same time. It sends the [SIGKILL signal][1] to the running program to force quit the command. + +![Stopping a program in the Linux terminal][2] + +Do you see the ^C? The caret (^) means Ctrl. So basically, the terminal shows the Ctrl+C keystrokes as ^C. + +The Ctrl+C works very well for the commands that are designed to keep on running until interrupted. You feel like you have to cancel the command, use Ctrl+C. + +In a more complicated method, you can [find the process ID and kill a running process][3]. That’s more advanced stuff and used only when the process is running in the background or by another user or in another terminal window. + +Apart from that, there are some other commands and command line tools that have their own exit commands. Let me briefly mention some of them here. + +#### How to exit Vim editor + +[Existing Vim editor][4] has made so many jokes in the Linux world. It is difficult to figure out when you are new to this powerful command line based text editor. Among several ways of quitting vim, the most common is to press the Esc key and then type a colon (:) and then type `q!` for force quit without save or `wq` for save and quit. + +![][5] + +#### How to exit Nano editor + +Quitting the [Nano editor][6] is a bit simpler than exiting Vim. Why? Because Nano mentions the shortcut at the bottom. You may not understand it if you are new to it but at least you’ll be able to figure it out the next time. + +To exit Nano, press Ctrl+X. It will ask if you want to save the changes made to the file or not. You can enter your choice. + +![][7] + +#### How to exit less command + +The less is a wonderful command that lets you view without cluttering your terminal screen like the cat command. If you are inside the less command view, use the key `q` to exit less. + +#### How to exit the terminal + +To exit the terminal itself, instead of closing the terminal, either use Ctrl+D keyboard shortcut or type the exit command: + +``` +exit +``` + +This actually exists you from the current shell. When you [open a terminal in Ubuntu][8] or any other Linux distribution, it runs the default shell. When you exit from this shell, terminal ends as well. Ctrl+D is the shortcut to do the same and quit the terminal. + +I hope you find this quick tutorial helpful. I highly recommend learning these [Linux command tips][9]. + +**Recommended Read:** + +![][10] + +#### [21 Super Handy Linux Command Tips and Tricks That Will Save you a lot of Time and Increase Your Productivity][9] + +Questions or suggestions? Please leave a comment below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/stop-program-linux-terminal/ + +作者:[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://linuxhandbook.com/sigterm-vs-sigkill/#what-is-sigkill +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/stop-a-program-linux-terminal.png?resize=800%2C373&ssl=1 +[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ +[4]: https://itsfoss.com/how-to-exit-vim/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/05/how-to-exit-vim.png?resize=737%2C422&ssl=1 +[6]: https://itsfoss.com/nano-editor-guide/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-save-and-exit.png?resize=799%2C503&ssl=1 +[8]: https://itsfoss.com/open-terminal-ubuntu/ +[9]: https://itsfoss.com/linux-command-tricks/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/linux-command-tips.png?fit=800%2C450&ssl=1 From df523ed538630a8c8ccf5e2b56d1cb593a8a5946 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Sep 2021 05:03:44 +0800 Subject: [PATCH 0267/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210906?= =?UTF-8?q?=20Learn=20everything=20about=20computers=20with=20this=20Raspb?= =?UTF-8?q?erry=20Pi=20kit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md --- ...ut computers with this Raspberry Pi kit.md | 148 ++++++++++++++++++ 1 file changed, 148 insertions(+) create mode 100644 sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md diff --git a/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md b/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md new file mode 100644 index 0000000000..21f2f6e1f0 --- /dev/null +++ b/sources/tech/20210906 Learn everything about computers with this Raspberry Pi kit.md @@ -0,0 +1,148 @@ +[#]: subject: "Learn everything about computers with this Raspberry Pi kit" +[#]: via: "https://opensource.com/article/21/9/raspberry-pi-crowpi2" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Learn everything about computers with this Raspberry Pi kit +====== +The CrowPi is an amazing Raspberry Pi project system housed in a +laptop-like body. +![Teacher or learner?][1] + +I like history, and I like computers, so I enjoy hearing stories about computing before computers were an everyday household appliance, much less a personal accessory. [One tale I hear often][2] is about how the computers of long ago (in computer years, anyway) were pleasantly basic. They were so basic, in fact, that it was relatively trivial for a curious user to figure out how to program one. Looking at modern computers, with object-oriented programming languages, complex GUI frameworks, network APIs, containers, and more, there's genuine concern that the tools of the computing trade have become essentially inaccessible to anyone without specialized training. + +From the day the Raspberry Pi was released in 2012, it has always been intended as an educational platform. Several third-party vendors support the Pi with add-ons and training kits to help learners of all ages explore programming, physical computing, and open source. However, until recently, it's largely been up to the user to figure out how all the pieces on the market fit together. And then I got a CrowPi. + +![CrowPi more than a laptop][3] + +The CrowPi is not a laptop. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +### Introducing the CrowPi2 + +Crows are surprisingly intelligent birds. They recognize and remember faces, mimic sounds they've heard, solve complex puzzles, and even use tools to accomplish a task. It's fitting that the CrowPi uses the crow as its logo and namesake because this device is packed with opportunities for exploration, experimentation, education, and, best of all, fun. + +The design itself is clever: It looks like a laptop, but it's much more than that. When you lift the Bluetooth keyboard from the case, it reveals a hidden electronics workshop, complete with an LCD screen, 16 buttons, dials, RFID sensor, proximity sensor, breadboard, speakers, GPIO connections, a LED array, and much more. _And it's all programmable._ + +As its name implies, the unit itself is powered entirely by a Raspberry Pi, securely fastened within the underside of the case. + +![crowpi pi board][5] + +The CrowPi Pi board. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +By default, you're meant to power the unit with a power adapter, and it ships with a wall adapter that you can plug into the case rather than powering the Pi directly. You can also use a battery supply plugged into an external micro-USB port. There's even a drawer built into the case so you can store your battery pack. When you do this, there's a USB cable popping out of the battery drawer and into the case power port, so there's no illusion that this is a "normal" laptop. However, with a device like this, that's pretty much the desired aesthetic! + +### First boot + +The CrowPi2 ships with Raspbian installed on a microSD card labeled **System**, although it includes a second microSD card loaded with [RetroPie][6], too. Being a responsible adult, I booted RetroPie first, naturally. + +RetroPie is always fun, and the CrowPi2 ships with two SNES-style game controllers to ensure you have the optimal retro gaming experience. + +Booting to the actual system is, amazingly, just as fun and arguably more so. The login manager is a custom project hub with quick links to sample coding projects, the Python and Arduino IDEs, Scratch, sample Python games, Minecraft, and more. You can also choose to exit the project hub and just use the desktop. + +![CrowPi hub][7] + +The CrowPi Hub. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +The desktop is familiar to anyone used to the Raspberry Pi or Linux in general, but it's basic enough that it's easy to learn, too. There's an application menu in the top left, shortcut icons on the desktop, a system tray for network selection and volume control in the top right, and so on. + +![CrowPi Desktop][8] + +The CrowPi Desktop. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +There's so much available on the CrowPi that it might be difficult to decide where to start. For me, there were four broad categories: Programming, physical electronics, Linux, and gaming. + +There's an instruction manual in the box, so you know what you need to connect (for instance, the keyboard is battery-powered, so it does need charging sometimes, and it and the mouse always require a USB dongle). It's a quick read, though, and just one of the many examples of how seriously the CrowPi team takes documentation. + +![CrowPi Docs][9] + +The CrowPi Docs. +(Seth Kenlon, [CC BY-SA 4.0][4]) + +### Programming + +If you're keen to learn how to code, there are many paths to success on the CrowPi. You should take the path that you find the most satisfying. + +#### 1\. Scratch + +[Scratch][10] is a simple visual coding application that lets you make games and interactive stories using code blocks that fit together like [Lego pieces][11]. It's the easiest way to begin coding, and I've seen kids as young as eight spend hours puzzling over the optimal algorithm for a game of their own design. Of course, it's not only great for kids! Adults can have a lot of fun with it, too. Not sure where to start? There's a 99-page booklet (printed on actual paper) in the box with Scratch lessons and projects for you to try. + +#### 2\. Java and Minecraft + +Minecraft is not open source (although there are [several open source projects][12] that reimplement it), but there's enough source available that it's often used to teach programming. Minecraft was written in Java, and the CrowPi ships with both [Minecraft Pi Edition][13] and the [BlueJ Java IDE][14] to make learning Java easier and more fun than ever. + +#### 3\. Python and PyGame + +There are several really fun games on the CrowPi that were written in Python and the [PyGame game engine][15]. You can play the games and then look at the source code to find out how the game works. The Geany, Thonny, and [Mu][16] editors are included on the CrowPi, so you can start programming in Python right away. As with Scratch, there's a booklet in the box with lessons so you can learn Python basics. + +### Electronics + +The physical electronics workshop concealed under the keyboard is essentially an array of Pi Hats. The whole thing is mapped out on a fold-out diagram in both English and Chinese so that you can identify all the components. There are plenty of sample projects to get you started. Here's a small list: + + * **Hello** prints "hello" on the LCD screen when you speak to the CrowPi. + * **Intrusion alarm** sounds an alarm using the proximity sensor. + * **Remote controller** enables you to use a remote control (yes, this too is included in the box) to trigger events on the CrowPi. + * **RGB Tetris** lets you play a game of Tetris on an LED display. + * **Voice recognition** demonstrates natural language processing. + * **Ultrasonic music** creates a rudimentary Theramin using distance sensors and a speaker. + + + +Those projects are just the beginning because you can build upon what exists. There's more to explore, of course. Patch cables, resistors, LEDs, and all sorts of components are included in the box so that you can learn all about the Pi's GPIO capabilities at your leisure. + +One problem: The location of the sample projects is a little difficult to find. It's easy to find the demos (they're on the CrowPi hub screen), but the location of the source code isn't immediately obvious. It turns out that most of the sample projects are in `/usr/share/code`, which you can reach either through the file manager or a terminal. + +![CrowPi Peripherals][17] + +The CrowPi Peripherals +(Seth Kenlon, [CC BY-SA 4.0][4]) + +### Linux + +The Raspberry Pi runs Linux. If you've been meaning to learn more about Linux, the CrowPi is a great platform for that, too. You can explore the desktop, the terminal, and nearly any Linux or open source application you can find. If you've been reading about open source for years and are ready to dive into an open source OS, this could be a platform for that (and much more, obviously). + +### Gaming + +The **RetroPie** SD card included in the box means you can reboot into a retro game console and play any number of old-school arcade games. It's not exactly a Steam Deck, but it's a fun and inspiring little gaming platform. Because it comes with not one but two game controllers, it's ideal for couch co-op. And best of all, you not only can play games on the CrowPi, but you can make your own games, too. + +### Screwdriver included + +I got to sit down with the CrowPi2 for about two weeks, and I've barely been able to get through all of the projects. There have been many nights when I've had to force myself to step away from it because even after I've tired of one project, I inevitably find something else to explore. To sum it up, I found one component in particular in the box, and I immediately knew that the CrowPi and I were well suited to one another: It was a small, humble screwdriver. There's no voiding of warranty stickers here. The CrowPi wants you to tinker, to take things apart, explore, and learn. This isn't a laptop or even just a Pi; this is a portable, low-powered, diverse, and open source learner's toolkit. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/raspberry-pi-crowpi2 + +作者:[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/osdc-lead-teacher-learner.png?itok=rMJqBN5G (Teacher or learner?) +[2]: https://opensource.com/article/21/8/my-first-programming-language +[3]: https://opensource.com/sites/default/files/crowpi-not-laptop.jpeg (CrowPi more than a laptop) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/crowpi-pi.jpeg (crowpi pi board) +[6]: https://opensource.com/article/19/1/retropie +[7]: https://opensource.com/sites/default/files/crowpi-hub.png (CrowPi hub) +[8]: https://opensource.com/sites/default/files/crowpi-desktop.png (CrowPi desktop) +[9]: https://opensource.com/sites/default/files/crowpi-docs.jpeg (CrowPi docs) +[10]: https://opensource.com/article/20/9/scratch +[11]: https://opensource.com/article/20/6/open-source-virtual-lego +[12]: https://opensource.com/alternatives/minecraft +[13]: https://www.minecraft.net/en-us/edition/pi +[14]: https://opensource.com/article/20/7/ide-java#bluej +[15]: https://opensource.com/downloads/python-gaming-ebook +[16]: https://opensource.com/article/18/8/getting-started-mu-python-editor-beginners +[17]: https://opensource.com/sites/default/files/crowpi-peripherals.jpeg (CrowPi peripherals) From 12518ef11e447768e9a5380d49c707be64f51b67 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 7 Sep 2021 05:03:59 +0800 Subject: [PATCH 0268/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210906?= =?UTF-8?q?=20Resize=20an=20image=20from=20the=20Linux=20terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210906 Resize an image from the Linux terminal.md --- ...Resize an image from the Linux terminal.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/tech/20210906 Resize an image from the Linux terminal.md diff --git a/sources/tech/20210906 Resize an image from the Linux terminal.md b/sources/tech/20210906 Resize an image from the Linux terminal.md new file mode 100644 index 0000000000..a5d0764687 --- /dev/null +++ b/sources/tech/20210906 Resize an image from the Linux terminal.md @@ -0,0 +1,81 @@ +[#]: subject: "Resize an image from the Linux terminal" +[#]: via: "https://opensource.com/article/21/9/resize-image-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Resize an image from the Linux terminal +====== +Shrink an image from your terminal with the ImageMagick convert command. +![Old camera blue][1] + +ImageMagick is a handy multipurpose command-line tool for all your image needs. ImageMagick supports a variety of image types, including JPG photos and PNG graphics. + +### Resizing images + +I often use ImageMagick on my webserver to resize images. For example, let's say I want to include a photo of my cats on my personal website. The photo from my phone is very large, about 4000x3000 pixels, at 3.3MB. That's much too large for a web page. I use the ImageMagick convert tool to change the size of my photo so that I can include it on my web page. ImageMagick is a full suite of tools, one of the most common is the `convert` command. + +The ImageMagick `convert` command uses this general syntax: + + +``` +`convert {input} {actions} {output}` +``` + +To resize a photo called `PXL_20210413_015045733.jpg` to a more manageable 500-pixel width, type this: + + +``` +`$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg` +``` + +The new image is now only 65KB in size.  + +![Sleeping cats][2] + +Jim Hall, [CC BY-SA 4.0][3] + +You can provide both width and height dimensions with the `-resize` option. But, by providing only the width, ImageMagic does the math for you and automatically retains the aspect ratio by resizing the output image with a proportional height. + +### Install ImageMagick on Linux + +On Linux, you can install ImageMagick using your package manager. For instance, on Fedora or similar: + + +``` +`$ sudo dnf install imagemagick` +``` + +On Debian and similar: + + +``` +`$ sudo apt install imagemagick` +``` + +On macOS, use [MacPorts][4] or [Homebrew][5]. + +On Windows, use [Chocolatey][6]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/resize-image-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/osdc-photo-camera-blue.png?itok=AsIMZ9ga (Old camera blue) +[2]: https://opensource.com/sites/default/files/sleeping-cats.jpg (Sleeping cats) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey From dcd0f4d4086f4b09a1fe36de323aef462fdf5ffd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 08:25:58 +0800 Subject: [PATCH 0269/1588] PRF @unigeorge --- ...essential Linux commands for every user.md | 72 ++++++++++--------- 1 file changed, 37 insertions(+), 35 deletions(-) diff --git a/translated/tech/20210901 20 essential Linux commands for every user.md b/translated/tech/20210901 20 essential Linux commands for every user.md index 65eb1115a2..619ae0b1a7 100644 --- a/translated/tech/20210901 20 essential Linux commands for every user.md +++ b/translated/tech/20210901 20 essential Linux commands for every user.md @@ -3,24 +3,26 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -用户必会的 20 个 Linux 命令 +用户必会的 20 个 Linux 基础命令 ====== -无论新手老手,这 20 个 Linux 命令都能让你的操作更轻松。 -![Command line prompt][1] -在黝黑的终端窗口中输入命令,这样的方式对某些人群来说可能好像过时了,但对许多专业计算机用户来说,这几乎是计算机完成能够执行的所有任务的最有效、最简便和最清晰的方式。如今,一些项目将开源命令引入了 macOS 和 Windows 等非开放平台,因此终端命令不仅仅是针对 Linux 和 BSD 用户,更是与每个人都息息相关。你可能会惊讶地发现,在一台普通的 [POSIX][2] 计算机上安装了数千个命令,当然,其中很多命令并不是真的有用,至少不是直接或定期性被使用。而其中的一部分命令虽然不是有效终端必须使用的命令,但相比其他命令而言使用频率较高,值得大家学习一下。 +> 无论新手老手,这 20 个 Linux 命令都能让你的操作更轻松。 + +![](https://img.linux.net.cn/data/attachment/album/202109/07/082525n7amf7gejo16zaxx.jpg) + +在黝黑的终端窗口中输入命令,这样的方式对某些人群来说可能好像过时了,但对许多专业计算机人员来说,这几乎是计算机完成能够执行的所有任务的最有效、最简便和最清晰的方式。如今,一些项目将开源命令引入了 macOS 和 Windows 等非开放平台,因此终端命令不仅仅是针对 Linux 和 BSD 用户,更是与每个人都息息相关。你可能会惊讶地发现,在一台普通的 [POSIX][2] 计算机上安装了数千个命令,当然,其中很多命令并不是真的有用,至少不是直接或经常性被使用。而其中的一部分命令虽然不是有效终端必须使用的命令,但相比其他命令而言使用频率较高,值得大家学习一下。 以下是终端用户最可能会使用的前 20 个命令: ### cd -在终端外,你可以单击图标从一个文件夹移动到另一个文件夹,但在终端中,你需要使用 `cd`。`cd` 命令代表 _change directory_(变更目录),是用户在 Linux 系统中移动的方式。这是 Linux 中从一个地方到另一个地方最快、最直接的路线。 +在终端外,你可以单击图标从一个文件夹移动到另一个文件夹,但在终端中,你需要使用 `cd`。`cd` 命令代表变更目录change directory,是用户在 Linux 系统中移动的方式。这是 Linux 中从一个地方到另一个地方最快、最直接的路线。 -例如,在桌面上,当你想从你的主目录(你保存所有文件夹的地方)移动到一个名为 `presentations` 的文件夹时,你首先要打开你的 `Documents` 文件夹,然后打开一个名叫 `work` 的文件夹,然后是 `projects` 文件夹,然后是`conference` 文件夹,最后是 `presentations` 文件夹,里面存放的是 LibreOffice Impress 幻灯片。这个过程包含了很多次的双击操作。同时屏幕上还需要许多移动动作,这取决于新窗口出现的位置,以及大脑需要跟踪的许多路径点。许多人通过将 _所有文件_ 都放在桌面上来避免这个看似微不足道的任务。 +例如,在桌面上,当你想从你的主目录(你保存所有文件夹的地方)移动到一个名为 `presentations` 的文件夹时,你首先要打开你的 `Documents` 文件夹,然后打开一个名叫 `work` 的文件夹,然后是 `projects` 文件夹,然后是 `conference` 文件夹,最后是 `presentations` 文件夹,里面存放的是 LibreOffice Impress 幻灯片。这个过程包含了很多次的双击操作。同时屏幕上还需要许多鼠标移动动作,这取决于新窗口出现的位置,以及大脑需要跟踪的许多路径点。许多人通过将 _所有文件_ 都放在桌面上来避免这个看似微不足道的任务。 而终端用户只需键入以下内容即可避免此问题: @@ -28,7 +30,7 @@ $ cd ~/Documents/work/projects/conference/presentations ``` -一些有经验的终端用户甚至都懒得输入所有这些,而是使用 **Tab** 键自动完成单词填充。更甚者,有时你都不必依赖自动完成,而是改用通配符: +一些有经验的终端用户甚至都懒得输入所有这些,而是使用 `Tab` 键自动完成单词填充。更甚者,有时你都不必依赖自动完成,而是改用通配符: ``` $ cd ~/Doc*/work/*/conf*/p* @@ -38,7 +40,7 @@ $ cd ~/Doc*/work/*/conf*/p* 用 Buckaroo Banzai 的话来说:“无论你走到哪里,你就在那里。” -当你想弄清楚确切位置时,就可以使用 `pwd` 命令。`pwd` 代表 _print working directory_(打印工作目录),这正是它的作用。`--physical`(在某些情况时缩写为 `-P`)显示解析所有符号链接后的确切位置。 +当你想弄清楚确切位置时,就可以使用 `pwd` 命令。`pwd` 代表打印工作目录print working directory,这正是它的作用。`--physical`(在某些情况时缩写为 `-P`)显示解析所有符号链接后的确切位置。 ``` $ pwd @@ -50,11 +52,11 @@ $ pwd --physical ### sed -流编辑器 `sed` 更广为人知的是一个强大的批量 _查找和替换_ 命令,但它同时也是一个合法的文本编辑器。你可以通过阅读我的 [介绍性文章][3] 来学习使用它,然后通过我的 [高级教程和备忘录][4] 成为老手。 +流编辑器 `sed` 更广为人知的是一个强大的批量 _查找和替换_ 命令,但它同时也是一个正当合理的文本编辑器。你可以通过阅读我的 [介绍性文章][3] 来学习使用它,然后通过我的 [高级教程和备忘录][4] 成为老手。 ### grep -`grep` 命令使用很普遍,以至于经常被用作动词(例如“我会通过一些文件 grep”)和动名词(例如“grep 一些输出”)。无论是查看日志文件还是解析其他命令的输出,它都是在 shell 中解析文本时的关键组件。这是忙碌的用户专注于特定信息的一种方式。考虑一下计算世界中的数据量,grep 命令的流行就见怪不怪了。你可以通过阅读我的 [介绍性文章][5] 了解 grep,然后下载 [备忘录][6] 学习。 +`grep` 命令使用很普遍,以至于经常被用作动词(例如 “我会对一些文件进行 grep”)和动名词(例如 “grep 一些输出”)。无论是查看日志文件还是解析其他命令的输出,它都是在 shell 中解析文本时的关键组件。这是忙碌的用户专注于特定信息的一种方式。考虑一下计算世界中的数据量,`grep` 命令的流行就见怪不怪了。你可以通过阅读我的 [介绍性文章][5] 了解 `grep`,然后下载 [备忘录][6] 学习。 ### file @@ -68,17 +70,17 @@ $ file example.bar example.bar: ELF 64-bit LSB executable, x86-64 [...] ``` -当然,`file` 命令并不神奇。它不过是根据文件如何识别自身进行输出,并且文件可能是错误的、损坏的或伪装的。使用 [`hexdump`][7] 进行严格检查的方式确定性更强,但对于日常使用而言,`file` 命令非常方便。 +当然,`file` 命令并不神奇。它只不过是根据文件如何标识自身而进行输出的,并且文件可能是错误的、损坏的或伪装的。使用 [hexdump][7] 进行严格检查的方式确定性更强,但对于日常使用而言,`file` 命令非常方便。 ### awk -awk 不仅仅是一个命令,它还是一种文字 [编程语言][8]。[点此下载我们的免费 Awk 电子书][9] 进行学习,你可能会写出远超你想象的脚本。 +`awk` 不仅仅是一个命令,它还是一种字面意义上的 [编程语言][8]。[点此下载我们的免费 Awk 电子书][9] 进行学习,你可能会写出远超你想象的脚本。 ### curl -`curl` 命令是用于终端的 [非交互式 Web 浏览器][10]。它是面向 Web 和 API 开发人员的 [开发工具][11]。因为灵活性,它是一个复杂的命令,但如果你想从你的终端顺利地与网络服务交互,该命令是很值得学习的。 +`curl` 命令是用于终端的 [非交互式 Web 浏览器][10]。它是面向 Web 和 API 开发人员的 [开发工具][11]。它是一个复杂灵活的命令,但如果你想从你的终端顺利地与 Web 服务交互,该命令是很值得学习的。 -下载我们免费的 [`curl` 备忘录][12],你可以从中学会 `curl` 的许多选项。 +下载我们免费的 [curl 备忘录][12],你可以从中学会 `curl` 的许多选项。 ### ps @@ -86,22 +88,22 @@ awk 不仅仅是一个命令,它还是一种文字 [编程语言][8]。[点此 ### cat -[`cat` 命令][14] 是 _concatenate_(连接)的缩写,它曾因为能将由于大小限制而被(使用 `split` 命令)拆分成的若干小文件合并而非常有用。如今,`cat` 主要是用来将文本文件的内容转储到终端中以供快速阅读,除非你为此专门去使用 `head`、`tail`、`more` 或 `less` 等命令。 +[cat 命令][14] 是连接concatenate的缩写,它曾因为能将若干小文件合并而显得非常有用,这些小文件可能是由于大小限制而(使用 `split` 命令)拆分的。如今,`cat` 主要是用来将文本文件的内容转储到终端中以供快速阅读,除非你为此专门去使用 `head`、`tail`、`more` 或 `less` 等命令。 -尽管它的原始用途几乎已被弃用,并且其他几个命令也主要是执行其次要功能,但 `cat` 仍然是一个有用的工具。例如,它可以是复制 (`cp`) 命令的替代品: +尽管它的原始用途几乎已被弃用,并且其他几个命令也主要提供了其次要功能,但 `cat` 仍然是一个有用的工具。例如,它可以是复制(`cp`)命令的替代品: ``` $ cat myfile.ogg > /backups/myfile.ogg ``` -它可以显示文件中不便观察的隐形字符。例如,使用 `--show-tabs` 选项,分割 [YAML][15] 的 **Tab** 字符就会显示为 `^I`: +它可以显示文件中不便观察的隐形字符。例如,使用 `--show-tabs` 选项,分割 [YAML][15] 的 `Tab` 字符就会显示为 `^I`: ``` $ cat --show-tabs my.yaml -\--- +--- -\- hosts: all +- hosts: all   tasks:   - name: Make sure the current version of 'sysstat' is installed.     dnf: @@ -116,9 +118,9 @@ $ cat --show-tabs my.yaml ### find -`find` 命令可以用来查找文件,但它还有许多选项,这些选项可以帮助你查找具有各种过滤器和参数的文件。读者可以从我的 [介绍性文章][16] 中学习该命令的基础知识。 +`find` 命令可以用来查找文件,但它还有许多选项,这些选项可以帮助你通过各种过滤器和参数查找文件。读者可以从我的 [介绍性文章][16] 中学习该命令的基础知识。 -如果你一直想知道为什么最基本的,不起眼的 [`ls` 命令][17],不在本文列表中,那是因为 `find` 的灵活性。它不仅可以找到列表文件: +如果你一直想知道为什么最基本的、不起眼的 [ls 命令][17],不在本文列表中,那是因为 `find` 的灵活性。它不仅可以列表文件: ``` $ find . @@ -142,43 +144,43 @@ $ find . -ls ### tar -人们有时会引用 BSD 的 `tar` 语法来拿 Linux 命令开玩笑。尽管广为人赞,但 `tar` 命令实际上非常直观。读者可以阅读我的 [如何解压缩 tar.gz 文件][18] 文章,了解按需使用 `tar` 命令的简单知识。 +人们有时会引用 BSD 的 `tar` 语法来拿 Linux 命令开玩笑。尽管有这样的名声,但 `tar` 命令实际上非常直观。读者可以阅读我的 [如何解压缩 tar.gz 文件][18] 文章,了解在需要时使用 `tar` 命令的简单知识。 -### more or less or most +### more、less 和 most -这些统称为 pager 命令。pager 命令与 `cat` 类似,但前者会在屏幕底部暂停输出,直到你向下滚动查看更多内容。这些命令比较简单,但每个之间都有细微差别。用户是用箭头键还是空格键滚动?是必须手动退出,还是在显示的文件末尾自动退出?用户的首选搜索行为是什么样的?选择你最喜欢的 pager 命令并将其设置在 `.bashrc` 中吧! +这些统称为分页命令。分页命令与 `cat` 类似,但前者会在屏幕底部暂停输出,直到你向下滚动查看更多内容。这些命令比较简单,但每个之间都有细微差别。用户是用箭头键还是空格键滚动?是必须手动退出,还是在显示的文件末尾自动退出?用户的首选搜索行为是什么样的?选择你最喜欢的分页命令并将其设置在 `.bashrc` 中吧! -### ssh and scp +### ssh 和 scp -OpenSSH 不仅有助于保护与远程系统的连接安全,还可以用于启用其他命令。例如,对于许多用户来说,有了 `.ssh` 目录,他们才能与 Git 存储库顺利交互、将更新发布到网站、登录云控制平面。 +OpenSSH 不仅有助于保护与远程系统的连接安全,还可以用于启用其他命令。例如,对于许多用户来说,有了 `.ssh` 目录,他们才能与 Git 存储库顺利交互、将更新发布到网站、登录云控制平台。 ### mv -`mv` 命令有双重作用:它既 [移动文件][19] 又 [重命名文件][20]。它有几个可用的保护措施,例如 `--interactive` 和 `--no-clobber` 选项避免破坏现有文件,`--backup` 命令确保数据在新位置验证之前被保留,以及 `--update` 选项确保旧版本不会替换新版本文件。 +`mv` 命令有双重作用:它既可以 [移动文件][19] 又可以 [重命名文件][20]。它有几个可用的保护措施,例如 `--interactive` 和 `--no-clobber` 选项避免破坏现有文件,`--backup` 命令确保数据在新位置验证之前被保留,以及 `--update` 选项确保旧版本不会替换新版本文件。 ### sudo -当某个用户账户的用户名已知,且具有 _全部_ 系统权限时,该用户很快就会成为黑客攻击的目标。`sudo` 命令消除了对字面上 `root` 用户的需求,从而优雅地移除了有关系统的重要信息。不过这还不是全部,使用 `sudo` 你还可以轻松地将权限管理到单个命令、用户和组。你可以启用选择命令的无密码执行、记录用户会话、使用摘要验证验证命令,[以及更多操作][21]。 +当某个用户账户的用户名已知,且具有 _全部_ 系统权限时,该用户很快就会成为黑客攻击的目标。`sudo` 命令消除了对字面上 `root` 用户的需求,从而优雅地移除了有关系统的重要信息。不过这还不是全部,使用 `sudo` 你还可以轻松地管理单个命令、用户和组的权限。你可以在选定的命令上启用无密码执行、记录用户会话、使用摘要验证来验证命令,[等等][21]。 ### alias 使用 `alias` 命令将长命令变成易于记忆的快捷方式: ``` -`$ alias ls='ls --classify --almost-all --ignore-backups --color'` +$ alias ls='ls --classify --almost-all --ignore-backups --color' ``` ### clear -有时终端会显得很混乱,输入 `clear`(或在某些 shell 中按 **Ctrl+L**)后,你就能得到漂亮、全新的屏幕了。 +有时终端会显得很混乱,输入 `clear`(或在某些 shell 中按 `Ctrl+L`)后,你就能得到漂亮、刷新的屏幕了。 ### setfacl -传统上,POSIX 文件权限由 `chown` 和 `chmod` 决定。然而,如今系统变得更加复杂,因此有一个灵活性更高的命令。`setfacl` 命令允许创建一个 [访问控制列表 (ACL)][22],可以配置任意用户所需权限,并可以为文件夹及其中创建的内容设置默认权限。 +传统上,POSIX 文件权限由 `chown` 和 `chmod` 决定。然而,如今系统变得更加复杂,因此有一个灵活性更高的命令。`setfacl` 命令允许创建一个 [访问控制列表(ACL)][22],可以配置任意用户所需权限,并可以为文件夹及其中创建的内容设置默认权限。 ### netcat -可能需要使用 netcat (`nc`) 的人不多,但这些使用人对它的依赖度会很高。`nc` 命令是一个通用的网络连接工具。 +可能需要使用 `netcat`(`nc`)的人不多,但这些使用它的人确离不开它。`nc` 命令是一个通用的网络连接工具。 它可以连接到一个端口,类似于 `telnet` 命令: @@ -202,7 +204,7 @@ $ nc -zv 192.168.0.12 25-80 ### 你自己构建的命令 -在某种程度上,Linux 终端是关于创造性解决问题的平台。当你学习命令时,你也在学习可用于创建自己的命令的构造块。我的 [shell history][23] 中的许多命令都是自己编写的 shell 脚本,从而我实现了根据自己想要的工作方式定制工作流程。你为自己的效率和舒适度而设计的命令也可以作为 shell 中的基本命令。花些时间了解一些很棒的命令,然后试着构建自己的命令吧。当你构建出的命令非常好用时,把它开源,这样就可以与他人分享你的想法啦! +在某种程度上,Linux 终端是一个创造性解决问题的平台。当你学习命令时,你也在学习可用于创建自己的命令的组块。我的 [shell 历史][23] 中的许多命令都是自己编写的 shell 脚本,从而实现了根据自己想要的工作方式定制工作流程。你为自己的效率和舒适度而设计的命令也可以作为 shell 中的基本命令。花些时间了解一些很棒的命令,然后试着构建自己的命令吧。当你构建出的命令非常好用时,把它开源,这样就可以与他人分享你的想法啦! -------------------------------------------------------------------------------- @@ -211,7 +213,7 @@ via: https://opensource.com/article/21/9/essential-linux-commands 作者:[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 645917ce915e6bda3e654ec4ab310d56f35b564e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 08:26:42 +0800 Subject: [PATCH 0270/1588] PUB @unigeorge https://linux.cn/article-13759-1.html --- .../20210901 20 essential Linux commands for every user.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210901 20 essential Linux commands for every user.md (99%) diff --git a/translated/tech/20210901 20 essential Linux commands for every user.md b/published/20210901 20 essential Linux commands for every user.md similarity index 99% rename from translated/tech/20210901 20 essential Linux commands for every user.md rename to published/20210901 20 essential Linux commands for every user.md index 619ae0b1a7..61ef6c4baf 100644 --- a/translated/tech/20210901 20 essential Linux commands for every user.md +++ b/published/20210901 20 essential Linux commands for every user.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13759-1.html" 用户必会的 20 个 Linux 基础命令 ====== From ac1623ec9eae55be8add19337e460c5f7e8481c5 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 Sep 2021 08:41:36 +0800 Subject: [PATCH 0271/1588] translated --- .../20210901 What are container runtimes.md | 97 ------------------- .../20210901 What are container runtimes.md | 96 ++++++++++++++++++ 2 files changed, 96 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20210901 What are container runtimes.md create mode 100644 translated/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 deleted file mode 100644 index 56f3b32fe8..0000000000 --- a/sources/tech/20210901 What are container runtimes.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: 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: "geekpi" -[#]: 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 diff --git a/translated/tech/20210901 What are container runtimes.md b/translated/tech/20210901 What are container runtimes.md new file mode 100644 index 0000000000..be42d2f766 --- /dev/null +++ b/translated/tech/20210901 What are container runtimes.md @@ -0,0 +1,96 @@ +[#]: 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: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +什么是容器运行时? +====== +深入了解容器运行时,你就可以理解容器环境是如何建立的。 +![Ships at sea on the web][1] + +在对[容器镜像][2]的检查中,我讨论了容器的基本原理,但现在是时候深入研究容器运行时了,这样你就可以了解容器环境是如何构建的。本文的部分信息摘自 Open Container Initiative (OCI)(容器的开放标准)的[官方文档][3],所以无论你的容器引擎如何,这些信息都是相关的。 + +### 容器运行机制 + +那么,当你运行 `podman run` 或 `docker run` 命令时,在后台到底发生了什么?这里为你提供一个逐步的概述: + + 1. 如果本地没有镜像,则从镜像注册处拉取镜像 + 2. 镜像被提取到一个写时拷贝的文件系统上,所有的容器层相互叠加以创建一个合并的文件系统 + 3. 准备一个容器挂载点 + 4. 从容器镜像中设置元数据,包括诸如覆盖 CMD、来自用户输入的 ENTRYPOINT、设置 SECCOMP 规则等设置,以确保容器按预期运行 + 5. 提醒内核为该容器分配某种隔离,如进程、网络和文件系统(命名空间) + 6. 内核还被提醒为这个容器分配一些资源限制,如 CPU 或内存限制(cgroups) + 7. 一个系统调用(syscall)被传递给内核以启动容器 + 8. 设置 SELinux/AppArmor + + + +容器运行时负责上述所有的工作。当我们想到容器运行时,想到的可能是 runc、lxc、containerd、rkt、cri-o 等等。嗯,你没有错。这些都是容器引擎和容器运行时,每一种都是为不同的情况建立的。 + +_容器运行时_更侧重于运行容器,为容器设置命名空间和 cgroups,也被称为底层容器运行时。高层的容器运行时或容器引擎专注于格式、解包、管理和镜像共享。它们还为开发者提供 API。 + +### Open Container Initiative (OCI) + +Open Container Initiative(OCI)是一个 Linux 基金会项目。其目的是设计某些开放标准或围绕如何与容器运行时和容器镜像格式工作的结构。它是由 Docker、rkt、CoreOS 和其他行业领导者于 2015 年 6 月建立的。 + +它使用两个规范来做这件事: + +#### 1\. 镜像规范(image-spec) + +该规范的目标是创建可互操作的工具,用于构建、传输和准备运行的容器镜像。 + +该规范的高层组件包括: + + * [Image Manifest][4] — 一个描述构成容器镜像的元素的文件 + * [Image Index][5] — 镜像清单的注释索引 + * [Image Layout][6] — 一个代表镜像内容的文件系统布局 + * [Filesystem Layer][7] — 一个描述容器文件系统的变化集 + * [Image Configuration][8] — 确定镜像层排序和配置的文件,适合转换成[运行时包][9]。 + * [Conversion][10] — 解释应该如何进行转换的文件 + * [Descriptor][11] — 一个描述被引用内容的类型、元数据和内容地址的参考资料 + + + +#### 2\. 运行时规范(runtime-spec) + +该规范旨在定义容器的配置、执行环境和生命周期。config.json 文件为所有支持的平台提供了容器配置,并详细说明了能够创建容器的地方。执行环境与为容器的生命周期定义的通用操作一起被详细说明,以确保在容器内运行的应用在不同的运行时之间有一个一致的环境。 + +Linux 容器规范使用了各种内核功能,包括命名空间、cgroups、capabilities、LSM 和文件系统监牢来实现该规范。 + +### 现在你知道了 + +容器运行时是由 OCI 规范管理的,以提供一致性和互操作性。许多人在使用容器时不需要了解它们是如何工作的,但当你需要排除故障或优化使用方法时,了解容器是一个宝贵的优势。 + +* * * + +_本文基于 [techbeatly][12] 的文章,并经授权改编。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/container-runtimes + +作者:[Nived V][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/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 e3aeba76dd829e53839753a79b7be88b160dd10b Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 7 Sep 2021 08:45:58 +0800 Subject: [PATCH 0272/1588] translating --- .../tech/20210906 Resize an image from the Linux terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210906 Resize an image from the Linux terminal.md b/sources/tech/20210906 Resize an image from the Linux terminal.md index a5d0764687..ed603fbb16 100644 --- a/sources/tech/20210906 Resize an image from the Linux terminal.md +++ b/sources/tech/20210906 Resize an image from the Linux terminal.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/resize-image-linux" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 0ffab936ebc97158ab8ddef2e383cc232cb22dc3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 15:48:57 +0800 Subject: [PATCH 0273/1588] APL --- .../20210902 4 Linux technologies fundamental to containers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210902 4 Linux technologies fundamental to containers.md b/sources/tech/20210902 4 Linux technologies fundamental to containers.md index 8875b5bf95..aedc4320ef 100644 --- a/sources/tech/20210902 4 Linux technologies fundamental to containers.md +++ b/sources/tech/20210902 4 Linux technologies fundamental to containers.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/container-linux-technology" [#]: author: "Nived V https://opensource.com/users/nivedv" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From f99e968175e53e83fd7554f926850aa9f84b6a76 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 16:29:21 +0800 Subject: [PATCH 0274/1588] TSL --- ... technologies fundamental to containers.md | 152 -------------- ... technologies fundamental to containers.md | 192 ++++++++++++++++++ 2 files changed, 192 insertions(+), 152 deletions(-) delete mode 100644 sources/tech/20210902 4 Linux technologies fundamental to containers.md create mode 100644 translated/tech/20210902 4 Linux technologies fundamental to containers.md diff --git a/sources/tech/20210902 4 Linux technologies fundamental to containers.md b/sources/tech/20210902 4 Linux technologies fundamental to containers.md deleted file mode 100644 index aedc4320ef..0000000000 --- a/sources/tech/20210902 4 Linux technologies fundamental to containers.md +++ /dev/null @@ -1,152 +0,0 @@ -[#]: subject: "4 Linux technologies fundamental to containers" -[#]: via: "https://opensource.com/article/21/8/container-linux-technology" -[#]: author: "Nived V https://opensource.com/users/nivedv" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -4 Linux technologies fundamental to containers -====== -Namespaces, cgroups, seccomp, and SELinux are the Linux technologies -that make up the foundations of building and running a container process -on your system. -![Penguin driving a car with a yellow background][1] - -In previous articles, I have written about [container images][2] and [runtimes][3]. In this article, I look at how containers are made possible by a foundation of some special Linux technologies, including namespaces and control groups. - -![layers of linux technologies][4] - -Figure 1: Linux technologies that contribute to containers -(Nived Velayudhan, [CC BY-SA 4.0][5]) - -Linux technologies make up the foundations of building and running a container process on your system. Technologies include: - - 1. Namespaces - 2. Control groups (cgroups) - 3. Seccomp - 4. SELinux - - - -### Namespaces - -_Namespaces_ provide a layer of isolation for the containers by giving the container a view of what appears to be its own Linux filesystem. This limits what a process can see and therefore restricts the resources available to it. - -There are several namespaces in the Linux kernel that are used by Docker or Podman and others while creating a container: -  - - -``` -$ docker container run alpine ping 8.8.8.8 -$ sudo lsns -p 29413 -        NS TYPE   NPROCS PID USER COMMAND -4026531835 cgroup   299   1  root /usr/lib/systemd/systemd -- -switched... -4026533105 mnt 1 29413 root ping 8.8.8.8 -4026533106 uts 1 29413 root ping 8.8.8.8 -4026533105 ipc 1 29413 root ping 8.8.8.8 -[...] -``` - -#### **User** - -The user namespace isolates users and groups within a container. This is done by allowing containers to have a different view of UID and GID ranges compared to the host system. The user namespace enables the software to run inside the container as the root user. If an intruder attacks the container and then escapes to the host machine, they're confined to only a non-root identity. - -#### **Mnt** - -The mnt namespace allows the containers to have their own view of the system's file system hierarchy. You can find the mount points for each container process in the _/proc/<PID>/mounts_ location in your Linux system. - -#### **UTS** - -The Unix Timesharing System (UTS) namespace allows containers to have a unique hostname and domain name. When you run a container, a random ID is used as the hostname even when using the `— name` tag. You can use the [`unshare` command][6] to get an idea of how this works. - - -``` -$ docker container run -it --name nived alpine sh -/ # hostname -9c9a5edabdd6 -/ # -$ sudo unshare -u sh -# hostname isolated.hostname -# hostname -# exit -$ hostname -homelab.redhat.com -``` - -#### **IPC** - -The Inter-Process Communication (IPC) namespace allows different container processes to communicate by accessing a shared range of memory or using a shared message queue. -  - - -``` -# ipcmk -M 10M -Shared memory id: 0 -# ipcmk -M 20M -Shared memory id: 1 -# ipcs -\---- Message Queues ---- -key  msqid  owner  perms  used-bytes  messages - -\---- Shared Memory Segments -key        shmid owner perms bytes    nattch status -0xd1df416a 0     root  644   10485760 0 -0xbd487a9d 1     root  644   20971520 0 -[...] -``` - -#### **PID** - -The Process ID (PID) namespace ensures that the processes running inside a container are isolated from the external world. When you run a `ps` command inside a container, you only see the processes running inside the container and not on the host machine because of this namespace. - -#### **Net** - -The network namespace allows the container to have its own view of network interface, IP addresses, routing tables, port numbers, and so on. How does a container able to communicate to the external world? All containers you create get attached to a special virtual network interface for communication. - -### Control groups (cgroups) - -Cgroups are fundamental blocks of making a container. A cgroup allocates and limits resources such as CPU, memory, network I/O that are used by containers. The container engine automatically creates a cgroup filesystem of each type, and sets values for each container when the container is run. - -### SECCOMP - -Seccomp basically stands for _secure computing_. It is a Linux feature used to restrict the set of system calls that an application is allowed to make. The default seccomp profile for Docker, for example, disables around 44 syscalls (over 300 are available). - -The idea here is to provide containers access to only those resources which the container might need. For example, if you don't need the container to change the clock time on your host machine, you probably have no use for the _clock_adjtime_ and _clock_settime_ syscalls, and it makes sense to block them out. Similarly, you don't want the containers to change the kernel modules, so there is no need for them to make _create_module, delete_module_ syscalls. - -### SELinux - -SELinux stands for _security-enhanced Linux_. If you are running a Red Hat distribution on your hosts, then SELinux is enabled by default. SELinux lets you limit an application to have access only to its own files and prevent any other processes from accessing them. So, if an application is compromised, it would limit the number of files that it can affect or control. It does this by setting up contexts for files and processes and by defining policies that would enforce what a process can see and make changes to. - -SELinux policies for containers are defined by the `container-selinux` package. By default, containers are run with the **container_t** label and are allowed to read (r) and execute (x) under the _/usr_ directory and read most content from the _/etc_ directory. The label **container_var_lib_t** is common for files relating to containers. - -### Wrap up - -Containers are a critical part of today's IT infrastructure and a pretty interesting technology, too. Even if your role doesn't involve containerization directly, understanding a few fundamental container concepts and approaches gives you an appreciation for how they can help your organization. The fact that containers are built on open source Linux technologies makes them even better! - -* * * - -_This article is based on a [techbeatly][7] article and has been adapted with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/container-linux-technology - -作者:[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/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) -[2]: https://opensource.com/article/21/8/container-fundamentals-2 -[3]: https://opensource.com/article/21/8/deep-dive-container-runtimes -[4]: https://opensource.com/sites/default/files/1linuxtechs.png (layers of linux technologies) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://opensource.com/article/19/10/namespaces-and-containers-linux -[7]: https://nivedv.medium.com/container-internals-deep-dive-5cc424957413 diff --git a/translated/tech/20210902 4 Linux technologies fundamental to containers.md b/translated/tech/20210902 4 Linux technologies fundamental to containers.md new file mode 100644 index 0000000000..6d15032103 --- /dev/null +++ b/translated/tech/20210902 4 Linux technologies fundamental to containers.md @@ -0,0 +1,192 @@ +[#]: subject: "4 Linux technologies fundamental to containers" +[#]: via: "https://opensource.com/article/21/8/container-linux-technology" +[#]: author: "Nived V https://opensource.com/users/nivedv" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +容器的四大基础技术 +====== + +> 命名空间、控制组、seccomp 和 SELinux 构成了在你的系统上构建和运行一个容器进程的 Linux 技术基础。 + +![企鹅驾驶一辆黄色背景的汽车][1] + +在以前的文章中,我介绍过 [容器镜像][2] 及其 [运行时][3]。在这篇文章中,我研究了容器是如何在一些特殊的 Linux 技术基础上实现的,这些技术包括命名空间和控制组。 + +![容器技术的层次][4] + +*图1:对容器有贡献的 Linux 技术(Nived Velayudhan, [CC BY-SA 4.0][5])* + +这些 Linux 技术构成了在系统上构建和运行容器进程的基础: + + 1. 命名空间 + 2. 控制组(cgroups) + 3. Seccomp + 4. SELinux + +### 命名空间 + +命名空间namespace 为容器提供了一个隔离层,给容器提供了一个看起来是它自己的 Linux 文件系统的视图。这就限制了进程所能看到的东西,从而限制了它所能获得的资源。 + +在创建容器时,Docker 或 Podman 和其他容器技术使用了 Linux 内核中的几个命名空间: + +``` +[nivedv@homelab ~]$ docker container run alpine ping 8.8.8.8 +[nivedv@homelab ~]$ sudo lsns -p 29413 + + NS TYPE NPROCS PID USER COMMAND +4026531835 cgroup 299 1 root /usr/lib/systemd/systemd --switched... +4026531837 user 278 1 root /usr/lib/systemd/systemd --switched... +4026533105 mnt 1 29413 root ping 8.8.8.8 +4026533106 uts 1 29413 root ping 8.8.8.8 +4026533107 ipc 1 29413 root ping 8.8.8.8 +4026533108 pid 1 29413 root ping 8.8.8.8 +4026533110 net 1 29413 root ping 8.8.8.8 +``` +#### 用户 + +用户(`user`)命名空间将用户和组隔离在一个容器内。这是通过允许容器与宿主系统有不同的 UID 和 GID 范围来实现的。用户命名空间使软件能够以 root 用户的身份在容器内运行。如果入侵者攻击容器,然后逃逸到宿主机上,他们就受限于只能以非 root身份出现了。 + +#### 挂载 + +挂载(`mnt`)命名空间允许容器对系统的文件系统层次结构有自己的视图。你可以在 Linux 系统中的 `/proc//mounts` 位置找到每个容器进程的挂载点。 + +#### UTS + +Unix 分时系统Unix Timeharing System(UTS)命名空间允许容器有一个唯一的主机名和域名。当你运行一个容器时,即使使用 `- name` 标签,也会使用一个随机的 ID 作为主机名。你可以使用 [unshare 命令][6] 来了解一下这个工作原理。 + +``` +nivedv@homelab ~]$ docker container run -it --name nived alpine sh +/ # hostname +9c9a5edabdd6 +/ # +nivedv@homelab ~]$ sudo unshare -u sh +sh-5.0# hostname isolated.hostname +sh-5.0# hostname +isolated.hostname +sh-5.0# +sh-5.0# exit +exit +[nivedv@homelab ~]$ hostname +homelab.redhat.com +``` + +#### IPC + +进程间通信Inter-Process Communication(IPC)命名空间允许不同的容器进程通过访问共享内存或使用共享消息队列来进行通信。 + +``` +[root@demo /]# ipcmk -M 10M +Shared memory id: 0 +[root@demo /]# ipcmk -M 20M +Shared memory id: 1 +[root@demo /]# +[root@demo /]# ipcs +------ Message Queues -------- +key msqid owner perms used-bytes messages +------ Shared Memory Segments -------- +key shmid owner perms bytes nattch status +0xd1df416a 0 root 644 10485760 0 +0xbd487a9d 1 root 644 20971520 0 +------ Semaphore Arrays -------- +key semid owner perms nsems +``` + +#### PID + +进程 IDProcess ID(PID)命名空间确保在容器内运行的进程与外部世界隔离。当你在容器内运行 `ps` 命令时,由于这个命名空间的存在,你只能看到在容器内运行的进程,而不是在宿主机上。 + +#### 网络 + +网络(`net`)命名空间允许容器对网络接口、IP 地址、路由表、端口号等有自己的视图。容器如何能够与外部世界沟通?你创建的所有容器都会被附加到一个特殊的虚拟网络接口上进行通信。 + +``` +[nivedv@homelab ~]$ docker container run --rm -it alpine sh +/ # ping 8.8.8.8 +PING 8.8.8.8 (8.8.8.8): 56 data bytes +64 bytes from 8.8.8.8: seq=0 ttl=119 time=21.643 ms +64 bytes from 8.8.8.8: seq=1 ttl=119 time=20.940 ms +^C +[root@homelab ~]# ip link show veth84ea6fc +veth84ea6fc@if22: mtu 1500 qdisc noqueue +master docker0 state UP mode DEFAULT group default +``` + +### 控制组 + +控制组(`cgroup`)是制作一个容器的基本模块。控制组会分配和限制资源,如 CPU、内存、网络 I/O 等,这些资源被容器所使用。容器引擎会自动创建每种类型的控制组文件系统,并在容器运行时为每个容器设置值。 + +``` +[root@homelab ~]# lscgroup | grep docker +cpuset:/docker +net_cls,net_prio:/docker +cpu,cpuacct:/docker +hugetlb:/docker +devices:/docker +freezer:/docker +memory:/docker +perf_event:/docker +blkio:/docker +pids:/docker +``` + +容器运行时为每个容器设置了控制组值,所有信息都存储在 `/sys/fs/cgroup/*/docker`。下面的命令将确保容器可以使用 50000 微秒的 CPU 时间,并将内存的软、硬限制分别设置为 500M 和 1G。 + +``` +[root@homelab ~]# docker container run -d --name test-cgroups --cpus 0.5 --memory 1G --memory-reservation 500M httpd +[root@homelab ~]# lscgroup cpu,cpuacct:/docker memory:/docker +cpu,cpuacct:/docker/ +cpu,cpuacct:/docker/c3503ac704dafea3522d3bb82c77faff840018e857a2a7f669065f05c8b2cc84 +memory:/docker/ +memory:/docker/c3503ac704dafea3522d3bb82c77faff840018e857a2a7f669065f05c8b2cc84 +[root@homelab c....c84]# cat cpu.cfs_period_us +100000 +[root@homelab c....c84]# cat cpu.cfs_quota_us +50000 +[root@homelab c....c84]# cat memory.soft_limit_in_bytes +524288000 +[root@homelab c....c84]# cat memory.limit_in_bytes +1073741824 +``` + +### SECCOMP + +Seccomp 意思是“安全计算secure computing”。它是一项 Linux 功能,用于限制应用程序允许进行的系统调用的集合。例如,Docker 的默认 seccomp 配置文件禁用了大约 44 个系统调用(总计超过 300 个)。 + +这里的思路是让容器只访问容器可能需要的那些资源。例如,如果你不需要容器改变主机上的时钟时间,你可能不会使用 `clock_adjtime` 和 `clock_settime` 系统调用,屏蔽它们是合理的。同样地,你不希望容器改变内核模块,所以没有必要让它们进行 `create_module`、 `delete_module` 系统调用。 + +### SELinux + +SELinux 是“安全增强的 Linuxsecurity-enhanced Linux”的缩写。如果你在你的宿主机上运行的是 Red Hat 发行版,那么 SELinux 是默认启用的。SELinux 可以让你限制一个应用程序只能访问它自己的文件,并阻止任何其他进程访问它们。因此,如果一个应用程序被破坏了,它将限制该应用程序可以影响或控制的文件数量。它通过为文件和进程设置上下文环境以及定义策略来实现这一目的,这些策略将强制执行一个进程可以看到和改变的内容。 + +容器的 SELinux 策略是由 `container-selinux` 包定义的。默认情况下,容器以 `container_t` 标签运行,允许在 `/usr` 目录下读取(`r`)和执行(`x`),并从 `/etc` 目录下读取大部分内容。标签`container_var_lib_t` 是与容器有关的文件的通用标签。 + +### 总结 + +容器是当今 IT 基础设施的一个重要组成部分,也是一项相当有趣的技术。即使你的工作不直接涉及容器化,了解一些基本的容器概念和方法,也能让你体会到它们如何帮助你的组织。容器是建立在开源的 Linux 技术之上的,这使它们变得更加美好。 + +本文基于 [techbeatly][7] 的文章,并经授权改编。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/container-linux-technology + +作者:[Nived V][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/nivedv +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://opensource.com/article/21/8/container-fundamentals-2 +[3]: https://opensource.com/article/21/8/deep-dive-container-runtimes +[4]: https://opensource.com/sites/default/files/1linuxtechs.png (layers of linux technologies) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/article/19/10/namespaces-and-containers-linux +[7]: https://nivedv.medium.com/container-internals-deep-dive-5cc424957413 From 9aaf17df52cdb943ac6b4faa0135c7265a7b83fd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 16:57:40 +0800 Subject: [PATCH 0275/1588] APL --- .../tech/20210804 Apps for daily needs part 3- image editors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210804 Apps for daily needs part 3- image editors.md b/sources/tech/20210804 Apps for daily needs part 3- image editors.md index 437496e3d6..bf7e31a71f 100644 --- a/sources/tech/20210804 Apps for daily needs part 3- image editors.md +++ b/sources/tech/20210804 Apps for daily needs part 3- image editors.md @@ -2,7 +2,7 @@ [#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-3-image-editors/" [#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 8fb539718ec6b7babc8b4ba04248378e65f85f39 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 18:36:39 +0800 Subject: [PATCH 0276/1588] TSL&PRF --- ...s for daily needs part 3- image editors.md | 89 ------------------- ...s for daily needs part 3- image editors.md | 79 ++++++++++++++++ 2 files changed, 79 insertions(+), 89 deletions(-) delete mode 100644 sources/tech/20210804 Apps for daily needs part 3- image editors.md create mode 100644 translated/tech/20210804 Apps for daily needs part 3- image editors.md diff --git a/sources/tech/20210804 Apps for daily needs part 3- image editors.md b/sources/tech/20210804 Apps for daily needs part 3- image editors.md deleted file mode 100644 index bf7e31a71f..0000000000 --- a/sources/tech/20210804 Apps for daily needs part 3- image editors.md +++ /dev/null @@ -1,89 +0,0 @@ -[#]: subject: "Apps for daily needs part 3: image editors" -[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-3-image-editors/" -[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Apps for daily needs part 3: image editors -====== - -![][1] - -Photo by [Brooke Cagle][2] on [Unsplash][3] - -Image editors are applications that are liked and needed by many people, from professional designers, students, or for those who have certain hobbies. Especially in this digital era, more and more people need image editors for various reasons. This article will introduce some of the open source image editors 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 image editors category. - -### GIMP - -GIMP (GNU Image Manipulation Program) is a raster graphics editor used for photo retouching, image composition, and image authoring. It has almost the same functionality as Adobe Photoshop. You can use GIMP to do a lot of the things you can do with Photoshop. Because of that, GIMP has become the most popular application as an open source alternative to Adobe Photoshop. - -GIMP has a lot of features for manipulating images, especially for raster images. You can fix or change the color of your photos using GIMP. You can select a part of the image, crop it, and then merge it with other pieces of the image. GIMP also has many effects that you can apply to your images, including blur, shadow, noise, etc. Many people use GIMP to repair damaged photos, improve image quality, crop unwanted parts of images, create posters and various graphic design works, and much more. Moreover you can also add plugins and scripts in GIMP, making it even more fully featured. - -![][5] - -More information is available at this link: - -* * * - -### Inkscape - -Inkscape is a popular open source application used to create and edit vector graphics. It is a feature-rich vector graphics editor which makes it competitive with other similar proprietary applications, such as Adobe Illustrator and Corel Draw. Because of that, many professional illustrators use it to create vector-based artwork. - -You can use Inkscape for making artistic and technical illustrations, such as logos, diagrams, icons, desktop wallpapers, flowcharts, cartoons, and much more. Moreover, Inkscape can handle various graphic file formats. In addition, you can also add add-ons to make your work easier. - -![][6] - -More information is available at this link: - -* * * - -### Krita - -Krita looks like GIMP or Inkscape at first glance. But actually it is an application that is quite different, although it has some similar functions. Krita is an application for creating digital paintings like those made by artists. You can use Krita for making concept art, illustration, comics, texture, and matte paintings. - -Krita has over 100 professionally made brushes that come preloaded. It also has a brush stabilizer feature with 3 different ways to smooth and stabilize your brush strokes. Moreover, you can customize your brushes with over 9 unique brush engines. Krita is the right application for those of you who like digital painting activities. - -![][7] - -More information is available at this link: - -* * * - -### darktable - -darktable is perfect for photographers or for those who want to improve the quality of their photos. darktable focuses more on image editing specifically on non-destructive post-production of raw images. Therefore, it provides professional color management that supports automatic display profile detection. In addition, you can also use darktable to handle multiple images with filtering and sorting features. So you can search your collections by tags, rating, color labels, and many more. It can import various image formats, such as JPEG, CR2, NEF, HDR, PFM, RAF, etc. - -![][8] - -More information is available at this link: - -* * * - -### Conclusion - -This article presented four image editors as apps for your daily needs that you can use on Fedora Linux. Each application represents a sub-category of image editor applications. Actually there are many other image editors that you can use in Fedora Linux. You can also use RawTherapee or Photivo as a dartkable alternative. In addition there is Pinta as an alternative to GIMP, and MyPaint as an alternative to Krita. Hopefully this article can help you to choose the right image editors. If you have experience in using these applications, please share your experience in the comments. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/apps-for-daily-needs-part-3-image-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-3-Graphics-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/07/image-gimp-1024x576.png -[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-inkscape-1024x575.png -[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-krita-1024x592.png -[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-darktable-1024x583.png diff --git a/translated/tech/20210804 Apps for daily needs part 3- image editors.md b/translated/tech/20210804 Apps for daily needs part 3- image editors.md new file mode 100644 index 0000000000..5f6640fa57 --- /dev/null +++ b/translated/tech/20210804 Apps for daily needs part 3- image editors.md @@ -0,0 +1,79 @@ +[#]: subject: "Apps for daily needs part 3: image editors" +[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-3-image-editors/" +[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +满足日常需求的应用(三):图像编辑器 +====== + +![][1] + +图像编辑器是许多人喜欢和需要的应用程序,从专业的设计师、学生,或那些有某些爱好的人。特别是在这个数字时代,越来越多的人因为各种原因需要图像编辑器。本文将介绍一些你可以在 Fedora Linux 上使用的开源图像编辑器。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章 [安装 Fedora 34 工作站后要做的事情][4]。这里列出了图像编辑器类的一些日常需求的应用程序。 + +### GIMP + +GIMP(GNU 图像处理程序GNU Image Manipulation Program)是一个光栅图像(位图)编辑器,用于照片修饰、图像合成和图像创作。它的功能几乎与 Adobe Photoshop 相同。你可以用 GIMP 做很多你可以用 Photoshop 做的事情。正因为如此,GIMP 作为 Adobe Photoshop 的开源替代品,已经成为最受欢迎的应用程序。 + +GIMP 有很多图像处理的功能,特别是针对光栅图像。你可以用 GIMP 修复或改变照片的颜色。你可以选择图像的一部分,裁剪它,然后与图像的其他部分合并。GIMP 还有许多你可以应用于你的图像的效果,包括模糊、阴影、噪音等等。许多人用 GIMP 来修复损坏的照片,提高图像质量,裁剪图像中不需要的部分,制作海报和各种图形设计作品,等等。此外,你还可以在 GIMP 中添加插件和脚本,使其功能更加全面。 + +![][5] + +更多信息请见此链接:: + +### Inkscape + +Inkscape 是一个流行的开源应用程序,用于创建和编辑矢量图。它是一个功能丰富的矢量图形编辑器,这使它可以与其他类似的专有应用程序(如 Adobe Illustrator 和 Corel Draw)相竞争。正因为如此,许多专业插画师使用它来创建基于矢量的艺术作品。 + +你可以用 Inkscape 制作艺术和技术插图,如标志、图表、图标、桌面壁纸、流程图、漫画等等。此外,Inkscape 可以处理各种图形文件格式。此外,你还可以添加附加组件,使你的工作更容易。 + +![][6] + +更多信息请见此链接: + +### Krita + +Krita 乍一看像 GIMP 或 Inkscape。但实际上,它是一个完全不同的应用程序,尽管它有一些类似的功能。Krita 是一款用于创作像艺术家那样的数字绘画的应用程序。你可以用 Krita 来制作概念艺术、插图、漫画、纹理和哑光画。 + +Krita 有 100 多个预装的专业画笔。它还有一个画笔稳定器功能,有 3 种不同的方式来平滑和稳定你的画笔笔触。此外,你可以用 9 种以上的独特画笔引擎来定制你的画笔。Krita 是那些喜欢进行数字绘画的人的合适应用。 + +![][7] + +更多信息可在此链接获得: + +### darktable + +darktable 是摄影师或那些想提高照片质量的人的完美选择。darktable 更侧重于图像编辑,特别是对 RAW 图像的非破坏性后期制作。因此,它提供专业的色彩管理,支持自动检测显示配置文件。此外,你还可以用 darktable 过滤和排序多张图片。所以你可以通过标签、评级、颜色标签等来搜索你的收藏。它可以导入各种图像格式,如 JPEG、CR2、NEF、HDR、PFM、RAF 等。 + +![][8] + +更多信息可在此链接中获得: + +### 总结 + +这篇文章介绍了四个图像编辑器,你可以在 Fedora Linux 上使用它们满足你日常需求。每个应用程序都代表了图像编辑器应用程序的一个子类别。实际上,还有许多其他的图像编辑器可以在 Fedora Linux 上使用。你也可以使用 RawTherapee 或 Photivo 作为 dartkable 替代品。此外,还有 Pinta 作为 GIMP 的替代品,以及 MyPaint 作为 Krita 的替代品。希望这篇文章能帮助你选择正确的图像编辑器。如果你有使用这些应用程序的经验,请在评论中分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-3-image-editors/ + +作者:[Arman Arisman][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://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/07/FedoraMagz-Apps-3-Graphics-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/07/image-gimp-1024x576.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-inkscape-1024x575.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-krita-1024x592.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/07/image-darktable-1024x583.png From 616147ba82919a8b5f38eb38480bc96f20a4fe01 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 18:40:24 +0800 Subject: [PATCH 0277/1588] PUB @wxy https://linux.cn/article-13761-1.html --- .../20210804 Apps for daily needs part 3- image editors.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210804 Apps for daily needs part 3- image editors.md (98%) diff --git a/translated/tech/20210804 Apps for daily needs part 3- image editors.md b/published/20210804 Apps for daily needs part 3- image editors.md similarity index 98% rename from translated/tech/20210804 Apps for daily needs part 3- image editors.md rename to published/20210804 Apps for daily needs part 3- image editors.md index 5f6640fa57..f23981589d 100644 --- a/translated/tech/20210804 Apps for daily needs part 3- image editors.md +++ b/published/20210804 Apps for daily needs part 3- image editors.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13761-1.html" 满足日常需求的应用(三):图像编辑器 ====== From 473a624c944d5ad0e691e868241b8d79455b916b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E4=B9=9D?= <2220238842@qq.com> Date: Tue, 7 Sep 2021 21:56:21 +0800 Subject: [PATCH 0278/1588] Update 20210907 Run Web Applications in Linux Using Tangram Browser.md --- ...907 Run Web Applications in Linux Using Tangram Browser.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md index 36e7b67827..87110132b8 100644 --- a/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md +++ b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/tangram/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "阿九" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -74,7 +74,7 @@ via: https://itsfoss.com/tangram/ 作者:[Ankush Das][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 053267b57dbe8f2b46c439e1ebd0aa09829ccc74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E4=B9=9D?= <2220238842@qq.com> Date: Tue, 7 Sep 2021 22:20:27 +0800 Subject: [PATCH 0279/1588] Update 20210907 Run Web Applications in Linux Using Tangram Browser.md --- ...10907 Run Web Applications in Linux Using Tangram Browser.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md index 87110132b8..11ea307510 100644 --- a/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md +++ b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/tangram/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: "阿九" +[#]: translator: "anine09" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d8c7608ff9e937f84129b55a2a56e70dfcc308c2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 22:43:41 +0800 Subject: [PATCH 0280/1588] PRF @perfiffer --- ...ite a guessing game in ncurses on Linux.md | 27 ++++++++++--------- 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/translated/tech/20210830 Write a guessing game in ncurses on Linux.md b/translated/tech/20210830 Write a guessing game in ncurses on Linux.md index 978348b8ac..b49e0396b0 100644 --- a/translated/tech/20210830 Write a guessing game in ncurses on Linux.md +++ b/translated/tech/20210830 Write a guessing game in ncurses on Linux.md @@ -3,20 +3,22 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 通过 ncurses 在 Linux 上写一个猜谜游戏 ====== -使用 ncurses 的灵活性和强大功能在 Linux 上创建一个猜数字游戏。 -![question mark in chalk][1] -在我的[上一篇文章][2],我简要介绍了使用 ncurses 库通过 C 语言编写文本模式交互式应用程序。使用 `ncurses`,我们可以控制文本在终端上的显示位置和方式。如果你通过阅读手册页探索 `ncurses` 库函数,你会发现有很多不同的方式来显示文本,包括粗体文本、颜色、闪烁文本、窗口、边框、图形字符和其它功能,这些都可以使你的应用脱颖而出。 +> 使用 ncurses 的灵活性和强大功能在 Linux 上创建一个猜数字游戏。 -如果你想探索一个更高级的程序来演示其中一些有趣的功能,这里有一个简单的“猜数字”游戏,已更新为使用 `ncurses`。该程序在一个范围内选择一个随机数,然后要求用户进行重复猜测,直到他们猜到秘密数字。当用户进行猜测时,程序会告知他们猜测的数字是太低还是太高。 +![](https://img.linux.net.cn/data/attachment/album/202109/07/224224ecchm0t5jbjc1dzy.jpg) -请注意,程序限定可能的数字范围是 0 到 7。将值保持在有限的个位数数字范围内,可以更轻松的使用 `getch()` 函数从用户读取单个数字。我还使用了 `getrandom` 内核系统调用来生成随机数,设定数字最大值为 7,以从 0 (二进制 0000)到 7 (二进制0111)中选择一个随机数。 +在我的 [上一篇文章][2],我简要介绍了使用 ncurses 库通过 C 语言编写文本模式交互式应用程序。使用 ncurses,我们可以控制文本在终端上的显示位置和方式。如果你通过阅读手册页探索 ncurses 库函数,你会发现显示文本有很多不同的方式,包括粗体文本、颜色、闪烁文本、窗口、边框、图形字符和其它功能,这些都可以使你的应用脱颖而出。 + +如果你想探索一个更高级的程序来演示其中一些有趣的功能,有一个简单的“猜数字”游戏,我已更新为使用 ncurses 编写的了。该程序在一个范围内选择一个随机数,然后要求用户进行重复猜测,直到他们猜到这个秘密数字。当用户进行猜测时,程序会告知他们猜测的数字是太低还是太高。 + +请注意,程序限定可能的数字范围是 0 到 7。将值保持在有限的个位数数字范围内,可以更轻松的使用 `getch()` 函数从用户读取单个数字。我还使用了 `getrandom` 内核系统调用来生成随机数,设定数字最大值为 7,以从 0 (二进制 `0000`)到 7 (二进制 `0111`)中选择一个随机数。 ``` #include ; @@ -44,7 +46,7 @@ read_guess() } ``` -通过使用 `ncurses`,我们可以增加一些有趣的视觉体验。通过添加函数,我们可以在屏幕顶部显示重要的文本信息,在屏幕底部显示状态消息行。 +通过使用 ncurses,我们可以增加一些有趣的视觉体验。通过添加函数,我们可以在屏幕顶部显示重要的文本信息,在屏幕底部显示状态消息行: ``` void @@ -72,7 +74,7 @@ print_status(const char *text) } ``` -通过这些函数,我们就可以构建猜数字游戏的主要部分。首先,程序为 `ncurses` 设置终端,然后从 0 到 7 中选择一个随机数。显示数字刻度后,程序启动一个循环,询问用户的猜测。 +通过这些函数,我们就可以构建猜数字游戏的主要部分。首先,程序为 ncurses 设置终端,然后从 0 到 7 中选择一个随机数。显示数字刻度后,程序启动一个循环,询问用户的猜测。 当用户进行猜测时,程序会在屏幕上提供反馈。如果猜测太低,程序会在屏幕上的数字下方打印一个左方括号。如果猜测太高,程序会在屏幕上的数字下方打印一个右方括号。这有助于用户缩小他们的选择范围,直到他们猜出正确的数字。 @@ -125,20 +127,21 @@ main() } ``` -复制这个程序,自己尝试编译它。不要忘记你需要告诉 GCC 编译器链接到 `ncurses` 库: +复制这个程序,自己尝试编译它。不要忘记你需要告诉 GCC 编译器链接到 ncurses 库: ``` $ gcc -o guess guess.c -lncurses ``` + 我留下了一个调试行,所以你可以看到屏幕右上角附近的秘密数字: ![guess number game interface][3] -图1:猜数字游戏。注意右上角的秘密数字。 +*图1:猜数字游戏。注意右上角的秘密数字。* ### 开始使用 ncurses -该程序使用了 `ncurses` 的许多其它功能,你可以从这些功能开始。例如,`print_header` 函数在屏幕顶部居中以粗体文本打印消息,`print_status` 函数在屏幕左下角以反向文本打印消息。使用它来帮助你开始使用 `ncurses` 编程。 +该程序使用了 ncurses 的许多其它函数,你可以从这些函数开始。例如,`print_header` 函数在屏幕顶部居中以粗体文本打印消息,`print_status` 函数在屏幕左下角以反向文本打印消息。使用它来帮助你开始使用 ncurses 编程。 -------------------------------------------------------------------------------- @@ -147,7 +150,7 @@ via: https://opensource.com/article/21/8/guess-number-game-ncurses-linux 作者:[Jim Hall][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 0145df810e5c87ba955eaf759face8928b6107b2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 7 Sep 2021 22:44:32 +0800 Subject: [PATCH 0281/1588] PUB @perfiffer https://linux.cn/article-13762-1.html --- .../20210830 Write a guessing game in ncurses on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210830 Write a guessing game in ncurses on Linux.md (98%) diff --git a/translated/tech/20210830 Write a guessing game in ncurses on Linux.md b/published/20210830 Write a guessing game in ncurses on Linux.md similarity index 98% rename from translated/tech/20210830 Write a guessing game in ncurses on Linux.md rename to published/20210830 Write a guessing game in ncurses on Linux.md index b49e0396b0..581e629460 100644 --- a/translated/tech/20210830 Write a guessing game in ncurses on Linux.md +++ b/published/20210830 Write a guessing game in ncurses on Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13762-1.html" 通过 ncurses 在 Linux 上写一个猜谜游戏 ====== From 77fd0b998be30dd9e364dc6309c9aa0eecb761bd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Sep 2021 05:02:38 +0800 Subject: [PATCH 0282/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210908?= =?UTF-8?q?=20How=20to=20Use=20the=20dd=20Command=20to=20Create=20a=20Live?= =?UTF-8?q?=20USB=20Drive=20in=20Linux=20Terminal=20[For=20Experts=20and?= =?UTF-8?q?=20Adventurers]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md --- ...x Terminal -For Experts and Adventurers.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md diff --git a/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md b/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md new file mode 100644 index 0000000000..03346f2a31 --- /dev/null +++ b/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md @@ -0,0 +1,127 @@ +[#]: subject: "How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers]" +[#]: via: "https://itsfoss.com/live-usb-with-dd-command/" +[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers] +====== + +There are several graphical tools available for creating live USB. [Etcher on Linux][1] is probably the most popular. Ubuntu has its own Startup Disk Creator tool for this purpose. + +However, advanced Linux users swear by the comfort and swiftness of creating live USBs in Linux terminal using the dd command. + +The dd command is a [CLI tool][2] that gives you powerful features for copying and converting files. + +A common use case that people use dd for is to write ISO files to an external storage device such as a USB drive, which can be used to do things like install a new Linux distribution onto a computer or laptop. + +That’s what I am going to show in this tutorial. I’ll go over the commands you will need to run, finding our USB drive from the terminal, and then finally doing the actual flashing of the ISO file. + +### Creating live USB from ISO with dd command + +Before I show you the steps, let me quickly go over the command which you’ll be using and explain what it does. + +Here’s the example command for flashing of the ISO: + +``` +dd if="./filename.iso" of="/dev/sdb" status="progress" conv="fsync" +``` + +Let’s go over what exactly that [dd command][3] is doing. + +#### Understanding the above dd command + +![Explanation of the dd command for live USB creation][4] + +First, you enter `dd`. As expected, this is just the name of the program you are going to run. + +Next, you specify `if="./filename.iso"`. `if` stands for input file, which tells `dd` what file you are going to be writing to the external storage drive. + +After that, you enter `of="/dev/sdb"`. As was with `if`, `of` simply stands for output file. + +The thing to remember is that the output file doesn’t technically have to be a file on your system. You can also specify things like the path to an external device (as shown in the example), which just **looks** like a normal file on your system, but actually points to a device connected to your machine. + +`status` can be set to three options: `none`, `noxfer` and `progress.` + +The `progress` option that you set will cause dd to show periodic statistics on how much of the ISO has been transferred to the storage drive, as well as an estimation on how much longer it will be until dd is finished. + +If you were to have set the `none` option instead, dd would only print error messages during the writing of the ISO, thus removing things like the progress bar. + +The `noxfer` option hides some information that’s printed after a transfer is complete, such as how long it took from start to finish. + +Lastly, you set the `conv` option to `fsync`. This causes dd to not report a successful write until the entire ISO has been written to the USB drive. + +If you omit this option, dd will still write just fine (and might actually appear to run quicker), but you might find your system taking quite a while before it tells you it’s safe to remove the USB drive as it will finish writing the ISO’s content in the background, thus allowing you to do other things in the meantime. + +_**Now that you understand what you have to do, let’s see how to do it.**_ + +Warning + +The command line is a double-edged sword. Be extra careful when you are running a command like dd. You must make sure that you are using the correct device for the output file destination. One wrong step and you may format your main system disk and lose your operating system. + +#### Step 0: Download the desired ISO + +This goes without saying that you need to have an ISO image file in order to flash it on a USB. + +I am going to use Ubuntu 20.04 ISO (downloadable [here][5]) to test the dd command I showed earlier. + +#### Step 1: Get the USB disk label + +Plug in your USB disk. + +The specific path I entered for `of` was `/dev/sdb`. The USB disks are usually labelled /dev/sdb but that’s not a hard and fast rule. + +This path may differ on your system, but you can confirm the path of the drive with the `lsblk` command. Just look for a listing that looks like the size of your USB drive, and that’ll be it. + +![][6] + +If you are more comfortable with GUI programs, you can also find the drive’s path with tools like GNOME Disks. + +![][7] + +Now that you have established the path to our external drive, let’s create the live USB. + +#### Step 2: Writing the ISO file to the USB disk + +Open up a terminal at the directory where the ISO file is downloaded, and run the following (remember to replace `/dev/sdb` with the name of your storage device if it’s something different): + +``` +sudo dd if="./ubuntu-20.04.2.0-desktop-amd64.iso" of="/dev/sdb" status="progress" conv="fsync" +``` + +After that, just let dd do it’s thing, and it’ll print a completion message once it’s done: + +![][8] + +And just like that, you’ve flashed an ISO with dd command in the Linux terminal! + +### Wrapping Up + +Now you’re on your way to doing even more things through the terminal, allowing you to do things faster and quicker than you might have been able to do before. + +Got any remaining questions about the dd command, or something just not working right? Feel free to leave any of it in the comment section below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/live-usb-with-dd-command/ + +作者:[Hunter Wittenborn][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/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-etcher-linux/ +[2]: https://itsfoss.com/gui-cli-tui/ +[3]: https://linuxhandbook.com/dd-command/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/dd-command-for-live-usb-creation.png?resize=800%2C450&ssl=1 +[5]: https://ubuntu.com/download/desktop/thank-you?version=20.04.2.0&architecture=amd64 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_disks.png?resize=753%2C264&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_gnome_disks.png?resize=800%2C440&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd-iso-write.png?resize=800%2C322&ssl=1 From 7be71911db00bd12867ac532db892ca44caa3bf3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Sep 2021 05:02:48 +0800 Subject: [PATCH 0283/1588] add done: 20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md --- sources/tech/20210908 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210908 .md diff --git a/sources/tech/20210908 .md b/sources/tech/20210908 .md new file mode 100644 index 0000000000..a5389b61f9 --- /dev/null +++ b/sources/tech/20210908 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/boot-centos-8-rhel-8-rescue-mode/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/boot-centos-8-rhel-8-rescue-mode/ + +作者:[][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 10b65687a69c3da892a5638ee887cb4caa9e1461 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Sep 2021 05:03:02 +0800 Subject: [PATCH 0284/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210908?= =?UTF-8?q?=20How=20to=20Run=20Java=20Programs=20in=20Ubuntu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210908 How to Run Java Programs in Ubuntu.md --- ...0908 How to Run Java Programs in Ubuntu.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210908 How to Run Java Programs in Ubuntu.md diff --git a/sources/tech/20210908 How to Run Java Programs in Ubuntu.md b/sources/tech/20210908 How to Run Java Programs in Ubuntu.md new file mode 100644 index 0000000000..89cbe6916e --- /dev/null +++ b/sources/tech/20210908 How to Run Java Programs in Ubuntu.md @@ -0,0 +1,116 @@ +[#]: subject: "How to Run Java Programs in Ubuntu" +[#]: via: "https://itsfoss.com/run-java-program-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Run Java Programs in Ubuntu +====== + +So, you have started learning Java programming? That’s good. + +And you want to run the java programs on your Linux system? Even better. + +Let me show how to run Java in terminal in Ubuntu and other Linux distributions. + +### Running Java programs in Ubuntu + +Let’s go in proper steps here. + +#### Step 1: Install Java compiler + +To run a Java program, you need to compile the program first. You need Java compiler for this purpose. + +The Java compiler is part of [JDK][1] (Java Development Kit). You need to install JDK in order to compile and run Java programs. + +First, check if you already have Java Compiler installed on your system: + +``` +javac --version +``` + +If you see an error like “Command ‘javac’ not found, but can be installed with”, this means you need to install Java Development Kit. + +![Check if Java compiler is already installed or not][2] + +The simplest way to install JDK on Ubuntu is to go with the default offering from Ubuntu: + +``` +sudo apt install default-jdk +``` + +You’ll be asked to enter your account’s password. When you type the password, nothing is seen on the screen. That is normal. Just enter your password blindly. When asked, press the enter key or Y key. + +![Installing JDK that also contains the Java compiler][3] + +The above command should work for other Debian and Ubuntu based distributions like Linux Mint, elementary OS etc. For other distributions, use your distribution’s package manager. The package name could also be different. + +Once installed, verify that javac is available now. + +![Verify that Java compiler can be used now][4] + +#### Step 2: Compile Java program in Linux + +You need to have a Java program file for this reason. Let’s say you create a new Java program file named **HelloWorld.java** and it has the following content: + +``` +class HelloWorld{ + public static void main(String args[]){ + System.out.println("Hello World"); + } +} +``` + +You can [use Nano editor in terminal][5] or Gedit graphical text editor for writing your Java programs. + +``` +javac HelloWorld.java +``` + +If there is no error, the above command produces no output. + +When you compile the Java program, it generates a .class file with the class name you used in your program. You have to run this class file. + +#### Step 3: Run the Java class file + +You do not need to specify the class extension here. Just the name of the class. And this time, you use the command java, not javac. + +``` +java HelloWorld +``` + +This will print Hello World on the screen for my program. + +![Running java programs in the Linux terminal][6] + +And that’s how you run a Java program in the Linux terminal. + +This was the simplest of the example. The sample program had just one class. The Java compiler creates a class file for each class in your program. Things get complicated for bigger programs and projects. + +This is why I advise [installing Eclipse on Ubuntu][7] for proper Java programming. It is easier to program in an IDE. + +I hope you find this tutorial helpful. Questions or suggestions? The comment section is all yours. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/run-java-program-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://jdk.java.net/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=800%2C328&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-jdk-ubuntu.png?resize=800%2C430&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-ubuntu.png?resize=798%2C226&ssl=1 +[5]: https://itsfoss.com/nano-editor-guide/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/running-java-programs-in-Linux-terminal.png?resize=798%2C301&ssl=1 +[7]: https://itsfoss.com/install-latest-eclipse-ubuntu/ From d77d5a7aa759178dcd83badb98001af7c477d340 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Sep 2021 05:03:21 +0800 Subject: [PATCH 0285/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210908?= =?UTF-8?q?=20What=20is=20the=20Latest=20Ubuntu=20Version=3F=20Which=20one?= =?UTF-8?q?=20to=20use=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210908 What is the Latest Ubuntu Version- Which one to use.md --- ...Latest Ubuntu Version- Which one to use.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20210908 What is the Latest Ubuntu Version- Which one to use.md diff --git a/sources/tech/20210908 What is the Latest Ubuntu Version- Which one to use.md b/sources/tech/20210908 What is the Latest Ubuntu Version- Which one to use.md new file mode 100644 index 0000000000..6690c5739a --- /dev/null +++ b/sources/tech/20210908 What is the Latest Ubuntu Version- Which one to use.md @@ -0,0 +1,103 @@ +[#]: subject: "What is the Latest Ubuntu Version? Which one to use?" +[#]: via: "https://itsfoss.com/latest-ubuntu-version/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is the Latest Ubuntu Version? Which one to use? +====== + +So, you decided to use Ubuntu. Set upon to install Ubuntu and find that there are several active Ubuntu releases. + +That makes you bother about the latest Ubuntu release. Let me help you with that. + +**The newest Ubuntu release is Ubuntu 21.04.** It is a short term release which was out in April 2021 and it will be supported till January 2022. After that, you’ll have to upgrade to Ubuntu 21.10 (will be releases in October 2021). + +**The latest LTS release is Ubuntu 20.04 codenamed Focal Fossa**. It was released in April 2020 and it will be supported till April 2025. If you do not want to upgrade your version every nine months, stick with the latest LTS release. + +In other current Ubuntu releases, version 18.04 is still active. It will be supported till April 2023. But if you are going for a [fresh Ubuntu install][1], go for the latest Ubuntu LTS release, which is 20.04. + +For your information, every two years, there is a new LTS release and **three non-LTS releases** in between (every six months). You may [read this article to know about Ubuntu LTS and non-LTS releases][2]. + +The non-LTS releases often bring bleeding-edge features but with minor iterations. And, the next LTS release can be expected to bring all the features added to the non-LTS releases. + +### Latest LTS Version of Ubuntu 20.04 “Focal Fossa” + +![Ubuntu 20.04 LTS][3] + +Every Ubuntu release is associated with a codename, which is often named after animals in alphabetical order. + +In this case, it is “**Focal Fossa**” which refers to a catlike animal found on Madagascar. + +Ubuntu 20.04 comes packed with [Linux Kernel 5.4][4] will be supported till **April 2025**. And, the latest LTS point release is **Ubuntu 20.04.3**. + +If you are using the latest point release (via a new installation), you might have [Linux Kernel 5.11][5] if you are hardware did not fully support Linux 5.4 + +Did You Know? + +Every LTS version release is followed by seven point releases, with extra extended security maintenance updates available for five more years (for a fee). + +If you are an enterprise or want longer LTS support than usual, you can subscribe to Ubuntu ESM to get a total of ten years of support for Ubuntu LTS versions on your desktop or server. + +The Long Term Support versions are usually known for adding major feature improvements while the non-LTS versions add bleeding-edge technologies to test and get it ready for the next LTS release. + +If you take a look at [Ubuntu 20.04 features][6] and [Ubuntu 21.04 features][7], you should get an idea of the differences between an LTS and non-LTS release. + +### Which versions of Ubuntu are LTS? + +Not just limited to the version number, there are several Ubuntu flavors available as well. Some of them offer similar software update support and some of them only give you **three years of updates** (in contrast to five by Canonical). + +So, if you want to explore those, I suggest you know [which Ubuntu version to use][8] before deciding to install any Ubuntu flavour. + +### How Long is Ubuntu LTS Supported? + +Any Ubuntu release is supported until the [end-of-life period][9]. + +For LTS versions, this is usually five years. And, for non-LTS versions, it is nine months. + +### Should I Upgrade to Ubuntu 20.04 LTS? + +First, you should [check the Ubuntu version installed on your computer][10]. + +If you are using an older LTS release, you should definitely consider upgrading to the new one for better hardware compatibility, improved workflow, and performance. + +If you do not want to break the user experience, you can stick to the older release until it reaches the end-of-life period. + +### How to Upgrade to the Latest Ubuntu version? + +![][11] + +You can upgrade to the latest Ubuntu version using the graphical user interface (GUI) or the terminal. + +Simply head to the Software Updater, it should check and notify you if an update is available. + +To get help, you can refer to our [upgrade instructions guide][12] to swiftly upgrade your Ubuntu version without any issues. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/latest-ubuntu-version/ + +作者:[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://itsfoss.com/install-ubuntu/ +[2]: https://itsfoss.com/long-term-support-lts/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/01/ubuntu_yaru_light_dark_theme.jpg?resize=800%2C450&ssl=1 +[4]: https://itsfoss.com/linux-kernel-5-4/ +[5]: https://news.itsfoss.com/linux-kernel-5-11-release/ +[6]: https://itsfoss.com/ubuntu-20-04-release-features/ +[7]: https://news.itsfoss.com/ubuntu-21-04-features/ +[8]: https://itsfoss.com/which-ubuntu-install/ +[9]: https://itsfoss.com/end-of-life-ubuntu/ +[10]: https://itsfoss.com/how-to-know-ubuntu-unity-version/ +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/start-upgrade-focal.jpg?resize=800%2C495&ssl=1 +[12]: https://itsfoss.com/upgrade-ubuntu-version/ From 6c02c8622731297123341216fd1fb32e0a3b4e54 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Sep 2021 05:03:41 +0800 Subject: [PATCH 0286/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210907?= =?UTF-8?q?=20Use=20lspci=20on=20Linux=20to=20see=20your=20hardware?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210907 Use lspci on Linux to see your hardware.md --- ...Use lspci on Linux to see your hardware.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20210907 Use lspci on Linux to see your hardware.md diff --git a/sources/tech/20210907 Use lspci on Linux to see your hardware.md b/sources/tech/20210907 Use lspci on Linux to see your hardware.md new file mode 100644 index 0000000000..dd11793761 --- /dev/null +++ b/sources/tech/20210907 Use lspci on Linux to see your hardware.md @@ -0,0 +1,157 @@ +[#]: subject: "Use lspci on Linux to see your hardware" +[#]: via: "https://opensource.com/article/21/9/lspci-linux-hardware" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use lspci on Linux to see your hardware +====== +Use the lspci command to display devices and drivers on your Linux +system. +![computer screen ][1] + +When you're running Linux on a desktop or server, sometimes you need to identify the hardware in that system. One command used for this is `lspci`. It works by showing all devices attached to the PCI bus. It's provided by the [pciutils][2] package and is available for a wide range of Linux and BSD-based operating systems. + +### Basic usage + +The information displayed when a regular user runs `lspci` might be limited due to access permissions. Running the command with `sudo` provides a complete picture. + +Running `lspci` by itself lists the PCI buses and their attached devices. Here's an example from my media center PC. It's an AMD Phenom CPU-based system, so it has an AMD chipset. It also has an Atheros wireless controller and an Nvidia graphics card. All hardware devices are listed with details such as vendor, name, and model number: + + +``` +$ sudo lspci +00:00.0 Host bridge: Advanced Micro Devices, Inc. [AMD] RS880 Host Bridge +00:02.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780 PCI to PCI bridge (ext gfx port 0) +00:04.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 0) +00:05.0 PCI bridge: Advanced Micro Devices, Inc. [AMD] RS780/RS880 PCI to PCI bridge (PCIE port 1) +00:11.0 SATA controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 SATA Controller [AHCI mode] +00:12.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller +00:12.1 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller +00:12.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller +00:13.0 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI0 Controller +00:13.1 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0 USB OHCI1 Controller +00:13.2 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB EHCI Controller +00:14.0 SMBus: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 SMBus Controller (rev 3c) +00:14.1 IDE interface: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 IDE Controller +00:14.3 ISA bridge: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 LPC host controller +00:14.4 PCI bridge: Advanced Micro Devices, Inc. [AMD/ATI] SBx00 PCI to PCI Bridge +00:14.5 USB controller: Advanced Micro Devices, Inc. [AMD/ATI] SB7x0/SB8x0/SB9x0 USB OHCI2 Controller +00:18.0 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor HyperTransport Configuration +00:18.1 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Address Map +00:18.2 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor DRAM Controller +00:18.3 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Miscellaneous Control +00:18.4 Host bridge: Advanced Micro Devices, Inc. [AMD] Family 10h Processor Link Control +01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1) +01:00.1 Audio device: NVIDIA Corporation GK107 HDMI Audio Controller (rev a1) +02:00.0 Network controller: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) (rev 01) +``` + +### Verbose output + +Adding a `-v` option increases the verbosity or the level of detail for each device. You can use `-vv` or `-vvv` for even higher amounts of device detail. At this level, `lspci` displays various subsystems and memory addresses, interrupt request (IRQ) numbers, and other capabilities for all devices. The output is extremely long. Give it a try on your system. + +### Searching with grep + +Sometimes you want to narrow your search. For instance, the RPM Fusion web site has instructions for installing Nvidia graphics drivers. They begin with identifying your graphics card using the `grep` command. This is what I get on my laptop: + + +``` +$ sudo lspci | grep -e VGA +00:02.0 VGA compatible controller: Intel Corporation UHD Graphics 620 (rev 07) +$ sudo lspci | grep -e 3D +01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce MX130] (rev a2) +``` + +The `grep` commands above show one VGA device on my media center PC but no 3D device. + + +``` +$ sudo lspci | grep -e VGA +01:00.0 VGA compatible controller: NVIDIA Corporation GK107 [GeForce GTX 650] (rev a1) +$ sudo lspci | grep -e 3D +$ +``` + +### Searching by vendor ID + +There is another way that doesn't require `grep`. Suppose I want to determine whether any other Nvidia devices are present. It's necessary to know a little more. I use the `-nn` option to display vendor and device ID numbers. On my media center PC, this option shows my VGA card, vendor ID, and device ID: + + +``` +$ sudo lspci -nn | grep -e VGA +01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1) +``` + +The set of brackets with the colon-separated numbers after the device name shows the vendor and device ID. The output indicates that the vendor ID for a device made by Nvidia Corporation is **10de**. + +The `-d` option displays all devices from a specified vendor, device, or class ID. Here are all the Nvidia devices in my system (keeping the `-nn` to include the vendor IDs): + + +``` +$ sudo lspci -nn -d 10de: +01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1) +01:00.1 Audio device [0403]: NVIDIA Corporation GK107 HDMI Audio Controller [10de:0e1b] (rev a1) +``` + +From the output, you can see that in addition to a graphics card, I have an Nvidia audio device. They are both actually part of the same **Nvidia GeForce GTX 650** card, but this is a good example nonetheless. + +### Kernel modules + +Along with PCI hardware devices, `lspci` can show what kernel driver modules are loaded with the `-k` option. I add this option to my `lspci` commands to view several pieces of information about my Nvidia devices. + + +``` +$ sudo lspci -nn -k -d 10de: +01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1) + Subsystem: eVga.com. Corp. GK107 [GeForce GTX 650] [3842:2650] + Kernel driver in use: nvidia + Kernel modules: nvidiafb, nouveau, nvidia_drm, nvidia +01:00.1 Audio device [0403]: NVIDIA Corporation GK107 HDMI Audio Controller [10de:0e1b] (rev a1) + Subsystem: eVga.com. Corp. GK107 HDMI Audio Controller [3842:2650] + Kernel driver in use: snd_hda_intel + Kernel modules: snd_hda_intel +``` + +Two additional lines are displayed: _Kernel driver in use_ and _Kernel modules_. The second one lists the modules available to support the device. + +### Keeping up to date + +New devices and vendors are constantly entering the market. If you see a device listed as _unknown_, your PCI device ID database may be outdated. There are two ways to check. The `-Q` option uses DNS to query the central database. This, of course, requires network connectivity. + + +``` +`$ sudo lspci -Q` +``` + +You can also update your local PCI ID database by running the command `update-pciids`. + + +``` +$ sudo update-pciids +Downloaded daily snapshot dated 2021-08-22 03:15:01 +``` + +### Learn more about your hardware + +Of course, `lspci` is just one of many commands available for Linux that is useful for querying the hardware and software on your system. Learn more about hardware on Linux in my article covering USB devices: [Recognize more devices on Linux with this USB ID Repository][3]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/lspci-linux-hardware + +作者:[Alan Formy-Duval][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/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/features_solutions_command_data.png?itok=4_VQN3RK (computer screen ) +[2]: https://mj.ucw.cz/sw/pciutils/ +[3]: https://opensource.com/article/20/8/usb-id-repository From 0495e6d1018984ec52e01ad0188f233d53fd4155 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Sep 2021 05:03:56 +0800 Subject: [PATCH 0287/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210907?= =?UTF-8?q?=20How=20to=20use=20BusyBox=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210907 How to use BusyBox on Linux.md --- .../20210907 How to use BusyBox on Linux.md | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 sources/tech/20210907 How to use BusyBox on Linux.md diff --git a/sources/tech/20210907 How to use BusyBox on Linux.md b/sources/tech/20210907 How to use BusyBox on Linux.md new file mode 100644 index 0000000000..dfcc7dbd6d --- /dev/null +++ b/sources/tech/20210907 How to use BusyBox on Linux.md @@ -0,0 +1,189 @@ +[#]: subject: "How to use BusyBox on Linux" +[#]: via: "https://opensource.com/article/21/8/what-busybox" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to use BusyBox on Linux +====== +BusyBox is an open source (GPL) project providing simple implementations +of nearly 400 common commands. +![bash logo on green background][1] + +It's easy to take Linux commands for granted. They come bundled with the system when you install Linux, and we often don't question why they're there. Some of the basic commands, such as [`cd`][2], [`kill`][3], and `echo` aren't always independent applications but are actually built into your shell. Others, such as [`ls`][4], [`mv`][5], and [`cat`][6] are part of a core utility package (often GNU `coreutils` specifically). But there are always alternatives in the world of open source, and one of the most interesting is [BusyBox][7]. + +### What is BusyBox in Linux? + +BusyBox is an open source (GPL) project providing simple implementations of nearly 400 common commands, including `ls`, `mv`, `ln`, `mkdir`, `more`, `ps`, `gzip`, `bzip2`, `tar`, and `grep`. It also contains a version of the programming language `awk`, the stream editor `sed`, the filesystem checker `fsck`, the `rpm` and `dpkg` package managers, and of course, a shell (`sh`) that provides easy access to all of these commands. In short, it contains all the essential commands required for a POSIX system to perform common system maintenance tasks as well as many user and administrative tasks. + +In fact, it even contains an `init` command which can be launched as PID 1 to serve as the parent process for all other system services. In other words, BusyBox can be used as an alternative to [systemd][8], OpenRC, sinit, init, and other launch daemons. + +BusyBox is very small. As an executable, it's under 1 MB, so it has gained much of its popularity in the [embedded][9], [Edge][10], and [IoT][11] space, where drive space is at a premium. In the world of containers and cloud computing, it's also popular as a foundation for minimal Linux container images. + +### Minimalism + +Part of the appeal of BusyBox is its minimalism. All of its commands are compiled into a single binary (`busybox`), and its man page is a mere 81 pages (by my calculation of piping `man` to `pr`) but covers nearly 400 commands. + +As an example comparison, here's the output of the `shadow` version of `useradd --help`: + + +``` + -b, --base-dir BASE_DIR       base directory for home + -c, --comment COMMENT         GECOS field of the new account + -d, --home-dir HOME_DIR       home directory of the new account + -D, --defaults                print or change the default config + -e, --expiredate EXPIRE_DATE  expiration date of the new account + -f, --inactive INACTIVE       password inactivity + -g, --gid GROUP               name or ID of the primary group + -G, --groups GROUPS           list of supplementary groups + -h, --help                    display this help message and exit + -k, --skel SKEL_DIR           alternative skeleton dir + -K, --key KEY=VALUE           override /etc/login.defs + -l, --no-log-init             do not add the user to the lastlog + -m, --create-home             create the user's home directory + -M, --no-create-home          do not create the user's home directory + -N, --no-user-group           do not create a group with the user's name + -o, --non-unique              allow users with non-unique UIDs + -p, --password PASSWORD       encrypted password of the new account + -r, --system                  create a system account + -R, --root CHROOT_DIR         directory to chroot into + -s, --shell SHELL             login shell of the new account + -u, --uid UID                 user ID of the new account + -U, --user-group              create a group with the same name as a user +``` + +And here's the BusyBox version of the same command: + + +``` + -h DIR    Home directory + -g GECOS  GECOS field + -s SHELL  Login shell + -G GRP    Group + -S            Create a system user + -D            Don't assign a password + -H            Don't create home directory + -u UID    User id + -k SKEL   Skeleton directory (/etc/skel) +``` + +Whether or not this difference is a feature or a limitation depends on whether you prefer to have 20 options or ten options in your commands. For some users and use-cases, BusyBox's minimalism provides just enough for what needs to be done. For others, it's a good minimal environment to have as a fallback or as a foundation for installing more robust tools like [Bash][12], [Zsh][13], GNU [Awk][14], and so on. + +### Installing BusyBox + +On Linux, you can install BusyBox using your package manager. For example, on Fedora and similar: + + +``` +`$ sudo dnf install busybox` +``` + +On Debian and derivatives: + + +``` +`$ sudo apt install busybox` +``` + +On macOS, use [MacPorts][15] or [Homebrew][16]. On Windows, use [Chocolatey][17]. + +You can set BusyBox as your shell using the `chsh --shell` command, followed by the path to the BusyBox `sh` application. I keep BusyBox in `/lib64`, but its location depends on where your distribution installed it. + + +``` +$ which busybox +/lib64/busybox/busybox +$ chsh --shell /lib64/busybox/sh +``` + +Replacing all common commands wholesale with BusyBox is a little more complex, because most distributions are "hard-wired" to look to specific packages for specific commands. In other words, while it's technically possible to replace `init` with BusyBox's `init`, your package manager may refuse to allow you to remove the package containing `init` for fear of you causing your system to become non-bootable. There are some distributions built upon BusyBox, so starting fresh is probably the easiest way to experience a system built around BusyBox. + +### Try BusyBox + +You don't have to change your shell to BusyBox permanently just to try it. You can launch a BusyBox shell from your current shell: + + +``` +$ busybox sh +~ $ +``` + +Your system still has the non-BusyBox versions of commands installed, though, so to experience BusyBox's tools, you must issue commands as arguments to the `busybox` executable: + + +``` +~ $ busybox echo $0 +sh +~ $ busybox ls --help +BusyBox vX.YY.Z (2021-08-25 07:31:48 NZST) multi-call binary. + +Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]... + +List directory contents + + -1  One column output + -a  Include entries that start with . + -A  Like -a, but exclude . and .. + -x  List by lines +[...] +``` + +For the "full" BusyBox experience, you can create symlinks to `busybox` for each command. This is easier than it sounds, as long as you use a [for-loop][18]: + + +``` +$ mkdir bbx +$ for i in $(bbx --list); do \ +ln -s /path/to/busybox bbx/$i \ +done +``` + +Add your directory of symlinks at the _start_ of your [path][19], and launch BusyBox: + + +``` +`$ PATH=$(pwd)/bbx:$PATH bbx/sh` +``` + +### Get busy + +BusyBox is a fun project and an example of just how _minimal_ computing can be. Whether you use BusyBox as a lightweight environment for an [ancient computer][20] [you've rescued][21], as the userland for an [embedded device][22], to trial a new init system, or just as a curiosity, it can be fun reacquainting yourself with old familiar, yet somehow new, commands. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/what-busybox + +作者:[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/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/article/21/8/navigate-linux-directories +[3]: https://opensource.com/article/18/5/how-kill-process-stop-program-linux +[4]: https://opensource.com/article/19/7/master-ls-command +[5]: https://opensource.com/article/19/8/moving-files-linux-depth +[6]: https://opensource.com/article/19/2/getting-started-cat-command +[7]: https://www.busybox.net +[8]: https://opensource.com/article/20/4/systemd +[9]: https://opensource.com/article/21/3/rtos-embedded-development +[10]: https://opensource.com/article/17/9/what-edge-computing +[11]: https://opensource.com/article/21/3/iot-measure-raspberry-pi +[12]: https://opensource.com/article/20/4/bash-sysadmins-ebook +[13]: https://opensource.com/article/19/9/getting-started-zsh +[14]: https://opensource.com/article/20/9/awk-ebook +[15]: https://opensource.com/article/20/11/macports +[16]: https://opensource.com/article/20/6/homebrew-mac +[17]: https://opensource.com/article/20/3/chocolatey +[18]: https://opensource.com/article/19/10/programming-bash-loops +[19]: https://opensource.com/article/17/6/set-path-linux +[20]: https://opensource.com/article/20/2/restore-old-computer-linux +[21]: https://opensource.com/article/19/7/how-make-old-computer-useful-again +[22]: https://opensource.com/article/20/6/open-source-rtos From b545c8616d27bb7210fd6b27dc0c14e03ee07caa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Sep 2021 05:04:23 +0800 Subject: [PATCH 0288/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210907?= =?UTF-8?q?=20Lakka=20Linux=203.4=20Brings=20Fidelity=20FX=20Support=20Wit?= =?UTF-8?q?h=20the=20New=20RetroArch=201.9.9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md --- ...FX Support With the New RetroArch 1.9.9.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md diff --git a/sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md b/sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md new file mode 100644 index 0000000000..31cbe35407 --- /dev/null +++ b/sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md @@ -0,0 +1,96 @@ +[#]: subject: "Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9" +[#]: via: "https://news.itsfoss.com/lakka-retroarch-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9 +====== + +For years now, [RetroArch][1] has been the gold standard in emulation, thanks to its ease of use and simplicity. Similarly, [Lakka][2] has gotten a name by using RetroArch to create an incredibly smooth and straightforward experience for its users. + +Hence, we have recommended it in the past to [turn your old PC into a retrogaming console][3]. + +It is always a great day when these two large projects announce new releases, and it looks like we have some exciting news with Lakka 3.4 and RetroArch 1.9.9 release. + +Here, we will be looking at some of the new features announced in RetroArch 1.9.9 and Lakka 3.4 and the significant impact on the future of emulation. + +### What’s New? + +With this release, RetroArch has introduced some useful and impactful new features. These include: + + * AMD FidelityFX support for all games + * Windows users can now use HDR on many games + * New touchscreen menu for the Nintendo DS + + + +Lakka (which includes RetroArch) has also received some welcome improvements. + + * Improved stability + * 3 new cores for the PS1, PS2, and DOS + * Updated Mesa to version 21.2.1 + + + +Here we focus on the key highlights and, primarily, Integrated FidelityFX. + +#### FidelityFX For Retro Games + +![][4] + +When AMD announced its open-source alternative to DLSS back in June, we could never have predicted the incredible impact it would have on emulation. + +For those not aware, [FidelityFX][5] allows games to run at a lower resolution while retaining the same image quality, dramatically improving the performance. + +Now, with the RetroArch 1.9.9 release, this technology is being brought to RetroArch and Lakka. This is great because it allows older games designed to run at a low resolution to look much better without resorting to mods or texture packs. + +Overall, I expect this addition to be widely appreciated, especially by people looking for a more modern version of their favorite retro games. + +If you want to learn more about FidelityFX and upscaling, I’d highly suggest you check out [our article on Intel’s XeSS where we explain all this][6] and how it impacts you. + +#### New Touchscreen Menu For Nintendo 3DS + +One of the more interesting ports of RetroArch, the Nintendo 3DS, has also gotten a cool new feature. This comes in the form of a touchscreen menu for the bottom screen, which shows a few useful shortcuts without covering the game. + +While this doesn’t apply to Lakka, users of RetroArch running on top of another distribution should receive this change once RetroArch 1.9.9 lands in the repositories. + +### Wrapping Up + +Overall, [RetroArch 1.9.9][7] and [Lakka 3.4][8] are looking to be significant upgrades, especially with the new integration with FidelityFX. + +As we have already seen, with emulators such as [RPCS3][9], FidelityFX can provide significant graphical improvements on older games, so it is exciting to see this come to RetroArch. + +_What do you think about FidelityFX being used for retro games? 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/lakka-retroarch-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://www.retroarch.com/ +[2]: http://lakka.tv +[3]: https://itsfoss.com/lakka-retrogaming-linux/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://www.amd.com/en/technologies/radeon-software-fidelityfx-super-resolution +[6]: https://news.itsfoss.com/intel-xess-open-source/ +[7]: https://www.libretro.com/index.php/retroarch-1-9-9-released/ +[8]: http://lakka.tv/articles/2021/09/06/lakka-3.4/ +[9]: http://rpcs3.net From 2aa0fac09b7d56bbafadbce57e504c7ca5fd721c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 8 Sep 2021 05:04:38 +0800 Subject: [PATCH 0289/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210907?= =?UTF-8?q?=20OpenWrt=2021.02=20Arrives=20With=20Linux=20Kernel=205.4=20&?= =?UTF-8?q?=20WPA3=20Support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md --- ...es With Linux Kernel 5.4 - WPA3 Support.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md diff --git a/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md b/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md new file mode 100644 index 0000000000..5e539b43fe --- /dev/null +++ b/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md @@ -0,0 +1,98 @@ +[#]: subject: "OpenWrt 21.02 Arrives With Linux Kernel 5.4 & WPA3 Support" +[#]: via: "https://news.itsfoss.com/openwrt-21-02-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +OpenWrt 21.02 Arrives With Linux Kernel 5.4 & WPA3 Support +====== + +The OpenWrt community announced the first stable update of their series, OpenWrt 21.02. + +In case you did not know, OpenWrt is a project that helps create custom operating systems for embedded devices. + +It enables users to openly customize their devices according to their networking needs, something that the stock router firmware doesn’t. Other than routers, OpenWrt can run on a variety of devices such as smartphones, residential gateways, and even 32 bit PCs! + +With this release, they have over 5800 commits since the older OpenWrt 19.07. + +Let us take a look at what is new with OpenWrt 21.02. + +### OpenWrt 21.02: What’s New? + +While there are several technical changes and improvements, let me highlight the key additions. + +#### WPA3 Support + +Although present in the 19.07 release, the latest security standard for Wi-Fi networks is now included by default in the images. + +WPA3 stands for Wi-Fi Protected Access 3 and is a major improvement in terms of security over the popular WPA2. Backward compatibility is also supported. + +#### TLS and HTTPS Support + +Just like WPA3, TLS and HTTPS support is also included by default. This comes with the trusted CA certificates from Mozilla as well. + +With this addition, _wget_ and _opkg_ should now support fetching resources over HTTPS out-of-the-box. Moreover, [LuCl][1] is available over HTTPS in addition to HTTP. + +#### Initial DSA Support + +As the release announcement states: + +“DSA stands for Distributed Switch Architecture and is the Linux standard to deal with configurable Ethernet switches” + +This has replaced the _swconfig_ system which was being used until now. This is a notable change to how VLANs and switch ports are managed. + +#### New Minimum Hardware Requirements + +With numerous new features and updates to OpenWrt, including the increase in the general size of the Linux kernel, the minimum requirements have been increased. + +Devices now require at least 8 MB of flash and 64 MB memory to run the default build ensuring proper stability. + +#### Package Updates + +The release also comes packed in with several package upgrades, some of them are: + + * Linux kernel 5.4.143 + * gcc 8.4.0 + * glibc 2.33 + * binutils 2.34 + * busybox 1.33.1 + + + +Along with the above-listed packages, there are many others that have also received upgrades. You can get the full technical details in the [official release announcement][2]. + +### Download OpenWrt 21.02 + +You can head to its official website to download the latest stable builds or opt for development snapshots for experiments. + +Instructions to build your own packages, and firmware should be available in their documentation. + +The _sysupgrade_ command can be used to upgrade your system from OpenWrt 19.07 to OpenWrt 21.02. Do note that you won’t be able to upgrade from 18.06. + +[OpenWrt 21.02][3] + +#### 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/openwrt-21-02-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://openwrt.org/docs/techref/luci +[2]: https://openwrt.org/releases/21.02/notes-21.02.0 +[3]: https://openwrt.org/downloads From acc3fbcc7e0a4e6f16c5f1fc1bff96deced4e100 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 Sep 2021 08:53:46 +0800 Subject: [PATCH 0290/1588] translated --- ... How to Install Dropbox on Ubuntu Linux.md | 116 ------------------ ... How to Install Dropbox on Ubuntu Linux.md | 116 ++++++++++++++++++ 2 files changed, 116 insertions(+), 116 deletions(-) delete mode 100644 sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md create mode 100644 translated/tech/20210904 How to Install Dropbox on Ubuntu Linux.md diff --git a/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md b/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md deleted file mode 100644 index 5426cce22e..0000000000 --- a/sources/tech/20210904 How to Install Dropbox on Ubuntu Linux.md +++ /dev/null @@ -1,116 +0,0 @@ -[#]: subject: "How to Install Dropbox on Ubuntu Linux" -[#]: via: "https://itsfoss.com/install-dropbox-ubuntu/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install Dropbox on Ubuntu Linux -====== - -Dropbox is one of the [most popular cloud storage services available for Linux][1] and other operating systems. - -In fact, Dropbox is one of the earliest services to provide a native Linux application. It still [supports 32-bit Linux systems][2] that is also a commendable job. - -In this beginner’s tutorial, I’ll show the steps for installing Dropbox on Ubuntu. The steps are really simple but some websites make it unnecessarily complicated. - -### Install Dropbox on Ubuntu desktop - -Let’s see the installation procedure, step by step. - -#### Step 1: Get Dropbox installer for Ubuntu - -Dropbox offers DEB files for its installer. Go to the download section of its website: - -[Dropbox Download][3] - -And download the appropriate DEB file. Considering that you are using 64 bit Ubuntu, get the deb file for 64-bit version. - -![Download the Dropbox installer][4] - -#### Step 2: Install Dropbox installer - -The deb file you downloaded is just an installer for Dropbox. Actual Dropbox installation starts later, similar to [installing Steam on Ubuntu][5]. - -To [install the downloaded deb file][6], either double click on it or right click and select open with Software Install. - -![Installing the downloaded Dropbox deb file][7] - -It will open the software center and you can click the install button. - -![Installing Dropbox deb file][8] - -Wait for the installation to finish. - -#### Step 3: Start Dropbox installation - -Dropbox installer is now installed. Press the Windows key (also known as super key) and search for Dropbox and click on it. - -![Start Dropbox for installation][9] - -On the first launch, it shows two popups. One about restarting Nautilus (the file explorer in Ubuntu) and the other about Dropbox installation. - -![Starting Dropbox installation][10] - -Clicking either Restart Nautilus/Close (on the Nautilus popup) or OK (on the installation popup) starts the actual Dropbox client download and installation. If the ‘Nautilus Restart’ does not close on clicking Close button, click the x button. - -Wait for the Dropbox installation to finish. - -![Installing Dropbox][11] - -Oh! Nautilus restart is required because Dropbox adds some extra features like showing the synchronization status in the file explorer. - -Once Dropbox is installed, it should either take you to the Dropbox login page automatically or you can hit the Dropbox icon at the top and select sign in option. - -![Sign in to Dropbox after installation][12] - -In fact, this is how you would be accessing Dropbox settings in the future. - -#### Step 4: Start using Dropbox on Ubuntu - -![Sign in into Dropbox][13] - -**Note**: Dropbox won’t work until you successfully sign in. Here’s a catch. The free version of Dropbox limits the number of devices you can link to your account. **If you already have 3 linked devices, you should remove some of the older ones that you do not use.** - -Once you are successfully signed in, you should see a Dropbox folder created in your home directory and your files from the cloud starts appearing here. - -![Dropbox folder is created under home directory][14] - -If you want to save disk space or bandwidth, you can go to the Preferences and choose the Selective Sync option. The selective sync option allows you only sync selected folders from Dropbox cloud on your local system. - -![Using selective sync in Dropbox][15] - -Dropbox automatically starts at each boot. This is the behavior you should expect from any cloud service, I believe. - -That’s all you need to get started with Dropbox on Ubuntu. I hope you find this tutorial helpful. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-dropbox-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/cloud-services-linux/ -[2]: https://itsfoss.com/32-bit-linux-distributions/ -[3]: https://www.dropbox.com/install-linux -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-dropbox-for-ubuntu.png?resize=800%2C294&ssl=1 -[5]: https://itsfoss.com/install-steam-ubuntu-linux/ -[6]: https://itsfoss.com/install-deb-files-ubuntu/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-installer-ubuntu.png?resize=797%2C476&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-dropbox-deb-file.png?resize=800%2C346&ssl=1 -[9]: https://itsfoss.com/wp-content/uploads/2021/09/start-drobox-ubuntu.webp -[10]: https://itsfoss.com/wp-content/uploads/2021/09/starting-dropbox-installation-800x599.webp -[11]: https://itsfoss.com/wp-content/uploads/2021/09/installing-dropbox.webp -[12]: https://itsfoss.com/wp-content/uploads/2021/09/sign-in-to-dropbox-after-first-installation.webp -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/sign-in-dropbox.png?resize=800%2C409&ssl=1 -[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-folder-ubuntu.png?resize=800%2C491&ssl=1 -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Dropbox-selective-sync.png?resize=800%2C399&ssl=1 diff --git a/translated/tech/20210904 How to Install Dropbox on Ubuntu Linux.md b/translated/tech/20210904 How to Install Dropbox on Ubuntu Linux.md new file mode 100644 index 0000000000..5427a572a7 --- /dev/null +++ b/translated/tech/20210904 How to Install Dropbox on Ubuntu Linux.md @@ -0,0 +1,116 @@ +[#]: subject: "How to Install Dropbox on Ubuntu Linux" +[#]: via: "https://itsfoss.com/install-dropbox-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Ubuntu Linux 上安装 Dropbox +====== + +Dropbox 是[最受欢迎的云存储服务之一,可用于 Linux][1] 和其他操作系统。 + +事实上,Dropbox 是最早提供原生 Linux 应用的服务之一。它仍然[支持 32 位 Linux 系统][2],这也是一项值得称赞的工作。 + +在这个初学者的教程中,我将展示在 Ubuntu 上安装 Dropbox 的步骤。这些步骤其实很简单,但有些网站把它弄得不必要的复杂。 + +### 在 Ubuntu 桌面上安装 Dropbox + +让我们来看看安装步骤,一步一步来。 + +#### 第一步:获取 Ubuntu 的 Dropbox 安装程序 + +Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面: + +[Dropbox Download][3] + +下载相应的 DEB 文件。考虑到你使用的是 64 位的 Ubuntu,请获取 64 位版本的 DEB 文件。 + +![Download the Dropbox installer][4] + +#### 第二步:安装 Dropbox 安装程序 + +你下载的 deb 文件只是 Dropbox 的一个安装程序。实际的 Dropbox 安装稍后开始,类似于[在 Ubuntu 上安装 Steam][5]。 + +要[安装下载的 deb 文件][6],可以双击它,或者右击并选择用软件安装打开。 + +![Installing the downloaded Dropbox deb file][7] + +它将打开软件中心,你可以点击安装按钮。 + +![Installing Dropbox deb file][8] + +等待安装完成。 + +#### 第三步:开始安装 Dropbox + +现在 Dropbox 安装程序已经安装完毕。按 Windows 键(也叫 super 键),搜索 Dropbox 并点击它。 + +![Start Dropbox for installation][9] + +第一次启动时,它显示两个弹出窗口。一个是关于重启 Nautilus(Ubuntu 中的文件资源管理器),另一个是关于 Dropbox 的安装。 + +![Starting Dropbox installation][10] + +点击 Restart Nautilus/Close(在 Nautilus 弹出窗口)或 OK(在安装弹出窗口),开始实际的 Dropbox 客户端下载和安装。如果 “Nautilus Restart” 在点击关闭按钮时没有关闭,请点击 x 按钮。 + +等待Dropbox的安装完成。 + +![Installing Dropbox][11] + +哦!需要重新启动 Nautilus,因为 Dropbox 增加了一些额外的功能,如在文件资源管理器中显示同步状态。 + +当 Dropbox 安装完毕,它应该会自动带你到 Dropbox 的登录页面,或者你可以点击顶部的 Dropbox 图标并选择登录选项。 + +![Sign in to Dropbox after installation][12] + +事实上,这就是你今后访问 Dropbox 设置的方式。 + +#### 第四步:开始在 Ubuntu 上使用 Dropbox + +![Sign in into Dropbox][13] + +**注意**:在你成功登录之前,Dropbox 将不会工作。这里有一个问题。免费版的 Dropbox 限制了你可以链接到你的账户的设备数量。**如果你已经有 3 个链接的设备,你应该删除一些你不使用的旧设备。** + +当你成功登录后,你应该看到在你的家目录中创建了一个 Dropbox 文件夹,你的云端文件开始出现在这里。 + +![Dropbox folder is created under home directory][14] + +如果你想节省磁盘空间或带宽,你可以进入偏好设置并选择选择性同步选项。选择性同步选项允许你只在本地系统上同步来自 Dropbox 云的选定文件夹。 + +![Using selective sync in Dropbox][15] + +Dropbox 会在每次启动时自动启动。我相信,这是你应该从任何云服务中期待的行为。 + +这就是你在 Ubuntu 上开始使用 Dropbox 所需要的一切。我希望这个教程对你有帮助。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-dropbox-ubuntu/ + +作者:[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/cloud-services-linux/ +[2]: https://itsfoss.com/32-bit-linux-distributions/ +[3]: https://www.dropbox.com/install-linux +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-dropbox-for-ubuntu.png?resize=800%2C294&ssl=1 +[5]: https://itsfoss.com/install-steam-ubuntu-linux/ +[6]: https://itsfoss.com/install-deb-files-ubuntu/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-installer-ubuntu.png?resize=797%2C476&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-dropbox-deb-file.png?resize=800%2C346&ssl=1 +[9]: https://itsfoss.com/wp-content/uploads/2021/09/start-drobox-ubuntu.webp +[10]: https://itsfoss.com/wp-content/uploads/2021/09/starting-dropbox-installation-800x599.webp +[11]: https://itsfoss.com/wp-content/uploads/2021/09/installing-dropbox.webp +[12]: https://itsfoss.com/wp-content/uploads/2021/09/sign-in-to-dropbox-after-first-installation.webp +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/sign-in-dropbox.png?resize=800%2C409&ssl=1 +[14]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/dropbox-folder-ubuntu.png?resize=800%2C491&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Dropbox-selective-sync.png?resize=800%2C399&ssl=1 From c62a01ecd3cc5f196cb73a6cdcafbb33e6e5058a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 8 Sep 2021 08:56:41 +0800 Subject: [PATCH 0291/1588] translating --- .../tech/20210907 How to Stop a Program in Linux Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210907 How to Stop a Program in Linux Terminal.md b/sources/tech/20210907 How to Stop a Program in Linux Terminal.md index 0db2f82279..27b45a42b8 100644 --- a/sources/tech/20210907 How to Stop a Program in Linux Terminal.md +++ b/sources/tech/20210907 How to Stop a Program in Linux Terminal.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/stop-program-linux-terminal/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 697a12455686dfcbbb378069d75543f953509671 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 8 Sep 2021 09:07:50 +0800 Subject: [PATCH 0292/1588] Delete 20210908 .md --- sources/tech/20210908 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210908 .md diff --git a/sources/tech/20210908 .md b/sources/tech/20210908 .md deleted file mode 100644 index a5389b61f9..0000000000 --- a/sources/tech/20210908 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/boot-centos-8-rhel-8-rescue-mode/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/boot-centos-8-rhel-8-rescue-mode/ - -作者:[][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 e9b04ace2078a92d8a30cd07ce498c127ad42332 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Sep 2021 09:11:43 +0800 Subject: [PATCH 0293/1588] APL --- ...penWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md b/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md index 5e539b43fe..a611c7b998 100644 --- a/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md +++ b/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/openwrt-21-02-release/" [#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 00439a8ab103b7b3a02bcfb7ba9374e411635ffd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Sep 2021 09:43:30 +0800 Subject: [PATCH 0294/1588] TSL&PRF --- ...es With Linux Kernel 5.4 - WPA3 Support.md | 98 ------------------- ...es With Linux Kernel 5.4 - WPA3 Support.md | 92 +++++++++++++++++ 2 files changed, 92 insertions(+), 98 deletions(-) delete mode 100644 sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md create mode 100644 translated/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md diff --git a/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md b/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md deleted file mode 100644 index a611c7b998..0000000000 --- a/sources/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md +++ /dev/null @@ -1,98 +0,0 @@ -[#]: subject: "OpenWrt 21.02 Arrives With Linux Kernel 5.4 & WPA3 Support" -[#]: via: "https://news.itsfoss.com/openwrt-21-02-release/" -[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -OpenWrt 21.02 Arrives With Linux Kernel 5.4 & WPA3 Support -====== - -The OpenWrt community announced the first stable update of their series, OpenWrt 21.02. - -In case you did not know, OpenWrt is a project that helps create custom operating systems for embedded devices. - -It enables users to openly customize their devices according to their networking needs, something that the stock router firmware doesn’t. Other than routers, OpenWrt can run on a variety of devices such as smartphones, residential gateways, and even 32 bit PCs! - -With this release, they have over 5800 commits since the older OpenWrt 19.07. - -Let us take a look at what is new with OpenWrt 21.02. - -### OpenWrt 21.02: What’s New? - -While there are several technical changes and improvements, let me highlight the key additions. - -#### WPA3 Support - -Although present in the 19.07 release, the latest security standard for Wi-Fi networks is now included by default in the images. - -WPA3 stands for Wi-Fi Protected Access 3 and is a major improvement in terms of security over the popular WPA2. Backward compatibility is also supported. - -#### TLS and HTTPS Support - -Just like WPA3, TLS and HTTPS support is also included by default. This comes with the trusted CA certificates from Mozilla as well. - -With this addition, _wget_ and _opkg_ should now support fetching resources over HTTPS out-of-the-box. Moreover, [LuCl][1] is available over HTTPS in addition to HTTP. - -#### Initial DSA Support - -As the release announcement states: - -“DSA stands for Distributed Switch Architecture and is the Linux standard to deal with configurable Ethernet switches” - -This has replaced the _swconfig_ system which was being used until now. This is a notable change to how VLANs and switch ports are managed. - -#### New Minimum Hardware Requirements - -With numerous new features and updates to OpenWrt, including the increase in the general size of the Linux kernel, the minimum requirements have been increased. - -Devices now require at least 8 MB of flash and 64 MB memory to run the default build ensuring proper stability. - -#### Package Updates - -The release also comes packed in with several package upgrades, some of them are: - - * Linux kernel 5.4.143 - * gcc 8.4.0 - * glibc 2.33 - * binutils 2.34 - * busybox 1.33.1 - - - -Along with the above-listed packages, there are many others that have also received upgrades. You can get the full technical details in the [official release announcement][2]. - -### Download OpenWrt 21.02 - -You can head to its official website to download the latest stable builds or opt for development snapshots for experiments. - -Instructions to build your own packages, and firmware should be available in their documentation. - -The _sysupgrade_ command can be used to upgrade your system from OpenWrt 19.07 to OpenWrt 21.02. Do note that you won’t be able to upgrade from 18.06. - -[OpenWrt 21.02][3] - -#### 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/openwrt-21-02-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://openwrt.org/docs/techref/luci -[2]: https://openwrt.org/releases/21.02/notes-21.02.0 -[3]: https://openwrt.org/downloads diff --git a/translated/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md b/translated/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md new file mode 100644 index 0000000000..285d520559 --- /dev/null +++ b/translated/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md @@ -0,0 +1,92 @@ +[#]: subject: "OpenWrt 21.02 Arrives With Linux Kernel 5.4 & WPA3 Support" +[#]: via: "https://news.itsfoss.com/openwrt-21-02-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +OpenWrt 21.02 发布,支持 Linux 内核 5.4 和 WPA3 +====== + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/OpenWrt-21.02.jpg?w=1200&ssl=1) + +OpenWrt 社区宣布了该发行版的最新稳定版本:OpenWrt 21.02。 + +补充一句,OpenWrt 是一个帮助你创建嵌入式设备定制操作系统的项目。 + +它使用户能够根据他们的网络需求公开定制他们的设备,这是市面上销售的路由器的固件所没有的功能。除了路由器之外,OpenWrt 还可以在各种设备上运行,如智能手机、住宅网关,甚至是 32 位的个人电脑。 + +自从旧的 OpenWrt 19.07 以来,这个版本的发布带来了超过 5800 个新提交。 + +让我们来看看 OpenWrt 21.02 有哪些新功能。 + +### OpenWrt 21.02 有什么新内容? + +虽然有一些技术上的变化和改进,但让我强调一下主要的新增内容。 + +#### WPA3 支持 + +虽然在 19.07 版本中就已经存在,但这个最新的 Wi-Fi 网络安全标准现在已默认包含在镜像中了。 + +WPA3 的意思是Wi-Fi 受保护接入第三版Wi-Fi Protected Access 3,与流行的 WPA2 相比,在安全方面有很大的改进,也向后兼容。 + +#### TLS 和 HTTPS 支持 + +就像 WPA3 一样,它也默认包括了 TLS 和 HTTPS 支持,并且带有来自 Mozilla 的可信 CA 证书。 + +有了这个支持,无需其它工作,`wget` 和 ` opkg` 现在可以通过 HTTPS 获取资源了。此外,除了 HTTP 之外,[LuCl][1] 也可以通过 HTTPS 获得。 + +#### 初步的 DSA 支持 + +正如其发布公告中所说: + +> “DSA(分布式交换机架构Distributed Switch Architecture)是关于可配置的以太网交换机的 Linux 标准。” + +这取代了直到现在还在使用的 `swconfig` 系统,是对 VLAN 和交换机端口管理方式的一个明显变化。 + +#### 新的最低硬件要求 + +随着 OpenWrt 的众多新功能和更新,以及 Linux 内核的大小的普遍增加,其最低硬件要求也被提高。 + +现在设备需要至少 8MB 的闪存和 64MB 的内存来运行默认的构建版本,以确保适当的稳定性。 + +#### 软件包更新 + +该版本还包含了几个软件包的升级,其中一些是: + + * Linux 内核 5.4.143 + * gcc 8.4.0 + * glibc 2.33 + * binutils 2.34 + * busybox 1.33.1 + +除了上述列出的软件包,还有许多其他软件包也得到了升级。你可以在 [官方发布公告][2] 中了解完整的技术细节。 + +### 下载 OpenWrt 21.02 + +你可以前往其官方网站下载最新的稳定版,或者选择开发快照进行实验。 + +构建自己的软件包和固件的说明应该可以在其文档中找到。 + +可以使用 `sysupgrade` 命令将你的系统从 OpenWrt 19.07 升级到 OpenWrt 21.02。请注意,你无法从 18.06 升级。 + +- [OpenWrt 21.02][3] + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/openwrt-21-02-release/ + +作者:[Rishabh Moharir][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/rishabh/ +[b]: https://github.com/lujun9972 +[1]: https://openwrt.org/docs/techref/luci +[2]: https://openwrt.org/releases/21.02/notes-21.02.0 +[3]: https://openwrt.org/downloads From 8b80ad70ee867105253c033161ae60a6d13b2409 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Sep 2021 09:49:58 +0800 Subject: [PATCH 0295/1588] PUB @wxy https://linux.cn/article-13763-1.html --- ...nWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md (98%) diff --git a/translated/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md b/published/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md similarity index 98% rename from translated/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md rename to published/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md index 285d520559..d0e2b53289 100644 --- a/translated/news/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md +++ b/published/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13763-1.html" OpenWrt 21.02 发布,支持 Linux 内核 5.4 和 WPA3 ====== From 75c0cd92070a3c7d682828f44dda34055b1dd47c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Sep 2021 14:30:18 +0800 Subject: [PATCH 0296/1588] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zz-air 辛苦了,但是我觉得这类文章价值和传播不大,建议可以找一些更有留存价值的文章,比如一些历史类的文章。 --- ...g your team-s implicit values and needs.md | 31 ++++++++++--------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md index 39d7e1cbf2..0314fd00f7 100644 --- a/translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md +++ b/translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md @@ -3,49 +3,52 @@ [#]: author: "Ron McFarland https://opensource.com/users/ron-mcfarland" [#]: collector: "lujun9972" [#]: translator: "zz-air" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 了解团队隐含价值观和需求的指南 ====== -为了增强团队动力,开放的领导可以研究指导成员行为和决策的隐性社会规范。 -![Working meetings can be effective meetings][1] -文化在[开放的组织][2]很重要。 但“文化”似乎是一个如此庞大而复杂的概念。我们该如何帮助开放式的团队组织去理解它呢? +> 为了增强团队动力,开放式领导可以研究指导成员行为和决策的隐性社会规范。 -一个解决方案可能来自于 [_Rule Makers, Rule Breakers_][4]_的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号_。Gelfand 把所有的国家和文化分成简单的两类, 一类是“紧密的”文化另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。 +![](https://img.linux.net.cn/data/attachment/album/202109/08/142831uj5zz2shqr1pybr2.jpg) -In this two-part review of _Rule Makers, Rule Breakers_, 我将解释 Gelfand 的论点,并讨论它对在开放性组织中工作的人们有用的方式。 +文化在 [开放式组织][2] 很重要。但“文化”似乎是一个如此庞大而复杂的概念。我们该如何帮助开放式组织去理解它呢? + +一个解决方案可能来自于《[Rule Makers, Rule Breakers][4]》的作者 [Michele J. Gelfand][3]:紧密和松散的文化以及指导我们生活的秘密信号。Gelfand 把所有的国家和文化分成简单的两类:一类是“紧密的”文化,另一类是“松散的”。然后,她解释了两者的特点和社会规范,提供了它们的相对优势和劣势。通过研究两者,我们可以克服团队、组织和国家之间的分歧和冲突。 + +在这个分为两篇的《Rule Makers, Rule Breakers》的点评中, 我将解释 Gelfand 的论点,并讨论它对在开放性组织中工作的人们有用的方式。 ### 了解你的社会规范 -Gelfand 认为,我们的行为很大程度上取决于我们是生活在 "紧密的" 还是 "松散的" 社区文化中,因为这些文化有不同于其他文化的社会规范。这些规范————以及强制执行的严格程度————将决定我们在社会中的行为。 它们给了我们身份。它们帮助我们彼此协调,简而言之,这些价值使社区团结在一起。 +Gelfand 认为,我们的行为很大程度上取决于我们是生活在“紧密的”还是“松散的”社区文化中,因为每一种文化都有不同于其他文化的社会规范。这些规范 ——— 以及强制执行的严格程度 ——— 将决定我们在社会中的行为。它们给了我们身份,它们帮助我们彼此协调。简而言之,这些价值使社区团结在一起。 它们也会影响我们的世界观,影响我们构造环境的方式,甚至影响我们大脑的处理过程。 Gelfand 写道:“无数研究表明,社会规范对于将社区团结成合作、协调良好的团体,从而实现伟大成就至关重要。” 纵观历史,社区让其公民参加看似最疯狂的仪式,除了维持群体凝聚力和合作外,别无其他原因。 这些仪式产生了更紧密的联系,使人们得以生存(特别是在狩猎、觅食和战争时期)。 -社会规范包括我们所有人都会自动遵守的规则, Gelfand 称之为一种 “规范性自动驾驶仪。” 这些是我们不需要思考就能做的事情————例如,在图书馆、电影院、电梯或飞机上保持安静。 我们会自动的做这些事。 “从外面看,” Gelfand 说, “我们的社会规范通常看起来很奇怪。但在内心深处,我们认为这是理所当然的。” 她解释到,社会规范可以被编入法规和法律(“遵守停车标志”和“不要偷窃”)。还有一些基本上是默不作声的(“不要盯着火车上的人看”或“打喷嚏时捂住嘴”)。当然,它们因环境而异。 +社会规范包括我们所有人都会自动遵守的规则, Gelfand 称之为一种 “规范性自动驾驶仪”。 这些是我们不需要思考就能做的事情————例如,在图书馆、电影院、电梯或飞机上保持安静。 我们会自动的做这些事。 “从表面看,” Gelfand 说, “我们的社会规范通常看起来很奇怪。但在内心深处,我们认为这是理所当然的。” 她解释到,社会规范可以被编入法规和法律(“遵守停车标志”和“不要偷窃”)。还有一些基本上是不言而喻的(“不要盯着火车上的人看”或“打喷嚏时捂住嘴”)。当然,它们因环境而异。 挑战在于大多数社会规范都是无形的,我们不知道这些社会规范在多大程度上控制着我们。在不知不觉中,我们常常只是跟随周围的人群。这被称为“群体思维”,在这种思维中,人们会跟随他们认同的群体,即使这个群体是错误的。他们不想站出来。 ### 组织,有松有紧 -Gelfand 将社会规范组织成不同的群体。她认为,一些规范具有“紧密”文化的特征,而另一些规范则具有“松散”文化的特征。为此, Gelfand 对来自五大洲 30 多个国家的约 7000 人进行了研究和抽样,他们的职业、性别、年龄、宗教、教派,以及社会阶层,以了解这些社区将自己定位在何处(以及他们的社会规范在官方和社区/社区总体上的执行力度)。 紧密和松散文化之间的差异在国家之间、国家内部(如美国及其各个地区)、组织内部、社会阶层内部甚至家庭内部都有所不同。 +Gelfand 将社会规范组织成不同的组别。她认为,一些规范具有“紧密”文化的特征,而另一些规范则具有“松散”文化的特征。为此, Gelfand 对来自五大洲 30 多个国家的约 7000 人进行了研究和抽样,他们具有广泛的职业、性别、年龄、宗教、教派,以及社会阶层,以了解这些社区将自己定位在何处(以及他们的社会规范在官方和社区/社区总体上的执行力度)。 紧密和松散文化之间的差异在国家之间、国家内部(如美国及其各个地区)、组织内部、社会阶层内部甚至家庭内部都有所不同。 -因为组织有文化,它们也有自己的社会规范(毕竟,如果一个组织无法协调其成员并影响其行为,它将无法生存)。 因此,组织也可以反映和灌输 Gelfand 所描述的轻松”或“松散”的文化特征。 并且如果我们有很强的能力识别这些差异,我们就能更成功地预测和解决冲突。然后,在对这些社会规范有了更高认识的情况下,我们可以将开放式组织原则付诸实践。 +因为组织有文化,它们也有自己的社会规范(毕竟,如果一个组织无法协调其成员并影响其行为,它将无法存在)。 因此,组织也可以反映和灌输 Gelfand 所描述的“紧密”或“松散”的文化特征。 并且如果我们有很强的能力识别这些差异,我们就能更成功地预测和解决冲突。然后,在对这些社会规范有了更高认识的情况下,我们可以将开放式组织原则付诸实践。 Gelfand 这样描述紧密和松散文化的区别: -> 从广义上讲,松散的文化倾向于开放,但它们也更加无序。另一方面,紧密的文化有令人欣慰的秩序和可预测性,但它们的容忍度较低。这就是紧-松的权衡:一个领域的优势与另一个领域的劣势并存。 +> 从广义上讲,松散的文化倾向于开放,但它们也更加无序。另一方面,紧密的文化有令人欣慰的秩序和可预测性,但它们的容忍度较低。这就是紧与松的权衡:一个领域的优势与另一个领域的劣势并存。 她总结说,紧密的社会保持着严格的社会秩序、同步性和自律性;宽松的社会以高度宽容、富有创造力和对变化持开放态度而自豪。 虽然并非所有情况都是如此,但紧密和松散的文化通常会表现出一些权衡;每个人都有自己的长处和短处。参见下面的图 1 。 + ![][5] -在这两种环境中成功应用五项开放式组织原则的工作可能会有很大的不同。要取得成功,社区承诺至关重要,如果社会规范不同,承诺的原因也会不同。组织领导者必须知道社区的价值观是什么。只有这样,这个人才能充分激励他人。 +在这两种环境中成功应用五项开放式组织原则的工作可能会有很大的不同。要取得成功,社区承诺至关重要,如果社会规范不同,承诺的理由也会不同。组织领导者必须知道社区的价值观是什么。只有这样,这个人才能充分激励他人。 -在本综述的下一部分中,我将更彻底地解释紧密文化和松散文化的特征,以便领导者能够更好地了解如何将开放式组织原则运用到团队中。 +在本点评的下一部分中,我将更彻底地解释紧密文化和松散文化的特征,以便领导者能够更好地了解如何将开放式组织原则运用到团队中。 -------------------------------------------------------------------------------- @@ -54,7 +57,7 @@ via: https://opensource.com/open-organization/21/8/leadership-cultural-social-no 作者:[Ron McFarland][a] 选题:[lujun9972][b] 译者:[zz-air](https://github.com/zz-air) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 5f1fbebb06f97d0ea95dc7fade3b49d5ec15eded Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Sep 2021 14:30:59 +0800 Subject: [PATCH 0297/1588] PUB @zz-air https://linux.cn/article-13765-1.html --- ... to understanding your team-s implicit values and needs.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210819 A guide to understanding your team-s implicit values and needs.md (98%) diff --git a/translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md b/published/20210819 A guide to understanding your team-s implicit values and needs.md similarity index 98% rename from translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md rename to published/20210819 A guide to understanding your team-s implicit values and needs.md index 0314fd00f7..b883d98c6f 100644 --- a/translated/talk/20210819 A guide to understanding your team-s implicit values and needs.md +++ b/published/20210819 A guide to understanding your team-s implicit values and needs.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zz-air" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13765-1.html" 了解团队隐含价值观和需求的指南 ====== From 7b2ae074e6df30cbdc46858617b204744bfb8359 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Sep 2021 15:28:02 +0800 Subject: [PATCH 0298/1588] PRF @geekpi --- .../20210831 What is a container image.md | 88 +++++++++---------- 1 file changed, 41 insertions(+), 47 deletions(-) diff --git a/translated/tech/20210831 What is a container image.md b/translated/tech/20210831 What is a container image.md index 596520f951..f71dc010d3 100644 --- a/translated/tech/20210831 What is a container image.md +++ b/translated/tech/20210831 What is a container image.md @@ -3,109 +3,103 @@ [#]: author: "Nived V https://opensource.com/users/nivedv" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 什么是容器镜像? ====== -容器镜像包含一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。 -![Shipping containers stacked][1] +> 容器镜像包含一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。 -容器是当今 IT 运维的一个关键部分。一个_容器镜像_包含了一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。 +![](https://img.linux.net.cn/data/attachment/album/202109/08/152733c9i69xsssa62b6rr.jpg) -你通过提供一组特殊格式的指令来创建容器镜像,可以是提交给 Registry,或者是 Dockerfile。 例如,这个 Dockerfile 为 PHP Web 应用创建了一个容器: +容器是当今 IT 运维的一个关键部分。容器镜像container image包含了一个打包的应用,以及它的依赖关系,还有它在启动时运行的进程信息。 +你可以通过提供一组特殊格式的指令来创建容器镜像,可以是提交给注册中心Registry,或者是作为 Dockerfile 保存。例如,这个 Dockerfile 为 PHP Web 应用创建了一个容器: ``` 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 + && 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 + && 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 +CMD php-fpm & httpd -D FOREGROUND ``` -这个文件中的每条指令都会在容器镜像中增加一个_层_。每一层只增加与下面一层的区别,然后,所有这些层叠在一起,形成一个只读的容器镜像。 +这个文件中的每条指令都会在容器镜像中增加一个layer。每一层只增加与下面一层的区别,然后,所有这些堆叠在一起,形成一个只读的容器镜像。 -### 这是怎么做到的? +### 它是如何工作的? 你需要知道一些关于容器镜像的事情,按照这个顺序理解这些概念很重要: - 1. Union 文件系统 - 2. 写入时复制 - 3. Overlay 文件系统 - 4. SnapShotters + 1. 联合文件系统 + 2. 写入时复制(COW) + 3. 叠加文件系统 + 4. 快照器 +### 联合文件系统 +联合文件系统Union File System(UnionFS)内置于 Linux 内核中,它允许将一个文件系统的内容与另一个文件系统的内容合并,同时保持“物理”内容的分离。其结果是一个统一的文件系统,即使数据实际上是以分支形式组织。 -### Union 文件系统(Aufs) - -Union 文件系统(UnionFS)内置于 Linux 内核中,它允许将一个文件系统的内容与另一个文件系统的内容合并,同时保持“物理”内容的分离。其结果是一个统一的文件系统,即使数据实际上是以分支形式组织。 - -这里的想法是,如果你有多个镜像有一些相同的数据,不是让这些数据再次复制过来,而是通过使用一个叫做_层_的东西来共享。 +这里的想法是,如果你有多个镜像有一些相同的数据,不是让这些数据再次复制过来,而是通过使用一个叫做layer的东西来共享。 ![UnionFS][2] -图片 CC BY-SA opensource.com - 每一层都是一个可以在多个容器中共享的文件系统,例如,httpd 基础层是 Apache 的官方镜像,可以在任何数量的容器中使用。想象一下,由于我们在所有的容器中使用相同的基础层,我们节省了多少磁盘空间。 -这些镜像层总是只读的,但是当我们用这个镜像创建一个新的容器时,我们会在它上面添加一个薄的可写层。这个可写层是你创建/修改/删除或进行每个容器所需的其他修改的地方。 +这些镜像层总是只读的,但是当我们用这个镜像创建一个新的容器时,我们会在它上面添加一个薄的可写层。这个可写层是你创建、修改、删除或进行每个容器所需的其他修改的地方。 -### 写时复制 +### 写时复制(COW) 当你启动一个容器时,看起来好像这个容器有自己的整个文件系统。这意味着你在系统中运行的每个容器都需要自己的文件系统副本。这岂不是要占用大量的磁盘空间,而且还要花费大量的时间让容器启动?不是的,因为每个容器都不需要它自己的文件系统副本! -容器和镜像使用写时复制机制来实现这一点。写时复制策略不是复制文件,而是将同一个数据实例分享给多个进程,并且只在一个进程需要修改或写入数据时进行复制。所有其他进程将继续使用原始数据。在运行中的容器中执行任何写操作之前,要修改的文件的副本被放在容器的可写层上。这就是发生_写_的地方。现在你知道为什么它被称为“写时复制”了么。 +容器和镜像使用写时复制copy-on-write(COW)机制来实现这一点。写时复制策略不是复制文件,而是将同一个数据实例分享给多个进程,并且只在一个进程需要修改或写入数据时进行复制。所有其他进程将继续使用原始数据。 + +Docker 对镜像和容器都使用了写时复制的机制。为了做到这一点,在旧版本中,镜像和运行中的容器之间的变化是通过图驱动graph driver来跟踪的,现在则是通过快照器snapshotter来跟踪。 + +在运行中的容器中执行任何写操作之前,要修改的文件的副本被放在容器的可写层上。这就是发生 _写_ 的地方。现在你知道为什么它被称为“写时复制”了么。 这种策略既优化了镜像磁盘空间的使用,也优化了容器启动时间的性能,并与 UnionFS 一起工作。 -### Overlay 文件系统 +### 叠加文件系统 -Overlay 文件系统位于现有文件系统的顶部,结合了上层和下层的目录树,并将它们作为一个单一的目录来呈现。这些目录被称为_层_。下层保持不被修改。每一层只增加与下一层的差异(计算术语为 _diff_),这种统一的过程被称为 _union 挂载_。 +叠加文件系统Overlay File System位于现有文件系统的顶部,结合了上层和下层的目录树,并将它们作为一个单一的目录来呈现。这些目录被称为layer。下层保持不被修改。每一层只增加与下一层的差异(计算机术语为 “diff”),这种统一的过程被称为联合挂载union mount。 -最低的目录或镜像层被称为 _lowerdir_,上面的目录被称为 _upperdir_。最后的覆盖层或统一层被称为 _merged_。 +最低的目录或镜像层被称为下层目录lowerdir,上面的目录被称为 上层目录upperdir。最后的覆盖层或统一层被称为合并层merged。 ![Layered file system][3] -图片 CC BY-SA opensource.com - 常见的术语包括这些层的定义: - * 基础层是你的文件系统的文件所在的地方。就容器镜像而言,这个层就是你的基础镜像。 - * Overlay 层通常被称为_容器层_,因为对运行中的容器所做的所有改变,如添加、删除或修改文件,都会写到这个可写层。对这一层所做的所有修改都存储在下一层,是基础层和 Diff 层的 _union_ 视图。 - * Diff 层包含了在 Overlay 层所作的所有修改。如果你写的东西已经在基础层了,那么 Overlay 文件系统就会把文件复制到 Diff层,并做出你想写的修改。这被称为_写时复制_。 + * 基础层Base layer:是你的文件系统的文件所在的地方。就容器镜像而言,这个层就是你的基础镜像。 + * 叠加层Overlay layer:通常被称为容器层container layer,因为对运行中的容器所做的所有改变,如添加、删除或修改文件,都会写到这个可写层。对这一层所做的所有修改都存储在下一层,是基础层和差异层的联合视图。 + * 差异层Diff layer包含了在叠加层所作的所有修改。如果你写的东西已经在基础层了,那么叠加文件系统就会把文件复制到差异层,并做出你想写的修改。这被称为写时复制。 +### 快照器 +通过使用层和图驱动,容器可以将其更改作为其容器文件系统的一部分来构建、管理和分发。但是使用图驱动graph driver的工作真的很复杂,而且容易出错。快照器SnapShotter与图驱动不同,因为它们不用了解镜像或容器。 -# SnapShotters +快照器的工作方式与 Git 非常相似,比如有树的概念,并跟踪每次提交对树的改变。一个快照snapshot代表一个文件系统状态。快照有父子关系,使用一组目录。可以在父级和其快照之间进行差异比较(`diff`),以创建一个层。 -容器可以使用层和图形驱动程序构建、管理和分发更改作为其容器文件系统的一部分。。但是使用图形驱动的工作真的很复杂,而且容易出错。SnapShotters 与图形驱动不同,因为它们不了解镜像或容器。 - -Snapshotters 的工作方式与 Git 非常相似,比如有树的概念,并跟踪每次提交对树的改变。一个_快照_代表一个文件系统状态。快照有父子关系,使用一组目录。可以在父级和其快照之间进行 _diff_,以创建一个层。 - -Snapshotter 提供了一个用于分配、快照和挂载抽象的分层文件系统的 API。 +快照器提供了一个用于分配、快照和挂载抽象的分层文件系统的 API。 ### 总结 你现在对什么是容器镜像以及它们的分层方法如何使容器可移植有了很好的认识。接下来,我将介绍容器的运行机制和内部结构。 -* * * - -_本文基于 [techbeatly][4] 的文章,经许可后改编。_ +本文基于 [techbeatly][4] 的文章,经许可后改编。 -------------------------------------------------------------------------------- @@ -114,7 +108,7 @@ via: https://opensource.com/article/21/8/container-image 作者:[Nived V][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/) 荣誉推出 @@ -122,5 +116,5 @@ via: https://opensource.com/article/21/8/container-image [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) +[3]: https://miro.medium.com/max/4800/0*h61UE3S0jRPv3mA7 (Layered file system) [4]: https://medium.com/techbeatly/container-part-ii-images-4f2139194775 From fd859792219b1afea6cfb84c560d50ea3eb452ce Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 8 Sep 2021 15:28:44 +0800 Subject: [PATCH 0299/1588] PUB @geekpi https://linux.cn/article-13766-1.html --- .../tech => published}/20210831 What is a container image.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210831 What is a container image.md (99%) diff --git a/translated/tech/20210831 What is a container image.md b/published/20210831 What is a container image.md similarity index 99% rename from translated/tech/20210831 What is a container image.md rename to published/20210831 What is a container image.md index f71dc010d3..7f3729f419 100644 --- a/translated/tech/20210831 What is a container image.md +++ b/published/20210831 What is a container image.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13766-1.html" 什么是容器镜像? ====== From 01877138fcad5010340823b97919bc8aa7b58eaa Mon Sep 17 00:00:00 2001 From: anine Date: Wed, 8 Sep 2021 16:00:33 +0800 Subject: [PATCH 0300/1588] translated --- ...ications in Linux Using Tangram Browser.md | 93 ------------------- ...ications in Linux Using Tangram Browser.md | 93 +++++++++++++++++++ 2 files changed, 93 insertions(+), 93 deletions(-) delete mode 100644 sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md create mode 100644 translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md diff --git a/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md b/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md deleted file mode 100644 index 11ea307510..0000000000 --- a/sources/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: subject: "Run Web Applications in Linux Using Tangram Browser" -[#]: via: "https://itsfoss.com/tangram/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "anine09" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Run Web Applications in Linux Using Tangram Browser -====== - -_**Brief:** Tangram is a browser that aims to help you run and manage web applications in Linux_. _Let’s take a look at how it works._ - -Even if we have native Linux applications available for several tools, many end up using web applications. - -Maybe in the form of an electron app or directly through a web browser, native experiences are becoming an old-school thing. - -Of course, running web applications, no matter the platform, needs more system resources. And, considering every service is going for a web-based approach instead of a native experience, we need solutions to manage the web apps efficiently. - -An open-source Linux app, Tangram, could be the solution. - -### Tangram: A Browser Tailored to Run Web Applications - -![][1] - -You can choose to use some of the [best Linux web browsers][2] to run web applications. But, if you want something that entirely focuses on web application experience, Tangram is an exciting option. - -The developer took inspiration from GNOME Web, [Franz][3], and [Rambox][4]. - -You do not get any fancy features but just the ability to change the user agent and manage the web applications you have logged in to. - -It can be used to access multiple social media platforms, chat messengers, work collaboration applications, and more. - -### Features of Tangram - -![][5] - -Considering it is a minimal browser based on WebKitGTK, not much you can do here. To list some of the essentials, here’s what you can do: - - * Re-order tabs in the sidebar - * Easily add any web service as a web app - * Ability to tweak the user agent (Desktop/mobile) - * Keyboard shortcuts - * Change position of the sidebar (tab bar) - - - -All you need to do is load up a web service, log in, and click on “**Done**” to add it as a web application. - -![][6] - -### Installing Tangram in Linux - -Tangram is available as a Flatpak for every Linux distribution, and you can also find it in [AUR][7]. - -If you want to install it via the terminal, type in the following command: - -``` -flatpak install flathub re.sonny.Tangram -``` - -You may refer to our [Flatpak guide][8] if you do not have it enabled on your system. - -To explore more about it, you can check out its [GitHub page][9]. - -[Tangram Browser][10] - -Have you tried this yet? Do you prefer web applications or native applications? Feel free to share your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/tangram/ - -作者:[Ankush Das][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://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-browser.png?resize=800%2C611&ssl=1 -[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ -[3]: https://itsfoss.com/franz-messaging-app/ -[4]: https://itsfoss.com/rambox/ -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-settings.png?resize=530%2C290&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-whatsapp.png?resize=800%2C431&ssl=1 -[7]: https://itsfoss.com/aur-arch-linux/ -[8]: https://itsfoss.com/flatpak-guide/ -[9]: https://github.com/sonnyp/Tangram -[10]: https://flathub.org/apps/details/re.sonny.Tangram diff --git a/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md b/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md new file mode 100644 index 0000000000..615cc95b10 --- /dev/null +++ b/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md @@ -0,0 +1,93 @@ +[#]: subject: "Run Web Applications in Linux Using Tangram Browser" +[#]: via: "https://itsfoss.com/tangram/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "anine09" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 Tangram Browser 在 Linux 中运行 Web 应用 +======= + +_**导语:**Tangram 是一个旨在帮助你在 Linux 中运行和管理 Web 应用的浏览器_。_一起来看看它是如何使用的吧。_ + +即使我们有许多本地的工具类 Linux 本地应用,但是许多人最终还是选择使用 Web 应用。 + +他们也许是使用 Electron 构建的应用或是直接在浏览器中打开网页,使用本地应用正在成为一种比较“传统”的做法。 + +当然,运行 Web 应用,不管是什么平台,都会占用更多的系统资源。而且,考虑到每一个服务都是基于 Web 端而不是本地,我们就需要一种有效管理 Web 应用的解决方案。 + +因此,我为你介绍一款开源的 Linux 应用,Tangram。 + +### Tangram:专为 Web 应用设计的浏览器 + +![][1] + +你可以选择其他[优秀的浏览器][2]来运行 Web 应用,但是如果你想完全专注于 Web 应用体验的浏览器,Tangram 是个不错的选择。 + +Tangram 的开发者从 GNOME Web,[Franz][3],和 [Rambox][4] 中获得的灵感。 + +没有其他花里胡哨的功能, Tangram 能帮助你改变你的用户代理( User Agent )和管理那些你已经登陆的 Web 应用。 + +它可以用于访问多个社交媒体,聊天工具,工作协同应用等等。 + +### Tangram 的特性 + +![][5] + +考虑到 Tangram 是基于 WebKitGTK 的精简化浏览器,它拥有的功能不算很多,下面是一些功能要点: + + * 重新排列的侧边栏选项卡 + * 方便地添加任何一个 Web 服务作为一个 Web 应用程序 + * 在桌面端和移动端调整用户代理(User Agent) + * 使用键盘快捷键 + * 改变侧边栏和选项卡的位置 + + +你所需要做的就是加载一个 Web 服务,登陆,然后点击**“完成”**,将其添加为 Web 应用程序。 + +![][6] + +### 在 Linux 中安装 Tangram + +每个 Linux 发行版都可以通过 Flatpak 来安装 Tangram,你也可以在 [AUR][7] 中找到它。 + +如果你想通过终端来安装它,输入以下命令: + +``` +flatpak install flathub re.sonny.Tangram +``` + +如果你的系统没有启用 Flatpak,你可以参考我们的 [Flatpak 指南][8]。 + +想要了解更多信息,请访问 [Tangram 的 Github 页面][9]。 + +[Tangram Browser][10] + +你试过 Tangram 吗?你更喜欢 Web 应用还是本地应用?欢迎在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/tangram/ + +作者:[Ankush Das][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://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-browser.png?resize=800%2C611&ssl=1 +[2]: https://itsfoss.com/best-browsers-ubuntu-linux/ +[3]: https://itsfoss.com/franz-messaging-app/ +[4]: https://itsfoss.com/rambox/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-settings.png?resize=530%2C290&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/tangram-web-app-whatsapp.png?resize=800%2C431&ssl=1 +[7]: https://itsfoss.com/aur-arch-linux/ + +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://github.com/sonnyp/Tangram +[10]: https://flathub.org/apps/details/re.sonny.Tangram From 97d87f63dc1092cfc3970192850cda2fa3c2d7af Mon Sep 17 00:00:00 2001 From: perfiffer Date: Wed, 8 Sep 2021 20:06:42 +0800 Subject: [PATCH 0301/1588] translating by perfiffer --- ... USB Drive in Linux Terminal -For Experts and Adventurers.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md b/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md index 03346f2a31..9713676059 100644 --- a/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md +++ b/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/live-usb-with-dd-command/" [#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 609824bbc5117bbe7d16c3be69542ada14e098a9 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Wed, 8 Sep 2021 23:23:31 +0800 Subject: [PATCH 0302/1588] translating by unigeorge --- .../tech/20210907 Use lspci on Linux to see your hardware.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210907 Use lspci on Linux to see your hardware.md b/sources/tech/20210907 Use lspci on Linux to see your hardware.md index dd11793761..4f01fe3985 100644 --- a/sources/tech/20210907 Use lspci on Linux to see your hardware.md +++ b/sources/tech/20210907 Use lspci on Linux to see your hardware.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/lspci-linux-hardware" [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -145,7 +145,7 @@ via: https://opensource.com/article/21/9/lspci-linux-hardware 作者:[Alan Formy-Duval][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 43b7f941b1f3b27c66ba41ac66e81f47b530683c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Sep 2021 03:51:17 +0800 Subject: [PATCH 0303/1588] Revert "translating 20200121 13 of the best React JavaScript frameworks.md" This reverts commit 9dbf1fc55fb6088843f1537b40e38be346d3e440. --- .../tech/20200121 13 of the best React JavaScript frameworks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200121 13 of the best React JavaScript frameworks.md b/sources/tech/20200121 13 of the best React JavaScript frameworks.md index 83b00bdd35..e82ef14a8a 100644 --- a/sources/tech/20200121 13 of the best React JavaScript frameworks.md +++ b/sources/tech/20200121 13 of the best React JavaScript frameworks.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (zpl1025) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From fbfb4af2a03f2e3ba7811775c070bf638a93a89b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Sep 2021 05:03:14 +0800 Subject: [PATCH 0304/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210908?= =?UTF-8?q?=20Apps=20for=20daily=20needs=20part=205:=20video=20editors?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210908 Apps for daily needs part 5- video editors.md --- ...s for daily needs part 5- video editors.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20210908 Apps for daily needs part 5- video editors.md diff --git a/sources/tech/20210908 Apps for daily needs part 5- video editors.md b/sources/tech/20210908 Apps for daily needs part 5- video editors.md new file mode 100644 index 0000000000..0b927ea99c --- /dev/null +++ b/sources/tech/20210908 Apps for daily needs part 5- video editors.md @@ -0,0 +1,88 @@ +[#]: subject: "Apps for daily needs part 5: video editors" +[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/" +[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Apps for daily needs part 5: video editors +====== + +![][1] + +Photo by [Brooke Cagle][2] on [Unsplash][3] + +Video editing has become a popular activity. People need video editors for various reasons, such as work, education, or just a hobby. There are also now many platforms for sharing video on the internet. Almost all social media and chat messengers provide features for sharing videos. This article will introduce some of the open source video editors 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 video editors category. + +### Kdenlive + +When anyone asks about an open source video editor on Linux, the answer that often comes up is Kdenlive. It is a very popular video editor among open source users. This is because its features are complete for general purposes and are easy to use by someone who is not a professional. + +Kdenlive supports multi-track, so you can combine audio, video, images, and text from multiple sources. This application also supports various video and audio formats without having to convert them first. In addition, Kdenlive provides a wide variety of effects and transitions to support your creativity in producing cool videos. Some of the features that Kdenlive provides are titler for creating 2D titles, audio and video scopes, proxy editing, timeline preview, keyframeable effects, and many more. + +![][5] + +More information is available at this link: + +* * * + +### Shotcut + +Shotcut has more or less the same features as Kdenlive. This application is a general purposes video editor. It has a fairly simple interface, but with complete features to meet the various needs of your video editing work. + +Shotcut has a complete set of features for a video editor, ranging from simple editing to high-level capabilities. It also supports various video, audio, and image formats. You don’t need to worry about your work history, because this application has unlimited undo and redo. Shotcut also provides a variety of video and audio effects features, so you have freedom to be creative in producing your video works. Some of the features offered are audio filters, audio mixing, cross fade audio and video dissolve transition, tone generator, speed change, video compositing, 3 way color wheels, track compositing/blending mode, video filters, etc. + +![][6] + +More information is available at this link: + +* * * + +### Pitivi + +Pitivi will be the right choice if you want a video editor that has an intuitive and clean user interface. You will feel comfortable with how it looks and will have no trouble finding the features you need. This application is classified as very easy to learn, especially if you need an application for simple editing needs. However, Pitivi still offers a variety of features, like trimming & cutting, sound mixing, keyframeable audio effects, audio waveforms, volume keyframe curves, video transitions, etc. + +![][7] + +More information is available at this link: + +* * * + +### Cinelerra + +Cinelerra is a video editor that has been in development for a long time. There are tons of features for your video work such as built-in frame render, various video effects, unlimited layers, 8K support, multi camera support, video audio sync, render farm, motion graphics, live preview, etc. This application is maybe not suitable for those who are just learning. I think it will take you a while to get used to the interface, especially if you are already familiar with other popular video editor applications. But Cinelerra will still be an interesting choice as your video editor. + +![][8] + +More information is available at this link: [][9] + +* * * + +### Conclusion + +This article presented four video editor apps for your daily needs that are available on Fedora Linux. Actually there are many other video editors that you can use in Fedora Linux. You can also use Olive (Fedora Linux repo), OpenShot (rpmfusion-free) , Flowblade (rpmfusion-free) and many more. Each video editor has its own advantages. Some are better at correcting color, while others are better at a variety of transitions and effects. Some are better when it comes to how easy it is to add text. Choose the application that suits your needs. Hopefully this article can help you to choose the right video editors. If you have experience in using these applications, please share your experience in the comments. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-5-video-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/08/FedoraMagz-Apps-5-video-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/video-kdenlive-1024x576.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-shotcut-1024x576.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-pitivi-1024x576.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-cinelerra-1024x576.png +[9]: https://www.olivevideoeditor.org/ From 817cd4070dbd05b3d6aec225ebaf729edaffefe4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Sep 2021 05:03:35 +0800 Subject: [PATCH 0305/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210909?= =?UTF-8?q?=20How=20to=20Change=20Color=20of=20Ubuntu=20Terminal?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210909 How to Change Color of Ubuntu Terminal.md --- ... How to Change Color of Ubuntu Terminal.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20210909 How to Change Color of Ubuntu Terminal.md diff --git a/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md b/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md new file mode 100644 index 0000000000..c4cd318c4c --- /dev/null +++ b/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md @@ -0,0 +1,99 @@ +[#]: subject: "How to Change Color of Ubuntu Terminal" +[#]: via: "https://itsfoss.com/change-terminal-color-ubuntu/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Change Color of Ubuntu Terminal +====== + +The default terminal looks good enough if you want to get things done. + +But, if you want a unique terminal experience or something that suits your taste, you can also change the color of your Ubuntu terminal. + +In this quick tutorial, I shall focus on tweaking the color scheme of the terminal in Ubuntu. Ubuntu uses GNOME Terminal so the steps should be valid for most other distributions using GNOME desktop environment. + +### Changing the color of your Ubuntu terminal + +The steps are similar to how you [change the font and size of the terminal][1]. You have to find the option for customizing colors, that’s it. + +Let me quickly highlight what you need to go through to find it: + +**Step 1**. [Open the terminal window in Ubuntu][2] by pressing Ctrl+Alt+T. + +**Step 2**. Head to the terminal preferences. You can click on the menu button to access the **Preferences** or right-click anywhere on the terminal screen. + +![][3] + +It will be a good idea to create a separate profile for your customization so that the default settings do not change. + +![][4] + +**Step 3**. Now, you can find the options to tweak the font size and style. But, here, you need to head to the “**Colors**” tab, as shown in the screenshot below. + +![][5] + +**Step 4**. By default, you will notice that it uses colors from the system theme. If you want to blend in with your system theme, that should be the preferred choice. + +But, if you want to customize, you need to deselect the option and then start choosing the colors. + +![][6] + +As you can notice in the screenshot above, you can choose to use some of the built-in color schemes and also get to customize them to your liking _**by changing the default color option for the text and background.**_ + +You can customize every aspect of the terminal screen color, starting from the texts to the cursor, if you select a “custom” built-in scheme. + +![][7] + +Again! Create separate profiles if you want to access different customized versions of the terminal quickly or else you will end up customizing every time you want a specific color combination. + +### Other ways to change the terminal color + +Here are a couple of other ways to change the terminal color in Ubuntu: + +#### Change the theme + +Most Ubuntu themes have their own implementation of terminal colors and some of them actually look very nice. Here is how the terminal color scheme is changed for Ant and Orchis themes. + +![][8] + +You choose a dark theme and your terminal turns black. No need to wonder about selecting color schemes. + +#### Change terminal color based on your wallpaper + +If you do not want to customize the colors of your terminal manually, you can utilize Pywal. With this handy Python tool, you can [change the color scheme of your terminal][9] as per your wallpaper. + +It will automatically adapt to any of your active wallpapers. So, you do not have to bother customizing the terminal. + +### More Customization Options for Your Terminal + +If you are more of a tinkerer, you would love to know that you have more options to customize the look of the terminal. You can read through our resource on [different ways to tweak the look of the terminal][10] to explore more about it. + +_How do you prefer to customize the terminal? Let me know your experiences in the comments below!_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/change-terminal-color-ubuntu/ + +作者:[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://itsfoss.com/change-terminal-font-ubuntu/ +[2]: https://itsfoss.com/open-terminal-ubuntu/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-preference.png?resize=800%2C428&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/terminal-profiles.jpg?resize=800%2C619&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-colors-option.png?resize=800%2C330&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/changing-colors-ubuntu-terminal.webp?resize=800%2C654&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-color-customize.png?resize=800%2C550&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-ant-theme.png?resize=742%2C316&ssl=1 +[9]: https://itsfoss.com/pywal/ +[10]: https://itsfoss.com/customize-linux-terminal/ From 3954a92b74b40e39f200000e5f9d51209bbcb35b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Sep 2021 05:03:51 +0800 Subject: [PATCH 0306/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210909?= =?UTF-8?q?=20How=20to=20change=20Ubuntu=20Terminal=20Font=20and=20Size=20?= =?UTF-8?q?[Beginner=E2=80=99s=20Tip]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210909 How to change Ubuntu Terminal Font and Size -Beginner-s Tip.md --- ... Terminal Font and Size -Beginner-s Tip.md | 109 ++++++++++++++++++ 1 file changed, 109 insertions(+) create mode 100644 sources/tech/20210909 How to change Ubuntu Terminal Font and Size -Beginner-s Tip.md diff --git a/sources/tech/20210909 How to change Ubuntu Terminal Font and Size -Beginner-s Tip.md b/sources/tech/20210909 How to change Ubuntu Terminal Font and Size -Beginner-s Tip.md new file mode 100644 index 0000000000..f4127340bb --- /dev/null +++ b/sources/tech/20210909 How to change Ubuntu Terminal Font and Size -Beginner-s Tip.md @@ -0,0 +1,109 @@ +[#]: subject: "How to change Ubuntu Terminal Font and Size [Beginner’s Tip]" +[#]: via: "https://itsfoss.com/change-terminal-font-ubuntu/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to change Ubuntu Terminal Font and Size [Beginner’s Tip] +====== + +If you are spending a lot of time using the terminal on Ubuntu, you may want to adjust the font and size to get a good experience. + +Changing the font is one of the simplest but most visual way of [Linux terminal customization][1]. Let me show you the detailed steps for changing the terminal fonts in Ubuntu along with some tips and suggestions on font selection. + +_**Note:**_ _The steps should be the same for most other [Linux terminal emulator][2] but the way you access the option can differ._ + +### Change Ubuntu Terminal font and size using GUI + +**Step 1.** [Launch the terminal on your Ubuntu][3] system by using Ctrl+Alt+T keys. + +**Step 2.** Head to the “**Preferences**” option that you can find when you click on the menu. + +![][4] + +You can also perform a right-click anywhere on the terminal to access the option as shown below. + +![][5] + +**Step 3.** Now, you should be able to access the settings for the terminal. By default, there will be an unnamed profile. This is the default profile. **I suggest creating a new profile** so that your changes do not impact the default settings. + +![][6] + +**Step 4**. To change the font, you need to enable the “**Custom font**” option and then click on “**Monospace Regular**” + +![][7] + +It will show a list of fonts available for selection. + +![][8] + +Here, you get a quick preview of the font at the bottom of the font listing and also the ability to tweak the font size of your Ubuntu terminal. + +By default, it uses a size of **12** for the font and **Ubuntu mono** style. + +**Step 5**. Finally, you can search for your preferred font style and hit “**Select**” to finalize it after looking at the preview and adjusting the font size. + +![][9] + +That’s it. You have successfully changed the fonts. See the changes in the image below. Move the slider to see the difference. + +![Ubuntu terminal font change][10] + +#### Want to Customize the Look of your Linux Terminal? + +Check out our detailed article on some terminal customization tips and tricks. + +[Linux Terminal Tweaks][1] + +### Tips on getting new fonts for Ubuntu terminal + +You can download fonts from the internet in TTF file format and [easily install these new fonts in Ubuntu][11] by double-clicking the TTF file. + +![][12] + +You should open a new terminal window to load the newly installed fonts. + +However, keep in mind that **Ubuntu will not show ALL the newly installed fonts in the terminal**. Why? Because the terminal is designed to use monospaced fonts. Fonts that have letters too close to each other may look weird. Some fonts do not offer proper clarity between the alphabet O and the number 0. Similarly, you may face issues in differentiating the lowercase l and i. + +This is why you’ll see the available fonts in the terminal are often have ‘mono’ in their name. + +Overall, there can be plenty of readability issues that could create more confusion. Hence, it is best to select a font that does not make the terminal hard to read. + +You should also check if a font looks good/weird when you increase/decrease the size of the font to ensure that you do not have a problem when customizing the look of your terminal. + +### Font suggestions for terminal customization + +Free mono and Noto mono are some of the good fonts available from the default list of font selections to apply on your terminal. + +You can try [installing new fonts in Linux][11] like **JetBrains Mono**, and **Robo Mono**, Larabiefont, Share Tech Mono and more from Google Fonts and other sources. + +_What font style/size do you prefer to use with the Ubuntu terminal? Let us know in the comments below!_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/change-terminal-font-ubuntu/ + +作者:[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://itsfoss.com/customize-linux-terminal/ +[2]: https://itsfoss.com/linux-terminal-emulators/ +[3]: https://itsfoss.com/open-terminal-ubuntu/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-preference.png?resize=800%2C428&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/terminal-right-click-menu.png?resize=800%2C341&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-preference-option.png?resize=800%2C303&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/enable-font-change-ubuntu-terminal.png?resize=798%2C310&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/monospace-font-default.png?resize=800%2C651&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-custom-font-selection.png?resize=800%2C441&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-terminal-font-2.png?resize=723%2C353&ssl=1 +[11]: https://itsfoss.com/install-fonts-ubuntu/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/12/install-new-fonts-ubuntu.png?resize=800%2C463&ssl=1 From b0303df120fc99a8091d1c0272a8569d9ca14e60 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Sep 2021 05:04:16 +0800 Subject: [PATCH 0307/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210908?= =?UTF-8?q?=20How=20I=20migrated=20a=20WordPress=20website=20to=20a=20new?= =?UTF-8?q?=20host?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210908 How I migrated a WordPress website to a new host.md --- ...rated a WordPress website to a new host.md | 288 ++++++++++++++++++ 1 file changed, 288 insertions(+) create mode 100644 sources/tech/20210908 How I migrated a WordPress website to a new host.md diff --git a/sources/tech/20210908 How I migrated a WordPress website to a new host.md b/sources/tech/20210908 How I migrated a WordPress website to a new host.md new file mode 100644 index 0000000000..637074a2f1 --- /dev/null +++ b/sources/tech/20210908 How I migrated a WordPress website to a new host.md @@ -0,0 +1,288 @@ +[#]: subject: "How I migrated a WordPress website to a new host" +[#]: via: "https://opensource.com/article/21/9/migrate-wordpress" +[#]: author: "David Both https://opensource.com/users/dboth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I migrated a WordPress website to a new host +====== +Use this simple approach to migrate a website and manage firewall +configurations. +![Text editor on a browser, in blue][1] + +Have you ever needed to migrate a WordPress website to a new host? I have done it several times and found the process to be quite easy. Of course, I don't use the recommended methods for doing most things, and this is no exception–I use the easy way, and that is what I recommend. + +This migration is non-destructive, so it is simple to revert to the original server if that should be necessary for any reason. + +### Components of a WordPress website + +Three main components are required to run a website based on [WordPress][2]: WordPress itself, a webserver such as [Apache][3] (which I use), and the [MariaDB][4]. MariaDB is a fork of MySQL and is functionally equivalent. + +There are plenty of webservers out there, but I prefer Apache because I have used it for so long. You may need to adapt the Apache configuration I use here to whatever webserver you are using. + +### The original setup + +I use one Linux host as a firewall and router for my network. The webserver is a different host inside my network. My internal network uses what used to be called a class C private network address range, but which is simply referred to as 192.168.0.0/24 in the [Classless Internet Domain Routing (CIDR)][5] methodology. + +For the firewall, I use the very simple [IPTables][6], which I prefer over the much more complex `firewalld`. One line in this firewall configuration sends incoming packets on port 80 (HTTP) to the webserver. As you can see by the comments, I placed rules to forward other inbound server connections to the same server on their appropriate ports in the `/etc/sysconfig/iptables` file. + + +``` +# Reroute ports for inbound connections to the appropriate web/email/etc server. +# HTTPD goes to 192.168.0.75 +-A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \ + +  -j DNAT --to-destination 192.168.0.75:80 +``` + +I set up my original Apache webserver using named virtual hosts because I served multiple websites from this one HTTPD instance. It is always a good idea to use the named virtual host configuration approach because, like me, you may decide to host additional sites later, and this process makes that easier to do. + +The virtual host stanza for the website to be moved in `/etc/httpd/conf/httpd.conf` looks like the one below. There are no IP addresses in this stanza, so it needs no changes for use on the new server. + + +``` +<VirtualHost *:80> +   ServerName [www.website1.org][7] +   ServerAlias server.org + +DocumentRoot "/var/website1/html" +   ErrorLog "logs/error_log" +   ServerAdmin [me@website1.org][8] +  +<Directory "/var/website1/html"> +      Options Indexes FollowSymLinks +  +AllowOverride None +      Require all granted +  +</Directory> +</VirtualHost> +``` + +The `Listen` directive near the top of the `httpd.conf` file looks like this before the migration. This is the actual IP private address of the server and not the public IP address. + + +``` +`Listen 192.168.0.75:80` +``` + +You need to change the `Listen` IP address on the new host. + +### Preparation + +The preparation can be accomplished with three steps: + + * Install the services. + * Configure the firewall. + * Configure the webserver. + + + +#### Install Apache and MariaDB + +Install Apache and MariaDB if they are not already on your new server. It is not necessary to install WordPress. + + +``` +`dnf -y install httpd mariadb` +``` + +#### New server firewall configuration + +Ensure that the firewall on the new server allows port 80. You do have a firewall on _all_ of your computers, right? Most modern distributions use an initial setup that includes a firewall that blocks all incoming traffic to ensure a higher level of security. + +The first line in the snippet below may already be part of your IPTables or other netfilter-based firewall. It identifies inbound packets that have already been recognized as coming from an acceptable source and bypasses additional INPUT filter rules, thus saving time and CPU cycles. The last line in the snippet identifies new incoming connections to HTTPD on port 80 and accepts them. + + +``` +-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT +<snip> +# HTTP +-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT +``` + +The following sample `/etc/sysconfig/iptables` file is an example of a minimal set of IPTables rules that allow incoming connections on SSH (port 22) and HTTPD (port 80) . + + +``` +*filter +:INPUT ACCEPT [0:0] +:FORWARD ACCEPT [0:0] +:OUTPUT ACCEPT [0:0] +-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT +-A INPUT -p icmp -j ACCEPT +-A INPUT -i lo -j ACCEPT +# SSHD +-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT +# HTTP +-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT + +# Final disposition for unmatched packets +-A INPUT -j REJECT --reject-with icmp-host-prohibited +-A FORWARD -j REJECT --reject-with icmp-host-prohibited +COMMIT +``` + +All I needed on my new server host was to add the last line in the snippet above to my firewall rules in the `/etc/sysconfig/iptables` file and then reload the revised ruleset. + + +``` +`iptables-restore /etc/sysconfig/iptables` +``` + +Most current Red Hat-based distributions, such as Fedora, use `firewalld`. I don't use it because I find it far more complex than it needs to be for use cases such as home or small to medium businesses. To add inbound port 80 to `firewalld`, I suggest you refer to the [firewalld web page][9]. + +Your firewall and its configuration details might differ from these, but the objective is to allow incoming connections to HTTPD on port 80 of the new web server. + +#### HTTPD configuration + +Configure HTTPD in the `/etc/httpd/conf/httpd.conf` file. Set the IP address in the Listen stanza as shown below. The IP address of my new web server is 192.168.0.125. + + +``` +`Listen 192.168.0.125:80` +``` + +Copy the VirtualHost stanza for the website being moved and paste it at the end of the `httpd.conf` file of the new server. + +### The move + +Only two sets of data need to be moved to the new server—the database itself and the website directory structure. Create `tar` archives of the two directories. + + +``` +cd /var ; tar -cvf /tmp/website.tar website1/ +cd /var/lib ; tar -cvf /tmp/database.tar mysql/ +``` + +Copy those tarballs to the new server. I usually store files like this in `/tmp`, which is what it is for. Run the following commands on the new server to extract the files from the tar archives into the correct directories. + + +``` +cd /var ; tar -xvf /tmp/website.tar +cd /var/lib ; tar -xvf /tmp/database.tar +``` + +All WordPress files are contained in the `/var/website1`, so they do not need to be installed on the new server. The WordPress installation procedure does not need to be performed on the new server. + +This directory is all that needs to be moved to the new server. + +The last step before making the switch is to start (or restart) the `mysqld` and `httpd` service daemons. WordPress is not a service, so it is not started as a daemon. + + +``` +`systemctl start mysqld ; systemctl start httpd` +``` + +You should check the status of these services after starting them. + + +``` +systemctl status mysqld +● mariadb.service - MariaDB 10.5 database server +    Loaded: loaded (/usr/lib/systemd/system/mariadb.service; enabled; vendor preset: disabled) +    Active: active (running) since Sat 2021-08-21 14:03:44 EDT; 4 days ago +        Docs: man:mariadbd(8) + + +   Process: 251783 ExecStartPre=/usr/libexec/mariadb-check-socket (code=exited, status=0/SUCCESS) +   Process: 251805 ExecStartPre=/usr/libexec/mariadb-prepare-db-dir mariadb.service (code=exited, status=0/SUCCESS) +   Process: 251856 ExecStartPost=/usr/libexec/mariadb-check-upgrade (code=exited, status=0/SUCCESS) + Main PID: 251841 (mariadbd) +      Status: "Taking your SQL requests now..." +      Tasks: 15 (limit: 19003) +    Memory: 131.8M +        CPU: 1min 31.793s +    CGroup: /system.slice/mariadb.service +└─251841 /usr/libexec/mariadbd --basedir=/usr + +Aug 21 14:03:43 simba.stmarks-ral.org systemd[1]: Starting MariaDB 10.5 database server... +Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: Database MariaDB is probably initialized in /var/lib/mysql already, n> +Aug 21 14:03:43 simba.stmarks-ral.org mariadb-prepare-db-dir[251805]: If this is not the case, make sure the /var/lib/mysql is empty before> +Aug 21 14:03:44 simba.stmarks-ral.org mariadbd[251841]: 2021-08-21 14:03:44 0 [Note] /usr/libexec/mariadbd (mysqld 10.5.11-MariaDB) startin> +Aug 21 14:03:44 simba.stmarks-ral.org systemd[1]: Started MariaDB 10.5 database server. + +systemctl status httpd +● httpd.service - The Apache HTTP Server +   Loaded: loaded (/usr/lib/systemd/system/httpd.service; enabled; vendor preset: disabled) +   Drop-In: /usr/lib/systemd/system/httpd.service.d +└─php-fpm.conf +      Active: active (running) since Sat 2021-08-21 14:08:39 EDT; 4 days ago +        Docs: man:httpd.service(8) +   Main PID: 252458 (httpd) +      Status: "Total requests: 10340; Idle/Busy workers 100/0;Requests/sec: 0.0294; Bytes served/sec: 616 B/sec" +        Tasks: 278 (limit: 19003) +      Memory: 44.7M +        CPU: 2min 31.603s +   CGroup: /system.slice/httpd.service +├─252458 /usr/sbin/httpd -DFOREGROUND +├─252459 /usr/sbin/httpd -DFOREGROUND +├─252460 /usr/sbin/httpd -DFOREGROUND +├─252461 /usr/sbin/httpd -DFOREGROUND +├─252462 /usr/sbin/httpd -DFOREGROUND +└─252676 /usr/sbin/httpd -DFOREGROUND + +Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Starting The Apache HTTP Server... +Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: AH00112: Warning: DocumentRoot [/var/teststmarks-ral/html] does not exist +Aug 21 14:08:39 simba.stmarks-ral.org httpd[252458]: Server configured, listening on: port 80 +Aug 21 14:08:39 simba.stmarks-ral.org systemd[1]: Started The Apache HTTP Server. +``` + +### Making the final switch + +Now that the required services are up and running, you can change the firewall rule for HTTPD to the following in the `/etc/sysconfig/iptables` file. + + +``` +-A PREROUTING -d 45.20.209.41/255.255.255.248 -p tcp -m tcp --dport 80 \ +  -j DNAT --to-destination 192.168.0.125:80 +``` + +Then reload the IPTables rule set. + + +``` +`iptables-restore /etc/sysconfig/iptables` +``` + +Because of the firewall rules in the firewall host, it is not necessary to change the external DNS entries to point to the new server. If you use an internal DNS server, you will need to make the IP address change to that A record in your internal DNS database. If you don't use an internal DNS server, be sure to set the correct address for your new server in the `/etc/hosts` files of your host computers. + +### Testing and cleanup + +Be sure to test your new setup. First, turn off the `mysqld` and `httpd` services on the old server. Then access the website with a browser. If everything works as it should, you can disable `mysqld` and `httpd` on the old server. If there is a failure, you can change the IPTables routing rule back to the old server until the problem is fixed. + +I then removed both MySQL and HTTPD from the old server to ensure that they cannot be started accidentally. + +### Conclusion + +It really is that simple. There is no need to perform export or import procedures on the database because everything necessary is copied over in the `mysql` directory. The only reason you might want to deal with the export/import procedure is if there are databases other than those for the website or sites in the same instance of the MariaDB that you don't want copied to the new server. + +Migrating the rest of the websites served by the old server is easy too. All of the databases required for the additional sites have already been moved over with MariaDB. It is only necessary to move the `/var/website` directories to the new server, add the appropriate virtual host stanzas, and restart HTTPD. + +I have used this procedure multiple times for migrating a website from one server to another, and it always works well. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/migrate-wordpress + +作者:[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/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue) +[2]: https://wordpress.org/ +[3]: https://opensource.com/article/18/2/how-configure-apache-web-server +[4]: https://mariadb.org/ +[5]: https://opensource.com/article/16/12/cidr-network-notation-configuration-linux +[6]: https://en.wikipedia.org/wiki/Iptables +[7]: http://www.website1.org +[8]: mailto:me@website1.org +[9]: https://firewalld.org/documentation/howto/open-a-port-or-service.html From 619262b5cdb0dfe5597f4376990edb0006af5ad9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 9 Sep 2021 05:04:34 +0800 Subject: [PATCH 0308/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210908?= =?UTF-8?q?=20Debug=20a=20web=20page=20error=20from=20the=20command=20line?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210908 Debug a web page error from the command line.md --- ... a web page error from the command line.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20210908 Debug a web page error from the command line.md diff --git a/sources/tech/20210908 Debug a web page error from the command line.md b/sources/tech/20210908 Debug a web page error from the command line.md new file mode 100644 index 0000000000..62616cfa08 --- /dev/null +++ b/sources/tech/20210908 Debug a web page error from the command line.md @@ -0,0 +1,95 @@ +[#]: subject: "Debug a web page error from the command line" +[#]: via: "https://opensource.com/article/21/9/wget-debug-web-server" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Debug a web page error from the command line +====== +One way to debug a web server is by using the wget command-line program. +![Digital creative of a browser on the internet][1] + +Sometimes when managing a website, things can get messed up. You might remove some stale content and replace it with a redirect to other pages. Later, after making other changes, you find some web pages become entirely inaccessible. You might see an error in your browser that "The page isn't redirecting properly" with a suggestion to check your cookies. + +![Redirect loop example in Firefox][2] + +Screenshot by Jim Hall, [CC-BY SA 4.0][3] + +One way to debug this situation is by using the `wget` command-line program, with the `-S` option to show all server responses. When using `wget` for debugging, I also prefer to save the output to some temporary file, using the `-O` option, in case I need to view its contents later. + + +``` +$ wget -O /tmp/test.html -S +\--2021-08-24 17:09:49--   +Connecting to 10.0.0.11:80... connected. +HTTP request sent, awaiting response...  +  +HTTP/1.1 302 Found +  +Date: Tue, 24 Aug 2021 22:09:49 GMT +  +Server: Apache/2.4.48 (Fedora) +  +X-Powered-By: PHP/7.4.21 +  +Location: +  +Content-Length: 0 +  +Keep-Alive: timeout=5, max=100 +  +Connection: Keep-Alive +  +Content-Type: text/html; charset=UTF-8 +Location: [following] +\--2021-08-24 17:09:49--   +Reusing existing connection to 10.0.0.11:80. +HTTP request sent, awaiting response...  +  +HTTP/1.1 302 Found +  +Date: Tue, 24 Aug 2021 22:09:49 GMT +  +Server: Apache/2.4.48 (Fedora) +  +X-Powered-By: PHP/7.4.21 +  +Location: +  +Content-Length: 0 +  +Keep-Alive: timeout=5, max=99 +  +Connection: Keep-Alive +  +Content-Type: text/html; charset=UTF-8 +Location: [following] +\--2021-08-24 17:09:49--   +Reusing existing connection to 10.0.0.11:80. +. +. +. +20 redirections exceeded. +``` + +I've omitted a lot of repetition in this output. By reading the server responses, you can see that `http ://10.0.0.11/announce/` redirects immediately to `http ://10.0.0.11/assets/`, which then redirects back to `http ://10.0.0.11/announce/`. And so on. This is an endless loop and `wget` will exit after 20 redirections. But armed with this debugging information, you can fix the redirects and avoid the loop. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/wget-debug-web-server + +作者:[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/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) +[2]: https://opensource.com/sites/default/files/uploads/firefox-redirect-loop.png (Redirect loop example in Firefox) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ From 86cf422f293cb9177f98cf4956afbbdaa4c7a335 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 9 Sep 2021 08:39:11 +0800 Subject: [PATCH 0309/1588] translated --- ...Resize an image from the Linux terminal.md | 81 ------------------- ...Resize an image from the Linux terminal.md | 81 +++++++++++++++++++ 2 files changed, 81 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/20210906 Resize an image from the Linux terminal.md create mode 100644 translated/tech/20210906 Resize an image from the Linux terminal.md diff --git a/sources/tech/20210906 Resize an image from the Linux terminal.md b/sources/tech/20210906 Resize an image from the Linux terminal.md deleted file mode 100644 index ed603fbb16..0000000000 --- a/sources/tech/20210906 Resize an image from the Linux terminal.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: subject: "Resize an image from the Linux terminal" -[#]: via: "https://opensource.com/article/21/9/resize-image-linux" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Resize an image from the Linux terminal -====== -Shrink an image from your terminal with the ImageMagick convert command. -![Old camera blue][1] - -ImageMagick is a handy multipurpose command-line tool for all your image needs. ImageMagick supports a variety of image types, including JPG photos and PNG graphics. - -### Resizing images - -I often use ImageMagick on my webserver to resize images. For example, let's say I want to include a photo of my cats on my personal website. The photo from my phone is very large, about 4000x3000 pixels, at 3.3MB. That's much too large for a web page. I use the ImageMagick convert tool to change the size of my photo so that I can include it on my web page. ImageMagick is a full suite of tools, one of the most common is the `convert` command. - -The ImageMagick `convert` command uses this general syntax: - - -``` -`convert {input} {actions} {output}` -``` - -To resize a photo called `PXL_20210413_015045733.jpg` to a more manageable 500-pixel width, type this: - - -``` -`$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg` -``` - -The new image is now only 65KB in size.  - -![Sleeping cats][2] - -Jim Hall, [CC BY-SA 4.0][3] - -You can provide both width and height dimensions with the `-resize` option. But, by providing only the width, ImageMagic does the math for you and automatically retains the aspect ratio by resizing the output image with a proportional height. - -### Install ImageMagick on Linux - -On Linux, you can install ImageMagick using your package manager. For instance, on Fedora or similar: - - -``` -`$ sudo dnf install imagemagick` -``` - -On Debian and similar: - - -``` -`$ sudo apt install imagemagick` -``` - -On macOS, use [MacPorts][4] or [Homebrew][5]. - -On Windows, use [Chocolatey][6]. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/resize-image-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/osdc-photo-camera-blue.png?itok=AsIMZ9ga (Old camera blue) -[2]: https://opensource.com/sites/default/files/sleeping-cats.jpg (Sleeping cats) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ -[4]: https://opensource.com/article/20/11/macports -[5]: https://opensource.com/article/20/6/homebrew-mac -[6]: https://opensource.com/article/20/3/chocolatey diff --git a/translated/tech/20210906 Resize an image from the Linux terminal.md b/translated/tech/20210906 Resize an image from the Linux terminal.md new file mode 100644 index 0000000000..9672eda344 --- /dev/null +++ b/translated/tech/20210906 Resize an image from the Linux terminal.md @@ -0,0 +1,81 @@ +[#]: subject: "Resize an image from the Linux terminal" +[#]: via: "https://opensource.com/article/21/9/resize-image-linux" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +从 Linux 终端调整图像的大小 +====== +用 ImageMagick 的转换命令从你的终端收缩一张图像。 +![Old camera blue][1] + +ImageMagick 是一个方便的多用途命令行工具,它能满足你所有的图像需求。ImageMagick 支持各种图像类型,包括 JPG 照片和 PNG 图形。 + +### 调整图像大小 + +我经常在我的网络服务器上使用 ImageMagick 来调整图像大小。例如,假设我想在我的个人网站上发一张我的猫的照片。我手机里的照片非常大,大约 4000x3000 像素,有 3.3MB。这对一个网页来说太大了。我使用 ImageMagick 转换工具来改变照片的大小,这样我就可以把它放在我的网页上。ImageMagick 是一套完整的工具,其中最常用的是 `convert` 命令。 + +ImageMagick 的 `convert` 命令使用这样的一般语法: + + +``` +`convert {input} {actions} {output}` +``` + +要将一张名为 `PXL_20210413_015045733.jpg` 的照片调整到一个更容易管理的 500 像素宽度,请输入: + + +``` +`$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg` +``` + +现在新图片的大小只有 65KB。 + +![Sleeping cats][2] + +Jim Hall,[CC BY-SA 4.0][3] + +你可以用 `-resize` 选项同时提供宽度和高度尺寸。但是,如果只提供宽度,ImageMagic 就会为你做计算,并通过调整输出图像的高度比例来自动保留长宽比。 + +### 在 Linux 上安装 ImageMagick + +在 Linux 上,你可以使用你的包管理器安装 ImageMagick。例如,在 Fedora 或类似系统上: + + +``` +`$ sudo dnf install imagemagick` +``` + +在 Debian 和类似系统上: + + +``` +`$ sudo apt install imagemagick` +``` + +在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。 + +在 Windows 上,使用 [Chocolatey][6]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/resize-image-linux + +作者:[Jim Hall][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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-photo-camera-blue.png?itok=AsIMZ9ga (Old camera blue) +[2]: https://opensource.com/sites/default/files/sleeping-cats.jpg (Sleeping cats) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://opensource.com/article/20/11/macports +[5]: https://opensource.com/article/20/6/homebrew-mac +[6]: https://opensource.com/article/20/3/chocolatey From ce16426a695cde58d3f385a80185f892183a8a43 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 9 Sep 2021 08:43:47 +0800 Subject: [PATCH 0310/1588] translating --- .../20210908 Debug a web page error from the command line.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210908 Debug a web page error from the command line.md b/sources/tech/20210908 Debug a web page error from the command line.md index 62616cfa08..a933c507b2 100644 --- a/sources/tech/20210908 Debug a web page error from the command line.md +++ b/sources/tech/20210908 Debug a web page error from the command line.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/wget-debug-web-server" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 5fc46b68eaebb81e4ed6f9ffaed8ba9708ff283d Mon Sep 17 00:00:00 2001 From: SamMa Date: Thu, 9 Sep 2021 09:17:11 +0800 Subject: [PATCH 0311/1588] Update 20210820 Check file status on Linux with the stat command.md --- ...e status on Linux with the stat command.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/translated/tech/20210820 Check file status on Linux with the stat command.md b/translated/tech/20210820 Check file status on Linux with the stat command.md index c89b1c0883..287613b4bc 100644 --- a/translated/tech/20210820 Check file status on Linux with the stat command.md +++ b/translated/tech/20210820 Check file status on Linux with the stat command.md @@ -3,28 +3,28 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "New-World-2019" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " 在 Linux 上使用 stat 命令查看文件状态 ====== -只需要一个 Linux 命令,你就可以获取到任何文件或文件系统的所有信息。 +获取到任何文件或文件系统的所有信息,仅需要一条 Linux 命令。 ![Hand putting a Linux file folder into a drawer][1] -命令 `stat` 被包含在 GNU `coreutils` 软件包里,它提供了关于文件和文件系统的各种元数据,包括文件大小、结点位置、访问权限和 SELinux 上下文以及创建和修改时间。通常情况下,你需要多个不同命令获取的信息,这一个命令就可以实现。 +在 GNU `coreutils` 软件包中包含 `stat` 命令,它提供了关于文件和文件系统包括文件大小、结点位置、访问权限和 SELinux 上下文以及创建和修改时间等各种元数据。通常情况下,你需要多个不同命令获取的信息,而这一个命令就可以实现。 ### 在 Linux 上安装 stat 命令 -在 Linux 系统中,可能早已安装了 `state` 命令,因为它是核心功能软件包的一部分,默认情况下,通常包含在 Linux 发行版里。 +在 Linux 系统中,可能已经预装了 `stat` 命令,因为它属于核心功能软件包,通常包含在 Linux 默认发行版里。 如果系统中没有安装 `stat` 命令,你可以使用包管理器安装 `coreutils` 软件包。 -另外,你可以 [ 使用源码编译 coreutils 包 ][2]。 +另外,你可以 [ 通过源码编译安装 coreutils 包 ][2]。 ### 获取文件状态 -运行 `stat` 命令可以获取指定文件或目录易于理解的输出。 +运行 `stat` 命令可以获取指定文件或目录易读的状态信息。 ``` @@ -40,7 +40,7 @@ Change: 2021-08-17 18:26:58.738332799 +1200 Birth: 2021-08-17 18:26:57.281330711 +1200 ``` -输出的信息很容易理解,但是包含了很多的信息,这里是 `stat` 所包含的项: +输出的信息易懂,但是包含了很多的信息,这里是 `stat` 所包含的项: * **File**: 文件名 * **Size**: 文件大小,以字节表示 @@ -58,7 +58,7 @@ Change: 2021-08-17 18:26:58.738332799 +1200 ### 精简输出 -对于非常了解输出或者想要使用其它工具(例如:[awk][3])解析输出的人,这里可以使用 `--terse`(短参数为 `-t`) 参数,实现没有标题或换行符的格式化输出。 +对于精通输出或者想要使用其它工具(例如:[awk][3])解析输出的人,这里可以使用 `--terse`(短参数为 `-t`) 参数,实现没有标题或换行符的格式化输出。 ``` @@ -66,9 +66,9 @@ $ 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 ``` -### 选择自己的格式 +### 自定义格式 -你可以使用 `--printf` 参数以及与 [printf][4] 类似的语法定义自己的输出格式。`stat` 的每一个属性都有一个格式序列(`%C` 表示 SELinux 上下文,`%n` 表示文件名等等),所以,你可以选择你想要的输出格式。 +你可以使用 `--printf` 参数以及与 [printf][4] 类似的语法定义自己的输出格式。`stat` 的每一个属性都有一个格式序列(`%C` 表示 SELinux 上下文,`%n` 表示文件名等等),所以,你可以定义输出格式。 ``` @@ -97,7 +97,7 @@ Modified: 2021-08-17 18:26:58.738332799 +1200 ### 文件信息 -如果你曾经尝试解析过 `ls -l` 的输出,那么,你会很喜欢 `stat` 命令的灵活性。你并不是每次都需要 `stat` 提供的所有信息,但是,当你需要其中一些或全部的时候它是非常有用的。不管你是读取默认输出,还是你自己创建的查询输出,`stat` 命令都可以让你访问想要的数据。 +如果你曾尝试解析过 `ls -l` 的输出,那么,你会很喜欢 `stat` 命令的灵活性。你并不是每次都需要 `stat` 提供的所有信息,但是,当你需要其中一些或全部的时候它是非常有用的。不管你是读取默认输出,还是你自己创建的查询输出,`stat` 命令都可以查看所需的数据。 -------------------------------------------------------------------------------- @@ -106,7 +106,7 @@ via: https://opensource.com/article/21/8/linux-stat-file-status 作者:[Seth Kenlon][a] 选题:[lujun9972][b] 译者:[New-World-2019](https://github.com/New-World-2019) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -115,4 +115,4 @@ via: https://opensource.com/article/21/8/linux-stat-file-status [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 \ No newline at end of file +[4]: https://opensource.com/article/20/8/printf From 089da8fb59fa1ab76e23b13d31adaee17c230332 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Thu, 9 Sep 2021 10:36:07 +0800 Subject: [PATCH 0312/1588] translated --- ...Use lspci on Linux to see your hardware.md | 57 ++++++++----------- 1 file changed, 24 insertions(+), 33 deletions(-) rename {sources => translated}/tech/20210907 Use lspci on Linux to see your hardware.md (55%) diff --git a/sources/tech/20210907 Use lspci on Linux to see your hardware.md b/translated/tech/20210907 Use lspci on Linux to see your hardware.md similarity index 55% rename from sources/tech/20210907 Use lspci on Linux to see your hardware.md rename to translated/tech/20210907 Use lspci on Linux to see your hardware.md index 4f01fe3985..1eeee0946a 100644 --- a/sources/tech/20210907 Use lspci on Linux to see your hardware.md +++ b/translated/tech/20210907 Use lspci on Linux to see your hardware.md @@ -7,20 +7,18 @@ [#]: publisher: " " [#]: url: " " -Use lspci on Linux to see your hardware +在 Linux 上使用 lspci 命令查看硬件情况 ====== -Use the lspci command to display devices and drivers on your Linux -system. +使用 lspci 命令可以显示 Linux 系统上的设备和驱动程序。 ![computer screen ][1] -When you're running Linux on a desktop or server, sometimes you need to identify the hardware in that system. One command used for this is `lspci`. It works by showing all devices attached to the PCI bus. It's provided by the [pciutils][2] package and is available for a wide range of Linux and BSD-based operating systems. +当你在个人电脑或服务器上运行 Linux 时,有时可能需要识别该系统中的硬件。`lspci` 命令可以显示连接到 PCI 总线的所有设备,从而实现上述目的。该命令由 [pciutils][2] 包提供,可用于各种基于 Linux 和 BSD 的操作系统。 -### Basic usage +### 基础用法 -The information displayed when a regular user runs `lspci` might be limited due to access permissions. Running the command with `sudo` provides a complete picture. - -Running `lspci` by itself lists the PCI buses and their attached devices. Here's an example from my media center PC. It's an AMD Phenom CPU-based system, so it has an AMD chipset. It also has an Atheros wireless controller and an Nvidia graphics card. All hardware devices are listed with details such as vendor, name, and model number: +由于访问权限的存在,普通用户运行 `lspci` 时显示的信息可能会受限,因此可以使用 `sudo` 运行命令,系统会给出完整的信息图。 +单独运行 `lspci` 命令会列出 PCI 总线及其连接的设备,下图是在我的媒体中心 PC 上的演示样例。图中是一个基于 AMD Phenom CPU 的系统,所以它有一个 AMD 芯片组,以及 Atheros 无线控制器和 Nvidia 显卡。所有硬件设备都列出了详细信息,例如供应商、名称和型号等: ``` $ sudo lspci @@ -50,14 +48,13 @@ $ sudo lspci 02:00.0 Network controller: Qualcomm Atheros AR9287 Wireless Network Adapter (PCI-Express) (rev 01) ``` -### Verbose output +### 详细输出 -Adding a `-v` option increases the verbosity or the level of detail for each device. You can use `-vv` or `-vvv` for even higher amounts of device detail. At this level, `lspci` displays various subsystems and memory addresses, interrupt request (IRQ) numbers, and other capabilities for all devices. The output is extremely long. Give it a try on your system. +添加 `-v` 选项会增加每个设备的详细程度或详细程度,你可以使用 `-vv` 或 `-vvv` 来获取更多的设备细节。在 `-v` 级别,`lspci` 会显示所有设备的各种子系统和内存地址、中断请求 (IRQ) 编号和一些其他功能信息。输出信息会非常长。在你的系统上试一试吧。 -### Searching with grep - -Sometimes you want to narrow your search. For instance, the RPM Fusion web site has instructions for installing Nvidia graphics drivers. They begin with identifying your graphics card using the `grep` command. This is what I get on my laptop: +### 使用 grep 过滤搜索 +有时你可能会想要缩小搜索范围。例如,RPM Fusion 网站有安装 Nvidia 图形驱动程序的说明,里面就首先使用了 `grep` 命令来定位显卡信息。下面是我在笔记本电脑上得到的界面: ``` $ sudo lspci | grep -e VGA @@ -66,8 +63,7 @@ $ sudo lspci | grep -e 3D 01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce MX130] (rev a2) ``` -The `grep` commands above show one VGA device on my media center PC but no 3D device. - +下面(LCTT 译注:原文为 “above”,应为作者笔误)的 `grep` 命令在我的媒体中心 PC 上显示了一个 VGA 设备,但没有显示 3D 设备。 ``` $ sudo lspci | grep -e VGA @@ -76,20 +72,18 @@ $ sudo lspci | grep -e 3D $ ``` -### Searching by vendor ID - -There is another way that doesn't require `grep`. Suppose I want to determine whether any other Nvidia devices are present. It's necessary to know a little more. I use the `-nn` option to display vendor and device ID numbers. On my media center PC, this option shows my VGA card, vendor ID, and device ID: +### 按供应商 ID 搜索 +还有另一种不需要 `grep` 的方法可以使用。假设我想确认一下此计算机是否有其他的 Nvidia 设备,在此之前我们还需要一些额外信息,使用 `-nn` 选项显示的供应商和设备 ID 号。在我的媒体中心 PC 上,此选项会给出我的 VGA 卡、供应商 ID 和设备 ID: ``` $ sudo lspci -nn | grep -e VGA 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1) ``` -The set of brackets with the colon-separated numbers after the device name shows the vendor and device ID. The output indicates that the vendor ID for a device made by Nvidia Corporation is **10de**. - -The `-d` option displays all devices from a specified vendor, device, or class ID. Here are all the Nvidia devices in my system (keeping the `-nn` to include the vendor IDs): +设备名称后的括号内有用冒号分隔的数字,即供应商和设备 ID。输出表明 Nvidia Corporation 制造的设备的供应商 ID 为 **10de**。 +`-d` 选项会给出来自指定供应商、设备或类 ID 的所有设备。以下是我系统中的所有 Nvidia 设备(保留 `-nn` 以解析供应商 ID): ``` $ sudo lspci -nn -d 10de: @@ -97,12 +91,11 @@ $ sudo lspci -nn -d 10de: 01:00.1 Audio device [0403]: NVIDIA Corporation GK107 HDMI Audio Controller [10de:0e1b] (rev a1) ``` -From the output, you can see that in addition to a graphics card, I have an Nvidia audio device. They are both actually part of the same **Nvidia GeForce GTX 650** card, but this is a good example nonetheless. +从输出中可以看到,除了显卡之外,我还有一个 Nvidia 音频设备。虽然它们实际上都是同一张 **Nvidia GeForce GTX 650** 卡的一部分,但这仍然是一个很好的示例。 -### Kernel modules - -Along with PCI hardware devices, `lspci` can show what kernel driver modules are loaded with the `-k` option. I add this option to my `lspci` commands to view several pieces of information about my Nvidia devices. +### 内核模块 +结合 PCI 硬件设备,`lspci` 可以使用 `-k` 选项显示加载了哪些内核驱动程序模块。我将此选项添加到我的 `lspci` 命令来查看有关我的 Nvidia 设备的信息。 ``` $ sudo lspci -nn -k -d 10de: @@ -116,28 +109,26 @@ $ sudo lspci -nn -k -d 10de:  Kernel modules: snd_hda_intel ``` -Two additional lines are displayed: _Kernel driver in use_ and _Kernel modules_. The second one lists the modules available to support the device. +可以看到额外显示了两行:_正在使用的内核驱动程序_(Kernel driver in use)_内核模块_(Kernel modules),其中后者列出了可用于支持该设备的模块。 -### Keeping up to date - -New devices and vendors are constantly entering the market. If you see a device listed as _unknown_, your PCI device ID database may be outdated. There are two ways to check. The `-Q` option uses DNS to query the central database. This, of course, requires network connectivity. +### 同步最新状态 +新设备和供应商总是在持续不断进入市场。如果看到显示为 _unknown_ 的设备,说明你的 PCI 设备 ID 数据库可能已过时。有两种方法可以检查更新。`-Q` 选项会使用 DNS 查询中央数据库,当然,这需要网络连接。 ``` `$ sudo lspci -Q` ``` -You can also update your local PCI ID database by running the command `update-pciids`. - +你还可以通过运行命令 `update-pciids` 来更新本地 PCI ID 数据库。 ``` $ sudo update-pciids Downloaded daily snapshot dated 2021-08-22 03:15:01 ``` -### Learn more about your hardware +### 了解有关你的硬件的更多信息 -Of course, `lspci` is just one of many commands available for Linux that is useful for querying the hardware and software on your system. Learn more about hardware on Linux in my article covering USB devices: [Recognize more devices on Linux with this USB ID Repository][3]. +当然,`lspci` 只是 Linux 中可用于查询系统硬件和软件的诸多命令之一。读者可以在阅读我关于 USB 设备的文章,了解有关 Linux 硬件的更多信息:[使用此 USB ID 存储库识别 Linux 上的更多设备][3]。 -------------------------------------------------------------------------------- From ca41db1b89513cb1e57088a2c67d186aa055c296 Mon Sep 17 00:00:00 2001 From: SamMa Date: Thu, 9 Sep 2021 14:21:00 +0800 Subject: [PATCH 0313/1588] 20210823 apps for daily needs part 4 audio editors.md (#23192) * Update 20210823 Apps for daily needs part 4- audio editors.md * Update 20210823 Apps for daily needs part 4- audio editors.md * Update 20210823 Apps for daily needs part 4- audio editors.md --- ...s for daily needs part 4- audio editors.md | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) 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 index 8207f167b1..c3a32c892a 100644 --- 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 @@ -3,18 +3,18 @@ [#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " -满足日常需求的应用第四部分:音频编辑器 +日常需求应用之四:音频编辑器 ====== ![][1] -照片由 [Brooke Cagle][2] 在 [Unsplash][3] 上发布。 +图片由 [Brooke Cagle][2] 在 [Unsplash][3] 上发布。 -音频编辑应用或数字音频工作站(DAW)在过去只被专业人士使用,如唱片制作人、音响工程师和音乐家。但现在很多不是专业人士的人也需要它们。这些工具被用于演示文稿解说、视频博客,甚至只是作为一种爱好。现在尤其如此,因为有这么多的在线平台,方便大家分享音频作品,如音乐、歌曲、播客等。本文将介绍一些你可以在 Fedora Linux 上使用的开源音频编辑器或 DAW。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。这里列出了音频编辑器或 DAW 类的一些日常需求的应用。 +在过去,音频编辑应用或数字音频工作站(DAW)只提供给专业人士使用,如唱片制作人、音响工程师和音乐家。但现在很多不是专业人士的人也需要它们。这些工具被用于演示文稿解说、视频博客,甚至只是作为一种爱好。现在尤其如此,因为有这么多的在线平台,方便大家分享音频作品,如音乐、歌曲、播客等。本文将介绍一些你可以在 Fedora Linux 上使用的开源音频编辑器或 DAW。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。这里列出了音频编辑器或 DAW 类的一些日常需求的应用。 ### Audacity @@ -24,17 +24,17 @@ Audacity 有很多功能,可以支持你的音频作品。它有对插件的 ![][5] -更多信息可在此链接中找到: +详情请参考此链接: * * * ### LMMS -LMMS 或 Linux MultiMedia Studio 是一个全面的音乐创作应用。你可以使用 LMMS 用你的电脑从头开始制作你的音乐。你可以根据自己的创意创造旋律和节拍,并通过选择声音乐器和各种效果使其更加完美。有几个与乐器和效果有关的内置功能,如 16 个内置合成器、嵌入式 ZynAddSubFx、支持插入式 VST 效果插件、捆绑图形和参数均衡器、内置分析器等等。LMMS 还支持 MIDI 键盘和其他音频外围设备。 +LMMS 或 Linux MultiMedia Studio 是一个全面的音乐创作应用。你可以从头使用 LMMS 用你的电脑开始制作你的音乐。你可以根据自己的创意创造旋律和节拍,并通过选择声音乐器和各种效果使其更加完美。有几个与乐器和效果有关的内置功能,如 16 个内置合成器、嵌入式 ZynAddSubFx、支持插入式 VST 效果插件、捆绑图形和参数均衡器、内置分析器等等。LMMS 还支持 MIDI 键盘和其他音频外围设备。 ![][6] -更多信息可在此链接中获得: +详情请参考此链接: * * * @@ -42,27 +42,27 @@ LMMS 或 Linux MultiMedia Studio 是一个全面的音乐创作应用。你可 Ardour 作为一个全面的音乐创作应用,其功能与 LMMS 相似。它在其网站上说,Ardour 是一个 DAW 应用,是来自世界各地的音乐家、程序员和专业录音工程师合作的结果。Ardour 拥有音频工程师、音乐家、配乐编辑和作曲家需要的各种功能。 -Ardour 为录音、编辑、混音和输出提供了完整的功能。它有无限的多声道音轨、无限撤销/重做的非线性编辑器、一个全功能的混音器、内置插件等。Ardour 还带有视频播放工具,所以它在为视频项目创建和编辑配乐的过程中也很有帮助。 +Ardour 提供了完整的录音、编辑、混音和输出功能。它有无限的多声道音轨、无限撤销/重做的非线性编辑器、一个全功能的混音器、内置插件等。Ardour 还包含视频播放工具,所以使用它为视频项目创建和编辑配乐也很有帮助。 ![][7] -更多信息可在此链接中获得: +详情请参考此链接: * * * ### TuxGuitar -TuxGuitar 是一个指法谱和乐谱编辑器。它配备了指法编辑器、乐谱查看器、多轨显示、拍号管理和速度管理。它包括各种效果,如弯曲、滑动、颤音等。虽然 TuxGuitar 专注于吉他,但它也允许你为其他乐器写乐谱。它也可以作为一个基本的 MIDI 编辑器。你需要对指法谱和乐谱有一定的了解才能使用它。 +TuxGuitar 是一款指法谱和乐谱编辑器。它配备了指法编辑器、乐谱查看器、多轨显示、拍号管理和速度管理。它包括弯曲、滑动、颤音等各种效果。虽然 TuxGuitar 专注于吉他,但它也可以为其他乐器写乐谱。它也能够作为一个基本的 MIDI 编辑器。你需要对指法谱和乐谱有一定的了解才能使用它。 ![][8] -更多的信息可以在这个链接上获得: +详情请参考此链接: * * * ### 总结 -这篇文章介绍了四个音频编辑器,作为你在 Fedora Linux 上的日常需要和使用的应用。实际上,还有许多其他的你可以在 Fedora Linux 上使用的音频编辑器或者 DAW。你也可以使用 Mixxx、Rosegarden、Kwave、Qtractor、MuseScore、musE 等等。希望这篇文章能帮助你调查和选择合适的音频编辑器或者 DAW。如果你有使用这些应用的经验,请在评论中分享你的经验。 +本文章介绍了四款音频编辑器,满足您在 Fedora Linux 上日常使用的需求。其实,在 Fedora Linux 上还有很多音频编辑器或者 DAW 供您选择。您也可以使用 Mixxx、Rosegarden、Kwave、Qtractor、MuseScore、musE 等等。希望本文为您调查和选择合适的音频编辑器或者 DAW 提供帮助。如您有使用这些应用的经验,请在评论中分享您的经验。 -------------------------------------------------------------------------------- @@ -71,7 +71,7 @@ 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) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 92a3cedc3e9d0d1705643e2f0b396c711512a6f6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Sep 2021 05:02:29 +0800 Subject: [PATCH 0314/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210909?= =?UTF-8?q?=20Find=20files=20and=20directories=20on=20Linux=20with=20the?= =?UTF-8?q?=20find=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210909 Find files and directories on Linux with the find command.md --- ...ectories on Linux with the find command.md | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20210909 Find files and directories on Linux with the find command.md diff --git a/sources/tech/20210909 Find files and directories on Linux with the find command.md b/sources/tech/20210909 Find files and directories on Linux with the find command.md new file mode 100644 index 0000000000..a612cd435c --- /dev/null +++ b/sources/tech/20210909 Find files and directories on Linux with the find command.md @@ -0,0 +1,170 @@ +[#]: subject: "Find files and directories on Linux with the find command" +[#]: via: "https://opensource.com/article/21/9/linux-find-command" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Find files and directories on Linux with the find command +====== +There are many reasons to learn find, so download our free find cheat +sheet to help you learn more about the command. +![Magnifying glass on code][1] + +Regardless of how organized I resolve to be, it seems there are always times when I just can't locate a file. Sometimes it's because I can't remember the name of the file in the first place. Other times, I know the name, but I can't recall where I decided to save it. There are even times when I need a file that I didn't create in the first place. No matter what the quandary, though, I know that on a [POSIX system][2], I always have the `find` command. + +### Installing find + +The `find` command is defined by the [POSIX specification][3], which creates the open standard by which POSIX systems (including Linux, BSD, and macOS) are measured. Simply put, you already have `find` installed as long as you're running Linux, BSD, or macOS. + +However, not all `find` commands are exactly alike. The GNU `find` command, for instance, has features that the BSD or Busybox or Solaris `find` command might not have or does have but implements differently. This article uses GNU `find` from the [findutils][4] package because it's readily available and pretty popular. Most commands demonstrated in this article work with other implementations of `find`, but should you try a command on a platform other than Linux and get unexpected results, try downloading and installing the GNU version. + +### Find a file by name + +You can locate a file by its filename by providing the full file name or parts of the file name using regular expressions. The `find` command requires the path to the directory you want to search in, options to specify what attribute you're searching (for instance, -`name` for a case-sensitive file name), and then the search string. By default, your search string is treated literally: The `find` command searches for a filename that is exactly the string you enter between quotes unless you use regular expression syntax. + +Assume your Documents directory contains four files: `Foo`, `foo`, `foobar.txt`, and `foo.xml`. Here's a literal search for a file with the name "foo": + + +``` +$ find ~ -name "foo" +/home/tux/Documents/examples/foo +``` + +You can broaden your search by making it case-insensitive with the `-iname` option: + + +``` +$ find ~ -iname "foo" +/home/tux/Documents/examples/foo +/home/tux/Documents/examples/Foo +``` + +### Wildcards + +You can use basic shell wildcard characters to broaden your search. For instance, the asterisk (`*`) represents any number of characters: + + +``` +$ find ~ -iname "foo*" +/home/tux/Documents/examples/foo +/home/tux/Documents/examples/Foo +/home/tux/Documents/examples/foo.xml +/home/tux/Documents/examples/foobar.txt +``` + +A question mark (`?`) represents a single character: + + +``` +$ find ~ -iname "foo*.???" +/home/tux/Documents/examples/foo.xml +/home/tux/Documents/examples/foobar.txt +``` + +This isn't regular expression syntax, so the dot (`.`) represents a literal dot in this example. + +### Regular expressions + +You can also use regular expressions. As with `-iname` and `-name`, there's both a case-sensitive and a case-insensitive option. Unlike the `-name` and `-iname` options, though, a `-regex` and `-iregex` search is applied to the _whole path_, not just the file name. That means if you search for `foo`, you get no results because `foo` doesn't match `/home/tux/Documents/foo`. Instead, you must either search for the entire path, or else use a wildcard sequence at the beginning of your string: + + +``` +$ find ~ -iregex ".*foo" +/home/tux/Documents/examples/foo +/home/tux/Documents/examples/Foo +``` + +### Find a file modified within the last week + +To find a file you last modified last week, use the `-mtime` option along with a (negative) number of days in the past: + + +``` +$ find ~ -mtime -7 +/home/tux/Documents/examples/foo +/home/tux/Documents/examples/Foo +/home/tux/Documents/examples/foo.xml +/home/tux/Documents/examples/foobar.txt +``` + +### Find a file modified within a range of days + +You can combine `-mtime` options to locate a file within a range of days. For the first `-mtime` argument, provide the most recent number of days you could have modified the file, and for the second, give the greatest number of days. For instance, this search looks for files with modification times more than one day in the past, but no more than seven: + + +``` +`$ find ~ -mtime +1 -mtime -7` +``` + +### Limit a search by file type + +It's common to optimize the results of `find` by specifying the file type you're looking for. You shouldn't use this option if you're not sure what you're looking for, but if you know you're looking for a file and not a directory, or a directory but not a file, then this can be a great filter to use. The option is `-type`, and its arguments are a letter code representing a few different kinds of data. The most common are: + + * `d` \- directory + * `f` \- file + * `l` \- symbolic link + * `s` \- socket + * `p` \- named pipe (used for FIFO) + * `b` \- block special (usually a hard drive designation) + + + +Here are some examples: + + +``` +$ find ~ -type d -name "Doc*" +/home/tux/Documents +$ find ~ -type f -name "Doc*" +/home/tux/Downloads/10th-Doctor.gif +$ find /dev -type b -name "sda*" +/dev/sda +/dev/sda1 +``` + +### Adjust scope + +The `find` command is recursive by default, meaning that it searches for results in the directories of directories contained in directories (and so on). This can get overwhelming in a large filesystem, but you can use the `-maxdepth` option to control how deep into your folder structure you want `find` to descend: + + +``` +$ find /usr -iname "*xml" | wc -l +15588 +$ find /usr -maxdepth 2 -iname "*xml" | wc -l +15 +``` + +You can alternately set the minimum depth of recursion with `-mindepth`: + + +``` +$ find /usr -mindepth 8 -iname "*xml" | wc -l +9255 +``` + +### Download the cheat sheet + +This article only covers the basic functions of `find`. It's a great tool for searching through your system, but it's also a really useful front-end for the powerful [Parallel][5] command. There are many reasons to learn `find`, so **[download our free `find` cheat sheet][6]** to help you learn more about the command. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/linux-find-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/find-file-linux-code_magnifying_glass_zero.png?itok=E2HoPDg0 (Magnifying glass on code) +[2]: https://opensource.com/article/19/7/what-posix-richard-stallman-explains +[3]: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/ +[4]: https://www.gnu.org/software/findutils/ +[5]: https://opensource.com/article/18/5/gnu-parallel +[6]: https://opensource.com/downloads/linux-find-cheat-sheet From dd118c63a6cf019c7a6c88defb203e795d0ae9b6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Sep 2021 05:02:37 +0800 Subject: [PATCH 0315/1588] add done: 20210909 Find files and directories on Linux with the find command.md --- sources/tech/20210909 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210909 .md diff --git a/sources/tech/20210909 .md b/sources/tech/20210909 .md new file mode 100644 index 0000000000..10e6715b07 --- /dev/null +++ b/sources/tech/20210909 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/fedora-35/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 0724f9e29c7e77295abef0f31a3584f82cd0e1ee Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Sep 2021 05:02:50 +0800 Subject: [PATCH 0316/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210909?= =?UTF-8?q?=20A=20guide=20to=20simplifying=20invoicing=20with=20this=20ope?= =?UTF-8?q?n=20source=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210909 A guide to simplifying invoicing with this open source tool.md --- ...ng invoicing with this open source tool.md | 331 ++++++++++++++++++ 1 file changed, 331 insertions(+) create mode 100644 sources/tech/20210909 A guide to simplifying invoicing with this open source tool.md diff --git a/sources/tech/20210909 A guide to simplifying invoicing with this open source tool.md b/sources/tech/20210909 A guide to simplifying invoicing with this open source tool.md new file mode 100644 index 0000000000..cbcdda143e --- /dev/null +++ b/sources/tech/20210909 A guide to simplifying invoicing with this open source tool.md @@ -0,0 +1,331 @@ +[#]: subject: "A guide to simplifying invoicing with this open source tool" +[#]: via: "https://opensource.com/article/21/7/open-source-invoicing-po" +[#]: author: "Frank Bergmann https://opensource.com/users/fraber" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to simplifying invoicing with this open source tool +====== +]project-open[ simplifies one of the most challenging activities in IT: +writing customer invoices. +![Digital images of a computer desktop][1] + +Many IT projects are late, over budget, and subject to dramatic changes during development. This makes invoicing for them one of the most taxing activities in IT. It's stressful—it involves dealing with ambiguities, conflicting interests, and human error. Worse, every single decision made during the project affects how much you can bill for. When a sales guy brags—incorrectly—that your software "includes this feature," you can't invoice for the time to build it. When a support guy admits something is a bug rather than an imprecise spec, you won't be able to charge money for it. + +This tutorial explains a methodology and a tool to streamline this process. Together, they help reduce frustration, improve customer relationships, and achieve a higher percentage of billable hours. The tool is free, open source, and can be applied to a wide range of organizations—from a self-employed IT guy to a multimillion-dollar software business. + +This article can also serve as a guide on how to handle financial tasks if you decide to become self-employed or set up a startup. It doesn't cover project management or similar disciplines; I'm focusing only on invoicing here. The first part of this article describes the invoicing methodology, while the second part shows you how to apply the methodology within []project-open[][2] (or ]po[ for short). + +### The general invoicing process + +There's a general process for writing invoices no matter what tool you use. Some organizations may be more or less formal with certain steps, but all project-based businesses follow the same basic process: + +![Invoicing processes covered in this tutorial][3] + +Figure 1. Invoicing processes (Frank Bergmann, [CC BY-SA 4.0][4]) + +#### Assign a contract type + +From an invoicing perspective, the most important property of a project is the contract type. You can invoice services for a **fixed price** (the risk of time and other overruns is 100% on your side), **time and materials** (you bill by the hour, and the customer takes on the risk of overruns), or a **mixture of both** (you specify some deliverables with a fixed price, but other parts of the contract are billed using time and materials). Sometimes invoicing is tied to certain objectives (milestone billing) or time periods (periodic invoicing), but these are just variants of the two contract types above. + +Agile projects tend to be more time-and-materials based because the specs (and therefore the amount of work) for each user story change over the course of the project. Classic waterfall projects tend to be more fixed-price based, but this depends on the project and negotiation position. The following information applies to all contract types. + +#### Define your project + +Project definition is normally a separate step before execution begins. If you want to get paid, you have to start here and define the scope of your project with watertight deliverables. Otherwise, you're at the mercy of your customer's goodwill to let you off the hook if there are ambiguities later. + +![Initial project definition Gantt Chart][5] + +Figure 2. Initial project definition Gantt chart (Frank Bergmann, [CC BY-SA 4.0][4]) + +The Gantt chart above shows a sample ]po[ project. To define a project with unambiguous deliverables: + + 1. Define the project as a list of tasks to work on. Every task must have a clear deliverable so that it's easy to tell if the task is complete or not. + 2. Create an estimate (the **Work** column) of how long it will take to complete the task. This helps you track time overruns. A second column, **Billable Hours**, allows you to account for unbillable time (e.g., time spent in presales activities is generally not billable). + 3. Define a **Material** for each task if you charge different rates for different task types. For example, you may charge US$ 100 per hour for project management while database administration costs US$ 60 per hour. + 4. Optional: Assign **Resources** to each task to specify who should do the work. + + + +Entering information this way makes it very easy to produce invoices and status reports later. + +#### Manage project change requests, bugs, and issues + +Projects tend to change during their course due to unforeseen issues, new ideas from the customer, and many other reasons. Most of these changes mean additional work for you. It's important to track whether this work is paid or unpaid. Customer extension requests or scope increases are usually paid, while bugs or other issues tend to be unpaid. + +There are different ways of tracking change requests (CRs): + + * **Contractually:** Formally record change requests as an email or a signed CR document so that there are no ambiguities when invoicing. + * **Operationally:** You probably want to add CRs as tasks in your project. This is just like creating the initial tasks list. You may want to group additional tasks below a summary task to indicate they aren't covered by the original scope. + * **Bug tracker:** It may also be useful to keep a separate log for quality issues and bugs (usually non-billable changes). + + + +Whatever method you use, make sure you tag the work as tasks vs. bugs in some way to remind you to treat them differently when writing an invoice later. + +#### Issue periodic status reports + +Customers expect you to provide periodic information about the progress of their projects. That's because IT projects are usually late and over budget. This can be an unpleasant duty, particularly if you have to report overruns, but it makes good business sense. + +A weekly status report frequently contains the following sections: + + * A list of tasks you're working on, optionally with their completion status + * A list of tasks you've started working on in this reporting period + * A list of tasks you've finished in this reporting period + * The reasons it took you so long to finish the tasks above + + + +#### Get customer signoff + +Before you can write an invoice, you usually need approval from the customer confirming all deliverables are complete. This may be the most difficult phase of the entire project because it often involves negotiating accountability for any overruns you encountered in the project. + +I recommend you start considering this phase when you first define the project so that every task is bound to a clearly defined deliverable and completion status isn't up for debate. You may also define explicit acceptance criteria during project definition to avoid ambiguities. When negotiating the details of a task with the customer during project execution, remember to record all decisions so that you can easily find this documentation when trying to get signoff. + +#### Invoice + +Once you've gotten signoff, writing the invoice is relatively easy. You just need to multiply the billable hours by the agreed rate per hour or day: + + * Look at all billable tasks and determine planned hours, billable hours, and actual hours. + * Can you bill the overrun hours to the customer? If so, you'll probably have to explain why the customer should pay for this and where this has been agreed upon contractually. + * Multiply the billable hours by the hourly rate for the respective service type. + + + +Once you calculate the final amount, you may need to add taxes according to your local regulations, which will differ depending upon the country, state, county, or even city where your business is located. Finally, enter the calculation into a standardized invoice document and send it to the customer. + +#### Track accounts receivable and payments + +Once the invoice has been sent to the customer, you have to track the payments in your bank account and connect them to the respective invoices. You may also have to send reminders to your customers if they're late with payments. + +#### Do profit & loss and post-mortem + +After all the work is finished, you'll want to see how much money you earned from the project. This can be very easy or quite complex if the work involves salaried employees, external consultants, efforts shared with other projects, travel costs, etc. At the end, you'll have a profit-and-loss statement that consists of the invoiced amount minus all of your costs. + +This may also be a good moment to review your project in general (called a post-mortem) and your estimation process in particular. Compare the estimated time with the actual time spent and how the various decisions and events during the project affected the balance. This should inform your sales and quoting process for the next project. + +### Create invoices with ]project-open[ + +Now that you know the process, let's look at implementing it using the free and open source tool ]po[. + +#### Download, install, and configure ]po[ + +It only takes a few minutes to get ]po[ running on your computer. You can get [native installers][6] (along with help and instructions) for various Linux flavors or Windows from the ]po[ website. + +After installing ]po[, follow the configuration wizard and choose the **Other/Everything** and **Complete/Full Installation** options to enable all system options. Project invoicing is disabled in the simplified configurations. + +#### Define a project + +To create a new project, use **Projects -> New Project** and choose **Gantt Project** or one of its subtypes. The ]po[ Gantt editor contains everything you need to set up your project. You can structure your project hierarchically with **Summary tasks** or keep it as a flat list. The Gantt timeline on the right-hand side is optional for the invoicing process. It's only used for tracking progress during project execution. + +There are columns for all the task properties described below. The **Material** and **Billable Hours** columns aren't visible in ]po[ by default. To make them visible, click the **v** button to the right of each column header and enable the column. You can change the column order by dragging and dropping: + +![Gantt chart with project definition and status][7] + +Figure 3. Gantt chart with project definition and status (Frank Bergmann, [CC BY-SA 4.0][4]) + + * **Task:** This is the name of the task. + * **Work:** Enter the estimated hours to finish the task. + * **Billable Hours** (optional): Allows you to specify billable time if it is different from Work. + * **Done %:** The project manager enters the progress toward completing the task. + * **Material:** This is the service type of the task, for example, project management or frontend development. You can edit the list of materials in **Master Data -> Materials**. These service types tie in with the list of rates (see below) to define prices for different types of work or different resources. + * **Resources:** To assign resources to tasks, you first have to use the **Projects -> <project name> -> Members** portlet to add resources to the project. After you reload the page, these resources will be available in the Gantt editor, where you can assign them to tasks in the **Resources** column. + * **Notes:** This field is not available as a column. Double-click on the icon before any task to open the **Task** property panel that includes a large free-text area for notes. + + + +]po[ will automatically calculate the duration (setting the end date) of a task if you have defined its Work and Resources. Similarly, it will calculate the duration of a Summary task (a parent task with several subtasks) based on its children. You can create dependencies between tasks by dragging and dropping with your mouse. + +#### Log your hours + +Use the **Timesheet** menu to get to the calendar page. Click **Log hours** for a specific day. + +![Time sheet calendar][8] + +Figure 3. Time sheet calendar (Frank Bergmann, [CC BY-SA 4.0][4]) + +You'll see a list of all projects on which you are a member. There, you can log hours and add comments about what you've done. + +![Logging hours][9] + +Figure 4. Logging hours (Frank Bergmann, [CC BY-SA 4.0][4]) + +#### Add issues and change requests + +You can add new tasks to the Gantt editor any time during the project to reflect change requests. + +You can also add a bug tracker to your project. From the left-hand side of the project, find **Project -> Admin Project -> Create a Subproject**. Then create a new subproject with the name **<Project> Bug Tracker** and type **Ticket Container**. This new bug tracker will appear in the Gantt editor together with the included tickets marked with different icons. The bug tracker will also appear in the **Tickets -> New Ticket** section so that the project manager, the customer, or other stakeholders can log various types of issues. Please see the **Documentation** tab on the []po[ website][10] for details about the ]po[ helpdesk functionality, as this is beyond the scope of this tutorial. + +#### Report your status + +The ]po[ Gantt editor also serves as a visual status report. Basically, all tasks to the left of the red line ("today") should show 100% in the **Done %** column. + +![Project status Gantt chart][11] + +Figure 5. Project status Gantt chart (Frank Bergmann, [CC BY-SA 4.0][4]) + +Look at the **Master data import** task in Figure 5: + + * **Is the task on time?** The black bar inside the Gantt bar represents the 40% from the **Done%** column. The rectangle ends to the left of the red line representing today, indicating the task is late. + * **Is the task within budget?** The red rectangle in the Gantt bar is red. It represents the **Logged Hours** as a percentage of **Work**. We can see that the team has already spent 48 of the planned 56 hours, but the task is only 40% done. Continuing like this, it would take 120 hours (= 48h / 40%) to complete the task. The bar's color changes to blue if **Logged Hours** < **Work * Done%**. + + + +]po[ includes other more advanced status reporting tools, including Earned Value Analysis (EVA), Milestone Trend Analysis, and various specialized reports. The documentation provides more information on these tools. + +#### Get to sign off + +]project-open[ doesn't include specific support for getting your customer to sign off on your project. However, the detailed information attached to each task—which you documented at the start—will be extremely helpful in proving that everything's been done in accordance with the decisions you and your customer made together. Take note of any difficulties and take them into account when defining the next project. + +#### Create an invoice manually + +This is the simplest and most flexible way to create invoices and is suitable for very small or fixed-price projects. Use **<project> -> Finance -> New Customer Invoice** **from Scratch** to start. (Do not use the **Finance** tab at the top of the ]po[ menu—go to your specific project and use the project's **Finance** tab there). You'll see a screen like this: + +![Creating an invoice manually][12] + +Figure 6. Creating an invoice manually (Frank Bergmann, [CC BY-SA 4.0][4]) + +Fields in the invoice header: + + * **Invoice no:** This is the invoice identification for tax reporting purposes. This number is created automatically and numbered per month. Alternative numbering schemes are available. + * **Invoice date:** This is the date you created the invoice (for tax reporting purposes). + * **Payment terms:** This is the number of days until the invoice is due. + * **Payment method:** This is how the customer should pay. You can modify the available payment options in **Admin -> Categories -> Intranet Invoice Payment Method**. + * **Invoice template:** This is a LibreOffice template that will render the invoices. **Admin -> Invoice templates** shows the list of available templates. Here you can also download a template and upload a modified version. + * **Invoice status:** **Created** is a freshly created invoice. The other options are for tracking the payment process. You can configure invoice states in **Admin -> Categories -> Intranet Cost Status**. + * **Invoice type:** **Customer Invoice** is the default type of invoice. + * **Customer:** You can set up new customers in **Master Data -> Companies -> New Company** or the CRM section of ]po[. + * **Invoice address:** One customer may have multiple places of business, so enter the address where you want this invoice sent. + * **Contact:** Enter the person who should receive the invoice. ]po[ can send out invoices directly as emails. + * **Notes:** Enter any notes relevant to the invoice. + * **VAT:** Most countries use value-added tax (VAT). You can also configure VAT types (instead of a numeric value) for certain countries. + * **TAX:** Some countries add a second tax to invoices. You can disable this field in **Admin -> Parameters -> intranet-invoices** if you don't need this. + + + +Fields in the invoice lines: + + * **Line:** This is a way to order the invoice line items. + * **Description:** Enter a description of the item. + * **Unit:** Enter the units of what you invoice (e.g., how many hours, days, etc.). + * **UoM:** This stands for unit of measure, and it can be the number of hours, days, or just units. + * **Rate:** This is the price per unit using the default currency. You can configure currencies in **Master Data -> Exchange Rates** and define the default currency in **Admin -> Parameters -> DefaultCurrency**. + + + +Clicking the **Preview using Template** link will launch your text processor (Microsoft Word or LibreOffice Writer) if it's installed on your computer. You can now edit the invoice before you send it to the customer. + +![Invoice print preview][13] + +Figure 7. Invoice print preview  (Frank Bergmann, [CC BY-SA 4.0][4]) + +#### Create an invoice semiautomatically + +]po[ also has a wizard that converts logged hours "automagically" into invoice line items for you. This process applies to fixed-price, time-and-materials, and periodic invoicing types. + +Use **<project> -> Finance -> New Customer Invoice from Timesheet Tasks** to start the wizard. + +![Invoice wizard][14] + +Figure 8. Invoice wizard (Frank Bergmann, [CC BY-SA 4.0][4]) + +The main part of the screen (labeled **(1)** in the image above) shows five different types of hours per task. This works a bit like a report but lets you take actions using the provided user interface elements: + + * **Planned Hours:** The estimated hours for the task, as specified in the Gantt editor during project planning + * **Billable Hours:** Similar to Planned Hours, but you can manually modify this to account for non-billable time + * **All Reported Hours:** All timesheet hours logged by anyone, ever + * **Reported Hours in Interval:** Hours logged between the start date and end date in the filter **(2)** at the top of the screen + * **All Unbilled Hours:** Hours that aren't included in any previous invoice created using this wizard. This figure is useful when doing periodic invoicing to see if hours "slipped through" in past invoicing runs. + + + +The checkboxes **(3)** in the first column let you manually deselect certain tasks. The **Aggregate hours** checkbox **(4)** lets you create invoice lines per task (when unchecked) or invoice lines per material (when checked). Select **aggregate** if there are many tasks in your project; otherwise, your invoice could become very long. + +Your result is an invoice like this: + +![Invoice proposed by the wizard][15] + +Figure 9. Invoice proposed by the wizard (Frank Bergmann, [CC BY-SA 4.0][4]) + +This is similar to the manually created invoice but with additional information: + + * The invoice lines are copied from the selected tasks in the previous screen. Summary tasks are excluded because, otherwise, the number of hours would be duplicated. + * The **Rate** column includes the best matching rate for the task (see below). + + + +Select the **Create Customer Invoice** button to finish the process. But before doing that, you may want to check that the prices are right. + +##### Check the price list and reference prices + +The **Reference Prices** section in the figure above explains how the best matching rate is determined for each of the six invoice lines (this is why the same line is repeated six times). + +The source of this data is the **Company Timesheet Prices** portlet. + +![Company Timesheet Prices portlet][16] + +Figure 10. Price list with one entry (Frank Bergmann, [CC BY-SA 4.0][4]) + +This example contains a single line with **Hour** as the UoM and 75.00 EUR as the **Rate**; all other fields are empty. We could translate this as: "All hours for this customer cost EUR 75.00." This is a suitable definition of a "default rate" if you want to keep things simple. + +##### Use the price-finding algorithm + +Unfortunately, reality tends to be complex. Consider the example below. It defines a discount for TCL Programming Hours but only for the specific project Motor Development (2016_0019). + +![Price-finding data entry screen][17] + +Figure 11. Price entry in a specific project (Frank Bergmann, [CC BY-SA 4.0][4]) + +The price-finding algorithm will select the most suitable rate for each line of the new invoice by choosing the one with the highest number of matching fields and discarding those with hard mismatches. The **Reference Prices** section will list all candidate rate entries, from best match to worst. + +In the end, though, it's up to you to modify the proposed rates. This option for manual intervention is designed to handle the most unusual cases. + +### Next steps + +There are a number of steps that come after writing an invoice. Detailing them would exceed the scope of this tutorial. However, the functionality is available as part of the ]po[ Community Edition: + + * **Accounts receivable:** The **Finance -> Accounts Receivable** section allows you to follow up on invoices and send reminders to customers. + * **Procurement and accounts payable:** ]po[ includes a project-based procurement and vendor-management system. + * **Profit and loss:** You'll be interested to see if you made a profit on your project or not. + * **Learned lessons:** You may want to do a post-mortem to review the project and learn what to do differently the next time. + * **Cash-flow forecasting:** Starting with your current bank account level, your invoices, and your CRM sales funnel, this will calculate the moment when your company will run out of money. + * **Management accounting:** This consists of many that reports that will answer most questions about your business out of the box. There's a tutorial on how to write your own reports. + * **Tax reporting:** ]po[ captures almost everything a service company needs for tax reporting. There are export interfaces for various accounting software packages. + + + +What are your biggest challenges with invoicing customers? Please share your pet peeves in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/open-source-invoicing-po + +作者:[Frank Bergmann][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/fraber +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/computer_browser_web_desktop.png?itok=Bw8ykZMA (Digital images of a computer desktop) +[2]: https://www.project-open.com/ +[3]: https://opensource.com/sites/default/files/uploads/1-invoicingprocess.png (Invoicing processes covered in this tutorial) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/2-ganttchart.png (Initial project definition Gantt Chart) +[6]: https://www.project-open.com/en/list-installers +[7]: https://opensource.com/sites/default/files/pictures/define-a-project-gantt-project.png (Gantt chart with project definition and status) +[8]: https://opensource.com/sites/default/files/uploads/3-timesheet-calendar.png (Time sheet calendar) +[9]: https://opensource.com/sites/default/files/uploads/4-logging-hours.png (Logging hours) +[10]: https://www.project-open.com/en/ +[11]: https://opensource.com/sites/default/files/uploads/5-project-status.png (Project status Gantt chart) +[12]: https://opensource.com/sites/default/files/uploads/6-invoicing.png (Creating an invoice manually) +[13]: https://opensource.com/sites/default/files/uploads/7-invoice-preview.png (Invoice print preview) +[14]: https://opensource.com/sites/default/files/uploads/8-invoice-wizard_rev.png (Invoice wizard) +[15]: https://opensource.com/sites/default/files/uploads/8-invoice-wizard.png (Invoice proposed by the wizard) +[16]: https://opensource.com/sites/default/files/uploads/10-timesheet-prices.png (Company Timesheet Prices portlet) +[17]: https://opensource.com/sites/default/files/uploads/11-price-finding.png (Price-finding data entry screen) From 147c458e5fb648556854c3cf09e0c0be7e6e6174 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Sep 2021 05:03:21 +0800 Subject: [PATCH 0317/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210909?= =?UTF-8?q?=20Ubuntu=E2=80=99s=20Yaru=20Theme=20Now=20Officially=20Support?= =?UTF-8?q?s=20Xfce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md --- ...Yaru Theme Now Officially Supports Xfce.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md diff --git a/sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md b/sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md new file mode 100644 index 0000000000..f9607f5d74 --- /dev/null +++ b/sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md @@ -0,0 +1,71 @@ +[#]: subject: "Ubuntu’s Yaru Theme Now Officially Supports Xfce" +[#]: via: "https://news.itsfoss.com/yaru-xfce-support/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ubuntu’s Yaru Theme Now Officially Supports Xfce +====== + +Back when [Ubuntu 20.04][1] was released, the Ubuntu team stunned everyone with the new Yaru theme’s beautiful visuals and simplicity. It keeps on getting better with each Ubuntu release. It has become the symbolism of Ubuntu now. + +However, the Yaru theme was not well supported for other desktop environments like Xfce. + +Fortunately, this is set to change with a recent pull request on the [project’s GitHub page][2]. Here, we will be looking at this change, as well as how to try out these changes for yourself. + +### Yaru on Xfce + +![][3] + +This update started in late July, when developer [Muqtxdir][4] opened [a pull request on the Yaru GitHub page][5] to add support for the XFCE desktop environment. Over the course of a month, the awesome developers there worked tirelessly on improving Muqtxdir’s work, with a result that is truly stunning. + +![][3] + +One interesting change is the panel, which now looks similar to the panel found in the GNOME desktop environment. + +### If you want to try it right away (not recommended) + +If you are already using XFCE, trying out the Yaru theme is as simple as following the instructions on here. For this, I will be assuming that you are using Xubuntu, however the commands can be easily adapted for other distributions. + +``` +sudo apt install git meson sassc libglib2.0-dev libxml2-utils +git clone https://github.com/ubuntu/yaru +cd yaru && meson build -Dxfwm4=true && sudo ninja -C build install +``` + +_**If you don’t quite feel comfortable building it from source, I suspect that it will be available with Xubuntu 21.10, which is only a month away now.**_ + +Either way, I am really excited about this change, especially as it gives XFCE a much more modern and simplistic look. Plus, it also gives users a major reason to upgrade to Xubuntu 21.10. + +What do you think about the Yaru theme on XFCE? Let me know in the comments below! + +_Source: [Linux Uprising][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 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/yaru-xfce-support/ + +作者:[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://itsfoss.com/download-ubuntu-20-04/ +[2]: https://github.com/ubuntu/yaru +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://github.com/Muqtxdir +[5]: https://github.com/ubuntu/yaru/pull/2971 +[6]: https://www.linuxuprising.com/2021/09/ubuntus-yaru-theme-gets-official.html From c3526a24be560ebc1961d434699a57091fe713f3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Sep 2021 05:03:38 +0800 Subject: [PATCH 0318/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210909?= =?UTF-8?q?=20Vivaldi=20Replaces=20Firefox=20as=20the=20Default=20Browser?= =?UTF-8?q?=20on=20Manjaro=20Linux=20Cinnamon?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md --- ...fault Browser on Manjaro Linux Cinnamon.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md diff --git a/sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md b/sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md new file mode 100644 index 0000000000..249f3778c3 --- /dev/null +++ b/sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md @@ -0,0 +1,81 @@ +[#]: subject: "Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon" +[#]: via: "https://news.itsfoss.com/vivaldi-replaces-firefox-manjaro/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon +====== + +Vivaldi is one of the [best web browsers available for Linux][1]. + +For all the good reasons, many Linux users have been switching to Vivaldi, especially after [Vivaldi 4.0 release][2]. + +Now, to take it up a notch, Vivaldi has managed to replace Firefox as the default browser on Arch-based Manjaro Linux (Cinnamon edition). + +![][3] + +Even though the Cinnamon version is a community edition, it is surprising that Mozilla Firefox dropped from a Linux distribution. + +As per the official announcement, Manjaro’s co-CEO mentioned why they chose Vivaldi: + +> _To give Vivaldi more of the attention it deserves, I decided to include it as the default browser in our popular Cinnamon Community Edition. With its remarkable browsing speed, exceptional customizability and especially the way it values user privacy, Vivaldi for me is a perfect match for Manjaro Linux._ + +### Customized Experience for Manjaro Linux Users + +![][4] + +To spice things up, [Vivaldi][5] comes baked in with a Manjaro-Cinnamon theme to give you a refreshing out-of-the-box experience. + +Of course, if you have already used Vivaldi as your browser, you have to sync your data to get started. + +### Vivaldi is a Great Option for Linux Users + +![][6] + +It is worth noting that Vivaldi is not 100% open-source, but you can find most of its source code online, except its UI. Also, it is based on Chromium. + +However, it is a feature-rich web browser that lets you customize a lot of things. You also get a unique tab management feature, integration of web apps, email, calendar, timer, RSS feeds, and more. + +I have been using Vivaldi as my daily driver on Linux, keeping Firefox as the secondary for a while now. And, I like the experience so far! + +So, if you prefer multi-tasking without leaving the web browser, Vivaldi as your default choice should be exciting. + +In addition to this, Vivaldi seems to be taking good care of its privacy policies while offering in-built ad blockers and encrypted sync features. + +### Get Started Using Vivaldi on Manjaro Linux + +You should be able to find and install Vivaldi through official Manjaro repositories. + +If you want it by default, you can consider performing a fresh installation of Manjaro Linux Cinnamon. + +Manjaro Linux Cinnamon + +#### 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/vivaldi-replaces-firefox-manjaro/ + +作者:[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/best-browsers-ubuntu-linux/ +[2]: https://news.itsfoss.com/vivaldi-4-0-release/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMCIgd2lkdGg9IjY2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://vivaldi.com +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYxOCIgd2lkdGg9IjY5NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= From 8ab8e4be8cbd7419a0d57e35dd44008c4fd5a653 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 10 Sep 2021 05:03:53 +0800 Subject: [PATCH 0319/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210909?= =?UTF-8?q?=20Adobe=20Kills=20Brackets=20Code=20Editor=20&=20Suggests=20Us?= =?UTF-8?q?ing=20Visual=20Studio=20Code?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md --- ...tor - Suggests Using Visual Studio Code.md | 81 +++++++++++++++++++ 1 file changed, 81 insertions(+) create mode 100644 sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md diff --git a/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md b/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md new file mode 100644 index 0000000000..045c0d6cfb --- /dev/null +++ b/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md @@ -0,0 +1,81 @@ +[#]: subject: "Adobe Kills Brackets Code Editor & Suggests Using Visual Studio Code" +[#]: via: "https://news.itsfoss.com/adobe-kills-brackets-editor/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Adobe Kills Brackets Code Editor & Suggests Using Visual Studio Code +====== + +Brackets was an impressive open-source modern code editor available for Windows, macOS, and Linux. + +Adobe created it as a community-guided project to help web developers. We previously listed it as one of the [best modern text editors available for coders][1]. + +Unfortunately, Adobe ended its support for Brackets on September 1, 2021. + +### Why Did Adobe Discontinue Brackets? + +![][2] + +It looks like Adobe’s partnership with Microsoft may have encouraged them to pull the plug off the community project. + +Hence, they recommend users migrate to Microsoft’s Visual Studio Code editor. + +![][3] + +This is what Brackets’ original GitHub page says after the discontinuation of the project. + +### Visual Studio Code as a Replacement to Brackets + +Of course, Microsoft’s Visual Studio Code is a fantastic alternative and built on open-source. However, when you download the Visual Studio Code from their website, it does not come under a license that promotes free and open-source software. + +So, you may have to build from source or try [VSCodium][4], a freely licensed edition of Visual Studio Code minus the telemetry/tracking. + +Also, there is an [official guide on migrating from Brackets][5] that you can explore if interested. + +### Brackets Will Continue as a Fork Without Adobe + +![][6] + +Even though Adobe has discontinued the project, the [original website][7] still exists to maintain a fork of the project. + +The project’s name is subject to change, but as of now, it’s “**Brackets Continued**” to help users identify the fork. + +Do note that the fork does not yet have a release, and we have no idea if it will continue as an independent project. + +So, if you want to help Brackets fork and help maintain it somehow, head to its GitHub page for more details. + +[Brackets Continued (Fork)][8] + +_What do you prefer to use as your code editor? Did you like Brackets code editor for web development work? Feel free to share your thoughts on this 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/adobe-kills-brackets-editor/ + +作者:[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/best-modern-open-source-code-editors-for-linux/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://vscodium.com +[5]: https://code.visualstudio.com/migrate-from-brackets +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMyNyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://brackets.io +[8]: https://github.com/brackets-cont/brackets From de950fa0dca211e486574d0ba802f1c81419a88d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 10 Sep 2021 07:19:48 +0800 Subject: [PATCH 0320/1588] Delete 20210909 .md --- sources/tech/20210909 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210909 .md diff --git a/sources/tech/20210909 .md b/sources/tech/20210909 .md deleted file mode 100644 index 10e6715b07..0000000000 --- a/sources/tech/20210909 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/fedora-35/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From ef5ae8a695699ace6edc8edd104dd062523ce4a7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Sep 2021 07:30:15 +0800 Subject: [PATCH 0321/1588] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @New-World-2019 感谢您,完成了第一篇翻译贡献! --- ...e status on Linux with the stat command.md | 61 +++++++++---------- 1 file changed, 28 insertions(+), 33 deletions(-) diff --git a/translated/tech/20210820 Check file status on Linux with the stat command.md b/translated/tech/20210820 Check file status on Linux with the stat command.md index 287613b4bc..3073d3a982 100644 --- a/translated/tech/20210820 Check file status on Linux with the stat command.md +++ b/translated/tech/20210820 Check file status on Linux with the stat command.md @@ -4,29 +4,30 @@ [#]: collector: "lujun9972" [#]: translator: "New-World-2019" [#]: reviewer: "turbokernel" -[#]: publisher: " " +[#]: publisher: "wxy" [#]: url: " " 在 Linux 上使用 stat 命令查看文件状态 ====== -获取到任何文件或文件系统的所有信息,仅需要一条 Linux 命令。 -![Hand putting a Linux file folder into a drawer][1] -在 GNU `coreutils` 软件包中包含 `stat` 命令,它提供了关于文件和文件系统包括文件大小、结点位置、访问权限和 SELinux 上下文以及创建和修改时间等各种元数据。通常情况下,你需要多个不同命令获取的信息,而这一个命令就可以实现。 +> 获取到任何文件或文件系统的所有信息,仅需要一条 Linux 命令。 + +![](https://img.linux.net.cn/data/attachment/album/202109/10/072912ouo04jchatqazq53.jpg) + +在 GNU `coreutils` 软件包中包含 `stat` 命令,它提供了关于文件和文件系统包括文件大小、节点位置、访问权限和 SELinux 上下文,以及创建和修改时间等各种元数据。通常情况下,你需要多个不同命令获取的信息,而这一个命令就可以实现。 ### 在 Linux 上安装 stat 命令 -在 Linux 系统中,可能已经预装了 `stat` 命令,因为它属于核心功能软件包,通常包含在 Linux 默认发行版里。 +在 Linux 系统中,可能已经预装了 `stat` 命令,因为它属于核心功能软件包,通常默认包含在 Linux 发行版里。 如果系统中没有安装 `stat` 命令,你可以使用包管理器安装 `coreutils` 软件包。 -另外,你可以 [ 通过源码编译安装 coreutils 包 ][2]。 +另外,你可以 [通过源码编译安装 coreutils 包][2]。 ### 获取文件状态 运行 `stat` 命令可以获取指定文件或目录易读的状态信息。 - ``` $ stat planets.xml File: planets.xml @@ -42,24 +43,21 @@ Change: 2021-08-17 18:26:58.738332799 +1200 输出的信息易懂,但是包含了很多的信息,这里是 `stat` 所包含的项: - * **File**: 文件名 - * **Size**: 文件大小,以字节表示 - * **Blocks**: 在硬盘驱动器上为文件保留的数据块的数量 - * **IO Block**: 文件系统块大小 - * **regular file**: 文件类型(普通文件,目录,文件系统) - * **Device**: 文件所在的设备 - * **Inode**: 文件所在的 Inode 号 - * **Links**: 文件的链接数 - * **Access, UID, GID**: 文件权限,用户和组的所有者 - * **Context**: SELinux 上下文 - * **Access, Modify, Change, Birth**: 文件被访问、修改、更改状态以及创建时的时间戳 - - + * `File`:文件名 + * `Size`:文件大小,以字节表示 + * `Blocks`:在硬盘驱动器上为文件保留的数据块的数量 + * `IO Block`:文件系统块大小 + * `regular file`:文件类型(普通文件、目录、文件系统) + * `Device`:文件所在的设备 + * `Inode`:文件所在的 Inode 号 + * `Links`:文件的链接数 + * `Access`、`UID`、`GID`:文件权限、用户和组的所有者 + * `Context`:SELinux 上下文 + * `Access`、`Modify`、`Change`、`Birth`:文件被访问、修改、更改状态以及创建时的时间戳 ### 精简输出 -对于精通输出或者想要使用其它工具(例如:[awk][3])解析输出的人,这里可以使用 `--terse`(短参数为 `-t`) 参数,实现没有标题或换行符的格式化输出。 - +对于精通输出或者想要使用其它工具(例如:[awk][3])解析输出的人,这里可以使用 `--terse`(短参数为 `-t`)参数,实现没有标题或换行符的格式化输出。 ``` $ stat --terse planets.xml @@ -70,7 +68,6 @@ planets.xml 325 8 81b4 100977 100 fd03 140217 1 0 0 1629181617 1629181618 162918 你可以使用 `--printf` 参数以及与 [printf][4] 类似的语法定义自己的输出格式。`stat` 的每一个属性都有一个格式序列(`%C` 表示 SELinux 上下文,`%n` 表示文件名等等),所以,你可以定义输出格式。 - ``` $ stat --printf="%n\n%C\n" planets.xml planets.xml @@ -82,16 +79,14 @@ Modified: 2021-08-17 18:26:58.738332799 +1200 下面是一些常见的格式序列: - * **%a** 访问权限 - * **%F** 文件类型 - * **%n** 文件名 - * **%U** 用户名 - * **%u** 用户 ID - * **%g** 组 ID - * **%w** 创建时间 - * **%y** 修改时间 - - + * `%a` 访问权限 + * `%F` 文件类型 + * `%n` 文件名 + * `%U` 用户名 + * `%u` 用户 ID + * `%g` 组 ID + * `%w` 创建时间 + * `%y` 修改时间 在 `stat` 手册和 `coreutils` 信息页中都有完整的格式化序列列表。 From d1d150b2c22f26af0c45f5e382251357a436ec65 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Sep 2021 07:31:15 +0800 Subject: [PATCH 0322/1588] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @New-World-2019 本文首发地址:https://linux.cn/article-13768-1.html 您的 LCTT 专页:https://linux.cn/lctt/New-World-2019 --- ...20210820 Check file status on Linux with the stat command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) rename {translated/tech => published}/20210820 Check file status on Linux with the stat command.md (98%) diff --git a/translated/tech/20210820 Check file status on Linux with the stat command.md b/published/20210820 Check file status on Linux with the stat command.md similarity index 98% rename from translated/tech/20210820 Check file status on Linux with the stat command.md rename to published/20210820 Check file status on Linux with the stat command.md index 3073d3a982..551d34a53f 100644 --- a/translated/tech/20210820 Check file status on Linux with the stat command.md +++ b/published/20210820 Check file status on Linux with the stat command.md @@ -5,7 +5,7 @@ [#]: translator: "New-World-2019" [#]: reviewer: "turbokernel" [#]: publisher: "wxy" -[#]: url: " " +[#]: url: "https://linux.cn/article-13768-1.html" 在 Linux 上使用 stat 命令查看文件状态 ====== From d5d623e0989a394f99c86e61dba336a4f9fcf795 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Sep 2021 07:58:23 +0800 Subject: [PATCH 0323/1588] PRF @unigeorge --- ...200211 Using external libraries in Java.md | 250 +++++++++--------- 1 file changed, 125 insertions(+), 125 deletions(-) diff --git a/translated/tech/20200211 Using external libraries in Java.md b/translated/tech/20200211 Using external libraries in Java.md index f852e55ce6..f739050739 100644 --- a/translated/tech/20200211 Using external libraries in Java.md +++ b/translated/tech/20200211 Using external libraries in Java.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Using external libraries in Java) @@ -9,37 +9,39 @@ 在 Java 中使用外部库 ====== -外部库填补了 Java 核心库中的一些功能空白。 -![books in a library, stacks][1] -Java 自带有一组核心库,其中包含了定义常用数据类型和相关行为的库(例如 **String** 和 **Date**)、与主机操作系统交互的实用程序(例如 **System** 和 **File**),以及一些用来管理安全性、处理网络通信、创建或解析 XML的有用的子系统。鉴于核心库的丰富性,程序员通常很容易在其中找到有用的组件,以减少需要编写的代码量。 +> 外部库填补了 Java 核心库中的一些功能空白。 -即便如此,核心库仍有一些功能上的不足,因此发现这些不足的程序员们还额外创建了很多有趣的 Java 库。例如,[Apache Commons][2] 是一个专注于可重用 Java 组件所有方面的 Apache 项目,提供了大约 43 个开源库的集合(截至撰写本文时),涵盖了 Java 核心库之外的一系列功能 (例如 [geometry][3] 或 [statistics][4]),并增强或替换了 Java 核心库中的原有功能(例如 [math][5] 或 [numbers][6])。 +![](https://img.linux.net.cn/data/attachment/album/202109/10/075749s65x89uzxj8x5kq9.jpg) + +Java 自带有一组核心库,其中包含了定义常用数据类型和相关行为的库(例如 `String` 和 `Date`)、与主机操作系统交互的实用程序(例如 `System` 和 `File`),以及一些用来管理安全性、处理网络通信、创建或解析 XML的有用的子系统。鉴于核心库的丰富性,程序员通常很容易在其中找到有用的组件,以减少需要编写的代码量。 + +即便如此,核心库仍有一些功能上的不足,因此发现这些不足的程序员们还额外创建了很多有趣的 Java 库。例如,[Apache Commons][2]“是一个专注于可重用 Java 组件所有方面的 Apache 项目”,提供了大约 43 个开源库的集合(截至撰写本文时),涵盖了 Java 核心库之外的一系列功能 (例如 [geometry][3] 或 [statistics][4]),并增强或替换了 Java 核心库中的原有功能(例如 [math][5] 或 [numbers][6])。 另一种常见的 Java 库类型是系统组件的接口(例如数据库系统接口),本文会着眼于使用此类接口连接到 [PostgreSQL][7] 数据库,并得到一些有趣的信息。首先,我们来回顾一下库的重要部分。 ### 什么是库? -库里自然包含的是一些有用的代码。但为了发挥用处,代码需要以特定方式进行组织,特定的方式使 Java 程序员可以访问其中组件来解决手头问题。 +library里自然包含的是一些有用的代码。但为了发挥用处,代码需要以特定方式进行组织,特定的方式使 Java 程序员可以访问其中组件来解决手头问题。 -可以说,一个库最重要的部分是它的应用程序编程接口 (API) 文档。这种文档很多人都熟悉,通常是由 [Javadoc][8] 生成的。Javadoc 读取代码中的结构化注释并以 HTML 格式输出文档,通常 API 的 (pacage) 在页面左上角的面板中显示,(class) 在左下角显示,同时右侧会有库、包或类级别的详细文档(具体取决于在主面板中选择的内容)。例如,[Apache Commons Math 的顶级 API 文档][9] 如下所示: +可以说,一个库最重要的部分是它的应用程序编程接口(API)文档。这种文档很多人都熟悉,通常是由 [Javadoc][8] 生成的。Javadoc 读取代码中的结构化注释并以 HTML 格式输出文档,通常 API 的 package 在页面左上角的面板中显示,class 在左下角显示,同时右侧会有库、包或类级别的详细文档(具体取决于在主面板中选择的内容)。例如,[Apache Commons Math 的顶级 API 文档][9] 如下所示: ![API documentation for Apache Commons Math][10] -单击主面板中的包会显示该包中定义的 Java 类和接口。例如,**[org.apache.commons.math4.analysis.solvers][11]** 显示了诸如 **BisectionSolver** 这样的类,该类用于使用二分算法查找单变量实函数的零点。单击 [BisectionSolver][12] 链接会列出 **BisectionSolver** 类的所有方法。 +单击主面板中的包会显示该包中定义的 Java 类和接口。例如,[org.apache.commons.math4.analysis.solvers][11] 显示了诸如 `BisectionSolver` 这样的类,该类用于使用二分算法查找单变量实函数的零点。单击 [BisectionSolver][12] 链接会列出 `BisectionSolver` 类的所有方法。 -这类文档可用作参考文档,不适合作为学习如何使用库的教程。比如,如果你知道什么是单变量实函数并查看包 **org.apache.commons.math4.analysis.function**,就可以试着使用该包来组合函数定义,然后使用 **org.apache.commons.math4.analysis.solvers** 包来查找刚刚创建的函数的零点。但如果你不知道,就可能需要更多学习向的文档,也许甚至是一个实际例子,来读懂参考文档。 +这类文档可用作参考文档,不适合作为学习如何使用库的教程。比如,如果你知道什么是单变量实函数并查看包 `org.apache.commons.math4.analysis.function`,就可以试着使用该包来组合函数定义,然后使用 `org.apache.commons.math4.analysis.solvers` 包来查找刚刚创建的函数的零点。但如果你不知道,就可能需要更多学习向的文档,也许甚至是一个实际例子,来读懂参考文档。 -这种文档结构还有助于阐明 _package_(相关 Java 类和接口定义的集合)的含义,并显示特定库中捆绑了哪些包。 +这种文档结构还有助于阐明 package(相关 Java 类和接口定义的集合)的含义,并显示特定库中捆绑了哪些包。 -这种库的代码通常是在 [**.jar** 文件][13] 中,它基本上是由 Java 的 **jar** 命令创建的 .zip 文件,其中还包含一些其他有用的信息。**.jar** 文件通常被创建为构建过程的端点,该构建过程编译了所定义包中的所有 **.java** 文件。 +这种库的代码通常是在 [.jar 文件][13] 中,它基本上是由 Java 的 `jar` 命令创建的 .zip 文件,其中还包含一些其他有用的信息。.jar 文件通常被创建为构建过程的端点,该构建过程编译了所定义包中的所有 .java 文件。 要访问外部库提供的功能,有两个主要步骤: - 1. 确保通过类路径(或者命令行中的 **-cp** 参数或者 **CLASSPATH** 环境变量),库可用于 Java 编译步骤([**javac**][14])和执行步骤(**java**)。 - 2. 使用恰当的 **import** 语句访问程序源代码中的包和类。 + 1. 确保通过类路径(或者命令行中的 `-cp` 参数或者 `CLASSPATH` 环境变量),库可用于 Java 编译步骤([javac][14])和执行步骤(`java`)。 + 2. 使用恰当的 `import` 语句访问程序源代码中的包和类。 -其余的步骤就与使用 **String** 等 Java核心类相同,使用库提供的类和接口定义来编写代码。很简单对吧?不过也没那么简单。首先,你需要了解库组件的预期使用模式,然后才能编写代码。 +其余的步骤就与使用 `String` 等 Java核心类相同,使用库提供的类和接口定义来编写代码。很简单对吧?不过也没那么简单。首先,你需要了解库组件的预期使用模式,然后才能编写代码。 ### 示例:连接 PostgreSQL 数据库 @@ -52,42 +54,42 @@ Java 自带有一组核心库,其中包含了定义常用数据类型和相关 5. 针对返回的结果,做需要的处理。 6. 断开与数据库服务器的连接。 -所有这些面向程序员的部分由接口包 **[java.sql][15]** 提供,它独立于数据库,定义了核心客户端 Java 数据库连接 (JDBC) API。**java.sql** 包是 Java 核心库的一部分,因此无需提供 **.jar** 文件即可编译。但每个数据库提供者都会创建自己的 **java.sql** 接口实现(例如 **Connection** 接口),并且必须在运行步骤中提供这些实现。 +所有这些面向程序员的部分由接口包 [java.sql][15] 提供,它独立于数据库,定义了核心客户端 Java 数据库连接(JDBC)API。`java.sql` 包是 Java 核心库的一部分,因此无需提供 .jar 文件即可编译。但每个数据库提供者都会创建自己的 `java.sql` 接口实现(例如 `Connection` 接口),并且必须在运行步骤中提供这些实现。 接下来我们使用 PostgreSQL,看看这一过程是如何进行的。 #### 访问特定数据库的代码 -以下代码使用 [Java 类加载器][16](**Class.forName()** 调用)将 PostgreSQL 驱动程序代码加载到正在执行的虚拟机中: +以下代码使用 [Java 类加载器][16](`Class.forName()` 调用)将 PostgreSQL 驱动程序代码加载到正在执行的虚拟机中: ``` import java.sql.*; public class Test1 { -    public static void main([String][17] args[]) { + public static void main(String args[]) { -        // Load the driver (jar file must be on class path) [1] + // Load the driver (jar file must be on class path) [1] -        try { -            Class.forName("org.postgresql.Driver"); -            [System][18].out.println("driver loaded"); -        } catch ([Exception][19] e1) { -            [System][18].err.println("couldn't find driver"); -            [System][18].err.println(e1); -            [System][18].exit(1); -        } + try { + Class.forName("org.postgresql.Driver"); + System.out.println("driver loaded"); + } catch (Exception e1) { + System.err.println("couldn't find driver"); + System.err.println(e1); + System.exit(1); + } -        // If we get here all is OK + // If we get here all is OK -        [System][18].out.println("done."); -    } + System.out.println("done."); + } } ``` -因为类加载器可能失败,失败时会抛出异常,所以将对 **Class.forName()** 的调用放在 try-catch 代码块中。 +因为类加载器可能失败,失败时会抛出异常,所以将对 `Class.forName()` 的调用放在 `try-catch` 代码块中。 -如果你使用 **javac** 编译上面的代码,然后用 Java 运行,会报异常: +如果你使用 `javac` 编译上面的代码,然后用 `java` 运行,会报异常: ``` me@mymachine:~/Test$ javac Test1.java @@ -97,7 +99,7 @@ java.lang.ClassNotFoundException: org.postgresql.Driver me@mymachine:~/Test$ ``` -类加载器要求类路径中有包含 PostgreSQL JDBC 驱动程序实现的 **.jar** 文件: +类加载器要求类路径中有包含 PostgreSQL JDBC 驱动程序实现的 .jar 文件: ``` me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test1 @@ -115,41 +117,41 @@ import java.sql.*; public class Test2 { -        public static void main([String][17] args[]) { + public static void main(String args[]) { -                // Load the driver (jar file must be on class path) [1] + // Load the driver (jar file must be on class path) [1] -                try { -                        Class.forName("org.postgresql.Driver"); -                        [System][18].out.println("driver loaded"); -                } catch ([Exception][19] e1) { -                        [System][18].err.println("couldn't find driver"); -                        [System][18].err.println(e1); -                        [System][18].exit(1); -                } + try { + Class.forName("org.postgresql.Driver"); + System.out.println("driver loaded"); + } catch (Exception e1) { + System.err.println("couldn't find driver"); + System.err.println(e1); + System.exit(1); + } -                // Set up connection properties [2] + // Set up connection properties [2] -                java.util.[Properties][20] props = new java.util.[Properties][20](); -                props.setProperty("user","me"); -                props.setProperty("password","mypassword"); -                [String][17] database = "jdbc:postgresql://myhost.org:5432/test"; + java.util.Properties props = new java.util.Properties(); + props.setProperty("user","me"); + props.setProperty("password","mypassword"); + String database = "jdbc:postgresql://myhost.org:5432/test"; -                // Open the connection to the database [3] + // Open the connection to the database [3] -                try ([Connection][21] conn = [DriverManager][22].getConnection(database, props)) { -                        [System][18].out.println("connection created"); -                } catch ([Exception][19] e2) { -                        [System][18].err.println("sql operations failed"); -                        [System][18].err.println(e2); -                        [System][18].exit(2); -                } -                [System][18].out.println("connection closed"); + try (Connection conn = DriverManager.getConnection(database, props)) { + System.out.println("connection created"); + } catch (Exception e2) { + System.err.println("sql operations failed"); + System.err.println(e2); + System.exit(2); + } + System.out.println("connection closed"); -                // If we get here all is OK + // If we get here all is OK -                [System][18].out.println("done."); -        } + System.out.println("done."); + } } ``` @@ -167,15 +169,13 @@ me@mymachine:~/Test$ 关于上述的一些注意事项: - * 注释 [2] 后面的代码使用系统属性来设置连接参数(在本例中参数为 PostgreSQL 用户名和密码)。代码也可以从 Java 命令行获取这些参数并将所有参数作为参数包传递,同时还有一些其他 **Driver.getConnection()** 选项可用于单独传递参数。 - * JDBC 需要一个用于定义数据库的 URL,它在上述代码中被声明为 **String database** 并与连接参数一起传递给 **Driver.getConnection()** 方法。 - * 代码使用 try-with-resources 语句,它会在 try-catch 块中的代码完成后自动关闭连接。[Stack Overflow][23] 上对这种方法进行了长期的讨论。 - * try-with-resources 语句提供对 **Connection** 实例的访问,并可以在其中执行 SQL 语句;所有错误都会被同一个 **catch** 语句捕获。 + * 注释 `[2]` 后面的代码使用系统属性来设置连接参数(在本例中参数为 PostgreSQL 用户名和密码)。代码也可以从 Java 命令行获取这些参数并将所有参数作为参数包传递,同时还有一些其他 `Driver.getConnection()` 选项可用于单独传递参数。 + * JDBC 需要一个用于定义数据库的 URL,它在上述代码中被声明为 `String database` 并与连接参数一起传递给 `Driver.getConnection()` 方法。 + * 代码使用 `try-with-resources` 语句,它会在 `try-catch` 块中的代码完成后自动关闭连接。[Stack Overflow][23] 上对这种方法进行了长期的讨论。 + * `try-with-resources` 语句提供对 `Connection` 实例的访问,并可以在其中执行 SQL 语句;所有错误都会被同一个 `catch` 语句捕获。 #### 用数据库的连接处理一些有趣的事情 -In my day job, I often need to know what users have been defined for a given database server instance, and I use this [handy piece of SQL][24] for grabbing a list of all users: - 日常工作中,我经常需要知道为给定的数据库服务器实例定义了哪些用户,这里我使用这个 [简便的 SQL][24] 来获取所有用户的列表: ``` @@ -183,78 +183,78 @@ import java.sql.*; public class Test3 { -        public static void main([String][17] args[]) { + public static void main(String args[]) { -                // Load the driver (jar file must be on class path) [1] + // Load the driver (jar file must be on class path) [1] -                try { -                        Class.forName("org.postgresql.Driver"); -                        [System][18].out.println("driver loaded"); -                } catch ([Exception][19] e1) { -                        [System][18].err.println("couldn't find driver"); -                        [System][18].err.println(e1); -                        [System][18].exit(1); -                } + try { + Class.forName("org.postgresql.Driver"); + System.out.println("driver loaded"); + } catch (Exception e1) { + System.err.println("couldn't find driver"); + System.err.println(e1); + System.exit(1); + } -                // Set up connection properties [2] + // Set up connection properties [2] -                java.util.[Properties][20] props = new java.util.[Properties][20](); -                props.setProperty("user","me"); -                props.setProperty("password","mypassword"); -                [String][17] database = "jdbc:postgresql://myhost.org:5432/test"; + java.util.Properties props = new java.util.Properties(); + props.setProperty("user","me"); + props.setProperty("password","mypassword"); + String database = "jdbc:postgresql://myhost.org:5432/test"; -                // Open the connection to the database [3] + // Open the connection to the database [3] -                try ([Connection][21] conn = [DriverManager][22].getConnection(database, props)) { -                        [System][18].out.println("connection created"); + try (Connection conn = DriverManager.getConnection(database, props)) { + System.out.println("connection created"); -                        // Create the SQL command string [4] + // Create the SQL command string [4] -                        [String][17] qs = "SELECT " + -                                "       u.usename AS \"User name\", " + -                                "       u.usesysid AS \"User ID\", " + -                                "       CASE " + -                                "       WHEN u.usesuper AND u.usecreatedb THEN " + -                                "               CAST('superuser, create database' AS pg_catalog.text) " + -                        "       WHEN u.usesuper THEN " + -                                "               CAST('superuser' AS pg_catalog.text) " + -                                "       WHEN u.usecreatedb THEN " + -                                "               CAST('create database' AS pg_catalog.text) " + -                                "       ELSE " + -                                "               CAST('' AS pg_catalog.text) " + -                                "       END AS \"Attributes\" " + -                                "FROM pg_catalog.pg_user u " + -                                "ORDER BY 1"; + String qs = "SELECT " + + " u.usename AS \"User name\", " + + " u.usesysid AS \"User ID\", " + + " CASE " + + " WHEN u.usesuper AND u.usecreatedb THEN " + + " CAST('superuser, create database' AS pg_catalog.text) " + + " WHEN u.usesuper THEN " + + " CAST('superuser' AS pg_catalog.text) " + + " WHEN u.usecreatedb THEN " + + " CAST('create database' AS pg_catalog.text) " + + " ELSE " + + " CAST('' AS pg_catalog.text) " + + " END AS \"Attributes\" " + + "FROM pg_catalog.pg_user u " + + "ORDER BY 1"; -                        // Use the connection to create a statement, execute it, -                        // analyze the results and close the result set [5] + // Use the connection to create a statement, execute it, + // analyze the results and close the result set [5] -                        [Statement][25] stat = conn.createStatement(); -                        [ResultSet][26] rs = stat.executeQuery(qs); -                        [System][18].out.println("User name;User ID;Attributes"); -                        while (rs.next()) { -                                [System][18].out.println(rs.getString("User name") + ";" + -                                                rs.getLong("User ID") + ";" + -                                                rs.getString("Attributes")); -                        } -                        rs.close(); -                        stat.close(); -                -                } catch ([Exception][19] e2) { -                        [System][18].err.println("connecting failed"); -                        [System][18].err.println(e2); -                        [System][18].exit(1); -                } -                [System][18].out.println("connection closed"); + Statement stat = conn.createStatement(); + ResultSet rs = stat.executeQuery(qs); + System.out.println("User name;User ID;Attributes"); + while (rs.next()) { + System.out.println(rs.getString("User name") + ";" + + rs.getLong("User ID") + ";" + + rs.getString("Attributes")); + } + rs.close(); + stat.close(); + + } catch (Exception e2) { + System.err.println("connecting failed"); + System.err.println(e2); + System.exit(1); + } + System.out.println("connection closed"); -                // If we get here all is OK + // If we get here all is OK -                [System][18].out.println("done."); -        } + System.out.println("done."); + } } ``` -在上述代码中,一旦有了 **Connection** 实例,它就会定义一个查询字符串(上面的注释 [4]),创建一个 **Statement** 实例并用其来执行查询字符串,然后将其结果放入一个 **ResultSet** 实例。程序可以遍历该 **ResultSet** 实例来分析返回的结果,并以关闭 **ResultSet** 和 **Statement** 实例结束(上面的注释 [5])。 +在上述代码中,一旦有了 `Connection` 实例,它就会定义一个查询字符串(上面的注释 `[4]`),创建一个 `Statement` 实例并用其来执行查询字符串,然后将其结果放入一个 `ResultSet` 实例。程序可以遍历该 `ResultSet` 实例来分析返回的结果,并以关闭 `ResultSet` 和 `Statement` 实例结束(上面的注释 `[5]`)。 编译和执行程序会产生以下输出: @@ -263,7 +263,7 @@ me@mymachine:~/Test$ javac Test3.java me@mymachine:~/Test$ java -cp ~/src/postgresql-42.2.5.jar:. Test3 driver loaded connection created -User name;User ID;[Attributes][27] +User name;User ID;Attributes fwa;16395;superuser vax;197772; mbe;290995; @@ -273,7 +273,7 @@ done. me@mymachine:~/Test$ ``` -这是在一个简单的 Java 应用程序中使用 PostgreSQL JDBC 库的(非常简单的)示例。要注意的是,由于 **java.sql** 库的设计方式,它不需要在代码中使用像 **import org.postgresql.jdbc.*;** 这样的 Java 导入语句,而是使用 Java 类加载器在运行时引入 PostgreSQL 代码的方式,也正因此无需在代码编译时指定类路径。 +这是在一个简单的 Java 应用程序中使用 PostgreSQL JDBC 库的(非常简单的)示例。要注意的是,由于 `java.sql` 库的设计方式,它不需要在代码中使用像 `import org.postgresql.jdbc.*;` 这样的 Java 导入语句,而是使用 Java 类加载器在运行时引入 PostgreSQL 代码的方式,也正因此无需在代码编译时指定类路径。 -------------------------------------------------------------------------------- @@ -282,7 +282,7 @@ via: https://opensource.com/article/20/2/external-libraries-java 作者:[Chris Hermansen][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 252cb25549f3f558b97df2a128f51ea013e6e32b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Sep 2021 07:59:38 +0800 Subject: [PATCH 0324/1588] PUB @unigeorge https://linux.cn/article-13769-1.html --- .../20200211 Using external libraries in Java.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200211 Using external libraries in Java.md (99%) diff --git a/translated/tech/20200211 Using external libraries in Java.md b/published/20200211 Using external libraries in Java.md similarity index 99% rename from translated/tech/20200211 Using external libraries in Java.md rename to published/20200211 Using external libraries in Java.md index f739050739..c1f3652236 100644 --- a/translated/tech/20200211 Using external libraries in Java.md +++ b/published/20200211 Using external libraries in Java.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13769-1.html) [#]: subject: (Using external libraries in Java) [#]: via: (https://opensource.com/article/20/2/external-libraries-java) [#]: author: (Chris Hermansen https://opensource.com/users/clhermansen) From b1f2e49550f2d1d9f74120e551427eb71ceb8852 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 Sep 2021 08:47:20 +0800 Subject: [PATCH 0325/1588] translated --- ...How to Stop a Program in Linux Terminal.md | 97 ------------------- ...How to Stop a Program in Linux Terminal.md | 90 +++++++++++++++++ 2 files changed, 90 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20210907 How to Stop a Program in Linux Terminal.md create mode 100644 translated/tech/20210907 How to Stop a Program in Linux Terminal.md diff --git a/sources/tech/20210907 How to Stop a Program in Linux Terminal.md b/sources/tech/20210907 How to Stop a Program in Linux Terminal.md deleted file mode 100644 index 27b45a42b8..0000000000 --- a/sources/tech/20210907 How to Stop a Program in Linux Terminal.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: "How to Stop a Program in Linux Terminal" -[#]: via: "https://itsfoss.com/stop-program-linux-terminal/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Stop a Program in Linux Terminal -====== - -It’s amusing how the simplest of the things could be complicated when you are new to something. - -The other day, I found my friend could not figure out how to exit the top command. Instead of stopping the command, he closed the entire terminal application. - -That’s not only unnecessary, it is a not good thing to do. - -### Stopping programs in Linux - -In Linux, you can use the Ctrl+C keys to stop a running program in the terminal. This works for Ubuntu as well as any other Linux distribution. - -Take the ping command for example. If you do not stop it, it will keep on displaying the result. - -Hold the Ctrl button and press the C key at the same time. It sends the [SIGKILL signal][1] to the running program to force quit the command. - -![Stopping a program in the Linux terminal][2] - -Do you see the ^C? The caret (^) means Ctrl. So basically, the terminal shows the Ctrl+C keystrokes as ^C. - -The Ctrl+C works very well for the commands that are designed to keep on running until interrupted. You feel like you have to cancel the command, use Ctrl+C. - -In a more complicated method, you can [find the process ID and kill a running process][3]. That’s more advanced stuff and used only when the process is running in the background or by another user or in another terminal window. - -Apart from that, there are some other commands and command line tools that have their own exit commands. Let me briefly mention some of them here. - -#### How to exit Vim editor - -[Existing Vim editor][4] has made so many jokes in the Linux world. It is difficult to figure out when you are new to this powerful command line based text editor. Among several ways of quitting vim, the most common is to press the Esc key and then type a colon (:) and then type `q!` for force quit without save or `wq` for save and quit. - -![][5] - -#### How to exit Nano editor - -Quitting the [Nano editor][6] is a bit simpler than exiting Vim. Why? Because Nano mentions the shortcut at the bottom. You may not understand it if you are new to it but at least you’ll be able to figure it out the next time. - -To exit Nano, press Ctrl+X. It will ask if you want to save the changes made to the file or not. You can enter your choice. - -![][7] - -#### How to exit less command - -The less is a wonderful command that lets you view without cluttering your terminal screen like the cat command. If you are inside the less command view, use the key `q` to exit less. - -#### How to exit the terminal - -To exit the terminal itself, instead of closing the terminal, either use Ctrl+D keyboard shortcut or type the exit command: - -``` -exit -``` - -This actually exists you from the current shell. When you [open a terminal in Ubuntu][8] or any other Linux distribution, it runs the default shell. When you exit from this shell, terminal ends as well. Ctrl+D is the shortcut to do the same and quit the terminal. - -I hope you find this quick tutorial helpful. I highly recommend learning these [Linux command tips][9]. - -**Recommended Read:** - -![][10] - -#### [21 Super Handy Linux Command Tips and Tricks That Will Save you a lot of Time and Increase Your Productivity][9] - -Questions or suggestions? Please leave a comment below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/stop-program-linux-terminal/ - -作者:[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://linuxhandbook.com/sigterm-vs-sigkill/#what-is-sigkill -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/stop-a-program-linux-terminal.png?resize=800%2C373&ssl=1 -[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ -[4]: https://itsfoss.com/how-to-exit-vim/ -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/05/how-to-exit-vim.png?resize=737%2C422&ssl=1 -[6]: https://itsfoss.com/nano-editor-guide/ -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-save-and-exit.png?resize=799%2C503&ssl=1 -[8]: https://itsfoss.com/open-terminal-ubuntu/ -[9]: https://itsfoss.com/linux-command-tricks/ -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/07/linux-command-tips.png?fit=800%2C450&ssl=1 diff --git a/translated/tech/20210907 How to Stop a Program in Linux Terminal.md b/translated/tech/20210907 How to Stop a Program in Linux Terminal.md new file mode 100644 index 0000000000..58ac4347f5 --- /dev/null +++ b/translated/tech/20210907 How to Stop a Program in Linux Terminal.md @@ -0,0 +1,90 @@ +[#]: subject: "How to Stop a Program in Linux Terminal" +[#]: via: "https://itsfoss.com/stop-program-linux-terminal/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Linux 终端中停止一个程序 +====== + +有趣的是,当你刚接触一些东西时,最简单的事情也会变得复杂。 + +有一天,我发现我的朋友搞不清楚如何退出 top 命令。他没有停止这个命令,而是关闭了整个终端程序。 + +这不仅是不必要的,而且是一件不好的事情。 + +### 在 Linux 中停止程序 + +在 Linux 中,你可以使用 Ctrl+C 键来停止终端中的运行程序。这对 Ubuntu 和其他 Linux 发行版都适用。 + +以 ping 命令为例。如果你不停止它,它将持续显示结果。 + +按住 Ctrl 键并同时按下 C 键。它向正在运行的程序发送 [SIGKILL 信号][1]以强制退出该命令。 + +![Stopping a program in the Linux terminal][2] + +你看到 ^C 了吗?这个插入符号(^)代表 Ctrl。所以基本上,终端将 Ctrl+C 的按键显示为 ^C。 + +Ctrl+C 对于那些被设计为持续运行直到被打断的命令非常有效。你觉得你需要取消命令,就用 Ctrl+C。 + +在一个更复杂的方法中,你可以[找到进程 ID 并杀死一个正在运行的进程][3]。这是更高级的东西,只有进程在后台或由其他用户运行或在另一个终端窗口运行时使用。 + +除此以外,还有一些其他的命令和命令行工具也有自己的退出命令。让我在这里简单地提一下其中的一些。 + +#### 如何退出 Vim 编辑器 + +[退出 Vim 编辑器][4]在 Linux 世界里闹出了很多笑话。当你刚接触这个强大的基于命令行的文本编辑器时,是很难搞清楚的。在几种退出 vim 的方法中,最常见的是按 Esc 键,然后输入冒号(:),再输入 `q!` 表示不保存而强制退出,或者 `wq` 表示保存并退出。 + +![][5] + +#### 如何退出 Nano 编辑器 + +退出 [Nano 编辑器][6]比退出 Vim 要简单一些。为什么?因为 Nano 在底部有快捷方式。如果你是新手,你可能不明白,但至少你下次就能搞清楚了。 + +要退出 Nano,按 Ctrl+X。它将询问你是否要保存对文件所做的修改。你可以输入你的选择。 + +![][7] + +#### 如何退出 less 命令 + +less 是一个奇妙的命令,它可以让你在不像 cat 命令那样杂乱的终端屏幕上进行查看。如果你在 less 命令的视图内,使用 `q` 键来退出 less。 + +#### 如何退出终端 + +要退出终端本身,不是关闭终端,而是使用 Ctrl+D 键盘快捷键或输入退出命令: + +``` +exit +``` + +这实际上是让你从当前的 shell 中退出。当你[在 Ubuntu 或其他发行版中打开一个终端][8],它会运行默认的 shell。当你从这个 shell 退出时,终端也会结束。Ctrl+D 是做同样事情的快捷方式,并退出终端。 + +我希望你觉得这个快速教程对你有帮助。我强烈建议你学习这些 [Linux 命令技巧][9]。 + +有问题或建议?请在下面留下评论。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/stop-program-linux-terminal/ + +作者:[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://linuxhandbook.com/sigterm-vs-sigkill/#what-is-sigkill +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/stop-a-program-linux-terminal.png?resize=800%2C373&ssl=1 +[3]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ +[4]: https://itsfoss.com/how-to-exit-vim/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/05/how-to-exit-vim.png?resize=737%2C422&ssl=1 +[6]: https://itsfoss.com/nano-editor-guide/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/05/nano-editor-save-and-exit.png?resize=799%2C503&ssl=1 +[8]: https://itsfoss.com/open-terminal-ubuntu/ +[9]: https://itsfoss.com/linux-command-tricks/ \ No newline at end of file From 8101c5b63835b46ec524e01e68d3964a2925efab Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 10 Sep 2021 08:49:38 +0800 Subject: [PATCH 0326/1588] translating --- sources/tech/20210908 How to Run Java Programs in Ubuntu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210908 How to Run Java Programs in Ubuntu.md b/sources/tech/20210908 How to Run Java Programs in Ubuntu.md index 89cbe6916e..afceaf480e 100644 --- a/sources/tech/20210908 How to Run Java Programs in Ubuntu.md +++ b/sources/tech/20210908 How to Run Java Programs in Ubuntu.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/run-java-program-ubuntu/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 73af52b69242d4439f7ae632dcda7dbdad15b1cc Mon Sep 17 00:00:00 2001 From: SamMa Date: Fri, 10 Sep 2021 09:23:35 +0800 Subject: [PATCH 0327/1588] Update 20210901 What are container runtimes.md --- .../20210901 What are container runtimes.md | 38 +++++++++---------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/translated/tech/20210901 What are container runtimes.md b/translated/tech/20210901 What are container runtimes.md index be42d2f766..9118053dda 100644 --- a/translated/tech/20210901 What are container runtimes.md +++ b/translated/tech/20210901 What are container runtimes.md @@ -3,41 +3,41 @@ [#]: author: "Nived V https://opensource.com/users/nivedv" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " 什么是容器运行时? ====== -深入了解容器运行时,你就可以理解容器环境是如何建立的。 +通过深入了解容器运行时,理解容器环境是如何建立的。 ![Ships at sea on the web][1] -在对[容器镜像][2]的检查中,我讨论了容器的基本原理,但现在是时候深入研究容器运行时了,这样你就可以了解容器环境是如何构建的。本文的部分信息摘自 Open Container Initiative (OCI)(容器的开放标准)的[官方文档][3],所以无论你的容器引擎如何,这些信息都是相关的。 +在检查[容器镜像][2]时,我讨论了容器的基本原理,但现在是深入研究容器运行时的时候了,从而了解容器环境是如何构建的。本文的部分信息摘自 Open Container Initiative (OCI)(容器的开放标准)的[官方文档][3],所以无论使用何种容器引擎,这些信息都是贯通的。 ### 容器运行机制 -那么,当你运行 `podman run` 或 `docker run` 命令时,在后台到底发生了什么?这里为你提供一个逐步的概述: +那么,当你运行 `podman run` 或 `docker run` 命令时,在后台到底发生了什么?一个分步的概述如下: - 1. 如果本地没有镜像,则从镜像注册处拉取镜像 - 2. 镜像被提取到一个写时拷贝的文件系统上,所有的容器层相互叠加以创建一个合并的文件系统 - 3. 准备一个容器挂载点 + 1. 如果本地没有镜像,则从镜像仓库拉取镜像 + 2. 镜像被提取到一个写时拷贝的文件系统上,所有的容器层相互叠加以形成一个合并的文件系统 + 3. 为容器准备一个挂载点 4. 从容器镜像中设置元数据,包括诸如覆盖 CMD、来自用户输入的 ENTRYPOINT、设置 SECCOMP 规则等设置,以确保容器按预期运行 5. 提醒内核为该容器分配某种隔离,如进程、网络和文件系统(命名空间) - 6. 内核还被提醒为这个容器分配一些资源限制,如 CPU 或内存限制(cgroups) - 7. 一个系统调用(syscall)被传递给内核以启动容器 + 6. 提醒内核为改容器分配一些资源限制,如 CPU 或内存限制(cgroups) + 7. 传递一个系统调用(syscall)给内核用于启动容器 8. 设置 SELinux/AppArmor -容器运行时负责上述所有的工作。当我们想到容器运行时,想到的可能是 runc、lxc、containerd、rkt、cri-o 等等。嗯,你没有错。这些都是容器引擎和容器运行时,每一种都是为不同的情况建立的。 +容器运行时负责上述所有的工作。当我们提及容器运行时,想到的可能是 runc、lxc、containerd、rkt、cri-o 等等。嗯,你没有错。这些都是容器引擎和容器运行时,每一种都是为不同的情况建立的。 _容器运行时_更侧重于运行容器,为容器设置命名空间和 cgroups,也被称为底层容器运行时。高层的容器运行时或容器引擎专注于格式、解包、管理和镜像共享。它们还为开发者提供 API。 ### Open Container Initiative (OCI) -Open Container Initiative(OCI)是一个 Linux 基金会项目。其目的是设计某些开放标准或围绕如何与容器运行时和容器镜像格式工作的结构。它是由 Docker、rkt、CoreOS 和其他行业领导者于 2015 年 6 月建立的。 +Open Container Initiative(OCI)是一个 Linux 项目基金会。其目的是设计某些开放标准或围绕如何与容器运行时和容器镜像格式工作的结构。它是由 Docker、rkt、CoreOS 和其他行业领导者于 2015 年 6 月建立的。 -它使用两个规范来做这件事: +它通过两个规范来完成如下任务: #### 1\. 镜像规范(image-spec) @@ -47,9 +47,9 @@ Open Container Initiative(OCI)是一个 Linux 基金会项目。其目的是 * [Image Manifest][4] — 一个描述构成容器镜像的元素的文件 * [Image Index][5] — 镜像清单的注释索引 - * [Image Layout][6] — 一个代表镜像内容的文件系统布局 + * [Image Layout][6] — 一个镜像内容的文件系统布局 * [Filesystem Layer][7] — 一个描述容器文件系统的变化集 - * [Image Configuration][8] — 确定镜像层排序和配置的文件,适合转换成[运行时包][9]。 + * [Image Configuration][8] — 确定镜像层顺序和配置的文件,适合转换成[运行时包][9]。 * [Conversion][10] — 解释应该如何进行转换的文件 * [Descriptor][11] — 一个描述被引用内容的类型、元数据和内容地址的参考资料 @@ -57,13 +57,13 @@ Open Container Initiative(OCI)是一个 Linux 基金会项目。其目的是 #### 2\. 运行时规范(runtime-spec) -该规范旨在定义容器的配置、执行环境和生命周期。config.json 文件为所有支持的平台提供了容器配置,并详细说明了能够创建容器的地方。执行环境与为容器的生命周期定义的通用操作一起被详细说明,以确保在容器内运行的应用在不同的运行时之间有一个一致的环境。 +该规范用于定义容器的配置、执行环境和生命周期。config.json 文件为所有支持的平台提供了容器配置,并详细说明了能够创建容器的地方。执行环境与为容器的生命周期定义的通用操作一起被详细说明,以确保在容器内运行的应用在不同的运行时之间有一个一致的环境。 -Linux 容器规范使用了各种内核功能,包括命名空间、cgroups、capabilities、LSM 和文件系统监牢来实现该规范。 +Linux 容器规范各种内核功能的使用,包括命名空间、cgroups、capabilities、LSM 和文件系统隔离来实现该规范。 -### 现在你知道了 +### 小结 -容器运行时是由 OCI 规范管理的,以提供一致性和互操作性。许多人在使用容器时不需要了解它们是如何工作的,但当你需要排除故障或优化使用方法时,了解容器是一个宝贵的优势。 +容器运行时是通过 OCI 规范管理的,以提供一致性和互操作性。许多人在使用容器时不需要了解它们是如何工作的,但当你需要排除故障或优化时,了解容器是一个宝贵的优势。 * * * @@ -76,7 +76,7 @@ via: https://opensource.com/article/21/9/container-runtimes 作者:[Nived V][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 ce6df47bbbb1ac43043d08a79bf2f0c85093e9d3 Mon Sep 17 00:00:00 2001 From: runningwater Date: Fri, 10 Sep 2021 09:45:35 +0800 Subject: [PATCH 0328/1588] =?UTF-8?q?[=E7=BF=BB=E8=AF=91=E7=94=B3=E9=A2=86?= =?UTF-8?q?]How=20to=20examine=20processes=20running=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20200515 How to examine processes running on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200515 How to examine processes running on Linux.md b/sources/tech/20200515 How to examine processes running on Linux.md index 0659ab04f9..92e75e679b 100644 --- a/sources/tech/20200515 How to examine processes running on Linux.md +++ b/sources/tech/20200515 How to examine processes running on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (runningwater) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -221,7 +221,7 @@ via: https://www.networkworld.com/article/3543232/how-to-examine-processes-runni 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[runningwater](https://github.com/runningwater) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 603edb0a583e06103ccd1937489e9562918f9529 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Sep 2021 11:32:19 +0800 Subject: [PATCH 0329/1588] PUB @geekpi @turbokernel https://linux.cn/article-13771-1.html --- ...s for daily needs part 4- audio editors.md | 24 ++++++------------- 1 file changed, 7 insertions(+), 17 deletions(-) rename {translated/tech => published}/20210823 Apps for daily needs part 4- audio editors.md (63%) diff --git a/translated/tech/20210823 Apps for daily needs part 4- audio editors.md b/published/20210823 Apps for daily needs part 4- audio editors.md similarity index 63% rename from translated/tech/20210823 Apps for daily needs part 4- audio editors.md rename to published/20210823 Apps for daily needs part 4- audio editors.md index c3a32c892a..782b51296d 100644 --- a/translated/tech/20210823 Apps for daily needs part 4- audio editors.md +++ b/published/20210823 Apps for daily needs part 4- audio editors.md @@ -4,21 +4,19 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13771-1.html" -日常需求应用之四:音频编辑器 +满足日常需求的应用(四):音频编辑器 ====== ![][1] -图片由 [Brooke Cagle][2] 在 [Unsplash][3] 上发布。 - -在过去,音频编辑应用或数字音频工作站(DAW)只提供给专业人士使用,如唱片制作人、音响工程师和音乐家。但现在很多不是专业人士的人也需要它们。这些工具被用于演示文稿解说、视频博客,甚至只是作为一种爱好。现在尤其如此,因为有这么多的在线平台,方便大家分享音频作品,如音乐、歌曲、播客等。本文将介绍一些你可以在 Fedora Linux 上使用的开源音频编辑器或 DAW。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。这里列出了音频编辑器或 DAW 类的一些日常需求的应用。 +在过去,音频编辑应用或数字音频工作站digital audio workstation(DAW)只提供给专业人士使用,如唱片制作人、音响工程师和音乐家。但现在很多不是专业人士的人也需要它们。这些工具被用于演示文稿解说、视频博客,甚至只是作为一种爱好。现在尤其如此,因为有这么多的在线平台,方便大家分享音频作品,如音乐、歌曲、播客等。本文将介绍一些你可以在 Fedora Linux 上使用的开源音频编辑器或 DAW。你可能需要安装提到的软件。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章[安装 Fedora 34 工作站后要做的事情][4]。这里列出了音频编辑器或 DAW 类的一些日常需求的应用。 ### Audacity -我相信很多人已经知道 Audacity 了。它是一个流行的多轨音频编辑器和录音机,可用于对所有类型的音频进行后期处理。大多数人使用 Audacity 来记录他们的声音,然后进行编辑,使其结果更好。其结果可以作为播客或视频博客的解说词。此外,人们还用 Audacity 来创作音乐和歌曲。你可以通过麦克风或调音台录制现场音频。它还支持 32 位的声音质量。 +我相信很多人已经知道 Audacity 了。它是一个流行的多轨音频编辑器和录音机,可用于对所有类型的音频进行后期处理。大多数人使用 Audacity 来记录他们的声音,然后进行编辑,使其成品更好。其成品可以作为播客或视频博客的解说词。此外,人们还用 Audacity 来创作音乐和歌曲。你可以通过麦克风或调音台录制现场音频。它还支持 32 位的声音质量。 Audacity 有很多功能,可以支持你的音频作品。它有对插件的支持,你甚至可以自己编写插件。Audacity 提供了许多内置效果,如降噪、放大、压缩、混响、回声、限制器等。你可以利用实时预览功能在直接聆听音频的同时尝试这些效果。内置的插件管理器可以让你管理经常使用的插件和效果。 @@ -26,18 +24,14 @@ Audacity 有很多功能,可以支持你的音频作品。它有对插件的 详情请参考此链接: -* * * - ### LMMS -LMMS 或 Linux MultiMedia Studio 是一个全面的音乐创作应用。你可以从头使用 LMMS 用你的电脑开始制作你的音乐。你可以根据自己的创意创造旋律和节拍,并通过选择声音乐器和各种效果使其更加完美。有几个与乐器和效果有关的内置功能,如 16 个内置合成器、嵌入式 ZynAddSubFx、支持插入式 VST 效果插件、捆绑图形和参数均衡器、内置分析器等等。LMMS 还支持 MIDI 键盘和其他音频外围设备。 +LMMS(即 Linux 多媒体工作室Linux MultiMedia Studio)是一个全面的音乐创作应用。你可以从头使用 LMMS 用你的电脑开始制作你的音乐。你可以根据自己的创意创造旋律和节拍,并通过选择声音乐器和各种效果使其更加完美。有几个与乐器和效果有关的内置功能,如 16 个内置合成器、嵌入式 ZynAddSubFx、支持插入式 VST 效果插件、捆绑图形和参数均衡器、内置分析器等等。LMMS 还支持 MIDI 键盘和其他音频外围设备。 ![][6] 详情请参考此链接: -* * * - ### Ardour Ardour 作为一个全面的音乐创作应用,其功能与 LMMS 相似。它在其网站上说,Ardour 是一个 DAW 应用,是来自世界各地的音乐家、程序员和专业录音工程师合作的结果。Ardour 拥有音频工程师、音乐家、配乐编辑和作曲家需要的各种功能。 @@ -48,8 +42,6 @@ Ardour 提供了完整的录音、编辑、混音和输出功能。它有无限 详情请参考此链接: -* * * - ### TuxGuitar TuxGuitar 是一款指法谱和乐谱编辑器。它配备了指法编辑器、乐谱查看器、多轨显示、拍号管理和速度管理。它包括弯曲、滑动、颤音等各种效果。虽然 TuxGuitar 专注于吉他,但它也可以为其他乐器写乐谱。它也能够作为一个基本的 MIDI 编辑器。你需要对指法谱和乐谱有一定的了解才能使用它。 @@ -58,11 +50,9 @@ TuxGuitar 是一款指法谱和乐谱编辑器。它配备了指法编辑器、 详情请参考此链接: -* * * - ### 总结 -本文章介绍了四款音频编辑器,满足您在 Fedora Linux 上日常使用的需求。其实,在 Fedora Linux 上还有很多音频编辑器或者 DAW 供您选择。您也可以使用 Mixxx、Rosegarden、Kwave、Qtractor、MuseScore、musE 等等。希望本文为您调查和选择合适的音频编辑器或者 DAW 提供帮助。如您有使用这些应用的经验,请在评论中分享您的经验。 +本文章介绍了四款音频编辑器,可以满足你在 Fedora Linux 上日常使用的需求。其实,在 Fedora Linux 上还有很多音频编辑器或者 DAW 供你选择。你也可以使用 Mixxx、Rosegarden、Kwave、Qtractor、MuseScore、musE 等等。希望本文为你调查和选择合适的音频编辑器或者 DAW 提供帮助。如你有使用这些应用的经验,请在评论中分享你的经验。 -------------------------------------------------------------------------------- From ea8d1c8d2d1929e2293b164cdc69382929e5df19 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 10 Sep 2021 14:56:26 +0800 Subject: [PATCH 0330/1588] =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=BF=87=E6=9C=9F?= =?UTF-8?q?=E6=96=87=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @imgradeone --- ...data with an Improved UI - Qt 6 Support.md | 94 ----------- ...n Thinks GIMP Needs a Major UI Overhaul.md | 88 ---------- ... Now Use KDE Connect in Windows as Well.md | 91 ----------- ...Released Zorin OS 16 Linux Distribution.md | 126 -------------- ...wnload This New Linux Release Right Now.md | 144 ---------------- ...s on Visual Changes and Package Updates.md | 96 ----------- ...pen-Source Alternative to Nvidia-s DLSS.md | 123 -------------- ...n Debian 11 and Includes a Built-in VPN.md | 93 ----------- ...l to Showcase Best Linux Apps for GNOME.md | 81 --------- ...ed With AI Effects - Major Improvements.md | 122 -------------- ...ght After the 30th Anniversary of Linux.md | 154 ------------------ ...n-Source Krita Painting App Promo Video.md | 76 --------- ...You Want Model With Version 5.6 Release.md | 77 --------- ...FX Support With the New RetroArch 1.9.9.md | 96 ----------- ...OS 6 ODIN Released. This is What-s New..md | 101 ------------ ...o- Released Based on Debian 11 Bullseye.md | 118 -------------- sources/tech/20210824 .md | 25 --- 17 files changed, 1705 deletions(-) delete mode 100644 sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md delete mode 100644 sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md delete mode 100644 sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md delete mode 100644 sources/news/20210818 Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution.md delete mode 100644 sources/news/20210818 Zorin OS 16 is a Visual Spectacle- You Can Download This New Linux Release Right Now.md delete mode 100644 sources/news/20210819 KaOS 2021.08 Release Focuses on Visual Changes and Package Updates.md delete mode 100644 sources/news/20210820 Intel-s XeSS Could be the Open-Source Alternative to Nvidia-s DLSS.md delete mode 100644 sources/news/20210820 SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN.md delete mode 100644 sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md delete mode 100644 sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md delete mode 100644 sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md delete mode 100644 sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md delete mode 100644 sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md delete mode 100644 sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md delete mode 100644 sources/tech/20210810 elementary OS 6 ODIN Released. This is What-s New..md delete mode 100644 sources/tech/20210821 SparkyLinux 6.0 -Po-Tolo- Released Based on Debian 11 Bullseye.md delete mode 100644 sources/tech/20210824 .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 deleted file mode 100644 index 4898095a65..0000000000 --- a/sources/news/20210615 PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI - Qt 6 Support.md +++ /dev/null @@ -1,94 +0,0 @@ -[#]: subject: (PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI & Qt 6 Support) -[#]: via: (https://news.itsfoss.com/pdf-mix-tool-1-0-1-release/) -[#]: author: (Omar Maarof https://news.itsfoss.com/author/omar/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -PDF Mix Tool 1.0.1 Now Lets You Edit Metadata with an Improved UI & Qt 6 Support -====== - -[PDF Mix Tool][1] is one of the [best PDF editors for Linux][2] and an alternative to [PDF Arranger][3]. -It is a neat and simple GUI tool for manipulating pdf files and allows you to modify your files (rotating, splitting, extracting from files), not their content, however. - -Although this application does not come with a lot of tools, it provides a concise toolset so you can manipulate your documents. - -After a year of no new releases, the developer is back with another release (1.0.1) with some significant improvements. - -Let us discover what features this release has to offer. - -### Improved User Interface (UI) - -There is now a left sidebar containing icons for all the operations you might need to perform. Each one of the icons has a respective function and its name below it. - -![][4] - -This is not a big makeover but helps enhancing the user experience, which should be the focus for a useful tool like PDF Mix Tool. - -### PDF Metadata Editing - -![][5] - -You can now modify your document’s title, author, subject, keywords, creator, producer, and creation and modification dates. Thus, you can edit your document’s metadata easily. - -### Support for Qt 6.0 - -PDF Mix Tool is written in C++, and it relies on **qpdf** and the **Qt** library to make its magic work. It supports [Qt 6.0][6] now, which will affect the UX positively. - -### Other Improvements - - * PDF Mix Tool now adds right-to-left support in page composition. - * Links, annotations, and outlines are preserved as much as possible in all operations. - * This version fixed some bugs. - - - -You can check out the [official changelog][7] in their GitLab page. - -### Summing Up - -Despite its reputation for being a lightweight, PDF Mix Tool is a handy application that delivers essential capabilities to the user. - -You can get it from [Flathub][8] or [Snap store][9]. For Arch Linux users, you may not find the latest release in the repositories or the [AUR][10]. In either case, you can build it from source that can be found on [GitLab][11]. - -You may want to go through our [Flatpak guide][12] or the tutorial for [using Snaps in Linux][13] to get help with installation. - -[Download PDFMixTool][14] - -_What do you think about this release? I’m also curious to know what PDF editor do you happen to use?_ - -#### 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/pdf-mix-tool-1-0-1-release/ - -作者:[Omar Maarof][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/omar/ -[b]: https://github.com/lujun9972 -[1]: https://scarpetta.eu/pdfmixtool/ -[2]: https://itsfoss.com/pdf-editors-linux/ -[3]: https://news.itsfoss.com/pdf-arranger-1-7-release/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU3MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://news.itsfoss.com/qt-6-released/ -[7]: https://gitlab.com/scarpetta/pdfmixtool/-/blob/master/CHANGELOG.md -[8]: https://flathub.org/apps/details/eu.scarpetta.PDFMixTool -[9]: https://snapcraft.io/pdfmixtool -[10]: https://itsfoss.com/aur-arch-linux/ -[11]: https://gitlab.com/scarpetta/pdfmixtool -[12]: https://itsfoss.com/flatpak-guide/ -[13]: https://itsfoss.com/use-snap-packages-ubuntu-16-04/ -[14]: https://scarpetta.eu/pdfmixtool/#download diff --git a/sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md b/sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md deleted file mode 100644 index 2f3eaf1c2a..0000000000 --- a/sources/news/20210719 Edward Snowden Thinks GIMP Needs a Major UI Overhaul.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: subject: (Edward Snowden Thinks GIMP Needs a Major UI Overhaul) -[#]: via: (https://news.itsfoss.com/gimp-ui-edward-snowden/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Edward Snowden Thinks GIMP Needs a Major UI Overhaul -====== - -Edward Snowden’s recent tweet praised what free and open-source software can achieve. - -In the tweet, he highlights that every time he uses Blender (an open-source 3D software suite), it reminds him of the advantages of FOSS and the growth of the ecosystem. - -He did not just limit to that, in a follow-up reply to the same thread, he also tagged **GIMP** and added, “**I’m really hoping for a major UI overhaul. You guys could be eating Adobe’s lunch.**“ - -> P.S. [@GIMP_Official][1], I'm really hoping for a major UI overhaul. You guys could be eating Adobe's lunch. -> -> — Edward Snowden (@Snowden) [July 18, 2021][2] - -### Does GIMP Require a Major UI Overhaul? - -![][3] - -[GIMP][4] is one of the most effective free and open-source image manipulation tools available. - -It is actively used by professionals and all kinds of individuals to get a variety of things done. - -You can even [make a GIF in GIMP][5]. Hence, it is tailored for simple and advanced tasks. - -While it offers a learning curve to get used to its UI, it is good enough functionality-wise. - -Does it require a UI overhaul? - -Yes, as per the trends, all kinds of designing/editing tools are working to improve the user-friendliness factor, GIMP may have missed out on this front. - -Of course, a sudden UI change may affect the workflow for a lot of veteran users. But, it does require a UI overhaul to beat its competitors like Adobe’s tools. - -Also, with an easy-to-use interface, it will attract more users, potentially helping it grow and monetize the project even further. - -And, it is also clear that Snowden thinks the same way, which is why he is hoping for a major UI overhaul while expecting GIMP to challenge Adobe tools in a big way. - -### Why is GIMP Not Working on a Major User Experience Overhaul Yet? - -Unfortunately, GIMP does not have regular UX contributors or developers to work on a major overhaul. - -They mentioned it as a reply to one of the tweets in Snowden’s tweet thread: - -> “We worked with a UX architect between 2005 and 2012. Good things came out of it. We make small UX improvements in almost every update now that point releases (e.g. 2.10.24) are allowed to have new stuff. But we don’t have a regular UX contributor or devs for a huge overhaul” - -Well, this is definitely a sad thing for such a popular project that gets immense love from thousands of users. - -And, I hope, after Snowden’s tweet, the GIMP project gets more traction and we see regular contributors to help evolve GIMP with the love it deserves. - -If you want to help, you can explore [GIMP’s contribution page][6] to learn more about helping the project. - -_Feel free to let me know your thoughts on GIMP and if you find it useful. Do you think that it needs a major UI overhaul, comments section is all yours!_ - -**Image Credits (Snowden’s image)**: [TheGuardian][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/gimp-ui-edward-snowden/ - -作者:[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://twitter.com/GIMP_Official?ref_src=twsrc%5Etfw -[2]: https://twitter.com/Snowden/status/1416778909358731266?ref_src=twsrc%5Etfw -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://www.gimp.org -[5]: https://itsfoss.com/make-gif-in-gimp/ -[6]: https://www.gimp.org/develop/ -[7]: https://www.theguardian.com/books/2019/aug/01/edward-snowden-memoir-to-reveal-whistleblowers-secrets-permanent-record diff --git a/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md b/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md deleted file mode 100644 index 12967b2eef..0000000000 --- a/sources/news/20210720 You Can Now Use KDE Connect in Windows as Well.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: subject: (You Can Now Use KDE Connect in Windows as Well) -[#]: via: (https://news.itsfoss.com/kde-connect-windows/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (imgradeone) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -You Can Now Use KDE Connect in Windows as Well -====== - -KDE Connect is a popular open-source tool that lets you share a connection between a phone and your computer. - -While it was always limited to the Linux platform, it looks like that it is coming to Windows after all. - -And, cross-platform availability of software is always a good thing. - -### What is KDE Connect? - -In case you are coming across it for the first time—KDE connect lets you share files, links, sync notifications, gives you the ability to reply to messages, and more. - -You can also choose to control your desktop and perform some custom commands remotely. And, you can also use your phone to control the volume/skip the music playing on your computer. - -### KDE Connect Available as Beta in Microsoft Store - -![][1] - -As per a Reddit thread posted a few weeks back, a KDE contributor mentions that the beta version is available from the [Microsoft Store][2]. - -However, it is only accessible through the private link and cannot be found when you search for it in the Microsoft Store. - -This also marks official support for Windows. - -![][3] - -### KDE Connect for Windows: Here’s How it Looks - -![][4] - -You just need to make sure that both of your devices are connected to the same network. - -Next, all you have to do is pair them and then start sharing files/links, browse your phone, and also get notifications. - -You can choose to tweak some of the options that include storage paths for shared images or change the sound to play when you try to ring the device. - -![][5] - -As you can notice here, you have a variety of options to make use of. - -I tried connecting my Android device for a while, and it worked just fine. You may want to explore more to learn what else you can do with it. - -### Why is it Good News for Windows Users? - -Undoubtedly Windows users already had plenty of options to achieve the same functions without KDE Connect. But with KDE connect onboard, it will finally provide the opportunity to use an open-source and privacy-friendly tool that they can pair their devices with. - -After all, you would not want your notifications, and links/files that you share to be spied upon by a shoddy third-party application. - -In that case, KDE Connect is your friend. - -Even though it is in beta right now. You can try it out by visiting the link and installing it from the Microsoft store. - -[KDE Connect on Microsoft Store][2] - -**Via**: [Omg!Ubuntu!][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 - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/kde-connect-windows/ - -作者:[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,PHN2ZyBoZWlnaHQ9IjIyOCIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://www.microsoft.com/en-gb/p/kde-connect/9n93mrmsxbf0?&activetab=pivot:overviewtab -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI4NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2MyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://www.omgubuntu.co.uk/2021/07/kde-connect-windows-app 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 deleted file mode 100644 index c5d5dade29..0000000000 --- a/sources/news/20210818 Top 9 Features in the Newly Released Zorin OS 16 Linux Distribution.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: 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= 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 deleted file mode 100644 index 327bd1e4ae..0000000000 --- a/sources/news/20210818 Zorin OS 16 is a Visual Spectacle- You Can Download This New Linux Release Right Now.md +++ /dev/null @@ -1,144 +0,0 @@ -[#]: 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/ 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 deleted file mode 100644 index 2a83d1dec4..0000000000 --- a/sources/news/20210819 KaOS 2021.08 Release Focuses on Visual Changes and Package Updates.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: 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/ 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 deleted file mode 100644 index 748552f214..0000000000 --- a/sources/news/20210820 Intel-s XeSS Could be the Open-Source Alternative to Nvidia-s DLSS.md +++ /dev/null @@ -1,123 +0,0 @@ -[#]: 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 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 deleted file mode 100644 index a1b233c1af..0000000000 --- a/sources/news/20210820 SparkyLinux 6.0 Release is based on Debian 11 and Includes a Built-in VPN.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: 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/ 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 deleted file mode 100644 index 6e24a612a3..0000000000 --- a/sources/news/20210826 -Apps for GNOME- is a New Web Portal to Showcase Best Linux Apps for GNOME.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: 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 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 deleted file mode 100644 index a69fcdee8f..0000000000 --- a/sources/news/20210826 Open Source Video Editor OpenShot 2.6 Released With AI Effects - Major Improvements.md +++ /dev/null @@ -1,122 +0,0 @@ -[#]: 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/ 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 deleted file mode 100644 index 5f9ffc4f7a..0000000000 --- a/sources/news/20210830 Linux Kernel 5.14 Released Right After the 30th Anniversary of Linux.md +++ /dev/null @@ -1,154 +0,0 @@ -[#]: 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/ 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 deleted file mode 100644 index 80108b8fde..0000000000 --- a/sources/news/20210831 Ransomware Disguised as Open-Source Krita Painting App Promo Video.md +++ /dev/null @@ -1,76 +0,0 @@ -[#]: 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 diff --git a/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md b/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md deleted file mode 100644 index e0e534f26f..0000000000 --- a/sources/news/20210902 Linux Lite Moves to Pay What You Want Model With Version 5.6 Release.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: subject: "Linux Lite Moves to Pay What You Want Model With Version 5.6 Release" -[#]: via: "https://news.itsfoss.com/linux-lite-5-6-release/" -[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linux Lite Moves to Pay What You Want Model With Version 5.6 Release -====== - -[Linux Lite][1] has just announced Linux lite 5.6, the fourth installment in their 5.x series of releases. This release brings some major changes, especially in the download process. Other, more subtle tweaks are also shown throughout the OS. - -Here, we will be looking at what is new, what has changed, and how these changes may affect the future of Linux Lite. - -### What Has Changed in Linux Lite 5.6? - -![][2] - -Alongside the new download model, there a few key changes. These include: - - * New features in the Lite Tweaks app - * Updated icon theme - * New wallpapers - - - -While this list is relatively short, there are a couple of meaningful changes. - -### Pay Want You Want Download Model - -Definitely the most impactful change, Linux Lite has moved to a “Pay what you want” download model. For those not familiar with the term, it is a system where the user is encouraged to pay to obtain a download link. Users can still enter $0 to get the download link for free, but it is not immediately clear and does not support the distro. - -This move follows the footsteps of other popular distros, including ElementryOS. While I can see many users being annoyed at this change, it has also been made clear that Linux Lite would die without this change. - -> “This is a road I’d never thought I’d go down, but we have no choice. Either we stagnate and accept the big G’s ever-changing algorithms, or we boldly go where others have dared.” - -Jerry Bezencon - -In hindsight, this change was inevitable, as there is almost no other way for distributions to reasonably sustain themselves (aside from donations). Now we need to see how this change pays off for the developers of Linux Lite. - -### Updated Lite Tweaks App - -With this update, the Lite Tweaks app gets a few improvements. One of these is the ability to completely clear the cache of the Brave web browser. It also has a new option to set Brave as the default web browser. - -The second update within the Lite Tweaks app is a fix for GRUB. This tweak changes the grub entry from “Ubuntu” to “Linux Lite”. However, it should be noted that this option is only available when GRUB is controlled by Linux Lite. - -### Wrapping Up - -If you want to try Linux Lite for yourself, you can [download it from its website][3]. If you are already running Linux Lite, you can update to version 5.6 using the instructions found on the [release announcement][4]. - -While minor, this release does have a few improvements scattered around the OS. Most importantly, however, is the fact that Linux Lite can now be self-sustaining, meaning that we will continue to see more features added with every release. I think this is much better that the distro dying, don’t you? - -#### 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/linux-lite-5-6-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://www.linuxliteos.com/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ0MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://www.linuxliteos.com/download.php -[4]: https://www.linuxliteos.com/forums/release-announcements/linux-lite-5-6-final-released/ diff --git a/sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md b/sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md deleted file mode 100644 index 31cbe35407..0000000000 --- a/sources/news/20210907 Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: subject: "Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9" -[#]: via: "https://news.itsfoss.com/lakka-retroarch-release/" -[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Lakka Linux 3.4 Brings Fidelity FX Support With the New RetroArch 1.9.9 -====== - -For years now, [RetroArch][1] has been the gold standard in emulation, thanks to its ease of use and simplicity. Similarly, [Lakka][2] has gotten a name by using RetroArch to create an incredibly smooth and straightforward experience for its users. - -Hence, we have recommended it in the past to [turn your old PC into a retrogaming console][3]. - -It is always a great day when these two large projects announce new releases, and it looks like we have some exciting news with Lakka 3.4 and RetroArch 1.9.9 release. - -Here, we will be looking at some of the new features announced in RetroArch 1.9.9 and Lakka 3.4 and the significant impact on the future of emulation. - -### What’s New? - -With this release, RetroArch has introduced some useful and impactful new features. These include: - - * AMD FidelityFX support for all games - * Windows users can now use HDR on many games - * New touchscreen menu for the Nintendo DS - - - -Lakka (which includes RetroArch) has also received some welcome improvements. - - * Improved stability - * 3 new cores for the PS1, PS2, and DOS - * Updated Mesa to version 21.2.1 - - - -Here we focus on the key highlights and, primarily, Integrated FidelityFX. - -#### FidelityFX For Retro Games - -![][4] - -When AMD announced its open-source alternative to DLSS back in June, we could never have predicted the incredible impact it would have on emulation. - -For those not aware, [FidelityFX][5] allows games to run at a lower resolution while retaining the same image quality, dramatically improving the performance. - -Now, with the RetroArch 1.9.9 release, this technology is being brought to RetroArch and Lakka. This is great because it allows older games designed to run at a low resolution to look much better without resorting to mods or texture packs. - -Overall, I expect this addition to be widely appreciated, especially by people looking for a more modern version of their favorite retro games. - -If you want to learn more about FidelityFX and upscaling, I’d highly suggest you check out [our article on Intel’s XeSS where we explain all this][6] and how it impacts you. - -#### New Touchscreen Menu For Nintendo 3DS - -One of the more interesting ports of RetroArch, the Nintendo 3DS, has also gotten a cool new feature. This comes in the form of a touchscreen menu for the bottom screen, which shows a few useful shortcuts without covering the game. - -While this doesn’t apply to Lakka, users of RetroArch running on top of another distribution should receive this change once RetroArch 1.9.9 lands in the repositories. - -### Wrapping Up - -Overall, [RetroArch 1.9.9][7] and [Lakka 3.4][8] are looking to be significant upgrades, especially with the new integration with FidelityFX. - -As we have already seen, with emulators such as [RPCS3][9], FidelityFX can provide significant graphical improvements on older games, so it is exciting to see this come to RetroArch. - -_What do you think about FidelityFX being used for retro games? 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/lakka-retroarch-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://www.retroarch.com/ -[2]: http://lakka.tv -[3]: https://itsfoss.com/lakka-retrogaming-linux/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjIzMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://www.amd.com/en/technologies/radeon-software-fidelityfx-super-resolution -[6]: https://news.itsfoss.com/intel-xess-open-source/ -[7]: https://www.libretro.com/index.php/retroarch-1-9-9-released/ -[8]: http://lakka.tv/articles/2021/09/06/lakka-3.4/ -[9]: http://rpcs3.net diff --git a/sources/tech/20210810 elementary OS 6 ODIN Released. This is What-s New..md b/sources/tech/20210810 elementary OS 6 ODIN Released. This is What-s New..md deleted file mode 100644 index 6f5371c922..0000000000 --- a/sources/tech/20210810 elementary OS 6 ODIN Released. This is What-s New..md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: subject: "elementary OS 6 ODIN Released. This is What’s New." -[#]: via: "https://www.debugpoint.com/2021/08/elementary-os-6/" -[#]: author: "Arindam https://www.debugpoint.com/author/admin1/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -elementary OS 6 ODIN Released. This is What’s New. -====== -The team announced the release of elementary OS 6 ODIN, and it is -immediately available for download. We recap the release in this post. -![elementary OS 6 ODIN Desktop][1] - -The elementary OS 6 code named “ODIN” was a long due. This release coming after more than two years since its predecessor, [elementary OS 5.1 Hera][2]. A lot had happened in the last two years, that includes a full-fledged pandemic. Despite all the challenges, roadblocks – a brand new and much awaited release is here. - -Let’s take a look at what’s new. - -### elementary OS 6 Odin – What’s New - -The team promises the following items in a nutshell in this release: - -> Empowering you to be in control and express yourself, -> Continuing to innovate with new features, and -> Making elementary OS easier to get and more inclusive - - * This release is based on Ubuntu 20.04 and Linux Kernel 5.8. If you ask me, it’s late at this moment to have a new version of a distro based on Ubuntu 20.04 whereas next LTS is due in 2022. - * Dark theme and new ascent color is introduced in this release. With the dark theme enabled, all the default applications, windows automatically adapt to dark mode. This mode also can be set based on sunset and sunrise at your location. - * The ascent colors applied across the system when chosen. A fair and nice list of assent colors are available. - * The new dark theme is designed such as way that third party app developers can easily integrate their application to follow elementary OS stylesheet. - - - -![Dark and Light theme][3] - - * All apps in AppCenter are now Flatpak apps which runs in their separate sandbox. This is one of the best move by elementary team and all the Flatpak apps requires separate permission controls via settings. - * If you are a touchpad/touch device fan, then you are in for a treat. Three finger swipe up gestures brings up the activities overview. - * Three finger left and right – swap between dynamic workspaces. - * And all the applicable apps uses two finger gestures. - * Notifications are revamped with new look and can follow dark theme. - * A new task application introduced to track your tasks and can sync with online accounts. - * elementary OS 6 comes with firmware updates built in, powered by the Linux Vendor Firmware Service. Firmware updates are provided for supported devices by hardware manufacturers like Star Labs, Dell, Lenovo, HP, Intel, Logitech, Wacom, 8bitdo, and many more—now supported devices can get the latest updates for security and stability straight from System Settings → System → Firmware or by searching the Applications Menu for “Firmware.” - * Native applications are updated and redesigned completely. Epiphany browser is renamed as Web. Mail is completely rewritten with tighter integration with online accounts. - * Files introduces a different behavioral change. You need to single click to browse folders, but double click for files. This can not be changed via gsettings. - * And many more updates, which you can read in the [change log][4] here. - - - -[][5] - -SEE ALSO:   elementary OS 6 Beta Released. Download and Test Now! - -### Minimum System Requirement for elementary OS 6 - -Here’s a system specification for this version, before you hit download. - - * Recent Intel i3 or comparable dual-core 64-bit processor - * 4 GB of system memory (RAM) - * Solid state drive (SSD) with 15 GB of free space - * Internet access - * Built-in or wired mouse/touchpad and keyboard - * 1024×768 minimum resolution display - - - -### elementary OD 6 Odin – Download - -The .iso files for the new release is available in below link. Due to rush, the servers might be busy, hence it is recommended to use torrents if possible. - -[Download elementary OS 6 ODIN][6] - -### How to Upgrade - -There is no upgrade path available at the moment to upgrade to elementary 6 from elementary 5.1. Hence, you need to take backups and do a fresh installation via .iso available in above link. - -### Closing Notes - -There is no question that elementary OS is a one-of-a-kind Linux Distribution today. And its popularity is increasing everyday due to the awesome Pantheon desktop. It is one of the rare Linux distribution which appeals both macOS and Windows users. That said, I think the development process requires a bit faster and two years of the wait between versions is too long for IT. This release is based on Ubuntu 20.04 which is already two years old, and we have a new LTS coming up on 2022. And of course there is no upgrade path. I believe if the team work on these aspects, considering dedicated developers, donations, I think it would be one of the best Linux distro. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/08/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/blog/wp-content/uploads/2021/08/elementary-OS-6-ODIN-Desktop-1024x576.jpg -[2]: https://www.debugpoint.com/2019/12/elementary-os-hera-released/ -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/08/Dark-and-Light-theme-1024x692.png -[4]: https://blog.elementary.io/elementary-os-6-odin-released/ -[5]: https://www.debugpoint.com/2021/05/elementary-os-6-beta/ -[6]: https://elementary.io/ 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 deleted file mode 100644 index 4b8546e70d..0000000000 --- a/sources/tech/20210821 SparkyLinux 6.0 -Po-Tolo- Released Based on Debian 11 Bullseye.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: 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 diff --git a/sources/tech/20210824 .md b/sources/tech/20210824 .md deleted file mode 100644 index b04e0acb3f..0000000000 --- a/sources/tech/20210824 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: 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 810373021cbebd6f95a12c5fe68fad6d8ee0d0e5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Sep 2021 05:02:27 +0800 Subject: [PATCH 0331/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210910?= =?UTF-8?q?=20MAKE=20MORE=20with=20Inkscape=20=E2=80=93=20Ink/Stitch?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md --- ...10 MAKE MORE with Inkscape - Ink-Stitch.md | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md diff --git a/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md b/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md new file mode 100644 index 0000000000..6469a1de35 --- /dev/null +++ b/sources/tech/20210910 MAKE MORE with Inkscape - Ink-Stitch.md @@ -0,0 +1,212 @@ +[#]: subject: "MAKE MORE with Inkscape – Ink/Stitch" +[#]: via: "https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/" +[#]: author: "Sirko Kemter https://fedoramagazine.org/author/gnokii/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +MAKE MORE with Inkscape – Ink/Stitch +====== + +![MAKE more with Inkscape - Ink/Stitch][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. Also, Inkscape can do a lot more than just graphics. The first article of this [series][2] showed how to [produce GCode with Inkscape][3]. This article will examine another Inkscape extension – [Ink/Stitch][4]. Ink/Stitch is an extension for designing embroidery with Inkscape. + +### DIY Embroidery + +In the last few years the do-it-yourself or maker scene has experienced a boom. You could say it all began with the inexpensive option of [3D printing][5]; followed by also not expensive [CNC][6] machines and laser cutters/engravers. Also the prices for more _“_traditional_”_ machines such as embroidery machines have fallen during recent years. [Home embroidery machines are now available for 500 US dollars][7]. + +If you don’t want to or can’t buy one yourself, the nearest [MakerSpace][8] often has one. Even the prices for commercial single-head embroidery machines are down to 5,000 US dollars. They are an investment that can pay off quickly. + +### Software for Embroidery Design + +Some of the home machines include their own software for designing embroidery. But most, if not all, of these applications are Windows-only. Also, the most used manufacturer-independent software of this area – [Embird][9] – is only available for Windows. But you could run it in Wine. + +Another solution for Linux – [Embroidermodde][10] – is not really developed anymore. And this is after having had a fundraising campaign. + +Today, only one solution is left – [Ink/Stitch][4] + +![The logo of the Ink/Stitch project][11] + +### Open Source and Embroidery Design + +Ink/Stitch started out using [libembroidery][12]. Today [pyembroidery][13] is used. The manufacturers can’t be blamed for the prices of these machines and the number of Linux users. It is hardly worthwhile to develop applications for Linux. + +#### The Embroidery File Format Problem + +There is a problem with the proliferation of file formats for embroidery machines; especially among manufacturers that cook their own file format for their machines. In some cases, even a single manufacturer may use several different file formats. + + * **.10o** – Toyota embroidery machines + * **.100** – Toyota embroidery machines + * **.CSD** – Poem, Huskygram, and Singer EU embroidery home sewing machines. + * **.DSB** – Baruda embroidery machines + * **.JEF** – MemoryCraft 10000 machines. + * **.SEW** – MemoryCraft 5700, 8000, and 9000 machines. + * **.PES** – Brother and Babylock embroidery home sewing machines. + * **.PEC** – Brother and Babylock embroidery home sewing machines. + * **.HUS** – Husqvarna/Viking embroidery home sewing machines. + * **.PCS** – Pfaff embroidery home sewing machines. + * **.VIP** – old Pfaff format also used by Husqvarna machines. + * **.VP3** – newer Pfaff embroidery home sewing machines. + * **.DST** – Tajima commercial embroidery sewing machines. + * **.EXP** – Melco commercial embroidery sewing machines. + * **.XXX** – Compucon, Singer embroidery home sewing machines. + * **.ZSK** – ZSK machines on the american market + + + +This is just a small selection of the file formats that are available for embroidery. You can find a more complete list [here][14]. If you are interested in [deeper knowledge about these file formats, see here for more information][15]. + +#### File Formats of Ink/Stitch + +Ink/Stitch can currently read the following file formats: 100, 10o, BRO, DAT, DSB, DST, DSZ, EMD, EXP, EXY, FXY, GT, INB, JEF, JPX, KSM, MAX, MIT, NEW, PCD, PCM, PCQ, PCS, PEC, PES, PHB, PHC, SEW, SHV, STC, STX, TAP, TBF, U01, VP3, XXX, ZXY and also GCode as TXT file. + +For the more important task of writing/saving your work, Ink/Stitch supports far fewer formats: DST, EXP, JEF, PEC, PES, U01, VP3 and of course SVG, CSV and GCode as TXT + +Besides the problem of all these file formats, there are other problems that a potential stitch program has to overcome. + +Working with the different kinds of stitches is one difficulty. The integration of tools for drawing and lettering is another. But why invent such a thing from scratch? Why not take an existing vector program and just add the functions for embroidery to it? That was the idea behind the [Ink/Stitch project][4] over three years ago. + +### Install Ink/Stitch + +Ink/Stitch is an [extension for Inkscape][16]. Inkscape’s new functionality for downloading and installing extensions is still experimental. And you will not find Ink/Stitch among the extensions that are offered there. You must [download][17] the extension manually. After it is downloaded, unzip the package into your directory for Inkscape extensions. The default location is _~/.config/Inkscape/extensions_ (or _/usr/share/inkscape/extensions_ for system-wide availability). If you have changed the defaults, you may need to check Inkscape’s settings to find the location of the extensions directory. + +### Customization – Install Add-ons for Ink/Stitch + +The Ink/Stitch extension provides a function called Install Add-Ons for Inkscape, which you should run first. + +The execution of this function – _Extensions > Ink/Stitch > Thread Color Management > Install thread color palettes for Inkscape_ – will take a while. + +Do not become nervous as there is no progress bar or a similar thing to see. + +This function will install 70 color palettes of various yarn manufacturers and a symbol library for Ink/Stitch. + +![Inkscape with the swatches dialogue open, which shows the Madeira Rayon color palette][18] + +If you use the download from Github version 2.0.0, the ZIP-file contains the color palette files. You only need to unpack them into the right directory (_~/.config/inkscape/palettes/_). If you need a [hoop template, you can download][19] one and save it to _~/.config/inkscape/templates_. + +The next time you start Inkscape, you will find it under _File > New From Template_. + +### Lettering with Ink/Stitch + +The way that is by far the easiest and most widely used, is to get a embroidery design using the _Lettering_ function of Ink/Stitch. It is located under _Extensions > Ink/Stitch > Lettering_. Lettering for embroidery is not simple. What you expect are so called satin stitched letters. For this, special font settings are needed. + +![Inkscape with a “Chopin” glyph for satin stitching defined for the Lettering function][20] + +You can convert paths to satin stitching. But this is more work intensive than using the Lettering function. Thanks to the work of an active community, the May 2021 release of Ink/Stitch 2.0 brought more predefined fonts for this. An English tutorial on how to create such fonts can be found [here][21]. + +Version 2.0 also brings functions (_Extensions > Ink/Stitch > Font Management_) to make managing these kinds of fonts easier. There are also functions for creating these kinds of fonts. But you will need knowledge about font design with Inkscape to do so. First, you create an an entire SVG font. It is then feed through a JSON script which converts the SVG font into the type of files that Ink/Stitch’s font management function works with. + +![On the left side the Lettering dialogue and on the right the preview of this settings][22] + +The function will open a dialogue window where you just have to put in your text, choose the size and font, and then it will render a preview. + +### Embroider Areas/Path-Objects + +The easiest thing with Ink/Stitch, is to embroider areas or paths. Just draw your path. When you use shapes then you have to convert them and then run _Extensions > Ink/Stitch > Fill Tools > Break Apart Fill Objects…_ + +This breaks apart the path into its different parts. You have to use this function. The _Path > Break apart_ function of Inkscape won’t work for this. + +Next, you can run Ink/Stitch’s built-in simulator: _Extensions > Ink/Stitch > Visualise and Export > Simulator/Realistic Preview_. + +![The new Fedora logo as Stitch Plan Preview][23] + +Be careful with the simulator. It takes a lot system resources and it will take a while to start. You may find it easier to use the function _Extensions > Ink/Stitch > Visualise and Export > Stitch Plan Preview_. The latter renders the threading of the embroidery outside of the document. + +![Nicubunu’s Fedora hat icon as embroidery. The angles for the stitches of the head part and the brim are different so that it looks more realistic. The outline is done in Satin stitching][24] + +### Simple Satin and Satin Embroidery + +Ink/Stitch will convert each stroke with a continuous line (no dashes) to what they call Zig-Zag or Simple Satin. Stitches are created along the path using the stroke width you have specified. This will work as long there aren’t too many curves on the path. + +![Parameter setting dialogue and on the right the Fedora logo shape embroidered as Zig-Zag line][25] + +This is simple. But it is by far not the best way. It is better to use the Satin Tools for this. The functions for the Satin embroidery can be found under _Extensions > Satin Tools_. The most important is the conversion function which converts paths to satin strokes. + +![Fedora logo shape as Satin Line embroidery][26] + +You can also reverse the stitch direction using _Extensions > Satin Tools > Flip Satin Column Rails_. This underlines the 3D effect satin embroidery gets, especially when you make puff embroidery. For machines that have this capability, you can also set the markings for the trims of jump stitches. To visualize these trims, Ink/Stitch uses the symbols that where installed from its own symbol library. + +### The Ink/Stitch Stitch Library + +What is called the stitch library is simply the kind of stitches that Ink/Stitch can create. The Fill Stitch and Zig-Zag/Satin Stitch have already been introduced. But there are more. + + * **Running Stitches**: These are used for doing outline designs. The running stitch produces a series of small stitches following a line or curve. Each dashed line will be converted into a Running Stitch. The size of the dashes does not matter. + + + +![A running stitch – each dashed line will be converted in such one][27] + + * **Bean Stitches**: These can also be used for outline designs or add details to a design. The bean stitch describes a repetition of running stitches back and forth. This results in thicker threading. + + + +![Bean Stitches – creating a thicker line][28] + + * **Manual Stitch**: In this mode, Ink/Stitch will use each node of a path as a needle penetration point; exactly as they are placed. + + + +![In manual mode – each node will be the needle penetration point][29] + + * **E-Stitch**: The main use for e-stitch is a simple but strong cover stitch for applique items. It is often used for baby cloths because their skin tends to be more sensitive. + + + +![E-Stitch mostly used for applications on baby cloths, soft but strong connection][30] + +### Embroidery Thread List + +Some embroidery machines (especially those designed for commercial use) allow different threads to be fitted in advance according to what will be needed for the design. These machines will automatically switch to the right thread when needed. Some file formats for embroidery support this feature. But some do not. Ink/Stitch can apply custom thread lists to an embroidery design. + +If you want to work on an existing design, you can import a thread list: _Extensions > Ink/Stitch > Import Threadlist_. Thread lists can also be exported: _Save As different file formats as *.zip_. You can also print them: _Extensions > Ink/Stitch > Visualise and Export > Print PDF_. + +### Conclusion + +Writing software for embroidery design is not easy. Many functions are needed and diverse (sometimes closed-source) file formats make the task difficult. Ink/Stitch has managed to create a useful tool with many functions. It enables the user to get started with basic embroidery design. Some things could be done a little better. But it is definitely a good tool as-is and I expect that it will become better over time. Machine embroidery can be an interesting hobby and with Ink/Stitch the Fedora Linux user can begin designing breathtaking things. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/make-more-with-inkscape-ink-stitch/ + +作者:[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/08/drawing2-816x345.png +[2]: https://fedoramagazine.org/series/make-more/ +[3]: https://fedoramagazine.org/make-more-with-inkscape-g-code-tools/ +[4]: https://inkstitch.org/ +[5]: https://fedoramagazine.org/3d-printing-in-fedora-from-an-idea-to-the-thing/ +[6]: https://en.wikipedia.org/wiki/Numerical_control +[7]: https://www.amazon.com/-/de/dp/B07VZ2YBLL/ref=sr_1_11?__mk_de_DE=%C3%85M%C3%85%C5%BD%C3%95%C3%91&crid=1MFJJWXMKQD6R&dchild=1&keywords=home+embroidery+machine&qid=1628388092&rnid=2941120011&s=arts-crafts&sprefix=home+embroider+%2Caps%2C-1&sr=1-11 +[8]: https://www.fablabs.io/labs/map +[9]: https://www.embird.net/ +[10]: https://embroidermodder.org/ +[11]: https://fedoramagazine.org/wp-content/uploads/2021/08/inkstitch_logo.png +[12]: https://github.com/Embroidermodder/libembroidery +[13]: https://github.com/inkstitch/pyembroidery +[14]: http://www.needlework.ru/page/embroidery.htm +[15]: http://edutechwiki.unige.ch/en/Embroidery_format +[16]: https://inkscape.org/~wwderw/%E2%98%85inkstitch-embroidery-extension +[17]: https://github.com/inkstitch/inkstitch/releases/tag/v2.0.0 +[18]: https://fedoramagazine.org/wp-content/uploads/2021/08/swatches-1024x556.png +[19]: https://inkstitch.org/assets/images/tutorials/templates/hoop-template.svg +[20]: https://fedoramagazine.org/wp-content/uploads/2021/08/satinfont-1024x556.png +[21]: https://inkstitch.org/tutorials/font-creation/ +[22]: https://fedoramagazine.org/wp-content/uploads/2021/08/lettering-1024x523.png +[23]: https://fedoramagazine.org/wp-content/uploads/2021/08/stitch-preview-1024x556.png +[24]: https://fedoramagazine.org/wp-content/uploads/2021/08/nicu-stitch.gif +[25]: https://fedoramagazine.org/wp-content/uploads/2021/08/zigzag-1024x463.png +[26]: https://fedoramagazine.org/wp-content/uploads/2021/08/satin.png +[27]: https://fedoramagazine.org/wp-content/uploads/2021/08/running-stitch-detail.jpg +[28]: https://fedoramagazine.org/wp-content/uploads/2021/08/bean-stitch-detail.jpg +[29]: https://fedoramagazine.org/wp-content/uploads/2021/08/manual-stitch-detail.png +[30]: https://fedoramagazine.org/wp-content/uploads/2021/08/e-stitch-detail.jpg From 91585e99f5279c05ef408a73deb27c33bbde6b5d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Sep 2021 05:02:50 +0800 Subject: [PATCH 0332/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210911?= =?UTF-8?q?=20How=20to=20Set=20JAVA=5FHOME=20Variable=20in=20Ubuntu=20Linu?= =?UTF-8?q?x=20Correctly?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md --- ...HOME Variable in Ubuntu Linux Correctly.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md diff --git a/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md b/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md new file mode 100644 index 0000000000..8d6dafd4d1 --- /dev/null +++ b/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md @@ -0,0 +1,157 @@ +[#]: subject: "How to Set JAVA_HOME Variable in Ubuntu Linux Correctly" +[#]: via: "https://itsfoss.com/set-java-home-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Set JAVA_HOME Variable in Ubuntu Linux Correctly +====== + +If you are [running Java programs on Ubuntu][1] using Eclipse, [Maven][2] or Netbeans etc, you’ll need to set JAVA_HOME to your path. Otherwise, your system will complain that “java_home environment variable is not set”. + +In this beginner’s tutorial, I’ll show the steps to correctly set Java Home variable on Ubuntu. The steps should be valid for most other Linux distributions as well. + +The process consists of these steps: + + * Making sure Java Development Kit (JDK) is installed. + * Finding the correct location of JDK executable. + * Setting the JAVA_HOME variable and making the change permanent. + + + +### Step 1: Check if JDK is installed + +The simplest way to check if Java Development Kit (JDK) is installed on your Linux system is by running this command: + +``` +javac --version +``` + +The above command checks the version of Java compiler. If it is installed, it will show the Java version. + +![Java Compiler is installed][3] + +If the command shows an error like javac command not found, you’ll have to install JDK. + +![Java Compiler is not installed][4] + +If Java Compiler is not installed on your system, install Java Development Kit using this command: + +``` +sudo apt install default-jdk +``` + +This will install the default Java version in your current Ubuntu version. If you need some other specific Java version, you’ll have to specify it while [installing Java on Ubuntu][5]. + +Once you have made sure that Java Compiler is present on your system, it’s time to find its location. + +### Step 2: Get the location of JDK executable (Java Compiler) + +The executable is usually located in the /usr/lib/jvm directory. I won’t left you on your own for a guessing game. Instead, let’s find out the path of the Java executable. + +[Use the which command][6] to get the location of Java Compiler executable: + +``` +which javac +``` + +The problem here is that the location it gives is actually a [symbolic link][7]. You’ll have to follow it a couple of times: + +![][8] + +An easier method is to follow the symbolic link and get to the actual executable file directly using this command: + +``` +readlink -f `which java` +``` + +The readlink command follows a symbolic link. I have used ` around _which java_. This is called command substitution and it replaces the command with its output. So basically, the above command is equivalent to _readlink -f /usr/bin/java_ in this case. + +In my example, the location of the executable file is **/usr/lib/jvm/java-11-openjdk-amd64/bin/java**. It could be different for you. Copy the correct path you got from the above command in your system. You know, you can [copy paste in the Ubuntu terminal][9]. + +### Step 3: Setting JAVA_HOME variable + +Now that you have got the location, use it to set the JAVA_HOME environment variable: + +``` +export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java +``` + +Check the value of JAVA_HOME directory: + +``` +echo $JAVA_HOME +``` + +![][10] + +Try to run your program or project in the SAME TERMINAL and see if it works. + +This is not over yet. The JAVA_HOME variable you just declared is temporary. If you close the terminal or start a new session, it will be empty again. + +To set JAVA_HOME variable ‘permanently’, you should add it to the bashrc file in your home directory. + +You can [use the Nano editor for editing files in the Linux terminal][11]. If you do not want that and take a simple copy-paste approach, use the following commands: + +Back up your bashrc file (in case you mess it, you can get it back): + +``` +cp ~/.bashrc ~/.bashrc.bak +``` + +Next, [use the echo command to append][12] the export command you used at the beginning of this section. _**Change the command below to use the correct path as displayed by your system in**_. + +``` +echo "export JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/bin/java" >> ~/.bashrc +``` + +Verify that it has been correctly added to the end of the file: + +``` +tail -3 ~/.bashrc +``` + +The above [tail command][13] will show the last 3 lines of the specified file. + +Here’s the entire output of the above three commands. + +![][14] + +Now, even if you exit the session or restart the system, the JAVA_HOME variable will still be set to the value you specified. That’s what you want, right? + +Do note that if you change the default Java version in the future, you’ll have to change the value of JAVA_HOME and point it to the correct executable path. + +I hope this tutorial not only helped you to set Java Home, it also taught you how you are doing it. + +If you are still facing issues or have any questions or suggestions, please let me know in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/set-java-home-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/run-java-program-ubuntu/ +[2]: https://maven.apache.org/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/check-java-compiler-ubuntu.png?resize=750%2C310&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=732%2C300&ssl=1 +[5]: https://itsfoss.com/install-java-ubuntu/ +[6]: https://linuxhandbook.com/which-command/ +[7]: https://linuxhandbook.com/symbolic-link-linux/ +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/get-java-home-path-ubuntu.png?resize=800%2C283&ssl=1 +[9]: https://itsfoss.com/copy-paste-linux-terminal/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/setting-java-home-ubuntu.png?resize=800%2C268&ssl=1 +[11]: https://itsfoss.com/nano-editor-guide/ +[12]: https://linuxhandbook.com/echo-command/ +[13]: https://linuxhandbook.com/tail-command/ +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/set-java-home-bashrc-ubuntu.png?resize=786%2C348&ssl=1 From 52587517185c6044a6ae1f9fe2d97fb855777db4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Sep 2021 05:03:15 +0800 Subject: [PATCH 0333/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210910?= =?UTF-8?q?=20Building=20an=20open=20source=20community=20health=20analyti?= =?UTF-8?q?cs=20platform?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210910 Building an open source community health analytics platform.md --- ...rce community health analytics platform.md | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 sources/tech/20210910 Building an open source community health analytics platform.md diff --git a/sources/tech/20210910 Building an open source community health analytics platform.md b/sources/tech/20210910 Building an open source community health analytics platform.md new file mode 100644 index 0000000000..39c5a3c5eb --- /dev/null +++ b/sources/tech/20210910 Building an open source community health analytics platform.md @@ -0,0 +1,58 @@ +[#]: subject: "Building an open source community health analytics platform" +[#]: via: "https://opensource.com/article/21/9/openrit-mystic" +[#]: author: "Quinn Foster https://opensource.com/users/quinn-foster" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Building an open source community health analytics platform +====== +An academic OSPO is working with CHAOSS software to build a community +health analytics platform. +![metrics and data shown on a computer screen][1] + +Rochester Institute of Technology (RIT) has made considerable strides in increasing its presence in the open source world lately. RIT's _Free and Open Source Software and Free Culture_ minor is the first of its kind in academia. For example, its open source programs office, Open @ RIT, has begun helping RIT faculty and staff fellows build and maintain communities for their open source projects. + +These strides are driven by the students, faculty, and staff at RIT. Already, a growing number of people at the university are heading their own open projects. However, running an entirely open source project can be cumbersome. Much of this comes from maintaining a community for the project and managing data such as the project's code, issue tracking, and repositories. + +To help these people, Open @ RIT is creating a system called Mystic, a community health analytics platform that utilizes [GrimoireLab][2], an open source toolkit developed by [CHAOSS][3] software that provides metrics and analytics for open source projects. GrimoireLab allows users to gather, enrich, filter, and visualize a project's data, such as the time it takes a reported issue to be solved, contributor affiliations, and much more. + +Mystic will act as a front-end portal where anybody can submit their project. From there, the project will be sent directly to GrimoireLab, which will compute and publish the project's metrics for the submitter after only a few minutes. + +> "Our hope is that anyone at RIT who is managing, leading, or participating in an open source project will be able to submit that project to Mystic and have any metrics they need provided to them," says Emi Simpson, full-stack developer at Open @ RIT and head developer of Mystic. + +The process is straightforward. After logging into Mystic, the user uploading their project opens up a pop-up window where they enter details about the project and links to data sources like GitLab, RSS feed, and an Open Software Foundation (OSF) project. Once the details and project are saved, Mystic uses GrimoireLab to automatically retrieve metrics from the project source and render graphs for each source. The project and its metrics will then be displayed on its own dashboard. + +![Mystic statistics page][4] + +Screenshot by Quinn Foster, [CC-BY SA 4.0][5] + +These dashboards will also be displayed and listed on a single page for others to see, encouraging cooperative development and interaction between open source communities within RIT worldwide. Simpson and Open @ RIT hope this will increase participation in open work at RIT and further cement the university as an open work hub. + +> "If somebody asks what is RIT doing for open source software, my hope is that people will be able to point to Mystic and GrimoireLab and say 'here's what,'" says Simpson. "By building that metric of 'here's what we're doing, here's what we've contributed, here are the projects that people are working on,' we can build a community at RIT centered around the work that we're doing in open source." + +At the moment, Mystic is still under development and not ready for a production environment, but its potential for both RIT and open source as a whole remains well in sight. Future goals include implementing easy integration with the university's reporting tools and comprehensive dashboards at the project level and in aggregate. + +Are you interested in contributing to Mystic? [Get in touch with us][6] to get started. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/openrit-mystic + +作者:[Quinn Foster][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/quinn-foster +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://chaoss.github.io/grimoirelab/ +[3]: https://chaoss.community/ +[4]: https://opensource.com/sites/default/files/uploads/mystic_statistics_page.png (Mystic statistics page) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.ieee.org/rit/mystic From 462f860d34ceeae5ec69bf083d3f0336a827589e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 11 Sep 2021 05:03:53 +0800 Subject: [PATCH 0334/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210910?= =?UTF-8?q?=20Quadratic=20algorithms=20are=20slow=20(and=20hashmaps=20are?= =?UTF-8?q?=20fast)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md --- ...rithms are slow (and hashmaps are fast).md | 257 ++++++++++++++++++ 1 file changed, 257 insertions(+) create mode 100644 sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md diff --git a/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md b/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md new file mode 100644 index 0000000000..57917ef11d --- /dev/null +++ b/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md @@ -0,0 +1,257 @@ +[#]: subject: "Quadratic algorithms are slow (and hashmaps are fast)" +[#]: via: "https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Quadratic algorithms are slow (and hashmaps are fast) +====== + +Hello! I was talking to a friend yesterday who was studying for a programming interview and trying to learn some algorithms basics. + +The topic of quadratic-time vs linear-time algorithms came up, I thought this would be fun to write about here because avoiding quadratic-time algorithms isn’t just important in interviews – it’s sometimes good to know about in real life too! I’ll explain what a “quadratic-time algorithm is” in a minute :) + +here are the 3 things we’ll talk about: + + 1. quadratic time functions are WAY WAY WAY slower than linear time functions + 2. sometimes you can make a quadratic algorithm into a linear algorithm by using a hashmap + 3. this is because hashmaps lookups are very fast (instant!) + + + +I’m going to try to keep the math jargon to a minimum and focus on real code examples and how fast/slow they are. + +### our problem: intersect two lists + +Let’s talk about a simple interview-style problem: getting the intersection of 2 lists of numbers. For example, `intersect([1,2,3], [2,4,5])` should return `[2]`. + +This problem is also somewhat realistic – you could imagine having a real program where you need to take the intersection of 2 lists of IDs. + +### the “obvious” solution: + +Let’s write some code to take the intersection of 2 lists. Here’s a program that does it, called `quadratic.py`. + +``` +import sys + +# the actual code +def intersection(list1, list2): + result = [] + for x in list1: + for y in list2: + if x == y: + result.append(y) + return result + +# some boilerplate so that we can run it from the command line on lists of +# different sizes +def run(n): + # make 2 lists of n+1 elements + list1 = list(range(3, n)) + [2] + list2 = list(range(n+1, 2*n)) + [2] + # intersect them and print out the result + print(list(intersection(list1, list2))) + +# Run with the program's first command line argument +run(int(sys.argv[1])) +``` + +The reason it’s called `quadratic.py` is that if `list1` and `list2` have size `n`, then the inner loop (`if x == y`) will run `n^2` times. And in math, functions like `x^2` are called “quadratic” functions. + +### how slow is `quadratic.py`? + +Let’s run this program with a bunch of lists of different lengths. The intersection of the two lists is always the same: `[2]`. + +``` +$ time python3 quadratic.py 10 +[2] + +real 0m0.037s +$ time python3 quadratic.py 100 +[2] + +real 0m0.053s +$ time python3 quadratic.py 1000 +[2] + +real 0m0.051s +$ time python3 quadratic.py 10000 # 10,000 +[2] + +real 0m1.661s +``` + +So far none of this is too bad – it’s still taking less than 2 seconds. + +Then I ran it on two lists with 100,000 elements, and I had to wait a LONG time. Here’s the result: + +``` +$ time python3 quadratic.py 100000 # 100,000 +[2] + +real 2m41.059s +``` + +This is very slow! It’s 160 seconds, which is almost exactly 100x longer than it did to run on 10,000 elements (which was 1.6 seconds). So we can see that after a certain point, every time we make the list 10x bigger, the program takes about 100x longer to run. + +I didn’t try to run this program on 1,000,000 elements, because I knew it would take 100x longer again – probably about 3 hours. I don’t have time for that! + +You can probably see now why quadratic time algorithms can be a problem – even this very simple program starts getting very slow pretty quickly. + +### let’s write a fast version: `linear.py` + +Okay, so let’s write a fast version of the program. First I’ll show you the program, then I’ll explain it. + +``` +import sys + +# the actual algorithm +def intersection(list1, list2): + set1 = set(list1) # this is a hash set + result = [] + for y in list2: + if y in set1: + result.append(y) + return result + +# some boilerplate so that we can run it from the command line on lists of +# different sizes +def run(n): + # make 2 lists of n+1 elements + list1 = range(3, n) + [2] + list2 = range(n+1, 2*n) + [2] + # print out the intersection + print(intersection(list1, list2)) + +run(int(sys.argv[1])) +``` + +(this isn’t the most idiomatic Python, but I wanted to write it without using too many python-isms so that people who don’t know Python could understand it more easily) + +We’ve done 2 things differently here than our slow program: + + 1. convert `list1` into a set called `set1` + 2. only use one for loop instead of two for loops + + + +### let’s see how fast this `linear.py` program is + +Before we talk about _why_ this program is fast, let’s first prove that it’s fast by running it on some big lists. Here it is running on lists of size 10 to 10,000,000. (remember that our original program started getting SUPER slow when run on 100,000 elements) + +``` +$ time python3 linear.py 100 +[2] + +real 0m0.056s +$ time python3 linear.py 1000 +[2] + +real 0m0.036s +$ time python3 linear.py 10000 # 10,000 +[2] + +real 0m0.028s +$ time python3 linear.py 100000 # 100,000 +[2] + +real 0m0.048s <-- quadratic.py took 2 minutes in this case! we're doing it in 0.04 seconds now!!! so fast! +$ time python3 linear.py 1000000 # 1,000,000 +[2] + +real 0m0.178s +$ time python3 linear.py 10000000 # 10,000,000 +[2] + +real 0m1.560s +``` + +### running `linear.py` on an extremely big list + +If we try to run it on a very very big list (10 billion / 10,000,000,000 elements), then actually we run into a different problem: it’s _fast_ enough (that list is only 100x bigger than the list that took 4.2 seconds, so we could probably do it in 420 seconds), but my computer doesn’t have enough memory to store all of the elements of the list and so the program crashes before it gets there. + +``` +$ time python3 linear.py 10000000000 +Traceback (most recent call last): + File "/home/bork/work/homepage/linear.py", line 18, in + run(int(sys.argv[1])) + File "/home/bork/work/homepage/linear.py", line 13, in run + list1 = [1] * n + [2] +MemoryError + +real 0m0.090s +user 0m0.034s +sys 0m0.018s +``` + +We’re not talking about memory usage in this blog post though, so let’s ignore that. + +### okay, why is `linear.py` fast? + +Now I’ll try to explain why `linear.py` is fast. + +Here’s the code again: + +``` +def intersection(list1, list2): + set1 = set(list1) # this is a hash set + result = [] + for y in list2: + if y in set1: + result.append(y) + return result +``` + +Let’s say that `list1` and `list2` are both lists of about 10,000,000 different elements. That’s kind of a lot of elements! + +So why is this able to run so fast? HASHMAPS!!! + +### hashmap lookups are instant (“constant time”) + +Let’s look at this if statement from our fast program: + +``` +if y in set1: + result.append(y) +``` + +You might think that this check – `if y in set1` – would be slower if the `set1` contains 10 million elements than it is if `set1` contains 1000 elements. But it’s not! It always takes basically the same amount of time (SUPER FAST), no matter how big `set1` gets. + +This is because `set1` is a hash set, which is a type of hashmap/hashtable which only has keys and no values. + +I’m not going to explain _why_ hashmap lookups are instant in this post, but the amazing Vaidehi Joshi’s [basecs][1] series has explanations of [hash tables][2] and [hash functions][3] which talk about it. + +### accidentally quadratic: real life quadratic algorithms! + +This issue that we saw where quadratic time algorithms are really slow is actually a problem that shows up in real life – Nelson Elhage has a great blog called [accidentally quadratic][4] with stories about performance problems caused by code that accidentally ran in quadratic time. + +### quadratic time algorithms can kind of sneak up on you + +The weird thing about quadratic time algorithms is that when you run them on a small number of elements (like 1000), it doesn’t seem so bad! It’s not that slow! But then if you throw 1,000,000 elements at it, it can really take hours to run. + +So I think it’s worth being broadly aware of them, so you can avoid writing them by accident. Especially if there’s an easy way to write a linear-time algorithm instead (like using a hashmap). + +### hashmaps always feel a little magical to me + +Hashmaps aren’t magic of course (you can learn the math behind why hashmap lookups are instant! it’s cool!), but it always _feels_ a little magical to me, and every time I use hashmaps in a program to speed things up it makes me happy :) + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/ + +作者:[Julia 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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://medium.com/basecs +[2]: https://medium.com/basecs/taking-hash-tables-off-the-shelf-139cbf4752f0 +[3]: https://medium.com/basecs/hashing-out-hash-functions-ea5dd8beb4dd +[4]: https://accidentallyquadratic.tumblr.com/ From ec50304e954fdaf6e6c2d35489ac224a2e085933 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sat, 11 Sep 2021 08:57:43 +0800 Subject: [PATCH 0335/1588] translating --- ...0 Quadratic algorithms are slow (and hashmaps are fast).md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md b/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md index 57917ef11d..9034e42d7f 100644 --- a/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md +++ b/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md @@ -2,7 +2,7 @@ [#]: via: "https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/" [#]: author: "Julia Evans https://jvns.ca/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -244,7 +244,7 @@ via: https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/ 作者:[Julia Evans][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 005c091d09fbdd4bdfa83d6a2121b77b0996cb27 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Sep 2021 11:01:35 +0800 Subject: [PATCH 0336/1588] PRF @geekpi @turbokernel --- .../20210901 What are container runtimes.md | 56 +++++++++---------- 1 file changed, 26 insertions(+), 30 deletions(-) diff --git a/translated/tech/20210901 What are container runtimes.md b/translated/tech/20210901 What are container runtimes.md index 9118053dda..99ca0277b2 100644 --- a/translated/tech/20210901 What are container runtimes.md +++ b/translated/tech/20210901 What are container runtimes.md @@ -9,65 +9,61 @@ 什么是容器运行时? ====== -通过深入了解容器运行时,理解容器环境是如何建立的。 -![Ships at sea on the web][1] -在检查[容器镜像][2]时,我讨论了容器的基本原理,但现在是深入研究容器运行时的时候了,从而了解容器环境是如何构建的。本文的部分信息摘自 Open Container Initiative (OCI)(容器的开放标准)的[官方文档][3],所以无论使用何种容器引擎,这些信息都是贯通的。 +> 通过深入了解容器运行时,理解容器环境是如何建立的。 + +![](https://img.linux.net.cn/data/attachment/album/202109/11/110104vzgjs0v9c9o04s78.jpg) + +在学习 [容器镜像][2] 时,我们讨论了容器的基本原理,但现在是深入研究容器运行时runtime的时候了,从而了解容器环境是如何构建的。本文的部分信息摘自 开放容器计划Open Container Initiative(OCI)的 [官方文档][3],所以无论使用何种容器引擎,这些信息都是一致的。 ### 容器运行机制 那么,当你运行 `podman run` 或 `docker run` 命令时,在后台到底发生了什么?一个分步的概述如下: - 1. 如果本地没有镜像,则从镜像仓库拉取镜像 - 2. 镜像被提取到一个写时拷贝的文件系统上,所有的容器层相互叠加以形成一个合并的文件系统 + 1. 如果本地没有镜像,则从镜像登记仓库registry拉取镜像 + 2. 镜像被提取到一个写时复制(COW)的文件系统上,所有的容器层相互堆叠以形成一个合并的文件系统 3. 为容器准备一个挂载点 - 4. 从容器镜像中设置元数据,包括诸如覆盖 CMD、来自用户输入的 ENTRYPOINT、设置 SECCOMP 规则等设置,以确保容器按预期运行 - 5. 提醒内核为该容器分配某种隔离,如进程、网络和文件系统(命名空间) - 6. 提醒内核为改容器分配一些资源限制,如 CPU 或内存限制(cgroups) - 7. 传递一个系统调用(syscall)给内核用于启动容器 + 4. 从容器镜像中设置元数据,包括诸如覆盖 `CMD`、来自用户输入的 `ENTRYPOINT`、设置 SECCOMP 规则等设置,以确保容器按预期运行 + 5. 提醒内核为该容器分配某种隔离,如进程、网络和文件系统(命名空间namespace) + 6. 提醒内核为改容器分配一些资源限制,如 CPU 或内存限制(控制组cgroup) + 7. 传递一个系统调用syscall给内核用于启动容器 8. 设置 SELinux/AppArmor - - 容器运行时负责上述所有的工作。当我们提及容器运行时,想到的可能是 runc、lxc、containerd、rkt、cri-o 等等。嗯,你没有错。这些都是容器引擎和容器运行时,每一种都是为不同的情况建立的。 -_容器运行时_更侧重于运行容器,为容器设置命名空间和 cgroups,也被称为底层容器运行时。高层的容器运行时或容器引擎专注于格式、解包、管理和镜像共享。它们还为开发者提供 API。 +容器运行时Container runtime更侧重于运行容器,为容器设置命名空间和控制组(cgroup),也被称为底层容器运行时。高层的容器运行时或容器引擎专注于格式、解包、管理和镜像共享。它们还为开发者提供 API。 -### Open Container Initiative (OCI) +### 开放容器计划(OCI) -Open Container Initiative(OCI)是一个 Linux 项目基金会。其目的是设计某些开放标准或围绕如何与容器运行时和容器镜像格式工作的结构。它是由 Docker、rkt、CoreOS 和其他行业领导者于 2015 年 6 月建立的。 +开放容器计划Open Container Initiative(OCI)是一个 Linux 基金会的项目。其目的是设计某些开放标准或围绕如何与容器运行时和容器镜像格式工作的结构。它是由 Docker、rkt、CoreOS 和其他行业领导者于 2015 年 6 月建立的。 它通过两个规范来完成如下任务: -#### 1\. 镜像规范(image-spec) +#### 1、镜像规范 该规范的目标是创建可互操作的工具,用于构建、传输和准备运行的容器镜像。 该规范的高层组件包括: - * [Image Manifest][4] — 一个描述构成容器镜像的元素的文件 - * [Image Index][5] — 镜像清单的注释索引 - * [Image Layout][6] — 一个镜像内容的文件系统布局 - * [Filesystem Layer][7] — 一个描述容器文件系统的变化集 - * [Image Configuration][8] — 确定镜像层顺序和配置的文件,适合转换成[运行时包][9]。 - * [Conversion][10] — 解释应该如何进行转换的文件 - * [Descriptor][11] — 一个描述被引用内容的类型、元数据和内容地址的参考资料 + * [镜像清单][4] — 一个描述构成容器镜像的元素的文件 + * [镜像索引][5] — 镜像清单的注释索引 + * [镜像布局][6] — 一个镜像内容的文件系统布局 + * [文件系统布局][7] — 一个描述容器文件系统的变更集 + * [镜像配置][8] — 确定镜像层顺序和配置的文件,以便转换成 [运行时捆包][9] + * [转换][10] — 解释应该如何进行转换的文件 + * [描述符][11] — 一个描述被引用内容的类型、元数据和内容地址的参考资料 +#### 2、运行时规范 +该规范用于定义容器的配置、执行环境和生命周期。`config.json` 文件为所有支持的平台提供了容器配置,并详细定义了用于创建容器的字段。在详细定义执行环境时也描述了为容器的生命周期定义的通用操作,以确保在容器内运行的应用在不同的运行时环境之间有一个一致的环境。 -#### 2\. 运行时规范(runtime-spec) - -该规范用于定义容器的配置、执行环境和生命周期。config.json 文件为所有支持的平台提供了容器配置,并详细说明了能够创建容器的地方。执行环境与为容器的生命周期定义的通用操作一起被详细说明,以确保在容器内运行的应用在不同的运行时之间有一个一致的环境。 - -Linux 容器规范各种内核功能的使用,包括命名空间、cgroups、capabilities、LSM 和文件系统隔离来实现该规范。 +Linux 容器规范使用了各种内核特性,包括命名空间namespace控制组cgroup权能capability、LSM 和文件系统隔离jail等来实现该规范。 ### 小结 容器运行时是通过 OCI 规范管理的,以提供一致性和互操作性。许多人在使用容器时不需要了解它们是如何工作的,但当你需要排除故障或优化时,了解容器是一个宝贵的优势。 -* * * - -_本文基于 [techbeatly][12] 的文章,并经授权改编。_ +本文基于 [techbeatly][12] 的文章,并经授权改编。 -------------------------------------------------------------------------------- From fb4e3aaf8975220d5665b519fe46f57678aba25b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Sep 2021 11:02:49 +0800 Subject: [PATCH 0337/1588] PUB @geekpi @turbokernel https://linux.cn/article-13772-1.html --- .../20210901 What are container runtimes.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210901 What are container runtimes.md (98%) diff --git a/translated/tech/20210901 What are container runtimes.md b/published/20210901 What are container runtimes.md similarity index 98% rename from translated/tech/20210901 What are container runtimes.md rename to published/20210901 What are container runtimes.md index 99ca0277b2..9119fc9aeb 100644 --- a/translated/tech/20210901 What are container runtimes.md +++ b/published/20210901 What are container runtimes.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13772-1.html" 什么是容器运行时? ====== From 1dd9621fb3b8d0b7508d3089a48c9ce4cc5bedcd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 11 Sep 2021 11:31:32 +0800 Subject: [PATCH 0338/1588] PRF&PUB @geekpi https://linux.cn/article-13773-1.html --- ... How to Install Dropbox on Ubuntu Linux.md | 30 ++++++++++--------- 1 file changed, 16 insertions(+), 14 deletions(-) rename {translated/tech => published}/20210904 How to Install Dropbox on Ubuntu Linux.md (78%) diff --git a/translated/tech/20210904 How to Install Dropbox on Ubuntu Linux.md b/published/20210904 How to Install Dropbox on Ubuntu Linux.md similarity index 78% rename from translated/tech/20210904 How to Install Dropbox on Ubuntu Linux.md rename to published/20210904 How to Install Dropbox on Ubuntu Linux.md index 5427a572a7..450681de4c 100644 --- a/translated/tech/20210904 How to Install Dropbox on Ubuntu Linux.md +++ b/published/20210904 How to Install Dropbox on Ubuntu Linux.md @@ -3,16 +3,18 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13773-1.html" 如何在 Ubuntu Linux 上安装 Dropbox ====== -Dropbox 是[最受欢迎的云存储服务之一,可用于 Linux][1] 和其他操作系统。 +![](https://img.linux.net.cn/data/attachment/album/202109/11/112839qa96g29ws99z9479.jpg) -事实上,Dropbox 是最早提供原生 Linux 应用的服务之一。它仍然[支持 32 位 Linux 系统][2],这也是一项值得称赞的工作。 +Dropbox 是 [最受欢迎的云存储服务之一,可用于 Linux][1] 和其他操作系统。 + +事实上,Dropbox 是最早提供原生 Linux 应用的服务之一。它仍然 [支持 32 位 Linux 系统][2],这也是一项值得称赞的工作。 在这个初学者的教程中,我将展示在 Ubuntu 上安装 Dropbox 的步骤。这些步骤其实很简单,但有些网站把它弄得不必要的复杂。 @@ -22,9 +24,9 @@ Dropbox 是[最受欢迎的云存储服务之一,可用于 Linux][1] 和其他 #### 第一步:获取 Ubuntu 的 Dropbox 安装程序 -Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面: +Dropbox 为其安装程序提供 DEB 文件。进入网站的下载页面: -[Dropbox Download][3] +- [下载 Dropbox][3] 下载相应的 DEB 文件。考虑到你使用的是 64 位的 Ubuntu,请获取 64 位版本的 DEB 文件。 @@ -32,9 +34,9 @@ Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面: #### 第二步:安装 Dropbox 安装程序 -你下载的 deb 文件只是 Dropbox 的一个安装程序。实际的 Dropbox 安装稍后开始,类似于[在 Ubuntu 上安装 Steam][5]。 +你下载的 deb 文件只是 Dropbox 的一个安装程序。实际的 Dropbox 安装稍后开始,类似于 [在 Ubuntu 上安装 Steam][5]。 -要[安装下载的 deb 文件][6],可以双击它,或者右击并选择用软件安装打开。 +要 [安装下载的 deb 文件][6],可以双击它,或者右击并选择用软件安装打开。 ![Installing the downloaded Dropbox deb file][7] @@ -46,7 +48,7 @@ Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面: #### 第三步:开始安装 Dropbox -现在 Dropbox 安装程序已经安装完毕。按 Windows 键(也叫 super 键),搜索 Dropbox 并点击它。 +现在 Dropbox 安装程序已经安装完毕。按 `Windows` 键(也叫 `Super` 键),搜索 Dropbox 并点击它。 ![Start Dropbox for installation][9] @@ -54,9 +56,9 @@ Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面: ![Starting Dropbox installation][10] -点击 Restart Nautilus/Close(在 Nautilus 弹出窗口)或 OK(在安装弹出窗口),开始实际的 Dropbox 客户端下载和安装。如果 “Nautilus Restart” 在点击关闭按钮时没有关闭,请点击 x 按钮。 +点击 “Restart Nautilus” -> “Close”(在 Nautilus 弹出窗口)或 “OK”(在安装弹出窗口),开始实际的 Dropbox 客户端下载和安装。如果 “Nautilus Restart” 在点击关闭按钮时没有关闭,请点击 “X” 按钮。 -等待Dropbox的安装完成。 +等待 Dropbox 的安装完成。 ![Installing Dropbox][11] @@ -78,7 +80,7 @@ Dropbox 为其安装程序提供 DEB文 件。进入网站的下载页面: ![Dropbox folder is created under home directory][14] -如果你想节省磁盘空间或带宽,你可以进入偏好设置并选择选择性同步选项。选择性同步选项允许你只在本地系统上同步来自 Dropbox 云的选定文件夹。 +如果你想节省磁盘空间或带宽,你可以进入偏好设置并选择选择性同步Selective Sync选项。该选项允许你只在本地系统上同步来自 Dropbox 云的选定文件夹。 ![Using selective sync in Dropbox][15] @@ -93,7 +95,7 @@ via: https://itsfoss.com/install-dropbox-ubuntu/ 作者:[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 4f6cb017f4e2f655e98be12e19291f2dd803279f Mon Sep 17 00:00:00 2001 From: imgradeone <30969327+imgradeone@users.noreply.github.com> Date: Sat, 11 Sep 2021 21:26:20 +0800 Subject: [PATCH 0339/1588] Update 20210906 Getting the Top Indicator Panel Back in GNOME.md --- .../20210906 Getting the Top Indicator Panel Back in GNOME.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md b/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md index efeb2a3dad..896d7c954b 100644 --- a/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md +++ b/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/enable-applet-indicator-gnome/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "imgradeone" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From f024af013bac8dbf8c67643c6b856643b81cfda4 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: Sat, 11 Sep 2021 22:21:29 +0800 Subject: [PATCH 0340/1588] finished tl --- ...g the Top Indicator Panel Back in GNOME.md | 50 +++++++++---------- 1 file changed, 25 insertions(+), 25 deletions(-) diff --git a/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md b/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md index 896d7c954b..0659356bee 100644 --- a/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md +++ b/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md @@ -7,56 +7,56 @@ [#]: publisher: " " [#]: url: " " -Getting the Top Indicator Panel Back in GNOME +恢复 GNOME 顶栏的托盘图标 ====== -GNOME is the popular desktop environment that thrives to give Linux a modern desktop experience. +GNOME 是一款流行的 Linux 桌面环境,致力于为 Linux 用户提供现代化的桌面体验。 -While it works for the most part, some of their decisions has left the user fuming and questioning. +虽然这款桌面绝大部分功能都是可用的,但 GNOME 团队的某些决定确实也让许多用户恼火、质疑。 -You cannot have icons and files on the desktop, [new document option has been removed][1] from the right click context menu. In addition to that, GNOME has also removed the applet indicator functionality. +前脚不能在桌面摆放图标和文件,后脚将右键菜单中的 [新建文档选项移除][1],现在,除此之外,GNOME 同样也移除了托盘图标栏功能。 -You know what indicator applets are, don’t you? Those little icons that let you access additional features of the given application. I have plenty of them in my Ubuntu system. +怎么说,你总得知道托盘图标栏是什么吧?这些小图标允许你使用相应应用程序的额外功能。我自己的 Ubuntu 系统里就有许多托盘图标。 -![Indicator applets][2] +![托盘图标栏][2] -And this creates a problem, specially for applications that rely completely on these applet indicators to function. Take [Dropbox][3] for example. The only way to access Dropbox settings is through the app-indicator and you won’t find it in GNOME. +这一砍就砍出了大问题,尤其是针对那些完全依赖托盘图标的软件的致命打击。就拿 [Dropbox][3] 举例子吧,你只能通过 Dropbox 的托盘图标菜单来访问 Dropbox 的设置页面,很不幸,你在 GNOME 中就完全找不到这个图标。 -That’s a problem, but thankfully, there is a workaround for that. +这确实是个大问题,好在,我们还是有解决办法的。 -### Enabling applet indicator in GNOME via extension +### 借助插件来重新启用 GNOME 的托盘图标栏 -If you are using GNOME, you probably already know what GNOME Extension is. These are basically small add-ons developed by enthusiastic, independent developers. +如果你在用 GNOME,想必你已经知道 GNOME 插件是什么了。这些小插件基本上是由热心的独立开发者开发的。 -If not done already, [enable GNOME extensions][4]. It’s actually quite simple. Go to any GNOME extension’s page using Firefox or Chrome and it will suggest downloading a browser extension. Install it and you are good to go. +如果你没有准备好,那么就去 [启用 GNOME 插件][4] 吧。这一步其实非常简单,使用 Chrome 或 Firefox 打开任意一个插件的页面,然后页面会提示你安装浏览器扩展。安装这个扩展,然后就可以启程了。 -![Enabling GNOME Extension browser add-on][5] +![启用 GNOME 插件的浏览器扩展][5] -Now, there are several GNOME extensions available that allow adding applet indicators in the top panel. At the time of writing this tutorial, [AppIndicator and KStatusNotifierItem Support][6] extension is well developed and supported for the recent GNOME versions. +现在,这里有一些可以向顶栏增加托盘图标的 GNOME 插件。在撰写本篇教程的时候,[AppIndicator and KStatusNotifierItem Support][6] 这款插件在 GNOME 的较新版本中已经有良好的开发优化与支持。、 -Go to its webpage: +前往插件的页面: -[AppIndicator Extension][6] +[AppIndicator 插件][6] -On the page, you should see a toggle button. Click it to install it. +在这个页面中,你应该能看到一个开关按钮。点击这个按钮即可安装该插件。 ![][7] -There will be a pop-up. Hit install when you see it. +接下来会有一个弹窗,弹出后请点击“安装”。 -![Install the extension][8] +![安装插件][8] -The results won’t be seen immediately. You’ll have to restart GNOME. On Xorg, you could just use Alt+F2 and enter r but that does not work in Wayland. +也许安装插件后,插件不会立即生效。此时,你必须重启 GNOME。在 Xorg 会话中,你只需要按下 Alt + F2 并输入 `r` 即可重启 GNOME,但这个操作不支持 Wayland 会话。 -Log out of the system and log back in. Applet indicator should be activated now. If you have any applications installed that provides an indicator applet, you should see it on the top panel. +注销当前会话,并且重新登录,此后托盘图标应该就能成功启用了。如果你安装了任何一款带托盘图标的软件,那么你应该可以在顶栏上看见这些图标的身影了。 -In my case, I had Dropbox already installed and hence it started showing the icon in the top panel. +于我而言,我已经安装了 Dropbox,因此托盘图标就直接出现在顶栏上了。 -![Dropbox indicator working in GNOME][9] +![Dropbox 托盘图标在 GNOME 下可用的截图][9] -I hope this little tip help you gain access to the app indicators in the top panel of GNOME again. +希望这个小提示能帮助你恢复 GNOME 顶栏中的托盘图标。 -I do not know why the GNOME developers though that dropping this essential feature was a good idea. Anyway, if one door closes, another opens (usually). Enjoy GNOME to your liking. +我完全不理解,为什么 GNOME 的开发者会认为把这种实用性极强的功能删除会是个好主意。不过,上帝关上了一扇门,却(通常)会再打开一扇窗。好好享受按你的偏好运作的 GNOME 吧。 -------------------------------------------------------------------------------- @@ -64,7 +64,7 @@ via: https://itsfoss.com/enable-applet-indicator-gnome/ 作者:[Abhishek Prakash][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/) 荣誉推出 From b5f8ff78d6497863562c68fc0ad84a22713cb986 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: Sat, 11 Sep 2021 22:25:36 +0800 Subject: [PATCH 0341/1588] move file --- .../20210906 Getting the Top Indicator Panel Back in GNOME.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md (100%) diff --git a/sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md b/translated/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md similarity index 100% rename from sources/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md rename to translated/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md From 01c7a8449de3a8f34576a571860a2717711450f0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 12 Sep 2021 05:03:21 +0800 Subject: [PATCH 0342/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210911?= =?UTF-8?q?=20Play=20with=20model=20trains=20in=20OpenTTD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210911 Play with model trains in OpenTTD.md --- ...10911 Play with model trains in OpenTTD.md | 206 ++++++++++++++++++ 1 file changed, 206 insertions(+) create mode 100644 sources/tech/20210911 Play with model trains in OpenTTD.md diff --git a/sources/tech/20210911 Play with model trains in OpenTTD.md b/sources/tech/20210911 Play with model trains in OpenTTD.md new file mode 100644 index 0000000000..d636df830f --- /dev/null +++ b/sources/tech/20210911 Play with model trains in OpenTTD.md @@ -0,0 +1,206 @@ +[#]: subject: "Play with model trains in OpenTTD" +[#]: via: "https://opensource.com/article/21/9/model-trains-openttd" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Play with model trains in OpenTTD +====== +Don't have room for a physical model train set? Try virtual trains with +OpenTTD. +![Old train][1] + +My father has always been fond of model trains, and I remember watching him building a track around the Christmas tree when I was young. When [Lego][2] train sets were released, he and I transitioned to them for their convenience and inherent extensibility. We built and operated Lego trains and monorail tracks over the course of many years. I've often imagined a possible future in which I have a garage or a basement dedicated to miniature landscapes and electric whistling trains. Then again, the probability of me diving that severely into yet another hobby is pretty low, so I was very happy to discover that _virtual_ model railways can provide me with much of the same satisfaction. The engine for my virtualized hobby is [OpenTTD][3], an open source simulation game based on an old '90s game called **Transport Tycoon Deluxe**. + +### Installing OpenTTD + +You can download OpenTTD for Linux, macOS, and Windows from [openttd.org/downloads][4]. + +If you're running Debian Linux or one of its derivatives, or even [running it on a Chromebook][5], you can download the `.deb` package. Install it with `apt`: + + +``` +`$ sudo apt install ./openttd*deb` +``` + +If you're using any other Linux distribution, download the generic installer and extract the package with [the `tar command`][6]: + + +``` +`$ tar xvf openttd-x.yy.z-linux*.tar.xz` +``` + +OpenTTD is also available on [Steam][7] for Linux, macOS, and Windows (Steam isn't open source, but it's a common cross-platform gaming client). + +### Launch OpenTTD + +If you installed OpenTTD, you can launch it from your application menu. + +If you're downloaded the generic package, change into the directory and launch the game using the local `openttd` command: + + +``` +$ cd openttd* +$ ./openttd & +``` + +The first time you launch OpenTTD, it alerts you that you must download a graphic set. This is automatically installed in the Steam edition, but it's a single-click in the stand-alone app. And anyway, because OpenTTD is open source, it's well modded, so you'll end up downloading a lot more than just the default graphics. + +After the graphics have been downloaded, you're presented with the quaintly diminutive interface. I find a 640x480 interface a little small, and while the old graphics do hearken back to simpler computing days, a slight upgrade for modern screens is helpful. For that reason, your first stop is the **Check online content** button. + +### Loading mods + +The **Content downloading** screen provides you with a window to approved OpenTTD mods, giving improved graphics, new music, train models, and map names appropriate to your location or interests. I use the New Zealand set, so all of my generated cities sound familiar, although, since 2020, I've started using the Fallout 3 set. There are _a lot_ of mods, so use the search bar in the top right to narrow your choices. + +Here are the mods I consider essential: + + * **abase** \- High res graphics. At nearly 300 MB, this is the largest download you're likely to need (the game itself is barely 50 MB). + * **OpenSFX** \- A sound set so you can hear the traffic in cities, the horns of the boating industry, and the very satisfying whistles of trains. + * **Town names** \- The default names of cities are fun, but I find it easier to remember names that feel local. + * **Trains** \- OpenTTD has a default set of train models that work perfectly well, but if you're a trainspotter already, then you might enjoy downloading some additional train sets. I use the NZR set, but there are many trains available, including trains from the UK, the USA, Austria, Belgium, Czech Republic, and on and on down the alphabet. + * **Beginner tutorial** \- A scenario to help you learn the game and its interface. + + + +### Game engine defaults + +Once you download your new assets, you must set them as your defaults. There are two places for this: Game engine defaults and in-game scripts and assets. + +![OpenTTD main menu][8] + +The OpenTTD menu (Seth Kenlon, [CC BY-SA 4.0][9]) + +Click the **Game Options** button. In the **Game Options** screen, adjust these settings: + + * Set the **screen resolution** to your preferred interface size. + * Set **base graphics set** to **abase.** + * Set **base sounds set** to **OpenSFX.** + + + +Close the **Game Options** screen. Your changes are saved automatically. + +### Game options + +From the main menu screen, click the **NewGRF Settings** button. + +![NewGRF settings window][10] + +The NewGRF settings menu (Seth Kenlon, [CC BY-SA 4.0][9]) + +Inactive mods are listed at the bottom of the **NewGRF Settings** window. To activate one, select it and click the **Add** button in the bottom left. Once you've chosen the mods to activate, click the **Apply** button. + +### Tutorial + +If you downloaded the **Beginner tutorial** scenario, you could learn OpenTTD by playing through it. To start the tutorial, click the **Play scenario** button near the top of the main menu screen. Select the tutorial and begin. + +The tutorial gives you a full tour of the game's interface, and it takes some time to get through it. + +### Quickstart + +By way of a quicker introduction, here's what you need to know: vehicles come from depots, and everything needs a schedule. By remembering those two rules, you can start building trains (and roads and seaports and airports) right away. + +#### **Build stations** + +To build a simple rail line between two cities, click the railway track icon in the top icon bar. + +![New icon bar - railway option][11] + +The new icon bar - railway option (Seth Kenlon, [CC BY-SA 4.0][9]) + +Railways start and end with stations, so I usually place a station at each end of my intended line. Click the train station icon (mouse over it to see its label). For a train station to serve a region, its area of effect must overlap with as much of the region as possible. To see a station's coverage, enable **Coverage area highlight** by clicking the **On** button at the bottom of the station dialog box. + +![Station coverage window][12] + +Station coverage information window (Seth Kenlon, [CC BY-SA 4.0][9]) + +The dark grid overlay represents coverage, while the white grid overlay shows the physical footprint of the station. As you hover over an area, the supplies that a station's coverage enables are listed in the station popup window. Start simple and create a single-track, 4-car platform. Do this twice between two cities on the map. + +![create station menu][13] + +The create station menu (Seth Kenlon, [CC BY-SA 4.0][9]) + +### Lay the rails + +Next, connect the stations with rails. The isometric view of OpenTTD takes some getting used to, but after clicking on the rail icons and clicking and dragging on the map, you start to get a feel for it. The X-rail icon provides an "autorail" mode, which aligns the track based on where in a square you click. + +Be careful as you lay your rails. OpenTTD is rather unforgiving, so once you click in a square, rails are constructed. You must use the dynamite icon to remove rails. Just like in real life, there's no undo button. + +### Train depot + +Trains come from a depot. So to add a train to your railway, you must add a depot somewhere along the line. Click the depot icon and place a depot near an existing rail. Connect the depot to an existing track to ensure your trains can get from the depot to the appropriate (in this simple example, the only) line. + +![create depot menu][14] + +The create depot menu (Seth Kenlon, [CC BY-SA 4.0][9]) + +### Model trains + +At long last, you get to add a virtual model train to your virtual railway. To create a train, click on your depot. + +Click the **New Vehicle** button at the bottom of the depot window to list available train engines and cars. The list you get depends partly on what models you've added from the downloadable content. Generally, there are three types of engines: Steam, diesel, and electric. Early in the game, which starts in the year 1950, you have only steam. As the years progress, you get innovative new models you can use as upgrades. + +![create train menu][15] + +The create train menu (Seth Kenlon, [CC BY-SA 4.0][9]) + +For now, create a simple train that includes an engine, a passenger car, and a mail car. If you want to add other kinds of cars, click on your stations to confirm the types of supplies they're able to accept (as determined by its area of coverage). + +### Create a train schedule + +Now that you have a railway and a train, you must create a train schedule. Schedules are attached to vehicles, so any time you add a new vehicle of any kind, you must add a schedule for it to be useful. + +To add a schedule to your train, click the number to the left of the train in its depot listing. This opens a viewport for the train, with buttons along the right side of the window. Click the arrow icon to see that train's schedule. + +![create schedule menu][16] + +The create schedule menu (Seth Kenlon, [CC BY-SA 4.0][9]) + +To create a schedule, click the **Go To** button at the bottom of the schedule window, and then click on the station you want to set as the first destination. Then click the next station. You can adjust loading and unloading requirements by selecting a stop in the schedule and browsing the options in the **Full load** and **Unload** drop-down menus, and you can adjust routes (should you develop new routes) in the **Non-stop** drop-down menu. The options are plentiful, and as cities grow and your map becomes more developed, you may have to adjust your strategy. + +But for now, click the red **Stopped** button at the bottom of your train viewport to put your train into service! + +![train moving from station to station][17] + +Train in service (Seth Kenlon, [CC BY-SA 4.0][9]) + +### Try OpenTTD + +OpenTTD is a simulator, but it's also a game, so you do have constraints, including a budget and parameters you might want to optimize. For instance, you can click on a city, farm, or factory to discover what kind of imports and exports are acceptable to it. You can borrow money by clicking the budget button in the bottom right corner of the OpenTTD window. And it's not just a virtual train set. You can build roads, airports, seaports, and more. Just remember that all vehicles need depots and schedules, and you're halfway to a successful virtual enterprise. + +OpenTTD has an active and enthusiastic community, [an extensive wiki][18], and there are lots of resources and tutorials available online. Download the game and give it a try! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/model-trains-openttd + +作者:[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/train-plane-speed-big-machine.png?itok=f377dXKs (Old train) +[2]: https://opensource.com/article/20/6/open-source-virtual-lego +[3]: http://openttd.org +[4]: https://www.openttd.org/downloads/openttd-releases/latest.html +[5]: https://opensource.com/article/21/2/chromebook-linux +[6]: https://opensource.com/article/17/7/how-unzip-targz-file +[7]: https://store.steampowered.com/app/1536610/OpenTTD/ +[8]: https://opensource.com/sites/default/files/openttd-menu.jpg (OpenTTD menu) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/openttd-newgrf.jpg (The NewGRF settings menu) +[11]: https://opensource.com/sites/default/files/openttd-iconbar-railway.jpg (The new icon bar - railway option) +[12]: https://opensource.com/sites/default/files/openttd-window-station.jpg (Station coverage information window) +[13]: https://opensource.com/sites/default/files/openttd-create-station.jpg (The create station menu) +[14]: https://opensource.com/sites/default/files/openttd-create-depot.jpg (Create depot menu) +[15]: https://opensource.com/sites/default/files/openttd-create-train.jpg (The create train menu) +[16]: https://opensource.com/sites/default/files/openttd-create-schedule.png (The create schedule menu) +[17]: https://opensource.com/sites/default/files/openttd-train.jpg (Train in service) +[18]: https://wiki.openttd.org/en/ From e39f18b5dc8bc9da2ee737a5168b9b8d08455585 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 12 Sep 2021 05:04:42 +0800 Subject: [PATCH 0343/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210911?= =?UTF-8?q?=20Here=E2=80=99s=20Why=20Firefox=20is=20Seeing=20a=20Continuou?= =?UTF-8?q?s=20Decline=20for=20Last=2012=20Years?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md --- ... a Continuous Decline for Last 12 Years.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md diff --git a/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md b/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md new file mode 100644 index 0000000000..075a2b3b16 --- /dev/null +++ b/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md @@ -0,0 +1,87 @@ +[#]: subject: "Here’s Why Firefox is Seeing a Continuous Decline for Last 12 Years" +[#]: via: "https://news.itsfoss.com/firefox-continuous-decline/" +[#]: author: "Community https://news.itsfoss.com/author/team/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Here’s Why Firefox is Seeing a Continuous Decline for Last 12 Years +====== + +There has been a lot of discussion lately about the decline of the Firefox browser and numerous articles about it [losing 50 Million users in the last two years][1]. + +But the _**real decline has been over 12 years with a total loss of half a Billion users**_ and 75% of the market share it once held. + +It all started in 2009 Q3 with the fateful decision to force… + +### Tabs-On-Top + +As soon as [this decision was made][2], Firefox starting losing market share. Every other program on a PC uses tabs against the active window. Proprietary software like MS Office and Adobe, FOSS software like Notepad++ and GIMP, 3D design, video editors, hex editors, you name it: It is the standard, logical design. + +Then Google decided to make the tabs on top standard for its Chrome browser, which was designed for mobile devices not desktops. On a smartphone it may make sense, as there isn’t room for a full desktop style menu layout. On a desktop it is counterintuitive and breaks workflow with all other programs. The code for desktops is different from phones so there was no rational reason to try and force a mobile UI onto desktop users who were Firefox’s primary userbase. The argument that it was “too hard to maintain” a single setting enacted by 2 lines of code in a 4 Million line codebase is just insulting to the intelligence of users. Code isn’t a lawn. It doesn’t change if you leave it alone for a few weeks. + +When inundated with user complaints about the change, the response I received from a lead developer who shall remain nameless was “We have hundreds of millions of users. 5000 people complaining doesn’t represent the majority of users”. Those complaints had one common sentiment, “If I wanted my browser to look like Chrome I’d just use Chrome”. And so they did. + +### Constant removal of features “that no-one uses” + +Every change made to Firefox had the same pattern. The default feature was changed, but there was a menu setting to revert it. Then the menu setting was removed and you could only change it via about:config. Then the about:config option was removed. Every protest from the userbase met the same response “You’re just a tiny minority, most people like the change”. + +75% is not a minority. Almost everyone hated the changes and each change pushed more users away, and the arrogant, condescending responses from Mozilla staff left a bitter taste in their mouth ensuring they would never return. Looking closely at the user numbers you could see a visible drop with every removal, only stabilising when a third party add-on or CSS would revert the change. Over and over, year after year. No lessons were learnt. + +Removing settings wasn’t enough. Firefox went on to neuter add-ons and themes, forcing centralised signing and ultimately deprecating XUL without adequate webextension api’s to replace lost functionality. Complaining about this change I again spoke to one of the lead developers (same guy). His response was (exact quote) “People don’t use Firefox because of add-ons. Our telemetry shows 80% of users never install any add-ons” i.e. the telemetry that any tech savvy person immediately turns off because they don’t want their browser spying on them and about which we have also complained numerous times. + +Even the one great move they made in UI design, the drag and drop customisable Australis interface, alienated more users because of the horrible default layout and lack of options that didn’t need CSS. The awful angled tabs (copied from chrome) is the only UI change Mozilla has admitted was terrible and they only did so, surprise surpise, AFTER chrome did away with them. + +To this day, Mozilla still claims to want to hear from their users and after 12 years they still keep ignoring us, the awful default Proton UI being the latest foolish choice forced upon an unwilling userbase. (Type in “Firefox Proton” on Google to look at the most commonly searched suggestions if you think I’m in the minority). Fortunately it can still be mostly fixed with userChrome.css but even I’m getting sick of having to repeatedly patch together new code to keep up with constant deprecation and format changes.   + +### Bad coding paradigms + +Mozilla’s source code is a nightmare. For example, default profile location is defined 3 times, using different variables, in 3 different languages, one of which is generated by combining multiple variables located in separate files. Another example I saw was another global variable being defined in 6 different files. + +Post compiling, history for downloads, visited pages, bookmarks etc, are all shoved together into obfuscated files. The end result? Try deleting 400 entries from your history and watch how long it takes. Deleting that many lines from a separate text file would take a split second. Want to change the appearance of an icon or add a new one for a custom search? They’re mostly just PNGs, but they are obfuscated and sealed into the omni.ja file. Could otherwise be changed in seconds with your editor of choice, instead you need to install and learn a program like Eclipse and recompile the file with every change. The list goes on and on. + +It is no wonder Mozilla’s coders have such trouble finding and fixing bugs. This led to an even worse coding paradigm, logging everything for the purpose of bugfixes. This is one of the culprits of… + +### Poor memory management + +If a program is sitting there doing nothing, its memory usage should not change. Looking at my memory manager I have 40 processes obeying this principle. What is the only program constantly reading and writing to disk despite doing nothing? Firefox. It is running 13 processes and all of them are constantly doing both. I’ve been coding for 40 years and building PC’s for 30 so I do know a thing or two about how computing works. This is just awful design at the base level and no amount of tinkering on the surface will fix that. + +The code paradigm is the root of Mozilla’s performance issues and they won’t address it. I’ll wager that’s also the reason for the failure of FirefoxOS, which was a great idea but failed because of poor execution and coding practices resulting in too many bugs to fix.   + +### Invading your privacy at the same time as telling us “we value your privacy” + +Telemetry. Hidden telemetry that isn’t disabled when you click “disable telemetry”. Firstrun pings. Forced signing of add-ons. Auto-updates you can’t switch off, pinging every 10 minutes. “Experiments” which require a separate opt out. Now the latest offence is enforcing app based 2FA to login to a Firefox Add-on account just to make a custom theme, which you wouldn’t need in the first place if not for forced add-on signing. + +Mozilla has as little respect for their users privacy as they do for our opinions. + +### Final thoughts + +It didn’t have to be this way. It still doesn’t, but the mind that is incapable of admitting when it is wrong, or of considering differing opinions is doomed to stagnation and decay. The decision makers of Mozilla appear to have such minds so I do not hold out much hope for the future. Hopefully some of you out there can at least learn from their mistakes and succeed where they are failing. You succeed by giving users what they want, not telling them what they should want. By providing what is missing in the market, not blindly trying to copy your competitors. + +_The views and opinions expressed are those of the authors and do not necessarily reflect the official policy or position of It’s FOSS._ + +Author info: From Melbourne Australia, Dan has been coding for about 40 years and doing graphic design for 25 years. He also works on open source mechanical designs based on 3D printer kits. + +#### 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/firefox-continuous-decline/ + +作者:[Community][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/team/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/firefox-decline/ +[2]: https://www.wired.com/2009/07/mozilla-considers-copying-chrome-for-firefox-4dot0/ From 7c587fd4144ff91140a568781cf5c1229d8eb82b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 12 Sep 2021 05:04:52 +0800 Subject: [PATCH 0344/1588] add done: 20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md --- sources/tech/20210912 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210912 .md diff --git a/sources/tech/20210912 .md b/sources/tech/20210912 .md new file mode 100644 index 0000000000..1bf8863d94 --- /dev/null +++ b/sources/tech/20210912 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/find-graphics-card-linux/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 3d3e8eb2fb0807f84b27402fca7a2d118a98bfa0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 Sep 2021 08:25:01 +0800 Subject: [PATCH 0345/1588] Delete 20210912 .md --- sources/tech/20210912 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210912 .md diff --git a/sources/tech/20210912 .md b/sources/tech/20210912 .md deleted file mode 100644 index 1bf8863d94..0000000000 --- a/sources/tech/20210912 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/find-graphics-card-linux/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 65454d178562e578862d7bc64a46dd46d7e2262c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 12 Sep 2021 08:36:16 +0800 Subject: [PATCH 0346/1588] Update identify.sh --- scripts/check/identify.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/check/identify.sh b/scripts/check/identify.sh index f0a0ad58fa..baa250c179 100644 --- a/scripts/check/identify.sh +++ b/scripts/check/identify.sh @@ -24,9 +24,9 @@ rule_bypass_check() { [ -f /tmp/bypass ] && echo "匹配规则:绕过检查" } -# 添加原文:添加至少一篇原文 +# 添加原文:只能添加一篇原文 rule_source_added() { - [ "$SRC_A" -ge 1 ] \ + [ "$SRC_A" -eq 1 ] \ && check_category SRC A \ && [ "$TOTAL" -eq "$SRC_A" ] && echo "匹配规则:添加原文 ${SRC_A} 篇" } From 77a152da45fb7b4d242e70ccfabe765a7e5f469d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Sep 2021 09:00:14 +0800 Subject: [PATCH 0347/1588] APL --- sources/talk/20210228 What is GNU-Linux Copypasta.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210228 What is GNU-Linux Copypasta.md b/sources/talk/20210228 What is GNU-Linux Copypasta.md index ebf9e7d040..ed3ef68d4b 100644 --- a/sources/talk/20210228 What is GNU-Linux Copypasta.md +++ b/sources/talk/20210228 What is GNU-Linux Copypasta.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/gnu-linux-copypasta/) [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From ada69d651f9cfe0aea3124e449366c039dacb94d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Sep 2021 10:30:23 +0800 Subject: [PATCH 0348/1588] TLS&PRF --- .../20210228 What is GNU-Linux Copypasta.md | 73 ------------------- .../20210228 What is GNU-Linux Copypasta.md | 67 +++++++++++++++++ 2 files changed, 67 insertions(+), 73 deletions(-) delete mode 100644 sources/talk/20210228 What is GNU-Linux Copypasta.md create mode 100644 translated/talk/20210228 What is GNU-Linux Copypasta.md diff --git a/sources/talk/20210228 What is GNU-Linux Copypasta.md b/sources/talk/20210228 What is GNU-Linux Copypasta.md deleted file mode 100644 index ed3ef68d4b..0000000000 --- a/sources/talk/20210228 What is GNU-Linux Copypasta.md +++ /dev/null @@ -1,73 +0,0 @@ -[#]: subject: (What is GNU/Linux Copypasta?) -[#]: via: (https://itsfoss.com/gnu-linux-copypasta/) -[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What is GNU/Linux Copypasta? -====== - -As a Linux user, you might have come across a long text that starts with “I’d like to interject for a moment. What you are referring to as Linux, is in fact, GNU/Linux”. - -It makes some people confused about what is Linux and what is GNU/Linux. I have explained it in the article about the [concept of Linux distributions][1]. - -Basically, [Linux is a kernel][2] and with [GNU softwares][3], it becomes usable in the form of an operating system. - -Many purists and enthusiasts don’t want people to forget the contribution of GNU to the Linux-based operating systems. Hence, they often post this long text (known as GNU Linux copypasta) in various forums and communities. - -I am not sure of the origin of the GNU/Linux copypasta and since when it came into existence. Some people attribute it to Richard Stallman’s [article on GNU blog in 2011][4]. I cannot confirm or deny that. - -### Complete GNU/Linux Copypasta - -I’d just like to interject for a moment. What you’re refering to as Linux, is in fact, GNU/Linux, or as I’ve recently taken to calling it, GNU plus Linux. Linux is not an operating system unto itself, but rather another free component of a fully functioning GNU system made useful by the GNU corelibs, shell utilities and vital system components comprising a full OS as defined by POSIX. - -Many computer users run a modified version of the GNU system every day, without realizing it. Through a peculiar turn of events, the version of GNU which is widely used today is often called Linux, and many of its users are not aware that it is basically the GNU system, developed by the GNU Project. - -There really is a Linux, and these people are using it, but it is just a part of the system they use. Linux is the kernel: the program in the system that allocates the machine’s resources to the other programs that you run. The kernel is an essential part of an operating system, but useless by itself; it can only function in the context of a complete operating system. Linux is normally used in combination with the GNU operating system: the whole system is basically GNU with Linux added, or GNU/Linux. All the so-called Linux distributions are really distributions of GNU/Linux! - -**Recommended Read:** - -![][5] - -#### [Linux Jargon Buster: What is FOSS (Free and Open Source Software)? What is Open Source?][6] - -### What is a Copypasta, again? - -![][7] - -Did you notice that I used the term ‘copypasta’. It has nothing to do with Italian dish pasta. - -[Copypasta][8] is a block of text which is copied and pasted across the internet, often to troll or poke fun at people. It is a degeneration of the term ‘copy-paste’. - -Copypasta is also considered spam because they are repeated as it is a number of times. Take the example of GNU Linux copypasta. If a few people keep on pasting the huge text block every time someone uses Linux instead of GNU/Linux in a discussion forum, it would annoy other members. - -### Have you ever used GNU/Linux Copypasta? - -Personally, I have never done that. But, to be honest, that’s how I come to know about the term GNU/Linux when I was a new Linux users and was browsing through some Linux forum. - -How about you? Have you ever copy-pasted the “I would like to interject for a moment” in a Linux forum? Do you think it’s a tool for ‘trolls’ or is it the necessary evil to make people aware of the GNU project? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/gnu-linux-copypasta/ - -作者:[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/what-is-linux-distribution/ -[2]: https://itsfoss.com/what-is-linux/ -[3]: https://www.gnu.org/ -[4]: https://www.gnu.org/gnu/linux-and-gnu.html -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/09/what-is-foss.png?fit=800%2C450&ssl=1 -[6]: https://itsfoss.com/what-is-foss/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/copypasta.png?resize=800%2C450&ssl=1 -[8]: https://www.makeuseof.com/what-is-a-copypasta/ diff --git a/translated/talk/20210228 What is GNU-Linux Copypasta.md b/translated/talk/20210228 What is GNU-Linux Copypasta.md new file mode 100644 index 0000000000..d8364fc801 --- /dev/null +++ b/translated/talk/20210228 What is GNU-Linux Copypasta.md @@ -0,0 +1,67 @@ +[#]: subject: (What is GNU/Linux Copypasta?) +[#]: via: (https://itsfoss.com/gnu-linux-copypasta/) +[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +谈谈 GNU/Linux 口水话 +====== + +作为一个 Linux 用户,你可能遇到过以这样开头的一大段文字:“我想插一句话。你所说的 Linux,实际上是指 GNU/Linux。” + +这让一些人对什么是 “Linux” 和什么是 “GNU/Linux” 感到困惑。对此,我在关于 [Linux 发行版的概念][1] 的文章中已经解释过。 + +基本上,[Linux 是一个内核][2],加上 [GNU 软件][3],它就可以以操作系统的形式使用。 + +许多纯粹主义者和拥趸们不希望人们忘记 GNU 对基于 Linux 的操作系统的贡献。因此,他们经常在各种论坛和社区发布这篇长文(被称为 GNU Linux 口水话copypaste)。 + +我不清楚这些 GNU/Linux 口水话的起源,也不清楚它是从什么时候开始出现的。有些人把它归功于 Richard Stallman 的 [2011 年在 GNU 博客上的文章][4]。我无法证实或否认这一点。 + +### 完整的 GNU/Linux 口水话 + +> 我只想插一句话。你所说的 Linux,实际上是 GNU/Linux,或者正如我最近所称,是 GNU + Linux。Linux 本身并不是一个操作系统,而是功能齐全的 GNU 系统的另一个自由组件,这个系统是由 GNU 核心库、shell 实用程序和重要的系统组件组成的、按 POSIX 定义构成的完整操作系统。 +> +> 许多计算机用户每天都在运行着一个修改过的 GNU 系统,却没有意识到这一点。通过一个奇特的转折,这个今天被广泛使用的 GNU 版本通常被称为 Linux,而它的许多用户并不知道它基本上是由 GNU 项目开发的 GNU 系统。 +> +> Linux 倒也真的是存在,这些人也在使用它,但它只是他们使用的系统的一部分罢了。Linux 是内核:在系统中该程序将机器的资源分配给你运行的其他程序。内核是操作系统的一个重要部分,但它本身是无用的;它只能在一个完整的操作系统的环境下发挥作用。Linux 通常与 GNU 操作系统结合使用:整个系统基本上是添加了 Linux 的 GNU,或者叫 GNU/Linux。所有所谓的 Linux 发行版实际上都是 GNU/Linux 的发行版! + +### 到底什么是口水话? + +![][7] + +你是否注意到,我使用了“Copypasta”(LCTT 译注:译者选择翻译为“口水话”,或许有更贴合中文的译法,请大家指正)这个术语。它与意大利面pasta毫无关系。 + +[口水话][8] 是在互联网上复制和粘贴的文本块,通常是为了嘲弄或取笑别人。它是“复制-粘贴copy-paste”一词的变种。 + +口水话也被认为是垃圾内容,因为它们被重复了一次又一次。以 GNU Linux 口水话为例。如果每次有人在讨论区中使用 Linux 这个词而不是 GNU/Linux 时,总会有几个人不断地粘贴这些大段的文本,那么就会惹恼其他成员。 + +### 你有没有贴过 GNU/Linux 口水话? + +就个人而言,我从来没有这样做过。但是,说实话,当我还是一个新的 Linux 用户,在浏览一些 Linux 论坛时,我就是这样知道 GNU/Linux 这个术语的。 + +你呢?你有没有在 Linux 论坛上复制粘贴过“我想插一句话……”?你认为它是“嘲弄”工具,还是让人们了解 GNU 项目的必要之举? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gnu-linux-copypasta/ + +作者:[Abhishek Prakash][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/abhishek/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/what-is-linux-distribution/ +[2]: https://itsfoss.com/what-is-linux/ +[3]: https://www.gnu.org/ +[4]: https://www.gnu.org/gnu/linux-and-gnu.html +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/09/what-is-foss.png?fit=800%2C450&ssl=1 +[6]: https://itsfoss.com/what-is-foss/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/02/copypasta.png?resize=800%2C450&ssl=1 +[8]: https://www.makeuseof.com/what-is-a-copypasta/ From 4ab5bf91ce70d691445d79046691db5c15695b27 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Sep 2021 10:34:52 +0800 Subject: [PATCH 0349/1588] PUB @wxy https://linux.cn/article-13776-1.html --- .../20210228 What is GNU-Linux Copypasta.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename {translated/talk => published}/20210228 What is GNU-Linux Copypasta.md (96%) diff --git a/translated/talk/20210228 What is GNU-Linux Copypasta.md b/published/20210228 What is GNU-Linux Copypasta.md similarity index 96% rename from translated/talk/20210228 What is GNU-Linux Copypasta.md rename to published/20210228 What is GNU-Linux Copypasta.md index d8364fc801..0026fa8d35 100644 --- a/translated/talk/20210228 What is GNU-Linux Copypasta.md +++ b/published/20210228 What is GNU-Linux Copypasta.md @@ -3,13 +3,15 @@ [#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (wxy) 谈谈 GNU/Linux 口水话 ====== +![](https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/02/gnu-linux-copypasta.png) + 作为一个 Linux 用户,你可能遇到过以这样开头的一大段文字:“我想插一句话。你所说的 Linux,实际上是指 GNU/Linux。” 这让一些人对什么是 “Linux” 和什么是 “GNU/Linux” 感到困惑。对此,我在关于 [Linux 发行版的概念][1] 的文章中已经解释过。 From cb592ffa2079beb6320f41e6cd3306d9877a84e0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Sep 2021 11:03:43 +0800 Subject: [PATCH 0350/1588] PRF @anine09 --- ...ications in Linux Using Tangram Browser.md | 39 +++++++++---------- 1 file changed, 19 insertions(+), 20 deletions(-) diff --git a/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md b/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md index 615cc95b10..4f034c0beb 100644 --- a/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md +++ b/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md @@ -3,32 +3,32 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "anine09" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -使用 Tangram Browser 在 Linux 中运行 Web 应用 +使用 Tangram 浏览器在 Linux 中运行 Web 应用 ======= -_**导语:**Tangram 是一个旨在帮助你在 Linux 中运行和管理 Web 应用的浏览器_。_一起来看看它是如何使用的吧。_ +> Tangram 是一个旨在帮助你在 Linux 中运行和管理 Web 应用的浏览器。一起来看看它是如何使用的吧。 -即使我们有许多本地的工具类 Linux 本地应用,但是许多人最终还是选择使用 Web 应用。 +对于一些工具来说,即使我们有许多 Linux 原生应用,但是许多人最终还是选择使用 Web 应用。 -他们也许是使用 Electron 构建的应用或是直接在浏览器中打开网页,使用本地应用正在成为一种比较“传统”的做法。 +他们也许是使用 Electron 构建的应用,或是直接在浏览器中打开的网页,使用原生应用正在成为一种比较“传统”的做法。 -当然,运行 Web 应用,不管是什么平台,都会占用更多的系统资源。而且,考虑到每一个服务都是基于 Web 端而不是本地,我们就需要一种有效管理 Web 应用的解决方案。 +当然,不管在什么平台运行 Web 应用都会占用更多的系统资源。而且,考虑到每一个服务都正在提供基于 Web 的方式,而不是原生体验,我们就需要一种有效管理 Web 应用的解决方案。 -因此,我为你介绍一款开源的 Linux 应用,Tangram。 +一款开源的 Linux 应用 Tangram 或许就是这个解决方案。 ### Tangram:专为 Web 应用设计的浏览器 ![][1] -你可以选择其他[优秀的浏览器][2]来运行 Web 应用,但是如果你想完全专注于 Web 应用体验的浏览器,Tangram 是个不错的选择。 +你可以选择其他 [优秀的浏览器][2] 来运行 Web 应用,但是如果你想完全专注于 Web 应用体验的浏览器,Tangram 是个不错的选择。 -Tangram 的开发者从 GNOME Web,[Franz][3],和 [Rambox][4] 中获得的灵感。 +Tangram 的开发者从 GNOME Web、[Franz][3] 和 [Rambox][4] 中获得了灵感。 -没有其他花里胡哨的功能, Tangram 能帮助你改变你的用户代理( User Agent )和管理那些你已经登陆的 Web 应用。 +没有其他花里胡哨的功能,只是能更改你的用户代理User Agent和管理你所登录的 Web 应用。 它可以用于访问多个社交媒体,聊天工具,工作协同应用等等。 @@ -36,16 +36,15 @@ Tangram 的开发者从 GNOME Web,[Franz][3],和 [Rambox][4] 中获得的 ![][5] -考虑到 Tangram 是基于 WebKitGTK 的精简化浏览器,它拥有的功能不算很多,下面是一些功能要点: +考虑到 Tangram 是一个基于 WebKitGTK 的精简化浏览器,它拥有的功能不算很多,下面是一些功能要点: - * 重新排列的侧边栏选项卡 - * 方便地添加任何一个 Web 服务作为一个 Web 应用程序 - * 在桌面端和移动端调整用户代理(User Agent) + * 重新排列侧边栏的标签 + * 方便地将任何一个 Web 服务添加为 Web 应用程序 + * 调整用户代理(桌面端和移动端) * 使用键盘快捷键 - * 改变侧边栏和选项卡的位置 + * 改变侧边栏(标签栏)的位置 - -你所需要做的就是加载一个 Web 服务,登陆,然后点击**“完成”**,将其添加为 Web 应用程序。 +你所需要做的就是加载一个 Web 服务,登录,然后点击“完成”,将其添加为 Web 应用程序。 ![][6] @@ -63,9 +62,9 @@ flatpak install flathub re.sonny.Tangram 想要了解更多信息,请访问 [Tangram 的 Github 页面][9]。 -[Tangram Browser][10] +- [Tangram Browser][10] -你试过 Tangram 吗?你更喜欢 Web 应用还是本地应用?欢迎在下面的评论中分享你的想法。 +你试过 Tangram 吗?你更喜欢 Web 应用还是原生应用?欢迎在下面的评论中分享你的想法。 -------------------------------------------------------------------------------- @@ -74,7 +73,7 @@ via: https://itsfoss.com/tangram/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[anine09](https://github.com/anine09) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b5b7160b5b949467559249539264edc1922afbcc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Sep 2021 11:04:32 +0800 Subject: [PATCH 0351/1588] PUB @anine09 https://linux.cn/article-13777-1.html --- ...907 Run Web Applications in Linux Using Tangram Browser.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210907 Run Web Applications in Linux Using Tangram Browser.md (98%) diff --git a/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md b/published/20210907 Run Web Applications in Linux Using Tangram Browser.md similarity index 98% rename from translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md rename to published/20210907 Run Web Applications in Linux Using Tangram Browser.md index 4f034c0beb..3d22db8010 100644 --- a/translated/tech/20210907 Run Web Applications in Linux Using Tangram Browser.md +++ b/published/20210907 Run Web Applications in Linux Using Tangram Browser.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "anine09" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13777-1.html" 使用 Tangram 浏览器在 Linux 中运行 Web 应用 ======= From 2d6c9cbabdebb32f83d692b6cfc0a77d914dd397 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 12 Sep 2021 23:52:14 +0800 Subject: [PATCH 0352/1588] PRF&PUB @geekpi https://linux.cn/article-13779-1.html --- ...Resize an image from the Linux terminal.md | 34 ++++++++----------- 1 file changed, 15 insertions(+), 19 deletions(-) rename {translated/tech => published}/20210906 Resize an image from the Linux terminal.md (67%) diff --git a/translated/tech/20210906 Resize an image from the Linux terminal.md b/published/20210906 Resize an image from the Linux terminal.md similarity index 67% rename from translated/tech/20210906 Resize an image from the Linux terminal.md rename to published/20210906 Resize an image from the Linux terminal.md index 9672eda344..c3438f6d0e 100644 --- a/translated/tech/20210906 Resize an image from the Linux terminal.md +++ b/published/20210906 Resize an image from the Linux terminal.md @@ -3,62 +3,58 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13779-1.html" -从 Linux 终端调整图像的大小 +在 Linux 终端调整图像的大小 ====== -用 ImageMagick 的转换命令从你的终端收缩一张图像。 -![Old camera blue][1] + +> 用 ImageMagick 的转换命令从你的终端缩放一张图像。 + +![](https://img.linux.net.cn/data/attachment/album/202109/12/235041ohsppv1hg1m26y1m.jpg) ImageMagick 是一个方便的多用途命令行工具,它能满足你所有的图像需求。ImageMagick 支持各种图像类型,包括 JPG 照片和 PNG 图形。 ### 调整图像大小 -我经常在我的网络服务器上使用 ImageMagick 来调整图像大小。例如,假设我想在我的个人网站上发一张我的猫的照片。我手机里的照片非常大,大约 4000x3000 像素,有 3.3MB。这对一个网页来说太大了。我使用 ImageMagick 转换工具来改变照片的大小,这样我就可以把它放在我的网页上。ImageMagick 是一套完整的工具,其中最常用的是 `convert` 命令。 +我经常在我的 Web 服务器上使用 ImageMagick 来调整图像大小。例如,假设我想在我的个人网站上发一张我的猫的照片。我手机里的照片非常大,大约 4000x3000 像素,有 3.3MB。这对一个网页来说太大了。我使用 ImageMagick 转换工具来改变照片的大小,这样我就可以把它放在我的网页上。ImageMagick 是一套完整的工具,其中最常用的是 `convert` 命令。 ImageMagick 的 `convert` 命令使用这样的一般语法: - ``` -`convert {input} {actions} {output}` +convert {input} {actions} {output} ``` 要将一张名为 `PXL_20210413_015045733.jpg` 的照片调整到一个更容易管理的 500 像素宽度,请输入: - ``` -`$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg` +$ convert PXL_20210413_015045733.jpg -resize 500x sleeping-cats.jpg ``` 现在新图片的大小只有 65KB。 ![Sleeping cats][2] -Jim Hall,[CC BY-SA 4.0][3] - 你可以用 `-resize` 选项同时提供宽度和高度尺寸。但是,如果只提供宽度,ImageMagic 就会为你做计算,并通过调整输出图像的高度比例来自动保留长宽比。 ### 在 Linux 上安装 ImageMagick 在 Linux 上,你可以使用你的包管理器安装 ImageMagick。例如,在 Fedora 或类似系统上: - ``` -`$ sudo dnf install imagemagick` +$ sudo dnf install imagemagick ``` 在 Debian 和类似系统上: - ``` -`$ sudo apt install imagemagick` +$ sudo apt install imagemagick ``` 在 macOS 上,使用 [MacPorts][4] 或 [Homebrew][5]。 -在 Windows 上,使用 [Chocolatey][6]。 +在 Windows 上,使用 [Chocolatey][6] 即可。 -------------------------------------------------------------------------------- @@ -67,7 +63,7 @@ via: https://opensource.com/article/21/9/resize-image-linux 作者:[Jim Hall][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 e11c30b56c2858a33419c68af5c737e522350ec7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 13 Sep 2021 05:02:35 +0800 Subject: [PATCH 0353/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210912?= =?UTF-8?q?=20What=20I=20miss=20about=20open=20source=20conferences?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210912 What I miss about open source conferences.md --- ...at I miss about open source conferences.md | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 sources/tech/20210912 What I miss about open source conferences.md diff --git a/sources/tech/20210912 What I miss about open source conferences.md b/sources/tech/20210912 What I miss about open source conferences.md new file mode 100644 index 0000000000..44fafd03ba --- /dev/null +++ b/sources/tech/20210912 What I miss about open source conferences.md @@ -0,0 +1,45 @@ +[#]: subject: "What I miss about open source conferences" +[#]: via: "https://opensource.com/article/21/9/why-i-miss-conferences" +[#]: author: "Mike Bursell https://opensource.com/users/mikecamel" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What I miss about open source conferences +====== +I can buy my own t-shirts, but friendships need nurturing. +![Stickers from all different open source projects and communities][1] + +A typical work year would involve my attending maybe six to eight conferences in person and speaking at quite a few of them. A few years ago, I stopped raiding random booths at the exhibitions usually associated with these for t-shirts for the simple reason that I had too many of them. That's not to say that I wouldn't accept one here or there if it was particularly nice, or an open source project which I esteemed particularly, for instance. Or ones which I thought my kids would like—they're not "cool" but are at least useful for sleepwear, apparently. I also picked up a lot of pens and enough notebooks to keep me going for a while. + +And then, at the beginning of 2020, the pandemic hit, I left San Francisco, where I'd been attending meetings co-located with RSA North America (my employer at the time made the somewhat prescient decision not to allow us to go to the main conference), and I've not attended any in-person conferences since. + +There are some good things about this, the most obvious being less travel, though, of late, my family has been dropping an increasing number of not-so-subtle hints about how it would be good if I let them alone for a few days so they can eat food I don't like (pizza and macaroni cheese, mainly) and watch films that I don't enjoy (largely, but not exclusively, romcoms on Disney+). The downsides are manifold. Having to buy my own t-shirts and notebooks, obviously, though it turns out that I'd squirreled away enough pens for the duration. It also turned out that the move to USB-C connectors hadn't sufficiently hit the conference swag industry by the end of 2019 for me to have enough of those to keep me going, so I've had to purchase some of those. That's the silly, minor stuff, though—what about areas where there's real impact? + +Virtual conferences aren't honestly too bad, and the technology has definitely improved over the past few months. I've attended some very good sessions online (and given my share of sessions and panels, whose quality I won't presume to judge), but I've realised that I'm much more likely to attend borderline-interesting talks not on my main list of "must-sees" (some of which turn out to be very valuable) if I've actually traveled to get to a venue. The same goes for attention. I'm much less likely to be checking email, writing emails, and responding to chat messages in an in-person conference than a virtual one. It's partly about the venue, moving between rooms, and not bothering to get my laptop out all the time—not to mention the politeness factor of giving your attention to the speaker(s) or panellists. When I'm sitting at my desk at home, none of these is relevant, and the pull of the laptop (which is open anyway to watch the session) is generally irresistible. + +Two areas that have really suffered, though, are the booth experience and the "hallway track." I've had some very fruitful conversations, both from dropping by booths (sometimes mainly for a t-shirt—see above) or from staffing a booth and meeting those who visit. I've yet to attend any virtual conferences where the booth experience has worked, particularly for small projects and organisations. Online chat isn't the same, and the serendipitous aspect of wandering past a booth and seeing something you'd like to talk about is pretty much entirely missing if you have to navigate a set of webpages of menu options with actual intent. + +The hallway track is meeting people outside a conference's main sessions, either people you know already or as conversations spill out of sessions you've been attending. Knots of people asking questions of presenters or panellists can reveal shared interests, opposing but thought-provoking points of view, or just similar approaches to a topic which can lead to valuable professional relationships and even long-term friendships. I'm not a particularly gregarious person—particularly if I'm tired and jetlagged—but I really enjoy catching up with colleagues and friends over a drink or a meal from time to time. While that's often difficult given the distributed nature of the companies and industries I've been involved with, conferences have presented great opportunities to meet up, have a chinwag and discuss the latest tech trends, mergers and acquisitions, and fashion failures of our fellow attendees. This is what I miss most: I can buy my own t-shirts, but friendships need nurturing. And I hope that we can safely start attending conferences again so that I can meet up with friends and share a drink. I just hope I'm not the one making the fashion mistakes (this time). + +* * * + +_This article was originally published on [Alice, Eve, and Bob][2] and is reprinted with the author's permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/why-i-miss-conferences + +作者:[Mike Bursell][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/mikecamel +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/stickers-osdc-lead.png?itok=2RNn132b (Stickers from all different open source projects and communities) +[2]: https://aliceevebob.com/2021/08/24/buying-my-own-t-shirts-or-what-i-miss-about-conferences/ From 0eeb6ee2381052e955dd29942f00835945a331bd Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 13 Sep 2021 09:19:08 +0800 Subject: [PATCH 0354/1588] Rename sources/tech/20210912 What I miss about open source conferences.md to sources/talk/20210912 What I miss about open source conferences.md --- .../20210912 What I miss about open source conferences.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210912 What I miss about open source conferences.md (100%) diff --git a/sources/tech/20210912 What I miss about open source conferences.md b/sources/talk/20210912 What I miss about open source conferences.md similarity index 100% rename from sources/tech/20210912 What I miss about open source conferences.md rename to sources/talk/20210912 What I miss about open source conferences.md From b82d01f8c025d49a59889c793665c1e51db6eeeb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Sep 2021 10:16:31 +0800 Subject: [PATCH 0355/1588] APL --- ... Firefox is Seeing a Continuous Decline for Last 12 Years.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md b/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md index 075a2b3b16..bea8d5d1d4 100644 --- a/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md +++ b/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/firefox-continuous-decline/" [#]: author: "Community https://news.itsfoss.com/author/team/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From dc200d4cdf189114f2cb9e92dd0682ae4b22f75e Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 Sep 2021 11:19:08 +0800 Subject: [PATCH 0356/1588] translated --- ... a web page error from the command line.md | 62 +++++++++---------- 1 file changed, 31 insertions(+), 31 deletions(-) rename {sources => translated}/tech/20210908 Debug a web page error from the command line.md (55%) diff --git a/sources/tech/20210908 Debug a web page error from the command line.md b/translated/tech/20210908 Debug a web page error from the command line.md similarity index 55% rename from sources/tech/20210908 Debug a web page error from the command line.md rename to translated/tech/20210908 Debug a web page error from the command line.md index a933c507b2..71b060dc93 100644 --- a/sources/tech/20210908 Debug a web page error from the command line.md +++ b/translated/tech/20210908 Debug a web page error from the command line.md @@ -7,67 +7,67 @@ [#]: publisher: " " [#]: url: " " -Debug a web page error from the command line +从命令行调试网页错误 ====== -One way to debug a web server is by using the wget command-line program. +调试网络服务器的一种方法是使用 wget 命令行程序。 ![Digital creative of a browser on the internet][1] -Sometimes when managing a website, things can get messed up. You might remove some stale content and replace it with a redirect to other pages. Later, after making other changes, you find some web pages become entirely inaccessible. You might see an error in your browser that "The page isn't redirecting properly" with a suggestion to check your cookies. +有时在管理一个网站时,事情会被搞得一团糟。你可能会删除一些陈旧的内容,用重定向到其他页面来代替。后来,在做了其他改动后,你发现一些网页变得完全无法访问了。你可能会在浏览器中看到一个错误:“该页面没有正确重定向”,并建议你检查你的 cookies。 ![Redirect loop example in Firefox][2] -Screenshot by Jim Hall, [CC-BY SA 4.0][3] +Screenshot by Jim Hall,[CC-BY SA 4.0][3] -One way to debug this situation is by using the `wget` command-line program, with the `-S` option to show all server responses. When using `wget` for debugging, I also prefer to save the output to some temporary file, using the `-O` option, in case I need to view its contents later. +调试这种情况的一个方法是使用 `wget` 命令行程序,使用 `-S` 选项来显示所有的服务器响应。当使用 `wget` 进行调试时,我也喜欢使用 `-O` 选项将输出保存到一些临时文件中,以备以后需要查看其内容。 ``` $ wget -O /tmp/test.html -S -\--2021-08-24 17:09:49--   +\--2021-08-24 17:09:49-- Connecting to 10.0.0.11:80... connected. -HTTP request sent, awaiting response...  -  +HTTP request sent, awaiting response... + HTTP/1.1 302 Found -  + Date: Tue, 24 Aug 2021 22:09:49 GMT -  + Server: Apache/2.4.48 (Fedora) -  + X-Powered-By: PHP/7.4.21 -  + Location: -  + Content-Length: 0 -  + Keep-Alive: timeout=5, max=100 -  + Connection: Keep-Alive -  + Content-Type: text/html; charset=UTF-8 Location: [following] -\--2021-08-24 17:09:49--   +\--2021-08-24 17:09:49-- Reusing existing connection to 10.0.0.11:80. -HTTP request sent, awaiting response...  -  +HTTP request sent, awaiting response... + HTTP/1.1 302 Found -  + Date: Tue, 24 Aug 2021 22:09:49 GMT -  + Server: Apache/2.4.48 (Fedora) -  + X-Powered-By: PHP/7.4.21 -  + Location: -  + Content-Length: 0 -  + Keep-Alive: timeout=5, max=99 -  + Connection: Keep-Alive -  + Content-Type: text/html; charset=UTF-8 Location: [following] -\--2021-08-24 17:09:49--   +\--2021-08-24 17:09:49-- Reusing existing connection to 10.0.0.11:80. . . @@ -75,7 +75,7 @@ Reusing existing connection to 10.0.0.11:80. 20 redirections exceeded. ``` -I've omitted a lot of repetition in this output. By reading the server responses, you can see that `http ://10.0.0.11/announce/` redirects immediately to `http ://10.0.0.11/assets/`, which then redirects back to `http ://10.0.0.11/announce/`. And so on. This is an endless loop and `wget` will exit after 20 redirections. But armed with this debugging information, you can fix the redirects and avoid the loop. +我在这个输出中省略了很多重复的内容。通过阅读服务器的响应,你可以看到 `http://10.0.0.11/announce/` 立即重定向到 `http://10.0.0.11/assets/`,然后又重定向到 `http://10.0.0.11/announce/`。以此类推。这是一个无休止的循环,`wget` 将在 20 次重定向后退出。但有了这些调试信息,你可以修复重定向,避免循环。 -------------------------------------------------------------------------------- @@ -83,7 +83,7 @@ via: https://opensource.com/article/21/9/wget-debug-web-server 作者:[Jim Hall][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/) 荣誉推出 @@ -92,4 +92,4 @@ via: https://opensource.com/article/21/9/wget-debug-web-server [b]: https://github.com/lujun9972 [1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_web_internet_website.png?itok=g5B_Bw62 (Digital creative of a browser on the internet) [2]: https://opensource.com/sites/default/files/uploads/firefox-redirect-loop.png (Redirect loop example in Firefox) -[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[3]: https://creativecommons.org/licenses/by-sa/4.0/ \ No newline at end of file From bcf15ba81fa786376fccacd368399d9af85a34ac Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 13 Sep 2021 11:24:00 +0800 Subject: [PATCH 0357/1588] translating --- ...ilding an open source community health analytics platform.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210910 Building an open source community health analytics platform.md b/sources/tech/20210910 Building an open source community health analytics platform.md index 39c5a3c5eb..d512103802 100644 --- a/sources/tech/20210910 Building an open source community health analytics platform.md +++ b/sources/tech/20210910 Building an open source community health analytics platform.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/openrit-mystic" [#]: author: "Quinn Foster https://opensource.com/users/quinn-foster" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 8f48a3d7345bc9b41e736b9d3a399c8041a92723 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 13 Sep 2021 12:38:04 +0800 Subject: [PATCH 0358/1588] TSL&PRF --- ... a Continuous Decline for Last 12 Years.md | 87 ------------------- ... a Continuous Decline for Last 12 Years.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 87 deletions(-) delete mode 100644 sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md create mode 100644 translated/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md diff --git a/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md b/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md deleted file mode 100644 index bea8d5d1d4..0000000000 --- a/sources/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: subject: "Here’s Why Firefox is Seeing a Continuous Decline for Last 12 Years" -[#]: via: "https://news.itsfoss.com/firefox-continuous-decline/" -[#]: author: "Community https://news.itsfoss.com/author/team/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Here’s Why Firefox is Seeing a Continuous Decline for Last 12 Years -====== - -There has been a lot of discussion lately about the decline of the Firefox browser and numerous articles about it [losing 50 Million users in the last two years][1]. - -But the _**real decline has been over 12 years with a total loss of half a Billion users**_ and 75% of the market share it once held. - -It all started in 2009 Q3 with the fateful decision to force… - -### Tabs-On-Top - -As soon as [this decision was made][2], Firefox starting losing market share. Every other program on a PC uses tabs against the active window. Proprietary software like MS Office and Adobe, FOSS software like Notepad++ and GIMP, 3D design, video editors, hex editors, you name it: It is the standard, logical design. - -Then Google decided to make the tabs on top standard for its Chrome browser, which was designed for mobile devices not desktops. On a smartphone it may make sense, as there isn’t room for a full desktop style menu layout. On a desktop it is counterintuitive and breaks workflow with all other programs. The code for desktops is different from phones so there was no rational reason to try and force a mobile UI onto desktop users who were Firefox’s primary userbase. The argument that it was “too hard to maintain” a single setting enacted by 2 lines of code in a 4 Million line codebase is just insulting to the intelligence of users. Code isn’t a lawn. It doesn’t change if you leave it alone for a few weeks. - -When inundated with user complaints about the change, the response I received from a lead developer who shall remain nameless was “We have hundreds of millions of users. 5000 people complaining doesn’t represent the majority of users”. Those complaints had one common sentiment, “If I wanted my browser to look like Chrome I’d just use Chrome”. And so they did. - -### Constant removal of features “that no-one uses” - -Every change made to Firefox had the same pattern. The default feature was changed, but there was a menu setting to revert it. Then the menu setting was removed and you could only change it via about:config. Then the about:config option was removed. Every protest from the userbase met the same response “You’re just a tiny minority, most people like the change”. - -75% is not a minority. Almost everyone hated the changes and each change pushed more users away, and the arrogant, condescending responses from Mozilla staff left a bitter taste in their mouth ensuring they would never return. Looking closely at the user numbers you could see a visible drop with every removal, only stabilising when a third party add-on or CSS would revert the change. Over and over, year after year. No lessons were learnt. - -Removing settings wasn’t enough. Firefox went on to neuter add-ons and themes, forcing centralised signing and ultimately deprecating XUL without adequate webextension api’s to replace lost functionality. Complaining about this change I again spoke to one of the lead developers (same guy). His response was (exact quote) “People don’t use Firefox because of add-ons. Our telemetry shows 80% of users never install any add-ons” i.e. the telemetry that any tech savvy person immediately turns off because they don’t want their browser spying on them and about which we have also complained numerous times. - -Even the one great move they made in UI design, the drag and drop customisable Australis interface, alienated more users because of the horrible default layout and lack of options that didn’t need CSS. The awful angled tabs (copied from chrome) is the only UI change Mozilla has admitted was terrible and they only did so, surprise surpise, AFTER chrome did away with them. - -To this day, Mozilla still claims to want to hear from their users and after 12 years they still keep ignoring us, the awful default Proton UI being the latest foolish choice forced upon an unwilling userbase. (Type in “Firefox Proton” on Google to look at the most commonly searched suggestions if you think I’m in the minority). Fortunately it can still be mostly fixed with userChrome.css but even I’m getting sick of having to repeatedly patch together new code to keep up with constant deprecation and format changes.   - -### Bad coding paradigms - -Mozilla’s source code is a nightmare. For example, default profile location is defined 3 times, using different variables, in 3 different languages, one of which is generated by combining multiple variables located in separate files. Another example I saw was another global variable being defined in 6 different files. - -Post compiling, history for downloads, visited pages, bookmarks etc, are all shoved together into obfuscated files. The end result? Try deleting 400 entries from your history and watch how long it takes. Deleting that many lines from a separate text file would take a split second. Want to change the appearance of an icon or add a new one for a custom search? They’re mostly just PNGs, but they are obfuscated and sealed into the omni.ja file. Could otherwise be changed in seconds with your editor of choice, instead you need to install and learn a program like Eclipse and recompile the file with every change. The list goes on and on. - -It is no wonder Mozilla’s coders have such trouble finding and fixing bugs. This led to an even worse coding paradigm, logging everything for the purpose of bugfixes. This is one of the culprits of… - -### Poor memory management - -If a program is sitting there doing nothing, its memory usage should not change. Looking at my memory manager I have 40 processes obeying this principle. What is the only program constantly reading and writing to disk despite doing nothing? Firefox. It is running 13 processes and all of them are constantly doing both. I’ve been coding for 40 years and building PC’s for 30 so I do know a thing or two about how computing works. This is just awful design at the base level and no amount of tinkering on the surface will fix that. - -The code paradigm is the root of Mozilla’s performance issues and they won’t address it. I’ll wager that’s also the reason for the failure of FirefoxOS, which was a great idea but failed because of poor execution and coding practices resulting in too many bugs to fix.   - -### Invading your privacy at the same time as telling us “we value your privacy” - -Telemetry. Hidden telemetry that isn’t disabled when you click “disable telemetry”. Firstrun pings. Forced signing of add-ons. Auto-updates you can’t switch off, pinging every 10 minutes. “Experiments” which require a separate opt out. Now the latest offence is enforcing app based 2FA to login to a Firefox Add-on account just to make a custom theme, which you wouldn’t need in the first place if not for forced add-on signing. - -Mozilla has as little respect for their users privacy as they do for our opinions. - -### Final thoughts - -It didn’t have to be this way. It still doesn’t, but the mind that is incapable of admitting when it is wrong, or of considering differing opinions is doomed to stagnation and decay. The decision makers of Mozilla appear to have such minds so I do not hold out much hope for the future. Hopefully some of you out there can at least learn from their mistakes and succeed where they are failing. You succeed by giving users what they want, not telling them what they should want. By providing what is missing in the market, not blindly trying to copy your competitors. - -_The views and opinions expressed are those of the authors and do not necessarily reflect the official policy or position of It’s FOSS._ - -Author info: From Melbourne Australia, Dan has been coding for about 40 years and doing graphic design for 25 years. He also works on open source mechanical designs based on 3D printer kits. - -#### 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/firefox-continuous-decline/ - -作者:[Community][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/team/ -[b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/firefox-decline/ -[2]: https://www.wired.com/2009/07/mozilla-considers-copying-chrome-for-firefox-4dot0/ diff --git a/translated/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md b/translated/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md new file mode 100644 index 0000000000..b128403f01 --- /dev/null +++ b/translated/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md @@ -0,0 +1,84 @@ +[#]: subject: "Here’s Why Firefox is Seeing a Continuous Decline for Last 12 Years" +[#]: via: "https://news.itsfoss.com/firefox-continuous-decline/" +[#]: author: "Community https://news.itsfoss.com/author/team/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Firefox 在过去 12 年里损失了 5 亿用户及其 75% 份额的原因 +====== + +> 一位有四十年编程经验的老程序员表达了他对 Firefox 浏览器为何逐渐衰退的看法。 + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/decline.png?w=1200&ssl=1) + +最近有很多关于 Firefox 浏览器衰落的讨论,还有很多讨论 [它在过去两年里失去了 5000 万用户][1] 的文章。 + +但是 **实际上它的衰落已经有 12 年之久了,总共损失了 5 亿用户和它曾经拥有的市场份额的 75%**。 + +这一切都开始于 2009 年第三季度,其致命的决定是强迫…… + +### 顶部标签 + +自从 [做了这个决定][2],Firefox 就开始丢失市场份额。PC 上的所有程序都使用针对活动窗口的标签。如微软 Office 和 Adobe 这样的专有软件,如 GIMP、3D 设计、视频编辑器、十六进制编辑器这样的 FOSS 软件,你能想的的种种软件都是这样的,这是标准的、合乎逻辑的设计。 + +然后,谷歌决定将标签放在其 Chrome 浏览器的顶部,该浏览器是为移动设备而非台式机设计的。在智能手机上,这可能是有意义的,因为没有空间来容纳一个完整的桌面风格的菜单布局。但在桌面上,它是反直觉的,并且会破坏与所有其他程序的工作流程。台式机的代码与手机不同,所以没有合理的理由试图将移动用户界面强加给台式机用户,而台式机是 Firefox 的主要用户群。在一个 400 万行的代码库中,由两行代码所制定的单一设置“太难维护”的论点,只是在侮辱用户的智商。代码不是草坪,如果你几周不管它,它也不会改变。 + +当用户对这一变化的投诉蜂拥而至时,我从一位不愿透露姓名的主要开发者那里得到的回应是:“我们有数亿用户。5000 人的抱怨并不代表大多数的用户。”这些投诉有一个共同的观点:“如果我想让我的浏览器看起来像 Chrome,我就会使用 Chrome。”于是他们就这么做了。 + +### 不断删除“没人使用”的功能 + +对 Firefox 所做的每项改动都是一样的做法。默认功能被改变了,但有一个菜单设置可以恢复它。然后菜单设置被删除,你只能通过`about:config` 来改变它。再然后,`about:config` 选项也被删除了。用户群的每一次抗议都得到了同样的回应:“你只是极少数人,大多数人喜欢这种改变。” + +75% 并不是少数人。几乎每个人都讨厌这些变化,每一次变化都会把更多的用户赶走,而 Mozilla 工作人员傲慢的、居高临下的回应让用户们有苦难言,让他们再也不想回来了。仔细观察,你可以看到每次删除一些功能,用户数量都有明显的下降,只有在第三方组件或 CSS 恢复了这些变化时才会稳定下来。一次又一次,年复一年。他们没有学到任何教训。 + +光是移除设置还不够。Firefox 继续阉割附加组件和主题,强迫集中签名,并最终废除了 XUL,而没有足够的 Web 扩展 API 来替代失去的功能。在抱怨这一变化时,我再次与一位主要开发者(同一个人)交谈。他的回答是(原话)“人们并不是因为附加组件而使用 Firefox 的。我们的遥测显示 80% 的用户从未安装过任何附加组件。”也就是说,任何懂技术的人都会立即关闭遥测,因为他们不想让浏览器监视他们,对此我们也曾无数次抱怨过。 + +即使是他们在用户界面设计方面的一项重大举措,即可拖放定制的 Australis 界面,也因为可怕的默认布局和缺乏不需要 CSS 的选项而疏远了更多用户。难看的斜角标签(抄袭自 Chrome)是 Mozilla 唯一承认糟糕的用户界面变化,而且令人惊讶的是,他们只是在 Chrome 取消了斜角标签 **之后** 才这样做。 + +时至今日,Mozilla 仍然声称要听取用户的意见,但 12 年后,他们仍然无视我们,难看的默认 Proton 用户界面是最新强加给不情愿的用户群的愚蠢选择。(如果你认为我属于少数的话,可以在谷歌上输入 “Firefox Proton” 来查看最常搜索的建议。)幸运的是,它仍然可以用 `userChrome.css` 来大致修复,但即使是我,也已经厌倦了必须反复修补新的代码来跟上不断的弃用和格式变化。  + +### 糟糕的编码范式 + +Mozilla 的源代码是一场噩梦。例如,默认配置文件的位置被定义了 3 次,使用了 3 种不同的语言的不同的变量,其中之一是由位于不同文件中的多个变量组合生成的。我看到的另外一个例子是在 6 个不同的文件中定义的另一个全局变量。 + +在编译后,下载历史、访问过的网页、书签等等,都被一起塞进了乱七八糟的文件中。最终的结果是什么?试着从你的历史记录中删除 400 个条目,看看它需要多长时间。而从一个单独的文本文件中删除这么多行,只需要一瞬间。想改变一个图标的外观或为自定义搜索添加一个新的图标?它们大多只是 PNG,但它们被混淆并被封入 `omni.ja` 文件。本来可以用你选择的编辑器在几秒钟内改变,但你需要安装和学习 Eclipse 之类的程序,并在每次更改时重新编译文件。这样的例子不胜枚举。 + +难怪 Mozilla 的码农在寻找和修复错误方面这么困难。这导致了更糟糕的编码范式,为了修复错误而记录一切。它部分导致了... + +### 糟糕的内存管理 + +如果一个程序坐在那里什么都不做,它的内存使用量不应该改变。看看我的内存管理器,我有 40 个进程在遵守这个原则。尽管什么都不做,却不断地读写磁盘的唯一程序是什么?Firefox。它正在运行 13 个进程,所有这些进程都在不断地做这两件事。我写了 40 年的代码,造了 30 年的电脑,所以我确实了解一点计算机如何工作的事情。这就是基础层面上的糟糕设计,在表面上做再多的修补也无济于事。 + +代码范式是 Mozilla 性能问题的根源,他们不会解决这个问题。我敢打赌,这也是 FirefoxOS 失败的原因,它是一个伟大的想法,但由于执行不力和编码实践问题,导致太多的错误无法修复而失败。  +### 在告诉我们“我们重视你的隐私”的同时,侵犯了你的隐私 + +就是遥测。当你点击“禁用遥测”时,隐藏的遥测并没有被禁用。首次运行也要发出遥测信号。强制签署附加组件。无法关闭的自动更新,每 10 分钟发出一次信号。需要单独选择退出的“实验”。现在最新的问题是,只是为了制作一个自定义的主题,就强制使用基于 2FA 的应用以登录到 Firefox 插件帐户,如果不是强制签署附加组件,根本就不需要。 + +Mozilla 对用户隐私的尊重和对我们意见的尊重一样少。 + +### 总结 + +事情不一定是这样的。虽然还没有,但是不能承认自己的错误,也不考虑不同的意见的人,注定要停滞不前,走向衰败。Mozilla 的决策者似乎就是这样想的,所以我对未来不抱什么希望。希望你们中的一些人至少能从他们的错误中学习,在他们失败的地方取得成功。通过为用户提供他们想要的东西,而不是告诉他们应该想要什么来取得成功。通过提供市场上缺少的东西,而不是盲目地试图复制你的竞争对手。 + +*本文所表达的观点和意见仅代表作者本人,不一定反映本站和 It's FOSS 的官方政策或立场。* + +> 作者信息:Dan 来自澳大利亚墨尔本,已经有大约 40 年的编码经验,做了 25 年的平面设计。他还从事基于 3D 打印机套件的开源机械设计。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/firefox-continuous-decline/ + +作者:[Community][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/team/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/firefox-decline/ +[2]: https://www.wired.com/2009/07/mozilla-considers-copying-chrome-for-firefox-4dot0/ From e32de09a113a782f863eec5f4e2b9b11cb0aef34 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Mon, 13 Sep 2021 15:13:51 +0800 Subject: [PATCH 0359/1588] translated --- ...rithms are slow (and hashmaps are fast).md | 257 ------------------ ...rithms are slow (and hashmaps are fast).md | 251 +++++++++++++++++ 2 files changed, 251 insertions(+), 257 deletions(-) delete mode 100644 sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md create mode 100644 translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md diff --git a/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md b/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md deleted file mode 100644 index 9034e42d7f..0000000000 --- a/sources/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md +++ /dev/null @@ -1,257 +0,0 @@ -[#]: subject: "Quadratic algorithms are slow (and hashmaps are fast)" -[#]: via: "https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/" -[#]: author: "Julia Evans https://jvns.ca/" -[#]: collector: "lujun9972" -[#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Quadratic algorithms are slow (and hashmaps are fast) -====== - -Hello! I was talking to a friend yesterday who was studying for a programming interview and trying to learn some algorithms basics. - -The topic of quadratic-time vs linear-time algorithms came up, I thought this would be fun to write about here because avoiding quadratic-time algorithms isn’t just important in interviews – it’s sometimes good to know about in real life too! I’ll explain what a “quadratic-time algorithm is” in a minute :) - -here are the 3 things we’ll talk about: - - 1. quadratic time functions are WAY WAY WAY slower than linear time functions - 2. sometimes you can make a quadratic algorithm into a linear algorithm by using a hashmap - 3. this is because hashmaps lookups are very fast (instant!) - - - -I’m going to try to keep the math jargon to a minimum and focus on real code examples and how fast/slow they are. - -### our problem: intersect two lists - -Let’s talk about a simple interview-style problem: getting the intersection of 2 lists of numbers. For example, `intersect([1,2,3], [2,4,5])` should return `[2]`. - -This problem is also somewhat realistic – you could imagine having a real program where you need to take the intersection of 2 lists of IDs. - -### the “obvious” solution: - -Let’s write some code to take the intersection of 2 lists. Here’s a program that does it, called `quadratic.py`. - -``` -import sys - -# the actual code -def intersection(list1, list2): - result = [] - for x in list1: - for y in list2: - if x == y: - result.append(y) - return result - -# some boilerplate so that we can run it from the command line on lists of -# different sizes -def run(n): - # make 2 lists of n+1 elements - list1 = list(range(3, n)) + [2] - list2 = list(range(n+1, 2*n)) + [2] - # intersect them and print out the result - print(list(intersection(list1, list2))) - -# Run with the program's first command line argument -run(int(sys.argv[1])) -``` - -The reason it’s called `quadratic.py` is that if `list1` and `list2` have size `n`, then the inner loop (`if x == y`) will run `n^2` times. And in math, functions like `x^2` are called “quadratic” functions. - -### how slow is `quadratic.py`? - -Let’s run this program with a bunch of lists of different lengths. The intersection of the two lists is always the same: `[2]`. - -``` -$ time python3 quadratic.py 10 -[2] - -real 0m0.037s -$ time python3 quadratic.py 100 -[2] - -real 0m0.053s -$ time python3 quadratic.py 1000 -[2] - -real 0m0.051s -$ time python3 quadratic.py 10000 # 10,000 -[2] - -real 0m1.661s -``` - -So far none of this is too bad – it’s still taking less than 2 seconds. - -Then I ran it on two lists with 100,000 elements, and I had to wait a LONG time. Here’s the result: - -``` -$ time python3 quadratic.py 100000 # 100,000 -[2] - -real 2m41.059s -``` - -This is very slow! It’s 160 seconds, which is almost exactly 100x longer than it did to run on 10,000 elements (which was 1.6 seconds). So we can see that after a certain point, every time we make the list 10x bigger, the program takes about 100x longer to run. - -I didn’t try to run this program on 1,000,000 elements, because I knew it would take 100x longer again – probably about 3 hours. I don’t have time for that! - -You can probably see now why quadratic time algorithms can be a problem – even this very simple program starts getting very slow pretty quickly. - -### let’s write a fast version: `linear.py` - -Okay, so let’s write a fast version of the program. First I’ll show you the program, then I’ll explain it. - -``` -import sys - -# the actual algorithm -def intersection(list1, list2): - set1 = set(list1) # this is a hash set - result = [] - for y in list2: - if y in set1: - result.append(y) - return result - -# some boilerplate so that we can run it from the command line on lists of -# different sizes -def run(n): - # make 2 lists of n+1 elements - list1 = range(3, n) + [2] - list2 = range(n+1, 2*n) + [2] - # print out the intersection - print(intersection(list1, list2)) - -run(int(sys.argv[1])) -``` - -(this isn’t the most idiomatic Python, but I wanted to write it without using too many python-isms so that people who don’t know Python could understand it more easily) - -We’ve done 2 things differently here than our slow program: - - 1. convert `list1` into a set called `set1` - 2. only use one for loop instead of two for loops - - - -### let’s see how fast this `linear.py` program is - -Before we talk about _why_ this program is fast, let’s first prove that it’s fast by running it on some big lists. Here it is running on lists of size 10 to 10,000,000. (remember that our original program started getting SUPER slow when run on 100,000 elements) - -``` -$ time python3 linear.py 100 -[2] - -real 0m0.056s -$ time python3 linear.py 1000 -[2] - -real 0m0.036s -$ time python3 linear.py 10000 # 10,000 -[2] - -real 0m0.028s -$ time python3 linear.py 100000 # 100,000 -[2] - -real 0m0.048s <-- quadratic.py took 2 minutes in this case! we're doing it in 0.04 seconds now!!! so fast! -$ time python3 linear.py 1000000 # 1,000,000 -[2] - -real 0m0.178s -$ time python3 linear.py 10000000 # 10,000,000 -[2] - -real 0m1.560s -``` - -### running `linear.py` on an extremely big list - -If we try to run it on a very very big list (10 billion / 10,000,000,000 elements), then actually we run into a different problem: it’s _fast_ enough (that list is only 100x bigger than the list that took 4.2 seconds, so we could probably do it in 420 seconds), but my computer doesn’t have enough memory to store all of the elements of the list and so the program crashes before it gets there. - -``` -$ time python3 linear.py 10000000000 -Traceback (most recent call last): - File "/home/bork/work/homepage/linear.py", line 18, in - run(int(sys.argv[1])) - File "/home/bork/work/homepage/linear.py", line 13, in run - list1 = [1] * n + [2] -MemoryError - -real 0m0.090s -user 0m0.034s -sys 0m0.018s -``` - -We’re not talking about memory usage in this blog post though, so let’s ignore that. - -### okay, why is `linear.py` fast? - -Now I’ll try to explain why `linear.py` is fast. - -Here’s the code again: - -``` -def intersection(list1, list2): - set1 = set(list1) # this is a hash set - result = [] - for y in list2: - if y in set1: - result.append(y) - return result -``` - -Let’s say that `list1` and `list2` are both lists of about 10,000,000 different elements. That’s kind of a lot of elements! - -So why is this able to run so fast? HASHMAPS!!! - -### hashmap lookups are instant (“constant time”) - -Let’s look at this if statement from our fast program: - -``` -if y in set1: - result.append(y) -``` - -You might think that this check – `if y in set1` – would be slower if the `set1` contains 10 million elements than it is if `set1` contains 1000 elements. But it’s not! It always takes basically the same amount of time (SUPER FAST), no matter how big `set1` gets. - -This is because `set1` is a hash set, which is a type of hashmap/hashtable which only has keys and no values. - -I’m not going to explain _why_ hashmap lookups are instant in this post, but the amazing Vaidehi Joshi’s [basecs][1] series has explanations of [hash tables][2] and [hash functions][3] which talk about it. - -### accidentally quadratic: real life quadratic algorithms! - -This issue that we saw where quadratic time algorithms are really slow is actually a problem that shows up in real life – Nelson Elhage has a great blog called [accidentally quadratic][4] with stories about performance problems caused by code that accidentally ran in quadratic time. - -### quadratic time algorithms can kind of sneak up on you - -The weird thing about quadratic time algorithms is that when you run them on a small number of elements (like 1000), it doesn’t seem so bad! It’s not that slow! But then if you throw 1,000,000 elements at it, it can really take hours to run. - -So I think it’s worth being broadly aware of them, so you can avoid writing them by accident. Especially if there’s an easy way to write a linear-time algorithm instead (like using a hashmap). - -### hashmaps always feel a little magical to me - -Hashmaps aren’t magic of course (you can learn the math behind why hashmap lookups are instant! it’s cool!), but it always _feels_ a little magical to me, and every time I use hashmaps in a program to speed things up it makes me happy :) - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/ - -作者:[Julia Evans][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://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://medium.com/basecs -[2]: https://medium.com/basecs/taking-hash-tables-off-the-shelf-139cbf4752f0 -[3]: https://medium.com/basecs/hashing-out-hash-functions-ea5dd8beb4dd -[4]: https://accidentallyquadratic.tumblr.com/ diff --git a/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md b/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md new file mode 100644 index 0000000000..a40b88e1a5 --- /dev/null +++ b/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md @@ -0,0 +1,251 @@ +[#]: subject: "Quadratic algorithms are slow (and hashmaps are fast)" +[#]: via: "https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +浅谈慢速的二次算法与快速的 hashmap +====== + +大家好!昨天我与一位正在准备编程面试并努力学习算法基础知识的朋友进行了一些交流。 + +我们聊到了二次时间与线性时间算法的话题,我认为在这里写这篇文章会很有趣,因为避免二次时间算法不仅在面试中很重要——有时在现实生活中了解一下也是很好的!后面我会快速解释一下什么是“二次时间算法” :) + +以下是我们将要讨论的 3 件事: + + 1. 二次时间函数比线性时间函数慢得非常非常多 + 2. 有时可以通过使用 hashmap 把二次算法变成线性算法 + 3. 这是因为 hashmap 查找非常快(即时查询!) + +我会尽量避免使用数学术语,重点关注真实的代码示例以及它们到底有多快/多慢。 + +### 目标问题:取两个列表的交集 + +我们来讨论一个简单的面试式问题:获取 2 个数字列表的交集。 例如,`intersect([1,2,3], [2,4,5])` 应该返回 `[2]`。 + +这个问题也是有些现实应用的——你可以假设有一个真实程序,其需求正是取两个 ID 列表交集。 + +### “显而易见”的解决方案: + +我们来写一些获取 2 个列表交集的代码。下面是一个实现此需求的程序,命名为“quadratic.py”。 + +``` +import sys + +# 实际运行的代码 +def intersection(list1, list2): + result = [] + for x in list1: + for y in list2: + if x == y: + result.append(y) + return result + +# 一些样板,便于我们从命令行运行程序,处理不同大小的列表 +def run(n): + # 定义两个有 n+1 个元素的列表 + list1 = list(range(3, n)) + [2] + list2 = list(range(n+1, 2*n)) + [2] + # 取其交集并输出结果 + print(list(intersection(list1, list2))) + +# 使用第一个命令行参数作为输入,运行程序 +run(int(sys.argv[1])) +``` + +程序名为 `quadratic.py`(LCTT 译注:“quadratic”意为“二次的”)的原因是:如果 `list1` 和 `list2` 的大小为 `n`,那么内层循环(`if x == y`)会运行 `n^2` 次。在数学中,像 `x^2` 这样的函数就称为“二次”函数。 + +### `quadratic.py` 有多慢? + +用一些不同长度的列表来运行这个程序,两个列表的交集总是相同的:`[2]`。 + +``` +$ time python3 quadratic.py 10 +[2] + +real 0m0.037s +$ time python3 quadratic.py 100 +[2] + +real 0m0.053s +$ time python3 quadratic.py 1000 +[2] + +real 0m0.051s +$ time python3 quadratic.py 10000 # 10,000 +[2] + +real 0m1.661s +``` + +到目前为止,一切都还不错——程序仍然只花费不到 2 秒的时间。 + +然后运行该程序处理两个包含 100,000 个元素的列表,我不得不等待了很长时间。结果如下: + +``` +$ time python3 quadratic.py 100000 # 100,000 +[2] + +real 2m41.059s +``` + +这可以说相当慢了!总共花费了 160 秒,几乎是在 10,000 个元素上运行时(1.6 秒)的 100 倍。所以我们可以看到,在某个点之后,每次我们将列表扩大 10 倍,程序运行的时间就会增加大约 100 倍。 + +我没有尝试在 1,000,000 个元素上运行这个程序,因为我知道它会花费又 100 倍的时间——可能大约需要 3 个小时。我没时间这样做! + +你现在大概明白了为什么二次时间算法会成为一个问题——即使是这个非常简单的程序也会很快变得非常缓慢。 + +### 快速版:`linear.py` + +好,接下来我们编写一个快速版的程序。我先给你看看程序的样子,然后再分析。 + +``` +import sys + +# 实际执行的算法 +def intersection(list1, list2): + set1 = set(list1) # this is a hash set + result = [] + for y in list2: + if y in set1: + result.append(y) + return result + +# 一些样板,便于我们从命令行运行程序,处理不同大小的列表 +def run(n): + # 定义两个有 n+1 个元素的列表 + list1 = range(3, n) + [2] + list2 = range(n+1, 2*n) + [2] + # 输出交集结果 + print(intersection(list1, list2)) + +run(int(sys.argv[1])) +``` + +(这不是最惯用的 Python 使用方式,但我想在尽量避免使用太多 Python 思想的前提下编写代码,以便不了解 Python 的人能够更容易理解) + +这里我们做了两件与慢速版程序不同的事: + + 1. 将 `list1` 转换成名为 `set1` 的 set 集合 + 2. 只使用一个 for 循环而不是两个 + +### 看看 `linear.py` 程序有多快 + +在讨论 _为什么_ 这个程序快之前,我们先在一些大型列表上运行该程序,以此证明它确实是很快的。此处演示该程序依次在大小为 10 到 10,000,000 的列表上运行的过程。(请记住,我们上一个的程序在 100,000 个元素上运行时开始变得非常非常慢) + +``` +$ time python3 linear.py 100 +[2] + +real 0m0.056s +$ time python3 linear.py 1000 +[2] + +real 0m0.036s +$ time python3 linear.py 10000 # 10,000 +[2] + +real 0m0.028s +$ time python3 linear.py 100000 # 100,000 +[2] + +real 0m0.048s <-- quadratic.py took 2 minutes in this case! we're doing it in 0.04 seconds now!!! so fast! +$ time python3 linear.py 1000000 # 1,000,000 +[2] + +real 0m0.178s +$ time python3 linear.py 10000000 # 10,000,000 +[2] + +real 0m1.560s +``` + +### 在极大型列表上运行 `linear.py` + +如果我们试着在一个非常非常大的列表(100 亿 / 10,000,000,000 个元素)上运行它,那么实际上会遇到另一个问题:它足够 _快_ 了(该列表仅比花费 4.2 秒的列表大 100 倍,因此我们大概应该能在不超过 420 秒的时间内完成),但我的计算机没有足够的内存来存储列表的所有元素,因此程序在运行结束之前崩溃了。 + +``` +$ time python3 linear.py 10000000000 +Traceback (most recent call last): + File "/home/bork/work/homepage/linear.py", line 18, in + run(int(sys.argv[1])) + File "/home/bork/work/homepage/linear.py", line 13, in run + list1 = [1] * n + [2] +MemoryError + +real 0m0.090s +user 0m0.034s +sys 0m0.018s +``` + +不过本文不讨论内存使用,所以我们可以忽略这个问题。 + +### 那么,为什么 `linear.py` 很快呢? + +现在我将试着解释为什么 `linear.py` 很快。 + +再看一下我们的代码: + +``` +def intersection(list1, list2): + set1 = set(list1) # this is a hash set + result = [] + for y in list2: + if y in set1: + result.append(y) + return result +``` + +假设 `list1` 和 `list2` 都是大约 10,000,000 个不同元素的列表,这样的元素数量可以说是很大了! + +那么为什么它还能够运行得如此之快呢?因为 hashmap!!! + +### hashmap 查找是即时的(“常数级时间”) + +我们看一下快速版程序中的 if 语句: + +``` +if y in set1: + result.append(y) +``` + +你可能会认为如果 `set1` 包含 1000 万个元素,那么这个查找——`if y in set1` 会比 `set1` 包含 1000 个元素时慢。但事实并非如此!无论 `set1` 有多大,所需时间基本是相同的(超级快)。 + +这是因为 `set1` 是一个 hash set 集合,它是一种只有键没有值的 hashmap 或 hashtable 结构。 + +我不准备在本文中解释 _为什么_ hashmap 查找是即时的,但是神奇的 Vaidehi Joshi 的 [basecs][1] 系列中有关于 [hash table][2] 和 [hash 函数][3] 的解释,其中讨论了 hashmap 即时查找的原因。 + +### 不经意的二次方:现实中的二次算法! + +二次时间算法真的很慢,我们看到的的这个问题实际上在现实中也会遇到——Nelson Elhage 有一个很棒的博客,名为 [不经意的二次方][4],其中有关于不经意以二次时间算法运行代码导致性能问题的故事。 + +### 二次时间算法可能会“偷袭”你 + +关于二次时间算法的奇怪之处在于,当你在少量元素(如 1000)上运行它们时,它看起来并没有那么糟糕!没那么慢!但是如果你给它 1,000,000 个元素,它真的会花费几个小时去运行。 + +所以我认为它还是值得深入了解的,这样你就可以避免无意中使用二次时间算法,特别是当有一种简单的方法来编写线性时间算法(例如使用 hashmap)时。 + +### 总是让我感到一丝神奇的 hashmap + +hashmap 当然不是魔法(你可以学习一下为什么 hashmap 查找是即时的!真的很酷!),但它总是让人 _感觉_ 有点神奇,每次我在程序中使用 hashmap 来加速,都会使我感到开心 :) + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/ + +作者:[Julia Evans][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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://medium.com/basecs +[2]: https://medium.com/basecs/taking-hash-tables-off-the-shelf-139cbf4752f0 +[3]: https://medium.com/basecs/hashing-out-hash-functions-ea5dd8beb4dd +[4]: https://accidentallyquadratic.tumblr.com/ From 8fb3435e5c1b43c08e7b70d52a0ebb8f8b5de33c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Sep 2021 05:03:33 +0800 Subject: [PATCH 0360/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210914?= =?UTF-8?q?=20Revolt:=20An=20Open-Source=20Alternative=20to=20Discord?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210914 Revolt- An Open-Source Alternative to Discord.md --- ...- An Open-Source Alternative to Discord.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20210914 Revolt- An Open-Source Alternative to Discord.md diff --git a/sources/tech/20210914 Revolt- An Open-Source Alternative to Discord.md b/sources/tech/20210914 Revolt- An Open-Source Alternative to Discord.md new file mode 100644 index 0000000000..36a33babf8 --- /dev/null +++ b/sources/tech/20210914 Revolt- An Open-Source Alternative to Discord.md @@ -0,0 +1,136 @@ +[#]: subject: "Revolt: An Open-Source Alternative to Discord" +[#]: via: "https://itsfoss.com/revolt/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Revolt: An Open-Source Alternative to Discord +====== + +_**Brief**: Revolt is a promising free and open-source choice to replace Discord. Here, we take a look at what it offers along with its initial impressions._ + +Discord is a feature-rich collaboration platform primarily tailored for gamers. Even though you can use Discord on Linux with no issues, it is still a proprietary solution. + +You can choose to use [Element][1] as an open-source solution collaboration platform, but it is not a replacement. + +But, Revolt is an impressive Discord alternative that is open-source. + +Note + +Revolt is in the public beta testing phase and does not offer any mobile applications. It may lack some essential features that you find on Discord. + +Let me highlight what you can expect with Revolt and if it can be a replacement for Discord on Linux. + +### An Open Source Discord Alternative That You Can Self-Host + +![][2] + +Revolt is not just a simple open-source replacement, but you also get the ability to self-host. + +It does lack a variety of features that Discord offers, but you get a lot of basic functionalities to get a head start to start experimenting. + +Even without some features, you could mention it as a feature-rich open-source client. Let us look at the features available right now. + +### Features of Revolt + +![][3] + +While it looks and feels a lot like Discord already, here are some of the key highlights: + + * Ability to create your own server + * Create text channels and voice channels + * Assign user roles in a server + * Tweak the theme (dark/light) + * Change the accent color + * Manage the font and emoji packs from available options + * Custom CSS support + * Ability to add bots + * Easy to manage permissions for text/voice channels + * Send friend requests to other users + * Saved notes section + * Ability to control notifications + * Hardware acceleration support + * Dedicated desktop settings + * Self-hosting using Docker + * User status and custom status support + + + +So, as something in the public beta testing phase, it sounds excellent for starters. You already get most of the core functionalities, but you may want to wait to see it as a full-fledged Discord replacement. + +### Initial Impressions of Using Revolt + +![][4] + +If you have used Discord, the user experience will feel familiar. And that is a good thing here. + +For this quick app highlight, I did not compare the resource usage of Discord and Revolt because it is still in beta and won’t be an apples-to-apples comparison. + +However, in my brief testing, it felt snappy, except the case when you load up a text channel for the first time. When publishing this, it did not have the Two-Factor Authentication (2FA) feature but was supposed to be added in their first milestone (Version 1) release. + +![][5] + +Some features like user status, permission management, and appearance tweaks looked useful. But, when it comes to the voice channels, it is not the same way as Discord works, at least for now. + +I have no idea if they plan to do it the same way, but Discord’s voice channel feature is intuitive, fast, and with better controls. + +Not to forget, Discord also offers “Discord Stage,” which is a Clubhouse-like audio room feature. + +Some other features that I couldn’t find included: + + * Ability to react to messages + * Noise suppression feature + * Change server + * Server logs + * Variety of useful bots + + + +Of course, it will take a significant amount of time to catch up with the features offered by Discord, but at least we now have an open-source solution to Discord. + +You can explore their [project roadmap/release tracker][6] to see what you can expect in its final/future releases. + +### Install Revolt in Linux + +Revolt is available for Linux and Windows. You can choose to use it on your web browser without needing a separate application. + +But, if you need to have it on your desktop, they offer an AppImage file and a deb package that you can grab from its [GitHub releases section][7]. + +If you’re new to Linux, refer to our resources on [using an AppImage file][8] and [installing deb packages][9] to get started. + +Feel free to head to its [Feedback section][10] if you want to help them improve with your bug reports and suggestions. Also, you can explore their [GitHub page][11] for more information. + +[Revolt][12] + +What do you think about Revolt? Do you believe that it has the potential to become a good open-source replacement to Discord on Linux? + +Let me know your thoughts in the comments down below! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/revolt/ + +作者:[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://itsfoss.com/element/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-screenshot.png?resize=800%2C506&ssl=1 +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-desktop-settings.png?resize=800%2C501&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-screenshot1.png?resize=800%2C509&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/revolt-appearance-setting.png?resize=800%2C524&ssl=1 +[6]: https://github.com/orgs/revoltchat/projects/2 +[7]: https://github.com/revoltchat/desktop/releases/tag/v1.0.2 +[8]: https://itsfoss.com/use-appimage-linux/ +[9]: https://itsfoss.com/install-deb-files-ubuntu/ +[10]: https://app.revolt.chat/settings/feedback +[11]: https://github.com/revoltchat +[12]: https://revolt.chat From 46a5dd96d443ecc8750d1407001cf26f5a93e1e0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Sep 2021 05:03:56 +0800 Subject: [PATCH 0361/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210913?= =?UTF-8?q?=20Replace=20smart=20quotes=20with=20the=20Linux=20sed=20comman?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210913 Replace smart quotes with the Linux sed command.md --- ...smart quotes with the Linux sed command.md | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 sources/tech/20210913 Replace smart quotes with the Linux sed command.md diff --git a/sources/tech/20210913 Replace smart quotes with the Linux sed command.md b/sources/tech/20210913 Replace smart quotes with the Linux sed command.md new file mode 100644 index 0000000000..2c4a999723 --- /dev/null +++ b/sources/tech/20210913 Replace smart quotes with the Linux sed command.md @@ -0,0 +1,83 @@ +[#]: subject: "Replace smart quotes with the Linux sed command" +[#]: via: "https://opensource.com/article/21/9/sed-replace-smart-quotes" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Replace smart quotes with the Linux sed command +====== +Banish "smart" quotes with your favorite version of sed. +![Coding on a computer][1] + +In typography, a pair of quotation marks were traditionally oriented toward one another. They look like this: + +“smart quotes” + +As computers became popular in the mid-twentieth century, the orientation was often abandoned. The original character set of computers didn't have much room to spare, so it makes sense that two double-quotes and two single-quotes were reduced down to just one of each in the ASCII specification. These days the common character set is Unicode, with plenty of space for lots of fancy quotation marks and apostrophes, but many people have become used to the minimalism of just one character for both opening and closing quotes. Besides that, computers actually see the different kinds of quotation marks and apostrophes as distinct characters. In other words, to a copmuter the right double quote is different from the left double quote or a straight quote. + +### Replacing smart quotes with sed + +Computers aren't typewriters. When you press a key on your keyboard, you're not pressing a lever with an inkstamp attached to it. You're just pressing a button that sends a signal to your computer, which the computer interprets as a request to display a specific predefined character. The request depends on your keyboard map. As a Dvorak typist, I've witnessed the confusion on people's faces when they discover "asdf" on my keyboard produces "aoeu" on the screen. You may also have pressed special combinations of keys to produce characters, such as ™ or ß or ≠, that's not even printed on your keyboard. + +Each letter or character, whether it's printed on your keyboard or not, has a code. Character encoding can be expressed in different ways, but to a computer the Unicode sequences u2018 and u2019 produce **‘** and **’**, while the codes u201c and u201d produce the **“** and **”** characters. Knowing these "secret" codes means you can replace them programmatically using a command like [sed][2]. Any version of sed will do, so you can use GNU sed or BSD sed or even [Busybox][3] sed. + +Here's the simple shell script I use: + + +``` +#!/bin/sh +# GNU All-Permissive License + +SDQUO=$(echo -ne '\u2018\u2019') +RDQUO=$(echo -ne '\u201C\u201D') +$SED -i -e "s/[$SDQUO]/\'/g" -e "s/[$RDQUO]/\"/g" "${1}" +``` + +Save this script as `fixquotes.sh` and then create a separate test file containing smart quotes: + + +``` +‘Single quote’ +“Double quote” +``` + +Run the script, and then use the [cat][4] command to see the results: + + +``` +$ sh ./fixquotes.sh test.txt +$ cat test.txt +'Single quote' +"Double quote" +``` + +### Install sed + +If you’re using Linux, BSD, or macOS, then you already have GNU or BSD `sed` installed. These are two unique reimplementations of the original `sed` command, and for the script in this article they are functionally the same (that's not true for all scripts, though). + +On Windows, you can [install GNU sed][5] with [Chocolatey][6]. + +Vim offers great benefits to writers, regardless of whether they are technically minded or not. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/sed-replace-smart-quotes + +作者:[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/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://opensource.com/article/20/12/sed +[3]: https://opensource.com/article/21/8/what-busybox +[4]: https://opensource.com/article/19/2/getting-started-cat-command +[5]: https://chocolatey.org/packages/sed +[6]: https://opensource.com/article/20/3/chocolatey From 4eeda0554ec1eacffba45e01b08e372ffa7bf656 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Sep 2021 05:04:21 +0800 Subject: [PATCH 0362/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210913?= =?UTF-8?q?=20How=20I=20rediscovered=20Logo=20with=20the=20Python=20Turtle?= =?UTF-8?q?=20module?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210913 How I rediscovered Logo with the Python Turtle module.md --- ...ered Logo with the Python Turtle module.md | 327 ++++++++++++++++++ 1 file changed, 327 insertions(+) create mode 100644 sources/tech/20210913 How I rediscovered Logo with the Python Turtle module.md diff --git a/sources/tech/20210913 How I rediscovered Logo with the Python Turtle module.md b/sources/tech/20210913 How I rediscovered Logo with the Python Turtle module.md new file mode 100644 index 0000000000..8a3bee24a5 --- /dev/null +++ b/sources/tech/20210913 How I rediscovered Logo with the Python Turtle module.md @@ -0,0 +1,327 @@ +[#]: subject: "How I rediscovered Logo with the Python Turtle module" +[#]: via: "https://opensource.com/article/21/9/logo-python-turtle" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I rediscovered Logo with the Python Turtle module +====== +The Logo programming language is available today as a Python package. +![Box turtle][1] + +When I was in high school, one of the very first programming languages I was introduced to was Logo. It was interactive and visual. With basic movement commands, you could have your cursor (“turtle”) draw basic shapes and intricate patterns. It was a great way to introduce the compelling concept of an algorithm—a series of instructions for a computer to execute. + +Fortunately, the Logo programming language is available today as a Python package. So let’s jump right in, and you can discover the possibilities with Logo as we go along. + +### Installing the Turtle module + +Logo is available as the [`turtle` package for Python][2]. To use it, you must have Python installed first. Python is already installed on Linux and BSD, and it's easy to install on both [MacOS][3] and [Windows][4]. + +Once you have Python installed, install the Turtle module: + + +``` +`pip3 install turtle` +``` + +### Bob draws a square + +With the `turtle` package installed, you can draw some basic shapes. + +To draw a square, imagine a turtle (call him Bob) in the middle of your screen, holding a pen with his tail. Every time Bob moves, he draws a line behind him. How must Bob move to draw a square? + + 1. Move forward 100 steps. + 2. Turn right 90 degrees. + 3. Move forward 100 steps. + 4. Turn right 90 degrees. + 5. Move forward 100 steps. + 6. Turn right 90 degrees. + 7. Move forward 100 steps. + + + +Now write the above algorithm in Python. Create a file called `logo.py` and place the following code in it. + + +``` +import turtle + +if __name__ == '__main__': + +    turtle.title('Hi! I\'m Bob the turtle!') +    turtle.setup(width=800, height=800) + +    bob = turtle.Turtle(shape='turtle') +    bob.color('orange') + +    # Drawing a square +    bob.forward(100) +    bob.right(90) +    bob.forward(100) +    bob.right(90) +    bob.forward(100) +    bob.right(90) +    bob.forward(100) + +    turtle.exitonclick() +``` + +Save the above as `logo.py` and run it: + + +``` +`$ python3 logo.py` +``` + +Bob draws a square on the screen: + +![Logo drawn square][5] + +Illustration by Ayush Sharma, [CC BY-SA 4.0][6] + +### Bob draws a hexagon + +To draw a hexagon, Bob must move like this: + + 1. Move forward 150 steps. + 2. Turn right 60 degrees. + 3. Move forward 150 steps. + 4. Turn right 60 degrees. + 5. Move forward 150 steps. + 6. Turn right 60 degrees. + 7. Move forward 150 steps. + 8. Turn right 60 degrees. + 9. Move forward 150 steps. + 10. Turn right 60 degrees. + 11. Move forward 150 steps. + + + +In Python, you can use a [`for` loop][7] to move Bob: + + +``` +import turtle + +if __name__ == '__main__': + +    turtle.title('Hi! I\'m Bob the turtle!') +    turtle.setup(width=800, height=800) + +    bob = turtle.Turtle(shape='turtle') +    bob.color('orange') + +    # Drawing a hexagon +    for i in range(6): + +        bob.forward(150) +        bob.right(60) + +    turtle.exitonclick() +``` + +Run your code again and watch Bob draw a hexagon. + +![Logo drawn hexagon][8] + +Illustration by Ayush Sharma, [CC BY-SA 4.0][6] + +### Bob draws a square spiral + +Now try drawing a square spiral, but this time you can speed things up a bit. You can use the `speed` function and set `bob.speed(2000)` so that Bob moves faster. + + +``` +import turtle + +if __name__ == '__main__': + +    turtle.title('Hi! I\'m Bob the turtle!') +    turtle.setup(width=800, height=800) + +    bob = turtle.Turtle(shape='turtle') +    bob.color('orange') + +    # Drawing a square spiral +    bob.speed(2000) +    for i in range(500): + +        bob.forward(i) +        bob.left(91) + +    turtle.exitonclick() +``` + +![Logo drawn spiral][9] + +Illustration by Ayush Sharma, [CC BY-SA 4.0][6] + +### Bob and Larry draw a weird snake thing + +In the above examples, you initialized `Bob` as an object of the `Turtle` class. You're not limited to just one turtle, though. In the next code block, create a second turtle called `Larry` to draw along with Bob. + +The `penup()` function makes the turtles lift their pens, so they don’t draw anything as they move, and the `stamp()` function places a marker whenever it’s called. + + +``` +import turtle + +if __name__ == '__main__': + +    turtle.title('Hi! We\'re Bob and Larry!') +    turtle.setup(width=800, height=800) + +    bob = turtle.Turtle(shape='turtle') +    larry = turtle.Turtle(shape='turtle') +    bob.color('orange') +    larry.color('purple') + +    bob.penup() +    larry.penup() +    bob.goto(-180, 200) +    larry.goto(-150, 200) +    for i in range(30, -30, -1): + +        bob.stamp() +        larry.stamp() +        bob.right(i) +        larry.right(i) +        bob.forward(20) +        larry.forward(20) + +    turtle.exitonclick() +``` + +![Logo drawn snake][10] + +Illustration by Ayush Sharma, [CC BY-SA 4.0][6] + +### Bob draws a sunburst + +Bob can also draw simple lines and fill them in with color. The functions `begin_fill()` and `end_fill()` allow Bob to fill a shape with the color set with `fillcolor()`. + + +``` +import turtle + +if __name__ == '__main__': + +    turtle.title('Hi! I\'m Bob the turtle!') +    turtle.setup(width=800, height=800) + +    bob = turtle.Turtle(shape='turtle') +    bob.color('orange') + +    # Drawing a filled star thingy +    bob.speed(2000) +    bob.fillcolor('yellow') +    bob.pencolor('red') + +    for i in range(200): + +        bob.begin_fill() +        bob.forward(300 - i) +        bob.left(170) +        bob.forward(300 - i) +        bob.end_fill() + +    turtle.exitonclick() +``` + +![Logo drawn sunburst][11] + +Illustration by Ayush Sharma, [CC BY-SA 4.0][6] + +### Larry draws a Sierpinski triangle + +Bob enjoys drawing simple geometrical shapes holding a pen with his tail as much as the next turtle, but what he enjoys most is drawing fractals. + +One such shape is the [Sierpinski triangle][12], which is an equilateral triangle recursively subdivided into smaller equilateral triangles. It looks something like this: + +![Logo drawn triangle][13] + +Illustration by Ayush Sharma, [CC BY-SA 4.0][6] + +To draw the Sierpinski triangle above, Bob has to work a bit harder: + + +``` +import turtle + +def get_mid_point(point_1: list, point_2: list): + +    return ((point_1[0] + point_2[0]) / 2, (point_1[1] + point_2[1]) / 2) + +def triangle(turtle: turtle, points, depth): + +    turtle.penup() +    turtle.goto(points[0][0], points[0][1]) + +    turtle.pendown() +    turtle.goto(points[1][0], points[1][1]) +    turtle.goto(points[2][0], points[2][1]) +    turtle.goto(points[0][0], points[0][1]) + +    if depth > 0: + +        triangle(turtle, [points[0], get_mid_point(points[0], points[1]), get_mid_point(points[0], points[2])], depth-1) +        triangle(turtle, [points[1], get_mid_point(points[0], points[1]), get_mid_point(points[1], points[2])], depth-1) +        triangle(turtle, [points[2], get_mid_point(points[2], points[1]), get_mid_point(points[0], points[2])], depth-1) + +if __name__ == '__main__': + +    turtle.title('Hi! I\'m Bob the turtle!') +    turtle.setup(width=800, height=800) + +    larry = turtle.Turtle(shape='turtle') +    larry.color('purple') + +    points = [[-175, -125], [0, 175], [175, -125]]  # size of triangle + +    triangle(larry, points, 5) + +    turtle.exitonclick() +``` + +### Wrap up + +The Logo programming language is a great way to teach basic programming concepts, such as how a computer can execute a set of commands. Also, because the library is now available in Python, it can be used to visualize complex ideas and concepts. + +I hope Bob and Larry have been enjoyable and instructive. + +Have fun, and happy coding. + +* * * + +_This article was originally published on the [author's personal blog][14] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/logo-python-turtle + +作者:[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/patti-black-unsplash.jpg?itok=hS8wQNUg (Box turtle) +[2]: https://docs.python.org/3.7/library/turtle.html +[3]: https://opensource.com/article/19/5/python-3-default-mac +[4]: https://opensource.com/article/19/8/how-install-python-windows +[5]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-square.jpg (Logo drawn square) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://opensource.com/article/18/3/loop-better-deeper-look-iteration-python +[8]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-hexagon.jpg (Logo drawn hexagon) +[9]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-square-spiral.jpg (Logo drawn spiral) +[10]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-stamping-larry.jpg (Logo drawn snake) +[11]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-sunburst.jpg (Logo drawn sunburst) +[12]: https://en.wikipedia.org/wiki/Sierpinski_triangle +[13]: https://opensource.com/sites/default/files/uploads/rediscovering-logo-python-turtle-sierpinski-triangle.jpg (Logo drawn triangle) +[14]: https://notes.ayushsharma.in/2019/06/rediscovering-logo-with-bob-the-turtle From dd0d00a5fdeecb8553ad897e15c45364b5c0399d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 14 Sep 2021 05:04:55 +0800 Subject: [PATCH 0363/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210913?= =?UTF-8?q?=20Fedora=2035=20Release=20Date=20and=20Expected=20New=20Featur?= =?UTF-8?q?es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210913 Fedora 35 Release Date and Expected New Features.md --- ... Release Date and Expected New Features.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/news/20210913 Fedora 35 Release Date and Expected New Features.md diff --git a/sources/news/20210913 Fedora 35 Release Date and Expected New Features.md b/sources/news/20210913 Fedora 35 Release Date and Expected New Features.md new file mode 100644 index 0000000000..d46cffd7e6 --- /dev/null +++ b/sources/news/20210913 Fedora 35 Release Date and Expected New Features.md @@ -0,0 +1,103 @@ +[#]: subject: "Fedora 35 Release Date and Expected New Features" +[#]: via: "https://news.itsfoss.com/fedora-35-release-date-features/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fedora 35 Release Date and Expected New Features +====== + +Fedora 35 is just around the corner. And, if you cannot wait already, let us highlight some of the essential details about the release. + +### Fedora 35 Release Date + +The expected release date for Fedora 35 beta is **14th September 2021**. But, if delayed, the next planned date is **21st September 2021**. + +After the public beta testing, the final release has been planned for **19th October 2021,** with a delayed date for **26th October 2021.** + +Of course, you can get your hands on Fedora 35 before the final and beta releases as well. But, considering it is just a few days away from its first beta release, you may want to wait it out. + +### Fedora 35 Features + +![][1] + +[Fedora 34][2] was an exciting release with GNOME 40 and a new i3 spin. And Fedora 35 is also shaping up as an interesting upgrade to it. + +Some of the fundamental changes that you can expect are: + +#### GNOME 41 + +GNOME 41 may not be a radical change when compared to [GNOME 40][3], but there are some visual improvements and valuable feature additions that you can expect. + +For instance, the GNOME Software will get a clean look and context tiles, resembling much like all the details that you can find in the [Apps for GNOME][4] portal. You should also find [VoIP support added to GNOME 41][5]. + +A new “**Connections**” app has been added to let you connect to other platforms/systems remotely. + +GNOME 41 has a planned release date of **September 22, 2021**. So, you may want to watch out for our coverage for the complete details when it releases. + +#### DNS Over TLS Support + +DNS Over TLS (DoT) is essential to encrypt DNS requests and prevent your ISP from spying. With Fedora 35, any configured DNS server should automatically attempt to connect using DoT if the DNS supports it. + +#### Default Btrfs Filesystem for Fedora Cloud + +While Fedora has already switched to the Btrfs filesystem since [Fedora 33][6], they enforce that change for the Cloud edition. + +#### Linux Kernel 5.14 + +[Linux Kernel 5.14][7] wasn’t a big release, but it added many features, especially when it comes to ARM devices. + +For Fedora 35, the improved hardware support should make a difference. + +#### Flathub Applications Included with Third-Party Repositories + +You also get some selected Flatpak applications added from a filtered Flathub remote when you enable third-party repositories. + +This should come in handy for better third-party app support in Fedora. + +#### PulseAudio Daemon Replaced by PipeWire + +While we saw initial implementations of replacing PulseAudio in Fedora 34, this time, there is a proposal to replace the PulseAudio daemon with a compatible implementation based on PipeWire. + +### Other Improvements + +Along with the key highlights mentioned above, you should find several under-the-hood changes and package updates that could translate as significant upgrades. + +For instance, the Firewalld package update and the GNU Toolchain update should prove to be valuable upgrades. + +You can explore more about the proposed changes in their [official changeset wiki][8]. + +### Wrapping Up + +It should be exciting to see the changes in the final release. For now, let us keep an eye out to test the public beta release. And, if you do not want to experiment on your system with a beta release, you should wait for the stable release. + +#### 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/fedora-35-release-date-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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://news.itsfoss.com/fedora-34-release/ +[3]: https://news.itsfoss.com/gnome-40-release/ +[4]: https://news.itsfoss.com/apps-for-gnome-portal/ +[5]: https://news.itsfoss.com/gnome-41-beta/ +[6]: https://itsfoss.com/fedora-33/ +[7]: https://news.itsfoss.com/kernel-5-14-release/ +[8]: https://fedoraproject.org/wiki/Releases/35/ChangeSet From f2c29d0a806ad87d07eb4f0ad0c24dd1b5297978 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Tue, 14 Sep 2021 08:03:31 +0800 Subject: [PATCH 0364/1588] translated by perfiffer --- ...x Terminal -For Experts and Adventurers.md | 127 ------------------ ...x Terminal -For Experts and Adventurers.md | 126 +++++++++++++++++ 2 files changed, 126 insertions(+), 127 deletions(-) delete mode 100644 sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md create mode 100644 translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md diff --git a/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md b/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md deleted file mode 100644 index 9713676059..0000000000 --- a/sources/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: subject: "How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers]" -[#]: via: "https://itsfoss.com/live-usb-with-dd-command/" -[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers] -====== - -There are several graphical tools available for creating live USB. [Etcher on Linux][1] is probably the most popular. Ubuntu has its own Startup Disk Creator tool for this purpose. - -However, advanced Linux users swear by the comfort and swiftness of creating live USBs in Linux terminal using the dd command. - -The dd command is a [CLI tool][2] that gives you powerful features for copying and converting files. - -A common use case that people use dd for is to write ISO files to an external storage device such as a USB drive, which can be used to do things like install a new Linux distribution onto a computer or laptop. - -That’s what I am going to show in this tutorial. I’ll go over the commands you will need to run, finding our USB drive from the terminal, and then finally doing the actual flashing of the ISO file. - -### Creating live USB from ISO with dd command - -Before I show you the steps, let me quickly go over the command which you’ll be using and explain what it does. - -Here’s the example command for flashing of the ISO: - -``` -dd if="./filename.iso" of="/dev/sdb" status="progress" conv="fsync" -``` - -Let’s go over what exactly that [dd command][3] is doing. - -#### Understanding the above dd command - -![Explanation of the dd command for live USB creation][4] - -First, you enter `dd`. As expected, this is just the name of the program you are going to run. - -Next, you specify `if="./filename.iso"`. `if` stands for input file, which tells `dd` what file you are going to be writing to the external storage drive. - -After that, you enter `of="/dev/sdb"`. As was with `if`, `of` simply stands for output file. - -The thing to remember is that the output file doesn’t technically have to be a file on your system. You can also specify things like the path to an external device (as shown in the example), which just **looks** like a normal file on your system, but actually points to a device connected to your machine. - -`status` can be set to three options: `none`, `noxfer` and `progress.` - -The `progress` option that you set will cause dd to show periodic statistics on how much of the ISO has been transferred to the storage drive, as well as an estimation on how much longer it will be until dd is finished. - -If you were to have set the `none` option instead, dd would only print error messages during the writing of the ISO, thus removing things like the progress bar. - -The `noxfer` option hides some information that’s printed after a transfer is complete, such as how long it took from start to finish. - -Lastly, you set the `conv` option to `fsync`. This causes dd to not report a successful write until the entire ISO has been written to the USB drive. - -If you omit this option, dd will still write just fine (and might actually appear to run quicker), but you might find your system taking quite a while before it tells you it’s safe to remove the USB drive as it will finish writing the ISO’s content in the background, thus allowing you to do other things in the meantime. - -_**Now that you understand what you have to do, let’s see how to do it.**_ - -Warning - -The command line is a double-edged sword. Be extra careful when you are running a command like dd. You must make sure that you are using the correct device for the output file destination. One wrong step and you may format your main system disk and lose your operating system. - -#### Step 0: Download the desired ISO - -This goes without saying that you need to have an ISO image file in order to flash it on a USB. - -I am going to use Ubuntu 20.04 ISO (downloadable [here][5]) to test the dd command I showed earlier. - -#### Step 1: Get the USB disk label - -Plug in your USB disk. - -The specific path I entered for `of` was `/dev/sdb`. The USB disks are usually labelled /dev/sdb but that’s not a hard and fast rule. - -This path may differ on your system, but you can confirm the path of the drive with the `lsblk` command. Just look for a listing that looks like the size of your USB drive, and that’ll be it. - -![][6] - -If you are more comfortable with GUI programs, you can also find the drive’s path with tools like GNOME Disks. - -![][7] - -Now that you have established the path to our external drive, let’s create the live USB. - -#### Step 2: Writing the ISO file to the USB disk - -Open up a terminal at the directory where the ISO file is downloaded, and run the following (remember to replace `/dev/sdb` with the name of your storage device if it’s something different): - -``` -sudo dd if="./ubuntu-20.04.2.0-desktop-amd64.iso" of="/dev/sdb" status="progress" conv="fsync" -``` - -After that, just let dd do it’s thing, and it’ll print a completion message once it’s done: - -![][8] - -And just like that, you’ve flashed an ISO with dd command in the Linux terminal! - -### Wrapping Up - -Now you’re on your way to doing even more things through the terminal, allowing you to do things faster and quicker than you might have been able to do before. - -Got any remaining questions about the dd command, or something just not working right? Feel free to leave any of it in the comment section below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/live-usb-with-dd-command/ - -作者:[Hunter Wittenborn][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/hunter/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/install-etcher-linux/ -[2]: https://itsfoss.com/gui-cli-tui/ -[3]: https://linuxhandbook.com/dd-command/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/dd-command-for-live-usb-creation.png?resize=800%2C450&ssl=1 -[5]: https://ubuntu.com/download/desktop/thank-you?version=20.04.2.0&architecture=amd64 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_disks.png?resize=753%2C264&ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_gnome_disks.png?resize=800%2C440&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd-iso-write.png?resize=800%2C322&ssl=1 diff --git a/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md b/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md new file mode 100644 index 0000000000..f5a77085c9 --- /dev/null +++ b/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md @@ -0,0 +1,126 @@ +[#]: subject: "How to Use the dd Command to Create a Live USB Drive in Linux Terminal [For Experts and Adventurers]" +[#]: via: "https://itsfoss.com/live-usb-with-dd-command/" +[#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +怎样在 Linux 终端下使用 dd 命令创建一个 Live USB 驱动器 [针对专家和冒险者] +====== + +有很多的图形化工具可以用来创建 live USB 驱动器。Linux 上的 [Etcher][1] 可能是最受欢迎的。为此,Ubuntu 开发了自己的启动盘创建工具。 + +但是,高级 Linux 用户可能更喜欢使用 dd 命令在 Linux 终端中创建 live USB,这会更快速便捷。 + +dd 命令是一个 [客户端][2] 工具,提供了强大的功能用来复制和转换文件。 + +一个普通的使用示例,用户使用 dd 命令向他们的外部存储设备(例如 USB 驱动盘)写入 ISO 文件,用来给他们的电脑或者笔记本安装一个 Linux 发型版。 + +这就是我将在本教程中展示的内容。我将带你认识需要的命令,从终端找到我们的 USB 驱动器,然后对 ISO 文件进行实际刷写。 + +### 使用 dd 命令从 ISO 镜像创建 live USB + +在我向你展示步骤前,让我带你快速过一下你将要使用到的命令并解释它的作用。 + +这是一个使用命令刷写 ISO 的例子: + +``` +dd if="./filename.iso" of="/dev/sdb" status="progress" conv="fsync" +``` + +让我们来看看 [dd 命令][3] 实际都做了些什么。 + +#### 理解 dd 命令 + +![Explanation of the dd command for live USB creation][4] + +首先,你输入 `dd`。没错,这就是你要运行的程序的名称。 + +接下来,你指定 `if="./filename.iso"`。`if` 代表 input file,告诉 `dd` 命令你将要向外部存储设备写入哪个文件。 + +之后,你输入 `of="/dev/sdb"`。和 `if` 一样,`of` 代表的是 output file。 + +要记住的是,输出文件在技术上不必是系统上的文件。你还可以指定诸如外部设备路径之类的内容(如示例所示),它看起来像系统上的普通文件,但实际上指向连接到你机器的设备。 + +`status` 可以设定为 3 个选项:`none`、`noxfer` 和 `progress`。 + +你设置的 `progress` 选项将使 `dd` 任务显示有关已将多少 ISO 文件传输到存储驱动器的定期统计信息,以及对 `dd` 任务完成前需要多长时间的估计。 + +如果你改为设置 `none` 选项,`dd` 任务只会在写入 ISO 文件期间打印错误消息,并且删除进度条之类的内容。 + +`noxfer` 选项隐藏了传输完成后打印的一些信息,例如从开始到完成所用的时间。 + +最后,你将 `conv` 选项设置为 `fsync`。这会导致 `dd` 任务在整个 ISO 文件写入 USB 驱动器之前不会报告成功写入。 + +如果你省略这个选项,`dd` 任务会工作的很好(并且实际上可能看起来运行得更快),但你可能会发现你的系统需要很长时间才能告诉你移除 USB 驱动器是安全的,因为它会在后台完成 ISO 的内容写入,从而允许你在此期间做其它事情。 + +现在你明白了你必须做什么,让我们看看如何去做。 + +注意事项 + +命令行是把双刃剑。当你在命令行使用类似于 `dd` 命令时必须十分小心。你必须确保你输入文件写入的地方是正确的设备。一个错误的步骤就可能会格式化你的系统硬盘,你的操作系统也会因此而损坏。 + +#### 第一步: 下载所需的 ISO 镜像 + +不用说,你需要有一个 ISO 镜像文件才能将其刷写到 USB 上。 + +我将使用 Ubuntu 20.04 ISO (可在此处下载[5]) 来测试我之前介绍的 `dd` 命令。 + +#### 第二步: 获取 USB 盘符 + +插入你的 USB 磁盘 + +我为 `of` 参数输入的具体路径是 `/dev/sdb`。USB 磁盘通常会标记为 /dev/sdb,但这不是硬性规定。 + +此路径可能因你的系统而异,你可以使用 `lsblk` 命令确认 USB 磁盘的路径。只需从列表中查找一个看起来像你的 USB 磁盘大小的驱动器,就可以了。 + +![][6] + +如果你更熟悉 GUI 程序,还可以使用 GNOME Disks 等工具找到驱动器的路径。 + +![][7] + +现在你已经确认了外部驱动器的路径,让我们开始创建 live USB。 + +#### 第三步:将 ISO 文件写入 USB 磁盘 + +在下载 ISO 文件的目录打开一个终端,然后运行以下命令(如果 `/dev/sdb` 与你的存储设备名称不同,请记住将其替换): + +``` +sudo dd if="./ubuntu-20.04.2.0-desktop-amd64.iso" of="/dev/sdb" status="progress" conv="fsync" +``` +之后,让 `dd` 去做剩下的事情,它会在完成后打印一条完成消息: + +![][8] + +就像这样,你已经在 Linux 终端中使用 `dd` 命令刷写了 ISO 文件! + +### 总结 + +现在,你可以通过终端做更多的事情,让你的工作效率大大提高。 + +对 `dd` 命令有任何剩余的问题,或者无法正常工作?请随时在下面的评论部分中留下你的问题。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/live-usb-with-dd-command/ + +作者:[Hunter Wittenborn][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/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/install-etcher-linux/ +[2]: https://itsfoss.com/gui-cli-tui/ +[3]: https://linuxhandbook.com/dd-command/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/dd-command-for-live-usb-creation.png?resize=800%2C450&ssl=1 +[5]: https://ubuntu.com/download/desktop/thank-you?version=20.04.2.0&architecture=amd64 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_disks.png?resize=753%2C264&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd_gnome_disks.png?resize=800%2C440&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/08/dd-iso-write.png?resize=800%2C322&ssl=1 From 43e30cb33a02ed6220cd62cf9d116a380e505a6b Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 Sep 2021 08:20:55 +0800 Subject: [PATCH 0365/1588] translated --- ...0908 How to Run Java Programs in Ubuntu.md | 116 ------------------ ...0908 How to Run Java Programs in Ubuntu.md | 116 ++++++++++++++++++ 2 files changed, 116 insertions(+), 116 deletions(-) delete mode 100644 sources/tech/20210908 How to Run Java Programs in Ubuntu.md create mode 100644 translated/tech/20210908 How to Run Java Programs in Ubuntu.md diff --git a/sources/tech/20210908 How to Run Java Programs in Ubuntu.md b/sources/tech/20210908 How to Run Java Programs in Ubuntu.md deleted file mode 100644 index afceaf480e..0000000000 --- a/sources/tech/20210908 How to Run Java Programs in Ubuntu.md +++ /dev/null @@ -1,116 +0,0 @@ -[#]: subject: "How to Run Java Programs in Ubuntu" -[#]: via: "https://itsfoss.com/run-java-program-ubuntu/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Run Java Programs in Ubuntu -====== - -So, you have started learning Java programming? That’s good. - -And you want to run the java programs on your Linux system? Even better. - -Let me show how to run Java in terminal in Ubuntu and other Linux distributions. - -### Running Java programs in Ubuntu - -Let’s go in proper steps here. - -#### Step 1: Install Java compiler - -To run a Java program, you need to compile the program first. You need Java compiler for this purpose. - -The Java compiler is part of [JDK][1] (Java Development Kit). You need to install JDK in order to compile and run Java programs. - -First, check if you already have Java Compiler installed on your system: - -``` -javac --version -``` - -If you see an error like “Command ‘javac’ not found, but can be installed with”, this means you need to install Java Development Kit. - -![Check if Java compiler is already installed or not][2] - -The simplest way to install JDK on Ubuntu is to go with the default offering from Ubuntu: - -``` -sudo apt install default-jdk -``` - -You’ll be asked to enter your account’s password. When you type the password, nothing is seen on the screen. That is normal. Just enter your password blindly. When asked, press the enter key or Y key. - -![Installing JDK that also contains the Java compiler][3] - -The above command should work for other Debian and Ubuntu based distributions like Linux Mint, elementary OS etc. For other distributions, use your distribution’s package manager. The package name could also be different. - -Once installed, verify that javac is available now. - -![Verify that Java compiler can be used now][4] - -#### Step 2: Compile Java program in Linux - -You need to have a Java program file for this reason. Let’s say you create a new Java program file named **HelloWorld.java** and it has the following content: - -``` -class HelloWorld{ - public static void main(String args[]){ - System.out.println("Hello World"); - } -} -``` - -You can [use Nano editor in terminal][5] or Gedit graphical text editor for writing your Java programs. - -``` -javac HelloWorld.java -``` - -If there is no error, the above command produces no output. - -When you compile the Java program, it generates a .class file with the class name you used in your program. You have to run this class file. - -#### Step 3: Run the Java class file - -You do not need to specify the class extension here. Just the name of the class. And this time, you use the command java, not javac. - -``` -java HelloWorld -``` - -This will print Hello World on the screen for my program. - -![Running java programs in the Linux terminal][6] - -And that’s how you run a Java program in the Linux terminal. - -This was the simplest of the example. The sample program had just one class. The Java compiler creates a class file for each class in your program. Things get complicated for bigger programs and projects. - -This is why I advise [installing Eclipse on Ubuntu][7] for proper Java programming. It is easier to program in an IDE. - -I hope you find this tutorial helpful. Questions or suggestions? The comment section is all yours. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/run-java-program-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://jdk.java.net/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=800%2C328&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-jdk-ubuntu.png?resize=800%2C430&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-ubuntu.png?resize=798%2C226&ssl=1 -[5]: https://itsfoss.com/nano-editor-guide/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/running-java-programs-in-Linux-terminal.png?resize=798%2C301&ssl=1 -[7]: https://itsfoss.com/install-latest-eclipse-ubuntu/ diff --git a/translated/tech/20210908 How to Run Java Programs in Ubuntu.md b/translated/tech/20210908 How to Run Java Programs in Ubuntu.md new file mode 100644 index 0000000000..9a47825f7f --- /dev/null +++ b/translated/tech/20210908 How to Run Java Programs in Ubuntu.md @@ -0,0 +1,116 @@ +[#]: subject: "How to Run Java Programs in Ubuntu" +[#]: via: "https://itsfoss.com/run-java-program-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Ubuntu 中运行 Java 程序 +====== + +那么,你已经开始学习 Java 编程了?这很好。 + +你想在你的 Linux 系统上运行 Java 程序?那就更好了。 + +让我告诉你如何在 Ubuntu 和其他 Linux 发行版的终端中运行 Java。 + +### 在 Ubuntu 中运行 Java 程序 + +让我们在这里按正确的步骤进行。 + +#### 第一步:安装 Java 编译器 + +要运行一个 Java 程序,你需要先编译该程序。为此你需要 Java 编译器。 + +Java 编译器是 [JDK][1](Java 开发工具包)的一部分。你需要安装 JDK,以便编译和运行 Java 程序。 + +首先,检查你的系统上是否已经安装了 Java 编译器: + +``` +javac --version +``` + +如果你看到类似 “Command ‘javac’ not found, but can be installed with” 的错误,这意味着你需要安装 Java 开发工具包。 + +![Check if Java compiler is already installed or not][2] + +在 Ubuntu 上安装 JDK 的最简单方法是使用 Ubuntu 的默认包: + +``` +sudo apt install default-jdk +``` + +你会被要求输入你的账户密码。当你输入密码时,屏幕上什么也看不到。这很正常。直接输入密码即可。当询问时,按回车键或 Y 键。 + +![Installing JDK that also contains the Java compiler][3] + +上述命令应该适用于其他基于 Debian 和 Ubuntu 的发行版,如 Linux Mint、Elementary OS 等。对于其他发行版,请使用你的发行版的包管理器。包的名称也可能不同。 + +安装完毕后,验证 javac 现在是否可用。 + +![Verify that Java compiler can be used now][4] + +#### 第二步:在 Linux 中编译 Java 程序 + +因为这个原因,你需要有一个 Java 程序文件。假设你创建了一个名为 **HelloWorld.java** 的新的 Java 程序文件,它的内容如下: + +``` +class HelloWorld{ + public static void main(String args[]){ + System.out.println("Hello World"); + } +} +``` + +你可以[使用终端的 Nano 编辑器][5]或 Gedit 图形化文本编辑器来编写你的 Java 程序。 + +``` +javac HelloWorld.java +``` + +如果没有错误,上面的命令不会产生输出。 + +当你编译 Java 程序时,它会生成一个 .class 文件,文件名是你在程序中使用的类。你需要运行这个类文件。 + +#### 第三步:运行 Java 类文件 + +你不需要在这里指定类的扩展名。只需要类的名称。而这一次,你使用 java 命令,而不是 javac。 + +``` +java HelloWorld +``` + +我的程序将在屏幕上打印 Hello World。 + +![Running java programs in the Linux terminal][6] + +这就是你如何在 Linux 终端中运行一个 Java 程序。 + +这是最简单的一个例子。这个示例程序只有一个类。Java 编译器为你程序中的每个类都创建一个类文件。对于较大的程序和项目来说,事情会变得很复杂。 + +这就是为什么我建议[在 Ubuntu 上安装 Eclipse][7]来进行 Java 编程。在 IDE 中编程更容易。 + +希望本教程对你有所帮助。有问题或建议吗?评论区都是你的。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/run-java-program-ubuntu/ + +作者:[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://jdk.java.net/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-check-ubuntu.png?resize=800%2C328&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-jdk-ubuntu.png?resize=800%2C430&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/java-compiler-ubuntu.png?resize=798%2C226&ssl=1 +[5]: https://itsfoss.com/nano-editor-guide/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/running-java-programs-in-Linux-terminal.png?resize=798%2C301&ssl=1 +[7]: https://itsfoss.com/install-latest-eclipse-ubuntu/ From e54de6d32814c84a70f02febd99037bd96965964 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 14 Sep 2021 08:26:13 +0800 Subject: [PATCH 0366/1588] translating --- .../20210913 Replace smart quotes with the Linux sed command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210913 Replace smart quotes with the Linux sed command.md b/sources/tech/20210913 Replace smart quotes with the Linux sed command.md index 2c4a999723..2f45272574 100644 --- a/sources/tech/20210913 Replace smart quotes with the Linux sed command.md +++ b/sources/tech/20210913 Replace smart quotes with the Linux sed command.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/sed-replace-smart-quotes" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 04ee5225d5fc1c8167b1a1c8ef9f2f681ab5c3dd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Sep 2021 08:45:31 +0800 Subject: [PATCH 0367/1588] PUB @wxy https://linux.cn/article-13780-1.html --- ...efox is Seeing a Continuous Decline for Last 12 Years.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/news => published}/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md (98%) diff --git a/translated/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md b/published/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md similarity index 98% rename from translated/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md rename to published/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md index b128403f01..95737229ff 100644 --- a/translated/news/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md +++ b/published/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md @@ -3,9 +3,9 @@ [#]: author: "Community https://news.itsfoss.com/author/team/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13780-1.html" Firefox 在过去 12 年里损失了 5 亿用户及其 75% 份额的原因 ====== From 91d183811d95e30fe054324a6bedb620c878bbf0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Sep 2021 08:50:31 +0800 Subject: [PATCH 0368/1588] APL --- ... Brackets Code Editor - Suggests Using Visual Studio Code.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md b/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md index 045c0d6cfb..76b21674f6 100644 --- a/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md +++ b/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/adobe-kills-brackets-editor/" [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 28abcc858d98675e5549879e8abe42c74fa94c50 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Sep 2021 09:23:28 +0800 Subject: [PATCH 0369/1588] TSL&PRF --- ...tor - Suggests Using Visual Studio Code.md | 81 ------------------- ...tor - Suggests Using Visual Studio Code.md | 79 ++++++++++++++++++ 2 files changed, 79 insertions(+), 81 deletions(-) delete mode 100644 sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md create mode 100644 translated/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md diff --git a/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md b/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md deleted file mode 100644 index 76b21674f6..0000000000 --- a/sources/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: subject: "Adobe Kills Brackets Code Editor & Suggests Using Visual Studio Code" -[#]: via: "https://news.itsfoss.com/adobe-kills-brackets-editor/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Adobe Kills Brackets Code Editor & Suggests Using Visual Studio Code -====== - -Brackets was an impressive open-source modern code editor available for Windows, macOS, and Linux. - -Adobe created it as a community-guided project to help web developers. We previously listed it as one of the [best modern text editors available for coders][1]. - -Unfortunately, Adobe ended its support for Brackets on September 1, 2021. - -### Why Did Adobe Discontinue Brackets? - -![][2] - -It looks like Adobe’s partnership with Microsoft may have encouraged them to pull the plug off the community project. - -Hence, they recommend users migrate to Microsoft’s Visual Studio Code editor. - -![][3] - -This is what Brackets’ original GitHub page says after the discontinuation of the project. - -### Visual Studio Code as a Replacement to Brackets - -Of course, Microsoft’s Visual Studio Code is a fantastic alternative and built on open-source. However, when you download the Visual Studio Code from their website, it does not come under a license that promotes free and open-source software. - -So, you may have to build from source or try [VSCodium][4], a freely licensed edition of Visual Studio Code minus the telemetry/tracking. - -Also, there is an [official guide on migrating from Brackets][5] that you can explore if interested. - -### Brackets Will Continue as a Fork Without Adobe - -![][6] - -Even though Adobe has discontinued the project, the [original website][7] still exists to maintain a fork of the project. - -The project’s name is subject to change, but as of now, it’s “**Brackets Continued**” to help users identify the fork. - -Do note that the fork does not yet have a release, and we have no idea if it will continue as an independent project. - -So, if you want to help Brackets fork and help maintain it somehow, head to its GitHub page for more details. - -[Brackets Continued (Fork)][8] - -_What do you prefer to use as your code editor? Did you like Brackets code editor for web development work? Feel free to share your thoughts on this 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/adobe-kills-brackets-editor/ - -作者:[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/best-modern-open-source-code-editors-for-linux/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjE1NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://vscodium.com -[5]: https://code.visualstudio.com/migrate-from-brackets -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMyNyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://brackets.io -[8]: https://github.com/brackets-cont/brackets diff --git a/translated/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md b/translated/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md new file mode 100644 index 0000000000..0d7f885f90 --- /dev/null +++ b/translated/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md @@ -0,0 +1,79 @@ +[#]: subject: "Adobe Kills Brackets Code Editor & Suggests Using Visual Studio Code" +[#]: via: "https://news.itsfoss.com/adobe-kills-brackets-editor/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Adobe 终止支持 Brackets,并建议使用 VS Code 替代 +====== + +> Adobe 结束了对 Brackets 代码编辑器的支持,坚持让用户迁移到微软的 Visual Studio Code。不过,还好总还算是留下了一个复刻。 + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/adobe-bracket-visual-studio.jpg?w=1200&ssl=1) + +Brackets 是一个令人印象深刻的现代开源代码编辑器,可用于 Windows、macOS 和 Linux。 + +Adobe 以一个社区引导的项目的形式创建了它,来帮助 Web 开发者。我们之前把它列为 [可供编程人员使用的最佳现代文本编辑器][1] 之一。 + +不幸的是,Adobe 在 2021 年 9 月 1 日结束了对 Brackets 的支持。 + +### 为什么 Adobe 停用了 Brackets? + +![][2] + +看起来可能是 Adobe 与微软的合作关系促使他们拔掉了这个社区项目的插头。 + +因此,他们建议用户迁移到微软的 Visual Studio Code 编辑器。 + +![][3] + +这是 Brackets 项目中止后 GitHub 的原始页面上的内容。 + +### Visual Studio Code 作为 Brackets 的替代品 + +当然,微软的 Visual Studio Code 是一个很好的替代品,而且建立在开源的基础上。然而,当你从他们的网站上下载 Visual Studio Code 时,它并不在一个促进自由和开源软件的许可证之下。 + +因此,你可能不得不从源代码构建,或者尝试 [VSCodium][4],这是一个没有遥测/跟踪功能的 Visual Studio Code 的自由许可版本。 + +另外,有一个 [关于从 Brackets 迁移的官方指南][5],如果你感兴趣,可以去看看。 + +### Brackets 将继续以没有 Adobe 的复刻出现 + +![][6] + +尽管 Adobe 已经停止了这个项目,但 [原网站][7] 仍然存在,以维持这个项目的复刻。 + +该项目名称可能会改变,但从目前来看,它叫 “Brackets Continued”,以帮助用户识别该复刻。 + +请注意,这个复刻项目还没有发布,我们也不知道它是否会作为一个独立的项目继续下去。 + +所以,如果你想帮助 Brackets 复刻,并以某种方式帮助维护它,请前往其 GitHub 页面了解更多细节。 + +- [Brackets Continued(复刻)][8] + +你喜欢用什么作为你的代码编辑器?你喜欢用 Brackets 代码编辑器进行 Web 开发工作吗?欢迎在评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/adobe-kills-brackets-editor/ + +作者:[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://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[2]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/brackets-screenshot.png?w=800&ssl=1 +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/adobe-brackets-github.png?w=964&ssl=1 +[4]: https://vscodium.com +[5]: https://code.visualstudio.com/migrate-from-brackets +[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/brackets-fork.png?w=1511&ssl=1 +[7]: https://brackets.io +[8]: https://github.com/brackets-cont/brackets From 00d695b205ceef5f8fd94c6f59cfed83651c6a6d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Sep 2021 09:27:19 +0800 Subject: [PATCH 0370/1588] PUB @wxy https://linux.cn/article-13782-1.html --- ...ckets Code Editor - Suggests Using Visual Studio Code.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/news => published}/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md (97%) diff --git a/translated/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md b/published/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md similarity index 97% rename from translated/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md rename to published/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md index 0d7f885f90..f8962272b2 100644 --- a/translated/news/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md +++ b/published/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md @@ -3,9 +3,9 @@ [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13782-1.html" Adobe 终止支持 Brackets,并建议使用 VS Code 替代 ====== From efeb702e82468c581c538a2c459dd1eccb409027 Mon Sep 17 00:00:00 2001 From: SamMa Date: Tue, 14 Sep 2021 09:35:03 +0800 Subject: [PATCH 0371/1588] Update 20210907 Use lspci on Linux to see your hardware.md --- ...Use lspci on Linux to see your hardware.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210907 Use lspci on Linux to see your hardware.md b/translated/tech/20210907 Use lspci on Linux to see your hardware.md index 1eeee0946a..4ad17b55f4 100644 --- a/translated/tech/20210907 Use lspci on Linux to see your hardware.md +++ b/translated/tech/20210907 Use lspci on Linux to see your hardware.md @@ -3,22 +3,22 @@ [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " 在 Linux 上使用 lspci 命令查看硬件情况 ====== -使用 lspci 命令可以显示 Linux 系统上的设备和驱动程序。 +lspci 命令用于显示 Linux 系统上的设备和驱动程序。 ![computer screen ][1] -当你在个人电脑或服务器上运行 Linux 时,有时可能需要识别该系统中的硬件。`lspci` 命令可以显示连接到 PCI 总线的所有设备,从而实现上述目的。该命令由 [pciutils][2] 包提供,可用于各种基于 Linux 和 BSD 的操作系统。 +当你在个人电脑或服务器上运行 Linux 时,有时需要识别该系统中的硬件。`lspci` 命令用于显示连接到 PCI 总线的所有设备,从而满足上述需求。该命令由 [pciutils][2] 包提供,可用于各种基于 Linux 和 BSD 的操作系统。 ### 基础用法 -由于访问权限的存在,普通用户运行 `lspci` 时显示的信息可能会受限,因此可以使用 `sudo` 运行命令,系统会给出完整的信息图。 +由于访问权限,普通用户运行 `lspci` 时显示的信息可能会受限,因此可以使用 `sudo` 运行命令,系统会给出完整的信息图。 -单独运行 `lspci` 命令会列出 PCI 总线及其连接的设备,下图是在我的媒体中心 PC 上的演示样例。图中是一个基于 AMD Phenom CPU 的系统,所以它有一个 AMD 芯片组,以及 Atheros 无线控制器和 Nvidia 显卡。所有硬件设备都列出了详细信息,例如供应商、名称和型号等: +直接运行 `lspci` 命令会列出 PCI 总线及其连接的设备,下图是在我的媒体中心 PC 上的演示样例。图中是一个基于 AMD Phenom CPU 的系统,所以它有一个 AMD 芯片组,以及 Atheros 无线适配器和 Nvidia 显卡。所有硬件设备都列出了详细信息,例如供应商、名称和型号等: ``` $ sudo lspci @@ -50,11 +50,11 @@ $ sudo lspci ### 详细输出 -添加 `-v` 选项会增加每个设备的详细程度或详细程度,你可以使用 `-vv` 或 `-vvv` 来获取更多的设备细节。在 `-v` 级别,`lspci` 会显示所有设备的各种子系统和内存地址、中断请求 (IRQ) 编号和一些其他功能信息。输出信息会非常长。在你的系统上试一试吧。 +添加 `-v` 选项会显示每个设备的详细信息,你可以使用 `-vv` 或 `-vvv` 来获取更多的设备细节。在 `-v` 级别,`lspci` 会显示所有设备的各种子系统和内存地址、中断请求 (IRQ) 编号和一些其他功能信息。输出信息会非常长。在你的系统上试一试吧。 ### 使用 grep 过滤搜索 -有时你可能会想要缩小搜索范围。例如,RPM Fusion 网站有安装 Nvidia 图形驱动程序的说明,里面就首先使用了 `grep` 命令来定位显卡信息。下面是我在笔记本电脑上得到的界面: +你可能会需要缩小搜索范围。例如,RPM Fusion 网站有安装 Nvidia 图形驱动程序的说明,里面就首先使用了 `grep` 命令来定位显卡信息。下面是我在笔记本电脑上得到的输出: ``` $ sudo lspci | grep -e VGA @@ -63,7 +63,7 @@ $ sudo lspci | grep -e 3D 01:00.0 3D controller: NVIDIA Corporation GM108M [GeForce MX130] (rev a2) ``` -下面(LCTT 译注:原文为 “above”,应为作者笔误)的 `grep` 命令在我的媒体中心 PC 上显示了一个 VGA 设备,但没有显示 3D 设备。 +下面(LCTT 译注:原文为 “above”,应为作者笔误)的 `grep` 命令在我的媒体中心 PC 上定位了一个 VGA 设备,但没有显示 3D 设备。 ``` $ sudo lspci | grep -e VGA @@ -74,16 +74,16 @@ $ ### 按供应商 ID 搜索 -还有另一种不需要 `grep` 的方法可以使用。假设我想确认一下此计算机是否有其他的 Nvidia 设备,在此之前我们还需要一些额外信息,使用 `-nn` 选项显示的供应商和设备 ID 号。在我的媒体中心 PC 上,此选项会给出我的 VGA 卡、供应商 ID 和设备 ID: +还有另一种无需 `grep` 的方法可以使用。假设我想确认一下此计算机是否有其他的 Nvidia 设备,在此之前我们还需要一些额外信息,使用 `-nn` 选项显示的供应商和设备 ID 号。在我的媒体中心 PC 上,此选项会给出我的 VGA 卡、供应商 ID 和设备 ID: ``` $ sudo lspci -nn | grep -e VGA 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1) ``` -设备名称后的括号内有用冒号分隔的数字,即供应商和设备 ID。输出表明 Nvidia Corporation 制造的设备的供应商 ID 为 **10de**。 +设备名称后的方括号内有用冒号分隔的数字,即供应商和设备 ID。输出表明 Nvidia Corporation 制造的设备的供应商 ID 为 **10de**。 -`-d` 选项会给出来自指定供应商、设备或类 ID 的所有设备。以下是我系统中的所有 Nvidia 设备(保留 `-nn` 以解析供应商 ID): +`-d` 选项用于指定供应商、设备或类 ID 的所有设备。以下是我系统中的所有 Nvidia 设备(保留 `-nn` 以解析供应商 ID): ``` $ sudo lspci -nn -d 10de: @@ -91,11 +91,11 @@ $ sudo lspci -nn -d 10de: 01:00.1 Audio device [0403]: NVIDIA Corporation GK107 HDMI Audio Controller [10de:0e1b] (rev a1) ``` -从输出中可以看到,除了显卡之外,我还有一个 Nvidia 音频设备。虽然它们实际上都是同一张 **Nvidia GeForce GTX 650** 卡的一部分,但这仍然是一个很好的示例。 +从输出中可以看到,除了显卡之外,我还有一个 Nvidia 音频设备。实际上它们都属于同一张 **Nvidia GeForce GTX 650** 卡,但这仍然是一个很好的示例。 ### 内核模块 -结合 PCI 硬件设备,`lspci` 可以使用 `-k` 选项显示加载了哪些内核驱动程序模块。我将此选项添加到我的 `lspci` 命令来查看有关我的 Nvidia 设备的信息。 +结合 PCI 硬件设备,`lspci` 可以使用 `-k` 选项显示内核加载了哪些驱动程序模块。我将此选项添加到我的 `lspci` 命令来查看有关我的 Nvidia 设备的信息。 ``` $ sudo lspci -nn -k -d 10de: @@ -113,7 +113,7 @@ $ sudo lspci -nn -k -d 10de: ### 同步最新状态 -新设备和供应商总是在持续不断进入市场。如果看到显示为 _unknown_ 的设备,说明你的 PCI 设备 ID 数据库可能已过时。有两种方法可以检查更新。`-Q` 选项会使用 DNS 查询中央数据库,当然,这需要网络连接。 +新设备和供应商总是在不断迭代。如果看到显示为 _unknown_ 的设备,说明你的 PCI 设备 ID 数据库可能已过时。有两种方法可以检查更新。`-Q` 选项会使用 DNS 查询中央数据库,当然,这需要联网。 ``` `$ sudo lspci -Q` @@ -128,7 +128,7 @@ Downloaded daily snapshot dated 2021-08-22 03:15:01 ### 了解有关你的硬件的更多信息 -当然,`lspci` 只是 Linux 中可用于查询系统硬件和软件的诸多命令之一。读者可以在阅读我关于 USB 设备的文章,了解有关 Linux 硬件的更多信息:[使用此 USB ID 存储库识别 Linux 上的更多设备][3]。 +当然,`lspci` 只是 Linux 中用于查询系统硬件和软件的诸多命令之一。读者可以在阅读关于 USB 设备的文章,了解有关 Linux 硬件的更多信息:[使用此 USB ID 存储库识别 Linux 上的更多设备][3]。 -------------------------------------------------------------------------------- @@ -137,7 +137,7 @@ via: https://opensource.com/article/21/9/lspci-linux-hardware 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4f71f197db11851492f99ded2d4a3e686c5c1cf8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Sep 2021 11:26:17 +0800 Subject: [PATCH 0372/1588] PRF&PUB @wxy https://linux.cn/article-13783-1.html --- ...How to Stop a Program in Linux Terminal.md | 38 ++++++++++--------- 1 file changed, 20 insertions(+), 18 deletions(-) rename {translated/tech => published}/20210907 How to Stop a Program in Linux Terminal.md (53%) diff --git a/translated/tech/20210907 How to Stop a Program in Linux Terminal.md b/published/20210907 How to Stop a Program in Linux Terminal.md similarity index 53% rename from translated/tech/20210907 How to Stop a Program in Linux Terminal.md rename to published/20210907 How to Stop a Program in Linux Terminal.md index 58ac4347f5..18d95f058a 100644 --- a/translated/tech/20210907 How to Stop a Program in Linux Terminal.md +++ b/published/20210907 How to Stop a Program in Linux Terminal.md @@ -3,40 +3,42 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13783-1.html" -如何在 Linux 终端中停止一个程序 +如何在 Linux 终端中退出一个程序 ====== +![](https://img.linux.net.cn/data/attachment/album/202109/14/112410p18i9dsj813i1j4p.jpg) + 有趣的是,当你刚接触一些东西时,最简单的事情也会变得复杂。 -有一天,我发现我的朋友搞不清楚如何退出 top 命令。他没有停止这个命令,而是关闭了整个终端程序。 +有一天,我发现我的朋友搞不清楚如何退出 `top` 命令。他没有中止这个命令,而是关闭了整个终端程序。 这不仅是不必要的,而且是一件不好的事情。 -### 在 Linux 中停止程序 +### 在 Linux 里中止程序 -在 Linux 中,你可以使用 Ctrl+C 键来停止终端中的运行程序。这对 Ubuntu 和其他 Linux 发行版都适用。 +在 Linux 中,你可以使用 `Ctrl+C` 键来中止终端中的运行程序。这对 Ubuntu 和其他 Linux 发行版都适用。 -以 ping 命令为例。如果你不停止它,它将持续显示结果。 +以 `ping` 命令为例。如果你不中止它,它将持续显示结果。 -按住 Ctrl 键并同时按下 C 键。它向正在运行的程序发送 [SIGKILL 信号][1]以强制退出该命令。 +按住 `Ctrl` 键并同时按下 `C` 键。它向正在运行的程序发送 [SIGKILL 信号][1]以强制退出该命令。 ![Stopping a program in the Linux terminal][2] -你看到 ^C 了吗?这个插入符号(^)代表 Ctrl。所以基本上,终端将 Ctrl+C 的按键显示为 ^C。 +你看到 `^C` 了吗?这个插入符号(`^`)代表 `Ctrl`。所以基本上,终端将 `Ctrl+C` 的按键显示为 `^C`。 -Ctrl+C 对于那些被设计为持续运行直到被打断的命令非常有效。你觉得你需要取消命令,就用 Ctrl+C。 +`Ctrl+C` 对于那些被设计为持续运行直到被打断的命令非常有效。你觉得你需要取消命令,就用 `Ctrl+C`。 -在一个更复杂的方法中,你可以[找到进程 ID 并杀死一个正在运行的进程][3]。这是更高级的东西,只有进程在后台或由其他用户运行或在另一个终端窗口运行时使用。 +在一个更复杂的方法中,你可以 [找到进程 ID 并杀死一个正在运行的进程][3]。这是更高级的东西,只有进程在后台或由其他用户运行或在另一个终端窗口运行时使用。 除此以外,还有一些其他的命令和命令行工具也有自己的退出命令。让我在这里简单地提一下其中的一些。 #### 如何退出 Vim 编辑器 -[退出 Vim 编辑器][4]在 Linux 世界里闹出了很多笑话。当你刚接触这个强大的基于命令行的文本编辑器时,是很难搞清楚的。在几种退出 vim 的方法中,最常见的是按 Esc 键,然后输入冒号(:),再输入 `q!` 表示不保存而强制退出,或者 `wq` 表示保存并退出。 +[退出 Vim 编辑器][4] 在 Linux 世界里闹出了很多笑话。当你刚接触这个强大的基于命令行的文本编辑器时,是很难搞清楚的。在几种退出 `vim` 的方法中,最常见的是按 `Esc` 键,然后输入冒号(`:`),再输入 `q!` 表示不保存而强制退出,或者 `wq` 表示保存并退出。 ![][5] @@ -44,23 +46,23 @@ Ctrl+C 对于那些被设计为持续运行直到被打断的命令非常有效 退出 [Nano 编辑器][6]比退出 Vim 要简单一些。为什么?因为 Nano 在底部有快捷方式。如果你是新手,你可能不明白,但至少你下次就能搞清楚了。 -要退出 Nano,按 Ctrl+X。它将询问你是否要保存对文件所做的修改。你可以输入你的选择。 +要退出 Nano,按 `Ctrl+X`。它将询问你是否要保存对文件所做的修改。你可以输入你的选择。 ![][7] #### 如何退出 less 命令 -less 是一个奇妙的命令,它可以让你在不像 cat 命令那样杂乱的终端屏幕上进行查看。如果你在 less 命令的视图内,使用 `q` 键来退出 less。 +`less` 是一个奇妙的命令,它可以让你在不像 `cat` 命令那样杂乱的终端屏幕上进行查看。如果你在 `less` 命令的视图内,使用 `q` 键来退出 `less`。 #### 如何退出终端 -要退出终端本身,不是关闭终端,而是使用 Ctrl+D 键盘快捷键或输入退出命令: +要退出终端本身,不是关闭终端,而是使用 `Ctrl+D` 键盘快捷键或输入退出命令: ``` exit ``` -这实际上是让你从当前的 shell 中退出。当你[在 Ubuntu 或其他发行版中打开一个终端][8],它会运行默认的 shell。当你从这个 shell 退出时,终端也会结束。Ctrl+D 是做同样事情的快捷方式,并退出终端。 +这实际上是让你从当前的 shell 中退出。当你[在 Ubuntu 或其他发行版中打开一个终端][8],它会运行默认的 shell。当你从这个 shell 退出时,终端也会结束。`Ctrl+D` 是做同样事情的快捷方式,并退出终端。 我希望你觉得这个快速教程对你有帮助。我强烈建议你学习这些 [Linux 命令技巧][9]。 @@ -73,7 +75,7 @@ via: https://itsfoss.com/stop-program-linux-terminal/ 作者:[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 a5d4330d2e0f25d1668c4c6be4cc5f85918ff304 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 14 Sep 2021 13:25:28 +0800 Subject: [PATCH 0373/1588] PRF --- published/20210907 How to Stop a Program in Linux Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210907 How to Stop a Program in Linux Terminal.md b/published/20210907 How to Stop a Program in Linux Terminal.md index 18d95f058a..e9856a16c0 100644 --- a/published/20210907 How to Stop a Program in Linux Terminal.md +++ b/published/20210907 How to Stop a Program in Linux Terminal.md @@ -24,7 +24,7 @@ 以 `ping` 命令为例。如果你不中止它,它将持续显示结果。 -按住 `Ctrl` 键并同时按下 `C` 键。它向正在运行的程序发送 [SIGKILL 信号][1]以强制退出该命令。 +按住 `Ctrl` 键并同时按下 `C` 键。它向正在运行的程序发送 [SIGINT 信号][1]以强制退出该命令。 ![Stopping a program in the Linux terminal][2] From 44f054a1030f39aca14eca95c66ad458a76b8404 Mon Sep 17 00:00:00 2001 From: guevaraya Date: Tue, 14 Sep 2021 19:44:07 +0800 Subject: [PATCH 0374/1588] Update and rename sources/tech/20210827 How to Easily Install Debian Linux.md to translated/tech/20210827 How to Easily Install Debian Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 翻译完成,请校对 --- ...0827 How to Easily Install Debian Linux.md | 252 ------------------ ...0827 How to Easily Install Debian Linux.md | 250 +++++++++++++++++ 2 files changed, 250 insertions(+), 252 deletions(-) delete mode 100644 sources/tech/20210827 How to Easily Install Debian Linux.md create mode 100644 translated/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 deleted file mode 100644 index 9f652f4b40..0000000000 --- a/sources/tech/20210827 How to Easily Install Debian Linux.md +++ /dev/null @@ -1,252 +0,0 @@ -[#]: 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: "guevaraya " -[#]: 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 diff --git a/translated/tech/20210827 How to Easily Install Debian Linux.md b/translated/tech/20210827 How to Easily Install Debian Linux.md new file mode 100644 index 0000000000..7cf837b527 --- /dev/null +++ b/translated/tech/20210827 How to Easily Install Debian Linux.md @@ -0,0 +1,250 @@ +[#]: 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: "guevaraya " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何简单安装 Debian Linux 系统 +====== + +安装 Debian 的简易程度依赖于选择什么镜像。 + +如果你使用 Debain 官网的默认镜像,安装 Debian 就比较费劲。你会遇到这种界面,让你从外部介质先安装网络驱动。 + +![Installing Debian from default ISO is problematic for new users][1] + +当然你也可以花时间去排除这个故障,但这让事情变得无意义的复杂。 + +不用担心,让我来展示如何轻巧的简单安装 Debian。 + +### 简单安装 Debian桌面系统 + +在你查看步骤之前,请确认以下准备工作: + * 一个至少 4Gb 大小的U盘 + * 一个可以联网的系统(可以和要安装的操作系统一样) + * 要安装的 Debian 系统将会清理掉系统上所有数据,因此请拷贝重要数据到其他外部磁盘 + +你需要什么规格的 Debian 系统?取决于你想用什么类型的[桌面环境][2]。例如,GNOME 桌面系统可以在4GB RAM上运行但最好在8GB RAM 流畅一些。如果你是4GB或更小的 RAM,还是建议尝试 KDE,Cinnamon 或 Xfce 桌面系统。 + +Debian 也都支持 [32位和64位的指令架构][3]。你需要根据你的CPU指令架构选择对应的 Debian 镜像。 + +你的系统应该至少要有 25 GB的硬盘空间可用。越多越好。 + +警告! + +这个方法会移除磁盘上其他操作系统的已有数据。 + +你可能需要保存你后面还需要用的个人信息,文档,照片等到外部 U 盘或云盘。 + +这个教程是我安装附带 GNOME Debian 11 Bullseye 的步骤。这些步骤其实和其他桌面环境都大同小异。 + +_**这个教程在 UEFI 系统的 GPT分区得到验证。如果你是[MBR替换GPT分区][4],或[传统的BIOS替换UEFI][5],创建Live USB的步骤有一点不同。**_ + + +#### 步骤 1:获取正确的 Debian 的 ISO 镜像 + +在安装 Debian 过程中的一半事情是选择合适的 ISO 镜像。奇怪的是,确实作为一个新 Debian 用户很难从官网容易的找到 ISO镜像。 + +如果你点击 Debian 官网的下载按钮,它会下载一个为用户提供最佳兼容的最小安装包。请不太要用它。 + +反而,你需要用 Live ISO。这有一个技巧,有独立非免费的 Live 版本(包含网络驱动) + +你需要下载非免费的 live ISO 镜像。这里的其他程序可以不必从官网下载,有各种 torrents 连接或直接下载各种架构的安装包。 + +这些链接就在这里 + +[32和64位的主仓地址][7] + +[Debian 11 官方下载][8] + +[Debian 11 种子地址][9] + +你将看到桌面环境的几个文件的名字。选择一种你的对应的桌面环境。直接下载的话,直接点击.iso结尾的链接。 + +![下载非免费版的 Live Debian 的ISO][10] + +一旦你有了对应的 ISO 下载包,剩下就是和其他 Linux 发行版的安装流程一样了 + +#### 步骤 2: 创建一个 Debian 的 Live USB + +将USB插入你的系统。最好在用之前最好格式化一下,它最终也会被格式化的。 + +你可以根据你的选择使用任何版本的 Live USB 创建工具。如果你使用 Windows,请用 Rufus。我们现在在这用 Etcher,因为这个工具在 Windows 和 Linux 都可以用。 + +从它的官网下载 Etcher + +[下载 Etcher][11] + +我有一个专门的[在linux下使用 Etcher 的教程][12]。而这我就不深入介绍了。仅仅下载可执行程序,浏览 Debian 的 ISO镜像,确认选择正确的 USB 驱动器然后点击 Flash 按钮。 + +![用 Etcher 创建 Debian 的 Live USB][13] + +不一会就创建好 live USB。一旦创建好,就可以开机引导了。 + +#### 步骤 3:从 live USB 引导启动 + +重启即将要安装 Debian 的系统。当她显示制造商标识的时候,按下F2/F10 或 F12 键进入开机引导选择界面。你可能也会[进入到 UEFI 固件设置界面][14]。 + +有些系统已经开启了安全启动功能就不允许从 Live USB 开机引导。如果是这种情况,请[从BIOS设置里禁用安全启动][15] + +不同的的制造商在界面上一些差异。 + +![][16] + +一点你在 BIOS 里做了修改,按下 F10 保存并推出。你的系统将会重新启动。 + +再次看到,当看到制造商的标识后按下 F2/F10 或 F12 查看引导配置。你应该可以看到从 USB 引导的类似选项,然后选中。 + +![][17] + +一会儿就会看到如下图的显示界面,选择第一个选项。 + +![Debian live 选择界面][18] + +#### 步骤 4: 开始 Debian 安装 + +当你进入 live Debian 会话,如果你用 GNONE 桌面话,它呈现一个欢迎界面并带有选择你的键盘和语言。当你看到这些界面只需要点击下一步。 + +![Debian live 欢迎界面][19] + +选择欢迎界面之后,按下 windows徽标/Super 键进入活动区。你应该可以看到 Debian 的安装按钮。 + +![开始 Debian 安装][20] + +它会打开一个友好的[卡拉马雷斯Calamares图形安装器][21]。从这里开始事情就比较简单了, + +![Debian 11 Calamares graphical installer][22] + +它会让你选择你的地理位置和时区。 + +![Select your location and time zone][23] + +下一个界面,会让你选择键盘类型。这儿请 **注意**。你的键盘会根据位置自动选择。例如,我的位置是印度它会自动选择印地语的印度键盘。我不得不将其改为英语印度类型。 + +![选择键盘类型][24] + +下一个界面是关于硬盘分区表和 Debian 安装哪里。这里是在你的系统只安装 Debian。 + +简单选择便是直接 “Erase Disk”。Debian 将把除过 ESP 分区和交互分区的其他分区都放在根挂载点上。实际上,下面显示了你选择了安装配置后的磁盘分布。 + +![磁盘分区][25] + +如果你想手动选择,你也需要手工划分区,选择 root,home,boot 或 swap 分配多少。只有你知道自己在做什么你才可以去手工配置。 + +下一界面,你需要提供用户名和密码。但它不会设置root的密码并将其保持为空。 + +![设置用户名和密码][26] + +这也意味着你可以用 sudo 新创建用户。在“复杂 Debian 安装”中,你也可以设置 root 密码但前提是你必须用手动添加普通用户到 sudoer 列表。看看,这个安装过程是不是对新手来说很简单? + +在实际真正安装之前,它会呈现你已经选择的汇总信息。如果没有问题,就可以点击安装按钮。 + +![安装配置的汇总信息][27] + +现在只需要等待安装完成。 + +![安装 Debian][28] + +几分钟后就会完成安装。当安装完成,它会提示重启。 + +![完成 Debian 安装][29] + +如果一切顺利重启系统,你应该可以看到 Debian 的 grub 界面。 + +![Debian 启动画面][30] + +### 疑难解答小贴士 (如果系统没有启动到 Debian) + +我遇到情况是,我的 Dell 系统不能识别并引导任何操作系统。很奇怪,我已经能看到 Debian 已经创建了一个 ESP 分区。 + +如果你也是同样的情况,去BIOS配置里。检测启动流程,如果你看不到任何东西,就点击新增一个启动选项。 + +![增加新的启动选项][31] + +它会提供一个增加 EFI 文件的选项。 + +![选择 EFi 文件][32] + +只有在安装过程中 Debian 创建了 ESP 分区,就有一个带文件的 EFI 目录被创建出来。 + +![选择 EFI 目录][33] + +它会显示一个 Debian 文件夹包含其他文件夹。选择 Debian 文件夹。 + +![选择 Debian][34] + +在 Debian 文件夹,你将看到 grubx64.efi, shimx64.efi。请选择 shimx64.efi。 + +![选择 shim.efi][35] + +你需要选择一个合适的名字。最后的界面应该如下: + +![增加 efi 文件的新启动选项][36] + +现在你可能有了下面这个启动选项。我命名为 Debian,它显示了两个 Debian 驱动选择(我猜其中一个是从 efi 文件来的)。按下 F10 保存退出 BIOS 的配置。 + +![新增的启动选项][37] + +现在启动你的系统,你可以看到 grub 界面带有 Debian 的启动选项。你现在可以体验 Debian 了。 + +![][30] + +### Debian 可以安装到哪里? + +我这里的目的是让事情变得简单。并不是说你不能从默认的官网下载安装包来安装。只是它需要花更多的精力。 + +这个教程对你安装有帮助吗?你如果还是有问题,请在下面留言给我,我会尽力提供帮助。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-debian-easily/ + +作者:[Abhishek Prakash][a] +选题:[lujun9972][b] +译者:[巴龙](https://github.com/guevaraya) +校对:[校对者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 e375e0fe203898b20b529b8bf7534aa280dfd9c2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Sep 2021 05:02:45 +0800 Subject: [PATCH 0375/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210915?= =?UTF-8?q?=20Screen=20Recording=20in=20Linux=20With=20OBS=20and=20Wayland?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md --- ...Recording in Linux With OBS and Wayland.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md diff --git a/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md b/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md new file mode 100644 index 0000000000..2c39272ba7 --- /dev/null +++ b/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md @@ -0,0 +1,125 @@ +[#]: subject: "Screen Recording in Linux With OBS and Wayland" +[#]: via: "https://itsfoss.com/screen-record-obs-wayland/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Screen Recording in Linux With OBS and Wayland +====== + +There are [tons of screen recorders available for Linux][1]. But when it comes to supporting [Wayland][2], almost all of them do not work. + +This is problematic because many new distribution releases are switching to Wayland display manager by default once again. And if something as basic as a screen recorder does not work, it leaves a bad experience. + +[GNOME’s built-in screen recorder][3] works but it is hidden, has no GUI and no way to configure and control the recordings. There is another tool called [Kooha][4] but it keeps on displaying a timer on the screen. + +[Switching between Xorg and Wayland][5] just for screen recording is not very convenient. + +Amidst all this, I was happy to learn that Wayland support landed in OBS Studio with version 27 release thanks to Pipewire. But even there, it’s not straightforward and hence I am going to show you the steps for screen recording on Wayland using [OBS Studio][6]. + +### Using OBS to screen record on Wayland + +![][7] + +Let’s see how it is done. + +#### Step 1: Install OBS Studio + +You should install OBS Studio version 27 first. It is already included in Ubuntu 21.10 which I am suing in this tutorial. + +To install OBS Studio 27 on Ubuntu 18.04, 20.04, Linux Mint 20 etc, use the [official OBS Studio][8] [][8][PPA][8]. + +Open a terminal and use the following commands one by one: + +``` +sudo add-apt-repository ppa:obsproject/obs-studio +sudo apt update +sudo apt install obs-studio +``` + +If there is an older version of OBS Studio installed already, it will be upgraded to the newer version. + +For Fedora, Arch and other distributions, please check your package manager or unofficial repositories for installing the latest version of OBS Studio. + +#### Step 2: Check if Wayland capture is working + +Please make sure that you are using Wayland. Now start OBS Studio and go through all the stuff it shows on the first run. I am not going to show that. + +The main step is to add Pipewire as a screen capture source. Click on the + symbol under the Sources list. + +![Add screen capture source in OBS Studio][9] + +Do you see anything that reads Screen Capture (PipeWire)? + +![Do you see PipeWire option in the screen sources?][10] + +**If the answer is no, quit OBS Studio**. This is normal. OBS Studio does not switch to use Wayland automatically in Ubuntu at least. There is a fix for that. + +Open a terminal and use the following command: + +``` +export QT_QPA_PLATFORM=wayland +``` + +In the same terminal, run the following command to start OBS Studio: + +``` +obs +``` + +It will show some message on the terminal. Ignore them. Your focus should be on the OBS Studio GUI. Try to add screen capture once again. You should see the PipeWire option now. + +![][10] + +You explicitly asked OBS Studio to use Wayland this time with the QT_QPA_PLATFORM variable. + +Select PipeWire as the source and then it asks you to choose a display screen. Select it and click on the Share button. + +![][11] + +Now it should show your screen recursively infinite number of times. If you see that, you could start recording the screen in Wayland now. + +![][12] + +#### Step 3: Make changes permanent + +That was good. You just verified that you can record your screen on Wayland. But setting the environment variable and starting OBS from the terminal each time is not convenient. + +What you can do is to **export the variable to your ~/.bash_profile (for you) or /etc/profile (for all users on the system).** + +``` +export QT_QPA_PLATFORM=wayland +``` + +Log out and log back in. Now OBS will automatically start using this parameter and you can use it to record your screen in Wayland. + +I hope you find this quick tip helpful. If you still have questions or suggestions, please let me know in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/screen-record-obs-wayland/ + +作者:[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/best-linux-screen-recorders/ +[2]: https://wayland.freedesktop.org/ +[3]: https://itsfoss.com/gnome-screen-recorder/ +[4]: https://itsfoss.com/kooha-screen-recorder/ +[5]: https://itsfoss.com/switch-xorg-wayland/ +[6]: https://obsproject.com/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-screen-record-wayland.webp?resize=800%2C450&ssl=1 +[8]: https://launchpad.net/~obsproject/+archive/ubuntu/obs-studio +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-add-screen-capture-source.png?resize=800%2C537&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-wayland-support.png?resize=800%2C538&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-screen.png?resize=800%2C578&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-screen-recording-obs-wayland.jpg?resize=800%2C537&ssl=1 From d4206fbf5c877e38a48283a8d3d9c764d78a6558 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Sep 2021 05:02:54 +0800 Subject: [PATCH 0376/1588] add done: 20210915 Screen Recording in Linux With OBS and Wayland.md --- sources/tech/20210915 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20210915 .md diff --git a/sources/tech/20210915 .md b/sources/tech/20210915 .md new file mode 100644 index 0000000000..c87749cc13 --- /dev/null +++ b/sources/tech/20210915 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/booting-centos-8-rhel-8-emergency-mode/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/booting-centos-8-rhel-8-emergency-mode/ + +作者:[][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 7e677ef011f60a0f9fa34f9b538f2f8423a348b8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 15 Sep 2021 05:03:11 +0800 Subject: [PATCH 0377/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210915?= =?UTF-8?q?=20Raspberry=20Pi=20Zero=20vs=20Zero=20W:=20What=E2=80=99s=20th?= =?UTF-8?q?e=20Difference=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md --- ...i Zero vs Zero W- What-s the Difference.md | 110 ++++++++++++++++++ 1 file changed, 110 insertions(+) create mode 100644 sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md diff --git a/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md b/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md new file mode 100644 index 0000000000..6d575a950a --- /dev/null +++ b/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md @@ -0,0 +1,110 @@ +[#]: subject: "Raspberry Pi Zero vs Zero W: What’s the Difference?" +[#]: via: "https://itsfoss.com/raspberry-pi-zero-vs-zero-w/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Raspberry Pi Zero vs Zero W: What’s the Difference? +====== + +Raspberry Pi created a revolution when it launched the $25 mini computer ten years ago. Over the time, several variants of Raspberry Pi have been launched. Some upgrade a previous model and some are crafted for specific purposes. + +Of all the Raspberry models, Pi Zero and Pi Zero W are the cheapest ones aimed for small scale and IoT projects. Both devices are almost similar to each other but with a subtle and important difference. + +**So, what is the difference between Raspberry Pi Zero and Zero W? The W in Zero W stands for Wireless and it depicts its wireless capability over the Pi Zero model. That’s the single biggest difference between the two similar models.** + +Let’s take a look at a bit more in detail. + +### Key Difference Between Pi Zero and Pi Zero W + +![][1] + +While Raspberry Pi Zero was built with a goal that provides more utility with half of the size of the A+ board. + +And, Raspberry Pi Zero W was introduced later to include wireless connectivity built-in without needing a separate accessory/module to enable Bluetooth and Wi-Fi. + +This is the key difference between the two with the rest of the specifications remaining identical. + +So, if you want the support for: + + * 802.11 b/g/n wireless LAN + * Bluetooth 4.1 + * Bluetooth Low Energy (BLE) + + + +Raspberry Pi Zero W will be the definite choice to go with. + +Also, Raspberry Pi Zero W offers a variant with header pins included which is “Raspberry Pi Zero WH”. + +Preview | Product | Price | +---|---|---|--- +[![CanaKit Raspberry Pi Zero W \(Wireless\) Complete Starter Kit - 16 GB Edition][2]][3] | [CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition][3] | $32.99[][4] | [Buy on Amazon][5] + +### Raspberry Pi Zero and Raspberry Pi Zero W Specifications + +![Raspberry Pi Zero W][6] + +The [specifications for Raspberry Pi Zero W][7] and Zero are almost identical. + +You get a 1 GHz single-core CPU coupled with 512 MB RAM. For connectivity, you get a mini HDMI port, micro USB OTG support, micro USB power, and a CSI Camera connector (to plug in a camera module). + +These boards also feature a [HAT][8] (Hardware Attached on Top)-compatible 40 pin header, but generally, without the pins that let you easily plug the interfaces. + +You can choose to explore the capabilities using [various Raspberry Pi OS][9] available. In either case, just stick to the Raspberry Pi OS. + +### Raspberry Pi Zero series: Is it worth It? + +![Raspberry Pi Zero][10] + +Raspberry Pi Zero is a single-board computer that is popular for its form factor. Even though you have plenty of [Raspberry Pi zero alternatives][11], Raspberry Pi Zero is the recommended choice for all the good reasons. + +Of course, unless you have specific requirements. + +In addition to the size of the board, the pricing, power requirement, and processing power are some of the key highlights of this board under **$20**. + +So, if you are looking for the essential features under a budget, the Raspberry Zero series should work for you. + +**Recommended Read:** + +![][12] + +#### [27 Super Cool Raspberry Pi Zero W Projects for DIY Enthusiasts][13] + +The small form factor of the Raspberry Pi Zero W enables a new range of projects. Here are some cool projects you can build with your tiny Raspberry Pi Zero W. + +### Is Raspberry Pi Zero series affordable? + +Raspberry Pi Zero costs **$5** and the Raspberry Pi Zero W would cost you around **$10**. ****Of course, depending on its availability and region, the cost will differ. If you want the Raspberry Pi Zero W with header pins, it should cost you around **$14**. + +There are other devices that can be used as an [alternative to Raspberry Pi Zero][11] and they have similar price tag. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-zero-vs-zero-w/ + +作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-vs-zero-w.png?resize=800%2C450&ssl=1 +[2]: https://i1.wp.com/m.media-amazon.com/images/I/517BwcAPmTL._SL160_.jpg?ssl=1 +[3]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition) +[4]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[5]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Buy on Amazon) +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-w.png?resize=600%2C400&ssl=1 +[7]: https://itsfoss.com/raspberry-pi-zero-w/ +[8]: https://github.com/raspberrypi/hats +[9]: https://itsfoss.com/raspberry-pi-os/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-1.png?resize=600%2C400&ssl=1 +[11]: https://itsfoss.com/raspberry-pi-zero-alternatives/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/raspberry-pi-zero-w-projects.png?fit=800%2C450&ssl=1 +[13]: https://itsfoss.com/raspberry-pi-zero-projects/ From 6f8abcc67bdba48dff8d9256ddf904ea72e10961 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 15 Sep 2021 08:14:23 +0800 Subject: [PATCH 0378/1588] Delete 20210915 .md --- sources/tech/20210915 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20210915 .md diff --git a/sources/tech/20210915 .md b/sources/tech/20210915 .md deleted file mode 100644 index c87749cc13..0000000000 --- a/sources/tech/20210915 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/booting-centos-8-rhel-8-emergency-mode/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/booting-centos-8-rhel-8-emergency-mode/ - -作者:[][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 4937543b7b3a30c9c6137256ed2fbac9e98e322a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 Sep 2021 08:48:11 +0800 Subject: [PATCH 0379/1588] translated --- ...rce community health analytics platform.md | 58 ------------------- ...rce community health analytics platform.md | 57 ++++++++++++++++++ 2 files changed, 57 insertions(+), 58 deletions(-) delete mode 100644 sources/tech/20210910 Building an open source community health analytics platform.md create mode 100644 translated/tech/20210910 Building an open source community health analytics platform.md diff --git a/sources/tech/20210910 Building an open source community health analytics platform.md b/sources/tech/20210910 Building an open source community health analytics platform.md deleted file mode 100644 index d512103802..0000000000 --- a/sources/tech/20210910 Building an open source community health analytics platform.md +++ /dev/null @@ -1,58 +0,0 @@ -[#]: subject: "Building an open source community health analytics platform" -[#]: via: "https://opensource.com/article/21/9/openrit-mystic" -[#]: author: "Quinn Foster https://opensource.com/users/quinn-foster" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Building an open source community health analytics platform -====== -An academic OSPO is working with CHAOSS software to build a community -health analytics platform. -![metrics and data shown on a computer screen][1] - -Rochester Institute of Technology (RIT) has made considerable strides in increasing its presence in the open source world lately. RIT's _Free and Open Source Software and Free Culture_ minor is the first of its kind in academia. For example, its open source programs office, Open @ RIT, has begun helping RIT faculty and staff fellows build and maintain communities for their open source projects. - -These strides are driven by the students, faculty, and staff at RIT. Already, a growing number of people at the university are heading their own open projects. However, running an entirely open source project can be cumbersome. Much of this comes from maintaining a community for the project and managing data such as the project's code, issue tracking, and repositories. - -To help these people, Open @ RIT is creating a system called Mystic, a community health analytics platform that utilizes [GrimoireLab][2], an open source toolkit developed by [CHAOSS][3] software that provides metrics and analytics for open source projects. GrimoireLab allows users to gather, enrich, filter, and visualize a project's data, such as the time it takes a reported issue to be solved, contributor affiliations, and much more. - -Mystic will act as a front-end portal where anybody can submit their project. From there, the project will be sent directly to GrimoireLab, which will compute and publish the project's metrics for the submitter after only a few minutes. - -> "Our hope is that anyone at RIT who is managing, leading, or participating in an open source project will be able to submit that project to Mystic and have any metrics they need provided to them," says Emi Simpson, full-stack developer at Open @ RIT and head developer of Mystic. - -The process is straightforward. After logging into Mystic, the user uploading their project opens up a pop-up window where they enter details about the project and links to data sources like GitLab, RSS feed, and an Open Software Foundation (OSF) project. Once the details and project are saved, Mystic uses GrimoireLab to automatically retrieve metrics from the project source and render graphs for each source. The project and its metrics will then be displayed on its own dashboard. - -![Mystic statistics page][4] - -Screenshot by Quinn Foster, [CC-BY SA 4.0][5] - -These dashboards will also be displayed and listed on a single page for others to see, encouraging cooperative development and interaction between open source communities within RIT worldwide. Simpson and Open @ RIT hope this will increase participation in open work at RIT and further cement the university as an open work hub. - -> "If somebody asks what is RIT doing for open source software, my hope is that people will be able to point to Mystic and GrimoireLab and say 'here's what,'" says Simpson. "By building that metric of 'here's what we're doing, here's what we've contributed, here are the projects that people are working on,' we can build a community at RIT centered around the work that we're doing in open source." - -At the moment, Mystic is still under development and not ready for a production environment, but its potential for both RIT and open source as a whole remains well in sight. Future goals include implementing easy integration with the university's reporting tools and comprehensive dashboards at the project level and in aggregate. - -Are you interested in contributing to Mystic? [Get in touch with us][6] to get started. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/openrit-mystic - -作者:[Quinn Foster][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/quinn-foster -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) -[2]: https://chaoss.github.io/grimoirelab/ -[3]: https://chaoss.community/ -[4]: https://opensource.com/sites/default/files/uploads/mystic_statistics_page.png (Mystic statistics page) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://opensource.ieee.org/rit/mystic diff --git a/translated/tech/20210910 Building an open source community health analytics platform.md b/translated/tech/20210910 Building an open source community health analytics platform.md new file mode 100644 index 0000000000..a47c94bb03 --- /dev/null +++ b/translated/tech/20210910 Building an open source community health analytics platform.md @@ -0,0 +1,57 @@ +[#]: subject: "Building an open source community health analytics platform" +[#]: via: "https://opensource.com/article/21/9/openrit-mystic" +[#]: author: "Quinn Foster https://opensource.com/users/quinn-foster" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +构建开源的社区健康分析平台 +====== +一个学术性的 OSPO 正在与 CHAOSS 软件合作以建立一个社区健康分析平台。 +![metrics and data shown on a computer screen][1] + +罗切斯特理工学院(RIT)最近在增加其在开源世界的存在方面取得了相当大的进展。例如,其开源项目办公室,Open@RIT,已经开始帮助 RIT 的教职员工为他们的开源项目建立和维护社区。 + +这些进展是由 RIT 的学生、教师和工作人员推动的。目前,大学里已经有越来越多的人在领导他们自己的开放项目。然而,运行一个完全的开源项目可能是很麻烦的。这主要来自于维护项目的社区和管理数据,如项目的代码、问题跟踪和仓库。 + +为了帮助这些人,Open@RIT 正在创建一个名为 Mystic 的系统,这是一个社区健康分析平台,利用了 [GrimoireLab][2],这是一个由 [CHAOSS][3] 软件开发的开源工具包,为开源项目提供指标和分析。GrimoireLab 允许用户收集、丰富、过滤和可视化一个项目的数据,例如一个报告的问题被解决的时间、贡献者的关系等。 + +Mystic 将作为一个前端门户,任何人都可以提交他们的项目。在那里,项目将被直接发送到 GrimoireLab,它将在几分钟后为提交者计算并发布项目的指标。 + +> Open@RIT 的全栈开发者和 Mystic 的首席开发者 Emi Simpson 说:“我们希望 RIT 的任何管理、领导或参与开源项目的人都能将该项目提交给 Mystic,并获得他们需要的任何指标”。 + +这个过程很简单。登录 Mystic 后,上传项目的用户会打开一个弹出式窗口,输入项目的细节和数据源的链接,如 GitLab、RSS feed 和一个开放软件基金会(OSF)项目。一旦细节和项目被保存下来,Mystic 就会使用 GrimoireLab 从项目源中自动检索指标,并为每个源渲染图表。然后,该项目及其指标将显示在它自己的仪表板上。 + +![Mystic statistics page][4] + +Screenshot by Quinn Foster,[CC-BY SA 4.0][5] + +这些仪表盘将并列显示在一个页面上,以供其他人查看,鼓励全世界 RIT 内部的开源社区之间的合作开发和互动。Simpson 和 Open@RIT 希望这将增加 RIT 的开放工作的参与度,并进一步巩固该大学作为开放工作中心的地位。 + +> Simpson 说:“如果有人问 RIT 在为开源软件做什么,我希望人们能够指着 Mystic 和 GrimoireLab 说就是这些。通过建立‘这些’是我们正在做的,这些是我们的贡献,这些是人们正在做的项目的指标,我们可以在 RIT 建立一个以我们正在做的开源工作为中心的社区。” + +目前,Mystic 仍在开发中,还没有准备好进入生产环境,但它对 RIT 和整个开源的潜力仍然是有目共睹的。未来的目标包括实现与大学报告工具的轻松整合,以及在项目层面和总体上的综合仪表盘。 + +你对 Mystic 的贡献感兴趣吗?[请与我们联系][6]开始吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/openrit-mystic + +作者:[Quinn Foster][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/quinn-foster +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_data_dashboard_system_computer_analytics.png?itok=oxAeIEI- (metrics and data shown on a computer screen) +[2]: https://chaoss.github.io/grimoirelab/ +[3]: https://chaoss.community/ +[4]: https://opensource.com/sites/default/files/uploads/mystic_statistics_page.png (Mystic statistics page) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.ieee.org/rit/mystic From d85a652783966e9454cc0ad1ecc2d95c0e8056b3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 15 Sep 2021 08:50:33 +0800 Subject: [PATCH 0380/1588] translating --- .../20210915 Screen Recording in Linux With OBS and Wayland.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md b/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md index 2c39272ba7..57fe47ea55 100644 --- a/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md +++ b/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/screen-record-obs-wayland/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 53e8e3345c0abf1122bf907b269402327ee3be1f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Sep 2021 09:21:00 +0800 Subject: [PATCH 0381/1588] PRF&PUB @imgradeone https://linux.cn/article-13785-1.html --- ...g the Top Indicator Panel Back in GNOME.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) rename {translated/tech => published}/20210906 Getting the Top Indicator Panel Back in GNOME.md (81%) diff --git a/translated/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md b/published/20210906 Getting the Top Indicator Panel Back in GNOME.md similarity index 81% rename from translated/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md rename to published/20210906 Getting the Top Indicator Panel Back in GNOME.md index 0659356bee..784a213bb9 100644 --- a/translated/tech/20210906 Getting the Top Indicator Panel Back in GNOME.md +++ b/published/20210906 Getting the Top Indicator Panel Back in GNOME.md @@ -3,20 +3,20 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "imgradeone" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13785-1.html" 恢复 GNOME 顶栏的托盘图标 ====== GNOME 是一款流行的 Linux 桌面环境,致力于为 Linux 用户提供现代化的桌面体验。 -虽然这款桌面绝大部分功能都是可用的,但 GNOME 团队的某些决定确实也让许多用户恼火、质疑。 +虽然这款桌面绝大部分功能都不错,但 GNOME 团队的某些决定确实也让许多用户恼火、质疑。 前脚不能在桌面摆放图标和文件,后脚将右键菜单中的 [新建文档选项移除][1],现在,除此之外,GNOME 同样也移除了托盘图标栏功能。 -怎么说,你总得知道托盘图标栏是什么吧?这些小图标允许你使用相应应用程序的额外功能。我自己的 Ubuntu 系统里就有许多托盘图标。 +怎么说,你总得知道托盘图标栏是什么吧?这些小图标允许你使用相应应用程序的附加功能。我自己的 Ubuntu 系统里就有许多托盘图标。 ![托盘图标栏][2] @@ -32,11 +32,11 @@ GNOME 是一款流行的 Linux 桌面环境,致力于为 Linux 用户提供现 ![启用 GNOME 插件的浏览器扩展][5] -现在,这里有一些可以向顶栏增加托盘图标的 GNOME 插件。在撰写本篇教程的时候,[AppIndicator and KStatusNotifierItem Support][6] 这款插件在 GNOME 的较新版本中已经有良好的开发优化与支持。、 +现在,有一些可以向顶栏增加托盘图标的 GNOME 插件。在撰写本篇教程的时候,[AppIndicator and KStatusNotifierItem Support][6] 这款插件在 GNOME 的较新版本中已经有良好的开发优化与支持。 前往插件的页面: -[AppIndicator 插件][6] +- [AppIndicator 插件][6] 在这个页面中,你应该能看到一个开关按钮。点击这个按钮即可安装该插件。 @@ -46,7 +46,7 @@ GNOME 是一款流行的 Linux 桌面环境,致力于为 Linux 用户提供现 ![安装插件][8] -也许安装插件后,插件不会立即生效。此时,你必须重启 GNOME。在 Xorg 会话中,你只需要按下 Alt + F2 并输入 `r` 即可重启 GNOME,但这个操作不支持 Wayland 会话。 +也许安装插件后,插件不会立即生效。此时,你必须重启 GNOME。在 Xorg 会话中,你只需要按下 `Alt + F2` 并输入 `r` 即可重启 GNOME,但这个操作不支持 Wayland 会话。 注销当前会话,并且重新登录,此后托盘图标应该就能成功启用了。如果你安装了任何一款带托盘图标的软件,那么你应该可以在顶栏上看见这些图标的身影了。 @@ -54,7 +54,7 @@ GNOME 是一款流行的 Linux 桌面环境,致力于为 Linux 用户提供现 ![Dropbox 托盘图标在 GNOME 下可用的截图][9] -希望这个小提示能帮助你恢复 GNOME 顶栏中的托盘图标。 +希望这个小技巧能帮助你恢复 GNOME 顶栏中的托盘图标。 我完全不理解,为什么 GNOME 的开发者会认为把这种实用性极强的功能删除会是个好主意。不过,上帝关上了一扇门,却(通常)会再打开一扇窗。好好享受按你的偏好运作的 GNOME 吧。 @@ -65,7 +65,7 @@ via: https://itsfoss.com/enable-applet-indicator-gnome/ 作者:[Abhishek Prakash][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 dc57114ef20e1c9ac13c95ae8bd5346569d02223 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Sep 2021 09:46:13 +0800 Subject: [PATCH 0382/1588] PRF @unigeorge --- ...orithms are slow (and hashmaps are fast).md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md b/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md index a40b88e1a5..053e1610cc 100644 --- a/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md +++ b/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md @@ -10,9 +10,11 @@ 浅谈慢速的二次算法与快速的 hashmap ====== -大家好!昨天我与一位正在准备编程面试并努力学习算法基础知识的朋友进行了一些交流。 +![](https://img.linux.net.cn/data/attachment/album/202109/15/094524s7dlcq74ksqazyyc.jpg) -我们聊到了二次时间与线性时间算法的话题,我认为在这里写这篇文章会很有趣,因为避免二次时间算法不仅在面试中很重要——有时在现实生活中了解一下也是很好的!后面我会快速解释一下什么是“二次时间算法” :) +大家好!昨天我与一位朋友聊天,他正在准备编程面试,并试图学习一些算法基础知识。 + +我们聊到了二次时间quadratic-time线性时间linear-time算法的话题,我认为在这里写这篇文章会很有趣,因为避免二次时间算法不仅在面试中很重要——有时在现实生活中了解一下也是很好的!后面我会快速解释一下什么是“二次时间算法” :) 以下是我们将要讨论的 3 件事: @@ -26,11 +28,11 @@ 我们来讨论一个简单的面试式问题:获取 2 个数字列表的交集。 例如,`intersect([1,2,3], [2,4,5])` 应该返回 `[2]`。 -这个问题也是有些现实应用的——你可以假设有一个真实程序,其需求正是取两个 ID 列表交集。 +这个问题也是有些现实应用的——你可以假设有一个真实程序,其需求正是取两个 ID 列表的交集。 ### “显而易见”的解决方案: -我们来写一些获取 2 个列表交集的代码。下面是一个实现此需求的程序,命名为“quadratic.py”。 +我们来写一些获取 2 个列表交集的代码。下面是一个实现此需求的程序,命名为 `quadratic.py`。 ``` import sys @@ -56,7 +58,7 @@ def run(n): run(int(sys.argv[1])) ``` -程序名为 `quadratic.py`(LCTT 译注:“quadratic”意为“二次的”)的原因是:如果 `list1` 和 `list2` 的大小为 `n`,那么内层循环(`if x == y`)会运行 `n^2` 次。在数学中,像 `x^2` 这样的函数就称为“二次”函数。 +程序名为 `quadratic.py`(LCTT 译注:“quadratic”意为“二次方的”)的原因是:如果 `list1` 和 `list2` 的大小为 `n`,那么内层循环(`if x == y`)会运行 `n^2` 次。在数学中,像 `x^2` 这样的函数就称为“二次”函数。 ### `quadratic.py` 有多慢? @@ -205,7 +207,7 @@ def intersection(list1, list2): ### hashmap 查找是即时的(“常数级时间”) -我们看一下快速版程序中的 if 语句: +我们看一下快速版程序中的 `if` 语句: ``` if y in set1: @@ -214,7 +216,7 @@ if y in set1: 你可能会认为如果 `set1` 包含 1000 万个元素,那么这个查找——`if y in set1` 会比 `set1` 包含 1000 个元素时慢。但事实并非如此!无论 `set1` 有多大,所需时间基本是相同的(超级快)。 -这是因为 `set1` 是一个 hash set 集合,它是一种只有键没有值的 hashmap 或 hashtable 结构。 +这是因为 `set1` 是一个哈希集合,它是一种只有键没有值的 hashmap(hashtable)结构。 我不准备在本文中解释 _为什么_ hashmap 查找是即时的,但是神奇的 Vaidehi Joshi 的 [basecs][1] 系列中有关于 [hash table][2] 和 [hash 函数][3] 的解释,其中讨论了 hashmap 即时查找的原因。 @@ -239,7 +241,7 @@ via: https://jvns.ca/blog/2021/09/10/hashmaps-make-things-fast/ 作者:[Julia Evans][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 1966ccbde9e43060d123463f3617de025ebcbba4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Sep 2021 09:46:43 +0800 Subject: [PATCH 0383/1588] PUB @unigeorge https://linux.cn/article-13786-1.html --- ...Quadratic algorithms are slow (and hashmaps are fast).md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210910 Quadratic algorithms are slow (and hashmaps are fast).md (99%) diff --git a/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md b/published/20210910 Quadratic algorithms are slow (and hashmaps are fast).md similarity index 99% rename from translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md rename to published/20210910 Quadratic algorithms are slow (and hashmaps are fast).md index 053e1610cc..c20f6d13c9 100644 --- a/translated/tech/20210910 Quadratic algorithms are slow (and hashmaps are fast).md +++ b/published/20210910 Quadratic algorithms are slow (and hashmaps are fast).md @@ -3,9 +3,9 @@ [#]: author: "Julia Evans https://jvns.ca/" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13786-1.html" 浅谈慢速的二次算法与快速的 hashmap ====== From ae69e1131df890e760d78cc8f1a8f89243263cf8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Sep 2021 10:50:27 +0800 Subject: [PATCH 0384/1588] PRF @perfiffer --- ...x Terminal -For Experts and Adventurers.md | 55 ++++++++++--------- 1 file changed, 28 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md b/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md index f5a77085c9..1752c1a318 100644 --- a/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md +++ b/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md @@ -3,24 +3,26 @@ [#]: author: "Hunter Wittenborn https://itsfoss.com/author/hunter/" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -怎样在 Linux 终端下使用 dd 命令创建一个 Live USB 驱动器 [针对专家和冒险者] +怎样在 Linux 终端下使用 dd 命令创建一个临场 USB 驱动器 ====== -有很多的图形化工具可以用来创建 live USB 驱动器。Linux 上的 [Etcher][1] 可能是最受欢迎的。为此,Ubuntu 开发了自己的启动盘创建工具。 +![](https://img.linux.net.cn/data/attachment/album/202109/15/104940ucajv4o4zb8934ll.jpg) -但是,高级 Linux 用户可能更喜欢使用 dd 命令在 Linux 终端中创建 live USB,这会更快速便捷。 +有很多的图形化工具可以用来创建临场live USB 驱动器。Linux 上的 [Etcher][1] 可能是最受欢迎的。为此,Ubuntu 也开发了自己的启动盘创建工具。 -dd 命令是一个 [客户端][2] 工具,提供了强大的功能用来复制和转换文件。 +但是,资深 Linux 用户可能更喜欢使用 `dd` 命令在 Linux 终端中创建临场 USB,这会更快速便捷。 -一个普通的使用示例,用户使用 dd 命令向他们的外部存储设备(例如 USB 驱动盘)写入 ISO 文件,用来给他们的电脑或者笔记本安装一个 Linux 发型版。 +`dd` 命令是一个 [命令行][2] 工具,它提供了用来复制和转换文件的强大功能。 + +一个常见的使用示例是,用户使用 `dd` 命令将 ISO 文件写入到他们的外部存储设备(例如 USB 驱动盘),以用来给他们的电脑或者笔记本安装一个新的 Linux 发行版。 这就是我将在本教程中展示的内容。我将带你认识需要的命令,从终端找到我们的 USB 驱动器,然后对 ISO 文件进行实际刷写。 -### 使用 dd 命令从 ISO 镜像创建 live USB +### 使用 dd 命令从 ISO 镜像创建临场 USB 在我向你展示步骤前,让我带你快速过一下你将要使用到的命令并解释它的作用。 @@ -38,41 +40,39 @@ dd if="./filename.iso" of="/dev/sdb" status="progress" conv="fsync" 首先,你输入 `dd`。没错,这就是你要运行的程序的名称。 -接下来,你指定 `if="./filename.iso"`。`if` 代表 input file,告诉 `dd` 命令你将要向外部存储设备写入哪个文件。 +接下来,你指定 `if="./filename.iso"`。`if` 代表输入文件input file,告诉 `dd` 命令你将要向外部存储设备写入哪个文件。 -之后,你输入 `of="/dev/sdb"`。和 `if` 一样,`of` 代表的是 output file。 +之后,你输入 `of="/dev/sdb"`。和 `if` 一样,`of` 代表的是输出文件output file。 要记住的是,输出文件在技术上不必是系统上的文件。你还可以指定诸如外部设备路径之类的内容(如示例所示),它看起来像系统上的普通文件,但实际上指向连接到你机器的设备。 `status` 可以设定为 3 个选项:`none`、`noxfer` 和 `progress`。 -你设置的 `progress` 选项将使 `dd` 任务显示有关已将多少 ISO 文件传输到存储驱动器的定期统计信息,以及对 `dd` 任务完成前需要多长时间的估计。 - -如果你改为设置 `none` 选项,`dd` 任务只会在写入 ISO 文件期间打印错误消息,并且删除进度条之类的内容。 - -`noxfer` 选项隐藏了传输完成后打印的一些信息,例如从开始到完成所用的时间。 +- 你设置的 `progress` 选项将使 `dd` 任务显示有关已将多少 ISO 文件传输到存储驱动器的定期统计信息,以及对 `dd` 任务完成前需要多长时间的估计。 +- 如果你改为设置 `none` 选项,`dd` 任务在写入 ISO 文件期间只会打印错误消息,并且删除进度条之类的内容。 +- `noxfer` 选项隐藏了传输完成后打印的一些信息,例如从开始到完成所用的时间。 最后,你将 `conv` 选项设置为 `fsync`。这会导致 `dd` 任务在整个 ISO 文件写入 USB 驱动器之前不会报告成功写入。 如果你省略这个选项,`dd` 任务会工作的很好(并且实际上可能看起来运行得更快),但你可能会发现你的系统需要很长时间才能告诉你移除 USB 驱动器是安全的,因为它会在后台完成 ISO 的内容写入,从而允许你在此期间做其它事情。 -现在你明白了你必须做什么,让我们看看如何去做。 +**现在你明白了你必须做什么,让我们看看如何去做。** -注意事项 +> **注意事项** +> +> 命令行是把双刃剑。当你在命令行使用类似于 `dd` 命令时必须十分小心。你必须确保你目标输出文件是正确的设备。一个错误的步骤就可能会格式化你的系统硬盘,你的操作系统也会因此而损坏。 -命令行是把双刃剑。当你在命令行使用类似于 `dd` 命令时必须十分小心。你必须确保你输入文件写入的地方是正确的设备。一个错误的步骤就可能会格式化你的系统硬盘,你的操作系统也会因此而损坏。 - -#### 第一步: 下载所需的 ISO 镜像 +#### 第 0 步: 下载所需的 ISO 镜像 不用说,你需要有一个 ISO 镜像文件才能将其刷写到 USB 上。 -我将使用 Ubuntu 20.04 ISO (可在此处下载[5]) 来测试我之前介绍的 `dd` 命令。 +我将使用 Ubuntu 20.04 ISO(可在此处[下载][5])来测试我之前介绍的 `dd` 命令。 -#### 第二步: 获取 USB 盘符 +#### 第 1 步: 获取 USB 盘符 -插入你的 USB 磁盘 +插入你的 USB 驱动器。 -我为 `of` 参数输入的具体路径是 `/dev/sdb`。USB 磁盘通常会标记为 /dev/sdb,但这不是硬性规定。 +我为 `of` 参数输入的具体路径是 `/dev/sdb`。USB 磁盘通常会标记为 `/dev/sdb`,但这不是硬性规定。 此路径可能因你的系统而异,你可以使用 `lsblk` 命令确认 USB 磁盘的路径。只需从列表中查找一个看起来像你的 USB 磁盘大小的驱动器,就可以了。 @@ -82,15 +82,16 @@ dd if="./filename.iso" of="/dev/sdb" status="progress" conv="fsync" ![][7] -现在你已经确认了外部驱动器的路径,让我们开始创建 live USB。 +现在你已经确认了外部驱动器的路径,让我们开始创建临场 USB。 -#### 第三步:将 ISO 文件写入 USB 磁盘 +#### 第 2 步:将 ISO 文件写入 USB 磁盘 在下载 ISO 文件的目录打开一个终端,然后运行以下命令(如果 `/dev/sdb` 与你的存储设备名称不同,请记住将其替换): ``` sudo dd if="./ubuntu-20.04.2.0-desktop-amd64.iso" of="/dev/sdb" status="progress" conv="fsync" ``` + 之后,让 `dd` 去做剩下的事情,它会在完成后打印一条完成消息: ![][8] @@ -101,7 +102,7 @@ sudo dd if="./ubuntu-20.04.2.0-desktop-amd64.iso" of="/dev/sdb" status="progress 现在,你可以通过终端做更多的事情,让你的工作效率大大提高。 -对 `dd` 命令有任何剩余的问题,或者无法正常工作?请随时在下面的评论部分中留下你的问题。 +对 `dd` 命令有任何没解决的问题,或者无法正常工作?请随时在下面的评论部分中留下你的问题。 -------------------------------------------------------------------------------- @@ -110,7 +111,7 @@ via: https://itsfoss.com/live-usb-with-dd-command/ 作者:[Hunter Wittenborn][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 5ae64577aa7bb22fdb0aef09def91a2069e8bfb0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 15 Sep 2021 10:51:06 +0800 Subject: [PATCH 0385/1588] PUB @perfiffer https://linux.cn/article-13787-1.html --- ...SB Drive in Linux Terminal -For Experts and Adventurers.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md (98%) diff --git a/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md b/published/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md similarity index 98% rename from translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md rename to published/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md index 1752c1a318..8c2b4ba03a 100644 --- a/translated/tech/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md +++ b/published/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13787-1.html" 怎样在 Linux 终端下使用 dd 命令创建一个临场 USB 驱动器 ====== From c94f9adfaa6840f1b8d5d1032c917b8c98cd555e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Sep 2021 05:02:24 +0800 Subject: [PATCH 0386/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210915?= =?UTF-8?q?=20How=20to=20check=20for=20update=20info=20and=20changelogs=20?= =?UTF-8?q?with=20rpm-ostree=20db?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md --- ... info and changelogs with rpm-ostree db.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md diff --git a/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md b/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md new file mode 100644 index 0000000000..8d9f367425 --- /dev/null +++ b/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md @@ -0,0 +1,114 @@ +[#]: subject: "How to check for update info and changelogs with rpm-ostree db" +[#]: via: "https://fedoramagazine.org/how-to-check-for-update-info-and-changelogs-with-rpm-ostree-db/" +[#]: author: "Mateus Rodrigues Costa https://fedoramagazine.org/author/mateusrodcosta/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to check for update info and changelogs with rpm-ostree db +====== + +![][1] + +Photo by [Dan-Cristian Pădureț][2] on [Unsplash][3] + +This article will teach you how to check for updates, check the changed packages, and read the changelogs with _rpm-ostree db_ and its subcommands. + +The commands will be demoed on a Fedora Silverblue installation and should work on any OS that uses _rpm-ostree_. + +### Introduction + +Let’s say you are interested in immutable systems. Using a base system that is read-only while you build your use cases on top of containers technology sounds very attractive and it persuades you to select a distro that uses _rpm-ostree_. + +You now find yourself on [Fedora Silverblue][4] (or another similar distro) and you want to check for updates. But you hit a problem. While you can find the updated packages on Fedora Silverblue with GNOME Software, you can’t actually read their changelogs. You also can’t [use _dnf updateinfo_ to read them on the command line][5], since there’s no DNF on the host system. + +So, what should you do? Well, _rpm-ostree_ has subcommands that can help in this situation. + +### Checking for updates + +The first step is to check for updates. Simply run _rpm-ostree upgrade –check_: + +``` +$ rpm-ostree upgrade --check +... +AvailableUpdate: + Version: 34.20210905.0 (2021-09-05T20:59:47Z) + Commit: d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 + GPGSignature: Valid signature by 8C5BA6990BDB26E19F2A1A801161AE6945719A39 + SecAdvisories: 1 moderate + Diff: 4 upgraded +``` + +Notice that while it doesn’t tell the updated packages in the output, it does show the Commit for the update as _d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4_. This will be useful later. + +Next thing you need to do is find the Commit for the current deployment you are running. Run _rpm-ostree status_ to get the BaseCommit of the current deployment: + +``` +$ rpm-ostree status +State: idle +Deployments: +● fedora:fedora/34/x86_64/silverblue + Version: 34.20210904.0 (2021-09-04T19:16:37Z) + BaseCommit: e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e + GPGSignature: Valid signature by 8C5BA6990BDB26E19F2A1A801161AE6945719A39 + RemovedBasePackages: ... + LayeredPackages: ... +... +``` + +For this example BaseCommit is _e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e_. + +Now you can find the diff of the two commits with _rpm-ostree db diff [commit1] [commit2]_. In this command _commit1_ will be the BaseCommit from the current deployment and _commit2_ will be the Commit from the upgrade checking command. + +``` +$ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 +ostree diff commit from: e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e +ostree diff commit to: d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 +Upgraded: + soundtouch 2.1.1-6.fc34 -> 2.1.2-1.fc34 +``` + +The diff output shows that _soundtouch_ was updated and indicates the version numbers. View the changelogs by adding _–changelogs_ to the previous command: + +``` +$ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 --changelogs +ostree diff commit from: e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e +ostree diff commit to: d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 +Upgraded: + soundtouch 2.1.1-6.fc34.x86_64 -> 2.1.2-1.fc34.x86_64 + * dom ago 29 2021 Uwe Klotz - 2.1.2-1 + - Update to new upstream version 2.1.2 + Bump version to 2.1.2 to correct incorrect version info in configure.ac + + * sex jul 23 2021 Fedora Release Engineering - 2.1.1-7 + - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild +``` + +This output shows the commit notes as well as the version numbers. + +### Conclusion + +Using _rpm-ostree db_ you are now able to have the functionality equivalent to _dnf check-update_ and _dnf updateinfo_. + +This will come in handy if you want to inspect detailed info about the updates you install. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/how-to-check-for-update-info-and-changelogs-with-rpm-ostree-db/ + +作者:[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/09/rpm-ostree-db_changelog-816x345.jpg +[2]: https://unsplash.com/@dancristianp?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/backdrop?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://fedoramagazine.org/what-is-silverblue/ +[5]: https://fedoramagazine.org/use-dnf-updateinfo-to-read-update-changelogs/ From 74bbdbc0f9a11a343d307ce1774dff4de815bc3b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Sep 2021 05:02:32 +0800 Subject: [PATCH 0387/1588] add done: 20210915 How to check for update info and changelogs with rpm-ostree db.md --- sources/tech/20210915 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210915 .md diff --git a/sources/tech/20210915 .md b/sources/tech/20210915 .md new file mode 100644 index 0000000000..e62faf33e9 --- /dev/null +++ b/sources/tech/20210915 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/linux-kernel-5-15-rc1/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From eab85a1a67d0981646d057949b4e986d27d4d147 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Sep 2021 05:02:54 +0800 Subject: [PATCH 0388/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210915?= =?UTF-8?q?=20A=20guide=20to=20web=20scraping=20in=20Python=20using=20Beau?= =?UTF-8?q?tiful=20Soup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210915 A guide to web scraping in Python using Beautiful Soup.md --- ...scraping in Python using Beautiful Soup.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 sources/tech/20210915 A guide to web scraping in Python using Beautiful Soup.md diff --git a/sources/tech/20210915 A guide to web scraping in Python using Beautiful Soup.md b/sources/tech/20210915 A guide to web scraping in Python using Beautiful Soup.md new file mode 100644 index 0000000000..0e46713039 --- /dev/null +++ b/sources/tech/20210915 A guide to web scraping in Python using Beautiful Soup.md @@ -0,0 +1,188 @@ +[#]: subject: "A guide to web scraping in Python using Beautiful Soup" +[#]: via: "https://opensource.com/article/21/9/web-scraping-python-beautiful-soup" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +A guide to web scraping in Python using Beautiful Soup +====== +The Beautiful Soup library in Python makes extracting HTML from web +pages easy. +![Computer screen with files or windows open][1] + +Today we'll discuss how to use the Beautiful Soup library to extract content from an HTML page. After extraction, we'll convert it to a Python list or dictionary using Beautiful Soup. + +### What is web scraping, and why do I need it? + +The simple answer is this: Not every website has an API to fetch content. You might want to get recipes from your favorite cooking website or photos from a travel blog. Without an API, extracting the HTML, or _scraping_, might be the only way to get that content. I'm going to show you how to do this in Python. + +**Not all websites take kindly to scraping, and some may prohibit it explicitly. Check with the website owners if they're okay with scraping.** + +### How do I scrape a website in Python? + +For web scraping to work in Python, we're going to perform three basic steps: + + 1. Extract the HTML content using the `requests` library. + 2. Analyze the HTML structure and identify the tags which have our content. + 3. Extract the tags using Beautiful Soup and put the data in a Python list. + + + +### Installing the libraries + +Let's first install the libraries we'll need. The `requests` library fetches the HTML content from a website. Beautiful Soup parses HTML and converts it to Python objects. To install these for Python 3, run: + + +``` +`pip3 install requests beautifulsoup4` +``` + +### Extracting the HTML + +For this example, I'll choose to scrape the [Technology][2] section of this website. If you go to that page, you'll see a list of articles with title, excerpt, and publishing date. Our goal is to create a list of articles with that information. + +The full URL for the Technology page is: + + +``` +`https://notes.ayushsharma.in/technology` +``` + +We can get the HTML content from this page using `requests`: + + +``` +#!/usr/bin/python3 +import requests + +url = '' + +data = requests.get(url) + +print(data.text) +``` + +The variable `data` will contain the HTML source code of the page. + +### Extracting content from the HTML + +To extract our data from the HTML received in `data`, we'll need to identify which tags have what we need. + +If you skim through the HTML, you’ll find this section near the top: + + +``` +<[div][3] class="col"> +  <[a][4] href="/2021/08/using-variables-in-jekyll-to-define-custom-content" class="post-card"> +    <[div][3] class="card"> +      <[div][3] class="card-body"> +        <[h5][5] class="card-title">Using variables in Jekyll to define custom content</[h5][5]> +        <[small][6] class="card-text text-muted">I recently discovered that Jekyll's config.yml can be used to define custom +          variables for reusing content. I feel like I've been living under a rock all this time. But to err over and +          over again is human.</[small][6]> +      </[div][3]> +      <[div][3] class="card-footer text-end"> +        <[small][6] class="text-muted">Aug 2021</[small][6]> +      </[div][3]> +    </[div][3]> +  </[a][4]> +</[div][3]> +``` + +This is the section that repeats throughout the page for every article. We can see that `.card-title` has the article title, `.card-text` has the excerpt, and `.card-footer > small` has the publishing date. + +Let's extract these using Beautiful Soup. + + +``` +#!/usr/bin/python3 +import requests +from bs4 import BeautifulSoup +from pprint import pprint + +url = '' +data = requests.get(url) + +my_data = [] + +html = BeautifulSoup(data.text, 'html.parser') +articles = html.select('a.post-card') + +for article in articles: + +    title = article.select('.card-title')[0].get_text() +    excerpt = article.select('.card-text')[0].get_text() +    pub_date = article.select('.card-footer small')[0].get_text() + +    my_data.append({"title": title, "excerpt": excerpt, "pub_date": pub_date}) + +pprint(my_data) +``` + +The above code extracts the articles and puts them in the `my_data` variable. I'm using `pprint` to pretty-print the output, but you can skip it in your code. Save the code above in a file called `fetch.py`, and then run it using: + + +``` +`python3 fetch.py` +``` + +If everything went fine, you should see this: + + +``` +[{'excerpt': "I recently discovered that Jekyll's config.yml can be used to" +"define custom variables for reusing content. I feel like I've" +'been living under a rock all this time. But to err over and over' +'again is human.', +'pub_date': 'Aug 2021', +'title': 'Using variables in Jekyll to define custom content'}, +{'excerpt': "In this article, I'll highlight some ideas for Jekyll" +'collections, blog category pages, responsive web-design, and' +'netlify.toml to make static website maintenance a breeze.', +'pub_date': 'Jul 2021', +'title': 'The evolution of ayushsharma.in: Jekyll, Bootstrap, Netlify,' +'static websites, and responsive design.'}, +{'excerpt': "These are the top 5 lessons I've learned after 5 years of" +'Terraform-ing.', +'pub_date': 'Jul 2021', +'title': '5 key best practices for sane and usable Terraform setups'}, + +... (truncated) +``` + +And that's all it takes! In 22 lines of code, we've built a web scraper in Python. You can find the [source code in my example repo][7]. + +### Conclusion + +With the website content in a Python list, we can now do cool stuff with it. We could return it as JSON for another application or convert it to HTML with custom styling. Feel free to copy-paste the above code and experiment with your favorite website. + +Have fun, and keep coding. + +* * * + +_This article was originally published on the [author's personal blog][8] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/web-scraping-python-beautiful-soup + +作者:[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/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://notes.ayushsharma.in/technology +[3]: http://december.com/html/4/element/div.html +[4]: http://december.com/html/4/element/a.html +[5]: http://december.com/html/4/element/h5.html +[6]: http://december.com/html/4/element/small.html +[7]: https://gitlab.com/ayush-sharma/example-assets/-/blob/fd7d2dfbfa3ca34103402993b35a61cbe943bcf3/programming/beautiful-soup/fetch.py +[8]: https://notes.ayushsharma.in/2021/08/a-guide-to-web-scraping-in-python-using-beautifulsoup From 1923641b18ace7a3df6ec68948724b70a59cb27b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Sep 2021 05:03:10 +0800 Subject: [PATCH 0389/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210915?= =?UTF-8?q?=20Build=20a=20data=20sharding=20service=20with=20DistSQL?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210915 Build a data sharding service with DistSQL.md --- ...ld a data sharding service with DistSQL.md | 378 ++++++++++++++++++ 1 file changed, 378 insertions(+) create mode 100644 sources/tech/20210915 Build a data sharding service with DistSQL.md diff --git a/sources/tech/20210915 Build a data sharding service with DistSQL.md b/sources/tech/20210915 Build a data sharding service with DistSQL.md new file mode 100644 index 0000000000..3daabaef4d --- /dev/null +++ b/sources/tech/20210915 Build a data sharding service with DistSQL.md @@ -0,0 +1,378 @@ +[#]: subject: "Build a data sharding service with DistSQL" +[#]: via: "https://opensource.com/article/21/9/distsql" +[#]: author: "Meng Haoran https://opensource.com/users/haoran-meng" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Build a data sharding service with DistSQL +====== +Database sharding demonstrates the additional functionality of DistSQL. +![Person standing in front of a giant computer screen with numbers, data][1] + +If you're reading this, then you're probably familiar with the data query and programming language, SQL (Structured Query Language). It's also used as the standard language for management systems for accessing data, querying, updating, and managing relational database systems. Like standard SQL, DistSQL, or Distributed SQL, it is a built-in SQL language unique to ShardingSphere that provides incremental functional capabilities beyond standard SQL. Leveraging ShardingSphere's powerful SQL parsing engine, DistSQL provides a syntax structure and syntax validation system like that of standard SQL, making DistSQL more flexible while maintaining regularity. ShardingSphere's Database Plus concept aims at creating an open source distributed database system that is both functional and relevant to the actual database business. DistSQL is built on top of the traditional database to provide SQL capabilities that are both standards-compliant and feature ShardingSphere's functionality to enhance conventional database management. + +### Original design intention of DistSQL + +Over its years of rapid development, ShardingSphere has become unique in the database middleware space as the kernel has gradually stabilized, and the core functionality has continuously been honed. As an open source leader in Asia, ShardingSphere keeps pursuing its exploration of a distributed database ecosystem. Redefining the boundary between middleware and database to allow developers to leverage Apache ShardingSphere as if they were using a database natively is DistSQL's design goal. It is also an integral part of ShardingSphere's ability to transform from a developer-oriented framework and middleware to an operations-oriented infrastructure product. + +### DistSQL syntax system + +DistSQL has been designed from the outset to be standards-oriented, considering the habits of both database developers and operators. The syntax of DistSQL is based on the standard SQL language, maintaining readability and ease of use while retaining the maximum amount of ShardingSphere's own features and providing the highest possible number of customization options for users to cope with different business scenarios. + +Developers familiar with SQL and ShardingSphere can get started quickly. + +Standard SQL provides different types of syntaxes such as DQL, DDL, DML, DCL, etc., to define various functional SQL statements. DistSQL defines a syntax system of its own, as well. + +In ShardingSphere, the DistSQL syntax is currently divided into three main types: RDL, RQL, and RAL. + + * RDL (Resource & Rule Definition Language) - Resource rule definition language for creating, modifying, and deleting resources and rules. + * RQL (Resource & Rule Query Language) - Resource rule query language for querying and presenting resources and rules. + * RAL (Resource & Rule Administrate Language) - Resource rule administration language for incremental functional operations such as hint, transaction type switching, and query of a sharding execution plan. + + + +DistSQL's syntax builds a bridge for ShardingSphere to move towards a distributed database. It is still being improved as more ideas are implemented, so DistSQL will become increasingly powerful. Developers who are interested are welcome to join ShardingSphere and contribute ideas and code to DistSQL. + +For more detailed syntax rules, please refer to the official [documentation][2]. + +For the project's community, please refer to the official [Slack channel][3]. + +### DistSQL in practice + +Having understood the design concept and syntax system of DistSQL, let's demonstrate how to build a data sharding service based on ShardingSphere. + +#### Environment preparation + + * Start MySQL services + * Create a MySQL database for sharding + * Start the Zookeeper service + * Turn on the distributed governance configuration and start [ShardingSphere-Proxy][4] + + + +#### Practical demonstration + +1\. Connect to the launched ShardingSphere-Proxy using the MySQL command line. + +2\. Create and query the distributed database `sharding_db`: + + +``` +mysql> CREATE DATABASE sharding_db; +Query OK, 0 ROWS affected (0.04 sec) + +mysql> SHOW DATABASES; ++-------------+ +| SCHEMA_NAME | ++-------------+ +| sharding_db | ++-------------+ +1 ROW IN SET (0.04 sec) +``` + +3\. Use the newly created database: + + +``` +mysql> USE sharding_db; +No connection. Trying TO reconnect... +Connection id: 2 +CURRENT DATABASE: *** NONE *** + +DATABASE changed +``` + +4\. Execute RDL to configure two data source resources, `ds_1` and `ds_2`, for sharding: + + +``` +mysql> ADD RESOURCE ds_1 ( +    -> HOST=127.0.0.1, +    -> PORT=3306, +    -> DB=ds_1, +    -> USER=root, +    -> PASSWORD=root123456 +    -> ); +Query OK, 0 ROWS affected (0.53 sec) + +mysql> +mysql> ADD RESOURCE ds_2 ( +    -> HOST=127.0.0.1, +    -> PORT=3306, +    -> DB=ds_2, +    -> USER=root, +    -> PASSWORD=root123456 +    -> ); +Query OK, 0 ROWS affected (0.02 sec) +``` + +5\. Execute RQL to query the newly added data source resources: + + +``` +    mysql> SHOW RESOURCES FROM sharding_db; +    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +    | name | TYPE  | host      | port | db   | attribute                                                                                                                                                   | +    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +    | ds_1 | MySQL | 127.0.0.1 | 3306 | ds_1 | {"maxLifetimeMilliseconds":1800000,"readOnly":FALSE,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} | +    | ds_2 | MySQL | 127.0.0.1 | 3306 | ds_2 | {"maxLifetimeMilliseconds":1800000,"readOnly":FALSE,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} | +    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ +    2 ROWS IN SET (0.13 sec) +``` + +6\. Execute RDL to create a sharding rule for the `t_order` table: + + +``` +mysql> CREATE SHARDING TABLE RULE t_order( +    -> RESOURCES(ds_1,ds_2), +    -> SHARDING_COLUMN=order_id, +    -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)), +    -> GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123))) +    -> ); +Query OK, 0 ROWS affected (0.06 sec) +``` + +7\. Execute RQL to query the sharding rules: + + +``` +    mysql> SHOW SHARDING TABLE RULES FROM sharding_db; +    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+ +    | TABLE   | actualDataNodes | actualDataSources | databaseStrategyType | databaseShardingColumn | databaseShardingAlgorithmType | databaseShardingAlgorithmProps | tableStrategyType | tableShardingColumn | tableShardingAlgorithmType | tableShardingAlgorithmProps | keyGenerateColumn | keyGeneratorType | keyGeneratorProps | +    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+ +    | t_order |                 | ds_1,ds_2         |                      |                        |                               |                                | hash_mod          | order_id            | hash_mod                   | sharding-COUNT=4            | order_id          | snowflake        | worker-id=123     | +    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+ +    1 ROW IN SET (0.01 sec) +``` + +In addition to querying all sharding rules under the current database, RQL can also query individual tables for sharding rules with the following statement: + +`SHOW SHARDING TABLE RULE t_order FROM sharding_db` + +Creating and querying the `t_order` sharding table: + + +``` +mysql> CREATE TABLE `t_order`( +    -> `order_id` INT NOT NULL, +    -> `user_id` INT NOT NULL, +    -> `status` VARCHAR(45) DEFAULT NULL, +    -> PRIMARY KEY (`order_id`) +    -> )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; +Query OK, 0 ROWS affected (0.28 sec) + +mysql> SHOW TABLES; ++-----------------------+ +| Tables_in_sharding_db | ++-----------------------+ +| t_order               | ++-----------------------+ +1 ROW IN SET (0.01 sec) +``` + +After successfully creating the sharding table `t_order` on the ShardingSphere-Proxy side, ShardingSphere automatically creates the sharding table based on the sharding rules of the `t_order` table by connecting to the underlying databases `ds_1` and `ds_2` via the client-side. + + +``` +mysql> USE ds_1; +DATABASE changed +mysql> SHOW TABLES; ++----------------+ +| Tables_in_ds_1 | ++----------------+ +| t_order_0      | +| t_order_2      | ++----------------+ +2 ROWS IN SET (0.01 sec) + +[/code] [code] + +mysql> USE ds_2; +DATABASE changed +mysql> SHOW TABLES; ++----------------+ +| Tables_in_ds_2 | ++----------------+ +| t_order_1      | +| t_order_3      | ++----------------+ +2 ROWS IN SET (0.00 sec) +``` + +Once the sharding table is created, continue to execute the SQL statement on the ShardingSphere-Proxy side to insert the data: + + +``` +mysql> INSERT INTO t_order VALUES(1, 1, 'ok'); +Query OK, 1 ROW affected (0.06 sec) + +mysql> INSERT INTO t_order VALUES(2, 2, 'disabled'); +Query OK, 1 ROW affected (0.00 sec) + +mysql> INSERT INTO t_order VALUES(3, 3, 'locked'); +Query OK, 1 ROW affected (0.01 sec) + +mysql> SELECT * FROM t_order; ++----------+---------+----------+ +| order_id | user_id | STATUS   | ++----------+---------+----------+ +|        1 |       1 | ok       | +|        2 |       2 | disabled | +|        3 |       3 | locked   | ++----------+---------+----------+ +3 ROWS IN SET (0.06 sec) +``` + +Query the execution plan via RAL: + + +``` +mysql> preview SELECT * FROM t_order; ++-----------------+------------------------------------------------+ +| datasource_name | SQL                                            | ++-----------------+------------------------------------------------+ +| ds_1            | SELECT * FROM t_order_0 ORDER BY order_id ASC  | +| ds_1            | SELECT * FROM t_order_2 ORDER BY order_id ASC  | +| ds_2            | SELECT * FROM t_order_1 ORDER BY order_id ASC  | +| ds_2            | SELECT * FROM t_order_3 ORDER BY order_id ASC  | ++-----------------+------------------------------------------------+ +4 ROWS IN SET (0.02 sec) +``` + +This completes the ShardingSphere data sharding service using DistSQL. Compared to the previous version of the ShardingSphere proxy, which was profile-driven, DistSQL is more developer-friendly and flexible in managing resources and rules. Moreover, the SQL-driven approach enables seamless interfacing between DistSQL and standard SQL. + + +``` +schemaName: sharding_db +dataSources: +  ds_0: +    url: jdbc:mysql://127.0.0.1:3306/ds_1?serverTimezone=UTC&useSSL=false +    username: root +    password: root123456 +    connectionTimeoutMilliseconds: 30000 +    idleTimeoutMilliseconds: 60000 +    maxLifetimeMilliseconds: 1800000 +    maxPoolSize: 50 +    minPoolSize: 1 +  ds_1: +    url: jdbc:mysql://127.0.0.1:3306/ds_2?serverTimezone=UTC&useSSL=false +    username: root +    password: root123456 +    connectionTimeoutMilliseconds: 30000 +    idleTimeoutMilliseconds: 60000 +    maxLifetimeMilliseconds: 1800000 +    maxPoolSize: 50 +    minPoolSize: 1 +rules: +\- !SHARDING +  tables: +    t_order: +      actualDataNodes: ds_${0..1}.t_order_${0..1} +      tableStrategy: +        standard: +          shardingColumn: order_id +          shardingAlgorithmName: t_order_inline +      keyGenerateStrategy: +        column: order_id +        keyGeneratorName: snowflake +    t_order_item: +      actualDataNodes: ds_${0..1}.t_order_item_${0..1} +      tableStrategy: +        standard: +          shardingColumn: order_id +          shardingAlgorithmName: t_order_item_inline +      keyGenerateStrategy: +        column: order_item_id +        keyGeneratorName: snowflake +  bindingTables: +   - t_order,t_order_item +  defaultDatabaseStrategy: +    standard: +      shardingColumn: user_id +      shardingAlgorithmName: database_inline +  defaultTableStrategy: +    none: + +  shardingAlgorithms: +    database_inline: +      type: INLINE +      props: +        algorithm-expression: ds_${user_id % 2} +    t_order_inline: +      type: INLINE +      props: +        algorithm-expression: t_order_${order_id % 2} +    t_order_item_inline: +      type: INLINE +      props: +        algorithm-expression: t_order_item_${order_id % 2} +  keyGenerators: +    snowflake: +      type: SNOWFLAKE +      props: +        worker-id: 123 + +[/code] [code] + +1\. CREATE a distributed DATABASE +CREATE DATABASE sharding_db; + +2\. ADD DATA resources +ADD RESOURCE ds_1 ( +HOST=127.0.0.1, +PORT=3306, +DB=ds_1, +USER=root, +PASSWORD=root123456 +); +ADD RESOURCE ds_2 ( +HOST=127.0.0.1, +PORT=3306, +DB=ds_2, +USER=root, +PASSWORD=root123456 +); + +3\. CREATE sharding rules +CREATE SHARDING TABLE RULE t_order( +RESOURCES(ds_1,ds_2), +SHARDING_COLUMN=order_id, +TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)), +GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123))) +); +``` + +In the above example, only a small part of the DistSQL syntax is demonstrated. In addition to creating and querying resources and rules via `CREATE` and `SHOW` statements, DistSQL also provides additional operations such as `ALTRE DROP` and supports configuration control of data sharding's core functions, read and write separation, data encryption, and database discovery. + +### Conclusion + +As one of the new features released in Apache ShardingSphere's 5.0.0-beta, DistSQL will continue to build on this release to improve syntax and increasingly powerful functions. DistSQL has opened up endless possibilities for ShardingSphere to explore the distributed database space. In the future, DistSQL will be used as a link to connect more functions and provide one-click operations. + +For example, it'll allow the analysis of the overall database status with one click, connect with elastic migration, provide one-click data expansion and shrinkage, and connect with control to realize one-click master-slave switch and change database status. Open source and JavaScript enthusiasts are warmly welcomed to join the Slack community or check the project's GitHub page to learn more about ShardingSphere's latest developments. + +* * * + +_This article is adapted from the author's [original publication][5]._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/distsql + +作者:[Meng Haoran][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/haoran-meng +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://shardingsphere.apache.org/document/current/en/features/dist-sql/syntax/ +[3]: https://join.slack.com/t/apacheshardingsphere/shared_invite/zt-sbdde7ie-SjDqo9~I4rYcR18bq0SYTg +[4]: https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-proxy-quick-start/ +[5]: https://shardingsphere.apache.org/blog/en/material/jul_26_an_introduction_to_distsql/ From d3fc33e578fe61ec4d49dc739c5abed152c1e5c2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 16 Sep 2021 05:03:45 +0800 Subject: [PATCH 0390/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210915?= =?UTF-8?q?=20Open-Source=20Frontend=20for=20Emulators=20=E2=80=9CRetroArc?= =?UTF-8?q?h=E2=80=9D=20Now=20Available=20on=20Steam=20for=20Windows=20and?= =?UTF-8?q?=20Linux=20Users?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md --- ...le on Steam for Windows and Linux Users.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md diff --git a/sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md b/sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md new file mode 100644 index 0000000000..2c34c768a2 --- /dev/null +++ b/sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md @@ -0,0 +1,103 @@ +[#]: subject: "Open-Source Frontend for Emulators “RetroArch” Now Available on Steam for Windows and Linux Users" +[#]: via: "https://news.itsfoss.com/retroarch-steam/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open-Source Frontend for Emulators “RetroArch” Now Available on Steam for Windows and Linux Users +====== + +Since its release way back in 2010, [RetroArch][1] has been one of the most popular game emulator interfaces. Over the years, it has received numerous upgrades and lets you play classic games from various retro consoles ranging from the Atari 2600 to the PlayStation 2. + +While the RetroArch team has been planning to launch this on Steam for more than a year, it is finally available to the masses! + +This means you can now emulate and play your favorite retro games without having to leave Steam. + +Sure, you can download it from their official website, but launching it directly from your Steam collection proves to be a hassle-free way for most users. + +Not to forget, RetroArch’s presence on Steam will put this on a lot of people’s radars. So, this should give RetroArch’s popularity a boost on both Windows and Linux platforms. + +![RetroArch on Steam][2] + +Keep in mind that the RetroArch version available on Steam lacks certain features and most cores compared to the official one. Let us take a look at them. + +### Key Highlights + +#### Emulator Cores + +Unlike the standard way of using the _Core Downloader_, Cores (Emulators) can be installed as **DLCs** from Steam. This can be easily done by navigating to **“Manage DLC”** on Steam’s Retroarch browser page. + +Only 10 cores are available at launch. Here’s the list of cores – + + * Mupen64 Plus Next – Nintendo N64 + * Kronos – Sega Saturn + * PCSX ReARMed – PlayStation 1 + * Stella – Atari 2600 + * SameBoy – Game Boy & Game Boy Colour + * mGBA – Game Boy Advance + * Mesen – Nintendo Entertainment System + * Mesen S – Super Nintendo Entertainment System + * Genesis Plus GX – Sega SG-1000, Master System, Game Gear, Genesis and Mega CD + * Final Burn Neo – Arcade + + + +Additional cores will certainly be released in the future. According to the developer: + +> More cores will be coming as DLC soon. We have no ETA on when these will arrive, but it will likely be a dripfeed of new cores on a periodic basis as it takes a lot of time preparing the pages, descriptions, logos, previews and whatnot that a Steam page requires. + +RetroArch Blog + +![Retroarch Main Menu \(Source: Retroarch\)][3] + +#### Other Highlights + +RetroArch UI stays the same. This may be overwhelming for users who will be using RetroArch for the first time. The developers have plans to revamp its UI soon enough. + +Remote Play and Steam Cloud sync should also work. + +Do note that RetroArch will only be available for 64-bit Linux or Windows PCs. As of now, there are no plans for macOS yet. + +You can learn more about RetroArch’s availability on Steam on their [official blog post][4]. + +### Wrapping Up + +The addition of RetroArch to Steam will certainly increase their userbase. Initial reviews seem to be very positive, which is a good thing! + +They should get better financial support from new users on [Patreon][5] as well. You might as well start helping them out if interested. + +If you want to try it out, head to your Steam client and search for it. Or, click on the link below to explore it on Steam store along with its system requirements. + +[RetroArch on Steam][6] + +**Via**: [GamingOnLinux][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/retroarch-steam/ + +作者:[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://www.retroarch.com/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM3NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://www.libretro.com/index.php/retroarch-finally-released-on-steam/ +[5]: https://www.patreon.com/libretro +[6]: https://store.steampowered.com/app/1118310/RetroArch/ +[7]: https://www.gamingonlinux.com/2021/09/retroarch-gets-a-steam-release-bringing-emulation-to-even-more-gamers From 952ed76329c4d3afaa56862e72e74a13a30aa91c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 16 Sep 2021 07:44:24 +0800 Subject: [PATCH 0391/1588] Delete 20210915 .md --- sources/tech/20210915 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210915 .md diff --git a/sources/tech/20210915 .md b/sources/tech/20210915 .md deleted file mode 100644 index e62faf33e9..0000000000 --- a/sources/tech/20210915 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/linux-kernel-5-15-rc1/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 8a9f822ef4a0c1f934aef32fd6c6ba2d820b04eb Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 Sep 2021 08:54:49 +0800 Subject: [PATCH 0392/1588] translating --- ...smart quotes with the Linux sed command.md | 83 ------------------- ...smart quotes with the Linux sed command.md | 82 ++++++++++++++++++ 2 files changed, 82 insertions(+), 83 deletions(-) delete mode 100644 sources/tech/20210913 Replace smart quotes with the Linux sed command.md create mode 100644 translated/tech/20210913 Replace smart quotes with the Linux sed command.md diff --git a/sources/tech/20210913 Replace smart quotes with the Linux sed command.md b/sources/tech/20210913 Replace smart quotes with the Linux sed command.md deleted file mode 100644 index 2f45272574..0000000000 --- a/sources/tech/20210913 Replace smart quotes with the Linux sed command.md +++ /dev/null @@ -1,83 +0,0 @@ -[#]: subject: "Replace smart quotes with the Linux sed command" -[#]: via: "https://opensource.com/article/21/9/sed-replace-smart-quotes" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Replace smart quotes with the Linux sed command -====== -Banish "smart" quotes with your favorite version of sed. -![Coding on a computer][1] - -In typography, a pair of quotation marks were traditionally oriented toward one another. They look like this: - -“smart quotes” - -As computers became popular in the mid-twentieth century, the orientation was often abandoned. The original character set of computers didn't have much room to spare, so it makes sense that two double-quotes and two single-quotes were reduced down to just one of each in the ASCII specification. These days the common character set is Unicode, with plenty of space for lots of fancy quotation marks and apostrophes, but many people have become used to the minimalism of just one character for both opening and closing quotes. Besides that, computers actually see the different kinds of quotation marks and apostrophes as distinct characters. In other words, to a copmuter the right double quote is different from the left double quote or a straight quote. - -### Replacing smart quotes with sed - -Computers aren't typewriters. When you press a key on your keyboard, you're not pressing a lever with an inkstamp attached to it. You're just pressing a button that sends a signal to your computer, which the computer interprets as a request to display a specific predefined character. The request depends on your keyboard map. As a Dvorak typist, I've witnessed the confusion on people's faces when they discover "asdf" on my keyboard produces "aoeu" on the screen. You may also have pressed special combinations of keys to produce characters, such as ™ or ß or ≠, that's not even printed on your keyboard. - -Each letter or character, whether it's printed on your keyboard or not, has a code. Character encoding can be expressed in different ways, but to a computer the Unicode sequences u2018 and u2019 produce **‘** and **’**, while the codes u201c and u201d produce the **“** and **”** characters. Knowing these "secret" codes means you can replace them programmatically using a command like [sed][2]. Any version of sed will do, so you can use GNU sed or BSD sed or even [Busybox][3] sed. - -Here's the simple shell script I use: - - -``` -#!/bin/sh -# GNU All-Permissive License - -SDQUO=$(echo -ne '\u2018\u2019') -RDQUO=$(echo -ne '\u201C\u201D') -$SED -i -e "s/[$SDQUO]/\'/g" -e "s/[$RDQUO]/\"/g" "${1}" -``` - -Save this script as `fixquotes.sh` and then create a separate test file containing smart quotes: - - -``` -‘Single quote’ -“Double quote” -``` - -Run the script, and then use the [cat][4] command to see the results: - - -``` -$ sh ./fixquotes.sh test.txt -$ cat test.txt -'Single quote' -"Double quote" -``` - -### Install sed - -If you’re using Linux, BSD, or macOS, then you already have GNU or BSD `sed` installed. These are two unique reimplementations of the original `sed` command, and for the script in this article they are functionally the same (that's not true for all scripts, though). - -On Windows, you can [install GNU sed][5] with [Chocolatey][6]. - -Vim offers great benefits to writers, regardless of whether they are technically minded or not. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/sed-replace-smart-quotes - -作者:[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/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) -[2]: https://opensource.com/article/20/12/sed -[3]: https://opensource.com/article/21/8/what-busybox -[4]: https://opensource.com/article/19/2/getting-started-cat-command -[5]: https://chocolatey.org/packages/sed -[6]: https://opensource.com/article/20/3/chocolatey diff --git a/translated/tech/20210913 Replace smart quotes with the Linux sed command.md b/translated/tech/20210913 Replace smart quotes with the Linux sed command.md new file mode 100644 index 0000000000..d6f3cc087a --- /dev/null +++ b/translated/tech/20210913 Replace smart quotes with the Linux sed command.md @@ -0,0 +1,82 @@ +[#]: subject: "Replace smart quotes with the Linux sed command" +[#]: via: "https://opensource.com/article/21/9/sed-replace-smart-quotes" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 Linux sed 命令替换智能引号 +====== +用你喜欢的 sed 版本去除“智能”引号。 +![Coding on a computer][1] + +In typography, a pair of quotation marks were traditionally oriented toward one another. They look like this: +在排版学中,一对引号传统上是朝向彼此的。它们看起来像这样: + +“智能引号” + +随着计算机在二十世纪中期的普及,这种方向往往被放弃了。计算机的原始字符集没有太多的空间,所以在 ASCII 规范中,两个双引号和两个单引号被缩减为各一个是合理的。如今,通用的字符集是 Unicode,有足够的空间容纳许多花哨的引号和撇号,但许多人已经习惯了开头和结尾引号都只有一个字符的极简主义。此外,计算机实际上将不同种类的引号和撇号视为不同的字符。换句话说,对计算机来说,右双引号与左双引号或直引号是不同的。 + +### 用 sed 替换智能引号 + +计算机并不是打字机。当你按下键盘上的一个键时,你不是在按一个带有印章的控制杆。你只是按下一个按钮,向你的计算机发送一个信号,计算机将其解释为一个显示特定预定义字符的请求。这个请求取决于你的键盘映射。作为一个 Dvorak 打字员,我目睹了人们在发现我的键盘上的 “asdf” 在屏幕上产生 “aoeu” 时脸上的困惑。你也可能按了一些特殊的组合键来产生字符,如 ™ 或 ß 或 ≠,这甚至没有印在你的键盘上。 + +每个字母或字符,不管它是否印在你的键盘上,都有一个编码。字符编码可以用不同的方式表达,但对计算机来说,Unicode 序列 u2018 和 u2019 产生 **‘** 和 **’**,而代码 u201c 和 u201d 产生 **“** 和 **”** 字符。知道这些“秘密”代码意味着你可以使用 [sed][2] 这样的命令以编程方式替换它们。任何版本的 sed 都可以,所以你可以使用 GNU sed 或 BSD sed,甚至是 [Busybox][3] sed。 + +下面是我使用的简单的 shell 脚本: + + +``` +#!/bin/sh +# GNU All-Permissive License + +SDQUO=$(echo -ne '\u2018\u2019') +RDQUO=$(echo -ne '\u201C\u201D') +$SED -i -e "s/[$SDQUO]/\'/g" -e "s/[$RDQUO]/\"/g" "${1}" +``` + +将此脚本保存为 `fixquotes.sh`,然后创建一个包含智能引号的单独测试文件: + + +``` +‘Single quote’ +“Double quote” +``` + +运行该脚本,然后使用 [cat][4] 命令查看结果: + + +``` +$ sh ./fixquotes.sh test.txt +$ cat test.txt +'Single quote' +"Double quote" +``` + +### 安装 sed + +如果你使用的是 Linux、BSD 或 macOS,那么你已经安装了 GNU 或 BSD 的 `sed`。这是原始 `sed` 命令的两个独特的重新实现,对于本文中的脚本来说,它们在功能上是一样的(不过并不是所有的脚本都是这样)。 + +在 Windows 上,你可以用 [Chocolatey][6] [安装 GNU sed][5]。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/sed-replace-smart-quotes + +作者:[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/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer) +[2]: https://opensource.com/article/20/12/sed +[3]: https://opensource.com/article/21/8/what-busybox +[4]: https://opensource.com/article/19/2/getting-started-cat-command +[5]: https://chocolatey.org/packages/sed +[6]: https://opensource.com/article/20/3/chocolatey From b4706ef915fb2029225d74d781783f28c647ff44 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 16 Sep 2021 08:57:58 +0800 Subject: [PATCH 0393/1588] translating --- ...o check for update info and changelogs with rpm-ostree db.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md b/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md index 8d9f367425..9e7b715960 100644 --- a/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md +++ b/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md @@ -2,7 +2,7 @@ [#]: via: "https://fedoramagazine.org/how-to-check-for-update-info-and-changelogs-with-rpm-ostree-db/" [#]: author: "Mateus Rodrigues Costa https://fedoramagazine.org/author/mateusrodcosta/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From e9ce9edfb68c8335ea11d7ce5d7a4eb50b1c3d45 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Sep 2021 12:38:04 +0800 Subject: [PATCH 0394/1588] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @guevaraya 翻译时可以使用自己的语气,但是应该忠实原文,将原文的意思表达到位。 --- ...0827 How to Easily Install Debian Linux.md | 166 +++++++++--------- 1 file changed, 83 insertions(+), 83 deletions(-) diff --git a/translated/tech/20210827 How to Easily Install Debian Linux.md b/translated/tech/20210827 How to Easily Install Debian Linux.md index 7cf837b527..975eee2b8a 100644 --- a/translated/tech/20210827 How to Easily Install Debian Linux.md +++ b/translated/tech/20210827 How to Easily Install Debian Linux.md @@ -2,145 +2,145 @@ [#]: via: "https://itsfoss.com/install-debian-easily/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: "guevaraya " -[#]: reviewer: " " +[#]: translator: "guevaraya" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -如何简单安装 Debian Linux 系统 +如何轻松安装 Debian Linux 系统 ====== -安装 Debian 的简易程度依赖于选择什么镜像。 +![](https://img.linux.net.cn/data/attachment/album/202109/16/123647x9uz7zjjqrq0qwkk.jpg) -如果你使用 Debain 官网的默认镜像,安装 Debian 就比较费劲。你会遇到这种界面,让你从外部介质先安装网络驱动。 +安装 Debian 的轻松程度依赖于选择什么镜像。 -![Installing Debian from default ISO is problematic for new users][1] +如果你使用 Debain 官网的默认 ISO 镜像,安装 Debian 就比较费劲。你会卡在这种界面,让你从外部可移动介质上安装网络驱动。 -当然你也可以花时间去排除这个故障,但这让事情变得无意义的复杂。 +![对于新用户来说,从默认的 ISO 中安装 Debian 是有问题的][1] -不用担心,让我来展示如何轻巧的简单安装 Debian。 +当然你可以花时间去排除这个故障,但这让事情变得没有必要的复杂。 -### 简单安装 Debian桌面系统 +不用担心,让我来展示如何轻松地简单安装 Debian。 -在你查看步骤之前,请确认以下准备工作: - * 一个至少 4Gb 大小的U盘 - * 一个可以联网的系统(可以和要安装的操作系统一样) - * 要安装的 Debian 系统将会清理掉系统上所有数据,因此请拷贝重要数据到其他外部磁盘 +### 轻松安装 Debian 桌面系统的方法 -你需要什么规格的 Debian 系统?取决于你想用什么类型的[桌面环境][2]。例如,GNOME 桌面系统可以在4GB RAM上运行但最好在8GB RAM 流畅一些。如果你是4GB或更小的 RAM,还是建议尝试 KDE,Cinnamon 或 Xfce 桌面系统。 +在你查看这些步骤之前,请确认以下准备工作: -Debian 也都支持 [32位和64位的指令架构][3]。你需要根据你的CPU指令架构选择对应的 Debian 镜像。 + * 一个至少 4GB 大小的 USB 盘。 + * 一个连接了互联网的系统(可以是要安装 Debian 的同一个机器)。 + * 一个要安装的 Debian 的机器。它将会清理掉系统上所有数据,因此请复制重要数据到其他外部磁盘 -你的系统应该至少要有 25 GB的硬盘空间可用。越多越好。 +你需要为 Debian 准备什么样配置的机器?这取决于你想用什么类型的 [桌面环境][2]。例如,GNOME 桌面系统可以在 4GB 内存上运行,但在 8GB 内存上更流畅一些。如果你只有 4GB 或更少的内存,还是建议尝试 KDE、Cinnamon 或 Xfce 桌面系统。 -警告! +Debian 支持 [32 位和 64 位的指令架构][3]。你需要根据你的 CPU 指令架构选择对应的 Debian ISO 镜像。 -这个方法会移除磁盘上其他操作系统的已有数据。 +你的系统应该至少要有 25GB 可用的硬盘空间。越多越好。 -你可能需要保存你后面还需要用的个人信息,文档,照片等到外部 U 盘或云盘。 +> **警告!** +> +> 这个方法会移除磁盘上所有其他操作系统及其数据。 +> +> 你可以保存你后面还需要用的个人信息、文档、照片等到外部 USB 盘或云存储中。 -这个教程是我安装附带 GNOME Debian 11 Bullseye 的步骤。这些步骤其实和其他桌面环境都大同小异。 +在这个教程中,我将展示安装带有 GNOME 桌面环境的 Debian 11 Bullseye 的步骤。即使你选择其他的桌面环境,步骤也应该是一样的。 -_**这个教程在 UEFI 系统的 GPT分区得到验证。如果你是[MBR替换GPT分区][4],或[传统的BIOS替换UEFI][5],创建Live USB的步骤有一点不同。**_ +这个教程是在 GPT 分区的 UEFI 系统上测试的。如果你的系统是 [MBR 而不是 GPT][4],或是 [传统的 BIOS 而不是 UEFI][5],那么创建临场Live USB 盘的步骤有一点不同。 +#### 步骤 1:获取正确的 Debian ISO 镜像 -#### 步骤 1:获取正确的 Debian 的 ISO 镜像 +在安装 Debian 过程中,选择正确的 ISO 镜像就已经成功一半了。令人惊讶的是,对于一个新的 Debian 用户来说,要浏览 Debian 的网站并找到最轻松好用的 ISO 真的很困难。 -在安装 Debian 过程中的一半事情是选择合适的 ISO 镜像。奇怪的是,确实作为一个新 Debian 用户很难从官网容易的找到 ISO镜像。 +如果你点击 Debian 官网的下载按钮,它会下载一个最小化的网络安装文件,这对普通用户来说是非常复杂的。请 **不要** 使用这个。 -如果你点击 Debian 官网的下载按钮,它会下载一个为用户提供最佳兼容的最小安装包。请不太要用它。 +反而,你应该用临场Live ISO。但这里要注意,有一些单独的含有非自由软件(以包括网络硬件的驱动程序)的版本。 -反而,你需要用 Live ISO。这有一个技巧,有独立非免费的 Live 版本(包含网络驱动) +你应该下载这个非自由版的临场 ISO 镜像。不过另一个问题是,你不会在网站的显著位置注意到它,而且有各种架构的 BT 种子或直接下载的 URL。 -你需要下载非免费的 live ISO 镜像。这里的其他程序可以不必从官网下载,有各种 torrents 连接或直接下载各种架构的安装包。 +让我把这些链接放在这里: -这些链接就在这里 +- [32 位和 64 位的主仓地址][7] +- [Debian 11 官方下载][8] +- [Debian 11 种子地址][9] -[32和64位的主仓地址][7] +你会看到几个文件,文件名中提到了桌面环境。选择一种你要的桌面环境。直接下载的话,直接点击 .iso 结尾的链接即可。 -[Debian 11 官方下载][8] +![下载非自由版的临场 Debian ISO][10] -[Debian 11 种子地址][9] +一旦你有了对应的 ISO 下载包,剩下就是和其他 Linux 发行版一样的标准安装流程了。 -你将看到桌面环境的几个文件的名字。选择一种你的对应的桌面环境。直接下载的话,直接点击.iso结尾的链接。 +#### 步骤 2: 创建一个 Debian 的临场 USB 盘 -![下载非免费版的 Live Debian 的ISO][10] +将 USB 盘插入你的系统。在用之前最好格式化一下,反正它最终也会被格式化的。 -一旦你有了对应的 ISO 下载包,剩下就是和其他 Linux 发行版的安装流程一样了 +你可以根据你的选择使用任何临场 USB 创建工具。如果你使用 Windows,可以使用 Rufus。我们在这里使用 Etcher,因为这个工具在 Windows 和 Linux 都可以用。 -#### 步骤 2: 创建一个 Debian 的 Live USB +从它的官网下载 Etcher。 -将USB插入你的系统。最好在用之前最好格式化一下,它最终也会被格式化的。 +- [下载 Etcher][11] -你可以根据你的选择使用任何版本的 Live USB 创建工具。如果你使用 Windows,请用 Rufus。我们现在在这用 Etcher,因为这个工具在 Windows 和 Linux 都可以用。 +我专门写过一篇 [在 Linux 下使用 Etcher 的教程][12],因此这里我就不深入介绍了。只要运行下载的可执行程序,浏览找到 Debian 的 ISO 镜像,确认选择正确的 USB 盘,然后点击 “Flash” 按钮即可。 -从它的官网下载 Etcher +![用 Etcher 创建 Debian 的临场 USB 盘][13] -[下载 Etcher][11] +不一会就创建好临场 USB 盘了。创建好之后,就可以开机引导了。 -我有一个专门的[在linux下使用 Etcher 的教程][12]。而这我就不深入介绍了。仅仅下载可执行程序,浏览 Debian 的 ISO镜像,确认选择正确的 USB 驱动器然后点击 Flash 按钮。 +#### 步骤 3:从临场 USB 盘引导启动 -![用 Etcher 创建 Debian 的 Live USB][13] +重启你要安装 Debian 的机器。当显示制造商标识的时候,按下 `F2`、`F10` 或 `F12` 等键进入开机引导设置界面。你也可以从 Windows [进入到 UEFI 固件设置界面][14]。 -不一会就创建好 live USB。一旦创建好,就可以开机引导了。 +有些机器如果启用了安全启动secure boot功能,就不允许从临场 USB 盘引导。如果是这种情况,请 [从 BIOS 设置里禁用安全启动][15] -#### 步骤 3:从 live USB 引导启动 - -重启即将要安装 Debian 的系统。当她显示制造商标识的时候,按下F2/F10 或 F12 键进入开机引导选择界面。你可能也会[进入到 UEFI 固件设置界面][14]。 - -有些系统已经开启了安全启动功能就不允许从 Live USB 开机引导。如果是这种情况,请[从BIOS设置里禁用安全启动][15] - -不同的的制造商在界面上一些差异。 +不同的的制造商在界面上会有一些差异。 ![][16] -一点你在 BIOS 里做了修改,按下 F10 保存并推出。你的系统将会重新启动。 +你在 BIOS 里做了修改之后,按下 `F10` 保存并退出。你的系统将会重新启动。 -再次看到,当看到制造商的标识后按下 F2/F10 或 F12 查看引导配置。你应该可以看到从 USB 引导的类似选项,然后选中。 +再一次,当看到制造商的标识后按下 `F2`、`F10` 或 `F12` 查看引导配置。你应该可以看到从 USB 引导的选项,然后选中它。 ![][17] 一会儿就会看到如下图的显示界面,选择第一个选项。 -![Debian live 选择界面][18] +![Debian 启动界面][18] -#### 步骤 4: 开始 Debian 安装 +#### 步骤 4: 开始安装 Debian -当你进入 live Debian 会话,如果你用 GNONE 桌面话,它呈现一个欢迎界面并带有选择你的键盘和语言。当你看到这些界面只需要点击下一步。 +当你进入临场 Debian 会话,如果你使用 GNONE 桌面,它呈现一个欢迎界面,可以在此选择你的键盘和语言。当你看到这些界面时,只需要点击下一步。 -![Debian live 欢迎界面][19] +![Debian 临场欢迎界面][19] -选择欢迎界面之后,按下 windows徽标/Super 键进入活动区。你应该可以看到 Debian 的安装按钮。 +欢迎界面之后,按下 `Windows` / `Super` 键进入活动区。你应该可以看到 Debian 的安装按钮。 -![开始 Debian 安装][20] +![开始安装 Debian][20] -它会打开一个友好的[卡拉马雷斯Calamares图形安装器][21]。从这里开始事情就比较简单了, +它会打开一个友好的 [Calamares 图形安装器][21]。从这里开始事情就比较简单了, -![Debian 11 Calamares graphical installer][22] +![Debian 11 Calamares 图形安装器][22] 它会让你选择你的地理位置和时区。 -![Select your location and time zone][23] +![选择你的地理位置和时区][23] -下一个界面,会让你选择键盘类型。这儿请 **注意**。你的键盘会根据位置自动选择。例如,我的位置是印度它会自动选择印地语的印度键盘。我不得不将其改为英语印度类型。 +下一个界面,会让你选择键盘类型。这儿请 **注意**。你的键盘会根据你所选的位置自动选择。例如,我的位置是印度,它会自动默认选择印度键盘和印地语。我需要将其改为印度英语。 ![选择键盘类型][24] -下一个界面是关于硬盘分区表和 Debian 安装哪里。这里是在你的系统只安装 Debian。 +下一个界面是关于磁盘分区和要安装 Debian 的地方。在本文中,把 Debian 作为你电脑上唯一的操作系统来安装。 -简单选择便是直接 “Erase Disk”。Debian 将把除过 ESP 分区和交互分区的其他分区都放在根挂载点上。实际上,下面显示了你选择了安装配置后的磁盘分布。 +最简单的方法是直接选择 “擦除磁盘Erase Disk”。除了必须的 ESP 分区和交换分区外,Debian 会把其他所有东西都放在根挂载点(`/`)上。实际上,下面显示了你所选的安装方式后的磁盘布局。 ![磁盘分区][25] -如果你想手动选择,你也需要手工划分区,选择 root,home,boot 或 swap 分配多少。只有你知道自己在做什么你才可以去手工配置。 +如果你想把事情掌握在自己手中,你也可以选择手动分区,选择分配给 `/`、`/home`、`/boot` 或交换分区的大小。只有在你知道自己在做什么时,才可以这样做。 -下一界面,你需要提供用户名和密码。但它不会设置root的密码并将其保持为空。 +下一界面,你需要提供用户名和密码。但它不会设置 root 的密码,并将其保持为空。 ![设置用户名和密码][26] -这也意味着你可以用 sudo 新创建用户。在“复杂 Debian 安装”中,你也可以设置 root 密码但前提是你必须用手动添加普通用户到 sudoer 列表。看看,这个安装过程是不是对新手来说很简单? +这也意味着你可以用新创建的用户使用 `sudo` 。在“复杂的 Debian 安装”中,你也可以设置 root 密码,但这样你就必须手动将普通用户添加到 `sudoer` 列表。看看,这种安装过程是不是对新手来说很容易? -在实际真正安装之前,它会呈现你已经选择的汇总信息。如果没有问题,就可以点击安装按钮。 +在继续实际安装之前,它会呈现你所做的选择的汇总信息。如果没有问题,就可以点击“安装Install”按钮。 ![安装配置的汇总信息][27] @@ -152,51 +152,51 @@ _**这个教程在 UEFI 系统的 GPT分区得到验证。如果你是[MBR替换 ![完成 Debian 安装][29] -如果一切顺利重启系统,你应该可以看到 Debian 的 grub 界面。 +重启系统后如果一切顺利,你应该可以看到 Debian 的 GRUB 界面。 ![Debian 启动画面][30] -### 疑难解答小贴士 (如果系统没有启动到 Debian) +### 疑难解答(如果系统没有启动到 Debian) -我遇到情况是,我的 Dell 系统不能识别并引导任何操作系统。很奇怪,我已经能看到 Debian 已经创建了一个 ESP 分区。 +我遇到情况是,我的 Dell 系统不能识别任何要引导的操作系统。这很奇怪,我看见 Debian 经创建了一个 ESP 分区。 -如果你也是同样的情况,去BIOS配置里。检测启动流程,如果你看不到任何东西,就点击新增一个启动选项。 +如果你也是同样的情况,进去 BIOS 配置里。检查启动顺序Boot Sequence,如果你看不到任何东西,就点击“新增引导选项Add Boot Option”。 ![增加新的启动选项][31] 它会提供一个增加 EFI 文件的选项。 -![选择 EFi 文件][32] +![选择 EFI 文件][32] -只有在安装过程中 Debian 创建了 ESP 分区,就有一个带文件的 EFI 目录被创建出来。 +由于在安装过程中 Debian 创建了 ESP 分区,因此一个包含必要文件的 `EFI` 目录已经创建好了。 ![选择 EFI 目录][33] -它会显示一个 Debian 文件夹包含其他文件夹。选择 Debian 文件夹。 +它会显示一个 `Debian` 目录及其他目录。选择 `Debian` 目录。 -![选择 Debian][34] +![选择 Debian 目录][34] -在 Debian 文件夹,你将看到 grubx64.efi, shimx64.efi。请选择 shimx64.efi。 +在 `Debian` 目录,你将看到 `grubx64.efi`、`shimx64.efi` 等文件。请选择 `shimx64.efi`。 -![选择 shim.efi][35] +![选择 shimx64.efi][35] -你需要选择一个合适的名字。最后的界面应该如下: +你需要给这个文件一个合适的名字。最后的界面应该如下: ![增加 efi 文件的新启动选项][36] -现在你可能有了下面这个启动选项。我命名为 Debian,它显示了两个 Debian 驱动选择(我猜其中一个是从 efi 文件来的)。按下 F10 保存退出 BIOS 的配置。 +现在你应该有了这个启动选项。因为我命名为 `Debian`,它显示了两个 `Debian` 引导选项(我猜其中一个是从 efi 文件来的)。按下 `F10` 保存退出 BIOS 的配置。 ![新增的启动选项][37] -现在启动你的系统,你可以看到 grub 界面带有 Debian 的启动选项。你现在可以体验 Debian 了。 +现在启动你的系统,你可以看到带有 Debian 启动选项的 GRUB 界面了。你现在可以体验 Debian 了。 ![][30] -### Debian 可以安装到哪里? +### 你能安装 Debian 吗? -我这里的目的是让事情变得简单。并不是说你不能从默认的官网下载安装包来安装。只是它需要花更多的精力。 +我写这篇文章的目的是让事情变得轻松点。并不是说你不能从默认的网络安装程序 ISO 来安装,只是它需要花更多的精力。 -这个教程对你安装有帮助吗?你如果还是有问题,请在下面留言给我,我会尽力提供帮助。 +这个教程对你安装 Debian 有帮助吗?你如果还是有问题,请在下面留言给我,我会尽力提供帮助。 -------------------------------------------------------------------------------- @@ -205,7 +205,7 @@ via: https://itsfoss.com/install-debian-easily/ 作者:[Abhishek Prakash][a] 选题:[lujun9972][b] 译者:[巴龙](https://github.com/guevaraya) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 324e327b8559ddfa95f79641a3bcc73a9a4098d6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Sep 2021 12:50:57 +0800 Subject: [PATCH 0395/1588] PUB @guevaraya https://linux.cn/article-13789-1.html --- .../20210827 How to Easily Install Debian Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210827 How to Easily Install Debian Linux.md (99%) diff --git a/translated/tech/20210827 How to Easily Install Debian Linux.md b/published/20210827 How to Easily Install Debian Linux.md similarity index 99% rename from translated/tech/20210827 How to Easily Install Debian Linux.md rename to published/20210827 How to Easily Install Debian Linux.md index 975eee2b8a..e72e6b8f6e 100644 --- a/translated/tech/20210827 How to Easily Install Debian Linux.md +++ b/published/20210827 How to Easily Install Debian Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "guevaraya" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13789-1.html" 如何轻松安装 Debian Linux 系统 ====== From 8cb0969517a0fb46fe21d4d9293b5fac7b74ceda Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Sep 2021 16:38:33 +0800 Subject: [PATCH 0396/1588] PRF @geekpi --- ...0908 How to Run Java Programs in Ubuntu.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20210908 How to Run Java Programs in Ubuntu.md b/translated/tech/20210908 How to Run Java Programs in Ubuntu.md index 9a47825f7f..285b432e4d 100644 --- a/translated/tech/20210908 How to Run Java Programs in Ubuntu.md +++ b/translated/tech/20210908 How to Run Java Programs in Ubuntu.md @@ -3,14 +3,16 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 如何在 Ubuntu 中运行 Java 程序 ====== -那么,你已经开始学习 Java 编程了?这很好。 +![](https://img.linux.net.cn/data/attachment/album/202109/16/163803pn2dja7ajcx8jjw2.jpg) + +听说,你已经开始学习 Java 编程了?很好。 你想在你的 Linux 系统上运行 Java 程序?那就更好了。 @@ -24,7 +26,7 @@ 要运行一个 Java 程序,你需要先编译该程序。为此你需要 Java 编译器。 -Java 编译器是 [JDK][1](Java 开发工具包)的一部分。你需要安装 JDK,以便编译和运行 Java 程序。 +Java 编译器是 [JDK][1](Java 开发工具包Java Development Kit)的一部分。你需要安装 JDK,以便编译和运行 Java 程序。 首先,检查你的系统上是否已经安装了 Java 编译器: @@ -42,19 +44,19 @@ javac --version sudo apt install default-jdk ``` -你会被要求输入你的账户密码。当你输入密码时,屏幕上什么也看不到。这很正常。直接输入密码即可。当询问时,按回车键或 Y 键。 +你会被要求输入你的账户密码。当你输入密码时,屏幕上什么也看不到。这很正常。直接输入密码即可。当询问时,按回车键或 `Y` 键。 ![Installing JDK that also contains the Java compiler][3] 上述命令应该适用于其他基于 Debian 和 Ubuntu 的发行版,如 Linux Mint、Elementary OS 等。对于其他发行版,请使用你的发行版的包管理器。包的名称也可能不同。 -安装完毕后,验证 javac 现在是否可用。 +安装完毕后,验证 `javac` 现在是否可用。 ![Verify that Java compiler can be used now][4] #### 第二步:在 Linux 中编译 Java 程序 -因为这个原因,你需要有一个 Java 程序文件。假设你创建了一个名为 **HelloWorld.java** 的新的 Java 程序文件,它的内容如下: +要编译的话,你首先需要有一个 Java 程序文件。假设你创建了一个名为 `HelloWorld.java` 的新的 Java 程序文件,它的内容如下: ``` class HelloWorld{ @@ -64,7 +66,7 @@ class HelloWorld{ } ``` -你可以[使用终端的 Nano 编辑器][5]或 Gedit 图形化文本编辑器来编写你的 Java 程序。 +你可以 [使用终端下的 Nano 编辑器][5] 或 Gedit 图形化文本编辑器来编写你的 Java 程序。 ``` javac HelloWorld.java @@ -76,13 +78,13 @@ javac HelloWorld.java #### 第三步:运行 Java 类文件 -你不需要在这里指定类的扩展名。只需要类的名称。而这一次,你使用 java 命令,而不是 javac。 +你不需要在这里指定类的扩展名。只需要类的名称。而这一次,你使用 `java` 命令,而不是 `javac`。 ``` java HelloWorld ``` -我的程序将在屏幕上打印 Hello World。 +我的程序将在屏幕上打印 “Hello World”。 ![Running java programs in the Linux terminal][6] @@ -90,7 +92,7 @@ java HelloWorld 这是最简单的一个例子。这个示例程序只有一个类。Java 编译器为你程序中的每个类都创建一个类文件。对于较大的程序和项目来说,事情会变得很复杂。 -这就是为什么我建议[在 Ubuntu 上安装 Eclipse][7]来进行 Java 编程。在 IDE 中编程更容易。 +这就是为什么我建议 [在 Ubuntu 上安装 Eclipse][7] 来进行 Java 编程。在 IDE 中编程更容易。 希望本教程对你有所帮助。有问题或建议吗?评论区都是你的。 @@ -101,7 +103,7 @@ via: https://itsfoss.com/run-java-program-ubuntu/ 作者:[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 2c1851d3efe18d73384855ff7bc196aeee216a06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E4=B9=9D?= <2220238842@qq.com> Date: Thu, 16 Sep 2021 16:39:23 +0800 Subject: [PATCH 0397/1588] Update 20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md --- ...0915 Raspberry Pi Zero vs Zero W- What-s the Difference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md b/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md index 6d575a950a..22f83c9589 100644 --- a/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md +++ b/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/raspberry-pi-zero-vs-zero-w/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "anine09" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -88,7 +88,7 @@ via: https://itsfoss.com/raspberry-pi-zero-vs-zero-w/ 作者:[Ankush Das][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 422574a12fcf69d567ca5c68371a7587343123da Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 16 Sep 2021 16:39:31 +0800 Subject: [PATCH 0398/1588] PUB @geekpi https://linux.cn/article-13790-1.html --- .../20210908 How to Run Java Programs in Ubuntu.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210908 How to Run Java Programs in Ubuntu.md (98%) diff --git a/translated/tech/20210908 How to Run Java Programs in Ubuntu.md b/published/20210908 How to Run Java Programs in Ubuntu.md similarity index 98% rename from translated/tech/20210908 How to Run Java Programs in Ubuntu.md rename to published/20210908 How to Run Java Programs in Ubuntu.md index 285b432e4d..e7b3277f53 100644 --- a/translated/tech/20210908 How to Run Java Programs in Ubuntu.md +++ b/published/20210908 How to Run Java Programs in Ubuntu.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13790-1.html" 如何在 Ubuntu 中运行 Java 程序 ====== From 8af4b2c1071cf684db9f87b23193969affa9a0c4 Mon Sep 17 00:00:00 2001 From: SamMa Date: Thu, 16 Sep 2021 19:33:22 +0800 Subject: [PATCH 0399/1588] Update 20210902 4 Linux technologies fundamental to containers.md --- ... technologies fundamental to containers.md | 32 +++++++++---------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210902 4 Linux technologies fundamental to containers.md b/translated/tech/20210902 4 Linux technologies fundamental to containers.md index 6d15032103..d0a8a35ef8 100644 --- a/translated/tech/20210902 4 Linux technologies fundamental to containers.md +++ b/translated/tech/20210902 4 Linux technologies fundamental to containers.md @@ -3,18 +3,18 @@ [#]: author: "Nived V https://opensource.com/users/nivedv" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " 容器的四大基础技术 ====== -> 命名空间、控制组、seccomp 和 SELinux 构成了在你的系统上构建和运行一个容器进程的 Linux 技术基础。 +> 命名空间、控制组、seccomp 和 SELinux 构成了在系统上构建和运行一个容器进程的 Linux 技术基础。 ![企鹅驾驶一辆黄色背景的汽车][1] -在以前的文章中,我介绍过 [容器镜像][2] 及其 [运行时][3]。在这篇文章中,我研究了容器是如何在一些特殊的 Linux 技术基础上实现的,这些技术包括命名空间和控制组。 +在以前的文章中,我介绍过 [容器镜像][2] 及其 [运行时][3]。在本文中,我研究了容器是如何在一些特殊的 Linux 技术基础上实现的,这其中包括命名空间和控制组。 ![容器技术的层次][4] @@ -29,7 +29,7 @@ ### 命名空间 -命名空间namespace 为容器提供了一个隔离层,给容器提供了一个看起来是它自己的 Linux 文件系统的视图。这就限制了进程所能看到的东西,从而限制了它所能获得的资源。 +命名空间namespace 为容器提供了一个隔离层,给容器提供了一个看起来是独占的 Linux 文件系统的视图。这就限制了进程能访问的内容,从而限制了它所能获得的资源。 在创建容器时,Docker 或 Podman 和其他容器技术使用了 Linux 内核中的几个命名空间: @@ -48,15 +48,15 @@ ``` #### 用户 -用户(`user`)命名空间将用户和组隔离在一个容器内。这是通过允许容器与宿主系统有不同的 UID 和 GID 范围来实现的。用户命名空间使软件能够以 root 用户的身份在容器内运行。如果入侵者攻击容器,然后逃逸到宿主机上,他们就受限于只能以非 root身份出现了。 +用户(`user`)命名空间将用户和组隔离在一个容器内。这是通过分配给容器与宿主系统有不同的 UID 和 GID 范围来实现的。用户命名空间使软件能够以 root 用户的身份在容器内运行。如果入侵者攻击容器,然后逃逸到宿主机上,他们就只能以受限的非 root身份运行了。 #### 挂载 -挂载(`mnt`)命名空间允许容器对系统的文件系统层次结构有自己的视图。你可以在 Linux 系统中的 `/proc//mounts` 位置找到每个容器进程的挂载点。 +挂载(`mnt`)命名空间允许容器有自己的文件系统层次结构视图。你可以在 Linux 系统中的 `/proc//mounts` 位置找到每个容器进程的挂载点。 #### UTS -Unix 分时系统Unix Timeharing System(UTS)命名空间允许容器有一个唯一的主机名和域名。当你运行一个容器时,即使使用 `- name` 标签,也会使用一个随机的 ID 作为主机名。你可以使用 [unshare 命令][6] 来了解一下这个工作原理。 +Unix 分时系统Unix Timeharing System(UTS)命名空间允许容器拥有一个唯一主机名和域名。当你运行一个容器时,即使使用 `- name` 标签,也会使用一个随机的 ID 作为主机名。你可以使用 [unshare 命令][6] 来了解一下这个工作原理。 ``` nivedv@homelab ~]$ docker container run -it --name nived alpine sh @@ -76,7 +76,7 @@ homelab.redhat.com #### IPC -进程间通信Inter-Process Communication(IPC)命名空间允许不同的容器进程通过访问共享内存或使用共享消息队列来进行通信。 +进程间通信Inter-Process Communication(IPC)命名空间允许不同的容器进程之间,通过访问共享内存或使用共享消息队列来进行通信。 ``` [root@demo /]# ipcmk -M 10M @@ -97,11 +97,11 @@ key semid owner perms nsems #### PID -进程 IDProcess ID(PID)命名空间确保在容器内运行的进程与外部世界隔离。当你在容器内运行 `ps` 命令时,由于这个命名空间的存在,你只能看到在容器内运行的进程,而不是在宿主机上。 +进程 IDProcess ID(PID)命名空间确保运行在容器内的进程与外部隔离。当你在容器内运行 `ps` 命令时,由于这个命名空间隔离的存在,你只能看到在容器内运行的进程,而不是在宿主机上。 #### 网络 -网络(`net`)命名空间允许容器对网络接口、IP 地址、路由表、端口号等有自己的视图。容器如何能够与外部世界沟通?你创建的所有容器都会被附加到一个特殊的虚拟网络接口上进行通信。 +网络(`net`)命名空间允许容器有自己网络接口、IP 地址、路由表、端口号等视图。容器如何能够与外部通信?你创建的所有容器都会被附加到一个特殊的虚拟网络接口上进行通信。 ``` [nivedv@homelab ~]$ docker container run --rm -it alpine sh @@ -117,7 +117,7 @@ master docker0 state UP mode DEFAULT group default ### 控制组 -控制组(`cgroup`)是制作一个容器的基本模块。控制组会分配和限制资源,如 CPU、内存、网络 I/O 等,这些资源被容器所使用。容器引擎会自动创建每种类型的控制组文件系统,并在容器运行时为每个容器设置值。 +控制组(`cgroup`)是组成一个容器的基本模块。控制组会分配和限制容器所使用的资源,如 CPU、内存、网络 I/O 等。容器引擎会自动创建每种类型的控制组文件系统,并在容器运行时为每个容器设置配额。 ``` [root@homelab ~]# lscgroup | grep docker @@ -133,7 +133,7 @@ blkio:/docker pids:/docker ``` -容器运行时为每个容器设置了控制组值,所有信息都存储在 `/sys/fs/cgroup/*/docker`。下面的命令将确保容器可以使用 50000 微秒的 CPU 时间,并将内存的软、硬限制分别设置为 500M 和 1G。 +容器运行时为每个容器设置了控制组值,所有信息都存储在 `/sys/fs/cgroup/*/docker`。下面的命令将确保容器可以使用 50000 微秒的 CPU 时间片,并将内存的软、硬限制分别设置为 500M 和 1G。 ``` [root@homelab ~]# docker container run -d --name test-cgroups --cpus 0.5 --memory 1G --memory-reservation 500M httpd @@ -154,13 +154,13 @@ memory:/docker/c3503ac704dafea3522d3bb82c77faff840018e857a2a7f669065f05c8b2cc84 ### SECCOMP -Seccomp 意思是“安全计算secure computing”。它是一项 Linux 功能,用于限制应用程序允许进行的系统调用的集合。例如,Docker 的默认 seccomp 配置文件禁用了大约 44 个系统调用(总计超过 300 个)。 +Seccomp 意思是“安全计算secure computing”。它是一项 Linux 功能,用于限制应用程序进行的系统调用的集合。例如,Docker 的默认 seccomp 配置文件禁用了大约 44 个系统调用(总计超过 300 个)。 -这里的思路是让容器只访问容器可能需要的那些资源。例如,如果你不需要容器改变主机上的时钟时间,你可能不会使用 `clock_adjtime` 和 `clock_settime` 系统调用,屏蔽它们是合理的。同样地,你不希望容器改变内核模块,所以没有必要让它们进行 `create_module`、 `delete_module` 系统调用。 +这里的思路是让容器只访问所必须的资源。例如,如果你不需要容器改变主机上的时钟时间,你可能不会使用 `clock_adjtime` 和 `clock_settime` 系统调用,屏蔽它们是合理的。同样地,你不希望容器改变内核模块,所以没有必要让它们使用 `create_module`、 `delete_module` 系统调用。 ### SELinux -SELinux 是“安全增强的 Linuxsecurity-enhanced Linux”的缩写。如果你在你的宿主机上运行的是 Red Hat 发行版,那么 SELinux 是默认启用的。SELinux 可以让你限制一个应用程序只能访问它自己的文件,并阻止任何其他进程访问它们。因此,如果一个应用程序被破坏了,它将限制该应用程序可以影响或控制的文件数量。它通过为文件和进程设置上下文环境以及定义策略来实现这一目的,这些策略将强制执行一个进程可以看到和改变的内容。 +SELinux 是“安全增强的 Linuxsecurity-enhanced Linux”的缩写。如果你在你的宿主机上运行的是 Red Hat 发行版,那么 SELinux 是默认启用的。SELinux 可以让你限制一个应用程序只能访问它自己的文件,并阻止任何其他进程访问。因此,如果一个应用程序被破坏了,它将限制该应用程序可以影响或控制的文件数量。通过为文件和进程设置上下文环境以及定义策略来实现,这些策略将限制一个进程可以访问和更改的内容。 容器的 SELinux 策略是由 `container-selinux` 包定义的。默认情况下,容器以 `container_t` 标签运行,允许在 `/usr` 目录下读取(`r`)和执行(`x`),并从 `/etc` 目录下读取大部分内容。标签`container_var_lib_t` 是与容器有关的文件的通用标签。 @@ -177,7 +177,7 @@ via: https://opensource.com/article/21/8/container-linux-technology 作者:[Nived V][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 4faf982f7f05f7bdd8592ed5a14a6e48b0166085 Mon Sep 17 00:00:00 2001 From: anine Date: Fri, 17 Sep 2021 00:23:37 +0800 Subject: [PATCH 0400/1588] translated --- ...i Zero vs Zero W- What-s the Difference.md | 110 ------------------ ...i Zero vs Zero W- What-s the Difference.md | 103 ++++++++++++++++ 2 files changed, 103 insertions(+), 110 deletions(-) delete mode 100644 sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md create mode 100644 translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md diff --git a/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md b/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md deleted file mode 100644 index 22f83c9589..0000000000 --- a/sources/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md +++ /dev/null @@ -1,110 +0,0 @@ -[#]: subject: "Raspberry Pi Zero vs Zero W: What’s the Difference?" -[#]: via: "https://itsfoss.com/raspberry-pi-zero-vs-zero-w/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "anine09" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Raspberry Pi Zero vs Zero W: What’s the Difference? -====== - -Raspberry Pi created a revolution when it launched the $25 mini computer ten years ago. Over the time, several variants of Raspberry Pi have been launched. Some upgrade a previous model and some are crafted for specific purposes. - -Of all the Raspberry models, Pi Zero and Pi Zero W are the cheapest ones aimed for small scale and IoT projects. Both devices are almost similar to each other but with a subtle and important difference. - -**So, what is the difference between Raspberry Pi Zero and Zero W? The W in Zero W stands for Wireless and it depicts its wireless capability over the Pi Zero model. That’s the single biggest difference between the two similar models.** - -Let’s take a look at a bit more in detail. - -### Key Difference Between Pi Zero and Pi Zero W - -![][1] - -While Raspberry Pi Zero was built with a goal that provides more utility with half of the size of the A+ board. - -And, Raspberry Pi Zero W was introduced later to include wireless connectivity built-in without needing a separate accessory/module to enable Bluetooth and Wi-Fi. - -This is the key difference between the two with the rest of the specifications remaining identical. - -So, if you want the support for: - - * 802.11 b/g/n wireless LAN - * Bluetooth 4.1 - * Bluetooth Low Energy (BLE) - - - -Raspberry Pi Zero W will be the definite choice to go with. - -Also, Raspberry Pi Zero W offers a variant with header pins included which is “Raspberry Pi Zero WH”. - -Preview | Product | Price | ----|---|---|--- -[![CanaKit Raspberry Pi Zero W \(Wireless\) Complete Starter Kit - 16 GB Edition][2]][3] | [CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition][3] | $32.99[][4] | [Buy on Amazon][5] - -### Raspberry Pi Zero and Raspberry Pi Zero W Specifications - -![Raspberry Pi Zero W][6] - -The [specifications for Raspberry Pi Zero W][7] and Zero are almost identical. - -You get a 1 GHz single-core CPU coupled with 512 MB RAM. For connectivity, you get a mini HDMI port, micro USB OTG support, micro USB power, and a CSI Camera connector (to plug in a camera module). - -These boards also feature a [HAT][8] (Hardware Attached on Top)-compatible 40 pin header, but generally, without the pins that let you easily plug the interfaces. - -You can choose to explore the capabilities using [various Raspberry Pi OS][9] available. In either case, just stick to the Raspberry Pi OS. - -### Raspberry Pi Zero series: Is it worth It? - -![Raspberry Pi Zero][10] - -Raspberry Pi Zero is a single-board computer that is popular for its form factor. Even though you have plenty of [Raspberry Pi zero alternatives][11], Raspberry Pi Zero is the recommended choice for all the good reasons. - -Of course, unless you have specific requirements. - -In addition to the size of the board, the pricing, power requirement, and processing power are some of the key highlights of this board under **$20**. - -So, if you are looking for the essential features under a budget, the Raspberry Zero series should work for you. - -**Recommended Read:** - -![][12] - -#### [27 Super Cool Raspberry Pi Zero W Projects for DIY Enthusiasts][13] - -The small form factor of the Raspberry Pi Zero W enables a new range of projects. Here are some cool projects you can build with your tiny Raspberry Pi Zero W. - -### Is Raspberry Pi Zero series affordable? - -Raspberry Pi Zero costs **$5** and the Raspberry Pi Zero W would cost you around **$10**. ****Of course, depending on its availability and region, the cost will differ. If you want the Raspberry Pi Zero W with header pins, it should cost you around **$14**. - -There are other devices that can be used as an [alternative to Raspberry Pi Zero][11] and they have similar price tag. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/raspberry-pi-zero-vs-zero-w/ - -作者:[Ankush Das][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://itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-vs-zero-w.png?resize=800%2C450&ssl=1 -[2]: https://i1.wp.com/m.media-amazon.com/images/I/517BwcAPmTL._SL160_.jpg?ssl=1 -[3]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition) -[4]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) -[5]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Buy on Amazon) -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-w.png?resize=600%2C400&ssl=1 -[7]: https://itsfoss.com/raspberry-pi-zero-w/ -[8]: https://github.com/raspberrypi/hats -[9]: https://itsfoss.com/raspberry-pi-os/ -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-1.png?resize=600%2C400&ssl=1 -[11]: https://itsfoss.com/raspberry-pi-zero-alternatives/ -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/raspberry-pi-zero-w-projects.png?fit=800%2C450&ssl=1 -[13]: https://itsfoss.com/raspberry-pi-zero-projects/ diff --git a/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md b/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md new file mode 100644 index 0000000000..255be35f17 --- /dev/null +++ b/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md @@ -0,0 +1,103 @@ +[#]: subject: "Raspberry Pi Zero vs Zero W: What’s the Difference?" +[#]: via: "https://itsfoss.com/raspberry-pi-zero-vs-zero-w/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "anine09" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +树莓派 Zero 与 Zero W:多方位对比 +====== + + + +树莓派十年前凭借 25 美元的迷你电脑掀起了一场革命。在这段时间里,树莓派发布了许多分支系列。也将一些为特定目的而设计的模块进行了一些升级。 + +在所有的树莓派模块中,Pi Zero 和 Pi Zero W 是旨在为小规模项目和 IoT 项目设计的最便宜的模块。这两种设备几乎是相同的,但是它们之间有一些微妙而重要的区别。 + + +**那么,树莓派 Zero 和 Zero W 之间的区别是什么?Zero W 中的 W 代表的是无线(Wireless),它表示的是 Zero W 模块拥有无线功能。这是这两个相似模块之间的最大差异** + +让我们更详细地看看其他细节吧。 + +### Pi Zero 与 Pi Zero W 之间的主要不同点 +![][1] + +虽然 树莓派 Zero 是以在只有 A+ 板一半的大小上提供尽可能多的功能为目标。 + +而且,树莓派 Zero W 在不需要任何附加的组件和模块的情况下就可以使用蓝牙和 Wifi。 + +这是两者之间的区别,其他的部分都是相同的。 + +所以,如果你需要以下功能: + + * 802.11 b/g/n 无线网口 + * 蓝牙 4.1 + * 低功耗的蓝牙模块(BLE:Bluetooth Low Energy) + +树莓派 Zero W 将是你的不二之选。 + +此外,树莓派 Zero W 提供了一种带引脚的版本,叫做 “树莓派 Pi Zero WH” + +### 树莓派 Zero 和 Zero W 的规格 + +![Raspberry Pi Zero W][6] + +[树莓派 Zero 和 Zero W 的规格][7]几乎是一样的。 + +它们都具有 1 GHz 的单核 CPU 和 512 MB 的 RAM。至于接口方面,一个 mini HDMI 接口,支持 micro USB OTG,micro USB 供电和一个 CSI 摄像头接口(需要插入一个相机模块)。 + +这些板子会提供一种叫 [HAT][8](Hardware Attached on Top,顶部附加硬件),兼容 40个引脚,当通常情况下,没有这些引脚你能更容易的使用接口。 + +你可以根据自己的功能需要选择使用[各种树莓派兼容的系统][9],但无论哪种情况,我还是推荐你使用 Raspberry Pi OS。 + +### 树莓派 Zero 系列值不值得买? + +![Raspberry Pi Zero][10] + +树莓派 Zero 是一种很受人们喜欢的单片机形式,尽管你有很多树莓派 Zero 的替代品,树莓派 Zero 仍然是最推荐的选择。 + +当然,除非你有特殊需求。 + +In addition to the size of the board, the pricing, power requirement, and processing power are some of the key highlights of this board under **$20**. +另外,对于同水平的单片机规模,定价,功率要求,运算能力而言,树莓派 Zero 最亮眼的地方就是它低于 **20 美元**的价格。 + +So, if you are looking for the essential features under a budget, the Raspberry Zero series should work for you. +因此,如果你正在寻找预算中满足基本功能的单片机,树莓派 Zero 就是专门为你打造的。 + +### Is Raspberry Pi Zero series affordable? +### 树莓派 Zero 系列价格怎么样? + +Raspberry Pi Zero costs **$5** and the Raspberry Pi Zero W would cost you around **$10**. ****Of course, depending on its availability and region, the cost will differ. If you want the Raspberry Pi Zero W with header pins, it should cost you around **$14**. +树莓派 Zero 售价 **5 美元** ,Zero W 售价 **10 美元左右**,当然,在不同的地方,定价规则会不一样,如果你选择树莓派 Zero W 带 引脚的版本,售价大概是 **14 美元**左右。 + +There are other devices that can be used as an [alternative to Raspberry Pi Zero][11] and they have similar price tag. +还有[其他的设备可以代替树莓派 Zero][11],它们价格也相差不大。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-zero-vs-zero-w/ + +作者:[Ankush Das][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://itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-vs-zero-w.png?resize=800%2C450&ssl=1 +[2]: https://i1.wp.com/m.media-amazon.com/images/I/517BwcAPmTL._SL160_.jpg?ssl=1 +[3]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 "CanaKit Raspberry Pi Zero W (Wireless) Complete Starter Kit - 16 GB Edition" +[4]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 "Amazon Prime" +[5]: https://www.amazon.com/dp/B072N3X39J?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 "Buy on Amazon" +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-w.png?resize=600%2C400&ssl=1 +[7]: https://itsfoss.com/raspberry-pi-zero-w/ +[8]: https://github.com/raspberrypi/hats +[9]: https://itsfoss.com/raspberry-pi-os/ +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-zero-1.png?resize=600%2C400&ssl=1 +[11]: https://itsfoss.com/raspberry-pi-zero-alternatives/ +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/raspberry-pi-zero-w-projects.png?fit=800%2C450&ssl=1 +[13]: https://itsfoss.com/raspberry-pi-zero-projects/ From 6513b8b464af53a55e653c5c7fd2c1c6724e28c0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Sep 2021 05:02:26 +0800 Subject: [PATCH 0401/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210917?= =?UTF-8?q?=20How=20to=20Install=20Kali=20Linux=20in=20VMware?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210917 How to Install Kali Linux in VMware.md --- ...917 How to Install Kali Linux in VMware.md | 190 ++++++++++++++++++ 1 file changed, 190 insertions(+) create mode 100644 sources/tech/20210917 How to Install Kali Linux in VMware.md diff --git a/sources/tech/20210917 How to Install Kali Linux in VMware.md b/sources/tech/20210917 How to Install Kali Linux in VMware.md new file mode 100644 index 0000000000..0777c9b862 --- /dev/null +++ b/sources/tech/20210917 How to Install Kali Linux in VMware.md @@ -0,0 +1,190 @@ +[#]: subject: "How to Install Kali Linux in VMware" +[#]: via: "https://itsfoss.com/install-kali-linux-vmware/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Kali Linux in VMware +====== + +Kali Linux is the de facto standard of [Linux distributions used for learning and practicin][1][g][1] [hacking and penetration testing][1]. + +And, if you’ve been tinkering around with Linux distros long enough, you might have tried it out just out of curiosity. + +However, no matter what you use it for, it is not a replacement for a regular full-fledged desktop Linux operating system. Hence, it is recommended (at least for beginners) to install Kali Linux using a virtual machine program like VMware. + +With a virtual machine, you can use Kali Linux as a regular application in your Windows or Linux system. It’s almost the same as running VLC or Skype in your system. + +There are a few free virtualization tools available for you. You can [install Kali Linux on Oracle VirtualBox][2] or use VMWare Workstation. + +This tutorial focuses on VMWare. + +### Installing Kali Linux on VMware on Windows and Linux + +Non-FOSS alert! + +VM Ware is not open source software. + +For this tutorial, I presume that you are using Windows, considering most VMware users prefer using Windows 10/11. + +However, the _**tutorial is also valid for Linux except the VMWare installation on Windows part**_. You can [easily install VMWare on Ubuntu][3] and other Linux distributions. + +#### Step 1: Install VMWare Workstation Player (on Windows) + +If you already have VMware installed on your system, you can skip the steps to install Kali Linux. + +Head to [VMWare’s official workstation player webpage][4] and then click on the “**Download Free**” button. + +![][5] + +Next, you get to choose the version (if you want something specific or encountering bugs in the latest version) and then click on “**Go to Downloads.**“ + +![][6] + +And then you get the download buttons for both Windows and Linux versions. You will have to click on the button for Windows 64-bit because that is what we need here. + +![][7] + +There is no support for 32-bit systems, in case you were wondering. + +Finally, when you get the .exe file downloaded, launch it to start the installation process. You need to hit “Next” to get started installing VMware. + +![][8] + +Next, you will have to agree to the policies and conditions to continue. + +![][9] + +Now, you get to choose the path of your installation. Ideally, keep it at the default settings. But, if you need better keyboard response / in-screen keyboard performance in the virtual machine, you may want to enable the “**Enhanced Keyboard Driver**.” + +![][10] + +Proceeding to the next step, you can choose to disable checking for updates every time you start the program (can be annoying) and disable sending data to VMware as part of its user experience improvement program. + +![][11] + +If you want quick access using desktop and start menu shortcuts, you can check those settings or toggle them off, which I prefer. + +![][12] + +Now, you have to continue to start the installation. + +![][13] + +This may take a while, and when completed, you get greeted with another window that lets you finish the process and gives you the option to enter a license key. If you want to get the commercial license for your use-case, you need the VMware Workstation Pro edition, or else, the player is free for personal use. + +![][14] + +Attention! + +Please make sure that virtualization is enabled in your system. Recent Windows versions require that you enable the virtualization explicitly to use virtual machines. + +#### Step 2: Install Kali Linux on VMware + +To get started, you need to download the image file of Kali Linux. And, when it comes to Kali Linux, they offer a separate ISO file if you plan to use it on a virtual machine. + +![][15] + +Head to its [official download page][16] and download the prebuilt VMware image available. + +![][17] + +You can download the **.7z** file directly or utilize Torrent (which is generally faster). In either case, you can also check the file integrity with the SHA256 value provided. + +Once downloaded, you need to extract the file to any path of your choice. + +![][18] + +Open VMware Workstation Player and then click on “**Open a Virtual Machine**.” Now, look for the folder you extracted. And navigate through it till you find a file with the “**.vmx**” extension. + +For instance: **Kali-Linux-2021.3-vmware-amd64.vmx** + +![][19] + +Select the .vmx file to open the virtual machine. And, it should appear right in your VMware player. + +You can choose to launch the virtual machine with the default settings. Or, if you want to tweak the hardware allocated to the virtual machine, feel free to change the settings before you launch it. + +![][20] + +Depending on your computer hardware, you should allocate more memory and at least half of your processor cores to get a smooth performance. + +In this case, I have 16 Gigs of RAM and a quad-core processor. Hence, it is safe to allocate nearly 7 GB of RAM and two cores for this virtual machine. + +![][21] + +While you can assign more resources, but it might affect the performance of your host operating system when working on a task. So, it is recommended to keep a balance between the two. + +Now, save the settings and hit “**Play virtual machine**” to start Kali Linux on VMware. + +When it starts loading up, you may be prompted with some tips to improve performance by tweaking some virtual machine settings. + +You do not have to do that, but if you notice performance issues, you can disable side-channel mitigations (needed for enhanced security) to uplift the performance of the VM. + +Also, you may be prompted to download and [install VMware tools for Linux][22]; you need to do this to get a good VM experience. + +Once you do that, you will be greeted with Kali Linux’s login screen. + +![][23] + +Considering that you launched a prebuilt VMware folder, you need to enter the default login and password to proceed. + +**Username**: kali +**Password:** kali + +![][24] + +That’s it! You’re done installing Kali Linux on VMware. Now, all you have to do is start exploring! + +### Where to go from here? + +Here are a few tips you can utilize: + + * If clipboard sharing and file sharing is not working, [install VMWare tools][22] on the guest system (Kali Linux). + * If you are new to it, check out this [list of Kali Linux tools][25]. + + + +Feel free to share your thoughts if you find this tutorial helpful. Do you prefer to install Kali Linux without using a VMware image ready to go? Let me know in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-kali-linux-vmware/ + +作者:[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://itsfoss.com/linux-hacking-penetration-testing/ +[2]: https://itsfoss.com/install-kali-linux-virtualbox/ +[3]: https://itsfoss.com/install-vmware-player-ubuntu-1310/ +[4]: https://www.vmware.com/products/workstation-player.html +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download.png?resize=732%2C486&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-1.png?resize=800%2C292&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-final.png?resize=800%2C212&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-1.png?resize=692%2C465&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-license.png?resize=629%2C443&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-2.png?resize=638%2C440&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-tracking.png?resize=618%2C473&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-shortcuts.png?resize=595%2C445&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-install.png?resize=620%2C474&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-installed.png?resize=589%2C441&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-image-kali.png?resize=800%2C488&ssl=1 +[16]: https://www.kali.org/get-kali/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-download.png?resize=800%2C764&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/extract-vmware-image.png?resize=617%2C359&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-folder.png?resize=800%2C498&ssl=1 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/virtual-machine-settings-kali.png?resize=800%2C652&ssl=1 +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-vm-settings.png?resize=800%2C329&ssl=1 +[22]: https://itsfoss.com/install-vmware-tools-linux/ +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-linux-vm-login.png?resize=800%2C540&ssl=1 +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux.png?resize=800%2C537&ssl=1 +[25]: https://itsfoss.com/best-kali-linux-tools/ From eb77bf70b5f7993fe5e71259aaab4c16269b87f8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Sep 2021 05:02:48 +0800 Subject: [PATCH 0402/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210916?= =?UTF-8?q?=20Watch=20commands=20and=20tasks=20with=20the=20Linux=20watch?= =?UTF-8?q?=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210916 Watch commands and tasks with the Linux watch command.md --- ... and tasks with the Linux watch command.md | 124 ++++++++++++++++++ 1 file changed, 124 insertions(+) create mode 100644 sources/tech/20210916 Watch commands and tasks with the Linux watch command.md diff --git a/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md b/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md new file mode 100644 index 0000000000..bc3b423046 --- /dev/null +++ b/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md @@ -0,0 +1,124 @@ +[#]: subject: "Watch commands and tasks with the Linux watch command" +[#]: via: "https://opensource.com/article/21/9/linux-watch-command" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Watch commands and tasks with the Linux watch command +====== +See how the watch command can let you know when a task has been +completed or a command has been executed. +![Clock, pen, and notepad on a desk][1] + +There are many times when you need to wait for something to finish, such as: + + * A file download. + * Creating or extracting a [tar][2] file. + * An [Ansible][3] job. + + + +Some of these processes have some sort of progress indication, but sometimes the process is run through a layer of abstraction, and the only way to measure the progress is through its side effects. Some of these might be: + + * A file being downloaded keeps growing. + * A directory extracted from a tarball fills up with files. + * The Ansible job builds a [container][4]. + + + +You can query all of these things with commands like these: + + +``` +$ ls -l downloaded-file +$ find . | wc -l +$ podman ps +$ docker ps +``` + +But running these commands over and over, even if it is with the convenience of [Bash history][5] and the **Up Arrow**, is tedious. + +Another approach is to write a little Bash script to automate these commands for you: + + +``` +while : +do +  docker ps +  sleep 2 +done +``` + +But such scripts can also become tedious to write. You could write a little generic script and package it, so it's always available to you. Luckily, other open source developers have already been there and done that. + +The result is the command `watch`. + +### Installing watch + +The `watch` command is part of the [`procps-ng` package][6], so if you're on Linux, you already have it installed. + +On macOS, install `watch` using [MacPorts][7] or [Homebrew][8]. On Windows, use [Chocolatey][9]. + +### Using watch + +The `watch` command periodically runs a command and shows its output. It has some text-terminal niceties, so only the latest output is on the screen. + +The simplest usage is: `watch `. + +For example, prefixing the `docker ps` command with `watch` works like this: + + +``` +`$ watch docker ps` +``` + +The `watch` command, and a few creative Unix command-line tricks, can generate ad-hoc dashboards. For example, to count audit events: + + +``` +`$ watch 'grep audit: /var/log/kern.log |wc -l'` +``` + +In the last example, it is probably useful if there's a visual indication that the number of audit events changed. If change is expected, but you want something to look "different," `watch --differences` works well. It highlights any differences from the last run. This works especially well if you are grepping in multiple files, so you can easily see which one changed. + +If changes are not expected, you can ask for them to be highlighted "permanently" to know which ones to investigate by using `watch --differences=permanent`. This is often more useful. + +### Controlling frequency + +Finally, sometimes the command might be resource-intensive and should not be run too frequently. The `-n` parameter controls the frequency. Watch uses two seconds by default, but `watch -n 10` might be appropriate for something more resource-intensive, like grepping for a pattern in any file in a subdirectory: + + +``` +`$ watch -n 10 'find . -type f | xargs grep suspicious-pattern'` +``` + +### Watch a command with watch + +The `watch` command is useful for many ad-hoc system administration tasks where you need to wait for some time-consuming step, without a progress bar, before moving on to the next one. Though this is not a great situation to be in, `watch` can make it slightly better—and give you time to start working on those notes for the retrospective! Download the **[cheat sheet][10] **to keep helpful syntax and options close at hand. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/linux-watch-command + +作者:[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/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 (Clock, pen, and notepad on a desk) +[2]: https://opensource.com/article/17/7/how-unzip-targz-file +[3]: https://opensource.com/resources/what-ansible +[4]: https://opensource.com/resources/what-docker +[5]: https://opensource.com/article/20/6/bash-history-control +[6]: https://opensource.com/article/21/8/linux-procps-ng +[7]: https://opensource.com/article/20/11/macports +[8]: https://opensource.com/article/20/6/homebrew-mac +[9]: https://opensource.com/article/20/3/chocolatey +[10]: https://opensource.com/downloads/watch-cheat-sheet From f2d16e81eea9ff25f6d710fe5783c9c131302951 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Sep 2021 05:03:05 +0800 Subject: [PATCH 0403/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210916?= =?UTF-8?q?=20How=20I=20patched=20Python=20to=20include=20this=20great=20R?= =?UTF-8?q?uby=20feature?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210916 How I patched Python to include this great Ruby feature.md --- ...thon to include this great Ruby feature.md | 865 ++++++++++++++++++ 1 file changed, 865 insertions(+) create mode 100644 sources/tech/20210916 How I patched Python to include this great Ruby feature.md diff --git a/sources/tech/20210916 How I patched Python to include this great Ruby feature.md b/sources/tech/20210916 How I patched Python to include this great Ruby feature.md new file mode 100644 index 0000000000..d12bcc11e1 --- /dev/null +++ b/sources/tech/20210916 How I patched Python to include this great Ruby feature.md @@ -0,0 +1,865 @@ +[#]: subject: "How I patched Python to include this great Ruby feature" +[#]: via: "https://opensource.com/article/21/9/python-else-less" +[#]: author: "Miguel Brito https://opensource.com/users/miguendes" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I patched Python to include this great Ruby feature +====== +What I learned from adding "else-less" functionality to Python, as +inspired by Ruby. +![Python programming language logo with question marks][1] + +Ruby, [unlike Python][2], makes lots of things implicit, and there's a special kind of _if_ expression that demonstrates this well. It's often referred to as an "inline-if" or "conditional modifier", and this special syntax is able to return one value when a condition is true, but another value (`nil`, specifically) when a condition is false. Here's an example: + + +``` +$ irb +irb(main):> RUBY_VERSION +=> "2.7.1" +irb(main):> a = 42 if true +=> 42 +irb(main):> b = 21 if false +=> nil +irb(main):> b +=> nil +irb(main):> a +=> 42 +``` + +In Python, you can't do that without explicitly adding an `else` clause to the expression. In fact, as of [this PR][3], the interpreter tells you immediately that `else` is mandatory: + + +``` +$ python +Python 3.11.0a0 +>>> a = 42 if True +  File "<stdin>", line 1 +    ;a = 42 if True +    ^^^^^^^^^^ +SyntaxError: expected 'else' after 'if' expression +``` + +However, I find Ruby's `if` actually very convenient. + +![return if python][4] + +Python accepts else-less if statements, similar to Ruby. + +This convenience became more evident when I had to go back to Python and write things like this: + + +``` +`>>> my_var = 42 if some_cond else None` +``` + +So I thought to myself, what would it be like if Python had a similar feature? Could I do it myself? How hard would that be? + +### Looking into Python's source code + +Digging into CPython's code and changing the language's syntax sounded not trivial to me. Luckily, during the same week, I found out on Twitter that [Anthony Shaw][5] had just written a [book on CPython Internals][6] and it was available for pre-release. I didn't think twice and bought the book. I've got to be honest, I'm the kind of person who buys things and doesn't use them immediately. As I had other plans in mind, I let it "gather dust" in my home folder until I had to work with that Ruby service again. It reminded me of the CPython Internals book and how challenging hacking the guts of Python would be. + +The first thing was to go through the book from the very start and try to follow each step. The book focuses on Python 3.9, so in order to follow it, one needs to check out the 3.9 tag, and that's what I did. I learned about how the code is structured and then how to compile it. The next chapters show how to extend the grammar and add new things, such as a new operator. + +As I got familiar with the code base and how to tweak the grammar, I decided to give it a spin and make my own changes to it. + +### The first (failed) attempt + +As I started finding my way around CPython's code from the latest main branch, I noticed that lots of things had changed since Python 3.9, yet some fundamental concepts didn't. + +My first attempt was to dig into the grammar definition and find the if expression rule. The file is currently named `Grammar/python.gram`. Locating it was not difficult. An ordinary **CTRL+F** for the `else` keyword was enough. + + +``` +file: Grammar/python.gram +... +expression[expr_ty] (memo): +   | invalid_expression +   | a=disjunction 'if' b=disjunction 'else' c=expression { _PyAST_IfExp(b, a, c, EXTRA) } +   | disjunction +   | lambdef +.... +``` + +Now with the rule in hand, my idea was to add one more option to the current `if` expression where it would match `a=disjunction 'if' b=disjunction` and the `c` expression would be `NULL`. + +This new rule should be placed immediately after the complete one, otherwise, the parser would match `a=disjunction 'if' b=disjunction` always, returning a `SyntaxError`. + + +``` +... +expression[expr_ty] (memo): +   | invalid_expression +   | a=disjunction 'if' b=disjunction 'else' c=expression { _PyAST_IfExp(b, a, c, EXTRA) } +   | a=disjunction 'if' b=disjunction { _PyAST_IfExp(b, a, NULL, EXTRA) } +   | disjunction +   | lambdef +.... +``` + +### Regenerating the parser and compiling Python from source + +CPython comes with a `Makefile` containing lots of useful commands. One of them is the [`regen-pegen` command][7] which converts `Grammar/python.gram` into `Parser/parser.c`. + +Besides changing the grammar, I had to modify the AST for the _if_ expression. AST stands for Abstract Syntax Tree, and it is a way of representing the syntactic structure of the grammar as a tree. For more information about ASTs, I highly recommend the [Crafting Interpreters book][8] by [Robert Nystrom][9]. + +Moving on, if you observe the rule for the _if_ expression, it goes like this: + + +``` +`   | a=disjunction 'if' b=disjunction 'else' c=expression { _PyAST_IfExp(b, a, c, EXTRA) }` +``` + +The means when the parser finds this rule, it calls the `_PyAST_IfExp`, which gives back a `expr_ty` data structure. So this gave me a clue that to implement the new rule's behavior, I'd need to change `_PyAST_IfExp`. + +To find where it is located, I used my `rip-grep` skills and searched for it inside the source root: + + +``` +$ rg _PyAST_IfExp -C2 . + +[OMITTED] +Python/Python-ast.c +2686- +2687-expr_ty +2688:_PyAST_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int +2689- col_offset, int end_lineno, int end_col_offset, PyArena *arena) +2690-{ +[OMITTED] +``` + +The implementation goes like this: + + +``` +expr_ty +_PyAST_IfExp(expr_ty test, expr_ty body, expr_ty orelse, int lineno, int +             col_offset, int end_lineno, int end_col_offset, PyArena *arena) +{ +   expr_ty p; +   if (!test) { +        PyErr_SetString(PyExc_ValueError, +                        "field 'test' is required for IfExp"); +       return NULL; +   } +   if (!body) { +        PyErr_SetString(PyExc_ValueError, +                        "field 'body' is required for IfExp"); +        return NULL; +   } +   if (!orelse) { +        PyErr_SetString(PyExc_ValueError, +                        "field 'orelse' is required for IfExp"); +        return NULL; +   } +   p = (expr_ty)_PyArena_Malloc(arena, sizeof(*p)); +   if (!p) +        return NULL; +   p->kind = IfExp_kind; +   p->v.IfExp.test = test; +   p->v.IfExp.body = body; +   p->v.IfExp.orelse = orelse; +   p->lineno = lineno; +   p->col_offset = col_offset; +   p->end_lineno = end_lineno; +   p->end_col_offset = end_col_offset; +   return p; +} +``` + +Since I passed **orelse**NULL, I thought it was just a matter of changing the body of `if (!orelse)`None to `orelse`. It would look like this: + + +``` +   if (!orelse) { +\- PyErr_SetString(PyExc_ValueError, +\- "field 'orelse' is required for IfExp"); +\- return NULL; +\+ orelse = Py_None; +   } +``` + +Now it was time to test it. I compiled the code with `make -j8 -s` and fired up the interpreter: + + +``` +$ make -j8 -s + +Python/Python-ast.c: In function ‘_PyAST_IfExp’: +Python/Python-ast.c:2703:16: warning: assignment from incompatible pointer type [-Wincompatible-pointer-types] +         orelse = Py_None; +``` + +Despite the glaring obvious warnings, I decided to ignore it just to see what would happen. + + +``` +$ ./python +Python 3.11.0a0 (heads/ruby-if-new-dirty:f92b9133ef, Aug 2 2021, 09:13:02) [GCC 7.5.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> a = 42 if True +>>> a +42 +>>> b = 21 if False +[1] 16805 segmentation fault (core dumped) ./python +``` + +Ouch! It worked for the `if True` case, but assigning `Py_None` to `expr_ty orelse` caused a `segfault`. + +Time to go back to see what went wrong. + +### The second attempt + +It wasn't too difficult to figure out where I messed up. `orelse` is an `expr_ty`, and I assigned to it a `Py_None` which is a `PyObject *`. Again, thanks to `rip-grep`, I found its definition: + + +``` +$ rg constant -tc -C2 + +Include/internal/pycore_asdl.h +14-typedef PyObject * string; +15-typedef PyObject * object; +16:typedef PyObject * constant; +``` + +Now, how did I find out `Py_None` was a constant? + +While reviewing the `Grammar/python.gram` file, I found that one of the rules for the new pattern matching syntax is defined like this: + + +``` +# Literal patterns are used for equality and identity constraints +literal_pattern[pattern_ty]: +   | value=signed_number !('+' | '-') { _PyAST_MatchValue(value, EXTRA) } +   | value=complex_number { _PyAST_MatchValue(value, EXTRA) } +   | value=strings { _PyAST_MatchValue(value, EXTRA) } +   | 'None' { _PyAST_MatchSingleton(Py_None, EXTRA) } +``` + +However, this rule is a `pattern_ty`, not an `expr_ty`. But that's fine. What really matters is to understand what `_PyAST_MatchSingleton` actually is. Then, I searched for it in `Python/Python-ast.c:` + + +``` +file: Python/Python-ast.c +... +pattern_ty +_PyAST_MatchSingleton(constant value, int lineno, int col_offset, int +                        end_lineno, int end_col_offset, PyArena *arena) +... +``` + +I looked for the definition of a `None` node in the grammar. To my great relief, I found it! + + +``` +atom[expr_ty]: +   | NAME +   | 'True' { _PyAST_Constant(Py_True, NULL, EXTRA) } +   | 'False' { _PyAST_Constant(Py_False, NULL, EXTRA) } +   | 'None' { _PyAST_Constant(Py_None, NULL, EXTRA) } +.... +``` + +At this point, I had all the information I needed. To return an `expr_ty` representing `None`, I needed to create a node in the AST which is constant by using the `_PyAST_Constant` function. + + +``` +   | a=disjunction 'if' b=disjunction 'else' c=expression { _PyAST_IfExp(b, a, c, EXTRA) } +\- | a=disjunction 'if' b=disjunction { _PyAST_IfExp(b, a, NULL, EXTRA) } +\+ | a=disjunction 'if' b=disjunction { _PyAST_IfExp(b, a, _PyAST_Constant(Py_None, NULL, EXTRA), EXTRA) } +   | disjunction +``` + +Next, I must revert `Python/Python-ast.c` as well. Since I'm feeding it a valid `expr_ty`, it will never be `NULL`. + + +``` +file: Python/Python-ast.c +... +   if (!orelse) { +\- orelse = Py_None; +\+ PyErr_SetString(PyExc_ValueError, +\+ "field 'orelse' is required for IfExp"); +\+ return NULL; +   } +... +``` + +I compiled it again: + + +``` +$ make -j8 -s && ./python +Python 3.11.0a0 (heads/ruby-if-new-dirty:25c439ebef, Aug 2 2021, 09:25:18) [GCC 7.5.0] on linux +Type "help", "copyright", "credits" or "license" for more information. +>>> c = 42 if True +>>> c +42 +>>> b = 21 if False +>>> type(b) +<class 'NoneType'> +>>> +``` + +It works! + +Now, I needed to do one more test. Ruby functions allow returning a value if a condition matches, and if not, the rest of the function body gets executed. Like this: + + +``` +> irb +irb(main):> def f(test) +irb(main):>   return 42 if test +irb(main):>   puts 'missed return' +irb(main):>   return 21 +irb(main):> end +=> :f +irb(main):> f(false) +missed return +=> 21 +irb(main):> f(true) +=> 42 +``` + +At this point, I wondered if that would work with my modified Python. I rushed to the interpreter again and wrote the same function: + + +``` +>>> def f(test): +... return 42 if test +... print('missed return') +... return 21 +... +>>> f(False) +>>> f(True) +42 +>>> +``` + +The function returns `None` if _test_ is `False`... To help me debug this, I summoned the [ast module][10]. The official docs define it like so: + +> The ast module helps Python applications to process trees of the Python abstract syntax grammar. The abstract syntax itself might change with each Python release; this module helps to find out programmatically what the current grammar looks like. + +I printed the AST for this function: + + +``` +>>> fc = ''' +... def f(test): +... return 42 if test +... print('missed return') +... return 21 +... ''' +>>> print(ast.dump(ast.parse(fc), indent=4)) +Module( +   body=[ +        FunctionDef( +            name='f', +            args=arguments( +                posonlyargs=[], +                args=[ +                  arg(arg='test')], +                kwonlyargs=[], +                kw_defaults=[], +                defaults=[]), +            body=[ +                Return( +                  value=IfExp( +                  test=Name(id='test', ctx=Load()), +                  ;body=Constant(value=42), +                  orelse=Constant(value=None))), +                Expr( +                  value=Call( +                    func=Name(id='print', ctx=Load()), +                      args=[ +                        Constant(value='missed return')], +                      keywords=[])), +                  Return( +                      value=Constant(value=21))], +            decorator_list=[])], +   type_ignores=[]) +``` + +Now things made more sense. My change to the grammar was just "syntax sugar". It turns an expression like this: `a if b` into this: `a if b else None`. The problem here is that Python returns no matter what, so the rest of the function is ignored. + +You can look at the [bytecode][11] generated to understand what exactly is executed by the interpreter. And for that, you can use the [`dis` module][12]. According to the docs: + +> The dis module supports the analysis of CPython bytecode by disassembling it. + + +``` +>>> import dis +>>> dis.dis(f) +  2 0 LOAD_FAST 0 (test) +              2 POP_JUMP_IF_FALSE 4 (to 8) +              4 LOAD_CONST 1 (42) +              6 RETURN_VALUE +        >> 8 LOAD_CONST 0 (None) +            10 RETURN_VALUE +``` + +What this basically means is that in case the _test_ is false, the execution jumps to 8, which loads the `None` into the top of the stack and returns it. + +### Supporting "return-if" + +To support the same Ruby feature, I need to turn the expression `return 42 if test` into a regular `if` statement that returns if `test` is true. + +To do that, I needed to add one more rule. This time, it would be a rule that matches the `return if ` piece of code. Not only that, I needed a `_PyAST_` function that creates the node for me. I'll then call it `_PyAST_ReturnIfExpr:` + + +``` +file: Grammar/python.gram + +return_stmt[stmt_ty]: +\+ | 'return' a=star_expressions 'if' b=disjunction { _PyAST_ReturnIfExpr(a, b, EXTRA) } +   | 'return' a=[star_expressions] { _PyAST_Return(a, EXTRA) } +``` + +As mentioned previously, the implementation for all these functions resides in `Python/Python-ast.c`, and their definition is in `Include/internal/pycore_ast.h`, so I put `_PyAST_ReturnIfExpr` there: + + +``` +file: Include/internal/pycore_ast.h + + stmt_ty _PyAST_Return(expr_ty value, int lineno, int col_offset, int +                      end_lineno, int end_col_offset, PyArena *arena); ++stmt_ty _PyAST_ReturnIfExpr(expr_ty value, expr_ty test, int lineno, int col_of +fset, int +\+ end_lineno, int end_col_offset, PyArena *arena); + stmt_ty _PyAST_Delete(asdl_expr_seq * targets, int lineno, int col_offset, int +                      end_lineno, int end_col_offset, PyArena *arena); + +[/code] [code] + +file: Python/Python-ast.c + ++stmt_ty ++_PyAST_ReturnIfExpr(expr_ty value, expr_ty test, int lineno, int col_offset, int end_lineno, int +\+ end_col_offset, PyArena *arena) ++{ +\+ stmt_ty ret, p; +\+ ret = _PyAST_Return(value, lineno, col_offset, end_lineno, end_col_offset, arena); ++ +\+ asdl_stmt_seq *body; +\+ body = _Py_asdl_stmt_seq_new(1, arena); +\+ asdl_seq_SET(body, 0, ret); ++ +\+ p = _PyAST_If(test, body, NULL, lineno, col_offset, end_lineno, end_col_offset, arena); ++ +\+ return p; ++} ++ + stmt_ty +``` + +I examined the implementation of `_PyAST_ReturnIfExpr`. I wanted to turn `return if ` into `if : return `. + +Both `return` and the regular `if` are statements, so in CPython, they're represented as `stmt_ty`. The `_PyAST_If` expectes a `expr_ty test` and a body, which is a sequence of statements. In this case, the `body` is `asdl_stmt_seq *body`. + +As a result, what I really wanted here was an `if` statement with a body where the only statement is a `return ` one. + +CPython disposes of some convenient functions to build `asdl_stmt_seq *`, and one of them is `_Py_asdl_stmt_seq_new`. So I used it to create the body and added the return statement I created a few lines before with `_PyAST_Return`. + +Once that was done, the last step was to pass the `test` as well as the `body` to `_PyAST_If`. + +And before I forget, you may be wondering what on earth is the `PyArena *arena`. **Arena** is a CPython abstraction used for memory allocation. It allows efficient memory usage by using memory mapping [mmap()][13] and placing it in contiguous [chunks of memory][6]. + +Time to regenerate the parser and test it one more time: + + +``` +>>> def f(test): +... return 42 if test +... print('missed return') +... return 21 +... +>>> import dis +>>> f(False) +>>> f(True) +42 +``` + +It doesn't work. Check the bytecodes: + + +``` +>>> dis.dis(f) +  2 0 LOAD_FAST 0 (test) +            2 POP_JUMP_IF_FALSE 4 (to 8) +            4 LOAD_CONST 1 (42) +            6 RETURN_VALUE +        >> 8 LOAD_CONST 0 (None) +        10 RETURN_VALUE +>>> +``` + +It's the same bytecode instructions again! + +### Going back to the compilers class + +At that point, I was clueless. I had no idea what was going on until I decided to go down the rabbit hole of expanding the grammar rules. + +The new rule I added went like this: `'return' a=star_expressions 'if' b=disjunction { _PyAST_ReturnIfExpr(a, b, EXTRA) }`. + +My only hypothesis was that `a=star_expressions 'if' b=disjunction` was being resolved to the else-less rule I added in the beginning. + +By going over the grammar one more time, I figured that my theory held. `star_expressions` would match `a=disjunction 'if' b=disjunction { _PyAST_IfExp(b, a, NULL, EXTRA) }`. + +The only way to fix this was by getting rid of the `star_expressions`. So I changed the rule to: + + +``` + return_stmt[stmt_ty]: +\- | 'return' a=star_expressions 'if' b=disjunction { _PyAST_ReturnIfExpr(a, b, EXTRA) } +\+ | 'return' a=disjunction guard=guard !'else' { _PyAST_ReturnIfExpr(a, guard, EXTRA) } +  | 'return' a=[star_expressions] { _PyAST_Return(a, EXTRA) } +``` + +You might be wondering, what are `guard,` `!else`, and `star_expressions`? + +This `guard` is a rule that is part of the pattern matching rules. The new pattern matching feature added in Python 3.10 allows things like this: + + +``` +match point: +   case Point(x, y) if x == y: +        print(f"Y=X at {x}") +        case Point(x, y): +        print(f"Not on the diagonal") +``` + +And the rule goes by this: + + +``` +`guard[expr_ty]: 'if' guard=named_expression { guard }` +``` + +With that, I added one more check. To avoid it failing with `SyntaxError`, I needed to make sure the rule matched only code like this: `return value if cond`. Thus, to prevent code such as `return an if cond else b` being matched prematurely, I added a `!' else` to the rule. + +Last but not least, the `star_expressions` allow me to return destructured iterables. For example: + + +``` +>>> def f(): +  ...: a = [1, 2] +  ...: return 0, *a +  ...:& + +>>> f() +(0, 1, 2) +``` + +In this case, `0, * a` is a tuple, which falls under the category of `star_expressions`. The regular if-expression doesn't allow using `star_expressions` with it, AFAIK, so changing the new `return` rule won't be an issue. + +### Does it work yet? + +After fixing the return rule, I regenerated the grammar one more time and compiled it: + + +``` +>>> def f(test): +... return 42 if test +... print('missed return') +... return 21 +... +>>> f(False) +missed return +21 +>>> f(True) +42 +``` + +It works! + +Looking at the bytecode: + + +``` +>>> import dis +>>> dis.dis(f) +  2 0 LOAD_FAST 0 (test) +            2 POP_JUMP_IF_FALSE 4 (to 8) +            4 LOAD_CONST 1 (42) +            6 RETURN_VALUE + +  3 >> 8 LOAD_GLOBAL 0 (print) +            10 LOAD_CONST 2 ('missed return') +            12 CALL_FUNCTION 1 +            14 POP_TOP + +  4 16 LOAD_CONST 3 (21) +            18 RETURN_VALUE +>>> +``` + +That's precisely what I wanted. Is the AST is the same as the one with regular `if`? + + +``` +>>> import ast +>>> print(ast.dump(ast.parse(fc), indent=4)) +Module( +   body=[ +        FunctionDef( +            name='f', +            args=arguments( +                posonlyargs=[], +                args=[ +                  arg(arg='test')], +                kwonlyargs=[], +                kw_defaults=[], +                defaults=[]), +            body=[ +                If( +                    test=Name(id='test', ctx=Load()), +                    body=[ +                      Return( +                      value=Constant(value=42))], +                      orelse=[]), +                Expr( +                  value=Call( +                          func=Name(id='print', ctx=Load()), +                          args=[ +                            Constant(value='missed return')], +                          keywords=[])), +                Return( +                  value=Constant(value=21))], +            decorator_list=[])], +   type_ignores=[]) +>>> +``` + +Indeed it is! + + +``` +If( +   test=Name(id='test', ctx=Load()), +   body=[ +        Return( +            value=Constant(value=42))], +   orelse=[]), +``` + +This node is the same as the one that would be generated by: + + +``` +`if test: return 42` +``` + +### If it's not tested, it's broken? + +To conclude this journey, I thought it'd be a good idea to add some unit tests as well. Before writing anything new, I wanted to get an idea of what I had broken. + +With the code tested manually, I ran all tests using the `test` module `python -m test -j8`. The `-j8` means it uses eight processes to run the tests in parallel: + + +``` +`$ ./python -m test -j8` +``` + +To my surprise, only one test failed! + + +``` +== Tests result: FAILURE == +406 tests OK. +1 test failed: +   test_grammar +``` + +Because I ran all tests, it's hard to navigate the output, so I can run only this one again in isolation: + + +``` +====================================================================== +FAIL: test_listcomps (test.test_grammar.GrammarTests) +\---------------------------------------------------------------------- +Traceback (most recent call last): +  File "/home/miguel/projects/cpython/Lib/test/test_grammar.py", line 1732, in test_listcomps +   check_syntax_error(self, "[x if y]") +   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +  File "/home/miguel/projects/cpython/Lib/test/support/__init__.py", line 497, in check_syntax_error +   with testcase.assertRaisesRegex(SyntaxError, errtext) as cm: +   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +AssertionError: SyntaxError not raised +\---------------------------------------------------------------------- + +Ran 76 tests in 0.038s + +FAILED (failures=1) +test test_grammar failed +test_grammar failed (1 failure) + +== Tests result: FAILURE == + +1 test failed: +   test_grammar + +1 re-run test: +   test_grammar + +Total duration: 82 ms +Tests result: FAILURE +``` + +And there it is! It expected a syntax error when running a `[x if y]` expression. I can safely remove it and re-run the tests again: + + +``` +== Tests result: SUCCESS == + +1 test OK. + +Total duration: 112 ms +Tests result: SUCCESS +``` + +Now that everything is OK, it's time to add a few more tests. It's important to test not only the new "else-less if" but also the new `return` statement. + +By navigating through the `test_grammar.py` file, I can find a test for pretty much every grammar rule. The first one I look for is `test_if_else_expr`. This test doesn't fail, so it only tests for the happy case. To make it more robust, I needed to add two new tests to check `if True` and `if False` cases: + + +``` +     self.assertEqual((6 < 4 if 0), None) +        self.assertEqual((6 < 4 if 1), False) +``` + +I ran everything again, and all tests passed this time. + +Note: `bool` in Python is a [subclass of integer][14], so you can use `1` to denote `True` and `0` for `False`. + + +``` +Ran 76 tests in 0.087s + +OK + +== Tests result: SUCCESS == + +1 test OK. + +Total duration: 174 ms +Tests result: SUCCESS +``` + +Lastly, I needed the tests for the `return` rule. They're defined in the `test_return` test. Just like the `if` expression one, this test passed with no modification. + +To test this new use case, I created a function that receives a `bool` argument and returns if the argument is true. When it's false, it skips the return, just like the manual tests I had been doing up to this point: + + +``` +        def g4(test): +             a = 1 +             return a if test +             a += 1 +             return a + +        self.assertEqual(g4(False), 2) +        self.assertEqual(g4(True), 1) +``` + +I saved the file and re-ran `test_grammar` one more time: + + +``` +\---------------------------------------------------------------------- + +Ran 76 tests in 0.087s + +OK + +== Tests result: SUCCESS == + +1 test OK. + +Total duration: 174 ms +Tests result: SUCCESS +``` + +Looks good! The `test_grammar` test passed. Just in case, I re-ran the full test suite: + + +``` +`$ ./python -m test -j8` +``` + +After a while, all tests passed, and I'm very happy with the result. + +### Limitations + +If you know Ruby well, by this point, you've probably noticed that what I did here was not 100% the same as a conditional modifier. For example, in Ruby, you can run actual expressions in these modifiers: + + +``` +irb(main):002:0> a = 42 +irb(main):003:0> a += 1 if false +=> nil +irb(main):004:0> a +=> 42 +irb(main):005:0> a += 1 if true +=> 43 +``` + +I cannot do the same with my implementation: + + +``` +>>> a = 42 +>>> a += 1 if False +Traceback (most recent call last): +  File "<stdin>", line 1, in <module> +TypeError: unsupported operand type(s) for +=: 'int' and 'NoneType' +>>> a += 1 if True +>>> a +43 +``` + +What this reveals is that the `return` rule I created is just a workaround. If I want to make it as close as possible to Ruby's conditional modifier, I'll need to make it work with other statements as well, not just `return`. + +Nevertheless, this is fine. My goal with this experiment was just to learn more about Python internals and see how I would navigate a little-known code base written in C and make the appropriate changes to it. And I have to admit that I'm pretty happy with the results! + +### Conclusion + +Adding a new syntax inspired by Ruby is a really nice exercise to learn more about the internals of Python. Of course, if I had to convert this as a PR, the core developers would probably find a few shortcomings, as I have already described in the previous section. However, since I did this just for fun, I'm very happy with the results. + +The source code with all my changes is on my CPython fork under the [branch ruby-if-new][15]. + +* * * + +_This article was originally published on the [author's personal blog][16] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/python-else-less + +作者:[Miguel Brito][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/miguendes +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/python_programming_question.png?itok=cOeJW-8r (Python programming language logo with question marks) +[2]: https://www.python.org/dev/peps/pep-0020/#id2 +[3]: https://github.com/python/cpython/pull/27506 +[4]: https://opensource.com/sites/default/files/ihe46r0jv.gif +[5]: https://tonybaloney.github.io/ +[6]: https://realpython.com/products/cpython-internals-book/ +[7]: https://github.com/python/cpython/blob/3.10/Makefile.pre.in#L850_L856 +[8]: https://craftinginterpreters.com/ +[9]: https://journal.stuffwithstuff.com/ +[10]: https://docs.python.org/3/library/ast.html +[11]: https://en.wikipedia.org/wiki/Bytecode +[12]: https://docs.python.org/3/library/dis.html +[13]: http://man7.org/linux/man-pages/man2/mmap.2.html +[14]: https://docs.python.org/3/c-api/bool.html +[15]: https://github.com/miguendes/cpython/tree/ruby-if-new +[16]: https://miguendes.me/what-if-python-had-this-ruby-feature From 949df42ec5395e28185f41cfaa43a8308d36efc4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Sep 2021 05:03:21 +0800 Subject: [PATCH 0404/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210916?= =?UTF-8?q?=20Crunch=20numbers=20in=20Python=20with=20NumPy?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210916 Crunch numbers in Python with NumPy.md --- ...916 Crunch numbers in Python with NumPy.md | 460 ++++++++++++++++++ 1 file changed, 460 insertions(+) create mode 100644 sources/tech/20210916 Crunch numbers in Python with NumPy.md diff --git a/sources/tech/20210916 Crunch numbers in Python with NumPy.md b/sources/tech/20210916 Crunch numbers in Python with NumPy.md new file mode 100644 index 0000000000..ee8a613ad4 --- /dev/null +++ b/sources/tech/20210916 Crunch numbers in Python with NumPy.md @@ -0,0 +1,460 @@ +[#]: subject: "Crunch numbers in Python with NumPy" +[#]: via: "https://opensource.com/article/21/9/python-numpy" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Crunch numbers in Python with NumPy +====== +This article discusses installing NumPy, and then creating, reading, and +sorting NumPy arrays. +![old school calculator][1] + +NumPy, or **Num**erical **Py**thon, is a library that makes it easy to do statistical and set operations on linear series and matrices in Python. It is orders of magnitude faster than Python lists, [which I covered in my notes on Python Data Types][2]. NumPy is used quite frequently in data analysis and scientific calculations. + +I'm going to go over installing NumPy, and then creating, reading, and sorting NumPy arrays. NumPy arrays are also called _ndarrays_, short for **n-dimensional arrays**. + +### Installing NumPy + +Installing the NumPy package is really simple using `pip`, and it can be installed just like you would install any other package. + + +``` +pip install numpy +``` + +With the NumPy package installed, just import it into your Python file. + + +``` +import numpy as np +``` + +Importing `numpy` as `np` is a standard convention, but instead of using `np` you can use any other alias that you want. + +### Why use NumPy? Because it is orders of magnitude faster than Python lists. + +NumPy is orders of magnitude faster than normal Python lists when it comes to handling a large number of values. To see exactly how fast it is, I'm going to first measure the time it takes for `min()` and `max()` operations on a normal Python list. + +I will first create a Python list with 999,999,999 items. + + +``` +>>> my_list = range(1, 1000000000) +>>> len(my_list) +999999999 +``` + +Now I'll measure the time for finding the minimum value in this list. + + +``` +>>> start = time.time() +>>> min(my_list) +1 +>>> print('Time elapsed in milliseconds: ' + str((time.time() - start) * 1000)) +Time elapsed in milliseconds: 27007.00879096985 +``` + +That took about 27,007 milliseconds or about **27 seconds**. That’s a long time. Now I'll try to find the time for finding the maximum value. + + +``` +>>> start = time.time() +>>> max(my_list) +999999999 +>>> print('Time elapsed in milliseconds: ' + str((time.time() - start) * 1000)) +Time elapsed in milliseconds: 28111.071348190308 +``` + +That took about 28,111 milliseconds, which is about **28 seconds**. + +Now I'll try to find the time to find the minimum and maximum value using NumPy. + + +``` +>>> my_list = np.arange(1, 1000000000) +>>> len(my_list) +999999999 +>>> start = time.time() +>>> my_list.min() +1 +>>> print('Time elapsed in milliseconds: ' + str((time.time() - start) * 1000)) +Time elapsed in milliseconds: 1151.1778831481934 +>>> +>>> start = time.time() +>>> my_list.max() +999999999 +>>> print('Time elapsed in milliseconds: ' + str((time.time() - start) * 1000)) +Time elapsed in milliseconds: 1114.8970127105713 +``` + +That took about 1151 milliseconds for finding the minimum value, and 1114 milliseconds for finding the maximum value. These are around **1 second**. + +As you can see, using NumPy reduces the time to find the minimum and maximum of a list of around a billion values **from around 28 seconds to 1 second**. This is the power of NumPy. + +### Creating ndarrays using Python lists + +There are several ways to create an ndarray in NumPy. + +You can create an ndarray by using a list of elements. + + +``` +>>> my_ndarray = np.array([1, 2, 3, 4, 5]) +>>> print(my_ndarray) +[1 2 3 4 5] +``` + +With the above ndarray defined, I'll check out a few things. First, the type of the variable defined above is `numpy.ndarray`. This is the type of all NumPy ndarrays. + + +``` +>>> type(my_ndarray) +<class 'numpy.ndarray'> +``` + +Another thing to note here would be _shape_. The shape of an ndarray is the length of each dimension of the ndarray. As you can see, the shape of `my_ndarray` is `(5,)`. This means that `my_ndarray` contains one dimension with 5 elements. + + +``` +>>> np.shape(my_ndarray) +(5,) +``` + +The number of dimensions in the array is called its _rank_. So the above ndarray has a rank of 1. + +I'll define another ndarray `my_ndarray2` as a multi-dimensional ndarray. What will its shape be then? See below. + + +``` +>>> my_ndarray2 = np.array([(1, 2, 3), (4, 5, 6)]) +>>> np.shape(my_ndarray2) +(2, 3) +``` + +This is a rank 2 ndarray. Another attribute to check is the `dtype`, which is the data type. Checking the `dtype` for our ndarray gives us the following: + + +``` +>>> my_ndarray.dtype +dtype('int64') +``` + +The `int64` means that our ndarray is made up of 64-bit integers. NumPy cannot create an ndarray of mixed types, and must contain only one type of element. If you define an ndarray containing a mix of element types, NumPy will automatically typecast all the elements to the highest element type available that can contain all the elements. + +For example, creating a mix of `int`s and `float`s will create a `float64` ndarray. + + +``` +>>> my_ndarray2 = np.array([1, 2.0, 3]) +>>> print(my_ndarray2) +[1. 2. 3.] +>>> my_ndarray2.dtype +dtype('float64') +``` + +Also, setting one of the elements as `string` will create string ndarray of `dtype` equal to ` 5]`. This operation will return an ndarray that contains all values greater than 5. + + +``` +>>> my_ndarray = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]) +>>> my_ndarray2 = my_ndarray[my_ndarray > 5] +>>> print(my_ndarray2) +[ 6  7  8  9 10] +``` + +For example, to get all the even values in an ndarray, you might use a boolean indexing operation as follows: + + +``` +>>> my_ndarray2 = my_ndarray[my_ndarray % 2 == 0] +>>> print(my_ndarray2) +[ 2  4  6  8 10] +``` + +And to get all the odd values, you might use this: + + +``` +>>> my_ndarray2 = my_ndarray[my_ndarray % 2 == 1] +>>> print(my_ndarray2) +[1 3 5 7 9] +``` + +### Vector and scalar arithmetic with ndarrays + +NumPy ndarrays allow vector and scalar arithmetic operations. In vector arithmetic, an element-wise arithmetic operation is performed between two ndarrays. In scalar arithmetic, an arithmetic operation is performed between an ndarray and a constant scalar value. + +Consider the two ndarrays below. + + +``` +>>> my_ndarray = np.array([1, 2, 3, 4, 5]) +>>> my_ndarray2 = np.array([6, 7, 8, 9, 10]) +``` + +If you add the above two ndarrays, it would produce a new ndarray where each element of the two ndarrays would be added. For example, the first element of the resultant ndarray would be the result of adding the first elements of the original ndarrays, and so on. + + +``` +>>> print(my_ndarray2 + my_ndarray) +[ 7  9 11 13 15] +``` + +Here, `7` is the sum of `1` and `6`, which are the first two elements of the ndarrays I've added together. Similarly, `15` is the sum of `5` and `10`, which are the last elements. + +Consider the following arithmetic operations: + + +``` +>>> print(my_ndarray2 - my_ndarray) +[5 5 5 5 5] +>>> +>>> print(my_ndarray2 * my_ndarray) +[ 6 14 24 36 50] +>>> +>>> print(my_ndarray2 / my_ndarray) +[6.         3.5        2.66666667 2.25       2.        ] +``` + +Adding a scalar value to an ndarray has a similar effect—the scalar value is added to all the elements of the ndarray. This is called _broadcasting_. + + +``` +>>> print(my_ndarray + 10) +[11 12 13 14 15] +>>> +>>> print(my_ndarray - 10) +[-9 -8 -7 -6 -5] +>>> +>>> print(my_ndarray * 10) +[10 20 30 40 50] +>>> +>>> print(my_ndarray / 10) +[0.1 0.2 0.3 0.4 0.5] +``` + +### Sorting ndarrays + +There are two ways available to sort ndarrays—in-place or out-of-place. In-place sorting sorts and modifies the original ndarray, and out-of-place sorting will return the sorted ndarray but not modify the original one. I'll try out both examples. + + +``` +>>> my_ndarray = np.array([3, 1, 2, 5, 4]) +>>> my_ndarray.sort() +>>> print(my_ndarray) +[1 2 3 4 5] +``` + +As you can see, the `sort()` method sorts the ndarray in-place and modifies the original array. + +There is another method called `np.sort()` which sorts the array out of place. + + +``` +>>> my_ndarray = np.array([3, 1, 2, 5, 4]) +>>> print(np.sort(my_ndarray)) +[1 2 3 4 5] +>>> print(my_ndarray) +[3 1 2 5 4] +``` + +As you can see, the `np.sort()` method returns a sorted ndarray but does not modify it. + +### Conclusion + +I've covered quite a bit about NumPy and ndarrays. I talked about creating ndarrays, the different ways of reading them, basic vector and scalar arithmetic, and sorting. There is a lot more to explore with NumPy, including set operations like `union()` and `intersection()`, statistical operations like `min()` and `max()`, etc. + +I hope the examples I demonstrated above were useful. Have fun exploring NumPy. + +* * * + +_This article was originally published on the [author's personal blog][3] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/python-numpy + +作者:[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/math_money_financial_calculator_colors.jpg?itok=_yEVTST1 (old school calculator) +[2]: https://notes.ayushsharma.in/2018/09/data-types-in-python +[3]: https://notes.ayushsharma.in/2018/10/working-with-numpy-in-python From cd3a7b7511ea5056a6cdf37e5538b9140436817a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Sep 2021 05:03:36 +0800 Subject: [PATCH 0405/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210916?= =?UTF-8?q?=20Debugging=20by=20starting=20a=20REPL=20at=20a=20breakpoint?= =?UTF-8?q?=20is=20fun?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210916 Debugging by starting a REPL at a breakpoint is fun.md --- ... starting a REPL at a breakpoint is fun.md | 188 ++++++++++++++++++ 1 file changed, 188 insertions(+) create mode 100644 sources/tech/20210916 Debugging by starting a REPL at a breakpoint is fun.md diff --git a/sources/tech/20210916 Debugging by starting a REPL at a breakpoint is fun.md b/sources/tech/20210916 Debugging by starting a REPL at a breakpoint is fun.md new file mode 100644 index 0000000000..269ccad77f --- /dev/null +++ b/sources/tech/20210916 Debugging by starting a REPL at a breakpoint is fun.md @@ -0,0 +1,188 @@ +[#]: subject: "Debugging by starting a REPL at a breakpoint is fun" +[#]: via: "https://jvns.ca/blog/2021/09/16/debugging-in-a-repl-is-fun/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Debugging by starting a REPL at a breakpoint is fun +====== + +Hello! I was talking to a Python programmer friend yesterday about debugging, and I mentioned that I really like debugging using a REPL. He said he’d never tried it and that it sounded fun, so I thought I’d write a quick post about it. + +This debugging method doesn’t work in a lot of languages, but it does work in Python and Ruby and kiiiiiind of in C (via gdb). + +### what’s a REPL? + +REPL stands for “read eval print loop”. A REPL is a program that: + + 1. reads some input from you like `print(f"2 + 2 = {2+2}")` (**read**) + 2. evaluates the input (**eval**) + 3. print out the result (**print**) + 4. and then goes back to step 1 (**loop**) + + + +Here’s an example of me using the IPython REPL to run a print statement. (also it demonstrates f-strings, my favourite Python 3 feature) + +``` +$ ipython3 +Python 3.9.5 (default, May 24 2021, 12:50:35) +Type 'copyright', 'credits' or 'license' for more information +IPython 7.24.1 -- An enhanced Interactive Python. Type '?' for help. + +In [1]: print(f"2 + 2 = {2+2}") +2 + 2 = 4 + +In [2]: +``` + +### you can start a REPL at a breakpoint + +There are 2 ways to use a REPL when debugging. + +**Way 1**: Open an empty REPL (like IPython, pry, or a browser Javascript console) to test out something. + +This is great but it’s not what I’m talking about in this post. + +**Way 2**: Set a breakpoint in your program, and start a REPL at that breakpoint. + +This is the one we’re going to be talking about. I like doing this because it gives me both: + + 1. all the variables in scope at the breakpoint, so I can print them out interactively + 2. easy access to all the functions in my program, so I can call them to try to find issues + + + +### how to get a REPL in Python: `ipdb.set_trace()` + +Here’s a program called `test.py` that sets a breakpoint on line 5 using `import ipdb; ipdb.set_trace()`. + +``` +import requests + +def make_request(): + result = requests.get("https://google.com") + import ipdb; ipdb.set_trace() + +make_request() +``` + +And here’s what it looks like when you run it: you get a REPL where you can inspect the `result` variable or do anything else you want. + +``` +python3 test.py +--Return-- +None +> /home/bork/work/homepage/test.py(5)make_request() + 4 result = requests.get("https://google.com") +----> 5 import ipdb; ipdb.set_trace() + 6 + +ipdb> result.headers +{'Date': 'Thu, 16 Sep 2021 13:11:19 GMT', 'Expires': '-1', 'Cache-Control': 'private, max-age=0', 'Content-Type': 'text/html; charset=ISO-8859-1', 'P3P': 'CP="This is not a P3P policy! See g.co/p3phelp for more info."', 'Content-Encoding': 'gzip', 'Server': 'gws', 'X-XSS-Protection': '0', 'X-Frame-Options': 'SAMEORIGIN', 'Set-Cookie': '1P_JAR=2021-09-16-13; expires=Sat, 16-Oct-2021 13:11:19 GMT; path=/; domain=.google.com; Secure, NID=223=FXhKNT7mgxX7Fjhh6Z6uej9z13xYKdm9ZuAU540WDoIwYMj9AZzWTgjsVX-KJF6GErxfMijl-uudmjrJH1wgH3c1JjudPcmDMJovNuuAiJqukh1dAao_vUiqL8ge8pSIXRx89vAyYy3BDRrpJHbEF33Hbgt2ce4_yCZPtDyokMk; expires=Fri, 18-Mar-2022 13:11:19 GMT; path=/; domain=.google.com; HttpOnly', 'Alt-Svc': 'h3=":443"; ma=2592000,h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"', 'Transfer-Encoding': 'chunked'} +``` + +You have to install `ipdb` to make this work, but I think it’s worth it – `import pdb; pdb.set_trace()` will work too (and is built into Python) but `ipdb` is much nicer. I just learned that you can also use `breakpoint()` in Python 3 to get a breakpoint, but that puts you in `pdb` too which I don’t like. + +### how to get a REPL in Ruby: `binding.pry` + +Here’s the same thing in Ruby – I wrote a `test.rb` program: + +``` +require 'net/http' +require 'pry' + +def make_request() + result = Net::HTTP.get_response('example.com', '/') + binding.pry +end + +make_request() +``` + +and here’s what it looks like when I run it: + +``` +$ ruby test.rb +From: /home/bork/work/homepage/test.rb:6 Object#make_request: + + 4: def make_request() + 5: result = Net::HTTP.get_response('example.com', '/') + => 6: binding.pry + 7: end + +[1] pry(main)> result.code +=> "200" +``` + +### you can also do get a REPL in the middle of an HTTP request + +Rails also lets you start a REPL in the middle of a HTTP request and poke around and see what’s happening. I assume you can do this in Flask and Django too – I’ve only really done this in Sinatra (in Ruby). + +### GDB is sort of like a REPL for C + +I was talking to another friend about REPLs, and we agreed that GDB is a little bit like a REPL for C. + +Now, obviously this is sort of not true – C is a compiled language, and you can’t just type in arbitrary C expressions in GDB and have them work. + +But you can do a surprising number of things like: + + * call functions + * inspect structs if your program has debugging symbols (`p var->field->subfield`) + + + +This stuff only works in gdb because the gdb developers put in a lot of work doing Very Weird Things to make it easier to get a REPL-like experience. I wrote a blog post a few years called [how does gdb call functions?][1] about how surprising it is that gdb can call functions, and how it does that. + +This is the only way I use `gdb` when looking at C programs – I never set watchpoints or do anything fancy, I just set a couple of breakpoints in the program and then poke around at those points. + +### where this method works + +languages where this works: + + * Python + * Ruby + * probably PHP, but I don’t know + * C, sort of, in a weird way (though you might disagree :)) + + + +languages where this doesn’t work: + + * most compiled languages + * in Javascript, I think even though you can get a REPL with `node inspect` and `debugger`, the REPL doesn’t integrate well with async functions which makes it less useful. I don’t really understand this yet though. (python’s REPL also doesn’t let you use `await`, but it’s not as big of a deal because async programming in Python isn’t as core a part of the language as in JS) + + + +### REPL debugging is easy for me to remember how to do + +There are (at least) 4 different ways of debugging: + + 1. Lots of print statements + 2. a debugger + 3. getting a REPL at a breakpoint + 4. inspect your program with external tools like strace + + + +I think part of the reason I like this type of REPL debugging more than using a more traditional debugger is – it’s so easy to remember how to do it! I can just set a breakpoint, and then run code to try to figure out what’s wrong. + +With debuggers, I always forget how to use the debugger (probably partly because I switch programming languages a lot) and I get confused about what features it has and how they work, so I never use it. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/09/16/debugging-in-a-repl-is-fun/ + +作者:[Julia 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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/blog/2018/01/04/how-does-gdb-call-functions/ From ea5000fe18b7b25d364925ba70eb8b50399dbb2a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 17 Sep 2021 05:04:17 +0800 Subject: [PATCH 0406/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210916?= =?UTF-8?q?=20Kali=20Linux=202021.3=20Brings=20in=20Kali=20Live=20VM=20Sup?= =?UTF-8?q?port,=20New=20Tools,=20and=20Other=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md --- ...port, New Tools, and Other Improvements.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md diff --git a/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md b/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md new file mode 100644 index 0000000000..b125f1dcbc --- /dev/null +++ b/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md @@ -0,0 +1,115 @@ +[#]: subject: "Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements" +[#]: via: "https://news.itsfoss.com/kali-linux-2021-3-release/" +[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements +====== + +Kali Linux is one of the [best Linux distributions for penetration testing][1]. It is based on Debian, but it may not be a suitable replacement for your full-fledged desktop operating system. + +The latest 2021.3 release brings some significant feature additions and improvements onboard. Let us check them out. + +### What’s New? + +![][2] + +#### OpenSSL Compatibility + +[OpenSSL][3] has been **reconfigured to expand the services networked to Kali**. As a result, legacy protocols such as TLS 1.0 and TLS 1.1 and older ciphers are allowed by default. That is to say; it will grant Kali the capability of connecting to more out-of-date servers. However, you can alter this option if you do not need it. + +#### Virtualization Improvements + +Kali is known to work flawlessly as a virtual machine. Firstly, actions like drag and drop, copy and paste between host and guest systems are smoother than ever, whether your guest machine is running under VirtualBox, VMware, Hyper-V, or QEMU+Spice. + +Secondly, it is easier to configure Kali for Hyper-V Enhanced Session Mode, a virtualization hypervisor, using Kali-Tweaks. + +In short, Kali Linux 2021.3 has made the experience even more seamless when setting up a virtual environment. + +#### Kali Tools + +It is taken for granted that every release of Kali contains new tools. Likewise, this release is no exception. The tools that Kali added to its fleet are: + + * [Berate_ap][4] – Orchestrating MANA rogue Wi-Fi Access Points + * [CALDERA][5] – Scalable automated adversary emulation platform + * [EAPHammer][6] – Targeted evil twin attacks against WPA2-Enterprise Wi-Fi networks + * [HostHunter][7] – Recon tool for discovering hostnames using OSINT techniques + * [RouterKeygenPC][8] – Generate default WPA/WEP Wi-Fi keys + * [Subjack][9] – Subdomain takeover + * [WPA_Sycophant][10] – Evil client portion of EAP relay attack + + + +##### Kali ARM Updates and Kali-Tools + +With Kali 2021.3, ARM devices are getting more ameliorations. The ones I found eye-catching are:  + + * en_US.UTF-8 is the default locale on all images. + * The Kali ARM build scripts are rebuilt to better support some devices. + * Raspberry Pi images can now use a wpa_supplicant.conf file on the /boot partition. + + + +Moreover, Kali has refreshed its information domain **Kali-Tools**, to provide a concise overview of tools, a neat and clean interface, and a fast system. + +### Other Changes + +![Kali Linux 2021.3][11] + +Kali has seen other neat improvements as well that includes: + + * Improvement to its layout for its Xfce and Gnome editions. Kali did not forget about KDE, as it is one of its favorite desktop environments. For instance, KDE 5.21 is the new version available baked in. + * Some of the important pages in their documentation site has received major updates. + * Partnered with Ampere to have its ARM package building machines running on Ampere’s hardware. As a consequence, Kali benefited from a burst in speed. + + + +Kali’s mobile penetration testing platform for Android devices has seen an enhancement. In other words, you can now install Kali NetHunter on Android 11 devices without the need for a fully working [TWRP][12] (Team Win Recovery Project). Above all, this update is promising due to its convenient installation procedure. + +In addition to this release, they also announced their first NetHunter smartwatch, **TicHunter Pro**. But, it is still in its very first stages of development. + +To learn more about all the technical changes with this upgrade, refer to [the official announcement][13]. + +### Summing Up + +Overall, this is a significant release with valuable improvements and exciting new tools. Get started by downloading it from its official site. + +[Download Kali Linux 2021.3][14] + +#### 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/kali-linux-2021-3-release/ + +作者:[Omar Maarof][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/omar/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-hacking-penetration-testing/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://www.openssl.org/ +[4]: https://pkg.kali.org/pkg/berate-ap +[5]: https://pkg.kali.org/pkg/caldera +[6]: https://pkg.kali.org/pkg/eaphammer +[7]: https://pkg.kali.org/pkg/hosthunter +[8]: https://pkg.kali.org/pkg/routerkeygenpc +[9]: https://pkg.kali.org/pkg/subjack +[10]: https://pkg.kali.org/pkg/wpa-sycophant +[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[12]: http://twrp.me/ +[13]: https://www.kali.org/blog/kali-linux-2021-3-release/ +[14]: https://www.kali.org/get-kali/ From 6824c6d6ef1f40692a54a0a5ff1b49799eb81ceb Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 Sep 2021 08:47:02 +0800 Subject: [PATCH 0407/1588] translated --- ...Recording in Linux With OBS and Wayland.md | 125 ------------------ ...Recording in Linux With OBS and Wayland.md | 125 ++++++++++++++++++ 2 files changed, 125 insertions(+), 125 deletions(-) delete mode 100644 sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md create mode 100644 translated/tech/20210915 Screen Recording in Linux With OBS and Wayland.md diff --git a/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md b/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md deleted file mode 100644 index 57fe47ea55..0000000000 --- a/sources/tech/20210915 Screen Recording in Linux With OBS and Wayland.md +++ /dev/null @@ -1,125 +0,0 @@ -[#]: subject: "Screen Recording in Linux With OBS and Wayland" -[#]: via: "https://itsfoss.com/screen-record-obs-wayland/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Screen Recording in Linux With OBS and Wayland -====== - -There are [tons of screen recorders available for Linux][1]. But when it comes to supporting [Wayland][2], almost all of them do not work. - -This is problematic because many new distribution releases are switching to Wayland display manager by default once again. And if something as basic as a screen recorder does not work, it leaves a bad experience. - -[GNOME’s built-in screen recorder][3] works but it is hidden, has no GUI and no way to configure and control the recordings. There is another tool called [Kooha][4] but it keeps on displaying a timer on the screen. - -[Switching between Xorg and Wayland][5] just for screen recording is not very convenient. - -Amidst all this, I was happy to learn that Wayland support landed in OBS Studio with version 27 release thanks to Pipewire. But even there, it’s not straightforward and hence I am going to show you the steps for screen recording on Wayland using [OBS Studio][6]. - -### Using OBS to screen record on Wayland - -![][7] - -Let’s see how it is done. - -#### Step 1: Install OBS Studio - -You should install OBS Studio version 27 first. It is already included in Ubuntu 21.10 which I am suing in this tutorial. - -To install OBS Studio 27 on Ubuntu 18.04, 20.04, Linux Mint 20 etc, use the [official OBS Studio][8] [][8][PPA][8]. - -Open a terminal and use the following commands one by one: - -``` -sudo add-apt-repository ppa:obsproject/obs-studio -sudo apt update -sudo apt install obs-studio -``` - -If there is an older version of OBS Studio installed already, it will be upgraded to the newer version. - -For Fedora, Arch and other distributions, please check your package manager or unofficial repositories for installing the latest version of OBS Studio. - -#### Step 2: Check if Wayland capture is working - -Please make sure that you are using Wayland. Now start OBS Studio and go through all the stuff it shows on the first run. I am not going to show that. - -The main step is to add Pipewire as a screen capture source. Click on the + symbol under the Sources list. - -![Add screen capture source in OBS Studio][9] - -Do you see anything that reads Screen Capture (PipeWire)? - -![Do you see PipeWire option in the screen sources?][10] - -**If the answer is no, quit OBS Studio**. This is normal. OBS Studio does not switch to use Wayland automatically in Ubuntu at least. There is a fix for that. - -Open a terminal and use the following command: - -``` -export QT_QPA_PLATFORM=wayland -``` - -In the same terminal, run the following command to start OBS Studio: - -``` -obs -``` - -It will show some message on the terminal. Ignore them. Your focus should be on the OBS Studio GUI. Try to add screen capture once again. You should see the PipeWire option now. - -![][10] - -You explicitly asked OBS Studio to use Wayland this time with the QT_QPA_PLATFORM variable. - -Select PipeWire as the source and then it asks you to choose a display screen. Select it and click on the Share button. - -![][11] - -Now it should show your screen recursively infinite number of times. If you see that, you could start recording the screen in Wayland now. - -![][12] - -#### Step 3: Make changes permanent - -That was good. You just verified that you can record your screen on Wayland. But setting the environment variable and starting OBS from the terminal each time is not convenient. - -What you can do is to **export the variable to your ~/.bash_profile (for you) or /etc/profile (for all users on the system).** - -``` -export QT_QPA_PLATFORM=wayland -``` - -Log out and log back in. Now OBS will automatically start using this parameter and you can use it to record your screen in Wayland. - -I hope you find this quick tip helpful. If you still have questions or suggestions, please let me know in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/screen-record-obs-wayland/ - -作者:[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/best-linux-screen-recorders/ -[2]: https://wayland.freedesktop.org/ -[3]: https://itsfoss.com/gnome-screen-recorder/ -[4]: https://itsfoss.com/kooha-screen-recorder/ -[5]: https://itsfoss.com/switch-xorg-wayland/ -[6]: https://obsproject.com/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-screen-record-wayland.webp?resize=800%2C450&ssl=1 -[8]: https://launchpad.net/~obsproject/+archive/ubuntu/obs-studio -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-add-screen-capture-source.png?resize=800%2C537&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-wayland-support.png?resize=800%2C538&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-screen.png?resize=800%2C578&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-screen-recording-obs-wayland.jpg?resize=800%2C537&ssl=1 diff --git a/translated/tech/20210915 Screen Recording in Linux With OBS and Wayland.md b/translated/tech/20210915 Screen Recording in Linux With OBS and Wayland.md new file mode 100644 index 0000000000..0d9afb5486 --- /dev/null +++ b/translated/tech/20210915 Screen Recording in Linux With OBS and Wayland.md @@ -0,0 +1,125 @@ +[#]: subject: "Screen Recording in Linux With OBS and Wayland" +[#]: via: "https://itsfoss.com/screen-record-obs-wayland/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 Linux 中使用 OBS 和 Wayland 进行屏幕录制 +====== + +有[大量可用于 Linux 的屏幕录像机][1]。但是当涉及到支持 [Wayland][2] 时,几乎所有的都不能用。 + +这是个问题,因为许多新发布的版本都再次默认切换到 Wayland 显示管理器。而如果像屏幕录像机这样基本的东西不能工作,就会给人留下不好的体验。 + +[GNOME 的内置屏幕录像机][3]可以工作,但它是隐藏的,没有 GUI,也没有办法配置和控制记录内容。还有一个叫 [Kooha][4] 的工具,但它一直在屏幕上显示一个计时器。 + +只是为了录制屏幕而[在 Xorg 和 Wayland 之间切换][5],这不是很方便。 + +在这一切中,我很高兴地得知,由于 Pipewire 的帮助,在 OBS Studio v27 中支持了 Wayland。但即使是这样,也不是很简单,因此我将向你展示使用 [OBS Studio][6] 在 Wayland 上录制屏幕的步骤。 + +### 使用 OBS 在 Wayland 上进行屏幕录制 + +![][7] + +让我们来看看它是如何完成的。 + +#### 第一步:安装 OBS Studio + +你应该先安装 OBS Studio v27。它已经包含在 Ubuntu 21.10 中,我会在本教程中使用它。 + +要在 Ubuntu 18.04、20.04、Linux Mint 20 等系统上安装 OBS Studio 27,请使用[官方的 OBS Studio PPA][8]。 + +打开终端,逐一使用以下命令: + +``` +sudo add-apt-repository ppa:obsproject/obs-studio +sudo apt update +sudo apt install obs-studio +``` + +如果已经安装了 OBS Studio 的旧版本,它将被升级到较新的版本。 + +对于 Fedora、Arch 和其他发行版,请检查你的包管理器或非官方仓库以安装最新版本的 OBS Studio。 + +#### 第二步:检查 Wayland 捕获是否工作 + +请确认你正在使用 Wayland。现在启动 OBS Studio,查看它在第一次运行时显示的所有内容。我不打算展示这些。 + +主要步骤是添加 Pipewire 作为屏幕捕捉源。点击 “Sources” 列表下的 “+” 符号。 + +![Add screen capture source in OBS Studio][9] + +你有没有看到 “Screen Capture (PipeWire)” 的字样? + +![Do you see PipeWire option in the screen sources?][10] + +**如果答案是否定的,请退出 OBS Studio**。这很正常。至少在 Ubuntu 下,OBS Studio 不会自动切换到使用 Wayland。对此有一个修复方法。 + +打开一个终端,使用以下命令: + +``` +export QT_QPA_PLATFORM=wayland +``` + +在同一个终端,运行以下命令,启动 OBS Studio: + +``` +obs +``` + +它将在终端上显示一些信息。不要理会它们。你的注意力应该放在 OBS Studio GUI 上。再次尝试添加屏幕捕捉。你现在应该看到 PipeWire 选项了。 + +![][10] + +你这次用 QT_QPA_PLATFORM 变量明确要求 OBS Studio 使用 Wayland。 + +选择 PipeWire 作为源,然后它要求你选择一个显示屏幕。选择它并点击分享按钮。 + +![][11] + +现在它应该无限次递归地显示你的屏幕。如果你看到了,你现在就可以开始在 Wayland 中录制屏幕了。 + +![][12] + +#### 第三步:让改变成为永久性的 + +这很好。你刚刚验证了你可以在 Wayland 上录制屏幕。但每次设置环境变量并从终端启动 OBS 并不方便。 + +你可以做的是**把这个变量导出到你的 ~/.bash_profile(对你而言)或 /etc/profile(对系统中的所有用户而言)。** + +``` +export QT_QPA_PLATFORM=wayland +``` + +退出并重新登录。现在 OBS 会自动开始使用这个参数,你可以用它来录制 Wayland 的屏幕。 + +我希望这个快速技巧对你有帮助。如果你还有问题或建议,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/screen-record-obs-wayland/ + +作者:[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/best-linux-screen-recorders/ +[2]: https://wayland.freedesktop.org/ +[3]: https://itsfoss.com/gnome-screen-recorder/ +[4]: https://itsfoss.com/kooha-screen-recorder/ +[5]: https://itsfoss.com/switch-xorg-wayland/ +[6]: https://obsproject.com/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-screen-record-wayland.webp?resize=800%2C450&ssl=1 +[8]: https://launchpad.net/~obsproject/+archive/ubuntu/obs-studio +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-add-screen-capture-source.png?resize=800%2C537&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-wayland-support.png?resize=800%2C538&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/obs-studio-screen.png?resize=800%2C578&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-screen-recording-obs-wayland.jpg?resize=800%2C537&ssl=1 From 4074f91313931a33c32764f6cbe95c57075cb013 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 17 Sep 2021 08:51:22 +0800 Subject: [PATCH 0408/1588] translating --- ...916 Watch commands and tasks with the Linux watch command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md b/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md index bc3b423046..ec01b2f5ad 100644 --- a/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md +++ b/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/linux-watch-command" [#]: author: "Moshe Zadka https://opensource.com/users/moshez" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From f560eb2e1efecdf690c1ea853e5062b427fa2f5d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 17 Sep 2021 08:55:41 +0800 Subject: [PATCH 0409/1588] PUB @wxy @turbokernel https://linux.cn/article-13792-1.html --- ...4 Linux technologies fundamental to containers.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename {translated/tech => published}/20210902 4 Linux technologies fundamental to containers.md (96%) diff --git a/translated/tech/20210902 4 Linux technologies fundamental to containers.md b/published/20210902 4 Linux technologies fundamental to containers.md similarity index 96% rename from translated/tech/20210902 4 Linux technologies fundamental to containers.md rename to published/20210902 4 Linux technologies fundamental to containers.md index d0a8a35ef8..0a719929b2 100644 --- a/translated/tech/20210902 4 Linux technologies fundamental to containers.md +++ b/published/20210902 4 Linux technologies fundamental to containers.md @@ -4,15 +4,15 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13792-1.html" 容器的四大基础技术 ====== > 命名空间、控制组、seccomp 和 SELinux 构成了在系统上构建和运行一个容器进程的 Linux 技术基础。 -![企鹅驾驶一辆黄色背景的汽车][1] +![](https://img.linux.net.cn/data/attachment/album/202109/17/085439ye0iq5ynzyhpusy5.jpg) 在以前的文章中,我介绍过 [容器镜像][2] 及其 [运行时][3]。在本文中,我研究了容器是如何在一些特殊的 Linux 技术基础上实现的,这其中包括命名空间和控制组。 @@ -48,7 +48,7 @@ ``` #### 用户 -用户(`user`)命名空间将用户和组隔离在一个容器内。这是通过分配给容器与宿主系统有不同的 UID 和 GID 范围来实现的。用户命名空间使软件能够以 root 用户的身份在容器内运行。如果入侵者攻击容器,然后逃逸到宿主机上,他们就只能以受限的非 root身份运行了。 +用户(`user`)命名空间将用户和组隔离在一个容器内。这是通过分配给容器与宿主系统有不同的 UID 和 GID 范围来实现的。用户命名空间使软件能够以 root 用户的身份在容器内运行。如果入侵者攻击容器,然后逃逸到宿主机上,他们就只能以受限的非 root 身份运行了。 #### 挂载 @@ -184,8 +184,8 @@ via: https://opensource.com/article/21/8/container-linux-technology [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/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) -[2]: https://opensource.com/article/21/8/container-fundamentals-2 -[3]: https://opensource.com/article/21/8/deep-dive-container-runtimes +[2]: https://linux.cn/article-13766-1.html +[3]: https://linux.cn/article-13772-1.html [4]: https://opensource.com/sites/default/files/1linuxtechs.png (layers of linux technologies) [5]: https://creativecommons.org/licenses/by-sa/4.0/ [6]: https://opensource.com/article/19/10/namespaces-and-containers-linux From 0f470afe752d93e9bd919db813ef5367e1643db6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 17 Sep 2021 09:15:38 +0800 Subject: [PATCH 0410/1588] PUB @unigeorge @turbokernel https://linux.cn/article-13793-1.html --- ...Use lspci on Linux to see your hardware.md | 20 ++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) rename {translated/tech => published}/20210907 Use lspci on Linux to see your hardware.md (91%) diff --git a/translated/tech/20210907 Use lspci on Linux to see your hardware.md b/published/20210907 Use lspci on Linux to see your hardware.md similarity index 91% rename from translated/tech/20210907 Use lspci on Linux to see your hardware.md rename to published/20210907 Use lspci on Linux to see your hardware.md index 4ad17b55f4..1e0d130b60 100644 --- a/translated/tech/20210907 Use lspci on Linux to see your hardware.md +++ b/published/20210907 Use lspci on Linux to see your hardware.md @@ -4,13 +4,15 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13793-1.html" 在 Linux 上使用 lspci 命令查看硬件情况 ====== -lspci 命令用于显示 Linux 系统上的设备和驱动程序。 -![computer screen ][1] + +> lspci 命令用于显示 Linux 系统上的设备和驱动程序。 + +![](https://img.linux.net.cn/data/attachment/album/202109/17/091425l7c8au5c865x7q68.jpg) 当你在个人电脑或服务器上运行 Linux 时,有时需要识别该系统中的硬件。`lspci` 命令用于显示连接到 PCI 总线的所有设备,从而满足上述需求。该命令由 [pciutils][2] 包提供,可用于各种基于 Linux 和 BSD 的操作系统。 @@ -50,7 +52,7 @@ $ sudo lspci ### 详细输出 -添加 `-v` 选项会显示每个设备的详细信息,你可以使用 `-vv` 或 `-vvv` 来获取更多的设备细节。在 `-v` 级别,`lspci` 会显示所有设备的各种子系统和内存地址、中断请求 (IRQ) 编号和一些其他功能信息。输出信息会非常长。在你的系统上试一试吧。 +添加 `-v` 选项会显示每个设备的详细信息,你可以使用 `-vv` 或 `-vvv` 来获取更多的设备细节。在 `-v` 级别,`lspci` 会显示所有设备的各种子系统和内存地址、中断请求(IRQ)编号和一些其他功能信息。输出信息会非常长。在你的系统上试一试吧。 ### 使用 grep 过滤搜索 @@ -81,7 +83,7 @@ $ sudo lspci -nn | grep -e VGA 01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GK107 [GeForce GTX 650] [10de:0fc6] (rev a1) ``` -设备名称后的方括号内有用冒号分隔的数字,即供应商和设备 ID。输出表明 Nvidia Corporation 制造的设备的供应商 ID 为 **10de**。 +设备名称后的方括号内有用冒号分隔的数字,即供应商和设备 ID。输出表明 Nvidia Corporation 制造的设备的供应商 ID 为 `10de`。 `-d` 选项用于指定供应商、设备或类 ID 的所有设备。以下是我系统中的所有 Nvidia 设备(保留 `-nn` 以解析供应商 ID): @@ -109,14 +111,14 @@ $ sudo lspci -nn -k -d 10de:  Kernel modules: snd_hda_intel ``` -可以看到额外显示了两行:_正在使用的内核驱动程序_(Kernel driver in use)_内核模块_(Kernel modules),其中后者列出了可用于支持该设备的模块。 +可以看到额外显示了两行:正在使用的内核驱动程序Kernel driver in use内核模块Kernel modules,其中后者列出了可用于支持该设备的模块。 ### 同步最新状态 -新设备和供应商总是在不断迭代。如果看到显示为 _unknown_ 的设备,说明你的 PCI 设备 ID 数据库可能已过时。有两种方法可以检查更新。`-Q` 选项会使用 DNS 查询中央数据库,当然,这需要联网。 +新设备和供应商总是在不断迭代。如果看到显示为 `unknown` 的设备,说明你的 PCI 设备 ID 数据库可能已过时。有两种方法可以检查更新。`-Q` 选项会使用 DNS 查询中央数据库,当然,这需要联网。 ``` -`$ sudo lspci -Q` +$ sudo lspci -Q ``` 你还可以通过运行命令 `update-pciids` 来更新本地 PCI ID 数据库。 From 65d273ebe9c5d754401d4a5323527d917b74e4c2 Mon Sep 17 00:00:00 2001 From: anine Date: Fri, 17 Sep 2021 09:54:44 +0800 Subject: [PATCH 0411/1588] remake --- ...915 Raspberry Pi Zero vs Zero W- What-s the Difference.md | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md b/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md index 255be35f17..0443563607 100644 --- a/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md +++ b/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md @@ -60,19 +60,16 @@ 当然,除非你有特殊需求。 -In addition to the size of the board, the pricing, power requirement, and processing power are some of the key highlights of this board under **$20**. 另外,对于同水平的单片机规模,定价,功率要求,运算能力而言,树莓派 Zero 最亮眼的地方就是它低于 **20 美元**的价格。 -So, if you are looking for the essential features under a budget, the Raspberry Zero series should work for you. 因此,如果你正在寻找预算中满足基本功能的单片机,树莓派 Zero 就是专门为你打造的。 ### Is Raspberry Pi Zero series affordable? + ### 树莓派 Zero 系列价格怎么样? -Raspberry Pi Zero costs **$5** and the Raspberry Pi Zero W would cost you around **$10**. ****Of course, depending on its availability and region, the cost will differ. If you want the Raspberry Pi Zero W with header pins, it should cost you around **$14**. 树莓派 Zero 售价 **5 美元** ,Zero W 售价 **10 美元左右**,当然,在不同的地方,定价规则会不一样,如果你选择树莓派 Zero W 带 引脚的版本,售价大概是 **14 美元**左右。 -There are other devices that can be used as an [alternative to Raspberry Pi Zero][11] and they have similar price tag. 还有[其他的设备可以代替树莓派 Zero][11],它们价格也相差不大。 -------------------------------------------------------------------------------- From ffef58b1922df4b5bc9935d729993e03fd865303 Mon Sep 17 00:00:00 2001 From: Frank Zhang Date: Fri, 17 Sep 2021 21:34:05 +0800 Subject: [PATCH 0412/1588] translated --- ...of the best React JavaScript frameworks.md | 496 ----------------- ...of the best React JavaScript frameworks.md | 498 ++++++++++++++++++ 2 files changed, 498 insertions(+), 496 deletions(-) delete mode 100644 sources/tech/20200121 13 of the best React JavaScript frameworks.md create mode 100644 translated/tech/20200121 13 of the best React JavaScript frameworks.md diff --git a/sources/tech/20200121 13 of the best React JavaScript frameworks.md b/sources/tech/20200121 13 of the best React JavaScript frameworks.md deleted file mode 100644 index e82ef14a8a..0000000000 --- a/sources/tech/20200121 13 of the best React JavaScript frameworks.md +++ /dev/null @@ -1,496 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (13 of the best React JavaScript frameworks) -[#]: via: (https://opensource.com/article/20/1/react-javascript-frameworks) -[#]: author: (Amit Dua https://opensource.com/users/amitdua) - -13 of the best React JavaScript frameworks -====== -If you're using React.js or React Native to create user interfaces, try -these frameworks. -![Javascript code close-up with neon graphic overlay][1] - -React.js and React Native are popular open source platforms for developing user interfaces (UIs); both rank well for desirability and use in StackOverflow's 2019 Developer Survey. React.js was developed by Facebook in 2011 as a JavaScript library to address the need for cross-platform, dynamic, and high-performing UIs, while React Native, which Facebook released in 2015, is used for building native applications using JavaScript. - -The following are 13 of the best React JavaScript frameworks; all are open source—the first 11 (like React) are licensed under the MIT license and the latter two are licensed under Apache 2.0. - -### 1\. Create React App - -This command-line interface from Facebook developers is a must-have for every React Native project. The reason is that the [Create React App][2] is easy to use and prevents you from having to manually set up and configure your app, thereby saving you a lot of time and effort. With just a simple command, everything will be ready for you to create a React native project easily. You can use it to build a catalog and files, and the framework also includes tools to build, test, and launch your application. - - -``` -# Install package -$ npm install -g create-react-native-web-app -  -# Run create-react-native-web-app <project-directory> -$ create-react-native-web-app myApp -  -# cd into your <project-directory> -$ cd myApp -  -# Run Web/Ios/Android development -# Web -$ npm run web -  -# IOS (simulator) -$ npm run ios -  -# Android (connected device) -$ npm run android -``` - -#### Why opt for Create React App - - 1. Top-notch tool developed with a configure bundle, transpiler, and test runner - 2. No configuration and no extra files at the app structure - 3. Fixed Development stack - 4. Effective Fast developing tool - - - -### 2\. Material Kit React - -Inspired by Google's Material Design system, [Material Kit React][3] can be an excellent choice for building React UI components. The best thing about this library is that it offers a lot of components that are built to fit together and look incredible. There are over 1,000 fully coded components, and each one comes with separate layers organized in folders. This means you have thousands of options to choose from. There are several example pages as well, in case you want to get inspiration or share an idea or concept with someone. - -#### Installing the Material Kit - - -``` -`  $ npm install @material-ui/core` -``` - -#### Implementation - - -``` -import React from 'react'; -import Button from '@material-ui/core/Button'; - -const App = () => ( -  <Button variant="contained" color="primary"> -    Hello World -  </Button> -); -``` - -The Material-UI component work without any additional setup, and do not pollute the global scope. - -#### Advantage - -The React component supports easier and faster web development. With it, you can build your own design system, or start with Material Design. - -### 3\. Shards React - -This modern React UI kit has been built from scratch to achieve fast performance. It has a modern design system that lets you customize things the way you want. You can even download the source files to customize things at the code level. Also, the SCSS syntax used for styling enhances the development experience. - -[Shards React][4] is based on Shards and uses React Datepicker, React Popper (a positioning engine), and noUISlider. It also supports incredible Material Design icons. There are some pre-made versions to help you gain some inspiration and get started. - -#### Installation Shards with Yarn or NPM - - -``` -# Yarn -yarn add shards-react - -# NPM -npm i shards-react -``` - -#### Advantages - - 1. Shards is lightweight having a small footprint and weighting ~13kb minified and gzipped - 2. Shards is responsive by default being able to adapt and reflow its layout to any screen size - 3. Shards is well documented so you can start building beautiful interfaces as soon as possible - - - -### 4\. Styled Components - -This efficient CSS tool helps build small, reusable components that are responsible for an app's visual interface. With traditional CSS, you can accidentally overwrite the selectors used in other places on the website, but [Styled Components][5] can help you completely avoid this problem by using a CSS syntax directly inside your components. - -#### Installation - - -``` -`npm install --save styled-components` -``` - -#### Implementation - - -``` -const Button = styled.button` -  background: background_type; -  border-radius: radius_value; -  border: abc; -  color: name_of_color; -  Margin: margin_value; -  padding: value; -``` - -#### Advantage - - 1. Make components more readable - 2. Components rely on JavaScript for their style - 3. Build custom components with CSS - 4. Inline styling - 5. Convert component even the custom component to a styled component by simply invoking styled() - - - -### 5\. Redux - -[Redux][6] is a state-management solution for JavaScript applications. While it is mostly used for React.js, you can also use it for other React-like frameworks. - -#### Installation - - -``` -sudo npm install redux -sudo npm install react-redux -``` - -#### Implementation - - -``` -import { createStore } from "redux"; -import rotateReducer from "reducers/rotateReducer"; - -function configureStore(state = { rotating: value}) { -  return createStore(rotateReducer,state); -} - -export default configureStore; -``` - -#### Advantage - - 1. Predictable state update helps in defining the data flow of the application - 2. Logic easier to test and time-travel debugging with reducer functions - 3. Centralizing the state - - - -### 6\. React Virtualized - -This React Native JavaScript framework helps in large-list and tabular-data rendering. Using [React Virtualized][7], you can restrict the number of requests and Document Object Model (DOM) elements, thus enhancing the performance of React apps. - -#### Installation - - -``` -`npm install react-virtualized` -``` - -#### Implementation - - -``` -import 'react-virtualized/styles.css' -import { Column, Table } from 'react-virtualized' -import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer' -import List from 'react-virtualized/dist/commonjs/List' -{ -  alias: { -    'react-virtualized/List': 'react-virtualized/dist/es/List', -  }, -  ...rest -} -``` - -#### Advantages - - 1. Display a large amount of data efficiently - 2. Rendering a huge data set - 3. Implements virtual rendering with a set of components - - - -### 7\. React DnD - -[ReactDnD][8] is responsible for the creation of complex drag-and-drop interfaces. There are dozens of drag-and-drop libraries, but React DnD stands out because it is built on top of modern HTML5's drag-and-drop API, making the process of creating interfaces easy. - -#### Installation - - -``` -`npm install react-dnd-preview` -``` - -#### Implementation - - -``` - import Preview from 'react-dnd-preview'; -  -  const generatePreview = ({itemType, item, style}) => { -    return <div class="item-list" style={style}>{itemType}</div>; -  }; -  -  class App extends React.Component { -    ... -  -    render() { -      return ( -        <DndProvider backend={MyBackend}> -          <ItemList /> -          <Preview generator={generatePreview} /> -          // or -          <Preview>{generatePreview}</Preview> -        </DndProvider> -      ); -    } -  } -``` - -#### Advantages - - 1. Beautiful and natural movement of items bouquet - 2. Powerful keyboard and screen reader support wheelchair - 3. Extremely performant - 4. Clean and powerful api - 5. Plays extremely well with standard browser interactions - 6. Unopinionated styling - 7. No creation of additional wrapper dom nodes - - - -### 8\. React Bootstrap - -This UI Kit library replaces Bootstrap's JavaScript with React, giving you more control over the functions of each component. Because each component is built to be easily accessible, [React Bootstrap][9] can be beneficial for frontend framework building. There are thousands of bootstrap themes to choose from. - -#### Installation - - -``` -`npm install react-bootstrap bootstrap` -``` - -#### Implementation - - -``` -import 'bootstrap/dist/css/bootstrap.min.css'; -import React from 'react'; -import ReactDOM from 'react-dom'; -import './index.css'; -import App from './App'; -import registerServiceWorker from './registerServiceWorker'; - -ReactDOM.render(<App />, document.getElementById('root')); -registerServiceWorker(); -``` - -#### Advantages - - 1. Can easily import required code/component - 2. Saves typing and bugs by compressing the Bootstrap - 3. Reduces typing efforts and conflicts by compressing the Bootstrap - 4. It is easy to use - 5. It encapsulates in elements - - - -### 9\. React Suite - -[React Suite][10] is another efficient React.js framework that contains a wide range of component libraries for enterprise system products. It supports all major browsers and platforms, making it suitable for just about any system. It also supports server-side rendering. - -#### Installation - - -``` -`npm i rsuite --save` -``` - -#### Implementation - - -``` -import { Button } from 'rsuite'; -import 'rsuite/styles/less/index.less'; -ReactDOM.render(<Button>Button</Button>, mountNode); -``` - -#### Advantages - - 1. Easily manage the application easily by the help of global accessing features - 2. Redux library centralizes the state management - 3. Redux is flexible with all the UI layers and has a large ecosystem - 4. Redux reduces this complexity and provides global accessibility - - - -### 10\. PrimeReact - -The best thing about [PrimeReact][11] is that it provides components that cover almost all of a UI's basic requirements, such as input options, menus, data presentations, messages, etc. The framework also pays close attention to the mobile experience, thus helping you design touch-optimized elements. - -#### Installation - - -``` -npm install primereact --save -npm install primeicons --save -``` - -#### Implementation - - -``` -import {Dialog} from 'primereact/dialog'; -import {Accordion,AccordionTab} from 'primereact/accordion'; -dependencies: { -    "react": "^16.0.0", -    "react-dom": "^16.0.0", -    "react-transition-group": "^2.2.1", -    "classnames": "^2.2.5", -    "primeicons": "^2.0.0" -} -``` - -#### Advantages - - 1. Simplicity and Performance - 2. Ease of Use - 3. Spring Applications - 4. Create rich user interfaces - 5. Usability and simplicity - - - -### 11\. React Router - -[React Router][12] is quite popular in the React Native developer community because it is very easy to start working with. All you need is Git and the npm package manager installed on your PC, a basic knowledge of React, and a willingness to learn. There is nothing too complicated. - -#### Installation - - -``` -`$ npm install --save react-router` -``` - -#### Implementation - - -``` -import { Router, Route, Switch } from "react-router"; -  -// using CommonJS modules -var Router = require("react-router").Router; -var Route = require("react-router").Route; -var Switch = require("react-router").Switch; -``` - -#### Advantages - - 1. Dynamic route matching - 2. CSS transitions on views when navigating - 3. Standardized app structure and behavior - - - -### 12\. Grommet - -[Grommet][13] is used for creating responsive and accessible mobile-first web apps. The best thing about this Apache 2.0-licensed JavaScript framework is that it offers accessibility, modularity, responsiveness, and theming in one small package. Perhaps this is one of the major reasons it is widely used by companies like Netflix, GE, Uber, and Boeing. - -#### Installation for yarn and npm - - -``` -` $ npm install grommet styled-components --save` -``` - -#### Implementation - - -``` -"grommet-controls/chartjs": { -          "transform": "grommet-controls/es6/chartjs/${member}", -          "preventFullImport": true, -          "skipDefaultConversion": true -``` - -#### Advantages - - 1. Create one toolkit as a packaged deal - 2. Take the open-door policy to the extreme - 3. Restructuring can help influence an established org - - - -### 13\. Onsen UI - -[Onsen UI][14] is another mobile app development framework that uses HTML5 and JavaScript and offers integration with Angular, Vue, and React. It is licensed under Apache 2.0. - -Onsen offers tabs, a side menu, stack navigation, and other components. The best thing about the framework is that all of its components have iOS and Android Material Design support along with automatic styling, which changes the app's appearance depending on the platform. - -#### Installation - - -``` -`npm install onsenui` -``` - -#### Implementation - - -``` -(function() { -    'use strict'; -    var module = angular.module('app', ['onsen']); - -    module.controller('AppController', function($scope) { -      // more to come here -    }); - -})(); -``` - -#### Advantages - - 1. Onsen UI is built on free and open-source code - 2. Doesn't force any type of DRM on apps developed with it - 3. Compiles JavaScript and HTML5 code - 4. Offers end users the native experience - - - -* * * - -What are your favorite React JavaScript frameworks? Please share them in the comments. - -Learn more about React Native, a framework for building native apps using React and JavaScript. - -Whether you are new to JavaScript or an experienced JavaScript developer, using libraries and... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/1/react-javascript-frameworks - -作者:[Amit Dua][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/amitdua -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_javascript.jpg?itok=60evKmGl (Javascript code close-up with neon graphic overlay) -[2]: https://github.com/facebook/create-react-app -[3]: https://github.com/creativetimofficial/material-kit-react -[4]: https://github.com/DesignRevision/shards-react -[5]: https://github.com/styled-components/styled-components -[6]: https://github.com/reduxjs/redux -[7]: https://github.com/bvaughn/react-virtualized -[8]: https://github.com/react-dnd/react-dnd/ -[9]: https://github.com/react-bootstrap/react-bootstrap -[10]: https://github.com/rsuite/rsuite -[11]: https://github.com/primefaces/primereact -[12]: https://github.com/ReactTraining/react-router -[13]: https://github.com/grommet/grommet -[14]: https://github.com/OnsenUI/OnsenUI diff --git a/translated/tech/20200121 13 of the best React JavaScript frameworks.md b/translated/tech/20200121 13 of the best React JavaScript frameworks.md new file mode 100644 index 0000000000..c76a969d11 --- /dev/null +++ b/translated/tech/20200121 13 of the best React JavaScript frameworks.md @@ -0,0 +1,498 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (13 of the best React JavaScript frameworks) +[#]: via: (https://opensource.com/article/20/1/react-javascript-frameworks) +[#]: author: (Amit Dua https://opensource.com/users/amitdua) + +13 个最好的 React JavaScript 框架 +====== +如果你正在用 React.js 或 React Native 来开发用户界面的话,试试这些框架。 +![Javascript code close-up with neon graphic overlay][1] + +React.js 和 React Native 都是用来开发用户界面(UI)的很受欢迎的开源平台。在 StackOverflow 2019 年度开发者调查里,两个框架的可取性和实用性都排名靠前。React.js 是 Facebook 在 2011 年开发的一个 JavaScript 库,来实现跨平台,动态以及高性能的 UI 设计需求;而 React Native 则是 Facebook 在 2015 年发布的框架,目的是使用 JavaScript 构建原生应用。 + +下面介绍 13 个最好的 React JavaScript 框架,都是开源项目。前 11 个(和 React 一样)都使用 MIT 协议授权,后面两个使用 Apache 2.0 协议。 + +### 1\. Create React App + +这个 Facebook 开发的命令行工具是 React Native 项目一定要用的。因为 [Create React App][2] 使用很简单,还可以避免你自己手动设定和配置应用,因此能节省大量的时间和精力。仅仅使用给一个简单的命令,就可以为你准备好创建 React 原生项目所需的一切。你可以用它来创建分类和文件,而且该框架还自带了工具用来构建,测试和启动应用。 + + +``` +# 安装软件包 +$ npm install -g create-react-native-web-app +  +# 运行 create-react-native-web-app <项目目录> +$ create-react-native-web-app myApp +  +# 切换到创建的<项目目录> +$ cd myApp +  +# 运行 Web/Ios/Android 调试 +# Web +$ npm run web +  +# IOS (模拟器) +$ npm run ios +  +# Android (实际连接的设备) +$ npm run android +``` + +#### 为什么选择 Create React App + + 1. 支持配置,转换,以及测试运行的一流工具 + 2. 在应用架构里不需要配置以及没有额外文件 + 3. 确定的开发栈 + 4. 高效快速的开发工具 + + + +### 2\. Material Kit React + +[Material Kit React][3] 是受谷歌的 Material Design 系统启发开发的, 很适合用来创建 React UI 组件。这个库最大的优点是提供了大量的组件,可以互相搭配做出非常好的效果。有超过一千个完全编码的组件,每一个都有用文件夹组织起来的独立图层。这样你就可以有上千个选项可以选择。同时也包含一些示例页面,方便你从中寻找灵感,或者向别人分享你的点子或创意。 + +#### 安装 Material Kit + + +``` +`  $ npm install @material-ui/core` +``` + +#### 使用 + + +``` +import React from 'react'; +import Button from '@material-ui/core/Button'; + +const App = () => ( +  <Button variant="contained" color="primary"> +    Hello World +  </Button> +); +``` + +Material-UI 组件不需要其他额外设置,也不会干扰全局变量空间。 + +#### 优点 + +这个 React 组件支持简易快速的网页开发。你可以用它创建自己的设计系统,或者直接开始 Material Design。 + +### 3\. Shards React + +这个现代的 React UI 工具为了追求高效率,是从最底层开始构建的。它拥有现代的设计系统,可以让你按自己的想法任意定制。甚至可以下载源文件,然后从代码级别定制。另外,它用来设计样式的 SCSS 语法提高了开发体验。 + +[Shards React][4] 基于 Shards,使用了 React Datepicker,React Popper(一个定位引擎),和 noUISlider。还带有非常优秀的 Material Design 图标。还有很多设计好的版本,可以帮你寻找灵感或上手。 + +#### 用 Yarn 或 NPM 安装 Shards + + +``` +# Yarn +yarn add shards-react + +# NPM +npm i shards-react +``` + +#### 优点 + + 1. Shards 是一个轻量级的脚本,压缩后大概 13kb + 2. Shards 默认支持响应式,图层可以适配任意大小屏幕 + 3. Shards 有完整的文档,可以快速开始构建漂亮的界面 + + + +### 4\. Styled Components + +这个高效的 CSS 工具可以用来为应用的可视界面创建小型可重用的组件。使用传统的 CSS,你可能会不小心覆盖掉网站其他位置的选择器,但 [Styled Components][5] 通过使用直接内嵌到组件里的 CSS 语法,可以完全避免这个问题。 + +#### 安装 + + +``` +`npm install --save styled-components` +``` + +#### 使用 + + +``` +const Button = styled.button` +  background: background_type; +  border-radius: radius_value; +  border: abc; +  color: name_of_color; +  Margin: margin_value; +  padding: value; +``` + +#### 优点 + + 1. 让组件有更好的可读性 + 2. 组件样式依赖 JavaScript + 3. 创建定制 CSS 组件 + 4. 内嵌样式 + 5. 简单地调用 styled() 可以将组件甚至是自定义组件转换成样式组件 + + + +### 5\. Redux + +[Redux][6] 是一个为 JavaScript 应用提供状态管理的方案。常用于 React.js,也可以用在其他类 React 框架里。 + +#### 安装 + + +``` +sudo npm install redux +sudo npm install react-redux +``` + +#### 使用 + + +``` +import { createStore } from "redux"; +import rotateReducer from "reducers/rotateReducer"; + +function configureStore(state = { rotating: value}) { +  return createStore(rotateReducer,state); +} + +export default configureStore; +``` + +#### 优点 + + 1. 可预计的状态更新有助于定义应用里的数据流 + 2. 逻辑上测试更简单,使用 reducer 函数进行时间旅行调试也更容易 + 3. 统一管理状态 + + + +### 6\. React Virtualized + +这个 React Native JavaScript 框架帮助渲染 large-list 和 tabular-data。使用 [React Virtualized][7],你可以限制请求和文档对象模型(DOM)元素的数量,从而提高 React 应用的性能。 + +#### 安装 + + +``` +`npm install react-virtualized` +``` + +#### 使用 + + +``` +import 'react-virtualized/styles.css' +import { Column, Table } from 'react-virtualized' +import AutoSizer from 'react-virtualized/dist/commonjs/AutoSizer' +import List from 'react-virtualized/dist/commonjs/List' +{ +  alias: { +    'react-virtualized/List': 'react-virtualized/dist/es/List', +  }, +  ...rest +} +``` + +#### 优点 + + 1. 高效展示大量数据 + 2. 渲染超大数据集 + 3. 使用一系列组件实现虚拟渲染 + + + +### 7\. React DnD + +[ReactDnD][8] 用来创建复杂的拖放界面。拖放控件库有很多,选用 React DnD 是因为它是基于 HTML5 的拖放 API 的,创建界面更简单。 + +#### 安装 + + +``` +`npm install react-dnd-preview` +``` + +#### 使用 + + +``` + import Preview from 'react-dnd-preview'; +  +  const generatePreview = ({itemType, item, style}) => { +    return <div class="item-list" style={style}>{itemType}</div>; +  }; +  +  class App extends React.Component { +    ... +  +    render() { +      return ( +        <DndProvider backend={MyBackend}> +          <ItemList /> +          <Preview generator={generatePreview} /> +          // or +          <Preview>{generatePreview}</Preview> +        </DndProvider> +      ); +    } +  } +``` + +#### 优点 + + 1. 漂亮自然的控件移动 (bouquet是个库??? Beautiful and natural movement of items bouquet) + 2. 强大的键盘和屏幕阅读支持 (wheelchair是说行动不便的人?Powerful keyboard and screen reader support wheelchair) + 3. 极限性能 + 4. 强大整洁的接口 + 5. 标准浏览器支持非常好 + 6. 中性样式 + 7. 没有额外创建 DOM 节点 + + + +### 8\. React Bootstrap + +这个 UI 库将 Bootstrap 的 JavaScript 替换成了 React,可以更好地控制每个组件的功能。每个组件都构建成能轻易访问,因此 [React Bootstrap][9] 有利于构建前端框架。有上千种 bootstrap 主题可以选择。 + +#### 安装 + + +``` +`npm install react-bootstrap bootstrap` +``` + +#### 使用 + + +``` +import 'bootstrap/dist/css/bootstrap.min.css'; +import React from 'react'; +import ReactDOM from 'react-dom'; +import './index.css'; +import App from './App'; +import registerServiceWorker from './registerServiceWorker'; + +ReactDOM.render(<App />, document.getElementById('root')); +registerServiceWorker(); +``` + +#### 优点 + + 1. 可以简单导入所需的代码/组件 + 2. 通过压缩 Bootstrap 节省了输入和问题 + 3. 通过压缩 Bootstrap 减少了输入工作和冲突 + 4. 使用简单 + 5. 使用元素封装 + + + +### 9\. React Suite + +[React Suite][10] 是另一个高效的 React.js 框架,包含了大量组件库,方便开发企业级产品。支持所有主流浏览器和平台,适用于任何系统。还支持服务器端渲染。 + +#### 安装 + + +``` +`npm i rsuite --save` +``` + +#### 使用 + + +``` +import { Button } from 'rsuite'; +import 'rsuite/styles/less/index.less'; +ReactDOM.render(<Button>Button</Button>, mountNode); +``` + +#### 优点 + + 1. 通过全局访问特性轻松管理应用 + 2. 使用 Redux 库集中管理系统状态 + 3. Redux 库有灵活的 UI 层,以及广泛的生态 + 4. Redux 库减少系统复杂度,并提供了全局访问特性 + + + +### 10\. PrimeReact + +[PrimeReact][11] 最值得推荐的是它提供了几乎覆盖所有基本 UI 需求的组件,比如输入选项,菜单,数据展示,消息,等等。这个框架还优化了移动体验,帮助你设计触摸优化的元素。 + +#### 安装 + + +``` +npm install primereact --save +npm install primeicons --save +``` + +#### 使用 + + +``` +import {Dialog} from 'primereact/dialog'; +import {Accordion,AccordionTab} from 'primereact/accordion'; +dependencies: { +    "react": "^16.0.0", +    "react-dom": "^16.0.0", +    "react-transition-group": "^2.2.1", +    "classnames": "^2.2.5", +    "primeicons": "^2.0.0" +} +``` + +#### 优点 + + 1. 简单,高效 + 2. 容易使用 + 3. Spring 应用 + 4. 创建复杂用户界面 + 5. 好用,简单 + + + +### 11\. React Router + +[React Router][12] 在 React Native 开发社区很受欢迎,因为它上手很容易。只需要你在电脑上安装 git 和 npm 包管理工具,有 React 的基础知识,以及好学的意愿。没什么特别难的地方。 + +#### 安装 + + +``` +`$ npm install --save react-router` +``` + +#### 使用 + + +``` +import { Router, Route, Switch } from "react-router"; +  +// using CommonJS modules +var Router = require("react-router").Router; +var Route = require("react-router").Route; +var Switch = require("react-router").Switch; +``` + +#### 优点 + + 1. 动态路由匹配 + 2. 在导航时支持不同页面的 CSS 切换 + 3. 统一的 app 结构和行为 + + + +### 12\. Grommet + +[Grommet][13] 常用于开发响应式可访问的移动网页应用。这个用 Apache 2.0 协议授权的 JavaScript 框架最大的优点是用很小的包提供了可访问性,模块化,响应式以及主题功能。这可能是它被一些公司广泛使用的主要原因,比如奈飞,通用电气,优步,以及波音。 + +#### 安装 for yarn and npm + + +``` +` $ npm install grommet styled-components --save` +``` + +#### 使用 + + +``` +"grommet-controls/chartjs": { +          "transform": "grommet-controls/es6/chartjs/${member}", +          "preventFullImport": true, +          "skipDefaultConversion": true +``` + +#### 优点 + + 1. 创建一个工具包来打包 Create one toolkit as a packaged deal + 2. 把开放政策发挥到极致 + 3. 重构有助于影响已成立的组织 + + + +### 13\. Onsen UI + +[Onsen UI][14] 另一个使用 HTML5 和 JavaScript 的手机应用开发框架,集成了 Angular,Vue 和 React,使用 Apache 2.0 协议授权。 + +Onsen 提供了标签,侧边栏,堆栈导航以及其他组件。这个框架最好的地方是,它所有的组件都支持 iOS 和安卓 Material Design 自动适配,会根据不同的平台切换应用的外观。 + + +#### 安装 + + +``` +`npm install onsenui` +``` + +#### 使用 + + +``` +(function() { +    'use strict'; +    var module = angular.module('app', ['onsen']); + +    module.controller('AppController', function($scope) { +      // more to come here +    }); + +})(); +``` + +#### 优点 + + 1. Onsen UI 基于免费和开源代码 + 2. 不强制基于它开发的应用使用任何形式的 DRM + 3. 内置了 JavaScript 和 HTML5 代码 + 4. 给最终用户带来原生体验 + + + +* * * + +你最喜欢哪个 React JavaScript 框架?请在评论区分享。 + +Learn more about React Native, a framework for building native apps using React and JavaScript. + +Whether you are new to JavaScript or an experienced JavaScript developer, using libraries and... +(检查了原文,没有这两句,是下面关联文章的简介) + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/1/react-javascript-frameworks + +作者:[Amit Dua][a] +选题:[lujun9972][b] +译者:[zpl1025](https://github.com/zpl1025) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://opensource.com/users/amitdua +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_javascript.jpg?itok=60evKmGl (Javascript code close-up with neon graphic overlay) +[2]: https://github.com/facebook/create-react-app +[3]: https://github.com/creativetimofficial/material-kit-react +[4]: https://github.com/DesignRevision/shards-react +[5]: https://github.com/styled-components/styled-components +[6]: https://github.com/reduxjs/redux +[7]: https://github.com/bvaughn/react-virtualized +[8]: https://github.com/react-dnd/react-dnd/ +[9]: https://github.com/react-bootstrap/react-bootstrap +[10]: https://github.com/rsuite/rsuite +[11]: https://github.com/primefaces/primereact +[12]: https://github.com/ReactTraining/react-router +[13]: https://github.com/grommet/grommet +[14]: https://github.com/OnsenUI/OnsenUI From 9a4971e83e54be2c99e111f0f437cedab22e9316 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 17 Sep 2021 22:51:23 +0800 Subject: [PATCH 0413/1588] PRF&PUB @geekpi https://linux.cn/article-13795-1.html --- ... a web page error from the command line.md | 59 +++++++------------ 1 file changed, 22 insertions(+), 37 deletions(-) rename {translated/tech => published}/20210908 Debug a web page error from the command line.md (76%) diff --git a/translated/tech/20210908 Debug a web page error from the command line.md b/published/20210908 Debug a web page error from the command line.md similarity index 76% rename from translated/tech/20210908 Debug a web page error from the command line.md rename to published/20210908 Debug a web page error from the command line.md index 71b060dc93..a720798e24 100644 --- a/translated/tech/20210908 Debug a web page error from the command line.md +++ b/published/20210908 Debug a web page error from the command line.md @@ -3,71 +3,56 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13795-1.html" -从命令行调试网页错误 +从命令行使用 wget 调试网页错误 ====== -调试网络服务器的一种方法是使用 wget 命令行程序。 -![Digital creative of a browser on the internet][1] -有时在管理一个网站时,事情会被搞得一团糟。你可能会删除一些陈旧的内容,用重定向到其他页面来代替。后来,在做了其他改动后,你发现一些网页变得完全无法访问了。你可能会在浏览器中看到一个错误:“该页面没有正确重定向”,并建议你检查你的 cookies。 +> 调试 Web 服务器的一种方法是使用 wget 命令行程序。 + +![](https://img.linux.net.cn/data/attachment/album/202109/17/225018elcip4pii4qcknir.jpg) + +有时在管理一个网站时,事情会被搞得一团糟。你可能会删除一些陈旧的内容,用重定向到其他页面来代替。后来,在做了其他改动后,你发现一些网页变得完全无法访问了。你可能会在浏览器中看到一个错误:“该页面没有正确重定向”,并建议你检查你的 cookie。 ![Redirect loop example in Firefox][2] -Screenshot by Jim Hall,[CC-BY SA 4.0][3] - 调试这种情况的一个方法是使用 `wget` 命令行程序,使用 `-S` 选项来显示所有的服务器响应。当使用 `wget` 进行调试时,我也喜欢使用 `-O` 选项将输出保存到一些临时文件中,以备以后需要查看其内容。 - ``` -$ wget -O /tmp/test.html -S -\--2021-08-24 17:09:49-- +$ wget -O /tmp/test.html -S http://10.0.0.11/announce/ +--2021-08-24 17:09:49-- http://10.0.0.11/announce/ Connecting to 10.0.0.11:80... connected. -HTTP request sent, awaiting response... + +HTTP request sent, awaiting response... HTTP/1.1 302 Found - Date: Tue, 24 Aug 2021 22:09:49 GMT - Server: Apache/2.4.48 (Fedora) - X-Powered-By: PHP/7.4.21 - -Location: - +Location: http://10.0.0.11/assets/ Content-Length: 0 - Keep-Alive: timeout=5, max=100 - Connection: Keep-Alive - Content-Type: text/html; charset=UTF-8 -Location: [following] -\--2021-08-24 17:09:49-- +Location: http://10.0.0.11/assets/ [following] +--2021-08-24 17:09:49-- http://10.0.0.11/assets/ Reusing existing connection to 10.0.0.11:80. -HTTP request sent, awaiting response... +HTTP request sent, awaiting response... + HTTP/1.1 302 Found - Date: Tue, 24 Aug 2021 22:09:49 GMT - Server: Apache/2.4.48 (Fedora) - X-Powered-By: PHP/7.4.21 - -Location: - +Location: http://10.0.0.11/announce/ Content-Length: 0 - Keep-Alive: timeout=5, max=99 - Connection: Keep-Alive - Content-Type: text/html; charset=UTF-8 -Location: [following] -\--2021-08-24 17:09:49-- +Location: http://10.0.0.11/announce/ [following] +--2021-08-24 17:09:49-- http://10.0.0.11/announce/ Reusing existing connection to 10.0.0.11:80. . . @@ -84,7 +69,7 @@ via: https://opensource.com/article/21/9/wget-debug-web-server 作者:[Jim Hall][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 1a0bd4d9ede6baadf48e3e8b64f6f98307ee6977 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Sep 2021 05:02:23 +0800 Subject: [PATCH 0414/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210917?= =?UTF-8?q?=20Open=20source=20game=20achievements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210917 Open source game achievements.md --- .../20210917 Open source game achievements.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/tech/20210917 Open source game achievements.md diff --git a/sources/tech/20210917 Open source game achievements.md b/sources/tech/20210917 Open source game achievements.md new file mode 100644 index 0000000000..663e6387a2 --- /dev/null +++ b/sources/tech/20210917 Open source game achievements.md @@ -0,0 +1,82 @@ +[#]: subject: "Open source game achievements" +[#]: via: "https://fedoramagazine.org/open-source-game-achievements/" +[#]: author: "Dennis Payne https://fedoramagazine.org/author/dulsi/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open source game achievements +====== + +![][1] + +Photo by [Michał Parzuchowski][2] on [Unsplash][3] + +Learn how Gamerzilla brings an achievement system to open source games and enables all developers to implement achievements separate from the game platform. + +Some open source games rival the quality of commercial games. While it is hard to match the quality of triple-a games, open source games compete effectively against the indie games. But, gamer expectations change over time. Early games included a high score. Achievements expanded over time to promote replay. For example, you may have completed a level but you didn’t find all the secrets or collect all the coins. The Xbox 360 introduced the first multi-game online achievement system. Since that introduction, many game platforms added an achievement system. + +Open source games are largely left out of the achievement systems. You can publish an open source game on Steam, but it costs money and they focus on working with companies not the free software community. Additionally, this locks players into a non-free platform. + +Commercial game developers are not well served either, since some players enjoy achievements and refuse to purchase from other stores due to the inability to share their accomplishments. This lock-in gives the power to the platform holder. Each platform has a different system forcing the developer to implement support and testing multiple times. Smaller platform are likely to be skipped entirely. Furthermore, the platform holder has access to the achievement data on all companies using their system which could be used for competitive advantage. + +### Architecture of Gamerzilla + +[Gamerzilla][4] is an open source game achievement system which attempts to correct this situation. The design considered both open source and commercial games. You can run your own Gamerzilla server, use one provided by a game store, or even distributions, or other groups could run them. Where you buy the game doesn’t matter. The achievement data uploads to your Gamerzilla server. + +Game achievements require two things, a game, and a Gamerzilla server. As game collections grow, however, that setup has a disadvantage. Each game needs to have credentials to upload to the Gamerzilla server. Many gamers turn to game launchers due to their large number of games and ability to synchronize with one or more stores. By adding Gamerzilla support to the launcher, the individual games no longer need to know your credentials. Session results will relay from the game launcher to the Gamerzilla server. + +At one time, freegamedev.net provided the Hubzilla social networking system. We created an addon allowing us to jump start Gamerzilla development. Unfortunately server upgrades broke the service so freegamedev.net stopped offering it. + +For Gamerzilla servers, two implementations exist. Maintaining Hubzilla is a complex task, so we developed a standalone Gamerzilla service using *.*Net and React. The API used by games remains the same so it doesn’t matter which implementation you connect to. + +Game launchers development and support often lags. To facilitate adding support, we created libgamerzilla. The library handles all the interaction between the game launcher, games, and the Gamerzilla server. Right now only _GameHub_ has an implementation with Gamerzilla support and merging into the project is pending. On Fedora Linux, libgamerzilla-server package serves as a temporary solution. It does not launch games but listens for achievements and relays them to your server. + +Game support continues growing. As with game launchers, developers use libgamerzilla to handle the Gamerzilla integration. The library, written in C, is in use in a variety of languages like Python and nim. Games which already have an achievement system typically take only a few days to add support. For other games ,collecting all the information to award the achievements occupies the bulk of the implementation time. + +### Setting up a server + +The easiest server to setup is the Hubzilla addon. That, however, requires a working Hubzilla site which is not the simplest thing to setup. The new .Net and React server can be setup relatively easily on Fedora Linux, although there are a lot of steps. The [readme][5] details all the steps. The long set of steps is, in part, due to the lack of a built release. This means you need to build the .Net and the React code. Once built, React code serves up directly in Apache. A new service runs the .Net piece. Apache proxies all requests to the Gamerzilla API for the new service. + +With the setup steps done, Gamerzilla runs but there are no users. There needs to be an easy way to create an administrator and register new users. Unfortunately this piece does not exist yet. At this time, users must be entered directly using the sqlite3 command line tool. The instructions are in the [readme][5]. Users can be publicly visible or not. The approval flag allows new users to not use the system immediately but web registration still needs to be implemented The user piece is designed with replacement in mind. It would not be hard to replace backend/Service/UserService.cs to integrate with an existing site. Gaming web sites could use this to offer Gamerzilla achievements to their users. + +Currently the backend uses a sqlite database. No performance testing has been done. We expect that larger installations may need to modify the system to use a more robust database system. + +### Testing the system + +There is no game launcher easily available at the moment. If you install libgamerzilla-server, you will have the command _gamerzillaserver_ available from the command line. The first time you run it, you enter your url and login information. Subsequent executions will simply read the information from the configuration file. There is currently no way to correct a mistake except deleting the file at _.local/share/ga_merzillaserver/server.cfg and running _gamerzillaserver_ again. + +Most games have no built releases with Gamerzilla support. [Pinball Disc Room on itch.io][6] does have support built in the Linux version. The web version has no achievements There are only two achievements in the game, one for surviving for ten seconds and the other for unlocking and using the tunnel. With a little practice you can get an achievement. You need to check your Gamerzila server as the game provides no visual notification of the achievement. + +Currently no game packaged in Fedora Linux supports Gamerzilla. SuperTuxKart merged support but is still awaiting a new release. Seahorse adventures and Shippy 1984 added achievements but new releases are not packaged yet. Some games with support, we maintain independently as the developers ignore pull requests or other attempt to contact them. + +### Future work + +Gamerzilla needs more games. A variety of games currently support the system. An addition occurs nearly every month. If you have a game you like, ask the developer to support Gamerzilla. If you are making a game and need help adding support, please let us now. + +Server development proceeds at a slow pace and we hope to have a functional registration system soon. After that we may setup a permanent hosting site. Right now you can see our [test server][7]. Some people expressed concern with the .Net backend. The API is not very complex and could be rewritten in Python fairly easily. + +The largest unknown remains game launchers. GameHub wants a generic achievement interface. We could try to work with them to get that implemented. Adding support to the itch.io app could increase interest in the system. Another possibility is to do away with the game launcher entirely. Perhaps adding something like the gamerzillaserver to Gnome might be possible. You would then configure your url and login information on a settings page. Any game launched could then record achievements. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/open-source-game-achievements/ + +作者:[Dennis Payne][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/dulsi/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/09/game_acheivements-816x345.jpg +[2]: https://unsplash.com/@mparzuchowski?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/jenga?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: http://identicalsoftware.com/gamerzilla/ +[5]: https://github.com/dulsi/gamerzilla.net#readme +[6]: https://dulsi.itch.io/pinball-disc-room +[7]: http://108.49.106.217/ From 88609a5a6c80dfaf8be0f0fa43a5f6b9c8446cd8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Sep 2021 05:02:45 +0800 Subject: [PATCH 0415/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210918?= =?UTF-8?q?=20How=20to=20Install=20Ubuntu=20Desktop=20on=20Raspberry=20Pi?= =?UTF-8?q?=204?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md --- ...nstall Ubuntu Desktop on Raspberry Pi 4.md | 235 ++++++++++++++++++ 1 file changed, 235 insertions(+) create mode 100644 sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md diff --git a/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md b/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md new file mode 100644 index 0000000000..cff3752858 --- /dev/null +++ b/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md @@ -0,0 +1,235 @@ +[#]: subject: "How to Install Ubuntu Desktop on Raspberry Pi 4" +[#]: via: "https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/" +[#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Ubuntu Desktop on Raspberry Pi 4 +====== + +_**Brief: This thorough tutorial shows you how to install Ubuntu Desktop on Raspberry Pi 4 device.**_ + +The revolutionary Raspberry Pi is the most popular single board computer. It has its very own Debian based operating system called [Raspbian][1]. + +There are several other [operating systems available for Raspberry Pi][2] but almost all of them are lightweight. This was appropriate for the small factor and low end hardware of the Pi devices. + +This changes with the introduction of Raspberry Pi 4B that flaunts 8 GB RAM and supports 4K display. The aim is to use Raspberry Pi as a regular desktop and it succeeds in doing so to a larger extent. + +Before the 4B model, you could [install the Ubuntu server on Raspberry Pi][3] but the desktop version was not available. However, **Ubuntu now provides official desktop image for Pi 4 models**. + +In this tutorial, I am going to show the steps for installing Ubuntu desktop on Raspberry Pi 4. + +First, a quick look at the prerequisites. + +### Prerequisites for running Ubuntu on Raspberry Pi 4 + +![][4] + +Here’s what you need: + + 1. A Linux or Windows system with active internet connection. + 2. [Raspberry Pi Imager][5] : The official open source tool from Raspberry that gets you the distro image on your SD card. + 3. Micro SD Card: Consider using at least a 16 GB storage for your card, albeit a 32 GB version is recommended. + 4. A USB based Micro SD Card Reader (if your computer does not have a card reader). + 5. Essential Raspberry Pi 4 accessories such as an HDMI compatible display, [Micro HDMI to Standard HDMI (A/M) Cable][6], [Power Supply (Official Adapter Recommended)][7], USB Wired/Wireless Keyboard and Mouse/Touchpad. + + + +It is good practice to [read in detail about the Pi requirements][8] beforehand. + +Now, without further delay, let me quickly walk you through the image preparation for the SD Card. + +### Preparing the Ubuntu Desktop image for Raspberry Pi + +Raspberry Pi provides a GUI application for writing the ISO image to the SD Card. **This tool can also download compatible operating systems like Ubuntu, Raspbian etc automatically**. + +![Official tool to download and put operating system on SD card][9] + +You can download this tool for Ubuntu, Windows and macOS from the official website: + +[Download Raspberry Pi Imager][10] + +On Ubuntu and other Linux distributions, you can also install it with Snap: + +``` +sudo snap install rpi-imager +``` + +Once installed, run the imager tool. When you see the screen below, select “CHOOSE OS”: + +![Pi imager: choose the preferred operating system][11] + +Under “Operating System”, select “Other general purpose OS”: + +![Pi imager: other general purpose operating systems][12] + +Now, select “Ubuntu”: + +![Pi imager distro: Ubuntu][13] + +Next, select “Ubuntu Desktop 21.04 (RPI 4/400)” as shown below: + +![Pi imager distro version: Ubuntu 21.04][14] + +Note + +If you do not have a good, consistent internet collection, you can [download the Ubuntu for Raspberry Pi image separately from Ubuntu’s website][15]. In the Imager tool, while choosing the OS, go to the bottom and select “Use custom” option. You can also use Etcher for writing the image to the SD card. + +Insert the micro SD card inside your Card reader and wait for it to mount. Select “CHOOSE STORAGE” under “Storage”: + +![Pi imager – choose storage \(SD card\)][16] + +You should be seeing only your micro SD card storage and you’d recognize it instantly based on the size. Here, I’ve used a 32 GB card: + +![Pi imager – choose SD card][17] + +Now click on “WRITE”: + +![Pi imager image write][18] + +I’ll assume you have the contents of the SD card backed up. If it’s a new card, you can just proceed: + +![Pi imager image write confirmation query][19] + +Since this is a [sudo][20] privilege, you must enter your password. If you run `sudo rpi-imager` from a terminal, this would not appear: + +![Pi imager image write authentication asking for password][21] + +If your SD card is a bit old, it would take some time. But if it is a recent one with high speeds, it wouldn’t take long: + +![Pi imager writing image][22] + +I also wouldn’t recommend skipping verification. Make sure the image write went successful: + +![Pi imager verifying changes][23] + +Once it is over, you will get the following confirmation: + +![Pi imager write successful][24] + +Now, safely-remove the SD card from your system. + +### Using the micro SD card with Ubuntu on Raspberry Pi + +Half of the battle is won. Unlike the regular Ubuntu install, you have not created a live environment. Ubuntu is already installed on the SD card and is almost read to use. Let’s see what remains here. + +#### Step 1: Insert the SD card into Pi + +For first time users, it can take a bit confusing sometimes to figure out where on earth is that card slot! Not to worry. It is located below the board on the left-hand side. Here’s an inverted view with a card inserted: + +![Pi 4B board inverted and micro SD card inserted][25] + +Keep sliding the card in this orientation slowly into the slot below the board, gently until it no longer goes any further. You may also hear a little clicking sound for confirmation. This means it has just fit in perfectly: + +![Raspberry Pi SD slot left side middle and below the pi board][26] + +You might notice two little pins adjusting themselves in the slot (shown above) as you put it inside, but that’s ok. Once inserted, the card would look like a bit protruded. That’s how it is supposed to look like: + +![Pi SD card inserted with a little portion visible][27] + +#### Step 2: Setting Up the Raspberry Pi + +I do not need to go in detail here, I presume. + +Ensure that the power cable connector, micro HDMI cable connector, keyboard and mouse connectors (wired/non-wired) are securely connected to the Pi board in the relevant ports. + +Make sure the display and power plug are properly connected as well, before you go ahead and turn on the power socket. I wouldn’t recommend plugging in the adapter to a live electrical socket. Look up [electrical arcing][28]. + +Once you’ve ensured the above two steps, you can [power on the Raspberry Pi device][29]. + +#### Step 3: The first run of Ubuntu desktop on Raspberry Pi + +Once you power on the Raspberry Pi, you’ll be asked to some basic configuration on your first run. You just have to follow the onscreen instructions. + +Select your language, keyboard layout, connect to WiFi etc. + +![Select language][30] + +![Select keyboard layout][31] + +![Select WiFi][32] + +You’ll be asked to select the time zone: + +![Select time zone][33] + +And then create the user and password: + +![Enter desired username and password][34] + +It will configure a couple of things and may take some time in doing so. + +![Finishing Ubuntu setup][35] + +![Finishing Ubuntu setup][36] + +It may take some time after this, your system will reboot and you’ll find yourself at the Ubuntu login screen: + +![][37] + +You can start enjoying Ubuntu desktop on Raspberry Pi now. + +![Ubuntu desktop on Raspberry Pi][38] + +### Conclusion + +I noticed **a temporary anomaly**: A red flickering border on the left-hand side of my display while doing the installation. This flickering (also of different colors) was noticeable on random parts of the screen as well. But it went away after restarting and the first boot. + +It was much needed that Ubuntu to start providing support for popular ARM devices like Raspberry Pi and I am happy to see it running on a Raspberry Pi. + +I hope you find this tutorial helpful. If you have questions or suggestions, please let me know in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/ + +作者:[Avimanyu Bandyopadhyay][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/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[2]: https://itsfoss.com/raspberry-pi-os/ +[3]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-desktop-raspberry-pi.png?resize=800%2C450&ssl=1 +[5]: https://github.com/raspberrypi/rpi-imager +[6]: https://www.raspberrypi.org/products/micro-hdmi-to-standard-hdmi-a-cable/ +[7]: https://www.raspberrypi.org/products/type-c-power-supply/ +[8]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-imager-tool.webp?resize=680%2C448&ssl=1 +[10]: https://www.raspberrypi.org/software/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-os.webp?resize=681%2C443&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-other-general-purpose-os.webp?resize=679%2C440&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-os-ubuntu.webp?resize=677%2C440&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-os-ubuntu-21-04.webp?resize=677%2C440&ssl=1 +[15]: https://ubuntu.com/download/raspberry-pi +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-storage.webp?resize=677%2C438&ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-sd-card.webp?resize=790%2C450&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write.webp?resize=676%2C437&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write-confirm.webp?resize=679%2C440&ssl=1 +[20]: https://itsfoss.com/add-sudo-user-ubuntu/ +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write-password.webp?resize=380%2C227&ssl=1 +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-writing-image.webp?resize=673%2C438&ssl=1 +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-verifying-changes.webp?resize=677%2C440&ssl=1 +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-write-successful.webp?resize=675%2C442&ssl=1 +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-inverted-micro-sd-card-inserted.webp?resize=800%2C572&ssl=1 +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-sd-slot-left-side-middle-below-board.webp?resize=632%2C324&ssl=1 +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-sd-card-inserted.webp?resize=650%2C432&ssl=1 +[28]: https://www.electricianatlanta.net/what-is-electrical-arcing-and-why-is-it-dangerous/ +[29]: https://itsfoss.com/turn-on-raspberry-pi/ +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run.webp?resize=800%2C451&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-2.webp?resize=800%2C600&ssl=1 +[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-3.webp?resize=800%2C600&ssl=1 +[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-4.webp?resize=800%2C600&ssl=1 +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-5.webp?resize=800%2C600&ssl=1 +[35]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-6.webp?resize=800%2C600&ssl=1 +[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-7.webp?resize=800%2C600&ssl=1 +[37]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-login-screen.webp?resize=800%2C600&ssl=1 +[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-21-04-post-setup-desktop.webp?resize=800%2C450&ssl=1 From 9128698d35089f5f6fd2c3e3f79830046b516c7c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Sep 2021 05:03:06 +0800 Subject: [PATCH 0416/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210917?= =?UTF-8?q?=20Organize=20your=20Magic:=20The=20Gathering=20decks=20with=20?= =?UTF-8?q?Magic=20Assistant?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210917 Organize your Magic- The Gathering decks with Magic Assistant.md --- ...he Gathering decks with Magic Assistant.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20210917 Organize your Magic- The Gathering decks with Magic Assistant.md diff --git a/sources/tech/20210917 Organize your Magic- The Gathering decks with Magic Assistant.md b/sources/tech/20210917 Organize your Magic- The Gathering decks with Magic Assistant.md new file mode 100644 index 0000000000..94982613d4 --- /dev/null +++ b/sources/tech/20210917 Organize your Magic- The Gathering decks with Magic Assistant.md @@ -0,0 +1,114 @@ +[#]: subject: "Organize your Magic: The Gathering decks with Magic Assistant" +[#]: via: "https://opensource.com/article/21/9/magic-the-gathering-assistant" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Organize your Magic: The Gathering decks with Magic Assistant +====== +The open source application Magic Assistant makes managing your Magic +collection easy. +![Holding a Magic the Gathering deckmaster card][1] + +The world's first trading card game was _Magic: The Gathering,_ first published in 1993. + +It remains popular today because of its great flexibility. With more than 25,000 unique cards published over nearly three decades, there are enough cards for players to build hundreds of different decks for surprisingly unique gameplay experiences. + +Along with this flexibility, however, there comes a cost: many _Magic: The Gathering_ players collect lots of cards so they can construct lots of different decks, which in turn lets them focus on different win conditions and try out different strategies. + +It can be quite a job to keep track of 1,000 cards when you only need 60 to 100 for a deck, but the open source application Magic Assistant makes managing your _Magic_ collection easy. + +### Installing Magic Assistant + +[Magic Assistant][2] is a Java application, so it's cross-platform. Regardless of whether you're on the open source operating system [Linux,][3] macOS, or Windows, you can download Magic Assistant, double-click on its launcher icon, and use it to manage your cards. + +After the application first launches, there are sure to be updates to the card database available. Multiple new _Magic_ sets are released each year, so accept the offer to update and go grab a cup of coffee while new cards are added. + +### Importing cards + +To catalog your cards with Magic Assistant, either you can rummage through the card database manually to add cards to your local collection, or you can import an existing list. The simplest format for a list of _Magic_ cards is a text file containing the number of copies you own and the name of a card on a line by itself: + + +``` +2x Mimic 1x Mordenkainen's Polymorph 2x Ray of Frost 4x Sol Ring +``` + +However, the application supports many formats, including a CSV from _Magic: The Gathering Online,_ TCGPlayer table, MTG Studio, Apprentice, DeckBox, and more. + +To import your cards, select the Import option from the File menu. + +![Sample entry field for importing cards into a deck or collection][4] + +Importing cards (Seth Kenlon, [CC BY-SA 4.0][5]) + +Importing cards adds them to the default collection database (called **main**). This database represents the entirety of your collection. You can then use cards from your collection to build decks and cubes. There's no limit on how many collections you can have, so you can organize your cards in whatever way you prefer. + +### Browsing your collection + +A collection is organized by its metadata by default. That means you can browse your collection by any number of attributes, including mana cost, card type, color, keyword abilities, and format legality. All of these options are available as tabs at the bottom of the collection interface. + +![A view of sorting tabs with several card categories][6] + +Interface tabs (Seth Kenlon, [CC BY-SA 4.0][5]) + +### Building a deck or cube + +One way to get better at _Magic: The Gathering_—and get a better feel for how you like to experience the game—is to build decks. On the one hand, it's great to hold physical cards, but, on the other hand, it can be a lot of work to sort through hundreds of cards kept in several different boxes or binders. With Magic Assistant, it's easy to sort through your cards based on whatever attribute you need, so building decks with it is a pleasure. + +To build a new deck (Magic Assistant has no concept of a cube, but functionally a cube is arguably no different than a deck), right-click on the Deck category in the Card Navigator panel, then select New to create a new deck. + +There are two kinds of decks you can build. You can build a virtual deck, which is purely theorycrafting, with no implication that the deck exists physically. When you create a virtual deck, you can take a card you own only one actual copy of and use it in several decks. You could not build the decks in real life, obviously, because you would be overusing some number of cards, but as a deck idea or recipe, it works well. + +Alternately, you can build a "real" deck, which affects your collection the same way a physical deck does. If you put three copies of Sol Ring into a deck, then your collection shows that you have three fewer copies of Sol Ring available. + +Choose what kind of deck you're building, and give your deck a name for your own reference in the New window. + +![Sample entry field for creating a new deck, with name and parent container][7] + +Deckbuilding tool (Seth Kenlon, [CC BY-SA 4.0][5]) + +To add cards to your a deck, locate the card in your collection, right-click on it, and select Move to or Copy to, followed by the deck you want it to appear in. A virtual deck never lets you move cards to it. Instead, it prompts you to copy the card, because a virtual card never removes a card from your collection. + +![Using Copy to to add a card to a specific deck][8] + +Adding a card to a deck (Seth Kenlon, [CC BY-SA 4.0][5]) + +When you have multiple copies of a card and copy that card into a deck, Magic Assistant adds all copies. To decrease or increase the number of copies of a card in a deck, right-click on the card in your deck and choose Decrease count or Increase count. + +### Deck reports + +After you've built a deck, you can view reports detailing the statistics for the cards you've assembled. You can get charts to view card types, creature types, mana curve, color distribution, and more. + +![A pie chart showing the different types of cards, and a chart with greater detail][9] + +Charts and graphs (Seth Kenlon, [CC BY-SA 4.0][5]) + +### Open source tools for everything + +There's an open source application for nearly everything, so it's no surprise that there's a robust card collection manager like Magic Assistant to help _Magic: The Gathering_ players. If you play the original trading card game, try this one out. It can help you keep track of which cards you have available for building decks. And just as important, it may encourage you to build more decks more often, because it's so easy to do when all the cards are at your fingertips. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/magic-the-gathering-assistant + +作者:[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/wayne-low-unsplash.jpg?itok=eqvfc71L (Holding a Magic the Gathering deckmaster card) +[2]: https://sourceforge.net/projects/mtgbrowser/ +[3]: https://opensource.com/resources/linux +[4]: https://opensource.com/sites/default/files/mtgassistant-import.jpeg (Importing cards into a deck or collection) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/mtgassistant-tab.jpeg (Interface tabs) +[7]: https://opensource.com/sites/default/files/mtgassistant-deck_0.jpeg (Deckbuilding tool) +[8]: https://opensource.com/sites/default/files/mtgassistant-add_0.jpeg (Using Copy to to add a card to a specific deck) +[9]: https://opensource.com/sites/default/files/mtgassistant-chart.jpeg (Charts and graphs) From 456068dde36b3b43c2e45c031e56b142e5146aaa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Sep 2021 05:03:22 +0800 Subject: [PATCH 0417/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210917?= =?UTF-8?q?=20Start=20using=20YAML=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210917 Start using YAML now.md --- sources/tech/20210917 Start using YAML now.md | 129 ++++++++++++++++++ 1 file changed, 129 insertions(+) create mode 100644 sources/tech/20210917 Start using YAML now.md diff --git a/sources/tech/20210917 Start using YAML now.md b/sources/tech/20210917 Start using YAML now.md new file mode 100644 index 0000000000..5ba41093ff --- /dev/null +++ b/sources/tech/20210917 Start using YAML now.md @@ -0,0 +1,129 @@ +[#]: subject: "Start using YAML now" +[#]: via: "https://opensource.com/article/21/9/intro-yaml" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Start using YAML now +====== +What is YAML, and why is it about time we started using it? +![woman on laptop sitting at the window][1] + +YAML (YAML Ain't Markup Language) is a human-readable data serialization language. Its syntax is simple and human-readable. It does not contain quotation marks, opening and closing tags, or braces. It does not contain anything which might make it harder for humans to parse nesting rules. You can scan your YAML document and immediately know what's going on. + +### YAML features + +YAML has some super features which make it superior to other serialization formats: + + * Easy to skim. + * Easy to use. + * Portable between programming languages. + * Native data structures of Agile languages. + * Consistent model to support generic tools. + * Supports one-pass processing. + * Expressive and extensible. + + + +I will show you YAML's power further with some examples. + +Can you figure out what's going on below? + + +``` +\------- +# My grocery list +groceries: +    - Milk +     - Eggs +     - Bread +     - Butter +... +``` + +The above example contains a simple list of groceries to buy, and it's a fully-formed YAML document. In YAML, strings aren't quoted, and lists need simple hyphens and spaces. A YAML document starts with **\---** and ends with **...**, but they are optional. Comments in YAML begin with a **#**. + +Indentation is key in YAML. Indentation must contain spaces, not tabs. And while the number of spaces required is flexible, it's a good idea to keep them consistent. + +### Basic Elements + +#### Collections + +YAML has two types of collections: _Lists_ (for sequences) and _dictionaries_ (for mappings). Lists are key-value pairs where every value is on a new line, beginning with a hyphen and space. Dictionaries are key-value pairs where every value is a mapping containing a key, a colon and space, and a value. + +For example: + + +``` +# My List +groceries: +    - Milk +     - Eggs +     - Bread +     - Butter + +# My dictionary +contact: + name: Ayush Sharma + email: [myemail@example.com][2] +``` + +Lists and dictionaries are often combined to provide more complex data structures. Lists can contain dictionaries, and dictionaries can contain lists. + +#### Strings + +Strings in YAML don't need quotation marks. Multi-line strings are defined using **|** or **>**. The former preserves newlines, but the latter does not. + +For example: + + +``` +my_string: | +    This is my string. +     It can contain many lines. +     Newlines are preserved. +my_string_2: > +    This is my string. +     This can also contain many lines. +     Newlines aren't preserved and all lines are folded. +``` + +#### Anchors + +YAML can have repeatable blocks of data using node anchors. The **&** character defines a block of data that is later referenced using *****. For example: + + +``` +billing_address: &add1 + house: B1 + street: My Street + +shipping_address: *add1 +``` + +At this point, you know enough YAML to get started. You can play around with the online YAML parser to test yourself. If you work with YAML daily, then [this handy cheatsheet][3] will be helpful. + +* * * + +_This article was originally published on the [author's personal blog][4] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/intro-yaml + +作者:[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/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: mailto:myemail@example.com +[3]: https://yaml.org/refcard.html +[4]: https://notes.ayushsharma.in/2021/08/introduction-to-yaml From a10d6466a2820ac2db04eabba16f836c442dd853 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Sep 2021 05:03:51 +0800 Subject: [PATCH 0418/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210917?= =?UTF-8?q?=20Linux=20Mint=E2=80=99s=20Website=20Has=20a=20Much=20Needed?= =?UTF-8?q?=20Minty=20Fresh=20New=20Look?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md --- ... Has a Much Needed Minty Fresh New Look.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md diff --git a/sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md b/sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md new file mode 100644 index 0000000000..8458af1ffe --- /dev/null +++ b/sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md @@ -0,0 +1,65 @@ +[#]: subject: "Linux Mint’s Website Has a Much Needed Minty Fresh New Look" +[#]: via: "https://news.itsfoss.com/linux-mint-new-website-design/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Mint’s Website Has a Much Needed Minty Fresh New Look +====== + +Linux Mint is one of the [best Linux distributions][1] available while offering a modern user experience. + +However, Linux Mint’s original website looked dated and potentially unattractive to new-age computer users. + +Many suggested a visual makeover to reflect Linux Mint’s taste through a modern website design. And, only recently the developers started working on a redesign in collaboration with the community members, asking for feedback and getting insights on proposed designs. + +Finally, a design was finalized and applied to [Linux M][2][i][2][nt’s official website][2]. + +The website looks clean and informative, great on desktop, and perfectly fits mobile phone browsers! + +![][3] + +Every new Linux user should be able to evaluate their requirements by looking at the features offered easily. + +The information is well-presented to convince users why they should try out Linux Mint on their desktop system. + +![][4] + +The key highlights of the website would be the homepage, download page, and donation page. + +Of course, you can choose to explore more about Linux Mint and how everything works through individual resources (like our articles), but the official website should be the essential starting point, which it is now. + +The accent color and the theme combination feels just like what Linux Mint needed! Navigating through various web pages and the menu is a breeze. I don’t think there is any unnecessary element on the website; everything fits perfectly in the first look. The page load time is faster as well. + +The blog/monthly news section continues to use the same design. And, I’m not certain if they intend to refresh that by applying the same design anytime soon. But, I think that should happen to ensure consistency between their web pages. + +_What do you think about Linux Mint’s new website design? Do you like it? Do you think this would help them get more attention from new-age users?_ + +_You are welcome to 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/linux-mint-new-website-design/ + +作者:[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/best-linux-distributions/ +[2]: https://linuxmint.com +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= From b4292cfd1c93f67ce1c263eec4826ef19433de6a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 18 Sep 2021 05:04:04 +0800 Subject: [PATCH 0419/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210917?= =?UTF-8?q?=20After=20Chromium,=20Ubuntu=20Now=20Converts=20Firefox=20to?= =?UTF-8?q?=20Snap=20by=20Default?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md --- ...Now Converts Firefox to Snap by Default.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md diff --git a/sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md b/sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md new file mode 100644 index 0000000000..afd9c82492 --- /dev/null +++ b/sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md @@ -0,0 +1,86 @@ +[#]: subject: "After Chromium, Ubuntu Now Converts Firefox to Snap by Default" +[#]: via: "https://news.itsfoss.com/ubuntu-firefox-snap-default/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +After Chromium, Ubuntu Now Converts Firefox to Snap by Default +====== + +One of the major and controversial [changes in the upcoming Ubuntu 21.10][1] is the conversion of Firefox from deb to snap. + +Yes, you heard it right. The default Firefox will be a Snap application, not the regular DEB version. + +As [spotted by OMG! Ubuntu][2], this is done as per an agreement between Mozilla and Canonical (Ubuntu’s parent company). + +The [feature freeze exception (FFE)][3] mentions it clearly: + +> Per Canonical’s distribution agreement with Mozilla, we’re making the snap the default installation of Firefox on desktop ISOs starting with Ubuntu 21.10. + +With this change, the Firefox deb package will be converted to Firefox snap package. + +This means that going forward, Firefox will be available as Snap. I think this change also means that even if you use apt command to install it, you’ll be getting the Snap package. + +### Deja vu? + +If you feel that this has been done in the past, you have got the right feeling. In the past, Ubuntu converted the Chromium browser to Snap. + +Today, if you use apt install chromium-browser, you still get the Snap version. There is no DEB package for Chromium in Ubuntu anymore. + +When Ubuntu made this sudden change on its own, there was an uproar. The conversion of Firefox to Snap will also create controversy. But this time, Ubuntu shares the blame with Mozilla. + +### Mozilla wants Snap + +![][4] + +Interestingly, it was [Mozilla that approached Canonical for this change][5]. Mozilla will maintain the Snap version of Firefox and the end users will get quick updates directly from the source. + +After all, it takes a few days before a new Firefox release lands in Ubuntu. With the Snap move, your Firefox will be updated to the new version the same day. + +### Concerns? + +A few for sure. I know there are a few people completely averted to Snap, I am not one of them. + +I have three major complaints with Snap packages: slow start up speed, poor system integration and high disk space. + +Over the time, Snaps have improved on the disk space front. But despite all the improvements, Snap packages still take longer to start. This could be tolerable with an IDE but it may ruin the browsing experience. + +This slow startup speed makes me wonder why it is called ‘Snap’ because surely, it doesn’t start in a snap. + +Another thing that bothers me is the Snap auto-refresh. Snap apps are updated automatically. If Mozilla starts pushing updates more frequently, this [Firefox restart annoyance][6] in the middle of work will be more frequently as well. + +![][7] + +The change will impact you when you install or upgrade to Ubuntu 21.10. The change will eventually propagate to Ubuntu 22.04 LTS. + +What do you think of this change? Yeah or neah? + +#### 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/ubuntu-firefox-snap-default/ + +作者:[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://news.itsfoss.com/ubuntu-21-10-release-schedule/ +[2]: https://www.omgubuntu.co.uk/2021/09/ubuntu-makes-firefox-snap-default +[3]: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1943840 +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI1NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://discourse.ubuntu.com/t/feature-freeze-exception-seeding-the-official-firefox-snap-in-ubuntu-desktop/24210 +[6]: https://news.itsfoss.com/mozilla-annoying-new-tab/ +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= From 7b59b04841681dad3201a5faa9665358c069f2e6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 18 Sep 2021 08:46:43 +0800 Subject: [PATCH 0420/1588] translated --- ... info and changelogs with rpm-ostree db.md | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-) rename {sources => translated}/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md (57%) diff --git a/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md b/translated/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md similarity index 57% rename from sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md rename to translated/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md index 9e7b715960..513c53058c 100644 --- a/sources/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md +++ b/translated/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md @@ -7,28 +7,28 @@ [#]: publisher: " " [#]: url: " " -How to check for update info and changelogs with rpm-ostree db +如何用 rpm-ostree db 检查更新信息和更新日志 ====== ![][1] -Photo by [Dan-Cristian Pădureț][2] on [Unsplash][3] +照片由 [Dan-Cristian Pădureț][2] 发布在 [Unsplash][3]。 -This article will teach you how to check for updates, check the changed packages, and read the changelogs with _rpm-ostree db_ and its subcommands. +这篇文章将教你如何使用 _rpm-ostree db_ 及其子命令检查更新、检查更改的软件包和阅读更新日志。 -The commands will be demoed on a Fedora Silverblue installation and should work on any OS that uses _rpm-ostree_. +这些命令将在 Fedora Silverblue 上进行演示,并且应该在任何使用 _rpm-ostree_ 的操作系统上工作。 -### Introduction +### 简介 -Let’s say you are interested in immutable systems. Using a base system that is read-only while you build your use cases on top of containers technology sounds very attractive and it persuades you to select a distro that uses _rpm-ostree_. +假设你对不可更改的系统感兴趣。在基于容器技术构建用例时使用只读的基本系统听起来非常有吸引力,它会说服你选择使用 _rpm-ostree_ 的发行版。 -You now find yourself on [Fedora Silverblue][4] (or another similar distro) and you want to check for updates. But you hit a problem. While you can find the updated packages on Fedora Silverblue with GNOME Software, you can’t actually read their changelogs. You also can’t [use _dnf updateinfo_ to read them on the command line][5], since there’s no DNF on the host system. +你现在发现自己在 [Fedora Silverblue][4](或其他类似的发行版)上,你想检查更新。但你遇到了一个问题。虽然你可以通过 GNOME Software 找到 Fedora Silverblue 上的更新包,但你实际上无法阅读它们的更新日志。你也不能[使用 _dnf updateinfo_ 在命令行上读取它们][5],因为主机系统上没有 DNF。 -So, what should you do? Well, _rpm-ostree_ has subcommands that can help in this situation. +那么,你应该怎么做呢?嗯,_rpm-ostree_ 有一些子命令可以在这种情况下提供帮助。 -### Checking for updates +### 检查更新 -The first step is to check for updates. Simply run _rpm-ostree upgrade –check_: +第一步是检查更新。只需运行 _rpm-ostree upgrade -check_: ``` $ rpm-ostree upgrade --check @@ -41,9 +41,9 @@ AvailableUpdate: Diff: 4 upgraded ``` -Notice that while it doesn’t tell the updated packages in the output, it does show the Commit for the update as _d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4_. This will be useful later. +请注意,虽然它没有在输出中告诉更新的软件包,但它显示了更新的 Commit 为 _d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4_。这在后面会很有用。 -Next thing you need to do is find the Commit for the current deployment you are running. Run _rpm-ostree status_ to get the BaseCommit of the current deployment: +接下来你需要做的是找到你正在运行的当前部署的 Commit。运行 _rpm-ostree status_ 以获得当前部署的 BaseCommit: ``` $ rpm-ostree status @@ -58,9 +58,9 @@ Deployments: ... ``` -For this example BaseCommit is _e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e_. +对于这个例子,BaseCommit 是 _e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e_。 -Now you can find the diff of the two commits with _rpm-ostree db diff [commit1] [commit2]_. In this command _commit1_ will be the BaseCommit from the current deployment and _commit2_ will be the Commit from the upgrade checking command. +现在你可以用 _rpm-ostree db diff [commit1] [commit2]_ 找到这两个提交的差异。在这个命令中,_commit1_ 将是当前部署的 BaseCommit,_commit2_ 将是升级检查命令中的 Commit。 ``` $ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 @@ -70,7 +70,7 @@ Upgraded: soundtouch 2.1.1-6.fc34 -> 2.1.2-1.fc34 ``` -The diff output shows that _soundtouch_ was updated and indicates the version numbers. View the changelogs by adding _–changelogs_ to the previous command: +diff 输出显示 _soundtouch_ 被更新了,并指出了版本号。通过在前面的命令中加入 _-changelogs_ 来查看更新日志: ``` $ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 --changelogs @@ -86,13 +86,13 @@ Upgraded: - Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild ``` -This output shows the commit notes as well as the version numbers. +这个输出显示了提交说明以及版本号。 -### Conclusion +### 总结 -Using _rpm-ostree db_ you are now able to have the functionality equivalent to _dnf check-update_ and _dnf updateinfo_. +使用 _rpm-ostree db_,你现在可以拥有相当于 _dnf check-update_ 和 _dnf updateinfo_ 的功能。 -This will come in handy if you want to inspect detailed info about the updates you install. +如果你想检查你所安装的更新的详细信息,这将非常有用。 -------------------------------------------------------------------------------- @@ -100,7 +100,7 @@ via: https://fedoramagazine.org/how-to-check-for-update-info-and-changelogs-with 作者:[Mateus Rodrigues Costa][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 7777c3cdd29c4f1493ba422e53c916b2cf78b646 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 18 Sep 2021 08:49:12 +0800 Subject: [PATCH 0421/1588] translating --- sources/tech/20210917 Start using YAML now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210917 Start using YAML now.md b/sources/tech/20210917 Start using YAML now.md index 5ba41093ff..3b626bad09 100644 --- a/sources/tech/20210917 Start using YAML now.md +++ b/sources/tech/20210917 Start using YAML now.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/intro-yaml" [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From efd8b838b589c2919b49694e57f2b5e166ccbf8b Mon Sep 17 00:00:00 2001 From: Frank Zhang Date: Sat, 18 Sep 2021 09:07:26 +0800 Subject: [PATCH 0422/1588] translating --- .../tech/20200115 Develop GUI apps using Flutter on Fedora.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md b/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md index afff65b34e..9770fc567d 100644 --- a/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md +++ b/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (zpl1025) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From bf8d995c637509015715d4eadcaf0f092f552357 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Sep 2021 09:58:20 +0800 Subject: [PATCH 0423/1588] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zpl1025 辛苦了! --- ...of the best React JavaScript frameworks.md | 208 +++++++----------- 1 file changed, 77 insertions(+), 131 deletions(-) diff --git a/translated/tech/20200121 13 of the best React JavaScript frameworks.md b/translated/tech/20200121 13 of the best React JavaScript frameworks.md index c76a969d11..b7be204e81 100644 --- a/translated/tech/20200121 13 of the best React JavaScript frameworks.md +++ b/translated/tech/20200121 13 of the best React JavaScript frameworks.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) +[#]: translator: (zpl1025) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (13 of the best React JavaScript frameworks) @@ -9,70 +9,67 @@ 13 个最好的 React JavaScript 框架 ====== -如果你正在用 React.js 或 React Native 来开发用户界面的话,试试这些框架。 -![Javascript code close-up with neon graphic overlay][1] -React.js 和 React Native 都是用来开发用户界面(UI)的很受欢迎的开源平台。在 StackOverflow 2019 年度开发者调查里,两个框架的可取性和实用性都排名靠前。React.js 是 Facebook 在 2011 年开发的一个 JavaScript 库,来实现跨平台,动态以及高性能的 UI 设计需求;而 React Native 则是 Facebook 在 2015 年发布的框架,目的是使用 JavaScript 构建原生应用。 +> 如果你正在用 React.js 或 React Native 来开发用户界面的话,试试这些框架。 -下面介绍 13 个最好的 React JavaScript 框架,都是开源项目。前 11 个(和 React 一样)都使用 MIT 协议授权,后面两个使用 Apache 2.0 协议。 +![](https://img.linux.net.cn/data/attachment/album/202109/18/095748k48eskmjpzuhyzuj.jpg) -### 1\. Create React App +React.js 和 React Native 都是用来开发用户界面(UI)的很受欢迎的开源平台。在 StackOverflow 2019 年度开发者调查里,两个框架的可取性和使用情况都排名靠前。React.js 是 Facebook 在 2011 年开发的一个 JavaScript 库,来实现跨平台,动态以及高性能的 UI 设计需求;而 React Native 则是 Facebook 在 2015 年发布的框架,目的是使用 JavaScript 构建原生应用。 + +下面介绍 13 个最好的 React JavaScript 框架,都是开源项目。前 11 个(和 React 一样)都使用 MIT 许可证授权,后面两个使用 Apache 2.0 许可证。 + +### 1、Create React App 这个 Facebook 开发的命令行工具是 React Native 项目一定要用的。因为 [Create React App][2] 使用很简单,还可以避免你自己手动设定和配置应用,因此能节省大量的时间和精力。仅仅使用给一个简单的命令,就可以为你准备好创建 React 原生项目所需的一切。你可以用它来创建分类和文件,而且该框架还自带了工具用来构建,测试和启动应用。 - ``` # 安装软件包 $ npm install -g create-react-native-web-app   -# 运行 create-react-native-web-app <项目目录> +# 运行 create-react-native-web-app <项目目录> $ create-react-native-web-app myApp   -# 切换到创建的<项目目录> +# 切换到创建的 <项目目录> $ cd myApp   # 运行 Web/Ios/Android 调试 # Web $ npm run web   -# IOS (模拟器) +# IOS(模拟) $ npm run ios   -# Android (实际连接的设备) +# Android(实际连接的设备) $ npm run android ``` #### 为什么选择 Create React App - 1. 支持配置,转换,以及测试运行的一流工具 + 1. 使用配置包、转码器,以及测试运行器进行开发的一流工具 2. 在应用架构里不需要配置以及没有额外文件 3. 确定的开发栈 4. 高效快速的开发工具 +### 2、Material Kit React - -### 2\. Material Kit React - -[Material Kit React][3] 是受谷歌的 Material Design 系统启发开发的, 很适合用来创建 React UI 组件。这个库最大的优点是提供了大量的组件,可以互相搭配做出非常好的效果。有超过一千个完全编码的组件,每一个都有用文件夹组织起来的独立图层。这样你就可以有上千个选项可以选择。同时也包含一些示例页面,方便你从中寻找灵感,或者向别人分享你的点子或创意。 +[Material Kit React][3] 是受谷歌的 Material Design 系统启发开发的,很适合用来创建 React UI 组件。这个库最大的优点是提供了大量的组件,可以互相搭配做出非常好的效果。有超过一千个完全编码的组件,每一个都有用文件夹组织起来的独立层。这样你就可以有上千个选项可以选择。它同时也包含一些示例页面,方便你从中寻找灵感,或者向别人分享你的点子或创意。 #### 安装 Material Kit - ``` -`  $ npm install @material-ui/core` +$ npm install @material-ui/core ``` #### 使用 - ``` import React from 'react'; import Button from '@material-ui/core/Button'; -const App = () => ( -  <Button variant="contained" color="primary"> +const App = () => ( +  ); ``` @@ -82,15 +79,14 @@ Material-UI 组件不需要其他额外设置,也不会干扰全局变量空 这个 React 组件支持简易快速的网页开发。你可以用它创建自己的设计系统,或者直接开始 Material Design。 -### 3\. Shards React +### 3、Shards React -这个现代的 React UI 工具为了追求高效率,是从最底层开始构建的。它拥有现代的设计系统,可以让你按自己的想法任意定制。甚至可以下载源文件,然后从代码级别定制。另外,它用来设计样式的 SCSS 语法提高了开发体验。 +这个现代的 React UI 工具为了追求高效率,是从最底层开始构建的。它拥有现代的设计系统,可以让你按自己的想法任意定制。你甚至可以下载源文件,然后从代码级别定制。另外,它用来设计样式的 SCSS 语法提高了开发体验。 -[Shards React][4] 基于 Shards,使用了 React Datepicker,React Popper(一个定位引擎),和 noUISlider。还带有非常优秀的 Material Design 图标。还有很多设计好的版本,可以帮你寻找灵感或上手。 +[Shards React][4] 基于 Shards,使用了 React Datepicker、React Popper(一个定位引擎)和 noUISlider。还带有非常优秀的 Material Design 图标。还有很多设计好的版本,可以帮你寻找灵感或上手。 #### 用 Yarn 或 NPM 安装 Shards - ``` # Yarn yarn add shards-react @@ -105,22 +101,18 @@ npm i shards-react 2. Shards 默认支持响应式,图层可以适配任意大小屏幕 3. Shards 有完整的文档,可以快速开始构建漂亮的界面 - - -### 4\. Styled Components +### 4、Styled Components 这个高效的 CSS 工具可以用来为应用的可视界面创建小型可重用的组件。使用传统的 CSS,你可能会不小心覆盖掉网站其他位置的选择器,但 [Styled Components][5] 通过使用直接内嵌到组件里的 CSS 语法,可以完全避免这个问题。 #### 安装 - ``` -`npm install --save styled-components` +npm install --save styled-components ``` #### 使用 - ``` const Button = styled.button`   background: background_type; @@ -128,7 +120,7 @@ const Button = styled.button`   border: abc;   color: name_of_color;   Margin: margin_value; -  padding: value; +  padding: value`; ``` #### 优点 @@ -137,17 +129,14 @@ const Button = styled.button` 2. 组件样式依赖 JavaScript 3. 创建定制 CSS 组件 4. 内嵌样式 - 5. 简单地调用 styled() 可以将组件甚至是自定义组件转换成样式组件 + 5. 简单地调用 `styled()` 可以将组件甚至是自定义组件转换成样式组件 - - -### 5\. Redux +### 5、Redux [Redux][6] 是一个为 JavaScript 应用提供状态管理的方案。常用于 React.js,也可以用在其他类 React 框架里。 #### 安装 - ``` sudo npm install redux sudo npm install react-redux @@ -155,7 +144,6 @@ sudo npm install react-redux #### 使用 - ``` import { createStore } from "redux"; import rotateReducer from "reducers/rotateReducer"; @@ -173,22 +161,18 @@ export default configureStore; 2. 逻辑上测试更简单,使用 reducer 函数进行时间旅行调试也更容易 3. 统一管理状态 - - -### 6\. React Virtualized +### 6、React Virtualized 这个 React Native JavaScript 框架帮助渲染 large-list 和 tabular-data。使用 [React Virtualized][7],你可以限制请求和文档对象模型(DOM)元素的数量,从而提高 React 应用的性能。 #### 安装 - ``` -`npm install react-virtualized` +npm install react-virtualized ``` #### 使用 - ``` import 'react-virtualized/styles.css' import { Column, Table } from 'react-virtualized' @@ -198,7 +182,7 @@ import List from 'react-virtualized/dist/commonjs/List'   alias: {     'react-virtualized/List': 'react-virtualized/dist/es/List',   }, -  ...rest +  ...等等 } ``` @@ -208,71 +192,62 @@ import List from 'react-virtualized/dist/commonjs/List' 2. 渲染超大数据集 3. 使用一系列组件实现虚拟渲染 +### 7、React DnD - -### 7\. React DnD - -[ReactDnD][8] 用来创建复杂的拖放界面。拖放控件库有很多,选用 React DnD 是因为它是基于 HTML5 的拖放 API 的,创建界面更简单。 +[React DnD][8] 用来创建复杂的拖放界面。拖放控件库有很多,选用 React DnD 是因为它是基于 HTML5 的拖放 API 的,创建界面更简单。 #### 安装 - ``` -`npm install react-dnd-preview` +npm install react-dnd-preview ``` #### 使用 - ``` - import Preview from 'react-dnd-preview'; +import Preview from 'react-dnd-preview';   -  const generatePreview = ({itemType, item, style}) => { -    return <div class="item-list" style={style}>{itemType}</div>; -  }; -  -  class App extends React.Component { -    ... -  -    render() { -      return ( -        <DndProvider backend={MyBackend}> -          <ItemList /> -          <Preview generator={generatePreview} /> -          // or -          <Preview>{generatePreview}</Preview> -        </DndProvider> -      ); -    } +const generatePreview = ({itemType, item, style}) => { +  return
{itemType}
; +}; + +class App extends React.Component { + ... +  render() { +    return ( +      +        +        +        // or +        {generatePreview} +      +    );   } +} ``` #### 优点 - 1. 漂亮自然的控件移动 (bouquet是个库??? Beautiful and natural movement of items bouquet) - 2. 强大的键盘和屏幕阅读支持 (wheelchair是说行动不便的人?Powerful keyboard and screen reader support wheelchair) + 1. 漂亮自然的控件移动 + 2. 强大的键盘和屏幕阅读支持 3. 极限性能 4. 强大整洁的接口 5. 标准浏览器支持非常好 6. 中性样式 7. 没有额外创建 DOM 节点 - - -### 8\. React Bootstrap +### 8、React Bootstrap 这个 UI 库将 Bootstrap 的 JavaScript 替换成了 React,可以更好地控制每个组件的功能。每个组件都构建成能轻易访问,因此 [React Bootstrap][9] 有利于构建前端框架。有上千种 bootstrap 主题可以选择。 #### 安装 - ``` -`npm install react-bootstrap bootstrap` +npm install react-bootstrap bootstrap ``` #### 使用 - ``` import 'bootstrap/dist/css/bootstrap.min.css'; import React from 'react'; @@ -281,7 +256,7 @@ import './index.css'; import App from './App'; import registerServiceWorker from './registerServiceWorker'; -ReactDOM.render(<App />, document.getElementById('root')); +ReactDOM.render(, document.getElementById('root')); registerServiceWorker(); ``` @@ -293,26 +268,22 @@ registerServiceWorker(); 4. 使用简单 5. 使用元素封装 - - -### 9\. React Suite +### 9、React Suite [React Suite][10] 是另一个高效的 React.js 框架,包含了大量组件库,方便开发企业级产品。支持所有主流浏览器和平台,适用于任何系统。还支持服务器端渲染。 #### 安装 - ``` -`npm i rsuite --save` +npm i rsuite --save ``` #### 使用 - ``` import { Button } from 'rsuite'; import 'rsuite/styles/less/index.less'; -ReactDOM.render(<Button>Button</Button>, mountNode); +ReactDOM.render(, mountNode); ``` #### 优点 @@ -322,15 +293,12 @@ ReactDOM.render(<Button>Button</Button>, mountNode); 3. Redux 库有灵活的 UI 层,以及广泛的生态 4. Redux 库减少系统复杂度,并提供了全局访问特性 - - -### 10\. PrimeReact +### 10、PrimeReact [PrimeReact][11] 最值得推荐的是它提供了几乎覆盖所有基本 UI 需求的组件,比如输入选项,菜单,数据展示,消息,等等。这个框架还优化了移动体验,帮助你设计触摸优化的元素。 #### 安装 - ``` npm install primereact --save npm install primeicons --save @@ -338,7 +306,6 @@ npm install primeicons --save #### 使用 - ``` import {Dialog} from 'primereact/dialog'; import {Accordion,AccordionTab} from 'primereact/accordion'; @@ -353,32 +320,28 @@ dependencies: { #### 优点 - 1. 简单,高效 + 1. 简单而高效 2. 容易使用 3. Spring 应用 4. 创建复杂用户界面 - 5. 好用,简单 + 5. 好用而简单 +### 11、React Router - -### 11\. React Router - -[React Router][12] 在 React Native 开发社区很受欢迎,因为它上手很容易。只需要你在电脑上安装 git 和 npm 包管理工具,有 React 的基础知识,以及好学的意愿。没什么特别难的地方。 +[React Router][12] 在 React Native 开发社区很受欢迎,因为它上手很容易。只需要你在电脑上安装 Git 和 npm 包管理工具,有 React 的基础知识,以及好学的意愿。没什么特别难的地方。 #### 安装 - ``` -`$ npm install --save react-router` +$ npm install --save react-router ``` #### 使用 - ``` import { Router, Route, Switch } from "react-router";   -// using CommonJS modules +// 使用 CommonJS 模块 var Router = require("react-router").Router; var Route = require("react-router").Route; var Switch = require("react-router").Switch; @@ -388,24 +351,20 @@ var Switch = require("react-router").Switch; 1. 动态路由匹配 2. 在导航时支持不同页面的 CSS 切换 - 3. 统一的 app 结构和行为 + 3. 统一的应用结构和行为 +### 12、Grommet - -### 12\. Grommet - -[Grommet][13] 常用于开发响应式可访问的移动网页应用。这个用 Apache 2.0 协议授权的 JavaScript 框架最大的优点是用很小的包提供了可访问性,模块化,响应式以及主题功能。这可能是它被一些公司广泛使用的主要原因,比如奈飞,通用电气,优步,以及波音。 +[Grommet][13] 常用于开发响应式、可访问的移动网页应用。这个用 Apache 2.0 许可证授权的 JavaScript 框架最大的优点是用很小的包提供了可访问性、模块化、响应式以及主题功能。这可能是它被一些公司广泛使用的主要原因,比如奈飞、通用电气、优步以及波音。 #### 安装 for yarn and npm - ``` -` $ npm install grommet styled-components --save` +$ npm install grommet styled-components --save ``` #### 使用 - ``` "grommet-controls/chartjs": {           "transform": "grommet-controls/es6/chartjs/${member}", @@ -415,29 +374,24 @@ var Switch = require("react-router").Switch; #### 优点 - 1. 创建一个工具包来打包 Create one toolkit as a packaged deal + 1. 创建一个工具包来打包 2. 把开放政策发挥到极致 3. 重构有助于影响已成立的组织 +### 13、Onsen UI +[Onsen UI][14] 另一个使用 HTML5 和 JavaScript 的手机应用开发框架,集成了 Angular、Vue 和 React,使用 Apache 2.0 许可证授权。 -### 13\. Onsen UI - -[Onsen UI][14] 另一个使用 HTML5 和 JavaScript 的手机应用开发框架,集成了 Angular,Vue 和 React,使用 Apache 2.0 协议授权。 - -Onsen 提供了标签,侧边栏,堆栈导航以及其他组件。这个框架最好的地方是,它所有的组件都支持 iOS 和安卓 Material Design 自动适配,会根据不同的平台切换应用的外观。 - +Onsen 提供了标签、侧边栏、堆栈导航以及其他组件。这个框架最好的地方是,它所有的组件都支持 iOS 和安卓 Material Design 自动适配,会根据不同的平台切换应用的外观。 #### 安装 - ``` -`npm install onsenui` +npm install onsenui ``` #### 使用 - ``` (function() {     'use strict'; @@ -452,23 +406,15 @@ Onsen 提供了标签,侧边栏,堆栈导航以及其他组件。这个框 #### 优点 - 1. Onsen UI 基于免费和开源代码 + 1. Onsen UI 基于自由而开源代码 2. 不强制基于它开发的应用使用任何形式的 DRM 3. 内置了 JavaScript 和 HTML5 代码 4. 给最终用户带来原生体验 - - * * * 你最喜欢哪个 React JavaScript 框架?请在评论区分享。 -Learn more about React Native, a framework for building native apps using React and JavaScript. - -Whether you are new to JavaScript or an experienced JavaScript developer, using libraries and... -(检查了原文,没有这两句,是下面关联文章的简介) - - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/1/react-javascript-frameworks @@ -476,7 +422,7 @@ via: https://opensource.com/article/20/1/react-javascript-frameworks 作者:[Amit Dua][a] 选题:[lujun9972][b] 译者:[zpl1025](https://github.com/zpl1025) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 892d5a5d2fdf78e25c7d193ebb601839ab9aa29e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Sep 2021 09:58:58 +0800 Subject: [PATCH 0424/1588] PUB @zpl1025 https://linux.cn/article-13796-1.html --- .../20200121 13 of the best React JavaScript frameworks.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200121 13 of the best React JavaScript frameworks.md (99%) diff --git a/translated/tech/20200121 13 of the best React JavaScript frameworks.md b/published/20200121 13 of the best React JavaScript frameworks.md similarity index 99% rename from translated/tech/20200121 13 of the best React JavaScript frameworks.md rename to published/20200121 13 of the best React JavaScript frameworks.md index b7be204e81..45d734f18e 100644 --- a/translated/tech/20200121 13 of the best React JavaScript frameworks.md +++ b/published/20200121 13 of the best React JavaScript frameworks.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (zpl1025) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13796-1.html) [#]: subject: (13 of the best React JavaScript frameworks) [#]: via: (https://opensource.com/article/20/1/react-javascript-frameworks) [#]: author: (Amit Dua https://opensource.com/users/amitdua) From c5cd7842911c017c4ecbcab7d34a9492eb305649 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Sep 2021 10:10:33 +0800 Subject: [PATCH 0425/1588] APL --- ...n Kali Live VM Support, New Tools, and Other Improvements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md b/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md index b125f1dcbc..6036577800 100644 --- a/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md +++ b/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/kali-linux-2021-3-release/" [#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 6ec1a0e03beacfb156600b1f07a4089c1cd7b629 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sat, 18 Sep 2021 16:08:08 +0800 Subject: [PATCH 0426/1588] translating --- .../20210813 Code memory safety and efficiency by example.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 index 3dc22c5a38..6d4c2f05f9 100644 --- a/sources/tech/20210813 Code memory safety and efficiency by example.md +++ b/sources/tech/20210813 Code memory safety and efficiency by example.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/memory-programming-c" [#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -688,7 +688,7 @@ via: https://opensource.com/article/21/8/memory-programming-c 作者:[Marty Kalin][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 b122d29b0840f52ad376f49a1891cbb245e0cfd5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Sep 2021 22:20:57 +0800 Subject: [PATCH 0427/1588] TSL&PRF --- ...port, New Tools, and Other Improvements.md | 115 ------------------ ...port, New Tools, and Other Improvements.md | 107 ++++++++++++++++ 2 files changed, 107 insertions(+), 115 deletions(-) delete mode 100644 sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md create mode 100644 translated/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md diff --git a/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md b/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md deleted file mode 100644 index 6036577800..0000000000 --- a/sources/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md +++ /dev/null @@ -1,115 +0,0 @@ -[#]: subject: "Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements" -[#]: via: "https://news.itsfoss.com/kali-linux-2021-3-release/" -[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements -====== - -Kali Linux is one of the [best Linux distributions for penetration testing][1]. It is based on Debian, but it may not be a suitable replacement for your full-fledged desktop operating system. - -The latest 2021.3 release brings some significant feature additions and improvements onboard. Let us check them out. - -### What’s New? - -![][2] - -#### OpenSSL Compatibility - -[OpenSSL][3] has been **reconfigured to expand the services networked to Kali**. As a result, legacy protocols such as TLS 1.0 and TLS 1.1 and older ciphers are allowed by default. That is to say; it will grant Kali the capability of connecting to more out-of-date servers. However, you can alter this option if you do not need it. - -#### Virtualization Improvements - -Kali is known to work flawlessly as a virtual machine. Firstly, actions like drag and drop, copy and paste between host and guest systems are smoother than ever, whether your guest machine is running under VirtualBox, VMware, Hyper-V, or QEMU+Spice. - -Secondly, it is easier to configure Kali for Hyper-V Enhanced Session Mode, a virtualization hypervisor, using Kali-Tweaks. - -In short, Kali Linux 2021.3 has made the experience even more seamless when setting up a virtual environment. - -#### Kali Tools - -It is taken for granted that every release of Kali contains new tools. Likewise, this release is no exception. The tools that Kali added to its fleet are: - - * [Berate_ap][4] – Orchestrating MANA rogue Wi-Fi Access Points - * [CALDERA][5] – Scalable automated adversary emulation platform - * [EAPHammer][6] – Targeted evil twin attacks against WPA2-Enterprise Wi-Fi networks - * [HostHunter][7] – Recon tool for discovering hostnames using OSINT techniques - * [RouterKeygenPC][8] – Generate default WPA/WEP Wi-Fi keys - * [Subjack][9] – Subdomain takeover - * [WPA_Sycophant][10] – Evil client portion of EAP relay attack - - - -##### Kali ARM Updates and Kali-Tools - -With Kali 2021.3, ARM devices are getting more ameliorations. The ones I found eye-catching are:  - - * en_US.UTF-8 is the default locale on all images. - * The Kali ARM build scripts are rebuilt to better support some devices. - * Raspberry Pi images can now use a wpa_supplicant.conf file on the /boot partition. - - - -Moreover, Kali has refreshed its information domain **Kali-Tools**, to provide a concise overview of tools, a neat and clean interface, and a fast system. - -### Other Changes - -![Kali Linux 2021.3][11] - -Kali has seen other neat improvements as well that includes: - - * Improvement to its layout for its Xfce and Gnome editions. Kali did not forget about KDE, as it is one of its favorite desktop environments. For instance, KDE 5.21 is the new version available baked in. - * Some of the important pages in their documentation site has received major updates. - * Partnered with Ampere to have its ARM package building machines running on Ampere’s hardware. As a consequence, Kali benefited from a burst in speed. - - - -Kali’s mobile penetration testing platform for Android devices has seen an enhancement. In other words, you can now install Kali NetHunter on Android 11 devices without the need for a fully working [TWRP][12] (Team Win Recovery Project). Above all, this update is promising due to its convenient installation procedure. - -In addition to this release, they also announced their first NetHunter smartwatch, **TicHunter Pro**. But, it is still in its very first stages of development. - -To learn more about all the technical changes with this upgrade, refer to [the official announcement][13]. - -### Summing Up - -Overall, this is a significant release with valuable improvements and exciting new tools. Get started by downloading it from its official site. - -[Download Kali Linux 2021.3][14] - -#### 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/kali-linux-2021-3-release/ - -作者:[Omar Maarof][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/omar/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/linux-hacking-penetration-testing/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://www.openssl.org/ -[4]: https://pkg.kali.org/pkg/berate-ap -[5]: https://pkg.kali.org/pkg/caldera -[6]: https://pkg.kali.org/pkg/eaphammer -[7]: https://pkg.kali.org/pkg/hosthunter -[8]: https://pkg.kali.org/pkg/routerkeygenpc -[9]: https://pkg.kali.org/pkg/subjack -[10]: https://pkg.kali.org/pkg/wpa-sycophant -[11]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[12]: http://twrp.me/ -[13]: https://www.kali.org/blog/kali-linux-2021-3-release/ -[14]: https://www.kali.org/get-kali/ diff --git a/translated/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md b/translated/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md new file mode 100644 index 0000000000..a00b8e9b5e --- /dev/null +++ b/translated/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md @@ -0,0 +1,107 @@ +[#]: subject: "Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements" +[#]: via: "https://news.itsfoss.com/kali-linux-2021-3-release/" +[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Kali Linux 2021.3 的新改进 +====== + +> Kali Linux 2021.3 带来了一些重要的功能改进以及一些新工具。此外还有一个惊喜,他们还宣布正在开发他们的第一个 NetHunter 智能手表。 + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/kali-linux-2021-3.jpg?w=1200&ssl=1) + +Kali Linux 是 [用于渗透测试的最佳 Linux 发行版][1] 之一。它是基于 Debian 的,但它可能不适合替代你的成熟的桌面操作系统。 + +最新的 2021.3 版本带来了一些重要的功能添加和改进。让我们来看看它们。 + +### 有何新变化? + +![][2] + +#### OpenSSL 兼容性 + +重新配置了 [OpenSSL][3],以扩大 Kali 可以连接的服务。因此,老式过期的协议,如 TLS 1.0 和 TLS 1.1 以及更旧的加密算法,在默认情况下是允许的。也就是说;它将让 Kali 可以连接到更多过时的服务器。然而,如果你不需要它,你可以改变这个选项。 + +#### 虚拟化的改进 + +众所周知,Kali 可以作为一个虚拟机完美地工作。首先,无论你的访客机是在 VirtualBox、VMware、Hyper-V 还是 QEMU+Spice 下运行,宿主机和访客机系统之间的拖放、复制和粘贴等操作都比以前更顺畅。 + +其次,使用 Kali-Tweaks 可以更容易为 Hyper-V 增强会话模式(一种虚拟化管理程序)配置 Kali。 + +简而言之,Kali Linux 2021.3 使得在设置虚拟环境时的体验更加完美。 + +#### Kali 工具 + +每一个 Kali 版本都包含新的工具,这是理所当然的。同样的,这个版本也不例外。Kali 加入的工具有: + + * [Berate_ap][4] - 编组 MANA rogue Wi-Fi 接入点 + * [CALDERA][5] - 可扩展的自动对手模拟平台 + * [EAPHammer][6] - 针对 WPA2-Enterprise Wi-Fi 网络的 evil twin 攻击 + * [HostHunter][7] - 使用 OSINT 技术发现主机名的侦察工具 + * [RouterKeygenPC][8] - 生成默认的 WPA/WEP 无线密钥 + * [Subjack][9] - 子域接管 + * [WPA_Sycophant][10] - EAP 中继攻击的邪恶客户端部分 + +##### Kali ARM 更新和 Kali-Tools + +在 Kali 2021.3 中,对 ARM 设备的支持得到了更多的改进。我发现最吸引人的是: + + * en_US.UTF-8 是所有镜像的默认语言。 + * 重新构建了 Kali ARM 构建脚本,以更好地支持一些设备。 + * 树莓派镜像现在可以使用 `/boot` 分区上的 `wpa_supplicant.conf` 文件。 + +此外,Kali 刷新了其信息域 **Kali-Tools**,以提供简洁的工具概述、整洁的界面和快速的系统。 + +### 其他变化 + +![Kali Linux 2021.3][11] + +Kali 还有其他一些不错的改进,包括: + + * 改进了 Xfce 和 Gnome 版本的布局。Kali 并没有忘记 KDE,因为这是它最喜欢的桌面环境之一,已经内置了 KDE 5.21 是新的版本。 + * 他们的文档网站中的一些重要页面进行了大幅更新。 + * 与 Ampere 合作,让其 ARM 包构建机运行在 Ampere 的硬件上。因此,其大幅的提速使得 Kali 受益。 + +Kali 增强了针对安卓设备的移动渗透测试平台。换句话说,你现在可以在 Android 11 设备上安装 Kali NetHunter,而不需要完整的可工作的 [TWRP][12](Team Win Recovery Project)。最重要的是,由于其方便的安装程序,这一更新很有希望。 + +除了这个版本之外,他们还宣布了他们的第一个 NetHunter 智能手表,**TicHunter Pro**。但是,它仍然处于开发的最初阶段。 + +要了解更多关于这次升级的所有技术变化,请参考 [官方公告][13]。 + +### 总结 + +总的来说,这是一个重要的版本,提供了重要的改进和令人兴奋的新工具。从它的官方网站上下载它,就可以开始了。 + +- [下载 Kali Linux 2021.3][14] + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kali-linux-2021-3-release/ + +作者:[Omar Maarof][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/omar/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/linux-hacking-penetration-testing/ +[2]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/kali-linux-desktop-2021-3.png?w=1200&ssl=1 +[3]: https://www.openssl.org/ +[4]: https://pkg.kali.org/pkg/berate-ap +[5]: https://pkg.kali.org/pkg/caldera +[6]: https://pkg.kali.org/pkg/eaphammer +[7]: https://pkg.kali.org/pkg/hosthunter +[8]: https://pkg.kali.org/pkg/routerkeygenpc +[9]: https://pkg.kali.org/pkg/subjack +[10]: https://pkg.kali.org/pkg/wpa-sycophant +[11]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/banner-kali-2021.3-release.jpg?w=1200&ssl=1 +[12]: http://twrp.me/ +[13]: https://www.kali.org/blog/kali-linux-2021-3-release/ +[14]: https://www.kali.org/get-kali/ From a819fa7bad91ed6e4bfe3a53332bf96965fbb126 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Sep 2021 22:24:43 +0800 Subject: [PATCH 0428/1588] PUB @wxy https://linux.cn/article-13798-1.html --- ...li Live VM Support, New Tools, and Other Improvements.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/news => published}/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md (98%) diff --git a/translated/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md b/published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md similarity index 98% rename from translated/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md rename to published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md index a00b8e9b5e..cec64a78a3 100644 --- a/translated/news/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md +++ b/published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md @@ -3,9 +3,9 @@ [#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13798-1.html" Kali Linux 2021.3 的新改进 ====== From e10cf75a61f5d4c553447ff141ef94280df796fe Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Sep 2021 22:28:21 +0800 Subject: [PATCH 0429/1588] PRF --- ...n Kali Live VM Support, New Tools, and Other Improvements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md b/published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md index cec64a78a3..64d25716e9 100644 --- a/published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md +++ b/published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md @@ -46,7 +46,7 @@ Kali Linux 是 [用于渗透测试的最佳 Linux 发行版][1] 之一。它是 * [Subjack][9] - 子域接管 * [WPA_Sycophant][10] - EAP 中继攻击的邪恶客户端部分 -##### Kali ARM 更新和 Kali-Tools +#### Kali ARM 更新和 Kali-Tools 在 Kali 2021.3 中,对 ARM 设备的支持得到了更多的改进。我发现最吸引人的是: From 1b35ca2d0bcf3e84534334ff3396a56cdc53fb7f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 18 Sep 2021 22:42:28 +0800 Subject: [PATCH 0430/1588] =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=BF=87=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...Yaru Theme Now Officially Supports Xfce.md | 71 ---- ...fault Browser on Manjaro Linux Cinnamon.md | 81 ---- ... Release Date and Expected New Features.md | 103 ----- ...Turning Heads. Time to migrate to Linux.md | 101 ----- ...h Indri - New Features and Release Date.md | 166 -------- ...ld a data sharding service with DistSQL.md | 378 ------------------ 6 files changed, 900 deletions(-) delete mode 100644 sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md delete mode 100644 sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md delete mode 100644 sources/news/20210913 Fedora 35 Release Date and Expected New Features.md delete mode 100644 sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md delete mode 100644 sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md delete mode 100644 sources/tech/20210915 Build a data sharding service with DistSQL.md diff --git a/sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md b/sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md deleted file mode 100644 index f9607f5d74..0000000000 --- a/sources/news/20210909 Ubuntu-s Yaru Theme Now Officially Supports Xfce.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: subject: "Ubuntu’s Yaru Theme Now Officially Supports Xfce" -[#]: via: "https://news.itsfoss.com/yaru-xfce-support/" -[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ubuntu’s Yaru Theme Now Officially Supports Xfce -====== - -Back when [Ubuntu 20.04][1] was released, the Ubuntu team stunned everyone with the new Yaru theme’s beautiful visuals and simplicity. It keeps on getting better with each Ubuntu release. It has become the symbolism of Ubuntu now. - -However, the Yaru theme was not well supported for other desktop environments like Xfce. - -Fortunately, this is set to change with a recent pull request on the [project’s GitHub page][2]. Here, we will be looking at this change, as well as how to try out these changes for yourself. - -### Yaru on Xfce - -![][3] - -This update started in late July, when developer [Muqtxdir][4] opened [a pull request on the Yaru GitHub page][5] to add support for the XFCE desktop environment. Over the course of a month, the awesome developers there worked tirelessly on improving Muqtxdir’s work, with a result that is truly stunning. - -![][3] - -One interesting change is the panel, which now looks similar to the panel found in the GNOME desktop environment. - -### If you want to try it right away (not recommended) - -If you are already using XFCE, trying out the Yaru theme is as simple as following the instructions on here. For this, I will be assuming that you are using Xubuntu, however the commands can be easily adapted for other distributions. - -``` -sudo apt install git meson sassc libglib2.0-dev libxml2-utils -git clone https://github.com/ubuntu/yaru -cd yaru && meson build -Dxfwm4=true && sudo ninja -C build install -``` - -_**If you don’t quite feel comfortable building it from source, I suspect that it will be available with Xubuntu 21.10, which is only a month away now.**_ - -Either way, I am really excited about this change, especially as it gives XFCE a much more modern and simplistic look. Plus, it also gives users a major reason to upgrade to Xubuntu 21.10. - -What do you think about the Yaru theme on XFCE? Let me know in the comments below! - -_Source: [Linux Uprising][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 - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/yaru-xfce-support/ - -作者:[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://itsfoss.com/download-ubuntu-20-04/ -[2]: https://github.com/ubuntu/yaru -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://github.com/Muqtxdir -[5]: https://github.com/ubuntu/yaru/pull/2971 -[6]: https://www.linuxuprising.com/2021/09/ubuntus-yaru-theme-gets-official.html diff --git a/sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md b/sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md deleted file mode 100644 index 249f3778c3..0000000000 --- a/sources/news/20210909 Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: subject: "Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon" -[#]: via: "https://news.itsfoss.com/vivaldi-replaces-firefox-manjaro/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Vivaldi Replaces Firefox as the Default Browser on Manjaro Linux Cinnamon -====== - -Vivaldi is one of the [best web browsers available for Linux][1]. - -For all the good reasons, many Linux users have been switching to Vivaldi, especially after [Vivaldi 4.0 release][2]. - -Now, to take it up a notch, Vivaldi has managed to replace Firefox as the default browser on Arch-based Manjaro Linux (Cinnamon edition). - -![][3] - -Even though the Cinnamon version is a community edition, it is surprising that Mozilla Firefox dropped from a Linux distribution. - -As per the official announcement, Manjaro’s co-CEO mentioned why they chose Vivaldi: - -> _To give Vivaldi more of the attention it deserves, I decided to include it as the default browser in our popular Cinnamon Community Edition. With its remarkable browsing speed, exceptional customizability and especially the way it values user privacy, Vivaldi for me is a perfect match for Manjaro Linux._ - -### Customized Experience for Manjaro Linux Users - -![][4] - -To spice things up, [Vivaldi][5] comes baked in with a Manjaro-Cinnamon theme to give you a refreshing out-of-the-box experience. - -Of course, if you have already used Vivaldi as your browser, you have to sync your data to get started. - -### Vivaldi is a Great Option for Linux Users - -![][6] - -It is worth noting that Vivaldi is not 100% open-source, but you can find most of its source code online, except its UI. Also, it is based on Chromium. - -However, it is a feature-rich web browser that lets you customize a lot of things. You also get a unique tab management feature, integration of web apps, email, calendar, timer, RSS feeds, and more. - -I have been using Vivaldi as my daily driver on Linux, keeping Firefox as the secondary for a while now. And, I like the experience so far! - -So, if you prefer multi-tasking without leaving the web browser, Vivaldi as your default choice should be exciting. - -In addition to this, Vivaldi seems to be taking good care of its privacy policies while offering in-built ad blockers and encrypted sync features. - -### Get Started Using Vivaldi on Manjaro Linux - -You should be able to find and install Vivaldi through official Manjaro repositories. - -If you want it by default, you can consider performing a fresh installation of Manjaro Linux Cinnamon. - -Manjaro Linux Cinnamon - -#### 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/vivaldi-replaces-firefox-manjaro/ - -作者:[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/best-browsers-ubuntu-linux/ -[2]: https://news.itsfoss.com/vivaldi-4-0-release/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyNCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMCIgd2lkdGg9IjY2MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://vivaldi.com -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYxOCIgd2lkdGg9IjY5NyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= diff --git a/sources/news/20210913 Fedora 35 Release Date and Expected New Features.md b/sources/news/20210913 Fedora 35 Release Date and Expected New Features.md deleted file mode 100644 index d46cffd7e6..0000000000 --- a/sources/news/20210913 Fedora 35 Release Date and Expected New Features.md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: subject: "Fedora 35 Release Date and Expected New Features" -[#]: via: "https://news.itsfoss.com/fedora-35-release-date-features/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Fedora 35 Release Date and Expected New Features -====== - -Fedora 35 is just around the corner. And, if you cannot wait already, let us highlight some of the essential details about the release. - -### Fedora 35 Release Date - -The expected release date for Fedora 35 beta is **14th September 2021**. But, if delayed, the next planned date is **21st September 2021**. - -After the public beta testing, the final release has been planned for **19th October 2021,** with a delayed date for **26th October 2021.** - -Of course, you can get your hands on Fedora 35 before the final and beta releases as well. But, considering it is just a few days away from its first beta release, you may want to wait it out. - -### Fedora 35 Features - -![][1] - -[Fedora 34][2] was an exciting release with GNOME 40 and a new i3 spin. And Fedora 35 is also shaping up as an interesting upgrade to it. - -Some of the fundamental changes that you can expect are: - -#### GNOME 41 - -GNOME 41 may not be a radical change when compared to [GNOME 40][3], but there are some visual improvements and valuable feature additions that you can expect. - -For instance, the GNOME Software will get a clean look and context tiles, resembling much like all the details that you can find in the [Apps for GNOME][4] portal. You should also find [VoIP support added to GNOME 41][5]. - -A new “**Connections**” app has been added to let you connect to other platforms/systems remotely. - -GNOME 41 has a planned release date of **September 22, 2021**. So, you may want to watch out for our coverage for the complete details when it releases. - -#### DNS Over TLS Support - -DNS Over TLS (DoT) is essential to encrypt DNS requests and prevent your ISP from spying. With Fedora 35, any configured DNS server should automatically attempt to connect using DoT if the DNS supports it. - -#### Default Btrfs Filesystem for Fedora Cloud - -While Fedora has already switched to the Btrfs filesystem since [Fedora 33][6], they enforce that change for the Cloud edition. - -#### Linux Kernel 5.14 - -[Linux Kernel 5.14][7] wasn’t a big release, but it added many features, especially when it comes to ARM devices. - -For Fedora 35, the improved hardware support should make a difference. - -#### Flathub Applications Included with Third-Party Repositories - -You also get some selected Flatpak applications added from a filtered Flathub remote when you enable third-party repositories. - -This should come in handy for better third-party app support in Fedora. - -#### PulseAudio Daemon Replaced by PipeWire - -While we saw initial implementations of replacing PulseAudio in Fedora 34, this time, there is a proposal to replace the PulseAudio daemon with a compatible implementation based on PipeWire. - -### Other Improvements - -Along with the key highlights mentioned above, you should find several under-the-hood changes and package updates that could translate as significant upgrades. - -For instance, the Firewalld package update and the GNU Toolchain update should prove to be valuable upgrades. - -You can explore more about the proposed changes in their [official changeset wiki][8]. - -### Wrapping Up - -It should be exciting to see the changes in the final release. For now, let us keep an eye out to test the public beta release. And, if you do not want to experiment on your system with a beta release, you should wait for the stable release. - -#### 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/fedora-35-release-date-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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://news.itsfoss.com/fedora-34-release/ -[3]: https://news.itsfoss.com/gnome-40-release/ -[4]: https://news.itsfoss.com/apps-for-gnome-portal/ -[5]: https://news.itsfoss.com/gnome-41-beta/ -[6]: https://itsfoss.com/fedora-33/ -[7]: https://news.itsfoss.com/kernel-5-14-release/ -[8]: https://fedoraproject.org/wiki/Releases/35/ChangeSet diff --git a/sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md b/sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md deleted file mode 100644 index dab9dde3ec..0000000000 --- a/sources/tech/20210626 Windows 11 System Requirement is Turning Heads. Time to migrate to Linux.md +++ /dev/null @@ -1,101 +0,0 @@ -[#]: subject: (Windows 11 System Requirement is Turning Heads. Time to migrate to Linux?) -[#]: via: (https://www.debugpoint.com/2021/06/windows-11-system-requirement/) -[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Windows 11 System Requirement is Turning Heads. Time to migrate to Linux? -====== -Microsoft announced Windows 11 at the official online event. Here’s in -this post we brief the Windows 11 system requirement and give you -thinking points on whether you should permanently migrate to Linux. -There are many debates and discussions going around after the announcement of Windows 11 from Microsoft. Many are “blown away” by the look and feel of the customization option that it brings, little they know that it might be “[inspired][1]” by other operating systems. - -![Windows 11 Desktop][2] - -Here’s a quick recap of visible features – - - * New Start Menu, Taskbar, and Search Bar - * New Animations are added while moving and dragging the windows. Even Opening a new window, closing, and minimize tap have different animation than earlier versions of Windows. - * Featured add to perform multitask with windows like split-screen, creating groups of various task windows, etc. - * Touch controls are improved significantly. - * New sounds are added in this version. After the release of Windows 10 in 2015, no significant changes were made in the sounds. But in Windows 11, you will see various new sound options. - * You will have access to dark mode also. - * Rounded Corners: Pointy corners will not be available in Windows 11. Corners of various bars will be made round. - * New icons are added which will make it more attractive than the earlier versions. - * Various new Widgets are added in this version. - * You can run Android apps via Windows 11 store - - - -### Windows 11 System Requirement - - * Processor – 1 gigahertz (GHz) or faster with 2 or more cores on a compatible 64-bit processor or System on a Chip (SoC) - * Memory – 4 GB RAM - * Storage – 64 GB or larger storage device - * System firmware – UEFI, Secure Boot capable - * TPM Trusted Platform Module (TPM) version 2.0 - * Graphics card DirectX 12 compatible graphics / WDDM 2.x -Display >9” with HD Resolution (720p) - * Internet connection Microsoft account and internet connectivity required for setup for Windows 11 Home - - - -Looking at the specification, you might have noticed a couple of interesting items. Windows 11 recommends your system should have TPM a.k.a Trusted Platform Module (TPM) version 2.0. Trusted Platform Module (TPM) technology is designed to provide hardware-based, security-related functions. A TPM chip is a secure crypto-processor that is designed to carry out cryptographic operations. The chip includes multiple physical security mechanisms to make it tamper-resistant, and malicious software is unable to tamper with the security functions of the TPM. - -And this is why Microsoft boasts about Windows 11 being more secure. - -Not all the hardware that is available today has a TPM chip. And worse is, many may force to buy new hardware as well. As a thumb rule, if you have bought any Laptop, Desktop 2017 onwards, you should be fine. - -[][1] - -SEE ALSO:   Windows 11 Look Inspired by KDE Plasma and GNOME? - -### Internet Required for set up? - -From an end-user perspective, this is not a good idea at all. This forces everyone to create a Microsoft account for the initial setup. Think about millions of users who probably buy Laptops for basic usage, and now they required to create an account, with OneDrive and other online “BS”. And you end up consuming more data, give away your data, and so on. - -This move is completely unnecessary from the Microsoft side. Internet connectivity should be optional and not mandatory for setting up your computer which you bought with a price. - -### Should you be moving to Linux? - -Yes, of course. Linux can run super-fast in all newer and older hardware. There are plenty of versions of the Linux operating system with a nice-looking desktop out there that you can easily install and use. You do not need to shell out additional money just to experience fancy Windows 11. - -Linux has many variants which cater to different people with a variety of tastes. You do not need to settle for only one look and feel and functionality. You have the freedom to choose. - -You do not need to buy expensive Antivirus which is recommended for Windows operating system. Linux doesn’t get a virus that easily as it is designed in a different way, and not that popular. So, you are protected on that front and save more money. - -Linux updates are much faster due to stability and the small size of updates. Hence you save money on your data plan as well. - -And, you save thousands of hours by not looking at this: - -![The Never ending wait which becomes part of your life][3] - -### Closing Notes - -Benchmarking a certain set of hardware as “old” is completely subjective in terms of software. You can easily run Debian, or Lubuntu in ten-year-old or more hardware for basic tasks. If someone tells you that your hardware is old, doesn’t make it so. Windows 11 may compel some users to think about their personal hardware strategy in the longer term. It is a market leader in the Desktop operating system and it is a business model for them and OEMs. Fair enough. But if you are a Windows user and reading this, I would recommend you to start experimenting with simple and friendly Linux distributions such as [Linux Mint][4], right now. So that you have options to choose from and have control over your spending in the longer run. - -Cheers. - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/06/windows-11-system-requirement/ - -作者:[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/windows-11-inspiration-linux-kde-plasma/ -[2]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/Windows-11-Desktop-1024x575.jpg -[3]: https://www.debugpoint.com/blog/wp-content/uploads/2021/06/The-Never-ending-wait-which-becomes-part-of-your-life.jpg -[4]: https://www.debugpoint.com/2021/02/cinnamon-arch-linux-install/ diff --git a/sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md b/sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md deleted file mode 100644 index 50c7bd5414..0000000000 --- a/sources/tech/20210711 Ubuntu 21.10 Impish Indri - New Features and Release Date.md +++ /dev/null @@ -1,166 +0,0 @@ -[#]: subject: (Ubuntu 21.10 Impish Indri – New Features and Release Date) -[#]: via: (https://www.debugpoint.com/2021/07/ubuntu-21-10/) -[#]: author: (Arindam https://www.debugpoint.com/author/admin1/) -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Ubuntu 21.10 Impish Indri – New Features and Release Date -====== -Final release of 2021, Ubuntu 21.10 Impish Indri development is in -progress. In this post, we sum up the new features known so far and -planned release dates. -This post includes information about ongoing development. The information may change frequently, and this page is regularly updated until the final release. - -This page contains the following topics – - - * [Ubuntu 21.10 – Code name history][1] - * [New Features in desktop flavor][2] - * [Ubuntu Official flavor information][3] - * [Release schedule][4] - * [Daily-build .ISO download][5] - * [Canary build .ISO download][6] - - - -Before we list out the features, you should remember that, we are at a very early stage of the development considering October as of publishing this. And the final pieces may change as we move closer to the final release. - -Historically, October releases are somewhat quieter but impactful. They create the base for next LTS in every alternate year. So having said that, this is an important release due to many factors. - -### The Code Name - -Following the trend, Ubuntu 21.10 is code named “impish indri” as we are at “I” based names. The “Indri” refers to _“babakoto, is one of the largest living lemurs, with a head-and-body length of about 64–72 cm and a weight of between 6 to 9.5 kg. It has a black and white coat and maintains an upright posture when climbing or clinging” (from Wikipedia)_. Well, the final mascot is yet to be revealed. - -So, all the packages and repo is tagged with “impish” for this version of Ubuntu. - -Let’s take a look at other new features. - -### Ubuntu 21.10 New Features - -![Ubuntu 21.10 Desktop \(daily build\)][7] - - * Ubuntu 21.10 would feature **Linux Kernel 5.14**. This is currently in development and will be released before the feature freeze. - - - * If you are wondering of about GNOME, well yes, Ubuntu 21.10 features [GNOME 40 desktop][8] – but with a twist. The **GNOME 40** version brings some fundamental changes to GNOME desktop, which you are already aware of by now. But with the usual left fixed dock! So, the customized GNOME 40 with left fixed doc, eliminates the bottom dock of vanilla GNOME 40. - - - * So, initially it would feel a bit strange with have **left fixed dock** with horizontal workspaces, overview and scrolling. But it would be interesting to observe user reactions and feedback once it releases. - - - * Version wise, this release would feature **GNOME 40.3** (it’s due by July 2021). - - - * A brand **new Desktop Installer** which would replace the decade old Ubiquity. This is created in collaboration with Google in Flutter and gives a nice and easy way of installing Ubuntu. We covered more about this installer in detail when it was launched. You can read the coverage [here][9]. - - - -![New Installer – Ubuntu 21.10][10] - - * The new installer is still in Canary build and not arrived in daily build as of publishing this. And when I tested, it has many bugs which are simple ones. I hope they would be sorted out before final release. - - - * The default theme would be set to **Yaru Light**. As per the Ubuntu team, it is difficult to maintain a mixed theme with both and dark and light together. - - - * In the prior Ubuntu 21.04, the Wayland display server is made default. In this release, **NVIDIA** driver users also would be able to Wayland, hopefully. - - - * With the **wallpaper** competition is back, we expect a stunning default wallpaper with “Indri” mascot. Already there are beautiful wallpapers submitted by the community, and they look promising. - - - * The applications and packages sees their respective version upgrades in this release. Here’s a quick summary. - - - 1. Firefox 89 - 2. LibreOffice 7.1 (I am still hopeful whether [LibreOffice 7.2][11] is an option) - 3. Thunderbird 78.12 - - - -### Official Flavors - -The official Ubuntu desktop flavors would have their respective version upgrades. Here’s a quick update. - - * Xubuntu with Xfce 4.16 - * Ubuntu MATE with MATE 1.24 - * Kubuntu with KDE Plasma 5.22 (I don’t think Plasma 5.23 would be ready before BETA) - - - -### Ubuntu 21.10 Release Date - -Ubuntu 21.10 releases on October 14, 2021. Here is the schedule of this release. - - * **Feature Freeze**: August 19, 2021 - * **Beta Release**: September 23, 2021 - * **Final Releas**e: October 14, 2021 - - - -### Daily Build Downloads for Ubuntu 21.10 - -Default desktop image .ISO for daily build is available in below link. The following images are unstable so, do not use this as your serious work. Try for testing only. - -[download ubuntu 21.10 daily build – GNOME][12] - -#### Other flavors - -Ubuntu Flavor | Link for Daily build .iso image (64 bit) ----|--- -Ubuntu 21.10 Desktop (GNOME) | -Xubuntu 21.10 | -Ubuntu MATE 21.10 | -Ubuntu Kylin 21.10 | -Lubuntu 21.10 | -Kubuntu 21.10 | -Ubuntu Budgie 21.10 | - -### Untested Canary build - -The daily canary build can be downloaded from the below link. This is super unstable and did not pass automatic testing. So, unless absolutely necessary, do not use this .iso. - - - -### Closing Notes - -I am specifically interested on the new desktop installer. Because it gives a repair option and a brand-new way of installing Ubuntu. We know there are many powerful installers out there like Calamares – but it would be interesting to see Ubuntu’s new Flutter based app. And the adaptation of GNOME 40 is really a thing to observe with more users. - -I will keep this post updated with the latest info when available with details. - - * _[Official change log and schedule][13]_ - * _[Launchpad source][14]_ - - - -* * * - --------------------------------------------------------------------------------- - -via: https://www.debugpoint.com/2021/07/ubuntu-21-10/ - -作者:[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]: tmp.Bd5zVlb4BJ#code-name -[2]: tmp.Bd5zVlb4BJ#new-features -[3]: tmp.Bd5zVlb4BJ#official-flavors -[4]: tmp.Bd5zVlb4BJ#release-schedule -[5]: tmp.Bd5zVlb4BJ#daily-build-download -[6]: tmp.Bd5zVlb4BJ#canary-build-download -[7]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/Ubuntu-21.10-Desktop-daily-build-1024x535.jpeg -[8]: https://www.debugpoint.com/2021/03/gnome-40-release/ -[9]: https://www.debugpoint.com/2021/02/new-ubuntu-desktop-installer/ -[10]: https://www.debugpoint.com/blog/wp-content/uploads/2021/07/New-Installer-Ubuntu-21.10.jpeg -[11]: https://www.debugpoint.com/2021/05/libreoffice-7-2/ -[12]: https://cdimage.ubuntu.com/daily-live/current/ -[13]: https://discourse.ubuntu.com/t/impish-indri-release-schedule/18540 -[14]: https://launchpad.net/ubuntu/impish diff --git a/sources/tech/20210915 Build a data sharding service with DistSQL.md b/sources/tech/20210915 Build a data sharding service with DistSQL.md deleted file mode 100644 index 3daabaef4d..0000000000 --- a/sources/tech/20210915 Build a data sharding service with DistSQL.md +++ /dev/null @@ -1,378 +0,0 @@ -[#]: subject: "Build a data sharding service with DistSQL" -[#]: via: "https://opensource.com/article/21/9/distsql" -[#]: author: "Meng Haoran https://opensource.com/users/haoran-meng" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Build a data sharding service with DistSQL -====== -Database sharding demonstrates the additional functionality of DistSQL. -![Person standing in front of a giant computer screen with numbers, data][1] - -If you're reading this, then you're probably familiar with the data query and programming language, SQL (Structured Query Language). It's also used as the standard language for management systems for accessing data, querying, updating, and managing relational database systems. Like standard SQL, DistSQL, or Distributed SQL, it is a built-in SQL language unique to ShardingSphere that provides incremental functional capabilities beyond standard SQL. Leveraging ShardingSphere's powerful SQL parsing engine, DistSQL provides a syntax structure and syntax validation system like that of standard SQL, making DistSQL more flexible while maintaining regularity. ShardingSphere's Database Plus concept aims at creating an open source distributed database system that is both functional and relevant to the actual database business. DistSQL is built on top of the traditional database to provide SQL capabilities that are both standards-compliant and feature ShardingSphere's functionality to enhance conventional database management. - -### Original design intention of DistSQL - -Over its years of rapid development, ShardingSphere has become unique in the database middleware space as the kernel has gradually stabilized, and the core functionality has continuously been honed. As an open source leader in Asia, ShardingSphere keeps pursuing its exploration of a distributed database ecosystem. Redefining the boundary between middleware and database to allow developers to leverage Apache ShardingSphere as if they were using a database natively is DistSQL's design goal. It is also an integral part of ShardingSphere's ability to transform from a developer-oriented framework and middleware to an operations-oriented infrastructure product. - -### DistSQL syntax system - -DistSQL has been designed from the outset to be standards-oriented, considering the habits of both database developers and operators. The syntax of DistSQL is based on the standard SQL language, maintaining readability and ease of use while retaining the maximum amount of ShardingSphere's own features and providing the highest possible number of customization options for users to cope with different business scenarios. - -Developers familiar with SQL and ShardingSphere can get started quickly. - -Standard SQL provides different types of syntaxes such as DQL, DDL, DML, DCL, etc., to define various functional SQL statements. DistSQL defines a syntax system of its own, as well. - -In ShardingSphere, the DistSQL syntax is currently divided into three main types: RDL, RQL, and RAL. - - * RDL (Resource & Rule Definition Language) - Resource rule definition language for creating, modifying, and deleting resources and rules. - * RQL (Resource & Rule Query Language) - Resource rule query language for querying and presenting resources and rules. - * RAL (Resource & Rule Administrate Language) - Resource rule administration language for incremental functional operations such as hint, transaction type switching, and query of a sharding execution plan. - - - -DistSQL's syntax builds a bridge for ShardingSphere to move towards a distributed database. It is still being improved as more ideas are implemented, so DistSQL will become increasingly powerful. Developers who are interested are welcome to join ShardingSphere and contribute ideas and code to DistSQL. - -For more detailed syntax rules, please refer to the official [documentation][2]. - -For the project's community, please refer to the official [Slack channel][3]. - -### DistSQL in practice - -Having understood the design concept and syntax system of DistSQL, let's demonstrate how to build a data sharding service based on ShardingSphere. - -#### Environment preparation - - * Start MySQL services - * Create a MySQL database for sharding - * Start the Zookeeper service - * Turn on the distributed governance configuration and start [ShardingSphere-Proxy][4] - - - -#### Practical demonstration - -1\. Connect to the launched ShardingSphere-Proxy using the MySQL command line. - -2\. Create and query the distributed database `sharding_db`: - - -``` -mysql> CREATE DATABASE sharding_db; -Query OK, 0 ROWS affected (0.04 sec) - -mysql> SHOW DATABASES; -+-------------+ -| SCHEMA_NAME | -+-------------+ -| sharding_db | -+-------------+ -1 ROW IN SET (0.04 sec) -``` - -3\. Use the newly created database: - - -``` -mysql> USE sharding_db; -No connection. Trying TO reconnect... -Connection id: 2 -CURRENT DATABASE: *** NONE *** - -DATABASE changed -``` - -4\. Execute RDL to configure two data source resources, `ds_1` and `ds_2`, for sharding: - - -``` -mysql> ADD RESOURCE ds_1 ( -    -> HOST=127.0.0.1, -    -> PORT=3306, -    -> DB=ds_1, -    -> USER=root, -    -> PASSWORD=root123456 -    -> ); -Query OK, 0 ROWS affected (0.53 sec) - -mysql> -mysql> ADD RESOURCE ds_2 ( -    -> HOST=127.0.0.1, -    -> PORT=3306, -    -> DB=ds_2, -    -> USER=root, -    -> PASSWORD=root123456 -    -> ); -Query OK, 0 ROWS affected (0.02 sec) -``` - -5\. Execute RQL to query the newly added data source resources: - - -``` -    mysql> SHOW RESOURCES FROM sharding_db; -    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -    | name | TYPE  | host      | port | db   | attribute                                                                                                                                                   | -    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -    | ds_1 | MySQL | 127.0.0.1 | 3306 | ds_1 | {"maxLifetimeMilliseconds":1800000,"readOnly":FALSE,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} | -    | ds_2 | MySQL | 127.0.0.1 | 3306 | ds_2 | {"maxLifetimeMilliseconds":1800000,"readOnly":FALSE,"minPoolSize":1,"idleTimeoutMilliseconds":60000,"maxPoolSize":50,"connectionTimeoutMilliseconds":30000} | -    +------+-------+-----------+------+------+-------------------------------------------------------------------------------------------------------------------------------------------------------------+ -    2 ROWS IN SET (0.13 sec) -``` - -6\. Execute RDL to create a sharding rule for the `t_order` table: - - -``` -mysql> CREATE SHARDING TABLE RULE t_order( -    -> RESOURCES(ds_1,ds_2), -    -> SHARDING_COLUMN=order_id, -    -> TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)), -    -> GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123))) -    -> ); -Query OK, 0 ROWS affected (0.06 sec) -``` - -7\. Execute RQL to query the sharding rules: - - -``` -    mysql> SHOW SHARDING TABLE RULES FROM sharding_db; -    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+ -    | TABLE   | actualDataNodes | actualDataSources | databaseStrategyType | databaseShardingColumn | databaseShardingAlgorithmType | databaseShardingAlgorithmProps | tableStrategyType | tableShardingColumn | tableShardingAlgorithmType | tableShardingAlgorithmProps | keyGenerateColumn | keyGeneratorType | keyGeneratorProps | -    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+ -    | t_order |                 | ds_1,ds_2         |                      |                        |                               |                                | hash_mod          | order_id            | hash_mod                   | sharding-COUNT=4            | order_id          | snowflake        | worker-id=123     | -    +---------+-----------------+-------------------+----------------------+------------------------+-------------------------------+--------------------------------+-------------------+---------------------+----------------------------+-----------------------------+-------------------+------------------+-------------------+ -    1 ROW IN SET (0.01 sec) -``` - -In addition to querying all sharding rules under the current database, RQL can also query individual tables for sharding rules with the following statement: - -`SHOW SHARDING TABLE RULE t_order FROM sharding_db` - -Creating and querying the `t_order` sharding table: - - -``` -mysql> CREATE TABLE `t_order`( -    -> `order_id` INT NOT NULL, -    -> `user_id` INT NOT NULL, -    -> `status` VARCHAR(45) DEFAULT NULL, -    -> PRIMARY KEY (`order_id`) -    -> )ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -Query OK, 0 ROWS affected (0.28 sec) - -mysql> SHOW TABLES; -+-----------------------+ -| Tables_in_sharding_db | -+-----------------------+ -| t_order               | -+-----------------------+ -1 ROW IN SET (0.01 sec) -``` - -After successfully creating the sharding table `t_order` on the ShardingSphere-Proxy side, ShardingSphere automatically creates the sharding table based on the sharding rules of the `t_order` table by connecting to the underlying databases `ds_1` and `ds_2` via the client-side. - - -``` -mysql> USE ds_1; -DATABASE changed -mysql> SHOW TABLES; -+----------------+ -| Tables_in_ds_1 | -+----------------+ -| t_order_0      | -| t_order_2      | -+----------------+ -2 ROWS IN SET (0.01 sec) - -[/code] [code] - -mysql> USE ds_2; -DATABASE changed -mysql> SHOW TABLES; -+----------------+ -| Tables_in_ds_2 | -+----------------+ -| t_order_1      | -| t_order_3      | -+----------------+ -2 ROWS IN SET (0.00 sec) -``` - -Once the sharding table is created, continue to execute the SQL statement on the ShardingSphere-Proxy side to insert the data: - - -``` -mysql> INSERT INTO t_order VALUES(1, 1, 'ok'); -Query OK, 1 ROW affected (0.06 sec) - -mysql> INSERT INTO t_order VALUES(2, 2, 'disabled'); -Query OK, 1 ROW affected (0.00 sec) - -mysql> INSERT INTO t_order VALUES(3, 3, 'locked'); -Query OK, 1 ROW affected (0.01 sec) - -mysql> SELECT * FROM t_order; -+----------+---------+----------+ -| order_id | user_id | STATUS   | -+----------+---------+----------+ -|        1 |       1 | ok       | -|        2 |       2 | disabled | -|        3 |       3 | locked   | -+----------+---------+----------+ -3 ROWS IN SET (0.06 sec) -``` - -Query the execution plan via RAL: - - -``` -mysql> preview SELECT * FROM t_order; -+-----------------+------------------------------------------------+ -| datasource_name | SQL                                            | -+-----------------+------------------------------------------------+ -| ds_1            | SELECT * FROM t_order_0 ORDER BY order_id ASC  | -| ds_1            | SELECT * FROM t_order_2 ORDER BY order_id ASC  | -| ds_2            | SELECT * FROM t_order_1 ORDER BY order_id ASC  | -| ds_2            | SELECT * FROM t_order_3 ORDER BY order_id ASC  | -+-----------------+------------------------------------------------+ -4 ROWS IN SET (0.02 sec) -``` - -This completes the ShardingSphere data sharding service using DistSQL. Compared to the previous version of the ShardingSphere proxy, which was profile-driven, DistSQL is more developer-friendly and flexible in managing resources and rules. Moreover, the SQL-driven approach enables seamless interfacing between DistSQL and standard SQL. - - -``` -schemaName: sharding_db -dataSources: -  ds_0: -    url: jdbc:mysql://127.0.0.1:3306/ds_1?serverTimezone=UTC&useSSL=false -    username: root -    password: root123456 -    connectionTimeoutMilliseconds: 30000 -    idleTimeoutMilliseconds: 60000 -    maxLifetimeMilliseconds: 1800000 -    maxPoolSize: 50 -    minPoolSize: 1 -  ds_1: -    url: jdbc:mysql://127.0.0.1:3306/ds_2?serverTimezone=UTC&useSSL=false -    username: root -    password: root123456 -    connectionTimeoutMilliseconds: 30000 -    idleTimeoutMilliseconds: 60000 -    maxLifetimeMilliseconds: 1800000 -    maxPoolSize: 50 -    minPoolSize: 1 -rules: -\- !SHARDING -  tables: -    t_order: -      actualDataNodes: ds_${0..1}.t_order_${0..1} -      tableStrategy: -        standard: -          shardingColumn: order_id -          shardingAlgorithmName: t_order_inline -      keyGenerateStrategy: -        column: order_id -        keyGeneratorName: snowflake -    t_order_item: -      actualDataNodes: ds_${0..1}.t_order_item_${0..1} -      tableStrategy: -        standard: -          shardingColumn: order_id -          shardingAlgorithmName: t_order_item_inline -      keyGenerateStrategy: -        column: order_item_id -        keyGeneratorName: snowflake -  bindingTables: -   - t_order,t_order_item -  defaultDatabaseStrategy: -    standard: -      shardingColumn: user_id -      shardingAlgorithmName: database_inline -  defaultTableStrategy: -    none: - -  shardingAlgorithms: -    database_inline: -      type: INLINE -      props: -        algorithm-expression: ds_${user_id % 2} -    t_order_inline: -      type: INLINE -      props: -        algorithm-expression: t_order_${order_id % 2} -    t_order_item_inline: -      type: INLINE -      props: -        algorithm-expression: t_order_item_${order_id % 2} -  keyGenerators: -    snowflake: -      type: SNOWFLAKE -      props: -        worker-id: 123 - -[/code] [code] - -1\. CREATE a distributed DATABASE -CREATE DATABASE sharding_db; - -2\. ADD DATA resources -ADD RESOURCE ds_1 ( -HOST=127.0.0.1, -PORT=3306, -DB=ds_1, -USER=root, -PASSWORD=root123456 -); -ADD RESOURCE ds_2 ( -HOST=127.0.0.1, -PORT=3306, -DB=ds_2, -USER=root, -PASSWORD=root123456 -); - -3\. CREATE sharding rules -CREATE SHARDING TABLE RULE t_order( -RESOURCES(ds_1,ds_2), -SHARDING_COLUMN=order_id, -TYPE(NAME=hash_mod,PROPERTIES("sharding-count"=4)), -GENERATED_KEY(COLUMN=order_id,TYPE(NAME=snowflake,PROPERTIES("worker-id"=123))) -); -``` - -In the above example, only a small part of the DistSQL syntax is demonstrated. In addition to creating and querying resources and rules via `CREATE` and `SHOW` statements, DistSQL also provides additional operations such as `ALTRE DROP` and supports configuration control of data sharding's core functions, read and write separation, data encryption, and database discovery. - -### Conclusion - -As one of the new features released in Apache ShardingSphere's 5.0.0-beta, DistSQL will continue to build on this release to improve syntax and increasingly powerful functions. DistSQL has opened up endless possibilities for ShardingSphere to explore the distributed database space. In the future, DistSQL will be used as a link to connect more functions and provide one-click operations. - -For example, it'll allow the analysis of the overall database status with one click, connect with elastic migration, provide one-click data expansion and shrinkage, and connect with control to realize one-click master-slave switch and change database status. Open source and JavaScript enthusiasts are warmly welcomed to join the Slack community or check the project's GitHub page to learn more about ShardingSphere's latest developments. - -* * * - -_This article is adapted from the author's [original publication][5]._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/distsql - -作者:[Meng Haoran][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/haoran-meng -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://shardingsphere.apache.org/document/current/en/features/dist-sql/syntax/ -[3]: https://join.slack.com/t/apacheshardingsphere/shared_invite/zt-sbdde7ie-SjDqo9~I4rYcR18bq0SYTg -[4]: https://shardingsphere.apache.org/document/current/cn/quick-start/shardingsphere-proxy-quick-start/ -[5]: https://shardingsphere.apache.org/blog/en/material/jul_26_an_introduction_to_distsql/ From a8fe94b7eb8aa659262bac6bd36ad6e5bced9d41 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Sep 2021 09:14:28 +0800 Subject: [PATCH 0431/1588] PRF @anine09 --- ...i Zero vs Zero W- What-s the Difference.md | 48 +++++++++---------- 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md b/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md index 0443563607..339e80209c 100644 --- a/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md +++ b/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md @@ -3,74 +3,70 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "anine09" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -树莓派 Zero 与 Zero W:多方位对比 +树莓派 Zero 与 Zero W 对比 ====== +树莓派十年前凭借 25 美元的迷你电脑掀起了一场革命。随着时间的推移,树莓派发布了许多变种。有些是对以前的型号进行升级,有些是为特定目的而制作的。 +在所有的树莓派模块中,Pi Zero 和 Pi Zero W 是最便宜的型号,旨在用于小规模项目和 IoT 项目。这两种设备几乎是相同的,但是它们之间有一些微妙而重要的区别。 -树莓派十年前凭借 25 美元的迷你电脑掀起了一场革命。在这段时间里,树莓派发布了许多分支系列。也将一些为特定目的而设计的模块进行了一些升级。 +**那么,树莓派 Zero 和 Zero W 之间的区别是什么?Zero W 中的 W 代表的是无线Wireless,它表示的是 Zero W 模块拥有无线功能。这是这两个相似模块之间的最大差异。** -在所有的树莓派模块中,Pi Zero 和 Pi Zero W 是旨在为小规模项目和 IoT 项目设计的最便宜的模块。这两种设备几乎是相同的,但是它们之间有一些微妙而重要的区别。 - - -**那么,树莓派 Zero 和 Zero W 之间的区别是什么?Zero W 中的 W 代表的是无线(Wireless),它表示的是 Zero W 模块拥有无线功能。这是这两个相似模块之间的最大差异** - -让我们更详细地看看其他细节吧。 +让我们来详细了解一下。 ### Pi Zero 与 Pi Zero W 之间的主要不同点 + ![][1] -虽然 树莓派 Zero 是以在只有 A+ 板一半的大小上提供尽可能多的功能为目标。 +树莓派 Zero 是以在只有 A+ 板一半的大小上提供尽可能多的功能为目标。 -而且,树莓派 Zero W 在不需要任何附加的组件和模块的情况下就可以使用蓝牙和 Wifi。 +而树莓派 Zero W 是为了支持无线在后来推出的,在不需要任何附加的组件和模块的情况下就可以使用蓝牙和 Wi-Fi。 -这是两者之间的区别,其他的部分都是相同的。 +这是两者之间的关键区别,其他的规格保持一致。 所以,如果你需要以下功能: * 802.11 b/g/n 无线网口 * 蓝牙 4.1 - * 低功耗的蓝牙模块(BLE:Bluetooth Low Energy) + * 低功耗蓝牙(BLE) 树莓派 Zero W 将是你的不二之选。 -此外,树莓派 Zero W 提供了一种带引脚的版本,叫做 “树莓派 Pi Zero WH” +此外,树莓派 Zero W 还提供了一种带引脚的版本,叫做 “树莓派 Pi Zero WH” ### 树莓派 Zero 和 Zero W 的规格 ![Raspberry Pi Zero W][6] -[树莓派 Zero 和 Zero W 的规格][7]几乎是一样的。 +[树莓派 Zero 和 Zero W 的规格][7] 几乎是一样的。 -它们都具有 1 GHz 的单核 CPU 和 512 MB 的 RAM。至于接口方面,一个 mini HDMI 接口,支持 micro USB OTG,micro USB 供电和一个 CSI 摄像头接口(需要插入一个相机模块)。 +它们都具有 1 GHz 的单核 CPU 和 512 MB 的 RAM。至于接口方面,一个 mini HDMI 接口,支持 micro USB OTG、micro USB 供电和一个 CSI 摄像头接口(用于插入一个相机模块)。 -这些板子会提供一种叫 [HAT][8](Hardware Attached on Top,顶部附加硬件),兼容 40个引脚,当通常情况下,没有这些引脚你能更容易的使用接口。 +这些板子会提供一种叫 [HAT][8](顶部附加硬件Hardware Attached on Top)兼容的 40 个引脚。但一般情况下,没有这些可以让你轻松插入接口的引脚。 -你可以根据自己的功能需要选择使用[各种树莓派兼容的系统][9],但无论哪种情况,我还是推荐你使用 Raspberry Pi OS。 +你可以根据自己的功能需要选择使用 [各种树莓派兼容的系统][9],但无论哪种情况,我还是推荐你使用树莓派 OS。 ### 树莓派 Zero 系列值不值得买? ![Raspberry Pi Zero][10] -树莓派 Zero 是一种很受人们喜欢的单片机形式,尽管你有很多树莓派 Zero 的替代品,树莓派 Zero 仍然是最推荐的选择。 +树莓派 Zero 是一种很受人们喜欢的单片机形式,即使你有很多树莓派 Zero 的替代品,树莓派 Zero 仍然是最推荐的选择。 当然,除非你有特殊需求。 -另外,对于同水平的单片机规模,定价,功率要求,运算能力而言,树莓派 Zero 最亮眼的地方就是它低于 **20 美元**的价格。 +除了板子的尺寸之外,定价、功率要求、运算能力也是这款 20 美元以下的板子的主要亮点。 -因此,如果你正在寻找预算中满足基本功能的单片机,树莓派 Zero 就是专门为你打造的。 - -### Is Raspberry Pi Zero series affordable? +因此,如果你正在寻找预算内满足基本功能的单片机,树莓派 Zero 就是专门为你打造的。 ### 树莓派 Zero 系列价格怎么样? -树莓派 Zero 售价 **5 美元** ,Zero W 售价 **10 美元左右**,当然,在不同的地方,定价规则会不一样,如果你选择树莓派 Zero W 带 引脚的版本,售价大概是 **14 美元**左右。 +树莓派 Zero 售价 **5 美元** ,Zero W 售价 **10 美元左右**,当然,根据其供应情况和地区,定价规则会不一样,如果你选择带引脚的版本树莓派 Zero WH ,售价大概是 **14 美元** 左右。 -还有[其他的设备可以代替树莓派 Zero][11],它们价格也相差不大。 +还有 [其他的设备可以代替树莓派 Zero][11],它们价格也相差不大。 -------------------------------------------------------------------------------- @@ -79,7 +75,7 @@ via: https://itsfoss.com/raspberry-pi-zero-vs-zero-w/ 作者:[Ankush Das][a] 选题:[lujun9972][b] 译者:[anine09](https://github.com/anine09) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 77732e0c37f696c61d2c8bcdb49aef58b9eba461 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Sep 2021 09:15:33 +0800 Subject: [PATCH 0432/1588] PUB @anine09 https://linux.cn/article-13799-1.html --- ...0915 Raspberry Pi Zero vs Zero W- What-s the Difference.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md (98%) diff --git a/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md b/published/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md similarity index 98% rename from translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md rename to published/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md index 339e80209c..b7b68fd5ce 100644 --- a/translated/tech/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md +++ b/published/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "anine09" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13799-1.html" 树莓派 Zero 与 Zero W 对比 ====== From fc7d3de092750c5ed13f58faaabe9d8b9872c663 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 19 Sep 2021 10:08:51 +0800 Subject: [PATCH 0433/1588] PUB @geekpi https://linux.cn/article-13800-1.html --- ...rce community health analytics platform.md | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) rename {translated/tech => published}/20210910 Building an open source community health analytics platform.md (59%) diff --git a/translated/tech/20210910 Building an open source community health analytics platform.md b/published/20210910 Building an open source community health analytics platform.md similarity index 59% rename from translated/tech/20210910 Building an open source community health analytics platform.md rename to published/20210910 Building an open source community health analytics platform.md index a47c94bb03..fb77032618 100644 --- a/translated/tech/20210910 Building an open source community health analytics platform.md +++ b/published/20210910 Building an open source community health analytics platform.md @@ -3,38 +3,38 @@ [#]: author: "Quinn Foster https://opensource.com/users/quinn-foster" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13800-1.html" 构建开源的社区健康分析平台 ====== -一个学术性的 OSPO 正在与 CHAOSS 软件合作以建立一个社区健康分析平台。 -![metrics and data shown on a computer screen][1] -罗切斯特理工学院(RIT)最近在增加其在开源世界的存在方面取得了相当大的进展。例如,其开源项目办公室,Open@RIT,已经开始帮助 RIT 的教职员工为他们的开源项目建立和维护社区。 +> 一个学术性的 OSPO 正在与 CHAOSS 软件合作,以建立一个社区健康分析平台。 -这些进展是由 RIT 的学生、教师和工作人员推动的。目前,大学里已经有越来越多的人在领导他们自己的开放项目。然而,运行一个完全的开源项目可能是很麻烦的。这主要来自于维护项目的社区和管理数据,如项目的代码、问题跟踪和仓库。 +![](https://img.linux.net.cn/data/attachment/album/202109/19/100755mlngkwvvwjjlblgn.png) -为了帮助这些人,Open@RIT 正在创建一个名为 Mystic 的系统,这是一个社区健康分析平台,利用了 [GrimoireLab][2],这是一个由 [CHAOSS][3] 软件开发的开源工具包,为开源项目提供指标和分析。GrimoireLab 允许用户收集、丰富、过滤和可视化一个项目的数据,例如一个报告的问题被解决的时间、贡献者的关系等。 +罗切斯特理工学院Rochester Institute of Technology(RIT)最近在增加其在开源世界的影响力方面取得了相当大的进展。RIT的自由和开源软件及自由文化辅修课程是学术界的第一个此类课程。例如,其开源项目办公室 Open@RIT 已经开始帮助 RIT 的教职员工和研究员为他们的开源项目建立和维护社区。 + +这些进展是由 RIT 的学生、教师和工作人员推动的。目前,大学里已经有越来越多的人在管理他们自己的开源项目。然而,运行一个完全的开源项目可能是很麻烦的。这主要来自于维护项目的社区和管理数据,如项目的代码、问题跟踪和仓库。 + +为了帮助他们,Open@RIT 正在创建一个名为 Mystic 的系统,这是一个社区健康分析平台,利用了 [GrimoireLab][2],这是一个由 [CHAOSS][3] 软件开发的开源工具包,为开源项目提供了指标和分析。GrimoireLab 允许用户收集、丰富、过滤和可视化一个项目的数据,例如一个报告的问题被解决的时间、贡献者的关系等。 Mystic 将作为一个前端门户,任何人都可以提交他们的项目。在那里,项目将被直接发送到 GrimoireLab,它将在几分钟后为提交者计算并发布项目的指标。 > Open@RIT 的全栈开发者和 Mystic 的首席开发者 Emi Simpson 说:“我们希望 RIT 的任何管理、领导或参与开源项目的人都能将该项目提交给 Mystic,并获得他们需要的任何指标”。 -这个过程很简单。登录 Mystic 后,上传项目的用户会打开一个弹出式窗口,输入项目的细节和数据源的链接,如 GitLab、RSS feed 和一个开放软件基金会(OSF)项目。一旦细节和项目被保存下来,Mystic 就会使用 GrimoireLab 从项目源中自动检索指标,并为每个源渲染图表。然后,该项目及其指标将显示在它自己的仪表板上。 +这个过程很简单。登录 Mystic 后,上传项目的用户会打开一个弹出式窗口,输入项目的细节和数据源的链接,如 GitLab、RSS feed 和一个开放软件基金会Open Software Foundation(OSF)项目名。一旦保存了细节和项目,Mystic 就会使用 GrimoireLab 从项目源中自动检索指标,并为每个源渲染图表。然后,该项目及其指标将显示在它自己的仪表板上。 ![Mystic statistics page][4] -Screenshot by Quinn Foster,[CC-BY SA 4.0][5] +这些仪表盘将并列显示在一个页面上,以供其他人查看,鼓励 RIT 内部的开源社区之间的合作开发和互动。Simpson 和 Open@RIT 希望这将增加 RIT 的开放工作的参与度,并进一步巩固该大学作为开放工作中心的地位。 -这些仪表盘将并列显示在一个页面上,以供其他人查看,鼓励全世界 RIT 内部的开源社区之间的合作开发和互动。Simpson 和 Open@RIT 希望这将增加 RIT 的开放工作的参与度,并进一步巩固该大学作为开放工作中心的地位。 - -> Simpson 说:“如果有人问 RIT 在为开源软件做什么,我希望人们能够指着 Mystic 和 GrimoireLab 说就是这些。通过建立‘这些’是我们正在做的,这些是我们的贡献,这些是人们正在做的项目的指标,我们可以在 RIT 建立一个以我们正在做的开源工作为中心的社区。” +> Simpson 说:“如果有人问 RIT 在为开源软件做什么,我希望人们能够指着 Mystic 和 GrimoireLab 说就是这些。通过建立‘这些是我们正在做的,这些是我们的贡献,这些是人们正在做的项目’的指标,我们可以在 RIT 建立一个以我们正在做的开源工作为中心的社区。” 目前,Mystic 仍在开发中,还没有准备好进入生产环境,但它对 RIT 和整个开源的潜力仍然是有目共睹的。未来的目标包括实现与大学报告工具的轻松整合,以及在项目层面和总体上的综合仪表盘。 -你对 Mystic 的贡献感兴趣吗?[请与我们联系][6]开始吧。 +你对 Mystic 的贡献感兴趣吗?[请与我们联系][6] 开始吧。 -------------------------------------------------------------------------------- @@ -43,7 +43,7 @@ via: https://opensource.com/article/21/9/openrit-mystic 作者:[Quinn Foster][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 fc48be21a394f84b34034270150725bf2692ec2c Mon Sep 17 00:00:00 2001 From: perfiffer Date: Sun, 19 Sep 2021 21:58:06 +0800 Subject: [PATCH 0434/1588] updating by perfiffer --- .../talk/20210424 Can We Recommend Linux for Gaming in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md b/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md index 665199a720..62b1942df3 100644 --- a/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md +++ b/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/linux-for-gaming-opinion/) [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (perfiffer) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 39d269fcd716b630cbb713d4eb150406d7106b8d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Sep 2021 16:38:03 +0800 Subject: [PATCH 0435/1588] PRF&PUB: @geekpi https://linux.cn/article-13802-1.html --- ...Recording in Linux With OBS and Wayland.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20210915 Screen Recording in Linux With OBS and Wayland.md (79%) diff --git a/translated/tech/20210915 Screen Recording in Linux With OBS and Wayland.md b/published/20210915 Screen Recording in Linux With OBS and Wayland.md similarity index 79% rename from translated/tech/20210915 Screen Recording in Linux With OBS and Wayland.md rename to published/20210915 Screen Recording in Linux With OBS and Wayland.md index 0d9afb5486..931655002d 100644 --- a/translated/tech/20210915 Screen Recording in Linux With OBS and Wayland.md +++ b/published/20210915 Screen Recording in Linux With OBS and Wayland.md @@ -3,22 +3,22 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13802-1.html" 在 Linux 中使用 OBS 和 Wayland 进行屏幕录制 ====== -有[大量可用于 Linux 的屏幕录像机][1]。但是当涉及到支持 [Wayland][2] 时,几乎所有的都不能用。 +有 [大量可用于 Linux 的屏幕录像机][1]。但是当涉及到支持 [Wayland][2] 时,几乎所有的都不能用。 这是个问题,因为许多新发布的版本都再次默认切换到 Wayland 显示管理器。而如果像屏幕录像机这样基本的东西不能工作,就会给人留下不好的体验。 -[GNOME 的内置屏幕录像机][3]可以工作,但它是隐藏的,没有 GUI,也没有办法配置和控制记录内容。还有一个叫 [Kooha][4] 的工具,但它一直在屏幕上显示一个计时器。 +[GNOME 的内置屏幕录像机][3] 可以工作,但它是隐藏的,没有 GUI,也没有办法配置和控制记录内容。此外,还有一个叫 [Kooha][4] 的工具,但它一直在屏幕上显示一个计时器。 -只是为了录制屏幕而[在 Xorg 和 Wayland 之间切换][5],这不是很方便。 +只是为了录制屏幕而 [在 Xorg 和 Wayland 之间切换][5],这不是很方便。 -在这一切中,我很高兴地得知,由于 Pipewire 的帮助,在 OBS Studio v27 中支持了 Wayland。但即使是这样,也不是很简单,因此我将向你展示使用 [OBS Studio][6] 在 Wayland 上录制屏幕的步骤。 +这种情况下,我很高兴地得知,由于 Pipewire 的帮助,在 OBS Studio v27 中支持了 Wayland。但即使是这样,也不是很简单,因此我将向你展示使用 [OBS Studio][6] 在 Wayland 上录制屏幕的步骤。 ### 使用 OBS 在 Wayland 上进行屏幕录制 @@ -30,7 +30,7 @@ 你应该先安装 OBS Studio v27。它已经包含在 Ubuntu 21.10 中,我会在本教程中使用它。 -要在 Ubuntu 18.04、20.04、Linux Mint 20 等系统上安装 OBS Studio 27,请使用[官方的 OBS Studio PPA][8]。 +要在 Ubuntu 18.04、20.04、Linux Mint 20 等系统上安装 OBS Studio 27,请使用 [官方的 OBS Studio PPA][8]。 打开终端,逐一使用以下命令: @@ -56,7 +56,7 @@ sudo apt install obs-studio ![Do you see PipeWire option in the screen sources?][10] -**如果答案是否定的,请退出 OBS Studio**。这很正常。至少在 Ubuntu 下,OBS Studio 不会自动切换到使用 Wayland。对此有一个修复方法。 +**如果没看到,请退出 OBS Studio**。这很正常。至少在 Ubuntu 下,OBS Studio 不会自动切换到使用 Wayland。对此有一个修复方法。 打开一个终端,使用以下命令: @@ -74,7 +74,7 @@ obs ![][10] -你这次用 QT_QPA_PLATFORM 变量明确要求 OBS Studio 使用 Wayland。 +你这次用 `QT_QPA_PLATFORM` 变量明确要求 OBS Studio 使用 Wayland。 选择 PipeWire 作为源,然后它要求你选择一个显示屏幕。选择它并点击分享按钮。 @@ -88,7 +88,7 @@ obs 这很好。你刚刚验证了你可以在 Wayland 上录制屏幕。但每次设置环境变量并从终端启动 OBS 并不方便。 -你可以做的是**把这个变量导出到你的 ~/.bash_profile(对你而言)或 /etc/profile(对系统中的所有用户而言)。** +你可以做的是**把这个变量导出到你的 `~/.bash_profile`(对你而言)或 `/etc/profile`(对系统中的所有用户而言)。** ``` export QT_QPA_PLATFORM=wayland @@ -105,7 +105,7 @@ via: https://itsfoss.com/screen-record-obs-wayland/ 作者:[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 21d67e5f819cec3c817588f57a4b57e4793d0bb3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 20 Sep 2021 16:55:32 +0800 Subject: [PATCH 0436/1588] PRF&PUB @geekpi https://linux.cn/article-13803-1.html --- ... info and changelogs with rpm-ostree db.md | 36 +++++++++---------- 1 file changed, 17 insertions(+), 19 deletions(-) rename {translated/tech => published}/20210915 How to check for update info and changelogs with rpm-ostree db.md (72%) diff --git a/translated/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md b/published/20210915 How to check for update info and changelogs with rpm-ostree db.md similarity index 72% rename from translated/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md rename to published/20210915 How to check for update info and changelogs with rpm-ostree db.md index 513c53058c..a45df8003b 100644 --- a/translated/tech/20210915 How to check for update info and changelogs with rpm-ostree db.md +++ b/published/20210915 How to check for update info and changelogs with rpm-ostree db.md @@ -3,32 +3,30 @@ [#]: author: "Mateus Rodrigues Costa https://fedoramagazine.org/author/mateusrodcosta/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13803-1.html" -如何用 rpm-ostree db 检查更新信息和更新日志 +如何用 rpm-ostree 数据库检查更新信息和更新日志 ====== ![][1] -照片由 [Dan-Cristian Pădureț][2] 发布在 [Unsplash][3]。 +这篇文章将教你如何使用 `rpm-ostree` 数据库及其子命令检查更新、检查更改的软件包和阅读更新日志。 -这篇文章将教你如何使用 _rpm-ostree db_ 及其子命令检查更新、检查更改的软件包和阅读更新日志。 - -这些命令将在 Fedora Silverblue 上进行演示,并且应该在任何使用 _rpm-ostree_ 的操作系统上工作。 +这些命令将在 Fedora Silverblue 上进行演示,并且应该在任何使用 `rpm-ostree` 的操作系统上工作。 ### 简介 -假设你对不可更改的系统感兴趣。在基于容器技术构建用例时使用只读的基本系统听起来非常有吸引力,它会说服你选择使用 _rpm-ostree_ 的发行版。 +假设你对不可更改的系统感兴趣。在基于容器技术构建用例时使用只读的基本系统听起来非常有吸引力,它会说服你选择使用 `rpm-ostree` 的发行版。 -你现在发现自己在 [Fedora Silverblue][4](或其他类似的发行版)上,你想检查更新。但你遇到了一个问题。虽然你可以通过 GNOME Software 找到 Fedora Silverblue 上的更新包,但你实际上无法阅读它们的更新日志。你也不能[使用 _dnf updateinfo_ 在命令行上读取它们][5],因为主机系统上没有 DNF。 +你现在发现自己在 [Fedora Silverblue][4](或其他类似的发行版)上,你想检查更新。但你遇到了一个问题。虽然你可以通过 GNOME Software 找到 Fedora Silverblue 上的更新包,但你实际上无法阅读它们的更新日志。你也不能 [使用 dnf updateinfo 在命令行上读取它们][5],因为主机系统上没有 DNF。 -那么,你应该怎么做呢?嗯,_rpm-ostree_ 有一些子命令可以在这种情况下提供帮助。 +那么,你应该怎么做呢?嗯,`rpm-ostree` 有一些子命令可以在这种情况下提供帮助。 ### 检查更新 -第一步是检查更新。只需运行 _rpm-ostree upgrade -check_: +第一步是检查更新。只需运行: ``` $ rpm-ostree upgrade --check @@ -41,9 +39,9 @@ AvailableUpdate: Diff: 4 upgraded ``` -请注意,虽然它没有在输出中告诉更新的软件包,但它显示了更新的 Commit 为 _d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4_。这在后面会很有用。 +请注意,虽然它没有在输出中告诉更新的软件包,但它显示了更新的提交为 `d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4`。这在后面会很有用。 -接下来你需要做的是找到你正在运行的当前部署的 Commit。运行 _rpm-ostree status_ 以获得当前部署的 BaseCommit: +接下来你需要做的是找到你正在运行的当前部署的提交。运行 `rpm-ostree status` 以获得当前部署的基提交BaseCommit: ``` $ rpm-ostree status @@ -58,9 +56,9 @@ Deployments: ... ``` -对于这个例子,BaseCommit 是 _e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e_。 +对于这个例子,基提交是`e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e`。 -现在你可以用 _rpm-ostree db diff [commit1] [commit2]_ 找到这两个提交的差异。在这个命令中,_commit1_ 将是当前部署的 BaseCommit,_commit2_ 将是升级检查命令中的 Commit。 +现在你可以用 `rpm-ostree db diff [commit1] [commit2]` 找到这两个提交的差异。在这个命令中,`[commit1]` 将是当前部署的基提交,`[commit2]` 将是升级检查命令中的提交。 ``` $ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 @@ -70,7 +68,7 @@ Upgraded: soundtouch 2.1.1-6.fc34 -> 2.1.2-1.fc34 ``` -diff 输出显示 _soundtouch_ 被更新了,并指出了版本号。通过在前面的命令中加入 _-changelogs_ 来查看更新日志: +`diff` 输出显示 `soundtouch` 被更新了,并指出了版本号。通过在前面的命令中加入 `-changelogs` 来查看更新日志: ``` $ rpm-ostree db diff e279286dcd8b5e231cff15c4130a4b1f5a03b6735327b213ee474332b311dd1e d8bab818f5abcfb58d2c038614965bf26426d55667e52018fcd295b9bfbc88b4 --changelogs @@ -90,7 +88,7 @@ Upgraded: ### 总结 -使用 _rpm-ostree db_,你现在可以拥有相当于 _dnf check-update_ 和 _dnf updateinfo_ 的功能。 +使用 `rpm-ostree db`,你现在可以拥有相当于 `dnf check-update` 和 `dnf updateinfo` 的功能。 如果你想检查你所安装的更新的详细信息,这将非常有用。 @@ -101,7 +99,7 @@ via: https://fedoramagazine.org/how-to-check-for-update-info-and-changelogs-with 作者:[Mateus Rodrigues Costa][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 54809c46a8d09a465d08fdadc9a0d62bfaaabfff Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Sep 2021 05:03:09 +0800 Subject: [PATCH 0437/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210921?= =?UTF-8?q?=20Pensela:=20An=20Open-Source=20Tool=20Tailored=20for=20Screen?= =?UTF-8?q?=20Annotations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210921 Pensela- An Open-Source Tool Tailored for Screen Annotations.md --- ...ce Tool Tailored for Screen Annotations.md | 116 ++++++++++++++++++ 1 file changed, 116 insertions(+) create mode 100644 sources/tech/20210921 Pensela- An Open-Source Tool Tailored for Screen Annotations.md diff --git a/sources/tech/20210921 Pensela- An Open-Source Tool Tailored for Screen Annotations.md b/sources/tech/20210921 Pensela- An Open-Source Tool Tailored for Screen Annotations.md new file mode 100644 index 0000000000..d82ee2048f --- /dev/null +++ b/sources/tech/20210921 Pensela- An Open-Source Tool Tailored for Screen Annotations.md @@ -0,0 +1,116 @@ +[#]: subject: "Pensela: An Open-Source Tool Tailored for Screen Annotations" +[#]: via: "https://itsfoss.com/pensela/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Pensela: An Open-Source Tool Tailored for Screen Annotations +====== + +_**Brief:** Pensela is an interesting screen annotation tool available cross-platform. Let us take a closer look at it._ + +You may have come across [several screenshot tools][1] available for Linux. However, a dedicated screen annotation tool along with the ability to take screenshots? And, with cross-platform support? + +Well, that sounds even better! + +### Pensela: A Useful Screen Annotation Tool + +![][2] + +While you get many tools to beautify your screenshots and the screenshot tools like Flameshot, Pensela lets you focus on annotations first. + +It focuses on offering several annotation options while giving you the ability to take full-size screenshots. + +Here, I shall highlight some of its features along with my experience using it. + +### Features of Pensela + +**Note:** Pensela is a fairly new project on [GitHub][3] with no recent updates to it. If you like what you see, I encourage you to help the project or fork it to add the necessary improvements. + +Given that it is a new project with an uncertain future, the feature set is impressive as per what it describes. + +Here’s what you can expect: + + * Cross-platform support (Windows, macOS, and Linux) + * Drawing shapes (circle,square,triangle, and more) + * Signs for yes or no (or correct or wrong) + * Arrow object + * Double-sided arrow + * Ability to change the color of the objects added + * Undo/Redo option + * Add custom text + * Adjust the placement of text/objects + * Toggle the annotation tool or turn off to use the active window + * Text highlighter + * Screenshot button to take the full-screen picture + * Option for clearing all the drawings + + + +### Using Pensela as Screen Annotation Tool + +The moment you launch the tool, your active window gets unresponsive because it focuses on the annotation capability of pensela. + +You get the option to toggle it using the visibility button (icon with an eye). If you disable it, you can interact with the active windows and your computer, but you cannot add annotations. + +![][4] + +When you enable it, the annotations should start working, and the existing ones will be visible. + +This should come in handy if you are streaming/screencasting so that you can use the annotations live and toggle them off when needed. + +In the same section, you select the drag button with two double-side arrows, which lets you move the annotations you already created before turning off the button. + +You can add a piece of text if you click on “T” and then tweak it around to set a color to add them. The tool gives you the freedom to customize the colors of every object available. + +The undo/redo feature works like a charm without limits, which is a good thing. + +The ability to hide all the annotations in one click while resuming it after finishing any existing work should come in handy. + +![][5] + +**Some downsides of Pensela as of now:** + +Unfortunately, it does not let you take a screenshot of a specific region on your screen. It only takes a full-screen screenshot, and any annotations you work on need to be full-screen specific for the best results. + +Of course, you can manually crop/resize the screenshot later, but that is a limitation I have come across. + +Also, you cannot adjust the position of the annotation bar. So, it could be an inconvenience if you want to add an annotation on the top side of your screen. + +And, there is no advanced customization option to tweak or change the behavior of how the tools work, how the screenshot is taken, etc. + +### Installing Pensela in Linux + +You get an AppImage file and a deb file available from its [GitHub releases section][6]. + +Using an AppImage file should come in handy irrelevant of your Linux distribution, but feel free to try other options mentioned on its GitHub page. + +You should also find it in [AUR][7] on an Arch-based Linux distro. + +[Pensela][3] + +What do you think about Pensela as an annotation tool? Do you know of any similar annotation tools? Feel free to let me know your thoughts in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/pensela/ + +作者:[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://itsfoss.com/take-screenshot-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pensela-screenshot.png?resize=800%2C442&ssl=1 +[3]: https://github.com/weiameili/Pensela +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pensela-visibility.png?resize=575%2C186&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pensela-folder-screenshot.png?resize=800%2C285&ssl=1 +[6]: https://github.com/weiameili/Pensela/releases/tag/v1.1.3 +[7]: https://itsfoss.com/aur-arch-linux/ From 27818c8aa6d1f33d2a8ecee03177b5302c21a778 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Sep 2021 05:03:18 +0800 Subject: [PATCH 0438/1588] add done: 20210921 Pensela- An Open-Source Tool Tailored for Screen Annotations.md --- sources/tech/20210920 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210920 .md diff --git a/sources/tech/20210920 .md b/sources/tech/20210920 .md new file mode 100644 index 0000000000..db721ba174 --- /dev/null +++ b/sources/tech/20210920 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/install-java-17-ubuntu-mint/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 9fce44564bb7b473b5861b11e4c5bc6afb6b3e1f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Sep 2021 05:03:39 +0800 Subject: [PATCH 0439/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210920?= =?UTF-8?q?=20Use=20this=20Linux=20command-line=20tool=20to=20learn=20more?= =?UTF-8?q?=20about=20your=20NVMe=20drives?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md --- ...ol to learn more about your NVMe drives.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md diff --git a/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md b/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md new file mode 100644 index 0000000000..5d6b5dc5b2 --- /dev/null +++ b/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md @@ -0,0 +1,183 @@ +[#]: subject: "Use this Linux command-line tool to learn more about your NVMe drives" +[#]: via: "https://opensource.com/article/21/9/nvme-cli" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use this Linux command-line tool to learn more about your NVMe drives +====== +The nvme-cli command has lots of useful options, and it's a great way to +take control of how you manage your data. +![Command line prompt][1] + +NVMe stands for _Non-Volatile Memory Express_, and it refers to how software and storage communicate across PCIe and other protocols, including TCP. It's an [open specification][2] led by a non-profit organization and defines several forms of solid-state storage. + +My laptop has an NVMe drive, as does my desktop. And they're fast. I love how quickly my computers boot and how quickly they're able to read and write data. There's no perceptible delay. + +It also didn't take long for me to get curious about the technology driving this ultra-fast storage, so I did a little investigation. I learned that NVMe drives consume less power while delivering much faster access to data compared to even SSD drives over SATA. That was interesting, but I wanted to know more about my particular NVMe drives, and I wanted to know how they compared with other drives. Could I securely erase the drive? How could I check its integrity? + +Those questions led me to an Internet search that yielded an open source project with a collection of tools to manage NVMe drives. It's called [nvme-cli][3]. + +### Install nvme-cli + +You can install `nvme-cli` from your distribution's package manager. For instance, on Fedora, CentOS, or similar: + + +``` +`$ sudo dnf install nvme-cli` +``` + +On Debian, Mint, Elementary, and similar: + + +``` +`$ sudo apt install nvme-cli` +``` + +### Exploring an NVMe drive + +After installing `nvme-cli` for my distribution, I wanted to explore my drive. There's no man page for `nvme-cli`, but you can get lots of help by entering `nvme help`: + + +``` +$ nvme help +nvme-1.14 +usage: nvme <command> [<device>] [<args>] + +The '<device>' may be either an NVMe character device (ex: /dev/nvme0) or an +nvme block device (ex: /dev/nvme0n1). + +The following are all implemented sub-commands: + list List all NVMe devices and namespaces on machine + list-subsys List nvme subsystems + id-ctrl Send NVMe Identify Controller + id-ns Send NVMe Identify Namespace, display structure + id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure + list-ns Send NVMe Identify List, display structure + list-ctrl Send NVMe Identify Controller List, display structure + nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure + primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities +[...] +``` + +### List all NVMe drives + +The `sudo nvme list` command lists all NVMe devices and namespaces on your machine. I used it and found an NVMe drive at `/dev/nvme0n1`. Here is the output: + + +``` +$ sudo nvme list + +Node SN Model Namespace Usage Format FW Rev + +\--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- + +/dev/nvme0n1    S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1 + +214.68 GB / 256.06 GB 512  B + 0 B 0L2QEXD7 +``` + +I have a drive called `nvme0n1`. It lists the serial number, brand, size, firmware revision, and so on. + +You can get even more information about the drive and the features it supports by using the `id-ctrl` subcommand: + + +``` +$ sudo nvme id-ctrl /dev/nvme0n1 +NVME Identify Controller: +vid : 0x144d +ssvid : 0x144d +sn : S42GMY9M141281 +mn : SAMSUNG MZVLB256HAHQ-000L7 +fr : 0L2QEXD7 +rab : 2 +ieee : 002538 +cmic : 0 +mdts : 9 +cntlid : 0x4 +ver : 0x10200 +rtd3r : 0x186a0 +rtd3e : 0x7a1200 +[...] +``` + +### Drive health + +You can read about the overall health of a drive with the `smart-log` subcommand: + + +``` +$ sudo nvme smart-log /dev/nvme0n1 +Smart Log for NVME device:nvme0n1 namespace-id:ffffffff +critical_warning : 0 +temperature : 21 C +available_spare : 100% +available_spare_threshold : 10% +percentage_used : 2% +endurance group critical warning summary: 0 +data_units_read : 5,749,452 +data_units_written : 10,602,948 +host_read_commands : 77,809,121 +host_write_commands : 153,405,213 +controller_busy_time : 756 +power_cycles : 1,719 +power_on_hours : 1,311 +unsafe_shutdowns : 129 +media_errors : 0 +num_err_log_entries : 1,243 +Warning Temperature Time : 0 +Critical Composite Temperature Time : 0 +Temperature Sensor 1 : 21 C +Temperature Sensor 2 : 22 C +Thermal Management T1 Trans Count : 0 +Thermal Management T2 Trans Count : 0 +Thermal Management T1 Total Time : 0 +Thermal Management T2 Total Time : 0 +``` + +This provides you with the drive's current temperature, the hours of use it's had so far, how many times it was unsafely shut down, and so on. + +### Formatting an NVMe drive + +You can format an NVMe drive with `nvme-cli`, but beware: This erases all of the data on the drive! If there's important data on your drive, you _must_ back it up before doing this, or else you **will** lose data. The subcommand is `format`: + + +``` +`$ sudo nvme format /dev/nvme0nX` +``` + +(For safety, I've replaced the actual location of the drive with **X** to prevent copy-paste mishaps. Change the **X** to **1** or the appropriate location as listed in the results of `nvme list`.) + +### Securely erasing an NVMe drive + +When you get ready to sell or dispose of your NVMe computer, you probably want to erase the drive securely. The same warnings apply here as with the format process: Back up important data first because this command erases it! + + +``` +`$ sudo nvme sanitize /dev/nvme0nX` +``` + +### Try nvme-cli + +The `nvme-cli` command is released under a [GPLv2][4] license. It's a robust command with lots of useful options, and it's a great way to take control of how you manage your data. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/nvme-cli + +作者:[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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://nvmexpress.org/ +[3]: https://github.com/linux-nvme/nvme-cli +[4]: https://github.com/linux-nvme/nvme-cli/blob/master/LICENSE From 40cd3d9764b0de6e538dda3f8a9da1ea26377449 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 21 Sep 2021 05:03:57 +0800 Subject: [PATCH 0440/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210920?= =?UTF-8?q?=20Use=20Vagrant=20to=20test=20your=20scripts=20on=20different?= =?UTF-8?q?=20operating=20systems?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md --- ... scripts on different operating systems.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md diff --git a/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md b/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md new file mode 100644 index 0000000000..e82363241c --- /dev/null +++ b/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md @@ -0,0 +1,142 @@ +[#]: subject: "Use Vagrant to test your scripts on different operating systems" +[#]: via: "https://opensource.com/article/21/9/test-vagrant" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use Vagrant to test your scripts on different operating systems +====== +Vagrant helps you run other operating systems on your computer—meaning +you can build things, test things, and do wacky stuff without blowing up +your own system. +![Business woman on laptop sitting in front of window][1] + +I've been happy using Vagrant for quite a while now. I work with several DevOps tools, and installing them all on one system can get complicated. Vagrant lets you do cool things without breaking your system because you don't have to experiment on your production system at all. + +If you're familiar with [VirtualBox][2] or [GNOME Boxes][3], then learning Vagrant is easy. Vagrant is a simple and clean interface for working with virtual machines. A single config file, called `Vagrantfile`, allows you to customize your virtual machines (called _Vagrant boxes_). A simple command-line interface lets you start, stop, suspend, or destroy your boxes. + +Consider this simple example. + +Let's say you want to write Ansible or shell scripts to install Nginx on a new server. You can't do it on your own system because you might not be running the operating system you want to test, or you may not have all of the dependencies for what you want to do. Launching new cloud servers for testing can be time-consuming and expensive. This is where Vagrant comes in. You can use it to bring up a virtual machine, provision it using your scripts, and prove that everything works as expected. You can then delete the box, re-provision it, and re-run your scripts to verify it. You can repeat this process as many times as you want until you're confident your scripts work under all conditions. And you can commit your Vagrantfile to Git to ensure your team is testing the exact same environment (because they'll be using the exact same test box). No more "…but it works fine on my machine!" + +### Getting started + +First, [install Vagrant on your system][4] and then create a new folder to experiment in. In this new folder, create a new file named `Vagrantfile` with these contents: + + +``` +Vagrant.configure("2") do |config| +  +  config.vm.box = "ubuntu/hirsute64" +  +end +``` + +You can also run `vagrant init ubuntu/hirsute64`, and it will generate a new Vagrantfile for you. Now run `vagrant up`. This command will download the `ubuntu/hirsuite64` image from the Vagrant registry. + + +``` +Bringing machine 'default' up with 'virtualbox' provider... +==> default: Importing base box 'ubuntu/hirsute64'... +==> default: Matching MAC address for NAT networking... +==> default: Checking if box 'ubuntu/hirsute64' version '20210820.0.0' is up to date... +==> default: Setting the name of the VM: a_default_1630204214778_76885 +==> default: Clearing any previously set network interfaces... +==> default: Preparing network interfaces based on configuration... +    default: Adapter 1: nat +    default: Adapter 2: hostonly +==> default: Forwarding ports... +    default: 22 (guest) => 2222 (host) (adapter 1) +==> default: Running 'pre-boot' VM customizations... +==> default: Booting VM... +==> default: Waiting for machine to boot. This may take a few minutes... +    default: SSH address: 127.0.0.1:2222 +    default: SSH username: vagrant +    default: SSH auth method: private key +    default: Warning: Remote connection disconnect. Retrying... +    default: Warning: Connection reset. Retrying... +    default: +    default: Vagrant insecure key detected. Vagrant will automatically replace +    default: this with a newly generated keypair for better security. +    default: +    default: Inserting generated public key within guest... +    default: Removing insecure key from the guest if it's present... +    default: Key inserted! Disconnecting and reconnecting using new SSH key... +==> default: Machine booted and ready! +``` + +At this point, if you open your Vagrant backend (such as VirtualBox or virt-manager), you'll see your box there. Next, run `vagrant ssh` to log in to the box. If you can see the Vagrant prompt, then you’re in! + + +``` +~ vagrant ssh +Welcome to Ubuntu 21.04 (GNU/Linux 5.11.0-31-generic x86_64) + + * Documentation:   + * Management:     + * Support:         + +  System information as of Sun Aug 29 02:33:51 UTC 2021 + +  System load:  0.01              Processes:               110 +  Usage of /:   4.1% of 38.71GB   Users logged in:         0 +  Memory usage: 17%               IPv4 address for enp0s3: 10.0.2.15 +  Swap usage:   0%                IPv4 address for enp0s8: 192.168.1.20 + +0 updates can be applied immediately. + +vagrant@ubuntu-hirsute:~$ +``` + +Vagrant uses "base boxes" to bring up your local machines. In our case, Vagrant downloads the `ubuntu/hirsuite64` image from [Hashicorp’s Vagrant catalogue][5] and plugs into VirtualBox to create the actual box. + +### Shared folders + +Vagrant maps your current folder as `/vagrant` within the Vagrant box. This allows you to keep your files in sync on your system and within the box. This is great for testing a Nginx website by pointing your document root to `/vagrant`. You can use an IDE to make changes and Nginx within the box will serve them. + +### Vagrant commands + +There are several Vagrant commands which you can use to control your box. + +Some of the important ones are: + + * `vagrant up`: Bring a box online. + * `vagrant status`: Show current box status. + * `vagrant suspend`: Pause the current box. + * `vagrant resume`: Resume the current box. + * `vagrant halt`: Shutdown the current box. + * `vagrant destroy`: Destroy the current box. By running this command, you will lose any data stored on the box. + * `vagrant snapshot`: Take a snapshot of the current box. + + + +### Try Vagrant + +Vagrant is a time-tested tool for virtual machine management using DevOps principles. Configure your test machines, share the configs with your team, and test your projects in a predictable and reproducible environment. If you're developing software, then you'll do your users a great service by using Vagrant for testing. If you're not developing software but you love to try out new versions of an OS, then there's no easier way. Try Vagrant today! + +* * * + +_This article was originally published on the [author's personal blog][6] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/test-vagrant + +作者:[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/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://opensource.com/article/21/6/try-linux-virtualbox +[3]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[4]: https://www.vagrantup.com/docs/installation +[5]: https://app.vagrantup.com/boxes/search +[6]: https://notes.ayushsharma.in/2021/08/introduction-to-vagrant From d45f55d65ed61a67c02da15ca5f632b1eca1a5eb Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 21 Sep 2021 07:41:00 +0800 Subject: [PATCH 0441/1588] Delete 20210920 .md --- sources/tech/20210920 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210920 .md diff --git a/sources/tech/20210920 .md b/sources/tech/20210920 .md deleted file mode 100644 index db721ba174..0000000000 --- a/sources/tech/20210920 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/install-java-17-ubuntu-mint/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From fe23141b3816a4bfa93047c53364b29056d36bea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 12:57:47 +0800 Subject: [PATCH 0442/1588] APL --- sources/tech/20210917 Start using YAML now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210917 Start using YAML now.md b/sources/tech/20210917 Start using YAML now.md index 3b626bad09..4536510091 100644 --- a/sources/tech/20210917 Start using YAML now.md +++ b/sources/tech/20210917 Start using YAML now.md @@ -3,7 +3,7 @@ [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " From 6910b0260cb6fdca75af7c6a0ece2f8a2a503e10 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 21 Sep 2021 13:40:13 +0800 Subject: [PATCH 0443/1588] Revert "APL:sources/tech/20210917 Start using YAML now.md" --- sources/tech/20210917 Start using YAML now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210917 Start using YAML now.md b/sources/tech/20210917 Start using YAML now.md index 4536510091..3b626bad09 100644 --- a/sources/tech/20210917 Start using YAML now.md +++ b/sources/tech/20210917 Start using YAML now.md @@ -3,7 +3,7 @@ [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: "wxy" +[#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 82a1791d13e6b72e58a1b16bb2f4128884e4db22 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 13:43:59 +0800 Subject: [PATCH 0444/1588] APL --- sources/tech/20210917 How to Install Kali Linux in VMware.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210917 How to Install Kali Linux in VMware.md b/sources/tech/20210917 How to Install Kali Linux in VMware.md index 0777c9b862..b688f4c4f9 100644 --- a/sources/tech/20210917 How to Install Kali Linux in VMware.md +++ b/sources/tech/20210917 How to Install Kali Linux in VMware.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-kali-linux-vmware/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 946392a7671f9e94f25c4944ee75402717d826b9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 14:43:14 +0800 Subject: [PATCH 0445/1588] TSL&PRF --- ...917 How to Install Kali Linux in VMware.md | 190 ----------------- ...917 How to Install Kali Linux in VMware.md | 194 ++++++++++++++++++ 2 files changed, 194 insertions(+), 190 deletions(-) delete mode 100644 sources/tech/20210917 How to Install Kali Linux in VMware.md create mode 100644 translated/tech/20210917 How to Install Kali Linux in VMware.md diff --git a/sources/tech/20210917 How to Install Kali Linux in VMware.md b/sources/tech/20210917 How to Install Kali Linux in VMware.md deleted file mode 100644 index b688f4c4f9..0000000000 --- a/sources/tech/20210917 How to Install Kali Linux in VMware.md +++ /dev/null @@ -1,190 +0,0 @@ -[#]: subject: "How to Install Kali Linux in VMware" -[#]: via: "https://itsfoss.com/install-kali-linux-vmware/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install Kali Linux in VMware -====== - -Kali Linux is the de facto standard of [Linux distributions used for learning and practicin][1][g][1] [hacking and penetration testing][1]. - -And, if you’ve been tinkering around with Linux distros long enough, you might have tried it out just out of curiosity. - -However, no matter what you use it for, it is not a replacement for a regular full-fledged desktop Linux operating system. Hence, it is recommended (at least for beginners) to install Kali Linux using a virtual machine program like VMware. - -With a virtual machine, you can use Kali Linux as a regular application in your Windows or Linux system. It’s almost the same as running VLC or Skype in your system. - -There are a few free virtualization tools available for you. You can [install Kali Linux on Oracle VirtualBox][2] or use VMWare Workstation. - -This tutorial focuses on VMWare. - -### Installing Kali Linux on VMware on Windows and Linux - -Non-FOSS alert! - -VM Ware is not open source software. - -For this tutorial, I presume that you are using Windows, considering most VMware users prefer using Windows 10/11. - -However, the _**tutorial is also valid for Linux except the VMWare installation on Windows part**_. You can [easily install VMWare on Ubuntu][3] and other Linux distributions. - -#### Step 1: Install VMWare Workstation Player (on Windows) - -If you already have VMware installed on your system, you can skip the steps to install Kali Linux. - -Head to [VMWare’s official workstation player webpage][4] and then click on the “**Download Free**” button. - -![][5] - -Next, you get to choose the version (if you want something specific or encountering bugs in the latest version) and then click on “**Go to Downloads.**“ - -![][6] - -And then you get the download buttons for both Windows and Linux versions. You will have to click on the button for Windows 64-bit because that is what we need here. - -![][7] - -There is no support for 32-bit systems, in case you were wondering. - -Finally, when you get the .exe file downloaded, launch it to start the installation process. You need to hit “Next” to get started installing VMware. - -![][8] - -Next, you will have to agree to the policies and conditions to continue. - -![][9] - -Now, you get to choose the path of your installation. Ideally, keep it at the default settings. But, if you need better keyboard response / in-screen keyboard performance in the virtual machine, you may want to enable the “**Enhanced Keyboard Driver**.” - -![][10] - -Proceeding to the next step, you can choose to disable checking for updates every time you start the program (can be annoying) and disable sending data to VMware as part of its user experience improvement program. - -![][11] - -If you want quick access using desktop and start menu shortcuts, you can check those settings or toggle them off, which I prefer. - -![][12] - -Now, you have to continue to start the installation. - -![][13] - -This may take a while, and when completed, you get greeted with another window that lets you finish the process and gives you the option to enter a license key. If you want to get the commercial license for your use-case, you need the VMware Workstation Pro edition, or else, the player is free for personal use. - -![][14] - -Attention! - -Please make sure that virtualization is enabled in your system. Recent Windows versions require that you enable the virtualization explicitly to use virtual machines. - -#### Step 2: Install Kali Linux on VMware - -To get started, you need to download the image file of Kali Linux. And, when it comes to Kali Linux, they offer a separate ISO file if you plan to use it on a virtual machine. - -![][15] - -Head to its [official download page][16] and download the prebuilt VMware image available. - -![][17] - -You can download the **.7z** file directly or utilize Torrent (which is generally faster). In either case, you can also check the file integrity with the SHA256 value provided. - -Once downloaded, you need to extract the file to any path of your choice. - -![][18] - -Open VMware Workstation Player and then click on “**Open a Virtual Machine**.” Now, look for the folder you extracted. And navigate through it till you find a file with the “**.vmx**” extension. - -For instance: **Kali-Linux-2021.3-vmware-amd64.vmx** - -![][19] - -Select the .vmx file to open the virtual machine. And, it should appear right in your VMware player. - -You can choose to launch the virtual machine with the default settings. Or, if you want to tweak the hardware allocated to the virtual machine, feel free to change the settings before you launch it. - -![][20] - -Depending on your computer hardware, you should allocate more memory and at least half of your processor cores to get a smooth performance. - -In this case, I have 16 Gigs of RAM and a quad-core processor. Hence, it is safe to allocate nearly 7 GB of RAM and two cores for this virtual machine. - -![][21] - -While you can assign more resources, but it might affect the performance of your host operating system when working on a task. So, it is recommended to keep a balance between the two. - -Now, save the settings and hit “**Play virtual machine**” to start Kali Linux on VMware. - -When it starts loading up, you may be prompted with some tips to improve performance by tweaking some virtual machine settings. - -You do not have to do that, but if you notice performance issues, you can disable side-channel mitigations (needed for enhanced security) to uplift the performance of the VM. - -Also, you may be prompted to download and [install VMware tools for Linux][22]; you need to do this to get a good VM experience. - -Once you do that, you will be greeted with Kali Linux’s login screen. - -![][23] - -Considering that you launched a prebuilt VMware folder, you need to enter the default login and password to proceed. - -**Username**: kali -**Password:** kali - -![][24] - -That’s it! You’re done installing Kali Linux on VMware. Now, all you have to do is start exploring! - -### Where to go from here? - -Here are a few tips you can utilize: - - * If clipboard sharing and file sharing is not working, [install VMWare tools][22] on the guest system (Kali Linux). - * If you are new to it, check out this [list of Kali Linux tools][25]. - - - -Feel free to share your thoughts if you find this tutorial helpful. Do you prefer to install Kali Linux without using a VMware image ready to go? Let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-kali-linux-vmware/ - -作者:[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://itsfoss.com/linux-hacking-penetration-testing/ -[2]: https://itsfoss.com/install-kali-linux-virtualbox/ -[3]: https://itsfoss.com/install-vmware-player-ubuntu-1310/ -[4]: https://www.vmware.com/products/workstation-player.html -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download.png?resize=732%2C486&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-1.png?resize=800%2C292&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-final.png?resize=800%2C212&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-1.png?resize=692%2C465&ssl=1 -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-license.png?resize=629%2C443&ssl=1 -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-2.png?resize=638%2C440&ssl=1 -[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-tracking.png?resize=618%2C473&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-shortcuts.png?resize=595%2C445&ssl=1 -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-install.png?resize=620%2C474&ssl=1 -[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-installed.png?resize=589%2C441&ssl=1 -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-image-kali.png?resize=800%2C488&ssl=1 -[16]: https://www.kali.org/get-kali/ -[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-download.png?resize=800%2C764&ssl=1 -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/extract-vmware-image.png?resize=617%2C359&ssl=1 -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-folder.png?resize=800%2C498&ssl=1 -[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/virtual-machine-settings-kali.png?resize=800%2C652&ssl=1 -[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-vm-settings.png?resize=800%2C329&ssl=1 -[22]: https://itsfoss.com/install-vmware-tools-linux/ -[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-linux-vm-login.png?resize=800%2C540&ssl=1 -[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux.png?resize=800%2C537&ssl=1 -[25]: https://itsfoss.com/best-kali-linux-tools/ diff --git a/translated/tech/20210917 How to Install Kali Linux in VMware.md b/translated/tech/20210917 How to Install Kali Linux in VMware.md new file mode 100644 index 0000000000..0312e49ddf --- /dev/null +++ b/translated/tech/20210917 How to Install Kali Linux in VMware.md @@ -0,0 +1,194 @@ +[#]: subject: "How to Install Kali Linux in VMware" +[#]: via: "https://itsfoss.com/install-kali-linux-vmware/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +如何在 VMware 中安装 Kali Linux +====== + +![](https://img.linux.net.cn/data/attachment/album/202109/21/144206sjhgutyjgtu6m22z.jpg) + +Kali Linux 是 [用于学习和练习黑客攻击和渗透测试的 Linux 发行版][1] 的不二之选。 + +而且,如果你经常捣鼓 Linux 发行版,出于好奇心,你可能已经尝试过它。 + +> **警告!** +> +> 本文介绍的内容仅供学习 Kali Linux 的安装,请勿使用 Kali Linux 进行任何非授权的行为。Kali Linux 应该用于在授权的情况下,对授权的目标进行合理的渗透测试,以了解其脆弱性并加以防范。本文作译者和本站均不对非授权和非法的使用及其造成的后果负责。 + +然而,无论你用它做什么,它都不能替代正规成熟的桌面 Linux 操作系统。因此,(至少对于初学者来说)建议使用虚拟机程序(如 VMware)来安装 Kali Linux。 + +通过虚拟机,你可以把 Kali Linux 作为你的 Windows 或 Linux 系统中的一个常规应用程序来使用,就像在你的系统中运行 VLC 或 Skype 一样。 + +有一些免费的虚拟化工具可供使用。你可以 [在 Oracle VirtualBox 上安装 Kali Linux][2] ,也可以使用 VMWare Workstation。 + +本教程重点介绍 VMWare。 + +### 在 Windows 和 Linux 的 VMware 上安装 Kali Linux + +> **非 FOSS 警报!** +> +> VMWare 不是开源软件。 + +对于本教程,我假定你使用的是 Windows,是考虑到大多数 VMware 用户喜欢使用 Windows 10/11。 + +然而,除了在 Windows 上安装 VMWare 的部分,本 **教程对 Linux 也是有效的**。你可以 [轻松地在 Ubuntu 和其他 Linux 发行版上安装 VMWare][3]。 + +#### 步骤 1:安装 VMWare Workstation Player(在 Windows 上) + +如果你的系统上已经安装了 VMware,你可以跳到安装 Kali Linux 的步骤。 + +前往 [VMWare 的 Workstation Player 官方网页][4],然后点击 “Download For Free” 按钮。 + +![][5] + +接下来,你可以选择版本(如果你想要特定的版本或遇到最新版本的 bug),然后点击 “Go to Downloads”。 + +![][6] + +然后你就会看到 Windows 和 Linux 版本的下载按钮。你需要点击 “Windows 64-bit” 的按钮,因为这就是我们在这里需要的。 + +![][7] + +顺便提一句,它不支持 32 位系统。 + +最后,当你得到下载的 .exe 文件时,启动它以开始安装过程。你需要点击 “Next” 来开始安装 VMware。 + +![][8] + +接下来,你需要同意这些政策和条件才能继续。 + +![][9] + +现在,你可以选择安装的路径。理想情况下,保持默认设置。但是,如果你在虚拟机中需要更好的键盘响应/屏幕上的键盘性能,你可能想启用 “增强型键盘驱动程序Enhanced Keyboard Driver”。 + +![][10] + +进入下一步,你可以选择禁用每次启动程序时的更新检查(可能很烦人),并禁用向 VMware 发送数据,这是其用户体验改进计划的一部分。 + +![][11] + +如果你想使用桌面和开始菜单的快捷方式进行快速访问,你可以勾选这些设置,或像我一样将其取消。 + +![][12] + +现在,继续以开始安装。 + +![][13] + +这可能需要一些时间,完成后,你会看到另一个窗口,让你完成这个过程,并让你选择输入一个许可证密钥。如果你想获得商业许可,你需要 VMware Workstation 专业版,否则,该 Player 版本对个人使用是免费的。 + +![][14] + +> **注意!** +> +> 请确保你的系统已经启用了虚拟化功能。最近的 VMWare 的 Windows 版本要求你明确启用虚拟化以使用虚拟机。 + +#### 步骤 2:在 VMware 上安装 Kali Linux + +开始时,你需要下载 Kali Linux 的镜像文件。而且,如果你打算在虚拟机上使用它,Kali Linux 会提供一个单独的 ISO 文件。 + +![][15] + +前往其 [官方下载页面][16],下载可用的预构建的 VMware 镜像。 + +![][17] + +你可以直接下载 .7z 文件或利用 Torrent(一般来说速度更快)。在这两种情况下,你也可以用提供的 SHA256 值检查文件的完整性。 + +下载完成,你需要将文件解压到你选择的任何路径。 + +![][18] + +打开 VMware Workstation Player,然后点击 “打开一个虚拟机Open a Virtual Machine”。现在,寻找你提取的文件夹。然后浏览它,直到你找到一个扩展名为 .vmx 的文件。 + +比如说,`Kali-Linux-2021.3-vmware-amd64.vmx`。 + +![][19] + +选择 .vmx 文件来打开该虚拟机。它应该直接出现在你的 VMware Player 中。 + +你可以选择以默认设置启动虚拟机。或者,如果你想调整分配给虚拟机的硬件,可以在启动前随意改变设置。 + +![][20] + +根据你的计算机硬件,你应该分配更多的内存和至少一半的处理器核心,以获得流畅的性能。 + +在这种情况下,我有 16GB 的内存和一个四核处理器。因此,为这个虚拟机分配近 7GB 的内存和两个内核是安全的。 + +![][21] + +虽然你可以分配更多的资源,但它可能会影响你的宿主机操作系统在工作时的性能。所以,建议在这两者之间保持平衡。 + +现在,保存设置并点击 “播放虚拟机Play virtual machine” 来启动 Kali Linux on VMware。 + +当它开始加载时,你可能会看到一些提示,告诉你可以通过调整一些虚拟机设置来提高性能。 + +你不用必须这样做,但如果你注意到性能问题,你可以禁用侧通道缓解措施side-channel mitigations(用于增强安全性)来提高虚拟机的性能。 + +另外,你可能会被提示下载并 [安装 VMware tools for Linux][22];你需要这样做以获得良好的虚拟机体验。 + +完成之后,你就会看到 Kali Linux 的登录界面。 + +![][23] + +考虑到你启动了一个预先建立的 VMware 虚拟机,你需要输入默认的登录名和密码来继续。 + +- 用户名:`kali` +- 密码: `kali` + +![][24] + +就是这样!你已经完成了在 VMware 上安装 Kali Linux。现在,你所要做的就是开始探索了! + +### 接下来呢? + +这里有一些你可以利用的提示: + + * 如果剪贴板共享和文件共享不工作,请在访客系统(Kali Linux)上 [安装 VMWare tools][22]。 + * 如果你是新手,请查看这个 [Kali Linux 工具列表][25]。 + +如果你觉得这个教程有帮助,欢迎分享你的想法。你是否喜欢在不使用 VMware 镜像的情况下安装 Kali Linux?请在下面的评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-kali-linux-vmware/ + +作者:[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://itsfoss.com/linux-hacking-penetration-testing/ +[2]: https://itsfoss.com/install-kali-linux-virtualbox/ +[3]: https://itsfoss.com/install-vmware-player-ubuntu-1310/ +[4]: https://www.vmware.com/products/workstation-player.html +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download.png?resize=732%2C486&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-1.png?resize=800%2C292&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-download-final.png?resize=800%2C212&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-1.png?resize=692%2C465&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-license.png?resize=629%2C443&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-setup-2.png?resize=638%2C440&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-tracking.png?resize=618%2C473&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-workstation-shortcuts.png?resize=595%2C445&ssl=1 +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-install.png?resize=620%2C474&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-player-installed.png?resize=589%2C441&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-image-kali.png?resize=800%2C488&ssl=1 +[16]: https://www.kali.org/get-kali/ +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-download.png?resize=800%2C764&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/extract-vmware-image.png?resize=617%2C359&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux-image-folder.png?resize=800%2C498&ssl=1 +[20]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/virtual-machine-settings-kali.png?resize=800%2C652&ssl=1 +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-vm-settings.png?resize=800%2C329&ssl=1 +[22]: https://itsfoss.com/install-vmware-tools-linux/ +[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/kali-linux-vm-login.png?resize=800%2C540&ssl=1 +[24]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/vmware-kali-linux.png?resize=800%2C537&ssl=1 +[25]: https://itsfoss.com/best-kali-linux-tools/ From ca4ad61dcc55eb120f4b52f57ee53894579bc751 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 14:46:06 +0800 Subject: [PATCH 0446/1588] PUB @wxy https://linux.cn/article-13805-1.html --- .../20210917 How to Install Kali Linux in VMware.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20210917 How to Install Kali Linux in VMware.md (100%) diff --git a/translated/tech/20210917 How to Install Kali Linux in VMware.md b/published/20210917 How to Install Kali Linux in VMware.md similarity index 100% rename from translated/tech/20210917 How to Install Kali Linux in VMware.md rename to published/20210917 How to Install Kali Linux in VMware.md From 6848679ea84481f9f62ffd66489476e3a15246f4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 15:15:05 +0800 Subject: [PATCH 0447/1588] PRF&PUB @geekpi https://linux.cn/article-13806-1.html --- ...smart quotes with the Linux sed command.md | 22 +++++++++---------- 1 file changed, 10 insertions(+), 12 deletions(-) rename {translated/tech => published}/20210913 Replace smart quotes with the Linux sed command.md (82%) diff --git a/translated/tech/20210913 Replace smart quotes with the Linux sed command.md b/published/20210913 Replace smart quotes with the Linux sed command.md similarity index 82% rename from translated/tech/20210913 Replace smart quotes with the Linux sed command.md rename to published/20210913 Replace smart quotes with the Linux sed command.md index d6f3cc087a..753582a52d 100644 --- a/translated/tech/20210913 Replace smart quotes with the Linux sed command.md +++ b/published/20210913 Replace smart quotes with the Linux sed command.md @@ -3,31 +3,31 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13806-1.html" 用 Linux sed 命令替换智能引号 ====== -用你喜欢的 sed 版本去除“智能”引号。 -![Coding on a computer][1] -In typography, a pair of quotation marks were traditionally oriented toward one another. They look like this: +> 用你喜欢的 sed 版本去除“智能”引号。 + +![](https://img.linux.net.cn/data/attachment/album/202109/21/151406chun5nyumy8wyu5y.png) + 在排版学中,一对引号传统上是朝向彼此的。它们看起来像这样: “智能引号” -随着计算机在二十世纪中期的普及,这种方向往往被放弃了。计算机的原始字符集没有太多的空间,所以在 ASCII 规范中,两个双引号和两个单引号被缩减为各一个是合理的。如今,通用的字符集是 Unicode,有足够的空间容纳许多花哨的引号和撇号,但许多人已经习惯了开头和结尾引号都只有一个字符的极简主义。此外,计算机实际上将不同种类的引号和撇号视为不同的字符。换句话说,对计算机来说,右双引号与左双引号或直引号是不同的。 +随着计算机在二十世纪中期的普及,这种朝向往往被放弃了。计算机的原始字符集没有太多的空间,所以在 ASCII 规范中,两个双引号和两个单引号被缩减为各一个是合理的。如今,通用的字符集是 Unicode,有足够的空间容纳许多花哨的引号和撇号,但许多人已经习惯了开头和结尾引号都只有一个字符的极简主义。此外,计算机实际上将不同种类的引号和撇号视为不同的字符。换句话说,对计算机来说,右双引号与左双引号或直引号是不同的。 ### 用 sed 替换智能引号 计算机并不是打字机。当你按下键盘上的一个键时,你不是在按一个带有印章的控制杆。你只是按下一个按钮,向你的计算机发送一个信号,计算机将其解释为一个显示特定预定义字符的请求。这个请求取决于你的键盘映射。作为一个 Dvorak 打字员,我目睹了人们在发现我的键盘上的 “asdf” 在屏幕上产生 “aoeu” 时脸上的困惑。你也可能按了一些特殊的组合键来产生字符,如 ™ 或 ß 或 ≠,这甚至没有印在你的键盘上。 -每个字母或字符,不管它是否印在你的键盘上,都有一个编码。字符编码可以用不同的方式表达,但对计算机来说,Unicode 序列 u2018 和 u2019 产生 **‘** 和 **’**,而代码 u201c 和 u201d 产生 **“** 和 **”** 字符。知道这些“秘密”代码意味着你可以使用 [sed][2] 这样的命令以编程方式替换它们。任何版本的 sed 都可以,所以你可以使用 GNU sed 或 BSD sed,甚至是 [Busybox][3] sed。 +每个字母或字符,不管它是否印在你的键盘上,都有一个编码。字符编码可以用不同的方式表达,但对计算机来说,Unicode 序列 u2018 和 u2019 产生 `‘` 和 `’`,而代码 u201c 和 u201d 产生 `“` 和 `”` 字符。知道这些“秘密”代码意味着你可以使用 [sed][2] 这样的命令以编程方式替换它们。任何版本的 sed 都可以,所以你可以使用 GNU sed 或 BSD sed,甚至是 [Busybox][3] sed。 下面是我使用的简单的 shell 脚本: - ``` #!/bin/sh # GNU All-Permissive License @@ -39,7 +39,6 @@ $SED -i -e "s/[$SDQUO]/\'/g" -e "s/[$RDQUO]/\"/g" "${1}" 将此脚本保存为 `fixquotes.sh`,然后创建一个包含智能引号的单独测试文件: - ``` ‘Single quote’ “Double quote” @@ -47,7 +46,6 @@ $SED -i -e "s/[$SDQUO]/\'/g" -e "s/[$RDQUO]/\"/g" "${1}" 运行该脚本,然后使用 [cat][4] 命令查看结果: - ``` $ sh ./fixquotes.sh test.txt $ cat test.txt @@ -68,7 +66,7 @@ via: https://opensource.com/article/21/9/sed-replace-smart-quotes 作者:[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 66a193187bd61efc8cda680e2a67cffca9f31860 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 21:28:11 +0800 Subject: [PATCH 0448/1588] APL --- .../tech/20210908 Apps for daily needs part 5- video editors.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210908 Apps for daily needs part 5- video editors.md b/sources/tech/20210908 Apps for daily needs part 5- video editors.md index 0b927ea99c..72aa602cf7 100644 --- a/sources/tech/20210908 Apps for daily needs part 5- video editors.md +++ b/sources/tech/20210908 Apps for daily needs part 5- video editors.md @@ -2,7 +2,7 @@ [#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/" [#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From fab4cdd7656241ae4391ba65fee713cf21f2fc31 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 21:52:51 +0800 Subject: [PATCH 0449/1588] TSL&PRF --- ...s for daily needs part 5- video editors.md | 88 ------------------- ...s for daily needs part 5- video editors.md | 78 ++++++++++++++++ 2 files changed, 78 insertions(+), 88 deletions(-) delete mode 100644 sources/tech/20210908 Apps for daily needs part 5- video editors.md create mode 100644 translated/tech/20210908 Apps for daily needs part 5- video editors.md diff --git a/sources/tech/20210908 Apps for daily needs part 5- video editors.md b/sources/tech/20210908 Apps for daily needs part 5- video editors.md deleted file mode 100644 index 72aa602cf7..0000000000 --- a/sources/tech/20210908 Apps for daily needs part 5- video editors.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: subject: "Apps for daily needs part 5: video editors" -[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/" -[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Apps for daily needs part 5: video editors -====== - -![][1] - -Photo by [Brooke Cagle][2] on [Unsplash][3] - -Video editing has become a popular activity. People need video editors for various reasons, such as work, education, or just a hobby. There are also now many platforms for sharing video on the internet. Almost all social media and chat messengers provide features for sharing videos. This article will introduce some of the open source video editors 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 video editors category. - -### Kdenlive - -When anyone asks about an open source video editor on Linux, the answer that often comes up is Kdenlive. It is a very popular video editor among open source users. This is because its features are complete for general purposes and are easy to use by someone who is not a professional. - -Kdenlive supports multi-track, so you can combine audio, video, images, and text from multiple sources. This application also supports various video and audio formats without having to convert them first. In addition, Kdenlive provides a wide variety of effects and transitions to support your creativity in producing cool videos. Some of the features that Kdenlive provides are titler for creating 2D titles, audio and video scopes, proxy editing, timeline preview, keyframeable effects, and many more. - -![][5] - -More information is available at this link: - -* * * - -### Shotcut - -Shotcut has more or less the same features as Kdenlive. This application is a general purposes video editor. It has a fairly simple interface, but with complete features to meet the various needs of your video editing work. - -Shotcut has a complete set of features for a video editor, ranging from simple editing to high-level capabilities. It also supports various video, audio, and image formats. You don’t need to worry about your work history, because this application has unlimited undo and redo. Shotcut also provides a variety of video and audio effects features, so you have freedom to be creative in producing your video works. Some of the features offered are audio filters, audio mixing, cross fade audio and video dissolve transition, tone generator, speed change, video compositing, 3 way color wheels, track compositing/blending mode, video filters, etc. - -![][6] - -More information is available at this link: - -* * * - -### Pitivi - -Pitivi will be the right choice if you want a video editor that has an intuitive and clean user interface. You will feel comfortable with how it looks and will have no trouble finding the features you need. This application is classified as very easy to learn, especially if you need an application for simple editing needs. However, Pitivi still offers a variety of features, like trimming & cutting, sound mixing, keyframeable audio effects, audio waveforms, volume keyframe curves, video transitions, etc. - -![][7] - -More information is available at this link: - -* * * - -### Cinelerra - -Cinelerra is a video editor that has been in development for a long time. There are tons of features for your video work such as built-in frame render, various video effects, unlimited layers, 8K support, multi camera support, video audio sync, render farm, motion graphics, live preview, etc. This application is maybe not suitable for those who are just learning. I think it will take you a while to get used to the interface, especially if you are already familiar with other popular video editor applications. But Cinelerra will still be an interesting choice as your video editor. - -![][8] - -More information is available at this link: [][9] - -* * * - -### Conclusion - -This article presented four video editor apps for your daily needs that are available on Fedora Linux. Actually there are many other video editors that you can use in Fedora Linux. You can also use Olive (Fedora Linux repo), OpenShot (rpmfusion-free) , Flowblade (rpmfusion-free) and many more. Each video editor has its own advantages. Some are better at correcting color, while others are better at a variety of transitions and effects. Some are better when it comes to how easy it is to add text. Choose the application that suits your needs. Hopefully this article can help you to choose the right video editors. If you have experience in using these applications, please share your experience in the comments. - --------------------------------------------------------------------------------- - -via: https://fedoramagazine.org/apps-for-daily-needs-part-5-video-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/08/FedoraMagz-Apps-5-video-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/video-kdenlive-1024x576.png -[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-shotcut-1024x576.png -[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-pitivi-1024x576.png -[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-cinelerra-1024x576.png -[9]: https://www.olivevideoeditor.org/ diff --git a/translated/tech/20210908 Apps for daily needs part 5- video editors.md b/translated/tech/20210908 Apps for daily needs part 5- video editors.md new file mode 100644 index 0000000000..4ef9a4d336 --- /dev/null +++ b/translated/tech/20210908 Apps for daily needs part 5- video editors.md @@ -0,0 +1,78 @@ +[#]: subject: "Apps for daily needs part 5: video editors" +[#]: via: "https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/" +[#]: author: "Arman Arisman https://fedoramagazine.org/author/armanwu/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +满足日常需求的应用(四):视频编辑器 +====== + +![][1] + +视频编辑已经成为一种流行的活动。人们出于各种原因需要视频编辑,不管是工作、教育或仅仅是一种爱好。现在也有很多平台可以在互联网上分享视频,以及几乎所有的社交媒体和聊天工具都提供分享视频的功能。本文将介绍一些你可以在 Fedora Linux 上使用的开源视频编辑器。你可能需要安装提到的这些软件才能使用。如果你不熟悉如何在 Fedora Linux 中添加软件包,请参阅我之前的文章《[安装 Fedora 34 工作站后要做的事情][4]》。这里列出了视频编辑器类别的一些日常需求的应用程序。 + +### Kdenlive + +当有人问起 Linux 上的开源视频编辑器时,经常出现的答案是 Kdenlive。它是一个在开源用户群体中非常流行的视频编辑器。这是因为它的功能对于一般用途来说是足够的,而且对于非专业人士的人来说也很容易使用。 + +Kdenlive 支持多轨编辑,因此你可以将多个来源的音频、视频、图像和文本结合起来。这个应用程序还支持各种视频和音频格式,这样你就不必事先转换它们。此外,Kdenlive 提供了各种各样的效果和转场,以支持你的创造力来制作很酷的视频。Kdenlive 提供的一些功能有:用于创建 2D 字幕的字幕器、音频和视频范围、代理编辑、时间线预览、关键帧效果等等。 + +![][5] + +更多信息可在此链接中获得: + +### Shotcut + +Shotcut 与 Kdenlive 的功能大致相同。这个应用程序是一个通用的视频编辑器。它有一个相当简单的界面,但功能齐全,可以满足你视频编辑工作的各种需要。 + +Shotcut 拥有一套完整视频编辑功能,提供了从简单的编辑到高级的功能。它还支持各种视频、音频和图像格式。你不需要担心你的编辑历史,因为这个应用程序有无限的撤销和重做功能。Shotcut 还提供了各种视频和音频效果,因此你可以自由地创造性地制作你的视频作品。它提供的一些功能有:音频过滤器、音频混合、交叉淡化的音视频溶解过渡、音调发生器、速度变化、视频合成、3 路色轮、轨道合成/混合模式、视频过滤器等。 + +![][6] + +更多信息可在此链接中获得: + +### Pitivi + +如果你想要一个具有直观和简洁用户界面的视频编辑器,Pitivi 将是正确的选择。你会对它的外观感到舒适,并且不难找到你需要的功能。这个应用程序被归类为非常容易学习,特别是如果你需要一个用于简单编辑需求的应用程序时。然而,Pitivi 仍然提供了种种功能,如修剪 & 切割、混音、关键帧音频效果、音频波形、音量关键帧曲线、视频过渡等。 + +![][7] + +更多信息可在此链接中获得: + +### Cinelerra + +Cinelerra 是一个已经开发了很久的视频编辑器。它为你的视频工作提供了大量的功能,如内置帧渲染、各种视频效果、无限的层、8K 支持、多相机支持、视频音频同步、渲染农场、动态图形、实时预览等。这个应用程序可能不适合那些刚开始学习的人。我认为你需要一段时间来适应这个界面,特别是如果你已经熟悉了其他流行的视频编辑应用程序。但 Cinelerra 仍是一个有趣的选择,可以作为你的视频编辑器。 + +![][8] + +更多信息请见此链接: + +### 总结 + +这篇文章介绍了四个在 Fedora Linux 上可用的视频编辑器应用,以满足你的日常需求。实际上,在 Fedora Linux 上还有很多其他的视频编辑器可以使用。你也可以使用 Olive(Fedora Linux 仓库)、 OpenShot(rpmfusion-free)、Flowblade(rpmfusion-free)等等。每个视频编辑器都有自己的优势。有些在纠正颜色方面比较好,而有些在各种转场和效果方面比较好。当涉及到如何轻松地添加文本时,有些则更好。请选择适合你需求的应用程序。希望这篇文章可以帮助你选择正确的视频编辑。如果你有使用这些应用程序的经验,请在评论中分享你的经验。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/apps-for-daily-needs-part-5-video-editors/ + +作者:[Arman Arisman][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://fedoramagazine.org/author/armanwu/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/08/FedoraMagz-Apps-5-video-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/video-kdenlive-1024x576.png +[6]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-shotcut-1024x576.png +[7]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-pitivi-1024x576.png +[8]: https://fedoramagazine.org/wp-content/uploads/2021/08/video-cinelerra-1024x576.png +[9]: https://www.olivevideoeditor.org/ From faed7148de564379e7d7302ba2f0da56fc628c12 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 21:56:45 +0800 Subject: [PATCH 0450/1588] PUB @wxy https://linux.cn/article-13808-1.html --- .../20210908 Apps for daily needs part 5- video editors.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210908 Apps for daily needs part 5- video editors.md (97%) diff --git a/translated/tech/20210908 Apps for daily needs part 5- video editors.md b/published/20210908 Apps for daily needs part 5- video editors.md similarity index 97% rename from translated/tech/20210908 Apps for daily needs part 5- video editors.md rename to published/20210908 Apps for daily needs part 5- video editors.md index 4ef9a4d336..b8fdeceee1 100644 --- a/translated/tech/20210908 Apps for daily needs part 5- video editors.md +++ b/published/20210908 Apps for daily needs part 5- video editors.md @@ -4,10 +4,10 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13808-1.html" -满足日常需求的应用(四):视频编辑器 +满足日常需求的应用(五):视频编辑器 ====== ![][1] From bee8d418b8e769994e26c7146f2f166176f71195 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 22:05:11 +0800 Subject: [PATCH 0451/1588] APL --- ...x Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 index c12d1e5314..086cb31c1d 100644 --- 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 @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/sudo-rm-rf/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 8db15eeed5c6a4f0d5974fb9f67e1c9b292296ae Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 21 Sep 2021 22:48:08 +0800 Subject: [PATCH 0452/1588] TSL&PRF --- ...hat is sudo rm -rf- Why is it Dangerous.md | 143 ------------------ ...hat is sudo rm -rf- Why is it Dangerous.md | 143 ++++++++++++++++++ 2 files changed, 143 insertions(+), 143 deletions(-) delete mode 100644 sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md create mode 100644 translated/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 deleted file mode 100644 index 086cb31c1d..0000000000 --- a/sources/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md +++ /dev/null @@ -1,143 +0,0 @@ -[#]: 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: "wxy" -[#]: 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 diff --git a/translated/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md b/translated/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md new file mode 100644 index 0000000000..9c5d756a43 --- /dev/null +++ b/translated/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: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +Linux 黑话解释:什么是 sudo rm -rf?为什么如此危险? +====== + +当你刚接触 Linux 时,你会经常遇到这样的建议:永远不要运行 `sudo rm -rf /`。在 Linux 世界里,围绕着 `sudo rm -rf` 有很多梗。 + +![][1] + +但似乎关于它有一些混乱的现象。在 [清理 Ubuntu 以腾出空间][2] 的教程中,我建议运行一些涉及 `sudo` 和 `rm -rf` 的命令。一位读者问我,如果 `sudo rm -rf` 是一个不应该运行的危险的 Linux 命令,我为什么要建议这样做。 + +因此,我想到了写一篇 Linux 黑话解释,以消除误解。 + +### sudo rm -rf:在做什么? + +让我们按步骤来学习。 + +`rm` 命令用于 [在 Linux 命令行中删除文件和目录][3]。 + +``` +$ rm agatha +$ +``` + +但是因为有只读的 [文件权限][4],有些文件不会被立即删除。它们必须用选项 `-f` 强制删除。 + +``` +$ rm books +rm: remove write-protected regular file 'books'? y +$ rm -f christie +$ +``` + +另外,`rm` 命令不能被用来直接删除目录(文件夹)。你必须在 `rm` 命令中使用递归选项 `-r`。 + +``` +$ rm new_dir +rm: cannot remove 'new_dir': Is a directory +``` + +因此最终,`rm -rf` 命令意味着递归地、强制删除指定的目录。 + +``` +$ rm -r new_dir +rm: remove write-protected regular file 'new_dir/books'? ^C +$ rm -rf new_dir +$ +``` + +下面是上述所有命令的截图。 + +![解释 rm 命令的例子][5] + +如果你在 `rm -rf` 命令前加入 `sudo`,你就是在删除具有 root 权限的文件。这意味着你可以删除由 [root 用户][6] 拥有的系统文件。 + +### 所以,sudo rm -rf 是一个危险的 Linux 命令? + +嗯,任何删除东西的命令都可能是危险的,如果你不确定你正在删除什么。 + +把 `rm -rf` 命令看作一把刀。刀是一个危险的东西吗?有可能。如果你用刀切蔬菜,那是好事。如果你用刀切手指,那当然是不好的。 + +`rm -rf` 命令也是如此。它本身并不危险。它毕竟是用来删除文件的。但是,如果你在不知情的情况下用它来删除重要文件,那就有问题了。 + +现在来看看 `sudo rm -rf /`。 + +你知道,使用 `sudo`,你以 root 身份运行一个命令,这允许你对系统进行任何改变。 + +`/` 是根目录的符号。`/var` 表示根目录下的 `var` 目录。`/var/log/apt` 指的是根目录的 `log` 目录下的 `apt` 目录。 + +![Linux 目录层次表示法][7] + +按照 [Linux 目录层次结构][8],Linux 文件系统中的一切都从根目录开始。如果你删除了根目录,你基本上就是删除了系统中的所有文件。 + +这就是为什么建议不要运行 `sudo rm -rf /` 命令,因为你会抹去你的整个 Linux 系统。 + +请注意,在某些情况下,你可能正在运行像 `sudo rm -rf /var/log/apt` 这样的命令,这可能是好的。同样,你必须注意你正在删除的东西,就像你必须注意你正在用刀切割的东西一样。 + +### 我在玩火:如果我运行 sudo rm -rf /,看看会发生什么呢? + +大多数 Linux 发行版都提供了一个故障安全保护,防止意外删除根目录。 + +``` +$ sudo rm -rf / +[sudo] password for abhishek: +rm: it is dangerous to operate recursively on '/' +rm: use --no-preserve-root to override this failsafe +``` + +我的意思是,人是会打错字的,如果你不小心打了 `/ var/log/apt`,而不是 `/var/log/apt`(`/` 和 `var` 之间的空格意味着你给出了 `/` 和 `var` 目录来删除),你将会删除根目录。 + +![使用 sudo rm -rf 时要注意][9] + +别担心。你的 Linux 系统会照顾到这种意外。 + +现在,如果你一心想用 `sudo rm -rf /` 来破坏你的系统呢?你将必须使用它将要求你使用的 `-no-preserve-root` 选项与之配合。 + +不,请不要自己这样做。让我做给你看看。 + +所以,我在一个虚拟机中运行基本的操作系统。我运行 `sudo rm -rf / --no-preserve-root`,你可以在下面的视频中看到灯光熄灭(大约 1 分钟)。 + +![video](https://player.vimeo.com/video/594025609) + +### 清楚了么? + +Linux 有一个活跃的社区,大多数人都会帮助新用户。 之所以说是大多数,是是因为有一些的邪恶坏人潜伏着捣乱新用户。他们经常会建议对初学者所面临的最简单的问题运行 `rm -rf /`。我认为这些白痴在这种邪恶行为中得到了某种至上主义的满足。我会立即将他们从我管理的论坛和群组中踢出去。 + +我希望这篇文章能让你更清楚地了解这些情况。你有可能仍然有一些困惑,特别是因为它涉及到根目录、文件权限和其他新用户可能不熟悉的东西。如果是这样的话,请在评论区告诉我你的疑惑,我会尽力去解决。 + +最后,请记住。不要喝酒胡搞Don’t drink and root。在运行你的 Linux 系统时要安全驾驶。 + +![][11] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/sudo-rm-rf/ + +作者:[Abhishek Prakash][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/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 ede9256ff430ab3377a8e7e5a478648afa2f2987 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Sep 2021 05:02:29 +0800 Subject: [PATCH 0453/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210922?= =?UTF-8?q?=20Install=20AnyDesk=20on=20Ubuntu=20Linux=20[GUI=20and=20Termi?= =?UTF-8?q?nal=20Methods]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md --- ... Ubuntu Linux -GUI and Terminal Methods.md | 149 ++++++++++++++++++ 1 file changed, 149 insertions(+) create mode 100644 sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md diff --git a/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md b/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md new file mode 100644 index 0000000000..4a7880a888 --- /dev/null +++ b/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md @@ -0,0 +1,149 @@ +[#]: subject: "Install AnyDesk on Ubuntu Linux [GUI and Terminal Methods]" +[#]: via: "https://itsfoss.com/install-anydesk-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install AnyDesk on Ubuntu Linux [GUI and Terminal Methods] +====== + +_**Brief: This beginner’s tutorial discusses both GUI and terminal methods of installing AnyDesk on Ubuntu-based Linux distributions.**_ + +[AnyDesk][1] is a popular remote desktop software available for Linux, Windows, BSD, macOS and mobile platforms. + +With this tool, you can remotely access other computer using AnyDesk or let someone else remotely access your system. Not everyone can access it just because two devices use AnyDesk. You have to accept the incoming connection and/or provide a password for secure connection. + +This is helpful in providing tech support to friend, family, colleagues or even to the customers. + +In this tutorial, I’ll show you both graphical and command line ways of installing AnyDesk on Ubuntu. You can use either method based on your preference. Both methods will install the same AnyDesk version on your Ubuntu system. + +The same method should be applicable to Debian and other Debian and Ubuntu based distributions such as Linux Mint, Linux Lite etc. + +Non-FOSS alert! + +AnyDesk is not open source software. It is covered here because it is available on Linux and the article’s focus is on Linux. + +### Method 1: Install AnyDesk on Ubuntu using terminal + +[Open the terminal application][2] on your system. You’ll need a tool like wget to [download files in the terminal. For th][3]at, use the following command: + +``` +sudo apt update +sudo apt install wget +``` + +The next step now is to download the GPG key of AnyDesk repository and add it to your system’s trusted keys. This way, your system will trust the software coming from this [external repository][4]. + +``` +wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo apt-key add - +``` + +You may ignore the deprecated warning about apt-key command for now. The next step is to add the AnyDesk repository to your system’s repository sources: + +``` +echo "deb http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk-stable.list +``` + +Update the package cache so that your system learns about the availability of new applications through the newly added repository. + +``` +sudo apt update +``` + +And now, you can install AnyDesk: + +``` +sudo apt install anydesk +``` + +Once that is done, you can start AnyDesk from the system menu or from the terminal itself: + +``` +anydesk +``` + +You can enjoy AnyDesk now. + +![AnyDesk running in Ubuntu][5] + +### Method 2: Install AnyDesk on Ubuntu graphically + +If you are not comfortable with the command line, no worries. You can also install AnyDesk without going into the terminal. + +You can download AnyDesk for Ubuntu from the official AnyDesk website: + +[Download AnyDesk for Linux][6] + +You’ll see a Download Now button. Click on it. + +![Download AnyDesk][7] + +When you click on the download button, it gives you options for various Linux distributions. Select the one for Ubuntu: + +![Download the appropriate file][8] + +It will download the DEB file of AnyDesk application. [Installing deb file][9] is easy. Either double click on it or right click and open with Software Install. + +![Right click on deb file and open with software center][10] + +Software Center application will be opened and you can install it from there. + +![Installing AnyDesk in Ubuntu software center][11] + +Once installed, search for it in the system menu and start from there. + +![AnyDesk installed in Ubuntu][12] + +That’s it. Not too hard, is it? + +I am not going to show the steps for using AnyDesk. I think you already have some idea about that. If not, refer to [this article][13], please. + +#### Troubleshooting tip + +When I tried to run AnyDesk from the system menu, it didn’t start. So, I started it from the terminal and it showed me this error: + +``` +[email protected]:~$ anydesk +anydesk: error while loading shared libraries: libpangox-1.0.so.0: cannot open shared object file: No such file or directory +``` + +If you see the [error while loading shared libraries][14] message, you install the package it is complaining about. Here’s what I did in my case: + +``` +sudo apt install libpangox-1.0-0 +``` + +That solved the issue for me and I hope it fixes for you as well. + +If you have any questions related to this topic, please let me know in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-anydesk-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://anydesk.com/en +[2]: https://itsfoss.com/open-terminal-ubuntu/ +[3]: https://itsfoss.com/download-files-from-linux-terminal/ +[4]: https://itsfoss.com/adding-external-repositories-ubuntu/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/anydesk-running-in-ubuntu.png?resize=800%2C418&ssl=1 +[6]: https://anydesk.com/en/downloads/linux +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/any-desk-ubuntu-download.webp?resize=800%2C312&ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/any-desk-ubuntu-download-1.webp?resize=800%2C427&ssl=1 +[9]: https://itsfoss.com/install-deb-files-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-anaydesk-ubuntu.png?resize=800%2C403&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-anydesk-in-ubuntu-software-center.png?resize=781%2C405&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/anydesk-installed-in-ubuntu.png?resize=759%2C196&ssl=1 +[13]: https://support.anydesk.com/Access +[14]: https://itsfoss.com/solve-open-shared-object-file-quick-tip/ From 405e00ee5fa10a930ae5055a9e339dac675220b1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Sep 2021 05:02:50 +0800 Subject: [PATCH 0454/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210921?= =?UTF-8?q?=203=20ways=20to=20test=20your=20API=20with=20Python?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210921 3 ways to test your API with Python.md --- ...921 3 ways to test your API with Python.md | 513 ++++++++++++++++++ 1 file changed, 513 insertions(+) create mode 100644 sources/tech/20210921 3 ways to test your API with Python.md diff --git a/sources/tech/20210921 3 ways to test your API with Python.md b/sources/tech/20210921 3 ways to test your API with Python.md new file mode 100644 index 0000000000..a996dfc7a4 --- /dev/null +++ b/sources/tech/20210921 3 ways to test your API with Python.md @@ -0,0 +1,513 @@ +[#]: subject: "3 ways to test your API with Python" +[#]: via: "https://opensource.com/article/21/9/unit-test-python" +[#]: author: "Miguel Brito https://opensource.com/users/miguendes" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 ways to test your API with Python +====== +Unit testing can be daunting, but these Python modules will make your +life much easier. +![Puzzle pieces coming together to form a computer screen][1] + +In this tutorial, you'll learn how to unit test code that performs HTTP requests. In other words, you'll see the art of API unit testing in Python. + +Unit tests are meant to test a single unit of behavior. In testing, a well-known rule of thumb is to isolate code that reaches external dependencies. + +For instance, when testing a code that performs HTTP requests, it's recommended to replace the real call with a fake call during test time. This way, you can unit test it without performing a real HTTP request every time you run the test. + +The question is, _how can you isolate the code?_ + +Hopefully, that's what I'm going to answer in this post! I'll not only show you how to do it but also weigh the pros and cons of three different approaches. + +Requirements: + + * [Python 3.8][2] + * pytest-mock + * requests + * flask + * responses + * VCR.py + + + +### Demo app using a weather REST API + +To put this problem in context, imagine that you're building a weather app. This app uses a third-party weather REST API to retrieve weather information for a particular city. One of the requirements is to generate a simple HTML page, like the image below: + +![web page displaying London weather][3] + +The weather in London, OpenWeatherMap. Image is the author's own. + +To get the information about the weather, you must find it somewhere. Fortunately, [OpenWeatherMap][2] provides everything you need through its REST API service. + +_Ok, that's cool, but how can I use it?_ + +You can get everything you need by sending a `GET` request to: `https://api.openweathermap.org/data/2.5/weather?q={city_name}&appid={api_key}&units=metric`. For this tutorial, I'll parameterize the city name and settle on the metric unit. + +### Retrieving the data + +To retrieve the weather data, use `requests`. You can create a function that receives a city name as a parameter and returns a JSON. The JSON will contain the temperature, weather description, sunset, sunrise time, and so on. + +The example below illustrates such a function: + + +``` +def find_weather_for(city: str) -> dict: +    """Queries the weather API and returns the weather data for a particular city.""" +    url = API.format(city_name=city, api_key=API_KEY) +    resp = requests.get(url) +    return resp.json() +``` + +The URL is made up of two global variables: + + +``` +BASE_URL = "" +API = BASE_URL + "?q={city_name}&appid={api_key}&units=metric" +``` + +The API returns a JSON in this format: + + +``` +{ +  "coord": { +    "lon": -0.13, +    "lat": 51.51 +  }, +  "weather": [ +    { +      "id": 800, +      "main": "Clear", +      "description": "clear sky", +      "icon": "01d" +    } +  ], +  "base": "stations", +  "main": { +    "temp": 16.53, +    "feels_like": 15.52, +    "temp_min": 15, +    "temp_max": 17.78, +    "pressure": 1023, +    "humidity": 72 +  }, +  "visibility": 10000, +  "wind": { +    "speed": 2.1, +    "deg": 40 +  }, +  "clouds": { +    "all": 0 +  }, +  "dt": 1600420164, +  "sys": { +    "type": 1, +    "id": 1414, +    "country": "GB", +    "sunrise": 1600407646, +    "sunset": 1600452509 +  }, +  "timezone": 3600, +  "id": 2643743, +  "name": "London", +  "cod": 200 +``` + +The data is returned as a Python dictionary when you call `resp.json()`. In order to encapsulate all the details, you can represent them as a `dataclass`. This class has a factory method that gets the dictionary and returns a `WeatherInfo` instance. + +This is good because you keep the representation stable. For example, if the API changes the way it structures the JSON, you can change the logic in just one place, the `from_dict` method. Other parts of the code won't be affected. You can even get information from different sources and combine them in the `from_dict` method! + + +``` +@dataclass +class WeatherInfo: +    temp: float +    sunset: str +    sunrise: str +    temp_min: float +    temp_max: float +    desc: str + +    @classmethod +    def from_dict(cls, data: dict) -> "WeatherInfo": +        return cls( +            temp=data["main"]["temp"], +            temp_min=data["main"]["temp_min"], +            temp_max=data["main"]["temp_max"], +            desc=data["weather"][0]["main"], +            sunset=format_date(data["sys"]["sunset"]), +            sunrise=format_date(data["sys"]["sunrise"]), +        ) +``` + +Now, you'll create a function called `retrieve_weather`. You'll use this function to call the API and return a `WeatherInfo` so you can build your HTML page. + + +``` +def retrieve_weather(city: str) -> WeatherInfo: +    """Finds the weather for a city and returns a WeatherInfo instance.""" +    data = find_weather_for(city) +    return WeatherInfo.from_dict(data) +``` + +Good, you have the basic building blocks for our app. Before moving forward, unit test those functions. + +### 1\. Testing the API using mocks + +[According to Wikipedia][4], a mock object is an object that simulates the behavior of a real object by mimicking it. In Python, you can mock any object using the `unittest.mock` lib that is part of the standard library. To test the `retrieve_weather` function, you can then mock `requests.get` and return static data. + +#### pytest-mock + +For this tutorial, you'll use `pytest` as your testing framework of choice. The `pytest` library is very extensible through plugins. To accomplish our mocking goals, use `pytest-mock`. This plugin abstracts a bunch of setups from `unittest.mock` and makes your testing code very concise. If you are curious, I discuss more about it in [another blog post][5]. + +_Ok, enough talking, show me the code._ + +Here's a complete test case for the `retrieve_weather` function. This test uses two fixtures: One is the `mocker` fixture provided by the `pytest-mock` plugin. The other one is ours. It's just the static data you saved from a previous request. + + +``` +@pytest.fixture() +def fake_weather_info(): +    """Fixture that returns a static weather data.""" +    with open("tests/resources/weather.json") as f: +        return json.load(f) + +[/code] [code] + +def test_retrieve_weather_using_mocks(mocker, fake_weather_info): +    """Given a city name, test that a HTML report about the weather is generated +    correctly.""" +    # Creates a fake requests response object +    fake_resp = mocker.Mock() +    # Mock the json method to return the static weather data +    fake_resp.json = mocker.Mock(return_value=fake_weather_info) +    # Mock the status code +    fake_resp.status_code = HTTPStatus.OK + +    mocker.patch("weather_app.requests.get", return_value=fake_resp) + +    weather_info = retrieve_weather(city="London") +    assert weather_info == WeatherInfo.from_dict(fake_weather_info) +``` + +If you run the test, you get the following output: + + +``` +============================= test session starts ============================== +...[omitted]... +tests/test_weather_app.py::test_retrieve_weather_using_mocks PASSED      [100%] +============================== 1 passed in 0.20s =============================== +Process finished with exit code 0 +``` + +Great, your tests pass! But... Life is not a bed of roses. This test has pros and cons. I'll take a look at them. + +#### Pros + +Well, one pro already discussed is that by mocking the API's return, you make your tests easier. Isolate the communication with the API and make the test predictable. It will always return what you want. + +#### Cons + +As for cons, the problem is, what if you don't want to use `requests` anymore and decide to go with the standard library's `urllib`. Every time you change the implementation of `find_weather_for`, you will have to adapt the test. A good test doesn't change when your implementation changes. So, by mocking, you end up coupling your test with the implementation. + +Also, another downside is the amount of setup you have to do before calling the function—at least three lines of code. + + +``` +... +    # Creates a fake requests response object +    fake_resp = mocker.Mock() +    # Mock the json method to return the static weather data +    fake_resp.json = mocker.Mock(return_value=fake_weather_info) +    # Mock the status code +    fake_resp.status_code = HTTPStatus.OK +... +``` + +_Can I do better?_ + +Yes, please, follow along. I'll see now how to improve it a bit. + +### Using responses + +Mocking `requests` using the `mocker` feature has the downside of having a long setup. A good way to avoid that is to use a library that intercepts `requests` calls and patches them. There is more than one lib for that, but the simplest to me is `responses`. Let's see how to use it to replace `mock`. + + +``` +@responses.activate +def test_retrieve_weather_using_responses(fake_weather_info): +    """Given a city name, test that a HTML report about the weather is generated +    correctly.""" +    api_uri = API.format(city_name="London", api_key=API_KEY) +    responses.add(responses.GET, api_uri, json=fake_weather_info, status=HTTPStatus.OK) + +    weather_info = retrieve_weather(city="London") +    assert weather_info == WeatherInfo.from_dict(fake_weather_info) +``` + +Again, this function makes use of our `fake_weather_info` fixture. + +Next, run the test: + + +``` +============================= test session starts ============================== +... +tests/test_weather_app.py::test_retrieve_weather_using_responses PASSED  [100%] +============================== 1 passed in 0.19s =============================== +``` + +Excellent! This test pass too. But... It's still not that great. + +#### Pros + +The good thing about using libraries like `responses` is that you don't need to patch `requests` ourselves. You save some setup by delegating the abstraction to the library. However, in case you haven't noticed, there are problems. + +#### Cons + +Again, the problem is, much like `unittest.mock`, your test is coupled to the implementation. If you replace `requests`, your test breaks. + +### 2\. Testing the API using an adapter + +_If by using mocks I couple our tests, what can I do?_ + +Imagine the following scenario: Say that you can no longer use `requests`, and you'll have to replace it with `urllib` since it comes with Python. Not only that, you learned the lesson of not coupling test code with implementation, and you want to avoid that in the future. You want to replace `urllib` and not have to rewrite the tests. + +It turns out you can abstract away the code that performs the `GET` request. + +_Really? How?_ + +You can abstract it by using an adapter. The adapter is a design pattern used to encapsulate or wrap the interface of other classes and expose it as a new interface. This way, you can change the adapters without changing our code. For example, you can encapsulate the details about `requests` in our `find_weather_for` and expose it via a function that takes only the URL. + +So, this: + + +``` +def find_weather_for(city: str) -> dict: +    """Queries the weather API and returns the weather data for a particular city.""" +    url = API.format(city_name=city, api_key=API_KEY) +    resp = requests.get(url) +    return resp.json() +``` + +Becomes this: + + +``` +def find_weather_for(city: str) -> dict: +    """Queries the weather API and returns the weather data for a particular city.""" +    url = API.format(city_name=city, api_key=API_KEY) +    return adapter(url) +``` + +And the adapter becomes this: + + +``` +def requests_adapter(url: str) -> dict: +    resp = requests.get(url) +    return resp.json() +``` + +Now it's time to refactor our `retrieve_weather` function: + + +``` +def retrieve_weather(city: str) -> WeatherInfo: +    """Finds the weather for a city and returns a WeatherInfo instance.""" +    data = find_weather_for(city, adapter=requests_adapter) +    return WeatherInfo.from_dict(data) +``` + +So, if you decide to change this implementation to one that uses `urllib`, just swap the adapters: + + +``` +def urllib_adapter(url: str) -> dict: +    """An adapter that encapsulates urllib.urlopen""" +    with urllib.request.urlopen(url) as response: +        resp = response.read() +    return json.loads(resp) + +[/code] [code] + +def retrieve_weather(city: str) -> WeatherInfo: +    """Finds the weather for a city and returns a WeatherInfo instance.""" +    data = find_weather_for(city, adapter=urllib_adapter) +    return WeatherInfo.from_dict(data) +``` + +_Ok, how about the tests?_ + +To test r`etrieve_weather`, just create a fake adapter that is used during test time: + + +``` +@responses.activate +def test_retrieve_weather_using_adapter( +    fake_weather_info, +): +    def fake_adapter(url: str): +        return fake_weather_info + +    weather_info = retrieve_weather(city="London", adapter=fake_adapter) +    assert weather_info == WeatherInfo.from_dict(fake_weather_info) +``` + +If you run the test you get: + + +``` +============================= test session starts ============================== +tests/test_weather_app.py::test_retrieve_weather_using_adapter PASSED    [100%] +============================== 1 passed in 0.22s =============================== +``` + +#### Pros + +The pro for this approach is that you successfully decoupled your test from the implementation. Use [dependency injection][6] to inject a fake adapter during test time. Also, you can swap the adapter at any time, including during runtime. You did all of this without changing the behavior. + +#### Cons + +The cons are that, since you're using a fake adapter for tests, if you introduce a bug in the adapter you employ in the implementation, your test won't catch it. For example, say that we pass a faulty parameter to `requests`, like this: + + +``` +def requests_adapter(url: str) -> dict: +    resp = requests.get(url, headers=<some broken headers>) +    return resp.json() +``` + +This adapter will fail in production, and the unit tests won't catch it. But truth to be told, you also have the same problem with the previous approach. That's why you always need to go beyond unit tests and also have integration tests. That being said, consider another option. + +### 3\. Testing the API using VCR.py + +Now it's finally the time to discuss our last option. I have only found about it quite recently, frankly. I've been using mocks for a long time and always had some problems with them. `VCR.py` is a library that simplifies a lot of the tests that make HTTP requests. + +It works by recording the HTTP interaction the first time you run the test as a flat YAML file called a _cassette_. Both the request and the response are serialized. When you run the test for the second time, `VCR.py` will intercept the call and return a response for the request made. + +Now see how to test `retrieve_weather` using `VCR.py below:` + + +``` +@vcr.use_cassette() +def test_retrieve_weather_using_vcr(fake_weather_info): +    weather_info = retrieve_weather(city="London") +    assert weather_info == WeatherInfo.from_dict(fake_weather_info) +``` + +_Wow, is that it? No setup? What is that `@vcr.use_cassette()`?_ + +Yes, that's it! There is no setup, just a `pytest` annotation to tell VCR to intercept the call and save the cassette file. + +_What does the cassette file look like?_ + +Good question. There's a bunch of things in it. This is because VCR saves every detail of the interaction. + + +``` +interactions: +\- request: +    body: null +    headers: +      Accept: +      - '*/*' +      Accept-Encoding: +      - gzip, deflate +      Connection: +      - keep-alive +      User-Agent: +      - python-requests/2.24.0 +    method: GET +    uri: [https://api.openweathermap.org/data/2.5/weather?q=London\&appid=\][7]<YOUR API KEY HERE>&units=metric +  response: +    body: +      string: '{"coord":{"lon":-0.13,"lat":51.51},"weather":[{"id":800,"main":"Clear","description":"clearsky","icon":"01d"}],"base":"stations","main":{"temp":16.53,"feels_like":15.52,"temp_min":15,"temp_max":17.78,"pressure":1023,"humidity":72},"visibility":10000,"wind":{"speed":2.1,"deg":40},"clouds":{"all":0},"dt":1600420164,"sys":{"type":1,"id":1414,"country":"GB","sunrise":1600407646,"sunset":1600452509},"timezone":3600,"id":2643743,"name":"London","cod":200}' +    headers: +      Access-Control-Allow-Credentials: +      - 'true' +      Access-Control-Allow-Methods: +      - GET, POST +      Access-Control-Allow-Origin: +      - '*' +      Connection: +      - keep-alive +      Content-Length: +      - '454' +      Content-Type: +      - application/json; charset=utf-8 +      Date: +      - Fri, 18 Sep 2020 10:53:25 GMT +      Server: +      - openresty +      X-Cache-Key: +      - /data/2.5/weather?q=london&units=metric +    status: +      code: 200 +      message: OK +version: 1 +``` + +_That's a lot!_ + +Indeed! The good thing is that you don't need to care much about it. `VCR.py` takes care of that for you. + +#### Pros + +Now, for the pros, I can list at least five things: + + * No setup code. + * Tests remain isolated, so it's fast. + * Tests are deterministic. + * If you change the request, like by using incorrect headers, the test will fail. + * It's not coupled to the implementation, so you can swap the adapters, and the test will pass. The only thing that matters is that you request is the same. + + + +#### Cons + +Again, despite the enormous benefits compared to mocking, there are still problems. + +If the API provider changes the format of the data for some reason, the test will still pass. Fortunately, this is not very frequent, and API providers usually version their APIs before introducing such breaking changes. Also, unit tests are not meant to access the external API, so there isn't much to do here. + +Another thing to consider is having end-to-end tests in place. These tests will call the server every time it runs. As the name says, it's a more broad test and slow. They cover a lot more ground than unit tests. In fact, not every project will need to have them. So, in my view, `VCR.py` is more than enough for most people's needs. + +### Conclusion + +This is it. I hope you've learned something useful today. Testing API client applications can be a bit daunting. Yet, when armed with the right tools and knowledge, you can tame the beast. + +You can find the full app on [my GitHub][8]. + +* * * + +_This article was originally published on the [author's personal blog][9] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/unit-test-python + +作者:[Miguel Brito][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/miguendes +[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://miguendes.me/how-i-set-up-my-python-workspace +[3]: https://opensource.com/sites/default/files/sbzkkiywh.jpeg +[4]: https://en.wikipedia.org/wiki/Mock_object +[5]: https://miguendes.me/7-pytest-plugins-you-must-definitely-use +[6]: https://stackoverflow.com/questions/130794/what-is-dependency-injection +[7]: https://api.openweathermap.org/data/2.5/weather?q=London\&appid=\ +[8]: https://github.com/miguendes/tutorials/tree/master/testing_http +[9]: https://miguendes.me/3-ways-to-test-api-client-applications-in-python From 7ec1a86a7eedb2935d11541f65b5efd99588b8ef Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 22 Sep 2021 05:03:08 +0800 Subject: [PATCH 0455/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210921?= =?UTF-8?q?=20Run=20containers=20on=20your=20Mac=20with=20Lima?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210921 Run containers on your Mac with Lima.md --- ...21 Run containers on your Mac with Lima.md | 157 ++++++++++++++++++ 1 file changed, 157 insertions(+) create mode 100644 sources/tech/20210921 Run containers on your Mac with Lima.md diff --git a/sources/tech/20210921 Run containers on your Mac with Lima.md b/sources/tech/20210921 Run containers on your Mac with Lima.md new file mode 100644 index 0000000000..698d52362b --- /dev/null +++ b/sources/tech/20210921 Run containers on your Mac with Lima.md @@ -0,0 +1,157 @@ +[#]: subject: "Run containers on your Mac with Lima" +[#]: via: "https://opensource.com/article/21/9/run-containers-mac-lima" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Run containers on your Mac with Lima +====== +Lima can help overcome the challenges of running containers on a Mac. +![Containers for shipping overseas][1] + +Running containers on your Mac can be a challenge. After all, containers are based on Linux-specific technologies like cgroups and namespaces. + +Luckily, macOS has a built-in hypervisor, allowing virtual machines (VMs) on the Mac. The hypervisor is a low-level kernel feature, not a user-facing one. + +Enter `hyperkit`, an [open source project][2] that will run VMs using the macOS hypervisor. The `hyperkit` tool is designed to be a "minimalist" VM runner. Unlike, say, VirtualBox, it does not come with fancy UI features to manage VMs. + +You can grab `hyperkit`, a minimalist Linux distribution running a container manager, and plumb all the pieces together. This would be a lot of moving parts, and sounds like a lot of work. Especially if you want to make the network connections a bit more seamless by using `vpnkit`, an open source project to create a VM's network that feels more like part of the host's network. + +### Lima + +There is no reason to go to all that effort, when [the `lima` project][3] has figured out the details. One of the easiest ways to get `lima` running is with [Homebrew][4]. You can install `lima` with this command: + + +``` +`$ brew install lima` +``` + +After installation, which might take a while, it is time to begin having some fun. In order to let `lima` know you are ready for some fun, you need to start it. Here's the command: + + +``` +`$ limactl start` +``` + +If this is your first time, you will be asked if you like the defaults or whether you want to change any of them. The defaults are pretty safe, but I like to live on the wild side. This is why I jump into an editor and make the following modifications from: + + +``` + - location: "~" +    # CAUTION: `writable` SHOULD be false for the home directory. +    # Setting `writable` to true is possible but untested and dangerous. +    writable: false +``` + +to: + + +``` +  - location: "~" +    # I *also* like to live dangerously -- Austin Powers +    writable: true +``` + +As it says in the comment, this can be dangerous. Many existing workflows, sadly, depend on this mounting to be read-write. + +By default, `lima` runs `containerd` to manage containers. The `containerd` manager is also a pretty frill-less one. While it is not uncommon to use a wrapper daemon, like `dockerd`, to add those nice-to-have ergonomics, there is another way. + +### The nerdctl tool + +The `nerdctl` tool is a drop-in replacement for the Docker client which puts those features in the client, not the server. The `lima` tool allows running `nerdctl` without installing it locally, directly from inside the VM. + +Putting it all together, it is time to run a container! This container will run an HTTP server. You can create the files on your Mac: + + +``` +$ ls +index.html +$ cat index.html +hello +``` + +Now, mount and forward the ports: + + +``` +$ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python +root@9486145449ab:/# +``` + +Inside the container, run a simple web server: + + +``` +$ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python +root@9486145449ab:/# cd /html/ +root@9486145449ab:/html# python -m http.server 8000 +Serving HTTP on 0.0.0.0 port 8000 () ... +``` + +From a different terminal, you can check that everything looks good: + + +``` +$ curl localhost:8000 +hello +``` + +Back on the container, there is a log message documenting the HTTP client's connection: + + +``` +`10.4.0.1 - - [09/Sep/2021 14:59:08] "GET / HTTP/1.1" 200 -` +``` + +One file is not enough, so times to make some things better. **CTRL-C** the server, and add another file: + + +``` +^C +Keyboard interrupt received, exiting. +root@9486145449ab:/html# echo goodbye > foo.html +root@9486145449ab:/html# python -m http.server 8000 +Serving HTTP on 0.0.0.0 port 8000 () ... +``` + +Check that you can see the new file: + + +``` +$ curl localhost:8000/foo.html +goodbye +``` + +### Wrap up + +To recap, installing `lima` takes a while, but after you are done, you can do the following: + + * Run containers. + * Mount arbitrary sub-directories of your home directory into containers. + * Edit files in those directories. + * Run network servers that appear to Mac programs like they are running on localhost. + + + +All with `lima nerdctl`. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/run-containers-mac-lima + +作者:[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/lead-images/containers_2015-2-osdc-lead.png?itok=kAfHrBoy (Containers for shipping overseas) +[2]: https://www.docker.com/blog/docker-unikernels-open-source/ +[3]: https://github.com/lima-vm/lima +[4]: https://brew.sh/ From 06dffa98feafd305ca1bc18e3b99e57d86ac830d Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 Sep 2021 08:43:59 +0800 Subject: [PATCH 0456/1588] translating --- ... and tasks with the Linux watch command.md | 124 ------------------ ... and tasks with the Linux watch command.md | 123 +++++++++++++++++ 2 files changed, 123 insertions(+), 124 deletions(-) delete mode 100644 sources/tech/20210916 Watch commands and tasks with the Linux watch command.md create mode 100644 translated/tech/20210916 Watch commands and tasks with the Linux watch command.md diff --git a/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md b/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md deleted file mode 100644 index ec01b2f5ad..0000000000 --- a/sources/tech/20210916 Watch commands and tasks with the Linux watch command.md +++ /dev/null @@ -1,124 +0,0 @@ -[#]: subject: "Watch commands and tasks with the Linux watch command" -[#]: via: "https://opensource.com/article/21/9/linux-watch-command" -[#]: author: "Moshe Zadka https://opensource.com/users/moshez" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Watch commands and tasks with the Linux watch command -====== -See how the watch command can let you know when a task has been -completed or a command has been executed. -![Clock, pen, and notepad on a desk][1] - -There are many times when you need to wait for something to finish, such as: - - * A file download. - * Creating or extracting a [tar][2] file. - * An [Ansible][3] job. - - - -Some of these processes have some sort of progress indication, but sometimes the process is run through a layer of abstraction, and the only way to measure the progress is through its side effects. Some of these might be: - - * A file being downloaded keeps growing. - * A directory extracted from a tarball fills up with files. - * The Ansible job builds a [container][4]. - - - -You can query all of these things with commands like these: - - -``` -$ ls -l downloaded-file -$ find . | wc -l -$ podman ps -$ docker ps -``` - -But running these commands over and over, even if it is with the convenience of [Bash history][5] and the **Up Arrow**, is tedious. - -Another approach is to write a little Bash script to automate these commands for you: - - -``` -while : -do -  docker ps -  sleep 2 -done -``` - -But such scripts can also become tedious to write. You could write a little generic script and package it, so it's always available to you. Luckily, other open source developers have already been there and done that. - -The result is the command `watch`. - -### Installing watch - -The `watch` command is part of the [`procps-ng` package][6], so if you're on Linux, you already have it installed. - -On macOS, install `watch` using [MacPorts][7] or [Homebrew][8]. On Windows, use [Chocolatey][9]. - -### Using watch - -The `watch` command periodically runs a command and shows its output. It has some text-terminal niceties, so only the latest output is on the screen. - -The simplest usage is: `watch `. - -For example, prefixing the `docker ps` command with `watch` works like this: - - -``` -`$ watch docker ps` -``` - -The `watch` command, and a few creative Unix command-line tricks, can generate ad-hoc dashboards. For example, to count audit events: - - -``` -`$ watch 'grep audit: /var/log/kern.log |wc -l'` -``` - -In the last example, it is probably useful if there's a visual indication that the number of audit events changed. If change is expected, but you want something to look "different," `watch --differences` works well. It highlights any differences from the last run. This works especially well if you are grepping in multiple files, so you can easily see which one changed. - -If changes are not expected, you can ask for them to be highlighted "permanently" to know which ones to investigate by using `watch --differences=permanent`. This is often more useful. - -### Controlling frequency - -Finally, sometimes the command might be resource-intensive and should not be run too frequently. The `-n` parameter controls the frequency. Watch uses two seconds by default, but `watch -n 10` might be appropriate for something more resource-intensive, like grepping for a pattern in any file in a subdirectory: - - -``` -`$ watch -n 10 'find . -type f | xargs grep suspicious-pattern'` -``` - -### Watch a command with watch - -The `watch` command is useful for many ad-hoc system administration tasks where you need to wait for some time-consuming step, without a progress bar, before moving on to the next one. Though this is not a great situation to be in, `watch` can make it slightly better—and give you time to start working on those notes for the retrospective! Download the **[cheat sheet][10] **to keep helpful syntax and options close at hand. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/linux-watch-command - -作者:[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/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 (Clock, pen, and notepad on a desk) -[2]: https://opensource.com/article/17/7/how-unzip-targz-file -[3]: https://opensource.com/resources/what-ansible -[4]: https://opensource.com/resources/what-docker -[5]: https://opensource.com/article/20/6/bash-history-control -[6]: https://opensource.com/article/21/8/linux-procps-ng -[7]: https://opensource.com/article/20/11/macports -[8]: https://opensource.com/article/20/6/homebrew-mac -[9]: https://opensource.com/article/20/3/chocolatey -[10]: https://opensource.com/downloads/watch-cheat-sheet diff --git a/translated/tech/20210916 Watch commands and tasks with the Linux watch command.md b/translated/tech/20210916 Watch commands and tasks with the Linux watch command.md new file mode 100644 index 0000000000..60226c9c42 --- /dev/null +++ b/translated/tech/20210916 Watch commands and tasks with the Linux watch command.md @@ -0,0 +1,123 @@ +[#]: subject: "Watch commands and tasks with the Linux watch command" +[#]: via: "https://opensource.com/article/21/9/linux-watch-command" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 Linux 的 watch 命令观察命令和任务 +====== +了解 watch 命令如何让你知道任务已完成或命令已执行。 +![Clock, pen, and notepad on a desk][1] + +有很多时候,你需要等待一些事情的完成,比如: + + * 一个文件的下载。 + * 创建或解压一个 [tar][2] 文件。 + * 一个 [Ansible][3] 作业。 + + + +其中一些进程有进度指示,但有时进程是通过一层抽象运行的,衡量进度的唯一方法是通过其副作用。其中一些可能是: + + * 一个正在下载的文件不断增长。 + * 一个从 tarball 中提取的目录被文件填满了。 + * Ansible 作业构建了一个[容器][4]。 + + + +你可以用这样的命令查询所有这些: + + +``` +$ ls -l downloaded-file +$ find . | wc -l +$ podman ps +$ docker ps +``` + +但是反复运行这些命令,即使是利用 [Bash 历史][5]和**向上箭头**的便利,也是很乏味的。 + +另一种方法是写一个小的 Bash 脚本来为你自动执行这些命令: + + +``` +while : +do + docker ps + sleep 2 +done +``` + +但这样的脚本写起来也会很繁琐。你可以写一个小的通用脚本,并将其打包,这样它就可以一直被你使用。幸运的是,其他开源的开发者已经有了这样的经验和做法。 + +那就是 `watch` 这个命令。 + +### 安装 watch + +`watch` 命令是 [`procps-ng` 包][6]的一部分,所以如果你是在 Linux 上,你已经安装了它。 + +在 macOS 上,使用 [MacPorts][7] 或 [Homebrew][8] 安装 `watch`。在 Windows 上,使用 [Chocolatey][9]。 + +### 使用 watch + +`watch` 命令定期运行一个命令并显示其输出。它有一些文本终端的特性,所以只有最新的输出才会出现在屏幕上。 + +最简单的用法是:`watch `。 + +例如,在 `docker ps` 命令前加上 `watch`,就可以这样操作: + + +``` +`$ watch docker ps` +``` + +用 `watch` 命令,以及一些创造性的 Unix 命令行技巧,可以生成临时的仪表盘。例如,要计算审计事件: + + +``` +`$ watch 'grep audit: /var/log/kern.log |wc -l'` +``` + +在最后一个例子中,如果有一个可视化的指示,表明审计事件的数量发生了变化,这可能是有用的。如果变化是预期的,但你想让一些东西看起来“不同”,`watch --differences` 就很好用。它可以高亮显示与上次运行的任何差异。如果你在多个文件中搜索,这一点尤其有效,所以你可以很容易地看到哪个文件发生了变化。 + +如果没有预期的变化,你可以使用 `watch --differences=permanent` 要求它们被“永久”高亮显示,以便知道哪些变化需要调查。这通常是更有用的。 + +### 控制频率 + +最后,有时该命令可能是资源密集型的,不应运行得太频繁。`-n` 参数控制频率。Watch 默认使用 2 秒,但是 `watch -n 10` 可能适合于资源密集型的情况,比如在子目录的任何文件中搜索一个模式: + + +``` +`$ watch -n 10 'find . -type f | xargs grep suspicious-pattern'` +``` + +### 用 watch 观察一个命令 + +`watch` 命令对于许多临时性的系统管理任务非常有用,在这些任务中,你需要在没有进度条的情况下等待一些耗时的步骤,然后再进入下一个步骤。尽管这种情况并不理想,但 `watch` 可以使情况稍微好转。它让你有时间为工作做回顾性笔记!"。下载**[备忘录][10]**,让有用的语法和选项触手可及。。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/linux-watch-command + +作者:[Moshe Zadka][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/desk_clock_job_work.jpg?itok=Nj4fuhl6 (Clock, pen, and notepad on a desk) +[2]: https://opensource.com/article/17/7/how-unzip-targz-file +[3]: https://opensource.com/resources/what-ansible +[4]: https://opensource.com/resources/what-docker +[5]: https://opensource.com/article/20/6/bash-history-control +[6]: https://opensource.com/article/21/8/linux-procps-ng +[7]: https://opensource.com/article/20/11/macports +[8]: https://opensource.com/article/20/6/homebrew-mac +[9]: https://opensource.com/article/20/3/chocolatey +[10]: https://opensource.com/downloads/watch-cheat-sheet From 8cc0b65c388b6cf2ca85d6372dc849a529bdc957 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 22 Sep 2021 08:47:04 +0800 Subject: [PATCH 0457/1588] translating --- ...ux command-line tool to learn more about your NVMe drives.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md b/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md index 5d6b5dc5b2..6451970d2d 100644 --- a/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md +++ b/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/nvme-cli" [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 790b7f7341aebf11f75574957070ed94090ce309 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Sep 2021 10:46:47 +0800 Subject: [PATCH 0458/1588] PRF&PUB @geekpi https://linux.cn/article-13810-1.html --- ... and tasks with the Linux watch command.md | 37 ++++++++----------- 1 file changed, 15 insertions(+), 22 deletions(-) rename {translated/tech => published}/20210916 Watch commands and tasks with the Linux watch command.md (82%) diff --git a/translated/tech/20210916 Watch commands and tasks with the Linux watch command.md b/published/20210916 Watch commands and tasks with the Linux watch command.md similarity index 82% rename from translated/tech/20210916 Watch commands and tasks with the Linux watch command.md rename to published/20210916 Watch commands and tasks with the Linux watch command.md index 60226c9c42..4bd279ab40 100644 --- a/translated/tech/20210916 Watch commands and tasks with the Linux watch command.md +++ b/published/20210916 Watch commands and tasks with the Linux watch command.md @@ -3,14 +3,16 @@ [#]: author: "Moshe Zadka https://opensource.com/users/moshez" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13810-1.html" 用 Linux 的 watch 命令观察命令和任务 ====== -了解 watch 命令如何让你知道任务已完成或命令已执行。 -![Clock, pen, and notepad on a desk][1] + +> 了解 watch 命令如何让你知道任务已完成或命令已执行。 + +![](https://img.linux.net.cn/data/attachment/album/202109/22/104541ddfgzpvud5ga55sp.jpg) 有很多时候,你需要等待一些事情的完成,比如: @@ -18,19 +20,14 @@ * 创建或解压一个 [tar][2] 文件。 * 一个 [Ansible][3] 作业。 - - 其中一些进程有进度指示,但有时进程是通过一层抽象运行的,衡量进度的唯一方法是通过其副作用。其中一些可能是: * 一个正在下载的文件不断增长。 * 一个从 tarball 中提取的目录被文件填满了。 * Ansible 作业构建了一个[容器][4]。 - - 你可以用这样的命令查询所有这些: - ``` $ ls -l downloaded-file $ find . | wc -l @@ -38,11 +35,10 @@ $ podman ps $ docker ps ``` -但是反复运行这些命令,即使是利用 [Bash 历史][5]和**向上箭头**的便利,也是很乏味的。 +但是反复运行这些命令,即使是利用 [Bash 历史][5] 和**向上箭头**的便利,也是很乏味的。 另一种方法是写一个小的 Bash 脚本来为你自动执行这些命令: - ``` while : do @@ -57,7 +53,7 @@ done ### 安装 watch -`watch` 命令是 [`procps-ng` 包][6]的一部分,所以如果你是在 Linux 上,你已经安装了它。 +`watch` 命令是 [procps-ng 包][6]的一部分,所以如果你是在 Linux 上,你已经安装了它。 在 macOS 上,使用 [MacPorts][7] 或 [Homebrew][8] 安装 `watch`。在 Windows 上,使用 [Chocolatey][9]。 @@ -69,16 +65,14 @@ done 例如,在 `docker ps` 命令前加上 `watch`,就可以这样操作: - ``` -`$ watch docker ps` +$ watch docker ps ``` 用 `watch` 命令,以及一些创造性的 Unix 命令行技巧,可以生成临时的仪表盘。例如,要计算审计事件: - ``` -`$ watch 'grep audit: /var/log/kern.log |wc -l'` +$ watch 'grep audit: /var/log/kern.log |wc -l' ``` 在最后一个例子中,如果有一个可视化的指示,表明审计事件的数量发生了变化,这可能是有用的。如果变化是预期的,但你想让一些东西看起来“不同”,`watch --differences` 就很好用。它可以高亮显示与上次运行的任何差异。如果你在多个文件中搜索,这一点尤其有效,所以你可以很容易地看到哪个文件发生了变化。 @@ -87,16 +81,15 @@ done ### 控制频率 -最后,有时该命令可能是资源密集型的,不应运行得太频繁。`-n` 参数控制频率。Watch 默认使用 2 秒,但是 `watch -n 10` 可能适合于资源密集型的情况,比如在子目录的任何文件中搜索一个模式: - +最后,有时该命令可能是资源密集型的,不应运行得太频繁。`-n` 参数控制频率。`watch` 默认使用 2 秒间隔,但是 `watch -n 10` 可能适合于资源密集型的情况,比如在子目录的任何文件中搜索一个模式: ``` -`$ watch -n 10 'find . -type f | xargs grep suspicious-pattern'` +$ watch -n 10 'find . -type f | xargs grep suspicious-pattern' ``` ### 用 watch 观察一个命令 -`watch` 命令对于许多临时性的系统管理任务非常有用,在这些任务中,你需要在没有进度条的情况下等待一些耗时的步骤,然后再进入下一个步骤。尽管这种情况并不理想,但 `watch` 可以使情况稍微好转。它让你有时间为工作做回顾性笔记!"。下载**[备忘录][10]**,让有用的语法和选项触手可及。。 +`watch` 命令对于许多临时性的系统管理任务非常有用,在这些任务中,你需要在没有进度条的情况下等待一些耗时的步骤,然后再进入下一个步骤。尽管这种情况并不理想,但 `watch` 可以使情况稍微好转。它让你有时间为工作做回顾性笔记!"。下载 [备忘录][10],让有用的语法和选项触手可及。。 -------------------------------------------------------------------------------- @@ -105,7 +98,7 @@ via: https://opensource.com/article/21/9/linux-watch-command 作者:[Moshe Zadka][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 10ce211ff9d70476852e0df463dfaf9ec718f57a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Sep 2021 16:03:01 +0800 Subject: [PATCH 0459/1588] APL --- .../20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md b/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md index cff3752858..392a9dca69 100644 --- a/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md +++ b/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/" [#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 025511483903b88116cc43a34e338c27df3c5c3b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 22 Sep 2021 16:54:06 +0800 Subject: [PATCH 0460/1588] TSL --- ...nstall Ubuntu Desktop on Raspberry Pi 4.md | 235 ------------------ ...nstall Ubuntu Desktop on Raspberry Pi 4.md | 233 +++++++++++++++++ 2 files changed, 233 insertions(+), 235 deletions(-) delete mode 100644 sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md create mode 100644 translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md diff --git a/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md b/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md deleted file mode 100644 index 392a9dca69..0000000000 --- a/sources/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md +++ /dev/null @@ -1,235 +0,0 @@ -[#]: subject: "How to Install Ubuntu Desktop on Raspberry Pi 4" -[#]: via: "https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/" -[#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install Ubuntu Desktop on Raspberry Pi 4 -====== - -_**Brief: This thorough tutorial shows you how to install Ubuntu Desktop on Raspberry Pi 4 device.**_ - -The revolutionary Raspberry Pi is the most popular single board computer. It has its very own Debian based operating system called [Raspbian][1]. - -There are several other [operating systems available for Raspberry Pi][2] but almost all of them are lightweight. This was appropriate for the small factor and low end hardware of the Pi devices. - -This changes with the introduction of Raspberry Pi 4B that flaunts 8 GB RAM and supports 4K display. The aim is to use Raspberry Pi as a regular desktop and it succeeds in doing so to a larger extent. - -Before the 4B model, you could [install the Ubuntu server on Raspberry Pi][3] but the desktop version was not available. However, **Ubuntu now provides official desktop image for Pi 4 models**. - -In this tutorial, I am going to show the steps for installing Ubuntu desktop on Raspberry Pi 4. - -First, a quick look at the prerequisites. - -### Prerequisites for running Ubuntu on Raspberry Pi 4 - -![][4] - -Here’s what you need: - - 1. A Linux or Windows system with active internet connection. - 2. [Raspberry Pi Imager][5] : The official open source tool from Raspberry that gets you the distro image on your SD card. - 3. Micro SD Card: Consider using at least a 16 GB storage for your card, albeit a 32 GB version is recommended. - 4. A USB based Micro SD Card Reader (if your computer does not have a card reader). - 5. Essential Raspberry Pi 4 accessories such as an HDMI compatible display, [Micro HDMI to Standard HDMI (A/M) Cable][6], [Power Supply (Official Adapter Recommended)][7], USB Wired/Wireless Keyboard and Mouse/Touchpad. - - - -It is good practice to [read in detail about the Pi requirements][8] beforehand. - -Now, without further delay, let me quickly walk you through the image preparation for the SD Card. - -### Preparing the Ubuntu Desktop image for Raspberry Pi - -Raspberry Pi provides a GUI application for writing the ISO image to the SD Card. **This tool can also download compatible operating systems like Ubuntu, Raspbian etc automatically**. - -![Official tool to download and put operating system on SD card][9] - -You can download this tool for Ubuntu, Windows and macOS from the official website: - -[Download Raspberry Pi Imager][10] - -On Ubuntu and other Linux distributions, you can also install it with Snap: - -``` -sudo snap install rpi-imager -``` - -Once installed, run the imager tool. When you see the screen below, select “CHOOSE OS”: - -![Pi imager: choose the preferred operating system][11] - -Under “Operating System”, select “Other general purpose OS”: - -![Pi imager: other general purpose operating systems][12] - -Now, select “Ubuntu”: - -![Pi imager distro: Ubuntu][13] - -Next, select “Ubuntu Desktop 21.04 (RPI 4/400)” as shown below: - -![Pi imager distro version: Ubuntu 21.04][14] - -Note - -If you do not have a good, consistent internet collection, you can [download the Ubuntu for Raspberry Pi image separately from Ubuntu’s website][15]. In the Imager tool, while choosing the OS, go to the bottom and select “Use custom” option. You can also use Etcher for writing the image to the SD card. - -Insert the micro SD card inside your Card reader and wait for it to mount. Select “CHOOSE STORAGE” under “Storage”: - -![Pi imager – choose storage \(SD card\)][16] - -You should be seeing only your micro SD card storage and you’d recognize it instantly based on the size. Here, I’ve used a 32 GB card: - -![Pi imager – choose SD card][17] - -Now click on “WRITE”: - -![Pi imager image write][18] - -I’ll assume you have the contents of the SD card backed up. If it’s a new card, you can just proceed: - -![Pi imager image write confirmation query][19] - -Since this is a [sudo][20] privilege, you must enter your password. If you run `sudo rpi-imager` from a terminal, this would not appear: - -![Pi imager image write authentication asking for password][21] - -If your SD card is a bit old, it would take some time. But if it is a recent one with high speeds, it wouldn’t take long: - -![Pi imager writing image][22] - -I also wouldn’t recommend skipping verification. Make sure the image write went successful: - -![Pi imager verifying changes][23] - -Once it is over, you will get the following confirmation: - -![Pi imager write successful][24] - -Now, safely-remove the SD card from your system. - -### Using the micro SD card with Ubuntu on Raspberry Pi - -Half of the battle is won. Unlike the regular Ubuntu install, you have not created a live environment. Ubuntu is already installed on the SD card and is almost read to use. Let’s see what remains here. - -#### Step 1: Insert the SD card into Pi - -For first time users, it can take a bit confusing sometimes to figure out where on earth is that card slot! Not to worry. It is located below the board on the left-hand side. Here’s an inverted view with a card inserted: - -![Pi 4B board inverted and micro SD card inserted][25] - -Keep sliding the card in this orientation slowly into the slot below the board, gently until it no longer goes any further. You may also hear a little clicking sound for confirmation. This means it has just fit in perfectly: - -![Raspberry Pi SD slot left side middle and below the pi board][26] - -You might notice two little pins adjusting themselves in the slot (shown above) as you put it inside, but that’s ok. Once inserted, the card would look like a bit protruded. That’s how it is supposed to look like: - -![Pi SD card inserted with a little portion visible][27] - -#### Step 2: Setting Up the Raspberry Pi - -I do not need to go in detail here, I presume. - -Ensure that the power cable connector, micro HDMI cable connector, keyboard and mouse connectors (wired/non-wired) are securely connected to the Pi board in the relevant ports. - -Make sure the display and power plug are properly connected as well, before you go ahead and turn on the power socket. I wouldn’t recommend plugging in the adapter to a live electrical socket. Look up [electrical arcing][28]. - -Once you’ve ensured the above two steps, you can [power on the Raspberry Pi device][29]. - -#### Step 3: The first run of Ubuntu desktop on Raspberry Pi - -Once you power on the Raspberry Pi, you’ll be asked to some basic configuration on your first run. You just have to follow the onscreen instructions. - -Select your language, keyboard layout, connect to WiFi etc. - -![Select language][30] - -![Select keyboard layout][31] - -![Select WiFi][32] - -You’ll be asked to select the time zone: - -![Select time zone][33] - -And then create the user and password: - -![Enter desired username and password][34] - -It will configure a couple of things and may take some time in doing so. - -![Finishing Ubuntu setup][35] - -![Finishing Ubuntu setup][36] - -It may take some time after this, your system will reboot and you’ll find yourself at the Ubuntu login screen: - -![][37] - -You can start enjoying Ubuntu desktop on Raspberry Pi now. - -![Ubuntu desktop on Raspberry Pi][38] - -### Conclusion - -I noticed **a temporary anomaly**: A red flickering border on the left-hand side of my display while doing the installation. This flickering (also of different colors) was noticeable on random parts of the screen as well. But it went away after restarting and the first boot. - -It was much needed that Ubuntu to start providing support for popular ARM devices like Raspberry Pi and I am happy to see it running on a Raspberry Pi. - -I hope you find this tutorial helpful. If you have questions or suggestions, please let me know in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/ - -作者:[Avimanyu Bandyopadhyay][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/avimanyu/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ -[2]: https://itsfoss.com/raspberry-pi-os/ -[3]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-desktop-raspberry-pi.png?resize=800%2C450&ssl=1 -[5]: https://github.com/raspberrypi/rpi-imager -[6]: https://www.raspberrypi.org/products/micro-hdmi-to-standard-hdmi-a-cable/ -[7]: https://www.raspberrypi.org/products/type-c-power-supply/ -[8]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ -[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-imager-tool.webp?resize=680%2C448&ssl=1 -[10]: https://www.raspberrypi.org/software/ -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-os.webp?resize=681%2C443&ssl=1 -[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-other-general-purpose-os.webp?resize=679%2C440&ssl=1 -[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-os-ubuntu.webp?resize=677%2C440&ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-os-ubuntu-21-04.webp?resize=677%2C440&ssl=1 -[15]: https://ubuntu.com/download/raspberry-pi -[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-storage.webp?resize=677%2C438&ssl=1 -[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-sd-card.webp?resize=790%2C450&ssl=1 -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write.webp?resize=676%2C437&ssl=1 -[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write-confirm.webp?resize=679%2C440&ssl=1 -[20]: https://itsfoss.com/add-sudo-user-ubuntu/ -[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write-password.webp?resize=380%2C227&ssl=1 -[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-writing-image.webp?resize=673%2C438&ssl=1 -[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-verifying-changes.webp?resize=677%2C440&ssl=1 -[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-write-successful.webp?resize=675%2C442&ssl=1 -[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-inverted-micro-sd-card-inserted.webp?resize=800%2C572&ssl=1 -[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-sd-slot-left-side-middle-below-board.webp?resize=632%2C324&ssl=1 -[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-sd-card-inserted.webp?resize=650%2C432&ssl=1 -[28]: https://www.electricianatlanta.net/what-is-electrical-arcing-and-why-is-it-dangerous/ -[29]: https://itsfoss.com/turn-on-raspberry-pi/ -[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run.webp?resize=800%2C451&ssl=1 -[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-2.webp?resize=800%2C600&ssl=1 -[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-3.webp?resize=800%2C600&ssl=1 -[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-4.webp?resize=800%2C600&ssl=1 -[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-5.webp?resize=800%2C600&ssl=1 -[35]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-6.webp?resize=800%2C600&ssl=1 -[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-7.webp?resize=800%2C600&ssl=1 -[37]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-login-screen.webp?resize=800%2C600&ssl=1 -[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-21-04-post-setup-desktop.webp?resize=800%2C450&ssl=1 diff --git a/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md b/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md new file mode 100644 index 0000000000..41b4539ace --- /dev/null +++ b/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md @@ -0,0 +1,233 @@ +[#]: subject: "How to Install Ubuntu Desktop on Raspberry Pi 4" +[#]: via: "https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/" +[#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在树莓派 4 上安装 Ubuntu 桌面系统 +====== + +> 这个详尽的教程告诉你如何在树莓派 4 设备上安装 Ubuntu 桌面。 + +革命性的树莓派Raspberry Pi是最受欢迎的单板计算机。它有自己的基于 Debian 的操作系统,叫做 [树莓派操作系统][1]Raspberry Pi OS(原名 Raspbian)。 + +还有其他几个 [可用于树莓派的操作系统][2],但几乎所有的都是轻量级的,适合于树莓派设备的小尺寸和低端硬件。 + +随着标榜 8GB 内存和支持 4K 显示的树莓派 4B 的推出,情况发生了变化。其目的是将树莓派作为常规桌面使用,并在更大程度上成功地做到了这一点。 + +在 4B 型号之前,你可以 [在树莓派上安装 Ubuntu 服务器][3],但桌面版本却无法使用。然而,**Ubuntu 现在为树莓派 4 提供了官方的桌面镜像**。 + +在本教程中,我将展示在树莓派 4 上安装 Ubuntu 桌面的步骤。 + +首先,快速了解一下先决条件。 + +### 在树莓派 4 上运行 Ubuntu 的先决条件 + +![][4] + +以下是你需要的东西: + + 1. 一个能用的互联网连接的 Linux 或 Windows 系统。 + 2. [树莓派镜像工具][5] :树莓派的官方开源工具,可以在你的 SD 卡上写入发行版镜像。 + 3. 微型 SD 卡:可以使用至少 16GB 的存储卡,尽管建议使用 32GB 的版本。 + 4. 一个基于 USB 的 Micro SD 卡读卡器(如果你的电脑没有读卡器)。 + 5. 必要的树莓派 4 配件,如 HDMI 兼容显示器、[Micro HDMI 连接到标准 HDMI(A/M) 接口的电缆][6]、[电源(建议使用官方适配器)][7]、USB 的有线/无线键盘和鼠标/触摸板。 + +事先 [详细阅读树莓派的要求][8] 是很好的做法。 + +现在,不再拖延了,让我快速带领你完成 SD 卡的镜像准备。 + +### 为树莓派准备 Ubuntu 桌面镜像 + +树莓派提供了一个 GUI 应用程序,用于将 ISO 镜像写入 SD 卡中。**这个工具还可以自动下载兼容的操作系统,如 Ubuntu、树莓派操作系统等**。 + +![下载并将操作系统放入 SD 卡的官方工具][9] + +你可以从官方网站上下载用于 Ubuntu、Windows 和 macOS 的这个工具: + +- [下载树莓派镜像工具][10] + +在 Ubuntu 和其他 Linux 发行版上,你也可以用 Snap 安装它: + +``` +sudo snap install rpi-imager +``` + +安装完毕后,运行该工具。当你看到下面的屏幕时,选择 “选择操作系统CHOOSE OS”: + +![镜像工具:选择首选操作系统][11] + +在“操作系统Operating System”下,选择 “其它通用的操作系统Other general purpose OS”: + +![镜像工具: 其他通用的操作系统][12] + +现在,选择 “Ubuntu”: + +![镜像工具:发行版 - Ubuntu][13] + +接下来,选择 “Ubuntu Desktop 21.04(RPI 4/400)”,如下图所示。 + +![镜像工具:发行版 - Ubuntu 21.04][14] + +> **注意:** +> +> 如果你没有一个好的、稳定的网络连接,你可以 [从 Ubuntu 的网站上单独下载 Ubuntu 的树莓派镜像][15]。在镜像工具中,在选择操作系统时,到底部选择“使用自定义Use custom”选项。你也可以使用 Etcher 将镜像写入到 SD 卡上。 + +将微型 SD 卡插入读卡器中,等待它挂载。选择“存储设备Storage”下的 “选择存储设备CHOOSE STORAGE”: + +![镜像工具:选择存储设备(SD 卡)][16] 。 + +你应该只看到你的微型 SD 卡的存储空间,你会根据大小立即识别它。这里,我使用的是 32GB 的卡: + +![镜像工具:选择 SD 卡][17] + +现在点击“写入WRITE”: + +![镜像工具:镜像写入][18] + +我假设你已经备份了 SD 卡上的内容。如果是一张新卡,你可以直接进行: + +![镜像工具:镜像写入确认][19] + +由于这是一个 [sudo][20] 的权限,你必须输入密码。如果你从终端运行 `sudo rpi-imager`,就不会出现这种情况: + +![镜像工具:镜像写入授权需要密码][21] + +如果你的 SD 卡有点旧,这将需要一些时间。但是,如果它是一个新的高速的 SD 卡,就不会花很长时间: + +![镜像工具:写入镜像][22] + +我也不建议跳过验证。确保镜像写入成功: + +![镜像工具:验证写入][23] + +一旦结束,你会得到以下确认: + +![镜像工具:写入成功][24] + +现在,从你的系统中安全移除 SD 卡。 + +###在树莓派上使用载有 Ubuntu 的微型 SD 卡 + +战斗的一半已经胜利了。与常规的 Ubuntu 安装不同,你并没有创建一个临场环境。Ubuntu 已经安装在 SD 卡上了,而且几乎已经可以使用了。让我们来看看这里还剩下什么。 + +#### 第 1 步:将 SD 卡插入树莓派中 + +对于第一次使用的用户来说,有时会有点困惑,不知道那个卡槽到底在哪里?不用担心。它位于电路板背面的左手边。下面是一个插入卡后的倒置视图。 + +![树莓派 4B 板倒置,插入微型 SD 卡][25] + +按这个方向将卡慢慢插入板子下面的插槽,轻轻地插,直到它不再往前移动。你可能还会听到一点咔嚓声来确认。这意味着它刚刚完美地插进去了。 + +![树莓派 SD 插槽在板子背面的左侧][26] + +当你把它插进去的时候,你可能会注意到有两个小针脚在插槽中调整了自己的位置(如上图所示),但这没关系。一旦插入,卡看起来会有一点突出。这就是它应该有的样子。 + +![树莓派 SD 卡插入时有一小部分可见][27] + +#### 第 2 步:设置树莓派 + +我想,我不需要在这里详细介绍。 + +确保电源线接头、微型 HDMI 线接头、键盘和鼠标接头(有线/无线)都牢固地连接到树莓派板的相关端口。 + +确保显示器和电源插头也已正确连接,然后再去打开电源插座。我不建议把适配器插到带电的插座上。主要一下 [电弧][28]。 + +一旦你确保了以上两个步骤,你就可以 [打开树莓派设备的电源][29]。 + +#### 第 3 步:在树莓派上 Ubuntu 桌面的首次运行 + +一旦你打开树莓派的电源,你会被要求在第一次运行时进行一些基本配置。你只需按照屏幕上的指示操作即可。 + +选择你的语言、键盘布局、连接到 WiFi 等: + +![选择语言][30] + +![选择键盘布局][31] + +![选择 WiFi][32] + +你会被要求选择时区: + +![选择时区][33] + +然后创建用户和密码: + +![输入所需的用户名和密码][34] + +它将配置一些东西,可能需要一些时间来完成: + +![完成 Ubuntu 设置][35] + +![完成 Ubuntu 设置][36] + +这之后可能需要一些时间,你的系统会重新启动,你会发现自己处于 Ubuntu 的登录界面: + +![Ubuntu 的登录界面][37] + +你现在可以开始享受树莓派上的 Ubuntu 桌面了: + +![树莓派上的 Ubuntu 桌面][38] + +### 总结 + +我注意到**一个暂时的异常情况**。在进行安装时,我的显示器左侧有一个红色的闪烁边界。这种闪烁(也有不同的颜色)在屏幕的随机部分也能注意到。但在重启和第一次启动后,它就消失了。 + +我非常需要 Ubuntu 开始为树莓派等流行的 ARM 设备提供支持,我很高兴看到它在树莓派上运行。 + +我希望你觉得这个教程对你有帮助。如果你有问题或建议,请在评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/ + +作者:[Avimanyu Bandyopadhyay][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://itsfoss.com/author/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/tutorial-how-to-install-raspberry-pi-os-raspbian-wheezy/ +[2]: https://itsfoss.com/raspberry-pi-os/ +[3]: https://itsfoss.com/install-ubuntu-server-raspberry-pi/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-desktop-raspberry-pi.png?resize=800%2C450&ssl=1 +[5]: https://github.com/raspberrypi/rpi-imager +[6]: https://www.raspberrypi.org/products/micro-hdmi-to-standard-hdmi-a-cable/ +[7]: https://www.raspberrypi.org/products/type-c-power-supply/ +[8]: https://itsfoss.com/things-you-need-to-get-your-raspberry-pi-working/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-imager-tool.webp?resize=680%2C448&ssl=1 +[10]: https://www.raspberrypi.org/software/ +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-os.webp?resize=681%2C443&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-other-general-purpose-os.webp?resize=679%2C440&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-os-ubuntu.webp?resize=677%2C440&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-os-ubuntu-21-04.webp?resize=677%2C440&ssl=1 +[15]: https://ubuntu.com/download/raspberry-pi +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-storage.webp?resize=677%2C438&ssl=1 +[17]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-choose-sd-card.webp?resize=790%2C450&ssl=1 +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write.webp?resize=676%2C437&ssl=1 +[19]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write-confirm.webp?resize=679%2C440&ssl=1 +[20]: https://itsfoss.com/add-sudo-user-ubuntu/ +[21]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-image-write-password.webp?resize=380%2C227&ssl=1 +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-writing-image.webp?resize=673%2C438&ssl=1 +[23]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-verifying-changes.webp?resize=677%2C440&ssl=1 +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-imager-write-successful.webp?resize=675%2C442&ssl=1 +[25]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-inverted-micro-sd-card-inserted.webp?resize=800%2C572&ssl=1 +[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-sd-slot-left-side-middle-below-board.webp?resize=632%2C324&ssl=1 +[27]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/pi-sd-card-inserted.webp?resize=650%2C432&ssl=1 +[28]: https://www.electricianatlanta.net/what-is-electrical-arcing-and-why-is-it-dangerous/ +[29]: https://itsfoss.com/turn-on-raspberry-pi/ +[30]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run.webp?resize=800%2C451&ssl=1 +[31]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-2.webp?resize=800%2C600&ssl=1 +[32]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-3.webp?resize=800%2C600&ssl=1 +[33]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-4.webp?resize=800%2C600&ssl=1 +[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-5.webp?resize=800%2C600&ssl=1 +[35]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-6.webp?resize=800%2C600&ssl=1 +[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-first-run-7.webp?resize=800%2C600&ssl=1 +[37]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-raspberry-pi-login-screen.webp?resize=800%2C600&ssl=1 +[38]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ubuntu-21-04-post-setup-desktop.webp?resize=800%2C450&ssl=1 From 7ad192053ea9c8a0408acda1c04337688ab83b43 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Sep 2021 05:03:13 +0800 Subject: [PATCH 0461/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210922?= =?UTF-8?q?=20Install=20PowerShell=20on=20Fedora=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210922 Install PowerShell on Fedora Linux.md --- ...0922 Install PowerShell on Fedora Linux.md | 320 ++++++++++++++++++ 1 file changed, 320 insertions(+) create mode 100644 sources/tech/20210922 Install PowerShell on Fedora Linux.md diff --git a/sources/tech/20210922 Install PowerShell on Fedora Linux.md b/sources/tech/20210922 Install PowerShell on Fedora Linux.md new file mode 100644 index 0000000000..05a2aa5445 --- /dev/null +++ b/sources/tech/20210922 Install PowerShell on Fedora Linux.md @@ -0,0 +1,320 @@ +[#]: subject: "Install PowerShell on Fedora Linux" +[#]: via: "https://fedoramagazine.org/install-powershell-on-fedora-linux/" +[#]: author: "TheEvilSkeletonOzymandias42 https://fedoramagazine.org/author/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install PowerShell on Fedora Linux +====== + +![][1] + +Photos by [NOAA][2] and [Cedric Fox][3] on [Unsplash][4] + +PowerShell (also written pwsh) is a powerful open source command-line and object-oriented shell developed and maintained by Microsoft. It is syntactically verbose and intuitive for the user. This article is a guide on how to install PowerShell on the host and inside a Podman or Toolbox container. + +### Table of contents + + * [Why use PowerShell][5] + * [Demonstration][6] + * [Comparison between Bash and PowerShell][7] + * [Install PowerShell][8] + * [Install PowerShell on a host using the package manager][9] + * [Method 1: Microsoft repositories][10] + * [Method 2: RPM file][11] + * [Install via container][12] + * [Method 1: Podman container][13] + * [Method 2: Fedora Linux Toolbox container][14] + + + +### Why use PowerShell + +PowerShell, as the name suggests, is _power_ful. The syntax is verbose and semantically clear to the end user. For those that don’t want to write long commands all the time, most commands are aliased. The aliases can be viewed with _Get-Alias_ or [here][15]. + +The most important difference between PowerShell and traditional shells, however, is its output pipeline. While normal shells output strings or character streams, PowerShell outputs objects. This has far reaching implications for how command pipelines work and comes with quite a few advantages. + +#### Demonstration + +The following examples illustrate the verbosity and simplicity. Lines that start with the pound symbol (**#**) are comments. Lines that start with **PS >** are commands, **PS >** being the prompt: + +``` +# Return all files greater than 50MB in the current directory. +## Longest form +PS > Get-Childitem | Where-Object Length -gt 50MB +## Shortest form (with use of aliases) +PS > gci | ? Length -gt 40MB +## Output looks like this + Directory: /home/Ozymandias42/Downloads +Mode LastWriteTime Length Name +---- ------------- ------ ---- +----- 20/08/2020 13:55 2000683008 40MB-file.img + + +# In order: get VMs, get snapshots, only select the last 3 and remove selected list: +PS > Get-VM VM-1 | Get-Snapshot | Select-Object -Last 3 | Remove-Snapshot +``` + +What this shows quite well is that input-output reformatting with tools like _cut_, _sed_, _awk_ or similar, which Bash scripts often need, is usually not necessary in PowerShell. The reason for this is that PowerShell works fundamentally different than traditional POSIX shells such as Bash, Zsh, or other shells like Fish. The commands of traditional shells are output as strings whereas in PowerShell they are output as objects. + +#### Comparison between Bash and PowerShell + +The following example illustrates the advantages of the object-output in PowerShell in contrast to the traditional string-output in Bash. Suppose you want a script that outputs all processes that occupy 200MB or more in RAM. With Bash, this might look something like this: + +``` +$ ps -eO rss | awk -F' ' \ + '{ if($2 >= (1024*200)) { \ + printf("%s\t%s\t%s\n",$1,$2,$6);} \ + }' + +PID RSS COMMAND +A B C +[...] +``` + +The first obvious difference is readability or more specifically, semantic clarity. Neither _ps_ nor _awk_ are self-descriptive. _ps_ shows the **p**rocess **s**tatus and _awk_ is a text processing tool and language whose letters are the initials of its developers’ last names, **A**ho, **W**einberger, **K**ernighan (see [Wikipedia][16]). Before contrasting it with PowerShell however, examine the script: + + * _ps -e_ outputs all running processes; + + * _-O rss_ outputs the default output of _ps_ plus the amount of kilobytes each process uses, the _rss_ field; this output looks like this: + +``` +PID RSS S TTY TIME COMMAND 1 13776 S ? 00:00:01 /usr/lib/systemd/systemd +``` + + * | pipe operator uses the output of the command on the left side as input for the command on the right side. + + * _awk -F’ ‘_ declares “space” as the input field separator. So going with the above example, PID is the first, RSS the second and so on. + + * _‘{ if($2 >= (1024*200)_ is the beginning of the actual AWK-script. It checks whether field 2 ([RSS][17]) contains a number larger than or equal to 1024*200KB (204800KB, or 200MB); + + * _{ printf(“%s\t%s\t%s\n”,$1,$2,$6);} }’_ continues the script. If the previous part evaluates to true, this outputs the first, second and sixth field ([PID][18], [RSS][17] and COMMAND fields respectively). + + + + +With this in mind, step back and look at what was required for this script to be written and for it to work: + + * The input command _ps_ had to have the field we wanted to filter against in its output. This was not the case by default and required us to use the _-O_ flag with the _rss_ field as argument. + * We had to treat the output of _ps_ as a list of input fields, requiring us to know their order and structure. Or in other words, we had to at least _know_ that _RSS_ would be the second field. Meaning we had to know how the output of _ps_ would look beforehand. + * We then had to know what unit the data we were filtering against was in as well as what unit the processing tool would work in. Meaning we had to know that the _RSS_ field uses kilobytes and that _awk_ does too. Otherwise we would not have been able to write the expression _($2 <= 1024*200)_ + + + +Now, contrast the above with the PowerShell equivalent: + +``` +# Longest form +PS > Get-Process | Where-Object WorkingSet -ge 200MB +# Shortest form (with use of aliases) +PS > gps | ? ws -ge 200MB + +NPM(K) PM(M) WS(M) CPU(s) Id SI ProcessName +------ ----- ----- ------ -- -- ----------- + A B C D E F G +[...] +``` + +This first thing to notice is that we have perfect semantic clarity. The commands are perfectly self-descriptive in what they do. + +Furthermore there is no requirement for input-output reformatting, nor is there concern about the unit used by the input command. The reason for this is that PowerShell does not output strings, but objects. + +To understand this think about the following. In Bash the output of a command is equal to that what it prints out in the terminal. In PowerShell what is printed on the terminal is not equal to the information, that is actually available. This is, because the output-printing system in PowerShell also works with objects. So every command in PowerShell marks some of the properties of its output objects as printable and others not. However, it always includes all properties, whereas Bash only includes what it actually prints. One can think of it like JSON objects. Where output in Bash would be separated into “fields” by a delimiter such as a space or tab, it becomes an easily addressable object property in PowerShell, with the only requirement being, that one has to know its name. Like _WorkingSet_ in the above example. + +To see all available properties of a command’s output objects and their types, one can simply do something like: + +``` +PS > Get-Process | Get-Member +``` + +### Install PowerShell + +PowerShell is available in several package formats, including RPM used by Fedora Linux. This article shows how to install PowerShell on Fedora Linux using various methods. + +I recommend installing it natively. But I will also show how to do it in a container. I will show using both the official Microsoft PowerShell container and a Fedora Linux 30 toolbox container. The advantage of the container-method is that it’s guaranteed to work, since all dependencies are bundled in it, and isolation from the host. Regardless, I recommend doing it natively, despite the official docs only explicitly stating Fedora Linux releases 28 to 30 as being supported. + +**Note:** Supported means guaranteed to work. It does not necessarily mean incompatible with other releases. This means, that while not guaranteed, releases higher than 30 should still work. They did in fact work in our tests. + +It is more difficult to set up PowerShell and run it in a container than to run it directly on a host. It takes more time to install and you will not be able to run host commands directly. + +#### Install PowerShell on a host using the package manager + +##### Method 1: Microsoft repositories + +Installation is as straight-forward as can be and the procedure doesn’t differ from any other software installed through third party repositories. + +It can be split into four general steps: + + 1. Adding the new repository’s GPG key + 2. Adding repository to DNF repository list + 3. Refreshing DNF cache to include available packages from the new repository + 4. Installing new packages + + + +Powershell is then launched with the command _pwsh_. + +``` +$ sudo rpm --import https://packages.microsoft.com/keys/microsoft.asc +$ curl https://packages.microsoft.com/config/rhel/7/prod.repo | sudo tee /etc/yum.repos.d/microsoft.repo +$ sudo dnf makecache +$ sudo dnf install powershell +$ pwsh +``` + +To remove the repository and packages, run the following. + +``` +$ sudo rm /etc/yum.repos.d/microsoft.repo +$ sudo dnf remove powershell +``` + +##### Method 2: RPM file + +This method is not meaningfully different from the first method. In fact it adds the GPG key and the repository implicitly when installing the RPM file. This is because the RPM file contains the link to both in it’s metadata. + +First, get the _.rpm_ file for the version you want from the [PowerShell Core GitHub repository][19]. See the readme.md +“Get Powershell” table for links. + +Second, enter the following: + +``` +$ sudo dnf install powershell-.rhel.7..rpm +``` + +Substitute _<version>_ and _<architecture>_ with the version and architecture you want to use respectively, for example [powershell-7.1.3-1.rhel.7.x86_64.rpm][20]. + +Alternatively you could even run it with the link instead, skipping the need to download it first. + +``` +$ sudo dnf install https://github.com/PowerShell/PowerShell/releases/download/v/powershell-.rhel.7..rpm +``` + +To remove PowerShell, run the following. + +``` +$ sudo dnf remove powershell +``` + +#### Install via container + +##### Method 1: Podman container + +Podman is an [Open Container Initiative][21] (OCI) compliant drop-in replacement for Docker. + +Microsoft provides a [PowerShell Docker container][22]. The following example will use that container with Podman. + +For more information about Podman, visit [Podman.io][23]. Fedora Magazine has a [tag][24] dedicated to Podman. + +To use PowerShell in Podman, run the following script: + +``` +$ podman run \ + -it \ + --privileged \ + --rm \ + --name powershell \ + --env-host \ + --net=host --pid=host --ipc=host \ + --volume $HOME:$HOME \ + --volume /:/var/host \ + mcr.microsoft.com/powershell \ + /usr/bin/pwsh -WorkingDirectory $(pwd) +``` + +This script creates a Podman container for PowerShell and immediately attaches to it. It also mounts the _/home_ and the host’s root directories into the container so they’re available there. However, the host’s root directory is available in _/var/host_. + +Unfortunately, you can only indirectly run host commands while inside the container. As a workaround, run _chroot /var/host_ to chroot to the root and then run host commands. + +To break the command down, everything is mandatory unless specified: + + * -it creates a persistent environment that does not kick you out when you enter it; + * \--privileged gives extended privileges to the container (optional); + * \--rm removes the container when you exit; + * \--name powershell sets the name of the container to _powershell_; + * \--env-host sets all host environment variables to the container’s variables (optional); + * \--volume $HOME:$HOME mounts the user directory; + * \--volume /:/var/host mounts the root directory to _/var/host_ (optional); + * \--net=host --pid=host --ipc=host runs the process in the host’s namespaces instead of a separate set of namespaces for the contained process; + * docker.io/microsoft/powershell enters the container; + * /usr/bin/pwsh -WorkingDirectory $(pwd) enters the container in the current directory (optional). + + + +Optional but very convenient: alias _pwsh_ with the script to easily access the Podman container by typing _pwsh_. + +To remove the PowerShell image, run the following. + +``` +$ podman rmi mcr.microsoft.com/powershell +``` + +##### Method 2: Fedora Linux Toolbox container + +Toolbox is an elegant solution to setup persistent environments without affecting the host system as a whole. It acts as a wrapper around Podman and takes care of supplying a lot of the flags demonstrated in the previous method. For this reason, Toolbox is a lot easier to use than Podman. It was designed to work for development and debugging. With Toolbox, you can run any command the same as you would directly on the Fedora Workstation host (including _dnf_). + +The installation procedure is similar to the installation on the host methods, with the only difference being that those steps are done inside a container. Make sure you have the _toolbox_ package installed. + +Preparing and entering the Fedora 34 Toolbox container is a two step process: + + 1. Creating the Fedora 34 Toolbox container + 2. Running the Fedora 34 Toolbox container + + + +``` +$ toolbox create --image registry.fedoraproject.org/f34/fedora-toolbox +$ toolbox enter --container fedora-toolbox +``` + +Then, follow the instructions at [Method 1: Microsoft repositories][10]. + +Optional but very convenient: alias _pwsh_ with _toolbox run –container fedora-toolbox_ _pwsh_ to easily access the Toolbox container by typing _pwsh_. + +To remove the Toolbox container, make certain you have stopped the Toolbox session by entering _exit_ and then run the following: + +``` +$ podman kill fedora-toolbox +$ toolbox rm fedora-toolbox +``` + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/install-powershell-on-fedora-linux/ + +作者:[TheEvilSkeletonOzymandias42][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/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/05/powershell-816x345.jpg +[2]: https://unsplash.com/@noaa?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/@thecedfox?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://unsplash.com/s/photos/shell?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[5]: tmp.c7U2gcu9Hl#why-use-powershell +[6]: tmp.c7U2gcu9Hl#demonstration +[7]: tmp.c7U2gcu9Hl#comparison-between-bash-and-powershell +[8]: tmp.c7U2gcu9Hl#install-powershell +[9]: tmp.c7U2gcu9Hl#install-on-host-via-package-manager +[10]: tmp.c7U2gcu9Hl#method-1-microsoft-repositories +[11]: tmp.c7U2gcu9Hl#method-2-rpm-file +[12]: tmp.c7U2gcu9Hl#install-via-container +[13]: tmp.c7U2gcu9Hl#method-1-podman-container +[14]: tmp.c7U2gcu9Hl#method-2-fedora-toolbox-container +[15]: https://ilovepowershell.com/2011/11/03/list-of-top-powershell-alias/ +[16]: https://en.wikipedia.org/wiki/AWK +[17]: https://en.wikipedia.org/wiki/Resident_set_size +[18]: https://en.wikipedia.org/wiki/Process_identifier +[19]: https://github.com/PowerShell/PowerShell +[20]: https://github.com/PowerShell/PowerShell/releases/download/v7.1.3/powershell-7.1.3-1.rhel.7.x86_64.rpm +[21]: https://opencontainers.org/ +[22]: https://hub.docker.com/_/microsoft-powershell +[23]: https://podman.io/ +[24]: https://fedoramagazine.org/tag/podman/ From 1f93698b3c76bf87d1f37a77710f0c3be80588f6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Sep 2021 05:03:35 +0800 Subject: [PATCH 0462/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210923?= =?UTF-8?q?=20JingPad=20Review:=20A=20Real=20Linux=20Tab=20for=20True=20Li?= =?UTF-8?q?nux=20Fans?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md --- ...w- A Real Linux Tab for True Linux Fans.md | 233 ++++++++++++++++++ 1 file changed, 233 insertions(+) create mode 100644 sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md diff --git a/sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md b/sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md new file mode 100644 index 0000000000..34a368bebd --- /dev/null +++ b/sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md @@ -0,0 +1,233 @@ +[#]: subject: "JingPad Review: A Real Linux Tab for True Linux Fans" +[#]: via: "https://itsfoss.com/jingpad-a1-review/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +JingPad Review: A Real Linux Tab for True Linux Fans +====== + +If you follow Linux news enthusiastically, you might have come across a new name recently: [JingOS][1]. + +It is a new Linux distribution designed for touch devices. It can also be used as a regular desktop operating system on non-touch devices. + +![JingOS][2] + +JingOS is not the primary product for Beijing based JingLing tech. They have created this OS for their flagship product, JingPad, an ARM-based Linux tablet. + +This review focuses on two aspects: + + * The hardware side of JingPad tablet + * The software side of JingOS + + + +So that you know + +People at Jing sent me the JingPad for free to review the device. I can keep the device forever. However, this does not mean that review is biased in their favor to show only the positives. I am sharing my experience with the device and its operating system. + +### JingPad: The first impression + +![JingPad A1][3] + +To be frank with you, I was expecting a mediocre, generic tablet preinstalled with a Linux OS. I was wrong. + +The moment I unboxed the device and hold it in my hands, I got a feeling that I am looking at a premium device. The black colored tablet has a smooth finish. The back has a glossy finish and though I prefer matte usually, I liked the shiny body. I learned later that they used Corning Gorilla Glass for the back. + +The hardware specification of the gadget is more than just decent. Take a look: + + * 11 inches AMOLED screen with 4:3 aspect ratio + * 2K screen with 266PPI and 350nit + * Unisoc Tiger T7510 ARM Chip + * 8000mAh battery + * Weighs around 550g so not too heavy + * Around 7 mm in thickness + * 16 MP back camera and 8 MP front camera + * Dual band WiFi and Bluetooth 5.0 + * 8 GB RAM + * 256 GB UMCP storage which can be expanded by MicroSD of 512 GB in size + + + +JingPad also has companion stylus and keyboard. The review unit did not have the stylus but I did get the detachable keyboard. More on the keyboard later. + +Note + +JingOS is in alpha stage of development. A lot of things do not work as expected or promised at this moment. It should eventually get better in the later stages of development. + +### JingOS: Experience the user interface + +The JingOS will immediately remind you of iOS or Deepin OS, whichever you prefer. The interface is clean and the 2K display makes things look pretty. + +There are row of application icons and a dock at the bottom. Swiping up from the bottom brings an activity area displaying all the running applications. From here, you can drag an application upward to close it. Touching the trash will close all the running applications. To minimize an application, you have to swipe from right to left. + +![JingOS interface][4] + +Swiping down from the top left brings the notification center. Doing the same on the top right corner lets you access the Settings menu. + +The theming option is limited to light and dark themes but hey, you are getting the dark theme at least. Changing the theme requires a restart, which is an annoyance. + +![JingOS provides a dark mode][5] + +From what I see and experience, JingOS uses Ubuntu as base. For the interface, it is using KDE Plasma and probably some parts of GNOME underneath. The footprints of KDE Plasma are visible at places. For example, look at this screenshot notification. + +![JingOS is built on top of KDE Plasma][6] + +Since it is based on Ubuntu, you can use the apt-get commands in the terminal. The terminal (KDE’s Konsole) can be used with both keyboard and on-screen keyboard. You also have the option to split the terminal window. + +![Terminal][7] + +Something that bothered me with JingOS is that it only works in the landscape mode. I could not find a way to use it in the portrait mode. This creates an issue if you are trying to log into a website in the browser because the on-screen keyboard takes half of the screen and you cannot see the form fields properly. + +![Works only in landscape mode][8] + +There is also no tap to wake feature. Face unlock is also missing. There is a fingerprint reader on the power button but it does not work for now. JingOS will add this feature in the [next couple of months through software update][9]. + +Overall, JingOS is pretty to look at, pretty to use for most part of it. + +### Keyboard + +The review device I got came with the companion keyboard. The keyboard is made for JingPad. It is magnetic and the tab sticks to it. It is detected automatically, no wonder there. It doubles up as cover to give the device front and back protection. + +![JingPad with keyboard][10] + +You can tilt the device at certain angles to use it comfortably as a laptop. + +![JingPad with keyboard placed at angle][11] + +**At the time of writing this review, the keyboard support is in initial stages for JingOS. This is why it does not work as it should.** + +There are several function keys on the keyboard for controlling the volume, brightness, media playback, screen lock etc. + +Most function keys work, except the one for showing the desktop. The super key, which has JingPad logo, does not work as well. I was expecting it to bring the home screen from running applications but that did not work. + +The worst part is that when the keyboard is attached, it does not show the mouse pointer on the screen. That means going into a hybrid use mode where you touch the applications icon to open them and then use the keyboard for typing. This must be improved in the future. + +Coming to the typing, the keys are a bit tiny but not miniscule. I think that’s expected from the keyboard that has to match the 11 inches screen. The keys + +The added weight of the keyboard makes the device heavier than usual but I guess you’ll have to make a compromise with the ease of use and the increased weight. + +Another thing I noticed that when you put the lid down in the keyboard mode, the screen is not locked automatically. I expected a similar behavior to closing the lid of laptop. + +### Battery life, charging and performance + +JingPad comes with a 8000 mAh and claims to have up to 10 hours of battery life. They also claim that their 18W fast charger will charge the device completely in 3 hours. + +My review device did not come with the fast charger because it was still under manufacturing when they shipped the device. I got a travel adapter instead and it took slightly more than 5 hours to charge the device. + +I tested and found that if you keep the device on standby, the battery lasts around 42 hours. If you start using it continuously, it goes for 6 hours max. Now, this depends on what kind of work you are doing on the system. A few tweaks like reducing screen brightness, refresh rate, disabling connectivity could give it some extra battery life. + +### Camera and sound + +![][12] + +There are two cameras here. 16 MP back camera for taking pictures (well, why not) and 8 MP front camera for video calls and online meetings. + +Camera performance is okay. The default camera does not come with AI features like the smartphones but that’s fine. You are not going to use it primarily as a camera, after all. + +The front camera is good enough for the video calls. The placement of front camera is on the top so when you are using it in the landscape mode, it may seem that you are not looking directly into the camera. But people could still see and hear you well so that should not be an issue. + +Speaking of hearing, JingPad has 4 speakers, two on each side. They provide decent sound for causal YouTube and watching streaming content for a single person. No complaints in this department. + +### Applications + +JingPad comes pre-installed with some of its own applications. These applications include a file manager, camera app, voice recorder, camera app, gallery app, music and video applications. Many of these applications are open source and you can find the code on [their GitHub repository][13]. + +![The music app from JingOS][14] + +JingOS has an app store of its own where it provides a handful of applications that work on the touch devices. + +![JingOS App Store][15] + +The app store does not offer many applications at the moment but _**you can use the apt package manager**_ to get additional software (from JingOS’s repositories). + +My biggest complaint is not about the lack of applications. It’s about the versions of some of the offered applications. I downloaded Mozilla Firefox from the app store and it installed version 82. The current Firefox version is 92 at the time of writing the review. I tried updating the system, even in command line, to see if it gets updates but there were none. + +Because of this outdated version, I could not [play Netflix on Firefox][16]. There is no dedicated Netflix app so this was the only way to test it. + +![Issue with outdated Firefox][17] + +There are plans to add Android apps support as well. I cannot say how well it will work but something is better than nothing. + +### Using JingPad for coding + +I am not a programmer, not anymore at least. But since JingPad’s targeted customer include young coders who are frequently on the move, I tried using it for some simple coding. + +There is no IDE available from the App Store but VS Code was available to install from the APT repository as well as in DEB file format. I installed it and opened it but it never ran like it was supposed to be. + +So, I installed Gedit and wrote some sample bash scripts. Not much of coding but with the attached keyboard, it was not too bad. + +It would have been a lot better if the copy-paste worked but unfortunately, I was not able to select and copy the code from random websites like a true programmer of the 21st century. I hope this gets fixed in the future updates. + +### Android compatibility and other operating systems + +I know what you are thinking. The tab looks good hardware wise. It is designed to run a Linux distribution based on Ubuntu. So can I use Ubuntu or some other distributions? + +JingOS team says that you are free to install any other operating system on it. It uses ARM architecture so that is something to keep in mind while replacing the OS. + +You will also be able to install JingOS back. I am yet to experiment with this part. I’ll update the review when I do that. + +As per the [roadmap of JingOS][18], there are plans for adding Android compatibility. This means you should be able to install Android or Android based ROM/distributions. As per the JingOS team, they will be developing the solution in house instead of using tools like Anbox. That will be interesting to see. + +Here’s a demo video of an Android app running on JingPad under JingOS: + +### Conclusion + +JingOS is in alpha stage of development at the moment. Most of the issues I have encountered in this review should be addressed in the future OTA updates, as their roadmap suggests. The final stable version of JingPad should be available by March 2022. + +JingPad as a device comes on the pricey side but it also gives you a high-end gadget. 2K AMOLED display with Gorilla Glass, 8 GB RAM, 256 GB UMCP storage and other stuff you get only in high-end devices. The sound from the speakers is decent. + +The magnetic tab cover and the detachable keyboards are also of premium quality. These things matter because you are paying a good amount of money for it. + +The [JingPad with the Pencil][19] (stylus) and the keyboard costs $899. It comes with free international shipping and 1-year warranty. In many countries, there will also be additional custom duty levied on top of this price. + +That seems like a lot of money, right? If you compare it to the price of iPad Air with same specifications (256 GB storage, WiFi+Cellular), keyboard and Pencil, the Apple device price reaches $1300 in the USA. + +It is natural to compare JingPad with PineTab, another ARM-based Linux tablet. But PineTab is not a high-end gadget. It has modest specification and geared towards DIY tinkerers. JingPad, on the other hand, targets regular users, not just the DIY geeks. + +Altogether, JingPad is aiming to give you a true Linux tablet but in the premium range. You get what you are paying for. A premium device for a premium pricing, with the freedom to run Linux on it. + +_**But at this stage, JingOS has a lot of pending work to make JingPad a consumer level Linux tablet.**_ You should wait for the final device unless you really want your hands on it right away. + +I plan to make a video review of the device where you can see it in action. I am not very good at doing video reviews, so this will take some time. You may leave your comments on what you would like to see in the video review and I’ll try to cover it. + +_Meanwhile, you can follow the updates on JingPad and JingOS development on their [Telegram channel][20] or [Discord][21]. You may also watch the demos on [their YouTube channel][22]._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/jingpad-a1-review/ + +作者:[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://en.jingos.com/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jing-os-interaface.webp?resize=768%2C512&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad.jpeg?resize=800%2C529&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-interface.webp?resize=800%2C584&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-theme-change.webp?resize=800%2C584&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-plasma-notification.webp?resize=800%2C584&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-terminal.webp?resize=800%2C584&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-landscape.webp?resize=800%2C584&ssl=1 +[9]: https://forum-cdn.jingos.com/uploads/default/original/1X/4c6ef800ef62f0315852fde4f2c32958b32d93a9.png +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-with-keyboard.webp?resize=800%2C600&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-keyboard-angle.webp?resize=800%2C600&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-camera.png?resize=787%2C552&ssl=1 +[13]: https://github.com/JingOS-team/JingOS +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-music-app.webp?resize=800%2C584&ssl=1 +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-app-store.webp?resize=800%2C584&ssl=1 +[16]: https://itsfoss.com/netflix-firefox-linux/ +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/JingPad-Netflix-Issue.webp?resize=800%2C584&ssl=1 +[18]: https://forum.jingos.com/t/feature-roadmap-of-jingos-arm-on-the-jingpad-a1/1708 +[19]: https://www.indiegogo.com/projects/jingpad-world-s-first-consumer-level-linux-tablet#/ +[20]: https://t.me/JingOS_Linux +[21]: https://discord.gg/uuWc8qKM +[22]: https://www.youtube.com/channel/UCRbaVa2v845SEtRadSlhWmA From 35b9c7010b22110f3115dd1131c10b770b37b01e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Sep 2021 05:03:59 +0800 Subject: [PATCH 0463/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210922?= =?UTF-8?q?=20My=20favorite=20LibreOffice=20productivity=20tips?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210922 My favorite LibreOffice productivity tips.md --- ... favorite LibreOffice productivity tips.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20210922 My favorite LibreOffice productivity tips.md diff --git a/sources/tech/20210922 My favorite LibreOffice productivity tips.md b/sources/tech/20210922 My favorite LibreOffice productivity tips.md new file mode 100644 index 0000000000..d4d5193d19 --- /dev/null +++ b/sources/tech/20210922 My favorite LibreOffice productivity tips.md @@ -0,0 +1,115 @@ +[#]: subject: "My favorite LibreOffice productivity tips" +[#]: via: "https://opensource.com/article/21/9/libreoffice-tips" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +My favorite LibreOffice productivity tips +====== +Here are some LibreOffice keyboard shortcuts and formatting tips that +might save you valuable time. +![woman on laptop sitting at the window][1] + +LibreOffice is my productivity application of choice. It's one of the most potent reasons for recommending Linux distributions to educators and students, whether PK-12 or higher education. Now that the school year is upon us, I thought I would recommend some LibreOffice shortcuts and tips that might save you valuable time. + +### Work faster with keyboard shortcuts + +I use a lot of keyboard shortcuts. Here are the most common shortcuts that apply to all LibreOffice applications. + + * **Ctrl**+**N**—Create a new document + * **Ctrl**+**O**—Open a document + * **Ctrl**+**S**—Save a document + * **Ctrl**+**Shift**+**S**—Save as + * **Ctrl**+**P**—Print a document + + + +Here are some shortcut keys just for LibreOffice Writer: + + * **Home**—Takes you to the beginning of the current line. + * **End**—Takes you to the end of a line. + * **Ctrl**+**Home**—Takes the cursor to the start of the document + * **Ctrl**+**End**—Takes the cursor to the end of the document + * **Ctrl**+**A**—Select All + * **Ctrl**+**D**—Double Underline + * **Ctrl**+**E**—Centered + * **Ctrl**+**H**—Find and Replace + * **Ctrl**+**L**—Align Left + * **Ctrl**+**R**—Align Right + + + +Function keys have value too: + + * **F2**—Opens the formula bar + * **F3**—Completes auto-text + * **F5**—Opens the navigator + * **F7**—Opens spelling and grammar + * **F11**—Opens styles and formatting + * **Shift**+**F11**—Creates a new style + + + +### Document formats + +There are lots of document formats out there, and LibreOffice supports a good number of them. By default, LibreOffice saves documents to the Open Document Format, an open source standard that stores stylesheets and data in a ZIP container labeled as ODT for text documents, ODS for spreadsheets, and ODP for presentations. It's a flexible format and is maintained by the LibreOffice community as well as the Document Foundation. + +The Open Document Format is on by default, so you don't need to do anything to get LibreOffice to use it. + +Another open specification for documents is Microsoft's [Office Open XML format][2]. It's an ISO standard and is well supported by all the major office solutions. + +If you work with folks using Microsoft Office (which itself is not open source, but it does use the open OOXML format), then they're definitely used to DOCX, XLSX, and, PPTX formats and probably can't open ODT, ODS, or ODP files. You can avoid a lot of confusion by setting LibreOffice to save to OOXML by default. + +To set OOXML as your preferred format:  + + 1. Click on the **Tools** menu and select **Options** at the bottom of the menu. + + 2. In the **Options** window, click on the **Load/Save** category in the left panel and select **General**. + +![LibreOffice settings panel][3] + +(Don Watkins, [CC BY-SA 4.0][4]) + + 3. Navigate to the **Default File Format and ODF Settings** section. + + 4. Choose _Text document_ for the **Document type** and choose _Open XML (Transitional) (*.docx)_ for the **Always save as **drop-down list. + + 5. Click **Apply** and then **OK**.  + + 6. Deselect the **Warn when not saving in ODF or default format** to avoid confirmation dialogue boxes when saving. + +![LibreOffice save formats][5] + +(Don Watkins, [CC BY-SA 4.0][4]) + + + + +Repeat the same process XLSX and PPTX documents by following the same logic.  + +### Free your office + +The LibreOffice project is managed by a thriving community of users and developers, in tandem with the Document Foundation. This includes an Engineering Steering Committee, a Board of Directors, independent developers and designers and translators, and more. These teams are always open to your contribution, so if you're eager to participate in a great open source project, don't hesitate to [get involved][6]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/libreoffice-tips + +作者:[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/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) +[2]: https://www.iso.org/standard/71691.html +[3]: https://opensource.com/sites/default/files/uploads/libreoffice-panel.jpg (LibreOffice settings panel) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/sites/default/files/uploads/libreoffice-save-format.jpg (LibreOffice save formats) +[6]: https://www.libreoffice.org/community/get-involved/ From 572bfc7c887ad2d86c9ea0ee082c15c0739dfd1c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Sep 2021 05:04:16 +0800 Subject: [PATCH 0464/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210922?= =?UTF-8?q?=20Add=20storage=20with=20LVM?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210922 Add storage with LVM.md --- sources/tech/20210922 Add storage with LVM.md | 284 ++++++++++++++++++ 1 file changed, 284 insertions(+) create mode 100644 sources/tech/20210922 Add storage with LVM.md diff --git a/sources/tech/20210922 Add storage with LVM.md b/sources/tech/20210922 Add storage with LVM.md new file mode 100644 index 0000000000..c4b3447aa5 --- /dev/null +++ b/sources/tech/20210922 Add storage with LVM.md @@ -0,0 +1,284 @@ +[#]: subject: "Add storage with LVM" +[#]: via: "https://opensource.com/article/21/9/add-storage-lvm" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Add storage with LVM +====== +LVM enables extreme flexibility in how you configure your storage. +![Storage units side by side][1] + +Logical Volume Manager (LVM) allows for a layer of abstraction between the operating system and the hardware. Normally, your OS looks for disks (`/dev/sda`, `/dev/sdb`, and so on) and partitions within those disks (`/dev/sda1`, `/dev/sdb1`, and so on). + +In LVM, a virtual layer is created between the operating system and the disks. Instead of one drive holding some number of partitions, LVM creates a unified storage pool (called a _Volume Group_) that spans any number of physical drives (called _Physical Volumes_). Using the storage available in a Volume Group, LVM provides what appear to be disks and partitions to your OS. + +And the operating system is completely unaware that it's being "tricked." + +![Drive space][2] + +Opensource.com, [CC BY-SA 4.0][3] + +Because the LVM creates volume groups and logical volumes virtually, it makes it easy to resize or move them, or create new volumes, even while the system is running. Additionally, LVM provides features that are not present otherwise, like creating live snapshots of logical volumes, without unmounting the disk first. + +A volume group in an LVM is a named virtual container that groups together the underlying physical disks. It acts as a pool from which logical volumes of different sizes can be created. Logical volumes contain the actual file system and can span multiple disks, and don't need to be physically contiguous. + +### Features + + * Partition names normally have system designations like `/dev/sda1`. LVM volumes have normal human-understandable names, like `home` or `media`. + * The total size of partitions is limited by the size of the underlying physical disk. In LVM, volumes can span multiple disks, and are only limited by the total size of all physical disks in the LVM. + * Partitions can normally only be resized, moved, or deleted when the disk is not in use and is unmounted. LVM volumes can be manipulated while the system is running. + * Partitions can only be expanded by allocating them free space adjacent to the partition. LVM volumes can take free space from anywhere. + * Expanding a partition involves moving the data around to make free space, which is time-consuming and could lead to data loss during a power outage. LVM volumes can take free space from anywhere in the volume group, even on another disk. + * Because it’s so easy to create volumes in an LVM, it encourages creating different volumes, like creating separate volumes to test features or to try different operating systems. With partitions, this process would be time-consuming and error-prone. + * Snapshots can only be created in an LVM. It allows you to create a point-in-time image of the current logical volume, even while the system is running. This is great for backups. + + + +### Test setup + +As a demonstration, assume your system has the following drive configuration: + + +``` +NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +xvda    202:0    0   8G  0 disk +`-xvda1 202:1    0   8G  0 part / +xvdb    202:16   0   1G  0 disk +xvdc    202:32   0   1G  0 disk +xvdd    202:48   0   2G  0 disk +xvde    202:64   0   5G  0 disk +xvdf    202:80   0   8G  0 disk +``` + +#### Step 1. Initialize disks to use with LVM + +Run `pvcreate /dev/xvdb /dev/xvdc /dev/xvdd /dev/xvde /dev/xvdf`. The output should be: + + +``` +Physical volume "/dev/xvdb" successfully created +Physical volume "/dev/xvdc" successfully created +Physical volume "/dev/xvdd" successfully created +Physical volume "/dev/xvde" successfully created +Physical volume "/dev/xvdf" successfully created +``` + +See the result using `pvs` or `pvdisplay`: + + +``` +"/dev/xvde" is a new physical volume of "5.00 GiB" +\--- NEW Physical volume --- +PV Name               /dev/xvde +VG Name +PV Size               5.00 GiB +Allocatable           NO +PE Size               0 +Total PE              0 +Free PE               0 +Allocated PE          0 +PV UUID               728JtI-ffZD-h2dZ-JKnV-8IOf-YKdS-8srJtn + +"/dev/xvdb" is a new physical volume of "1.00 GiB" +\--- NEW Physical volume --- +PV Name               /dev/xvdb +VG Name +PV Size               1.00 GiB +Allocatable           NO +PE Size               0 +Total PE              0 +Free PE               0 +Allocated PE          0 +PV UUID               zk1phS-7uXc-PjBP-5Pv9-dtAV-zKe6-8OCRkZ + +"/dev/xvdd" is a new physical volume of "2.00 GiB" +\--- NEW Physical volume --- +PV Name               /dev/xvdd +VG Name +PV Size               2.00 GiB +Allocatable           NO +PE Size               0 +Total PE              0 +Free PE               0 +Allocated PE          0 +PV UUID               R0I139-Ipca-KFra-2IZX-o9xJ-IW49-T22fPc + +"/dev/xvdc" is a new physical volume of "1.00 GiB" +\--- NEW Physical volume --- +PV Name               /dev/xvdc +VG Name +PV Size               1.00 GiB +Allocatable           NO +PE Size               0 +Total PE              0 +Free PE               0 +Allocated PE          0 +PV UUID               FDzcVS-sq22-2b13-cYRj-dXHf-QLjS-22Meae + +"/dev/xvdf" is a new physical volume of "8.00 GiB" +\--- NEW Physical volume --- +PV Name               /dev/xvdf +VG Name +PV Size               8.00 GiB +Allocatable           NO +PE Size               0 +Total PE              0 +Free PE               0 +Allocated PE          0 +PV UUID               TRVSH9-Bo5D-JHHb-g0NX-8IoS-GG6T-YV4d0p +``` + +#### Step 2. Create the volume group + +Run `vgcreate myvg /dev/xvdb /dev/xvdc /dev/xvdd /dev/xvde /dev/xvdf`. See the results with `vgs` or `vgdisplay`: + + +``` +\--- Volume group --- +VG Name               myvg +System ID +Format                lvm2 +Metadata Areas        5 +Metadata Sequence No  1 +VG Access             read/write +VG Status             resizable +MAX LV                0 +Cur LV                0 +Open LV               0 +Max PV                0 +Cur PV                5 +Act PV                5 +VG Size               16.98 GiB +PE Size               4.00 MiB +Total PE              4347 +Alloc PE / Size       0 / 0 +Free  PE / Size       4347 / 16.98 GiB +VG UUID               ewrrWp-Tonj-LeFa-4Ogi-BIJJ-vztN-yrepkh +``` + +#### Step 3: Create logical volumes + +Run the following commands: + + +``` +lvcreate myvg --name media --size 4G +lvcreate myvg --name home --size 4G +``` + +Verify the results using `lvs` or `lvdisplay`: + + +``` +\--- Logical volume --- +LV Path                /dev/myvg/media +LV Name                media +VG Name                myvg +LV UUID                LOBga3-pUNX-ZnxM-GliZ-mABH-xsdF-3VBXFT +LV Write Access        read/write +LV Creation host, time ip-10-0-5-236, 2017-02-03 05:29:15 +0000 +LV Status              available +# open                 0 +LV Size                4.00 GiB +Current LE             1024 +Segments               1 +Allocation             inherit +Read ahead sectors     auto +\- currently set to     256 +Block device           252:0 + +\--- Logical volume --- +LV Path                /dev/myvg/home +LV Name                home +VG Name                myvg +LV UUID                Hc06sl-vtss-DuS0-jfqj-oNce-qKf6-e5qHhK +LV Write Access        read/write +LV Creation host, time ip-10-0-5-236, 2017-02-03 05:29:40 +0000 +LV Status              available +# open                 0 +LV Size                4.00 GiB +Current LE             1024 +Segments               1 +Allocation             inherit +Read ahead sectors     auto +\- currently set to     256 +Block device           252:1 +``` + +#### Step 4: Create the file system + +Create the file system using: + + +``` +mkfs.ext3 /dev/myvg/media +mkfs.ext3 /dev/myvg/home +``` + +Mount it: + + +``` +mount /dev/myvg/media /media +mount /dev/myvg/home /home +``` + +See your full setup using `lsblk`: + + +``` +NAME         MAJ:MIN RM SIZE RO TYPE MOUNTPOINT +xvda         202:0    0   8G  0 disk +`-xvda1      202:1    0   8G  0 part / +xvdb         202:16   0   1G  0 disk +xvdc         202:32   0   1G  0 disk +xvdd         202:48   0   2G  0 disk +xvde         202:64   0   5G  0 disk +`-myvg-media 252:0    0   4G  0 lvm  /media +xvdf         202:80   0   8G  0 disk +`-myvg-home  252:1    0   4G  0 lvm  /home +``` + +#### Step 5: Extending the LVM + +Add a new disk at `/dev/xvdg`. To extend the `home` volume, run the following commands: + + +``` +pvcreate /dev/xvdg +vgextend myvg /dev/xvdg +lvextend -l 100%FREE /dev/myvg/home +resize2fs /dev/myvg/home +``` + +Run `df -h` and you should see your new size reflected. + +And that's it! + +LVM enables extreme flexibility in how you configure your storage. Try it out, and have fun with LVM! + +* * * + +_This article was originally published on the [author's personal blog][4] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/add-storage-lvm + +作者:[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/bus-storage.png?itok=95-zvHYl (Storage units side by side) +[2]: https://opensource.com/sites/default/files/lvm.png (Drive space) +[3]: https://creativecommons.org/licenses/by-sa/4.0/ +[4]: https://notes.ayushsharma.in/2017/02/working-with-logical-volume-manager-lvm From 893b42f593a9e19f3fc0e81593d180cf942724b6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Sep 2021 05:06:08 +0800 Subject: [PATCH 0465/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210922?= =?UTF-8?q?=20Ubuntu=20Touch=20OTA-19=20Brings=20in=20Support=20for=20New?= =?UTF-8?q?=20Devices=20With=20Multiple=20Bug=20Fixes?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md --- ...for New Devices With Multiple Bug Fixes.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md diff --git a/sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md b/sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md new file mode 100644 index 0000000000..ee950086fa --- /dev/null +++ b/sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md @@ -0,0 +1,80 @@ +[#]: subject: "Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes" +[#]: via: "https://news.itsfoss.com/ubuntu-touch-ota-19/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes +====== + +Ubuntu Touch is an open-source OS for mobile devices that respects user privacy, unlike Google’s Android for privacy-focused users. The UBports community has released yet another update of Ubuntu Touch that is based on Ubuntu 16.04. + +This release supports many new devices and contains significant updates on certain phones, along with numerous bug fixes. + +Let’s take a look at them. + +![Source: UBports][1] + +### What’s New? + +#### Framework and Packages + +The 16.04.7 Qt framework and packages like qml-module-qtwebview and libqt5webview5-dev have been added to the App framework. This improves application compatibility with other platforms. + +#### Imrpovements to Halium devices + +The gyroscope and magnetic field sensors can now be accessed on the Halium 5.1 and 7.1 devices. Do note that the functionality of the compass is still under development. The same applies to the magnetic field sensor for the Halium 9 and 10 devices that now use sensorfw, thus replacing the legacy platform-API. + +#### Pixel 3a + +You can completely shut down the device as intended. It no longer hangs in the process of the shutdown, so you should have better battery life. Additionally, the freezing of the camera app while capturing sounds when recording videos has also been fixed. + +#### Messaging App Fix + +The messaging app has also received a minor update. When messages arrive, the keyboard will no longer appear automatically but when needed. This is useful if the user doesn’t want to reply or access the keyboard on demand. + +#### Media Hub + +A bug that prevented the device from sleep when audio sounds were played in successions has been fixed. Another major bug that reduced battery life drastically, because of uncleared requested wake locks, has also been taken care of. + +### Other Improvements + +There are several new devices added to support Ubuntu Touch, along with fixes for the Wi-Fi, audio, and camera. + +You can look at the [official release notes][2] to check the list of devices added and explore more technical details. + +### Update or Installation + +Ubuntu Touch users should automatically receive an update or head to the updates in the System Settings to check for available updates. + +Those willing to try out Ubuntu Touch for the first time can explore the [official website][3] and check if their device is supported correctly before installation. + +I am particularly looking forward to the Ubuntu Touch OS update with Ubuntu 18.04 or newer as its base after several minor updates. + +_What do you think about this new update? 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/ubuntu-touch-ota-19/ + +作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMiIgd2lkdGg9IjM0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://ubports.com/blog/ubports-news-1/post/ubuntu-touch-ota-19-release-3779 +[3]: https://ubuntu-touch.io/get-ubuntu-touch From 499b84fca636da98536a6d05104eafb16e0ac224 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 23 Sep 2021 05:06:18 +0800 Subject: [PATCH 0466/1588] add done: 20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md --- sources/tech/20210923 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210923 .md diff --git a/sources/tech/20210923 .md b/sources/tech/20210923 .md new file mode 100644 index 0000000000..2315810089 --- /dev/null +++ b/sources/tech/20210923 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/cpu-hdd-temperature-ubuntu/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From dc09a034f5f4f8eb80d352a1b4b0a996f9b6d1fe Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 23 Sep 2021 08:41:31 +0800 Subject: [PATCH 0467/1588] translating --- sources/tech/20210917 Start using YAML now.md | 129 ------------------ .../tech/20210917 Start using YAML now.md | 129 ++++++++++++++++++ 2 files changed, 129 insertions(+), 129 deletions(-) delete mode 100644 sources/tech/20210917 Start using YAML now.md create mode 100644 translated/tech/20210917 Start using YAML now.md diff --git a/sources/tech/20210917 Start using YAML now.md b/sources/tech/20210917 Start using YAML now.md deleted file mode 100644 index 3b626bad09..0000000000 --- a/sources/tech/20210917 Start using YAML now.md +++ /dev/null @@ -1,129 +0,0 @@ -[#]: subject: "Start using YAML now" -[#]: via: "https://opensource.com/article/21/9/intro-yaml" -[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Start using YAML now -====== -What is YAML, and why is it about time we started using it? -![woman on laptop sitting at the window][1] - -YAML (YAML Ain't Markup Language) is a human-readable data serialization language. Its syntax is simple and human-readable. It does not contain quotation marks, opening and closing tags, or braces. It does not contain anything which might make it harder for humans to parse nesting rules. You can scan your YAML document and immediately know what's going on. - -### YAML features - -YAML has some super features which make it superior to other serialization formats: - - * Easy to skim. - * Easy to use. - * Portable between programming languages. - * Native data structures of Agile languages. - * Consistent model to support generic tools. - * Supports one-pass processing. - * Expressive and extensible. - - - -I will show you YAML's power further with some examples. - -Can you figure out what's going on below? - - -``` -\------- -# My grocery list -groceries: -    - Milk -     - Eggs -     - Bread -     - Butter -... -``` - -The above example contains a simple list of groceries to buy, and it's a fully-formed YAML document. In YAML, strings aren't quoted, and lists need simple hyphens and spaces. A YAML document starts with **\---** and ends with **...**, but they are optional. Comments in YAML begin with a **#**. - -Indentation is key in YAML. Indentation must contain spaces, not tabs. And while the number of spaces required is flexible, it's a good idea to keep them consistent. - -### Basic Elements - -#### Collections - -YAML has two types of collections: _Lists_ (for sequences) and _dictionaries_ (for mappings). Lists are key-value pairs where every value is on a new line, beginning with a hyphen and space. Dictionaries are key-value pairs where every value is a mapping containing a key, a colon and space, and a value. - -For example: - - -``` -# My List -groceries: -    - Milk -     - Eggs -     - Bread -     - Butter - -# My dictionary -contact: - name: Ayush Sharma - email: [myemail@example.com][2] -``` - -Lists and dictionaries are often combined to provide more complex data structures. Lists can contain dictionaries, and dictionaries can contain lists. - -#### Strings - -Strings in YAML don't need quotation marks. Multi-line strings are defined using **|** or **>**. The former preserves newlines, but the latter does not. - -For example: - - -``` -my_string: | -    This is my string. -     It can contain many lines. -     Newlines are preserved. -my_string_2: > -    This is my string. -     This can also contain many lines. -     Newlines aren't preserved and all lines are folded. -``` - -#### Anchors - -YAML can have repeatable blocks of data using node anchors. The **&** character defines a block of data that is later referenced using *****. For example: - - -``` -billing_address: &add1 - house: B1 - street: My Street - -shipping_address: *add1 -``` - -At this point, you know enough YAML to get started. You can play around with the online YAML parser to test yourself. If you work with YAML daily, then [this handy cheatsheet][3] will be helpful. - -* * * - -_This article was originally published on the [author's personal blog][4] and has been adapted with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/intro-yaml - -作者:[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/lenovo-thinkpad-laptop-window-focus.png?itok=g0xPm2kD (young woman working on a laptop) -[2]: mailto:myemail@example.com -[3]: https://yaml.org/refcard.html -[4]: https://notes.ayushsharma.in/2021/08/introduction-to-yaml diff --git a/translated/tech/20210917 Start using YAML now.md b/translated/tech/20210917 Start using YAML now.md new file mode 100644 index 0000000000..a0523859ba --- /dev/null +++ b/translated/tech/20210917 Start using YAML now.md @@ -0,0 +1,129 @@ +[#]: subject: "Start using YAML now" +[#]: via: "https://opensource.com/article/21/9/intro-yaml" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +现在就开始使用 YAML +====== +什么是 YAML,为什么我们现在应该开始使用它了? +![woman on laptop sitting at the window][1] + +YAML(YAML Ain't Markup Language)是一种人类可读的数据序列化语言。它的语法很简单,而且是人类可读的。它不包含引号、打开和关闭标签或大括号。它不包含任何可能使人类难以解析嵌套规则的东西。你可以扫描你的 YAML 文档并立即知道发生了什么。 + +### YAML 特性 + +YAML 有一些超级特性,使其优于其他序列化格式: + + * 易于浏览。 + * 易于使用。 + * 可在编程语言之间移植。 + * 敏捷语言的原生数据结构。 + * 支持通用工具的一致的模型。 + * 支持一次性处理。 + * 表现力和可扩展性。 + + + +我将通过一些例子进一步向你展示 YAML 的强大。 + +你能弄清楚下面发生了什么吗? + + +``` +\------- +# My grocery list +groceries: + - Milk + - Eggs + - Bread + - Butter +... +``` + +上面的例子包含了一个简单的要买的杂货清单,它是一个完全格式化的 YAML 文档。在 YAML 中,字符串不加引号,而列表需要简单的连字符和空格。一个 YAML 文档以 **\---** 开始,以 **...** 结束,但它们是可选的。YAML中的注释以 **#** 开始。 + +缩进是 YAML 的关键。缩进必须包含空格,而不是制表符。虽然所需的空格数量是灵活的,但保持一致是个好主意。 + +### 基本元素 + +#### 集合 + +YAML 有两种类型的集合。_列表_(用于序列)和_字典_(用于映射)。列表是键值对,每个值都在一个新的行中,以连字符和空格开始。字典是键值对,每个值都是一个映射,包含一个键、一个冒号和空格以及一个值。 + +例如: + + +``` +# My List +groceries: + - Milk + - Eggs + - Bread + - Butter + +# My dictionary +contact: +name: Ayush Sharma +email: [myemail@example.com][2] +``` + +列表和字典经常被结合起来,以提供更复杂的数据结构。列表可以包含字典,而字典可以包含列表。 + +#### 字符串 + +YAML 中的字符串不需要加引号。多行字符串可以用 **|** 或 **>** 来定义。前者保留了换行符,而后者则没有。 + +例如: + + +``` +my_string: | + This is my string. + It can contain many lines. + Newlines are preserved. +my_string_2: > + This is my string. + This can also contain many lines. + Newlines aren't preserved and all lines are folded. +``` + +#### 锚点 + +YAML 可以通过节点锚点来获得可重复的数据块。**&** 字符定义了一个数据块,以后可以用 * 来引用。例如: + + +``` +billing_address: &add1 +house: B1 +street: My Street + +shipping_address: *add1 +``` + +到此为止,你对 YAML 的了解足以让你开始工作。你可以使用在线 YAML 解析器来测试。如果你每天都与 YAML 打交道,那么[这个方便的备忘单][3]会对你有所帮助。 + +* * * + +_这篇文章最初发表在[作者的个人博客][4]上,并经授权改编。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/intro-yaml + +作者:[Ayush Sharma][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/ayushsharma +[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]: mailto:myemail@example.com +[3]: https://yaml.org/refcard.html +[4]: https://notes.ayushsharma.in/2021/08/introduction-to-yaml From 4d13d44b527cbf940af171275e3a626edbced7a4 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 23 Sep 2021 08:44:18 +0800 Subject: [PATCH 0468/1588] translating --- sources/tech/20210921 Run containers on your Mac with Lima.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210921 Run containers on your Mac with Lima.md b/sources/tech/20210921 Run containers on your Mac with Lima.md index 698d52362b..58f388a3e8 100644 --- a/sources/tech/20210921 Run containers on your Mac with Lima.md +++ b/sources/tech/20210921 Run containers on your Mac with Lima.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/run-containers-mac-lima" [#]: author: "Moshe Zadka https://opensource.com/users/moshez" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From f3d18e81cec0b6ae807c847e1c92a8463946721a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 23 Sep 2021 09:13:51 +0800 Subject: [PATCH 0469/1588] Delete 20210923 .md --- sources/tech/20210923 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210923 .md diff --git a/sources/tech/20210923 .md b/sources/tech/20210923 .md deleted file mode 100644 index 2315810089..0000000000 --- a/sources/tech/20210923 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/cpu-hdd-temperature-ubuntu/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 2c26a99c1622fbf35deef65e69c322a346f445a0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Sep 2021 09:54:18 +0800 Subject: [PATCH 0470/1588] PRF&PUB @geekpi https://linux.cn/article-13811-1.html --- published/20210917 Start using YAML now.md | 126 +++++++++++++++++ .../tech/20210917 Start using YAML now.md | 129 ------------------ 2 files changed, 126 insertions(+), 129 deletions(-) create mode 100644 published/20210917 Start using YAML now.md delete mode 100644 translated/tech/20210917 Start using YAML now.md diff --git a/published/20210917 Start using YAML now.md b/published/20210917 Start using YAML now.md new file mode 100644 index 0000000000..51a6134df8 --- /dev/null +++ b/published/20210917 Start using YAML now.md @@ -0,0 +1,126 @@ +[#]: subject: "Start using YAML now" +[#]: via: "https://opensource.com/article/21/9/intro-yaml" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13811-1.html" + +YAML 使用入门 +====== + +> 什么是 YAML,为什么我们现在应该开始使用它? + +![](https://img.linux.net.cn/data/attachment/album/202109/23/095242fw0qzzp5fe6e565z.jpg) + +[YAML](https://yaml.org/)(YAML 不是标记语言YAML Ain't Markup Language)是一种适宜阅读理解的数据序列化语言。它的语法简单而易于阅读。它不包含引号、打开和关闭的标签或大括号。它不包含任何可能使人类难以解析嵌套规则的东西。你可以看一下你的 YAML 文档就知道它在什么。 + +### YAML 特性 + +YAML 有一些超级特性,使其优于其他序列化格式: + + * 易于略读。 + * 易于使用。 + * 可在编程语言之间移植。 + * 敏捷语言的原生数据结构。 + * 支持通用工具的一致模型。 + * 支持一次性处理。 + * 表现力和可扩展性。 + +我将通过一些例子进一步向你展示 YAML 的强大。 + +你能弄清楚下面发生了什么吗? + +``` +------- +# My grocery list +groceries: + - Milk + - Eggs + - Bread + - Butter +... +``` + +上面的例子包含了一个简单的杂货购物清单,它是一个完全格式化的 YAML 文档。在 YAML 中,字符串不加引号,而列表需要简单的连字符和空格。一个 YAML 文档以 `---` 开始,以 `...` 结束,但它们是可选的。YAML中的注释以 `#` 开始。 + +缩进是 YAML 的关键。缩进必须包含空格,而不是制表符。虽然所需的空格数量是灵活的,但保持一致是个好主意。 + +### 基本元素 + +#### 集合 + +YAML 有两种类型的集合。列表(用于序列)和字典(用于映射)。列表是键值对,每个值都在一个新的行中,以连字符和空格开始。字典也是键值对,每个值都是一个映射,包含一个键、一个冒号和空格以及一个值。 + +例如: + +``` +# My List +groceries: + - Milk + - Eggs + - Bread + - Butter + +# My dictionary +contact: + name: Ayush Sharma + email: myemail@example.com +``` + +列表和字典经常被结合起来,以提供更复杂的数据结构。列表可以包含字典,而字典可以包含列表。 + +#### 字符串 + +YAML 中的字符串不需要加引号。多行字符串可以用 `|` 或 `>` 来定义。前者保留了换行符,而后者则没有。 + +例如: + +``` +my_string: | + This is my string. + It can contain many lines. + Newlines are preserved. +``` + +``` +my_string_2: > + This is my string. + This can also contain many lines. + Newlines aren't preserved and all lines are folded. +``` + +#### 锚点 + +YAML 可以通过节点锚点来获得可重复的数据块。`&` 字符定义了一个数据块,以后可以用 `*` 来引用。例如: + +``` +billing_address: &add1 + house: B1 + street: My Street + +shipping_address: *add1 +``` + +至止你对 YAML 的了解就足以让你开始工作了。你可以使用在线 YAML 解析器来测试。如果你每天都与 YAML 打交道,那么 [这个方便的备忘单][3] 会对你有所帮助。 + +_这篇文章最初发表在[作者的个人博客][4]上,并经授权改编。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/intro-yaml + +作者:[Ayush Sharma][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/ayushsharma +[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]: mailto:myemail@example.com +[3]: https://yaml.org/refcard.html +[4]: https://notes.ayushsharma.in/2021/08/introduction-to-yaml diff --git a/translated/tech/20210917 Start using YAML now.md b/translated/tech/20210917 Start using YAML now.md deleted file mode 100644 index a0523859ba..0000000000 --- a/translated/tech/20210917 Start using YAML now.md +++ /dev/null @@ -1,129 +0,0 @@ -[#]: subject: "Start using YAML now" -[#]: via: "https://opensource.com/article/21/9/intro-yaml" -[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -现在就开始使用 YAML -====== -什么是 YAML,为什么我们现在应该开始使用它了? -![woman on laptop sitting at the window][1] - -YAML(YAML Ain't Markup Language)是一种人类可读的数据序列化语言。它的语法很简单,而且是人类可读的。它不包含引号、打开和关闭标签或大括号。它不包含任何可能使人类难以解析嵌套规则的东西。你可以扫描你的 YAML 文档并立即知道发生了什么。 - -### YAML 特性 - -YAML 有一些超级特性,使其优于其他序列化格式: - - * 易于浏览。 - * 易于使用。 - * 可在编程语言之间移植。 - * 敏捷语言的原生数据结构。 - * 支持通用工具的一致的模型。 - * 支持一次性处理。 - * 表现力和可扩展性。 - - - -我将通过一些例子进一步向你展示 YAML 的强大。 - -你能弄清楚下面发生了什么吗? - - -``` -\------- -# My grocery list -groceries: - - Milk - - Eggs - - Bread - - Butter -... -``` - -上面的例子包含了一个简单的要买的杂货清单,它是一个完全格式化的 YAML 文档。在 YAML 中,字符串不加引号,而列表需要简单的连字符和空格。一个 YAML 文档以 **\---** 开始,以 **...** 结束,但它们是可选的。YAML中的注释以 **#** 开始。 - -缩进是 YAML 的关键。缩进必须包含空格,而不是制表符。虽然所需的空格数量是灵活的,但保持一致是个好主意。 - -### 基本元素 - -#### 集合 - -YAML 有两种类型的集合。_列表_(用于序列)和_字典_(用于映射)。列表是键值对,每个值都在一个新的行中,以连字符和空格开始。字典是键值对,每个值都是一个映射,包含一个键、一个冒号和空格以及一个值。 - -例如: - - -``` -# My List -groceries: - - Milk - - Eggs - - Bread - - Butter - -# My dictionary -contact: -name: Ayush Sharma -email: [myemail@example.com][2] -``` - -列表和字典经常被结合起来,以提供更复杂的数据结构。列表可以包含字典,而字典可以包含列表。 - -#### 字符串 - -YAML 中的字符串不需要加引号。多行字符串可以用 **|** 或 **>** 来定义。前者保留了换行符,而后者则没有。 - -例如: - - -``` -my_string: | - This is my string. - It can contain many lines. - Newlines are preserved. -my_string_2: > - This is my string. - This can also contain many lines. - Newlines aren't preserved and all lines are folded. -``` - -#### 锚点 - -YAML 可以通过节点锚点来获得可重复的数据块。**&** 字符定义了一个数据块,以后可以用 * 来引用。例如: - - -``` -billing_address: &add1 -house: B1 -street: My Street - -shipping_address: *add1 -``` - -到此为止,你对 YAML 的了解足以让你开始工作。你可以使用在线 YAML 解析器来测试。如果你每天都与 YAML 打交道,那么[这个方便的备忘单][3]会对你有所帮助。 - -* * * - -_这篇文章最初发表在[作者的个人博客][4]上,并经授权改编。_ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/intro-yaml - -作者:[Ayush Sharma][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/ayushsharma -[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]: mailto:myemail@example.com -[3]: https://yaml.org/refcard.html -[4]: https://notes.ayushsharma.in/2021/08/introduction-to-yaml From 8f6a7b55f2e55c7b1f0a4dabee12962b38cd1d48 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 23 Sep 2021 15:37:43 +0800 Subject: [PATCH 0471/1588] PUB @wxy https://linux.cn/article-13813-1.html --- ...hat is sudo rm -rf- Why is it Dangerous.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md (82%) diff --git a/translated/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md b/published/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md similarity index 82% rename from translated/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md rename to published/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md index 9c5d756a43..be034f13b5 100644 --- a/translated/tech/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md +++ b/published/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md @@ -4,21 +4,23 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13813-1.html" Linux 黑话解释:什么是 sudo rm -rf?为什么如此危险? ====== -当你刚接触 Linux 时,你会经常遇到这样的建议:永远不要运行 `sudo rm -rf /`。在 Linux 世界里,围绕着 `sudo rm -rf` 有很多梗。 +![][11] + +当你刚接触 Linux 时,你会经常遇到这样的建议:永远不要运行 `sudo rm -rf /`。在 Linux 世界里,更是围绕着 `sudo rm -rf` 有很多梗。 ![][1] -但似乎关于它有一些混乱的现象。在 [清理 Ubuntu 以腾出空间][2] 的教程中,我建议运行一些涉及 `sudo` 和 `rm -rf` 的命令。一位读者问我,如果 `sudo rm -rf` 是一个不应该运行的危险的 Linux 命令,我为什么要建议这样做。 +但似乎对于它也有一些混乱的认识。在 [清理 Ubuntu 以腾出空间][2] 的教程中,我建议运行一些涉及 `sudo` 和 `rm -rf` 的命令。一位读者问我,如果 `sudo rm -rf` 是一个不应该运行的危险的 Linux 命令,我为什么要建议这样做。 因此,我想到了写一篇 Linux 黑话解释,以消除误解。 -### sudo rm -rf:在做什么? +### sudo rm -rf 在做什么? 让我们按步骤来学习。 @@ -66,11 +68,11 @@ $ 把 `rm -rf` 命令看作一把刀。刀是一个危险的东西吗?有可能。如果你用刀切蔬菜,那是好事。如果你用刀切手指,那当然是不好的。 -`rm -rf` 命令也是如此。它本身并不危险。它毕竟是用来删除文件的。但是,如果你在不知情的情况下用它来删除重要文件,那就有问题了。 +`rm -rf` 命令也是如此。它本身并不危险。它只是用来删除文件的。但是,如果你在不知情的情况下用它来删除重要文件,那就有问题了。 现在来看看 `sudo rm -rf /`。 -你知道,使用 `sudo`,你以 root 身份运行一个命令,这允许你对系统进行任何改变。 +你知道,使用 `sudo`,你是以 root 身份运行一个命令,这允许你对系统进行任何改变。 `/` 是根目录的符号。`/var` 表示根目录下的 `var` 目录。`/var/log/apt` 指的是根目录的 `log` 目录下的 `apt` 目录。 @@ -80,7 +82,7 @@ $ 这就是为什么建议不要运行 `sudo rm -rf /` 命令,因为你会抹去你的整个 Linux 系统。 -请注意,在某些情况下,你可能正在运行像 `sudo rm -rf /var/log/apt` 这样的命令,这可能是好的。同样,你必须注意你正在删除的东西,就像你必须注意你正在用刀切割的东西一样。 +请注意,在某些情况下,你可能正在运行像 `sudo rm -rf /var/log/apt` 这样的命令,这可能是没问题的。同样,你必须注意你正在删除的东西,就像你必须注意你正在用刀切割的东西一样。 ### 我在玩火:如果我运行 sudo rm -rf /,看看会发生什么呢? @@ -93,7 +95,7 @@ rm: it is dangerous to operate recursively on '/' rm: use --no-preserve-root to override this failsafe ``` -我的意思是,人是会打错字的,如果你不小心打了 `/ var/log/apt`,而不是 `/var/log/apt`(`/` 和 `var` 之间的空格意味着你给出了 `/` 和 `var` 目录来删除),你将会删除根目录。 +我的意思是,人是会打错字的,如果你不小心打了 `/ var/log/apt`,而不是 `/var/log/apt`(`/` 和 `var` 之间的空格意味着你给出了 `/` 和 `var` 目录来删除),你将会删除根目录。(LCTT 译注:我真干过,键盘敲的飞起,结果多敲了一个空格,然后就丢了半个文件系统 —— 那时候 Linux 还没这种故障安全保护。) ![使用 sudo rm -rf 时要注意][9] @@ -105,7 +107,7 @@ rm: use --no-preserve-root to override this failsafe 所以,我在一个虚拟机中运行基本的操作系统。我运行 `sudo rm -rf / --no-preserve-root`,你可以在下面的视频中看到灯光熄灭(大约 1 分钟)。 -![video](https://player.vimeo.com/video/594025609) +![video](https://vimeo.com/594025609) ### 清楚了么? @@ -115,8 +117,6 @@ Linux 有一个活跃的社区,大多数人都会帮助新用户。 之所以 最后,请记住。不要喝酒胡搞Don’t drink and root。在运行你的 Linux 系统时要安全驾驶。 -![][11] - -------------------------------------------------------------------------------- via: https://itsfoss.com/sudo-rm-rf/ From 37313ef1744b72fc9d7fec3dd8d5d96bd37f55d4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Sep 2021 05:03:13 +0800 Subject: [PATCH 0472/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210923?= =?UTF-8?q?=205=20reasons=20to=20switch=20to=20Firefox=20right=20now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210923 5 reasons to switch to Firefox right now.md --- ... reasons to switch to Firefox right now.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20210923 5 reasons to switch to Firefox right now.md diff --git a/sources/tech/20210923 5 reasons to switch to Firefox right now.md b/sources/tech/20210923 5 reasons to switch to Firefox right now.md new file mode 100644 index 0000000000..6f301bbc0d --- /dev/null +++ b/sources/tech/20210923 5 reasons to switch to Firefox right now.md @@ -0,0 +1,111 @@ +[#]: subject: "5 reasons to switch to Firefox right now" +[#]: via: "https://opensource.com/article/21/9/switch-to-firefox" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 reasons to switch to Firefox right now +====== +Version 0.1 of Mozilla Firefox was released 19 years ago. +![red panda][1] + +Mozilla Firefox was one of the applications that opened my eyes to open source. It wasn't by any means the tipping point, but it was part of a larger cumulative effect of several open source applications grabbing my attention, which ultimately resulted in me switching to Linux, and never looking back. Since switching to Firefox, which occurred well before I consciously changed to open source, I've been an avid Firefox user. My mobile phone was a Firefox OS mobile phone, and it was until the project was abandoned. Interestingly, though, I didn't necessarily consider myself a Firefox _fan_. I used it then and continue to use it today because it continues to be the best browser available in many different ways. Here are five reasons you should [switch to Firefox][2] right now. + +### 1\. Firefox is focused on privacy + +The maintainer of Firefox is the [Mozilla foundation][3], a non-profit organization not motivated at all by your personal data. Mozilla doesn't care about what you search for, what websites you visit, or how much time you spend on the web. That's just not Mozilla's business model, but it is expressly the business model of many other popular browsers. + +Even if you don't object to a browser tracking your activities for privacy reasons, you may have had the experience of making that one-time purchase of an unusual gift, only to have every site you visit try to sell you that item for the rest of your life. The Internet is big, so it sometimes seems like a good idea to restructure it based on users' interests. I admit that if all of my searches could have "open source" appended to them, it would probably provide more relevant results. But then again, I'd rather opt in to that kind of optimization rather than have it, along with many other unknowns, being decided for me, outside my control. + +![Privacy in Firefox][4] + +Privacy in Firefox (Seth Kenlon, CC BY-SA 4.0)  + +Mozilla has this policy: [Take less. Keep it safe. No secrets.][5] + +Never one to stop short, Firefox also offers account [monitoring][6], an optional service from Mozilla that alerts you if any of your online accounts become compromised through a large-scale data breach. Additionally, Mozilla offers a paid VPN service using open source Wireguard software so you can browse safely from anywhere. + +### 2\. Firefox can use containers + +It may be hard to believe, but there was a time when leading web browsers did not feature tabs. In the late 90s and early 00s, when you wanted to visit two web pages simultaneously, you had to open two separate browser windows. Firefox (and the Mozilla browser before it) was an early adopter of the tabbed interface. + +Tabs are expected in browsers now, but through Firefox's extensions, there's been an interesting new twist on the power of the tabbed interface. Developed by Mozilla itself, the [Firefox Multi-Account Containers plugin][7] can turn each tab into an isolated "container" within your browser. + +![Containerized tabs in Firefox][8] + +Containerized tabs in Firefox (Seth Kenlon, CC BY-SA 4.0)  + +For instance, say your employer uses Google Apps, but you don't trust Google with your personal information. You can use the Multi-Account Containers plugin to isolate your work activities so that Google touches only your professional life and has no access to any other part of your life. + +You can even open the same site with two different accounts, and as a bonus, the tabs are color-coded, so it's useful whether you're looking to isolate sites or just add new visual cues to your browser. + +### 3\. Firefox user interface design + +As much as we humans tend to get excited about new things, there's just as much comfort to be found in something familiar and reliable. Firefox has updated its interface over the years, and it's had its fair share of innovations that are now unofficial industry standards, but overall it has remained very much the same. Its user interface retains all the standard conventions you already take for granted. + +When you download a file, you're prompted for how you want Firefox to handle the file. At your option, you can open the file in an appropriate application or save it to your hard drive. You can prompt Firefox to remember your choices for the future or have it continue to prompt you. + +![Firefox user interface][9] + +Firefox user interface (Seth Kenlon, CC BY-SA 4.0) + +When you need an application menu, you can find it in a modern-style "hamburger" menu, or else you can press the **Alt** key to show a traditional menu along the top of the Firefox window. + +Everything in Firefox is familiar, whether you're a long-time user of Firefox or not because it builds on years of user interface design. Where it can innovate, it does, but where it's counter-productive to change something intuitive, it refrains. + +### 4\. Developer tools in Firefox + +Back in the early days of the world wide web, you could navigate to any website and view the source code. There was a high chance of learning HTML just from doing this a few times. Everything was open, transparent, obvious, and relatively straightforward. + +The Internet has evolved into a powerful [cloud-based supercomputer][10], and extracting meaningful context from a website now sometimes requires more than just a text dump of its underlying markup. To ensure everyone can reverse engineer (and engineer) how a website functions, Firefox incorporates a set of powerful development tools into the browser. + +![Developer tools][11] + +Developer tools (Seth Kenlon, CC BY-SA 4.0)  + +Although this was a Firefox-based innovation originally (by [Firebug][12] back in 2006), many browsers have a devtools feature now. Not all devtools are equal, though, and it's Firefox's developer panels that make Firefox my go-to browser for web design and UX testing. + +### 5\. Firefox is open source + +Most importantly, Firefox is fully open source. It's an excellent browser with nothing to hide. It's got no ulterior motive aside from keeping the web open, educating people about the Internet, and promoting open source solutions to everyday tasks. + +![Firefox is open source][13] + +Firefox is open source (Seth Kenlon, CC BY-SA 4.0)  + +You can contribute to Firefox. You can file bugs about things that you don't like. You can see the code you run when you interface with the Internet. Firefox has taken a stand for the open web for decades. It's stayed true to its principles and arguably has forced the hand of several competitors who probably wouldn't have chosen to go open source if Firefox hadn't set the public's expectations. + +Firefox is a powerful force on the modern Internet, and it's a great browser. Firefox runs on your desktop and mobile devices, so do yourself a favor and [get Firefox][14]. + +Learn how to contribute to one of the largest and most popular open source projects on the web:... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/switch-to-firefox + +作者:[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/redpanda_firefox_pet_animal.jpg?itok=aSpKsyna (red panda) +[2]: http://getfirefox.org +[3]: https://foundation.mozilla.org/en/ +[4]: https://opensource.com/sites/default/files/firefox-privacy.jpg +[5]: https://blog.mozilla.org/en/products/firefox/firefox-data-privacy-promise/ +[6]: https://monitor.firefox.com +[7]: https://github.com/mozilla/multi-account-containers#readme +[8]: https://opensource.com/sites/default/files/firefox-container.jpg +[9]: https://opensource.com/sites/default/files/screenshot_from_2021-09-16_12-13-14.png +[10]: https://www.redhat.com/en/products/open-hybrid-cloud +[11]: https://opensource.com/sites/default/files/firefox-dev.jpg +[12]: https://getfirebug.com/ +[13]: https://opensource.com/sites/default/files/firefox-open.jpg +[14]: http://getfirefox.com From 79ed3013df1a479e150ffd94496c2ead3a002a87 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Sep 2021 05:03:30 +0800 Subject: [PATCH 0473/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210923?= =?UTF-8?q?=20Build=20your=20website=20with=20Jekyll?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210923 Build your website with Jekyll.md --- ...20210923 Build your website with Jekyll.md | 189 ++++++++++++++++++ 1 file changed, 189 insertions(+) create mode 100644 sources/tech/20210923 Build your website with Jekyll.md diff --git a/sources/tech/20210923 Build your website with Jekyll.md b/sources/tech/20210923 Build your website with Jekyll.md new file mode 100644 index 0000000000..d177ed0d2c --- /dev/null +++ b/sources/tech/20210923 Build your website with Jekyll.md @@ -0,0 +1,189 @@ +[#]: subject: "Build your website with Jekyll" +[#]: via: "https://opensource.com/article/21/9/build-website-jekyll" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Build your website with Jekyll +====== +Jekyll is an open source static site generator. You can write your +content in Markdown, use HTML/CSS for structure and presentation, and +Jekyll compiles it all into static HTML. +![Person using a laptop][1] + +Static website generators and JAMStack have taken off in recent years. And with good reason. There is no need for complex backends with only static HTML, CSS, and Javascript to serve. Not having backends means better security, lower operational overhead, and cheaper hosting. A win-win-win! + +In this article, I'm going to talk about Jekyll. As of this writing, [my personal website uses Jekyll][2]. Jekyll uses a Ruby engine to convert articles written in Markdown to generate HTML. [Sass][3] allows merging complex CSS rules into flat files. [Liquid][4] allows some programmatic control over otherwise static content. + +### Install Jekyll + +The [Jekyll website][5] has installation instructions for Linux, MacOS, and Windows. After installation, the [Quickstart guide][6] will set up a basic Hello-World project. + +Now visit `http://localhost:4000` in your browser. You should see your default "awesome" blog. + +![Default "awesome" blog][7] + +Screenshot by Ayush Sharma, [CC BY-SA 4.0][8] + +### Directory structure + +The default site contains the following files and folders: + + * `_posts`: Your blog entries. + * `_site`: The final compiled static website. + * `about.markdown`: Content for the about page. + * `index.markdown`: Content for the home page. + * `404.html`: Content for the 404 page. + * `_config.yml`: Site-wide configuration for Jekyll. + + + +### Creating new blog entries + +Creating posts is simple. All you need to do is create a new file under `_posts` with the proper format and extension, and you’re all set. + +A valid file name is `2021-08-29-welcome-to-jekyll.markdown`. A post file must contain what Jekyll calls the YAML Front Matter. It’s a special section at the beginning of the file with the metadata. If you see the default post, you’ll see the following: + + +``` +\--- +layout: post +title: "Welcome to Jekyll!" +date:  2021-08-29 11:28:12 +0530 +categories: jekyll update +\--- +``` + +Jekyll uses the above metadata, and you can also define custom `key: value` pairs. If you need some inspiration, [have a look at my website's front matter][9]. Aside from the front matter, you can [use in-built Jekyll variables][10] to customize your website. + +Let’s create a new post. Create `2021-08-29-ayushsharma.markdown` in the `_posts` folder. Add the following content: + + +``` +\--- +layout: post +title:  "Check out ayushsharma.in!" +date:   2021-08-29 12:00:00 +0530 +categories: mycategory +\--- +This is my first post. + +# This is a heading. + +## This is another heading. + +This is a [link]() + +This is my category: +``` + +If the `jekyll serve` command is still running, refresh the page, and you'll see the new entry below. + +![New blog entry][11] + +Screenshot by Ayush Sharma, [CC BY-SA 4.0][8] + +Congrats on creating your first article! The process may seem simple, but there's a lot you can do with Jekyll. Using simple markdown, you can generate an archive of posts, syntax highlighting for code snippets, and separate pages for posts in one category. + +### Drafts + +If you're not ready to publish your content yet, you can create a new `_drafts` folder. Markdown files in this folder are only rendered by passing the `--drafts` argument. + +### Layouts and Includes + +Note the front matter of the two articles in our `_posts` folder, and you'll see `layout: post` in the Front Matter. The `_layout` folder contains all the layouts. You won't find them in your source code because Jekyll loads them by default. The default source code used by Jekyll is [here][12]. If you follow the link, you'll see that the `post` layout uses the [`default` layout][13]. The default layout contains the code `{{ content }}` which is where content is injected. The layout files will also contain `include` directives. These load files from the [`includes` folder][14] and allow composing a page using different components. + +Overall, this is how layouts work—you define them in the front matter and inject your content within them. Includes provide other sections of the page to compose a whole page. This is a standard web-design technique—defining header, footer, aside, and content elements and then injecting content within them. This is the real power of static site generators—full programmatic control over assembling your website with final compilation into static HTML. + +### Pages + +Not all content on your website will be an article or a blog post. You'll need about pages, contact pages, project pages, or portfolio pages. This is where Pages come in. They work exactly like Posts do, meaning they're markdown files with front matter. But they don't go in the `_posts` directory. They either stay in your project root or in folders of their own. For Layouts and Includes, you can use the same ones as you do for your Posts or create new ones. Jekyll is very flexible and you can be as creative as you want! Your default blog already has `index.markdown` and `about.markdown`. Feel free to customize them as you wish. + +### Data files + +Data files live in the `_data` directory, and can be `.yml`, `.json`, or `.csv`. For example, a `_data/members.yml` file may contain: + + +``` +\- name: A + github: a@a + +\- name: B + github: b@b + +\- name: C + github: c@c +``` + +Jekyll reads these during site generation. You can access them using `site.data.members`. + + +``` +<ul> +{ % for member in site.data.members %} + <li> + <a href="[https://github.com/"\>][15] +      { { member.name }} + </a> + </li> +{ % endfor %} +</ul> +``` + +### Permalinks + +Your `_config.yml` file defines the format of your permalinks. You can [use a variety of default variables][16] to assemble your own custom permalink. + +### Building your final website + +The command `jekyll serve `is great for local testing. But once you're done with local testing, you'll want to build the final artifact to publish. The command `jekyll build --source source_dir --destination destination_dir` builds your website into the `_site` folder. Note that this folder is cleaned up before every build, so don't place important things in there. Once you have the content, you can host it on a static hosting service of your choosing. + +You should now have a decent overall grasp of what Jekyll is capable of and what the main bits and pieces do. If you’re looking for inspiration, the official [JAMStack website has some amazing examples][17]. + +![Example Jekyll sites from JAMStack][18] + +Screenshot by Ayush Sharma, [CC BY-SA 4.0][8] + +Happy coding :) + +* * * + +_This article was originally published on the [author's personal blog][19] and has been adapted with permission._ + +See how Jekyll, an open source generator of static HTML files, makes running a blog as easy as... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/build-website-jekyll + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://gitlab.com/ayush-sharma/ayushsharma-in +[3]: https://sass-lang.com/ +[4]: https://shopify.github.io/liquid/ +[5]: https://jekyllrb.com/docs/installation/ +[6]: https://jekyllrb.com/docs/ +[7]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-welcome-to-jekyll.png (Default "awesome" blog) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://gitlab.com/ayush-sharma/ayushsharma-in/-/blob/2.0/_posts/2021-07-15-the-evolution-of-ayushsharma-in.md +[10]: https://jekyllrb.com/docs/variables/ +[11]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-new-article.png (New blog entry) +[12]: https://github.com/jekyll/minima/blob/master/_layouts/post.html +[13]: https://github.com/jekyll/minima/blob/master/_layouts/default.html#L12 +[14]: https://github.com/jekyll/minima/tree/master/_includes +[15]: https://github.com/"\> +[16]: https://jekyllrb.com/docs/permalinks/ +[17]: https://jamstack.org/examples/ +[18]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-jamstack-examples.png (Example Jekyll sites from JAMStack) +[19]: https://notes.ayushsharma.in/2021/08/introduction-to-jekyll From 7d9a48352541e0a9f2e5be8afbb1118bb323398b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Sep 2021 05:04:47 +0800 Subject: [PATCH 0474/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210923?= =?UTF-8?q?=20GNOME=2041=20Released:=20The=20Most=20Popular=20Linux=20Desk?= =?UTF-8?q?top=20Environment=20Gets=20Better?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md --- ...r Linux Desktop Environment Gets Better.md | 172 ++++++++++++++++++ 1 file changed, 172 insertions(+) create mode 100644 sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md diff --git a/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md new file mode 100644 index 0000000000..1591689ba7 --- /dev/null +++ b/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md @@ -0,0 +1,172 @@ +[#]: subject: "GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better" +[#]: via: "https://news.itsfoss.com/gnome-41-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better +====== + +GNOME 41 stable release is ultimately here. + +While GNOME 40 was a radical change forcing many users to adapt to a new workflow, GNOME 41 seems to settle the dust. + +With GNOME 41, there are no significant workflow changes but new **feature additions** and **improvements** across the board. + +GNOME 41 beta has been out there for a while. And, we tried the stable release right before the release date using [GNOME OS][1] to highlight what you can expect with it. + +### GNOME 41 Features: What’s New? + +![][2] + +GNOME 41 does not give you any new visual treats but useful improvements to help you improve the workflow or take control of it. + +There are some GNOME app upgrades that come along with it. + +Let me mention the key highlights of GNOME 41. + +#### GNOME 41 Software Context Tiles + +![][3] + +Every release, users look forward to the improvements made to the GNOME Software Center. + +While they have been improving it in the right direction, it needed a visual overhaul. And, this time, GNOME 41 comes with a much-needed UI refresh. + +The software store is more descriptive and should look appealing to new users. Using emojis/creative icons to categorize applications makes the software center pop. + +Like the [Apps for GNOME][4] portal, the application screens on the Software center include more details to inform the user as much as possible without needing to refer to the project page or the web. + +![][5] + +In other words, these are the context tiles added to an app page that provides information about device support, safety/permissions, age rating, download size, the project, and more. + +You also get to choose the available add-ons for a particular app like GIMP to install in one go. So, you save time from finding add-ons and installing them individually. + +GNOME 41 Software should prove to be much more helpful than it ever was. + +#### New Multitasking Options + +![][6] + +To help you improve the workflow, GNOME 41 comes baked in with new multitasking tweaks. + +You get the toggle the hot corner to quickly open the Activities Overview. The ability to resize windows upon dragging them to the edges has also been added. + +If you want, you can set a fixed number of workspaces available or keep it dynamic to adapt as you require. + +In addition to these, you also get features to tweak: + + * Multi-monitor workspaces + * Application switching behaviour + + + +When you have multiple displays, you can choose to keep the workspaces restricted to a single screen or continue over connected displays. + +And, when you head to switch applications and navigate through them, you can customize to preview the applications only in the same workspace or from all workspaces. + +#### Power Saving Settings + +![][7] + +A helpful performance tweak to save power is now available in GNOME 41. This is incredibly useful for laptop users to tune their performance manually or if an app requests switching the mode to save power. + +![][8] + +#### GNOME Calendar Improvements + +GNOME Calendar now can open ICS files along with the ability to import the events. + +#### Touchpad Gestures + +The workflow experience should be seamless when you utilize three-finger vertical swipe up/down actions to get the activity overview, and three-finger horizontal swipe right/left actions to navigate between workspaces. + +It is good to see the focus on improving the workflow using the touchpad, similar to [elementary OS 6 features][9]. + +#### GNOME Connections App + +![][10] + +A new “Connections” app has been added to connect to remote computers no matter the platform. + +I still see the application as an alpha build, but maybe with the following few updates, you should get the finished version of the application. + +I haven’t tried if it works, but it might be worth another brief article to show you how to use it. + +#### SIP/VoIP Support + +With [GNOME 41 beta release][11], we spotted the inclusion of SIP/VoIP support. + +If you are a business user or prefer international calls, you can now make VoIP calls directly from the dialpad in GNOME 41. + +Unfortunately, I couldn’t find the “Calls” app included when using GNOME OS with GNOME 41 stable release. So, I couldn’t grab a screenshot of how it looks. + +#### GNOME Web / Epiphany Improvements + +![][12] + +GNOME Web or Epiphany browser has been receiving a lot of good improvements lately. + +With GNOME 41, the epiphany browser now utilizes AdGuard’s script to block YouTube advertisements. Not to forget, the support for epiphany canary builds has been added as well. + +#### Other Improvements + +Under the hood, several subtle but essential changes result in a better and faster user experience. + +For instance, you may notice the icons more prominent in the header areas of application/windows. This is to improve clarity and enhance the look. + +Similarly, there are numerous improvements to GNOME apps and functionalities that you might bump into when you use them: + + * GNOME Map now shows the mean sea levels in a user-friendly way + * Improvements to Nautilus file manager to support password-protected zip files and the ability to toggle to let you enable/disable automatic trash cleaning + * Music app getting a UI refresh + * GNOME Text Editor gaining more features + * GTK updated to 4.4.0 + * Addition of libawaita to potentially improve the user experience with GNOME apps + + + +You can refer to the [official changelog and the announcement blog post][13] to explore all the technical changes. + +### Wrapping Up + +GNOME 41 may not be an experience-breaking upgrade, but it is a significant update with many valuable additions. + +You can expect it with Fedora 35, which should release next month. Unfortunately, Ubuntu 21.10 will not include it, but you can wait it out for other Linux distributions. + +#### 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-41-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/gnome-os/ +[2]: https://i2.wp.com/i.ytimg.com/vi/holOYrZquBQ/hqdefault.jpg?w=780&ssl=1 +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://news.itsfoss.com/apps-for-gnome-portal/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMSIgd2lkdGg9IjQ0MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[9]: https://news.itsfoss.com/elementary-os-6-features/ +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[11]: https://news.itsfoss.com/gnome-41-beta/ +[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[13]: https://help.gnome.org/misc/release-notes/41.0/ From 94cdf8224a39f3d71004928b45589ee39f2f3c4e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 24 Sep 2021 05:04:57 +0800 Subject: [PATCH 0475/1588] add done: 20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md --- sources/tech/20210924 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210924 .md diff --git a/sources/tech/20210924 .md b/sources/tech/20210924 .md new file mode 100644 index 0000000000..5d05cf5ca3 --- /dev/null +++ b/sources/tech/20210924 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/change-login-background-fedora/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 88a7a580303fa5b09466b15ee6ac346fb88907ab Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 24 Sep 2021 08:51:46 +0800 Subject: [PATCH 0476/1588] translated --- ...ol to learn more about your NVMe drives.md | 183 ------------------ ...ol to learn more about your NVMe drives.md | 182 +++++++++++++++++ 2 files changed, 182 insertions(+), 183 deletions(-) delete mode 100644 sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md create mode 100644 translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md diff --git a/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md b/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md deleted file mode 100644 index 6451970d2d..0000000000 --- a/sources/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: subject: "Use this Linux command-line tool to learn more about your NVMe drives" -[#]: via: "https://opensource.com/article/21/9/nvme-cli" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Use this Linux command-line tool to learn more about your NVMe drives -====== -The nvme-cli command has lots of useful options, and it's a great way to -take control of how you manage your data. -![Command line prompt][1] - -NVMe stands for _Non-Volatile Memory Express_, and it refers to how software and storage communicate across PCIe and other protocols, including TCP. It's an [open specification][2] led by a non-profit organization and defines several forms of solid-state storage. - -My laptop has an NVMe drive, as does my desktop. And they're fast. I love how quickly my computers boot and how quickly they're able to read and write data. There's no perceptible delay. - -It also didn't take long for me to get curious about the technology driving this ultra-fast storage, so I did a little investigation. I learned that NVMe drives consume less power while delivering much faster access to data compared to even SSD drives over SATA. That was interesting, but I wanted to know more about my particular NVMe drives, and I wanted to know how they compared with other drives. Could I securely erase the drive? How could I check its integrity? - -Those questions led me to an Internet search that yielded an open source project with a collection of tools to manage NVMe drives. It's called [nvme-cli][3]. - -### Install nvme-cli - -You can install `nvme-cli` from your distribution's package manager. For instance, on Fedora, CentOS, or similar: - - -``` -`$ sudo dnf install nvme-cli` -``` - -On Debian, Mint, Elementary, and similar: - - -``` -`$ sudo apt install nvme-cli` -``` - -### Exploring an NVMe drive - -After installing `nvme-cli` for my distribution, I wanted to explore my drive. There's no man page for `nvme-cli`, but you can get lots of help by entering `nvme help`: - - -``` -$ nvme help -nvme-1.14 -usage: nvme <command> [<device>] [<args>] - -The '<device>' may be either an NVMe character device (ex: /dev/nvme0) or an -nvme block device (ex: /dev/nvme0n1). - -The following are all implemented sub-commands: - list List all NVMe devices and namespaces on machine - list-subsys List nvme subsystems - id-ctrl Send NVMe Identify Controller - id-ns Send NVMe Identify Namespace, display structure - id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure - list-ns Send NVMe Identify List, display structure - list-ctrl Send NVMe Identify Controller List, display structure - nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure - primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities -[...] -``` - -### List all NVMe drives - -The `sudo nvme list` command lists all NVMe devices and namespaces on your machine. I used it and found an NVMe drive at `/dev/nvme0n1`. Here is the output: - - -``` -$ sudo nvme list - -Node SN Model Namespace Usage Format FW Rev - -\--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- - -/dev/nvme0n1    S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1 - -214.68 GB / 256.06 GB 512  B + 0 B 0L2QEXD7 -``` - -I have a drive called `nvme0n1`. It lists the serial number, brand, size, firmware revision, and so on. - -You can get even more information about the drive and the features it supports by using the `id-ctrl` subcommand: - - -``` -$ sudo nvme id-ctrl /dev/nvme0n1 -NVME Identify Controller: -vid : 0x144d -ssvid : 0x144d -sn : S42GMY9M141281 -mn : SAMSUNG MZVLB256HAHQ-000L7 -fr : 0L2QEXD7 -rab : 2 -ieee : 002538 -cmic : 0 -mdts : 9 -cntlid : 0x4 -ver : 0x10200 -rtd3r : 0x186a0 -rtd3e : 0x7a1200 -[...] -``` - -### Drive health - -You can read about the overall health of a drive with the `smart-log` subcommand: - - -``` -$ sudo nvme smart-log /dev/nvme0n1 -Smart Log for NVME device:nvme0n1 namespace-id:ffffffff -critical_warning : 0 -temperature : 21 C -available_spare : 100% -available_spare_threshold : 10% -percentage_used : 2% -endurance group critical warning summary: 0 -data_units_read : 5,749,452 -data_units_written : 10,602,948 -host_read_commands : 77,809,121 -host_write_commands : 153,405,213 -controller_busy_time : 756 -power_cycles : 1,719 -power_on_hours : 1,311 -unsafe_shutdowns : 129 -media_errors : 0 -num_err_log_entries : 1,243 -Warning Temperature Time : 0 -Critical Composite Temperature Time : 0 -Temperature Sensor 1 : 21 C -Temperature Sensor 2 : 22 C -Thermal Management T1 Trans Count : 0 -Thermal Management T2 Trans Count : 0 -Thermal Management T1 Total Time : 0 -Thermal Management T2 Total Time : 0 -``` - -This provides you with the drive's current temperature, the hours of use it's had so far, how many times it was unsafely shut down, and so on. - -### Formatting an NVMe drive - -You can format an NVMe drive with `nvme-cli`, but beware: This erases all of the data on the drive! If there's important data on your drive, you _must_ back it up before doing this, or else you **will** lose data. The subcommand is `format`: - - -``` -`$ sudo nvme format /dev/nvme0nX` -``` - -(For safety, I've replaced the actual location of the drive with **X** to prevent copy-paste mishaps. Change the **X** to **1** or the appropriate location as listed in the results of `nvme list`.) - -### Securely erasing an NVMe drive - -When you get ready to sell or dispose of your NVMe computer, you probably want to erase the drive securely. The same warnings apply here as with the format process: Back up important data first because this command erases it! - - -``` -`$ sudo nvme sanitize /dev/nvme0nX` -``` - -### Try nvme-cli - -The `nvme-cli` command is released under a [GPLv2][4] license. It's a robust command with lots of useful options, and it's a great way to take control of how you manage your data. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/nvme-cli - -作者:[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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) -[2]: https://nvmexpress.org/ -[3]: https://github.com/linux-nvme/nvme-cli -[4]: https://github.com/linux-nvme/nvme-cli/blob/master/LICENSE diff --git a/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md b/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md new file mode 100644 index 0000000000..af8ff59418 --- /dev/null +++ b/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md @@ -0,0 +1,182 @@ +[#]: subject: "Use this Linux command-line tool to learn more about your NVMe drives" +[#]: via: "https://opensource.com/article/21/9/nvme-cli" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用这个 Linux 命令行工具来了解你的 NVMe 驱动器的更多信息 +====== +nvme-cli 命令有很多有用的选项,且它是一个很好的方式来控制你如何管理你的数据。 +![Command line prompt][1] + +NVMe 是指 _Non-Volatile Memory_(非易失性内存主机控制器接口规范),它指的是软件和存储如何通过 PCIe 和其他协议(包括 TCP)进行通信。它是一个由非营利组织领导的[开放规范][2],并定义了几种形式的固态存储。 + +我的笔记本电脑有一个 NVMe 驱动器,我的台式机也有。而且它们的速度很快。我喜欢我的电脑启动的速度,以及它们读写数据的速度。没有可察觉的延迟。 + +没过多久,我就对驱动这种超高速存储的技术产生了好奇,所以我做了一些调查。我了解到,NVMe 驱动器消耗的电力更少,而提供的数据访问速度甚至比 SATA 的 SSD 驱动器快得多。这很有趣,但我想知道更多关于我的特定 NVMe 驱动器的信息,我想知道它们与其他驱动器相比如何。我可以安全地擦除驱动器吗?我怎样才能检查它的完整性? + +这些问题让我在互联网上搜索,发现了一个开源项目,其中有一系列管理 NVMe 驱动器的工具。它被称为 [nvme-cli][3]。 + +### 安装 nvme-cli + +你可以从你的发行版的包管理器中安装 `nvme-cli`。例如,在 Fedora、CentOS 或类似系统上: + + +``` +`$ sudo dnf install nvme-cli` +``` + +在 Debian、Mint、Elementary 和类似系统上: + + +``` +`$ sudo apt install nvme-cli` +``` + +### 探索 NVMe 驱动器 + +在为我的发行版安装 `nvme-cli` 后,我想探索我的驱动器。`nvme-cli` 没有手册页,但你可以通过输入 `nvme help` 获得很多帮助: + + +``` +$ nvme help +nvme-1.14 +usage: nvme <command> [<device>] [<args>] + +The '<device>' may be either an NVMe character device (ex: /dev/nvme0) or an +nvme block device (ex: /dev/nvme0n1). + +The following are all implemented sub-commands: +list List all NVMe devices and namespaces on machine +list-subsys List nvme subsystems +id-ctrl Send NVMe Identify Controller +id-ns Send NVMe Identify Namespace, display structure +id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure +list-ns Send NVMe Identify List, display structure +list-ctrl Send NVMe Identify Controller List, display structure +nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure +primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities +[...] +``` + +### 列出所有的 NVMe 驱动器 + +`sudo nvme list` 命令列出你机器上所有的 NVMe 设备和命名空间。我用它在 `/dev/nvme0n1` 找到了一个 NVMe 驱动器。下面是输出结果: + + +``` +$ sudo nvme list + +Node SN Model Namespace Usage Format FW Rev + +\--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- + +/dev/nvme0n1 S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1 + +214.68 GB / 256.06 GB 512 B + 0 B 0L2QEXD7 +``` + +我有一个名为 `nvme0n1` 的驱动器。它列出了序列号、品牌、尺寸、固件版本等等。 + +通过使用 `id-ctrl` 子命令,你可以得到更多关于该硬盘和它所支持的特性的信息: + + +``` +$ sudo nvme id-ctrl /dev/nvme0n1 +NVME Identify Controller: +vid : 0x144d +ssvid : 0x144d +sn : S42GMY9M141281 +mn : SAMSUNG MZVLB256HAHQ-000L7 +fr : 0L2QEXD7 +rab : 2 +ieee : 002538 +cmic : 0 +mdts : 9 +cntlid : 0x4 +ver : 0x10200 +rtd3r : 0x186a0 +rtd3e : 0x7a1200 +[...] +``` + +### 驱动器健康 + +你可以通过 `smart-log` 子命令来了解硬盘的整体健康状况: + + +``` +$ sudo nvme smart-log /dev/nvme0n1 +Smart Log for NVME device:nvme0n1 namespace-id:ffffffff +critical_warning : 0 +temperature : 21 C +available_spare : 100% +available_spare_threshold : 10% +percentage_used : 2% +endurance group critical warning summary: 0 +data_units_read : 5,749,452 +data_units_written : 10,602,948 +host_read_commands : 77,809,121 +host_write_commands : 153,405,213 +controller_busy_time : 756 +power_cycles : 1,719 +power_on_hours : 1,311 +unsafe_shutdowns : 129 +media_errors : 0 +num_err_log_entries : 1,243 +Warning Temperature Time : 0 +Critical Composite Temperature Time : 0 +Temperature Sensor 1 : 21 C +Temperature Sensor 2 : 22 C +Thermal Management T1 Trans Count : 0 +Thermal Management T2 Trans Count : 0 +Thermal Management T1 Total Time : 0 +Thermal Management T2 Total Time : 0 +``` + +这为你提供了硬盘的当前温度、到目前为止的使用时间、不安全的关机次数等等。 + +### 格式化一个 NVMe 驱动器 + +你可以用 `nvme-cli` 格式化一个 NVMe 驱动器,但要注意。这将删除驱动器上的所有数据!如果你的硬盘上有重要的数据,你必须在这样做之前将其备份,否则你**将会**丢失数据。子命令是 `format`: + + +``` +`$ sudo nvme format /dev/nvme0nX` +``` + +(为了安全起见,我用 **X** 替换了驱动器的实际位置,以防止复制粘贴的错误。将 **X** 改为 **1** 或 `nvme list` 结果中列出的适当位置)。 + +### 安全地擦除 NVMe 驱动器 + +当你准备出售或处理你的 NVMe 电脑时,你可能想安全地擦除驱动器。这里的警告与格式化过程中的警告相同。首先要备份重要的数据,因为这个命令会删除这些数据! + + +``` +`$ sudo nvme sanitize /dev/nvme0nX` +``` + +### 尝试 nvme-cli + +`nvme-cli` 命令是在 [GPLv2][4] 许可下发布的。它是一个强大的命令,有很多有用的选项,它是控制你如何管理数据的好方法。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/nvme-cli + +作者:[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/command_line_prompt.png?itok=wbGiJ_yg (Command line prompt) +[2]: https://nvmexpress.org/ +[3]: https://github.com/linux-nvme/nvme-cli +[4]: https://github.com/linux-nvme/nvme-cli/blob/master/LICENSE From 457d38c9b5899fdae9973672fd176cc76cbc82df Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 24 Sep 2021 08:56:20 +0800 Subject: [PATCH 0477/1588] translating --- ...grant to test your scripts on different operating systems.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md b/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md index e82363241c..3d9c649d48 100644 --- a/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md +++ b/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/test-vagrant" [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 7a4bb9b0c1904edb0ef21fe6b2a461639fa572b6 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 24 Sep 2021 09:02:18 +0800 Subject: [PATCH 0478/1588] Delete 20210924 .md --- sources/tech/20210924 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210924 .md diff --git a/sources/tech/20210924 .md b/sources/tech/20210924 .md deleted file mode 100644 index 5d05cf5ca3..0000000000 --- a/sources/tech/20210924 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/change-login-background-fedora/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 732c40463a4cc363a8885e242626793b22765eab Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 24 Sep 2021 09:04:46 +0800 Subject: [PATCH 0479/1588] Rename sources/tech/20210923 5 reasons to switch to Firefox right now.md to sources/talk/20210923 5 reasons to switch to Firefox right now.md --- .../20210923 5 reasons to switch to Firefox right now.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210923 5 reasons to switch to Firefox right now.md (100%) diff --git a/sources/tech/20210923 5 reasons to switch to Firefox right now.md b/sources/talk/20210923 5 reasons to switch to Firefox right now.md similarity index 100% rename from sources/tech/20210923 5 reasons to switch to Firefox right now.md rename to sources/talk/20210923 5 reasons to switch to Firefox right now.md From bc4153aa2367aa31057bde6cfc5ca5e380247d3a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Sep 2021 09:14:14 +0800 Subject: [PATCH 0480/1588] APL --- ...d- The Most Popular Linux Desktop Environment Gets Better.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md index 1591689ba7..5be125d516 100644 --- a/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md +++ b/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/gnome-41-release/" [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 40bd3db7ab920fe6b577b86e3f5f8e022bec762a Mon Sep 17 00:00:00 2001 From: SamMa Date: Fri, 24 Sep 2021 09:52:34 +0800 Subject: [PATCH 0481/1588] 20210918 how to install ubuntu desktop on raspberry pi 4 (#23344) * Update 20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md * Update 20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md * Update 20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md * Update 20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md --- ...nstall Ubuntu Desktop on Raspberry Pi 4.md | 72 +++++++++---------- 1 file changed, 36 insertions(+), 36 deletions(-) diff --git a/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md b/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md index 41b4539ace..1f3f4e4197 100644 --- a/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md +++ b/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md @@ -3,16 +3,16 @@ [#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " 如何在树莓派 4 上安装 Ubuntu 桌面系统 ====== -> 这个详尽的教程告诉你如何在树莓派 4 设备上安装 Ubuntu 桌面。 +> 本教程将详细告诉你在树莓派 4 设备上如何安装 Ubuntu 桌面。 -革命性的树莓派Raspberry Pi是最受欢迎的单板计算机。它有自己的基于 Debian 的操作系统,叫做 [树莓派操作系统][1]Raspberry Pi OS(原名 Raspbian)。 +革命性的树莓派Raspberry Pi是最受欢迎的单板计算机。它拥有基于 Debian 的操作系统,叫做 [树莓派操作系统][1]Raspberry Pi OS(原名 Raspbian)。 还有其他几个 [可用于树莓派的操作系统][2],但几乎所有的都是轻量级的,适合于树莓派设备的小尺寸和低端硬件。 @@ -22,21 +22,21 @@ 在本教程中,我将展示在树莓派 4 上安装 Ubuntu 桌面的步骤。 -首先,快速了解一下先决条件。 +首先,快速了解一下运行要求。 -### 在树莓派 4 上运行 Ubuntu 的先决条件 +### 在树莓派 4 上运行 Ubuntu 的要求 ![][4] 以下是你需要的东西: - 1. 一个能用的互联网连接的 Linux 或 Windows 系统。 + 1. 一个能够联网的 Linux 或 Windows 系统。 2. [树莓派镜像工具][5] :树莓派的官方开源工具,可以在你的 SD 卡上写入发行版镜像。 - 3. 微型 SD 卡:可以使用至少 16GB 的存储卡,尽管建议使用 32GB 的版本。 + 3. Micro SD 卡:最低使用 16GB 的存储卡,推荐使用 32GB 的版本。 4. 一个基于 USB 的 Micro SD 卡读卡器(如果你的电脑没有读卡器)。 - 5. 必要的树莓派 4 配件,如 HDMI 兼容显示器、[Micro HDMI 连接到标准 HDMI(A/M) 接口的电缆][6]、[电源(建议使用官方适配器)][7]、USB 的有线/无线键盘和鼠标/触摸板。 + 5. 树莓派 4 必备配件,如 HDMI 兼容显示器、[Micro HDMI 连接到标准 HDMI(A/M) 接口的电缆][6]、[电源(建议使用官方适配器)][7]、USB 的有线/无线键盘和鼠标/触摸板。 -事先 [详细阅读树莓派的要求][8] 是很好的做法。 +最好能够提前 [详细阅读树莓派的要求][8] 。 现在,不再拖延了,让我快速带领你完成 SD 卡的镜像准备。 @@ -46,17 +46,17 @@ ![下载并将操作系统放入 SD 卡的官方工具][9] -你可以从官方网站上下载用于 Ubuntu、Windows 和 macOS 的这个工具: +你可以从官方网站上下载这个工具的 Ubuntu、Windows 和 macOS 版本: - [下载树莓派镜像工具][10] -在 Ubuntu 和其他 Linux 发行版上,你也可以用 Snap 安装它: +在 Ubuntu 和其他 Linux 发行版上,你也可以使用 Snap 安装它: ``` sudo snap install rpi-imager ``` -安装完毕后,运行该工具。当你看到下面的屏幕时,选择 “选择操作系统CHOOSE OS”: +安装完毕后,运行该工具。当你看到下面的界面时,选择 “选择操作系统CHOOSE OS”: ![镜像工具:选择首选操作系统][11] @@ -74,13 +74,13 @@ sudo snap install rpi-imager > **注意:** > -> 如果你没有一个好的、稳定的网络连接,你可以 [从 Ubuntu 的网站上单独下载 Ubuntu 的树莓派镜像][15]。在镜像工具中,在选择操作系统时,到底部选择“使用自定义Use custom”选项。你也可以使用 Etcher 将镜像写入到 SD 卡上。 +> 如果你没有一个稳定的网络连接,你可以 [从 Ubuntu 的网站上单独下载 Ubuntu 的树莓派镜像][15]。在镜像工具中,在选择操作系统时,从底部选择“使用自定义Use custom”选项。你也可以使用 Etcher 将镜像写入到 SD 卡上。 -将微型 SD 卡插入读卡器中,等待它挂载。选择“存储设备Storage”下的 “选择存储设备CHOOSE STORAGE”: +将 Micro SD 卡插入读卡器中,等待它挂载。选择“存储设备Storage”下的 “选择存储设备CHOOSE STORAGE”: ![镜像工具:选择存储设备(SD 卡)][16] 。 -你应该只看到你的微型 SD 卡的存储空间,你会根据大小立即识别它。这里,我使用的是 32GB 的卡: +你应该根据存储空间大小,识别你的 Micro SD 卡。这里,我使用的是 32GB 的卡: ![镜像工具:选择 SD 卡][17] @@ -88,7 +88,7 @@ sudo snap install rpi-imager ![镜像工具:镜像写入][18] -我假设你已经备份了 SD 卡上的内容。如果是一张新卡,你可以直接进行: +如果你已经备份了 SD 卡上的内容或是一张新卡,你可以直接进行: ![镜像工具:镜像写入确认][19] @@ -96,51 +96,51 @@ sudo snap install rpi-imager ![镜像工具:镜像写入授权需要密码][21] -如果你的 SD 卡有点旧,这将需要一些时间。但是,如果它是一个新的高速的 SD 卡,就不会花很长时间: +如果你的 SD 卡有点旧,这将需要一些时间。但是,如果它是一个新的高速的 SD 卡,就无需很长时间: ![镜像工具:写入镜像][22] -我也不建议跳过验证。确保镜像写入成功: +为确保镜像写入成功,我不建议跳过验证: ![镜像工具:验证写入][23] -一旦结束,你会得到以下确认: +写入结束后,会有以下确认提示: ![镜像工具:写入成功][24] 现在,从你的系统中安全移除 SD 卡。 -###在树莓派上使用载有 Ubuntu 的微型 SD 卡 +###在树莓派上使用装有 Ubuntu 的 MicroSD 卡 -战斗的一半已经胜利了。与常规的 Ubuntu 安装不同,你并没有创建一个临场环境。Ubuntu 已经安装在 SD 卡上了,而且几乎已经可以使用了。让我们来看看这里还剩下什么。 +战斗的一半已经胜利了。与常规的 Ubuntu 安装不同,无需创建一个临时安装环境。Ubuntu 已经安装在 SD 卡上了,而且几乎可以直接使用了。让我们来看看这里还剩下什么。 #### 第 1 步:将 SD 卡插入树莓派中 对于第一次使用的用户来说,有时会有点困惑,不知道那个卡槽到底在哪里?不用担心。它位于电路板背面的左手边。下面是一个插入卡后的倒置视图。 -![树莓派 4B 板倒置,插入微型 SD 卡][25] +![树莓派 4B 板倒置,插入 Micro SD 卡][25] -按这个方向将卡慢慢插入板子下面的插槽,轻轻地插,直到它不再往前移动。你可能还会听到一点咔嚓声来确认。这意味着它刚刚完美地插进去了。 +按照这个方向将卡慢慢插入板子下面的卡槽,轻轻地插,直到它不再往前移动。你可能还会听到一点咔嚓声来确认。这意味着它已经完美地插入了。 ![树莓派 SD 插槽在板子背面的左侧][26] -当你把它插进去的时候,你可能会注意到有两个小针脚在插槽中调整了自己的位置(如上图所示),但这没关系。一旦插入,卡看起来会有一点突出。这就是它应该有的样子。 +当你把它插进去的时候,你可能会注意到在插槽中有两个小针脚调整了自己的位置(如上图所示),但这没关系。一旦插入,卡看起来会有一点突出。这就是它应该有的样子。 ![树莓派 SD 卡插入时有一小部分可见][27] #### 第 2 步:设置树莓派 -我想,我不需要在这里详细介绍。 +我无需在这里详细介绍。 -确保电源线接头、微型 HDMI 线接头、键盘和鼠标接头(有线/无线)都牢固地连接到树莓派板的相关端口。 +保证电源线接头、微型 HDMI 线接头、键盘和鼠标接头(有线/无线)都牢固地连接到树莓派板的相关端口。 -确保显示器和电源插头也已正确连接,然后再去打开电源插座。我不建议把适配器插到带电的插座上。主要一下 [电弧][28]。 +确保显示器和电源插头也已正确连接,然后再去打开电源插座。我不建议把适配器插到带电的插座上。参考 [电弧][28]。 -一旦你确保了以上两个步骤,你就可以 [打开树莓派设备的电源][29]。 +确认了以上两个步骤后,你就可以 [打开树莓派设备的电源][29]。 #### 第 3 步:在树莓派上 Ubuntu 桌面的首次运行 -一旦你打开树莓派的电源,你会被要求在第一次运行时进行一些基本配置。你只需按照屏幕上的指示操作即可。 +当你打开树莓派的电源,你需要在初次运行时进行一些基本配置。你只需按照屏幕上的指示操作即可。 选择你的语言、键盘布局、连接到 WiFi 等: @@ -150,7 +150,7 @@ sudo snap install rpi-imager ![选择 WiFi][32] -你会被要求选择时区: +你可以根据需求选择时区: ![选择时区][33] @@ -158,17 +158,17 @@ sudo snap install rpi-imager ![输入所需的用户名和密码][34] -它将配置一些东西,可能需要一些时间来完成: +之后的步骤将配置一些东西,这个过程需要一些时间: ![完成 Ubuntu 设置][35] ![完成 Ubuntu 设置][36] -这之后可能需要一些时间,你的系统会重新启动,你会发现自己处于 Ubuntu 的登录界面: +系统会重新启动之前需要一些时间,最终,你将会来到 Ubuntu 的登录界面: ![Ubuntu 的登录界面][37] -你现在可以开始享受树莓派上的 Ubuntu 桌面了: +现在,你可以开始享受树莓派上的 Ubuntu 桌面了: ![树莓派上的 Ubuntu 桌面][38] @@ -176,9 +176,9 @@ sudo snap install rpi-imager 我注意到**一个暂时的异常情况**。在进行安装时,我的显示器左侧有一个红色的闪烁边界。这种闪烁(也有不同的颜色)在屏幕的随机部分也能注意到。但在重启和第一次启动后,它就消失了。 -我非常需要 Ubuntu 开始为树莓派等流行的 ARM 设备提供支持,我很高兴看到它在树莓派上运行。 +很高兴能够看到它在树莓派上运行,我非常需要 Ubuntu 开始为树莓派等流行的 ARM 设备提供支持。 -我希望你觉得这个教程对你有帮助。如果你有问题或建议,请在评论中告诉我。 +希望这个教程对你有所帮助。如果你有问题或建议,请在评论中告诉我。 -------------------------------------------------------------------------------- @@ -187,7 +187,7 @@ via: https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/ 作者:[Avimanyu Bandyopadhyay][a] 选题:[lujun9972][b] 译者:[wxy](https://github.com/wxy) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 0db61293b6e57d5802e4fe9d57e6cceaca8435eb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Sep 2021 13:07:24 +0800 Subject: [PATCH 0482/1588] TSL&PRF --- ...r Linux Desktop Environment Gets Better.md | 172 ------------------ ...r Linux Desktop Environment Gets Better.md | 164 +++++++++++++++++ 2 files changed, 164 insertions(+), 172 deletions(-) delete mode 100644 sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md create mode 100644 translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md diff --git a/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md deleted file mode 100644 index 5be125d516..0000000000 --- a/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md +++ /dev/null @@ -1,172 +0,0 @@ -[#]: subject: "GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better" -[#]: via: "https://news.itsfoss.com/gnome-41-release/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better -====== - -GNOME 41 stable release is ultimately here. - -While GNOME 40 was a radical change forcing many users to adapt to a new workflow, GNOME 41 seems to settle the dust. - -With GNOME 41, there are no significant workflow changes but new **feature additions** and **improvements** across the board. - -GNOME 41 beta has been out there for a while. And, we tried the stable release right before the release date using [GNOME OS][1] to highlight what you can expect with it. - -### GNOME 41 Features: What’s New? - -![][2] - -GNOME 41 does not give you any new visual treats but useful improvements to help you improve the workflow or take control of it. - -There are some GNOME app upgrades that come along with it. - -Let me mention the key highlights of GNOME 41. - -#### GNOME 41 Software Context Tiles - -![][3] - -Every release, users look forward to the improvements made to the GNOME Software Center. - -While they have been improving it in the right direction, it needed a visual overhaul. And, this time, GNOME 41 comes with a much-needed UI refresh. - -The software store is more descriptive and should look appealing to new users. Using emojis/creative icons to categorize applications makes the software center pop. - -Like the [Apps for GNOME][4] portal, the application screens on the Software center include more details to inform the user as much as possible without needing to refer to the project page or the web. - -![][5] - -In other words, these are the context tiles added to an app page that provides information about device support, safety/permissions, age rating, download size, the project, and more. - -You also get to choose the available add-ons for a particular app like GIMP to install in one go. So, you save time from finding add-ons and installing them individually. - -GNOME 41 Software should prove to be much more helpful than it ever was. - -#### New Multitasking Options - -![][6] - -To help you improve the workflow, GNOME 41 comes baked in with new multitasking tweaks. - -You get the toggle the hot corner to quickly open the Activities Overview. The ability to resize windows upon dragging them to the edges has also been added. - -If you want, you can set a fixed number of workspaces available or keep it dynamic to adapt as you require. - -In addition to these, you also get features to tweak: - - * Multi-monitor workspaces - * Application switching behaviour - - - -When you have multiple displays, you can choose to keep the workspaces restricted to a single screen or continue over connected displays. - -And, when you head to switch applications and navigate through them, you can customize to preview the applications only in the same workspace or from all workspaces. - -#### Power Saving Settings - -![][7] - -A helpful performance tweak to save power is now available in GNOME 41. This is incredibly useful for laptop users to tune their performance manually or if an app requests switching the mode to save power. - -![][8] - -#### GNOME Calendar Improvements - -GNOME Calendar now can open ICS files along with the ability to import the events. - -#### Touchpad Gestures - -The workflow experience should be seamless when you utilize three-finger vertical swipe up/down actions to get the activity overview, and three-finger horizontal swipe right/left actions to navigate between workspaces. - -It is good to see the focus on improving the workflow using the touchpad, similar to [elementary OS 6 features][9]. - -#### GNOME Connections App - -![][10] - -A new “Connections” app has been added to connect to remote computers no matter the platform. - -I still see the application as an alpha build, but maybe with the following few updates, you should get the finished version of the application. - -I haven’t tried if it works, but it might be worth another brief article to show you how to use it. - -#### SIP/VoIP Support - -With [GNOME 41 beta release][11], we spotted the inclusion of SIP/VoIP support. - -If you are a business user or prefer international calls, you can now make VoIP calls directly from the dialpad in GNOME 41. - -Unfortunately, I couldn’t find the “Calls” app included when using GNOME OS with GNOME 41 stable release. So, I couldn’t grab a screenshot of how it looks. - -#### GNOME Web / Epiphany Improvements - -![][12] - -GNOME Web or Epiphany browser has been receiving a lot of good improvements lately. - -With GNOME 41, the epiphany browser now utilizes AdGuard’s script to block YouTube advertisements. Not to forget, the support for epiphany canary builds has been added as well. - -#### Other Improvements - -Under the hood, several subtle but essential changes result in a better and faster user experience. - -For instance, you may notice the icons more prominent in the header areas of application/windows. This is to improve clarity and enhance the look. - -Similarly, there are numerous improvements to GNOME apps and functionalities that you might bump into when you use them: - - * GNOME Map now shows the mean sea levels in a user-friendly way - * Improvements to Nautilus file manager to support password-protected zip files and the ability to toggle to let you enable/disable automatic trash cleaning - * Music app getting a UI refresh - * GNOME Text Editor gaining more features - * GTK updated to 4.4.0 - * Addition of libawaita to potentially improve the user experience with GNOME apps - - - -You can refer to the [official changelog and the announcement blog post][13] to explore all the technical changes. - -### Wrapping Up - -GNOME 41 may not be an experience-breaking upgrade, but it is a significant update with many valuable additions. - -You can expect it with Fedora 35, which should release next month. Unfortunately, Ubuntu 21.10 will not include it, but you can wait it out for other Linux distributions. - -#### 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-41-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/gnome-os/ -[2]: https://i2.wp.com/i.ytimg.com/vi/holOYrZquBQ/hqdefault.jpg?w=780&ssl=1 -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://news.itsfoss.com/apps-for-gnome-portal/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMSIgd2lkdGg9IjQ0MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[9]: https://news.itsfoss.com/elementary-os-6-features/ -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[11]: https://news.itsfoss.com/gnome-41-beta/ -[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[13]: https://help.gnome.org/misc/release-notes/41.0/ diff --git a/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md new file mode 100644 index 0000000000..af347275af --- /dev/null +++ b/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md @@ -0,0 +1,164 @@ +[#]: subject: "GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better" +[#]: via: "https://news.itsfoss.com/gnome-41-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +GNOME 41 发布:最受欢迎的 Linux 桌面环境的精细打磨 +====== + +> GNOME 41 是一次有价值的升级,它带来了新的应用程序、功能和细微的视觉改进。 + +![](hhttps://img.linux.net.cn/data/attachment/album/202109/24/130703iznp8p53dbd1kktz.jpg) + +现在 GNOME 41 稳定版终于发布了。 + +虽然 GNOME 40 带来了不少激进的改变,让许多用户不得不去适应新的工作流程,但 GNOME 41 似乎避免了这个问题。 + +在 GNOME 41 中没有明显的工作流程变化,但有增加了新的功能,做了全面的改进。 + +GNOME 41 的测试版已经发布了一段时间了。而且,为了发现它值得关注的地方,我们在发布前就使用 [GNOME OS][1] 试用了它的稳定版。 + +### GNOME 41 有什么新功能? + +GNOME 41 并没有给你带来任何新的视觉感受,但是一些有用的改进可以帮助你改善或控制工作流程。 + +此外,还升级了一些 GNOME 应用程序。 + +让我提一下 GNOME 41 的主要亮点。 + +#### GNOME 41 软件的上下文板块 + +![][3] + +每个版本中,用户都期待着对 GNOME “软件Software”的改进。 + +虽然他们一直在朝着正确的方向改进它,但它需要一次视觉上的重新打造。而且,这一次,GNOME 41 带来了急需的 UI 更新。 + +软件商店的描述性更强了,看起来应该对新用户有吸引力。它使用表情符号/创意图标来对应用程序进行分类,使软件中心变得更时尚。 + +就像 [Apps for GNOME][4] 门户网站一样,“软件”的应用程序屏幕包括了更多的细节,以尽可能地告知用户,而不需要参考项目页面或其网站。 + +![][5] + +换句话说,这些添加到应用程序页面的上下文板块,提供了有关设备支持、安全/许可、年龄等级、下载的大小、项目等信息。 + +你还可以为某些应用程序(如 GIMP)选择可用的附加组件,以便一次都安装上。这样你就可以节省寻找附加组件和单独安装它们的时间了。 + +事实证明,GNOME 41 “软件”比以前更有好用了。 + +#### 新的多任务选项 + +![][6] + +GNOME 41 打造了新的多任务设置以帮助你改善工作流程。 + +你可以通过切换热角来快速打开“活动概览Activities Overview”。还添加了一个拖动窗口到边缘时调整其大小的能力。 + +根据你的需求,你可以设置一个固定的可用工作空间的数量,当然也可以保持动态数量。 + +除此以外,你还可以调整这些功能: + + * 多显示器工作区 + * 应用程序切换行为 + +当你有多个显示器时,你可以选择将工作空间限制在一个屏幕上,或在连接的显示器上连续显示。 + +而且,当你在切换应用程序并浏览它们时,你可以自定义只在同一工作区或在所有工作区预览应用程序。 + +#### 节电设置 + +![][7] + +在 GNOME 41 中,现在有一个有效节省电力的性能调整。这对于笔记本用户手动调整其性能,或者当一个应用程序要求切换模式以节省电力时,是非常有用的。 + +![][8] + +#### GNOME “日历”的改进 + +GNOME “日历Calendar”现在可以打开 ICS 文件及导入活动。 + +#### 触摸板手势 + +无缝的工作流程的体验:可以利用三指垂直向上/向下滑动的动作来获得“活动概览”,以及利用三指水平向右/向左滑动的动作在工作空间之间导航。 + +很高兴看到他们重点放在改善使用触摸板的工作流程上,这类似于 [elementary OS 6 的功能][9]。 + +#### GNOME 连接应用 + +![][10] + +添加了一个新的“连接Connections”应用程序,可以连接到远程计算机,不管是什么平台。 + +我看到这个应用程序仍然是一个 alpha 版本,但也许随着接下来的几次更新,就会看到这个应用程序的完成版本。 + +我还没有试过它是否可以工作,但也许值得再写一篇简短的文章来告诉你如何使用它。 + +#### SIP/VoIP 支持 + +在 [GNOME 41 测试版][11] 中,我发现了对 SIP/VoIP 的支持。 + +如果你是一个商业用户或者经常打国际电话,你现在可以直接从 GNOME 41 的拨号盘上拨打 VoIP 电话了。 + +不幸的是,在使用带有 GNOME 41 稳定版的 GNOME OS 时,我无法找到包含的“通话Calls”应用程序。所以,我无法截图给你看。 + +#### GNOME Web / Epiphany 的改进 + +![][12] + +GNOME Web(即 Epiphany 浏览器)最近进行了很多很棒的改进。 + +在 GNOME 41 中,Epiphany 浏览器现在利用 AdGuard 的脚本来阻止 YouTube 广告。别忘了,它还增加了对 Epiphany canary 构建版的支持。 + +#### 其他改进 + +在底层,有一些细微但重要的变化带来了更好、更快的用户体验。 + +例如,你可能会注意到,在应用程序/窗口的标题区域,图标更加醒目。这是为了提高清晰度和增强外观。 + +同样地,GNOME 应用程序和功能也有许多改进,你在使用它们时可能会发现: + + * GNOME “地图Map”现在以一种用户友好的方式显示平均海平面。 + * Nautilus 文件管理器进行了改进,支持有密码保护的压缩文件,并能够让你切换启用/禁用自动清理垃圾的功能 + * “音乐Music”应用程序的用户界面进行了更新 + * GNOME 文本编辑器有了更多功能 + * GTK 更新至 4.4.0 + * 增加 libawaita,以潜在地改善 GNOME 应用程序的用户体验 + +你可以参考 [官方更新日志和公告博文][13] 来探索所有的技术变化。 + +### 总结 + +GNOME 41 可能不是一个突破性的升级,但它是一个带有许多有价值的补充的重要更新。 + +你可以期待在下个月发布 Fedora 35 中带有它。不幸的是,Ubuntu 21.10 将不包括它,但你可以在其他 Linux 发行版中等待它。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-41-release/ + +作者:[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://itsfoss.com/gnome-os/ +[2]: https://i2.wp.com/i.ytimg.com/vi/holOYrZquBQ/hqdefault.jpg?w=780&ssl=1 +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-software.png?w=1233&ssl=1 +[4]: https://news.itsfoss.com/apps-for-gnome-portal/ +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-software-app.png?w=1284&ssl=1 +[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-multitasking.png?w=1032&ssl=1 +[7]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-power-settings.png?w=443&ssl=1 +[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-power-options.png?w=1012&ssl=1 +[9]: https://news.itsfoss.com/elementary-os-6-features/ +[10]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/connections-gnome-41.png?w=1075&ssl=1 +[11]: https://news.itsfoss.com/gnome-41-beta/ +[12]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-web-41.png?w=1328&ssl=1 +[13]: https://help.gnome.org/misc/release-notes/41.0/ From 7a1417ec64f2d22b6bba77ba4e39891823c5043c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 24 Sep 2021 13:11:55 +0800 Subject: [PATCH 0483/1588] TSL&PRF (#23345) --- ...r Linux Desktop Environment Gets Better.md | 172 ------------------ ...r Linux Desktop Environment Gets Better.md | 164 +++++++++++++++++ 2 files changed, 164 insertions(+), 172 deletions(-) delete mode 100644 sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md create mode 100644 translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md diff --git a/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md deleted file mode 100644 index 5be125d516..0000000000 --- a/sources/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md +++ /dev/null @@ -1,172 +0,0 @@ -[#]: subject: "GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better" -[#]: via: "https://news.itsfoss.com/gnome-41-release/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better -====== - -GNOME 41 stable release is ultimately here. - -While GNOME 40 was a radical change forcing many users to adapt to a new workflow, GNOME 41 seems to settle the dust. - -With GNOME 41, there are no significant workflow changes but new **feature additions** and **improvements** across the board. - -GNOME 41 beta has been out there for a while. And, we tried the stable release right before the release date using [GNOME OS][1] to highlight what you can expect with it. - -### GNOME 41 Features: What’s New? - -![][2] - -GNOME 41 does not give you any new visual treats but useful improvements to help you improve the workflow or take control of it. - -There are some GNOME app upgrades that come along with it. - -Let me mention the key highlights of GNOME 41. - -#### GNOME 41 Software Context Tiles - -![][3] - -Every release, users look forward to the improvements made to the GNOME Software Center. - -While they have been improving it in the right direction, it needed a visual overhaul. And, this time, GNOME 41 comes with a much-needed UI refresh. - -The software store is more descriptive and should look appealing to new users. Using emojis/creative icons to categorize applications makes the software center pop. - -Like the [Apps for GNOME][4] portal, the application screens on the Software center include more details to inform the user as much as possible without needing to refer to the project page or the web. - -![][5] - -In other words, these are the context tiles added to an app page that provides information about device support, safety/permissions, age rating, download size, the project, and more. - -You also get to choose the available add-ons for a particular app like GIMP to install in one go. So, you save time from finding add-ons and installing them individually. - -GNOME 41 Software should prove to be much more helpful than it ever was. - -#### New Multitasking Options - -![][6] - -To help you improve the workflow, GNOME 41 comes baked in with new multitasking tweaks. - -You get the toggle the hot corner to quickly open the Activities Overview. The ability to resize windows upon dragging them to the edges has also been added. - -If you want, you can set a fixed number of workspaces available or keep it dynamic to adapt as you require. - -In addition to these, you also get features to tweak: - - * Multi-monitor workspaces - * Application switching behaviour - - - -When you have multiple displays, you can choose to keep the workspaces restricted to a single screen or continue over connected displays. - -And, when you head to switch applications and navigate through them, you can customize to preview the applications only in the same workspace or from all workspaces. - -#### Power Saving Settings - -![][7] - -A helpful performance tweak to save power is now available in GNOME 41. This is incredibly useful for laptop users to tune their performance manually or if an app requests switching the mode to save power. - -![][8] - -#### GNOME Calendar Improvements - -GNOME Calendar now can open ICS files along with the ability to import the events. - -#### Touchpad Gestures - -The workflow experience should be seamless when you utilize three-finger vertical swipe up/down actions to get the activity overview, and three-finger horizontal swipe right/left actions to navigate between workspaces. - -It is good to see the focus on improving the workflow using the touchpad, similar to [elementary OS 6 features][9]. - -#### GNOME Connections App - -![][10] - -A new “Connections” app has been added to connect to remote computers no matter the platform. - -I still see the application as an alpha build, but maybe with the following few updates, you should get the finished version of the application. - -I haven’t tried if it works, but it might be worth another brief article to show you how to use it. - -#### SIP/VoIP Support - -With [GNOME 41 beta release][11], we spotted the inclusion of SIP/VoIP support. - -If you are a business user or prefer international calls, you can now make VoIP calls directly from the dialpad in GNOME 41. - -Unfortunately, I couldn’t find the “Calls” app included when using GNOME OS with GNOME 41 stable release. So, I couldn’t grab a screenshot of how it looks. - -#### GNOME Web / Epiphany Improvements - -![][12] - -GNOME Web or Epiphany browser has been receiving a lot of good improvements lately. - -With GNOME 41, the epiphany browser now utilizes AdGuard’s script to block YouTube advertisements. Not to forget, the support for epiphany canary builds has been added as well. - -#### Other Improvements - -Under the hood, several subtle but essential changes result in a better and faster user experience. - -For instance, you may notice the icons more prominent in the header areas of application/windows. This is to improve clarity and enhance the look. - -Similarly, there are numerous improvements to GNOME apps and functionalities that you might bump into when you use them: - - * GNOME Map now shows the mean sea levels in a user-friendly way - * Improvements to Nautilus file manager to support password-protected zip files and the ability to toggle to let you enable/disable automatic trash cleaning - * Music app getting a UI refresh - * GNOME Text Editor gaining more features - * GTK updated to 4.4.0 - * Addition of libawaita to potentially improve the user experience with GNOME apps - - - -You can refer to the [official changelog and the announcement blog post][13] to explore all the technical changes. - -### Wrapping Up - -GNOME 41 may not be an experience-breaking upgrade, but it is a significant update with many valuable additions. - -You can expect it with Fedora 35, which should release next month. Unfortunately, Ubuntu 21.10 will not include it, but you can wait it out for other Linux distributions. - -#### 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-41-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/gnome-os/ -[2]: https://i2.wp.com/i.ytimg.com/vi/holOYrZquBQ/hqdefault.jpg?w=780&ssl=1 -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://news.itsfoss.com/apps-for-gnome-portal/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzMSIgd2lkdGg9IjQ0MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[9]: https://news.itsfoss.com/elementary-os-6-features/ -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[11]: https://news.itsfoss.com/gnome-41-beta/ -[12]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUyMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[13]: https://help.gnome.org/misc/release-notes/41.0/ diff --git a/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md new file mode 100644 index 0000000000..af347275af --- /dev/null +++ b/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md @@ -0,0 +1,164 @@ +[#]: subject: "GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better" +[#]: via: "https://news.itsfoss.com/gnome-41-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +GNOME 41 发布:最受欢迎的 Linux 桌面环境的精细打磨 +====== + +> GNOME 41 是一次有价值的升级,它带来了新的应用程序、功能和细微的视觉改进。 + +![](hhttps://img.linux.net.cn/data/attachment/album/202109/24/130703iznp8p53dbd1kktz.jpg) + +现在 GNOME 41 稳定版终于发布了。 + +虽然 GNOME 40 带来了不少激进的改变,让许多用户不得不去适应新的工作流程,但 GNOME 41 似乎避免了这个问题。 + +在 GNOME 41 中没有明显的工作流程变化,但有增加了新的功能,做了全面的改进。 + +GNOME 41 的测试版已经发布了一段时间了。而且,为了发现它值得关注的地方,我们在发布前就使用 [GNOME OS][1] 试用了它的稳定版。 + +### GNOME 41 有什么新功能? + +GNOME 41 并没有给你带来任何新的视觉感受,但是一些有用的改进可以帮助你改善或控制工作流程。 + +此外,还升级了一些 GNOME 应用程序。 + +让我提一下 GNOME 41 的主要亮点。 + +#### GNOME 41 软件的上下文板块 + +![][3] + +每个版本中,用户都期待着对 GNOME “软件Software”的改进。 + +虽然他们一直在朝着正确的方向改进它,但它需要一次视觉上的重新打造。而且,这一次,GNOME 41 带来了急需的 UI 更新。 + +软件商店的描述性更强了,看起来应该对新用户有吸引力。它使用表情符号/创意图标来对应用程序进行分类,使软件中心变得更时尚。 + +就像 [Apps for GNOME][4] 门户网站一样,“软件”的应用程序屏幕包括了更多的细节,以尽可能地告知用户,而不需要参考项目页面或其网站。 + +![][5] + +换句话说,这些添加到应用程序页面的上下文板块,提供了有关设备支持、安全/许可、年龄等级、下载的大小、项目等信息。 + +你还可以为某些应用程序(如 GIMP)选择可用的附加组件,以便一次都安装上。这样你就可以节省寻找附加组件和单独安装它们的时间了。 + +事实证明,GNOME 41 “软件”比以前更有好用了。 + +#### 新的多任务选项 + +![][6] + +GNOME 41 打造了新的多任务设置以帮助你改善工作流程。 + +你可以通过切换热角来快速打开“活动概览Activities Overview”。还添加了一个拖动窗口到边缘时调整其大小的能力。 + +根据你的需求,你可以设置一个固定的可用工作空间的数量,当然也可以保持动态数量。 + +除此以外,你还可以调整这些功能: + + * 多显示器工作区 + * 应用程序切换行为 + +当你有多个显示器时,你可以选择将工作空间限制在一个屏幕上,或在连接的显示器上连续显示。 + +而且,当你在切换应用程序并浏览它们时,你可以自定义只在同一工作区或在所有工作区预览应用程序。 + +#### 节电设置 + +![][7] + +在 GNOME 41 中,现在有一个有效节省电力的性能调整。这对于笔记本用户手动调整其性能,或者当一个应用程序要求切换模式以节省电力时,是非常有用的。 + +![][8] + +#### GNOME “日历”的改进 + +GNOME “日历Calendar”现在可以打开 ICS 文件及导入活动。 + +#### 触摸板手势 + +无缝的工作流程的体验:可以利用三指垂直向上/向下滑动的动作来获得“活动概览”,以及利用三指水平向右/向左滑动的动作在工作空间之间导航。 + +很高兴看到他们重点放在改善使用触摸板的工作流程上,这类似于 [elementary OS 6 的功能][9]。 + +#### GNOME 连接应用 + +![][10] + +添加了一个新的“连接Connections”应用程序,可以连接到远程计算机,不管是什么平台。 + +我看到这个应用程序仍然是一个 alpha 版本,但也许随着接下来的几次更新,就会看到这个应用程序的完成版本。 + +我还没有试过它是否可以工作,但也许值得再写一篇简短的文章来告诉你如何使用它。 + +#### SIP/VoIP 支持 + +在 [GNOME 41 测试版][11] 中,我发现了对 SIP/VoIP 的支持。 + +如果你是一个商业用户或者经常打国际电话,你现在可以直接从 GNOME 41 的拨号盘上拨打 VoIP 电话了。 + +不幸的是,在使用带有 GNOME 41 稳定版的 GNOME OS 时,我无法找到包含的“通话Calls”应用程序。所以,我无法截图给你看。 + +#### GNOME Web / Epiphany 的改进 + +![][12] + +GNOME Web(即 Epiphany 浏览器)最近进行了很多很棒的改进。 + +在 GNOME 41 中,Epiphany 浏览器现在利用 AdGuard 的脚本来阻止 YouTube 广告。别忘了,它还增加了对 Epiphany canary 构建版的支持。 + +#### 其他改进 + +在底层,有一些细微但重要的变化带来了更好、更快的用户体验。 + +例如,你可能会注意到,在应用程序/窗口的标题区域,图标更加醒目。这是为了提高清晰度和增强外观。 + +同样地,GNOME 应用程序和功能也有许多改进,你在使用它们时可能会发现: + + * GNOME “地图Map”现在以一种用户友好的方式显示平均海平面。 + * Nautilus 文件管理器进行了改进,支持有密码保护的压缩文件,并能够让你切换启用/禁用自动清理垃圾的功能 + * “音乐Music”应用程序的用户界面进行了更新 + * GNOME 文本编辑器有了更多功能 + * GTK 更新至 4.4.0 + * 增加 libawaita,以潜在地改善 GNOME 应用程序的用户体验 + +你可以参考 [官方更新日志和公告博文][13] 来探索所有的技术变化。 + +### 总结 + +GNOME 41 可能不是一个突破性的升级,但它是一个带有许多有价值的补充的重要更新。 + +你可以期待在下个月发布 Fedora 35 中带有它。不幸的是,Ubuntu 21.10 将不包括它,但你可以在其他 Linux 发行版中等待它。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/gnome-41-release/ + +作者:[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://itsfoss.com/gnome-os/ +[2]: https://i2.wp.com/i.ytimg.com/vi/holOYrZquBQ/hqdefault.jpg?w=780&ssl=1 +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-software.png?w=1233&ssl=1 +[4]: https://news.itsfoss.com/apps-for-gnome-portal/ +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-software-app.png?w=1284&ssl=1 +[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-multitasking.png?w=1032&ssl=1 +[7]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-power-settings.png?w=443&ssl=1 +[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-power-options.png?w=1012&ssl=1 +[9]: https://news.itsfoss.com/elementary-os-6-features/ +[10]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/connections-gnome-41.png?w=1075&ssl=1 +[11]: https://news.itsfoss.com/gnome-41-beta/ +[12]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-web-41.png?w=1328&ssl=1 +[13]: https://help.gnome.org/misc/release-notes/41.0/ From 0f51d047432eddf7ac5c09e034d031727e921dc5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Sep 2021 13:12:16 +0800 Subject: [PATCH 0484/1588] PUB @wxy https://linux.cn/article-13816-1.html --- ... The Most Popular Linux Desktop Environment Gets Better.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md (99%) diff --git a/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/published/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md similarity index 99% rename from translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md rename to published/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md index af347275af..0a3ec80616 100644 --- a/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md +++ b/published/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13816-1.html" GNOME 41 发布:最受欢迎的 Linux 桌面环境的精细打磨 ====== From 9d290ed1c35b589a557c4bdb768d96508b7072f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Sep 2021 13:24:41 +0800 Subject: [PATCH 0485/1588] PUB --- ...r Linux Desktop Environment Gets Better.md | 164 ------------------ 1 file changed, 164 deletions(-) delete mode 100644 translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md diff --git a/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md deleted file mode 100644 index af347275af..0000000000 --- a/translated/news/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md +++ /dev/null @@ -1,164 +0,0 @@ -[#]: subject: "GNOME 41 Released: The Most Popular Linux Desktop Environment Gets Better" -[#]: via: "https://news.itsfoss.com/gnome-41-release/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " - -GNOME 41 发布:最受欢迎的 Linux 桌面环境的精细打磨 -====== - -> GNOME 41 是一次有价值的升级,它带来了新的应用程序、功能和细微的视觉改进。 - -![](hhttps://img.linux.net.cn/data/attachment/album/202109/24/130703iznp8p53dbd1kktz.jpg) - -现在 GNOME 41 稳定版终于发布了。 - -虽然 GNOME 40 带来了不少激进的改变,让许多用户不得不去适应新的工作流程,但 GNOME 41 似乎避免了这个问题。 - -在 GNOME 41 中没有明显的工作流程变化,但有增加了新的功能,做了全面的改进。 - -GNOME 41 的测试版已经发布了一段时间了。而且,为了发现它值得关注的地方,我们在发布前就使用 [GNOME OS][1] 试用了它的稳定版。 - -### GNOME 41 有什么新功能? - -GNOME 41 并没有给你带来任何新的视觉感受,但是一些有用的改进可以帮助你改善或控制工作流程。 - -此外,还升级了一些 GNOME 应用程序。 - -让我提一下 GNOME 41 的主要亮点。 - -#### GNOME 41 软件的上下文板块 - -![][3] - -每个版本中,用户都期待着对 GNOME “软件Software”的改进。 - -虽然他们一直在朝着正确的方向改进它,但它需要一次视觉上的重新打造。而且,这一次,GNOME 41 带来了急需的 UI 更新。 - -软件商店的描述性更强了,看起来应该对新用户有吸引力。它使用表情符号/创意图标来对应用程序进行分类,使软件中心变得更时尚。 - -就像 [Apps for GNOME][4] 门户网站一样,“软件”的应用程序屏幕包括了更多的细节,以尽可能地告知用户,而不需要参考项目页面或其网站。 - -![][5] - -换句话说,这些添加到应用程序页面的上下文板块,提供了有关设备支持、安全/许可、年龄等级、下载的大小、项目等信息。 - -你还可以为某些应用程序(如 GIMP)选择可用的附加组件,以便一次都安装上。这样你就可以节省寻找附加组件和单独安装它们的时间了。 - -事实证明,GNOME 41 “软件”比以前更有好用了。 - -#### 新的多任务选项 - -![][6] - -GNOME 41 打造了新的多任务设置以帮助你改善工作流程。 - -你可以通过切换热角来快速打开“活动概览Activities Overview”。还添加了一个拖动窗口到边缘时调整其大小的能力。 - -根据你的需求,你可以设置一个固定的可用工作空间的数量,当然也可以保持动态数量。 - -除此以外,你还可以调整这些功能: - - * 多显示器工作区 - * 应用程序切换行为 - -当你有多个显示器时,你可以选择将工作空间限制在一个屏幕上,或在连接的显示器上连续显示。 - -而且,当你在切换应用程序并浏览它们时,你可以自定义只在同一工作区或在所有工作区预览应用程序。 - -#### 节电设置 - -![][7] - -在 GNOME 41 中,现在有一个有效节省电力的性能调整。这对于笔记本用户手动调整其性能,或者当一个应用程序要求切换模式以节省电力时,是非常有用的。 - -![][8] - -#### GNOME “日历”的改进 - -GNOME “日历Calendar”现在可以打开 ICS 文件及导入活动。 - -#### 触摸板手势 - -无缝的工作流程的体验:可以利用三指垂直向上/向下滑动的动作来获得“活动概览”,以及利用三指水平向右/向左滑动的动作在工作空间之间导航。 - -很高兴看到他们重点放在改善使用触摸板的工作流程上,这类似于 [elementary OS 6 的功能][9]。 - -#### GNOME 连接应用 - -![][10] - -添加了一个新的“连接Connections”应用程序,可以连接到远程计算机,不管是什么平台。 - -我看到这个应用程序仍然是一个 alpha 版本,但也许随着接下来的几次更新,就会看到这个应用程序的完成版本。 - -我还没有试过它是否可以工作,但也许值得再写一篇简短的文章来告诉你如何使用它。 - -#### SIP/VoIP 支持 - -在 [GNOME 41 测试版][11] 中,我发现了对 SIP/VoIP 的支持。 - -如果你是一个商业用户或者经常打国际电话,你现在可以直接从 GNOME 41 的拨号盘上拨打 VoIP 电话了。 - -不幸的是,在使用带有 GNOME 41 稳定版的 GNOME OS 时,我无法找到包含的“通话Calls”应用程序。所以,我无法截图给你看。 - -#### GNOME Web / Epiphany 的改进 - -![][12] - -GNOME Web(即 Epiphany 浏览器)最近进行了很多很棒的改进。 - -在 GNOME 41 中,Epiphany 浏览器现在利用 AdGuard 的脚本来阻止 YouTube 广告。别忘了,它还增加了对 Epiphany canary 构建版的支持。 - -#### 其他改进 - -在底层,有一些细微但重要的变化带来了更好、更快的用户体验。 - -例如,你可能会注意到,在应用程序/窗口的标题区域,图标更加醒目。这是为了提高清晰度和增强外观。 - -同样地,GNOME 应用程序和功能也有许多改进,你在使用它们时可能会发现: - - * GNOME “地图Map”现在以一种用户友好的方式显示平均海平面。 - * Nautilus 文件管理器进行了改进,支持有密码保护的压缩文件,并能够让你切换启用/禁用自动清理垃圾的功能 - * “音乐Music”应用程序的用户界面进行了更新 - * GNOME 文本编辑器有了更多功能 - * GTK 更新至 4.4.0 - * 增加 libawaita,以潜在地改善 GNOME 应用程序的用户体验 - -你可以参考 [官方更新日志和公告博文][13] 来探索所有的技术变化。 - -### 总结 - -GNOME 41 可能不是一个突破性的升级,但它是一个带有许多有价值的补充的重要更新。 - -你可以期待在下个月发布 Fedora 35 中带有它。不幸的是,Ubuntu 21.10 将不包括它,但你可以在其他 Linux 发行版中等待它。 - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/gnome-41-release/ - -作者:[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://itsfoss.com/gnome-os/ -[2]: https://i2.wp.com/i.ytimg.com/vi/holOYrZquBQ/hqdefault.jpg?w=780&ssl=1 -[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-software.png?w=1233&ssl=1 -[4]: https://news.itsfoss.com/apps-for-gnome-portal/ -[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-software-app.png?w=1284&ssl=1 -[6]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-multitasking.png?w=1032&ssl=1 -[7]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-power-settings.png?w=443&ssl=1 -[8]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-41-power-options.png?w=1012&ssl=1 -[9]: https://news.itsfoss.com/elementary-os-6-features/ -[10]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/connections-gnome-41.png?w=1075&ssl=1 -[11]: https://news.itsfoss.com/gnome-41-beta/ -[12]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/gnome-web-41.png?w=1328&ssl=1 -[13]: https://help.gnome.org/misc/release-notes/41.0/ From 3ac0f00630b3fd5628088d0105f56e85ca5bce45 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Sep 2021 15:24:49 +0800 Subject: [PATCH 0486/1588] APL --- ...her Windows, nor Linux- Shrine is ‘God-s Operating System.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md b/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md index 07676c2130..a7edbed79f 100644 --- a/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md +++ b/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/shrine-os/" [#]: author: "John Paul https://itsfoss.com/author/john/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 26e63d74ede8b42d5dca86a770b13ba792d2bdf1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 24 Sep 2021 19:30:23 +0800 Subject: [PATCH 0487/1588] TSL --- ...inux- Shrine is ‘God-s Operating System.md | 80 ------------------- ...inux- Shrine is ‘God-s Operating System.md | 78 ++++++++++++++++++ 2 files changed, 78 insertions(+), 80 deletions(-) delete mode 100644 sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md create mode 100644 translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md diff --git a/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md b/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md deleted file mode 100644 index a7edbed79f..0000000000 --- a/sources/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: subject: "Neither Windows, nor Linux! Shrine is ‘God’s Operating System’" -[#]: via: "https://itsfoss.com/shrine-os/" -[#]: author: "John Paul https://itsfoss.com/author/john/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Neither Windows, nor Linux! Shrine is ‘God’s Operating System’ -====== - -We’ve all used multiple operating systems in our lives. Some were good and some were bad. But can you say that you’ve ever used an operating system designed by God? Today, I’d like to introduce you to Shrine. - -### What is Shrine? - -![Shrine interface][1] - -From that introduction, you’re probably wondering what the heck is going on. Well, it all started with a guy named Terry Davis. Before we go any further, I’d better warn you that Terry suffered from schizophrenia during his life and often didn’t take his medication. Because of this, he said or did things during his life that were not quite socially acceptable. - -Anyway, back to the story line. In the early 2000s, Terry released a simple operating system. Over the years, it went through several names, including J Operating System, LoseThos, and SparrowOS. He finally settled on the name [TempleOS][2]. He chose that name because this operating system would be God’s temple. As such. God gave Terry the following [specifications][3] for the operating system: - - * It would have 640×480 16 color graphics - * It would use “a single-voice 8-bit signed MIDI-like sample for sound”. - * It would follow the Commodore 64, i.e. “a non-networked, simple machine where programming was the goal, not just a means to an end”. - * It would only support one file system (named “Red Sea”). - * It would be limited to 100,000 lines of code to make it “easy to learn the whole thing”. - * “Ring-0-only. Everything runs in kernel mode, including user applications” - * The font would be limited to “one 8×8 fixed-width font”. - * The use would have “full access to everything. All memory, I/O ports, instructions, and similar things must never be off limits. All functions, variables and class members will be accessible.” - * It would only support one platform, 64-bit PCs. - - - -Terry wrote this operating system using in a programming language that he called HolyC. TechRepublic called it a “modified version of C++ (“more than C, less than C++”)”. If you are interested in getting a flavor of HolyC, I would recommend, [this article][4] and the HolyC entry on [RosettaCode][5]. - -In 2013, Terry announced on his website that TempleOS was complete. Tragically, Terry died a few years later in August of 2018 when he was hit by a train. He was homeless at the time. Over the years, many people followed Terry through his work on the operating system. Most were impressed at his ability to write an operating system in such a small package. - -Now, you are probably wondering what all this talk of TempleOS has to do with Shrine. Well, as the [GitHub page][6] for Shrine states, it is “A TempleOS distro for heretics”. GitHub user [minexew][7] created Shrine to add features to TempleOS that Terry had neglected. These features include: - - * 99% compatibility with TempleOS programs - * Ships with Lambda Shell, which feels a bit like a classic Unix command interpreter - * TCP/IP stack & internet access out of the box - * Includes a package downloader - - - -minexew is planning to add more features in the future, but hasn’t announced what exactly will be included. He has plans to make a full TempleOS environment for Linux. - -### Experience - -It’s fairly easy to get Shrine virtualized. All you need to do is install your virtualizing software of choice. (Mine is VirtualBox.) When you create a virtual machine for Shrine, make sure that it is 64-bit and has at least 512 MB of RAM. - -Once you boot into Shrine, you will be asked if you want to install to your (virtual) hard drive. Once that is finished (or not, if you choose), you will be offered a tour of the operating system. From there you can explore. - -### Final Thoughts - -Temple OS and (Shrine) is obviously not intended to be a replacement for Windows or Linux. Even though Terry referred to it as “God’s temple”, I’m sure in his more lucid moments, he would have acknowledged that it was more of a hobby operating system. With that in mind, the finished product is fairly [impressive][8]. Over a twelve-year period, Terry created an operating system in a little over 100,000 lines of code, using a language that he had created himself. He also wrote his own compiler, graphics library and several games. All this while fighting his own personal demons. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/shrine-os/ - -作者:[John Paul][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/john/ -[b]: https://github.com/lujun9972 -[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/shrine.jpg?resize=800%2C600&ssl=1 -[2]: https://templeos.org/ -[3]: https://web.archive.org/web/20170508181026/http://www.templeos.org:80/Wb/Doc/Charter.html -[4]: https://harrisontotty.github.io/p/a-lang-design-analysis-of-holyc -[5]: https://rosettacode.org/wiki/Category:HolyC -[6]: https://github.com/minexew/Shrine -[7]: https://github.com/minexew -[8]: http://www.codersnotes.com/notes/a-constructive-look-at-templeos/ diff --git a/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md b/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md new file mode 100644 index 0000000000..2fdc0afe51 --- /dev/null +++ b/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md @@ -0,0 +1,78 @@ +[#]: subject: "Neither Windows, nor Linux! Shrine is ‘God’s Operating System’" +[#]: via: "https://itsfoss.com/shrine-os/" +[#]: author: "John Paul https://itsfoss.com/author/john/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +不是 Windows,也不是 Linux,Shrine 才是 “神之操作系统” +====== + +在生活中,我们都曾使用过多种操作系统。有些好,有些坏。但你能说你使用过由“神”设计的操作系统吗?今天,我想向你介绍 Shrine(圣殿)。 + +### 什么是 Shrine? + +![Shrine 界面][1] + +从介绍里,你可能想知道这到底是怎么回事。嗯,这一切都始于一个叫 Terry Davis 的人。在我们进一步介绍之前,我最好提醒你,Terry 在生前患有精神分裂症,而且经常不吃药。正因为如此,他在生活中说过或做过一些不被社会接受的事情。 + +总之,让我们回到故事的主线。在 21 世纪初,Terry 发布了一个简单的操作系统。多年来,它不停地换了几个名字,有 J Operating System、LoseThos 和 SparrowOS 等等。他最终确定了 [TempleOS][2] 这个名字。他选择这个名字(神庙系统)是因为这个操作系统将成为神的圣殿。因此,神给 Terry 的操作系统规定了以下 [规格][3]: + +![video](https://youtu.be/LtlyeDAJR7A) + + * 它将有 640×480 的 16 色图形 + * 它将使用“单声道 8 位带符号的类似 MIDI 的声音采样” + * 它将追随 Commodore 64,即“一个非网络化的简单机器,编程是目标,而不仅仅是达到目的的手段” + * 它将只支持一个文件系统(名为 “Red Sea”)。 + * 它将被限制在 10 万行代码内,以使它 “整体易于学习”。 + * “只支持 Ring-0 级,一切都在内核模式下运行,包括用户应用程序 + * 字体将被限制为 “一种 8×8 等宽字体” + * “对一切都可以完全访问。所有的内存、I/O 端口、指令和类似的东西都绝无限制。所有的函数、变量和类成员都是可访问的” + * 它将只支持一个平台,即 64 位 PC + +Terry 用一种他称之为 HolyC(神圣 C 语言)的编程语言编写了这个操作系统。TechRepublic 称其为一种 “C++ 的修改版(‘比 C 多,比 C++ 少’)”。如果你有兴趣了解 HolyC,我推荐,[这篇文章][4] 和 [RosettaCode][5] 上的 HolyC 条目。 + +2013 年,Terry 在他的网站上宣布,TempleOS 已经完成。不幸的是,几年后的 2018 年 8 月,Terry 被火车撞死了。当时他无家可归。多年来,许多人通过他在该操作系统上的工作关注着他。大多数人对他在如此小的体积中编写操作系统的能力印象深刻。 + +现在,你可能想知道这些关于 TempleOS 的讨论与 Shrine 有什么关系。好吧,正如 Shrine 的 [GitHub 页面][6] 所说,它是 “一个为异教徒设计的 TempleOS 发行版”。GitHub 用户 [minexew][7] 创建了 Shrine,为 TempleOS 添加 Terry 忽略的功能。这些功能包括: + + * 与 TempleOS 程序 99% 的兼容性 + * 带有 Lambda Shell,感觉有点像经典的 Unix 命令解释器 + * TCP/IP 协议栈和开机即可上网 + * 包括一个软件包下载器 + +minexew 正计划在未来增加更多的功能,但还没有宣布具体会包括什么。他有计划为 Linux 制作一个完整的 TempleOS 环境。 + +### 体验 + +让 Shrine 在虚拟机中运行是相当容易的。你所需要做的就是安装你选择的虚拟化软件。(我的是 VirtualBox)当你为 Shrine 创建一个虚拟机时,确保它是 64 位的,并且至少有 512MB 的内存。 + +一旦你启动到 Shrine,会询问你是否要安装到你的(虚拟)硬盘上。一旦安装完成(你也可以选择不安装),你会看到一个该操作系统的导览,你可以由此探索。 + +### 总结 + +TempleOS (和 Shrine)显然不是为了取代 Windows 或 Linux。即使 Terry 把它称为 “神之圣殿”,我相信在他比较清醒的时候,他也会承认这更像是一个业余的作业系统。考虑到这一点,已完成的产品相当 [令人印象深刻][8]。在 12 年的时间里,Terry 用他自己创造的语言创造了一个稍稍超过 10 万行代码的操作系统。他还编写了自己的编译器、图形库和几个游戏。所有这些都是在与他自己的个人心魔作斗争的时候进行的。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/shrine-os/ + +作者:[John Paul][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://itsfoss.com/author/john/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/shrine.jpg?resize=800%2C600&ssl=1 +[2]: https://templeos.org/ +[3]: https://web.archive.org/web/20170508181026/http://www.templeos.org:80/Wb/Doc/Charter.html +[4]: https://harrisontotty.github.io/p/a-lang-design-analysis-of-holyc +[5]: https://rosettacode.org/wiki/Category:HolyC +[6]: https://github.com/minexew/Shrine +[7]: https://github.com/minexew +[8]: http://www.codersnotes.com/notes/a-constructive-look-at-templeos/ From 9620efcf98516cdd19e99bc967a52d9f5121b182 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Sep 2021 05:02:55 +0800 Subject: [PATCH 0488/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210924?= =?UTF-8?q?=20PowerShell=20on=20Linux=3F=20A=20primer=20on=20Object-Shells?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210924 PowerShell on Linux- A primer on Object-Shells.md --- ...ell on Linux- A primer on Object-Shells.md | 402 ++++++++++++++++++ 1 file changed, 402 insertions(+) create mode 100644 sources/tech/20210924 PowerShell on Linux- A primer on Object-Shells.md diff --git a/sources/tech/20210924 PowerShell on Linux- A primer on Object-Shells.md b/sources/tech/20210924 PowerShell on Linux- A primer on Object-Shells.md new file mode 100644 index 0000000000..15759ad4f1 --- /dev/null +++ b/sources/tech/20210924 PowerShell on Linux- A primer on Object-Shells.md @@ -0,0 +1,402 @@ +[#]: subject: "PowerShell on Linux? A primer on Object-Shells" +[#]: via: "https://fedoramagazine.org/powershell-on-linux-a-primer-on-object-shells/" +[#]: author: "TheEvilSkeletonOzymandias42 https://fedoramagazine.org/author/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +PowerShell on Linux? A primer on Object-Shells +====== + +![][1] + +Photos by [NOAA][2] and [Cedric Fox][3] on [Unsplash][4] + +In the previous post, [Install PowerShell on Fedora Linux][5], we went through different ways to install PowerShell on Fedora Linux and explained the basics of PowerShell. This post gives you an overview of PowerShell and a comparison to POSIX-compliant shells. + +### Table of contents + + * [Differences at first glance — Usability][6] + * [Speed and efficiency][7] + * [Aliases][8] + * [Custom aliases][9] + * [Differences between POSIX Shells — Char-stream vs. Object-stream][10] + * [To filter for something][11] + * [Output formatting][12] + * [Field separators, column-counting and sorting][13] + * [Getting rid of fields and formatting a nice table][14] + * [How it’s done in PowerShell][15] + * [Remote Administration with PowerShell — PowerShell-Sessions on Linux!?][16] + * [Background][17] + * [What this is good for][18] + * [Conclusion][19] + + + +### Differences at first glance — Usability + +One of the very first differences to take note of when using PowerShell for the first time is semantic clarity. + +Most commands in traditional POSIX shells, like the Bourne Again Shell (BASH), are heavily abbreviated and often require memorizing. + +Commands like _awk_, _ps_, _top_ or even _ls_ do not communicate what they do with their name. Only when one already _does_ know what they do, do the names start to make sense. Once I know that _ls_ **lists** files the abbreviation makes sense. + +In PowerShell on the other hand, commands are perfectly self-descriptive. They accomplish this by following a strict naming convention. + +Commands in PowerShell are called “cmdlets” (pronounced commandlets). These always follow the scheme of Verb-Noun. + +One example: To **get** all files or child-items in a directory I tell PowerShell like this: + +``` +PS > Get-ChildItem + + Directory: /home/Ozymandias42 + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +d---- 14/04/2021 08:11 Folder1 +d---- 13/04/2021 11:55 Folder2 +``` + +**An Aside:** +The cmdlet name is Get-Child_Item_ not _Item**s**_. This is in acknowledgement of [Set-theory][20]. Each of the standard cmdlets return a list or a set of results. The number of items in a set —mathematicians call this the sets [cardinality][21]— can be 0, 1 or any arbitrary natural number, meaning the set can be empty, contain exactly one result or many results. The reason for this, and why I stress this here, is because the standard cmdlets _also_ implicitly implement a ForEach-Loop for any results they return. More about this later. + +#### Speed and efficiency + +##### Aliases + +You might have noticed that standard cmdlets are long and can therefore be time consuming when writing scripts. However, many cmdlets are aliased and don’t necessarily depend on the case, which mitigates this problem. + +Let’s write a script with unaliased cmdlets as an example: + +``` +PS > Get-Process | ForEach-Object {Write-Host $_.Name -ForegroundColor Cyan} +``` + +This lists the name of running processes in cyan. As you can see, many characters are in upper case and cmdlets names are relatively long. Let’s shorten them and replace upper case letters to make the script easier to type: + +``` +PS > gps | foreach {write-host $_.name -foregroundcolor cyan} +``` + +This is the same script but with greatly simplified input. + +To see the full list of aliased cmdlets, type _Get-Alias_. + +##### Custom aliases + +Just like any other shell, PowerShell also lets you set your own aliases by using the _Set-Alias_ cmdlet. Let’s alias _Write-Host_ to something simpler so we can make the same script even easier to type: + +``` +PS > Set-Alias -Name wh -Value Write-Host +``` + +Here, we aliased _wh_ to _Write-Host_ to increase typebility. When setting aliases, _-Name_ indicates what you want the alias to be and _-Value_ indicates what you want to alias to. + +Let’s see how it looks now: + +``` +PS > gps | foreach {wh $_.name -foregroundcolor cyan} +``` + +You can see that we already made the script easier to type. If we wanted, we could also alias _ForEach-Object_ to _fe_, but you get the gist. + +If you want to see the properties of an alias, you can type _Get-Alias_. Let’s check the properties of the alias _wh_ using the _Get-Alias_ cmdlet: + +``` +PS > Get-Alias wh + +CommandType Name Version Source +----------- ---- ------- ------ +Alias wh -> Write-Host +``` + +##### Autocompletion and suggestions + +PowerShell suggests cmdlets or flags when you press the Tab key twice, by default. If there is nothing to suggest, PowerShell automatically completes to the cmdlet. + +### Differences between POSIX Shells — Char-stream vs. Object-stream + +Any scripting will eventually string commands together via pipe | and soon come to notice a few key differences. + +In bash what is moved from one command to the next through a pipe is just a string of characters. However, in PowerShell this is not the case. + +In PowerShell, every cmdlet is aware of data structures and objects. For example, a structure like this: + +``` +{ + firstAuthor=Ozy, + secondAuthor=Skelly +} +``` + +This data is kept as-is even if a command, used alone, would have presented this data as follows: + +``` +AuthorNr. AuthorName +1 Ozy +2 Skelly +``` + +In bash, on the other hand, that formatted output would need to be created by parsing with helper tools like _awk_ or _cut_ first, to be usable with a different command. + +PowerShell does not require this parsing since the underlying structure is sent when using a pipe rather than the formatted output shown without. So the command _authorObject | doThingsWithSingleAuthor firstAuthor_ is possible. + +The following examples shall further illustrate this. + +**Beware:** This will get fairly technical and verbose. Skip if satisfied already. + +A few of the most often used constructs to illustrate the advantage of PowerShell over bash, when using pipes, are to: + + * filter for something + * format output + * sort output + + + +When implementing these in bash there are a few things that will re-occur time and time again. +The following sections will exemplarise these constructs and their variants in bash and contrast them with their PowerShell equivalents. + +#### To filter for something + +Let’s say you want to see all processes matching the name _ssh-agent_. +In human thinking terms you know what you want. + + 1. Get all processes + 2. Filter for all processes that match our criteria + 3. Print those processes + + + +To apply this in bash we could do it in two ways. + +The first one, which most people who are comfortable with bash might use is this one: + +``` +$ ps -p $(pgrep ssh-agent) +``` + +At first glance this is straight forward. _ps_ get’s all processes and the _-p_ flag tells it to filter for a given list of pids. +What the veteran bash user might forget here however is that this might read this way but is not actually run as such. There’s a tiny but important little thing called the order of evaluation. + +_$()_ is d a subshell. A subshell is run, or evaluated, first. This means the list of pids to filter again is first and the result is then returned in place of the subshell for the waiting outer command _ps_ to use. + +This means it is written as: + + 1. Print processes + 2. Filter Processes + + + +but evaluated the other way around. It also implicitly combines the original steps 2. and 3. + +A less often used variant that more closely matches the human thought pattern and evaluation order is: + +``` +$ pgrep ssh-agent | xargs ps +``` + +The second one still combines two steps, the steps 1. and 2. but follows the evaluation logic a human would think of. + +The reason this variant is less used is that ominous _xargs_ command. What this basically does is to append all lines of output from the previous command as a single long line of arguments to the command followed by it. In this case _ps_. + +This is necessary because pgrep produces output like this: + +``` +$ pgrep bash +14514 +15308 +``` + +When used in conjunction with a subshell _ps_, might not care about this but when using pipes to approximate the human evaluation order this becomes a problem. + +What _xargs_ does, is to reduce the following construct to a single command: + +``` +$ for i in $(pgrep ssh-agent); do ps $i ; done +``` + +Okay. Now we have talked a LOT about evaluation order and how to do it in bash in different ways with different evaluation orders of the three basic steps we outlined. + +So with this much preparation, how does PowerShell handle it? + +``` +PS > Get-Process | Where-Object Name -Match ssh-agent +``` + +Completely self-descriptive and follows the evaluation order of the steps we outlined perfectly. Also do take note of the absence of _xargs_ or any explicit for-loop. + +As mentioned in our aside a few hundred words back, the standard cmdlets all implement ForEach internally and do it implicitly when piped input in list-form. + +#### Output formatting + +This is where PowerShell really shines. Consider a simple example to see how it’s done in bash first. Say we want to list all files in a directory sorted by size from the biggest to the smallest and listed as a table with filename, size and creation date. Also let’s say we have some files with long filenames in there and want to make sure we get the full filename no matter how big our terminal. + +##### Field separators, column-counting and sorting + +Now the first obvious step is to run _ls_ with the _-l_ flag to get a list with not just the filenames but the creation date and the file sizes we need to sort against too. + +We will get a more verbose output than we need. Like this one: + +``` +$ ls -l +total 148692 +-rwxr-xr-x 1 root root 51984 May 16 2020 [ +-rwxr-xr-x 1 root root 283728 May 7 18:13 appdata2solv +lrwxrwxrwx 1 root root 6 May 16 2020 apropos -> whatis +-rwxr-xr-x 1 root root 35608 May 16 2020 arch +-rwxr-xr-x 1 root root 14784 May 16 2020 asn1Coding +-rwxr-xr-x 1 root root 18928 May 16 2020 asn1Decoding +[not needed] [not needed] +``` + +What is apparent is, that to get the kind of output we want we have to get rid of the fields marked _[not needed]_ in the above example but that’s not the only thing needing work. We also need to sort the output so that the biggest file is the first in the list, meaning reverse sort… + +This, of course, can be done in multiple ways but it only shows again, how convoluted bash scripts can get. + +We can either sort with the _ls_ tool directly by using the _-r_ flag for reverse sort, and the _–sort=size_ flag for sort by size, or we can pipe the whole thing to _sort_ and supply that with the _-n_ flag for numeric sort and the _-k 5_ flag to sort by the fifth column. + +Wait! **fifth** ? Yes. Because this too we would have to know. _sort_, by default, uses spaces as field separators, meaning in the tabular output of _ls -l_ the numbers representing the size is the 5th field. + +##### Getting rid of fields and formatting a nice table + +To get rid of the remaining fields, we once again have multiple options. The most straightforward option, and most likely to be known, is probably _cut_. This is one of the few UNIX commands that is self-descriptive, even if it’s just because of the natural brevity of it’s associated verb. So we pipe our results, up to now, into _cut_ and tell it to only output the columns we want and how they are separated from each other. + +_cut -f5- -d” “_ will output from the fifth field to the end. This will get rid of the first columns. + +``` +283728 May 7 18:13 appdata2solv + 51984 May 16 2020 [ + 35608 May 16 2020 arch + 14784 May 16 2020 asn1Coding + 6 May 16 2020 apropos -> whatis +``` + +This is till far from how we wanted it. First of all the filename is in the last column and then the filesize is in the Human unfriendly format of blocks instead of KB, MB, GB and so on. Of course we could fix that too in various ways at various points in our already long pipeline. + +All of this makes it clear that transforming the output of traditional UNIX commands is quite complicated and can often be done at multiple points in the pipeline. + +##### How it’s done in PowerShell + +``` +PS > Get-ChildItem +| Sort-Object Length -Descending +| Format-Table -AutoSize + Name, + @{Name="Size"; Expression= + {[math]::Round($_.Length/1MB,2).toString()+" MB"} + }, + CreationTime +#Reformatted over multiple lines for better readability. +``` + +The only actual output transformation being done here is the conversion and rounding of bytes to megabytes for better human readability. This also is one of the only real weaknesses of PowerShell, that it lacks a _simple_ mechanism to get human readable filesizes. + +That part aside it’s clear, that Format-Table allows you to simply list the columns wanted by their names in the order you want them. + +This works because of the aforementioned object-nature of piped data-streams in PowerShell. There is no need to cut apart strings by delimiters. + +#### Remote Administration with PowerShell — PowerShell-Sessions on Linux!? + +#### Background + +Remote administration via PowerShell on Windows has traditionally always been done via Windows Remoting, using the WinRM protocol. + +With the release of Windows 10, Microsoft has also offered a Windows native OpenSSH Server and Client. + +Using the SSH Server alone on Windows provides the user a CMD prompt unless the default system Shell is changed via a registry key. + +A more elegant option is to make use of the Subsystem facility in _sshd_config_. This makes it possible to configure arbitrary binaries as remote-callable subsystems instead of the globally configured default shell. + +By default there is usually one already there. The sftp subsystem. + +To make PowerShell available as Subsystem one simply needs to add it like so: + +``` +Subsystem powershell /usr/bin/pwsh -sshs --noprofile --nologo +``` + +This works —with the correct paths of course— on _all_ OS’ PowerShell Core is available for. So that means Windows, Linux, and macOS. + +#### What this is good for + +It is now possible to open a PowerShell (Remote) Session to a properly configured SSH-enabled Server by doing this: + +``` +PS > Enter-PSSession + -HostName + -User + -IdentityFilePath + ... + <-SSHTransport> +``` + +What this does is to register and enter an interactive PSSession with the Remote-Host. By itself this has no functional difference from a normal SSH-session. It does, however, allow for things like running scripts from a local host on remote machines via other cmdlets that utilise the same subsystem. + +One such example is the _Invoke-Command_ cmdlet. This becomes especially useful, given that _Invoke-Command_ has the _-AsJob_ flag. + +What this enables is running local scripts as batchjobs on multiple remote servers while using the local Job-manager to get feedback about when the jobs have finished on the remote machines. + +While it is possible to run local scripts via ssh on remote hosts it is not as straight forward to view their progress and it gets outright hacky to run local scripts remotely. We refrain from giving examples here, for brevity’s sake. + +With PowerShell, however, this can be as easy as this: + +``` +$listOfRemoteHosts | Invoke-Command + -HostName $_ + -FilePath /home/Ozymandias42/Script2Run-Remotely.ps1 + -AsJob +``` + +Overview of the running tasks is available by doing this: + +``` +PS > Get-Job + +Id Name PSJobTypeName State HasMoreData Location Command +-- ---- ------------- ----- ----------- -------- ------- +1 Job1 BackgroundJob Running True localhost Microsoft.PowerShe… +``` + +Jobs can then be attached to again, should they require manual intervention, by doing _Receive-Job <JobName-or-JobNumber>_. + +### Conclusion + +In conclusion, PowerShell applies a fundamentally different philosophy behind its syntax in comparison to standard POSIX shells like bash. Of course, for bash, it’s historically rooted in the limitations of the original UNIX. PowerShell provides better semantic clarity with its cmdlets and outputs which means better understandability for humans, hence easier to use and learn. PowerShell also provides aliased cmdlets in the case of unaliased cmdlets being too long. The main difference is that PowerShell is object-oriented, leading to elimination of input-output parsing. This allows PowerShell scripts to be more concise. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/powershell-on-linux-a-primer-on-object-shells/ + +作者:[TheEvilSkeletonOzymandias42][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/theevilskeleton/https://fedoramagazine.org/author/ozymandias42/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/09/powershell_2-816x345.jpg +[2]: https://unsplash.com/@noaa?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/@thecedfox?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: https://unsplash.com/s/photos/shell?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[5]: https://fedoramagazine.org/install-powershell-on-fedora-linux +[6]: tmp.YtC5jLcRsL#differences-at-first-glance--usability +[7]: tmp.YtC5jLcRsL#speed-and-efficiency +[8]: tmp.YtC5jLcRsL#aliases +[9]: tmp.YtC5jLcRsL#custom-aliases +[10]: tmp.YtC5jLcRsL#differences-between-posix-shells--char-stream-vs-object-stream +[11]: tmp.YtC5jLcRsL#to-filter-for-something +[12]: tmp.YtC5jLcRsL#output-formatting +[13]: tmp.YtC5jLcRsL#field-operators-collumn-counting-and-sorting +[14]: tmp.YtC5jLcRsL#getting-rid-of-fields-and-formatting-a-nice-table +[15]: tmp.YtC5jLcRsL#how-its-done-in-powershell +[16]: tmp.YtC5jLcRsL#remote-administration-with-powershell--powershell-sessions-on-linux +[17]: tmp.YtC5jLcRsL#background +[18]: tmp.YtC5jLcRsL#what-this-is-good-for +[19]: tmp.YtC5jLcRsL#conclusion +[20]: https://en.wikipedia.org/wiki/Set_(mathematics) +[21]: https://en.wikipedia.org/wiki/Set_(mathematics)#Cardinality From 6cda268d6016f68d3c34fcdaf9134447c12c263c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Sep 2021 05:03:13 +0800 Subject: [PATCH 0489/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210923?= =?UTF-8?q?=20Fedora=20Linux=20earns=20recognition=20from=20the=20Digital?= =?UTF-8?q?=20Public=20Goods=20Alliance=20as=20a=20DPG!?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210923 Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG.md --- ... Digital Public Goods Alliance as a DPG.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20210923 Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG.md diff --git a/sources/tech/20210923 Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG.md b/sources/tech/20210923 Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG.md new file mode 100644 index 0000000000..234f49b192 --- /dev/null +++ b/sources/tech/20210923 Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG.md @@ -0,0 +1,67 @@ +[#]: subject: "Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG!" +[#]: via: "https://fedoramagazine.org/fedora-linux-earns-recognition-from-the-digital-public-goods-alliance-as-a-dpg/" +[#]: author: "Justin W. FloryAlberto Rodriguez SanchezMatthew Miller https://fedoramagazine.org/author/jflory7/https://fedoramagazine.org/author/bt0dotninja/https://fedoramagazine.org/author/mattdm/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fedora Linux earns recognition from the Digital Public Goods Alliance as a DPG! +====== + +![][1] + +In the Fedora Project community, [we look at open source][2] as not only code that can change how we interact with computers, but also as a way for us to positively influence and shape the future. The more hands that help shape a project, the more ideas, viewpoints and experiences the project represents — that’s truly what the spirit of open source is built from. + +But it’s not just the global contributors to the Fedora Project who feel this way. August 2021 saw Fedora Linux recognized as a digital public good by the [Digital Public Goods Alliance (DPGA)][3], a significant achievement and a testament to the openness and inclusivity of the project. + +We know that digital technologies can save lives, improve the well-being of billions, and contribute to a more sustainable future. We also know that in tackling those challenges, Open Source is uniquely positioned in the world of digital solutions by inherently welcoming different ideas and perspectives critical to lasting success. + +But, we also know that many regions and countries around the world do not have access to those technologies. Open Source technologies can be the difference between achieving the [Sustainable Development Goals][4] (SDGs) by 2030 or missing the targets. Projects like Fedora Linux, which [represent much more than code itself][2], are the game-changers we need. Already, individuals, organizations, governments, and Open Source communities, including the Fedora Project’s own, are working to make sure the potential of Open Source is realized and equipped to take on the monumental challenges being faced. + +The Digital Public Goods Alliance is a multi-stakeholder initiative, endorsed by the United Nations Secretary-General. It works to accelerate the attainment of the SDGs in low- and middle-income countries by facilitating the discovery, development, use of, and investment in digital public goods (DPGs). DPGs are Open Source software, open data, open AI models, open standards, and open content that adhere to privacy and other applicable best practices, and do no harm. This definition, drawn from the UN Secretary-General’s [2020 Roadmap for Digital Cooperation][5], serves as the foundation of the DPG Registry, an online repository for DPGs.  + +The DPG Registry was created to help increase the likelihood of discovery, and therefore use of, DPGs. Today, we are excited to share that Fedora Linux was added to the [DPG Registry][6]! Recognition as a DPG increases the visibility, support for, and prominence of open projects that have the potential to tackle global challenges. To become a digital public good, all projects are required to meet the [DPG Standard][7] to ensure they truly encapsulate Open Source principles.  + +As an Open Source leader, Fedora Linux can make achieving the SDGs a reality through its role as a convener of many Open Source “upstream” communities. In addition to providing a fully-featured desktop, server, cloud, and container operating system, it also acts as a platform where different Open Source software and work come together. Fedora Linux by default only ships its releases with purely Open Source software packages and components. While third-party repositories are available for use with proprietary packages or closed components, Fedora Linux is a complete offering with some of the greatest innovations that Open Source has to offer. Collectively this means Fedora Linux can act as a gateway, empowering the creation of more and better solutions to better tackle the challenges they are trying to address. + +The DPG designation also aligns with Fedora’s fundamental foundations: + + * **Freedom**: Fedora Linux was built as Free and Open Source Software from the beginning. Fedora Linux only ships and distributes Free Software from its default repositories. Fedora Linux already uses widely-accepted Open Source licenses. + * **Friends**: Fedora has an international community of hundreds spread across six continents. The Fedora Community is strong and well-positioned to scale as the upstream distribution of the world’s most-widely used enterprise flavor of Linux. + * **Features**: Fedora consistently delivers on innovation and features in Open Source. Fedora Linux 34 was a record-breaking release, with 63 new approved Changes in the last release. + * **First**: Fedora leverages its unique position and resources in the Free Software world to deliver on innovation. New ideas and features are tried out in the Fedora Community to discover what works, and what doesn’t. We have many stories of both. + + + +![][8] + +For us, recognition as a digital public good brings honor and is a great moment for us, as a community, to reaffirm our commitment to contribute and grow the Open Source ecosystem. + +This is a proud moment for each Fedora Community member because we are making a difference. Our work matters and has value in creating an equitable world; this is a fantastic and important feeling. + +If you have an interest in learning more about the Digital Public Goods Alliance please reach out to [hello@digitalpublicgoods.net][9]. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/fedora-linux-earns-recognition-from-the-digital-public-goods-alliance-as-a-dpg/ + +作者:[Justin W. FloryAlberto Rodriguez SanchezMatthew Miller][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/jflory7/https://fedoramagazine.org/author/bt0dotninja/https://fedoramagazine.org/author/mattdm/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2021/09/DPG_recognition-816x345.jpg +[2]: https://docs.fedoraproject.org/en-US/project/ +[3]: https://digitalpublicgoods.net/frequently-asked-questions/ +[4]: https://sdgs.un.org/goals +[5]: https://www.un.org/en/content/digital-cooperation-roadmap/ +[6]: http://digitalpublicgoods.net/registry/ +[7]: http://digitalpublicgoods.net/standard/ +[8]: https://lh6.googleusercontent.com/lzxUQ45O79-kK_LHsokEChsfMCyAz4fpTx1zEaj6sN_-IiJp5AVqpsISdcxvc8gFCU-HBv43lylwkqjItSm1X1rG_sl9is1ou9QbIUpJTGyzr4fQKWm_QujF55Uyi-hRrta1M9qB=s0 +[9]: mailto:hello@digitalpublicgoods.net From 87c9578dc7ec096c58c283cd522ceb6edce2da36 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Sep 2021 05:03:42 +0800 Subject: [PATCH 0490/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210924?= =?UTF-8?q?=20An=20open=20source=20alternative=20to=20Microsoft=20Exchange?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210924 An open source alternative to Microsoft Exchange.md --- ...ource alternative to Microsoft Exchange.md | 80 +++++++++++++++++++ 1 file changed, 80 insertions(+) create mode 100644 sources/tech/20210924 An open source alternative to Microsoft Exchange.md diff --git a/sources/tech/20210924 An open source alternative to Microsoft Exchange.md b/sources/tech/20210924 An open source alternative to Microsoft Exchange.md new file mode 100644 index 0000000000..3e587c7e56 --- /dev/null +++ b/sources/tech/20210924 An open source alternative to Microsoft Exchange.md @@ -0,0 +1,80 @@ +[#]: subject: "An open source alternative to Microsoft Exchange" +[#]: via: "https://opensource.com/article/21/9/open-source-groupware-grommunio" +[#]: author: "Markus Feilner https://opensource.com/users/mfeilner" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +An open source alternative to Microsoft Exchange +====== +Open source users now have a robust and fully functional choice for +groupware. +![Working on a team, busy worklife][1] + +Microsoft Exchange has for many years been nearly unavoidable as a platform for groupware environments. Late in 2020, however, an Austrian open source software developer introduced [grommunio][2], a groupware server and client with a look and feel familiar to Exchange and Outlook users. + +The grommunio project functions well as a drop-in replacement for Exchange. The developers connect components to the platform the same way Microsoft does, and they support RPC (Remote Procedure Call) with the HTTP protocol. According to the developers, grommunio also includes numerous interfaces of common groupware such as IMAP, POP3, SMTP, EAS (Exchange ActiveSync), EWS (Exchange Web Services), CalDAV, and CardDAV. With such broad support, grommunio integrates smoothly into existing infrastructures. + +Users will notice little difference among Outlook, Android, and iOS clients. Of course, as open source software, it supports other clients, too. Outlook and smartphones communicate with grommunio just as they do with a Microsoft Exchange server, thanks to their integrated, native Exchange protocols. An everyday enterprise user can continue to use their existing clients with the grommunio server quietly running in the background. + +### More than just mail + +In addition to mail functions, a calendaring system is available in the grommunio interface. Appointments can be created by clicking directly in the calendar display or in a new tab. It's intuitive and just what you'd expect from a modern tool. Users can create, manage, and share calendars as well as address books. Private contacts or common contacts are possible, and you can share everything with colleagues. + +Task management shows a list of tasks on the left in a drop-down menu, and they can have both one owner and multiple collaborators. You can assign deadlines, categories, attachments, and other attributes to each task. In the same way, notes can be managed and shared with other team members. + +### Chat, video conferences, and file sync + +In addition to all the standard features of modern groupware, grommunio also offers chat, video conferencing, and file synchronization. It does this with full integration on a large scale for the enterprise, with extraordinarily high performance. It's an easy choice for promoters of open source and a powerful option for sysadmins. Because grommunio aims to integrate rather than reinvent, all components are standard open source tools. + +![Screenshot of grommunio meeting space][3] + +Jitsi integration for advanced video conferences (Markus Feilner, [CC BY-SA 4.0][4]) + +Behind the meeting function in grommunio is [Jitsi][5], smoothly integrated into the grommunio UI with a familiar user interface. The chat feature, fully integrated and centrally managed, is based on [Mattermost][6]. + +![Screenshot of grommunio's town square for chat][7] + +Mattermost for chat (Markus Feilner, [CC BY-SA 4.0][4]) + +[ownCloud][8], which promises enterprise-level file sharing and synchronization, starts after a click on the Files button. + +![Screenshot of grommunio file sharing space][9] + +ownCloud for file synchronization and exchange (Markus Feilner, [CC BY-SA 4.0][4]) + +The grommunio project has a powerful administrative interface, including roles, domain and organization management, predictive monitoring, and a self-service portal. Shell-based wizards guide admins through installation and migration of data from Microsoft Exchange. The development team is constantly working for better integration and more centralization for management, and with that comes a better workflow for admins. + +![Screenshot of grommunio dashboards][10] + +grommunio's admin interface (Markus Feilner, [CC BY-SA 4.0][4]) + +### Explore grommunio + +The grommunio project has lofty goals, but its developers have put in the work, and it shows. A German hosting service specializing in tax consultants—a sector where German data protection laws are especially tough—recently announced that grommunio is available to their customers. The grommunio project gets a lot right: a clean combination of existing, successful concepts working together to enable open, secure, and privacy-compliant communication. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/open-source-groupware-grommunio + +作者:[Markus Feilner][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/mfeilner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) +[2]: https://grommunio.com/en/ +[3]: https://opensource.com/sites/default/files/uploads/jitsi_0.png (grommunio meeting space) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/article/20/5/open-source-video-conferencing +[6]: https://opensource.com/education/16/3/mattermost-open-source-chat +[7]: https://opensource.com/sites/default/files/uploads/mattermost.png (grommunio's town square for chat) +[8]: https://owncloud.com/ +[9]: https://opensource.com/sites/default/files/uploads/owncloud_0.png (Owncloud for file synchronization and exchange) +[10]: https://opensource.com/sites/default/files/uploads/grommunio_interface_0.png (Screenshot of grommunio dashboards) From 25bd8c3829ce3b4638b2cd20a11a359fe079e1b2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 25 Sep 2021 05:06:28 +0800 Subject: [PATCH 0491/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210924?= =?UTF-8?q?=20Linux=20Gamers=20Can=20Finally=20Play=20Games=20like=20Apex?= =?UTF-8?q?=20Legends,=20Fortnite,=20Thanks=20to=20Easy=20Anti-Cheat=20Sup?= =?UTF-8?q?port?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md --- ...nite, Thanks to Easy Anti-Cheat Support.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md diff --git a/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md b/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md new file mode 100644 index 0000000000..17228c449b --- /dev/null +++ b/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md @@ -0,0 +1,84 @@ +[#]: subject: "Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support" +[#]: via: "https://news.itsfoss.com/easy-anti-cheat-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support +====== + +Linux gamers, this is big news! + +Epic Games adds complete Linux support for its Easy-Anti Cheat service, along with official [SteamPlay][1] (or Proton) and Wine compatibility. + +Even though we expected this to happen sometime in the future, the introduction of Steam Deck changed the scene for [gaming on Linux][2]. + +If you aren’t aware, Steam Deck is powered by Linux, which is why Epic Games was interested in expanding support to the Linux platform. + +So, safe to say, if it wasn’t for Valve’s effort with Steam Deck, the chances of getting Easy Anti-Cheat support on Linux were not good. + +### Multiplayer Gamers Can Consider Switching to Linux + +With [Easy Anti-Cheat][3] support, many popular multiplayer titles like Apex Legends, Fortnite, Tom Clancy’s Division 2, Rust, and many other games should work flawlessly on Linux. + +As per the announcement by Epic Games: + +> Starting with the latest SDK release, developers can activate anti-cheat support for Linux via Wine or Proton with just a few clicks in the Epic Online Services Developer Portal. + +So, it may take a while for developers to activate the anti-cheat support for various games. But, it should be a green signal for most of the games with Easy Anti-Cheat. + +One less reason to [dual-boot Windows with Linux][4]. + +Apex Legends is one of the multiplayer titles I like. And, I had to use Windows to do that. Hopefully, that changes soon, and I get to try it on Linux in the coming weeks! + +Similarly, if you were nearly making a switch to Linux but held back for its compatibility issues with games, I’d say that’s halfway resolved! + +Sure, we still need the official support for BattleEye, other anti-cheat services, and game clients. But, this is a start. + +### Steam Deck is Now a Compelling Choice for Gaming + +While many were unsure of Steam Deck’s support for all AAA games, this should improve things! + +[Steam Deck][5] should now be an easy choice for multiplayer gamers. + +### Wrapping Up + +If Steam Deck steals the spotlight as a successful handheld gaming console, Linux gaming is going to change as we know it! + +And, I think Epic Games adding Linux support to its anti-cheat service is just the beginning. + +Maybe, we’ll never have to refer [ProtonDB][6] to play a Windows-only game on Linux; who knows? But, the future of Linux gaming seems promising right after this. + +If you are a developer, you might want to go through the [announcement][7] to get the latest SDK. + +_What do you think about Epic Games bringing Easy Anti-Cheat to Linux? Feel free to 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/easy-anti-cheat-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://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/steam-play/ +[2]: https://itsfoss.com/linux-gaming-guide/ +[3]: https://www.easy.ac/en-us/ +[4]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[5]: https://www.steamdeck.com/en/ +[6]: https://www.protondb.com +[7]: https://dev.epicgames.com/en-US/news/epic-online-services-launches-anti-cheat-support-for-linux-mac-and-steam-deck From c8a1eb0d122f714e99dbe4562d05c4025cc585bb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Sep 2021 08:41:49 +0800 Subject: [PATCH 0492/1588] PUB @wxy @turbokernel https://linux.cn/article-13817-1.html --- ...Install Ubuntu Desktop on Raspberry Pi 4.md | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) rename {translated/tech => published}/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md (92%) diff --git a/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md b/published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md similarity index 92% rename from translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md rename to published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md index 1f3f4e4197..9fa29a3b4e 100644 --- a/translated/tech/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md +++ b/published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md @@ -4,14 +4,16 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13817-1.html" 如何在树莓派 4 上安装 Ubuntu 桌面系统 ====== > 本教程将详细告诉你在树莓派 4 设备上如何安装 Ubuntu 桌面。 +![](https://img.linux.net.cn/data/attachment/album/202109/25/084015z4cfiiy8e1ezmmz0.jpg) + 革命性的树莓派Raspberry Pi是最受欢迎的单板计算机。它拥有基于 Debian 的操作系统,叫做 [树莓派操作系统][1]Raspberry Pi OS(原名 Raspbian)。 还有其他几个 [可用于树莓派的操作系统][2],但几乎所有的都是轻量级的,适合于树莓派设备的小尺寸和低端硬件。 @@ -38,7 +40,7 @@ 最好能够提前 [详细阅读树莓派的要求][8] 。 -现在,不再拖延了,让我快速带领你完成 SD 卡的镜像准备。 +现在,闲话少叙,让我快速带领你完成 SD 卡的镜像准备。 ### 为树莓派准备 Ubuntu 桌面镜像 @@ -80,7 +82,7 @@ sudo snap install rpi-imager ![镜像工具:选择存储设备(SD 卡)][16] 。 -你应该根据存储空间大小,识别你的 Micro SD 卡。这里,我使用的是 32GB 的卡: +你应该可以根据存储空间大小,识别你的 Micro SD 卡。这里,我使用的是 32GB 的卡: ![镜像工具:选择 SD 卡][17] @@ -92,11 +94,11 @@ sudo snap install rpi-imager ![镜像工具:镜像写入确认][19] -由于这是一个 [sudo][20] 的权限,你必须输入密码。如果你从终端运行 `sudo rpi-imager`,就不会出现这种情况: +由于这需要 [sudo][20] 的权限,你必须输入密码。如果你从终端运行 `sudo rpi-imager`,就不会出现这种情况: ![镜像工具:镜像写入授权需要密码][21] -如果你的 SD 卡有点旧,这将需要一些时间。但是,如果它是一个新的高速的 SD 卡,就无需很长时间: +如果你的 SD 卡有点旧,这将需要一些时间。如果它是一个新的高速 SD 卡,就无需很长时间: ![镜像工具:写入镜像][22] @@ -110,9 +112,9 @@ sudo snap install rpi-imager 现在,从你的系统中安全移除 SD 卡。 -###在树莓派上使用装有 Ubuntu 的 MicroSD 卡 +### 在树莓派上使用装有 Ubuntu 的 MicroSD 卡 -战斗的一半已经胜利了。与常规的 Ubuntu 安装不同,无需创建一个临时安装环境。Ubuntu 已经安装在 SD 卡上了,而且几乎可以直接使用了。让我们来看看这里还剩下什么。 +已经成功了一半了。与常规的 Ubuntu 安装不同,无需创建一个临场安装环境。Ubuntu 已经安装在 SD 卡上了,而且几乎可以直接使用了。让我们来看看这里还剩下什么。 #### 第 1 步:将 SD 卡插入树莓派中 From 1fd7fb3c5880285409079ddb7b10aea1dd259984 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Sep 2021 08:53:55 +0800 Subject: [PATCH 0493/1588] PRF --- .../20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md b/published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md index 9fa29a3b4e..809d57ea63 100644 --- a/published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md +++ b/published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md @@ -80,7 +80,7 @@ sudo snap install rpi-imager 将 Micro SD 卡插入读卡器中,等待它挂载。选择“存储设备Storage”下的 “选择存储设备CHOOSE STORAGE”: -![镜像工具:选择存储设备(SD 卡)][16] 。 +![镜像工具:选择存储设备(SD 卡)][16] 你应该可以根据存储空间大小,识别你的 Micro SD 卡。这里,我使用的是 32GB 的卡: From 7ca2f12504c39bc0dfbd9791c1b3deb4d8a041dc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Sep 2021 16:04:42 +0800 Subject: [PATCH 0494/1588] APL --- ...Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md b/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md index 17228c449b..29fb1135b9 100644 --- a/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md +++ b/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/easy-anti-cheat-linux/" [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 2f436c79ee95d79c89e8a763c543a2c1de23825e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Sep 2021 16:45:03 +0800 Subject: [PATCH 0495/1588] TSL&PRF --- ...nite, Thanks to Easy Anti-Cheat Support.md | 60 +++++++++---------- 1 file changed, 29 insertions(+), 31 deletions(-) diff --git a/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md b/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md index 29fb1135b9..59b55b247f 100644 --- a/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md +++ b/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md @@ -3,64 +3,62 @@ [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support +Linux 玩家终于可以玩《Apex Legends》、《Fortnite》等游戏了 ====== -Linux gamers, this is big news! +> 如果你是一个狂热的多人游戏玩家,你将能够玩到《Apex Legends》和《Fortnite》这样的热门游戏。但是,你可能需要等待一段时间。 -Epic Games adds complete Linux support for its Easy-Anti Cheat service, along with official [SteamPlay][1] (or Proton) and Wine compatibility. +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/easy-anti-cheat-linux.png?w=1200&ssl=1) -Even though we expected this to happen sometime in the future, the introduction of Steam Deck changed the scene for [gaming on Linux][2]. +Linux 玩家们,这可是个大新闻啊! -If you aren’t aware, Steam Deck is powered by Linux, which is why Epic Games was interested in expanding support to the Linux platform. +Epic Games 为其“简易反作弊”服务增加了完整的 Linux 支持,官方提供了兼容 [SteamPlay][1](或 Proton)和 Wine 兼容性。 -So, safe to say, if it wasn’t for Valve’s effort with Steam Deck, the chances of getting Easy Anti-Cheat support on Linux were not good. +尽管我们预计这将在未来的某个时候发生,但 Steam Deck 的引入改变了 [在 Linux 上玩游戏][2] 的场景。 -### Multiplayer Gamers Can Consider Switching to Linux +你可能知道,Steam Deck 是由 Linux 驱动的,这就是为什么 Epic Games 有兴趣扩大对 Linux 平台的支持。 -With [Easy Anti-Cheat][3] support, many popular multiplayer titles like Apex Legends, Fortnite, Tom Clancy’s Division 2, Rust, and many other games should work flawlessly on Linux. +因此,可以说,如果不是 Valve 在 Steam Deck 上的努力,在 Linux 上获得“简易反作弊”支持的机会并不乐观。 -As per the announcement by Epic Games: +### 多人游戏玩家可以考虑转到 Linux 上了 -> Starting with the latest SDK release, developers can activate anti-cheat support for Linux via Wine or Proton with just a few clicks in the Epic Online Services Developer Portal. +有了 [简易反作弊][3] 的支持,许多流行的多人游戏,如《Apex Legends》、《Fortnite》、《Tom Clancy's Division 2》、《Rust》 和其他许多游戏应该可以在 Linux 上完美地运行了。 -So, it may take a while for developers to activate the anti-cheat support for various games. But, it should be a green signal for most of the games with Easy Anti-Cheat. +根据 Epic Games 的公告: -One less reason to [dual-boot Windows with Linux][4]. +> 从最新的 SDK 版本开始,开发者只需在 Epic 在线服务开发者门户点击几下,就可以通过 Wine 或 Proton 激活对 Linux 的反作弊支持。 -Apex Legends is one of the multiplayer titles I like. And, I had to use Windows to do that. Hopefully, that changes soon, and I get to try it on Linux in the coming weeks! +因此,开发人员可能需要一段时间来激活对各种游戏的反作弊支持。但是,对于大多数带有简易反作弊功能的游戏来说,这应该是一个绿色信号。 -Similarly, if you were nearly making a switch to Linux but held back for its compatibility issues with games, I’d say that’s halfway resolved! +少了一个 [Windows 与 Linux 双启动][4] 的理由。 -Sure, we still need the official support for BattleEye, other anti-cheat services, and game clients. But, this is a start. +《Apex Legends》 是我喜欢的多人游戏之一。而且,我不得不使用 Windows 来玩这个游戏。希望这种情况很快就会改变,在未来几周内,我可以在 Linux 上试一试! -### Steam Deck is Now a Compelling Choice for Gaming +同样,如果你几乎就要转到 Linux 了,但因为它与游戏的兼容性问题而迟疑,我想说问题已经解决了一半了! -While many were unsure of Steam Deck’s support for all AAA games, this should improve things! +当然,我们仍然需要对 BattleEye、其他反作弊服务和游戏客户端的官方支持。但是,这是个开端。 -[Steam Deck][5] should now be an easy choice for multiplayer gamers. +### Steam Deck 现在是一个令人信服的游戏选择 -### Wrapping Up +虽然许多人不确定 Steam Deck 是否支持所有的 AAA 级游戏,但这应该会有所改善! -If Steam Deck steals the spotlight as a successful handheld gaming console, Linux gaming is going to change as we know it! +[Steam Deck][5] 现在应该是多人游戏玩家的一个简单选择。 -And, I think Epic Games adding Linux support to its anti-cheat service is just the beginning. +### 总结 -Maybe, we’ll never have to refer [ProtonDB][6] to play a Windows-only game on Linux; who knows? But, the future of Linux gaming seems promising right after this. +如果 Steam Deck 作为一个成功的掌上游戏机而成为了焦点,那么正如我们所知,在 Linux 上玩游戏也将发生改变。 -If you are a developer, you might want to go through the [announcement][7] to get the latest SDK. +而且,我认为 Epic Games 在其反作弊服务中加入 Linux 支持仅仅只是一个开始。 -_What do you think about Epic Games bringing Easy Anti-Cheat to Linux? Feel free to share your thoughts in the comments down below._ +也许,我们永远都不用借助 [ProtonDB][6] 来在 Linux 上玩一个只有 Windows 支持的游戏;谁知道呢?但是,在这之后,Linux 游戏的未来似乎充满希望。 -#### Big Tech Websites Get Millions in Revenue, It's FOSS Got You! +如果你是一个开发者,你可能想阅读 [该公告][7] 来获得最新的 SDK。 -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 +你对 Epic Games 将简易反作弊引入 Linux 有何看法?欢迎在下面的评论中分享你的想法。 -------------------------------------------------------------------------------- @@ -68,8 +66,8 @@ via: https://news.itsfoss.com/easy-anti-cheat-linux/ 作者:[Ankush Das][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 89039d55963d4c292b34bd9144a208a0ba28a896 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Sep 2021 16:46:54 +0800 Subject: [PATCH 0496/1588] TSL&PRF --- ...ex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {sources => translated}/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md (98%) diff --git a/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md b/translated/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md similarity index 98% rename from sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md rename to translated/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md index 59b55b247f..c2728027ce 100644 --- a/sources/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md +++ b/translated/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13821-1.html" Linux 玩家终于可以玩《Apex Legends》、《Fortnite》等游戏了 ====== From 4b795f5fff6c625c9bbeed1c7081ed8a8e399265 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 25 Sep 2021 16:49:02 +0800 Subject: [PATCH 0497/1588] PUB @wxy https://linux.cn/article-13821-1.html --- ...e Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/news => published}/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md (100%) diff --git a/translated/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md b/published/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md similarity index 100% rename from translated/news/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md rename to published/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md From 11bfa8686d6a7c0816338a5059323f2777eacf42 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sat, 25 Sep 2021 22:34:04 +0800 Subject: [PATCH 0498/1588] finish translation --- ...memory safety and efficiency by example.md | 708 ------------------ ...memory safety and efficiency by example.md | 666 ++++++++++++++++ 2 files changed, 666 insertions(+), 708 deletions(-) delete mode 100644 sources/tech/20210813 Code memory safety and efficiency by example.md create mode 100644 translated/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 deleted file mode 100644 index 6d4c2f05f9..0000000000 --- a/sources/tech/20210813 Code memory safety and efficiency by example.md +++ /dev/null @@ -1,708 +0,0 @@ -[#]: 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: "unigeorge" -[#]: 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] -译者:[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/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/ diff --git a/translated/tech/20210813 Code memory safety and efficiency by example.md b/translated/tech/20210813 Code memory safety and efficiency by example.md new file mode 100644 index 0000000000..314853622a --- /dev/null +++ b/translated/tech/20210813 Code memory safety and efficiency by example.md @@ -0,0 +1,666 @@ +[#]: 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: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +实例讲解代码之内存安全与效率 +====== + +了解有关内存安全和效率的更多信息。 +![Code going into a computer.][1] + +C 是一种高级语言,同时具有“接近金属”(LCTT 译注:即“接近人类思维方式”的反义词)的特性,这使得它有时看起来更像是一种可移植的汇编语言,而不是 Java 或 Python 的兄弟语言。内存管理作为上述特性之一,涵盖了正在执行的程序对内存的安全和高效使用。本文通过 C 语言代码示例,以及现代 C 语言编译器生成的汇编语言代码段,详细介绍了内存安全性和效率。 + +尽管代码示例是用 C 语言编写的,但安全高效的内存管理指南对于 C++ 是同样适用的。这两种语言在很多细节上有所不同(例如,C++ 具有 C 所缺乏的面向对象特性和泛型),但在内存管理方面面临的挑战是一样的。 + +### 执行中程序的内存概述 + +对于正在执行的程序(又名 _进程process_),内存被划分为三个区域:**stack**、**heap** 和 **静态区static area**。下文会给出每个区域的概述,以及完整的代码示例。 + +作为通用 CPU 寄存器的替补,_栈_ 为代码块(例如函数或循环体)中的局部变量提供暂存器存储。传递给函数的参数在此上下文中也视作局部变量。看一下下面这个简短的示例: + +``` +void some_func(int a, int b) { +   int n; +   ... +} +``` + +通过 **a** 和 **b** 传递的参数以及局部变量 **n** 的存储会在栈中,除非编译器可以找到通用寄存器。编译器倾向于优先将通用寄存器用作暂存器,因为 CPU 对这些寄存器的访问速度很快(一个时钟周期)。然而,这些寄存器在台式机、笔记本电脑和手持机器的标准架构上很少(大约 16 个)。 + +在只有汇编语言程序员才能看到的实施层面,栈被组织为具有 **push**(插入)和 **pop**(删除)操作的 LIFO(后进先出)列表。 **top** 指针可以作为偏移的基地址;这样,除了 **top** 之外的栈位置也变得可访问了。例如,表达式 **top+16** 指向堆栈的 **top** 指针上方 16 个字节的位置,表达式 **top-16** 指向 **top** 指针下方 16 个字节的位置。因此,可以通过 **top** 指针访问实现了暂存器存储的栈的位置。在标准的 ARM 或 Intel 架构中,栈从高内存地址增长到低内存地址;因此,减小某进程的 **top** 就是增大其栈规模。 + +使用栈结构就意味着轻松高效地使用内存。编译器(而非程序员)会编写管理栈的代码,管理过程通过分配和释放所需的暂存器存储来实现;程序员声明函数参数和局部变量,将实现过程交给编译器。此外,完全相同的栈存储可以在连续的函数调用和代码块(如循环)中重复使用。精心设计的模块化代码会将栈存储作为暂存器的首选内存选项,同时优化编译器要尽可能使用通用寄存器而不是栈。 + +**堆** 提供的存储是通过程序员代码显式分配的,堆分配的语法因语言而异。在 C 中,成功调用库函数 **malloc**(或其变体 **calloc** 等)会分配指定数量的字节(在 C++ 和 Java 等语言中,**new** 运算符具有相同的用途)。编程语言在如何释放堆分配的存储方面有着巨大的差异: + + * 在 Java、Go、Lisp 和 Python 等语言中,程序员不会显式释放动态分配的堆存储。 + +例如,下面这个 Java 语句为一个字符串分配了堆存储,并将这个堆存储的地址存储在变量 **greeting** 中: + + +``` +String greeting = new String("Hello, world!"); +``` + +Java 有一个垃圾回收器,它是一个运行时实用程序,如果进程无法再访问自己分配的堆存储,回收器可以使其自动释放。因此,Java 堆释放是通过垃圾收集器自动进行的。在上面的示例中,垃圾收集器将在变量 **greeting** 超出作用域后,释放字符串的堆存储。 + + * Rust 编译器会编写堆释放代码。这是 Rust 在不依赖垃圾回收器的情况下,使堆释放实现自动化的开创性努力,但这也会带来运行时复杂性和开销。向 Rust 的努力致敬! + * 在 C(和 C++)中,堆释放是程序员的任务。程序员调用 **malloc** 分配堆存储,然后负责相应地调用库函数 **free** 来释放该存储空间(在 C++ 中,**new** 运算符分配堆存储,而 **delete** 和 **delete[]** 运算符释放此类存储)。下面是一个 C 语言代码示例: + +``` +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 语言避免了垃圾回收器的成本和复杂性,但也不过是让程序员承担了堆释放的任务。 + +内存的 **静态区** 为可执行代码(例如 C 语言函数)、字符串文字(例如“Hello, world!”)和全局变量提供存储空间: + +``` +int n;                       /* global variable */ +int main() {                 /* function */ +   char* msg = "No comment"; /* string literal */ +   ... +} +``` + +该区域是静态的,因为它的大小从进程执行开始到结束都固定不变。由于静态区相当于进程固定大小的内存占用,因此经验法则是通过避免使用全局数组等方法来使该区域尽可能小。 + +下文会结合代码示例对本节概述展开进一步讲解。 + +### 栈存储 + +想象一个有各种连续执行的任务的程序,任务包括了处理每隔几分钟通过网络下载并存储在本地文件中的数字数据。下面的 **stack** 程序简化了处理流程(仅是将奇数整数值转换为偶数),而将重点放在栈存储的好处上。 + + +``` +#include +#include + +#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(infile, "r"); +  if (NULL == infile) return; +  FILE* output = fopen(outfile, "w"); +  if (NULL == output) { +    fclose(input); +    return; +  } + +  fread(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(input);               /* close input file */ + +  fwrite(nums, n, sizeof(int), output); +  fclose(output); +} + +int main() { +  process_data(Infile, Outfile, IntCount); +   +  /** now perform other tasks **/ +  other_task1(); /* automatically released stack storage available */ +  other_task2(); /* ditto */ +   +  return 0; +} +``` + +底部的 **main** 函数首先调用 **process_data** 函数,该函数会创建一个基于栈的数组,其大小由参数 **n** 给定(当前示例中为 128,000)。因此,该数组占用 128,000 x **sizeof(int)** 个字节,在标准设备上达到了 512,000 字节(**int** 在这些设备上是四个字节)。然后数据会被读入数组(使用库函数 **fread**),循环处理,并保存到本地文件 **outgoing.dat**(使用库函数**fwrite**)。 + +当 **process_data** 函数返回到其调用者 **main** 函数时,**process_data** 函数的大约 500MB 栈暂存器可供 **stack** 程序中的其他函数用作暂存器。在此示例中,**main** 函数接下来调用存根函数 **other_task1** 和 **other_task2**。这三个函数在 **main** 中依次调用,这意味着所有三个函数都可以使用相同的堆栈存储作为暂存器。因为编写栈管理代码的是编译器而不是程序员,所以这种方法对程序员来说既高效又容易。 + +在 C 语言中,在块(例如函数或循环体)内定义的任何变量默认都有一个 **auto** 存储类,这意味着该变量是基于栈的。存储类 **register** 现在已经过时了,因为 C 编译器会主动尝试尽可能使用 CPU 寄存器。只有在块内定义的变量可能是 **register**,如果没有可用的 CPU 寄存器,编译器会将其更改为 **auto**。基于栈的编程可能是不错的首选方式,但这种风格确实有一些挑战性。下面的 **badStack** 程序说明了这点。 + +``` +#include ; + +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("%i ", ptr[i]); +  puts("\n"); + +  return 0; +} +``` + +**badStack** 程序中的控制流程很简单。**main** 函数使用 16(LCTT译注:原文为 128,应为作者笔误)作为参数调用函数 **get_array**,然后被调用函数会使用传入参数来创建对应大小的本地数组。**get_array** 函数会初始化数组并返回给 **main** 中的数组标识符 **arr**。 **arr** 是一个指针常量,保存数组的第一个 **int** 元素的地址。 + +当然,本地数组 **arr** 可以在 **get_array** 函数中访问,但是一旦 **get_array** 返回,就不能合法访问该数组。尽管如此,**main** 函数会尝试使用函数 **get_array** 返回的堆栈地址 **arr** 来打印基于栈的数组。现代编译器会警告错误。例如,下面是来自 GNU 编译器的警告: + +``` +badStack.c: In function 'get_array': +badStack.c:9:10: warning: function returns address of local variable [-Wreturn-local-addr] +return arr;  /** ERROR **/ +``` + +一般规则是,如果使用栈存储实现局部变量,应该仅在该变量所在的代码块内,访问这块基于栈的存储(在本例中,数组指针 **arr** 和循环计数器 **i** 均为这样的局部变量)。因此,函数永远不应该返回指向基于栈存储的指针。 + +### 堆存储 + +接下来使用若干代码示例凸显在 C 语言中使用堆存储的优点。在第一个示例中,使用了最优方案分配、使用和释放堆存储。第二个示例(在下一节中)将堆存储嵌套在了其他堆存储中,这会使其释放操作变得复杂。 + +``` +#include +#include + +int* get_heap_array(unsigned n) { +  int* heap_nums = malloc(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(stderr, "%s\n", "malloc(...) failed..."); +  else { +    for (i = 0; i < n; i++) printf("%i\n", heap_nums[i]); +    free(heap_nums); /* free the heap storage */ +  } +  return 0;  +} +``` + +上面的 **heap** 程序有两个函数: **main** 函数使用参数(示例中为 100)调用 **get_heap_array** 函数,参数用来指定数组应该有多少个 **int** 元素。因为堆分配可能会失败,**main** 函数会检查 **get_heap_array** 是否返回了 **NULL**;如果是,则表示失败。如果分配成功,**main** 将打印数组中的 **int** 值,然后立即调用库函数 **free** 来对堆存储解除分配。这就是最优的方案。 + +**get_heap_array** 函数以下列语句开头,该语句值得仔细研究一下: + +``` +int* heap_nums = malloc(sizeof(int) * n); /* heap allocation */ +``` + +**malloc** 库函数及其变体函数针对字节进行操作;因此,**malloc** 的参数是 **n** 个 **int** 类型元素所需的字节数(**sizeof(int)** 在标准现代设备上是四个字节)。**malloc** 函数返回所分配字节段的首地址,如果失败则返回 **NULL** . + +如果成功调用 **malloc**,在现代台式机上其返回的地址大小为 64 位。在手持设备和早些时候的台式机上,该地址的大小可能是 32 位,或者甚至更小,具体取决于其年代。堆分配数组中的元素是 **int** 类型,这是一个四字节的有符号整数。这些堆分配的 **int** 的地址存储在基于栈的局部变量 **heap_nums** 中。可以参考下图: + +``` +                 heap-based + stack-based        / +     \        +----+----+   +----+ + heap-nums--->|int1|int2|...|intN| +              +----+----+   +----+ +``` + +一旦 **get_heap_array** 函数返回,指针变量 **heap_nums** 的栈存储将自动回收——但动态 **int** 数组的堆存储仍然存在,这就是 **get_heap_array** 函数返回这个地址(的副本)给 **main** 函数的原因:它现在负责在打印数组的整数后,通过调用库函数 **free** 显式释放堆存储: + +``` +free(heap_nums); /* free the heap storage */ +``` + +**malloc** 函数不会初始化堆分配的存储空间,因此里面是随机值。相比之下,其变体函数 **calloc** 会将分配的存储初始化为零。这两个函数都返回 **NULL** 来表示分配失败。 + +在 **heap** 示例中,**main** 函数在调用 **free** 后会立即返回,正在执行的程序会终止,这会让系统回收所有已分配的堆存储。尽管如此,程序员应该养成在不再需要时立即显式释放堆存储的习惯。 + +### 嵌套堆分配 + +下一个代码示例会更棘手一些。C 语言有很多返回指向堆存储的指针的库函数。下面是一个常见的使用情景: + +1\. C 程序调用一个库函数,该函数返回一个指向基于堆的存储的指针,而指向的存储通常是一个聚合体,如数组或结构体: + +``` +SomeStructure* ptr = lib_function(); /* returns pointer to heap storage */ +``` + +2\. 然后程序使用所分配的存储。 + +3\. 对于清理而言,问题是对 **free** 的简单调用是否会清理库函数分配的所有堆分配存储。例如,**SomeStructure** 实例可能有指向堆分配存储的字段。一个特别麻烦的情况是动态分配的结构体数组,每个结构体有一个指向又一层动态分配的存储的字段。下面的代码示例说明了这个问题,并重点关注了如何设计一个可以安全地为客户端提供堆分配存储的库。 + +``` +#include +#include + +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(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(sizeof(float) * n); +  if (NULL == heap_struct->heap_nums) {  /* failure? */ +    free(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(heap_struct->heap_nums); /* first free encapsulated aggregate */ +  free(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("%12f\n", hs->heap_nums[i]); + +  free_all(hs); /* free dynamically allocated storage */ +   +  return 0; +} +``` + +上面的 **nestedHeap** 程序示例以结构体 **HeapStruct** 为中心,结构体中又有名为 **heap_nums** 的指针字段: + +``` +typedef struct { +  unsigned id; +  unsigned len; +  float*   heap_nums; /** pointer **/ +} HeapStruct; +``` + +函数 **get_heap_struct** 尝试为 **HeapStruct** 实例分配堆存储,这需要为字段 **heap_nums** 指向的若干个 **float** 变量分配堆存储。如果成功调用 **get_heap_struct** 函数,并将指向堆分配结构体的指针以 **hs** 命名,其结果可以描述如下: + +``` +hs-->HeapStruct instance +        id +        len +        heap_nums-->N contiguous float elements +``` + +在 **get_heap_struct** 函数中,第一个堆分配过程很简单: + +``` +HeapStruct* heap_struct = malloc(sizeof(HeapStruct)); +if (NULL == heap_struct) /* failure? */ +  return NULL;           /* if so, return NULL */ +``` + +**sizeof(HeapStruct)** 包括了 **heap_nums** 字段的字节数(32 位机器上为 4,64 位机器上为 8),**heap_nums** 字段则是指向动态分配数组中的 **float** 元素的指针。那么,问题关键在于 **malloc** 为这个结构体传送了字节空间还是表示失败的 **NULL**;如果是 **NULL**,**get_heap_struct** 函数就也返回 **NULL** 以通知调用者堆分配失败。 + +第二步尝试堆分配的过程更复杂,因为在这一步,**HeapStruct** 的堆存储已经分配好了: + +``` +heap_struct->heap_nums = malloc(sizeof(float) * n); +if (NULL == heap_struct->heap_nums) {  /* failure? */ +  free(heap_struct);                   /* if so, first free the HeapStruct */ +  return NULL;                         /* and then return NULL */ +} +``` + +传递给 **get_heap_struct** 函数的参数 **n** 指明动态分配的 **heap_nums** 数组中应该有多少个 **float** 元素。如果可以分配所需的若干个 **float** 元素,则该函数在返回 **HeapStruct** 的堆地址之前会设置结构的 **id** 和 **len** 字段。 但是,如果尝试分配失败,则需要两个步骤来实现最优方案: + +1\. 必须释放 **HeapStruct** 的存储以避免内存泄漏。对于调用 **get_heap_struct** 的客户端函数而言,没有动态 **heap_nums** 数组的 **HeapStruct** 可能就是没用的;因此,**HeapStruct** 实例的字节空间应该显式释放,以便系统可以回收这些空间用于未来的堆分配。 + +2\. 返回 **NULL** 以标识失败。 + +如果成功调用 **get_heap_struct** 函数,那么释放堆存储也很棘手,因为它涉及要以正确顺序进行的两次 **free** 操作。因此,该程序设计了一个 **free_all** 函数,而不是要求程序员再去手动实现两步释放操作。回顾一下,**free_all** 函数是这样的: + +``` +void free_all(HeapStruct* heap_struct) { +  if (NULL == heap_struct) /* NULL pointer? */ +    return;                /* if so, do nothing */ +   +  free(heap_struct->heap_nums); /* first free encapsulated aggregate */ +  free(heap_struct);            /* then free containing structure */   +} +``` + +检查完参数 **heap_struct** 不是 **NULL** 值后,函数首先释放 **heap_nums** 数组,这步要求 **heap_struct** 指针此时仍然是有效的。先释放 **heap_struct** 的做法是错误的。一旦 **heap_nums** 被释放,**heap_struct** 就可以释放了。如果 **heap_struct** 被释放,但 **heap_nums** 没有被释放,那么数组中的 **float** 元素就会泄漏:仍然分配了字节空间,但无法被访问到——因此一定要记得释放 **heap_nums**。存储泄漏将一直持续,直到 **nestedHeap** 程序退出,系统回收泄漏的字节时为止。 + +关于 **free** 库函数的注意事项就是要有顺序。回想一下上面的调用示例: + +``` +free(heap_struct->heap_nums); /* first free encapsulated aggregate */ +free(heap_struct);            /* then free containing structure */ +``` + +这些调用释放了分配的存储空间——但它们并 _不是_ 将它们的操作参数设置为 **NULL**(**free** 函数会获取地址的副本作为参数;因此,将副本更改为 **NULL** 并不会改变原地址上的参数值)。例如,在成功调用 **free** 之后,指针 **heap_struct** 仍然持有一些堆分配字节的堆地址,但是现在使用这个地址将会产生错误,因为对 **free** 的调用使得系统有权回收然后重用这些分配过的字节。 + +使用 **NULL** 参数调用 **free** 没有意义,但也没有什么坏处。而在非 **NULL** 的地址上重复调用 **free** 会导致不确定结果的错误: + +``` +free(heap_struct);  /* 1st call: ok */ +free(heap_struct);  /* 2nd call: ERROR */ +``` + +### 内存泄漏和堆碎片化 + +“内存泄漏”是指动态分配的堆存储变得不再可访问。看一下相关的代码段: + +``` +float* nums = malloc(sizeof(float) * 10); /* 10 floats */ +nums[0] = 3.14f;                          /* and so on */ +nums = malloc(sizeof(float) * 25);        /* 25 new floats */ +``` + +假如第一个 **malloc** 成功,第二个 **malloc** 会再将 **nums** 指针重置为 **NULL**(分配失败情况下)或是新分配的 25 个 **float** 中第一个的地址。最初分配的 10 个 **float** 元素的堆存储仍然处于被分配状态,但此时已无法再对其访问,因为 **nums** 指针要么指向别处,要么是 **NULL**。结果就是造成了 40 个字节 (**sizeof(float) * 10**) 的泄漏。 + +在第二次调用 **malloc** 之前,应该释放最初分配的存储空间: + +``` +float* nums = malloc(sizeof(float) * 10); /* 10 floats */ +nums[0] = 3.14f;                          /* and so on */ +free(nums);                               /** good **/ +nums = malloc(sizeof(float) * 25);        /* no leakage */ +``` + +即使没有泄漏,堆也会随着时间的推移而碎片化,需要对系统进行碎片整理。例如,假设两个最大的堆块当前的大小分别为 200MB 和 100MB。然而,这两个堆块并不连续,进程 **P** 此时又需要分配 250MB 的连续堆存储。在进行分配之前,系统可能要对堆进行 _碎片整理_ 以给 **P** 提供 250MB 连续存储空间。碎片整理很复杂,因此也很耗时。 + +内存泄漏会创建处于已分配状态但不可访问的堆块,从而会加速碎片化。因此,释放不再需要的堆存储是程序员帮助减少碎片整理需求的一种方式。 + +### 诊断内存泄漏的工具 + +有很多工具可用于分析内存效率和安全性,其中我最喜欢的是 [valgrind][11]。为了说明该工具如何处理内存泄漏,这里给出 **leaky** 示例程序: + +``` +#include +#include + +int* get_ints(unsigned n) { +  int* ptr = malloc(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("%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; +} +``` + +**main** 函数调用了 **get_ints** 函数,后者会试着从堆中 **malloc** 32 个 4 字节的 **int**,然后初始化动态数组(如果 **malloc** 成功)。初始化成功后,**main** 函数会调用 **print_ints**函数。程序中并没有调用 **free** 来对应 **malloc** 操作;因此,内存泄漏了。 + +如果安装了 **valgrind** 工具箱,下面的命令会检查 **leaky** 程序是否存在内存泄漏(**%** 是命令行提示符): + +``` +% valgrind --leak-check=full ./leaky +``` + +绝大部分输出都在下面给出了。左边的数字 207683 是正在执行的 **leaky** 程序的进程标识符。这份报告给出了泄漏发生位置的详细信息,本例中位置是在 **main** 函数所调用的 **get_ints** 函数中对 **malloc** 的调用处。 + +``` +==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 +``` + +如果把 **main** 函数改成在对 **print_ints** 的调用之后,再加上一个对 **free** 的调用,**valgrind** 就会对 **leaky** 程序给出一个干净的内存健康清单: + +``` +==218462== All heap blocks were freed -- no leaks are possible +``` + +### 静态区存储 + +在正统的 C 语言中,函数必须在所有块之外定义。这是一些 C 编译器支持的特性,杜绝了在另一个函数体内定义一个函数的可能。我举的例子都是在所有块之外定义的函数。这样的函数要么是 **static** 即静态的,要么是 **extern** 即外部的,其中 **extern** 是默认值。 + +C 语言中,以 **static** 或 **extern** 修饰的函数和变量驻留在内存中所谓的 **静态区** 中,因为在程序执行期间该区域大小是固定不变的。这两个存储类型的语法非常复杂,我们应该回顾一下。在回顾之后,会有一个完整的代码示例来生动展示语法细节。在所有块之外定义的函数或变量默认为 **extern**;因此,函数和变量要想存储类型为 **static** ,必须显式指定: + +``` +/** 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 */ +``` + +**extern** 和 **static** 的区别在于作用域:**extern** 修饰的函数或变量可以实现跨文件可见(需要声明)。相比之下,**static** 修饰的函数仅在 _定义_ 该函数的文件中可见,而 **static** 修饰的变量仅在 _定义_ 该变量的文件(或文件中的块)中可见: + +``` +static int n1;    /* scope is the file */ +void func() { +   static int n2; /* scope is func's body */ +   ... +} +``` + +如果在所有块之外定义了 **static** 变量,例如上面的 **n1**,该变量的作用域就是定义变量的文件。无论在何处定义 **static** 变量,变量的存储都在内存的静态区中。 + +**extern** 函数或变量在给定文件中的所有块之外定义,但这样定义的函数或变量也可以在其他文件中声明。典型的做法是在头文件中 _声明_ 这样的函数或变量,只要需要就可以包含进来。下面这些简短的例子阐述了这些棘手的问题。 + +假设 **extern** 函数 **foo** 在 **file1.c** 中 _定义_,有无关键字 **extern** 效果都一样: + +``` +/** file1.c **/ +int foo(int n) { return n * 2; } /* definition has a body {...} */ +``` + +必须在其他文件(或其中的块)中使用显式的 **extern** _声明_ 此函数才能使其可见。以下是使 **extern** 函数 **foo** 在文件 **file2.c** 中可见的声明语句: + +``` +/** file2.c: make function foo visible here **/ +extern int foo(int); /* declaration (no body) */ +``` + +回想一下,函数声明没有用大括号括起来的主体,而函数定义会有这样的主体。 + +为了便于查看,函数和变量声明通常会放在头文件中。准备好需要声明的源代码文件,然后就可以 **#include** 相关的头文件。下一节中的 **staticProg** 程序演示了这种方法。 + +至于 **extern** 的变量,规则就变得更棘手了(很抱歉增加了难度!)。任何 **extern** 的对象——无论函数或变量——必须 _定义_ 在所有块之外。此外,在所有块之外定义的变量默认为 **extern**: + +``` +/** outside all blocks **/ +int n; /* defaults to extern */ +``` + +但是,只有在变量的 _定义_ 中显式初始化变量时,**extern** 才能在变量的 _定义_ 中显式修饰(LCTT译注:换言之,如果下列代码中的 `int n1;` 行前加上 **extern**,该行就由 _定义_ 变成了 _声明_): + +``` +/** 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 */ +``` + +要使在 **file1.c** 中定义为 **extern** 的变量在另一个文件(例如 **file2.c**)中可见,该变量必须在 **file2.c** 中显式 _声明_ 为 **extern** 并且不能初始化(初始化会将声明转换为定义): + +``` +/** file2.c **/ +extern int n1; /* declaration of n1 defined in file1.c */ +``` + +为了避免与 **extern** 变量混淆,经验是在 _声明_ 中显式使用 **extern**(必须),但不要在 _定义_ 中使用(非必须且棘手)。对于函数,**extern** 在定义中是可选使用的,但在声明中是必须使用的。下一节中的 **staticProg** 示例会把这些点整合到一个完整的程序中。 + +### staticProg 示例 + +**staticProg** 程序由三个文件组成:两个 C 语言源文件(**static1.c** 和 **static2.c**)以及一个头文件(**static.h**),头文件中包含两个声明: + +``` +/** header file static.h **/ +#define NumCount 100               /* macro */ +extern int global_nums[NumCount];  /* array declaration */ +extern void fill_array();          /* function declaration */ +``` + +两个声明中的 **extern**,一个用于数组,另一个用于函数,强调对象在别处(“外部”)_定义_:数组 **global_nums** 在文件 **static1.c** 中定义(没有显式的 **extern**),函数 **fill_array** 在文件 **static2.c** 中定义(也没有显式的 **extern**)。每个源文件都包含了头文件 **static.h**。**static1.c** 文件定义了两个驻留在内存静态区域中的数组(**global_nums** 和 **more_nums**)。第二个数组有 **static** 修饰,这将其作用域限制为定义数组的文件 (**static1.c**)。如前所述, **extern** 修饰的 **global_nums** 则可以实现在多个文件中可见。 + +``` +/** static1.c **/ +#include +#include + +#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("%4i\t%4i\n", global_nums[i], more_nums[i]); +     +  return 0;   +} +``` + +下面的 **static2.c** 文件中定义了 **fill_array** 函数,该函数由 **main**(在 **static1.c** 文件中)调用;**fill_array** 函数会给名为 **global_nums** 的 **extern** 数组中的元素赋值,该数组在文件 **static1.c** 中定义。使用两个文件的唯一目的是凸显 **extern** 变量或函数能够跨文件可见。 + +``` +/** static2.c **/ +#include "static.h" /** declarations **/ + +void fill_array() { /** definition **/ +  unsigned i; +  for (i = 0; i < NumCount; i++) global_nums[i] = i + 2; +} +``` + +**staticProg** 程序可以如下编译: + +``` +% gcc -o staticProg static1.c static2.c +``` + +### 从汇编语言看更多细节 + +现代 C 编译器能够处理 C 和汇编语言的任意组合。编译 C 源文件时,编译器首先将 C 代码翻译成汇编语言。这是对从上文 **static1.c** 文件生成的汇编语言进行保存的命令: + +``` +% gcc -S static1.c +``` + +生成的文件就是 **static1.s**。这是文件顶部的一段代码,额外添加了行号以提高可读性: + +``` +    .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 +... +``` + +诸如 **.file**(第 1 行)之类的汇编语言指令以句点开头。顾名思义,指令会指导汇编程序将汇编语言翻译成机器代码。**.rodata** 指令(第 6 行)表示后面是只读对象,包括字符串常量 **"%4i\t%4i\n"**(第 8 行),**main** 函数(第 12 行)会使用此字符串常量来实现格式化输出。作为标签引入(通过末尾的冒号实现)的 **main** 函数(第 12 行),同样也是只读的。 + +在汇编语言中,标签就是地址。标签 **main:**(第 12 行)标记了 **main** 函数代码开始的地址,标签 **.LC0**:(第 7 行)标记了格式化字符串开头所在的地址。 + +**global_nums**(第 3 行)和 **more_nums**(第 4 行)数组的定义包含了两个数字:400 是每个数组中的总字节数,32 是每个数组(含 100 个 **int** 元素)中每个元素的比特数。(第 5 行中的 **.comm** 指令表示 **common name**,可以忽略。) + +两个数组定义的不同之处在于 **more_nums** 被标记为 **.local**(第 4 行),这意味着其作用域仅限于其所在文件 **static1.s**。相比之下,**global_nums** 数组就能在多个文件中实现可见,包括由 **static1.c** 和 **static2.c** 文件翻译成的汇编文件。 + +最后,**.text** 指令在汇编代码段中出现了两次(第 2 行和第 9 行)。术语“text”表示“只读”,但也会涵盖一些读/写变量,例如两个数组中的元素。尽管本文展示的汇编语言是针对 Intel 架构的,但 Arm6 汇编也非常相似。对于这两种架构,**.text** 区域中的变量(本例中为两个数组中的元素)会自动初始化为零。 + +### 总结 + +C 语言中的内存高效和内存安全编程准则很容易说明,但可能会很难遵循,尤其是在调用设计不佳的库的时候。准则如下: + + * 尽可能使用栈存储,进而鼓励编译器将通用寄存器用作暂存器,实现优化。栈存储代表了高效的内存使用并促进了代码的整洁和模块化。永远不要返回指向基于栈的存储的指针。 + * 小心使用堆存储。C(和 C++)中的重难点是确保动态分配的存储尽快解除分配。良好的编程习惯和工具(如 **valgrind**)有助于攻关这些重难点。优先选用自身提供释放函数的库,例如 **nestedHeap** 代码示例中的 **free_all** 释放函数。 + * 谨慎使用静态存储,因为这种存储会自始至终地影响进程的内存占用。特别是尽量避免使用 **extern** 和 **static** 数组。 + +本文 C 语言代码示例可在我的网站 () 上找到。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/memory-programming-c + +作者:[Marty Kalin][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/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 26e3c55319ae62e33a2204e62e4fba83424f3efb Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 26 Sep 2021 08:42:58 +0800 Subject: [PATCH 0499/1588] translated --- ...21 Run containers on your Mac with Lima.md | 157 ------------------ ...21 Run containers on your Mac with Lima.md | 157 ++++++++++++++++++ 2 files changed, 157 insertions(+), 157 deletions(-) delete mode 100644 sources/tech/20210921 Run containers on your Mac with Lima.md create mode 100644 translated/tech/20210921 Run containers on your Mac with Lima.md diff --git a/sources/tech/20210921 Run containers on your Mac with Lima.md b/sources/tech/20210921 Run containers on your Mac with Lima.md deleted file mode 100644 index 58f388a3e8..0000000000 --- a/sources/tech/20210921 Run containers on your Mac with Lima.md +++ /dev/null @@ -1,157 +0,0 @@ -[#]: subject: "Run containers on your Mac with Lima" -[#]: via: "https://opensource.com/article/21/9/run-containers-mac-lima" -[#]: author: "Moshe Zadka https://opensource.com/users/moshez" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Run containers on your Mac with Lima -====== -Lima can help overcome the challenges of running containers on a Mac. -![Containers for shipping overseas][1] - -Running containers on your Mac can be a challenge. After all, containers are based on Linux-specific technologies like cgroups and namespaces. - -Luckily, macOS has a built-in hypervisor, allowing virtual machines (VMs) on the Mac. The hypervisor is a low-level kernel feature, not a user-facing one. - -Enter `hyperkit`, an [open source project][2] that will run VMs using the macOS hypervisor. The `hyperkit` tool is designed to be a "minimalist" VM runner. Unlike, say, VirtualBox, it does not come with fancy UI features to manage VMs. - -You can grab `hyperkit`, a minimalist Linux distribution running a container manager, and plumb all the pieces together. This would be a lot of moving parts, and sounds like a lot of work. Especially if you want to make the network connections a bit more seamless by using `vpnkit`, an open source project to create a VM's network that feels more like part of the host's network. - -### Lima - -There is no reason to go to all that effort, when [the `lima` project][3] has figured out the details. One of the easiest ways to get `lima` running is with [Homebrew][4]. You can install `lima` with this command: - - -``` -`$ brew install lima` -``` - -After installation, which might take a while, it is time to begin having some fun. In order to let `lima` know you are ready for some fun, you need to start it. Here's the command: - - -``` -`$ limactl start` -``` - -If this is your first time, you will be asked if you like the defaults or whether you want to change any of them. The defaults are pretty safe, but I like to live on the wild side. This is why I jump into an editor and make the following modifications from: - - -``` - - location: "~" -    # CAUTION: `writable` SHOULD be false for the home directory. -    # Setting `writable` to true is possible but untested and dangerous. -    writable: false -``` - -to: - - -``` -  - location: "~" -    # I *also* like to live dangerously -- Austin Powers -    writable: true -``` - -As it says in the comment, this can be dangerous. Many existing workflows, sadly, depend on this mounting to be read-write. - -By default, `lima` runs `containerd` to manage containers. The `containerd` manager is also a pretty frill-less one. While it is not uncommon to use a wrapper daemon, like `dockerd`, to add those nice-to-have ergonomics, there is another way. - -### The nerdctl tool - -The `nerdctl` tool is a drop-in replacement for the Docker client which puts those features in the client, not the server. The `lima` tool allows running `nerdctl` without installing it locally, directly from inside the VM. - -Putting it all together, it is time to run a container! This container will run an HTTP server. You can create the files on your Mac: - - -``` -$ ls -index.html -$ cat index.html -hello -``` - -Now, mount and forward the ports: - - -``` -$ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python -root@9486145449ab:/# -``` - -Inside the container, run a simple web server: - - -``` -$ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python -root@9486145449ab:/# cd /html/ -root@9486145449ab:/html# python -m http.server 8000 -Serving HTTP on 0.0.0.0 port 8000 () ... -``` - -From a different terminal, you can check that everything looks good: - - -``` -$ curl localhost:8000 -hello -``` - -Back on the container, there is a log message documenting the HTTP client's connection: - - -``` -`10.4.0.1 - - [09/Sep/2021 14:59:08] "GET / HTTP/1.1" 200 -` -``` - -One file is not enough, so times to make some things better. **CTRL-C** the server, and add another file: - - -``` -^C -Keyboard interrupt received, exiting. -root@9486145449ab:/html# echo goodbye > foo.html -root@9486145449ab:/html# python -m http.server 8000 -Serving HTTP on 0.0.0.0 port 8000 () ... -``` - -Check that you can see the new file: - - -``` -$ curl localhost:8000/foo.html -goodbye -``` - -### Wrap up - -To recap, installing `lima` takes a while, but after you are done, you can do the following: - - * Run containers. - * Mount arbitrary sub-directories of your home directory into containers. - * Edit files in those directories. - * Run network servers that appear to Mac programs like they are running on localhost. - - - -All with `lima nerdctl`. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/run-containers-mac-lima - -作者:[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/lead-images/containers_2015-2-osdc-lead.png?itok=kAfHrBoy (Containers for shipping overseas) -[2]: https://www.docker.com/blog/docker-unikernels-open-source/ -[3]: https://github.com/lima-vm/lima -[4]: https://brew.sh/ diff --git a/translated/tech/20210921 Run containers on your Mac with Lima.md b/translated/tech/20210921 Run containers on your Mac with Lima.md new file mode 100644 index 0000000000..b1b8c06525 --- /dev/null +++ b/translated/tech/20210921 Run containers on your Mac with Lima.md @@ -0,0 +1,157 @@ +[#]: subject: "Run containers on your Mac with Lima" +[#]: via: "https://opensource.com/article/21/9/run-containers-mac-lima" +[#]: author: "Moshe Zadka https://opensource.com/users/moshez" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用 Lima 在你的 Mac 上运行容器 +====== +Lima 可以帮助克服在 Mac 上运行容器的挑战。 +![Containers for shipping overseas][1] + +在你的 Mac 上运行容器可能是一个挑战。毕竟,容器是基于 Linux 特有的技术,如 cgroups 和命名空间。 + +幸运的是,macOS 拥有一个内置的虚拟机监控程序,允许在 Mac 上运行虚拟机(VM)。虚拟机监控程序是一个底层的内核功能,而不是一个面向用户的功能。 + +`hyperkit`,一个可以使用 macOS 虚拟机监控程序运行虚拟机的[开源项目][2]。`hyperkit` 被设计成一个“最小化”的虚拟机运行器。与 VirtualBox 不同,它没有花哨的 UI 功能来管理虚拟机。 + +你可以获取 `hyperkit`,一个运行容器管理器的极简 Linux 发行版,并将所有部分组合在一起。 这将有很多变动组件,且听起来像有很多工作。特别是如果你想通过使用 `vpnkit` (一个开源项目,用于创建感觉更像是主机网络一部分的 VM 网络)使网络连接更加无缝。 + +### Lima + +当 [`lima` 项目][3]已经解决了细节问题时,就没有理由再去做这些努力了。让 `lima` 运行的最简单方法之一是使用 [Homebrew][4]。你可以用这个命令安装 `lima`: + + +``` +`$ brew install lima` +``` + +安装后,可能需要一些时间,就享受一些乐趣了。为了让 `lima` 知道你已经准备好了,你需要启动它。下面是命令: + + +``` +`$ limactl start` +``` + +如果这是你的第一次,你会被问到是否喜欢默认值,或者是否要改变其中的任何一项。默认值是非常安全的,但我喜欢生活在疯狂的一面。这就是为什么我跳进一个编辑器,从以下地方进行修改: + + +``` +- location: "~" + # CAUTION: `writable` SHOULD be false for the home directory. + # Setting `writable` to true is possible but untested and dangerous. + writable: false +``` + +变成: + + +``` + - location: "~" + # I *also* like to live dangerously -- Austin Powers + writable: true +``` + +正如评论中所说,这可能是危险的。可悲的是,许多现有的工作流程都依赖于挂载是可读写的。 + +By default, `lima` runs `containerd` to manage containers. The `containerd` manager is also a pretty frill-less one. While it is not uncommon to use a wrapper daemon, like `dockerd`, to add those nice-to-have ergonomics, there is another way. +默认情况下,`lima` 运行 `containerd` 来管理容器。`containerd` 管理器也是一个非常简洁的管理器。虽然使用一个包装的守护程序,如 `dockerd`,来增加这些漂亮的工效是很常见的,但也有另一种方法。 + +### nerdctl 工具 + +`nerdctl` 工具是 Docker 客户端的直接替换,它将这些功能放在客户端,而不是服务器上。`lima` 工具允许运行 `nerdctl` 而不需要在本地安装,直接从虚拟机内部运行。 + +做完这些后,可以运行一个容器了!这个容器将运行一个 HTTP 服务器。你可以在你的 Mac 上创建这些文件: + +``` +$ ls +index.html +$ cat index.html +hello +``` + +现在,挂载并转发端口: + + +``` +$ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python +root@9486145449ab:/# +``` + +在容器内,运行一个简单的 Web 服务器: + + +``` +$ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python +root@9486145449ab:/# cd /html/ +root@9486145449ab:/html# python -m http.server 8000 +Serving HTTP on 0.0.0.0 port 8000 () ... +``` + +在另一个终端,你可以检查一切看起来都很好: + + +``` +$ curl localhost:8000 +hello +``` + +回到容器上,有一条记录 HTTP 客户端连接的日志信息: + + +``` +`10.4.0.1 - - [09/Sep/2021 14:59:08] "GET / HTTP/1.1" 200 -` +``` + +一个文件是不够的,所以还要做些优化。 在服务器上执行 **CTRL-C**,并添加另一个文件: + + +``` +^C +Keyboard interrupt received, exiting. +root@9486145449ab:/html# echo goodbye > foo.html +root@9486145449ab:/html# python -m http.server 8000 +Serving HTTP on 0.0.0.0 port 8000 () ... +``` + +检查你是否能看到新的文件: + + +``` +$ curl localhost:8000/foo.html +goodbye +``` + +### 总结 + +总结一下,安装 `lima` 需要一些时间,但完成后,你可以做以下事情: + + * 运行容器。 + * 将你的主目录中的任意子目录挂载到容器中。 + * 编辑这些目录中的文件。 + * 运行网络服务器,在 Mac 程序看来,它们是在 localhost 上运行的。 + + + +这些都是通过 `lima nerdctl` 实现的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/run-containers-mac-lima + +作者:[Moshe Zadka][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/moshez +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/containers_2015-2-osdc-lead.png?itok=kAfHrBoy (Containers for shipping overseas) +[2]: https://www.docker.com/blog/docker-unikernels-open-source/ +[3]: https://github.com/lima-vm/lima +[4]: https://brew.sh/ From 3c4146c6b7958ee54663276c218b84625c078e4c Mon Sep 17 00:00:00 2001 From: geekpi Date: Sun, 26 Sep 2021 08:49:32 +0800 Subject: [PATCH 0500/1588] translating --- ...20210924 An open source alternative to Microsoft Exchange.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210924 An open source alternative to Microsoft Exchange.md b/sources/tech/20210924 An open source alternative to Microsoft Exchange.md index 3e587c7e56..4d698eca5c 100644 --- a/sources/tech/20210924 An open source alternative to Microsoft Exchange.md +++ b/sources/tech/20210924 An open source alternative to Microsoft Exchange.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/open-source-groupware-grommunio" [#]: author: "Markus Feilner https://opensource.com/users/mfeilner" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 7f2f2fac01da384b803372a1b544169a14739a8e Mon Sep 17 00:00:00 2001 From: SamMa Date: Sun, 26 Sep 2021 09:24:09 +0800 Subject: [PATCH 0501/1588] Update 20210920 Use this Linux command-line tool to learn more about your NVMe drives.md --- ...ol to learn more about your NVMe drives.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md b/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md index af8ff59418..d24b98628a 100644 --- a/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md +++ b/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md @@ -7,18 +7,18 @@ [#]: publisher: " " [#]: url: " " -使用这个 Linux 命令行工具来了解你的 NVMe 驱动器的更多信息 +使用 Linux 命令行工具来了解你的 NVMe 驱动器 ====== -nvme-cli 命令有很多有用的选项,且它是一个很好的方式来控制你如何管理你的数据。 +nvme-cli 命令拥有诸多实用的选项,且它是控制和管理数据一种很好的方式。 ![Command line prompt][1] -NVMe 是指 _Non-Volatile Memory_(非易失性内存主机控制器接口规范),它指的是软件和存储如何通过 PCIe 和其他协议(包括 TCP)进行通信。它是一个由非营利组织领导的[开放规范][2],并定义了几种形式的固态存储。 +NVMe 是指 _Non-Volatile Memory_(非易失性内存主机控制器接口规范),它规范了软件和存储通过 PCIe 和其他协议(包括 TCP)进行通信的方式。它由非营利组织领导的[开放规范][2],并定义了几种形式的固态存储。 -我的笔记本电脑有一个 NVMe 驱动器,我的台式机也有。而且它们的速度很快。我喜欢我的电脑启动的速度,以及它们读写数据的速度。没有可察觉的延迟。 +我的笔记本电脑有一个 NVMe 驱动器,我的台式机也有。而且它们的速度很快。我喜欢我的电脑启动的速度,以及它们读写数据的速度。几乎没有延迟。 -没过多久,我就对驱动这种超高速存储的技术产生了好奇,所以我做了一些调查。我了解到,NVMe 驱动器消耗的电力更少,而提供的数据访问速度甚至比 SATA 的 SSD 驱动器快得多。这很有趣,但我想知道更多关于我的特定 NVMe 驱动器的信息,我想知道它们与其他驱动器相比如何。我可以安全地擦除驱动器吗?我怎样才能检查它的完整性? +没过多久,我就对驱动这种超高速存储的技术产生了好奇,所以我做了一些调查。我了解到,NVMe 驱动器消耗的电力更少,而提供的数据访问速度甚至比 SATA 的 SSD 驱动器快得多。这很有趣,但我想知道更多关于我的特定 NVMe 驱动器的信息,我想知道它们与其他驱动器有何区别。我可以安全地擦除驱动器吗?我怎样才能检查它的完整性? -这些问题让我在互联网上搜索,发现了一个开源项目,其中有一系列管理 NVMe 驱动器的工具。它被称为 [nvme-cli][3]。 +带着这些问题我在互联网上搜索,发现了一个开源项目,其中有一系列管理 NVMe 驱动器的工具。它被称为 [nvme-cli][3]。 ### 安装 nvme-cli @@ -38,7 +38,7 @@ NVMe 是指 _Non-Volatile Memory_(非易失性内存主机控制器接口规 ### 探索 NVMe 驱动器 -在为我的发行版安装 `nvme-cli` 后,我想探索我的驱动器。`nvme-cli` 没有手册页,但你可以通过输入 `nvme help` 获得很多帮助: +在安装 `nvme-cli` 后,我想探索我的驱动器。`nvme-cli` 没有手册页,但你可以通过输入 `nvme help` 获得很多帮助: ``` @@ -64,7 +64,7 @@ primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities ### 列出所有的 NVMe 驱动器 -`sudo nvme list` 命令列出你机器上所有的 NVMe 设备和命名空间。我用它在 `/dev/nvme0n1` 找到了一个 NVMe 驱动器。下面是输出结果: +`sudo nvme list` 命令列出你机器上所有的 NVMe 设备和命名空间。我用它在 `/dev/nvme0n1` 找到了一个 NVMe 驱动器。下面是命令输出结果: ``` @@ -79,7 +79,7 @@ Node SN Model Namespace Usage Format FW Rev 214.68 GB / 256.06 GB 512 B + 0 B 0L2QEXD7 ``` -我有一个名为 `nvme0n1` 的驱动器。它列出了序列号、品牌、尺寸、固件版本等等。 +我有一个名为 `nvme0n1` 的驱动器。它列出了序列号、品牌、容量、固件版本等等。 通过使用 `id-ctrl` 子命令,你可以得到更多关于该硬盘和它所支持的特性的信息: @@ -148,7 +148,7 @@ Thermal Management T2 Total Time : 0 `$ sudo nvme format /dev/nvme0nX` ``` -(为了安全起见,我用 **X** 替换了驱动器的实际位置,以防止复制粘贴的错误。将 **X** 改为 **1** 或 `nvme list` 结果中列出的适当位置)。 +(为了安全起见,我用 **X** 替换了驱动器的实际位置,以防止复制粘贴的错误。将 **X** 改为 **1** 或 `nvme list` 结果中列出的实际位置)。 ### 安全地擦除 NVMe 驱动器 @@ -161,7 +161,7 @@ Thermal Management T2 Total Time : 0 ### 尝试 nvme-cli -`nvme-cli` 命令是在 [GPLv2][4] 许可下发布的。它是一个强大的命令,有很多有用的选项,它是控制你如何管理数据的好方法。 +`nvme-cli` 命令是在 [GPLv2][4] 许可下发布的。它是一个强大的命令,有很多有用的选项,用来有效地控制和管理数据。 -------------------------------------------------------------------------------- @@ -170,7 +170,7 @@ via: https://opensource.com/article/21/9/nvme-cli 作者:[Don Watkins][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 312c2f44593e09e3bd6f7ef4417b5fa4794b7fe1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 26 Sep 2021 10:25:41 +0800 Subject: [PATCH 0502/1588] PUB @geekpi @turbokernel https://linux.cn/article-13822-1.html --- ...ol to learn more about your NVMe drives.md | 59 +++++++++---------- 1 file changed, 27 insertions(+), 32 deletions(-) rename {translated/tech => published}/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md (73%) diff --git a/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md b/published/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md similarity index 73% rename from translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md rename to published/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md index d24b98628a..782e44586b 100644 --- a/translated/tech/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md +++ b/published/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md @@ -3,16 +3,18 @@ [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "turbokernel" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13822-1.html" 使用 Linux 命令行工具来了解你的 NVMe 驱动器 ====== -nvme-cli 命令拥有诸多实用的选项,且它是控制和管理数据一种很好的方式。 -![Command line prompt][1] -NVMe 是指 _Non-Volatile Memory_(非易失性内存主机控制器接口规范),它规范了软件和存储通过 PCIe 和其他协议(包括 TCP)进行通信的方式。它由非营利组织领导的[开放规范][2],并定义了几种形式的固态存储。 +> nvme-cli 命令拥有诸多实用的选项,且它是控制和管理数据一种很好的方式。 + +![](https://img.linux.net.cn/data/attachment/album/202109/26/102441ux8cy36gy1vggykz.jpg) + +NVMe 是指非易失性内存规范Non-Volatile Memory Express,它规范了软件和存储通过 PCIe 和其他协议(包括 TCP)进行通信的方式。它是由非营利组织领导的 [开放规范][2],并定义了几种形式的固态存储。 我的笔记本电脑有一个 NVMe 驱动器,我的台式机也有。而且它们的速度很快。我喜欢我的电脑启动的速度,以及它们读写数据的速度。几乎没有延迟。 @@ -24,41 +26,38 @@ NVMe 是指 _Non-Volatile Memory_(非易失性内存主机控制器接口规 你可以从你的发行版的包管理器中安装 `nvme-cli`。例如,在 Fedora、CentOS 或类似系统上: - ``` -`$ sudo dnf install nvme-cli` +$ sudo dnf install nvme-cli ``` 在 Debian、Mint、Elementary 和类似系统上: - ``` -`$ sudo apt install nvme-cli` +$ sudo apt install nvme-cli ``` ### 探索 NVMe 驱动器 在安装 `nvme-cli` 后,我想探索我的驱动器。`nvme-cli` 没有手册页,但你可以通过输入 `nvme help` 获得很多帮助: - ``` $ nvme help nvme-1.14 -usage: nvme <command> [<device>] [<args>] +usage: nvme [] [] -The '<device>' may be either an NVMe character device (ex: /dev/nvme0) or an +The '' may be either an NVMe character device (ex: /dev/nvme0) or an nvme block device (ex: /dev/nvme0n1). The following are all implemented sub-commands: -list List all NVMe devices and namespaces on machine -list-subsys List nvme subsystems -id-ctrl Send NVMe Identify Controller -id-ns Send NVMe Identify Namespace, display structure -id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure -list-ns Send NVMe Identify List, display structure -list-ctrl Send NVMe Identify Controller List, display structure -nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure -primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities + list List all NVMe devices and namespaces on machine + list-subsys List nvme subsystems + id-ctrl Send NVMe Identify Controller + id-ns Send NVMe Identify Namespace, display structure + id-ns-granularity Send NVMe Identify Namespace Granularity List, display structure + list-ns Send NVMe Identify List, display structure + list-ctrl Send NVMe Identify Controller List, display structure + nvm-id-ctrl Send NVMe Identify Controller NVM Command Set, display structure + primary-ctrl-caps Send NVMe Identify Primary Controller Capabilities [...] ``` @@ -72,18 +71,17 @@ $ sudo nvme list Node SN Model Namespace Usage Format FW Rev -\--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- +--------------------- -------------------- ---------------------------------------- --------- -------------------------- ---------------- -------- -/dev/nvme0n1 S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1 +/dev/nvme0n1 S42GMY9M141281 SAMSUNG MZVLB256HAHQ-000L7 1 -214.68 GB / 256.06 GB 512 B + 0 B 0L2QEXD7 +214.68 GB / 256.06 GB 512 B + 0 B 0L2QEXD7 ``` 我有一个名为 `nvme0n1` 的驱动器。它列出了序列号、品牌、容量、固件版本等等。 通过使用 `id-ctrl` 子命令,你可以得到更多关于该硬盘和它所支持的特性的信息: - ``` $ sudo nvme id-ctrl /dev/nvme0n1 NVME Identify Controller: @@ -107,7 +105,6 @@ rtd3e : 0x7a1200 你可以通过 `smart-log` 子命令来了解硬盘的整体健康状况: - ``` $ sudo nvme smart-log /dev/nvme0n1 Smart Log for NVME device:nvme0n1 namespace-id:ffffffff @@ -143,20 +140,18 @@ Thermal Management T2 Total Time : 0 你可以用 `nvme-cli` 格式化一个 NVMe 驱动器,但要注意。这将删除驱动器上的所有数据!如果你的硬盘上有重要的数据,你必须在这样做之前将其备份,否则你**将会**丢失数据。子命令是 `format`: - ``` -`$ sudo nvme format /dev/nvme0nX` +$ sudo nvme format /dev/nvme0nX ``` -(为了安全起见,我用 **X** 替换了驱动器的实际位置,以防止复制粘贴的错误。将 **X** 改为 **1** 或 `nvme list` 结果中列出的实际位置)。 +(为了安全起见,我用 `X` 替换了驱动器的实际位置,以防止复制粘贴的错误。将 `X` 改为 `1` 或 `nvme list` 结果中列出的实际位置。) ### 安全地擦除 NVMe 驱动器 当你准备出售或处理你的 NVMe 电脑时,你可能想安全地擦除驱动器。这里的警告与格式化过程中的警告相同。首先要备份重要的数据,因为这个命令会删除这些数据! - ``` -`$ sudo nvme sanitize /dev/nvme0nX` +$ sudo nvme sanitize /dev/nvme0nX ``` ### 尝试 nvme-cli From 31facc85ebe5e77ecc4ec2537b7f5b598667357c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 27 Sep 2021 05:02:41 +0800 Subject: [PATCH 0503/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210925?= =?UTF-8?q?=206=20open=20source=20tools=20for=20orchestral=20composers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210925 6 open source tools for orchestral composers.md --- ...n source tools for orchestral composers.md | 63 +++++++++++++++++++ 1 file changed, 63 insertions(+) create mode 100644 sources/tech/20210925 6 open source tools for orchestral composers.md diff --git a/sources/tech/20210925 6 open source tools for orchestral composers.md b/sources/tech/20210925 6 open source tools for orchestral composers.md new file mode 100644 index 0000000000..3696a1bdc1 --- /dev/null +++ b/sources/tech/20210925 6 open source tools for orchestral composers.md @@ -0,0 +1,63 @@ +[#]: subject: "6 open source tools for orchestral composers" +[#]: via: "https://opensource.com/article/21/9/open-source-orchestral-composers" +[#]: author: "Pete Savage https://opensource.com/users/psav" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +6 open source tools for orchestral composers +====== +Think it's impossible to compose orchestral tracks with just open source +software? Think again. +![Sheet music with geometry graphic][1] + +As an avid amateur musician, I've worked with many different software programs to create both simple and complex pieces. As my projects have grown in scope, I've used composition software ranging from basic engraving to MIDI-compatible notation to playback of multi-instrument works. Composers have their choice of proprietary software, but I wanted to prove that, regardless of the need, there is an open source tool that will more than satisfy them. + +### Music engraving programs + +When my needs were simple and my projects few, I used the excellent resource [Lilypond][2], part of the GNU project, for engraving my music score. Lilypond is a markup language used to create sheet music. What looks like a mass of letters and numbers on the screen becomes a beautiful music score that can be exported as a PDF to share with all your musical acquaintances. For creating small snippets of a score, Lilypond performs excellently. + +Using a text markup language might be a tolerable experience for a software engineer, but waiting to save and run the renderer before seeing the result of your edit can be frustrating. [Frescobaldi][3] is an effective solution to this problem, allowing you to work in a text editor on the left and see a live preview updating on the right. For small scores, this works well. For larger scores, however, the render time can make for a painful experience. Though Frescobaldi has a built-in MIDI-style player, hooking it up to play something requires both knowledge of [JACK][4] (an audio connection API) and a user interface such as [qSynth][5]. For me, Frescobaldi is best for projects when I already know what the score looks like. It's not a composing tool; it's an engraving tool. + +### Music notation programs + +A few months ago, I started creating a songbook for my former band. For this project, I needed to add chord diagrams, guitar tablature, and multiple staves, so I moved over to [Denemo.][6] Denemo is a fabulously configurable tool that uses LilyPond as its rendering backend. The key benefit to Denemo is the ability to enter notes on a stave. The stave you enter notes on might not look exactly like the score will appear on rendering—in fact, it almost certainly won't. However, in most cases, it's far easier to enter the notes directly on a stave than to write them in a text markup language. + +Denemo served me well when creating my songbook, but I had greater ambitions. When I started composing a few piano and small ensemble pieces, I could have handled these in Denemo, but I decided to try [MuseScore][7] to compare the programs. Though MuseScore doesn't use a text-based markup language like Lilypond, it has many other benefits over the LilyPond-based offerings, such as single-note dynamics and rendering out to WAV or MP3. + +In my latest project, I took a piano concept I wrote for a fictional role-playing game (RPG) and turned it into a full orchestral version. MuseScore was fantastic for this. The program definitely became part of my composing process, and it would have been much more difficult for me to arrange 18 instruments in LilyPond than in MuseScore. I was also able to hear single-note dynamics, such as a single violin note moving from silence to loud and back. I do not know of any editors for Lilypond that allow for this. + +#### Piano Concept + +#### Orchestral Concept + +### Going beyond the score + +My next task will be to take the MIDI from this project and code it into a Digital Audio Workstation (DAW), such as [Ardour][8]. The difference between the audio output from MuseScore and something created with a DAW is that a DAW allows much more than single-note dynamics. Expression, volume, and other parameters can be adjusted in time, allowing for a more realistic sound, assuming the instrument can handle it. I'm currently working on packaging up [sFizz][9] for Fedora. sFizz is an SFZ instrument VST plugin that can be used in an open source DAW and has fantastic support for the different expressions I'd like to use in my piece. + +The ultimate aim of this project is to show that open source tooling can be used to create an orchestral track that sounds authentic. Think it's impossible to make realistic-sounding orchestral tracks just with open source software? That's for next time. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/open-source-orchestral-composers + +作者:[Pete Savage][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/psav +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/sheet_music_graphic.jpg?itok=t-uXNbzE (Sheet music with geometry graphic) +[2]: https://lilypond.org/ +[3]: https://frescobaldi.org/ +[4]: https://jackaudio.org/ +[5]: https://qsynth.sourceforge.io/ +[6]: http://www.denemo.org/ +[7]: https://musescore.org/en +[8]: https://ardour.org/ +[9]: https://sfz.tools/sfizz/ From 299756cd4c15146f5a1eaa92d9a6f521023f167b Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 27 Sep 2021 08:45:04 +0800 Subject: [PATCH 0504/1588] translated --- ... scripts on different operating systems.md | 142 ------------------ ... scripts on different operating systems.md | 141 +++++++++++++++++ 2 files changed, 141 insertions(+), 142 deletions(-) delete mode 100644 sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md create mode 100644 translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md diff --git a/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md b/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md deleted file mode 100644 index 3d9c649d48..0000000000 --- a/sources/tech/20210920 Use Vagrant to test your scripts on different operating systems.md +++ /dev/null @@ -1,142 +0,0 @@ -[#]: subject: "Use Vagrant to test your scripts on different operating systems" -[#]: via: "https://opensource.com/article/21/9/test-vagrant" -[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Use Vagrant to test your scripts on different operating systems -====== -Vagrant helps you run other operating systems on your computer—meaning -you can build things, test things, and do wacky stuff without blowing up -your own system. -![Business woman on laptop sitting in front of window][1] - -I've been happy using Vagrant for quite a while now. I work with several DevOps tools, and installing them all on one system can get complicated. Vagrant lets you do cool things without breaking your system because you don't have to experiment on your production system at all. - -If you're familiar with [VirtualBox][2] or [GNOME Boxes][3], then learning Vagrant is easy. Vagrant is a simple and clean interface for working with virtual machines. A single config file, called `Vagrantfile`, allows you to customize your virtual machines (called _Vagrant boxes_). A simple command-line interface lets you start, stop, suspend, or destroy your boxes. - -Consider this simple example. - -Let's say you want to write Ansible or shell scripts to install Nginx on a new server. You can't do it on your own system because you might not be running the operating system you want to test, or you may not have all of the dependencies for what you want to do. Launching new cloud servers for testing can be time-consuming and expensive. This is where Vagrant comes in. You can use it to bring up a virtual machine, provision it using your scripts, and prove that everything works as expected. You can then delete the box, re-provision it, and re-run your scripts to verify it. You can repeat this process as many times as you want until you're confident your scripts work under all conditions. And you can commit your Vagrantfile to Git to ensure your team is testing the exact same environment (because they'll be using the exact same test box). No more "…but it works fine on my machine!" - -### Getting started - -First, [install Vagrant on your system][4] and then create a new folder to experiment in. In this new folder, create a new file named `Vagrantfile` with these contents: - - -``` -Vagrant.configure("2") do |config| -  -  config.vm.box = "ubuntu/hirsute64" -  -end -``` - -You can also run `vagrant init ubuntu/hirsute64`, and it will generate a new Vagrantfile for you. Now run `vagrant up`. This command will download the `ubuntu/hirsuite64` image from the Vagrant registry. - - -``` -Bringing machine 'default' up with 'virtualbox' provider... -==> default: Importing base box 'ubuntu/hirsute64'... -==> default: Matching MAC address for NAT networking... -==> default: Checking if box 'ubuntu/hirsute64' version '20210820.0.0' is up to date... -==> default: Setting the name of the VM: a_default_1630204214778_76885 -==> default: Clearing any previously set network interfaces... -==> default: Preparing network interfaces based on configuration... -    default: Adapter 1: nat -    default: Adapter 2: hostonly -==> default: Forwarding ports... -    default: 22 (guest) => 2222 (host) (adapter 1) -==> default: Running 'pre-boot' VM customizations... -==> default: Booting VM... -==> default: Waiting for machine to boot. This may take a few minutes... -    default: SSH address: 127.0.0.1:2222 -    default: SSH username: vagrant -    default: SSH auth method: private key -    default: Warning: Remote connection disconnect. Retrying... -    default: Warning: Connection reset. Retrying... -    default: -    default: Vagrant insecure key detected. Vagrant will automatically replace -    default: this with a newly generated keypair for better security. -    default: -    default: Inserting generated public key within guest... -    default: Removing insecure key from the guest if it's present... -    default: Key inserted! Disconnecting and reconnecting using new SSH key... -==> default: Machine booted and ready! -``` - -At this point, if you open your Vagrant backend (such as VirtualBox or virt-manager), you'll see your box there. Next, run `vagrant ssh` to log in to the box. If you can see the Vagrant prompt, then you’re in! - - -``` -~ vagrant ssh -Welcome to Ubuntu 21.04 (GNU/Linux 5.11.0-31-generic x86_64) - - * Documentation:   - * Management:     - * Support:         - -  System information as of Sun Aug 29 02:33:51 UTC 2021 - -  System load:  0.01              Processes:               110 -  Usage of /:   4.1% of 38.71GB   Users logged in:         0 -  Memory usage: 17%               IPv4 address for enp0s3: 10.0.2.15 -  Swap usage:   0%                IPv4 address for enp0s8: 192.168.1.20 - -0 updates can be applied immediately. - -vagrant@ubuntu-hirsute:~$ -``` - -Vagrant uses "base boxes" to bring up your local machines. In our case, Vagrant downloads the `ubuntu/hirsuite64` image from [Hashicorp’s Vagrant catalogue][5] and plugs into VirtualBox to create the actual box. - -### Shared folders - -Vagrant maps your current folder as `/vagrant` within the Vagrant box. This allows you to keep your files in sync on your system and within the box. This is great for testing a Nginx website by pointing your document root to `/vagrant`. You can use an IDE to make changes and Nginx within the box will serve them. - -### Vagrant commands - -There are several Vagrant commands which you can use to control your box. - -Some of the important ones are: - - * `vagrant up`: Bring a box online. - * `vagrant status`: Show current box status. - * `vagrant suspend`: Pause the current box. - * `vagrant resume`: Resume the current box. - * `vagrant halt`: Shutdown the current box. - * `vagrant destroy`: Destroy the current box. By running this command, you will lose any data stored on the box. - * `vagrant snapshot`: Take a snapshot of the current box. - - - -### Try Vagrant - -Vagrant is a time-tested tool for virtual machine management using DevOps principles. Configure your test machines, share the configs with your team, and test your projects in a predictable and reproducible environment. If you're developing software, then you'll do your users a great service by using Vagrant for testing. If you're not developing software but you love to try out new versions of an OS, then there's no easier way. Try Vagrant today! - -* * * - -_This article was originally published on the [author's personal blog][6] and has been adapted with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/test-vagrant - -作者:[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/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) -[2]: https://opensource.com/article/21/6/try-linux-virtualbox -[3]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization -[4]: https://www.vagrantup.com/docs/installation -[5]: https://app.vagrantup.com/boxes/search -[6]: https://notes.ayushsharma.in/2021/08/introduction-to-vagrant diff --git a/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md b/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md new file mode 100644 index 0000000000..6d034b1ace --- /dev/null +++ b/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md @@ -0,0 +1,141 @@ +[#]: subject: "Use Vagrant to test your scripts on different operating systems" +[#]: via: "https://opensource.com/article/21/9/test-vagrant" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 Vagrant 在不同的操作系统上测试你的脚本 +====== +Vagrant 可以帮助你在你的电脑上运行其他操作系统,这意味着你可以构建、测试、做古怪的事情而不毁坏你的系统。 +![Business woman on laptop sitting in front of window][1] + +我使用 Vagrant 已经很长时间了。我使用几种 DevOps 工具,在一个系统上安装它们可能会变得很复杂。Vagrant 让你在不破坏系统的情况下做一些很酷的事情,因为你根本不需要在生产系统上做实验。 + +如果你熟悉 [VirtualBox][2] 或 [GNOME Boxes][3],那么学习 Vagrant 很容易。Vagrant 有一个简单而干净的界面用于处理虚拟机。一个名为 `Vagrantfile` 的配置文件,允许你定制你的虚拟机(称为 _Vagrant boxes_)。一个简单的命令行界面让你启动、停止、暂停或销毁你的 box。 + +考虑一下这个简单的例子。 + +假设你想写 Ansible 或 shell 脚本,在一个新的服务器上安装 Nginx。你不能在自己的系统上这样做,因为你可能没有运行想测试的操作系统,或者可能没有你想做的所有依赖项。启动新的云服务器进行测试可能会很费时和昂贵。这就是 Vagrant 派上用处的地方。你可以用它来启动一个虚拟机,用你的脚本来配置它,并证明一切按预期工作。然后,你可以删除这个 box,重新配置它,并重新运行你的脚本来验证它。你可以多次重复这个过程,直到你确信你的脚本在所有条件下都能工作。你可以将你的 Vagrant 文件提交给 Git,以确保你的团队正在测试完全相同的环境(因为他们将使用完全相同的测试机)。不再有“但它在我的机器上运行良好!”这事了。 + +### 开始使用 + +First,[install Vagrant on your system][4]and then create a new folder to experiment in. In this new folder, create a new file namedwith these contents: +首先,[在你的系统上安装 Vagrant][4],然后创建一个新的文件夹进行实验。在这个新文件夹中,创建一个名为 `Vagrantfile` 的新文件,内容如下: + + +``` +Vagrant.configure("2") do |config| + + config.vm.box = "ubuntu/hirsute64" + +end +``` + +你也可以运行 `vagrant init ubuntu/hirsute64`,它将为你生成一个新的 Vagrant 文件。现在运行 `vagrant up`。这个命令将从 Vagrant 仓库中下载 `ubuntu/hirsuite64` 镜像。 + + +``` +Bringing machine 'default' up with 'virtualbox' provider... +==> default: Importing base box 'ubuntu/hirsute64'... +==> default: Matching MAC address for NAT networking... +==> default: Checking if box 'ubuntu/hirsute64' version '20210820.0.0' is up to date... +==> default: Setting the name of the VM: a_default_1630204214778_76885 +==> default: Clearing any previously set network interfaces... +==> default: Preparing network interfaces based on configuration... + default: Adapter 1: nat + default: Adapter 2: hostonly +==> default: Forwarding ports... + default: 22 (guest) => 2222 (host) (adapter 1) +==> default: Running 'pre-boot' VM customizations... +==> default: Booting VM... +==> default: Waiting for machine to boot. This may take a few minutes... + default: SSH address: 127.0.0.1:2222 + default: SSH username: vagrant + default: SSH auth method: private key + default: Warning: Remote connection disconnect. Retrying... + default: Warning: Connection reset. Retrying... + default: + default: Vagrant insecure key detected. Vagrant will automatically replace + default: this with a newly generated keypair for better security. + default: + default: Inserting generated public key within guest... + default: Removing insecure key from the guest if it's present... + default: Key inserted! Disconnecting and reconnecting using new SSH key... +==> default: Machine booted and ready! +``` + +此时,如果你打开你的 Vagrant 后端(如 VirtualBox 或 virt-manager),你会看到你的 box 在那里。接下来,运行 `vagrant ssh` 登录到 box。如果你能看到 Vagrant 的提示,那么你就进入了! + + +``` +~ vagrant ssh +Welcome to Ubuntu 21.04 (GNU/Linux 5.11.0-31-generic x86_64) + +* Documentation: +* Management: +* Support: + + System information as of Sun Aug 29 02:33:51 UTC 2021 + + System load: 0.01 Processes: 110 + Usage of /: 4.1% of 38.71GB Users logged in: 0 + Memory usage: 17% IPv4 address for enp0s3: 10.0.2.15 + Swap usage: 0% IPv4 address for enp0s8: 192.168.1.20 + +0 updates can be applied immediately. + +vagrant@ubuntu-hirsute:~$ +``` + +Vagrant 使用“基础 box” 来启动你的本地机器。在我们的例子中,Vagrant 从 [Hashicorp 的 Vagrant 目录][5]下载 `ubuntu/hirsuite64` 镜像,并插入 VirtualBox 来创建实际的 box。 + +### 共享文件夹 + +Vagrant 将你的当前文件夹映射到 Vagrant box 中的 `/vagrant`。这允许你在你的系统和 box 里保持文件同步。这对于测试 Nginx 网站是很好的,通过将你的文件根目录指向 `/vagrant`。你可以使用 IDE 进行修改,box 里的 Nginx 会提供这些修改。 + +### Vagrant 命令 + +有几个 Vagrant 命令,你可以用它们来控制你的 box。 + +其中一些重要的命令是: + + * `vagrant up`:启动一个 box。 + * `vagrant status`:显示当前 box 的状态。 + * `vagrant suspend`:暂停当前的 box。 + * `vagrant resume`:恢复当前的 box。 + * `vagrant halt`:关闭当前的 box。 + * `vagrant destroy`:销毁当前的 box。通过运行此命令,你将失去存储在 box 上的任何数据。 + * `vagrant snapshot`:对当前的 box 进行快照。 + + + +### 试试 Vagrant + +Vagrant 是一个使用 DevOps 原则进行虚拟机管理的经过时间考验的工具。配置你的测试机,与你的团队分享配置,并在一个可预测和可重复的环境中测试你的项目。如果你正在开发软件,那么通过使用 Vagrant 进行测试,你将为你的用户提供良好的服务。如果你不开发软件,但你喜欢尝试新版本的操作系统,那么没有比这更简单的方法了。今天就试试 Vagrant 吧! + +* * * + +_这篇文章最初发表在[作者的个人博客][6]上,经许可后被改编。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/test-vagrant + +作者:[Ayush Sharma][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/ayushsharma +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/lenovo-thinkpad-laptop-concentration-focus-windows-office.png?itok=-8E2ihcF (Woman using laptop concentrating) +[2]: https://opensource.com/article/21/6/try-linux-virtualbox +[3]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[4]: https://www.vagrantup.com/docs/installation +[5]: https://app.vagrantup.com/boxes/search +[6]: https://notes.ayushsharma.in/2021/08/introduction-to-vagrant From 77ca4f5756a08fa2abdec3bd8b184b3f20f4ca85 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Mon, 27 Sep 2021 08:47:11 +0800 Subject: [PATCH 0505/1588] translated by perfiffer --- ...n We Recommend Linux for Gaming in 2021.md | 145 ------------------ ...n We Recommend Linux for Gaming in 2021.md | 145 ++++++++++++++++++ 2 files changed, 145 insertions(+), 145 deletions(-) delete mode 100644 sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md create mode 100644 translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md diff --git a/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md b/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md deleted file mode 100644 index 62b1942df3..0000000000 --- a/sources/talk/20210424 Can We Recommend Linux for Gaming in 2021.md +++ /dev/null @@ -1,145 +0,0 @@ -[#]: subject: (Can We Recommend Linux for Gaming in 2021?) -[#]: via: (https://news.itsfoss.com/linux-for-gaming-opinion/) -[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (perfiffer) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Can We Recommend Linux for Gaming in 2021? -====== - -You will often hear Linux enthusiasts praise about the improved gaming capabilities on Linux. Yes, we have come a long way considering the advancements made to support modern games on Linux desktop. - -Even Lutris’ creator mentions in our interview that the [progress Linux has made in terms of gaming is simply incredible][1]. - -But, is it something to be hyped about? Can we recommend Linux to a gamer? Is Linux suitable for gaming? - -In this article, I want to share a few things about gaming on a Linux system and share what I think about it. - -### You Can Play Games on Linux: Yes! - -If anyone’s ever told you that you cannot game on Linux, **that is not true**. - -You can play a variety of games on Linux without any major hiccups. And, for the most part, it is playable and totally a good experience. - -In fact, we have an ultimate guide for [Gaming on Linux][2] if you do not know where to start. - -### Do I Need a Specific Linux Distro to Play Games? - -Not really. It depends on how convenient you want the experience to be. - -For instance, if you want a Linux distribution to work well with your graphics driver and get the latest hardware support, there’s something for that. Similarly, if you just want to play native Linux indie games with an integrated GPU, any Linux distro can work. - -So, there are a few variables when choosing a Linux distribution for your gaming adventures. - -Fret not, to help you out, we have a useful list of the [best Linux gaming distributions][3]. - -### Virtual Reality Games on Linux: Uh-Oh! - -![][4] - -I’m sure VR gaming is not something widely adopted yet. But, if you want the exciting experience on a VR headset, **choosing Linux as your preferred platform might be a bad idea**. - -You do not have the necessary drivers or applications for a convenient experience on Linux. No distribution can help you solve this problem. - -If you are curious, you can go through the details shed on the **state of virtual reality** in a blog post on [Boiling Steam][5] and an interesting experience with Valve’s VR headset on [GamingOnLinux][6]. - -I’ve linked those blog posts for reference but long story short — avoid Linux if you want to experience VR games (feel free to experiment if you have the time though). - -### Can You Play Windows Exclusive Games on Linux? - -Yes and No. - -You can use [Steam Play to play Windows-only games][7], **but it has its share of issues**. Not every game works. - -For instance, I end up using Windows to play [Forza Horizon 4][8]. If you love car simulation or racing games, this is a masterpiece that you may not want to miss. - -Maybe we will see it working through Steam Play without issues in the near future, who knows? - -So, it is safe to assume that you will encounter many similar games that may not work at all. That’s the bitter truth. - -And, to know if the game works on Linux, head to [ProtonDB][9] and search for the game to see if it has a “**Gold**” status at the very least. - -### Multiplayer Gaming With Anti-Cheat Engines: Does It Work? - -![][10] - -A huge chunk of gamers prefer playing multiplayer games like [Apex Legends][11], [Rainbow Six Siege][12], and [Fortnite][13]. - -However, some of those popular titles that rely on anti-cheat engines do not work on Linux yet. It is still something a work in progress and can be made possible in future Linux Kernel releases — just not yet. - -Do note that multiplayer games like [CS:GO][14], Dota 2, Team Fortress 2, [Valheim][15], and several more offer native Linux support and works great! - -### Would I Recommend Linux for Gaming? - -![][4] - -Considering that you can play a lot of Windows-specific games, native indie games, and a variety of AAA games with native Linux support, I can recommend a first-time user to try gaming on Linux. - -But, that comes with a **caution** — I would suggest you to make a potential list of games that you want to play to make sure that it runs on Linux without any issues. In either case, you may end up wasting a lot of time troubleshooting with no results. - -Not to forget, a big no to VR gaming on Linux, I believe. - -And, if you want to explore all the latest and greatest titles, I will recommend you to stick to your Windows-powered gaming machine. - -**While I should encourage more users to adopt Linux as a gaming platform, but I won’t be ignoring the practical side of why common consumers still prefer a Windows-powered machine to game on.** - -_What do you think? Do you agree with my thoughts? Feel free to share what you feel 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 - -#### _Related_ - - * [The Progress Linux has Made in Terms of Gaming is Simply Incredible: Lutris Creator][1] - * ![][16] ![][17] - - - * [Popular Game Titles Metro Exodus and Total War: Rome Remastered Releasing for Linux in April][18] - * ![][16] ![][19] - - - * [Good News for Linux Gamers! An Unofficial Epic Games Store Launcher for Linux is in Works][20] - * ![][16] ![Heroic Games Launcher][21] - - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/linux-for-gaming-opinion/ - -作者:[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/lutris-creator-interview/ -[2]: https://itsfoss.com/linux-gaming-guide/ -[3]: https://itsfoss.com/linux-gaming-distributions/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[5]: https://boilingsteam.com/the-state-of-virtual-reality-on-linux/ -[6]: https://www.gamingonlinux.com/2020/08/my-experiences-of-valves-vr-on-linux -[7]: https://itsfoss.com/steam-play/ -[8]: https://forzamotorsport.net/en-US/games/fh4 -[9]: https://www.protondb.com/ -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[11]: https://www.ea.com/games/apex-legends -[12]: https://www.ubisoft.com/en-us/game/rainbow-six/siege -[13]: https://www.epicgames.com/fortnite/en-US/home -[14]: https://store.steampowered.com/app/730/CounterStrike_Global_Offensive/ -[15]: https://store.steampowered.com/app/892970/Valheim/ -[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[18]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ -[19]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[20]: https://news.itsfoss.com/heroic-games-launcher/ -[21]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/heroic-games-launcher.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 diff --git a/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md b/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md new file mode 100644 index 0000000000..ca6026418a --- /dev/null +++ b/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md @@ -0,0 +1,145 @@ +[#]: subject: (Can We Recommend Linux for Gaming in 2021?) +[#]: via: (https://news.itsfoss.com/linux-for-gaming-opinion/) +[#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (perfiffer) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +2021 年我们可以推荐使用 Linux 来玩游戏吗? +====== + +你经常会听到 Linux 爱好者称赞 Linux 上改进的游戏功能。是的,考虑到在 Linux 桌面上支持现代游戏所取得的进步,Linux 已经在游戏方面获得了很大的提升。 + +甚至 Lutris 的创造者在我们的采访中也提到 [Linux 在游戏方面取得的进步简直令人难以置信][1]。 + +但是,这有什么值得大肆宣传的吗?我们可以向游戏玩家推荐 Linux 吗? Linux 适合玩游戏吗? + +此文中,我想分享一些关于在 Linux 系统上玩游戏的的事情,并分享我对它的看法。 + +### 你可以在 Linux 上玩游戏:是的! + +如果有人曾经告诉过你,不能在 Linux 上玩游戏,**那不是真的**。 + +你可以在 Linux 上玩各种游戏而不会出现任何大问题。而且,在大多数情况下,它是可玩的,并且会提供很好的游戏体验。 + +事实上,如果你不知道从哪里开始,我们有一份 [Linux 游戏终极指南][2] 提供给你。 + +### 我需要一个特定的 Linux 发行版才能玩游戏吗? + +并不如此。怎么方便怎么来。 + +例如,如果你希望 Linux 发行版能够与你的图形驱动程序很好地配合并获得最新的硬件支持,那么有一些发行版可以做到。同样,如果你只想玩带有集成 GPU 的原生 Linux 独立游戏,任何发行版都可以。 + +因此,在你开启 Linux 游戏之旅的同时,会有一些因素影响你选择发行版。 + +不用担心,为了帮助你,我们提供了一份有用的[最佳 Linux 游戏发行版列表][3]。 + +### Linux 上的虚拟现实游戏:哦,哦! + +![][4] + +我确信 VR 游戏还没有完全普及。但是,如果你想要在 VR 耳机上获得激动人心的体验,那么**选择 Linux 作为你的首选平台可能不是一个好主意**。 + +你没有在 Linux 上获得便利体验所需的驱动程序或应用程序。没有任何发行版可以帮助你解决此问题。 + +如果你好奇,可以在 [Boiling Steam][5] 上的博客文章中了解有关虚拟现实状态的详细信息,以及在 [GamingOnLinux][6] 上使用 Valve 的 VR 耳机的有趣体验。 + +我已经提供了这些博客文章的链接以供参考,但长话短说 - 如果你想体验 VR 游戏,请避免使用 Linux (如果你有时间,请随意尝试)。 + +### 你可以在 Linux 上玩 Windows 系统的游戏吗? + +并不是完全不可以。 + +你可以使用 [Steam Play 来玩仅限 Windows 的游戏][7],但是它也存在一些问题,并不是每个游戏都可以运行。 + +例如,我最终使用 Windows 来玩 [地平线 4][8]。如果你喜欢汽车模拟或赛车游戏,这是你可能不想错过的杰作。 + +或许我们在不久的将来可以看到它通过 Steam Play 完美的运行,谁知道呢? + +因此,可以确定地假设你会遇到许多可能根本无法运行的类似游戏。这是残酷的事实。 + +而且,要知道该游戏是否可以在 Linux 上运行,请前往 [ProtonDB][9] 并搜索该游戏,看看它是否至少具有 “**Gold**” 状态。 + +### 带有反作弊引擎的多人游戏:它有效吗? + +![][10] + +大量游戏玩家更喜欢玩多人游戏,如 [Apex英雄][11]、[彩虹六号:围攻][12] 和 [堡垒之夜][13]。 + +然而,一些依赖于反作弊引擎的流行游戏还不能在 Linux 上运行。它仍然是一项正在进行中的工作,可以在未来的 Linux 内核版本中实现 - 但目前还没有。 + +请注意,像 `CS:GO`、`Dota 2`、`Team Fortress 2`、`Valheim` 等多人游戏提供原生 Linux 支持并且运行良好! + +### 我会推荐使用 Linux 来玩游戏吗? + +![][4] + +考虑到你可以玩很多 Windows 特定的游戏,原生独立游戏,以及原生 Linux 支持的各种 `AAA` 游戏,我可以推荐初次使用者尝试在 Linux 上玩游戏。 + +但是,需要注意的是——我建议你列出你想玩的游戏列表,以确保它在 Linux 上运行没有任何问题。在任何一种情况下,你最终都可能浪费大量时间进行故障排除而没有结果。 + +不要忘记,我相信 Linux 上的 VR 游戏是一个很大的禁忌。 + +而且,如果你想探索所有最新最好的游戏,我建议你坚持使用 Windows 驱动的游戏机。 + +虽然我应该鼓励更多的用户采用 Linux 作为游戏平台,但我不会忽视为什么普通消费者仍然喜欢使用 Windows 驱动的机器来玩游戏的客观事实。 + +你怎么认为呢?你同意我的想法吗?欢迎在下方的评论区分享你的想法! + +#### 大型科技网站获得数百万收入,It's FOSS 为你服务! + +如果你喜欢我们在 It's FOSS 所做的工作,请考虑捐款以支持我们的独立出版物。你的支持将帮助我们继续发布专注于桌面 Linux 和开源软件的内容。 + +我对此并不感兴趣。 + +#### 相关推荐 + + * [Linux 在游戏方面取得的进步简直令人难以置信: Lutris Creator][1] + * ![][16] ![][17] + + + * [热门游戏《地铁出埃及记》和《全面战争:罗马》4 月份发布 Linux 版][18] + * ![][16] ![][19] + + + * [Linux 游戏玩家的重大利好!适用于 Linux 的非官方 Epic Games Store Launcher 正在开发中][20] + * ![][16] ![Heroic Games Launcher][21] + + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/linux-for-gaming-opinion/ + +作者:[Ankush Das][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://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/lutris-creator-interview/ +[2]: https://itsfoss.com/linux-gaming-guide/ +[3]: https://itsfoss.com/linux-gaming-distributions/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[5]: https://boilingsteam.com/the-state-of-virtual-reality-on-linux/ +[6]: https://www.gamingonlinux.com/2020/08/my-experiences-of-valves-vr-on-linux +[7]: https://itsfoss.com/steam-play/ +[8]: https://forzamotorsport.net/en-US/games/fh4 +[9]: https://www.protondb.com/ +[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[11]: https://www.ea.com/games/apex-legends +[12]: https://www.ubisoft.com/en-us/game/rainbow-six/siege +[13]: https://www.epicgames.com/fortnite/en-US/home +[14]: https://store.steampowered.com/app/730/CounterStrike_Global_Offensive/ +[15]: https://store.steampowered.com/app/892970/Valheim/ +[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[18]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ +[19]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 +[20]: https://news.itsfoss.com/heroic-games-launcher/ +[21]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/heroic-games-launcher.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 From b07e5bbe302df7a0843143e6181825acfa8c9fe7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 27 Sep 2021 08:50:09 +0800 Subject: [PATCH 0506/1588] translating --- ...Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md b/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md index 4a7880a888..598d522f8d 100644 --- a/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md +++ b/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-anydesk-ubuntu/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 1dc8fce5580279eb6badad3b90e1da719f45d8a6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Sep 2021 09:16:18 +0800 Subject: [PATCH 0507/1588] PRF&PUB @geekpi https://linux.cn/article-13824-1.html --- ...21 Run containers on your Mac with Lima.md | 51 ++++++++----------- 1 file changed, 20 insertions(+), 31 deletions(-) rename {translated/tech => published}/20210921 Run containers on your Mac with Lima.md (63%) diff --git a/translated/tech/20210921 Run containers on your Mac with Lima.md b/published/20210921 Run containers on your Mac with Lima.md similarity index 63% rename from translated/tech/20210921 Run containers on your Mac with Lima.md rename to published/20210921 Run containers on your Mac with Lima.md index b1b8c06525..759725d878 100644 --- a/translated/tech/20210921 Run containers on your Mac with Lima.md +++ b/published/20210921 Run containers on your Mac with Lima.md @@ -3,41 +3,40 @@ [#]: author: "Moshe Zadka https://opensource.com/users/moshez" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13824-1.html" 用 Lima 在你的 Mac 上运行容器 ====== -Lima 可以帮助克服在 Mac 上运行容器的挑战。 -![Containers for shipping overseas][1] -在你的 Mac 上运行容器可能是一个挑战。毕竟,容器是基于 Linux 特有的技术,如 cgroups 和命名空间。 +> Lima 可以帮助克服在 Mac 上运行容器的挑战。 -幸运的是,macOS 拥有一个内置的虚拟机监控程序,允许在 Mac 上运行虚拟机(VM)。虚拟机监控程序是一个底层的内核功能,而不是一个面向用户的功能。 +![](https://img.linux.net.cn/data/attachment/album/202109/27/091509kx8u9uqdzcz8c6ud.jpg) -`hyperkit`,一个可以使用 macOS 虚拟机监控程序运行虚拟机的[开源项目][2]。`hyperkit` 被设计成一个“最小化”的虚拟机运行器。与 VirtualBox 不同,它没有花哨的 UI 功能来管理虚拟机。 +在你的 Mac 上运行容器可能是一个挑战。毕竟,容器是基于 Linux 特有的技术,如控制组和命名空间。 -你可以获取 `hyperkit`,一个运行容器管理器的极简 Linux 发行版,并将所有部分组合在一起。 这将有很多变动组件,且听起来像有很多工作。特别是如果你想通过使用 `vpnkit` (一个开源项目,用于创建感觉更像是主机网络一部分的 VM 网络)使网络连接更加无缝。 +幸运的是,macOS 拥有一个内置的虚拟机监控程序hypervisor,允许在 Mac 上运行虚拟机(VM)。虚拟机监控程序是一个底层的内核功能,而不是一个面向用户的功能。 + +hyperkit 是一个可以使用 macOS 虚拟机监控程序运行虚拟机的 [开源项目][2]。hyperkit 被设计成一个“极简化”的虚拟机运行器。与 VirtualBox 不同,它没有花哨的 UI 功能来管理虚拟机。 + +你可以获取 hyperkit,这是一个运行容器管理器的极简 Linux 发行版,并将所有部分组合在一起。但这将有很多变动组件,且听起来像有很多工作。特别是如果你想通过使用 `vpnkit` (一个开源项目,用于创建感觉更像是主机网络一部分的虚拟机网络)使网络连接更加无缝。 ### Lima -当 [`lima` 项目][3]已经解决了细节问题时,就没有理由再去做这些努力了。让 `lima` 运行的最简单方法之一是使用 [Homebrew][4]。你可以用这个命令安装 `lima`: - +当 [lima 项目][3] 已经解决了这些细节问题时,就没有理由再去做这些努力了。让 `lima` 运行的最简单方法之一是使用 [Homebrew][4]。你可以用这个命令安装 `lima`: ``` -`$ brew install lima` +$ brew install lima ``` 安装后,可能需要一些时间,就享受一些乐趣了。为了让 `lima` 知道你已经准备好了,你需要启动它。下面是命令: - ``` -`$ limactl start` +$ limactl start ``` -如果这是你的第一次,你会被问到是否喜欢默认值,或者是否要改变其中的任何一项。默认值是非常安全的,但我喜欢生活在疯狂的一面。这就是为什么我跳进一个编辑器,从以下地方进行修改: - +如果这是你第一次运行,你会被问到是否喜欢默认值,或者是否要改变其中的任何一项。默认值是非常安全的,但我喜欢生活在疯狂的一面。这就是为什么我跳进一个编辑器,从以下地方进行修改: ``` - location: "~" @@ -48,7 +47,6 @@ Lima 可以帮助克服在 Mac 上运行容器的挑战。 变成: - ``` - location: "~" # I *also* like to live dangerously -- Austin Powers @@ -57,12 +55,11 @@ Lima 可以帮助克服在 Mac 上运行容器的挑战。 正如评论中所说,这可能是危险的。可悲的是,许多现有的工作流程都依赖于挂载是可读写的。 -By default, `lima` runs `containerd` to manage containers. The `containerd` manager is also a pretty frill-less one. While it is not uncommon to use a wrapper daemon, like `dockerd`, to add those nice-to-have ergonomics, there is another way. 默认情况下,`lima` 运行 `containerd` 来管理容器。`containerd` 管理器也是一个非常简洁的管理器。虽然使用一个包装的守护程序,如 `dockerd`,来增加这些漂亮的工效是很常见的,但也有另一种方法。 ### nerdctl 工具 -`nerdctl` 工具是 Docker 客户端的直接替换,它将这些功能放在客户端,而不是服务器上。`lima` 工具允许运行 `nerdctl` 而不需要在本地安装,直接从虚拟机内部运行。 +`nerdctl` 工具是 Docker 客户端的直接替换,它将这些功能放在客户端,而不是服务器上。`lima` 工具允许无需在本地安装就可以直接从虚拟机内部运行 `nerdctl`。 做完这些后,可以运行一个容器了!这个容器将运行一个 HTTP 服务器。你可以在你的 Mac 上创建这些文件: @@ -75,7 +72,6 @@ hello 现在,挂载并转发端口: - ``` $ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python root@9486145449ab:/# @@ -83,7 +79,6 @@ root@9486145449ab:/# 在容器内,运行一个简单的 Web 服务器: - ``` $ lima nerdctl run --rm -it -p 8000:8000 -v $(pwd):/html --entrypoint bash python root@9486145449ab:/# cd /html/ @@ -93,7 +88,6 @@ Serving HTTP on 0.0.0.0 port 8000 () ... 在另一个终端,你可以检查一切看起来都很好: - ``` $ curl localhost:8000 hello @@ -101,25 +95,22 @@ hello 回到容器上,有一条记录 HTTP 客户端连接的日志信息: - ``` -`10.4.0.1 - - [09/Sep/2021 14:59:08] "GET / HTTP/1.1" 200 -` +10.4.0.1 - - [09/Sep/2021 14:59:08] "GET / HTTP/1.1" 200 - ``` -一个文件是不够的,所以还要做些优化。 在服务器上执行 **CTRL-C**,并添加另一个文件: - +一个文件是不够的,所以还要做些优化。 在服务器上执行 `CTRL-C`,并添加另一个文件: ``` ^C Keyboard interrupt received, exiting. root@9486145449ab:/html# echo goodbye > foo.html root@9486145449ab:/html# python -m http.server 8000 -Serving HTTP on 0.0.0.0 port 8000 () ... +Serving HTTP on 0.0.0.0 port 8000 (http://0.0.0.0:8000/) ... ``` 检查你是否能看到新的文件: - ``` $ curl localhost:8000/foo.html goodbye @@ -134,8 +125,6 @@ goodbye * 编辑这些目录中的文件。 * 运行网络服务器,在 Mac 程序看来,它们是在 localhost 上运行的。 - - 这些都是通过 `lima nerdctl` 实现的。 -------------------------------------------------------------------------------- @@ -145,7 +134,7 @@ via: https://opensource.com/article/21/9/run-containers-mac-lima 作者:[Moshe Zadka][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 ce5aa5d4d5905cc7b61411d4afdcca41ec4b48eb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Sep 2021 12:14:41 +0800 Subject: [PATCH 0508/1588] PRF @perfiffer --- ...n We Recommend Linux for Gaming in 2021.md | 100 +++++++----------- 1 file changed, 39 insertions(+), 61 deletions(-) diff --git a/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md b/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md index ca6026418a..6121598a7a 100644 --- a/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md +++ b/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md @@ -3,112 +3,95 @@ [#]: author: (Ankush Das https://news.itsfoss.com/author/ankush/) [#]: collector: (lujun9972) [#]: translator: (perfiffer) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) -2021 年我们可以推荐使用 Linux 来玩游戏吗? +2021 年了,我们能推荐使用 Linux 来玩游戏吗? ====== +> 每天,Linux 都在进行不断进步,以支持具有适当图形支持的现代游戏。但是,我们能推荐 Linux 用于游戏吗? + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/Gaming-On-Linux.jpg?w=1200&ssl=1) + 你经常会听到 Linux 爱好者称赞 Linux 上改进的游戏功能。是的,考虑到在 Linux 桌面上支持现代游戏所取得的进步,Linux 已经在游戏方面获得了很大的提升。 甚至 Lutris 的创造者在我们的采访中也提到 [Linux 在游戏方面取得的进步简直令人难以置信][1]。 -但是,这有什么值得大肆宣传的吗?我们可以向游戏玩家推荐 Linux 吗? Linux 适合玩游戏吗? +但是,这有什么值得大肆宣传的吗?我们能向游戏玩家推荐 Linux 吗? Linux 适合玩游戏吗? 此文中,我想分享一些关于在 Linux 系统上玩游戏的的事情,并分享我对它的看法。 -### 你可以在 Linux 上玩游戏:是的! +### 你可以在 Linux 上玩游戏吗?是的! -如果有人曾经告诉过你,不能在 Linux 上玩游戏,**那不是真的**。 +如果有人曾经告诉过你,不能在 Linux 上玩游戏,**那是不对的**。 -你可以在 Linux 上玩各种游戏而不会出现任何大问题。而且,在大多数情况下,它是可玩的,并且会提供很好的游戏体验。 +你可以在 Linux 上玩各种游戏而不会出现任何大的障碍。而且,在大多数情况下,它是可玩的,并且会提供很好的游戏体验。 事实上,如果你不知道从哪里开始,我们有一份 [Linux 游戏终极指南][2] 提供给你。 -### 我需要一个特定的 Linux 发行版才能玩游戏吗? +### 需要一个特定的 Linux 发行版才能玩游戏吗? -并不如此。怎么方便怎么来。 +并非如此。这取决于你想获得多么方便的体验。 -例如,如果你希望 Linux 发行版能够与你的图形驱动程序很好地配合并获得最新的硬件支持,那么有一些发行版可以做到。同样,如果你只想玩带有集成 GPU 的原生 Linux 独立游戏,任何发行版都可以。 +例如,如果你希望 Linux 发行版能够与你的图形驱动程序很好地配合,并获得最新的硬件支持,那么有一些发行版可以做到。同样,如果你只是想用集成的 GPU 玩原生的 Linux 独立游戏,任何发行版都可以。 -因此,在你开启 Linux 游戏之旅的同时,会有一些因素影响你选择发行版。 +因此,在你开启 Linux 游戏之旅的同时,会有一些因素影响你对发行版的选择。 -不用担心,为了帮助你,我们提供了一份有用的[最佳 Linux 游戏发行版列表][3]。 +不用担心,为了帮助你,我们提供了一份有用的 [最佳 Linux 游戏发行版列表][3]。 -### Linux 上的虚拟现实游戏:哦,哦! +### Linux 上的虚拟现实游戏,唉…… ![][4] -我确信 VR 游戏还没有完全普及。但是,如果你想要在 VR 耳机上获得激动人心的体验,那么**选择 Linux 作为你的首选平台可能不是一个好主意**。 +我确信 VR 游戏还没有完全普及。但是,如果你想要在 VR 头盔上获得激动人心的体验,那么**选择 Linux 作为你的首选平台可能不是一个好主意**。 你没有在 Linux 上获得便利体验所需的驱动程序或应用程序。没有任何发行版可以帮助你解决此问题。 -如果你好奇,可以在 [Boiling Steam][5] 上的博客文章中了解有关虚拟现实状态的详细信息,以及在 [GamingOnLinux][6] 上使用 Valve 的 VR 耳机的有趣体验。 +如果你想了解有关虚拟现实状态的详细信息,可以看看 [Boiling Steam][5] 上的博客文章和 [GamingOnLinux][6] 上的使用 Valve 的 VR 头盔的有趣体验。 -我已经提供了这些博客文章的链接以供参考,但长话短说 - 如果你想体验 VR 游戏,请避免使用 Linux (如果你有时间,请随意尝试)。 +我已经提供了这些博客文章的链接以供参考,但总而言之 —— 如果你想体验 VR 游戏,请避免使用 Linux(如果你实在太闲,请随意尝试)。 -### 你可以在 Linux 上玩 Windows 系统的游戏吗? +### 可以在 Linux 上玩 Windows 系统的游戏吗? -并不是完全不可以。 +可以,也不可以。 -你可以使用 [Steam Play 来玩仅限 Windows 的游戏][7],但是它也存在一些问题,并不是每个游戏都可以运行。 +你可以使用 [Steam Play 来玩 Windows 专属的游戏][7],但是它也存在一些问题,并不是每个游戏都可以运行。 -例如,我最终使用 Windows 来玩 [地平线 4][8]。如果你喜欢汽车模拟或赛车游戏,这是你可能不想错过的杰作。 +例如,我最终还是使用 Windows 来玩《[地平线 4][8]》。如果你喜欢汽车模拟或赛车游戏,这是一款你可能不想错过的杰作。 或许我们在不久的将来可以看到它通过 Steam Play 完美的运行,谁知道呢? -因此,可以确定地假设你会遇到许多可能根本无法运行的类似游戏。这是残酷的事实。 +因此,可以肯定的是,你会遇到许多类似的游戏,可能根本无法运行。这是残酷的事实。 -而且,要知道该游戏是否可以在 Linux 上运行,请前往 [ProtonDB][9] 并搜索该游戏,看看它是否至少具有 “**Gold**” 状态。 +而且,要知道该游戏是否可以在 Linux 上运行,请前往 [ProtonDB][9] 并搜索该游戏,看看它是否至少具有 “**黄金**” 状态。 -### 带有反作弊引擎的多人游戏:它有效吗? +### 带有反作弊引擎的多人游戏可以吗? ![][10] -大量游戏玩家更喜欢玩多人游戏,如 [Apex英雄][11]、[彩虹六号:围攻][12] 和 [堡垒之夜][13]。 +许多游戏玩家更喜欢玩多人游戏,如《[Apex Legends][11]》、《[彩虹六号:围攻][12]》和《[堡垒之夜][13]》。 -然而,一些依赖于反作弊引擎的流行游戏还不能在 Linux 上运行。它仍然是一项正在进行中的工作,可以在未来的 Linux 内核版本中实现 - 但目前还没有。 +然而,一些依赖于反作弊引擎的流行游戏还不能在 Linux 上运行。它仍然是一项进行中的工作,可能在未来的 Linux 内核版本中实现 —— 但目前还没有。 -请注意,像 `CS:GO`、`Dota 2`、`Team Fortress 2`、`Valheim` 等多人游戏提供原生 Linux 支持并且运行良好! +请注意,像 《[反恐精英:全球攻势][14]》、《Dota 2》、《军团要塞 2》、《[英灵神殿][15]》等多人游戏提供原生 Linux 支持并且运行良好! ### 我会推荐使用 Linux 来玩游戏吗? -![][4] +![][16] -考虑到你可以玩很多 Windows 特定的游戏,原生独立游戏,以及原生 Linux 支持的各种 `AAA` 游戏,我可以推荐初次使用者尝试在 Linux 上玩游戏。 +考虑到你可以玩很多 Windows 专属的游戏、原生的独立游戏,以及 Linux 原生支持的各种 AAA 游戏,我能推荐初次使用者尝试在 Linux 上玩游戏。 -但是,需要注意的是——我建议你列出你想玩的游戏列表,以确保它在 Linux 上运行没有任何问题。在任何一种情况下,你最终都可能浪费大量时间进行故障排除而没有结果。 +但是,需要**注意**的是 —— 我建议你列出你想玩的游戏列表,以确保它在 Linux 上运行没有任何问题。否则,你最终都可能浪费大量时间进行故障排除而没有结果。 -不要忘记,我相信 Linux 上的 VR 游戏是一个很大的禁忌。 +不要忘记,我相信 Linux 上的 VR 游戏是一个很大的问题。 -而且,如果你想探索所有最新最好的游戏,我建议你坚持使用 Windows 驱动的游戏机。 +而且,如果你想探索所有最新最好的游戏,我建议你坚持使用 Windows 的游戏电脑。 -虽然我应该鼓励更多的用户采用 Linux 作为游戏平台,但我不会忽视为什么普通消费者仍然喜欢使用 Windows 驱动的机器来玩游戏的客观事实。 +**虽然我应该鼓励更多的用户采用 Linux 作为游戏平台,但我不会忽视为什么普通消费者仍然喜欢使用 Windows 机器来玩游戏的客观事实。** 你怎么认为呢?你同意我的想法吗?欢迎在下方的评论区分享你的想法! -#### 大型科技网站获得数百万收入,It's FOSS 为你服务! - -如果你喜欢我们在 It's FOSS 所做的工作,请考虑捐款以支持我们的独立出版物。你的支持将帮助我们继续发布专注于桌面 Linux 和开源软件的内容。 - -我对此并不感兴趣。 - -#### 相关推荐 - - * [Linux 在游戏方面取得的进步简直令人难以置信: Lutris Creator][1] - * ![][16] ![][17] - - - * [热门游戏《地铁出埃及记》和《全面战争:罗马》4 月份发布 Linux 版][18] - * ![][16] ![][19] - - - * [Linux 游戏玩家的重大利好!适用于 Linux 的非官方 Epic Games Store Launcher 正在开发中][20] - * ![][16] ![Heroic Games Launcher][21] - - - -------------------------------------------------------------------------------- via: https://news.itsfoss.com/linux-for-gaming-opinion/ @@ -116,7 +99,7 @@ via: https://news.itsfoss.com/linux-for-gaming-opinion/ 作者:[Ankush Das][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/) 荣誉推出 @@ -125,21 +108,16 @@ via: https://news.itsfoss.com/linux-for-gaming-opinion/ [1]: https://news.itsfoss.com/lutris-creator-interview/ [2]: https://itsfoss.com/linux-gaming-guide/ [3]: https://itsfoss.com/linux-gaming-distributions/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMScgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/linux-gaming-vr.jpg?w=1200&ssl=1 [5]: https://boilingsteam.com/the-state-of-virtual-reality-on-linux/ [6]: https://www.gamingonlinux.com/2020/08/my-experiences-of-valves-vr-on-linux [7]: https://itsfoss.com/steam-play/ [8]: https://forzamotorsport.net/en-US/games/fh4 [9]: https://www.protondb.com/ -[10]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzUyMCcgd2lkdGg9Jzc4MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= +[10]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/linux-gaming-illustration.jpg?w=1200&ssl=1 [11]: https://www.ea.com/games/apex-legends [12]: https://www.ubisoft.com/en-us/game/rainbow-six/siege [13]: https://www.epicgames.com/fortnite/en-US/home [14]: https://store.steampowered.com/app/730/CounterStrike_Global_Offensive/ [15]: https://store.steampowered.com/app/892970/Valheim/ -[16]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9JzIwMCcgd2lkdGg9JzM1MCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJyB2ZXJzaW9uPScxLjEnLz4= -[17]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/lutris-interview-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[18]: https://news.itsfoss.com/metro-exodus-total-war-rome-linux/ -[19]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/03/metro-total-war-ft.png?fit=1200%2C675&ssl=1&resize=350%2C200 -[20]: https://news.itsfoss.com/heroic-games-launcher/ -[21]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/01/heroic-games-launcher.jpg?fit=1200%2C675&ssl=1&resize=350%2C200 +[16]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/04/gaming-on-linux-support.jpg?w=1200&ssl=1 From c762c8cfd225e6c4982bc268fd106aa938634cbb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 27 Sep 2021 12:15:30 +0800 Subject: [PATCH 0509/1588] PUB @perfiffer https://linux.cn/article-13826-1.html --- .../20210424 Can We Recommend Linux for Gaming in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/talk => published}/20210424 Can We Recommend Linux for Gaming in 2021.md (98%) diff --git a/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md b/published/20210424 Can We Recommend Linux for Gaming in 2021.md similarity index 98% rename from translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md rename to published/20210424 Can We Recommend Linux for Gaming in 2021.md index 6121598a7a..d2e5ad57bf 100644 --- a/translated/talk/20210424 Can We Recommend Linux for Gaming in 2021.md +++ b/published/20210424 Can We Recommend Linux for Gaming in 2021.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (perfiffer) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13826-1.html) 2021 年了,我们能推荐使用 Linux 来玩游戏吗? ====== From 9687aa2e45691942f227b9a750b870ce14a6ba24 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Mon, 27 Sep 2021 13:01:06 +0800 Subject: [PATCH 0510/1588] apply for translating by unigeorge --- sources/tech/20210622 What is a config file.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210622 What is a config file.md b/sources/tech/20210622 What is a config file.md index cadb9d3e7a..db2c6325a2 100644 --- a/sources/tech/20210622 What is a config file.md +++ b/sources/tech/20210622 What is a config file.md @@ -2,7 +2,7 @@ [#]: via: (https://opensource.com/article/21/6/what-config-files) [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (unigeorge) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -168,7 +168,7 @@ via: https://opensource.com/article/21/6/what-config-files 作者:[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 ba098c54b42cfceb436f15e313277d3cbc0e7c8c Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Mon, 27 Sep 2021 23:44:15 +0800 Subject: [PATCH 0511/1588] translated --- .../tech/20210622 What is a config file.md | 184 ------------------ .../tech/20210622 What is a config file.md | 173 ++++++++++++++++ 2 files changed, 173 insertions(+), 184 deletions(-) delete mode 100644 sources/tech/20210622 What is a config file.md create mode 100644 translated/tech/20210622 What is a config file.md diff --git a/sources/tech/20210622 What is a config file.md b/sources/tech/20210622 What is a config file.md deleted file mode 100644 index db2c6325a2..0000000000 --- a/sources/tech/20210622 What is a config file.md +++ /dev/null @@ -1,184 +0,0 @@ -[#]: subject: (What is a config file?) -[#]: via: (https://opensource.com/article/21/6/what-config-files) -[#]: author: (Seth Kenlon https://opensource.com/users/seth) -[#]: collector: (lujun9972) -[#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -What is a config file? -====== -There are several popular formats for configuration files, each with its -own strengths. Find what works best for you. -![Computer screen with files or windows open][1] - -There are thousands of configuration files on your computer. You may never directly interact with the bulk of them, but they're scattered throughout your `/etc` folder and in `~/.config` and `~/.local` and `/usr`. There are probably some in `/var` and possibly even in `/opt`. If you've ever opened one by accident or to make a change, you may have wondered why some configuration files look one way while others look completely different. - -Storing configurations is a flexible task because as long as developers know how their code puts data into a file, they can easily write code to extract that data as needed. However, the tech industry graciously favors well-documented standardization, so several well-known formats have evolved over the years to make configuration easy. - -### Why we need configuration - -Configuration files ("config files" for short) are important to modern computing. They allow you to customize how you interact with an application or how an application interacts with the rest of your system. It's thanks to config files that any time you launch an application, it has "memories" of how you like to use it. - -Configuration files can be, and often are, very simple in structure. For instance, if you were to write an application, and the only thing it ever needed to know was its user's preferred name, then its one and only config file could contain exactly one word: the name of the user. For example: - - -``` -`Tux` -``` - -Usually, though, an application needs to keep track of more than just one piece of information, so configuration often uses a key and a value: - - -``` -NAME='Tux' -SPECIES='Penguin' -``` - -Even without programming experience, you can imagine how code parses that data. Here are two simple examples, one using the [`awk` command][2] and the other using the [grep command][3], focusing on just the line containing the "key" of `NAME`, and returning the "value" appearing after the equal sign (`=`): - - -``` -$ awk -F'=' '/NAME/ { print $2; }' myconfig.ini -'Tux' -$ grep NAME fake.txt | cut -d'=' -f2 -'Tux' -``` - -The same principle applies to any programming language and any configuration file. As long as you have a consistent data structure, you can write simple code to extract and parse it when necessary. - -### Choose a format - -To be broadly effective, the most important thing about configuration files is that they are consistent and predictable. The last thing you want to do is dump information into a file under the auspices of saving user preferences and then spend days writing code to reverse-engineer the random bits of information that have ended up in the file. - -There are several popular formats for configuration files, each with its own strengths. - -#### INI - -INI files take the format of key and value pairs: - - -``` -[example] -name=Tux -style=widgety,fidgety -enabled=1 -``` - -This simple style of configuration can be intuitive, with the only point of confusion being poor key names (for example, cryptic names like `unampref` instead of `name`). They're easy to parse and easy to edit. - -The INI format features sections in addition to keys and values. In this sample code, `[example]` and `[demo]` are configuration sections: - - -``` -[example] -name=Tux -style=widgety,fidgety -enabled=1 - -[demo] -name=Beastie -fullscreen=1 -``` - -This is a little more complex to parse because there are _two_ `name` keys. You can imagine a careless programmer querying this config file for `name` and always getting back `Beastie` because that's the last name defined by the file. When parsing such a file, a developer must be careful to search within sections for keys, which can be tricky depending on the language used to parse the file. However, it's a popular enough format that most languages have an existing library to help programmers parse INI files. - -#### YAML - -[YAML files][4] are structured lists that can contain values or key and value pairs: - - -``` -\--- -Example: -  Name: 'Tux' -  Style: -   - 'widgety' -    - 'fidgety' -  Enabled: 1 -``` - -YAML is popular partly because it looks clean. It doesn't have much of a syntax aside from where you place the data in relation to previous data. What's a feature for some, though, is a bug for others, and many developers avoid YAML because of the significance it places on what is essentially _not there_. If you get indentation wrong in YAML, YAML parsers may see your file as invalid, and even if it's tolerated, it may return incorrect data. - -Most languages have YAML parsers, and there are good open source YAML linters (applications to validate syntax) to help you ensure the integrity of a YAML file. - -#### JSON - -JSON files are technically subsets of YAML, so its data structure is the same, although its syntax is completely different: - - -``` -{ -  "Example": { -    "Name": [ -      "Tux" -    ], -    "Style": [ -      "widgety", -      "fidgety" -    ], -    "Enabled": 1 -  } -} -``` - -JSON is popular among JavaScript programmers, which isn't surprising, given that JSON stands for JavaScript Object Notation. As a result of being strongly associated with web development, JSON is a common output format for web APIs. Most programming languages have libraries to parse JSON. - -#### XML - -XML uses tags as keys that surround a configuration value: - - -``` -<example> -  <name>Tux</name> -  <style priority="user">widgety</style> -  <style priority="fallback">fidgety</style> -  <enabled>1</enabled> -</example> -``` - -XML is often used by Java programmers, and Java has a rich set of XML parsers. While it has a reputation of being quite strict, XML is simultaneously very flexible. Unlike HTML, which has a set of tags you're allowed to use, you can arbitrarily invent your own XML tags. As long as you structure it consistently and have a good library to parse it, you can extract your data with precision and ease. - -There are some good open source linters to help you validate XML files, and most programming languages have a library to parse XML. - -#### Binary formats - -Linux prides itself on plain-text configuration. The advantage is that you can see configuration data using basic tools like [cat][5], and you can even edit a configuration with your [favorite text editor][6]. - -Some applications use binary formats, though, which means the data is encoded in some format that is not a natural language. These files usually require a special application (usually the application they're meant to configure) to interpret their data. -You can't view these files, at least not in a way that makes any sense, and you can't edit them outside of their host application. Some reasons for resorting to binary formats are: - - * **Speed:** A programmer can register specific bits of information at certain points within a binary's config file using custom notation. When the data is extracted, there's no searching involved because everything is already indexed. - * **Size:** Text files can get big, and should you choose to compress a text file, you're functionally turning it into a binary format. Binary files can be made smaller through tricks of encoding (the same is true of text files, but at some point, your optimizations make your data so obscure that it may as well be binary). - * **Obfuscation:** Some programmers don't want people even looking at their configuration files, so they encode them as binary data. This usually succeeds only in frustrating users. This is not a good reason to use binary formats. - - - -If you must use a binary format for configuration, use one that already exists as an open standard, such as [NetCDF][7]. - -### Find what works - -Configuration formats help developers store the data their applications need and help users store preferences for how they want applications to act. There's probably no wrong answer to the question of what format you should use, as long as you feel well supported by the language you're using. When developing your application, look at the formats available, model some sample data, review and evaluate the libraries and utilities your programming language provides, and choose the one you feel the most confident about. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/6/what-config-files - -作者:[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/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) -[2]: https://opensource.com/article/20/9/awk-ebook -[3]: https://opensource.com/downloads/grep-cheat-sheet -[4]: https://www.redhat.com/sysadmin/yaml-beginners -[5]: https://opensource.com/article/19/2/getting-started-cat-command -[6]: https://opensource.com/article/21/2/open-source-text-editors -[7]: https://www.unidata.ucar.edu/software/netcdf/ diff --git a/translated/tech/20210622 What is a config file.md b/translated/tech/20210622 What is a config file.md new file mode 100644 index 0000000000..b29393e4f9 --- /dev/null +++ b/translated/tech/20210622 What is a config file.md @@ -0,0 +1,173 @@ +[#]: subject: (What is a config file?) +[#]: via: (https://opensource.com/article/21/6/what-config-files) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) +[#]: collector: (lujun9972) +[#]: translator: (unigeorge) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +什么是配置文件? +====== + +流行的配置文件格式有若干种,每种都有其独特优势。从中找到最适合你的格式吧! +![Computer screen with files or windows open][1] + +计算机上有数以千计的配置文件。你可能永远不会直接与其中的大部分文件打交道,但它们确实散落在你的 `/etc` 以及 `~/.config`、`~/.local`、`/usr` 文件夹中。还有一些可能在 `/var`,甚至 `/opt` 文件夹中。如果无意中打开过或更改过它们,你就可能会有疑问:为什么有些配置文件看起来是某一种格式,而另一些则是看起来完全不同的格式? + +存储配置是一项很灵活的任务,因为只要开发人员知道他们的代码如何将数据存入文件,他们就可以轻松编写代码来根据需要提取数据。然而,科技行业非常青睐有详细文档的标准化事物,因此多年来出现了几种比较普遍的格式用来简化配置任务。 + +### 为什么我们需要配置文件 + +配置文件对于现代计算来说很重要。它们使你能够自定义与应用程序交互的方式,或自定义应用程序与系统内其他程序的交互方式。有了配置文件,每当你启动某个应用程序时,它都会有“记忆”,记录了你喜欢如何去使用该程序。 + +配置文件的结构可以很简单,而且通常确实也很简单。例如,如果你要编写一个应用程序,程序唯一需要知道的是其用户的偏好名称,那么它的唯一配置文件就可以只包含一个词:用户名。就像下面这样: + +``` +Tux +``` + +但通常应用程序需要追踪的不仅仅是一条信息,因此配置文件通常会有一个键和一个值: + +``` +NAME='Tux' +SPECIES='Penguin' +``` + +即使没有编程经验,你也可以想象出代码如何解析这些数据。这里有两个简单的例子,一个使用 [`awk` 命令][2],另一个使用 [grep 命令][3]。两个例子都是只关注包含 `NAME`“键”的行,并返回出现在等号 (`=`) 之后的“值”: + +``` +$ awk -F'=' '/NAME/ { print $2; }' myconfig.ini +'Tux' +$ grep NAME fake.txt | cut -d'=' -f2 +'Tux' +``` + +同样的原则适用于任何编程语言和任何配置文件。只要你有统一的数据结构,就可以在需要的时候编写简单的代码来提取和解析它。 + +### 选择格式 + +为了保证普遍有效性,配置文件最重要的一点是它们是一致的和可预测的。你绝对不会想做这样的事:以保存用户首选项的名义,将信息随意存储到文件中,然后就得花好几天时间来编写代码,以对整个文件中的随机信息实现读取操作。 + +流行的配置文件格式有若干种,每种格式都有自己的优势。 + +#### INI + +INI 文件采用了键值对的格式: + +``` +[example] +name=Tux +style=widgety,fidgety +enabled=1 +``` + +这种简单的配置风格很直观,只要你别选择使用糟糕的键名(比如用 `unampref` 这样的神秘键名来代替 `name`)就好。这些键值对很容易解析和编辑。 + +除了键和值之外,INI 格式还可以分 section。在下列示例代码中,`[example]` 和 `[demo]` 就是配置文件中的两节: + +``` +[example] +name=Tux +style=widgety,fidgety +enabled=1 + +[demo] +name=Beastie +fullscreen=1 +``` + +这几个配置语句解析起来有点复杂,因为有 _两个_ `name` 键。想象一下,一个粗心的程序员在这个配置文件中查询 `name`,结果总是返回 `Beastie`,因为这是文件中对 name 的最后一个定义值。在解析这样的文件时,开发人员必须加倍小心地在各节中搜索键,这可能会很棘手,具体取决于用来解析该文件的语言。然而,它仍然是一种很流行的格式,大多数语言都会有一个现成的库来帮助程序员解析 INI 文件。 + +#### YAML + +[YAML 文件][4] 是结构化列表,可以包含值或者键值对: + +``` +\--- +Example: +  Name: 'Tux' +  Style: +   - 'widgety' +    - 'fidgety' +  Enabled: 1 +``` + +YAML 格式很流行,部分原因是它看起来很整洁。数据要放置到相对其上层数据的特定位置,除此之外没有太多其他语法。然而,对于某些人来说的特色,在其他人眼中可能就是一个 bug。许多开发人员不愿使用 YAML,正是因为它很看重本质上 _不存在_ 的东西。如果你在 YAML 中缩进错误,YAML 解析器可能会将你的文件视为无效文件,即使不视为无效,返回的数据也可能是错误的。 + +大多数语言都有 YAML 解析器,并且有很好的开源 YAML linters(验证语法的应用程序)来帮你确保 YAML 文件的完整性。 + +#### JSON + +JSON 文件在技术上来说是 YAML 的子类,因此其数据结构是相同的,尽管其语法完全不同: + +``` +{ +  "Example": { +    "Name": [ +      "Tux" +    ], +    "Style": [ +      "widgety", +      "fidgety" +    ], +    "Enabled": 1 +  } +} +``` + +JSON 在 JavaScript 程序员中很流行,这并不奇怪,因为 JSON 全称为 JavaScript Object Notation 即 JavaScript 对象符号。由于与 Web 开发密切相关,JSON 是 Web API 的常见输出格式。大多数编程语言都有解析 JSON 的库。 + +#### XML + +XML 使用标签作为键,将配置值围绕起来: + +``` +Tux1 + +``` + +XML 经常被 Java 程序员使用,Java 有一套丰富的 XML 解析器。虽然 XML 以非常严格而著称,但同时也非常灵活。与有一系列特定标签的 HTML 不同,XML 中可以随意发明自己的标签。只要始终坚持相同的构建规则,并有一个良好的库来解析它,你就可以准确而轻松地提取数据。 + +有一些很好的开源 linter 可以帮你验证 XML 文件,并且大多数编程语言都提供用于解析 XML 的库。 + +#### 二进制格式 + +Linux 以纯文本配置为傲。这样做的优点是可以使用 [cat][5] 等基本工具查看配置数据,甚至可以使用你 [最喜欢的文本编辑器][6] 来编辑配置。 + +但是,某些应用程序使用二进制格式配置,就意味着数据以某种非自然语言的格式进行编码。这些文件通常需要一个特殊的应用程序(通常是它们要配置的应用程序)来解释它们的数据。你无法查看这些文件,至少无法以任何有意义的方式查看,并且无法在其宿主应用程序之外编辑它们。选用二进制格式的一些原因如下: + + * **速度:** 程序员可以使用自定义符号在二进制配置文件中的某些点注册特定的信息位。提取数据时不涉及搜索,因为所有内容都已标注了索引。 + * **大小:** 文本文件可能会变大,如果选择压缩文本文件,实际上是在将其转换为二进制格式。二进制文件可以通过编码技巧变得更小(文本文件也是如此,但在某些时候,你的优化会使数据变得晦涩,以至于文件也成了二进制文件)。 + * **晦涩:** 一些程序员甚至不希望人们查看他们的配置文件,因此将它们编码为二进制数据。这通常只会让用户感到沮丧,并不是使用二进制格式的好理由。 + +如果必须使用二进制格式进行配置,请使用已作为开放标准存在的格式,例如 [NetCDF][7]。 + +### 找到有效的配置格式 + +配置格式帮助开发人员存储应用程序所需的数据,并帮助用户存储他们希望应用程序如何操作的偏好项。对于应该使用什么格式的问题,可能没有错误的答案,只要你觉得所使用的语言能很好地支持就可以。在开发应用程序时,查看可用格式,用一些样例数据建模,查看和评估你的编程语言提供的库和实用程序,然后选择你觉得最合适的一种格式吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/6/what-config-files + +作者:[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/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://opensource.com/article/20/9/awk-ebook +[3]: https://opensource.com/downloads/grep-cheat-sheet +[4]: https://www.redhat.com/sysadmin/yaml-beginners +[5]: https://opensource.com/article/19/2/getting-started-cat-command +[6]: https://opensource.com/article/21/2/open-source-text-editors +[7]: https://www.unidata.ucar.edu/software/netcdf/ From 494b8b00c71084057e628fb4f6cb54cf1f72695f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Sep 2021 05:02:26 +0800 Subject: [PATCH 0512/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210927?= =?UTF-8?q?=20Bash=20Shell=20Scripting=20for=20beginners=20(Part=201)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210927 Bash Shell Scripting for beginners (Part 1).md --- ... Shell Scripting for beginners (Part 1).md | 223 ++++++++++++++++++ 1 file changed, 223 insertions(+) create mode 100644 sources/tech/20210927 Bash Shell Scripting for beginners (Part 1).md diff --git a/sources/tech/20210927 Bash Shell Scripting for beginners (Part 1).md b/sources/tech/20210927 Bash Shell Scripting for beginners (Part 1).md new file mode 100644 index 0000000000..2e6a196059 --- /dev/null +++ b/sources/tech/20210927 Bash Shell Scripting for beginners (Part 1).md @@ -0,0 +1,223 @@ +[#]: subject: "Bash Shell Scripting for beginners (Part 1)" +[#]: via: "https://fedoramagazine.org/bash-shell-scripting-for-beginners-part-1/" +[#]: author: "zexcon https://fedoramagazine.org/author/zexcon/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Bash Shell Scripting for beginners (Part 1) +====== + +![][1] + +Photo by [N Bandaru][2] on [Unsplash][3] + +As the title implies this article will be covering Bash Shell Scripting at a beginner level. I’m not going to review the history of Bash but there are many resources to fill you in or you can visit the GNU project at . We will start out with understanding some very basic concepts and then start to put things together. + +### Creating a script file + +The first thing to do is create a script file. First make sure the home directory is the current directory. + +``` +cd ~ +``` + +In the home directory, create the example file. This can be named anything but _learnToScript.sh_ will be used in this article. + +``` +touch learnToScript.sh +``` + +From this point there will be a file called _learnToScript.sh_ in your home directory. Verify it exists and also notice the privileges for that file are -rw-rw-r– by typing the following. + +``` +ls -l +``` + +``` +[zexcon@trinity ~]$ ls -l +total 7 +drwxr-xr-x. 1 zexcon zexcon 90 Aug 30 13:08 Desktop +drwxr-xr-x. 1 zexcon zexcon 80 Sep 16 08:53 Documents +drwxr-xr-x. 1 zexcon zexcon 1222 Sep 16 08:53 Downloads +-rw-rw-r--. 1 zexcon zexcon 70 Sep 17 10:10 learnToScript.sh +drwxr-xr-x. 1 zexcon zexcon 0 Jul 7 16:04 Music +drwxr-xr-x. 1 zexcon zexcon 318 Sep 15 13:53 Pictures +drwxr-xr-x. 1 zexcon zexcon 0 Jul 7 16:04 Public +drwxr-xr-x. 1 zexcon zexcon 0 Jul 7 16:04 Videos +[zexcon@trinity ~]$ +``` + +There is one more thing that needs to be done to get started. Let’s try and execute the script with nothing written in it. Type the following: + +``` +./learnToScript.sh +``` + +``` +[zexcon ~]$ ./learnToScript.sh +bash: ./learnToScript.sh: Permission denied +``` + +You get permission denied because there are no execute permissions on the file. You need to change the permissions of the file to be able to execute the script. If you are not familiar with permissions I would recommend reading the Fedora Magazine articles written by [Paul W. Frields][4] + +> [Command line quick tips: Permissions][5] + +> [Command line quick tips: More about permissions][6] + +At this point you’ve brushed up on permissions, so back to the terminal and let’s change the _learnToScript.sh_ file so it will execute. Type in the following to allow execution of the file. + +``` +chmod 755 learnToScript.sh +``` + +``` +[zexcon@trinity ~]$ ls -l +total 7 +drwxr-xr-x. 1 zexcon zexcon 90 Aug 30 13:08 Desktop +drwxr-xr-x. 1 zexcon zexcon 80 Sep 16 08:53 Documents +drwxr-xr-x. 1 zexcon zexcon 1222 Sep 16 08:53 Downloads +-rwxr-xr-x. 1 zexcon zexcon 70 Sep 17 10:10 learnToScript.sh +drwxr-xr-x. 1 zexcon zexcon 0 Jul 7 16:04 Music +drwxr-xr-x. 1 zexcon zexcon 318 Sep 15 13:53 Pictures +drwxr-xr-x. 1 zexcon zexcon 0 Jul 7 16:04 Public +drwxr-xr-x. 1 zexcon zexcon 0 Jul 7 16:04 Videos +[zexcon@trinity ~]$ +``` + +Okay now you’re ready, you have read, write and execute permissions (-rwxr-x r-x) to the _learnToScript.sh_ command. + +### Editing a script file + +Take a moment and make certain you are familiar with _vim_ or any text editor. Throughout this article I will be utilizing _vim_. At the command prompt type the following: + +``` +vim learnToScript.sh +``` + +This will bring you to an empty text file with a bunch of tildes in it. Type _i_ on your keyboard and this will move you into — INSERT — mode. You can see it’s in this mode by looking at the bottom left of the terminal window. (Note that an alternative editor is the [_nano_ editor][7].) + +From here you need to make sure that the file is recognized by the correct interpreter. So enter the shebang ( #! ) and the directory to your bash, /bin/bash: + +``` +#!/bin/bash +``` + +One last thing that you will use throughout the article is saving the document. Hit _Esc_ to leave input mode, then Shift + Colon. At the colon you will enter _wq_. This will write(_w_) the file and quit(_q_) _vim_ once you hit enter. + +A few things to remember while using _vi_m, anytime you want to write into a document you need to enter _i_ and you will see –INSERT– at the bottom. Anytime you want to save, you will need to hit _Esc_ to leave input mode, and then _Shift+:_ to enter _w_ to write the file or _Esc_ then _Shift+:_ to enter _q_ to quit and not save. Or add both _wq_ together and it will write and close. _Esc_ by itself will exit INSERT mode. You can find much more about _vim_ at it’s [website][8] or this [get started][9] site. + +## Lets start scripting… + +### echo + +The _echo_ command is used to return something to the terminal. You will notice that you can use single quotes, double quotes or no quotes. So let’s take a look at it with a traditional Hello World! + +``` +#!/bin/bash + +echo Hello World! +echo 'Hello World!' +echo "Hello World!" +``` + +``` +[zexcon ~]$ ./learnToScript.sh +Hello World! +Hello World! +Hello World! +[zexcon ~]$ +``` + +Notice that you get the same result with all three options. This is not always the case but in this basic script it is. In some circumstances the type of quotes will make a difference. By the way, congratulations you have written your first Bash script. Let’s look at a few things that you will want to know as you continue to create more scripts and let your mind run wild. + +### Command Substitution $( ) or ` ` + +Command substitution allows you to get the results of a command you might execute at the command line and write that result to a variable. For example if you type _ls_ at the command prompt you will get a list of the current working directory. So let’s put this into practice. You have two options for command substitution. Note that the first option uses a back tick found above the Tab key on the left side of the keyboard. It is paired with the tilde ~ key. The second option uses a shell variable. + +``` +#!/bin/bash + +command1=`ls` +echo $command1 + +command2=$(ls) +echo $command2 +``` + +``` +[zexcon ~]$ ./learnToScript.sh +Desktop Documents Downloads learnToScript.sh Music Pictures Public snap Videos +Desktop Documents Downloads learnToScript.sh Music Pictures Public snap Videos +[zexcon ~]$ +``` + +Notice no space between the variable, equal sign, and the start of the command. You get the exact same result with both options. Note that variables need to be led by a dollar sign. If you forget and you echo out the command variable without the dollar sign you will just see the name of the command as shown in the next example. + +``` +#!/bin/bash + +command1=`ls` +echo command1 + +command2=$(ls) +echo command2 +``` + +``` +[zexcon ~]$ ./learnToScript.sh +command1 +command2 +[zexcon ~]$ +``` + +### Double Parenthesis (()) + +So what are double parenthesis for? Double parenthesis are simple, they are for mathematical equations. + +``` +#!/bin/bash + +echo $((5+3)) +echo $((5-3)) +echo $((5*3)) +echo $((5/3)) +``` + +``` +[zexcon ~]$ ./learnToScript.sh +8 +2 +15 +1 +[zexcon ~]$ +``` + +## Conclusion + +At this point we have created our first script. We have an idea how to take several commands, place them in a script and run it to get the results. We will continue this discussion in the next article and look at redirection of input and output, the pipe command, using double brackets or maybe just adding some comments. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/bash-shell-scripting-for-beginners-part-1/ + +作者:[zexcon][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/09/bash_shell_scripting_pt1-816x345.jpg +[2]: https://unsplash.com/@nbandana?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[3]: https://unsplash.com/s/photos/shell-scripting?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[4]: http://pfrields.id.fedoraproject.org/ +[5]: https://fedoramagazine.org/command-line-quick-tips-permissions/ +[6]: https://fedoramagazine.org/command-line-quick-tips-more-about-permissions/ +[7]: https://fedoramagazine.org/gnu-nano-minimalist-console-editor/ +[8]: https://www.vim.org/docs.php +[9]: https://linuxhandbook.com/basic-vim-commands/ From 732d099b910d54bd2ff18dc3860ef187e03f7a14 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Sep 2021 05:02:37 +0800 Subject: [PATCH 0513/1588] add done: 20210927 Bash Shell Scripting for beginners (Part 1).md --- sources/tech/20210927 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210927 .md diff --git a/sources/tech/20210927 .md b/sources/tech/20210927 .md new file mode 100644 index 0000000000..af3cc59271 --- /dev/null +++ b/sources/tech/20210927 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/remove-firefox-snap-ubuntu/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 82d04264df184ccf5c442237c5b4f73455a30dd3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Sep 2021 05:02:57 +0800 Subject: [PATCH 0514/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210927?= =?UTF-8?q?=205=20open=20source=20alternatives=20to=20Zoom?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210927 5 open source alternatives to Zoom.md --- ...0927 5 open source alternatives to Zoom.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20210927 5 open source alternatives to Zoom.md diff --git a/sources/tech/20210927 5 open source alternatives to Zoom.md b/sources/tech/20210927 5 open source alternatives to Zoom.md new file mode 100644 index 0000000000..a1ae0f4640 --- /dev/null +++ b/sources/tech/20210927 5 open source alternatives to Zoom.md @@ -0,0 +1,71 @@ +[#]: subject: "5 open source alternatives to Zoom" +[#]: via: "https://opensource.com/article/21/9/alternatives-zoom" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 open source alternatives to Zoom +====== +Try one of these open source video conferencing services. +![Two people chatting via a video conference app][1] + +I recently attended the [Practical Open Source Information POSI][2] conference, which was held on a free and open source video conferencing platform. As I attended a series of excellent talks about practical uses of open source software, I realized how commonplace video conferencing had become over the past few years. + +If open source does anything, it provides choice, and now that more and more workers have the freedom of working remotely, having an option in the way you connect makes a lot of sense. + +Sometimes, you need a full-featured video conferencing application with moderation, a presentation mode, and breakout rooms, while other times, all you want to do is make a quick call to a friend so that you can see each other's faces. + +### Jitsi + +[Jitsi][3] is an easy, casual, but robust video calling platform. You can self host it or use it on the public instance at [meet.jit.si][4]. It's got customizable URLs that make it easy to share links with friends you want to meet with, in-call chat, administrative controls, and call recording. It's very actively developed and has a whole collection of new features being tested and released each year. It's the platform Opensource.com uses for our weekly meetings. + +### Signal + +[Signal][5] is already a popular security-focused chat application, and it recently added [group video calls][6] to its features. The video calls are great for simple meetings, and because you can only meet with other people in your Signal contact list, there's no concern over unwanted guests at your video call party. There's also no back and forth "phone tag" as you try to locate the virtual room you're supposed to be meeting in. It all happens in Signal, so there's no guesswork required. + +Signal itself is pretty intuitive, and the video feature fits neatly into its existing conventions. In short, as long as your contacts are using Signal, this is a no-effort video calling platform. This is the application I use for personal contacts, and I regularly use its video calling feature to connect to friends and family. + +### P2p.chat + +[P2p.chat][7] is the easiest of them all, in both design and implementation. Working through Web Real-Time Communication (WebRTC), p2p.chat is a web application that allows you to connect directly to the person you're calling, with no host server required. There's not much to the p2p.chat interface, but that's another part of its appeal. There's no administrative control or presentation mode because p2p.chat is very much the "vidphone" promised in sci-fi: A casual, no-effort person-to-person (or people-to-people) video call with somebody far away. + +You use custom URLs to create a meeting space dynamically, so they're relatively easy to remember (aside from the small randomized part) and type. I use p2p.chat with friends who aren't on Signal, and it's never let me down. + +### BigBlueButton + +Designed for classrooms, conferences, and presentations, [BigBlueButton][8] is the solution you're looking for if you need strict admin controls and extreme flexibility. With BigBlueButton, you can mute all participants, block and kick a participant, create breakout rooms, create a collaborative whiteboard, share screens, give presentations, and record sessions. Participants can raise a digital hand for attention and set their status as a non-verbal method of communication. It's easy to use, but it's a serious platform for focused and very large groups. I've attended a few technical conferences using BigBlueButton, including the [Practical Open Source Information (POSI)][2] conference. + +### Wire + +[Wire][9] is an excellent choice for corporate customers looking for a hosted video chat and groupware client. Licensed under the [AGPL][10], this open source project is available for desktop and server, Android, and iOS. It features video calling, messaging, and file sharing, so even a remote meeting essentially has all the conveniences of meeting in person. You can try Wire for free for a limited time and then purchase a support contract for your company. Alternately, you can host it yourself. + +### Open source video chat + +There's no reason to settle for proprietary video calling hosted by companies you may not fully trust. The open source options available today are great for keeping in touch with all the people in your professional and personal life. Try one of these solutions the next time you want to meet with friends. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/alternatives-zoom + +作者:[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/chat_video_conference_talk_team.png?itok=t2_7fEH0 (Two people chatting via a video conference app) +[2]: https://opensource.org/posicfp +[3]: http://jitsi.org +[4]: http://meet.jit.si +[5]: https://signal.org +[6]: https://support.signal.org/hc/en-us/articles/360052977792-Group-Calling-Voice-or-Video-with-Screen-Sharing +[7]: https://p2p.chat/ +[8]: https://bigbluebutton.org/ +[9]: https://wire.com/en/ +[10]: https://opensource.org/licenses/AGPL-3.0 From 00985aa93896f92e363e9122553e701bc518c279 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Sep 2021 05:03:16 +0800 Subject: [PATCH 0515/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210927?= =?UTF-8?q?=20Why=20nonprofit=20organizations=20choose=20open=20source=20s?= =?UTF-8?q?oftware?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210927 Why nonprofit organizations choose open source software.md --- ...ganizations choose open source software.md | 90 +++++++++++++++++++ 1 file changed, 90 insertions(+) create mode 100644 sources/tech/20210927 Why nonprofit organizations choose open source software.md diff --git a/sources/tech/20210927 Why nonprofit organizations choose open source software.md b/sources/tech/20210927 Why nonprofit organizations choose open source software.md new file mode 100644 index 0000000000..69c24ead75 --- /dev/null +++ b/sources/tech/20210927 Why nonprofit organizations choose open source software.md @@ -0,0 +1,90 @@ +[#]: subject: "Why nonprofit organizations choose open source software" +[#]: via: "https://opensource.com/article/21/9/nonprofit-open-source" +[#]: author: "Michael Korotaev https://opensource.com/users/michaelk" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why nonprofit organizations choose open source software +====== +Open source software increases in importance as more European nonprofits +shift to products like Nextcloud and ONLYOFFICE. +![4 books that spell out open][1] + +With tech and data safety awareness rising, open source software is becoming a go-to option for organizations of all classes more than ever. Nonprofit organizations are particularly vulnerable on the financial side while at the same time dealing with vital social and environmental issues. + +This article observes the adoption of open source collaboration technologies in nonprofit organizations by using [Nextcloud][2] and [ONLYOFFICE][3] as examples. + +### Transparency and security + +Open source is basically democracy written in code: It liberates and democratizes knowledge, gives access to vital technology to governmental and social institutions in all communities, and pursues the idea of transparency. + +People and organizations can access and reuse the software code. At the same time, contributors bear individual responsibility for the quality of their products and are more driven by initiative and ideas and much less by profit. + +Open source applications are seen as more reliable than proprietary solutions with source code reserved to a single vendor who decides how user’s data is handled and is in many cases the only observing party to this process. + +According to the latest [State of Enterprise Open Source report][4], the enterprise use of open source is expected to grow with 79% of surveyed IT leaders willing to build up their use of open source in the next two years. + +### Universal access to collaborative tools + +For decades, Microsoft and Google have been the de-facto standard for collaboration tools. But privacy and security concerns, together with a massive boost in cloud collaboration usage over the pandemic, have ramped up nonprofits' preference for open source tools. + +For nonprofit organizations, open source is a way to cut expenses by providing their employees and contributors with core collaboration tools such as content management and sharing environments, online office, and communication tools to manage operations, organize data, and create content. + +One example of an all-in-one system that sees constant growth in popularity among nonprofit organizations in Europe is Nextcloud. It is a free and secure sharing platform that combines document management space with various productivity add-ons. It also integrates with ONLYOFFICE Docs for document editing and collaboration functionality. + +### ONLYOFFICE and Nextcloud in practice + +Over the past year, several nonprofit organizations with diversified profiles have joined the users of Nexcloud and ONLYOFFICE. Some are newly in business and some are switching from proprietary solutions seeking a better match to handle their jobs. + +#### Sea-Watch + +[Sea-Watch][5] is a rescue organization that provides emergency aid for civilians in the Mediterranean amidst the ongoing refugee crisis and has saved over 38,000 lives to date. It has deployed a collaborative system for its 90 employees and over 400 volunteers. + +After having tried several free online solutions to maintain internal document flow and collaboration, Sea-Watch now relies on open source software to be more and more protective of the security and privacy of the organization’s data and the personal information of its employees and volunteers. + +Sea-Watch finds the solution to this problem by combining the Nextcloud file sharing platform with ONLYOFFICE online editors to enable secure editing and collaboration on documents online using the organization’s own physical infrastructure. + +#### Vegan in Leipzig + +[Vegan in Leipzig][6], a young activist association in Germany, advocates for animal rights and promotes a vegan diet and lifestyle. Around 100 people in the organization’s team work on creating vegan dining maps, scheduling and promoting related events, and uniting online communities to collect and organize all information for Leipzig’s vegan community and allies in one place. + +Vegan in Leipzig has been using Nextcloud to facilitate the organization’s internal file management and content sharing. A reliable and free platform for community users, Nextcloud is built to provide a sharing space of required scale for distributed teams and incorporating online communication tools such as videoconferencing and chat. + +In March 2021, the organization introduced its contributors to ONLYOFFICE editors integrated with Nextcloud for online collaboration on shared files, including documents, spreadsheets, and presentations. + +“Our employees are almost 100% satisfied. For now, there have been no complaints, feature requests, or reports of technical problems. As an administrator, I would go even further and say that ONLYOFFICE is the part of our application landscape that requires by far the least maintenance,” says Christo H., a volunteer administrator with Vegan in Leipzig. + +#### Wegweiser + +Among various nonprofit organizations grounded in helping struggling societal groups, one plays a vital role in the German social agenda: Wegweiser. The organization helps people with mental and physical disabilities integrate into society by dealing with daycare organizations, outpatient care, and school-to-employment transfer. + +Wegwiser had been using SharePoint for managing its content and documentation, but with growing concerns for the privacy of processed data, the organization opted for a Nextcloud and ONLYOFFICE combination to ensure full control over data in its own sovereign infrastructure. Wegweiser uses Nextcloud to document daily work, accounting and controlling, simultaneous document editing, and working with Microsoft Office-formatted documents. + +### Wrap up + +The list can be continued by numerous nonprofit organizations that have recently become users of Nextcloud and ONLYOFFICE, including The German Life Saving Association, Foodsharing Austria, and International Youth Community Services. + +Stories like this show that it’s not only cost-cutting that defines the value of open source for the global community but also the vitality of universal access to technology and knowledge. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/nonprofit-open-source + +作者:[Michael Korotaev][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/michaelk +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/EDU_OSDC_BYU_520x292_FINAL.png?itok=NVY7vR8o (4 books that spell out open) +[2]: https://nextcloud.com/ +[3]: https://www.onlyoffice.com/ +[4]: https://www.redhat.com/en/enterprise-open-source-report/2021 +[5]: https://sea-watch.org/en/ +[6]: https://www.vegan-in-leipzig.de/ From e811f6d178e849aefc08cced5b0987d9a48adc91 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Sep 2021 05:03:34 +0800 Subject: [PATCH 0516/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210927?= =?UTF-8?q?=20Install=20Java=20from=20your=20Linux=20distribution's=20repo?= =?UTF-8?q?sitories?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210927 Install Java from your Linux distribution-s repositories.md --- ... your Linux distribution-s repositories.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20210927 Install Java from your Linux distribution-s repositories.md diff --git a/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md b/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md new file mode 100644 index 0000000000..0a172b8529 --- /dev/null +++ b/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md @@ -0,0 +1,123 @@ +[#]: subject: "Install Java from your Linux distribution's repositories" +[#]: via: "https://opensource.com/article/21/9/install-java-linux-repositories" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install Java from your Linux distribution's repositories +====== +Regardless of which distribution and package manager you prefer, it is +easy to get Java on your Linux system. +![Coffee beans and a cup of coffee][1] + +There are a number of different ways to install Java on your Linux desktop. An obvious route is to use the packages provided in your Linux distribution. Note that this doesn’t work for everyone; for example, some users may need a very specific version of Java. + +Before you can start, you must determine “which Java” you need. Do you just need to run some `.class` files or a `.jar` file? Or are you writing some code that you need to compile? + +In my case, most of the Java I run is Java that I have (at least partly) written myself, so it always makes sense to install the full Java Development Kit, or JDK, which comes with a Java compiler, libraries, and some really useful utilities. And of course, hereabouts, we give preference to the open source JDK, called [OpenJDK][2]. + +Since I primarily work on the Ubuntu Linux distribution, my package manager is `apt`. I can use `apt` to find out which OpenJDK packages are available: + + +``` +`apt list OpenJDK\*` +``` + +The output of this command looks like: + + +``` +Listing... Done +openjdk-11-dbg/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-dbg/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-demo/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-demo/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-doc/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 11.0.11+9-0ubuntu2 all +openjdk-11-jdk-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jdk-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-jdk/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jdk/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-jre-dcevm/hirsute 11.0.10+1-1 amd64 +openjdk-11-jre-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jre-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-jre-zero/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jre-zero/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-jre/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jre/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-source/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 11.0.11+9-0ubuntu2 all +openjdk-15-dbg/hirsute 15.0.3+3-1 amd64 +openjdk-15-dbg/hirsute 15.0.3+3-1 i386 +openjdk-15-demo/hirsute 15.0.3+3-1 amd64 +... +openjdk-8-jre/hirsute-updates,hirsute-security 8u292-b10-0ubuntu1 i386 +openjdk-8-source/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 8u292-b10-0ubuntu1 all +``` + +I have elided quite a few lines above with `...`. + +It turns out that, even though I’m limiting myself to the OpenJDK, I still have plenty of options for: + + * The architecture (in my case, whether i386 or amd64). + * The version of Java (in my case, whether 8, 11, 15, 16, 17). + * The pure OpenJDK or the headless version. + * The Java Runtime Environment or JRE. + * Options for debugging, demo, source code, etc. + + + +Again, in my case, primarily, I’m just interested in the pure vanilla OpenJDK. + +Supposing then I want to install the Java 11 version of the plain vanilla OpenJDK for my amd64 architecture, I can type: + + +``` +`sudo apt install -a=amd64 openjdk-11-jdk` +``` + +A few minutes later, I’ll be able to compile, run, debug, and package my Java code. + +Note that it’s quite possible, and sometimes even desirable, to have multiple versions of Java installed simultaneously. In the case of Ubuntu, there is a useful utility called `update-java-alternatives` that [displays and configures which java environment][3] to use at any point in time. + +Those of you using a different Linux distro can, in general, take a similar approach. Several other distros (such as Debian and Mint) also use `apt`, though the available packages may differ. Other distros use different package managers. For example, [the Fedora documentation page for Installing Java][4] shows how to use the Fedora `dnf` package manager to handle the installation. First, to show the available version, type: + + +``` +`dnf search openjdk` +``` + +Next, to install the full development x86_64 architecture version, type: + + +``` +`sudo dnf install java-11-openjdk-devel.x86_64` +``` + +Similarly, Fedora provides the `alternatives` utility to [display and configure the Java environment][5]. + +For another example, the [wonderful Arch Linux wiki][6] shows the corresponding package is `jdk11-openjdk`**.** The wiki also explains many other important details related to using Java in Arch, such as using the `archlinux-java` utility to show what Java environments are installed or select a different default environment. Arch uses a package manager called `pacman`, which is also documented [here on the Arch Linux wiki][7]. + +Regardless of which distribution and package manager you prefer, it is easy to get Java on your Linux system. Consider version and function, of course, before installing. Also keep in mind that there are options for managing two or more Java versions on the same computer. Most of my examples used `apt`, but keep in mind the `dnf` options, too. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/install-java-linux-repositories + +作者:[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/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) +[2]: https://openjdk.java.net/ +[3]: http://manpages.ubuntu.com/manpages/hirsute/man8/update-java-alternatives.8.html +[4]: https://docs.fedoraproject.org/en-US/quick-docs/installing-java/ +[5]: https://tecadmin.net/install-java-on-fedora/ +[6]: https://wiki.archlinux.org/title/java#OpenJDK +[7]: https://wiki.archlinux.org/title/pacman#Querying_package_databases From 7b83549ccf4df7feac4de7337e4951f12f82dc8d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Sep 2021 05:04:57 +0800 Subject: [PATCH 0517/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210927?= =?UTF-8?q?=20Brave=20Launches=20Privacy-Focused=20=E2=80=9CBrave=20Talk?= =?UTF-8?q?=E2=80=9D=20as=20a=20Desperate=20Attempt=20to=20Push=20Brave=20?= =?UTF-8?q?Advertisements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md --- ...te Attempt to Push Brave Advertisements.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md diff --git a/sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md b/sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md new file mode 100644 index 0000000000..338aff0972 --- /dev/null +++ b/sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md @@ -0,0 +1,86 @@ +[#]: subject: "Brave Launches Privacy-Focused “Brave Talk” as a Desperate Attempt to Push Brave Advertisements" +[#]: via: "https://news.itsfoss.com/brave-talk/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Brave Launches Privacy-Focused “Brave Talk” as a Desperate Attempt to Push Brave Advertisements +====== + +Ever since the initial Covid-19 outbreak in 2020, the world has seen an explosion in the popularity of online meeting services. Unfortunately, many of these are not very privacy-friendly, especially as many of these are offered by notoriously data-hungry advertising companies. + +However, the company behind the wildly successful Brave browser has developed a privacy-friendly solution, “Brave Talk.” + +### Brave Talk: Open-Source Based Video Conferencing + +![][1] + +Unlike Zoom and Google Meet, Brave Talk is a piece of new video conferencing software that aims to provide better privacy than its competitors. + +It is based on an open-source video conferencing solution i.e., [Jitsi][2], and claims to track no user data. + +As a Brave service, alongside Brave News and Search, Brave Talk is integrated directly into the browser. While this makes it more convenient to start calls, it could be a push to promote the web browser more than ever. + +Like Apple’s FaceTime, Brave Talk calls can only be started from a specific browser, which is Brave. This is in contrast to many other [open-source video conferencing services][3]. + +### The Push for Brave Advertising Network + +![][4] + +Another thing that many people may point out is that it requires the use of Brave tokens. These are kind of like frequent flyer points, except for use digitally by viewing ads. + +For me, this wasn’t very clear, as Brave Talk never seemed to actually do anything with these tokens. + +So, the users need to opt for Brave rewards if they want to use the service for free. + +**Editor’s Thoughts:** Doesn’t it sound like an aggressive push to promote Brave’s advertising network? + +Considering that it utilizes an open-source technology, it not only restricts to a particular web browser, the requirement of enabling “Brave Rewards” may seem to be a bit extreme just because it promises total privacy? + +Of course, it is just a thought here. If the user (you) do not have any problem turning on “Brave Rewards,” Brave’s privacy-focused advertising network, and switching to Brave web browser, you may find Brave Talk an exciting option. + +![][5] + +### Final Thoughts + +I believe that as a privacy-centric offering, Brave Talk sounds good on paper. + +It may even offer a decent call quality and an engaging UI, among other things. Also, it should be mentioned that there are two tiers: a free tier and a premium option of **$7/month** with more features. + +If you are already using Brave Rewards and have no issues with their private advertising service, it could be a good option for you. It may not be a convenient option for users who do not use the Brave web browser or do not prefer the Brave Rewards system. + +If you want to try Brave Talk out for yourself, you will need the Brave browser. For more details, you can refer to the [official announcement][6]. + +[Brave Talk][7] + +_What do you think about Brave Talk? 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/brave-talk/ + +作者:[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,PHN2ZyBoZWlnaHQ9IjQxOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://itsfoss.com/jitsi-meet/ +[3]: https://itsfoss.com/open-source-video-conferencing-tools/ +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://brave.com/brave-talk-launch/ +[7]: https://talk.brave.com From 07b1d3f3797c77315f5f96fb64e4c6337d16b404 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 28 Sep 2021 05:05:07 +0800 Subject: [PATCH 0518/1588] add done: 20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md --- sources/tech/20210928 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210928 .md diff --git a/sources/tech/20210928 .md b/sources/tech/20210928 .md new file mode 100644 index 0000000000..2bc20bbf4b --- /dev/null +++ b/sources/tech/20210928 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/xerolinux-review/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 973e8c67a185c62490e5df02e6b49b55addd7d02 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Tue, 28 Sep 2021 07:59:25 +0800 Subject: [PATCH 0519/1588] translating by perfiffer --- sources/tech/20210923 Build your website with Jekyll.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210923 Build your website with Jekyll.md b/sources/tech/20210923 Build your website with Jekyll.md index d177ed0d2c..c322fe4937 100644 --- a/sources/tech/20210923 Build your website with Jekyll.md +++ b/sources/tech/20210923 Build your website with Jekyll.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/build-website-jekyll" [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 2a385b29e9440ea19b0ec9e314c1eff16efa3743 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 28 Sep 2021 08:31:35 +0800 Subject: [PATCH 0520/1588] Delete 20210928 .md --- sources/tech/20210928 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210928 .md diff --git a/sources/tech/20210928 .md b/sources/tech/20210928 .md deleted file mode 100644 index 2bc20bbf4b..0000000000 --- a/sources/tech/20210928 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/xerolinux-review/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From b5221915428803ecb39f54c9b80f2f0a66a9c495 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 28 Sep 2021 08:33:43 +0800 Subject: [PATCH 0521/1588] Delete 20210927 .md --- sources/tech/20210927 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210927 .md diff --git a/sources/tech/20210927 .md b/sources/tech/20210927 .md deleted file mode 100644 index af3cc59271..0000000000 --- a/sources/tech/20210927 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/remove-firefox-snap-ubuntu/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 437e07e4f70f5228d81956ac1d21840ccf096f8e Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 28 Sep 2021 08:36:03 +0800 Subject: [PATCH 0522/1588] Rename sources/tech/20210927 Why nonprofit organizations choose open source software.md to sources/talk/20210927 Why nonprofit organizations choose open source software.md --- ...927 Why nonprofit organizations choose open source software.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210927 Why nonprofit organizations choose open source software.md (100%) diff --git a/sources/tech/20210927 Why nonprofit organizations choose open source software.md b/sources/talk/20210927 Why nonprofit organizations choose open source software.md similarity index 100% rename from sources/tech/20210927 Why nonprofit organizations choose open source software.md rename to sources/talk/20210927 Why nonprofit organizations choose open source software.md From 1685ea6c6b4a2d13ad64aff9ef35e89cf4c1cbd9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 Sep 2021 08:50:05 +0800 Subject: [PATCH 0523/1588] translated --- ...ource alternative to Microsoft Exchange.md | 80 ------------------- ...ource alternative to Microsoft Exchange.md | 79 ++++++++++++++++++ 2 files changed, 79 insertions(+), 80 deletions(-) delete mode 100644 sources/tech/20210924 An open source alternative to Microsoft Exchange.md create mode 100644 translated/tech/20210924 An open source alternative to Microsoft Exchange.md diff --git a/sources/tech/20210924 An open source alternative to Microsoft Exchange.md b/sources/tech/20210924 An open source alternative to Microsoft Exchange.md deleted file mode 100644 index 4d698eca5c..0000000000 --- a/sources/tech/20210924 An open source alternative to Microsoft Exchange.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: subject: "An open source alternative to Microsoft Exchange" -[#]: via: "https://opensource.com/article/21/9/open-source-groupware-grommunio" -[#]: author: "Markus Feilner https://opensource.com/users/mfeilner" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -An open source alternative to Microsoft Exchange -====== -Open source users now have a robust and fully functional choice for -groupware. -![Working on a team, busy worklife][1] - -Microsoft Exchange has for many years been nearly unavoidable as a platform for groupware environments. Late in 2020, however, an Austrian open source software developer introduced [grommunio][2], a groupware server and client with a look and feel familiar to Exchange and Outlook users. - -The grommunio project functions well as a drop-in replacement for Exchange. The developers connect components to the platform the same way Microsoft does, and they support RPC (Remote Procedure Call) with the HTTP protocol. According to the developers, grommunio also includes numerous interfaces of common groupware such as IMAP, POP3, SMTP, EAS (Exchange ActiveSync), EWS (Exchange Web Services), CalDAV, and CardDAV. With such broad support, grommunio integrates smoothly into existing infrastructures. - -Users will notice little difference among Outlook, Android, and iOS clients. Of course, as open source software, it supports other clients, too. Outlook and smartphones communicate with grommunio just as they do with a Microsoft Exchange server, thanks to their integrated, native Exchange protocols. An everyday enterprise user can continue to use their existing clients with the grommunio server quietly running in the background. - -### More than just mail - -In addition to mail functions, a calendaring system is available in the grommunio interface. Appointments can be created by clicking directly in the calendar display or in a new tab. It's intuitive and just what you'd expect from a modern tool. Users can create, manage, and share calendars as well as address books. Private contacts or common contacts are possible, and you can share everything with colleagues. - -Task management shows a list of tasks on the left in a drop-down menu, and they can have both one owner and multiple collaborators. You can assign deadlines, categories, attachments, and other attributes to each task. In the same way, notes can be managed and shared with other team members. - -### Chat, video conferences, and file sync - -In addition to all the standard features of modern groupware, grommunio also offers chat, video conferencing, and file synchronization. It does this with full integration on a large scale for the enterprise, with extraordinarily high performance. It's an easy choice for promoters of open source and a powerful option for sysadmins. Because grommunio aims to integrate rather than reinvent, all components are standard open source tools. - -![Screenshot of grommunio meeting space][3] - -Jitsi integration for advanced video conferences (Markus Feilner, [CC BY-SA 4.0][4]) - -Behind the meeting function in grommunio is [Jitsi][5], smoothly integrated into the grommunio UI with a familiar user interface. The chat feature, fully integrated and centrally managed, is based on [Mattermost][6]. - -![Screenshot of grommunio's town square for chat][7] - -Mattermost for chat (Markus Feilner, [CC BY-SA 4.0][4]) - -[ownCloud][8], which promises enterprise-level file sharing and synchronization, starts after a click on the Files button. - -![Screenshot of grommunio file sharing space][9] - -ownCloud for file synchronization and exchange (Markus Feilner, [CC BY-SA 4.0][4]) - -The grommunio project has a powerful administrative interface, including roles, domain and organization management, predictive monitoring, and a self-service portal. Shell-based wizards guide admins through installation and migration of data from Microsoft Exchange. The development team is constantly working for better integration and more centralization for management, and with that comes a better workflow for admins. - -![Screenshot of grommunio dashboards][10] - -grommunio's admin interface (Markus Feilner, [CC BY-SA 4.0][4]) - -### Explore grommunio - -The grommunio project has lofty goals, but its developers have put in the work, and it shows. A German hosting service specializing in tax consultants—a sector where German data protection laws are especially tough—recently announced that grommunio is available to their customers. The grommunio project gets a lot right: a clean combination of existing, successful concepts working together to enable open, secure, and privacy-compliant communication. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/open-source-groupware-grommunio - -作者:[Markus Feilner][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/mfeilner -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) -[2]: https://grommunio.com/en/ -[3]: https://opensource.com/sites/default/files/uploads/jitsi_0.png (grommunio meeting space) -[4]: https://creativecommons.org/licenses/by-sa/4.0/ -[5]: https://opensource.com/article/20/5/open-source-video-conferencing -[6]: https://opensource.com/education/16/3/mattermost-open-source-chat -[7]: https://opensource.com/sites/default/files/uploads/mattermost.png (grommunio's town square for chat) -[8]: https://owncloud.com/ -[9]: https://opensource.com/sites/default/files/uploads/owncloud_0.png (Owncloud for file synchronization and exchange) -[10]: https://opensource.com/sites/default/files/uploads/grommunio_interface_0.png (Screenshot of grommunio dashboards) diff --git a/translated/tech/20210924 An open source alternative to Microsoft Exchange.md b/translated/tech/20210924 An open source alternative to Microsoft Exchange.md new file mode 100644 index 0000000000..9903696e39 --- /dev/null +++ b/translated/tech/20210924 An open source alternative to Microsoft Exchange.md @@ -0,0 +1,79 @@ +[#]: subject: "An open source alternative to Microsoft Exchange" +[#]: via: "https://opensource.com/article/21/9/open-source-groupware-grommunio" +[#]: author: "Markus Feilner https://opensource.com/users/mfeilner" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Microsoft Exchange 的一个开源替代方案 +====== +开源用户现在有了一个强大的、功能齐全的群件选择。 +![Working on a team, busy worklife][1] + +多年来,Microsoft Exchange 作为群件环境的平台几乎是不可避免的。然而,在 2020 年末,一个奥地利的开源软件开发商推出了[grommunio][2],一个群件服务器和客户端,其外观和感觉对 Exchange 和 Outlook 用户所熟悉。 + +grmmunio 项目可以很好地替代 Exchange。开发者以与微软相同的方式将组件连接到平台上,它们支持 RPC (远程过程调用)与 HTTP 协议。据开发者介绍,grommunio 还包括许多常见的群件接口,如 IMAP、POP3、SMTP、EAS(Exchange ActiveSync)、EWS(Exchange Web Services)、CalDAV 和 CardDAV。有了这样广泛的支持,grommunio 可以顺利地整合到现有的基础设施中。 + +用户会注意到 Outlook、Android 和 iOS 客户端之间几乎没有区别。当然,作为开源软件,它也支持其他客户端。由于集成了本地 Exchange 协议,Outlook 和智能手机与 grommunio 的通信就像与 Microsoft Exchange 服务器一样。日常的企业用户可以继续使用他们现有的客户端,而 grommunio 服务器则在后台安静地运行。 + +### 不仅仅是邮件 + +除了邮件功能外,grommunio 界面还提供了日历系统。可以直接在日历显示中或在一个新标签中点击创建约会。这很直观,正是你对现代工具的期望。用户可以创建、管理和分享日历以及地址簿。私人联系人或普通联系人都是可能的,而且你可以与同事分享一切。 + +任务管理在左边的下拉菜单中显示任务列表,它们可以有一个所有者和多个合作者。你可以为每个任务指定截止日期、类别、附件和其他属性。笔记可以以同样的方式被管理并与其他团队成员共享。 + +### 聊天、视频会议和文件同步 + +除了现代群件的所有标准功能外,grommunio 还提供聊天、视频会议和文件同步功能。它为企业实现了大规模的全面整合,具有极高的性能。对于开源的推动者来说,这是一个简单的选择,对于系统管理员来说,这是一个强大的选择。因为 grommunio 的目标是整合而不是重新发明,所以所有的组件都是标准的开源工具。 + +![Screenshot of grommunio meeting space][3] + +用于高级视频会议的 Jitsi 集成(Markus Feilner, [CC BY-SA 4.0][4]) + +在 grommunio 会议功能的背后是 [Jitsi][5],它以熟悉的用户界面顺利地集成到 grommunio 的用户界面中。完全集成和集中管理的聊天功能是基于 [Mattermost][6]。 + +![Screenshot of grommunio's town square for chat][7] + +用于聊天的 Mattermost(Markus Feilner,[CC BY-SA 4.0][4]) + +用于文件同步和交换的 ownCloud(Markus Feilner,[CC BY-SA 4.0][4]) + +![Screenshot of grommunio file sharing space][9] + +用于文件同步和交换的 ownCloud(Markus Feilner,[CC BY-SA 4.0][4]) + +grommunio 项目有一个强大的管理界面,包括角色、域和组织管理、预测性监测和自助服务门户。基于 shell 的向导指导管理员完成安装和从 Microsoft Exchange 迁移数据。开发团队正在不断努力,以实现更好的整合和更集中的管理,并随之为管理员提供更好的工作流程。 + +![Screenshot of grommunio dashboards][10] + +grommunio 的管理界面(Markus Feilner, [CC BY-SA 4.0][4]) + +### 探索 grommunio + +grommunio 项目的目标很高,但它的开发者已经付出了努力,这一点很明显。一家专门从事税务咨询的德国托管服务机构最近宣布,他们的客户可以使用 grommunio,这是一个德国数据保护法特别严厉的行业。grommunio 项目做得很好:将现有的、成功的概念干净地结合在一起,实现了开放、安全和符合隐私的通信。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/open-source-groupware-grommunio + +作者:[Markus Feilner][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/mfeilner +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team_dev_email_chat_video_work_wfm_desk_520.png?itok=6YtME4Hj (Working on a team, busy worklife) +[2]: https://grommunio.com/en/ +[3]: https://opensource.com/sites/default/files/uploads/jitsi_0.png (grommunio meeting space) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/article/20/5/open-source-video-conferencing +[6]: https://opensource.com/education/16/3/mattermost-open-source-chat +[7]: https://opensource.com/sites/default/files/uploads/mattermost.png (grommunio's town square for chat) +[8]: https://owncloud.com/ +[9]: https://opensource.com/sites/default/files/uploads/owncloud_0.png (Owncloud for file synchronization and exchange) +[10]: https://opensource.com/sites/default/files/uploads/grommunio_interface_0.png (Screenshot of grommunio dashboards) From 748df54f4b63025a56c47dbe43a5d81ffc9b41c8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 28 Sep 2021 08:52:56 +0800 Subject: [PATCH 0524/1588] translating --- sources/tech/20210927 5 open source alternatives to Zoom.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210927 5 open source alternatives to Zoom.md b/sources/tech/20210927 5 open source alternatives to Zoom.md index a1ae0f4640..4121a4acc2 100644 --- a/sources/tech/20210927 5 open source alternatives to Zoom.md +++ b/sources/tech/20210927 5 open source alternatives to Zoom.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/alternatives-zoom" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 677214f939d57a1f8a28a1dc19e6aef9396bccd4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Sep 2021 11:58:54 +0800 Subject: [PATCH 0525/1588] PRF @geekpi --- ... scripts on different operating systems.md | 102 +++++++++--------- 1 file changed, 48 insertions(+), 54 deletions(-) diff --git a/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md b/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md index 6d034b1ace..376e4351a5 100644 --- a/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md +++ b/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md @@ -3,29 +3,29 @@ [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 使用 Vagrant 在不同的操作系统上测试你的脚本 ====== -Vagrant 可以帮助你在你的电脑上运行其他操作系统,这意味着你可以构建、测试、做古怪的事情而不毁坏你的系统。 -![Business woman on laptop sitting in front of window][1] -我使用 Vagrant 已经很长时间了。我使用几种 DevOps 工具,在一个系统上安装它们可能会变得很复杂。Vagrant 让你在不破坏系统的情况下做一些很酷的事情,因为你根本不需要在生产系统上做实验。 +> Vagrant 可以帮助你在你的电脑上运行其他操作系统,这意味着你可以构建、测试、疯狂折腾而不毁坏你的系统。 -如果你熟悉 [VirtualBox][2] 或 [GNOME Boxes][3],那么学习 Vagrant 很容易。Vagrant 有一个简单而干净的界面用于处理虚拟机。一个名为 `Vagrantfile` 的配置文件,允许你定制你的虚拟机(称为 _Vagrant boxes_)。一个简单的命令行界面让你启动、停止、暂停或销毁你的 box。 +![](https://img.linux.net.cn/data/attachment/album/202109/28/115827gv75kkrhnnhvkhcf.jpg) + +我使用 Vagrant 已经很长时间了。我使用几种 DevOps 工具,把它们全安装在一个系统上会搞得很乱。Vagrant 可以让你在不破坏系统的情况下随意折腾,因为你根本不需要在生产系统上做实验。 + +如果你熟悉 [VirtualBox][2] 或 [GNOME Boxes][3],那么学习 Vagrant 很容易。Vagrant 有一个简单而干净的界面用于管理虚拟机。一个名为 `Vagrantfile` 的配置文件,允许你定制你的虚拟机(称为 “Vagrant 盒子box”)。一个简单的命令行界面让你启动、停止、暂停或销毁你的“盒子”。 考虑一下这个简单的例子。 -假设你想写 Ansible 或 shell 脚本,在一个新的服务器上安装 Nginx。你不能在自己的系统上这样做,因为你可能没有运行想测试的操作系统,或者可能没有你想做的所有依赖项。启动新的云服务器进行测试可能会很费时和昂贵。这就是 Vagrant 派上用处的地方。你可以用它来启动一个虚拟机,用你的脚本来配置它,并证明一切按预期工作。然后,你可以删除这个 box,重新配置它,并重新运行你的脚本来验证它。你可以多次重复这个过程,直到你确信你的脚本在所有条件下都能工作。你可以将你的 Vagrant 文件提交给 Git,以确保你的团队正在测试完全相同的环境(因为他们将使用完全相同的测试机)。不再有“但它在我的机器上运行良好!”这事了。 +假设你想写 Ansible 或 shell 脚本,在一个新的服务器上安装 Nginx。你不能在你自己的系统上这样做,因为你运行的可能不是你想测试的操作系统,或者没有所有的依赖项。启动新的云服务器进行测试可能会很费时和昂贵。这就是 Vagrant 派上用处的地方。你可以用它来启动一个虚拟机,用你的脚本来配备provision它,并证明一切按预期工作。然后,你可以删除这个“盒子”,重新配备它,并重新运行你的脚本来验证它。你可以多次重复这个过程,直到你确信你的脚本在所有条件下都能工作。你可以将你的 Vagrantfile 提交给 Git,以确保你的团队正在测试完全相同的环境(因为他们将使用完全相同的测试机)。不会再有“但它在我的机器上运行良好!”这事了。 ### 开始使用 -First,[install Vagrant on your system][4]and then create a new folder to experiment in. In this new folder, create a new file namedwith these contents: 首先,[在你的系统上安装 Vagrant][4],然后创建一个新的文件夹进行实验。在这个新文件夹中,创建一个名为 `Vagrantfile` 的新文件,内容如下: - ``` Vagrant.configure("2") do |config| @@ -36,39 +36,37 @@ end 你也可以运行 `vagrant init ubuntu/hirsute64`,它将为你生成一个新的 Vagrant 文件。现在运行 `vagrant up`。这个命令将从 Vagrant 仓库中下载 `ubuntu/hirsuite64` 镜像。 - ``` Bringing machine 'default' up with 'virtualbox' provider... -==> default: Importing base box 'ubuntu/hirsute64'... -==> default: Matching MAC address for NAT networking... -==> default: Checking if box 'ubuntu/hirsute64' version '20210820.0.0' is up to date... -==> default: Setting the name of the VM: a_default_1630204214778_76885 -==> default: Clearing any previously set network interfaces... -==> default: Preparing network interfaces based on configuration... - default: Adapter 1: nat - default: Adapter 2: hostonly -==> default: Forwarding ports... - default: 22 (guest) => 2222 (host) (adapter 1) -==> default: Running 'pre-boot' VM customizations... -==> default: Booting VM... -==> default: Waiting for machine to boot. This may take a few minutes... - default: SSH address: 127.0.0.1:2222 - default: SSH username: vagrant - default: SSH auth method: private key - default: Warning: Remote connection disconnect. Retrying... - default: Warning: Connection reset. Retrying... - default: - default: Vagrant insecure key detected. Vagrant will automatically replace - default: this with a newly generated keypair for better security. - default: - default: Inserting generated public key within guest... - default: Removing insecure key from the guest if it's present... - default: Key inserted! Disconnecting and reconnecting using new SSH key... -==> default: Machine booted and ready! +==> default: Importing base box 'ubuntu/hirsute64'... +==> default: Matching MAC address for NAT networking... +==> default: Checking if box 'ubuntu/hirsute64' version '20210820.0.0' is up to date... +==> default: Setting the name of the VM: a_default_1630204214778_76885 +==> default: Clearing any previously set network interfaces... +==> default: Preparing network interfaces based on configuration... + default: Adapter 1: nat + default: Adapter 2: hostonly +==> default: Forwarding ports... + default: 22 (guest) => 2222 (host) (adapter 1) +==> default: Running 'pre-boot' VM customizations... +==> default: Booting VM... +==> default: Waiting for machine to boot. This may take a few minutes... + default: SSH address: 127.0.0.1:2222 + default: SSH username: vagrant + default: SSH auth method: private key + default: Warning: Remote connection disconnect. Retrying... + default: Warning: Connection reset. Retrying... + default: + default: Vagrant insecure key detected. Vagrant will automatically replace + default: this with a newly generated keypair for better security. + default: + default: Inserting generated public key within guest... + default: Removing insecure key from the guest if it's present... + default: Key inserted! Disconnecting and reconnecting using new SSH key... +==> default: Machine booted and ready! ``` -此时,如果你打开你的 Vagrant 后端(如 VirtualBox 或 virt-manager),你会看到你的 box 在那里。接下来,运行 `vagrant ssh` 登录到 box。如果你能看到 Vagrant 的提示,那么你就进入了! - +此时,如果你打开你的 Vagrant 后端(如 VirtualBox 或 virt-manager),你会看到你的“盒子”已经有了。接下来,运行 `vagrant ssh` 登录到“盒子”。如果你能看到 Vagrant 的提示符,那么你就进入了! ``` ~ vagrant ssh @@ -90,35 +88,31 @@ Welcome to Ubuntu 21.04 (GNU/Linux 5.11.0-31-generic x86_64) vagrant@ubuntu-hirsute:~$ ``` -Vagrant 使用“基础 box” 来启动你的本地机器。在我们的例子中,Vagrant 从 [Hashicorp 的 Vagrant 目录][5]下载 `ubuntu/hirsuite64` 镜像,并插入 VirtualBox 来创建实际的 box。 +Vagrant 使用“基础盒子”来建立你的本地机器。在我们的例子中,Vagrant 从 [Hashicorp 的 Vagrant 目录][5]下载 `ubuntu/hirsuite64` 镜像,并插入 VirtualBox 来创建实际的“盒子”。 ### 共享文件夹 -Vagrant 将你的当前文件夹映射到 Vagrant box 中的 `/vagrant`。这允许你在你的系统和 box 里保持文件同步。这对于测试 Nginx 网站是很好的,通过将你的文件根目录指向 `/vagrant`。你可以使用 IDE 进行修改,box 里的 Nginx 会提供这些修改。 +Vagrant 将你的当前文件夹映射到 Vagrant “盒子”中的 `/vagrant`。这允许你在你的系统和“盒子”里保持文件同步。这很适合测试 Nginx 网站,通过将你的文件根目录指向 `/vagrant`。你可以使用 IDE 进行修改,“盒子”里的 Nginx 会提供这些修改。 ### Vagrant 命令 -有几个 Vagrant 命令,你可以用它们来控制你的 box。 +有几个 Vagrant 命令,你可以用它们来控制你的“盒子”。 其中一些重要的命令是: - * `vagrant up`:启动一个 box。 - * `vagrant status`:显示当前 box 的状态。 - * `vagrant suspend`:暂停当前的 box。 - * `vagrant resume`:恢复当前的 box。 - * `vagrant halt`:关闭当前的 box。 - * `vagrant destroy`:销毁当前的 box。通过运行此命令,你将失去存储在 box 上的任何数据。 - * `vagrant snapshot`:对当前的 box 进行快照。 - - + * `vagrant up`:启动一个“盒子”。 + * `vagrant status`:显示当前“盒子”的状态。 + * `vagrant suspend`:暂停当前的“盒子”。 + * `vagrant resume`:恢复当前的“盒子”。 + * `vagrant halt`:关闭当前的“盒子”。 + * `vagrant destroy`:销毁当前的“盒子”。通过运行此命令,你将失去存储在“盒子”上的任何数据。 + * `vagrant snapshot`:对当前的“盒子”进行快照。 ### 试试 Vagrant -Vagrant 是一个使用 DevOps 原则进行虚拟机管理的经过时间考验的工具。配置你的测试机,与你的团队分享配置,并在一个可预测和可重复的环境中测试你的项目。如果你正在开发软件,那么通过使用 Vagrant 进行测试,你将为你的用户提供良好的服务。如果你不开发软件,但你喜欢尝试新版本的操作系统,那么没有比这更简单的方法了。今天就试试 Vagrant 吧! +Vagrant 是一个使用 DevOps 原则进行虚拟机管理的工具,久经时间考验。配置你的测试机,与你的团队分享配置,并在一个可预测和可重复的环境中测试你的项目。如果你正在开发软件,那么通过使用 Vagrant 进行测试,你将为你的用户提供良好的服务。如果你不开发软件,但你喜欢尝试新版本的操作系统,那么没有比这更简单的方法了。今天就试试 Vagrant 吧! -* * * - -_这篇文章最初发表在[作者的个人博客][6]上,经许可后被改编。_ +这篇文章最初发表在 [作者的个人博客][6] 上,经许可后被改编。 -------------------------------------------------------------------------------- @@ -127,7 +121,7 @@ via: https://opensource.com/article/21/9/test-vagrant 作者:[Ayush Sharma][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 b9112e94c49e1c7d995578b4fec6342ed9b1b788 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Sep 2021 11:59:37 +0800 Subject: [PATCH 0526/1588] PUB @geekpi https://linux.cn/article-13829-1.html --- ...ant to test your scripts on different operating systems.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210920 Use Vagrant to test your scripts on different operating systems.md (99%) diff --git a/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md b/published/20210920 Use Vagrant to test your scripts on different operating systems.md similarity index 99% rename from translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md rename to published/20210920 Use Vagrant to test your scripts on different operating systems.md index 376e4351a5..b105bb5413 100644 --- a/translated/tech/20210920 Use Vagrant to test your scripts on different operating systems.md +++ b/published/20210920 Use Vagrant to test your scripts on different operating systems.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13829-1.html" 使用 Vagrant 在不同的操作系统上测试你的脚本 ====== From 467856233549fbf5934c44709f7fe7c36b955fb1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Sep 2021 15:49:04 +0800 Subject: [PATCH 0527/1588] PRF @wxy --- ...inux- Shrine is ‘God-s Operating System.md | 22 +++++++++++-------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md b/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md index 2fdc0afe51..f4f92efd9d 100644 --- a/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md +++ b/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md @@ -3,13 +3,15 @@ [#]: author: "John Paul https://itsfoss.com/author/john/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 不是 Windows,也不是 Linux,Shrine 才是 “神之操作系统” ====== +![](https://img.linux.net.cn/data/attachment/album/202109/28/154516dcc5u1a50zfn4abw.jpg) + 在生活中,我们都曾使用过多种操作系统。有些好,有些坏。但你能说你使用过由“神”设计的操作系统吗?今天,我想向你介绍 Shrine(圣殿)。 ### 什么是 Shrine? @@ -18,21 +20,21 @@ 从介绍里,你可能想知道这到底是怎么回事。嗯,这一切都始于一个叫 Terry Davis 的人。在我们进一步介绍之前,我最好提醒你,Terry 在生前患有精神分裂症,而且经常不吃药。正因为如此,他在生活中说过或做过一些不被社会接受的事情。 -总之,让我们回到故事的主线。在 21 世纪初,Terry 发布了一个简单的操作系统。多年来,它不停地换了几个名字,有 J Operating System、LoseThos 和 SparrowOS 等等。他最终确定了 [TempleOS][2] 这个名字。他选择这个名字(神庙系统)是因为这个操作系统将成为神的圣殿。因此,神给 Terry 的操作系统规定了以下 [规格][3]: +总之,让我们回到故事的主线。在 21 世纪初,Terry 发布了一个简单的操作系统。多年来,它不停地换了几个名字,有 J Operating System、LoseThos 和 SparrowOS 等等。他最终确定了 [TempleOS][2](神庙系统)这个名字。他选择这个名字是因为这个操作系统将成为“神的圣殿”。因此,“神”给 Terry 的操作系统规定了以下 [规格][3]: ![video](https://youtu.be/LtlyeDAJR7A) - * 它将有 640×480 的 16 色图形 - * 它将使用“单声道 8 位带符号的类似 MIDI 的声音采样” + * 它将有 640×480 的 16 色图形显示 + * 它将使用 “单声道 8 位带符号的类似 MIDI 的声音采样” * 它将追随 Commodore 64,即“一个非网络化的简单机器,编程是目标,而不仅仅是达到目的的手段” - * 它将只支持一个文件系统(名为 “Red Sea”)。 - * 它将被限制在 10 万行代码内,以使它 “整体易于学习”。 - * “只支持 Ring-0 级,一切都在内核模式下运行,包括用户应用程序 + * 它将只支持一个文件系统(名为 “Red Sea”) + * 它将被限制在 10 万行代码内,以使它 “整体易于学习” + * “只支持 Ring-0 级,一切都在内核模式下运行,包括用户应用程序” * 字体将被限制为 “一种 8×8 等宽字体” * “对一切都可以完全访问。所有的内存、I/O 端口、指令和类似的东西都绝无限制。所有的函数、变量和类成员都是可访问的” * 它将只支持一个平台,即 64 位 PC -Terry 用一种他称之为 HolyC(神圣 C 语言)的编程语言编写了这个操作系统。TechRepublic 称其为一种 “C++ 的修改版(‘比 C 多,比 C++ 少’)”。如果你有兴趣了解 HolyC,我推荐,[这篇文章][4] 和 [RosettaCode][5] 上的 HolyC 条目。 +Terry 用一种他称之为 HolyC(神圣 C 语言)的编程语言编写了这个操作系统。TechRepublic 称其为一种 “C++ 的修改版(‘比 C 多,比 C++ 少’)”。如果你有兴趣了解 HolyC,我推荐 [这篇文章][4] 和 [RosettaCode][5] 上的 HolyC 条目。 2013 年,Terry 在他的网站上宣布,TempleOS 已经完成。不幸的是,几年后的 2018 年 8 月,Terry 被火车撞死了。当时他无家可归。多年来,许多人通过他在该操作系统上的工作关注着他。大多数人对他在如此小的体积中编写操作系统的能力印象深刻。 @@ -45,6 +47,8 @@ Terry 用一种他称之为 HolyC(神圣 C 语言)的编程语言编写了 minexew 正计划在未来增加更多的功能,但还没有宣布具体会包括什么。他有计划为 Linux 制作一个完整的 TempleOS 环境。 +![video](https://youtu.be/UCgoxQCf5Jg) + ### 体验 让 Shrine 在虚拟机中运行是相当容易的。你所需要做的就是安装你选择的虚拟化软件。(我的是 VirtualBox)当你为 Shrine 创建一个虚拟机时,确保它是 64 位的,并且至少有 512MB 的内存。 @@ -62,7 +66,7 @@ via: https://itsfoss.com/shrine-os/ 作者:[John Paul][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 82f33618cb1d050fb215d92a1b8767979f6b1ba2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 28 Sep 2021 15:50:28 +0800 Subject: [PATCH 0528/1588] PUB @wxy https://linux.cn/article-13831-1.html --- ...r Windows, nor Linux- Shrine is ‘God-s Operating System.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md (98%) diff --git a/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md b/published/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md similarity index 98% rename from translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md rename to published/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md index f4f92efd9d..aac67eb493 100644 --- a/translated/tech/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md +++ b/published/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13831-1.html" 不是 Windows,也不是 Linux,Shrine 才是 “神之操作系统” ====== From b4d5b2ea924ee6abd09fa70e2510507ededd5622 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Sep 2021 05:02:50 +0800 Subject: [PATCH 0529/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210929?= =?UTF-8?q?=20Troubleshooting=20=E2=80=9CBash:=20Command=20Not=20Found?= =?UTF-8?q?=E2=80=9D=20Error=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md --- ...Bash- Command Not Found- Error in Linux.md | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 sources/tech/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md diff --git a/sources/tech/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md b/sources/tech/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md new file mode 100644 index 0000000000..3fd4ae17bb --- /dev/null +++ b/sources/tech/20210929 Troubleshooting -Bash- Command Not Found- Error in Linux.md @@ -0,0 +1,151 @@ +[#]: subject: "Troubleshooting “Bash: Command Not Found” Error in Linux" +[#]: via: "https://itsfoss.com/bash-command-not-found/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Troubleshooting “Bash: Command Not Found” Error in Linux +====== + +_**This beginner tutorial shows how to go about fixing the Bash: command not found error on Debian, Ubuntu and other Linux distributions.**_ + +When you use commands in Linux, you expect to see an output. But sometimes, you’ll encounter issues where the terminal shows ‘command not found’ error. + +![][1] + +There is no straightforward, single solution to this error. You have to do a little bit of troubleshooting on your own. + +It’s not too difficult, honestly. The error gives some hint already when it says “bash: command not found”. Your shell (or Linux system) cannot find the command you entered. + +There could be three possible reasons why it cannot find the command: + + * It’s a typo and the command name is misspelled + * The command is not even installed + * The command is basically an executable script and its location is not known + + + +Let’s go in detail on each possible root cause. + +### Fixing “bash: command not found” error + +![][2] + +#### Method 1: Double check the command name (no, seriously) + +It is human to make mistakes, specially while typing. It is possible that the command you entered has a typo (spelling mistake). + +You should specially pay attention to: + + * The correct command name + * The spaces between the command and its options + * The use of 1 (numeral one), I (capital i) and l (lowercase L) + * Use of uppercase and lowercase characters + + + +Take a look at the example below, where I have misspelled the common ls command. + +![][3] + +So, make double sure what you are typing. + +#### Method 2: Ensure that the command is installed on your system + +This is another common reason behind the command not found error. You cannot run a command if it is not installed already. + +While your Linux distribution comes with a huge number of commands installed by default, it is not possible to pre-install all the command line tools in a system. If the command you are trying to run is not a popular, common command, you’ll have to install it first. + +You can use your distribution’s package manager to install it. + +![You may have to install the missing command][4] + +In some cases, popular commands may get discontinued and you may not even install it anymore. You’ll have to find an alternative command to achieve the result. + +Take the example of ipconfig command. This deprecated command was used for [getting Ip address][5] and other network interface information. Older tutorials on the web still mention using this command but you cannot use it anymore in newer Linux versions. It has been replaced by the ifconfig tool. + +![Some popular commands get discontinued over the time][1] + +Occasionally, your system won’t find even the extremely common commands. This is often the case when you are running a Linux distribution in Docker containers. To cut down on the size of the operating system image, the containers often do not include even the most common Linux commands. + +This is why Docker user stumble across things like [ping command not found error][6] etc. + +![Docker containers often have only a few commands installed][7] + +So, the solution is to either install the missing command or find a tool that could do the same thing you were trying to do with the missing command. + +#### Method 3: Check if it is an executable script with correct path + +This is a common mistake Linux rookies make while [running a shell script][8]. + +Even if you are in the same directory and try to run an executable script just by its name, it will show an error. + +``` +[email protected]:~/scripts# sample +-bash: sample: command not found +``` + +You need to either specify the shell interpreter explicitly or its absolute path. + +![][9] + +If you are in some other directory and try to execute the shell script without giving the correct path to the file, it will complain about not finding the file. + +![][10] + +##### Adding it to the PATH + +In some cases, you download the entire software in a tar file, extract it and find an executable file along with other program files. To run the program, you need to run the executable file. + +But for that, you need to be in the same directory or specify the entire path to the executable file. This is tiresome. + +Here, you can use the PATH variable. This variable has a collection of directories and these directories have the binary (executable) files of various Linux commands. When you run a command, your Linux system checks the mentioned directories in the PATH variable to look for the executable file of that command. + +You can check the location of the binary of a command by using the `which` command: + +![][11] + +If you want to run an executable file or script from anywhere on the system, you need to add the location of the file to this PATH variable. + +![][12] + +The PATH variable then needs to be added to the rc file of the shell so that the changes made to PATH variable is permanent. + +You get the gist here. It is important that your Linux system has the knowledge about the location of the executable script. Either you give the path while running it or you add its location to the PATH variable. + +### Did it help you? + +I understand that when you are new to Linux, things could be overwhelming. But when you understand the root cause of the problem, it gradually improved your knowledge. + +Here, there is no straightforward solution possible for the ‘command not found error’. I gave you some hints and pointers and that should help you in troubleshooting. + +If you still have doubt or need help, please let me know in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/bash-command-not-found/ + +作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-command-not-found-error.png?resize=741%2C291&ssl=1 +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-command-not-found-error-1.png?resize=800%2C450&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/command-not-found-error.png?resize=723%2C234&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/command-not-found-debian.png?resize=741%2C348&ssl=1 +[5]: https://itsfoss.com/check-ip-address-ubuntu/ +[6]: https://linuxhandbook.com/ping-command-ubuntu/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/ping-command-not-found-ubuntu.png?resize=786%2C367&ssl=1 +[8]: https://itsfoss.com/run-shell-script-linux/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/bash-script-command-not-found-error-800x331.png?resize=800%2C331&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/script-file-not-found-error-800x259.png?resize=800%2C259&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/path-location.png?resize=800%2C241&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/adding-executable-to-PATH-variable-linux.png?resize=800%2C313&ssl=1 From 1519d9a84be5940ba1a3bb334464120269be1593 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Sep 2021 05:03:09 +0800 Subject: [PATCH 0530/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210929?= =?UTF-8?q?=20How=20to=20Install=20and=20Setup=20Flutter=20Development=20o?= =?UTF-8?q?n=20Ubuntu=20and=20Other=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210929 How to Install and Setup Flutter Development on Ubuntu and Other Linux.md --- ...r Development on Ubuntu and Other Linux.md | 191 ++++++++++++++++++ 1 file changed, 191 insertions(+) create mode 100644 sources/tech/20210929 How to Install and Setup Flutter Development on Ubuntu and Other Linux.md diff --git a/sources/tech/20210929 How to Install and Setup Flutter Development on Ubuntu and Other Linux.md b/sources/tech/20210929 How to Install and Setup Flutter Development on Ubuntu and Other Linux.md new file mode 100644 index 0000000000..11263c6eab --- /dev/null +++ b/sources/tech/20210929 How to Install and Setup Flutter Development on Ubuntu and Other Linux.md @@ -0,0 +1,191 @@ +[#]: subject: "How to Install and Setup Flutter Development on Ubuntu and Other Linux" +[#]: via: "https://itsfoss.com/install-flutter-linux/" +[#]: author: "Community https://itsfoss.com/author/itsfoss/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install and Setup Flutter Development on Ubuntu and Other Linux +====== + +Google’s UI toolkit Flutter is getting increasingly popular for creating cross-platform applications for the mobile, web and desktop. + +[Flutter][1] is not a programming language but a software development kit. [Dart][2] is the programming language used underneath the Flutter SDK. + +Flutter is the main framework behind Google’s open source Fuchsia OS, Google STADIA and many other software and mobile apps. + +If you want to start developing with Flutter, this tutorial will help you to get your set-up ready on Ubuntu and hopefully other Linux distributions. + +### Installing Flutter on Ubuntu and other Linux with Snap + +The easiest way to install Flutter on Linux is by using Snap. If you are using Ubuntu, you already have got Snap. _**For other distributions, please make sure to [enable Snap support][3].**_ + +[Open a terminal][4] and use the following command in a terminal to install Flutter: + +``` +sudo snap install flutter --classic +``` + +You’ll see something like this on your terminal: + +![][5] + +Once the installation completes, it is time to verify it. Not just Flutter installation but also verify every dependency that needs to be satisfied for Flutter to function properly. + +#### Verify Flutter dependencies + +To verify that every dependency, for the correct work of Flutter, is installed, Flutter has a built-in option: + +``` +flutter doctor +``` + +The process will start, looking like this: + +![][6] + +And it will be finishing like this: + +![][7] + +As you can see, we need Android Studio for working. So let’s install it. How do we do that? [Installing Android Studio on Linux][8] is also effortless with Snap. + +#### Install and set up Android Studio + +In a terminal, use the following command to get Android Studio installed: + +``` +sudo snap install android-studio --classic +``` + +![][9] + +Once installed, open Android Studio from our operating system menu. + +![][10] + +You are almost done. It’s time for configuring Android Studio. + +![][11] + +Click next and select standard if you don’t want to complicate things. + +![][12] + +Select your preferred theme (I like the Dark one). + +![][13] + +Verify that everything is OK and click on Next. + +![][14] + +Finally, hit the Finish button. + +![][15] + +And wait until the download is finished. + +![][16] + +### Creating a sample Hello World Flutter app + +In Android Studio, go to Projects and select New Flutter Project. Flutter SDK path will be set by default. + +![][17] + +And here is where the magic starts to appear because this is where you set your project name, which in this case it will be called hello_world. + +Let’s select the three available platforms: **Android, iOS, and Web**. And finally, click on Finish. + +![][18] + +The principal file in the projects is located in `lib/main.dart`, as is shown in the next image. + +![][19] + +Once selected, erase everything contained inside the file and change it for this sample code: + +``` +// Copyright 2018 The Flutter team. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +import 'package:flutter/material.dart'; + +void main() => runApp(MyApp()); + +class MyApp extends StatelessWidget { + @override + Widget build(BuildContext context) { + return MaterialApp( + title: 'Welcome to Flutter', + home: Scaffold( + appBar: AppBar( + title: const Text('Welcome to Flutter'), + ), + body: const Center( + child: Text('Hello World'), + ), + ), + ); + } +} +``` + +It’s important to say that this is only for showing you how Flutter works, in case you’re convinced about learning this beautiful and incredible language, here is the [Documentation][20] to see more about it. **Try** it! + +Finally, select **Chome Web** device and do click on the **Run** button, as is shown below; and see the magic! + +![][21] + +It’s incredible how fast you can create a Flutter project. Say hello to your Hello World project. + +![][22] + +### In the end… + +Flutter and Dart are perfect if you want to contribute with beautiful mobile and Web interfaces in a short time. + +Now you know how to install Flutter on Ubuntu Linux and how to create your first app with it. I really enjoyed writing this post for you, hoping this helps you and if you have any questions, please let me know by leaving a comment or sending me an email to [[email protected]][23] Good luck! + +_**Tutorial contributed by Marco Antonio Carmona Galván, a student of physics and data science.**_ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-flutter-linux/ + +作者:[Community][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/itsfoss/ +[b]: https://github.com/lujun9972 +[1]: https://flutter.dev/ +[2]: https://dart.dev/ +[3]: https://itsfoss.com/install-snap-linux/ +[4]: https://itsfoss.com/open-terminal-ubuntu/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-flutter-ubuntu.png?resize=786%2C195&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/verify-flutter-install.png?resize=786%2C533&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/Flutter-verification-completes.png?resize=786%2C533&ssl=1 +[8]: https://itsfoss.com/install-android-studio-ubuntu-linux/ +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-android-studio-linux-snap.png?resize=786%2C187&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/Open_Android_Studio.webp?resize=800%2C450&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/Setting-Up-Android-Studio-1.png?resize=800%2C603&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/Setting-Up-Android-Studio-2.png?resize=800%2C603&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Setting-Up-Android-Studio-3.png?resize=800%2C603&ssl=1 +[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/Setting-Up-Android-Studio-4.png?resize=800%2C603&ssl=1 +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Setting-Up-Android-Studio-5.png?resize=800%2C603&ssl=1 +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/Setting-Up-Android-Studio-6.png?resize=800%2C603&ssl=1 +[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/New_flutter_project.png?resize=800%2C639&ssl=1 +[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/sample-flutter-project.png?resize=800%2C751&ssl=1 +[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/sample-flutter-project-1.png?resize=800%2C435&ssl=1 +[20]: https://flutter.dev/docs +[21]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/sample-flutter-project-2.png?resize=800%2C450&ssl=1 +[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/sample-flutter-project-3.png?resize=800%2C549&ssl=1 +[23]: https://itsfoss.com/cdn-cgi/l/email-protection From 529a4947978f07c39929bd86f48df01c3f3d0d1c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Sep 2021 05:03:27 +0800 Subject: [PATCH 0531/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210929?= =?UTF-8?q?=20Dialect:=20An=20Open-Source=20Translation=20App=20for=20Linu?= =?UTF-8?q?x?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md --- ...n Open-Source Translation App for Linux.md | 102 ++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md diff --git a/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md b/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md new file mode 100644 index 0000000000..816f82b4be --- /dev/null +++ b/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md @@ -0,0 +1,102 @@ +[#]: subject: "Dialect: An Open-Source Translation App for Linux" +[#]: via: "https://itsfoss.com/dialect/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Dialect: An Open-Source Translation App for Linux +====== + +_**Brief:** Dialect is a straightforward app that lets you translate between languages using web services. To explore more, let us take a closer look._ + +While you can launch the web browser and directly use any translation service to get the job done, a desktop app can sometimes come in handy. + +Dialect is a simple translation app that utilizes web services to translate while giving you some extra abilities. + +### Open-Source Translation App with Google Translate & LibreTranslate + +![][1] + +Dialect is primarily an app tailored for GNOME desktops, but it should work fine with other desktop environments. + +It lets you quickly translate languages along with a few extra options. + +At its core, it lets you choose between Google Translate or LibreTranslate as the translation service. + +Even though LibreTranslate cannot come close to Google Translate’s accuracy, featuring it as an option to switch is an excellent addition. At least, for some basic usage, if a user does not want to utilize Google’s services, you have an alternative ready on your desktop. + +### Features of Dialect + +![][2] + +Along with the ability to switch translation services, you get a few more tweaks: + + * Pronunciation + * Text to Speech functionality (Google) + * Dark mode + * Translation shortcut + * Live Translation + * Clipboard buttons to quickly copy/paste + * Translation history (undo/redo) + + + +As you can notice in the screenshot, the live translation feature may get your IP addressed banned from using the service because of API abuse. + +![][3] + +I tried using LibreTranslate (as shown in the image above) and Google Translate with the live translation feature enabled, and it worked fine. + +Maybe if you rely on translations quite often, you may want to avoid the feature. But, for my quick usage, the services didn’t ban by IP address for quite a few test runs. + +It is important to note that you can specify a custom LibreTranslate instance if you want. By default, it uses “translate.astian.org” as the instance. + +You may not find a separate translation history section, but the arrow buttons in the top-left corner of the window will let you see your previous translations and the translation settings as well. + +So, it works as a redo/undo feature as well. + +### Installing Dialect in Linux + +Dialect is available as a [Flatpak][4]. So, you should be able to install it on any Linux distro of your choice. If you are new to this, you might want to check out our [Flatpak guide][5] for help. + +First, add Flathub repo: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +And then install the application: + +``` +flatpak install flathub com.github.gi_lom.dialect +``` + +Once installed, look for it in the system menu and start it from there. + +You can also explore its [GitHub page][6] for more information. + +[Dialect][7] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dialect/ + +作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-screenshot.png?resize=800%2C331&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-app-options.png?resize=800%2C470&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-libretranslate.png?resize=800%2C326&ssl=1 +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://itsfoss.com/flatpak-guide/ +[6]: https://github.com/dialect-app/dialect/ +[7]: https://flathub.org/apps/details/com.github.gi_lom.dialect From ef2cb99e7cb80dc2ab42d91636984e20c65ffff1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Sep 2021 05:04:06 +0800 Subject: [PATCH 0532/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210928?= =?UTF-8?q?=20Convert=20your=20Raspberry=20Pi=20into=20a=20trading=20bot?= =?UTF-8?q?=20with=20Pythonic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210928 Convert your Raspberry Pi into a trading bot with Pythonic.md --- ...rry Pi into a trading bot with Pythonic.md | 509 ++++++++++++++++++ 1 file changed, 509 insertions(+) create mode 100644 sources/tech/20210928 Convert your Raspberry Pi into a trading bot with Pythonic.md diff --git a/sources/tech/20210928 Convert your Raspberry Pi into a trading bot with Pythonic.md b/sources/tech/20210928 Convert your Raspberry Pi into a trading bot with Pythonic.md new file mode 100644 index 0000000000..c8d236dce4 --- /dev/null +++ b/sources/tech/20210928 Convert your Raspberry Pi into a trading bot with Pythonic.md @@ -0,0 +1,509 @@ +[#]: subject: "Convert your Raspberry Pi into a trading bot with Pythonic" +[#]: via: "https://opensource.com/article/21/9/raspberry-pi-trading-bot" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Convert your Raspberry Pi into a trading bot with Pythonic +====== +Reduce your power consumption by setting up your cryptocurrency trading +bot on a Raspberry Pi. +![A dollar sign in a network][1] + +The current popularity of cryptocurrencies also includes trading in them. Last year, I wrote an article *[How to automate your cryptocurrency trades with Python][2] *which covered the setup of a trading bot based on the graphical programming framework [Pythonic][3], which I developed in my leisure. At that time, you still needed a desktop system based on x86 to run Pythonic. In the meantime, I have reconsidered the concept (web-based GUI). Today, it is possible to run Pythonic on a Raspberry Pi, which mainly benefits the power consumption because such a trading bot has to be constantly switched on. + +That previous article is still valid. If you want to create a trading bot based on the old version of Pythonic (0._x_), you can install it with `pip3 install Pythonic==0.19`. + +This article covers the setup of a trading bot running on a Raspberry Pi and executing a trading algorithm based on the [EMA crossover strategy][4]. + +### Install Pythonic on your Raspberry Pi + +Here, I only briefly touch on the subject of installation because you can find detailed installation instructions for Pythonic in my last article [_Control your Raspberry Pi remotely with your smartphone_][5]. In a nutshell: Download the Raspberry Pi image from [sourceforge.net][6] and flash it on the SD card. + +The PythonicRPI image has no preinstalled graphical desktop, so to proceed, you should be able to access the programming web GUI (http : //PythonicRPI:7000/): + +![Pythonic GUI overview][7] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +#### Example code + +Download the example code for the trading bot from [GitHub][9] (direct download link) and unzip the archive. The archive contains three different file types: + + * `\*.py-files`: Contains the actual implementation of certain functionality + * `current_config.json`: This file describes the configured elements, the links between the elements, and the variable configuration of elements + * `jupyter/backtest.ipynb`: A [Jupyter][10] notebook for backtesting + * `jupyter/ADAUSD_5m.df`: A minimal OHLCV dataset which I use in this example + + + +With the green outlined button, upload the `current_config.json` to the Raspberry Pi. You can upload only valid configuration files. With the yellow outlined button, upload all the `\*.py `files.  + +![Upload toolbar buttons][11] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +The `\*.py `files are uploaded to `/home/pythonic/Pythonic/executables` whereas the `current_config.json` is uploaded to `/home/pythonic/Pythonic/current_config.json`. After uploading the `current_config.json`, you should see a screen like this: + +![Pythonic screen after upload of config.json][12] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Now I'll go step-by-step through each part of the trading bot. + +### Data acquisition + +Like in the last article, I begin with the data acquisition: + +![Pythonic area 2 data acquisition ][13] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +The data acquisition can be found on the **Area 2** tab and runs independently from the rest of the bot. It implements the following functionality: + + * **AcqusitionScheduler**: Trigger subsequent elements every five minutes + * **OHLCV_Query**: Prepares the OHLCV query method + * **KrakenConnector**: Establishes a connection with the Kraken cryptocurrency exchange + * **DataCollector**: Collect and process the new OHLCV data + + + +The _DataCollector_ gets a Python list of OHLCV data with a prefixed timestamp and converts it into a [Pandas DataFrame][14]. Pandas is a popular library for data analysis and manipulation. A _DataFrame_ is the base type for data of any kind to which arithmetic operation can be applied. + +The task of the DataCollector (`generic_pipe_3e059017.py`) is to load an existing DataFrame from file, append the latest OHLCV data, and save it back to file.  + + +``` +import time, queue +import pandas as pd +from pathlib import Path + +try: +    from element_types import Record, Function, ProcCMD, GuiCMD +except ImportError: +    from Pythonic.element_types import Record, Function, ProcCMD, GuiCMD + +class Element(Function): + +    def __init__(self, id, config, inputData, return_queue, cmd_queue): +        super().__init__(id, config, inputData, return_queue, cmd_queue) +         +    def execute(self): +        df_in = pd.DataFrame(self.inputData, columns=['close_time', 'open', 'high', 'low', 'close', 'volume']) +        df_in['close_time'] = df_in['close_time'].floordiv(1000) # remove milliseconds from timestamp + +        file_path = Path.home() / 'Pythonic' / 'executables' / 'ADAUSD_5m.df' + +        try: +            # load existing dataframe +            df = pd.read_pickle(file_path) +            # count existing rows +            n_row_cnt = df.shape[0] +            # concat latest OHLCV data +            df = pd.concat([df,df_in], ignore_index=True).drop_duplicates(['close_time']) +            # reset the index +            df.reset_index(drop=True, inplace=True) +            # calculate number of new rows +            n_new_rows = df.shape[0] - n_row_cnt +            log_txt = '{}: {} new rows written'.format(file_path, n_new_rows) + +        except Exception as e: +            log_txt = 'File error - writing new one' +            df = df_in  +             +        # save dataframe to file +        df.to_pickle(file_path) + +        logInfo = Record(None, log_txt) +        self.return_queue.put(logInfo) +``` + +This code is executed every full five minutes as the OHLCV data is also in 5-minute intervals. + +By default, the _OHLCV_Query_ element only downloads the dataset for the latest period. To have some data for developing the trading algorithm, right-click the **OHLCV_Query** element to open the configuration, set the _Limit_ to 500, and trigger the **AcquisitionScheduler**. This causes the download of 500 OHLCV values: + +![OHLCV_Query configuration][15] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +### Trading strategy + +Our trading strategy will be the popular [EMA crossover strategy][4]. The EMA indicator is a weighted moving average over the last _n_ close prices that gives more weight to recent price data. You calculate two EMA series, one for a longer period (for example, _n_ = 21, blue line) and one for a shorter period (for example, _n_ = 10, yellow line).  + +![Pythonic trading data graph][16] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +The bot should place a buy order (green circle) when the shorter-term EMA crosses above the longer-term EMA. The bot should place a sell order when the shorter-term EMA crosses below the longer-term EMA (orange circle). + +### Backtesting with Jupyter + +The example code on [GitHub][9] (direct download link) also contains a [Jupyter Notebook][10] file (`backtesting.ipynb`)  which you use to test and develop the trading algorithm. + +**Note:** Jupyter is not preinstalled on the Pythonic Raspberry Pi image. You can either install it also on the Raspberry Pi or install it on your regular PC. I  recommend the latter, as you will do some number crunching that is much faster on an ordinary x86 CPU. + +Start Jupyter and open the notebook. Make sure to have a DataFrame, downloaded by the _DataCollector_, available. With **Shift**+**Enter**, you can execute each cell individually. After executing the first three cells, you should get an output like this: + +![Output after executing the first three cells][17] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Now calculate the EMA-10 and EMA-21 values. Luckily, pandas offers you the `ewm` function, which does exactly what is needed. The EMA values are added as separate columns to the DataFrame: + +![EMA values added as separate columns to dataframe][18] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +To determine if a buy or sell condition is met, you have to consider these four variables: + + * **emaLong0**: Current long-term (_ema-21_) EMA value + * **emaLong1**: Last long-term (_ema-21_) EMA value (the value before emaLong0) + * **emaShort0**: Current short-term (_ema-10_) EMA value + * **emaShort1**: Last short-term (_ema-10_) EMA value (the value before emaShort0) + + + +When the following situation comes into effect, a buy condition is met: + +![Buy condition met][19] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +In Python code: + + +``` +`emaLong1 > emaShort1 and emaShort0 > emaLong0` +``` + +A sell condition is met in the following situation: + +![Sell condition met][20] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +In Python code: + + +``` +`emaShort1 > emaLong1 and emaLong0 > emaShort0` +``` + +To test the DataFrame and evaluate the possible profit you could make, you could either iterate over each row and test for these conditions or, with a smarter approach, filter the dataset to only the relevant rows with built-in methods from Pandas. + +Under the hood, Pandas uses [NumPy][21], which is the method of choice for fast and efficient data operation on arrays. This is, of course, convenient because the later use is to take place on a Raspberry Pi with an ARM CPU. + +For the sake of clarity, the DataFrame from the example (`ADAUSD_5m.df`) with only 20 entries is used in the following examples. The following code appends a column of boolean values dependent on the condition `emaShort0 > emaLong0`: + +![Dataframe with 20 entries][22] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +The place of interest is when a _False_ switches to _True_ (buy) or when _True_ switches to _False_. To filter them apply a `diff` operation to the _condition_ column. The `diff `operation calculates the difference between the current and the previous line. In terms of boolean values, it results in: + + * _False_ `diff` _False_ = _False_ + * _False_ `diff` _True_ = _True_ + * _True_ `diff` _True_ = _False_ + * _True_ `diff` _False_ = _True_ + + + +With the following code, you apply the `diff` operation as a filter to the *condition *column without modifying it: + +![Applying the diff operation][23] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +As a result, you get the desired data: The first row (index 2) signalizes a buy condition and the second row (index 8) signalizes a sell condition. As you now have an efficient way of extracting relevant data, you can calculate possible profit. + +To do so, you have to iterate through the rows and calculate the possible profit based on simulated trades. The variable `bBought` saves the state if you already bought, and `buyPrice` stores the price you bought between the iterations. You also skip the first sell indicator as it doesn't make sense to sell before you've even bought. + + +``` +profit   = 0.0 +buyPrice = 0.0 +bBought  = False + +for index, row, in trades.iterrows(): +     +    # skip first sell-indicator +    if not row['condition'] and not bBought: +        continue +     +    # buy-indication +    if row['condition'] and not bBought: +        bBought = True +        buyPrice = row['close'] +         +         +    # sell-indication +    if not row['condition'] and bBought: +        bBought = False +        sellPrice = row['close'] + +        orderProfit = (sellPrice * 100) / buyPrice - 100 +         +        profit += orderProfit +``` + +Your one-trade mini dataset would provide you the following profit: + +![One-trade mini dataset profit][24] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +**Note:** As you can see, the strategy would have given a terrible result as you would have bought at $2.5204 and sold at  $2.5065, causing a loss of 0.55% (order fees not included). However, this is a real-world scenario: One strategy does not work for each scenario. It is on you to find the most promising parameters (for example, using OHLCV on an hourly basis would make more sense in general). + +### Implementation + +You can find the implementation of the decision on the **Area 1** tab.  + +![Decision-making implementation on area 1][25] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +It implements the following functionality: + + * **BotScheduler**: Same as the AcqusitionScheduler: Trigger subsequent elements every five minutes + * **Delay**: Delay the execution for 30 seconds to make sure that the latest OHLCV data was written to file + * **Evaluation**: Make the trading decision based on the EMA crossover strategy + + + +You now know how the decision makings work, so you can take a look at the actual implementation. Open the file `generic_pipe_29dfc189.py`. It corresponds to the **Evaluation** element on the screen: + + +``` +@dataclass +class OrderRecord: +    orderType:          bool  # True = Buy, False = Sell +    price:              float # close price +    profit:             float # profit in percent +    profitCumulative:   float # cumulative profit in percent + +class OrderType(Enum):  +    Buy  = True +    Sell = False + +class Element(Function): + +    def __init__(self, id, config, inputData, return_queue, cmd_queue): +        super().__init__(id, config, inputData, return_queue, cmd_queue) + +    def execute(self): + +        ### Load data ### + +        file_path = Path.home() / 'Pythonic' / 'executables' / 'ADAUSD_5m.df' + +        # only the last 21 columsn are considered +        self.ohlcv = pd.read_pickle(file_path)[-21:] + +        self.bBought             = False +        self.lastPrice           = 0.0 +        self.profit              = 0.0 +        self.profitCumulative    = 0.0    +        self.price               = self.ohlcv['close'].iloc[-1] +         +        # switches for simulation + +        self.bForceBuy  = False +        self.bForceSell = False + +        # load trade history from file +        self.trackRecord = ListPersist('track_record') + +        try: +            lastOrder = self.trackRecord[-1] + +            self.bBought          = lastOrder.orderType +            self.lastPrice        = lastOrder.price +            self.profitCumulative = lastOrder.profitCumulative + +        except IndexError: +            pass +         +        ### Calculate indicators ### + +        self.ohlcv['ema-10'] = self.ohlcv['close'].ewm(span = 10, adjust=False).mean() +        self.ohlcv['ema-21'] = self.ohlcv['close'].ewm(span = 21, adjust=False).mean() +        self.ohlcv['condition'] = self.ohlcv['ema-10'] > self.ohlcv['ema-21'] +         +        ### Check for Buy- / Sell-condition ### +        tradeCondition = self.ohlcv['condition'].iloc[-1] != self.ohlcv['condition'].iloc[-2] + +        if tradeCondition or self.bForceBuy or self.bForceSell: + +            orderType = self.ohlcv['condition'].iloc[-1] # True = BUY, False = SELL + +            if orderType and not self.bBought or self.bForceBuy: # place a buy order +                 +                msg         = 'Placing a  Buy-order' +                newOrder    = self.createOrder(True) + +            elif not orderType and self.bBought or self.bForceSell: # place a sell order + +                msg = 'Placing a  Sell-order' + +                sellPrice   = self.price +                buyPrice    = self.lastPrice + +                self.profit = (sellPrice * 100) / buyPrice - 100 +                self.profitCumulative += self.profit + +                newOrder = self.createOrder(False) + +            else: # Something went wrong +                msg = 'Warning: Condition for {}-order met but bBought is {}'.format(OrderType(orderType).name, self.bBought) +                newOrder = None +             + +            recordDone = Record(newOrder, msg)      +            self.return_queue.put(recordDone) + +    def createOrder(self, orderType: bool) -> OrderRecord: +         +        newOrder = OrderRecord( +                orderType=orderType, +                price=self.price, +                profit=self.profit, +                profitCumulative=self.profitCumulative +            ) +         +        self.trackRecord.append(newOrder) + +        return newOrder +``` + +As the general process is not that complicated, I want to highlight some of the peculiarities: + +##### Input data + +The trading bot only processes the last 21 elements as this is the range you consider when calculating the exponential moving average: + + +``` +`   self.ohlcv = pd.read_pickle(file_path)[-21:]` +``` + +##### Track record + +The type _ListPersist_ is an extended Python list object that writes itself to the file system when modified (when elements get added or removed). It creates the file `track_record.obj` under `~/Pythonic/executables/` once you run it the first time. + + +``` +`  self.trackRecord = ListPersist('track_record')` +``` + +Maintaining a track record helps to keep the state of recent bot activity. + +##### Plausibility + +The algorithm outputs an object of the type _OrderRecord_ in case conditions for a trade are met. It also keeps track of the overall situation: For example, if a buy signal was received, but `bBought` indicates that you already bought before, something must've gone wrong: + + +``` +else: # Something went wrong +    msg = 'Warning: Condition for {}-order met but bBought is {}'.format(OrderType(orderType).name, self.bBought) +    newOrder = None +``` + +In this scenario, _None_ is returned with a corresponding log message. + +### Simulation + +The Evaluation element (`generic_pipe_29dfc189.py`) contains these switches which enable you to force the execution of a buy or sell order: + + +``` +self.bForceBuy  = False +self.bForceSell = False +``` + +Open the code server IDE (http : //PythonicRPI:8000/), load `generic_pipe_29dfc189.py `and set one of the switches to _True_. Attach with the debugger and add a breakpoint where the execution path enters the _inner if_ conditions. + +![Add breakpoint for inner if conditions][26] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Now open the programming GUI, add a **ManualScheduler **element (configured to _single fire_) and connect it directly to the **Evaluation** element to trigger it manually: + +![Add manual scheduler element][27] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Click the play button. The **Evaluation **element is triggered directly, and the debugger stops at the previously set breakpoint. You are now able to add, remove, or modify orders from the track record manually to simulate certain scenarios: + +![Manually simulate scenarios ][28] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Open the log message window (green outlined button) and the output data window (orange outlined button): + +![Pythonic trading output buttons][29] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +You will see the log messages and output of the **Evaluation** element and thus the behavior of the decision-making algorithm based on your input: + +### + +[19_pythonic_trading_simulate_orders_2.png][30] + +![Log messages and output of evaluation element][31] + +(Stephan Avenwedde, [CC BY-SA 4.0][8]) + +Summary + +The example stops here. The final implementation could notify the user about a trade indication, place an order on an exchange, or query the account balance in advance. At this point, you should feel that everything connects and be able to proceed on your own.  + +Using Pythonic as a base for your trading bot is a good choice because it runs on a Raspberry Pi, is entirely accessible by a web browser, and already has logging features. It is even possible to stop on a breakpoint without disturbing the execution of other tasks using Pythonic's multiprocessing capabilities. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/raspberry-pi-trading-bot + +作者:[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/osdc_whitehurst_money.png?itok=ls-SOzM0 (A dollar sign in a network) +[2]: https://opensource.com/article/20/4/python-crypto-trading-bot +[3]: https://github.com/hANSIc99/Pythonic +[4]: https://www.investopedia.com/articles/active-trading/052014/how-use-moving-average-buy-stocks.asp +[5]: https://opensource.com/article/21/9/raspberry-pi-remote-control +[6]: https://sourceforge.net/projects/pythonicrpi/ +[7]: https://opensource.com/sites/default/files/uploads/1_pythonic_trading_clear_2.png (Pythonic GUI overview) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://github.com/hANSIc99/Pythonic/raw/master/examples/trading_bot_crossing_ema/trading_bot_crossing_ema.zip +[10]: https://jupyter.org/ +[11]: https://opensource.com/sites/default/files/uploads/2_pythonic_trading_upload_buttons.png (Upload toolbar buttons) +[12]: https://opensource.com/sites/default/files/uploads/3_pythonic_trading_sample_loaded_2.png (Pythonic screen after upload of config.json) +[13]: https://opensource.com/sites/default/files/uploads/4_pythonic_trading_data_acquisition.png (Pythonic area 2 data acquisition) +[14]: https://pandas.pydata.org/docs/reference/api/pandas.DataFrame.html +[15]: https://opensource.com/sites/default/files/uploads/5_pythonic_trading_ohlcv_limit.png (OHLCV_Query configuration) +[16]: https://opensource.com/sites/default/files/uploads/6_pythonic_trading_ohlcv_data.png (Pythonic trading data graph) +[17]: https://opensource.com/sites/default/files/uploads/7_pythonic_trading_jupyter_a.png (Output after executing the first three cells) +[18]: https://opensource.com/sites/default/files/uploads/8_pythonic_trading_jupyter_calc_ema.png (EMA values added as separate columns to dataframe) +[19]: https://opensource.com/sites/default/files/uploads/9_pythonic_trading_buy_condition.png (Buy condition met) +[20]: https://opensource.com/sites/default/files/uploads/10_pythonic_trading_sell_condition.png (Sell condition met) +[21]: https://numpy.org/ +[22]: https://opensource.com/sites/default/files/uploads/11_pythonic_trading_jupyter_condition.png (Dataframe with 20 entries) +[23]: https://opensource.com/sites/default/files/uploads/12_pythonic_trading_jupyter_filter.png (Applying the diff operation) +[24]: https://opensource.com/sites/default/files/uploads/13_pythonic_trading_backtest_trades.png (One-trade mini dataset profit) +[25]: https://opensource.com/sites/default/files/uploads/14_pythonic_trading_implementation.png (Decision-making implementation on area 1) +[26]: https://opensource.com/sites/default/files/uploads/15_pythonic_trading_breakpoint_2.png (Add breakpoint for inner if conditions) +[27]: https://opensource.com/sites/default/files/uploads/16_pythonic_trading_manual_trigger.png (Add manual scheduler element) +[28]: https://opensource.com/sites/default/files/uploads/17_pythonic_trading_debugger_stop.png (Manually simulate scenarios) +[29]: https://opensource.com/sites/default/files/uploads/18_pythonic_trading_output_buttons.png (Pythonic trading output buttons) +[30]: https://opensource.com/file/512111 +[31]: https://opensource.com/sites/default/files/uploads/19_pythonic_trading_simulate_orders_2.png (Log messages and output of evaluation element) From 1aaf3d5038d2e264543e1d6e73f6c8d07b47d4d8 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Sep 2021 05:04:24 +0800 Subject: [PATCH 0533/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210928?= =?UTF-8?q?=20What=20is=20port=20forwarding=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210928 What is port forwarding.md --- .../tech/20210928 What is port forwarding.md | 98 +++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 sources/tech/20210928 What is port forwarding.md diff --git a/sources/tech/20210928 What is port forwarding.md b/sources/tech/20210928 What is port forwarding.md new file mode 100644 index 0000000000..0cccbb2063 --- /dev/null +++ b/sources/tech/20210928 What is port forwarding.md @@ -0,0 +1,98 @@ +[#]: subject: "What is port forwarding?" +[#]: via: "https://opensource.com/article/21/9/what-port-forwarding" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is port forwarding? +====== +This article demonstrates the most common scenarios for port forwarding. +![Multi-colored and directional network computer cables][1] + +Port forwarding transfers network traffic from one network listener (called a "port") to another, either on the same computer or a different computer. Ports, in this context, are not physical objects but a software routine listening for network activity. + +When traffic directed at a specific port arrives at a router or a firewall, or other networked application, the response it receives can be defined according to the port it's trying to communicate with. When you use port forwarding, you can catch communication coming in on port 8080, for instance, and forward it on to port 80 instead. The new destination port may be on the same device as the one receiving the signal or on a different device. There are many ways to forward ports, and there are different reasons for doing it. This article demonstrates the most common scenarios. + +### Port forwarding with your router + +You usually need to forward ports when you host a server at home. Your home router (usually the WiFi appliance you get from your ISP) has a built-in firewall designed to prevent the outside world from getting onto your home network. You can use port forwarding to allow traffic on a specific port through your router's firewall, sending it to a specific IP address on your network. + +For instance, say you're hosting a [Minetest server][2] and want to invite friends. For them to get through your router and into your Minetest server, you must forward a port from the router to the computer hosting Minetest. By default, a Minetest server runs on port 30000. You can port forward 30000 on your router to port 30000 on your Minetest server, or you could arbitrarily invent a simpler port for your players to remember and then forward that instead. I find that people inevitably miscount the zeroes in 30000 (especially without the benefit of a comma to help), so I use port 1234 and forward it to my internal 30000 port. + +Router interfaces differ from manufacturer to manufacturer, but the idea is the same regardless of what brand of router you have in your home. First, log in to your router. +Its IP address and login information is often printed on the router itself or in its documentation. I own a TP-Link GX90 router, and I log in to it by pointing my web browser to 10.0.1.1, but your router might be 192.168.0.1 or some other address. + +My GX90 router calls port forwarding "Virtual servers," which is a category found in the router's **NAT forwarding** tab. NAT stands for _Network Address Translation_. Other routers may just call it **Port forwarding** or **Firewall** or **Services**. It may take a little clicking around to find the right category, or you may need to spend some time studying your router's documentation. + +When you find the port forwarding setting, add a new rule that names an external port (1234, in my example) and an internal one (30000). Forward the external port to the internal port on the IP address of the computer you want people to be able to access. If you need help finding your IP address, read Archit Modi's _[How to find your IP address on Linux][3]_ article. + +![A sample port forwarding rule][4] + +A sample port forwarding rule +(Seth Kenlon, [CC BY-SA 4.0][5]) + +In this example, I'm forwarding traffic that reaches my home network at port 1234 to port 30000 of my home server located at 10.0.1.2. + +Save the rule to proceed. + +Next, you need to know your home network's public IP address. You can obtain this from websites like [ifconfig.me][6] or [icanhazip.com][7]. Either open a browser to one of those sites or get the IP using the [curl][8] command: + + +``` +$ curl ifconfig.me +93.184.216.34 +``` + +Your friends can now join your Minetest server by entering the `169.169.23.49:1234` into their Minetest client. + +### Port forwarding with a firewall + +Sysadmins sometimes need to forward ports for traffic reaching a server. For example, you may want to accept traffic to port 80 but present the user with a service running on port 8065. Without port forwarding, your users would have to remember to append a specific port at the end of the URL they enter into their browser, such as `example.com:8065`.  Most users aren't used to thinking about ports, so intercepting a call to the common web port 80 and redirecting it to the obscure one your web app runs on is a big convenience for your users. + +You can forward traffic on a server using [firewall-cmd][9], the front-end command to the `firewalld` daemon. + +First, set the ports and protocols you want to forward: + + +``` +$ sudo firewall-cmd \ +\--add-forward-port \ +port=80:proto=tcp:toport=8065 +``` + +To make the change permanent, use the `--runtime-to-permanent` option: + + +``` +`$ sudo firewall-cmd --runtime-to-permanent` +``` + +### Network forwarding + +In networking, there are other kinds of forwarding aside from port forwarding. For instance, both IP forwarding and proxying are forms of forwarding. As you get familiar with how network information is processed as it's routed, you can try different kinds of forwarding (and watch it with `tcpdump` or similar) to see what works best for your setup. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/what-port-forwarding + +作者:[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/connections_wires_sysadmin_cable.png?itok=d5WqHmnJ (Multi-colored and directional network computer cables) +[2]: https://opensource.com/alternatives/minecraft#minetest +[3]: https://opensource.com/article/18/5/how-find-ip-address-linux +[4]: https://opensource.com/sites/default/files/uploads/router-port-forward.jpg (A sample port forwarding rule) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: http://ifconfig.me +[7]: http://icanhazip.com +[8]: https://opensource.com/article/20/5/curl-cheat-sheet +[9]: https://www.redhat.com/sysadmin/secure-linux-network-firewall-cmd From 004671dbd987565c484825d47a83a372a8064320 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 29 Sep 2021 05:04:41 +0800 Subject: [PATCH 0534/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210928?= =?UTF-8?q?=20Modeling=20open=20management=20practices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210928 Modeling open management practices.md --- ...0928 Modeling open management practices.md | 101 ++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 sources/tech/20210928 Modeling open management practices.md diff --git a/sources/tech/20210928 Modeling open management practices.md b/sources/tech/20210928 Modeling open management practices.md new file mode 100644 index 0000000000..d896968e50 --- /dev/null +++ b/sources/tech/20210928 Modeling open management practices.md @@ -0,0 +1,101 @@ +[#]: subject: "Modeling open management practices" +[#]: via: "https://opensource.com/open-organization/21/9/modeling-open-management" +[#]: author: "Heidi Hess von Ludewig https://opensource.com/users/heidi-hess-von-ludewig" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Modeling open management practices +====== +How can managers know if other leaders are cultivating an open culture? +Ask the people they impact every day. +![Women talking][1] + +In the [first part of my interview with Sam Knuth][2], a fellow [Open Organization Ambassador][3], we discussed how leaders need to make time to be open. Openness isn't effortless. + +In this second part, Sam and I discuss how executive leaders support their managers and teams in [leading with open values][4]. Because of the confidentiality of some of the answers (we're colleagues at Red Hat, after all), I am summarizing the interview in a series of articles that highlight and share some of Sam's most memorable observations and practices. + +### Managing managers + +Executive and senior leaders manage groups of managers, which means they may have little (or no) direct, routine contact with individual contributors in their organizations. So if they're interested in promoting open cultures throughout their organizations, they'll need to continuously model the open management practices they expect to see from all the managers in their team. + +Executive and senior leaders, however, don't only _promote_ open culture; they're also members of the organizational communities they want to see thrive, and like other members they shoulder some accountability for the health and vitality of that culture. Like all other members of an open organization community, managers are accountable for being _stewards_ (even protectors) of the values of the community as well. Senior leaders are responsible—as is any community member—for challenging behaviors that are unsupportive of open values. + +But this work is even more critical in the case of managers, especially because managers can enjoy enhanced decision-making power in many open organizations, and they influence more and more people the higher their role in an organization's hierarchy they sit. + +So how can executive leaders promote and protect open values in their organizations? Sam described a multi-factor approach to gathering and understanding associates' perspectives of their managers' leadership competencies. + +#### Meeting one-on-one + +As Sam's organization grew and more layers of management formed, Sam found he didn't have ongoing conversations with associates who weren't directly reporting to him, and was losing touch with how employees were feeling. Those _feelings_ are integral to any understanding of the organizational culture individual contributors experience every day. + +The bottom line? However you connect with associates, cultivating psychological safety is important for generating candid discussions. + +So Sam set up [one-on-one meetings][5] to connect with associates throughout the organization, choosing as randomly as he could. This helped create a safe space and develop trust in a confidential environment. Sam did this across his 250-associate organization by scheduling two to three meetings every week, because he felt it was the best way to get a sense of everyone's perspectives. It also gave him opportunities to share what he was learning with the managers in his organization and to coach them on becoming open leaders and champions of open values among their peers. + +During these discussions, he listened actively and asked many questions. Red Hatters can be quite forthcoming in their feedback, but asking questions helped Sam pick up on subtle cues when necessary. This way, he could ferret out an accurate sense of the situation, asking himself, "Does what the associates' say line up with what I think the leaders are intending? Where does it seem like alignment is not occurring? Why?" + +It's an individualized approach that's both time-consuming and candid, and Sam found it to be well worth the effort. + +It's also the opposite of a process I recalled from my past life in a conventional organization. As Sam and I chatted, I remembered "round tables," where an executive would set up team discussions to (allegedly) understand associates' perspectives. It was supposed to be a venue for collecting feedback and constructive criticism—but, in practice, no one said anything to the visiting executive that they hadn’t shared with team or department leaders, so there was no candid discussion _about_ those team or department leaders. I didn't feel any [sense of psychological safety][6], which is required in order for associates to share their thoughts. In my case, the round tables were completely ineffective. + +The bottom line? However you connect with associates—individually or in groups—cultivating psychological safety is important for generating candid discussions. + +Travelling to meet associates was ideal for these kinds of individual meetings to occur face-to-face, but the pandemic changed this tactic. On the other hand, workplaces across the world were already becoming more distributed before the pandemic; in fact, Sam struggled to meet associates in the United States because of the distribution of sites and even associates working remotely! To overcome this, leaders can set up one-on-one teleconferences with associates. In cases where associates seem to be less forthcoming or fearful of sharing their opinions, leaders can ask probing (but not direct) questions of the associates to get feedback as best as they can. For instance, leaders can glean a great deal of information from how associates answer questions such as: + + * How are you feeling about your work? + * What kinds of challenges do you encounter in your work? + * Do you feel like you get the support you need to do your work? + * How well do you feel you connect with your manager? Colleagues? + + + +#### On (not) using surveys + +Finally, Sam and I discussed surveys. After all, couldn't someone achieve the same results using a survey—without all that extra legwork? + +Surveys have their place in tracking the health of an open culture, Sam told me, but on their own they're rarely sufficient for doing this. For starters, Sam said, using surveys requires skill in both asking quantifiable questions and analyzing data, and that kind of skill isn't as common as we tend to think it is. Without proper expertise in using survey instruments, we may be letting data mislead us (for instance, when we gloss over problems because we see a high average score on another, similar question). So Sam finds surveys most useful for capturing a _broad perspective_ on team- or department-level experience of a culture and a manager's role in creating and maintaining it. + +Getting an accurate sense of specific details or issues is difficult when using surveys, which tend to ask for more generic feedback. Painting a more complete picture really requires sitting down with people and talking to them. + +Getting an accurate sense of specific details or issues is difficult when using surveys, which tend to ask for more generic feedback. Painting a more complete picture really requires sitting down with people and talking to them, Sam insisted. + +That's why it's important to investigate and spend time learning about the work culture in your organization from the associates themselves. Use a combination of techniques, and open multiple channels to facilitate feedback in as many forms as possible, as different people feel comfortable with different media. + +### When managers aren't open + +Like any role, managers learn skills and behaviors that help them succeed in particular organizations. When they get hired into an open organization (like Red Hat), they might experience some "abrasion" (my term), because there can be a genuine belief that a manager is managing with open values even though that person's _vision_ of open values doesn't match that of the organization. + +I recalled personal experience with this, where I had a manager who probably _thought_ they were being open, but really wasn't. + +"Exactly," Sam said, "and it's very painful." + +_Listen to Sam Knuth describe difficulties helping managers become more open._ + +When managers really aren't sufficiently "open," it's an issue that has to be addressed—because it can be damaging to teams. Sometimes managers can unlearn their conventional skills and behaviors. And sometimes they can't. Sometimes the change has to happen quickly so that the team doesn’t suffer. Ultimately, the organization's executive leader must embody that organization's culture. + +So "open management" then becomes a question of "open by whose standards?" and the organization must make those standards explicit in some way. That means deliberately codifying what the organization _means_ by "openness." Some organizations might draw up a simple social contract to accomplish this—a description of open principles and practices that all agree to let guide them. Other organizations might go so far as to formalize certain managerial competencies that align with the open culture an organization seeks to maintain. Regardless of the approach, however, it's important that an open organization fosters transparent discussions about behaviors it _does_ and _doesn't_ want to see its managers reflecting and encouraging. In this way, executive leaders can be those stewards for an organization's open culture. + +In the final part of my interview with Sam, I'll describe another important open management tactic I learned during our conversation: daring to be vulnerable. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/open-organization/21/9/modeling-open-management + +作者:[Heidi Hess von Ludewig][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/heidi-hess-von-ludewig +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/conversation-interview-mentor.png?itok=HjoOPcrB (Women talking) +[2]: https://opensource.com/open-organization/21/3/open-practices-executive-leaders +[3]: https://github.com/open-organization/governance/blob/master/community-roster.md +[4]: https://opensource.com/open-organization/managing-with-open-values +[5]: https://opensource.com/open-organization/21/8/one-on-one-meeting-tips +[6]: https://opensource.com/open-organization/19/3/introduction-psychological-safety From d3a30f0e1748654ea074d0c70327ef8a740e2d1a Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 29 Sep 2021 08:43:50 +0800 Subject: [PATCH 0535/1588] translated --- ... Ubuntu Linux -GUI and Terminal Methods.md | 149 ------------------ ... Ubuntu Linux -GUI and Terminal Methods.md | 149 ++++++++++++++++++ 2 files changed, 149 insertions(+), 149 deletions(-) delete mode 100644 sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md create mode 100644 translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md diff --git a/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md b/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md deleted file mode 100644 index 598d522f8d..0000000000 --- a/sources/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md +++ /dev/null @@ -1,149 +0,0 @@ -[#]: subject: "Install AnyDesk on Ubuntu Linux [GUI and Terminal Methods]" -[#]: via: "https://itsfoss.com/install-anydesk-ubuntu/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Install AnyDesk on Ubuntu Linux [GUI and Terminal Methods] -====== - -_**Brief: This beginner’s tutorial discusses both GUI and terminal methods of installing AnyDesk on Ubuntu-based Linux distributions.**_ - -[AnyDesk][1] is a popular remote desktop software available for Linux, Windows, BSD, macOS and mobile platforms. - -With this tool, you can remotely access other computer using AnyDesk or let someone else remotely access your system. Not everyone can access it just because two devices use AnyDesk. You have to accept the incoming connection and/or provide a password for secure connection. - -This is helpful in providing tech support to friend, family, colleagues or even to the customers. - -In this tutorial, I’ll show you both graphical and command line ways of installing AnyDesk on Ubuntu. You can use either method based on your preference. Both methods will install the same AnyDesk version on your Ubuntu system. - -The same method should be applicable to Debian and other Debian and Ubuntu based distributions such as Linux Mint, Linux Lite etc. - -Non-FOSS alert! - -AnyDesk is not open source software. It is covered here because it is available on Linux and the article’s focus is on Linux. - -### Method 1: Install AnyDesk on Ubuntu using terminal - -[Open the terminal application][2] on your system. You’ll need a tool like wget to [download files in the terminal. For th][3]at, use the following command: - -``` -sudo apt update -sudo apt install wget -``` - -The next step now is to download the GPG key of AnyDesk repository and add it to your system’s trusted keys. This way, your system will trust the software coming from this [external repository][4]. - -``` -wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo apt-key add - -``` - -You may ignore the deprecated warning about apt-key command for now. The next step is to add the AnyDesk repository to your system’s repository sources: - -``` -echo "deb http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk-stable.list -``` - -Update the package cache so that your system learns about the availability of new applications through the newly added repository. - -``` -sudo apt update -``` - -And now, you can install AnyDesk: - -``` -sudo apt install anydesk -``` - -Once that is done, you can start AnyDesk from the system menu or from the terminal itself: - -``` -anydesk -``` - -You can enjoy AnyDesk now. - -![AnyDesk running in Ubuntu][5] - -### Method 2: Install AnyDesk on Ubuntu graphically - -If you are not comfortable with the command line, no worries. You can also install AnyDesk without going into the terminal. - -You can download AnyDesk for Ubuntu from the official AnyDesk website: - -[Download AnyDesk for Linux][6] - -You’ll see a Download Now button. Click on it. - -![Download AnyDesk][7] - -When you click on the download button, it gives you options for various Linux distributions. Select the one for Ubuntu: - -![Download the appropriate file][8] - -It will download the DEB file of AnyDesk application. [Installing deb file][9] is easy. Either double click on it or right click and open with Software Install. - -![Right click on deb file and open with software center][10] - -Software Center application will be opened and you can install it from there. - -![Installing AnyDesk in Ubuntu software center][11] - -Once installed, search for it in the system menu and start from there. - -![AnyDesk installed in Ubuntu][12] - -That’s it. Not too hard, is it? - -I am not going to show the steps for using AnyDesk. I think you already have some idea about that. If not, refer to [this article][13], please. - -#### Troubleshooting tip - -When I tried to run AnyDesk from the system menu, it didn’t start. So, I started it from the terminal and it showed me this error: - -``` -[email protected]:~$ anydesk -anydesk: error while loading shared libraries: libpangox-1.0.so.0: cannot open shared object file: No such file or directory -``` - -If you see the [error while loading shared libraries][14] message, you install the package it is complaining about. Here’s what I did in my case: - -``` -sudo apt install libpangox-1.0-0 -``` - -That solved the issue for me and I hope it fixes for you as well. - -If you have any questions related to this topic, please let me know in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-anydesk-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://anydesk.com/en -[2]: https://itsfoss.com/open-terminal-ubuntu/ -[3]: https://itsfoss.com/download-files-from-linux-terminal/ -[4]: https://itsfoss.com/adding-external-repositories-ubuntu/ -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/anydesk-running-in-ubuntu.png?resize=800%2C418&ssl=1 -[6]: https://anydesk.com/en/downloads/linux -[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/any-desk-ubuntu-download.webp?resize=800%2C312&ssl=1 -[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/any-desk-ubuntu-download-1.webp?resize=800%2C427&ssl=1 -[9]: https://itsfoss.com/install-deb-files-ubuntu/ -[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-anaydesk-ubuntu.png?resize=800%2C403&ssl=1 -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-anydesk-in-ubuntu-software-center.png?resize=781%2C405&ssl=1 -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/anydesk-installed-in-ubuntu.png?resize=759%2C196&ssl=1 -[13]: https://support.anydesk.com/Access -[14]: https://itsfoss.com/solve-open-shared-object-file-quick-tip/ diff --git a/translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md b/translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md new file mode 100644 index 0000000000..88f4504331 --- /dev/null +++ b/translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md @@ -0,0 +1,149 @@ +[#]: subject: "Install AnyDesk on Ubuntu Linux [GUI and Terminal Methods]" +[#]: via: "https://itsfoss.com/install-anydesk-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 Ubuntu Linux 上安装 AnyDesk(GUI 和终端方法) +====== + +_**简介:这个初学者的教程讨论了在基于 Ubuntu 的 Linux 发行版上安装 AnyDesk 的 GUI 和终端方法**_。 + +[AnyDesk][1] 是一个流行的远程桌面软件,可用于 Linux、Windows、BSD、macOS 和移动平台。 + +有了这个工具,你可以用 AnyDesk 远程访问其他电脑,或者让别人远程访问你的系统。不是每个人都可以访问它,因为有两台设备使用 AnyDesk。你必须接受传入的连接和/或提供一个安全连接的密码。 + +这对于向朋友、家人、同事甚至客户提供技术支持很有帮助。 + +在本教程中,我将向你展示在 Ubuntu 上安装 AnyDesk 的图形和命令行两种方法。你可以根据自己的喜好使用这两种方法。这两种方法都会在你的 Ubuntu 系统上安装相同的 AnyDesk 版本。 + +同样的方法应该适用于 Debian 和其他基于 Debian 和 Ubuntu 的发行版,如 Linux Mint,Linux Lite 等。 + +非 FOSS 警告! + +AnyDesk 不是开源软件。这里涉及它是因为它在 Linux 上可用,而文章的重点是 Linux。 + +### 方法 1:使用终端在 Ubuntu 上安装 AnyDesk + +在你的系统上[打开终端程序][2]。你需要一个像 wget 这样的工具来[在终端下载文件][3],对于这个使用以下命令: + +``` +sudo apt update +sudo apt install wget +``` + +下一步是下载 AnyDesk 仓库的 GPG 密钥,并将其添加到你的系统的可信密钥中。这样,你的系统就会信任来自这个[外部仓库][4]的软件。 + +``` +wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo apt-key add - +``` + +你可以暂时忽略关于 apt-key 命令的废弃警告。下一步是将 AnyDesk 仓库添加到系统的仓库源中: + +``` +echo "deb http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk-stable.list +``` + +更新包缓存,这样你的系统就能通过新添加的仓库了解到新应用的可用性。 + +``` +sudo apt update +``` + +现在,你可以安装 AnyDesk 了: + +``` +sudo apt install anydesk +``` + +完成后,你可以从系统菜单或从终端本身启动 AnyDesk: + +``` +anydesk +``` + +你现在可以享受 AnyDesk 了。 + +![AnyDesk running in Ubuntu][5] + +### 方法 2:在 Ubuntu 上以图形方式安装 AnyDesk + +如果你不习惯使用命令行,不用担心。你也可以不进入终端安装 AnyDesk。 + +你可以从 AnyDesk 官网下载 Ubuntu 上的 AnyDesk: + +[下载 Linux 上的 Anydesk][6] + +你会看到一个立即下载的按钮。点击它。 + +![Download AnyDesk][7] + +当你点击下载按钮时,它会给你提供各种 Linux 发行版的选项。选择 Ubuntu 的那个: + +![Download the appropriate file][8] + +它将下载 AnyDesk 的 DEB 文件。[安装 DEB 文件][9]很简单。要么双击它,要么右击并使用软件安装打开。 + +![Right click on deb file and open with software center][10] + +软件中心应用将被打开,你可以在那里安装它。 + +![Installing AnyDesk in Ubuntu software center][11] + +安装后,在系统菜单中搜索它并从那里开始。 + +![AnyDesk installed in Ubuntu][12] + +这就好了。不是太难,是吗? + +我不打算展示使用 AnyDesk 的步骤。我想你已经对这个问题有了一些了解。如果没有,请参考[这篇文章][13],谢谢。 + +#### 故障排除提示 + +当我试图从系统菜单中运行 AnyDesk 时,它没有启动。于是,我从终端启动它,它显示了这个错误: + +``` +[email protected]:~$ anydesk +anydesk: error while loading shared libraries: libpangox-1.0.so.0: cannot open shared object file: No such file or directory +``` + +如果你看到 [error while loading shared libraries][14] 信息,你要安装它所报错的软件包。在我的例子中,我是这样做的: + +``` +sudo apt install libpangox-1.0-0 +``` + +这解决了我的问题,我希望它也能为你解决。 + +如果你有任何与此主题相关的问题,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-anydesk-ubuntu/ + +作者:[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://anydesk.com/en +[2]: https://itsfoss.com/open-terminal-ubuntu/ +[3]: https://itsfoss.com/download-files-from-linux-terminal/ +[4]: https://itsfoss.com/adding-external-repositories-ubuntu/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/anydesk-running-in-ubuntu.png?resize=800%2C418&ssl=1 +[6]: https://anydesk.com/en/downloads/linux +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/any-desk-ubuntu-download.webp?resize=800%2C312&ssl=1 +[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/any-desk-ubuntu-download-1.webp?resize=800%2C427&ssl=1 +[9]: https://itsfoss.com/install-deb-files-ubuntu/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/install-anaydesk-ubuntu.png?resize=800%2C403&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-anydesk-in-ubuntu-software-center.png?resize=781%2C405&ssl=1 +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/anydesk-installed-in-ubuntu.png?resize=759%2C196&ssl=1 +[13]: https://support.anydesk.com/Access +[14]: https://itsfoss.com/solve-open-shared-object-file-quick-tip/ From 71e51171792a6e226218404545d1d54e93146da7 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 29 Sep 2021 08:46:59 +0800 Subject: [PATCH 0536/1588] translated --- ... Install Java from your Linux distribution-s repositories.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md b/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md index 0a172b8529..2a763b96f2 100644 --- a/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md +++ b/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/install-java-linux-repositories" [#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 53e92e3404068001aee46bffd24cf9e5610a24f7 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Wed, 29 Sep 2021 09:33:14 +0800 Subject: [PATCH 0537/1588] Rename sources/tech/20210928 Modeling open management practices.md to sources/talk/20210928 Modeling open management practices.md --- .../{tech => talk}/20210928 Modeling open management practices.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20210928 Modeling open management practices.md (100%) diff --git a/sources/tech/20210928 Modeling open management practices.md b/sources/talk/20210928 Modeling open management practices.md similarity index 100% rename from sources/tech/20210928 Modeling open management practices.md rename to sources/talk/20210928 Modeling open management practices.md From 69ada1cddc164ec72f517e5cc2e2c52010623c8d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Sep 2021 13:51:10 +0800 Subject: [PATCH 0538/1588] PRF&PUB @unigeorge https://linux.cn/article-13832-1.html --- .../20210622 What is a config file.md | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) rename {translated/tech => published}/20210622 What is a config file.md (76%) diff --git a/translated/tech/20210622 What is a config file.md b/published/20210622 What is a config file.md similarity index 76% rename from translated/tech/20210622 What is a config file.md rename to published/20210622 What is a config file.md index b29393e4f9..704240b003 100644 --- a/translated/tech/20210622 What is a config file.md +++ b/published/20210622 What is a config file.md @@ -3,25 +3,26 @@ [#]: author: (Seth Kenlon https://opensource.com/users/seth) [#]: collector: (lujun9972) [#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13832-1.html) -什么是配置文件? +浅谈配置文件格式 ====== -流行的配置文件格式有若干种,每种都有其独特优势。从中找到最适合你的格式吧! -![Computer screen with files or windows open][1] +> 流行的配置文件格式有若干种,每种都有其自身优势。从中找到最适合你的格式吧! + +![](https://img.linux.net.cn/data/attachment/album/202109/29/134955py5ypl58dgplyx4x.jpg) 计算机上有数以千计的配置文件。你可能永远不会直接与其中的大部分文件打交道,但它们确实散落在你的 `/etc` 以及 `~/.config`、`~/.local`、`/usr` 文件夹中。还有一些可能在 `/var`,甚至 `/opt` 文件夹中。如果无意中打开过或更改过它们,你就可能会有疑问:为什么有些配置文件看起来是某一种格式,而另一些则是看起来完全不同的格式? -存储配置是一项很灵活的任务,因为只要开发人员知道他们的代码如何将数据存入文件,他们就可以轻松编写代码来根据需要提取数据。然而,科技行业非常青睐有详细文档的标准化事物,因此多年来出现了几种比较普遍的格式用来简化配置任务。 +存储配置是一项很灵活的任务,因为只要开发人员知道他们的代码是如何将数据存入文件的,他们就可以轻松编写代码来根据需要提取数据。然而,科技行业非常青睐有详细文档的标准化事物,因此多年来出现了几种比较普遍的格式用来简化配置任务。 ### 为什么我们需要配置文件 配置文件对于现代计算来说很重要。它们使你能够自定义与应用程序交互的方式,或自定义应用程序与系统内其他程序的交互方式。有了配置文件,每当你启动某个应用程序时,它都会有“记忆”,记录了你喜欢如何去使用该程序。 -配置文件的结构可以很简单,而且通常确实也很简单。例如,如果你要编写一个应用程序,程序唯一需要知道的是其用户的偏好名称,那么它的唯一配置文件就可以只包含一个词:用户名。就像下面这样: +配置文件的结构可以很简单,而且通常确实也很简单。例如,如果你要编写一个应用程序,程序唯一需要知道的是其用户的偏好名字,那么它的唯一配置文件就可以只包含一个词:用户名。就像下面这样: ``` Tux @@ -34,7 +35,7 @@ NAME='Tux' SPECIES='Penguin' ``` -即使没有编程经验,你也可以想象出代码如何解析这些数据。这里有两个简单的例子,一个使用 [`awk` 命令][2],另一个使用 [grep 命令][3]。两个例子都是只关注包含 `NAME`“键”的行,并返回出现在等号 (`=`) 之后的“值”: +即使没有编程经验,你也可以想象出代码如何解析这些数据。这里有两个简单的例子,一个使用 [awk 命令][2],另一个使用 [grep 命令][3]。两个例子都是只关注包含 `NAME` “键”的行,并返回出现在等号 (`=`) 之后的“值”: ``` $ awk -F'=' '/NAME/ { print $2; }' myconfig.ini @@ -47,7 +48,7 @@ $ grep NAME fake.txt | cut -d'=' -f2 ### 选择格式 -为了保证普遍有效性,配置文件最重要的一点是它们是一致的和可预测的。你绝对不会想做这样的事:以保存用户首选项的名义,将信息随意存储到文件中,然后就得花好几天时间来编写代码,以对整个文件中的随机信息实现读取操作。 +为了保证普遍有效性,配置文件最重要的一点是它们是一致的和可预测的。你绝对不会想做这样的事:以保存用户首选项的名义,将信息随意存储到文件中,然后花好几天时间逆向工程,来找到最终出现在文件中的随机信息。 流行的配置文件格式有若干种,每种格式都有自己的优势。 @@ -64,7 +65,7 @@ enabled=1 这种简单的配置风格很直观,只要你别选择使用糟糕的键名(比如用 `unampref` 这样的神秘键名来代替 `name`)就好。这些键值对很容易解析和编辑。 -除了键和值之外,INI 格式还可以分 section。在下列示例代码中,`[example]` 和 `[demo]` 就是配置文件中的两节: +除了键和值之外,INI 格式还可以分 section。在下列示例代码中,`[example]` 和 `[demo]` 就是配置文件中的两个节: ``` [example] @@ -77,14 +78,14 @@ name=Beastie fullscreen=1 ``` -这几个配置语句解析起来有点复杂,因为有 _两个_ `name` 键。想象一下,一个粗心的程序员在这个配置文件中查询 `name`,结果总是返回 `Beastie`,因为这是文件中对 name 的最后一个定义值。在解析这样的文件时,开发人员必须加倍小心地在各节中搜索键,这可能会很棘手,具体取决于用来解析该文件的语言。然而,它仍然是一种很流行的格式,大多数语言都会有一个现成的库来帮助程序员解析 INI 文件。 +这几个配置语句解析起来有点复杂,因为有两个 `name` 键。想象一下,一个粗心的程序员在这个配置文件中查询 `name`,结果总是返回 `Beastie`,因为这是文件中对 `name` 的最后一个定义值。在解析这样的文件时,开发人员必须加倍小心地在各节中搜索键,这可能会很棘手,具体取决于用来解析该文件的语言。然而,它仍然是一种很流行的格式,大多数语言都会有一个现成的库来帮助程序员解析 INI 文件。 #### YAML [YAML 文件][4] 是结构化列表,可以包含值或者键值对: ``` -\--- +--- Example:   Name: 'Tux'   Style: @@ -93,13 +94,13 @@ Example:   Enabled: 1 ``` -YAML 格式很流行,部分原因是它看起来很整洁。数据要放置到相对其上层数据的特定位置,除此之外没有太多其他语法。然而,对于某些人来说的特色,在其他人眼中可能就是一个 bug。许多开发人员不愿使用 YAML,正是因为它很看重本质上 _不存在_ 的东西。如果你在 YAML 中缩进错误,YAML 解析器可能会将你的文件视为无效文件,即使不视为无效,返回的数据也可能是错误的。 +YAML 格式很流行,部分原因是它看起来很整洁。数据要放置到相对其上层数据的特定位置,除此之外没有太多其他语法。然而,对于某些人来说的这种特色,在其他人眼中可能就是一个问题。许多开发人员不愿使用 YAML,正是因为它很看重本质上 _不存在_ 的东西。如果你在 YAML 中缩进错误,YAML 解析器可能会将你的文件视为无效文件,即使不视为无效,返回的数据也可能是错误的。 大多数语言都有 YAML 解析器,并且有很好的开源 YAML linters(验证语法的应用程序)来帮你确保 YAML 文件的完整性。 #### JSON -JSON 文件在技术上来说是 YAML 的子类,因此其数据结构是相同的,尽管其语法完全不同: +JSON 文件在技术上来说是 YAML 的子集,因此其数据结构是相同的,尽管其语法完全不同: ``` { @@ -116,7 +117,7 @@ JSON 文件在技术上来说是 YAML 的子类,因此其数据结构是相同 } ``` -JSON 在 JavaScript 程序员中很流行,这并不奇怪,因为 JSON 全称为 JavaScript Object Notation 即 JavaScript 对象符号。由于与 Web 开发密切相关,JSON 是 Web API 的常见输出格式。大多数编程语言都有解析 JSON 的库。 +JSON 在 JavaScript 程序员中很流行,这并不奇怪,因为 JSON 全称为JavaScript 对象符号JavaScript Object Notation。由于与 Web 开发密切相关,JSON 是 Web API 的常见输出格式。大多数编程语言都有解析 JSON 的库。 #### XML @@ -158,7 +159,7 @@ via: https://opensource.com/article/21/6/what-config-files 作者:[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 4328c289f108db0b630ba4ba019963f043032aae Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 29 Sep 2021 14:14:57 +0800 Subject: [PATCH 0539/1588] PRF&PUB @geekpi https://linux.cn/article-13833-1.html --- ...ource alternative to Microsoft Exchange.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) rename {translated/tech => published}/20210924 An open source alternative to Microsoft Exchange.md (68%) diff --git a/translated/tech/20210924 An open source alternative to Microsoft Exchange.md b/published/20210924 An open source alternative to Microsoft Exchange.md similarity index 68% rename from translated/tech/20210924 An open source alternative to Microsoft Exchange.md rename to published/20210924 An open source alternative to Microsoft Exchange.md index 9903696e39..31cd9853e0 100644 --- a/translated/tech/20210924 An open source alternative to Microsoft Exchange.md +++ b/published/20210924 An open source alternative to Microsoft Exchange.md @@ -3,24 +3,26 @@ [#]: author: "Markus Feilner https://opensource.com/users/mfeilner" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13833-1.html" -Microsoft Exchange 的一个开源替代方案 +微软 Exchange 的一个开源替代方案 ====== -开源用户现在有了一个强大的、功能齐全的群件选择。 -![Working on a team, busy worklife][1] -多年来,Microsoft Exchange 作为群件环境的平台几乎是不可避免的。然而,在 2020 年末,一个奥地利的开源软件开发商推出了[grommunio][2],一个群件服务器和客户端,其外观和感觉对 Exchange 和 Outlook 用户所熟悉。 +> 开源用户现在有了一个强大的、功能齐全的群件选择。 + +![](https://img.linux.net.cn/data/attachment/album/202109/29/141404pesw8xgh8oohwhjh.jpg) + +多年来,微软 Exchange 作为一个平台牢牢统治着群件环境。然而,在 2020 年末,一个奥地利的开源软件开发商推出了 [grommunio][2],这是一个群件服务器和客户端,其外观和感觉让 Exchange 和 Outlook 用户感到很熟悉。 grmmunio 项目可以很好地替代 Exchange。开发者以与微软相同的方式将组件连接到平台上,它们支持 RPC (远程过程调用)与 HTTP 协议。据开发者介绍,grommunio 还包括许多常见的群件接口,如 IMAP、POP3、SMTP、EAS(Exchange ActiveSync)、EWS(Exchange Web Services)、CalDAV 和 CardDAV。有了这样广泛的支持,grommunio 可以顺利地整合到现有的基础设施中。 -用户会注意到 Outlook、Android 和 iOS 客户端之间几乎没有区别。当然,作为开源软件,它也支持其他客户端。由于集成了本地 Exchange 协议,Outlook 和智能手机与 grommunio 的通信就像与 Microsoft Exchange 服务器一样。日常的企业用户可以继续使用他们现有的客户端,而 grommunio 服务器则在后台安静地运行。 +用户会注意到对 Outlook、Android 和 iOS 客户端来说几乎没有区别。当然,作为开源软件,它也支持其他客户端。由于集成了原生的 Exchange 协议,Outlook 和智能手机与 grommunio 的通信就像与微软 Exchange 服务器一样。日常的企业用户可以继续使用他们现有的客户端,而 grommunio 服务器则在后台安静地运行。 ### 不仅仅是邮件 -除了邮件功能外,grommunio 界面还提供了日历系统。可以直接在日历显示中或在一个新标签中点击创建约会。这很直观,正是你对现代工具的期望。用户可以创建、管理和分享日历以及地址簿。私人联系人或普通联系人都是可能的,而且你可以与同事分享一切。 +除了邮件功能外,grommunio 界面还提供了日历系统。可以直接在日历显示中或在一个新标签中点击创建约会。这很直观,正如你对现代工具的期望。用户可以创建、管理和分享日历以及地址簿。私人联系人或普通联系人都支持,而且你可以与同事分享一切。 任务管理在左边的下拉菜单中显示任务列表,它们可以有一个所有者和多个合作者。你可以为每个任务指定截止日期、类别、附件和其他属性。笔记可以以同样的方式被管理并与其他团队成员共享。 @@ -30,25 +32,25 @@ grmmunio 项目可以很好地替代 Exchange。开发者以与微软相同的 ![Screenshot of grommunio meeting space][3] -用于高级视频会议的 Jitsi 集成(Markus Feilner, [CC BY-SA 4.0][4]) +*用于高级视频会议的 Jitsi 集成(Markus Feilner, [CC BY-SA 4.0][4])* 在 grommunio 会议功能的背后是 [Jitsi][5],它以熟悉的用户界面顺利地集成到 grommunio 的用户界面中。完全集成和集中管理的聊天功能是基于 [Mattermost][6]。 ![Screenshot of grommunio's town square for chat][7] -用于聊天的 Mattermost(Markus Feilner,[CC BY-SA 4.0][4]) +*用于聊天的 Mattermost(Markus Feilner,[CC BY-SA 4.0][4])* -用于文件同步和交换的 ownCloud(Markus Feilner,[CC BY-SA 4.0][4]) +[ownCloud][8] 承诺提供企业级的文件共享和同步,在点击“文件”按钮后开始。 ![Screenshot of grommunio file sharing space][9] -用于文件同步和交换的 ownCloud(Markus Feilner,[CC BY-SA 4.0][4]) +*用于文件同步和交换的 ownCloud(Markus Feilner,[CC BY-SA 4.0][4])* -grommunio 项目有一个强大的管理界面,包括角色、域和组织管理、预测性监测和自助服务门户。基于 shell 的向导指导管理员完成安装和从 Microsoft Exchange 迁移数据。开发团队正在不断努力,以实现更好的整合和更集中的管理,并随之为管理员提供更好的工作流程。 +grommunio 项目有一个强大的管理界面,包括角色、域和组织管理、预测性监测和自助服务门户。基于 shell 的向导指导管理员完成安装和从微软 Exchange 迁移数据。开发团队正在不断努力,以实现更好的整合和更集中的管理,并随之为管理员提供更好的工作流程。 ![Screenshot of grommunio dashboards][10] -grommunio 的管理界面(Markus Feilner, [CC BY-SA 4.0][4]) +*grommunio 的管理界面(Markus Feilner, [CC BY-SA 4.0][4])* ### 探索 grommunio @@ -61,7 +63,7 @@ via: https://opensource.com/article/21/9/open-source-groupware-grommunio 作者:[Markus Feilner][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 8ea86ffb3a8b58aebf21d261057fbae23ce2f294 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Sep 2021 05:03:12 +0800 Subject: [PATCH 0540/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210929?= =?UTF-8?q?=20How=20I=20keep=20my=20file=20folders=20tidy=20with=20Ansible?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210929 How I keep my file folders tidy with Ansible.md --- ... keep my file folders tidy with Ansible.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sources/tech/20210929 How I keep my file folders tidy with Ansible.md diff --git a/sources/tech/20210929 How I keep my file folders tidy with Ansible.md b/sources/tech/20210929 How I keep my file folders tidy with Ansible.md new file mode 100644 index 0000000000..aacc2f33b1 --- /dev/null +++ b/sources/tech/20210929 How I keep my file folders tidy with Ansible.md @@ -0,0 +1,183 @@ +[#]: subject: "How I keep my file folders tidy with Ansible" +[#]: via: "https://opensource.com/article/21/9/keep-folders-tidy-ansible" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I keep my file folders tidy with Ansible +====== +I try to use Ansible often, even for tasks that I know how to do with a +shell script because I know that Ansible is easy to scale. +![Filing cabinet for organization][1] + +I try to use Ansible often, even for tasks that I know how to do with a shell script because I know that Ansible is easy to scale. Even though I might develop an Ansible playbook just for my personal workstation, sometimes it ends up being a lot more useful than intended, and it's easy to apply that same playbook to all the computers on my network. And besides, sometimes the greatest enemy of getting really good at something is the impression that it's only meant for serious professionals, or big projects, or whatever you feel that you're not. I use Ansible because it's a great open source tool, but I benefit from it the most because it scales. + +One of the tasks I recently assigned to Ansible was the monumental one of keeping my Downloads folder tidy. If you're like me, you end up downloading many files from the Internet throughout the day and then forget that the files exist. On the one hand, I don't mind this habit. There have been times when I realize I still need a file in my Downloads folder, so forgetting about a file rather than promptly removing it can be helpful. However, there are other files that I download expressly to use once and then ought to remove. + +I decided to use a highly specific Ansible task to find files I know I don't need and then remove them. + +### Ansible boilerplate + +Ansible playbooks generally start in exactly the same way: Define your hosts and announce a task: + + +``` +\--- +\- hosts: localhost +  tasks: +``` + +Commit those three lines to memory. They're the "shebang" (`#!`) of Ansible playbooks. Once you have those lines in a text file, you can start defining the steps in your task. + +### Finding files with Ansible + +You can locate files on a system using the [`find` Ansible module][2]. If an Ansible module is a command, its parameters are its [command options][3]. In this example playbook, I want to find files explicitly located in the `~/Downloads` folder and I can define that using the `paths` parameter. + +This is my process when I start writing a playbook: I find a module in the Ansible module index that seems likely to do what I need, and then I read through its parameters to find out what kind of control I have over the module. + +In my case, the files I accidentally collect in my Downloads folder are CSV files. They get downloaded weekly, processed, and then ought to disappear. But they hang around for weeks until I get overwhelmed and delete them. Here's how to find CSV files in Downloads with Ansible: + + +``` +\--- +\- hosts: localhost +  tasks: +    - name: Find CSV in Downloads +      find: +        paths: ~/Downloads +        recurse: false +        patterns: '*.csv,*.CSV' +      register: result +``` + +The `paths` parameter tells Ansible where to search for files. + +The `recurse: false` parameter forbids Ansible from searching in subdirectories of Downloads. This gives me the ability to retain CSV files that I've downloaded and saved into a subdirectory. Ansible only targets the CSV files I save straight to Downloads (which is my habit). + +The `patterns` parameter tells Ansible what to count as a match. All of the CSV files I download end in .csv, but I'm confident that I'm willing to remove .CSV (in all capital letters) as well. + +The finishing touch to this step is to invoke the `register` module, which saves the results of the `find` process into a variable called `result`. + +This is important because I want Ansible to perform a second action on the results of `find`, so those results need to be stored somewhere for the next step. + +### Removing files with Ansible + +The next step in the task is to remove the files that `find` has uncovered. The module used to remove files is the [`file` module][4]. + +This step relies entirely on the `find` step, so it uses several variables: + + +``` +    - name: Remove CSV files +      file: +        path: "{{ item.path }}" +        state: absent +      with_items: "{{ result.files }}" +``` + +The `path` parameter uses the built-in `"{{ item.path }}"` variable, which confusingly isn't actually defined yet. The variable has no information on the path until the `file` module is used in a loop by the `with_items` keyword. The `with_items` step uses the contents of the `result` variable to extract one filename at a time, which becomes the `item` for the `path` parameter. Once the current item's path is extracted, Ansible uses the `state: absent` rule to ensure that the file located at that path is _not_ left on the system (in other words, it's deleted.) + +This is a _very_ dangerous step, especially during testing. If you get this step wrong, you can easily remove files you don't intend to delete. + +### Verify the playbook  + +Ansible playbooks are written in [YAML][5], which has a strict syntax. Verify that your YAML is correct using the `yamllint` command: + + +``` +$ yamllint cleanup.yaml +$ +``` + +No results means no errors. This playbook must have been written by someone who really [knows and loves YAML][6]! + +### Testing Ansible plays safely + +To avoid deleting my entire home directory by accident, I ran my first attempt with the `--check` option. This ensures that Ansible doesn't actually make changes to your system. + + +``` +$ ansible-playbook --check example.yaml +[WARNING]: provided hosts list is empty, only localhost is available. +'all' + +PLAY [localhost] **************************************************** + +TASK [Gathering Facts] ********************************************** +ok: [localhost] + +TASK [Find CSV files in Downloads] ********************************** +ok: [localhost] + +TASK [Remove CSV files] ********************************************* +changed: [localhost] => (item={'path': '/home/tux/Downloads/foo.csv', [...] +changed: [localhost] => (item={'path': '/home/tux/Downloads/bar.csv', [...] +changed: [localhost] => (item={'path': '/home/tux/Downloads/baz.csv', [...] + +PLAY RECAP ********************************************************** +localhost                  : ok=3    changed=1    unreachable=0 [...] +``` + +The output is very verbose, but it shows that my playbook is correct: Only CSV files within Downloads have been marked for removal. + +### Running Ansible playbooks + +To run an Ansible playbook, you use the `ansible-playbook` command: + + +``` +`$ ansible-playbook example.yaml` +``` + +Confirm the results: + + +``` +$ ls *.csv  ~/Downloads/ +ls: cannot access '*.csv': No such file or directory +/home/tux/Downloads/: +file.txt +``` + +### Schedule the Ansible playbook + +The Ansible playbook has been confirmed, but I want it to run at least every week. I use [Anacron][7] rather than Cron, so I created an Anacron job to run weekly: + + +``` +$ cat << EOF >> ~/.local/etc/cron.weekly/cleanup +#!/bin/sh +ansible-playbook $HOME/Ansible/cleanup.yaml +EOF +$ chmod +x ~/.local/etc/cron.daily/cleanup +``` + +### What can you do with Ansible? + +Generally, Ansible is meant as a system maintenance tool. It's finely tuned to bootstrap complex systems to help with course correction when something's gone wrong and to keep a system in a specific state. I've used it for simple but repetitive tasks, like setting up a complex directory tree that would typically require several commands or clicks. I've also used it for tasks I don't want to do wrong, like removing old files from directories. I've also used it for tasks that are just too complex for me to bother trying to remember, like synchronizing several changes made to a production system with its redundant backup system. + +I don't use this cleanup script on my servers because I don't download CSV files every week on my servers, but I do use a variation of it. Ansible isn't a replacement for shell or Python scripting, but for some tasks, it's a very precise method to perform some set of tasks that you might want to run on many more systems. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/keep-folders-tidy-ansible + +作者:[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/files_documents_organize_letter.png?itok=GTtiiabr (Filing cabinet for organization) +[2]: https://docs.ansible.com/ansible/2.8/modules/find_module.html#find-module +[3]: https://opensource.com/article/21/8/linux-terminal#options +[4]: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/file_module.html +[5]: https://www.redhat.com/sysadmin/yaml-beginners +[6]: https://www.redhat.com/sysadmin/yaml-tips +[7]: https://opensource.com/article/21/2/linux-automation From 20e49dfe04dba3e18d9d2272b5ccd7650f97e6be Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Sep 2021 05:03:29 +0800 Subject: [PATCH 0541/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210929?= =?UTF-8?q?=20Manage=20CentOS=20Stream=20with=20Foreman?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210929 Manage CentOS Stream with Foreman.md --- ...10929 Manage CentOS Stream with Foreman.md | 171 ++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 sources/tech/20210929 Manage CentOS Stream with Foreman.md diff --git a/sources/tech/20210929 Manage CentOS Stream with Foreman.md b/sources/tech/20210929 Manage CentOS Stream with Foreman.md new file mode 100644 index 0000000000..72b6b3b007 --- /dev/null +++ b/sources/tech/20210929 Manage CentOS Stream with Foreman.md @@ -0,0 +1,171 @@ +[#]: subject: "Manage CentOS Stream with Foreman" +[#]: via: "https://opensource.com/article/21/9/centos-stream-foreman" +[#]: author: "Melanie Corr https://opensource.com/users/melanie-corr" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Manage CentOS Stream with Foreman +====== +This example provides a glimpse into the many options you have to manage +and provision CentOS Stream content in Foreman. +![Puzzle pieces coming together to form a computer screen][1] + +In December 2021, CentOS 8 will reach end of life and be replaced by CentOS Stream. One of the major changes between previous iterations of CentOS and CentOS Stream is the lack of minor versions. Centos Stream has adopted a continuous release cycle. From the beginning of this year, developers in the Foreman community started to see the benefits of earlier bug detection and patching that CentOS Stream offers as a result of the continuous releases. We no longer have to wait for the next release to take advantage of the latest changes and bugfixes. [A veteran Linux community enthusiast][2] noted that this move also brings RHEL developers closer than ever to the FOSS community. + +However, if you are an administrator of hundreds or thousands of servers, you might want to exercise control over when new packages are added to particular servers. If you are looking for a free open source tool that helps you ensure stability of production servers, while at the same time allowing you to safely pull in the latest changes from Centos Stream for development and testing, this is where Foreman can help. With Foreman, you can manage your Centos Stream content at all stages of the lifecycle environment. + +### What is Foreman? + +Foreman is a complete lifecycle management tool for physical and virtual servers. With Foreman, system administrators have the power to easily automate repetitive tasks, quickly deploy applications, and proactively manage servers on-premise or in the cloud. Foreman provides enterprise-level solutions for provisioning management, configuration management, and monitoring. Thanks to its plugin architecture, Foreman can be extended in a myriad of ways. Using the Katello plugin, you can use Foreman as a complete content management tool to manage CentOS Stream, among many other content types. + +With Foreman and Katello, you can define exactly which packages you want each environment to contain. For example, a Production environment might use packages that have been verified as stable, while a Developer environment might require the latest and greatest package versions available. You can also promote the content views across lifecycle environments. Let's take a look at how Foreman accomplishes this. + +We reference the web UI in this article, but Foreman also has a robust CLI and API. The Katello plugin provides a workflow and web UI for the Pulp project, which you can read about more in [this article][3]. We also supply a simple workflow here, but Foreman and the Katello project offer many different configuration options to suit your specific needs. + +This article assumes that Foreman and Katello are already installed. For more information about how to do that, see the [Katello installation manual][4]. + +### Create a Product + +The first step is to create a product in Foreman. The product functions as an internal label to store the CentOS Stream repositories. + + 1. In the Foreman web UI, navigate to **Content** >**Products**, and click **Create Product**. + 2. In the **Name** field, enter a name for the product. Foreman automatically completes the **Label** field based on what you have entered for **Name, **and this can't be changed later. + + + +### Add the CentOS Stream repositories to the Product + +Now that you have a product, you can use the URLs for the AppStream and BaseOS repositories and add them to your new product. + + 1. In the Foreman web UI, navigate to **Content** > **Products**, select the product you want to use, and then click **New Repository**. + 2. In the **Name** field, enter a name for the repository; for example, **Centos8StreamBaseOS**. Foreman automatically completes the **Label** field based on what you have entered for **Name**. + 3. From the **Type** list, select the type of repository, and then select **Yum**. + 4. In the **URL** field, enter the URL of the CentOS Stream Baseos repository to use as a source: + 5. Select the **Download Policy** list. The default is **On Demand** \- this means that Katello will only download metadata. If you want to download all the packages, change to **Immediate**, which downloads all the packages, which might run into 20-30 GB. + 6. Ensure that the **Mirror on Sync** check box is selected. This option ensures that content that is no longer part of the upstream repository is removed during synchronization. + 7. Click **Save**. + + + +Repeat these steps to add the AppStream repositories with URLs, for example, . Ensure that you use the closest official CentOS mirror instead. + +To perform an immediate synchronization, in your product window, click **Sync Now**. The initial synchronization can take some time. You can watch the synchronization status from **Content > Sync Status.** + +After the synchronization completes, you can view the new CentOS Stream operating system in **Hosts > Operating System**. Feel free to edit the name and description to suit your requirements. + +If you plan to use configuration management software like Ansible or Puppet, Foreman automatically creates an operating system report. You can turn this option off in **Administe > Settings > Ignore facts for operating system**. It is a good idea to rename the operating system to match the name in the configuration management software. For example, for Puppet, this would be _CentOS 8_. + +### Define your infrastructure's Lifecycle Environment + +The application life cycle is a concept central to Foreman's content management functions. The application life cycle defines how a particular system and its software look at a specific stage. For example, an application life cycle might be simple; you might only have a _development_ stage and _production_ stage. Foreman provides methods to customize each application life cycle stage in a controlled manner to suit your specifications. + +At this point, you must create your lifecycle environment paths: + + 1. In the Foreman web UI, navigate to **Content** >**Lifecycle Environments**. + 2. Click **New Environment Path** to start a new application life cycle. + 3. In the **Name** field, enter a name for your environment. + 4. In the **Description** field, enter a description for your environment. + 5. Click **Save**. + 6. Add as many environment paths as you need. For example, you can create _dev_, _test,_ _stage,_ and _production_ environments. To add these environments, click **Add New Environment**, complete the **Name** and **Description** fields, and select the prior environment from the **Prior Environment** list so that you chain them together in the sequence you expect to use. + + + +### Create and publish a Content View + +In Foreman, a Content View is a snapshot of your repositories at a particular point in time. Content Views provide the mechanism for isolating package versions in a state that you want to preserve. Content Views have a lot of configurable features that you can use for further refinement. For the purposes of this tutorial, let's keep things simple. + + 1. In the Foreman web UI, navigate to **Content** > **Content Views** and click **Create New View**. + 2. In the **Name** field, enter a name for the view. Foreman automatically completes the **Label** field from the name you enter. + 3. In the **Description** field, enter a description of the view. + 4. Click **Save** to create the Content View. + 5. In your new Content View, click **Yum Content > Add Repositories** in the **Repository Selection** area, click **Add.** For both the BaseOS and Appstream repositories, select packages you want to include, then click **Add Repositories**. + 6. Click **Publish New Version** and in the **Description** field, enter information about the version to log changes. + 7. Click **Save**. + + + +When you click **Publish New Version**, you create a snapshot of all the content that you have synchronized. This means that every server you subscribe to this Content View will have access only to the package versions in the Content View associated with this lifecycle environment. + +Every new Content View and subsequent versions are published first to the Library environment, where you can then promote to additional environments. + +### Promote content across lifecycle environments + +If you have tested new packages and are satisfied that everything is stable, you can promote your Content View to another lifecycle environment. + + 1. Navigate to **Content** > **Content Views** and select the Content View that you want to promote. + 2. Click the **Versions** tab for the Content View. + 3. Select the version you want to promote, and in the **Actions** column, click **Promote**. + 4. Select the environment where you want to promote the Content View and click **Promote Version**. + 5. Click the **Promote** button again. This time select the lifecycle environment, for example, **Test**, and click **Promote Version**. + 6. Finally, click on the **Promote** button again. For example, select the **Production** environment and click **Promote Version**. + + + +The servers that are assigned to that particular environment can now pull from an updated set of packages. + +### Create an Activation Key + +To register a CentOS Stream server to the content you have defined in a particular lifecycle, you must create an activation key. The activation key is a secure method of sharing credentials with a server. This uses a tool called **subscription-manager** to subscribe the CentOS Stream server to the content. + +When you have created the activation key, add the CentOS Stream subscription to the activation key. + + 1. In the Foreman web UI, navigate to **Content > Activation keys** and click **Create Activation Key**. + 2. In the **Name** field, enter the name of the activation key. + 3. In the **Description** field, enter a description for the activation key. + 4. From the **Environment** list, select the environment to use. + 5. From the **Content View** list, select the Content View you created just now. + 6. Click **Save**. + + + +### Create a CentOS Stream Host from Foreman managed content + +Everything is now set up. With the content you have created contained in a content view, and promoted across lifecycles, you can now provision hosts with exactly the content you want to use and subscribe to the updates you want them to receive. + +To create a host in Foreman, navigate to **Hosts > Create Host**. + + 1. In the **Name** field, enter a name for the host. + 2. Click the **Organization** and **Location** tabs to ensure that the provisioning context is automatically set to the current context. + 3. From the **Deploy On** list, select **Bare Metal**. + 4. Click the **Operating System** tab. + 5. From the **Architectures** list, select **x86_64**. + 6. From the **Operating System** list, select **CentOS_Stream 8.** + 7. Check the **Build Mode** box. + 8. For **Media Selection**, select **Synced Content** to use the CentOS Stream content you synced previously. + 9. From the **Synced** **Content** list, ensure that CentOS Stream is selected. + 10. From the **Partition Table** list, for this demo, select **Kickstart** default, but there are many available options. + 11. In the **Root Password** field, enter a root password for your new host. + 12. Click the **Interface** tab, and click **Edit,** and add a **Mac address.** + 13. Click the **Parameters** tab, and ensure that a parameter exists that provides an activation key. If not, add an activation key. + 14. Click **Submit** to save the host entry. + + + +Now the new host is in build mode, which means when you turn it on, it will begin installing the operating system. + +If you navigate to **Hosts > Content Hosts,** you can see the full details of the subscriptions, lifecycle environment, and content view that your host is subscribed to. + +This example is only a small glimpse into the many options you have to manage and provision CentOS Stream content in Foreman. If you want more detailed information about how you can manage CentOS Stream versions, control the content that your servers have access to, and control and protect the stability of your infrastructure, check out the [Foreman Content Management][5] documentation. With all CentOS Stream content under your control, you can create and register Centos Streams that consume only the content that you specify. For more detailed information on provisioning, see the [Foreman Provisioning][6] documentation. If you have any questions, feedback, or suggestions, you can find the Foreman community at + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/centos-stream-foreman + +作者:[Melanie Corr][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/melanie-corr +[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://twitter.com/Det_Conan_Kudo/status/1337366036023218177?s=20 +[3]: https://opensource.com/article/20/8/manage-repositories-pulp +[4]: https://docs.theforeman.org/3.0/Installing_Server_on_Red_Hat/index-katello.html +[5]: https://docs.theforeman.org/master/Content_Management_Guide/index-foreman.html +[6]: https://docs.theforeman.org/master/Provisioning_Guide/index-foreman.html From b22633523483e3b3d10c018acc4b95a8a80c4b9a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Sep 2021 05:03:45 +0800 Subject: [PATCH 0542/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210929?= =?UTF-8?q?=20Install=20Java=20manually=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210929 Install Java manually on Linux.md --- ...20210929 Install Java manually on Linux.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20210929 Install Java manually on Linux.md diff --git a/sources/tech/20210929 Install Java manually on Linux.md b/sources/tech/20210929 Install Java manually on Linux.md new file mode 100644 index 0000000000..62f170cd7e --- /dev/null +++ b/sources/tech/20210929 Install Java manually on Linux.md @@ -0,0 +1,123 @@ +[#]: subject: "Install Java manually on Linux" +[#]: via: "https://opensource.com/article/21/9/install-java-manually-linux" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Install Java manually on Linux +====== +Manual installation provides the user with the highest level of control +over the Java runtime environment. +![Penguin driving a car with a yellow background][1] + +It is easy to use your Linux distribution's package management tool to install the Java software packages. However, sometimes you need to do a manual installation of Java. This is of particular importance to administrators of Java-based application servers such as Tomcat or JBoss. Many open source and proprietary software products rely on these services. + +### Developer or Runtime kit? + +The Java Virtual Machine (JVM) is provided in two different forms: The Java Development Kit (JDK) or the Java Runtime Environment (JRE). + +Software developers usually need the JDK. It contains the binaries necessary for compiling, running, and testing the source code. To deploy a pre-built Java application generally only requires the JRE. It doesn't include the compilers and other development tools. The JRE is typically installed in production environments due to increased security and space limitations. + +### Get Java + +You can download open source Java software from the internet. You can find downloads of OpenJDK tarballs at [Red Hat Developer][2], [Adoptium.net][3], or the [Zulu Community edition][4] from Azul. + +### Install Java + +Set up a directory to hold the Java files. I like to create one simply called `java` so I can download and extract the tarball in a dedicated directory. + + +``` +`$ mkdir -p java/jdk` +``` + +Let's use the JDK in this example. Save the downloaded file to the `jdk` directory. Then change into that directory: + + +``` +$ cd java/jdk +$ ls +OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz +``` + +Extract the tarball. Note that `tar` will create a new directory: + + +``` +$ tar xvzf OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz +$ ls +jdk-11.0.12+7 OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz +``` + +Confirm the version of the new JVM using the `-version` option: + + +``` +$ cd jdk-11.0.12+7/bin +$ ./java -version +``` + +The version output of the JVM looks similar to this: + + +``` +openjdk version "11.0.12" 2021-07-20 +OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7) +OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode) +``` + +#### Environment variables + +To ensure that a given application works correctly, it needs to know exactly how to locate the JVM. Two main variables should be set: **JAVA_HOME** and **PATH**: + + +``` +$ echo $JAVA_HOME +$ echo $PATH +``` + +These can be set in the user's `.bashrc` file. Make sure that the variables come after [any existing code that sets **PATH**][5]: + + +``` +#Set the JAVA_HOME +export JAVA_HOME=~/java/jdk/jdk-11.0.12+7 +#Add the JAVA_HOME to the PATH +export PATH="$JAVA_HOME/bin:$PATH" +``` + +### Manual install situations + +Different situations require a manual installation of Java. Consider the following three scenarios. + +One situation could be a requirement for a different, perhaps older, version of Java that is not available in your Linux distribution's software repositories. + +Another example could be a security-driven decision that Java will not be installed on an operating system by default or at the "root level." + +A third situation could be the need for several different versions of Java, usually because multiple instances of a J2EE web application are running on the same server. This OS sharing is less common today due to the increased usage of virtual machines and containers to isolate processes. However, the need to maintain varying container images continues to make the understanding of manual installation vital. + +### Wrap up + +I demonstrated how I like to install the Java runtime environment but feel free to make up a convention that works best for your needs. Ultimately, manual installation provides the user with the highest level of control over the Java runtime environment. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/install-java-manually-linux + +作者:[Alan Formy-Duval][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/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://developers.redhat.com/products/openjdk/download +[3]: https://adoptium.net/%20%22https://Adoptium.net%22 +[4]: https://www.azul.com/downloads/zulu-community%20%22https://www.azul.com/downloads/zulu-community%22 +[5]: https://opensource.com/article/17/6/set-path-linux From 8237527b4896fb7fbfd0e0e69a50f2532a5c1bb1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Sep 2021 05:05:05 +0800 Subject: [PATCH 0543/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020210929?= =?UTF-8?q?=20SuperTuxKart=201.3=20Release:=20Open=20Source=20Game=20for?= =?UTF-8?q?=20Linux=20Adds=20Switch=20Support?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md --- ...urce Game for Linux Adds Switch Support.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md diff --git a/sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md b/sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md new file mode 100644 index 0000000000..a953f29b63 --- /dev/null +++ b/sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md @@ -0,0 +1,88 @@ +[#]: subject: "SuperTuxKart 1.3 Release: Open Source Game for Linux Adds Switch Support" +[#]: via: "https://news.itsfoss.com/supertuxkart-1-3-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +SuperTuxKart 1.3 Release: Open Source Game for Linux Adds Switch Support +====== + +One of the most popular open-source games, SuperTuxKart, has finally received a significant update after a gap of almost a year. It is a free and cross-platform 3D kart-racing game available for Linux, macOS, Windows, and Android. + +Just like Mario Kart, you can choose from a vast catalog of characters (based on mascots of open-source projects) racing in unique karts using special items to win races in various arenas. The game also features various racing modes, including a story Mode and an online Mode, to keep you engaged. + +Let us see what’s new with the latest release. + +### Nintendo Switch Port + +![Source: blog.supertuxkart.net][1] + +SuperTuxKart is now (unofficially) playable on the Switch. This has been possible due to the SDL2 implementation that was already used in the previous 1.2 release. To play the game, you will need to have **Homebrew** installed on your console. + +Moreover, the game also supports force feedback for the Joy-Cons and other controllers. This will undoubtedly make the game more lively whenever there are effects on-screen. + +### New Arenas + +Two new arenas — Ancient Colosseum Labyrinth and Alien Signal — have been introduced. + +![Source: blog.supertuxkart.net][2] + +The Ancient Colosseum Labyrinth is based on the Roman Colosseum with a dark setting and a secret tunnel. On the other hand, the Alien Signal is another arena inspired by a SETI-styled location with strange markings on the ground. + +The Las Dunas Soccer Stadium has also been updated and now houses a symmetrical soccer field. + +Lastly, lap line extensions have been added to various tracks. This means the lap will be counted even if you drive slightly off the main road. + +### GUI Improvements + +A major feature that will improve the gameplay experience is the introduction of **render resolution**. Using the slider, you can sacrifice the resolution for better frame rates on low-end systems. + +The high score selection screen now has its independent menu and displays the best times for normal races, egg hunts, and time trials. + +You can also open links in the game. Specifically, the links in a text/instruction that pops up in the game. This is possible, thanks to the SDL2 SDL_OpenURL. + +Blender 2.8 was officially used by artists to create tracks, maps, and more. + +### Redesigned Karts + +![Source: blog.supertuxkart.net][3] + +Your favorite characters like GNU, Adiumy and Emule have undergone visual changes. Sara the Racer is now replaced by Pepper, the mascot of Pepper&Carrot. + +You can refer to the [official release notes][4] for detailed information about the update. + +[Download SuperTuxKart 1.3][5] + +### Wrapping Up + +Overall, SuperTuxKart 1.3 has brought in exciting changes and fixes. Nintendo Switch users will now have something fresh to try out and play! + +What do you think about this release? Will you be willing to try it out on your Switch? Do share your thoughts 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/supertuxkart-1-3-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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjczMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2NSIgd2lkdGg9IjY0OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2NCIgd2lkdGg9IjI0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://blog.supertuxkart.net/2021/09/supertuxkart-13-release.html +[5]: https://github.com/supertuxkart/stk-code/releases/tag/1.3 From 4ce2cdcd083c9d40e0ab2c16adf6467989c3256d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 30 Sep 2021 05:05:14 +0800 Subject: [PATCH 0544/1588] add done: 20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md --- sources/tech/20210930 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20210930 .md diff --git a/sources/tech/20210930 .md b/sources/tech/20210930 .md new file mode 100644 index 0000000000..76787246cd --- /dev/null +++ b/sources/tech/20210930 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/09/fedora-35-beta-release/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 5afd0e2a823fe6ef0e6b22e36bed41800eb232c8 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 30 Sep 2021 08:19:13 +0800 Subject: [PATCH 0545/1588] Delete 20210930 .md --- sources/tech/20210930 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20210930 .md diff --git a/sources/tech/20210930 .md b/sources/tech/20210930 .md deleted file mode 100644 index 76787246cd..0000000000 --- a/sources/tech/20210930 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/09/fedora-35-beta-release/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 89f4e17fc8b77ea2d7327b61fef7840e553a38b6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 Sep 2021 08:43:28 +0800 Subject: [PATCH 0546/1588] translated --- ...0927 5 open source alternatives to Zoom.md | 71 ------------------- ...0927 5 open source alternatives to Zoom.md | 71 +++++++++++++++++++ 2 files changed, 71 insertions(+), 71 deletions(-) delete mode 100644 sources/tech/20210927 5 open source alternatives to Zoom.md create mode 100644 translated/tech/20210927 5 open source alternatives to Zoom.md diff --git a/sources/tech/20210927 5 open source alternatives to Zoom.md b/sources/tech/20210927 5 open source alternatives to Zoom.md deleted file mode 100644 index 4121a4acc2..0000000000 --- a/sources/tech/20210927 5 open source alternatives to Zoom.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: subject: "5 open source alternatives to Zoom" -[#]: via: "https://opensource.com/article/21/9/alternatives-zoom" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -5 open source alternatives to Zoom -====== -Try one of these open source video conferencing services. -![Two people chatting via a video conference app][1] - -I recently attended the [Practical Open Source Information POSI][2] conference, which was held on a free and open source video conferencing platform. As I attended a series of excellent talks about practical uses of open source software, I realized how commonplace video conferencing had become over the past few years. - -If open source does anything, it provides choice, and now that more and more workers have the freedom of working remotely, having an option in the way you connect makes a lot of sense. - -Sometimes, you need a full-featured video conferencing application with moderation, a presentation mode, and breakout rooms, while other times, all you want to do is make a quick call to a friend so that you can see each other's faces. - -### Jitsi - -[Jitsi][3] is an easy, casual, but robust video calling platform. You can self host it or use it on the public instance at [meet.jit.si][4]. It's got customizable URLs that make it easy to share links with friends you want to meet with, in-call chat, administrative controls, and call recording. It's very actively developed and has a whole collection of new features being tested and released each year. It's the platform Opensource.com uses for our weekly meetings. - -### Signal - -[Signal][5] is already a popular security-focused chat application, and it recently added [group video calls][6] to its features. The video calls are great for simple meetings, and because you can only meet with other people in your Signal contact list, there's no concern over unwanted guests at your video call party. There's also no back and forth "phone tag" as you try to locate the virtual room you're supposed to be meeting in. It all happens in Signal, so there's no guesswork required. - -Signal itself is pretty intuitive, and the video feature fits neatly into its existing conventions. In short, as long as your contacts are using Signal, this is a no-effort video calling platform. This is the application I use for personal contacts, and I regularly use its video calling feature to connect to friends and family. - -### P2p.chat - -[P2p.chat][7] is the easiest of them all, in both design and implementation. Working through Web Real-Time Communication (WebRTC), p2p.chat is a web application that allows you to connect directly to the person you're calling, with no host server required. There's not much to the p2p.chat interface, but that's another part of its appeal. There's no administrative control or presentation mode because p2p.chat is very much the "vidphone" promised in sci-fi: A casual, no-effort person-to-person (or people-to-people) video call with somebody far away. - -You use custom URLs to create a meeting space dynamically, so they're relatively easy to remember (aside from the small randomized part) and type. I use p2p.chat with friends who aren't on Signal, and it's never let me down. - -### BigBlueButton - -Designed for classrooms, conferences, and presentations, [BigBlueButton][8] is the solution you're looking for if you need strict admin controls and extreme flexibility. With BigBlueButton, you can mute all participants, block and kick a participant, create breakout rooms, create a collaborative whiteboard, share screens, give presentations, and record sessions. Participants can raise a digital hand for attention and set their status as a non-verbal method of communication. It's easy to use, but it's a serious platform for focused and very large groups. I've attended a few technical conferences using BigBlueButton, including the [Practical Open Source Information (POSI)][2] conference. - -### Wire - -[Wire][9] is an excellent choice for corporate customers looking for a hosted video chat and groupware client. Licensed under the [AGPL][10], this open source project is available for desktop and server, Android, and iOS. It features video calling, messaging, and file sharing, so even a remote meeting essentially has all the conveniences of meeting in person. You can try Wire for free for a limited time and then purchase a support contract for your company. Alternately, you can host it yourself. - -### Open source video chat - -There's no reason to settle for proprietary video calling hosted by companies you may not fully trust. The open source options available today are great for keeping in touch with all the people in your professional and personal life. Try one of these solutions the next time you want to meet with friends. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/alternatives-zoom - -作者:[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/chat_video_conference_talk_team.png?itok=t2_7fEH0 (Two people chatting via a video conference app) -[2]: https://opensource.org/posicfp -[3]: http://jitsi.org -[4]: http://meet.jit.si -[5]: https://signal.org -[6]: https://support.signal.org/hc/en-us/articles/360052977792-Group-Calling-Voice-or-Video-with-Screen-Sharing -[7]: https://p2p.chat/ -[8]: https://bigbluebutton.org/ -[9]: https://wire.com/en/ -[10]: https://opensource.org/licenses/AGPL-3.0 diff --git a/translated/tech/20210927 5 open source alternatives to Zoom.md b/translated/tech/20210927 5 open source alternatives to Zoom.md new file mode 100644 index 0000000000..aaeb19c752 --- /dev/null +++ b/translated/tech/20210927 5 open source alternatives to Zoom.md @@ -0,0 +1,71 @@ +[#]: subject: "5 open source alternatives to Zoom" +[#]: via: "https://opensource.com/article/21/9/alternatives-zoom" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 个替代 Zoom 的开源软件 +====== +试试这些开源视频会议服务之一。 +![Two people chatting via a video conference app][1] + +我最近参加了[实用开源信息 POSI][2] 会议,它是在一个免费的开源视频会议平台上举行的。当我参加了一系列关于开源软件的实际用途的精彩讲座时,我意识到视频会议在过去几年里已经变得非常普遍。 + +如果说开源做了什么,那就是提供了选择,现在越来越多的工人有了远程工作的自由,在你的连接方式上有一个选择是非常有意义的。 + +有时,你需要一个全功能的视频会议应用,其中包括审核、演示模式和分组讨论室,而其他时候,你想做的只是给朋友打一个快速电话,以便看到对方的脸。 + +### Jitsi + +[Jitsi][3] 是一个简单、随意、但强大的视频通话平台。你可以自己托管它,也可以在 [meet.jit.si][4] 的公共实例上使用它。它有可定制的 URL,可以很容易地与你想见面的朋友分享链接、通话中的聊天、管理控制和通话录音。它的开发非常活跃,每年都有一大批新功能被测试和发布。它是 Opensource.com 用于我们每周会议的平台。 + +### Signal + +[Signal][5] 已经是一个流行的以安全为重点的聊天应用,最近它又增加了[团体视频通话][6]的功能。视频通话非常适合简单的会议,而且因为你只能与你的 Signal 联系人列表中的其他人见面,所以不用担心你的视频通话聚会上有不速之客。当你尝试定位你应该开会的虚拟房间时,也没有来回的“电话标签”。这一切都发生在 Signal 中,因此无需猜测。 + +Signal 本身是非常直观的,视频功能非常适合其现有惯例。简而言之,只要你的联系人在使用 Signal,这就是一个不费力的视频通话平台。这是我用于个人联系的应用,我经常使用其视频通话功能与朋友和家人联系。 + +### P2p.chat + +[P2p.chat][7] 是其中最简单的一个,无论是设计还是实现。通过网络实时通信(WebRTC)工作,p2p.chat 是一个网络应用,允许你直接连接到你正在呼叫的人,而不需要主机服务器。p2p.chat 的界面并不多,但这也是其吸引力的另一部分。没有管理控制或演示模式,因为 p2p.chat 在很大程度上是科幻片中承诺的“视频电话”:与远方的人进行轻松的人对人(或人们对人们)视频通话。 + +你使用自定义的 URL 来动态地创建一个会议空间,所以它们相对容易记忆(除了小的随机部分)和输入。我和不在 Signal 上的朋友使用 p2p.chat,它从未让我失望过。 + +### BigBlueButton + +如果你需要严格的管理控制和极端的灵活性,[BigBlueButton][8] 是你正在寻找的解决方案,它专为教室、会议和演讲而设计。有了 BigBlueButton,你可以让所有与会者静音,阻止和踢走一个与会者,创建分组讨论室,创建协作式白板,共享屏幕,进行演讲,以及记录会议。与会者可以举起数字手表示注意,并将他们的状态设定为非语言交流方式。它很容易使用,但它是一个严肃的平台,适用于重点和非常大的群体。我参加过一些使用 BigBlueButton 的技术会议,包括[实用开源信息(POSI)][2]会议。 + +### Wire + +[Wire][9] 是寻找托管视频聊天和群件客户端的企业客户的绝佳选择。它是 [AGPL][10] 许可,这个开源项目可用于桌面和服务器、安卓和 iOS。它具有视频通话、发信和文件共享的功能,因此,即使是远程会议,基本上也有亲自开会的所有便利。你可以在有限的时间内免费试用 Wire,然后为你的公司购买一份支持合同。另外,你也可以自己托管它。 + +### 开源视频聊天 + +没有理由满足于由你可能不完全信任的公司托管的专有视频通话。今天可用的开源选项对于与你的职业和个人生活中的所有人保持联系是非常好的。下次你想和朋友见面时,不妨试试这些解决方案之一 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/alternatives-zoom + +作者:[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/chat_video_conference_talk_team.png?itok=t2_7fEH0 (Two people chatting via a video conference app) +[2]: https://opensource.org/posicfp +[3]: http://jitsi.org +[4]: http://meet.jit.si +[5]: https://signal.org +[6]: https://support.signal.org/hc/en-us/articles/360052977792-Group-Calling-Voice-or-Video-with-Screen-Sharing +[7]: https://p2p.chat/ +[8]: https://bigbluebutton.org/ +[9]: https://wire.com/en/ +[10]: https://opensource.org/licenses/AGPL-3.0 From f982c59dbbb852b96a6ff0eee27209d58b9e5a36 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 30 Sep 2021 08:47:03 +0800 Subject: [PATCH 0547/1588] translating --- ...0210929 Dialect- An Open-Source Translation App for Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md b/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md index 816f82b4be..f2d8192562 100644 --- a/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md +++ b/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/dialect/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From e88cf7de0239a07155d164796395740fd489806a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Sep 2021 08:55:38 +0800 Subject: [PATCH 0548/1588] =?UTF-8?q?=E6=B8=85=E9=99=A4=E8=BF=87=E6=9C=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...le on Steam for Windows and Linux Users.md | 103 -------- ...Now Converts Firefox to Snap by Default.md | 86 ------- ... Has a Much Needed Minty Fresh New Look.md | 65 ----- ...for New Devices With Multiple Bug Fixes.md | 80 ------ ...te Attempt to Push Brave Advertisements.md | 86 ------- ...out Linux (And I am Happy He Was Wrong).md | 67 ----- ...w- A Real Linux Tab for True Linux Fans.md | 233 ------------------ 7 files changed, 720 deletions(-) delete mode 100644 sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md delete mode 100644 sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md delete mode 100644 sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md delete mode 100644 sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md delete mode 100644 sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md delete mode 100644 sources/talk/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md delete mode 100644 sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md diff --git a/sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md b/sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md deleted file mode 100644 index 2c34c768a2..0000000000 --- a/sources/news/20210915 Open-Source Frontend for Emulators -RetroArch- Now Available on Steam for Windows and Linux Users.md +++ /dev/null @@ -1,103 +0,0 @@ -[#]: subject: "Open-Source Frontend for Emulators “RetroArch” Now Available on Steam for Windows and Linux Users" -[#]: via: "https://news.itsfoss.com/retroarch-steam/" -[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Open-Source Frontend for Emulators “RetroArch” Now Available on Steam for Windows and Linux Users -====== - -Since its release way back in 2010, [RetroArch][1] has been one of the most popular game emulator interfaces. Over the years, it has received numerous upgrades and lets you play classic games from various retro consoles ranging from the Atari 2600 to the PlayStation 2. - -While the RetroArch team has been planning to launch this on Steam for more than a year, it is finally available to the masses! - -This means you can now emulate and play your favorite retro games without having to leave Steam. - -Sure, you can download it from their official website, but launching it directly from your Steam collection proves to be a hassle-free way for most users. - -Not to forget, RetroArch’s presence on Steam will put this on a lot of people’s radars. So, this should give RetroArch’s popularity a boost on both Windows and Linux platforms. - -![RetroArch on Steam][2] - -Keep in mind that the RetroArch version available on Steam lacks certain features and most cores compared to the official one. Let us take a look at them. - -### Key Highlights - -#### Emulator Cores - -Unlike the standard way of using the _Core Downloader_, Cores (Emulators) can be installed as **DLCs** from Steam. This can be easily done by navigating to **“Manage DLC”** on Steam’s Retroarch browser page. - -Only 10 cores are available at launch. Here’s the list of cores – - - * Mupen64 Plus Next – Nintendo N64 - * Kronos – Sega Saturn - * PCSX ReARMed – PlayStation 1 - * Stella – Atari 2600 - * SameBoy – Game Boy & Game Boy Colour - * mGBA – Game Boy Advance - * Mesen – Nintendo Entertainment System - * Mesen S – Super Nintendo Entertainment System - * Genesis Plus GX – Sega SG-1000, Master System, Game Gear, Genesis and Mega CD - * Final Burn Neo – Arcade - - - -Additional cores will certainly be released in the future. According to the developer: - -> More cores will be coming as DLC soon. We have no ETA on when these will arrive, but it will likely be a dripfeed of new cores on a periodic basis as it takes a lot of time preparing the pages, descriptions, logos, previews and whatnot that a Steam page requires. - -RetroArch Blog - -![Retroarch Main Menu \(Source: Retroarch\)][3] - -#### Other Highlights - -RetroArch UI stays the same. This may be overwhelming for users who will be using RetroArch for the first time. The developers have plans to revamp its UI soon enough. - -Remote Play and Steam Cloud sync should also work. - -Do note that RetroArch will only be available for 64-bit Linux or Windows PCs. As of now, there are no plans for macOS yet. - -You can learn more about RetroArch’s availability on Steam on their [official blog post][4]. - -### Wrapping Up - -The addition of RetroArch to Steam will certainly increase their userbase. Initial reviews seem to be very positive, which is a good thing! - -They should get better financial support from new users on [Patreon][5] as well. You might as well start helping them out if interested. - -If you want to try it out, head to your Steam client and search for it. Or, click on the link below to explore it on Steam store along with its system requirements. - -[RetroArch on Steam][6] - -**Via**: [GamingOnLinux][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/retroarch-steam/ - -作者:[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://www.retroarch.com/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM3NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://www.libretro.com/index.php/retroarch-finally-released-on-steam/ -[5]: https://www.patreon.com/libretro -[6]: https://store.steampowered.com/app/1118310/RetroArch/ -[7]: https://www.gamingonlinux.com/2021/09/retroarch-gets-a-steam-release-bringing-emulation-to-even-more-gamers diff --git a/sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md b/sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md deleted file mode 100644 index afd9c82492..0000000000 --- a/sources/news/20210917 After Chromium, Ubuntu Now Converts Firefox to Snap by Default.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: subject: "After Chromium, Ubuntu Now Converts Firefox to Snap by Default" -[#]: via: "https://news.itsfoss.com/ubuntu-firefox-snap-default/" -[#]: author: "Abhishek https://news.itsfoss.com/author/root/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -After Chromium, Ubuntu Now Converts Firefox to Snap by Default -====== - -One of the major and controversial [changes in the upcoming Ubuntu 21.10][1] is the conversion of Firefox from deb to snap. - -Yes, you heard it right. The default Firefox will be a Snap application, not the regular DEB version. - -As [spotted by OMG! Ubuntu][2], this is done as per an agreement between Mozilla and Canonical (Ubuntu’s parent company). - -The [feature freeze exception (FFE)][3] mentions it clearly: - -> Per Canonical’s distribution agreement with Mozilla, we’re making the snap the default installation of Firefox on desktop ISOs starting with Ubuntu 21.10. - -With this change, the Firefox deb package will be converted to Firefox snap package. - -This means that going forward, Firefox will be available as Snap. I think this change also means that even if you use apt command to install it, you’ll be getting the Snap package. - -### Deja vu? - -If you feel that this has been done in the past, you have got the right feeling. In the past, Ubuntu converted the Chromium browser to Snap. - -Today, if you use apt install chromium-browser, you still get the Snap version. There is no DEB package for Chromium in Ubuntu anymore. - -When Ubuntu made this sudden change on its own, there was an uproar. The conversion of Firefox to Snap will also create controversy. But this time, Ubuntu shares the blame with Mozilla. - -### Mozilla wants Snap - -![][4] - -Interestingly, it was [Mozilla that approached Canonical for this change][5]. Mozilla will maintain the Snap version of Firefox and the end users will get quick updates directly from the source. - -After all, it takes a few days before a new Firefox release lands in Ubuntu. With the Snap move, your Firefox will be updated to the new version the same day. - -### Concerns? - -A few for sure. I know there are a few people completely averted to Snap, I am not one of them. - -I have three major complaints with Snap packages: slow start up speed, poor system integration and high disk space. - -Over the time, Snaps have improved on the disk space front. But despite all the improvements, Snap packages still take longer to start. This could be tolerable with an IDE but it may ruin the browsing experience. - -This slow startup speed makes me wonder why it is called ‘Snap’ because surely, it doesn’t start in a snap. - -Another thing that bothers me is the Snap auto-refresh. Snap apps are updated automatically. If Mozilla starts pushing updates more frequently, this [Firefox restart annoyance][6] in the middle of work will be more frequently as well. - -![][7] - -The change will impact you when you install or upgrade to Ubuntu 21.10. The change will eventually propagate to Ubuntu 22.04 LTS. - -What do you think of this change? Yeah or neah? - -#### 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/ubuntu-firefox-snap-default/ - -作者:[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://news.itsfoss.com/ubuntu-21-10-release-schedule/ -[2]: https://www.omgubuntu.co.uk/2021/09/ubuntu-makes-firefox-snap-default -[3]: https://bugs.launchpad.net/ubuntu/+source/ubuntu-release-upgrader/+bug/1943840 -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI1NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://discourse.ubuntu.com/t/feature-freeze-exception-seeding-the-official-firefox-snap-in-ubuntu-desktop/24210 -[6]: https://news.itsfoss.com/mozilla-annoying-new-tab/ -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= diff --git a/sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md b/sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md deleted file mode 100644 index 8458af1ffe..0000000000 --- a/sources/news/20210917 Linux Mint-s Website Has a Much Needed Minty Fresh New Look.md +++ /dev/null @@ -1,65 +0,0 @@ -[#]: subject: "Linux Mint’s Website Has a Much Needed Minty Fresh New Look" -[#]: via: "https://news.itsfoss.com/linux-mint-new-website-design/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Linux Mint’s Website Has a Much Needed Minty Fresh New Look -====== - -Linux Mint is one of the [best Linux distributions][1] available while offering a modern user experience. - -However, Linux Mint’s original website looked dated and potentially unattractive to new-age computer users. - -Many suggested a visual makeover to reflect Linux Mint’s taste through a modern website design. And, only recently the developers started working on a redesign in collaboration with the community members, asking for feedback and getting insights on proposed designs. - -Finally, a design was finalized and applied to [Linux M][2][i][2][nt’s official website][2]. - -The website looks clean and informative, great on desktop, and perfectly fits mobile phone browsers! - -![][3] - -Every new Linux user should be able to evaluate their requirements by looking at the features offered easily. - -The information is well-presented to convince users why they should try out Linux Mint on their desktop system. - -![][4] - -The key highlights of the website would be the homepage, download page, and donation page. - -Of course, you can choose to explore more about Linux Mint and how everything works through individual resources (like our articles), but the official website should be the essential starting point, which it is now. - -The accent color and the theme combination feels just like what Linux Mint needed! Navigating through various web pages and the menu is a breeze. I don’t think there is any unnecessary element on the website; everything fits perfectly in the first look. The page load time is faster as well. - -The blog/monthly news section continues to use the same design. And, I’m not certain if they intend to refresh that by applying the same design anytime soon. But, I think that should happen to ensure consistency between their web pages. - -_What do you think about Linux Mint’s new website design? Do you like it? Do you think this would help them get more attention from new-age users?_ - -_You are welcome to 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/linux-mint-new-website-design/ - -作者:[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/best-linux-distributions/ -[2]: https://linuxmint.com -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzMSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= diff --git a/sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md b/sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md deleted file mode 100644 index ee950086fa..0000000000 --- a/sources/news/20210922 Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes.md +++ /dev/null @@ -1,80 +0,0 @@ -[#]: subject: "Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes" -[#]: via: "https://news.itsfoss.com/ubuntu-touch-ota-19/" -[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ubuntu Touch OTA-19 Brings in Support for New Devices With Multiple Bug Fixes -====== - -Ubuntu Touch is an open-source OS for mobile devices that respects user privacy, unlike Google’s Android for privacy-focused users. The UBports community has released yet another update of Ubuntu Touch that is based on Ubuntu 16.04. - -This release supports many new devices and contains significant updates on certain phones, along with numerous bug fixes. - -Let’s take a look at them. - -![Source: UBports][1] - -### What’s New? - -#### Framework and Packages - -The 16.04.7 Qt framework and packages like qml-module-qtwebview and libqt5webview5-dev have been added to the App framework. This improves application compatibility with other platforms. - -#### Imrpovements to Halium devices - -The gyroscope and magnetic field sensors can now be accessed on the Halium 5.1 and 7.1 devices. Do note that the functionality of the compass is still under development. The same applies to the magnetic field sensor for the Halium 9 and 10 devices that now use sensorfw, thus replacing the legacy platform-API. - -#### Pixel 3a - -You can completely shut down the device as intended. It no longer hangs in the process of the shutdown, so you should have better battery life. Additionally, the freezing of the camera app while capturing sounds when recording videos has also been fixed. - -#### Messaging App Fix - -The messaging app has also received a minor update. When messages arrive, the keyboard will no longer appear automatically but when needed. This is useful if the user doesn’t want to reply or access the keyboard on demand. - -#### Media Hub - -A bug that prevented the device from sleep when audio sounds were played in successions has been fixed. Another major bug that reduced battery life drastically, because of uncleared requested wake locks, has also been taken care of. - -### Other Improvements - -There are several new devices added to support Ubuntu Touch, along with fixes for the Wi-Fi, audio, and camera. - -You can look at the [official release notes][2] to check the list of devices added and explore more technical details. - -### Update or Installation - -Ubuntu Touch users should automatically receive an update or head to the updates in the System Settings to check for available updates. - -Those willing to try out Ubuntu Touch for the first time can explore the [official website][3] and check if their device is supported correctly before installation. - -I am particularly looking forward to the Ubuntu Touch OS update with Ubuntu 18.04 or newer as its base after several minor updates. - -_What do you think about this new update? 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/ubuntu-touch-ota-19/ - -作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQyMiIgd2lkdGg9IjM0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://ubports.com/blog/ubports-news-1/post/ubuntu-touch-ota-19-release-3779 -[3]: https://ubuntu-touch.io/get-ubuntu-touch diff --git a/sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md b/sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md deleted file mode 100644 index 338aff0972..0000000000 --- a/sources/news/20210927 Brave Launches Privacy-Focused -Brave Talk- as a Desperate Attempt to Push Brave Advertisements.md +++ /dev/null @@ -1,86 +0,0 @@ -[#]: subject: "Brave Launches Privacy-Focused “Brave Talk” as a Desperate Attempt to Push Brave Advertisements" -[#]: via: "https://news.itsfoss.com/brave-talk/" -[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Brave Launches Privacy-Focused “Brave Talk” as a Desperate Attempt to Push Brave Advertisements -====== - -Ever since the initial Covid-19 outbreak in 2020, the world has seen an explosion in the popularity of online meeting services. Unfortunately, many of these are not very privacy-friendly, especially as many of these are offered by notoriously data-hungry advertising companies. - -However, the company behind the wildly successful Brave browser has developed a privacy-friendly solution, “Brave Talk.” - -### Brave Talk: Open-Source Based Video Conferencing - -![][1] - -Unlike Zoom and Google Meet, Brave Talk is a piece of new video conferencing software that aims to provide better privacy than its competitors. - -It is based on an open-source video conferencing solution i.e., [Jitsi][2], and claims to track no user data. - -As a Brave service, alongside Brave News and Search, Brave Talk is integrated directly into the browser. While this makes it more convenient to start calls, it could be a push to promote the web browser more than ever. - -Like Apple’s FaceTime, Brave Talk calls can only be started from a specific browser, which is Brave. This is in contrast to many other [open-source video conferencing services][3]. - -### The Push for Brave Advertising Network - -![][4] - -Another thing that many people may point out is that it requires the use of Brave tokens. These are kind of like frequent flyer points, except for use digitally by viewing ads. - -For me, this wasn’t very clear, as Brave Talk never seemed to actually do anything with these tokens. - -So, the users need to opt for Brave rewards if they want to use the service for free. - -**Editor’s Thoughts:** Doesn’t it sound like an aggressive push to promote Brave’s advertising network? - -Considering that it utilizes an open-source technology, it not only restricts to a particular web browser, the requirement of enabling “Brave Rewards” may seem to be a bit extreme just because it promises total privacy? - -Of course, it is just a thought here. If the user (you) do not have any problem turning on “Brave Rewards,” Brave’s privacy-focused advertising network, and switching to Brave web browser, you may find Brave Talk an exciting option. - -![][5] - -### Final Thoughts - -I believe that as a privacy-centric offering, Brave Talk sounds good on paper. - -It may even offer a decent call quality and an engaging UI, among other things. Also, it should be mentioned that there are two tiers: a free tier and a premium option of **$7/month** with more features. - -If you are already using Brave Rewards and have no issues with their private advertising service, it could be a good option for you. It may not be a convenient option for users who do not use the Brave web browser or do not prefer the Brave Rewards system. - -If you want to try Brave Talk out for yourself, you will need the Brave browser. For more details, you can refer to the [official announcement][6]. - -[Brave Talk][7] - -_What do you think about Brave Talk? 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/brave-talk/ - -作者:[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,PHN2ZyBoZWlnaHQ9IjQxOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://itsfoss.com/jitsi-meet/ -[3]: https://itsfoss.com/open-source-video-conferencing-tools/ -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUxOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://brave.com/brave-talk-launch/ -[7]: https://talk.brave.com diff --git a/sources/talk/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 deleted file mode 100644 index 08548e553e..0000000000 --- a/sources/talk/20210825 When Linus Torvalds Was Wrong About Linux (And I am Happy He Was Wrong).md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: 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/ diff --git a/sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md b/sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md deleted file mode 100644 index 34a368bebd..0000000000 --- a/sources/tech/20210923 JingPad Review- A Real Linux Tab for True Linux Fans.md +++ /dev/null @@ -1,233 +0,0 @@ -[#]: subject: "JingPad Review: A Real Linux Tab for True Linux Fans" -[#]: via: "https://itsfoss.com/jingpad-a1-review/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -JingPad Review: A Real Linux Tab for True Linux Fans -====== - -If you follow Linux news enthusiastically, you might have come across a new name recently: [JingOS][1]. - -It is a new Linux distribution designed for touch devices. It can also be used as a regular desktop operating system on non-touch devices. - -![JingOS][2] - -JingOS is not the primary product for Beijing based JingLing tech. They have created this OS for their flagship product, JingPad, an ARM-based Linux tablet. - -This review focuses on two aspects: - - * The hardware side of JingPad tablet - * The software side of JingOS - - - -So that you know - -People at Jing sent me the JingPad for free to review the device. I can keep the device forever. However, this does not mean that review is biased in their favor to show only the positives. I am sharing my experience with the device and its operating system. - -### JingPad: The first impression - -![JingPad A1][3] - -To be frank with you, I was expecting a mediocre, generic tablet preinstalled with a Linux OS. I was wrong. - -The moment I unboxed the device and hold it in my hands, I got a feeling that I am looking at a premium device. The black colored tablet has a smooth finish. The back has a glossy finish and though I prefer matte usually, I liked the shiny body. I learned later that they used Corning Gorilla Glass for the back. - -The hardware specification of the gadget is more than just decent. Take a look: - - * 11 inches AMOLED screen with 4:3 aspect ratio - * 2K screen with 266PPI and 350nit - * Unisoc Tiger T7510 ARM Chip - * 8000mAh battery - * Weighs around 550g so not too heavy - * Around 7 mm in thickness - * 16 MP back camera and 8 MP front camera - * Dual band WiFi and Bluetooth 5.0 - * 8 GB RAM - * 256 GB UMCP storage which can be expanded by MicroSD of 512 GB in size - - - -JingPad also has companion stylus and keyboard. The review unit did not have the stylus but I did get the detachable keyboard. More on the keyboard later. - -Note - -JingOS is in alpha stage of development. A lot of things do not work as expected or promised at this moment. It should eventually get better in the later stages of development. - -### JingOS: Experience the user interface - -The JingOS will immediately remind you of iOS or Deepin OS, whichever you prefer. The interface is clean and the 2K display makes things look pretty. - -There are row of application icons and a dock at the bottom. Swiping up from the bottom brings an activity area displaying all the running applications. From here, you can drag an application upward to close it. Touching the trash will close all the running applications. To minimize an application, you have to swipe from right to left. - -![JingOS interface][4] - -Swiping down from the top left brings the notification center. Doing the same on the top right corner lets you access the Settings menu. - -The theming option is limited to light and dark themes but hey, you are getting the dark theme at least. Changing the theme requires a restart, which is an annoyance. - -![JingOS provides a dark mode][5] - -From what I see and experience, JingOS uses Ubuntu as base. For the interface, it is using KDE Plasma and probably some parts of GNOME underneath. The footprints of KDE Plasma are visible at places. For example, look at this screenshot notification. - -![JingOS is built on top of KDE Plasma][6] - -Since it is based on Ubuntu, you can use the apt-get commands in the terminal. The terminal (KDE’s Konsole) can be used with both keyboard and on-screen keyboard. You also have the option to split the terminal window. - -![Terminal][7] - -Something that bothered me with JingOS is that it only works in the landscape mode. I could not find a way to use it in the portrait mode. This creates an issue if you are trying to log into a website in the browser because the on-screen keyboard takes half of the screen and you cannot see the form fields properly. - -![Works only in landscape mode][8] - -There is also no tap to wake feature. Face unlock is also missing. There is a fingerprint reader on the power button but it does not work for now. JingOS will add this feature in the [next couple of months through software update][9]. - -Overall, JingOS is pretty to look at, pretty to use for most part of it. - -### Keyboard - -The review device I got came with the companion keyboard. The keyboard is made for JingPad. It is magnetic and the tab sticks to it. It is detected automatically, no wonder there. It doubles up as cover to give the device front and back protection. - -![JingPad with keyboard][10] - -You can tilt the device at certain angles to use it comfortably as a laptop. - -![JingPad with keyboard placed at angle][11] - -**At the time of writing this review, the keyboard support is in initial stages for JingOS. This is why it does not work as it should.** - -There are several function keys on the keyboard for controlling the volume, brightness, media playback, screen lock etc. - -Most function keys work, except the one for showing the desktop. The super key, which has JingPad logo, does not work as well. I was expecting it to bring the home screen from running applications but that did not work. - -The worst part is that when the keyboard is attached, it does not show the mouse pointer on the screen. That means going into a hybrid use mode where you touch the applications icon to open them and then use the keyboard for typing. This must be improved in the future. - -Coming to the typing, the keys are a bit tiny but not miniscule. I think that’s expected from the keyboard that has to match the 11 inches screen. The keys - -The added weight of the keyboard makes the device heavier than usual but I guess you’ll have to make a compromise with the ease of use and the increased weight. - -Another thing I noticed that when you put the lid down in the keyboard mode, the screen is not locked automatically. I expected a similar behavior to closing the lid of laptop. - -### Battery life, charging and performance - -JingPad comes with a 8000 mAh and claims to have up to 10 hours of battery life. They also claim that their 18W fast charger will charge the device completely in 3 hours. - -My review device did not come with the fast charger because it was still under manufacturing when they shipped the device. I got a travel adapter instead and it took slightly more than 5 hours to charge the device. - -I tested and found that if you keep the device on standby, the battery lasts around 42 hours. If you start using it continuously, it goes for 6 hours max. Now, this depends on what kind of work you are doing on the system. A few tweaks like reducing screen brightness, refresh rate, disabling connectivity could give it some extra battery life. - -### Camera and sound - -![][12] - -There are two cameras here. 16 MP back camera for taking pictures (well, why not) and 8 MP front camera for video calls and online meetings. - -Camera performance is okay. The default camera does not come with AI features like the smartphones but that’s fine. You are not going to use it primarily as a camera, after all. - -The front camera is good enough for the video calls. The placement of front camera is on the top so when you are using it in the landscape mode, it may seem that you are not looking directly into the camera. But people could still see and hear you well so that should not be an issue. - -Speaking of hearing, JingPad has 4 speakers, two on each side. They provide decent sound for causal YouTube and watching streaming content for a single person. No complaints in this department. - -### Applications - -JingPad comes pre-installed with some of its own applications. These applications include a file manager, camera app, voice recorder, camera app, gallery app, music and video applications. Many of these applications are open source and you can find the code on [their GitHub repository][13]. - -![The music app from JingOS][14] - -JingOS has an app store of its own where it provides a handful of applications that work on the touch devices. - -![JingOS App Store][15] - -The app store does not offer many applications at the moment but _**you can use the apt package manager**_ to get additional software (from JingOS’s repositories). - -My biggest complaint is not about the lack of applications. It’s about the versions of some of the offered applications. I downloaded Mozilla Firefox from the app store and it installed version 82. The current Firefox version is 92 at the time of writing the review. I tried updating the system, even in command line, to see if it gets updates but there were none. - -Because of this outdated version, I could not [play Netflix on Firefox][16]. There is no dedicated Netflix app so this was the only way to test it. - -![Issue with outdated Firefox][17] - -There are plans to add Android apps support as well. I cannot say how well it will work but something is better than nothing. - -### Using JingPad for coding - -I am not a programmer, not anymore at least. But since JingPad’s targeted customer include young coders who are frequently on the move, I tried using it for some simple coding. - -There is no IDE available from the App Store but VS Code was available to install from the APT repository as well as in DEB file format. I installed it and opened it but it never ran like it was supposed to be. - -So, I installed Gedit and wrote some sample bash scripts. Not much of coding but with the attached keyboard, it was not too bad. - -It would have been a lot better if the copy-paste worked but unfortunately, I was not able to select and copy the code from random websites like a true programmer of the 21st century. I hope this gets fixed in the future updates. - -### Android compatibility and other operating systems - -I know what you are thinking. The tab looks good hardware wise. It is designed to run a Linux distribution based on Ubuntu. So can I use Ubuntu or some other distributions? - -JingOS team says that you are free to install any other operating system on it. It uses ARM architecture so that is something to keep in mind while replacing the OS. - -You will also be able to install JingOS back. I am yet to experiment with this part. I’ll update the review when I do that. - -As per the [roadmap of JingOS][18], there are plans for adding Android compatibility. This means you should be able to install Android or Android based ROM/distributions. As per the JingOS team, they will be developing the solution in house instead of using tools like Anbox. That will be interesting to see. - -Here’s a demo video of an Android app running on JingPad under JingOS: - -### Conclusion - -JingOS is in alpha stage of development at the moment. Most of the issues I have encountered in this review should be addressed in the future OTA updates, as their roadmap suggests. The final stable version of JingPad should be available by March 2022. - -JingPad as a device comes on the pricey side but it also gives you a high-end gadget. 2K AMOLED display with Gorilla Glass, 8 GB RAM, 256 GB UMCP storage and other stuff you get only in high-end devices. The sound from the speakers is decent. - -The magnetic tab cover and the detachable keyboards are also of premium quality. These things matter because you are paying a good amount of money for it. - -The [JingPad with the Pencil][19] (stylus) and the keyboard costs $899. It comes with free international shipping and 1-year warranty. In many countries, there will also be additional custom duty levied on top of this price. - -That seems like a lot of money, right? If you compare it to the price of iPad Air with same specifications (256 GB storage, WiFi+Cellular), keyboard and Pencil, the Apple device price reaches $1300 in the USA. - -It is natural to compare JingPad with PineTab, another ARM-based Linux tablet. But PineTab is not a high-end gadget. It has modest specification and geared towards DIY tinkerers. JingPad, on the other hand, targets regular users, not just the DIY geeks. - -Altogether, JingPad is aiming to give you a true Linux tablet but in the premium range. You get what you are paying for. A premium device for a premium pricing, with the freedom to run Linux on it. - -_**But at this stage, JingOS has a lot of pending work to make JingPad a consumer level Linux tablet.**_ You should wait for the final device unless you really want your hands on it right away. - -I plan to make a video review of the device where you can see it in action. I am not very good at doing video reviews, so this will take some time. You may leave your comments on what you would like to see in the video review and I’ll try to cover it. - -_Meanwhile, you can follow the updates on JingPad and JingOS development on their [Telegram channel][20] or [Discord][21]. You may also watch the demos on [their YouTube channel][22]._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/jingpad-a1-review/ - -作者:[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://en.jingos.com/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jing-os-interaface.webp?resize=768%2C512&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad.jpeg?resize=800%2C529&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-interface.webp?resize=800%2C584&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-theme-change.webp?resize=800%2C584&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-plasma-notification.webp?resize=800%2C584&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-terminal.webp?resize=800%2C584&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-landscape.webp?resize=800%2C584&ssl=1 -[9]: https://forum-cdn.jingos.com/uploads/default/original/1X/4c6ef800ef62f0315852fde4f2c32958b32d93a9.png -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-with-keyboard.webp?resize=800%2C600&ssl=1 -[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-keyboard-angle.webp?resize=800%2C600&ssl=1 -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-camera.png?resize=787%2C552&ssl=1 -[13]: https://github.com/JingOS-team/JingOS -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-music-app.webp?resize=800%2C584&ssl=1 -[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingos-app-store.webp?resize=800%2C584&ssl=1 -[16]: https://itsfoss.com/netflix-firefox-linux/ -[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/JingPad-Netflix-Issue.webp?resize=800%2C584&ssl=1 -[18]: https://forum.jingos.com/t/feature-roadmap-of-jingos-arm-on-the-jingpad-a1/1708 -[19]: https://www.indiegogo.com/projects/jingpad-world-s-first-consumer-level-linux-tablet#/ -[20]: https://t.me/JingOS_Linux -[21]: https://discord.gg/uuWc8qKM -[22]: https://www.youtube.com/channel/UCRbaVa2v845SEtRadSlhWmA From ed438c23f86b78aad4afb134546ffeeea0afc34f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Sep 2021 11:44:44 +0800 Subject: [PATCH 0549/1588] PRF @geekpi --- ...0927 5 open source alternatives to Zoom.md | 24 ++++++++++--------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/translated/tech/20210927 5 open source alternatives to Zoom.md b/translated/tech/20210927 5 open source alternatives to Zoom.md index aaeb19c752..bdea93af02 100644 --- a/translated/tech/20210927 5 open source alternatives to Zoom.md +++ b/translated/tech/20210927 5 open source alternatives to Zoom.md @@ -3,16 +3,18 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 5 个替代 Zoom 的开源软件 ====== -试试这些开源视频会议服务之一。 -![Two people chatting via a video conference app][1] -我最近参加了[实用开源信息 POSI][2] 会议,它是在一个免费的开源视频会议平台上举行的。当我参加了一系列关于开源软件的实际用途的精彩讲座时,我意识到视频会议在过去几年里已经变得非常普遍。 +> 试试这些开源视频会议服务之一。 + +![](https://img.linux.net.cn/data/attachment/album/202109/30/114413ylalu7dcl5au575v.jpg) + +我最近参加了 [实用开源信息(POSI)][2] 会议,它是在一个自由开源的视频会议平台上举行的。当我参加了一系列关于开源软件的实际用途的精彩讲座时,我意识到视频会议在过去几年里已经变得非常普遍。 如果说开源做了什么,那就是提供了选择,现在越来越多的工人有了远程工作的自由,在你的连接方式上有一个选择是非常有意义的。 @@ -20,23 +22,23 @@ ### Jitsi -[Jitsi][3] 是一个简单、随意、但强大的视频通话平台。你可以自己托管它,也可以在 [meet.jit.si][4] 的公共实例上使用它。它有可定制的 URL,可以很容易地与你想见面的朋友分享链接、通话中的聊天、管理控制和通话录音。它的开发非常活跃,每年都有一大批新功能被测试和发布。它是 Opensource.com 用于我们每周会议的平台。 +[Jitsi][3] 是一个简单、随意、但强大的视频通话平台。你可以自己托管它,也可以在 [meet.jit.si][4] 的公共实例上使用它。它有可定制的 URL,可以很容易地与你想见面的朋友分享链接、通话中的聊天、管理控制,和通话录音。它的开发非常活跃,每年都会测试和发布一大批新功能。它是 Opensource.com 用于我们每周会议的平台。 ### Signal -[Signal][5] 已经是一个流行的以安全为重点的聊天应用,最近它又增加了[团体视频通话][6]的功能。视频通话非常适合简单的会议,而且因为你只能与你的 Signal 联系人列表中的其他人见面,所以不用担心你的视频通话聚会上有不速之客。当你尝试定位你应该开会的虚拟房间时,也没有来回的“电话标签”。这一切都发生在 Signal 中,因此无需猜测。 +[Signal][5] 已经是一个流行的以安全为重点的聊天应用,最近它又增加了 [团体视频通话][6] 的功能。视频通话非常适合简单的会议,而且因为你只能与你的 Signal 联系人列表中的其他人见面,所以不用担心你的视频通话会议上有不速之客。当你尝试定位你应该参与开会的虚拟房间时,也没有来回的“电话标签”。这一切都发生在 Signal 中,因此无需猜测。 Signal 本身是非常直观的,视频功能非常适合其现有惯例。简而言之,只要你的联系人在使用 Signal,这就是一个不费力的视频通话平台。这是我用于个人联系的应用,我经常使用其视频通话功能与朋友和家人联系。 ### P2p.chat -[P2p.chat][7] 是其中最简单的一个,无论是设计还是实现。通过网络实时通信(WebRTC)工作,p2p.chat 是一个网络应用,允许你直接连接到你正在呼叫的人,而不需要主机服务器。p2p.chat 的界面并不多,但这也是其吸引力的另一部分。没有管理控制或演示模式,因为 p2p.chat 在很大程度上是科幻片中承诺的“视频电话”:与远方的人进行轻松的人对人(或人们对人们)视频通话。 +[P2p.chat][7] 是这些中最简单的一个,无论是设计还是实现。通过 WebRTC 工作,p2p.chat 是一个 Web 应用,允许你直接连接到你正在呼叫的人,而不需要托管服务器。p2p.chat 的界面并不多,但这也是其吸引力的另一部分。没有管理控制或演示模式,因为 p2p.chat 在很大程度上是科幻片中承诺的“视频电话”:与远方的人进行轻松的人对人(或人们对人们)视频通话。 -你使用自定义的 URL 来动态地创建一个会议空间,所以它们相对容易记忆(除了小的随机部分)和输入。我和不在 Signal 上的朋友使用 p2p.chat,它从未让我失望过。 +你可以使用自定义的 URL 来动态地创建一个会议空间,所以它们相对容易记忆(除了小的随机部分)和输入。我和不在 Signal 上的朋友使用 p2p.chat,它从未让我失望过。 ### BigBlueButton -如果你需要严格的管理控制和极端的灵活性,[BigBlueButton][8] 是你正在寻找的解决方案,它专为教室、会议和演讲而设计。有了 BigBlueButton,你可以让所有与会者静音,阻止和踢走一个与会者,创建分组讨论室,创建协作式白板,共享屏幕,进行演讲,以及记录会议。与会者可以举起数字手表示注意,并将他们的状态设定为非语言交流方式。它很容易使用,但它是一个严肃的平台,适用于重点和非常大的群体。我参加过一些使用 BigBlueButton 的技术会议,包括[实用开源信息(POSI)][2]会议。 +如果你需要严格的管理控制和极端的灵活性,[BigBlueButton][8] 是你正在寻找的解决方案,它专为教室、会议和演讲而设计。有了 BigBlueButton,你可以让所有与会者静音,阻止和踢走一个与会者,创建分组讨论室,创建协作式白板,共享屏幕,进行演讲,以及记录会议。与会者可以“举起手”表示注意,并将他们的状态设定为非语言交流方式。它很容易使用,但它是一个严肃的平台,适用于重点和非常大的群体。我参加过一些使用 BigBlueButton 的技术会议,包括 [实用开源信息(POSI)][2]会议。 ### Wire @@ -44,7 +46,7 @@ Signal 本身是非常直观的,视频功能非常适合其现有惯例。简 ### 开源视频聊天 -没有理由满足于由你可能不完全信任的公司托管的专有视频通话。今天可用的开源选项对于与你的职业和个人生活中的所有人保持联系是非常好的。下次你想和朋友见面时,不妨试试这些解决方案之一 +没有理由满足于由你可能不完全信任的公司托管的专有视频通话。今天可用的开源选项对于与你的职业和个人生活中的所有人保持联系是非常好的。下次你想和朋友见面时,不妨试试这些解决方案之一。 -------------------------------------------------------------------------------- @@ -53,7 +55,7 @@ via: https://opensource.com/article/21/9/alternatives-zoom 作者:[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 2418f9f4c58aa9a6089d71455cbace808f9844de Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Sep 2021 11:45:18 +0800 Subject: [PATCH 0550/1588] PUB @geekpi https://linux.cn/article-13836-1.html --- .../20210927 5 open source alternatives to Zoom.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210927 5 open source alternatives to Zoom.md (98%) diff --git a/translated/tech/20210927 5 open source alternatives to Zoom.md b/published/20210927 5 open source alternatives to Zoom.md similarity index 98% rename from translated/tech/20210927 5 open source alternatives to Zoom.md rename to published/20210927 5 open source alternatives to Zoom.md index bdea93af02..64e4bd65c2 100644 --- a/translated/tech/20210927 5 open source alternatives to Zoom.md +++ b/published/20210927 5 open source alternatives to Zoom.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13836-1.html" 5 个替代 Zoom 的开源软件 ====== From 7cc33dad14c9f061620965764967d9ece4655a19 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Sep 2021 11:51:48 +0800 Subject: [PATCH 0551/1588] APL --- sources/tech/20210929 Manage CentOS Stream with Foreman.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210929 Manage CentOS Stream with Foreman.md b/sources/tech/20210929 Manage CentOS Stream with Foreman.md index 72b6b3b007..e1c8b045eb 100644 --- a/sources/tech/20210929 Manage CentOS Stream with Foreman.md +++ b/sources/tech/20210929 Manage CentOS Stream with Foreman.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/centos-stream-foreman" [#]: author: "Melanie Corr https://opensource.com/users/melanie-corr" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 8021f2ff7dfe483e5ade848ba75edc1267bf3497 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Sep 2021 13:33:05 +0800 Subject: [PATCH 0552/1588] TSL&PRF --- ...10929 Manage CentOS Stream with Foreman.md | 171 ------------------ ...10929 Manage CentOS Stream with Foreman.md | 164 +++++++++++++++++ 2 files changed, 164 insertions(+), 171 deletions(-) delete mode 100644 sources/tech/20210929 Manage CentOS Stream with Foreman.md create mode 100644 translated/tech/20210929 Manage CentOS Stream with Foreman.md diff --git a/sources/tech/20210929 Manage CentOS Stream with Foreman.md b/sources/tech/20210929 Manage CentOS Stream with Foreman.md deleted file mode 100644 index e1c8b045eb..0000000000 --- a/sources/tech/20210929 Manage CentOS Stream with Foreman.md +++ /dev/null @@ -1,171 +0,0 @@ -[#]: subject: "Manage CentOS Stream with Foreman" -[#]: via: "https://opensource.com/article/21/9/centos-stream-foreman" -[#]: author: "Melanie Corr https://opensource.com/users/melanie-corr" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Manage CentOS Stream with Foreman -====== -This example provides a glimpse into the many options you have to manage -and provision CentOS Stream content in Foreman. -![Puzzle pieces coming together to form a computer screen][1] - -In December 2021, CentOS 8 will reach end of life and be replaced by CentOS Stream. One of the major changes between previous iterations of CentOS and CentOS Stream is the lack of minor versions. Centos Stream has adopted a continuous release cycle. From the beginning of this year, developers in the Foreman community started to see the benefits of earlier bug detection and patching that CentOS Stream offers as a result of the continuous releases. We no longer have to wait for the next release to take advantage of the latest changes and bugfixes. [A veteran Linux community enthusiast][2] noted that this move also brings RHEL developers closer than ever to the FOSS community. - -However, if you are an administrator of hundreds or thousands of servers, you might want to exercise control over when new packages are added to particular servers. If you are looking for a free open source tool that helps you ensure stability of production servers, while at the same time allowing you to safely pull in the latest changes from Centos Stream for development and testing, this is where Foreman can help. With Foreman, you can manage your Centos Stream content at all stages of the lifecycle environment. - -### What is Foreman? - -Foreman is a complete lifecycle management tool for physical and virtual servers. With Foreman, system administrators have the power to easily automate repetitive tasks, quickly deploy applications, and proactively manage servers on-premise or in the cloud. Foreman provides enterprise-level solutions for provisioning management, configuration management, and monitoring. Thanks to its plugin architecture, Foreman can be extended in a myriad of ways. Using the Katello plugin, you can use Foreman as a complete content management tool to manage CentOS Stream, among many other content types. - -With Foreman and Katello, you can define exactly which packages you want each environment to contain. For example, a Production environment might use packages that have been verified as stable, while a Developer environment might require the latest and greatest package versions available. You can also promote the content views across lifecycle environments. Let's take a look at how Foreman accomplishes this. - -We reference the web UI in this article, but Foreman also has a robust CLI and API. The Katello plugin provides a workflow and web UI for the Pulp project, which you can read about more in [this article][3]. We also supply a simple workflow here, but Foreman and the Katello project offer many different configuration options to suit your specific needs. - -This article assumes that Foreman and Katello are already installed. For more information about how to do that, see the [Katello installation manual][4]. - -### Create a Product - -The first step is to create a product in Foreman. The product functions as an internal label to store the CentOS Stream repositories. - - 1. In the Foreman web UI, navigate to **Content** >**Products**, and click **Create Product**. - 2. In the **Name** field, enter a name for the product. Foreman automatically completes the **Label** field based on what you have entered for **Name, **and this can't be changed later. - - - -### Add the CentOS Stream repositories to the Product - -Now that you have a product, you can use the URLs for the AppStream and BaseOS repositories and add them to your new product. - - 1. In the Foreman web UI, navigate to **Content** > **Products**, select the product you want to use, and then click **New Repository**. - 2. In the **Name** field, enter a name for the repository; for example, **Centos8StreamBaseOS**. Foreman automatically completes the **Label** field based on what you have entered for **Name**. - 3. From the **Type** list, select the type of repository, and then select **Yum**. - 4. In the **URL** field, enter the URL of the CentOS Stream Baseos repository to use as a source: - 5. Select the **Download Policy** list. The default is **On Demand** \- this means that Katello will only download metadata. If you want to download all the packages, change to **Immediate**, which downloads all the packages, which might run into 20-30 GB. - 6. Ensure that the **Mirror on Sync** check box is selected. This option ensures that content that is no longer part of the upstream repository is removed during synchronization. - 7. Click **Save**. - - - -Repeat these steps to add the AppStream repositories with URLs, for example, . Ensure that you use the closest official CentOS mirror instead. - -To perform an immediate synchronization, in your product window, click **Sync Now**. The initial synchronization can take some time. You can watch the synchronization status from **Content > Sync Status.** - -After the synchronization completes, you can view the new CentOS Stream operating system in **Hosts > Operating System**. Feel free to edit the name and description to suit your requirements. - -If you plan to use configuration management software like Ansible or Puppet, Foreman automatically creates an operating system report. You can turn this option off in **Administe > Settings > Ignore facts for operating system**. It is a good idea to rename the operating system to match the name in the configuration management software. For example, for Puppet, this would be _CentOS 8_. - -### Define your infrastructure's Lifecycle Environment - -The application life cycle is a concept central to Foreman's content management functions. The application life cycle defines how a particular system and its software look at a specific stage. For example, an application life cycle might be simple; you might only have a _development_ stage and _production_ stage. Foreman provides methods to customize each application life cycle stage in a controlled manner to suit your specifications. - -At this point, you must create your lifecycle environment paths: - - 1. In the Foreman web UI, navigate to **Content** >**Lifecycle Environments**. - 2. Click **New Environment Path** to start a new application life cycle. - 3. In the **Name** field, enter a name for your environment. - 4. In the **Description** field, enter a description for your environment. - 5. Click **Save**. - 6. Add as many environment paths as you need. For example, you can create _dev_, _test,_ _stage,_ and _production_ environments. To add these environments, click **Add New Environment**, complete the **Name** and **Description** fields, and select the prior environment from the **Prior Environment** list so that you chain them together in the sequence you expect to use. - - - -### Create and publish a Content View - -In Foreman, a Content View is a snapshot of your repositories at a particular point in time. Content Views provide the mechanism for isolating package versions in a state that you want to preserve. Content Views have a lot of configurable features that you can use for further refinement. For the purposes of this tutorial, let's keep things simple. - - 1. In the Foreman web UI, navigate to **Content** > **Content Views** and click **Create New View**. - 2. In the **Name** field, enter a name for the view. Foreman automatically completes the **Label** field from the name you enter. - 3. In the **Description** field, enter a description of the view. - 4. Click **Save** to create the Content View. - 5. In your new Content View, click **Yum Content > Add Repositories** in the **Repository Selection** area, click **Add.** For both the BaseOS and Appstream repositories, select packages you want to include, then click **Add Repositories**. - 6. Click **Publish New Version** and in the **Description** field, enter information about the version to log changes. - 7. Click **Save**. - - - -When you click **Publish New Version**, you create a snapshot of all the content that you have synchronized. This means that every server you subscribe to this Content View will have access only to the package versions in the Content View associated with this lifecycle environment. - -Every new Content View and subsequent versions are published first to the Library environment, where you can then promote to additional environments. - -### Promote content across lifecycle environments - -If you have tested new packages and are satisfied that everything is stable, you can promote your Content View to another lifecycle environment. - - 1. Navigate to **Content** > **Content Views** and select the Content View that you want to promote. - 2. Click the **Versions** tab for the Content View. - 3. Select the version you want to promote, and in the **Actions** column, click **Promote**. - 4. Select the environment where you want to promote the Content View and click **Promote Version**. - 5. Click the **Promote** button again. This time select the lifecycle environment, for example, **Test**, and click **Promote Version**. - 6. Finally, click on the **Promote** button again. For example, select the **Production** environment and click **Promote Version**. - - - -The servers that are assigned to that particular environment can now pull from an updated set of packages. - -### Create an Activation Key - -To register a CentOS Stream server to the content you have defined in a particular lifecycle, you must create an activation key. The activation key is a secure method of sharing credentials with a server. This uses a tool called **subscription-manager** to subscribe the CentOS Stream server to the content. - -When you have created the activation key, add the CentOS Stream subscription to the activation key. - - 1. In the Foreman web UI, navigate to **Content > Activation keys** and click **Create Activation Key**. - 2. In the **Name** field, enter the name of the activation key. - 3. In the **Description** field, enter a description for the activation key. - 4. From the **Environment** list, select the environment to use. - 5. From the **Content View** list, select the Content View you created just now. - 6. Click **Save**. - - - -### Create a CentOS Stream Host from Foreman managed content - -Everything is now set up. With the content you have created contained in a content view, and promoted across lifecycles, you can now provision hosts with exactly the content you want to use and subscribe to the updates you want them to receive. - -To create a host in Foreman, navigate to **Hosts > Create Host**. - - 1. In the **Name** field, enter a name for the host. - 2. Click the **Organization** and **Location** tabs to ensure that the provisioning context is automatically set to the current context. - 3. From the **Deploy On** list, select **Bare Metal**. - 4. Click the **Operating System** tab. - 5. From the **Architectures** list, select **x86_64**. - 6. From the **Operating System** list, select **CentOS_Stream 8.** - 7. Check the **Build Mode** box. - 8. For **Media Selection**, select **Synced Content** to use the CentOS Stream content you synced previously. - 9. From the **Synced** **Content** list, ensure that CentOS Stream is selected. - 10. From the **Partition Table** list, for this demo, select **Kickstart** default, but there are many available options. - 11. In the **Root Password** field, enter a root password for your new host. - 12. Click the **Interface** tab, and click **Edit,** and add a **Mac address.** - 13. Click the **Parameters** tab, and ensure that a parameter exists that provides an activation key. If not, add an activation key. - 14. Click **Submit** to save the host entry. - - - -Now the new host is in build mode, which means when you turn it on, it will begin installing the operating system. - -If you navigate to **Hosts > Content Hosts,** you can see the full details of the subscriptions, lifecycle environment, and content view that your host is subscribed to. - -This example is only a small glimpse into the many options you have to manage and provision CentOS Stream content in Foreman. If you want more detailed information about how you can manage CentOS Stream versions, control the content that your servers have access to, and control and protect the stability of your infrastructure, check out the [Foreman Content Management][5] documentation. With all CentOS Stream content under your control, you can create and register Centos Streams that consume only the content that you specify. For more detailed information on provisioning, see the [Foreman Provisioning][6] documentation. If you have any questions, feedback, or suggestions, you can find the Foreman community at - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/centos-stream-foreman - -作者:[Melanie Corr][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/melanie-corr -[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://twitter.com/Det_Conan_Kudo/status/1337366036023218177?s=20 -[3]: https://opensource.com/article/20/8/manage-repositories-pulp -[4]: https://docs.theforeman.org/3.0/Installing_Server_on_Red_Hat/index-katello.html -[5]: https://docs.theforeman.org/master/Content_Management_Guide/index-foreman.html -[6]: https://docs.theforeman.org/master/Provisioning_Guide/index-foreman.html diff --git a/translated/tech/20210929 Manage CentOS Stream with Foreman.md b/translated/tech/20210929 Manage CentOS Stream with Foreman.md new file mode 100644 index 0000000000..4b4e3f0e0a --- /dev/null +++ b/translated/tech/20210929 Manage CentOS Stream with Foreman.md @@ -0,0 +1,164 @@ +[#]: subject: "Manage CentOS Stream with Foreman" +[#]: via: "https://opensource.com/article/21/9/centos-stream-foreman" +[#]: author: "Melanie Corr https://opensource.com/users/melanie-corr" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +用 Foreman 管理 CentOS Stream +====== + +> 这个例子让我们看到了在 Foreman 中管理和配置 CentOS Stream 内容的许多选项。 + +![拼图拼成的电脑屏幕][1] + +2021 年 12 月,CentOS 8 将达到生命终点,被 CentOS Stream 取代。CentOS Stream 和 CentOS 之前的迭代之间的主要变化之一是没有小版本。Centos Stream 采用了一个连续的发布周期。从今年年初开始,Foreman 社区的开发者开始看到 CentOS Stream 由于持续发布而提供的更早的错误检测和补丁的好处。我们不再需要等待下一个版本来利用最新的变化和错误修复。[一位资深的 Linux 社区爱好者][2] 指出,此举也使 RHEL 开发者比以往更接近 FOSS 社区。 + +然而,如果你是一个拥有数百或数千台服务器的管理员,你可能想控制新的软件包何时被添加到特定的服务器。如果你正在寻找一个免费的开源工具,帮助你确保生产服务器的稳定性,同时允许你安全地从 Centos Stream 中拉入最新的变化用于开发和测试,这就是 Foreman 可以帮助你的地方。有了 Foreman,你可以在生命周期环境的各个阶段管理你的 Centos Stream 内容。 + +### Foreman 介绍 + +Foreman 是一个完整的物理和虚拟服务器的生命周期管理工具。有了 Foreman,系统管理员有能力轻松实现重复性任务的自动化,快速部署应用程序,并主动管理内部或云中的服务器。Foreman 为配备provisioning管理、配置管理和监控提供了企业级解决方案。由于其插件架构,Foreman 可以以无数种方式进行扩展。使用 Katello 插件,你可以把 Foreman 作为一个完整的内容管理content management工具来管理 CentOS Stream,以及其他许多内容类型。 + +通过 Foreman 和 Katello,你可以准确地定义你希望每个环境包含哪些软件包。例如,生产环境可能使用已被验证为稳定的软件包,而开发环境可能需要最新、最先进的软件包版本。你还可以跨生命周期环境推广内容视图content view。让我们来看看 Foreman 是如何完成这个任务的。 + +我们在这篇文章中使用了网页用户界面,但 Foreman 也有一个强大的 CLI 和 API。Katello 插件为 Pulp 项目提供了一个工作流和网页用户界面,你可以在 [这篇文章][3] 中了解更多。我们在这里也提供了一个简单的工作流程,但是 Foreman 和 Katello 项目提供了许多不同的配置选项来满足你的具体需求。 + +本文假设 Foreman 和 Katello 已经安装完毕。关于如何安装的更多信息,请参阅 [Katello 安装手册][4]。 + +### 创建一个产品 + +第一步是在 Foreman 中创建一个产品product。该产品的功能是作为一个内部标签来存储 CentOS Stream 存储库。 + + 1. 在 Foreman 网页用户界面,导航到“内容Content > 产品Products”,并点击“创建产品Create Product”。 + 2. 在“名称Name”字段中,为产品输入一个名称。Foreman会根据你输入的“名称Name”自动完成“标签Label”字段,以后不能再更改。 + +### 将 CentOS Stream 存储库添加到产品中 + +现在你有了一个产品,你可以使用 AppStream 和 BaseOS 存储库的 URL,并将它们添加到你的新产品中。 + + 1. 在 Foreman 网页用户界面中,导航到 “内容Content > 产品Products”,选择你要使用的产品,然后点击 “新存储库New Repository”。 + 2. 在“名称Name”字段中,为存储库输入一个名称;例如,“Centos8StreamBaseOS”。Foreman 会根据你输入的“名称Name”,自动完成“标签Label”字段。 + 3. 从“类型Type”列表中,选择存储库的类型,然后选择“Yum”。 + 4. 在 “URL” 字段中,输入 CentOS Stream Baseos 存储库的 URL,作为源: `http://mirror.centos.org/centos/8-stream/BaseOS/x86_64/os/`。 + 5. 选择“下载规则Download Policy”列表。默认的是“按需On Demand”,这意味着 Katello 将只下载元数据。如果你想下载所有的软件包,请改成“即时Immediate”,它可以下载所有的软件包,可能会达到 20-30GB。 + 6. 确保“与镜像同步Mirror on Sync”复选框被选中。这个选项确保在同步过程中,不再是上游存储库的一部分的内容被删除。 + 7. 点击“保存Save”。 + + + +重复这些步骤,添加 AppStream 存储库及其 URL,例如,`http://mirror.centos.org/centos/8-stream/AppStream/x86_64/os/`。确保你使用最近的官方 CentOS 镜像来代替它。 + +要执行立即同步,在你的产品窗口,点击“立即同步Sync Now”。最初的同步可能需要一些时间。你可以从“内容Content > 同步状态Sync Status”查看同步状态。 + +同步完成后,你可以在“主机 Hosts > 操作系统Operating System”中查看新的 CentOS Stream 操作系统。请随意编辑名称和描述以满足你的要求。 + +如果你打算使用 Ansible 或 Puppet 等配置管理软件,Foreman 会自动创建一个操作系统报告。你可以在“管理Administe > 设置Settings > 忽略操作系统状况Ignore facts for operating system”中关闭这个选项。重命名操作系统以匹配配置管理软件中的名称是一个好主意。例如,对于 Puppet,这将是“CentOS 8”。 + +### 定义你的基础设施的生命周期环境 + +应用程序生命周期是 Foreman 的内容管理功能的一个核心概念。应用程序的生命周期定义了一个特定的系统和它的软件在特定阶段的状况。例如,一个应用程序的生命周期可能很简单,你可能只有一个“开发”阶段和“生产”阶段。Foreman 提供了一些方法来以可控的方式定制每个应用生命周期阶段,以适应你的规范。 + +在这一点上,你必须创建你的生命周期环境路径。 + + 1. 在 Foreman 网页用户界面中,导航到“内容Content > 生命周期环境Lifecycle Environments”。 + 2. 点击“新环境路径New Environment Path”,开始一个新的应用生命周期。 + 3. 在“名称Name”字段中,为你的环境输入一个名称。 + 4. 在“描述Description”字段中,为你的环境输入一个描述。 + 5. 点击“保存Save”。 + 6. 根据你的需要添加尽可能多的环境路径。例如,你可以创建“dev”、“test”、“stage” 和 “production” 环境。要添加这些环境,点击“添加新环境”,完成“名称Name”和“描述Description”字段,并从“优先环境Prior Environment*”列表中选择先前的环境,这样你就可以按照你预期使用的顺序将它们串联起来。 + + + +### 创建和发布一个内容视图 + +在 Foreman 中,“内容视图Content View”是你的存储库在某个特定时间点的快照。内容视图提供了隔离软件包版本到你想保留的状态的机制。内容视图有很多可配置的功能,你可以用它来进一步细化。为了本教程的目的,让我们保持简单。 + + 1. 在 Foreman 网页用户界面中,导航到“内容Content > 内容视图Content View”,并点击“创建新视图Create New View”。 + 2. 在“名称Name”字段中,为视图输入一个名称。Foreman 会根据你输入的名称自动完成“标签Label”字段。 + 3. 在“描述Description”字段中,输入视图的描述。 + 4. 单击“保存Save”以创建内容视图。 + 5. 在新的内容视图中,点击“Yum 内容Yum Contents > 添加存储库Add Repositories”,在“存储库选择Repository Selection”区域,点击“添加Add”。对于 BaseOS 和 Appstream 存储库,选择你想包括的软件包,然后点击“添加存储库Add Repositories”。 + 6. 点击“发布新版本Publish New Version”,在“描述Description”区域,输入关于版本的信息以记录变化。 + 7. 单击“保存Save”。 + +当你点击“发布新版本Publish New Version”时,你创建了一个你已同步的所有内容的快照。这意味着你订阅此内容视图的每台服务器将只能访问与此生命周期环境相关的内容视图中的软件包版本。 + +每一个新的内容视图和后续版本都会首先发布到库环境,然后你可以在那里推广到其他环境。 + +### 跨生命周期环境推广内容 + +如果你已经测试了新的软件包,并且确信一切都很稳定,你可以把你的内容视图推广到另一个生命周期环境中。 + + 1. 导航到“内容Content > 内容视图Content Views”,选择你想推广的内容视图。 + 2. 点击内容视图的“版本Versions”标签。 + 3. 选择你想推广的版本,并在“操作Action”栏中,点击“推广Promote”。 + 4. 选择你要推广内容视图的环境,并点击“推广版本Promote Version”。 + 5. 再次点击“推广Promote”按钮。这次选择生命周期环境,例如,“Test”,然后单击“推广版本Promote Version”。 + 6. 最后,再次点击“推广Promote”按钮。例如,选择“Production”环境并点击“推广版本Promote Version”。 + +被分配到该特定环境的服务器现在可以从一套更新的软件包中提取。 + +### 创建一个激活密钥 + +为了将 CentOS Stream 服务器注册到你在特定生命周期中定义的内容,你必须创建一个激活密钥。激活密钥是一种与服务器共享凭证的安全方法。这使用了一个叫做“订阅管理器subscription-manager的工具来订阅 CentOS Stream 服务器的内容。 + +当你创建了激活密钥后,将 CentOS Stream 订阅添加到激活密钥中。 + + 1. 在 Foreman 网页用户界面中,导航到“内容Content > 激活密钥Activation keys”,并点击“创建激活密钥Create Activation Key”。 + 2. 在“名称Name”栏中,输入激活密钥的名称。 + 3. 在“描述Description”栏中,输入激活密钥的描述。 + 4. 从“环境Environment”列表中,选择要使用的环境。 + 5. 从“内容视图Content View”列表中,选择你刚才创建的内容视图。 + 6. 点击“保存Save”。 + +###从 Foreman 管理的内容中创建一个 CentOS Stream 主机 + +现在一切都准备好了。随着你创建的内容包含在内容视图中,并在整个生命周期中推广,你现在可以准确地用你想使用的内容来配置主机,并订阅你想让它们接收的更新。 + +要在 Foreman 中创建一个主机,请导航到“主机 > 创建主机”。 + + 1. 在“名称Name”字段中,为主机输入一个名称。 + 2. 单击“组织Organization”和“位置Location”选项卡,以确保配置环境自动设置为当前环境。 + 3. 从“部署在Deploy On”列表中,选择“裸金属Bare Metal”。 + 4. 单击“操作系统Operating System”选项卡。 + 5. 从“架构Architectures”列表中,选择“x86_64”。 + 6. 从“操作系统Operating System”列表中,选择“CentOS_Stream 8”。 + 7. 勾选“构建模式Build Mode”框。 + 8. 对于“媒体选择Media Selection”,选择“同步的内容Synced Content”来使用你之前同步的 CentOS Stream 内容。 + 9. 从“同步的内容Synced Content”列表中,确保选择 “CentOS Stream”。 + 10. 从“分区表Partition Table”列表中,对于这个演示,选择默认的 “Kickstart”,但有许多可用的选项。 + 11. 在“Root 密码Root Password”栏中,为你的新主机输入一个 root 密码。 + 12. 点击“接口Interface”标签,并点击“编辑Edit”,并添加一个 “Mac 地址Mac address”。 + 13. 点击“参数Parameters”标签,并确保存在一个提供激活密钥的参数。如果没有,添加一个激活密钥。 + 14. 点击“提交Submit”以保存主机条目。 + + + +现在,新的主机处于构建模式,这意味着当你打开它时,它将开始安装操作系统。 + +如果你导航到“主机Hosts > 内容主机Content Hosts”,你可以看到你的主机所订阅的订阅、生命周期环境和内容视图的全部细节。 + +这个例子只是对你在 Foreman 中管理和配置 CentOS Stream 内容的众多选项的一个小窥视。如果你想了解更多关于如何管理 CentOS Stream 版本,控制你的服务器可以访问的内容,以及控制和保护你的基础设施的稳定性的详细信息,请查看 [Foreman 内容管理][5] 文档。当所有 CentOS Stream 内容在你的控制之下时,你可以创建和注册 Centos Stream,只使用你指定的内容。有关配备的更多详细信息,请参见 [Foreman 配备][6] 文档。如果你有任何问题、反馈或建议,你可以在 找到 Foreman 社区。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/centos-stream-foreman + +作者:[Melanie Corr][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/melanie-corr +[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://twitter.com/Det_Conan_Kudo/status/1337366036023218177?s=20 +[3]: https://opensource.com/article/20/8/manage-repositories-pulp +[4]: https://docs.theforeman.org/3.0/Installing_Server_on_Red_Hat/index-katello.html +[5]: https://docs.theforeman.org/master/Content_Management_Guide/index-foreman.html +[6]: https://docs.theforeman.org/master/Provisioning_Guide/index-foreman.html From e33c04592d6645a57be691eb7e4584f1184a2c72 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 30 Sep 2021 13:42:56 +0800 Subject: [PATCH 0553/1588] PUB @wxy https://linux.cn/article-13837-1.html --- .../20210929 Manage CentOS Stream with Foreman.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210929 Manage CentOS Stream with Foreman.md (99%) diff --git a/translated/tech/20210929 Manage CentOS Stream with Foreman.md b/published/20210929 Manage CentOS Stream with Foreman.md similarity index 99% rename from translated/tech/20210929 Manage CentOS Stream with Foreman.md rename to published/20210929 Manage CentOS Stream with Foreman.md index 4b4e3f0e0a..52d66d056a 100644 --- a/translated/tech/20210929 Manage CentOS Stream with Foreman.md +++ b/published/20210929 Manage CentOS Stream with Foreman.md @@ -4,15 +4,15 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13837-1.html" 用 Foreman 管理 CentOS Stream ====== > 这个例子让我们看到了在 Foreman 中管理和配置 CentOS Stream 内容的许多选项。 -![拼图拼成的电脑屏幕][1] +![](https://img.linux.net.cn/data/attachment/album/202109/30/133541s3e3s31yzmnugl1s.jpg) 2021 年 12 月,CentOS 8 将达到生命终点,被 CentOS Stream 取代。CentOS Stream 和 CentOS 之前的迭代之间的主要变化之一是没有小版本。Centos Stream 采用了一个连续的发布周期。从今年年初开始,Foreman 社区的开发者开始看到 CentOS Stream 由于持续发布而提供的更早的错误检测和补丁的好处。我们不再需要等待下一个版本来利用最新的变化和错误修复。[一位资深的 Linux 社区爱好者][2] 指出,此举也使 RHEL 开发者比以往更接近 FOSS 社区。 From 093fd2ec4d92c252fcb54f9f7b60cc6a443a9b02 Mon Sep 17 00:00:00 2001 From: ShirlyYang Date: Thu, 30 Sep 2021 15:36:52 +0800 Subject: [PATCH 0554/1588] Update 20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 已认领 --- ... Subsystem for Linux to open Linux on Windows 10 machines.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md b/sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md index e610f7eb2f..9daaab2ddd 100644 --- a/sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md +++ b/sources/tech/20200519 How to use Windows Subsystem for Linux to open Linux on Windows 10 machines.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (Pinkerr) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c983a3682d46c84b8e1f3f7085c795b047d0c1bc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 Oct 2021 05:02:33 +0800 Subject: [PATCH 0555/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211001?= =?UTF-8?q?=20The=20Official=20Raspberry=20Pi=204=20Case=20Sucks!=20Here?= =?UTF-8?q?=E2=80=99s=20What=20You=20Can=20do=20to=20Reduce=20the=20Overhe?= =?UTF-8?q?ating?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md --- ...at You Can do to Reduce the Overheating.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md diff --git a/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md b/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md new file mode 100644 index 0000000000..bc8c45ad85 --- /dev/null +++ b/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md @@ -0,0 +1,140 @@ +[#]: subject: "The Official Raspberry Pi 4 Case Sucks! Here’s What You Can do to Reduce the Overheating" +[#]: via: "https://itsfoss.com/raspberry-pi-case-overheating/" +[#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +The Official Raspberry Pi 4 Case Sucks! Here’s What You Can do to Reduce the Overheating +====== + +The [Raspberry Pi 4][1] is an absolute favorite among millions of people, especially in the nerd community, and I’m no exception. But did you know that the Pi throttles without proper cooling? + +Here, I’m going to describe some serious drawbacks in the [Official Raspberry Pi 4 Case][2] and also share some ways to mitigate them. + +![Raspberry Pi 4 official case][3] + +After the first boot, my Raspberry Pi 4 (8 GB RAM version) mounted inside the [Official Raspberry Pi 4 case][2], would shoot to 80 °C when the unattended upgrades kicked in. I was on Ubuntu with all [firmware updates][4] that are apparently supposed to [fix heating issues][5]. + +On idle, this hot vanilla and strawberry cake would never go less than 75°C. + +I could hardly use it until I removed the top white cover of the case. The temperature dropped to only around 67 °C on idle — Can you believe that? Even after I double-checked after a while with a reboot. This, obviously, still isn’t also quite acceptable. If I got the case and plan to use it for long-term purpose, why would I want to keep the case lid open all the time? + +And why is something like this happening? It’s all because of a very poor design of the official Raspberry Pi case. + +### The Official Raspberry Pi 4 Case is a Heat Monster! + +[Thermal throttling][6] in simple terms, is a reduction in the performance of your Pi processor (CPU) so that the temperature does not exceed extremely high temperatures (such as 80 °C) and [cause damage][7]. + +The case is built out of plastic — a poor conductor of heat (simple [old school physics][8]), and hence is unable to dissipate it effectively throughout the case and out of the Pi board. Therefore, the processor on the Pi board heats up and gets throttled down to an extremely inferior level of performance, once it literally reaches a temperature of an alarming degree. I noticed a 100% CPU usage during _**unattended upgrades**_ right after first boot with the CPU’s temperature at 80 °C. + +Beautiful though it may look, the official case delivers a big blow to the Pi’s performance. + +If you really want to get the most out of your Pi’s performance, you must take care of its cooling too. These heating issues cannot simply be ignored: + +#### Heat gets trapped + +Once you set up the Pi inside this case there is not even a single vent for that excess heat to escape. So it keeps getting accumulated inside until it reaches those crazy temps and triggers the throttle. + +#### No fan outlet (badly needed) + +The top white cover could have had a circular vent on top of the case for at least the [Official Raspberry Pi 4 Fan][9]. + +#### No passive cooling + +If the case had been of metal, it could have doubled up as heat-sink and dissipate the heat efficiently out of the processor residing on the Pi board. + +#### Other drawbacks apart from heating issues + +The official Pi 4 case has a few more drawbacks: + + 1. Inconvenient SD Card Management: It is not very convenient to assemble the Pi board inside the case and get the SD card port in the correct orientation to be able to switch cards later on. + 2. No Screwing System: No screws are provided, maybe because it could break the dummy holders on the base of the case that almost look like you could use four screws to fix the board securely onto the base. + + + +### What can you do to control the overheating in Raspberry Pi 4? + +After doing some intense research, I found some of the best cooling solutions available in the market – all thanks to our amazing modding community! + +#### Use an ice tower cooler + +I first found [an in-depth performance review of various Pi coolers at Jeff Geerling’s][10], who is known online as **[geerlingguy][11]**. I straightaway went for the ICE tower cooler after going through the temperature stats and assembled it: + +![Raspberry Pi 4 ice tower cooler][12] + +Preview | Product | Price | +---|---|---|--- +![GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi Heatsink for Raspberry Pi 4 Model B & Raspberry Pi 3B+ & Raspberry Pi 3 Model B][13] ![GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi Heatsink for Raspberry Pi 4 Model B & Raspberry Pi 3B+ & Raspberry Pi 3 Model B][13] | [GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi...][14] | $19.99[][15] | [Buy on Amazon][16] + +Temperatures dropped to 30 °C on idle and under load, it now stays at around 45 °C. I’m yet to mod a proper case for it. There are ready to purchase cases with enough space for the cooler. You may find such cases on Amazon or other online stores. + +No products found. + +#### Use an aluminum heat sink for passive cooling + +There is also a remarkable video online on [passive cooling][17], reviewing an aluminum heat-sink-as-a-case. + +A thermal pad is provided, which is equivalent to the thermal paste used on Desktop processors. On placing it in the manner shown in the video, the heat is dissipated out of the processor on the Pi board throughout the whole case. A wonderful magic of science! + +Preview | Product | Price | +---|---|---|--- +![Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive Cooling Case Compatible with Raspberry Pi 4 Model B Only][18] ![Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive Cooling Case Compatible with Raspberry Pi 4 Model B Only][18] | [Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive...][19] | $12.99[][15] | [Buy on Amazon][20] + +#### Modding the official Pi case + +If you still want to get the official case, it is advisable to at-least go for a fan mod: + +### Potential Manufacturing Solutions + +Here are some solutions that can make the whole process of manufacturing easier, by applying [DevOps][21] inspired improvements: + + * Think about it, that circular piece of plastic cut out from the top of the cover could be recycled to manufacture so many more Pi 4 cases in production. Isn’t it? It would clearly be a win-win scenario and also lowers costs as well! + + + * Aluminium is the most abundant metal on earth, but [global supply disruptions][22] can be challenging. Even then, there are other [conductivity solutions][23] to explore materials used for the designing the case. + + + +**Personal Notes** + +Hope this write-up helps you in getting the most out of your Raspberry Pi 4. It’s been a quite a while since I used to write here on _**It’s FOSS**_. Feels good to be back. I’d love to know your thoughts, suggestions, and experiences down in the comments below. Please do not hesitate to share. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-case-overheating/ + +作者:[Avimanyu Bandyopadhyay][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/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/raspberry-pi-4/ +[2]: https://www.raspberrypi.org/products/raspberry-pi-4-case/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-4-official-case.webp?resize=800%2C533&ssl=1 +[4]: https://www.einfochips.com/blog/understanding-firmware-updates-the-whats-whys-and-hows/ +[5]: https://www.seeedstudio.com/blog/2019/11/29/raspberry-pi-4-firmware-update-pi-4-now-runs-cooler-than-ever/ +[6]: https://www.pcmag.com/encyclopedia/term/thermal-throttling +[7]: https://www.pcgamer.com/cpu-temperature-overheat/ +[8]: https://thermtest.com/stay-colder-for-longer-in-a-container-made-of-plastic-or-metal +[9]: https://www.raspberrypi.org/products/raspberry-pi-4-case-fan/ +[10]: https://www.jeffgeerling.com/blog/2019/best-way-keep-your-cool-running-raspberry-pi-4 +[11]: https://www.jeffgeerling.com/about +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-4-ice-tower-cooler.webp?resize=480%2C360&ssl=1 +[13]: https://i0.wp.com/m.media-amazon.com/images/I/51g9gQC9k7L._SL160_.jpg?ssl=1 +[14]: https://www.amazon.com/dp/B07V35SXMC?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi Heatsink for Raspberry Pi 4 Model B & Raspberry Pi 3B+ & Raspberry Pi 3 Model B) +[15]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[16]: https://www.amazon.com/dp/B07V35SXMC?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) +[17]: https://buildabroad.org/2016/11/05/passive-cooling/ +[18]: https://i2.wp.com/m.media-amazon.com/images/I/41XGLQONCVS._SL160_.jpg?ssl=1 +[19]: https://www.amazon.com/dp/B07VD568FB?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive Cooling Case Compatible with Raspberry Pi 4 Model B Only) +[20]: https://www.amazon.com/dp/B07VD568FB?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Buy on Amazon) +[21]: https://linuxhandbook.com/what-is-devops/ +[22]: https://www.reuters.com/article/global-metals-idUSL1N2Q90GA +[23]: https://news.mit.edu/2018/engineers-turn-plastic-insulator-heat-conductor-0330 From 796b80a5164f5eba9b35d16f9d8aeae26672b362 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 Oct 2021 05:02:53 +0800 Subject: [PATCH 0556/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211001?= =?UTF-8?q?=20How=20to=20Install=20Google=20Chrome=20on=20Debian=20and=20K?= =?UTF-8?q?ali=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md --- ... Google Chrome on Debian and Kali Linux.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md diff --git a/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md b/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md new file mode 100644 index 0000000000..253966335e --- /dev/null +++ b/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md @@ -0,0 +1,160 @@ +[#]: subject: "How to Install Google Chrome on Debian and Kali Linux" +[#]: via: "https://itsfoss.com/install-chrome-debian-kali-linux/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Google Chrome on Debian and Kali Linux +====== + +Debian and Debian-based Kali Linux come with Firefox as the default web browser. But this does not mean that you cannot install other web browsers in it. + +Google Chrome is hugely popular and you probably already use it on other systems. If you want to install Chrome on Debian, you can surely do so. + +You won’t find Google Chrome in the repositories of Debian because it is not open source software but you can download and install it from Chrome website. + +In this tutorial, I’ll show you two methods of installing Chrome on Debian: + + * GUI method + * Command line method + + + +Let’s start with the GUI method first. + +_**Note: I am using Debian in the examples here but since Kali Linux is based on Debian, the same methods are also applicable to Kali Linux.**_ + +### Method 1: Installing Chrome on Debian Graphically + +This is a no-brainer. You go to the Google Chrome website, download the deb file and double lick on it to install it. I am going to show the steps in detail so that it is easy for you to follow it. + +Go to Google Chrome’s website. + +[Get Google Chrome][1] + +You’ll see the option to download Google Chrome. + +![Click on the Download Chrome button][2] + +When you click on the download button, it gives you two options for downloading the installer file. Go with the one that says Debian/Ubuntu. + +![Download the Chrome installer file for Debian][3] + +**Please note that Google Chrome is NOT available for 32-bit systems.** + +In the next screen, you should opt for saving the file to the computer instead of opening it in software center for installation. This way, the downloaded file will be saved in the Downloads folder instead of the temp directory. + +![Save the downloaded DEB file for Google Chrome][4] + +Go to the Download folders and right click on the downloaded deb file and choose to open it with Software Install. + +![Right click on the downloaded DEB file and open with Software Install][5] + +It will then open the software center and you should see the option to install Chrome now. Click on the install button. + +![Click on the install button][6] + +You’ll be asked to enter your account’s password. This is the same password you use to log into your system. + +![Enter your account’s password][7] + +In less than a minute, Google Chrome will be installed. You should see a remove option now which indicates that the software is installed. + +![Chrome is now installed][8] + +Once Chrome is installed on Debian, search for it in the system menu and start it. + +![Start Google Chrome][9] + +It will ask to be your default browser and send the crash reports to Google. You can uncheck either or both options. And then you can see Google Chrome browser window. + +![][10] + +If you log into your Google account, you should be able to sync your passwords, bookmarks and other browsing data here. Enjoy it! + +Another thing, after installing Chrome, you can delete the downloaded DEB file from your system. It is not needed anymore, not even for uninstalling Chrome. + +### Method 2: Install Google Chrome on Debian from the terminal + +What you just saw above can be easily achieved in the terminal. + +First, make sure that your package cache is refreshed and you have wget installed for [downloading files from the web in the terminal][11]. + +``` +sudo apt update && sudo apt install wget +``` + +The next option is to download the .deb file of Google Chrome: + +``` +wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +``` + +Once downloaded, you can [install the deb file in the terminal][12] with apt command like this: + +``` +sudo apt install ./google-chrome-stable_current_amd64.deb +``` + +Once the installation completes, you can start using Chrome. + +### Bonus tip: Updating Google Chrome + +Both methods add Google’s repository to your system. You can see it in your sources.lis.d directory: + +``` +cat /etc/apt/sources.list.d/google-chrome.list +``` + +This means that Google Chrome will be updated with other system updates in Debian and Kali Linux. You know [how to update your Kali Linux][13] or Debian system in command line? Just use this command: + +``` +sudo apt update && sudo apt upgrade -y +``` + +### Uninstall Google Chrome from your system + +Even if you chose to install Chrome on Debian using the GUI method, you’ll have to use the terminal to remove it. + +Don’t worry. It’s really just one command: + +``` +sudo apt purge google-chrome-stable +``` + +Enter your account password when asked. Nothing is displayed on the screen when you type the password. That’s okay. Type it and press enter and confirm the deletion. + +![][14] + +Well, that’s about it. I hope you find this tutorial helpful. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-chrome-debian-kali-linux/ + +作者:[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://www.google.com/chrome/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/download-chrome-on-debian.webp?resize=800%2C344&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/downloading-google-chrome.webp?resize=800%2C512&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/save-downloaded-chrome-installer-file-debian.webp?resize=800%2C430&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/open-deb-file-with-software-install.webp?resize=800%2C419&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-chrome-debian.webp?resize=800%2C408&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/enter-account-password-while-installing-deb-file.webp?resize=800%2C420&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/chrome-installed-debian.webp?resize=800%2C384&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-chrome-debian.webp?resize=800%2C276&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Chrom-in-Debian.webp?resize=800%2C450&ssl=1 +[11]: https://itsfoss.com/download-files-from-linux-terminal/ +[12]: https://itsfoss.com/install-deb-files-ubuntu/ +[13]: https://linuxhandbook.com/update-kali-linux/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp?resize=800%2C450&ssl=1 From 94fca4192280cbbd1a8a162620b9c5e1547c1825 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 Oct 2021 05:03:16 +0800 Subject: [PATCH 0557/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210930?= =?UTF-8?q?=20Make=20YAML=20as=20easy=20as=20it=20looks?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210930 Make YAML as easy as it looks.md --- .../20210930 Make YAML as easy as it looks.md | 160 ++++++++++++++++++ 1 file changed, 160 insertions(+) create mode 100644 sources/tech/20210930 Make YAML as easy as it looks.md diff --git a/sources/tech/20210930 Make YAML as easy as it looks.md b/sources/tech/20210930 Make YAML as easy as it looks.md new file mode 100644 index 0000000000..511963cc0f --- /dev/null +++ b/sources/tech/20210930 Make YAML as easy as it looks.md @@ -0,0 +1,160 @@ +[#]: subject: "Make YAML as easy as it looks" +[#]: via: "https://opensource.com/article/21/9/yaml-cheat-sheet" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Make YAML as easy as it looks +====== +YAML looks simple so why is it so hard to write? Learn the two secrets +to YAML success. +![Person using a laptop][1] + +If you've ever tried writing YAML, you may have been initially pleased with how apparently easy it looks. At first glance, the YAML that's often used for configuration files, Ansible playbooks, and flat-file databases looks more or less as intuitive as a shopping list. However, there's a lot of nuance in YAML's structure, and it conceals a dangerous secret: YAML is actually a highly precise, structured, and surprisingly strict language. The good news is that you only need to understand two things to know how YAML works. + +The truth about YAML is that there are only two data structures in YAML: sequences and mappings. Those are two fancy names to represent what you'll discover are very familiar concepts. This article explains them both, and more importantly, how they work together to make YAML a powerful way to represent the data you care about. + +### What's a YAML sequence? + +A YAML sequence is a list. In its simplest form, there's one item per line, with each line beginning in a dash and a space. + +Here's an example: + + +``` +\--- +\- Linux +\- BSD +\- Illumos +``` + +Different languages have different ways of representing this kind of data. In Python, for example, the same list can be written as `['Linux', 'BSD', 'Illumos']`. When you write a list in real life, for instance before you go shopping for groceries, you probably approximate a YAML sequence. + +### What's a YAML mapping? + +A YAML mapping is a key term combined with a definition for that term. A mapping in other languages is called a _key and value pair_ or a _dictionary_. + +Here's an example: + + +``` +\--- +Kernel: Linux +CPU: AMD +RAM: '16 GB' +``` + +Different languages have different ways of representing this kind of data. [In Python][2], for example, the same data can be written as `{"Kernel": "Linux", "CPU": "AMD", "RAM": "16 GB"}`. In real life, you might use this kind of structure to plan, for instance, a game night with friends. One friend signs up to bring snacks, another signs up to bring a deck of cards, another a board game, and so on. + +### Combing sequences and mappings + +You now know the syntax of YAML. Sequences and mappings are the only two kinds of building blocks available in YAML, and anything you want to represent in YAML can be placed into either a sequence or a mapping. + +Or both! + +Yes, sequences and mappings can be combined and nested, which is one reason YAML often looks intuitive and yet feels complex all at once. There are only four possible combinations, though, and once you learn to see them, YAML starts to feel as easy as it looks. + +### Mapping sequences + +When you want one key term to have many values, you use a mapping of sequences. That is, you start with a mapping (keys), but you insert a list for the values: + + +``` +\--- +Linux: + - Fedora +  - Slackware +BSD: + - FreeBSD +  - NetBSD +``` + +In this sample code, **Linux** is the first key, and its value is a sequence, which contains **Fedora** and **Slackware**. The second key is **BSD**, which has a value of a sequence containing **FreeBSD** and **NetBSD**. + +### Mapping of mappings + +When you want one key term to have values that themselves have both keys and values, you use a mapping of mappings. That is, you start with a mapping (keys), but you insert another mapping for the values. + +This one can be deceptive, but it reveals why special terminology is used in YAML: just because you create a list of mappings doesn't mean you've created a _sequence_. Here's a mapping of mappings: + + +``` +\--- +Desktop: +  CPU: RISC-V +  RAM: '32 GB' +Laptop: +  CPU: AMD +  RAM: '16 GB' +``` + +To most people, that looks like a list. And technically, it is a list. But it's important to recognize that it is _not_ a YAML sequence. It's a mapping, which contains mappings. Being a near-expert in YAML, you can spot the difference from the distinct lack of dashes. + +Of all the constructs in Ansible playbooks, I find that this one tricks people the most. As humans, we like lists, and when we see a data structure that _is literally_ a list, most people are compelled to translate that into a YAML sequence. But in YAML, although a sequence is a list, a list is not always a sequence. + +### Sequence of sequences + +Just as you can nest mappings, you can nest a sequence into a sequence: + + +``` +\--- +\- [Linux, FreeBSD, Illumos] +\- [YAML, XML, JSON] +``` + +This is probably the least common data structure I encounter in real-world uses of YAML, but sometimes you need a list of lists. + +### Sequence of mappings + +You can also create a sequence that contains mappings. This isn't terribly common for the way humans sort data, but for computers it can be an important construct. + +Here's an example: + + +``` +\--- +- +  CPU: AMD +  RAM: '16 GB' +- +  CPU: Intel +  RAM: '16 GB' +``` + +As YAML, this is possibly the least intuitive syntax. I find it clearer when rendered in Python: + + +``` +`[{"CPU": "AMD", "RAM": "16 GB"}, {"CPU": "Intel", "RAM": "16 GB"}]` +``` + +The square brackets represent a list structure, and the list contains two dictionaries. Each dictionary contains key and value pairs. + +### Build better YAML + +Now you know the two components of YAML, and how they can be combined to represent complex  data structures. The question is: what will you build with YAML? + +I use YAML, as many people do, for Ansible playbooks. I've also used it as an easy configuration format, as a character sheet for D&D, as a representation of a directory structure required for project organization, and much more. As long as you get comfortable with the concepts of sequences and mappings, you might find YAML an easy format to write, read, and (provided the right library) to parse. + +If you're finding yourself working with YAML often, download our **[YAML cheat sheet][3]** to help you visualize the basic data structures and their combinations and to help you remember some of the extra syntactical conventions available to you. With a little bit of practice, you'll find YAML really is as easy as it looks! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/yaml-cheat-sheet + +作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/article/21/3/dictionary-values-python +[3]: https://opensource.com/downloads/yaml-cheat-sheet From 3ea55f315321065fe5fb10856c25d4724b40038d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 Oct 2021 05:03:33 +0800 Subject: [PATCH 0558/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210930?= =?UTF-8?q?=20How=20I=20use=20Ansible=20and=20anacron=20for=20automation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210930 How I use Ansible and anacron for automation.md --- ... use Ansible and anacron for automation.md | 135 ++++++++++++++++++ 1 file changed, 135 insertions(+) create mode 100644 sources/tech/20210930 How I use Ansible and anacron for automation.md diff --git a/sources/tech/20210930 How I use Ansible and anacron for automation.md b/sources/tech/20210930 How I use Ansible and anacron for automation.md new file mode 100644 index 0000000000..78de59d790 --- /dev/null +++ b/sources/tech/20210930 How I use Ansible and anacron for automation.md @@ -0,0 +1,135 @@ +[#]: subject: "How I use Ansible and anacron for automation" +[#]: via: "https://opensource.com/article/21/9/ansible-anacron-automation" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use Ansible and anacron for automation +====== +With anacron, I can drop scripts and Ansible playbooks into place for +all manner of trivial tasks. +![Woman programming][1] + +Automation is the great IT and DevOps ideal, but in my experience, anything that's not immediately convenient may as well not exist at all. There have been many times when I've come up with a pretty good solution for some task, and I'll even script it, but I stop short of making it literally automated because the infrastructure for easy automation doesn't exist on the machine I'm working on. + +My favorite easy automation tool used to be the cron system—old, reliable, user-facing, and (aside from a scheduling syntax I can never commit to memory) simple. However, the problem with cron is that it assumes a computer is on 24 hours a day, every day. After missing one too many scheduled backups, I discovered [anacron][2], the cron system based on timestamps rather than scheduled times. If your computer is off when a job would typically have run, anacron ensures that it's run when the computer is back on. Creating a job is as easy as dropping a shell script into one of three directories: `cron.daily`, `cron.weekly`, or `cron.monthly` (you can define more if you want). With anacron, I find myself dropping scripts and Ansible playbooks into place for all manner of trivial tasks, including pop-up reminders of upcoming due dates or events. + +It's a simple and obvious solution to a modern problem, but it does me no good if anacron isn't installed on the computer. + +### Software setup with Ansible + +Any time I set up a new computer, whether it's a laptop, workstation, or server, I install anacron. That's easy, but an anacron install only provides the anacron command. It doesn't set up the anacron user environment. So I created an Ansible playbook to set up what the user needs to use anacron and install the anacron command. + +First, the standard Ansible boilerplate: + + +``` +\--- +\- hosts: localhost +  tasks: +``` + +### Creating directories with Ansible + +Next, I create the directory tree I use for anacron. You can think of this as a sort of transparent crontab. + + +``` +    - name: create directory tree +      ansible.builtin.file: +        path: "{{ item }}" +        state: directory +      with_items: +        - '~/.local/etc/cron.daily' +        - '~/.local/etc/cron.weekly' +        - '~/.local/etc/cron.monthly' +        - '~/.var/spool/anacron' +``` + +The syntax of this might seem a little strange, but it's actually a loop. The `with_items:` directive defines four directories to create, and Ansible iterates over the `ansible.builtin.file:` directive once for each directory (the directory name populates the `{{ item }}` variable). As with everything in Ansible, there's no error or conflict if the directory already exists. + +### Copying files with Ansible + +The `ansible.builtin.copy` module copies files from one location to another. For this to work, I needed to create a file called `anacrontab`. It's not an Ansible playbook, so I keep it in my `~/Ansible/data` directory, where I keep support files for my playbooks. + + +``` +    - name: copy anacrontab into place +      ansible.builtin.copy: +        src: ~/Ansible/data/anacrontab +        dest: ~/.local/etc/anacrontab +        mode: '0755' +``` + +My `anacrontab` file is simple and mimics the one some distributions install by default into `/etc/anacron`: + + +``` +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +1  0  cron.day    run-parts $HOME/.local/etc/cron.daily/ +7  0  cron.wek    run-parts $HOME/.local/etc/cron.weekly/ +30 0  cron.mon    run-parts $HOME/.local/etc/cron.monthly/ +``` + +### Running anacron on login + +Most Linux distributions configure anacron to read jobs from `/etc/anacron`. I mostly use anacron as a regular user, so I launch anacron from my login `~/.profile`. I don't want to have to remember to configure that myself, so I have Ansible do it. I use the `ansible.builtin.lineinfile` module, which creates `~/.profile` if it doesn't already exist and inserts the anacron launch line. + + +``` +    - name: add local anacrontab to .profile +      ansible.builtin.lineinfile: +        path: ~/.profile +        regexp: '^/usr/sbin/anacron' +        line: '/usr/sbin/anacron -t ~/.local/etc/anacrontab' +        create: true +``` + +### Installing anacron with Ansible + +For most of my systems, the `dnf` module would work for package installation, but my workstation runs Slackware (which uses `slackpkg`), and sometimes a different Linux distro makes its way into my collection. The `ansible.builtin.package` module provides a generic interface to package installation, so I use it for this playbook. Luckily, I haven't come across a repo that names `anacron` anything but `anacron`, so for now, I don't have to account for potential differences in package names. + +This is actually a separate play because package installation requires privilege escalation, provided by the `becomes: true` directive. + + +``` +\- hosts: localhost +  become: true +  tasks: +    - name: install anacron +      ansible.builtin.package: +        name: anacron +        state: present +``` + +### Using anacron and Ansible for easy automation + +To install anacron with Ansible, I run the playbook: + + +``` +`$ ansible-playbook ~/Ansible/setup-anacron.yaml` +``` + +From then on, I can write shell scripts to perform some trivial but repetitive task and copy it into `~/.local/etc/cron.daily` to have it automatically run once a day (or thereabouts). I also write Ansible playbooks for tasks such as [cleaning out my downloads folder][3]. I place my playbooks in `~/Ansible`, which is where I keep my Ansible plays, and then create a shell script in `~/.local/etc/cron.daily` to execute the play. It's easy, painless, and quickly becomes second nature. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/ansible-anacron-automation + +作者:[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/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://opensource.com/article/21/2/linux-automation +[3]: https://opensource.com/article/21/9/keep-folders-tidy-ansible From 3ee76f124b27e7b14a64a3c42b7da9059e08d545 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 1 Oct 2021 05:03:48 +0800 Subject: [PATCH 0559/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020210930?= =?UTF-8?q?=20Using=20Ansible=20with=20REST=20APIs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20210930 Using Ansible with REST APIs.md --- .../20210930 Using Ansible with REST APIs.md | 212 ++++++++++++++++++ 1 file changed, 212 insertions(+) create mode 100644 sources/tech/20210930 Using Ansible with REST APIs.md diff --git a/sources/tech/20210930 Using Ansible with REST APIs.md b/sources/tech/20210930 Using Ansible with REST APIs.md new file mode 100644 index 0000000000..4d05c8375b --- /dev/null +++ b/sources/tech/20210930 Using Ansible with REST APIs.md @@ -0,0 +1,212 @@ +[#]: subject: "Using Ansible with REST APIs" +[#]: via: "https://opensource.com/article/21/9/ansible-rest-apis" +[#]: author: "Vince Power https://opensource.com/users/vincepower" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Using Ansible with REST APIs +====== +You may have queried APIs with a web browser or curl, but one of the +overlooked capabilities of Ansible is how well it can leverage APIs as +part of any playbook. +![Looking at a map][1] + +Ansible is a top open source project which, on the surface, looks to provide a simple way to standardize your existing automation and allow it to run in parallel across multiple hosts, and it does this very successfully. Yet, in reality, Ansible has the capabilities to extend what your existing automation does to incorporate other systems and really simplify tasks across all aspects of your daily routine. + +This capability starts with the [collections][2] and [roles][3] that are included with Ansible and all the third-party utilities distributed through [Ansible Galaxy][4]. You may have queried APIs with a web browser or [curl][5], but one of the overlooked capabilities of Ansible is how well it can leverage APIs as part of any playbook. This is extremely useful because the number of REST APIs being built and deployed both internally and across the global internet is increasing exponentially. There's even a [public-apis GitHub repo][6] listing hundreds of free APIs across over a dozen categories just for a sense of scale. + +### A basic API playbook + +Well, it really comes down to a few key core capabilities within Ansible, which are exposed nicely with one specific built-in task, _uri_. In this post, I'll go through a fairly simple example of how to call a REST API and use the data from that call to decide what to do next. This works with Ansible 2.9 and higher. In later versions (specifically v4), the modules we use need to be prepended with _ansible.builtin_ like _ansible.builtin.set_fact_ instead of just _set_fact_. + +To get started, you need a basic playbook to build on. In this case, you're only using local calls, so you don't need to be a superuser. + +First, create this YAML file to establish a working baseline: + + +``` +\--- +\- name: Using a REST API +  become: false +  hosts: localhost +  gather_facts: false +  tasks: +    - debug: +        msg: “Let’s call an API” +``` + +Here's the output after running it: + + +``` +% ansible-playbook using-a-rest-api.yml + +PLAY [Using a REST API] ********************************************************************************************* + +TASK [debug] ******************************************************************************************************** +ok: [localhost] => { +    "msg": "“Let’s call an API”" +} + +PLAY RECAP ********************************************************************************************************** +localhost                  : ok=1    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   +``` + +### Calling an API + +To call an actual API, you can use the _uri_ module. Here are two examples. The first is just a GET and the second is a POST with parameters to show the different available options. + + +``` +\--- +\- name: Everyone loves a good Chuck Norris joke +  uri: +    url: +    method: GET + +\- name: Login to an API +  uri: +    url: +    method: POST +    body_format: json +    body: +      name: your_username +      password: your_password +      client_id: YOUR_CLIENT_ID +      access_token: ACCESS_TOKEN +      connection: CONNECTION +      scope: SCOPE +``` + +I use the first API for the rest of this article to show how the returned data can be used. The question is, how do you collect the data being returned, and what does it look like? + +To collect the output from any task running in Ansible, you use the _register_ attribute, and then you can use the _debug_ task to display the raw data. In the case of APIs called using _uri_, all the output is put under the .json. Subsection of the result. The _uri_ commands and other its output are also at that top level. These can be useful to make sure the API call works by looking at other data fields like status. + +These are the two tasks you must add to the original playbook to add the API call to the mix to later do something with. + + +``` +  - name: Getting the definition of awesome +      uri: +        url: +        method: GET +      register: results + +    - debug: +        var: results +``` + +Run it to see the output generated by debug: + + +``` +TASK [debug] ******************************************************************************************************** +ok: [localhost] => { +    "results": { +        "alt_svc": "h3=\":443\"; ma=86400, h3-29=\":443\"; ma=86400, h3-28=\":443\"; ma=86400, h3-27=\":443\"; ma=86400", +        "cf_cache_status": "DYNAMIC", +        "cf_ray": "694f7d791aeb19e7-EWR", +        "changed": false, +        "connection": "close", +        "content_type": "application/json;charset=UTF-8", +        "cookies": {}, +        "cookies_string": "", +        "date": "Sun, 26 Sep 2021 21:12:23 GMT", +        "elapsed": 0, +        "expect_ct": "max-age=604800, report-uri=\""", +        "failed": false, +        "json": { +            "categories": [], +            "created_at": "2020-01-05 13:42:26.991637", +            "icon_url": "", +            "id": "IjqNNWKvSDeVKaI82PaT1g", +            "updated_at": "2020-01-05 13:42:26.991637", +            "url": "", +            "value": "One person stated that Chuck Norris has forgotten more about killing than anyone will ever know. That is not true -- Chuck Norris never forgets. Ever." +        }, +        "msg": "OK (unknown bytes)", +        "nel": "{\"success_fraction\":0,\"report_to\":\"cf-nel\",\"max_age\":604800}", +        "redirected": false, +        "report_to": "{\"endpoints\":[{\"url\":\"https:\\\/\\\/a.nel.cloudflare.com\\\/report\\\/v3?s=HVPJYMVr%2B3wB1HSlgxv6GThBMjkBJgfdu0DPw%2BunjQzQ9YfXZqifggIJ%2FxOIKgOu6JP1SrPsx1jCCp3GQ9hZAp7NO0pmlTZ0y3ufbASGwLmCOV1zyaecUkSwQD%2Fv3RYYgZTkaSQ%3D\"}],\"group\":\"cf-nel\",\"max_age\":604800}", +        "server": "cloudflare", +        "status": 200, +        "transfer_encoding": "chunked", +        "url": "", +        "via": "1.1 vegur" +    } +} +``` + +Now that you can see all the output make a custom message listing the value returned by the API. Here is the completed playbook: + + +``` +\--- +\- name: Using a REST API +  become: false +  hosts: localhost +  gather_facts: false +  tasks: +    - debug: +        msg: “Let’s call an API” + +    - name: Everyone loves a good Chuck Norris joke +      uri: +        url: +        method: GET +      register: results + +    - debug: +        var: results.json.value +``` + +And now the complete output: + + +``` +PLAY [Using a REST API] ********************************************************************************************* + +TASK [debug] ******************************************************************************************************** +ok: [localhost] => { +    "msg": "“Let’s call an API”" +} + +TASK [Everyone loves a good Chuck Norris joke] ********************************************************************** +ok: [localhost] + +TASK [debug] ******************************************************************************************************** +ok: [localhost] => { +    "results.json.value": "Chuck Norris is the only computer system that beats a Mac or a PC. Too bad all it does is round house kicks the user." +} + +PLAY RECAP ********************************************************************************************************** +localhost                  : ok=3    changed=0    unreachable=0    failed=0    skipped=0    rescued=0    ignored=0   +``` + +### Next steps + +Things can get much more complicated than I've shown here. To get more details, head over to Ansible's [documentation][7]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/ansible-rest-apis + +作者:[Vince Power][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/vincepower +[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://docs.ansible.com/ansible/latest/user_guide/collections_using.html +[3]: https://docs.ansible.com/ansible/latest/user_guide/playbooks_reuse_roles.html +[4]: https://galaxy.ansible.com/ +[5]: https://www.redhat.com/sysadmin/use-curl-api +[6]: https://github.com/public-apis/public-apis +[7]: https://docs.ansible.com/ansible/latest/collections/ansible/builtin/uri_module.html From e4db2fbcbedc029b8678a91db592bc7ca09b5d9b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 Oct 2021 16:58:58 +0800 Subject: [PATCH 0560/1588] PRF&PUB @geekpi https://linux.cn/article-13839-1.html --- ... Ubuntu Linux -GUI and Terminal Methods.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) diff --git a/translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md b/translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md index 88f4504331..2820edd9a1 100644 --- a/translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md +++ b/translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md @@ -3,18 +3,20 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13839-1.html" -在 Ubuntu Linux 上安装 AnyDesk(GUI 和终端方法) +在 Ubuntu Linux 上安装 AnyDesk ====== -_**简介:这个初学者的教程讨论了在基于 Ubuntu 的 Linux 发行版上安装 AnyDesk 的 GUI 和终端方法**_。 +> 这个初学者的教程讨论了在基于 Ubuntu 的 Linux 发行版上安装 AnyDesk 的 GUI 和终端方法。 + +![](https://img.linux.net.cn/data/attachment/album/202110/01/165758y9aaiix7yu88ayui.jpg) [AnyDesk][1] 是一个流行的远程桌面软件,可用于 Linux、Windows、BSD、macOS 和移动平台。 -有了这个工具,你可以用 AnyDesk 远程访问其他电脑,或者让别人远程访问你的系统。不是每个人都可以访问它,因为有两台设备使用 AnyDesk。你必须接受传入的连接和/或提供一个安全连接的密码。 +有了 AnyDesk,你可以用它远程访问其他电脑,或者让别人远程访问你的系统。不是每个人都可以访问它,因为需要两台设备都使用 AnyDesk。你必须接受传入的连接和/或提供一个安全连接的密码。 这对于向朋友、家人、同事甚至客户提供技术支持很有帮助。 @@ -22,13 +24,13 @@ _**简介:这个初学者的教程讨论了在基于 Ubuntu 的 Linux 发行 同样的方法应该适用于 Debian 和其他基于 Debian 和 Ubuntu 的发行版,如 Linux Mint,Linux Lite 等。 -非 FOSS 警告! - -AnyDesk 不是开源软件。这里涉及它是因为它在 Linux 上可用,而文章的重点是 Linux。 +> **非 FOSS 警告!** +> +> AnyDesk 不是开源软件。这里涉及它是因为它在 Linux 上可用,而文章的重点是 Linux。 ### 方法 1:使用终端在 Ubuntu 上安装 AnyDesk -在你的系统上[打开终端程序][2]。你需要一个像 wget 这样的工具来[在终端下载文件][3],对于这个使用以下命令: +在你的系统上 [打开终端程序][2]。你需要一个像 `wget` 这样的工具来 [在终端下载文件][3],使用以下命令: ``` sudo apt update @@ -41,7 +43,7 @@ sudo apt install wget wget -qO - https://keys.anydesk.com/repos/DEB-GPG-KEY | sudo apt-key add - ``` -你可以暂时忽略关于 apt-key 命令的废弃警告。下一步是将 AnyDesk 仓库添加到系统的仓库源中: +你可以暂时忽略关于 `apt-key` 命令的废弃警告。下一步是将 AnyDesk 仓库添加到系统的仓库源中: ``` echo "deb http://deb.anydesk.com/ all main" | sudo tee /etc/apt/sources.list.d/anydesk-stable.list @@ -75,9 +77,9 @@ anydesk 你可以从 AnyDesk 官网下载 Ubuntu 上的 AnyDesk: -[下载 Linux 上的 Anydesk][6] +- [下载 Linux 上的 Anydesk][6] -你会看到一个立即下载的按钮。点击它。 +你会看到一个“Download Now”的按钮。点击它。 ![Download AnyDesk][7] @@ -99,7 +101,7 @@ anydesk 这就好了。不是太难,是吗? -我不打算展示使用 AnyDesk 的步骤。我想你已经对这个问题有了一些了解。如果没有,请参考[这篇文章][13],谢谢。 +我不打算展示使用 AnyDesk 的步骤。我想你已经对这个问题有了一些了解。如果没有,请参考 [这篇文章][13]。 #### 故障排除提示 @@ -110,7 +112,7 @@ anydesk anydesk: error while loading shared libraries: libpangox-1.0.so.0: cannot open shared object file: No such file or directory ``` -如果你看到 [error while loading shared libraries][14] 信息,你要安装它所报错的软件包。在我的例子中,我是这样做的: +如果你看到 “[error while loading shared libraries][14]” 信息,你要安装它所报错的软件包。在我的例子中,我是这样做的: ``` sudo apt install libpangox-1.0-0 @@ -127,7 +129,7 @@ via: https://itsfoss.com/install-anydesk-ubuntu/ 作者:[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 3b2ae798c46372100790c014bd0cbb33ede2e7e4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 Oct 2021 17:03:41 +0800 Subject: [PATCH 0561/1588] =?UTF-8?q?=E5=BD=92=E6=A1=A3=20202109?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../20200121 13 of the best React JavaScript frameworks.md | 0 .../{ => 202109}/20200211 Using external libraries in Java.md | 0 .../20200908 Deploy a deep learning model on Kubernetes.md | 0 published/{ => 202109}/20210228 What is GNU-Linux Copypasta.md | 0 .../20210424 Can We Recommend Linux for Gaming in 2021.md | 0 published/{ => 202109}/20210622 What is a config file.md | 0 .../20210719 Apps for daily needs part 2- office suites.md | 0 .../{ => 202109}/20210727 Analyze the Linux kernel with ftrace.md | 0 .../20210804 Apps for daily needs part 3- image editors.md | 0 ...uide to understanding your team-s implicit values and needs.md | 0 ... vs Ubuntu- What-s the Difference- Which One Should You Use.md | 0 .../20210820 Check file status on Linux with the stat command.md | 0 .../20210820 How to Download Audio Only Using youtube-dl.md | 0 ...0821 10 Things to Do After Installing elementary OS 6 -Odin.md | 0 .../{ => 202109}/20210821 How to set up your printer on Linux.md | 0 .../20210823 Apps for daily needs part 4- audio editors.md | 0 ...24 Ulauncher- A Super Useful Application Launcher for Linux.md | 0 ... Elementary OS 6 Odin Review - Late Arrival but a Solid One.md | 0 .../{ => 202109}/20210827 How to Easily Install Debian Linux.md | 0 .../20210827 Linux kernel modules we can-t live without.md | 0 ...20210829 Position text on your screen in Linux with ncurses.md | 0 ...nux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md | 0 .../20210830 Write a guessing game in ncurses on Linux.md | 0 published/{ => 202109}/20210831 What is a container image.md | 0 ...0831 Zulip- An Interesting Open-Source Alternative to Slack.md | 0 .../20210901 20 essential Linux commands for every user.md | 0 published/{ => 202109}/20210901 What are container runtimes.md | 0 .../20210902 4 Linux technologies fundamental to containers.md | 0 .../20210904 How to Install Dropbox on Ubuntu Linux.md | 0 ...ither Windows, nor Linux- Shrine is ‘God-s Operating System.md | 0 .../20210906 Getting the Top Indicator Panel Back in GNOME.md | 0 .../20210906 Resize an image from the Linux terminal.md | 0 .../20210907 How to Stop a Program in Linux Terminal.md | 0 ... OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md | 0 ...0210907 Run Web Applications in Linux Using Tangram Browser.md | 0 .../20210907 Use lspci on Linux to see your hardware.md | 0 .../20210908 Apps for daily needs part 5- video editors.md | 0 .../20210908 Debug a web page error from the command line.md | 0 .../{ => 202109}/20210908 How to Run Java Programs in Ubuntu.md | 0 ...ve USB Drive in Linux Terminal -For Experts and Adventurers.md | 0 ...ls Brackets Code Editor - Suggests Using Visual Studio Code.md | 0 ...Building an open source community health analytics platform.md | 0 ...10910 Quadratic algorithms are slow (and hashmaps are fast).md | 0 ...hy Firefox is Seeing a Continuous Decline for Last 12 Years.md | 0 .../20210913 Replace smart quotes with the Linux sed command.md | 0 ... to check for update info and changelogs with rpm-ostree db.md | 0 ...20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md | 0 .../20210915 Screen Recording in Linux With OBS and Wayland.md | 0 ... in Kali Live VM Support, New Tools, and Other Improvements.md | 0 ...10916 Watch commands and tasks with the Linux watch command.md | 0 .../{ => 202109}/20210917 How to Install Kali Linux in VMware.md | 0 published/{ => 202109}/20210917 Start using YAML now.md | 0 .../20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md | 0 ...Vagrant to test your scripts on different operating systems.md | 0 ...inux command-line tool to learn more about your NVMe drives.md | 0 .../{ => 202109}/20210921 Run containers on your Mac with Lima.md | 0 ...sed- The Most Popular Linux Desktop Environment Gets Better.md | 0 .../20210924 An open source alternative to Microsoft Exchange.md | 0 ...e Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md | 0 .../{ => 202109}/20210927 5 open source alternatives to Zoom.md | 0 .../{ => 202109}/20210929 Manage CentOS Stream with Foreman.md | 0 61 files changed, 0 insertions(+), 0 deletions(-) rename published/{ => 202109}/20200121 13 of the best React JavaScript frameworks.md (100%) rename published/{ => 202109}/20200211 Using external libraries in Java.md (100%) rename published/{ => 202109}/20200908 Deploy a deep learning model on Kubernetes.md (100%) rename published/{ => 202109}/20210228 What is GNU-Linux Copypasta.md (100%) rename published/{ => 202109}/20210424 Can We Recommend Linux for Gaming in 2021.md (100%) rename published/{ => 202109}/20210622 What is a config file.md (100%) rename published/{ => 202109}/20210719 Apps for daily needs part 2- office suites.md (100%) rename published/{ => 202109}/20210727 Analyze the Linux kernel with ftrace.md (100%) rename published/{ => 202109}/20210804 Apps for daily needs part 3- image editors.md (100%) rename published/{ => 202109}/20210819 A guide to understanding your team-s implicit values and needs.md (100%) rename published/{ => 202109}/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md (100%) rename published/{ => 202109}/20210820 Check file status on Linux with the stat command.md (100%) rename published/{ => 202109}/20210820 How to Download Audio Only Using youtube-dl.md (100%) rename published/{ => 202109}/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md (100%) rename published/{ => 202109}/20210821 How to set up your printer on Linux.md (100%) rename published/{ => 202109}/20210823 Apps for daily needs part 4- audio editors.md (100%) rename published/{ => 202109}/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md (100%) rename published/{ => 202109}/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md (100%) rename published/{ => 202109}/20210827 How to Easily Install Debian Linux.md (100%) rename published/{ => 202109}/20210827 Linux kernel modules we can-t live without.md (100%) rename published/{ => 202109}/20210829 Position text on your screen in Linux with ncurses.md (100%) rename published/{ => 202109}/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md (100%) rename published/{ => 202109}/20210830 Write a guessing game in ncurses on Linux.md (100%) rename published/{ => 202109}/20210831 What is a container image.md (100%) rename published/{ => 202109}/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md (100%) rename published/{ => 202109}/20210901 20 essential Linux commands for every user.md (100%) rename published/{ => 202109}/20210901 What are container runtimes.md (100%) rename published/{ => 202109}/20210902 4 Linux technologies fundamental to containers.md (100%) rename published/{ => 202109}/20210904 How to Install Dropbox on Ubuntu Linux.md (100%) rename published/{ => 202109}/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md (100%) rename published/{ => 202109}/20210906 Getting the Top Indicator Panel Back in GNOME.md (100%) rename published/{ => 202109}/20210906 Resize an image from the Linux terminal.md (100%) rename published/{ => 202109}/20210907 How to Stop a Program in Linux Terminal.md (100%) rename published/{ => 202109}/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md (100%) rename published/{ => 202109}/20210907 Run Web Applications in Linux Using Tangram Browser.md (100%) rename published/{ => 202109}/20210907 Use lspci on Linux to see your hardware.md (100%) rename published/{ => 202109}/20210908 Apps for daily needs part 5- video editors.md (100%) rename published/{ => 202109}/20210908 Debug a web page error from the command line.md (100%) rename published/{ => 202109}/20210908 How to Run Java Programs in Ubuntu.md (100%) rename published/{ => 202109}/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md (100%) rename published/{ => 202109}/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md (100%) rename published/{ => 202109}/20210910 Building an open source community health analytics platform.md (100%) rename published/{ => 202109}/20210910 Quadratic algorithms are slow (and hashmaps are fast).md (100%) rename published/{ => 202109}/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md (100%) rename published/{ => 202109}/20210913 Replace smart quotes with the Linux sed command.md (100%) rename published/{ => 202109}/20210915 How to check for update info and changelogs with rpm-ostree db.md (100%) rename published/{ => 202109}/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md (100%) rename published/{ => 202109}/20210915 Screen Recording in Linux With OBS and Wayland.md (100%) rename published/{ => 202109}/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md (100%) rename published/{ => 202109}/20210916 Watch commands and tasks with the Linux watch command.md (100%) rename published/{ => 202109}/20210917 How to Install Kali Linux in VMware.md (100%) rename published/{ => 202109}/20210917 Start using YAML now.md (100%) rename published/{ => 202109}/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md (100%) rename published/{ => 202109}/20210920 Use Vagrant to test your scripts on different operating systems.md (100%) rename published/{ => 202109}/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md (100%) rename published/{ => 202109}/20210921 Run containers on your Mac with Lima.md (100%) rename published/{ => 202109}/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md (100%) rename published/{ => 202109}/20210924 An open source alternative to Microsoft Exchange.md (100%) rename published/{ => 202109}/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md (100%) rename published/{ => 202109}/20210927 5 open source alternatives to Zoom.md (100%) rename published/{ => 202109}/20210929 Manage CentOS Stream with Foreman.md (100%) diff --git a/published/20200121 13 of the best React JavaScript frameworks.md b/published/202109/20200121 13 of the best React JavaScript frameworks.md similarity index 100% rename from published/20200121 13 of the best React JavaScript frameworks.md rename to published/202109/20200121 13 of the best React JavaScript frameworks.md diff --git a/published/20200211 Using external libraries in Java.md b/published/202109/20200211 Using external libraries in Java.md similarity index 100% rename from published/20200211 Using external libraries in Java.md rename to published/202109/20200211 Using external libraries in Java.md diff --git a/published/20200908 Deploy a deep learning model on Kubernetes.md b/published/202109/20200908 Deploy a deep learning model on Kubernetes.md similarity index 100% rename from published/20200908 Deploy a deep learning model on Kubernetes.md rename to published/202109/20200908 Deploy a deep learning model on Kubernetes.md diff --git a/published/20210228 What is GNU-Linux Copypasta.md b/published/202109/20210228 What is GNU-Linux Copypasta.md similarity index 100% rename from published/20210228 What is GNU-Linux Copypasta.md rename to published/202109/20210228 What is GNU-Linux Copypasta.md diff --git a/published/20210424 Can We Recommend Linux for Gaming in 2021.md b/published/202109/20210424 Can We Recommend Linux for Gaming in 2021.md similarity index 100% rename from published/20210424 Can We Recommend Linux for Gaming in 2021.md rename to published/202109/20210424 Can We Recommend Linux for Gaming in 2021.md diff --git a/published/20210622 What is a config file.md b/published/202109/20210622 What is a config file.md similarity index 100% rename from published/20210622 What is a config file.md rename to published/202109/20210622 What is a config file.md diff --git a/published/20210719 Apps for daily needs part 2- office suites.md b/published/202109/20210719 Apps for daily needs part 2- office suites.md similarity index 100% rename from published/20210719 Apps for daily needs part 2- office suites.md rename to published/202109/20210719 Apps for daily needs part 2- office suites.md diff --git a/published/20210727 Analyze the Linux kernel with ftrace.md b/published/202109/20210727 Analyze the Linux kernel with ftrace.md similarity index 100% rename from published/20210727 Analyze the Linux kernel with ftrace.md rename to published/202109/20210727 Analyze the Linux kernel with ftrace.md diff --git a/published/20210804 Apps for daily needs part 3- image editors.md b/published/202109/20210804 Apps for daily needs part 3- image editors.md similarity index 100% rename from published/20210804 Apps for daily needs part 3- image editors.md rename to published/202109/20210804 Apps for daily needs part 3- image editors.md diff --git a/published/20210819 A guide to understanding your team-s implicit values and needs.md b/published/202109/20210819 A guide to understanding your team-s implicit values and needs.md similarity index 100% rename from published/20210819 A guide to understanding your team-s implicit values and needs.md rename to published/202109/20210819 A guide to understanding your team-s implicit values and needs.md diff --git a/published/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md b/published/202109/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md similarity index 100% rename from published/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md rename to published/202109/20210819 Debian vs Ubuntu- What-s the Difference- Which One Should You Use.md diff --git a/published/20210820 Check file status on Linux with the stat command.md b/published/202109/20210820 Check file status on Linux with the stat command.md similarity index 100% rename from published/20210820 Check file status on Linux with the stat command.md rename to published/202109/20210820 Check file status on Linux with the stat command.md diff --git a/published/20210820 How to Download Audio Only Using youtube-dl.md b/published/202109/20210820 How to Download Audio Only Using youtube-dl.md similarity index 100% rename from published/20210820 How to Download Audio Only Using youtube-dl.md rename to published/202109/20210820 How to Download Audio Only Using youtube-dl.md diff --git a/published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md b/published/202109/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md similarity index 100% rename from published/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md rename to published/202109/20210821 10 Things to Do After Installing elementary OS 6 -Odin.md diff --git a/published/20210821 How to set up your printer on Linux.md b/published/202109/20210821 How to set up your printer on Linux.md similarity index 100% rename from published/20210821 How to set up your printer on Linux.md rename to published/202109/20210821 How to set up your printer on Linux.md diff --git a/published/20210823 Apps for daily needs part 4- audio editors.md b/published/202109/20210823 Apps for daily needs part 4- audio editors.md similarity index 100% rename from published/20210823 Apps for daily needs part 4- audio editors.md rename to published/202109/20210823 Apps for daily needs part 4- audio editors.md diff --git a/published/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md b/published/202109/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md similarity index 100% rename from published/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md rename to published/202109/20210824 Ulauncher- A Super Useful Application Launcher for Linux.md diff --git a/published/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md b/published/202109/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md similarity index 100% rename from published/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md rename to published/202109/20210826 Elementary OS 6 Odin Review - Late Arrival but a Solid One.md diff --git a/published/20210827 How to Easily Install Debian Linux.md b/published/202109/20210827 How to Easily Install Debian Linux.md similarity index 100% rename from published/20210827 How to Easily Install Debian Linux.md rename to published/202109/20210827 How to Easily Install Debian Linux.md diff --git a/published/20210827 Linux kernel modules we can-t live without.md b/published/202109/20210827 Linux kernel modules we can-t live without.md similarity index 100% rename from published/20210827 Linux kernel modules we can-t live without.md rename to published/202109/20210827 Linux kernel modules we can-t live without.md diff --git a/published/20210829 Position text on your screen in Linux with ncurses.md b/published/202109/20210829 Position text on your screen in Linux with ncurses.md similarity index 100% rename from published/20210829 Position text on your screen in Linux with ncurses.md rename to published/202109/20210829 Position text on your screen in Linux with ncurses.md diff --git a/published/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md b/published/202109/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md similarity index 100% rename from published/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md rename to published/202109/20210830 Linux Jargon Buster- What is sudo rm -rf- Why is it Dangerous.md diff --git a/published/20210830 Write a guessing game in ncurses on Linux.md b/published/202109/20210830 Write a guessing game in ncurses on Linux.md similarity index 100% rename from published/20210830 Write a guessing game in ncurses on Linux.md rename to published/202109/20210830 Write a guessing game in ncurses on Linux.md diff --git a/published/20210831 What is a container image.md b/published/202109/20210831 What is a container image.md similarity index 100% rename from published/20210831 What is a container image.md rename to published/202109/20210831 What is a container image.md diff --git a/published/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md b/published/202109/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md similarity index 100% rename from published/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md rename to published/202109/20210831 Zulip- An Interesting Open-Source Alternative to Slack.md diff --git a/published/20210901 20 essential Linux commands for every user.md b/published/202109/20210901 20 essential Linux commands for every user.md similarity index 100% rename from published/20210901 20 essential Linux commands for every user.md rename to published/202109/20210901 20 essential Linux commands for every user.md diff --git a/published/20210901 What are container runtimes.md b/published/202109/20210901 What are container runtimes.md similarity index 100% rename from published/20210901 What are container runtimes.md rename to published/202109/20210901 What are container runtimes.md diff --git a/published/20210902 4 Linux technologies fundamental to containers.md b/published/202109/20210902 4 Linux technologies fundamental to containers.md similarity index 100% rename from published/20210902 4 Linux technologies fundamental to containers.md rename to published/202109/20210902 4 Linux technologies fundamental to containers.md diff --git a/published/20210904 How to Install Dropbox on Ubuntu Linux.md b/published/202109/20210904 How to Install Dropbox on Ubuntu Linux.md similarity index 100% rename from published/20210904 How to Install Dropbox on Ubuntu Linux.md rename to published/202109/20210904 How to Install Dropbox on Ubuntu Linux.md diff --git a/published/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md b/published/202109/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md similarity index 100% rename from published/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md rename to published/202109/20210905 Neither Windows, nor Linux- Shrine is ‘God-s Operating System.md diff --git a/published/20210906 Getting the Top Indicator Panel Back in GNOME.md b/published/202109/20210906 Getting the Top Indicator Panel Back in GNOME.md similarity index 100% rename from published/20210906 Getting the Top Indicator Panel Back in GNOME.md rename to published/202109/20210906 Getting the Top Indicator Panel Back in GNOME.md diff --git a/published/20210906 Resize an image from the Linux terminal.md b/published/202109/20210906 Resize an image from the Linux terminal.md similarity index 100% rename from published/20210906 Resize an image from the Linux terminal.md rename to published/202109/20210906 Resize an image from the Linux terminal.md diff --git a/published/20210907 How to Stop a Program in Linux Terminal.md b/published/202109/20210907 How to Stop a Program in Linux Terminal.md similarity index 100% rename from published/20210907 How to Stop a Program in Linux Terminal.md rename to published/202109/20210907 How to Stop a Program in Linux Terminal.md diff --git a/published/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md b/published/202109/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md similarity index 100% rename from published/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md rename to published/202109/20210907 OpenWrt 21.02 Arrives With Linux Kernel 5.4 - WPA3 Support.md diff --git a/published/20210907 Run Web Applications in Linux Using Tangram Browser.md b/published/202109/20210907 Run Web Applications in Linux Using Tangram Browser.md similarity index 100% rename from published/20210907 Run Web Applications in Linux Using Tangram Browser.md rename to published/202109/20210907 Run Web Applications in Linux Using Tangram Browser.md diff --git a/published/20210907 Use lspci on Linux to see your hardware.md b/published/202109/20210907 Use lspci on Linux to see your hardware.md similarity index 100% rename from published/20210907 Use lspci on Linux to see your hardware.md rename to published/202109/20210907 Use lspci on Linux to see your hardware.md diff --git a/published/20210908 Apps for daily needs part 5- video editors.md b/published/202109/20210908 Apps for daily needs part 5- video editors.md similarity index 100% rename from published/20210908 Apps for daily needs part 5- video editors.md rename to published/202109/20210908 Apps for daily needs part 5- video editors.md diff --git a/published/20210908 Debug a web page error from the command line.md b/published/202109/20210908 Debug a web page error from the command line.md similarity index 100% rename from published/20210908 Debug a web page error from the command line.md rename to published/202109/20210908 Debug a web page error from the command line.md diff --git a/published/20210908 How to Run Java Programs in Ubuntu.md b/published/202109/20210908 How to Run Java Programs in Ubuntu.md similarity index 100% rename from published/20210908 How to Run Java Programs in Ubuntu.md rename to published/202109/20210908 How to Run Java Programs in Ubuntu.md diff --git a/published/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md b/published/202109/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md similarity index 100% rename from published/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md rename to published/202109/20210908 How to Use the dd Command to Create a Live USB Drive in Linux Terminal -For Experts and Adventurers.md diff --git a/published/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md b/published/202109/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md similarity index 100% rename from published/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md rename to published/202109/20210909 Adobe Kills Brackets Code Editor - Suggests Using Visual Studio Code.md diff --git a/published/20210910 Building an open source community health analytics platform.md b/published/202109/20210910 Building an open source community health analytics platform.md similarity index 100% rename from published/20210910 Building an open source community health analytics platform.md rename to published/202109/20210910 Building an open source community health analytics platform.md diff --git a/published/20210910 Quadratic algorithms are slow (and hashmaps are fast).md b/published/202109/20210910 Quadratic algorithms are slow (and hashmaps are fast).md similarity index 100% rename from published/20210910 Quadratic algorithms are slow (and hashmaps are fast).md rename to published/202109/20210910 Quadratic algorithms are slow (and hashmaps are fast).md diff --git a/published/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md b/published/202109/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md similarity index 100% rename from published/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md rename to published/202109/20210911 Here-s Why Firefox is Seeing a Continuous Decline for Last 12 Years.md diff --git a/published/20210913 Replace smart quotes with the Linux sed command.md b/published/202109/20210913 Replace smart quotes with the Linux sed command.md similarity index 100% rename from published/20210913 Replace smart quotes with the Linux sed command.md rename to published/202109/20210913 Replace smart quotes with the Linux sed command.md diff --git a/published/20210915 How to check for update info and changelogs with rpm-ostree db.md b/published/202109/20210915 How to check for update info and changelogs with rpm-ostree db.md similarity index 100% rename from published/20210915 How to check for update info and changelogs with rpm-ostree db.md rename to published/202109/20210915 How to check for update info and changelogs with rpm-ostree db.md diff --git a/published/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md b/published/202109/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md similarity index 100% rename from published/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md rename to published/202109/20210915 Raspberry Pi Zero vs Zero W- What-s the Difference.md diff --git a/published/20210915 Screen Recording in Linux With OBS and Wayland.md b/published/202109/20210915 Screen Recording in Linux With OBS and Wayland.md similarity index 100% rename from published/20210915 Screen Recording in Linux With OBS and Wayland.md rename to published/202109/20210915 Screen Recording in Linux With OBS and Wayland.md diff --git a/published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md b/published/202109/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md similarity index 100% rename from published/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md rename to published/202109/20210916 Kali Linux 2021.3 Brings in Kali Live VM Support, New Tools, and Other Improvements.md diff --git a/published/20210916 Watch commands and tasks with the Linux watch command.md b/published/202109/20210916 Watch commands and tasks with the Linux watch command.md similarity index 100% rename from published/20210916 Watch commands and tasks with the Linux watch command.md rename to published/202109/20210916 Watch commands and tasks with the Linux watch command.md diff --git a/published/20210917 How to Install Kali Linux in VMware.md b/published/202109/20210917 How to Install Kali Linux in VMware.md similarity index 100% rename from published/20210917 How to Install Kali Linux in VMware.md rename to published/202109/20210917 How to Install Kali Linux in VMware.md diff --git a/published/20210917 Start using YAML now.md b/published/202109/20210917 Start using YAML now.md similarity index 100% rename from published/20210917 Start using YAML now.md rename to published/202109/20210917 Start using YAML now.md diff --git a/published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md b/published/202109/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md similarity index 100% rename from published/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md rename to published/202109/20210918 How to Install Ubuntu Desktop on Raspberry Pi 4.md diff --git a/published/20210920 Use Vagrant to test your scripts on different operating systems.md b/published/202109/20210920 Use Vagrant to test your scripts on different operating systems.md similarity index 100% rename from published/20210920 Use Vagrant to test your scripts on different operating systems.md rename to published/202109/20210920 Use Vagrant to test your scripts on different operating systems.md diff --git a/published/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md b/published/202109/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md similarity index 100% rename from published/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md rename to published/202109/20210920 Use this Linux command-line tool to learn more about your NVMe drives.md diff --git a/published/20210921 Run containers on your Mac with Lima.md b/published/202109/20210921 Run containers on your Mac with Lima.md similarity index 100% rename from published/20210921 Run containers on your Mac with Lima.md rename to published/202109/20210921 Run containers on your Mac with Lima.md diff --git a/published/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md b/published/202109/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md similarity index 100% rename from published/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md rename to published/202109/20210923 GNOME 41 Released- The Most Popular Linux Desktop Environment Gets Better.md diff --git a/published/20210924 An open source alternative to Microsoft Exchange.md b/published/202109/20210924 An open source alternative to Microsoft Exchange.md similarity index 100% rename from published/20210924 An open source alternative to Microsoft Exchange.md rename to published/202109/20210924 An open source alternative to Microsoft Exchange.md diff --git a/published/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md b/published/202109/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md similarity index 100% rename from published/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md rename to published/202109/20210924 Linux Gamers Can Finally Play Games like Apex Legends, Fortnite, Thanks to Easy Anti-Cheat Support.md diff --git a/published/20210927 5 open source alternatives to Zoom.md b/published/202109/20210927 5 open source alternatives to Zoom.md similarity index 100% rename from published/20210927 5 open source alternatives to Zoom.md rename to published/202109/20210927 5 open source alternatives to Zoom.md diff --git a/published/20210929 Manage CentOS Stream with Foreman.md b/published/202109/20210929 Manage CentOS Stream with Foreman.md similarity index 100% rename from published/20210929 Manage CentOS Stream with Foreman.md rename to published/202109/20210929 Manage CentOS Stream with Foreman.md From 38b49a64d09792e2c4673c75411a9f497b949bd3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 Oct 2021 17:21:36 +0800 Subject: [PATCH 0562/1588] PUB:20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods --- ...2 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md (100%) diff --git a/translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md b/published/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md similarity index 100% rename from translated/tech/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md rename to published/20210922 Install AnyDesk on Ubuntu Linux -GUI and Terminal Methods.md From 5575ab9e595459bd926aef1563dab27d7ae19060 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 Oct 2021 17:36:16 +0800 Subject: [PATCH 0563/1588] APL --- sources/tech/20210907 How to use BusyBox on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210907 How to use BusyBox on Linux.md b/sources/tech/20210907 How to use BusyBox on Linux.md index dfcc7dbd6d..609412f9c4 100644 --- a/sources/tech/20210907 How to use BusyBox on Linux.md +++ b/sources/tech/20210907 How to use BusyBox on Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/8/what-busybox" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From eb015a3e60132c50e3e4edb1131c0e8a159fdfca Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 Oct 2021 18:38:56 +0800 Subject: [PATCH 0564/1588] TSL&PRF --- .../20210907 How to use BusyBox on Linux.md | 189 ------------------ .../20210907 How to use BusyBox on Linux.md | 181 +++++++++++++++++ 2 files changed, 181 insertions(+), 189 deletions(-) delete mode 100644 sources/tech/20210907 How to use BusyBox on Linux.md create mode 100644 translated/tech/20210907 How to use BusyBox on Linux.md diff --git a/sources/tech/20210907 How to use BusyBox on Linux.md b/sources/tech/20210907 How to use BusyBox on Linux.md deleted file mode 100644 index 609412f9c4..0000000000 --- a/sources/tech/20210907 How to use BusyBox on Linux.md +++ /dev/null @@ -1,189 +0,0 @@ -[#]: subject: "How to use BusyBox on Linux" -[#]: via: "https://opensource.com/article/21/8/what-busybox" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to use BusyBox on Linux -====== -BusyBox is an open source (GPL) project providing simple implementations -of nearly 400 common commands. -![bash logo on green background][1] - -It's easy to take Linux commands for granted. They come bundled with the system when you install Linux, and we often don't question why they're there. Some of the basic commands, such as [`cd`][2], [`kill`][3], and `echo` aren't always independent applications but are actually built into your shell. Others, such as [`ls`][4], [`mv`][5], and [`cat`][6] are part of a core utility package (often GNU `coreutils` specifically). But there are always alternatives in the world of open source, and one of the most interesting is [BusyBox][7]. - -### What is BusyBox in Linux? - -BusyBox is an open source (GPL) project providing simple implementations of nearly 400 common commands, including `ls`, `mv`, `ln`, `mkdir`, `more`, `ps`, `gzip`, `bzip2`, `tar`, and `grep`. It also contains a version of the programming language `awk`, the stream editor `sed`, the filesystem checker `fsck`, the `rpm` and `dpkg` package managers, and of course, a shell (`sh`) that provides easy access to all of these commands. In short, it contains all the essential commands required for a POSIX system to perform common system maintenance tasks as well as many user and administrative tasks. - -In fact, it even contains an `init` command which can be launched as PID 1 to serve as the parent process for all other system services. In other words, BusyBox can be used as an alternative to [systemd][8], OpenRC, sinit, init, and other launch daemons. - -BusyBox is very small. As an executable, it's under 1 MB, so it has gained much of its popularity in the [embedded][9], [Edge][10], and [IoT][11] space, where drive space is at a premium. In the world of containers and cloud computing, it's also popular as a foundation for minimal Linux container images. - -### Minimalism - -Part of the appeal of BusyBox is its minimalism. All of its commands are compiled into a single binary (`busybox`), and its man page is a mere 81 pages (by my calculation of piping `man` to `pr`) but covers nearly 400 commands. - -As an example comparison, here's the output of the `shadow` version of `useradd --help`: - - -``` - -b, --base-dir BASE_DIR       base directory for home - -c, --comment COMMENT         GECOS field of the new account - -d, --home-dir HOME_DIR       home directory of the new account - -D, --defaults                print or change the default config - -e, --expiredate EXPIRE_DATE  expiration date of the new account - -f, --inactive INACTIVE       password inactivity - -g, --gid GROUP               name or ID of the primary group - -G, --groups GROUPS           list of supplementary groups - -h, --help                    display this help message and exit - -k, --skel SKEL_DIR           alternative skeleton dir - -K, --key KEY=VALUE           override /etc/login.defs - -l, --no-log-init             do not add the user to the lastlog - -m, --create-home             create the user's home directory - -M, --no-create-home          do not create the user's home directory - -N, --no-user-group           do not create a group with the user's name - -o, --non-unique              allow users with non-unique UIDs - -p, --password PASSWORD       encrypted password of the new account - -r, --system                  create a system account - -R, --root CHROOT_DIR         directory to chroot into - -s, --shell SHELL             login shell of the new account - -u, --uid UID                 user ID of the new account - -U, --user-group              create a group with the same name as a user -``` - -And here's the BusyBox version of the same command: - - -``` - -h DIR    Home directory - -g GECOS  GECOS field - -s SHELL  Login shell - -G GRP    Group - -S            Create a system user - -D            Don't assign a password - -H            Don't create home directory - -u UID    User id - -k SKEL   Skeleton directory (/etc/skel) -``` - -Whether or not this difference is a feature or a limitation depends on whether you prefer to have 20 options or ten options in your commands. For some users and use-cases, BusyBox's minimalism provides just enough for what needs to be done. For others, it's a good minimal environment to have as a fallback or as a foundation for installing more robust tools like [Bash][12], [Zsh][13], GNU [Awk][14], and so on. - -### Installing BusyBox - -On Linux, you can install BusyBox using your package manager. For example, on Fedora and similar: - - -``` -`$ sudo dnf install busybox` -``` - -On Debian and derivatives: - - -``` -`$ sudo apt install busybox` -``` - -On macOS, use [MacPorts][15] or [Homebrew][16]. On Windows, use [Chocolatey][17]. - -You can set BusyBox as your shell using the `chsh --shell` command, followed by the path to the BusyBox `sh` application. I keep BusyBox in `/lib64`, but its location depends on where your distribution installed it. - - -``` -$ which busybox -/lib64/busybox/busybox -$ chsh --shell /lib64/busybox/sh -``` - -Replacing all common commands wholesale with BusyBox is a little more complex, because most distributions are "hard-wired" to look to specific packages for specific commands. In other words, while it's technically possible to replace `init` with BusyBox's `init`, your package manager may refuse to allow you to remove the package containing `init` for fear of you causing your system to become non-bootable. There are some distributions built upon BusyBox, so starting fresh is probably the easiest way to experience a system built around BusyBox. - -### Try BusyBox - -You don't have to change your shell to BusyBox permanently just to try it. You can launch a BusyBox shell from your current shell: - - -``` -$ busybox sh -~ $ -``` - -Your system still has the non-BusyBox versions of commands installed, though, so to experience BusyBox's tools, you must issue commands as arguments to the `busybox` executable: - - -``` -~ $ busybox echo $0 -sh -~ $ busybox ls --help -BusyBox vX.YY.Z (2021-08-25 07:31:48 NZST) multi-call binary. - -Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]... - -List directory contents - - -1  One column output - -a  Include entries that start with . - -A  Like -a, but exclude . and .. - -x  List by lines -[...] -``` - -For the "full" BusyBox experience, you can create symlinks to `busybox` for each command. This is easier than it sounds, as long as you use a [for-loop][18]: - - -``` -$ mkdir bbx -$ for i in $(bbx --list); do \ -ln -s /path/to/busybox bbx/$i \ -done -``` - -Add your directory of symlinks at the _start_ of your [path][19], and launch BusyBox: - - -``` -`$ PATH=$(pwd)/bbx:$PATH bbx/sh` -``` - -### Get busy - -BusyBox is a fun project and an example of just how _minimal_ computing can be. Whether you use BusyBox as a lightweight environment for an [ancient computer][20] [you've rescued][21], as the userland for an [embedded device][22], to trial a new init system, or just as a curiosity, it can be fun reacquainting yourself with old familiar, yet somehow new, commands. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/8/what-busybox - -作者:[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/bash_command_line.png?itok=k4z94W2U (bash logo on green background) -[2]: https://opensource.com/article/21/8/navigate-linux-directories -[3]: https://opensource.com/article/18/5/how-kill-process-stop-program-linux -[4]: https://opensource.com/article/19/7/master-ls-command -[5]: https://opensource.com/article/19/8/moving-files-linux-depth -[6]: https://opensource.com/article/19/2/getting-started-cat-command -[7]: https://www.busybox.net -[8]: https://opensource.com/article/20/4/systemd -[9]: https://opensource.com/article/21/3/rtos-embedded-development -[10]: https://opensource.com/article/17/9/what-edge-computing -[11]: https://opensource.com/article/21/3/iot-measure-raspberry-pi -[12]: https://opensource.com/article/20/4/bash-sysadmins-ebook -[13]: https://opensource.com/article/19/9/getting-started-zsh -[14]: https://opensource.com/article/20/9/awk-ebook -[15]: https://opensource.com/article/20/11/macports -[16]: https://opensource.com/article/20/6/homebrew-mac -[17]: https://opensource.com/article/20/3/chocolatey -[18]: https://opensource.com/article/19/10/programming-bash-loops -[19]: https://opensource.com/article/17/6/set-path-linux -[20]: https://opensource.com/article/20/2/restore-old-computer-linux -[21]: https://opensource.com/article/19/7/how-make-old-computer-useful-again -[22]: https://opensource.com/article/20/6/open-source-rtos diff --git a/translated/tech/20210907 How to use BusyBox on Linux.md b/translated/tech/20210907 How to use BusyBox on Linux.md new file mode 100644 index 0000000000..3d32336fdd --- /dev/null +++ b/translated/tech/20210907 How to use BusyBox on Linux.md @@ -0,0 +1,181 @@ +[#]: subject: "How to use BusyBox on Linux" +[#]: via: "https://opensource.com/article/21/8/what-busybox" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +如何在 Linux 上使用 BusyBox +====== + +> BusyBox 是一个开源(GPL)项目,提供了近 400 个常用命令的简单实现。 + +![绿色背景上的bash标志][1] + +我们很容易认为 Linux 的命令是理所当然的。当你安装 Linux 时,它们与系统捆绑在一起,而我们常常不问为什么它们会在那里。一些基本的命令,如 [cd][2]、[kill][3] 和 echo,并不总是独立的应用程序,而是实际上内置于你的 shell 中。其他如 [ls][4]、[mv][5] 和 [cat][6] 是核心工具包(通常是 GNU `coreutils`)的一部分。但在开源的世界里,总是有一些替代品,其中最有趣的是 [BusyBox][7]。 + +### Linux 中的 BusyBox 简介 + +BusyBox 是一个开源(GPL)项目,提供近 400 个常用命令的简单实现,包括 `ls`、`mv`、`ln`、`mkdir`、`more`、`ps`、`gzip`、`bzip2`、`tar` 和 `grep`。它还包含了编程语言 `awk`、流编辑器 `sed`、文件系统检查工具 `fsck`、`rpm` 和 `dpkg` 软件包管理器,当然还有一个可以方便的访问所有这些命令的 shell(`sh`)。简而言之,它包含了所有 POSIX 系统需要的基本命令,以执行常见的系统维护任务以及许多用户和管理任务。 + +事实上,它甚至包含一个 `init` 命令,可以作为 PID 1 启动,以作为所有其它系统服务的父进程。换句话说,BusyBox 可以作为 [systemd][8]、OpenRC、sinit、init 和其他初始化系统的替代品。 + +BusyBox 非常小。作为一个可执行文件,它不到 1MB,所以它在 [嵌入式][9]、[边缘计算][10] 和 [物联网][11] 领域很受欢迎,因为这些场景的存储空间是很宝贵的。在容器和云计算的世界里,它作为精简的 Linux 容器镜像的基础镜像也很受欢迎。 + +### 极简主义 + +BusyBox 的部分魅力在于它的极简主义。它的所有命令都被编译到一个二进制文件里(`busybox'),它的手册只有 81 页(根据我对 `man` 送到 `pr` 管道的计算),但它涵盖了近 400 条命令。 + +作为一个例子的比较,这是 “原版” 的 `useradd —help` 的输出: + +``` + -b, --base-dir BASE_DIR       base directory for home + -c, --comment COMMENT         GECOS field of the new account + -d, --home-dir HOME_DIR       home directory of the new account + -D, --defaults                print or change the default config + -e, --expiredate EXPIRE_DATE  expiration date of the new account + -f, --inactive INACTIVE       password inactivity + -g, --gid GROUP               name or ID of the primary group + -G, --groups GROUPS           list of supplementary groups + -h, --help                    display this help message and exit + -k, --skel SKEL_DIR           alternative skeleton dir + -K, --key KEY=VALUE           override /etc/login.defs + -l, --no-log-init             do not add the user to the lastlog + -m, --create-home             create the user's home directory + -M, --no-create-home          do not create the user's home directory + -N, --no-user-group           do not create a group with the user's name + -o, --non-unique              allow users with non-unique UIDs + -p, --password PASSWORD       encrypted password of the new account + -r, --system                  create a system account + -R, --root CHROOT_DIR         directory to chroot into + -s, --shell SHELL             login shell of the new account + -u, --uid UID                 user ID of the new account + -U, --user-group              create a group with the same name as a user +``` + +而这是是同一命令的 BusyBox 版本: + +``` + -h DIR    Home directory + -g GECOS  GECOS field + -s SHELL  Login shell + -G GRP    Group + -S            Create a system user + -D            Don't assign a password + -H            Don't create home directory + -u UID    User id + -k SKEL   Skeleton directory (/etc/skel) +``` + +这种差异是一种特性还是一种限制,取决于你是喜欢你的命令拥有 20 个选项还是 10 个选项。对于一些用户和某些用例来说,BusyBox 的极简主义刚刚满足所需。对于其他人来说,它是一个很好的最小化环境,可以作为一个后备工具,或者作为安装更强大的工具的基础,比如 [Bash][12]、[Zsh][13]、GNU [Awk][14] 等等。 + +### 安装 BusyBox + +在 Linux 上,你可以使用你的软件包管理器安装 BusyBox。例如,在 Fedora 及类似发行版: + +``` +$ sudo dnf install busybox +``` + +在 Debian 及其衍生版: + +``` +$ sudo apt install busybox +``` + +在 MacOS 上,可以使用 [MacPorts][15] 或 [Homebrew][16]。在 Windows 上,可以使用 [Chocolatey][17]。 + +你可以将 BusyBox 设置为你的 shell,使用 `chsh —shell` 命令,然后再加上 BusyBox `sh` 应用程序的路径。我把 BusyBox 放在 `/lib64` 中,但它的位置取决于你的发行版的安装位置。 + +``` +$ which busybox +/lib64/busybox/busybox +$ chsh --shell /lib64/busybox/sh +``` + +用 BusyBox 全盘替换所有常见的命令要复杂一些,因为大多数发行版都是“硬接线”,会在特定的软件包寻找特定的命令。换句话说,虽然技术上可以用 BusyBox 的 `init` 替换系统的 `init`,但你的软件包管理器可能会拒绝让你删除包含 `init` 的软件包,以免你担心删除会导致系统无法启动。有一些发行版是建立在 BusyBox 之上的,所以从新环境开始可能是体验 BusyBox 系统的最简单方法。 + +### 试试 BusyBox + +你不必为了尝试 BusyBox 而将你的 shell 永久改为 BusyBox。你可以从你当前的 shell 中启动一个 BusyBox shell。 + +``` +$ busybox sh +~ $ +``` + +不过你的系统仍然有安装的非 BusyBox 版本的命令,所以要体验 BusyBox 的工具,你必须把命令作为参数发给 `busybox` 可执行文件: + +``` +~ $ busybox echo $0 +sh +~ $ busybox ls --help +BusyBox vX.YY.Z (2021-08-25 07:31:48 NZST) multi-call binary. + +Usage: ls [-1AaCxdLHRFplinshrSXvctu] [-w WIDTH] [FILE]... + +List directory contents + + -1  One column output + -a  Include entries that start with . + -A  Like -a, but exclude . and .. + -x  List by lines +[...] +``` + +为了获得“完整”的 BusyBox 体验,你可以为每个命令创建一个 `busybox` 的符号链接。这很容易,只要你使用 [for 循环][18] 就行: + +``` +$ mkdir bbx +$ for i in $(bbx --list); do \ + ln -s /path/to/busybox bbx/$i \ +done +``` + +在你的 [路径][19] 的 _开头_ 添加这个符号链接目录,并启动 BusyBox: + +``` +$ PATH=$(pwd)/bbx:$PATH bbx/sh +``` + +### 用起来 + +BusyBox 是一个有趣的项目,也是一个可以实现 _极简_ 计算的例子。无论你是把 BusyBox 作为 [你唤醒的][21] [古老的计算机][20] 的轻量级环境,还是作为 [嵌入式设备][22] 的用户界面,抑或试用一个新的初始化系统,就算是为了好奇,让自己重新认识那些熟悉而又陌生的命令,都会很有意思。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/8/what-busybox + +作者:[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/lead-images/bash_command_line.png?itok=k4z94W2U (bash logo on green background) +[2]: https://opensource.com/article/21/8/navigate-linux-directories +[3]: https://opensource.com/article/18/5/how-kill-process-stop-program-linux +[4]: https://opensource.com/article/19/7/master-ls-command +[5]: https://opensource.com/article/19/8/moving-files-linux-depth +[6]: https://opensource.com/article/19/2/getting-started-cat-command +[7]: https://www.busybox.net +[8]: https://opensource.com/article/20/4/systemd +[9]: https://opensource.com/article/21/3/rtos-embedded-development +[10]: https://opensource.com/article/17/9/what-edge-computing +[11]: https://opensource.com/article/21/3/iot-measure-raspberry-pi +[12]: https://opensource.com/article/20/4/bash-sysadmins-ebook +[13]: https://opensource.com/article/19/9/getting-started-zsh +[14]: https://opensource.com/article/20/9/awk-ebook +[15]: https://opensource.com/article/20/11/macports +[16]: https://opensource.com/article/20/6/homebrew-mac +[17]: https://opensource.com/article/20/3/chocolatey +[18]: https://opensource.com/article/19/10/programming-bash-loops +[19]: https://opensource.com/article/17/6/set-path-linux +[20]: https://opensource.com/article/20/2/restore-old-computer-linux +[21]: https://opensource.com/article/19/7/how-make-old-computer-useful-again +[22]: https://opensource.com/article/20/6/open-source-rtos From c4b67e0c2587a37765dbf1c39c4da3d066d4c1c4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 Oct 2021 18:53:24 +0800 Subject: [PATCH 0565/1588] PUB @wxy https://linux.cn/article-13840-1.html --- .../20210907 How to use BusyBox on Linux.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210907 How to use BusyBox on Linux.md (98%) diff --git a/translated/tech/20210907 How to use BusyBox on Linux.md b/published/20210907 How to use BusyBox on Linux.md similarity index 98% rename from translated/tech/20210907 How to use BusyBox on Linux.md rename to published/20210907 How to use BusyBox on Linux.md index 3d32336fdd..66a536bca9 100644 --- a/translated/tech/20210907 How to use BusyBox on Linux.md +++ b/published/20210907 How to use BusyBox on Linux.md @@ -4,15 +4,15 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13840-1.html" 如何在 Linux 上使用 BusyBox ====== > BusyBox 是一个开源(GPL)项目,提供了近 400 个常用命令的简单实现。 -![绿色背景上的bash标志][1] +![](https://img.linux.net.cn/data/attachment/album/202110/01/185208x6ckkmvi0silk3vk.jpg) 我们很容易认为 Linux 的命令是理所当然的。当你安装 Linux 时,它们与系统捆绑在一起,而我们常常不问为什么它们会在那里。一些基本的命令,如 [cd][2]、[kill][3] 和 echo,并不总是独立的应用程序,而是实际上内置于你的 shell 中。其他如 [ls][4]、[mv][5] 和 [cat][6] 是核心工具包(通常是 GNU `coreutils`)的一部分。但在开源的世界里,总是有一些替代品,其中最有趣的是 [BusyBox][7]。 From 60fe8262ce3fa1f4dfca84cb5864d90285f8a32a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 1 Oct 2021 18:58:17 +0800 Subject: [PATCH 0566/1588] PRF --- published/20210907 How to use BusyBox on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210907 How to use BusyBox on Linux.md b/published/20210907 How to use BusyBox on Linux.md index 66a536bca9..3b2744163a 100644 --- a/published/20210907 How to use BusyBox on Linux.md +++ b/published/20210907 How to use BusyBox on Linux.md @@ -26,7 +26,7 @@ BusyBox 非常小。作为一个可执行文件,它不到 1MB,所以它在 [ ### 极简主义 -BusyBox 的部分魅力在于它的极简主义。它的所有命令都被编译到一个二进制文件里(`busybox'),它的手册只有 81 页(根据我对 `man` 送到 `pr` 管道的计算),但它涵盖了近 400 条命令。 +BusyBox 的部分魅力在于它的极简主义。它的所有命令都被编译到一个二进制文件里(`busybox`),它的手册只有 81 页(根据我对 `man` 送到 `pr` 管道的计算),但它涵盖了近 400 条命令。 作为一个例子的比较,这是 “原版” 的 `useradd —help` 的输出: From aefccfd5c919479359c97e46d9fe833d1aecad75 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 2 Oct 2021 05:02:47 +0800 Subject: [PATCH 0567/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211001?= =?UTF-8?q?=208=20reasons=20why=20I=20learned=20Core=20Java?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211001 8 reasons why I learned Core Java.md --- ...11001 8 reasons why I learned Core Java.md | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 sources/tech/20211001 8 reasons why I learned Core Java.md diff --git a/sources/tech/20211001 8 reasons why I learned Core Java.md b/sources/tech/20211001 8 reasons why I learned Core Java.md new file mode 100644 index 0000000000..d42e020c30 --- /dev/null +++ b/sources/tech/20211001 8 reasons why I learned Core Java.md @@ -0,0 +1,99 @@ +[#]: subject: "8 reasons why I learned Core Java" +[#]: via: "https://opensource.com/article/21/10/why-i-learned-core-java" +[#]: author: "Shantam Sahai https://opensource.com/users/shantam-sahai" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +8 reasons why I learned Core Java +====== +Understanding Core Java gives you a significant advantage when learning +all of the related tools built on top of it. +![Learning and studying technology is the key to success][1] + +Computer programming, also known as *coding *for short, is not about which language you use. It's about developing programming logic and learning to think like a programmer. The language you start with should be the one that helps you the most in this endeavor. So you have to ask yourself the question: "What do you want to do as a programmer?" + +For example, if you want to work on Android app development, video game development, desktop GUI applications, or just general software development, I think learning Java is an excellent option. It's the language I chose, and it has made a whole world of programming available to me. In India, where I live, the average salary of a Java programmer is around 5.9 Lakhs per Annum (LPA) (it can be as high as 10 LPA, depending on your experience.) + +Java is a vast language, though, with lots of frameworks and variants to choose from. _Core Java_ is the term the tech industry has developed to refer to the central components of the Java language—the thing that people use to write the frameworks and has developed the cottage industry around Java. I believe that Core Java is one of the most powerful skills you can acquire because understanding the basics of Java gives you a significant advantage when learning all of the related tools built on top of it. + +Here are the top eight reasons I chose Core Java, and I think you should too: + +### 1\. Java is an evolving programming language + +Java has significant corporate backing, but the most important component in Java development is [OpenJDK][2]—the open source Java Development Kit. With a mission statement to promote and maintain open source, open innovation, and open standards, the OpenJDK community is committed to improving and maintaining an open source implementation of Java and its toolchain. + +Innovations and conveniences get added with every release, making Java easier for developers and users alike. For instance, it was just in Java 11 that they added the ability to run .java files. Now, all it takes to run a single-file Java application is the `java` command, no compilation required: + + +``` +$ java ./hello.java + +Hello world +``` + +You can use Java to program applications for the web, mobile, or desktop. It's a highly versatile language. It has many interesting features such as dynamic coding, multiple security features, platform-independent characteristics, and network-centric design. + +### 2\. Java anchors android app development + +You can use Java to create Android apps. The Android market is enormous, and the demand for mobile programmers is only growing. Even if you're not interested in becoming a professional app developer, the ability to customize your mobile experience is a powerful one, and Java makes it possible. + +And it's easier than you might think! Learning Core Java makes it easy for you to pick up Android development kits or frameworks that export to mobile platforms, like [Processing][3]. + +### 3\. Rich APIs make Java easy to use + +Java's API (Application Programming Interface) includes classes, packages, interfaces, and more. Java has mainly three types of APIs:  + + * Official Java Core APIs + * Optimal official Java APIs + * Unofficial APIs + + + +An API makes programming easier because you can construct applications without knowing their inside implementations. In my experience, many companies prefer Java over other options because of the strength of the Java API. + +### 4\. Open source libraries + +There are nearly endless open source libraries for Java, including Maven, Guava, Apache Commons, Jhipster, and much more. You can copy, study, and share resources from these libraries. They make programming more accessible, faster, cheaper, and more educational. + +### 5\. Java has reliable development tools + +Java has some of my favorite IDEs (Integrated Development Environments), including [Eclipse][4], [NetBeans][5], [BlueJ][6], and IntelliJ IDEA. They provide debugging, syntax highlighting, code completion, language support, automated refactoring, and more. In short, IDEs play an essential role in Java's success and in your success as you learn it! + +### 6\. Demand for Java developers in India + +Giants like Google, Netflix, and Instagram use Java for backend development. Indian companies are actively looking to hire Java programmers to develop Android apps, new APIs, and microservices on the cloud. This demand translates to more job opportunities. + +### 7\. The Java programming community is huge + +The community of Java programmers is vast. It ranges from groups of beginners to experts. I have found the community to be welcoming and helpful when you ask for support. Most importantly, I've learned tons of new tricks by involving myself in online discussions. Being a part of the community has been a vital way for me to keep up with the latest trends, learn more about the language, and keep up with development. + +### 8\. Java is platform-independent + +The fact that Java is platform-independent makes it highly valuable. Java source code is compiled down to bitcode, which runs on the Java Virtual Machine (JVM). Any platform running a JVM (and all the major platforms do) can run your Java application. You write once and run everywhere! And this isn't just a theoretical position: Java has actually achieved this. You can write Java on whatever platform you develop on and deliver it to all your target platforms. + +There are many resources online to learn Java, including a [cheat sheet][7] here on Opensource.com. There's also a great [online Java course][8] available in Hindi for free. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/why-i-learned-core-java + +作者:[Shantam Sahai][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/shantam-sahai +[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://developer.ibm.com/components/open-jdk/ +[3]: http://processing.org/ +[4]: https://opensource.com/article/20/12/eclipse +[5]: https://opensource.com/article/20/12/netbeans +[6]: https://opensource.com/article/20/7/ide-java#bluej +[7]: https://opensource.com/downloads/java-cheat-sheet +[8]: https://www.learnvern.com/course/core-java-programming-tutorial From 978f7180dde4bf10a0d2b7ea44537d7ea2934511 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 2 Oct 2021 05:03:19 +0800 Subject: [PATCH 0568/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211001?= =?UTF-8?q?=20/e/=20cloud=20is=20a=20deGoogled=20Alternative=20to=20Google?= =?UTF-8?q?=20Drive?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md --- ...a deGoogled Alternative to Google Drive.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/news/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md diff --git a/sources/news/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md b/sources/news/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md new file mode 100644 index 0000000000..5d83613107 --- /dev/null +++ b/sources/news/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md @@ -0,0 +1,77 @@ +[#]: subject: "/e/ cloud is a deGoogled Alternative to Google Drive" +[#]: via: "https://news.itsfoss.com/e-cloud/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +/e/ cloud is a deGoogled Alternative to Google Drive +====== + +Google Drive is a popular cloud storage service that works great for the most part. + +However, it may not be the most private option out there. So, to take total control of your data, the best way is to spin up a [Nextcloud][1] instance and store your essential data while getting access to other collaboration tools. + +While that sounds good to hear, not everyone can put the effort to create and maintain their instance. This is where ecloud comes in—built by the same team behind [**/e/ OS**, the de-googled Android operating system][2]. + +ecloud pitches itself primarily as a new private alternative to Google Drive and offers a mailbox to replace Gmail. + +### /e/ cloud: Nextcloud & OnlyOffice With Mailbox + +![][3] + +When you create an /e/ account, it gives you a private email address **[xyz@e.email][4]** + +And, along with the email address, you get **1 GB** free ecloud storage space and a collaboration platform powered by Nextcloud and OnlyOffice at its core. + +So, if you want to utilize Nextcloud and OnlyOffice to replace Google’s suite of tools without setting it up all yourself, /e/ cloud can be a compelling privacy-centric choice. + +![][5] + +In addition to the file storage and document support with OnlyOffice, you can also use a calendar, store notes, and add tasks. + +Hence, it can also be a decent privacy-focused collaboration platform that you can use for free. + +If you want more storage, you can upgrade your subscription to a paid plan where you opt for 20 to 1 TB of storage as required with monthly/yearly billing options. The pricing plans start as low as **$3/month**. + +Undoubtedly, it should be a seamless experience if you are using /e/ OS on your phone or a /e/ smartphone. + +But, you can also use it on any device using third-party mail clients and the Nextcloud mobile app. + +[Sign Up for /e/ cloud][6] + +### Wrapping Up + +Considering it is relatively new, several features are planned to be added that include end-to-end encryption, migration from Google Drive, and more. + +You can sign up for an account and try it out free. + +_What do you think about a mainstream solution like /e/ cloud that uses Nextcloud at its core to help you manage/store files securely in addition to email and collaboration services?_ + +#### 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/e-cloud/ + +作者:[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/nextcloud/ +[2]: https://itsfoss.com/e-os-review/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: mailto:xyz@e.email +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://e.foundation/e-email-invite/ From 52b0483a4c2780eb75b584815806b8da9fd27a11 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 2 Oct 2021 08:21:11 +0800 Subject: [PATCH 0569/1588] Rename sources/news/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md to sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md --- ...211001 -e- cloud is a deGoogled Alternative to Google Drive.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => tech}/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md (100%) diff --git a/sources/news/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md b/sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md similarity index 100% rename from sources/news/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md rename to sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md From 90fe9d83ac52b38fc69919e5c35189863eada15a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 Oct 2021 08:27:39 +0800 Subject: [PATCH 0570/1588] APL --- sources/tech/20210930 Make YAML as easy as it looks.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210930 Make YAML as easy as it looks.md b/sources/tech/20210930 Make YAML as easy as it looks.md index 511963cc0f..dda8b4d1a5 100644 --- a/sources/tech/20210930 Make YAML as easy as it looks.md +++ b/sources/tech/20210930 Make YAML as easy as it looks.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/yaml-cheat-sheet" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 9c9a16f1b6ccf3156a1a73443e5c503de40f993d Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 Oct 2021 10:00:29 +0800 Subject: [PATCH 0571/1588] TSL&PRF --- .../20210930 Make YAML as easy as it looks.md | 160 ------------------ .../20210930 Make YAML as easy as it looks.md | 154 +++++++++++++++++ 2 files changed, 154 insertions(+), 160 deletions(-) delete mode 100644 sources/tech/20210930 Make YAML as easy as it looks.md create mode 100644 translated/tech/20210930 Make YAML as easy as it looks.md diff --git a/sources/tech/20210930 Make YAML as easy as it looks.md b/sources/tech/20210930 Make YAML as easy as it looks.md deleted file mode 100644 index dda8b4d1a5..0000000000 --- a/sources/tech/20210930 Make YAML as easy as it looks.md +++ /dev/null @@ -1,160 +0,0 @@ -[#]: subject: "Make YAML as easy as it looks" -[#]: via: "https://opensource.com/article/21/9/yaml-cheat-sheet" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Make YAML as easy as it looks -====== -YAML looks simple so why is it so hard to write? Learn the two secrets -to YAML success. -![Person using a laptop][1] - -If you've ever tried writing YAML, you may have been initially pleased with how apparently easy it looks. At first glance, the YAML that's often used for configuration files, Ansible playbooks, and flat-file databases looks more or less as intuitive as a shopping list. However, there's a lot of nuance in YAML's structure, and it conceals a dangerous secret: YAML is actually a highly precise, structured, and surprisingly strict language. The good news is that you only need to understand two things to know how YAML works. - -The truth about YAML is that there are only two data structures in YAML: sequences and mappings. Those are two fancy names to represent what you'll discover are very familiar concepts. This article explains them both, and more importantly, how they work together to make YAML a powerful way to represent the data you care about. - -### What's a YAML sequence? - -A YAML sequence is a list. In its simplest form, there's one item per line, with each line beginning in a dash and a space. - -Here's an example: - - -``` -\--- -\- Linux -\- BSD -\- Illumos -``` - -Different languages have different ways of representing this kind of data. In Python, for example, the same list can be written as `['Linux', 'BSD', 'Illumos']`. When you write a list in real life, for instance before you go shopping for groceries, you probably approximate a YAML sequence. - -### What's a YAML mapping? - -A YAML mapping is a key term combined with a definition for that term. A mapping in other languages is called a _key and value pair_ or a _dictionary_. - -Here's an example: - - -``` -\--- -Kernel: Linux -CPU: AMD -RAM: '16 GB' -``` - -Different languages have different ways of representing this kind of data. [In Python][2], for example, the same data can be written as `{"Kernel": "Linux", "CPU": "AMD", "RAM": "16 GB"}`. In real life, you might use this kind of structure to plan, for instance, a game night with friends. One friend signs up to bring snacks, another signs up to bring a deck of cards, another a board game, and so on. - -### Combing sequences and mappings - -You now know the syntax of YAML. Sequences and mappings are the only two kinds of building blocks available in YAML, and anything you want to represent in YAML can be placed into either a sequence or a mapping. - -Or both! - -Yes, sequences and mappings can be combined and nested, which is one reason YAML often looks intuitive and yet feels complex all at once. There are only four possible combinations, though, and once you learn to see them, YAML starts to feel as easy as it looks. - -### Mapping sequences - -When you want one key term to have many values, you use a mapping of sequences. That is, you start with a mapping (keys), but you insert a list for the values: - - -``` -\--- -Linux: - - Fedora -  - Slackware -BSD: - - FreeBSD -  - NetBSD -``` - -In this sample code, **Linux** is the first key, and its value is a sequence, which contains **Fedora** and **Slackware**. The second key is **BSD**, which has a value of a sequence containing **FreeBSD** and **NetBSD**. - -### Mapping of mappings - -When you want one key term to have values that themselves have both keys and values, you use a mapping of mappings. That is, you start with a mapping (keys), but you insert another mapping for the values. - -This one can be deceptive, but it reveals why special terminology is used in YAML: just because you create a list of mappings doesn't mean you've created a _sequence_. Here's a mapping of mappings: - - -``` -\--- -Desktop: -  CPU: RISC-V -  RAM: '32 GB' -Laptop: -  CPU: AMD -  RAM: '16 GB' -``` - -To most people, that looks like a list. And technically, it is a list. But it's important to recognize that it is _not_ a YAML sequence. It's a mapping, which contains mappings. Being a near-expert in YAML, you can spot the difference from the distinct lack of dashes. - -Of all the constructs in Ansible playbooks, I find that this one tricks people the most. As humans, we like lists, and when we see a data structure that _is literally_ a list, most people are compelled to translate that into a YAML sequence. But in YAML, although a sequence is a list, a list is not always a sequence. - -### Sequence of sequences - -Just as you can nest mappings, you can nest a sequence into a sequence: - - -``` -\--- -\- [Linux, FreeBSD, Illumos] -\- [YAML, XML, JSON] -``` - -This is probably the least common data structure I encounter in real-world uses of YAML, but sometimes you need a list of lists. - -### Sequence of mappings - -You can also create a sequence that contains mappings. This isn't terribly common for the way humans sort data, but for computers it can be an important construct. - -Here's an example: - - -``` -\--- -- -  CPU: AMD -  RAM: '16 GB' -- -  CPU: Intel -  RAM: '16 GB' -``` - -As YAML, this is possibly the least intuitive syntax. I find it clearer when rendered in Python: - - -``` -`[{"CPU": "AMD", "RAM": "16 GB"}, {"CPU": "Intel", "RAM": "16 GB"}]` -``` - -The square brackets represent a list structure, and the list contains two dictionaries. Each dictionary contains key and value pairs. - -### Build better YAML - -Now you know the two components of YAML, and how they can be combined to represent complex  data structures. The question is: what will you build with YAML? - -I use YAML, as many people do, for Ansible playbooks. I've also used it as an easy configuration format, as a character sheet for D&D, as a representation of a directory structure required for project organization, and much more. As long as you get comfortable with the concepts of sequences and mappings, you might find YAML an easy format to write, read, and (provided the right library) to parse. - -If you're finding yourself working with YAML often, download our **[YAML cheat sheet][3]** to help you visualize the basic data structures and their combinations and to help you remember some of the extra syntactical conventions available to you. With a little bit of practice, you'll find YAML really is as easy as it looks! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/yaml-cheat-sheet - -作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://opensource.com/article/21/3/dictionary-values-python -[3]: https://opensource.com/downloads/yaml-cheat-sheet diff --git a/translated/tech/20210930 Make YAML as easy as it looks.md b/translated/tech/20210930 Make YAML as easy as it looks.md new file mode 100644 index 0000000000..2025fb1b7c --- /dev/null +++ b/translated/tech/20210930 Make YAML as easy as it looks.md @@ -0,0 +1,154 @@ +[#]: subject: "Make YAML as easy as it looks" +[#]: via: "https://opensource.com/article/21/9/yaml-cheat-sheet" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +让 YAML 变得像它看起来一样简单 +====== + +> YAML 看起来很简单,为什么它这么难写呢?了解成功使用 YAML 的两个秘诀。 + +![使用笔记本电脑的人][1] + +如果你曾经尝试过写 YAML,你可能一开始会对它看起来很容易感到高兴。乍一看,经常用于配置文件、Ansible 剧本和普通文件数据库的 YAML 看起来就像购物清单一样直观。然而,YAML 的结构中有很多细微的差别,它隐藏着一个危险的秘密:YAML 实际上是一种高度精确、结构化和令人惊讶的严格语言。好消息是,你只需要了解两件事就可以知道 YAML 的工作原理。 + +关于 YAML 的真相是,YAML 中只有两种数据结构:序列sequence映射mapping。这是两个花哨的名字,你会发现它代表了你非常熟悉的概念。这篇文章解释了这两种结构,更重要的是,介绍了它们是如何协同工作,使 YAML 成为表示你所关心的数据的强大方式。 + +### YAML 序列 + +YAML 序列是一个列表。在其最简单的形式中,每行有一个项目,每行以破折号和空格开始。 + +下面是一个例子: + +``` +--- +- Linux +- BSD +- Illumos +``` + +不同的语言有不同的方式来表示这种数据。例如,在 Python 中,同一个列表可以写成 `['Linux', 'BSD', 'Illumos']`。当你在现实生活中写一个列表时,例如在你去买菜之前,你写的可能近似于 YAML 序列。 + +### YAML 映射 + +YAML 映射是一个关键术语与该术语的定义相结合。在其他语言中,映射被称为“键值对”或“词典”。 + +这里有一个例子: + +``` +--- +Kernel: Linux +CPU: AMD +RAM: '16 GB' +``` + +不同的语言有不同的方式来表示这种数据。[在 Python 中][2],例如,同样的数据可以写成 `{"Kernel": "Linux", "CPU": "AMD", "RAM": "16 GB"}`。在现实生活中,你可能会使用这种结构来计划,例如,与朋友的游戏之夜。一个朋友报名带零食,另一个报名带一副牌,另一个报名带一个棋盘游戏,等等。 + +### 组合序列和映射 + +你现在知道 YAML 的语法了。序列和映射是 YAML 中仅有的两种构件,你想在 YAML 中表示的任何东西都可以放在序列或映射中。 + +或者同时使用这二者! + +是的,序列和映射可以被组合和嵌套,这就是 YAML 看起来很直观,但同时又感觉很复杂的原因之一。不过,只有四种可能的组合,一旦你学会如何看它们,YAML 就会觉得像它看起来一样简单。 + +### 序列的映射 + +当你想让一个键项有许多值时,你可以使用一个序列的映射。也就是说,你从一个映射(键)开始,但是给值一个列表: + +``` +--- +Linux: +  - Fedora +  - Slackware +BSD: +  - FreeBSD +  - NetBSD +``` + +在这个示例代码中,`Linux` 是第一个键,它的值是一个序列,其中包含 `Fedora` 和 `Slackware`。第二个键是 `BSD`,它的值是一个序列,包含 `FreeBSD` 和 `NetBSD`。 + +### 映射的映射 + +当你想让一个键项的值中既有键又有值时,你可以使用映射的映射。也就是说,你从一个映射(键)开始,但是给值另一个映射。 + +这可能有点欺骗性,但它揭示了 YAML 中使用特定术语的原因:因为你只不过是创建了一个映射的列表,并不意味着你创建了一个序列。这里是一个映射的映射: + +``` +--- +Desktop: +  CPU: RISC-V +  RAM: '32 GB' +Laptop: +  CPU: AMD +  RAM: '16 GB' +``` + +对大多数人来说,这看起来像一个列表。而且从技术上讲,它是一个列表。但重要的是要认识到,它不是 YAML 序列。它是一个映射,其中包含映射。作为半个 YAML 专家,你可以从明显缺少破折号的地方看出区别。 + +在 Ansible 剧本的所有结构中,我发现这个结构最容易欺骗人。作为人类,我们喜欢列表,当我们看到一个数据结构 _在字面上_ 是列表时,大多数人会把它当成 YAML 序列。但是在 YAML 中,虽然序列是列表,但是列表并不总是序列。 + +### 序列的序列 + +就像你可以嵌套映射一样,你可以将一个序列嵌套到一个序列中: + +``` +--- +- [Linux, FreeBSD, Illumos] +- [YAML, XML, JSON] +``` + +这可能是我在 YAML 的实际使用中遇到的最不常见的数据结构,但有时你需要一个列表的列表。 + +### 映射的序列 + +你也可以创建一个包含映射的序列。对于人类排序数据的方式来说,这并不太常见,但对于计算机来说,这可能是一个重要的结构。 + +这里有一个例子: + +``` +--- +- +  CPU: AMD +  RAM: '16 GB' +- +  CPU: Intel +  RAM: '16 GB' +``` + +对于 YAML,这可能是最不直观的语法。我发现它在 Python 中呈现时更清晰: + +``` +[{"CPU": "AMD", "RAM": "16 GB"}, {"CPU": "Intel", "RAM": "16 GB"}] +``` + +方括号代表一个列表结构,这个列表包含两个字典。每个字典都包含键值对。 + +### 构建更好的 YAML + +现在你知道了 YAML 的两个组成部分,以及它们如何被组合起来以表示复杂的数据结构。问题是:你要用 YAML 构建什么? + +和很多人一样,我也使用 YAML 来编写 Ansible 剧本。我还用它作为一种简单的配置格式、作为 D&D 的角色表、表示项目组织所需的目录结构,等等。只要你能适应序列和映射的概念,你会发现 YAML 是一种很容易编写、阅读和(如果有合适的库)解析的格式。 + +如果你发现自己经常使用 YAML,请下载我们的 [YAML 速查表][3],以帮助你直观地了解基本数据结构及其组合,并帮助你记住一些额外的语法约定。通过一点点的练习,你会发现 YAML 真的和它看起来一样简单! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/yaml-cheat-sheet + +作者:[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/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) +[2]: https://opensource.com/article/21/3/dictionary-values-python +[3]: https://opensource.com/downloads/yaml-cheat-sheet From aab4d9a268d2713249baca1ad95798f96a25c80b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 Oct 2021 10:19:24 +0800 Subject: [PATCH 0572/1588] PUB @wxy https://linux.cn/article-13842-1.html --- .../20210930 Make YAML as easy as it looks.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210930 Make YAML as easy as it looks.md (97%) diff --git a/translated/tech/20210930 Make YAML as easy as it looks.md b/published/20210930 Make YAML as easy as it looks.md similarity index 97% rename from translated/tech/20210930 Make YAML as easy as it looks.md rename to published/20210930 Make YAML as easy as it looks.md index 2025fb1b7c..88330932b8 100644 --- a/translated/tech/20210930 Make YAML as easy as it looks.md +++ b/published/20210930 Make YAML as easy as it looks.md @@ -4,15 +4,15 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13842-1.html" 让 YAML 变得像它看起来一样简单 ====== > YAML 看起来很简单,为什么它这么难写呢?了解成功使用 YAML 的两个秘诀。 -![使用笔记本电脑的人][1] +![](https://img.linux.net.cn/data/attachment/album/202110/02/101824shamurmpvldpu29a.jpg) 如果你曾经尝试过写 YAML,你可能一开始会对它看起来很容易感到高兴。乍一看,经常用于配置文件、Ansible 剧本和普通文件数据库的 YAML 看起来就像购物清单一样直观。然而,YAML 的结构中有很多细微的差别,它隐藏着一个危险的秘密:YAML 实际上是一种高度精确、结构化和令人惊讶的严格语言。好消息是,你只需要了解两件事就可以知道 YAML 的工作原理。 From 163196cb1d78757e99425fd15d2a720fbabc9bbe Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 Oct 2021 10:30:25 +0800 Subject: [PATCH 0573/1588] APL --- sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md b/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md index c4b80e2b99..cecb9a1fda 100644 --- a/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md +++ b/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md @@ -2,7 +2,7 @@ [#]: via: (https://fedoramagazine.org/run-github-actions-on-fedora-coreos/) [#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 21406713afd59db5c4413a51d4dfb008106996f4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 Oct 2021 10:49:53 +0800 Subject: [PATCH 0574/1588] TSL --- ...721 Run GitHub Actions on Fedora CoreOS.md | 52 +++++++++---------- 1 file changed, 24 insertions(+), 28 deletions(-) rename {sources => translated}/tech/20210721 Run GitHub Actions on Fedora CoreOS.md (58%) diff --git a/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md b/translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md similarity index 58% rename from sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md rename to translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md index cecb9a1fda..9badd6a20e 100644 --- a/sources/tech/20210721 Run GitHub Actions on Fedora CoreOS.md +++ b/translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md @@ -7,26 +7,24 @@ [#]: publisher: ( ) [#]: url: ( ) -Run GitHub Actions on Fedora CoreOS +在 Fedora CoreOS 上运行 GitHub Actions ====== ![][1] -[United Artists][2], Public domain, via Wikimedia Commons +[GitHub Actions][3] 是一项为快速建立持续集成和交付(CI/CD)工作流程而提供的服务。这些工作流程在被称为“运行器runner”的主机上运行。GitHub 提供的 [托管运行器][4] 的操作系统的选择是有限的(Windows Server、Ubuntu、MacOS)。 -[GitHub Actions][3] is a service provided to quickly setup continuous integration and delivery (CI/CD) workflows . These workflows run on hosts called _runners_. GitHub provides [hosted runners][4] with a limited set of operating system choice (Windows Server, Ubuntu, MacOS). +另一个选择是使用 [自我托管][5] 运行器,这让仓库管理员对运行器有更多控制。自我托管的运行程序是专门为某个版本库或组织服务的。下面的文章介绍了使用 Fedora CoreOS 配置自我托管运行程序的步骤。 -Another option is to use [self-hosted][5] runners which gives the repository administrator more control on the runners. Self-hosted runners are dedicated to a repository or organization. The following article goes through the steps of configuring self-hosted runners using Fedora CoreOS. +### 入门 -### Getting Started +Fedora CoreOS 是一个精简的操作系统,旨在便于大规模的部署和维护。该操作系统会自动更新,并默认提供运行容器所需的工具。由于这些原因,Fedora CoreOS 是运行 CI/CD 工作流程的一个极佳选择。 -Fedora CoreOS is a minimalist operating system designed to be easy to deploy and maintain at scale. The operating system will automaticaly update and provide, by default, the tools needed to run containers. For all of these reasons, Fedora CoreOS is a great choice to consider for running CI/CD workflows. +配置和配备 Fedora CoreOS 机器的第一步是生成一个 [Ignition][6] 文件。[Butane][7] 允许你使用更友好的格式(YAML)生成 Ignition 文件。 -The first step to configure and provision a Fedora CoreOS machine is to generate an [Ignition][6] file. [Butane][7] allows you to generate Ignition’s file using a friendlier format (YAML). +#### 配置一个 Fedora CoreOS 运行器 -#### Configure a Fedora CoreOS runner - -To execute GitHub actions on Fedora CoreOS, the host needs the binaries and scripts used to register and run the runner. Download the binaries and scripts from the [actions runner project][8] and deploy under _/usr/local/sbin/actions-runner_. +要在 Fedora CoreOS 上执行 GitHub Actions,托管主机需要用于注册和运行该运行器的二进制文件和脚本。从 [Actions 运行器项目][8] 下载二进制文件和脚本,并部署在 `/usr/local/sbin/actions-runner` 下。 ``` version: "1.3.0" @@ -51,13 +49,13 @@ storage: name: core ``` -#### Registration and Removal token +#### 注册和删除令牌 -Configuring runners for a project requires a “token”. This prevents registering or removing self-hosted runners from projects without the correct permissions. Tokens provided by Github have a one hour expiration time. If the runner restarts after this time it will require a new registration token. +为一个项目配置运行程序需要一个“令牌token”。这可以防止在没有正确权限的情况下从项目中注册或删除自我托管的运行器。GitHub 提供的令牌有一个小时的过期时间。如果运行器在这个时间之后重新启动,它将需要一个新的注册令牌。 -The token can be problematic, in particular with Fedora CoreOS automatic updates. The update process expects that the host will restart at least once every couple weeks after receiving new data. +该令牌可能有问题,特别是在 Fedora CoreOS 自动更新时。更新过程希望托管主机在收到新数据后至少每隔几周重启一次。 -Luckily, it is possible to use GitHub REST API to obtain these tokens and automatically configure the runner every time the host restarts. The following _manage-runner.sh_ script uses the APIs to retrieve a token, remove any runner already configured and register the runner with a new token. +幸运的是,可以使用 GitHub REST API 来获取这些令牌,并在主机每次重启时自动配置运行器。下面的 `manage-runner.sh` 脚本使用 API 来获取令牌,删除任何已经配置好的运行器,并用新的令牌注册运行器。 ``` #!/bin/bash @@ -75,7 +73,7 @@ REGISTRATION_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: /usr/local/sbin/actions-runner/config.sh --url https://github.com/cverna/fcos-actions-runner --token ${REGISTRATION_TOKEN} --labels fcos --unattended ``` -The script above uses a few environment variables that contain a GitHub username and a [Personal Access Token][9] used to authenticate the REST API requests. The Personal Access Token requires the repo permissions in order to successfully retrieve the runner registration and removal tokens. The token is security sensitive so it is better to store it in a different file with stricter permissions. In this example that file is _actions-runner_. +上面的脚本使用了一些环境变量,包含 GitHub 用户名和用于验证 REST API 请求的 [个人访问令牌][9]Personal Access Token。个人访问令牌需要存储库权限,以便成功检索运行者注册和移除令牌。该令牌是安全敏感的,所以最好将其存储在一个具有更严格权限的不同文件中。在这个例子中,这个文件是 `actions-runner`。 ``` GITHUB_USER= @@ -83,7 +81,7 @@ GITHUB_REPO= GITHUB_TOKEN= ``` -Following is the Butane snippet that creates these two files – _manage-runner.sh_ and _actions-runner_. +以下是创建这两个文件 `manage-runner.sh` 和 `actions-runner` 的 Butane 片段。 ``` - path: /usr/local/sbin/actions-runner/manage-runner.sh @@ -104,9 +102,9 @@ Following is the Butane snippet that creates these two files – _manage-runner. name: core ``` -### Running Actions on Fedora CoreOS +### 在 Fedora CoreOS 上运行 Actions -Finally, create the systemd services that will configure and start the runner. Define the services in the Butane configuration file. +最后,创建用于配置和启动运行器的 systemd 服务。在 Butane 配置文件中定义这些服务。 ``` systemd: @@ -142,21 +140,19 @@ systemd: WantedBy=multi-user.target ``` -This creates two services, _github-runner-configure.service_ (running once when the host has finished booting) and _github-runner.service_ (running the Actions runner binaries and waiting for new CI/CD jobs). +这将创建两个服务:`github-runner-configure.service`(在主机启动完成后运行一次)和 `github-runner.service`(运行 Actions 运行器二进制文件并等待新的 CI/CD 作业)。 -Now that the Butane configuration is complete, generate an Ignition file out of it and provision a Fedora CoreOS Actions runner. +现在 Butane 配置已经完成,从中生成一个 Ignition 文件并配备一个Fedora CoreOS Actions 运行器。 ``` $ podman run -i --rm -v $PWD:/code:z --workdir /code quay.io/coreos/butane:release --pretty --strict --files-dir /code config.yaml -o config.ignition ``` -Once the Ignition file is generated, it can be used to provision a runner on the platforms where Fedora CoreOS is [available][10]. +一旦 Ignition 文件生成,它就可以用来在 [支持][10] Fedora CoreOS 的平台上配备一个运行器。 -> [Getting started with Fedora CoreOS][11] +### 配置一个 Action 来使用一个自我托管的运行器 -### Configure an Action to use a self-hosted runner - -The following test Action workflow will test the FCOS self-hosted worker. Create the following file in your git repository _.github/workflows/main.yml_ +下面的测试 Action 工作流程将测试 FCOS 的自我托管的工作者。在你的 git 存储库中创建以下文件 `.github/workflows/main.yml`。 ``` # This is a basic workflow to help you get started with Actions @@ -188,9 +184,9 @@ jobs: run: podman run --rm fedora-minimal:34 echo Hello World ! ``` -Note that the _runs-on_ configuration is set up to use a runner with the label _fcos_. +请注意,`runs-on` 的配置被设置为使用标签为 `fcos` 的运行器。 -The code presented in this article is available [here][12]. +本文介绍的代码可以在 [这里][12] 中找到。 -------------------------------------------------------------------------------- @@ -198,7 +194,7 @@ via: https://fedoramagazine.org/run-github-actions-on-fedora-coreos/ 作者:[Clément Verna][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[wxy](https://github.com/wxy) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 69b9f405a9cafddf06823146be45253291e1bd7a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 Oct 2021 12:08:29 +0800 Subject: [PATCH 0575/1588] APL --- ...10702 Creating a PKGBUILD to Make Packages for Arch Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md b/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md index c3078135ca..d54af819ff 100644 --- a/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md +++ b/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/create-pkgbuild/) [#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From c62d8c9363538061639eb572402db85d81135bd1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 Oct 2021 13:00:57 +0800 Subject: [PATCH 0576/1588] TSL&PRF --- ...KGBUILD to Make Packages for Arch Linux.md | 271 ------------------ ...KGBUILD to Make Packages for Arch Linux.md | 261 +++++++++++++++++ 2 files changed, 261 insertions(+), 271 deletions(-) delete mode 100644 sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md create mode 100644 translated/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md diff --git a/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md b/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md deleted file mode 100644 index d54af819ff..0000000000 --- a/sources/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md +++ /dev/null @@ -1,271 +0,0 @@ -[#]: subject: (Creating a PKGBUILD to Make Packages for Arch Linux) -[#]: via: (https://itsfoss.com/create-pkgbuild/) -[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Creating a PKGBUILD to Make Packages for Arch Linux -====== - -PKGBUILD files are how packages are built and created for Arch Linux and its derivatives such as Manjaro. - -You may have even come across them a bit yourself if you’ve ever used the [AUR][1], Arch Linux’s user-curated repository of PKGBUILDs. - -But how exactly do you go from a PKGBUILD to an installable package? What exactly is going on between the two, and how can you make them for your own packages? You’ll learn them in this article. - -### PKGBUILD basics - -For those who are familiar with Bash or other shells, you’ll be delighted to know, if you didn’t already, that a PKGBUILD is pretty much just a shell script with some variables. - -PKGBUILD files consist of variables and functions, all of which are used to define the package itself, and how to build it. - -To create a package from a PKGBUILD, the makepkg command line utility is used. After obtaining a PKGBUILD, you simply run `makepkg` inside the directory containing the PKGBUILD, and voila, you have an installable package! - -![][2] - -In this tutorial, you’ll be going over the package I just made, which prints “Hello World!” when run: - -![][3] - -### Getting set up - -To follow along with this tutorial, you need to create a couple of files. - -First, you need to make a file called **PKGBUILD**. If it wasn’t already made clear, this will serve as the “recipe” for building your package. - -The other file you’ll need to make is a file called **hello-world.sh**. I’ll explain its purpose a bit later. - -You can create both of these files with a single command as well. - -``` -touch PKGBUILD hello-world.sh -``` - -You can check that the files were created with the ls command: - -![][4] - -And you’re ready to go! - -### Setting up your PKGBUILD file - -**Instead of having you copy paste the whole file, I’ll be going over entering every line with you, so you can better understand the purpose of everything that’s happening. If you don’t prefer to learn this way, I’d highly recommend the** [Arch Wiki article][5] _**on creating packages for Arch Linux.**_ - -_**This article also doesn’t go over every single option you can set in a PKGBUILD, but rather some commonly used ones so you can get going as quickly as possible.**_ - -With that out of the way, open up your text editor, and let’s get straight into it! - -#### pkgname - -First things first, the pkgname variable. This is what defines the name of your package when installing, and how [Arch Linux’s package manager pacman][6] keeps track of the package. - -The format of this variable (and some others) takes the form of variable=value, with the variable name on the left, the value of the variable on the right, separated by an equals sign. - -To set the package name, enter the following into the PKGBUILD: - -``` -pkgname="hello-world" -``` - - * To set a different package name, replace `hello-world` with the name of the package. - * This doesn’t set the command used to run the program. That’s handled a bit below in the `package()` section. - - - -#### pkgver - -As is stated in the variable name itself, this sets the version of your package (i.e. 1.0.0). This is useful when a user updates their system, as setting a higher version will result in the user being prompted for an upgrade. - -To set, enter the following into the PKGBUILD (after the previous line): - -``` -pkgver="1.0.0" -``` - -#### pkgrel - -This is related to the pkgver variable, and isn’t normally important to know about. Like the pkgver variable though, it will notify users for upgrades if it’s moved to a higher number. - -It serves for any changes that require the pkgver to remain the same, such as any changes to the PKGBUILD itself. This would be useful if you’ve created a PKGBUILD for a program you use (and want to keep the version the same as the package’s), and you need to fix a bug in the PKGBUILD itself. - -To set the variable, enter the following in the PKGBUILD: - -``` -pkgver="1" -``` - -This variable should **always** start at 1, and then move up one at a time. When the **pkgver** itself moves up, this can (and should) be reset to 1, as the pkgver itself will notify users that upgrades are available. - -#### pkgdesc - -This will set the description of the package, which is used to help better identify the package. - -To set it, just put the description inside of quotation marks: - -``` -pkgdesc="Hello world in your terminal!" -``` - -#### arch - -This variable sets the [architecture][7] the package is compatible with. It’s fine if you don’t understand what an architecture is, as it’s pretty much useless in most cases. - -Regardless, makepkg still needs it to be set so it knows the package is compatible with our system. - -This variable supports setting multiple values, so makepkg requires a different syntax as shown below. - -To set it, enter the following in the PKGBUILD: - -``` -arch=("x86_64") -``` - -If you were to set multiple values for this, you would separate each value with a space and quotation marks like so: **arch=(“x86_x64” “arm”)** - -#### depends - -This lists all of the packages that our package needs to function. Like **arch**, it can also contain multiple values, and thus must use the parenthesis syntax. - -Since our package won’t have any dependencies, we don’t have to enter this field in the PKGBUILD. If our package did have dependencies however, we’d just use the same syntax as **arch**. - -#### optdepends - -This lists packages that aren’t required to function, but that are needed for extra functionality. - -This follows the same syntax as **depends**. - -#### conflicts - -This tells pacman what packages would cause our package to act up or behave in a way we wouldn’t want. - -Any package listed here would be uninstalled before ours is installed. - -This follows the same syntax as **depends** as well. - -#### license - -This defines the [software license][8] that your program is licensed under. The [Arch Wiki][9] has some info if you need help choosing a license. Setting this to `custom` will work if you don’t know what to set this to. - -This takes the same syntax as **arch** and **depends**: - -``` -license=("custom") -``` - -#### source - -This is how makepkg knows what files to use to build our package. This can contain a variety of different kinds of sources, including local files and URLs. - -When adding local files, enter the file’s name relative to the PKGBUILD i.e. consider the following directory layout: - -``` -PKGBUILD -file.txt -src/file.sh -``` - -If you wanted to include **file.sh** in our PKGBUILD, you would enter **src/file.sh** as its name. - -When entering URLs, you simply enter the full URL, i.e. . - -Your package only needs the hello-world.sh file, and since it’s in the same directory as the PKGBUILD, you just type its name as the value for **source**. - -This variable also uses the same syntax as **arch** and **depends**: - -``` -source=("hello-world.sh") -``` - -#### sha512sums - -This is used to verify that the files in **source** haven’t been modified or downloaded incorrectly. Information on obtaining the values for this can be found in the [Arch Wiki article on PKGBUILDs][10]. - -If you’d rather just not set this (or you just don’t need to, i.e. for local files), you can just enter SKIP for every file in the **source** variable: - -``` -sha512sums=("SKIP") -``` - -#### package() - -This is the last, and most important part to actually making our package. It’s important to know two variables when working with this: - - * **${srcdir}**: This is where makepkg puts the files in the **source** variable. This is the directory where you can interact with the files, and do any other needed modification to the files. - - - * ${pkgdir}: This is where we place the files that will be installed on our system. -The folder structure for ${pkgdir} is set up as if it was on an actual system (i.e. ${pkgdir}/usr/bin/hello-world would create the file /usr/bin/hello-world when installing with pacman. - - - -package() contains a list of commands used create a package. - -So, if (hypothetically) you needed to have a file that reads Linux is superior to Windows at /usr/share/motto.txt, you would run something like this: - -``` -package() { - mkdir -p "${pkgdir}/usr/share" - echo "Linux is superior to Windows" | tee "${pkgdir}/usr/share/motto.txt" -} -``` - -A few notes on the above command: - - * ${pkgdir} contains **no** directories inside it at first. If you skipped the [mkdir command][11], tee would output an error saying the directory doesn’t exist. - - - * When specifying directories, **always** prepend them with the **${pkgdir}** or **${srcdir}** variable. Entering something like /usr/share/motto.txt without such would point to the literal directory /usr/share/motto.txt on your currently running system. - - - -For your PKGBUILD, you’re going to place the file hello-world.sh at /usr/bin/hello-world on your target system. You’ll also be making the file say “Hello to you!” when ran. - -To do so, enter the following into your PKGBUILD: - -``` -package() { - echo 'Hello to you!' > "${srcdir}/hello-world.sh" - mkdir -p "${pkgdir}/usr/bin" - cp "${srcdir}/hello-world.sh" "${pkgdir}/usr/bin/hello-world" - chmod +x "${pkgdir}/usr/bin/hello-world" -} -``` - -And you’re done! **Build and install the package with makepkg -si**, and then run hello-world in your terminal to see its output. - -![][12] - -### Wrapping Up - -And just like that, you have made your first PKGBUILD! You’re on your way to making actual packages for yourself, and maybe even the AUR. - -Got any questions, or something just not working right? Feel free to post it in the comment section below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/create-pkgbuild/ - -作者:[Hunter Wittenborn][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/hunter/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/aur-arch-linux/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/image.png?resize=748%2C689&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/image-2.png?resize=682%2C260&ssl=1 -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/image-3.png?resize=682%2C265&ssl=1 -[5]: https://wiki.archlinux.org/title/Creating_packages -[6]: https://itsfoss.com/pacman-command/ -[7]: https://www.quora.com/What-is-CPU-architecture -[8]: https://en.wikipedia.org/wiki/Software_license -[9]: https://wiki.archlinux.org/title/PKGBUILD#license -[10]: https://wiki.archlinux.org/title/PKGBUILD#Integrity -[11]: https://linuxhandbook.com/mkdir-command/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/image-1.png?resize=561%2C281&ssl=1 diff --git a/translated/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md b/translated/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md new file mode 100644 index 0000000000..ae8fb9ccb0 --- /dev/null +++ b/translated/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md @@ -0,0 +1,261 @@ +[#]: subject: (Creating a PKGBUILD to Make Packages for Arch Linux) +[#]: via: (https://itsfoss.com/create-pkgbuild/) +[#]: author: (Hunter Wittenborn https://itsfoss.com/author/hunter/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +Arch Linux 软件包制作入门 +====== + +`PKGBUILD` 文件是为 Arch Linux 及其衍生版(如 Manjaro)构建和创建软件包的方式。 + +如果你曾经使用过 [AUR][1](即 Arch Linux 的用户维护的 `PKGBUILD` 存储库),你甚至可能也遇到过它们。 + +但是,到底是如何从 `PKGBUILD` 到可安装软件包的呢?这两者之间到底发生了什么,如何把自己的软件制作成软件包呢?你将在这篇文章中了解这些。 + +### PKGBUILD 基础知识 + +对于那些熟悉 Bash 或其他 shell 的人来说,你可能知道,`PKGBUILD` 就是一个带有一些变量的 shell 脚本。 + +`PKGBUILD` 文件由变量和函数组成,所有这些都是用来定义软件包本身,以及如何构建它。 + +为了从 `PKGBUILD` 中创建一个软件包,需要使用 `makepkg` 命令行工具。在获得 `PKGBUILD` 文件后,你只需在包含 `PKGBUILD` 的目录中运行 `makepkg',就可以得到一个可安装的软件包了。 + +![][2] + +在本教程中,你将会看到我刚刚制作的软件包,它在运行时打印出 “Hello World!”。 + +![][3] + +### 准备 + +为了继续学习本教程,你需要创建几个文件。 + +首先,你需要创建一个名为 `PKGBUILD` 的文件,它将作为构建你的软件包的“配方”。 + +你需要做的另一个文件是一个叫 `hello-world.sh` 的文件。我稍后会解释它的用途。 + +你也可以用一个命令来创建这两个文件: + +``` +touch PKGBUILD hello-world.sh +``` + +你可以用 `ls` 命令检查这些文件是否被创建。 + +![][4] + +然后你就可以开始了! + +### 设置你的 PKGBUILD 文件 + +我不会让你复制粘贴整个文件,而是和你一起键入每一行,这样你就能更好地理解每一行的目的。如果你不喜欢这种学习方式,我强烈推荐 [Arch 维基][5] 中为 Arch Linux 创建软件包的文章。 + +这篇文章也没有介绍 `PKGBUILD` 中可以设置的每一个选项,只是介绍了一些常用的选项,以便你能尽快上手。 + +说完了这些,打开你的文本编辑器,让我们直接进入正题吧。 + +#### pkgname + +首先是 `pkgname` 变量。这是安装时定义软件包名称的东西,也是 [Arch Linux 的软件包管理器 pacman][6] 跟踪软件包的方式。 + +这个变量(以及其他一些变量)的格式是 `variable=value`,变量名在左边,变量的值在右边,用等号隔开。 + +要设置包的名称,请在 `PKGBUILD` 中输入以下内容: + +``` +pkgname="hello-world" +``` + + * 要设置一个不同的软件包名称,用你的软件包的名称替换 `hello-world`。 + * 这并不设置用于运行程序的命令,这将在下面的 `package()` 部分中处理。 + +#### pkgver + +正如变量名称本身所述,它设置了你的软件包的版本(即 `1.0.0`)。这在用户更新他们的系统时很有用,因为设置更高的版本会提示用户升级。 + +要设置版本号,请在 `PKGBUILD` 中输入以下内容(在前一行之后): + +``` +pkgver="1.0.0" +``` + +#### pkgrel + +这与 `pkgver` 变量有关,通常不需要知道。不过和 `pkgver` 变量一样,如果它被换到一个更高的数字,就将通知用户进行升级。 + +它适用于任何需要保持 `pkgver` 不变的情况下,例如 `PKGBUILD` 本身发生了变化。如果你为一个你使用的程序创建了一个 `PKGBUILD`(并希望保持软件包的版本相同),而你需要修复 `PKGBUILD` 本身的一个错误,这将是非常有用的。 + +要设置这个变量,请在 `PKGBUILD` 中输入以下内容: + +``` +pkgver="1" +``` + +这个变量应该 **总是** 从 `1` 开始,然后一次一次地向上移动。当 `pkgver` 本身向上移动时,这个变量可以(也应该)重置为 `1`,因为 `pkgver` 本身会通知用户升级。 + +#### pkgdesc + +这将设置软件包的描述,用于帮助更好地识别该软件包。 + +要设置它,只需将描述放在引号内: + +``` +pkgdesc="Hello world in your terminal!" +``` + +#### arch + +这个变量设置软件包所兼容的 [硬件架构][7]。如果你不明白什么是架构,那也没关系,因为在大多数情况下,这个变量几乎是无用的。 + +无论如何,`makepkg` 仍然需要设置它,这样它就知道这个软件包与我们的系统是兼容的。 + +这个变量支持设置多个值,所以 `makepkg` 需要一个不同的语法,如下所示。 + +要设置它,请在 `PKGBUILD` 中输入以下内容: + +``` +arch=("x86_64") +``` + +如果你要设置多个值,需要用空格和引号分隔每个值,像这样。`arch=(“x86_x64" "arm")`。 + +#### depends + +这列出了提供了我们的软件包所需功能的所有软件包。与 `arch` 一样,它也可以包含多个值,因此必须使用括号语法。 + +由于我们的软件包没有任何依赖关系,所以我们不需要在 `PKGBUILD` 中输入这个字段。然而,如果我们的软件包有依赖关系,我们就会使用与 `arch` 相同的语法。 + +#### optdepends + +这里列出了那些并不是提供所需功能而是额外功能的软件包。 + +这与 `depends` 的语法相同。 + +#### conflicts + +这告诉 `pacman` 哪些软件包会导致我们的软件包出现问题,或者以我们不希望的方式行事。 + +这里列出的任何软件包都会在我们的软件包被安装之前被卸载。 + +这与 `depends` 的语法相同。 + +#### license + +这定义了你的程序所采用的 [软件许可证][8]。如果你需要帮助你选择一个许可证,[Arch 维基][9] 提供了一些信息。如果你不知道该怎么设置,将其设置为 `custom` 也可以。 + +这与 `arch` 和 `depends` 的语法相同: + +``` +license=("custom") +``` + +#### source + +这就是 `makepkg` 如何知道要用什么文件来构建我们的软件包。它可以包含各种不同类型的源,包括本地文件和 URL。 + +在添加本地文件时,要输入相对于 `PKGBUILD` 文件的文件路径,比如以下目录布局: + +``` +PKGBUILD +file.txt +src/file.sh +``` + +如果你想在我们的 `PKGBUILD` 中包括 `file.sh`,你需要输入 `src/file.sh` 作为其名称。 + +当输入 URL 时,你只需输入完整的 URL,即 `https://mirrors.creativecommons.org/presskit/logos/cc.logo.large.png`。 + +你的这个软件包只需要 `hello-world.sh` 文件,由于它和 `PKGBUILD` 在同一个目录中,你只需输入它的名字作为 `source` 的值。 + +这个变量也使用与 `arch` 和 `depends` 相同的语法: + +``` +source=("hello-world.sh") +``` + +#### sha512sums + +这是用来验证 `source` 中的文件没有被修改或下载错误。如何获得这个值的信息可以在 [Arch 维基关于 PKGBUILD 的文章][10] 中找到。 + +如果你宁愿不设置这个(或者你只是不需要,例如对于本地文件),你可以为 `source` 变量中的每个文件输入 `SKIP`: + +``` +sha512sums=("SKIP") +``` + +#### package() + +这是最后一个,也是实际制作我们的包的最重要的部分。在处理这个问题时,知道两个变量很重要。 + + * `${srcdir}`:这是 `makepkg` 放置 `source` 变量中文件的地方。在这个目录中,你可以与这些文件进行交互,并对文件进行任何其他需要的修改。 + * `${pkgdir}`:这是我们放置将被安装在系统中的文件的地方。 +`${pkgdir}` 的文件夹结构是按照实际系统中的情况设置的(例如,使用 `pacman` 安装时,`${pkgdir}/usr/bin/hello-world` 会创建文件 `/usr/bin/hello-world`)。 + +`package()` 包含一个用于创建软件包的命令列表。 + +因此,如果(假设)你需要有个在 `/usr/share/motto.txt` 写着 “Linux is superior to Windows ”的文件,你会运行这样的东西: + +``` +package() { + mkdir -p "${pkgdir}/usr/share" + echo "Linux is superior to Windows" | tee "${pkgdir}/usr/share/motto.txt" +} +``` + +关于上述命令的一些说明: + + * `${pkgdir}` 里面最初是 **不包含** 目录的。如果你跳过了 [mkdir 命令][11],`tee` 会输出一个错误,说这个目录不存在。 + * 在指定目录时,**总是** 在它们前面加上 `${pkgdir}` 或 `${srcdir}` 变量。如果输入 `/usr/share/motto.txt`,就会按照字面意义指向你当前运行的系统中的 `/usr/share/motto.txt`。 + +对于你的 `PKGBUILD`,你将把 `hello-world.sh` 文件放在目标系统的 `/usr/bin/hello-world` 中。你还将使该文件在运行时说 “Hello to you!”。 + +要做到这一点,请在 `PKGBUILD` 中输入以下内容: + +``` +package() { + echo 'Hello to you!' > "${srcdir}/hello-world.sh" + mkdir -p "${pkgdir}/usr/bin" + cp "${srcdir}/hello-world.sh" "${pkgdir}/usr/bin/hello-world" + chmod +x "${pkgdir}/usr/bin/hello-world" +} +``` + +然后就完成了!用 `makepkg -si` 构建和安装软件包,然后在终端运行 `hello-world`,查看其输出。 + +![][12] + +### 总结 + +就这样,你已经制作了你的第一个 `PKGBUILD`!你走在了为自己甚至是为 AUR 制作实际的软件包的路上。 + +有什么问题,或者有什么地方不对吗?请随时在下面的评论区发表。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/create-pkgbuild/ + +作者:[Hunter Wittenborn][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/hunter/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/aur-arch-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/image.png?resize=748%2C689&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/image-2.png?resize=682%2C260&ssl=1 +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/image-3.png?resize=682%2C265&ssl=1 +[5]: https://wiki.archlinux.org/title/Creating_packages +[6]: https://itsfoss.com/pacman-command/ +[7]: https://www.quora.com/What-is-CPU-architecture +[8]: https://en.wikipedia.org/wiki/Software_license +[9]: https://wiki.archlinux.org/title/PKGBUILD#license +[10]: https://wiki.archlinux.org/title/PKGBUILD#Integrity +[11]: https://linuxhandbook.com/mkdir-command/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/06/image-1.png?resize=561%2C281&ssl=1 From d0e0df3b09f33498a976f03c07ae31a36ab4a9d8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 2 Oct 2021 13:09:49 +0800 Subject: [PATCH 0577/1588] PUB @wxy https://linux.cn/article-13843-1.html --- ...2 Creating a PKGBUILD to Make Packages for Arch Linux.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md (98%) diff --git a/translated/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md b/published/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md similarity index 98% rename from translated/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md rename to published/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md index ae8fb9ccb0..1303a2a5ee 100644 --- a/translated/tech/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md +++ b/published/20210702 Creating a PKGBUILD to Make Packages for Arch Linux.md @@ -4,12 +4,14 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13843-1.html) Arch Linux 软件包制作入门 ====== +![](https://img.linux.net.cn/data/attachment/album/202110/02/130702ybexb5tsvkx1xbs1.jpg) + `PKGBUILD` 文件是为 Arch Linux 及其衍生版(如 Manjaro)构建和创建软件包的方式。 如果你曾经使用过 [AUR][1](即 Arch Linux 的用户维护的 `PKGBUILD` 存储库),你甚至可能也遇到过它们。 From f206a892b67bee502baf9c9f4f49d8ba4c7c6fee 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: Sat, 2 Oct 2021 19:28:13 +0800 Subject: [PATCH 0578/1588] Finish translation 20210728 Kernel tracing with trace-cmd.md --- .../20210728 Kernel tracing with trace-cmd.md | 376 ------------------ .../20210728 Kernel tracing with trace-cmd.md | 348 ++++++++++++++++ 2 files changed, 348 insertions(+), 376 deletions(-) delete mode 100644 sources/tech/20210728 Kernel tracing with trace-cmd.md create mode 100644 translated/tech/20210728 Kernel tracing with trace-cmd.md diff --git a/sources/tech/20210728 Kernel tracing with trace-cmd.md b/sources/tech/20210728 Kernel tracing with trace-cmd.md deleted file mode 100644 index cd5b549e40..0000000000 --- a/sources/tech/20210728 Kernel tracing with trace-cmd.md +++ /dev/null @@ -1,376 +0,0 @@ -[#]: subject: (Kernel tracing with trace-cmd) -[#]: via: (https://opensource.com/article/21/7/linux-kernel-trace-cmd) -[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) -[#]: collector: (lujun9972) -[#]: translator: (mengxinayan) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Kernel tracing with trace-cmd -====== -trace-cmd is an easy-to-use, feature-rich utility for tracing Linux -kernel functions. -![Puzzle pieces coming together to form a computer screen][1] - -In my [previous article][2], I explained how to use `ftrace` to trace kernel functions. Using `ftrace` by writing and reading from files can get tedious, so I used a wrapper around it to run commands with options to enable and disable tracing, set filters, view output, clear output, and more. - -The [trace-cmd][3] command is a utility that helps you do just this. In this article, I use `trace-cmd` to perform the same tasks I did in my `ftrace` article. Since I refer back to that article frequently, I recommend you read it before you read this one. - -### Install trace-cmd - -I run the commands in this article as the root user. - -The `ftrace` mechanism is built into the kernel, and you can verify it is enabled with: - - -``` -# mount | grep tracefs -none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) -``` - -However, you need to install the `trace-cmd` utility manually. - - -``` -`# dnf install trace-cmd -y` -``` - -### List available tracers - -When using `ftrace`, you must view a file's contents to see what tracers are available. But with `trace-cmd`, you can get this information with: - - -``` -# trace-cmd list -t -hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop -``` - -### Enable the function tracer - -In my [earlier article][2], I used two tracers, and I'll do the same here. Enable your first tracer, `function`, with: - - -``` -$ trace-cmd start -p function -  plugin 'function' -``` - -### View the trace output - -Once the tracer is enabled, you can view the output by using the `show` arguments. This shows only the first 20 lines to keep the example short (see my earlier article for an explanation of the output): - - -``` -# trace-cmd show | head -20 -## tracer: function -# -# entries-in-buffer/entries-written: 410142/3380032   #P:8 -# -#                                _-----=> irqs-off -#                               / _----=> need-resched -#                              | / _---=> hardirq/softirq -#                              || / _--=> preempt-depth -#                              ||| /     delay -#           TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION -#              | |         |   ||||      |         | -           gdbus-2606    [004] ..s. 10520.538759: __msecs_to_jiffies <-rebalance_domains -           gdbus-2606    [004] ..s. 10520.538760: load_balance <-rebalance_domains -           gdbus-2606    [004] ..s. 10520.538761: idle_cpu <-load_balance -           gdbus-2606    [004] ..s. 10520.538762: group_balance_cpu <-load_balance -           gdbus-2606    [004] ..s. 10520.538762: find_busiest_group <-load_balance -           gdbus-2606    [004] ..s. 10520.538763: update_group_capacity <-update_sd_lb_stats.constprop.0 -           gdbus-2606    [004] ..s. 10520.538763: __msecs_to_jiffies <-update_group_capacity -           gdbus-2606    [004] ..s. 10520.538765: idle_cpu <-update_sd_lb_stats.constprop.0 -           gdbus-2606    [004] ..s. 10520.538766: __msecs_to_jiffies <-rebalance_domains -``` - -### Stop tracing and clear the buffer - -Tracing continues to run in the background, and you can keep viewing the output using `show`. - -To stop tracing, run `trace-cmd` with the `stop` argument: - - -``` -`# trace-cmd stop` -``` - -To clear the buffer, run it with the `clear` argument: - - -``` -`# trace-cmd clear` -``` - -### Enable the function_graph tracer - -Enable the second tracer, `function_graph`, by running: - - -``` -# trace-cmd start -p function_graph -  plugin 'function_graph' -``` - -Once again, view the output using the `show` argument. As expected, the output is slightly different from the first trace output. This time it includes a `function calls` chain: - - -``` -# trace-cmd show | head -20 -## tracer: function_graph -# -# CPU  DURATION                  FUNCTION CALLS -# |     |   |                     |   |   |   | - 4)   0.079 us    |        } /* rcu_all_qs */ - 4)   0.327 us    |      } /* __cond_resched */ - 4)   0.081 us    |      rcu_read_unlock_strict(); - 4)               |      __cond_resched() { - 4)   0.078 us    |        rcu_all_qs(); - 4)   0.243 us    |      } - 4)   0.080 us    |      rcu_read_unlock_strict(); - 4)               |      __cond_resched() { - 4)   0.078 us    |        rcu_all_qs(); - 4)   0.241 us    |      } - 4)   0.080 us    |      rcu_read_unlock_strict(); - 4)               |      __cond_resched() { - 4)   0.079 us    |        rcu_all_qs(); - 4)   0.235 us    |      } - 4)   0.095 us    |      rcu_read_unlock_strict(); - 4)               |      __cond_resched() { -``` - -Use the `stop` and `clear` commands to stop tracing and clear the buffer: - - -``` -# trace-cmd stop -# trace-cmd clear -``` - -### Tweak tracing to increase depth - -If you want to see more depth in the function calls, you can tweak the tracer: - - -``` -# trace-cmd start -p function_graph --max-graph-depth 5 -  plugin 'function_graph' -``` - -Now when you compare this output with what you saw before, you should see more nested function calls: - - -``` -# trace-cmd show | head -20 -## tracer: function_graph -# -# CPU  DURATION                  FUNCTION CALLS -# |     |   |                     |   |   |   | - 6)               |        __fget_light() { - 6)   0.804 us    |          __fget_files(); - 6)   2.708 us    |        } - 6)   3.650 us    |      } /* __fdget */ - 6)   0.547 us    |      eventfd_poll(); - 6)   0.535 us    |      fput(); - 6)               |      __fdget() { - 6)               |        __fget_light() { - 6)   0.946 us    |          __fget_files(); - 6)   1.895 us    |        } - 6)   2.849 us    |      } - 6)               |      sock_poll() { - 6)   0.651 us    |        unix_poll(); - 6)   1.905 us    |      } - 6)   0.475 us    |      fput(); - 6)               |      __fdget() { -``` - -### Learn available functions to trace - -If you want to trace only certain functions and ignore the rest, you need to know the exact function names. You can get them with the `list` argument followed by `-f`. This example searches for the common kernel function `kmalloc`, which is used to allocate memory in the kernel: - - -``` -# trace-cmd list -f | grep kmalloc -bpf_map_kmalloc_node -mempool_kmalloc -__traceiter_kmalloc -__traceiter_kmalloc_node -kmalloc_slab -kmalloc_order -kmalloc_order_trace -kmalloc_large_node -__kmalloc -__kmalloc_track_caller -__kmalloc_node -__kmalloc_node_track_caller -[...] -``` - -Here's the total count of functions available on my test system: - - -``` -# trace-cmd list -f | wc -l -63165 -``` - -### Trace kernel module-related functions - -You can also trace functions related to a specific kernel module. Imagine you want to trace `kvm` kernel module-related functions. Ensure the module is loaded: - - -``` -# lsmod  | grep kvm_intel -kvm_intel             335872  0 -kvm                   987136  1 kvm_intel -``` - -Run `trace-cmd` again with the `list` argument, and from the output, `grep` for lines that end in `]`. This will filter out the kernel modules. Then `grep` the kernel module `kvm_intel`, and you should see all the functions related to that kernel module: - - -``` -# trace-cmd list -f | grep ]$  | grep kvm_intel -vmx_can_emulate_instruction [kvm_intel] -vmx_update_emulated_instruction [kvm_intel] -vmx_setup_uret_msr [kvm_intel] -vmx_set_identity_map_addr [kvm_intel] -handle_machine_check [kvm_intel] -handle_triple_fault [kvm_intel] -vmx_patch_hypercall [kvm_intel] - -[...] - -vmx_dump_dtsel [kvm_intel] -vmx_dump_sel [kvm_intel] -``` - -### Trace specific functions - -Now that you know how to find functions of interest, put that knowledge to work with an example. As in the earlier article, try to trace filesystem-related functions. The filesystem I had on my test system was `ext4`. - -This procedure is slightly different; instead of `start`, you run the command with the `record` argument followed by the "pattern" of the functions you want to trace. You also need to specify the tracer you want; in this case, that's `function_graph`. The command continues recording the trace until you stop it with **Ctrl+C**. So after a few seconds, hit **Ctrl+C** to stop tracing: - - -``` -# trace-cmd list -f | grep ^ext4_ - -# trace-cmd record -l ext4_* -p function_graph -  plugin 'function_graph' -Hit Ctrl^C to stop recording -^C -CPU0 data recorded at offset=0x856000 -    8192 bytes in size -[...] -``` - -### View the recorded trace - -To view the trace you recorded earlier, run the command with the `report` argument. From the output, it's clear that the filter worked, and you see only the ext4-related function trace: - - -``` -# trace-cmd report | head -20 -[...] -cpus=8 -       trace-cmd-12697 [000] 11303.928103: funcgraph_entry:                   |  ext4_show_options() { -       trace-cmd-12697 [000] 11303.928104: funcgraph_entry:        0.187 us   |    ext4_get_dummy_policy(); -       trace-cmd-12697 [000] 11303.928105: funcgraph_exit:         1.583 us   |  } -       trace-cmd-12697 [000] 11303.928122: funcgraph_entry:                   |  ext4_create() { -       trace-cmd-12697 [000] 11303.928122: funcgraph_entry:                   |    ext4_alloc_inode() { -       trace-cmd-12697 [000] 11303.928123: funcgraph_entry:        0.101 us   |      ext4_es_init_tree(); -       trace-cmd-12697 [000] 11303.928123: funcgraph_entry:        0.083 us   |      ext4_init_pending_tree(); -       trace-cmd-12697 [000] 11303.928123: funcgraph_entry:        0.141 us   |      ext4_fc_init_inode(); -       trace-cmd-12697 [000] 11303.928123: funcgraph_exit:         0.931 us   |    } -       trace-cmd-12697 [000] 11303.928124: funcgraph_entry:        0.081 us   |    ext4_get_dummy_policy(); -       trace-cmd-12697 [000] 11303.928124: funcgraph_entry:        0.133 us   |    ext4_get_group_desc(); -       trace-cmd-12697 [000] 11303.928124: funcgraph_entry:        0.115 us   |    ext4_free_inodes_count(); -       trace-cmd-12697 [000] 11303.928124: funcgraph_entry:        0.114 us   |    ext4_get_group_desc(); -``` - -### Trace a specific PID - -Say you want to trace functions related to a specific persistent identifier (PID). Open another terminal and note the PID of the running shell: - - -``` -# echo $$ -10885 -``` - -Run the `record` command again and pass the PID using the `-P` option. This time, let the terminal run (i.e., do not press **Ctrl+C** yet): - - -``` -# trace-cmd record -P 10885 -p function_graph -  plugin 'function_graph' -Hit Ctrl^C to stop recording -``` - -### Run some activity on the shell - -Move back to the other terminal where you had a shell running with a specific PID and run any command, e.g., `ls` to list files: - - -``` -# ls -Temp-9b61f280-fdc1-4512-9211-5c60f764d702 -tracker-extract-3-files.1000 -v8-compile-cache-1000 -[...] -``` - -Move back to the terminal where you enabled tracing and hit **Ctrl+C** to stop tracing: - - -``` -# trace-cmd record -P 10885 -p function_graph -  plugin 'function_graph' -Hit Ctrl^C to stop recording -^C -CPU1 data recorded at offset=0x856000 -    618496 bytes in size -[...] -``` - -In the trace's output, you can see the PID and the Bash shell on the left and the function calls related to it on the right. This can be pretty handy to narrow down your tracing: - - -``` -# trace-cmd report  | head -20 - -cpus=8 -          <idle>-0     [001] 11555.380581: funcgraph_entry:                   |  switch_mm_irqs_off() { -          <idle>-0     [001] 11555.380583: funcgraph_entry:        1.703 us   |    load_new_mm_cr3(); -          <idle>-0     [001] 11555.380586: funcgraph_entry:        0.493 us   |    switch_ldt(); -          <idle>-0     [001] 11555.380587: funcgraph_exit:         7.235 us   |  } -            bash-10885 [001] 11555.380589: funcgraph_entry:        1.046 us   |  finish_task_switch.isra.0(); -            bash-10885 [001] 11555.380591: funcgraph_entry:                   |  __fdget() { -            bash-10885 [001] 11555.380592: funcgraph_entry:        2.036 us   |    __fget_light(); -            bash-10885 [001] 11555.380594: funcgraph_exit:         3.256 us   |  } -            bash-10885 [001] 11555.380595: funcgraph_entry:                   |  tty_poll() { -            bash-10885 [001] 11555.380597: funcgraph_entry:                   |    tty_ldisc_ref_wait() { -            bash-10885 [001] 11555.380598: funcgraph_entry:                   |      ldsem_down_read() { -            bash-10885 [001] 11555.380598: funcgraph_entry:                   |        __cond_resched() { -``` - -### Give it a try - -These brief examples show how using `trace-cmd` instead of the underlying `ftrace` mechanism is both easy to use and rich in features, including many I didn't cover here. To learn more and get better at it, consult its man page and try out its other useful commands. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/7/linux-kernel-trace-cmd - -作者:[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/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) -[2]: https://opensource.com/article/21/7/analyze-linux-kernel-ftrace -[3]: https://lwn.net/Articles/410200/ diff --git a/translated/tech/20210728 Kernel tracing with trace-cmd.md b/translated/tech/20210728 Kernel tracing with trace-cmd.md new file mode 100644 index 0000000000..f2f2633110 --- /dev/null +++ b/translated/tech/20210728 Kernel tracing with trace-cmd.md @@ -0,0 +1,348 @@ +[#]: subject: (Kernel tracing with trace-cmd) +[#]: via: (https://opensource.com/article/21/7/linux-kernel-trace-cmd) +[#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) +[#]: collector: (lujun9972) +[#]: translator: (mengxinayan) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +使用 trace-cmd 追踪内核 +====== +trace-cmd 是一个容易使用且特性众多的,可用来追踪内核函数的命令。 +![Puzzle pieces coming together to form a computer screen][1] + +在 [之前的文章][2] 里,我介绍了如何利用 `ftrace` 来追踪内核函数。通过写入和读出文件来使用 `ftrace` 会变得很枯燥,所以在它周围使用了一个包装器来运行带有选项的命令,以启用和禁用追踪,设置过滤器,查看输出,清除输出等等。 + +[trace-cmd][3] 命令是一个可以帮助你做到这一点的工具。在这篇文章中,我使用 `trace-cmd` 来执行我在 `ftrace` 文章中所做的相同任务。由于会经常参考那篇文章,建议在阅读这篇文章之前先阅读它。 + +### 安装 trace-cmd + +本文中所有的命令都运行在 root 用户下。 + +因为 `ftrace` 机制被内置于内核中,因此你可以使用下面的命令进行验证它是否启用: + +``` +# mount | grep tracefs +none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) +``` + +然而,你需要手动尝试安装 `trace-cmd` 命令: + +``` +# dnf install trace-cmd -y +``` + +### 列出可用的追踪器 + +当使用 `ftrace` 时,你必须查看文件的内容以了解有哪些追踪器可用。但使用 `trace-cmd`,你可以通过以下方式获得这些信息。 + +``` +# trace-cmd list -t +hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop +``` + +### 启用函数(function)追踪器 + +在我之前的文章中,我使用了两个追踪器,在这里我也会这么做。用 `function` 启用你的第一个追踪器。 + +``` +$ trace-cmd start -p function +  plugin 'function' +``` + +### 查看追踪输出 + +一旦追踪器被启用,你可以通过使用 `show` 参数来查看输出。这只显示了前20行,以保持例子的简短(见我之前的文章对输出的解释)。 + +``` +# trace-cmd show | head -20 +## tracer: function +# +# entries-in-buffer/entries-written: 410142/3380032 #P:8 +# +# _-----=> irqs-off +# / _----=> need-resched +# | / _---=> hardirq/softirq +# || / _--=> preempt-depth +# ||| / delay +# TASK-PID CPU# |||| TIMESTAMP FUNCTION +# | | | |||| | | + gdbus-2606 [004] ..s. 10520.538759: __msecs_to_jiffies <-rebalance_domains + gdbus-2606 [004] ..s. 10520.538760: load_balance <-rebalance_domains + gdbus-2606 [004] ..s. 10520.538761: idle_cpu <-load_balance + gdbus-2606 [004] ..s. 10520.538762: group_balance_cpu <-load_balance + gdbus-2606 [004] ..s. 10520.538762: find_busiest_group <-load_balance + gdbus-2606 [004] ..s. 10520.538763: update_group_capacity <-update_sd_lb_stats.constprop.0 + gdbus-2606 [004] ..s. 10520.538763: __msecs_to_jiffies <-update_group_capacity + gdbus-2606 [004] ..s. 10520.538765: idle_cpu <-update_sd_lb_stats.constprop.0 + gdbus-2606 [004] ..s. 10520.538766: __msecs_to_jiffies <-rebalance_domains +``` + +### 停止追踪并清除缓冲区 + +追踪将会在后台继续运行,你可以继续用 `show` 查看输出。 + +要停止追踪,请运行带有 `stop` 参数的 `trace-cmd` 命令。 +``` +# trace-cmd stop +``` +要清除缓冲区,用 `clear` 参数运行它。 +``` +# trace-cmd clear +``` + +### 启用 函数调用图(function_graph) 追踪器 + +运行第二个追踪器,通过 `function_graph` 参数来启用它。 +``` +# trace-cmd start -p function_graph + Plugin 'function_graph' +``` + +再次使用 `show` 参数查看输出。正如预期的那样,输出与第一次追踪输出略有不同。这一次,它包括一个**函数调用**链。 + +``` +# trace-cmd show | head -20 +## tracer: function_graph +# +# CPU DURATION FUNCTION CALLS +# | | | | | | | + 4) 0.079 us | } /* rcu_all_qs */ + 4) 0.327 us | } /* __cond_resched */ + 4) 0.081 us | rcu_read_unlock_strict(); + 4) | __cond_resched() { + 4) 0.078 us | rcu_all_qs(); + 4) 0.243 us | } + 4) 0.080 us | rcu_read_unlock_strict(); + 4) | __cond_resched() { + 4) 0.078 us | rcu_all_qs(); + 4) 0.241 us | } + 4) 0.080 us | rcu_read_unlock_strict(); + 4) | __cond_resched() { + 4) 0.079 us | rcu_all_qs(); + 4) 0.235 us | } + 4) 0.095 us | rcu_read_unlock_strict(); + 4) | __cond_resched() { +``` + +使用 `stop` 和 `clear` 命令来停止追踪和清楚缓存区。 + +``` +# trace-cmd stop +# trace-cmd clear +``` + +### 调整追踪以增加深度 + +如果你想在函数调用中看到更多的深度,你可以对追踪器进行调整。 + +``` +# trace-cmd start -p function_graph --max-graph-depth 5 + plugin 'function_graph' +``` + +现在,当你将这个输出与你之前看到的进行比较时,你应该看到更多的嵌套函数调用。 + +``` +# trace-cmd show | head -20 +## tracer: function_graph +# +# CPU DURATION FUNCTION CALLS +# | | | | | | | + 6) | __fget_light() { + 6) 0.804 us | __fget_files(); + 6) 2.708 us | } + 6) 3.650 us | } /* __fdget */ + 6) 0.547 us | eventfd_poll(); + 6) 0.535 us | fput(); + 6) | __fdget() { + 6) | __fget_light() { + 6) 0.946 us | __fget_files(); + 6) 1.895 us | } + 6) 2.849 us | } + 6) | sock_poll() { + 6) 0.651 us | unix_poll(); + 6) 1.905 us | } + 6) 0.475 us | fput(); + 6) | __fdget() { +``` + +### 了解可被追踪的函数 + +如果你想只追踪某些函数而忽略其他的,你需要知道确切的函数名称。你可以用 `list -f` 参数来得到它们。例如搜索常见的内核函数 `kmalloc`,它被用来在内核中分配内存。 + +``` +# trace-cmd list -f | grep kmalloc +bpf_map_kmalloc_node +mempool_kmalloc +__traceiter_kmalloc +__traceiter_kmalloc_node +kmalloc_slab +kmalloc_order +kmalloc_order_trace +kmalloc_large_node +__kmalloc +__kmalloc_track_caller +__kmalloc_node +__kmalloc_node_track_caller +[...] +``` + +下面是我的测试系统中可被追踪的函数总数: + +``` +# trace-cmd list -f | wc -l +63165 +``` + +### 追踪内核模块相关的函数 + +你也可以追踪与特定内核模块相关的函数。假设你想追踪 `kvm` 内核模块相关的功能,你可以通过以下方式来实现。确保该模块已经加载。 + +``` +# lsmod | grep kvm_intel +kvm_intel 335872 0 +kvm 987136 1 kvm_intel +``` + +再次运行 `trace-cmd`,使用 `list` 参数,并从输出结果中,`grep` 查找以 `]` 结尾的行。这将过滤掉内核模块。然后 `grep` 内核模块 `kvm_intel` ,你应该看到所有与该内核模块有关的函数。 + +``` +# trace-cmd list -f | grep ]$ | grep kvm_intel +vmx_can_emulate_instruction [kvm_intel] +vmx_update_emulated_instruction [kvm_intel] +vmx_setup_uret_msr [kvm_intel] +vmx_set_identity_map_addr [kvm_intel] +handle_machine_check [kvm_intel] +handle_triple_fault [kvm_intel] +vmx_patch_hypercall [kvm_intel] + +[...] + +vmx_dump_dtsel [kvm_intel] +vmx_dump_sel [kvm_intel] +``` + +### 追踪特定函数 + +现在你知道了如何找到感兴趣的函数,请用一个例子把这些内容用于时间。就像前面的文章一样,试着追踪与文件系统相关的函数。我的测试系统上的文件系统是 `ext4`。 + +这个过程略有不同;你在运行命令时,不需要**启动**,而是在**记录**参数后面加上你想追踪的函数的 "模式"。你还需要指定你想要的追踪器;在这种情况下,就是 `function_graph`。该命令会继续记录追踪,直到你用 `Ctrl+C` 停止它。所以几秒钟后,按 `Ctrl+C` 停止追踪。 + +``` +# trace-cmd list -f | grep ^ext4_ + +# trace-cmd record -l ext4_* -p function_graph + plugin 'function_graph' +Hit Ctrl^C to stop recording +^C +CPU0 data recorded at offset=0x856000 + 8192 bytes in size +[...] +``` + +### 查看追踪记录 + +要查看你之前的追踪记录,运行带有 `report` 参数的命令。从输出结果来看,很明显过滤器起作用了,你只看到 `ext4` 相关的函数追踪。 + +``` +# trace-cmd report | head -20 +[...] +cpus=8 + trace-cmd-12697 [000] 11303.928103: funcgraph_entry: | ext4_show_options() { + trace-cmd-12697 [000] 11303.928104: funcgraph_entry: 0.187 us | ext4_get_dummy_policy(); + trace-cmd-12697 [000] 11303.928105: funcgraph_exit: 1.583 us | } + trace-cmd-12697 [000] 11303.928122: funcgraph_entry: | ext4_create() { + trace-cmd-12697 [000] 11303.928122: funcgraph_entry: | ext4_alloc_inode() { + trace-cmd-12697 [000] 11303.928123: funcgraph_entry: 0.101 us | ext4_es_init_tree(); + trace-cmd-12697 [000] 11303.928123: funcgraph_entry: 0.083 us | ext4_init_pending_tree(); + trace-cmd-12697 [000] 11303.928123: funcgraph_entry: 0.141 us | ext4_fc_init_inode(); + trace-cmd-12697 [000] 11303.928123: funcgraph_exit: 0.931 us | } + trace-cmd-12697 [000] 11303.928124: funcgraph_entry: 0.081 us | ext4_get_dummy_policy(); + trace-cmd-12697 [000] 11303.928124: funcgraph_entry: 0.133 us | ext4_get_group_desc(); + trace-cmd-12697 [000] 11303.928124: funcgraph_entry: 0.115 us | ext4_free_inodes_count(); + trace-cmd-12697 [000] 11303.928124: funcgraph_entry: 0.114 us | ext4_get_group_desc(); +``` + +### 追踪一个特定的 PID + +假设你想追踪与一个进程(PID)有关的函数。打开另一个终端,注意运行中的 shell 的PID。 + +``` +# echo $$ +10885 +``` + +再次运行 `record` 命令,用 `-P` 选项传递PID。这一次,让终端运行(也就是说,先不要按 `Ctrl+C` )。 + +``` +# trace-cmd record -P 10885 -p function_graph + Plugin 'function_graph' +Hit Ctrl^C to stop recording +``` + +### 在 shell 上运行一些命令 + +移动到另一个终端,在那里你有一个以特定PID运行的shell,并运行任何命令,例如,`ls` 命令用来列出文件。 + +``` +# ls +Temp-9b61f280-fdc1-4512-9211-5c60f764d702 +tracker-extract-3-files.1000 +v8-compile-cache-1000 +[...] +``` + +移动到你启用追踪的终端,按 `Ctrl+C` 停止追踪。 + +``` +# trace-cmd record -P 10885 -p function_graph + plugin 'function_graph' +Hit Ctrl^C to stop recording +^C +CPU1 data recorded at offset=0x856000 + 618496 bytes in size +[...] +``` + +在追踪的输出中,你可以看到左边是 PID 和 Bash shell,右边是与之相关的函数调用。这对于缩小你的追踪范围是非常方便的。 + +``` +# trace-cmd report | head -20 + +cpus=8 + -0 [001] 11555.380581: funcgraph_entry: | switch_mm_irqs_off() { + -0 [001] 11555.380583: funcgraph_entry: 1.703 us | load_new_mm_cr3(); + -0 [001] 11555.380586: funcgraph_entry: 0.493 us | switch_ldt(); + -0 [001] 11555.380587: funcgraph_exit: 7.235 us | } + bash-10885 [001] 11555.380589: funcgraph_entry: 1.046 us | finish_task_switch.isra.0(); + bash-10885 [001] 11555.380591: funcgraph_entry: | __fdget() { + bash-10885 [001] 11555.380592: funcgraph_entry: 2.036 us | __fget_light(); + bash-10885 [001] 11555.380594: funcgraph_exit: 3.256 us | } + bash-10885 [001] 11555.380595: funcgraph_entry: | tty_poll() { + bash-10885 [001] 11555.380597: funcgraph_entry: | tty_ldisc_ref_wait() { + bash-10885 [001] 11555.380598: funcgraph_entry: | ldsem_down_read() { + bash-10885 [001] 11555.380598: funcgraph_entry: | __cond_resched() { +``` + +### 试一试 + +这些简短的例子显示了使用 `trace-cmd` 命令而不是底层的 `ftrace` 机制,是如何实现既容易使用又拥有丰富的功能,许多内容本文并没有涉及。要想了解更多信息并更好地使用它,请查阅它的手册,并尝试使用其他有用的命令。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/7/linux-kernel-trace-cmd + +作者:[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/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) +[2]: https://opensource.com/article/21/7/analyze-linux-kernel-ftrace +[3]: https://lwn.net/Articles/410200/ From 9aad53d28c027e26fa5aebf13eb9b8d898f5918d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 3 Oct 2021 05:03:45 +0800 Subject: [PATCH 0579/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211002?= =?UTF-8?q?=20Monitor=20your=20Java=20on=20Linux=20with=20jconsole?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211002 Monitor your Java on Linux with jconsole.md --- ...onitor your Java on Linux with jconsole.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20211002 Monitor your Java on Linux with jconsole.md diff --git a/sources/tech/20211002 Monitor your Java on Linux with jconsole.md b/sources/tech/20211002 Monitor your Java on Linux with jconsole.md new file mode 100644 index 0000000000..3d75ccd24b --- /dev/null +++ b/sources/tech/20211002 Monitor your Java on Linux with jconsole.md @@ -0,0 +1,122 @@ +[#]: subject: "Monitor your Java on Linux with jconsole" +[#]: via: "https://opensource.com/article/21/10/monitor-java-linux-jconsole" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Monitor your Java on Linux with jconsole +====== +How to use the Java monitoring and management console included in the +Java Development Kit. +![Puzzle pieces coming together to form a computer screen][1] + +The Java Development Kit (JDK) provides binaries, tools, and compilers for the development of Java applications. One helpful tool included is jconsole. + +To demonstrate, I will use the WildFly J2EE application server, which is part of the JBOSS open source application server project. First, I start up a standalone instance. + + +``` +~/wildfly/24.0.1/bin$ ./standalone.sh +========================================================================= + +  JBoss Bootstrap Environment + +  JBOSS_HOME: /home/alan/wildfly/24.0.1 + +  JAVA: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-5.fc34.x86_64/bin/java +``` + +Now, in another terminal, I type `jconsole`. + + +``` +$ jconsole +``` + +Upon launching, jconsole lists local instances. Select Local Process, then select the name of the process and click Connect. That is all it takes to connect and begin using jconsole with a running Java Virtual Machine (JVM). + +![jconsole new connection screen with local processes][2] + +(Alan Formy-Duvall, [CC BY-SA 4.0][3]) + +### Overview + +The Java Monitoring and Management Console shows the process identifier (PID) at the top of the dashboard. The Overview tab has four graphs to show the vitals for Heap Memory Usage, Threads, Classes, and CPU Usage. + +![jconsole dashboard showing heap memory usage, threads, classes, and CPU usage][4] + +(Alan Formy-Duvall, [CC BY-SA 4.0][3]) + +The tabs along the top provide more detailed views of each area. + +### Memory + +The Memory tab displays graphs of various aspects of the memory being used by the JVM. The amount of the server system memory allocated to the JVM is called the heap. This screen also provides details about usage by the internal components of the heap, such as the Eden Space, Old Gen, and the Survivor Space. You can manually request a garbage collection action as well. + +![jconsole memory tab][5] + +(Alan Formy-Duvall, [CC BY-SA 4.0][3]) + +### Threads + +The Threads tab shows how many threads are running. You can also manually check for deadlocks. + +![jconsole thread dashboard showing number of threads over time and a scrolling list of threads][6] + +(Alan Formy-Duvall, [CC BY-SA 4.0][3]) + +### Classes + +The classes tab tells you how many classes are loaded and how many have been unloaded. + +![jconsole classes tab showing number of loaded classes over time][7] + +(Alan Formy-Duvall, [CC BY-SA 4.0][3]) + +### VM Summary + +The VM Summary tab provides many details about the application and the host system. You can learn which operating system and architecture you are on, the total amount of system memory, the number of CPUs, and even swap space. + +![jconsole VMsummary tab ][8] + +(Alan Formy-Duvall, [CC BY-SA 4.0][3]) + +Further details about the JVM shown in the summary include current and maximum heap size and information about the garbage collectors in use. The bottom pane lists all of the arguments passed to the JVM. + +### MBeans + +The last tab, MBeans, lets you drill down through all of the MBeans to view attributes and values for each. + +![MBeans tab][9] + +(Alan Formy-Duvall, [CC BY-SA 4.0][3]) + +### Conclusion + +Java has been around a long time, and it continues to power millions of systems worldwide. Plenty of development environments and monitoring systems are available, but having a tool like jconsole included in the base kit can be highly valuable. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/monitor-java-linux-jconsole + +作者:[Alan Formy-Duval][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/alanfdoss +[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://opensource.com/sites/default/files/uploads/jconsole_new_connection_local.png (new connection) +[3]: https://creativecommons.org/licenses/by-sa/4.0/deed.ast +[4]: https://opensource.com/sites/default/files/uploads/jconsole_tab_overview.png (tab overview) +[5]: https://opensource.com/sites/default/files/uploads/jconsole_tab_memory.png (memory tab) +[6]: https://opensource.com/sites/default/files/uploads/jconsole_tab_threads.png (threads tab) +[7]: https://opensource.com/sites/default/files/uploads/jconsole_tab_classes.png (classes tab) +[8]: https://opensource.com/sites/default/files/uploads/jconsole_tab_vm-summary.png (VMsummary tab ) +[9]: https://opensource.com/sites/default/files/uploads/jconsole_tab_mbeans.png (MBeans tab) From 06300017bf79feb8e41cf90aa5fc98a2b2a154b4 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sun, 3 Oct 2021 09:51:48 +0800 Subject: [PATCH 0580/1588] translating --- ...0104 Learn Fortran by writing a -guess the number- game.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210104 Learn Fortran by writing a -guess the number- game.md b/sources/tech/20210104 Learn Fortran by writing a -guess the number- game.md index f4e8f0d2fe..89292005f8 100644 --- a/sources/tech/20210104 Learn Fortran by writing a -guess the number- game.md +++ b/sources/tech/20210104 Learn Fortran by writing a -guess the number- game.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (unigeorge) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -123,7 +123,7 @@ via: https://opensource.com/article/21/1/fortran 作者:[Jim Hall][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 9163ed9434acbb1f8f0aa5a37935b0d4a70aebd0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 Oct 2021 10:13:48 +0800 Subject: [PATCH 0581/1588] RPF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @unigeorge 恭喜!达成三星任务!https://linux.cn/lctt/unigeorge --- ...memory safety and efficiency by example.md | 172 +++++++++--------- 1 file changed, 86 insertions(+), 86 deletions(-) diff --git a/translated/tech/20210813 Code memory safety and efficiency by example.md b/translated/tech/20210813 Code memory safety and efficiency by example.md index 314853622a..37b2d9985b 100644 --- a/translated/tech/20210813 Code memory safety and efficiency by example.md +++ b/translated/tech/20210813 Code memory safety and efficiency by example.md @@ -3,17 +3,18 @@ [#]: author: "Marty Kalin https://opensource.com/users/mkalindepauledu" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 实例讲解代码之内存安全与效率 ====== -了解有关内存安全和效率的更多信息。 -![Code going into a computer.][1] +> 了解有关内存安全和效率的更多信息。 -C 是一种高级语言,同时具有“接近金属”(LCTT 译注:即“接近人类思维方式”的反义词)的特性,这使得它有时看起来更像是一种可移植的汇编语言,而不是 Java 或 Python 的兄弟语言。内存管理作为上述特性之一,涵盖了正在执行的程序对内存的安全和高效使用。本文通过 C 语言代码示例,以及现代 C 语言编译器生成的汇编语言代码段,详细介绍了内存安全性和效率。 +![](https://img.linux.net.cn/data/attachment/album/202110/03/101238cd0hgdrhamzab7hj.jpg) + +C 是一种高级语言,同时具有“接近金属close-to-the-metal”(LCTT 译注:即“接近人类思维方式”的反义词)的特性,这使得它有时看起来更像是一种可移植的汇编语言,而不像 Java 或 Python 这样的兄弟语言。内存管理作为上述特性之一,涵盖了正在执行的程序对内存的安全和高效使用。本文通过 C 语言代码示例,以及现代 C 语言编译器生成的汇编语言代码段,详细介绍了内存安全性和效率。 尽管代码示例是用 C 语言编写的,但安全高效的内存管理指南对于 C++ 是同样适用的。这两种语言在很多细节上有所不同(例如,C++ 具有 C 所缺乏的面向对象特性和泛型),但在内存管理方面面临的挑战是一样的。 @@ -30,36 +31,35 @@ void some_func(int a, int b) { } ``` -通过 **a** 和 **b** 传递的参数以及局部变量 **n** 的存储会在栈中,除非编译器可以找到通用寄存器。编译器倾向于优先将通用寄存器用作暂存器,因为 CPU 对这些寄存器的访问速度很快(一个时钟周期)。然而,这些寄存器在台式机、笔记本电脑和手持机器的标准架构上很少(大约 16 个)。 +通过 `a` 和 `b` 传递的参数以及局部变量 `n` 的存储会在栈中,除非编译器可以找到通用寄存器。编译器倾向于优先将通用寄存器用作暂存器,因为 CPU 对这些寄存器的访问速度很快(一个时钟周期)。然而,这些寄存器在台式机、笔记本电脑和手持机器的标准架构上很少(大约 16 个)。 -在只有汇编语言程序员才能看到的实施层面,栈被组织为具有 **push**(插入)和 **pop**(删除)操作的 LIFO(后进先出)列表。 **top** 指针可以作为偏移的基地址;这样,除了 **top** 之外的栈位置也变得可访问了。例如,表达式 **top+16** 指向堆栈的 **top** 指针上方 16 个字节的位置,表达式 **top-16** 指向 **top** 指针下方 16 个字节的位置。因此,可以通过 **top** 指针访问实现了暂存器存储的栈的位置。在标准的 ARM 或 Intel 架构中,栈从高内存地址增长到低内存地址;因此,减小某进程的 **top** 就是增大其栈规模。 +在只有汇编语言程序员才能看到的实施层面,栈被组织为具有 `push`(插入)和 `pop`(删除)操作的 LIFO(后进先出)列表。 `top` 指针可以作为偏移的基地址;这样,除了 `top` 之外的栈位置也变得可访问了。例如,表达式 `top+16` 指向堆栈的 `top` 指针上方 16 个字节的位置,表达式 `top-16` 指向 `top` 指针下方 16 个字节的位置。因此,可以通过 `top` 指针访问实现了暂存器存储的栈的位置。在标准的 ARM 或 Intel 架构中,栈从高内存地址增长到低内存地址;因此,减小某进程的 `top` 就是增大其栈规模。 使用栈结构就意味着轻松高效地使用内存。编译器(而非程序员)会编写管理栈的代码,管理过程通过分配和释放所需的暂存器存储来实现;程序员声明函数参数和局部变量,将实现过程交给编译器。此外,完全相同的栈存储可以在连续的函数调用和代码块(如循环)中重复使用。精心设计的模块化代码会将栈存储作为暂存器的首选内存选项,同时优化编译器要尽可能使用通用寄存器而不是栈。 -**堆** 提供的存储是通过程序员代码显式分配的,堆分配的语法因语言而异。在 C 中,成功调用库函数 **malloc**(或其变体 **calloc** 等)会分配指定数量的字节(在 C++ 和 Java 等语言中,**new** 运算符具有相同的用途)。编程语言在如何释放堆分配的存储方面有着巨大的差异: +**堆** 提供的存储是通过程序员代码显式分配的,堆分配的语法因语言而异。在 C 中,成功调用库函数 `malloc`(或其变体 `calloc` 等)会分配指定数量的字节(在 C++ 和 Java 等语言中,`new` 运算符具有相同的用途)。编程语言在如何释放堆分配的存储方面有着巨大的差异: * 在 Java、Go、Lisp 和 Python 等语言中,程序员不会显式释放动态分配的堆存储。 -例如,下面这个 Java 语句为一个字符串分配了堆存储,并将这个堆存储的地址存储在变量 **greeting** 中: + 例如,下面这个 Java 语句为一个字符串分配了堆存储,并将这个堆存储的地址存储在变量 `greeting` 中: + ``` + String greeting = new String("Hello, world!"); + ``` -``` -String greeting = new String("Hello, world!"); -``` - -Java 有一个垃圾回收器,它是一个运行时实用程序,如果进程无法再访问自己分配的堆存储,回收器可以使其自动释放。因此,Java 堆释放是通过垃圾收集器自动进行的。在上面的示例中,垃圾收集器将在变量 **greeting** 超出作用域后,释放字符串的堆存储。 + Java 有一个垃圾回收器,它是一个运行时实用程序,如果进程无法再访问自己分配的堆存储,回收器可以使其自动释放。因此,Java 堆释放是通过垃圾收集器自动进行的。在上面的示例中,垃圾收集器将在变量 `greeting` 超出作用域后,释放字符串的堆存储。 * Rust 编译器会编写堆释放代码。这是 Rust 在不依赖垃圾回收器的情况下,使堆释放实现自动化的开创性努力,但这也会带来运行时复杂性和开销。向 Rust 的努力致敬! - * 在 C(和 C++)中,堆释放是程序员的任务。程序员调用 **malloc** 分配堆存储,然后负责相应地调用库函数 **free** 来释放该存储空间(在 C++ 中,**new** 运算符分配堆存储,而 **delete** 和 **delete[]** 运算符释放此类存储)。下面是一个 C 语言代码示例: + * 在 C(和 C++)中,堆释放是程序员的任务。程序员调用 `malloc` 分配堆存储,然后负责相应地调用库函数 `free` 来释放该存储空间(在 C++ 中,`new` 运算符分配堆存储,而 `delete` 和 `delete[]` 运算符释放此类存储)。下面是一个 C 语言代码示例: -``` -char* greeting = malloc(14);       /* 14 heap bytes */ -strcpy(greeting, "Hello, world!"); /* copy greeting into bytes */ -puts(greeting);                    /* print greeting */ -free(greeting);                    /* free malloced bytes */ -``` + ``` + 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 语言避免了垃圾回收器的成本和复杂性,但也不过是让程序员承担了堆释放的任务。 + C 语言避免了垃圾回收器的成本和复杂性,但也不过是让程序员承担了堆释放的任务。 内存的 **静态区** 为可执行代码(例如 C 语言函数)、字符串文字(例如“Hello, world!”)和全局变量提供存储空间: @@ -77,7 +77,7 @@ int main() {                 /* function */ ### 栈存储 -想象一个有各种连续执行的任务的程序,任务包括了处理每隔几分钟通过网络下载并存储在本地文件中的数字数据。下面的 **stack** 程序简化了处理流程(仅是将奇数整数值转换为偶数),而将重点放在栈存储的好处上。 +想象一个有各种连续执行的任务的程序,任务包括了处理每隔几分钟通过网络下载并存储在本地文件中的数字数据。下面的 `stack` 程序简化了处理流程(仅是将奇数整数值转换为偶数),而将重点放在栈存储的好处上。 ``` @@ -126,11 +126,11 @@ int main() { } ``` -底部的 **main** 函数首先调用 **process_data** 函数,该函数会创建一个基于栈的数组,其大小由参数 **n** 给定(当前示例中为 128,000)。因此,该数组占用 128,000 x **sizeof(int)** 个字节,在标准设备上达到了 512,000 字节(**int** 在这些设备上是四个字节)。然后数据会被读入数组(使用库函数 **fread**),循环处理,并保存到本地文件 **outgoing.dat**(使用库函数**fwrite**)。 +底部的 `main` 函数首先调用 `process_data` 函数,该函数会创建一个基于栈的数组,其大小由参数 `n` 给定(当前示例中为 128,000)。因此,该数组占用 `128000 * sizeof(int)` 个字节,在标准设备上达到了 512,000 字节(`int` 在这些设备上是四个字节)。然后数据会被读入数组(使用库函数 `fread`),循环处理,并保存到本地文件 `outgoing.dat`(使用库函数 `fwrite`)。 -当 **process_data** 函数返回到其调用者 **main** 函数时,**process_data** 函数的大约 500MB 栈暂存器可供 **stack** 程序中的其他函数用作暂存器。在此示例中,**main** 函数接下来调用存根函数 **other_task1** 和 **other_task2**。这三个函数在 **main** 中依次调用,这意味着所有三个函数都可以使用相同的堆栈存储作为暂存器。因为编写栈管理代码的是编译器而不是程序员,所以这种方法对程序员来说既高效又容易。 +当 `process_data` 函数返回到其调用者 `main` 函数时,`process_data` 函数的大约 500MB 栈暂存器可供 `stack` 程序中的其他函数用作暂存器。在此示例中,`main` 函数接下来调用存根函数 `other_task1` 和 `other_task2`。这三个函数在 `main` 中依次调用,这意味着所有三个函数都可以使用相同的堆栈存储作为暂存器。因为编写栈管理代码的是编译器而不是程序员,所以这种方法对程序员来说既高效又容易。 -在 C 语言中,在块(例如函数或循环体)内定义的任何变量默认都有一个 **auto** 存储类,这意味着该变量是基于栈的。存储类 **register** 现在已经过时了,因为 C 编译器会主动尝试尽可能使用 CPU 寄存器。只有在块内定义的变量可能是 **register**,如果没有可用的 CPU 寄存器,编译器会将其更改为 **auto**。基于栈的编程可能是不错的首选方式,但这种风格确实有一些挑战性。下面的 **badStack** 程序说明了这点。 +在 C 语言中,在块(例如函数或循环体)内定义的任何变量默认都有一个 `auto` 存储类,这意味着该变量是基于栈的。存储类 `register` 现在已经过时了,因为 C 编译器会主动尝试尽可能使用 CPU 寄存器。只有在块内定义的变量可能是 `register`,如果没有可用的 CPU 寄存器,编译器会将其更改为 `auto`。基于栈的编程可能是不错的首选方式,但这种风格确实有一些挑战性。下面的 `badStack` 程序说明了这点。 ``` #include ; @@ -155,9 +155,9 @@ int main() { } ``` -**badStack** 程序中的控制流程很简单。**main** 函数使用 16(LCTT译注:原文为 128,应为作者笔误)作为参数调用函数 **get_array**,然后被调用函数会使用传入参数来创建对应大小的本地数组。**get_array** 函数会初始化数组并返回给 **main** 中的数组标识符 **arr**。 **arr** 是一个指针常量,保存数组的第一个 **int** 元素的地址。 +`badStack` 程序中的控制流程很简单。`main` 函数使用 16(LCTT 译注:原文为 128,应为作者笔误)作为参数调用函数 `get_array`,然后被调用函数会使用传入参数来创建对应大小的本地数组。`get_array` 函数会初始化数组并返回给 `main` 中的数组标识符 `arr`。 `arr` 是一个指针常量,保存数组的第一个 `int` 元素的地址。 -当然,本地数组 **arr** 可以在 **get_array** 函数中访问,但是一旦 **get_array** 返回,就不能合法访问该数组。尽管如此,**main** 函数会尝试使用函数 **get_array** 返回的堆栈地址 **arr** 来打印基于栈的数组。现代编译器会警告错误。例如,下面是来自 GNU 编译器的警告: +当然,本地数组 `arr` 可以在 `get_array` 函数中访问,但是一旦 `get_array` 返回,就不能合法访问该数组。尽管如此,`main` 函数会尝试使用函数 `get_array` 返回的堆栈地址 `arr` 来打印基于栈的数组。现代编译器会警告错误。例如,下面是来自 GNU 编译器的警告: ``` badStack.c: In function 'get_array': @@ -165,7 +165,7 @@ badStack.c:9:10: warning: function returns address of local variable [-Wreturn-l return arr;  /** ERROR **/ ``` -一般规则是,如果使用栈存储实现局部变量,应该仅在该变量所在的代码块内,访问这块基于栈的存储(在本例中,数组指针 **arr** 和循环计数器 **i** 均为这样的局部变量)。因此,函数永远不应该返回指向基于栈存储的指针。 +一般规则是,如果使用栈存储实现局部变量,应该仅在该变量所在的代码块内,访问这块基于栈的存储(在本例中,数组指针 `arr` 和循环计数器 `i` 均为这样的局部变量)。因此,函数永远不应该返回指向基于栈存储的指针。 ### 堆存储 @@ -201,17 +201,17 @@ int main() { } ``` -上面的 **heap** 程序有两个函数: **main** 函数使用参数(示例中为 100)调用 **get_heap_array** 函数,参数用来指定数组应该有多少个 **int** 元素。因为堆分配可能会失败,**main** 函数会检查 **get_heap_array** 是否返回了 **NULL**;如果是,则表示失败。如果分配成功,**main** 将打印数组中的 **int** 值,然后立即调用库函数 **free** 来对堆存储解除分配。这就是最优的方案。 +上面的 `heap` 程序有两个函数: `main` 函数使用参数(示例中为 100)调用 `get_heap_array` 函数,参数用来指定数组应该有多少个 `int` 元素。因为堆分配可能会失败,`main` 函数会检查 `get_heap_array` 是否返回了 `NULL`;如果是,则表示失败。如果分配成功,`main` 将打印数组中的 `int` 值,然后立即调用库函数 `free` 来对堆存储解除分配。这就是最优的方案。 -**get_heap_array** 函数以下列语句开头,该语句值得仔细研究一下: +`get_heap_array` 函数以下列语句开头,该语句值得仔细研究一下: ``` int* heap_nums = malloc(sizeof(int) * n); /* heap allocation */ ``` -**malloc** 库函数及其变体函数针对字节进行操作;因此,**malloc** 的参数是 **n** 个 **int** 类型元素所需的字节数(**sizeof(int)** 在标准现代设备上是四个字节)。**malloc** 函数返回所分配字节段的首地址,如果失败则返回 **NULL** . +`malloc` 库函数及其变体函数针对字节进行操作;因此,`malloc` 的参数是 `n` 个 `int` 类型元素所需的字节数(`sizeof(int)` 在标准现代设备上是四个字节)。`malloc` 函数返回所分配字节段的首地址,如果失败则返回 `NULL` . -如果成功调用 **malloc**,在现代台式机上其返回的地址大小为 64 位。在手持设备和早些时候的台式机上,该地址的大小可能是 32 位,或者甚至更小,具体取决于其年代。堆分配数组中的元素是 **int** 类型,这是一个四字节的有符号整数。这些堆分配的 **int** 的地址存储在基于栈的局部变量 **heap_nums** 中。可以参考下图: +如果成功调用 `malloc`,在现代台式机上其返回的地址大小为 64 位。在手持设备和早些时候的台式机上,该地址的大小可能是 32 位,或者甚至更小,具体取决于其年代。堆分配数组中的元素是 `int` 类型,这是一个四字节的有符号整数。这些堆分配的 `int` 的地址存储在基于栈的局部变量 `heap_nums` 中。可以参考下图: ```                  heap-based @@ -221,29 +221,29 @@ int* heap_nums = malloc(sizeof(int) * n); /* heap allocation */               +----+----+   +----+ ``` -一旦 **get_heap_array** 函数返回,指针变量 **heap_nums** 的栈存储将自动回收——但动态 **int** 数组的堆存储仍然存在,这就是 **get_heap_array** 函数返回这个地址(的副本)给 **main** 函数的原因:它现在负责在打印数组的整数后,通过调用库函数 **free** 显式释放堆存储: +一旦 `get_heap_array` 函数返回,指针变量 `heap_nums` 的栈存储将自动回收——但动态 `int` 数组的堆存储仍然存在,这就是 `get_heap_array` 函数返回这个地址(的副本)给 `main` 函数的原因:它现在负责在打印数组的整数后,通过调用库函数 `free` 显式释放堆存储: ``` free(heap_nums); /* free the heap storage */ ``` -**malloc** 函数不会初始化堆分配的存储空间,因此里面是随机值。相比之下,其变体函数 **calloc** 会将分配的存储初始化为零。这两个函数都返回 **NULL** 来表示分配失败。 +`malloc` 函数不会初始化堆分配的存储空间,因此里面是随机值。相比之下,其变体函数 `calloc` 会将分配的存储初始化为零。这两个函数都返回 `NULL` 来表示分配失败。 -在 **heap** 示例中,**main** 函数在调用 **free** 后会立即返回,正在执行的程序会终止,这会让系统回收所有已分配的堆存储。尽管如此,程序员应该养成在不再需要时立即显式释放堆存储的习惯。 +在 `heap` 示例中,`main` 函数在调用 `free` 后会立即返回,正在执行的程序会终止,这会让系统回收所有已分配的堆存储。尽管如此,程序员应该养成在不再需要时立即显式释放堆存储的习惯。 ### 嵌套堆分配 下一个代码示例会更棘手一些。C 语言有很多返回指向堆存储的指针的库函数。下面是一个常见的使用情景: -1\. C 程序调用一个库函数,该函数返回一个指向基于堆的存储的指针,而指向的存储通常是一个聚合体,如数组或结构体: +1、C 程序调用一个库函数,该函数返回一个指向基于堆的存储的指针,而指向的存储通常是一个聚合体,如数组或结构体: ``` SomeStructure* ptr = lib_function(); /* returns pointer to heap storage */ ``` -2\. 然后程序使用所分配的存储。 +2、 然后程序使用所分配的存储。 -3\. 对于清理而言,问题是对 **free** 的简单调用是否会清理库函数分配的所有堆分配存储。例如,**SomeStructure** 实例可能有指向堆分配存储的字段。一个特别麻烦的情况是动态分配的结构体数组,每个结构体有一个指向又一层动态分配的存储的字段。下面的代码示例说明了这个问题,并重点关注了如何设计一个可以安全地为客户端提供堆分配存储的库。 +3、 对于清理而言,问题是对 `free` 的简单调用是否会清理库函数分配的所有堆分配存储。例如,`SomeStructure` 实例可能有指向堆分配存储的字段。一个特别麻烦的情况是动态分配的结构体数组,每个结构体有一个指向又一层动态分配的存储的字段。下面的代码示例说明了这个问题,并重点关注了如何设计一个可以安全地为客户端提供堆分配存储的库。 ``` #include @@ -299,7 +299,7 @@ int main() { } ``` -上面的 **nestedHeap** 程序示例以结构体 **HeapStruct** 为中心,结构体中又有名为 **heap_nums** 的指针字段: +上面的 `nestedHeap` 程序示例以结构体 `HeapStruct` 为中心,结构体中又有名为 `heap_nums` 的指针字段: ``` typedef struct { @@ -309,7 +309,7 @@ typedef struct { } HeapStruct; ``` -函数 **get_heap_struct** 尝试为 **HeapStruct** 实例分配堆存储,这需要为字段 **heap_nums** 指向的若干个 **float** 变量分配堆存储。如果成功调用 **get_heap_struct** 函数,并将指向堆分配结构体的指针以 **hs** 命名,其结果可以描述如下: +函数 `get_heap_struct` 尝试为 `HeapStruct` 实例分配堆存储,这需要为字段 `heap_nums` 指向的若干个 `float` 变量分配堆存储。如果成功调用 `get_heap_struct` 函数,并将指向堆分配结构体的指针以 `hs` 命名,其结果可以描述如下: ``` hs-->HeapStruct instance @@ -318,7 +318,7 @@ hs-->HeapStruct instance         heap_nums-->N contiguous float elements ``` -在 **get_heap_struct** 函数中,第一个堆分配过程很简单: +在 `get_heap_struct` 函数中,第一个堆分配过程很简单: ``` HeapStruct* heap_struct = malloc(sizeof(HeapStruct)); @@ -326,9 +326,9 @@ if (NULL == heap_struct) /* failure? */   return NULL;           /* if so, return NULL */ ``` -**sizeof(HeapStruct)** 包括了 **heap_nums** 字段的字节数(32 位机器上为 4,64 位机器上为 8),**heap_nums** 字段则是指向动态分配数组中的 **float** 元素的指针。那么,问题关键在于 **malloc** 为这个结构体传送了字节空间还是表示失败的 **NULL**;如果是 **NULL**,**get_heap_struct** 函数就也返回 **NULL** 以通知调用者堆分配失败。 +`sizeof(HeapStruct)` 包括了 `heap_nums` 字段的字节数(32 位机器上为 4,64 位机器上为 8),`heap_nums` 字段则是指向动态分配数组中的 `float` 元素的指针。那么,问题关键在于 `malloc` 为这个结构体传送了字节空间还是表示失败的 `NULL`;如果是 `NULL`,`get_heap_struct` 函数就也返回 `NULL` 以通知调用者堆分配失败。 -第二步尝试堆分配的过程更复杂,因为在这一步,**HeapStruct** 的堆存储已经分配好了: +第二步尝试堆分配的过程更复杂,因为在这一步,`HeapStruct` 的堆存储已经分配好了: ``` heap_struct->heap_nums = malloc(sizeof(float) * n); @@ -338,13 +338,13 @@ if (NULL == heap_struct->heap_nums) {  /* failure? */ } ``` -传递给 **get_heap_struct** 函数的参数 **n** 指明动态分配的 **heap_nums** 数组中应该有多少个 **float** 元素。如果可以分配所需的若干个 **float** 元素,则该函数在返回 **HeapStruct** 的堆地址之前会设置结构的 **id** 和 **len** 字段。 但是,如果尝试分配失败,则需要两个步骤来实现最优方案: +传递给 `get_heap_struct` 函数的参数 `n` 指明动态分配的 `heap_nums` 数组中应该有多少个 `float` 元素。如果可以分配所需的若干个 `float` 元素,则该函数在返回 `HeapStruct` 的堆地址之前会设置结构的 `id` 和 `len` 字段。 但是,如果尝试分配失败,则需要两个步骤来实现最优方案: -1\. 必须释放 **HeapStruct** 的存储以避免内存泄漏。对于调用 **get_heap_struct** 的客户端函数而言,没有动态 **heap_nums** 数组的 **HeapStruct** 可能就是没用的;因此,**HeapStruct** 实例的字节空间应该显式释放,以便系统可以回收这些空间用于未来的堆分配。 +1、 必须释放 `HeapStruct` 的存储以避免内存泄漏。对于调用 `get_heap_struct` 的客户端函数而言,没有动态 `heap_nums` 数组的 `HeapStruct` 可能就是没用的;因此,`HeapStruct` 实例的字节空间应该显式释放,以便系统可以回收这些空间用于未来的堆分配。 -2\. 返回 **NULL** 以标识失败。 +2、 返回 `NULL` 以标识失败。 -如果成功调用 **get_heap_struct** 函数,那么释放堆存储也很棘手,因为它涉及要以正确顺序进行的两次 **free** 操作。因此,该程序设计了一个 **free_all** 函数,而不是要求程序员再去手动实现两步释放操作。回顾一下,**free_all** 函数是这样的: +如果成功调用 `get_heap_struct` 函数,那么释放堆存储也很棘手,因为它涉及要以正确顺序进行的两次 `free` 操作。因此,该程序设计了一个 `free_all` 函数,而不是要求程序员再去手动实现两步释放操作。回顾一下,`free_all` 函数是这样的: ``` void free_all(HeapStruct* heap_struct) { @@ -356,18 +356,18 @@ void free_all(HeapStruct* heap_struct) { } ``` -检查完参数 **heap_struct** 不是 **NULL** 值后,函数首先释放 **heap_nums** 数组,这步要求 **heap_struct** 指针此时仍然是有效的。先释放 **heap_struct** 的做法是错误的。一旦 **heap_nums** 被释放,**heap_struct** 就可以释放了。如果 **heap_struct** 被释放,但 **heap_nums** 没有被释放,那么数组中的 **float** 元素就会泄漏:仍然分配了字节空间,但无法被访问到——因此一定要记得释放 **heap_nums**。存储泄漏将一直持续,直到 **nestedHeap** 程序退出,系统回收泄漏的字节时为止。 +检查完参数 `heap_struct` 不是 `NULL` 值后,函数首先释放 `heap_nums` 数组,这步要求 `heap_struct` 指针此时仍然是有效的。先释放 `heap_struct` 的做法是错误的。一旦 `heap_nums` 被释放,`heap_struct` 就可以释放了。如果 `heap_struct` 被释放,但 `heap_nums` 没有被释放,那么数组中的 `float` 元素就会泄漏:仍然分配了字节空间,但无法被访问到——因此一定要记得释放 `heap_nums`。存储泄漏将一直持续,直到 `nestedHeap` 程序退出,系统回收泄漏的字节时为止。 -关于 **free** 库函数的注意事项就是要有顺序。回想一下上面的调用示例: +关于 `free` 库函数的注意事项就是要有顺序。回想一下上面的调用示例: ``` free(heap_struct->heap_nums); /* first free encapsulated aggregate */ free(heap_struct);            /* then free containing structure */ ``` -这些调用释放了分配的存储空间——但它们并 _不是_ 将它们的操作参数设置为 **NULL**(**free** 函数会获取地址的副本作为参数;因此,将副本更改为 **NULL** 并不会改变原地址上的参数值)。例如,在成功调用 **free** 之后,指针 **heap_struct** 仍然持有一些堆分配字节的堆地址,但是现在使用这个地址将会产生错误,因为对 **free** 的调用使得系统有权回收然后重用这些分配过的字节。 +这些调用释放了分配的存储空间——但它们并 _不是_ 将它们的操作参数设置为 `NULL`(`free` 函数会获取地址的副本作为参数;因此,将副本更改为 `NULL` 并不会改变原地址上的参数值)。例如,在成功调用 `free` 之后,指针 `heap_struct` 仍然持有一些堆分配字节的堆地址,但是现在使用这个地址将会产生错误,因为对 `free` 的调用使得系统有权回收然后重用这些分配过的字节。 -使用 **NULL** 参数调用 **free** 没有意义,但也没有什么坏处。而在非 **NULL** 的地址上重复调用 **free** 会导致不确定结果的错误: +使用 `NULL` 参数调用 `free` 没有意义,但也没有什么坏处。而在非 `NULL` 的地址上重复调用 `free` 会导致不确定结果的错误: ``` free(heap_struct);  /* 1st call: ok */ @@ -384,9 +384,9 @@ nums[0] = 3.14f;                          /* and so on */ nums = malloc(sizeof(float) * 25);        /* 25 new floats */ ``` -假如第一个 **malloc** 成功,第二个 **malloc** 会再将 **nums** 指针重置为 **NULL**(分配失败情况下)或是新分配的 25 个 **float** 中第一个的地址。最初分配的 10 个 **float** 元素的堆存储仍然处于被分配状态,但此时已无法再对其访问,因为 **nums** 指针要么指向别处,要么是 **NULL**。结果就是造成了 40 个字节 (**sizeof(float) * 10**) 的泄漏。 +假如第一个 `malloc` 成功,第二个 `malloc` 会再将 `nums` 指针重置为 `NULL`(分配失败情况下)或是新分配的 25 个 `float` 中第一个的地址。最初分配的 10 个 `float` 元素的堆存储仍然处于被分配状态,但此时已无法再对其访问,因为 `nums` 指针要么指向别处,要么是 `NULL`。结果就是造成了 40 个字节(`sizeof(float) * 10`)的泄漏。 -在第二次调用 **malloc** 之前,应该释放最初分配的存储空间: +在第二次调用 `malloc` 之前,应该释放最初分配的存储空间: ``` float* nums = malloc(sizeof(float) * 10); /* 10 floats */ @@ -395,13 +395,13 @@ free(nums);                               /** good **/ nums = malloc(sizeof(float) * 25);        /* no leakage */ ``` -即使没有泄漏,堆也会随着时间的推移而碎片化,需要对系统进行碎片整理。例如,假设两个最大的堆块当前的大小分别为 200MB 和 100MB。然而,这两个堆块并不连续,进程 **P** 此时又需要分配 250MB 的连续堆存储。在进行分配之前,系统可能要对堆进行 _碎片整理_ 以给 **P** 提供 250MB 连续存储空间。碎片整理很复杂,因此也很耗时。 +即使没有泄漏,堆也会随着时间的推移而碎片化,需要对系统进行碎片整理。例如,假设两个最大的堆块当前的大小分别为 200MB 和 100MB。然而,这两个堆块并不连续,进程 `P` 此时又需要分配 250MB 的连续堆存储。在进行分配之前,系统可能要对堆进行 _碎片整理_ 以给 `P` 提供 250MB 连续存储空间。碎片整理很复杂,因此也很耗时。 内存泄漏会创建处于已分配状态但不可访问的堆块,从而会加速碎片化。因此,释放不再需要的堆存储是程序员帮助减少碎片整理需求的一种方式。 ### 诊断内存泄漏的工具 -有很多工具可用于分析内存效率和安全性,其中我最喜欢的是 [valgrind][11]。为了说明该工具如何处理内存泄漏,这里给出 **leaky** 示例程序: +有很多工具可用于分析内存效率和安全性,其中我最喜欢的是 [valgrind][11]。为了说明该工具如何处理内存泄漏,这里给出 `leaky` 示例程序: ``` #include @@ -431,15 +431,15 @@ int main() { } ``` -**main** 函数调用了 **get_ints** 函数,后者会试着从堆中 **malloc** 32 个 4 字节的 **int**,然后初始化动态数组(如果 **malloc** 成功)。初始化成功后,**main** 函数会调用 **print_ints**函数。程序中并没有调用 **free** 来对应 **malloc** 操作;因此,内存泄漏了。 +`main` 函数调用了 `get_ints` 函数,后者会试着从堆中 `malloc` 32 个 4 字节的 `int`,然后初始化动态数组(如果 `malloc` 成功)。初始化成功后,`main` 函数会调用 `print_ints`函数。程序中并没有调用 `free` 来对应 `malloc` 操作;因此,内存泄漏了。 -如果安装了 **valgrind** 工具箱,下面的命令会检查 **leaky** 程序是否存在内存泄漏(**%** 是命令行提示符): +如果安装了 `valgrind` 工具箱,下面的命令会检查 `leaky` 程序是否存在内存泄漏(`%` 是命令行提示符): ``` % valgrind --leak-check=full ./leaky ``` -绝大部分输出都在下面给出了。左边的数字 207683 是正在执行的 **leaky** 程序的进程标识符。这份报告给出了泄漏发生位置的详细信息,本例中位置是在 **main** 函数所调用的 **get_ints** 函数中对 **malloc** 的调用处。 +绝大部分输出都在下面给出了。左边的数字 207683 是正在执行的 `leaky` 程序的进程标识符。这份报告给出了泄漏发生位置的详细信息,本例中位置是在 `main` 函数所调用的 `get_ints` 函数中对 `malloc` 的调用处。 ``` ==207683== HEAP SUMMARY: @@ -459,7 +459,7 @@ int main() { ==207683==   suppressed: 0 bytes in 0 blocks ``` -如果把 **main** 函数改成在对 **print_ints** 的调用之后,再加上一个对 **free** 的调用,**valgrind** 就会对 **leaky** 程序给出一个干净的内存健康清单: +如果把 `main` 函数改成在对 `print_ints` 的调用之后,再加上一个对 `free` 的调用,`valgrind` 就会对 `leaky` 程序给出一个干净的内存健康清单: ``` ==218462== All heap blocks were freed -- no leaks are possible @@ -467,9 +467,9 @@ int main() { ### 静态区存储 -在正统的 C 语言中,函数必须在所有块之外定义。这是一些 C 编译器支持的特性,杜绝了在另一个函数体内定义一个函数的可能。我举的例子都是在所有块之外定义的函数。这样的函数要么是 **static** 即静态的,要么是 **extern** 即外部的,其中 **extern** 是默认值。 +在正统的 C 语言中,函数必须在所有块之外定义。这是一些 C 编译器支持的特性,杜绝了在另一个函数体内定义一个函数的可能。我举的例子都是在所有块之外定义的函数。这样的函数要么是 `static` ,即静态的,要么是 `extern`,即外部的,其中 `extern` 是默认值。 -C 语言中,以 **static** 或 **extern** 修饰的函数和变量驻留在内存中所谓的 **静态区** 中,因为在程序执行期间该区域大小是固定不变的。这两个存储类型的语法非常复杂,我们应该回顾一下。在回顾之后,会有一个完整的代码示例来生动展示语法细节。在所有块之外定义的函数或变量默认为 **extern**;因此,函数和变量要想存储类型为 **static** ,必须显式指定: +C 语言中,以 `static` 或 `extern` 修饰的函数和变量驻留在内存中所谓的 **静态区** 中,因为在程序执行期间该区域大小是固定不变的。这两个存储类型的语法非常复杂,我们应该回顾一下。在回顾之后,会有一个完整的代码示例来生动展示语法细节。在所有块之外定义的函数或变量默认为 `extern`;因此,函数和变量要想存储类型为 `static` ,必须显式指定: ``` /** file1.c: outside all blocks, five definitions  **/ @@ -481,7 +481,7 @@ int num1;        /* extern */ static int num2; /* static */ ``` -**extern** 和 **static** 的区别在于作用域:**extern** 修饰的函数或变量可以实现跨文件可见(需要声明)。相比之下,**static** 修饰的函数仅在 _定义_ 该函数的文件中可见,而 **static** 修饰的变量仅在 _定义_ 该变量的文件(或文件中的块)中可见: +`extern` 和 `static` 的区别在于作用域:`extern` 修饰的函数或变量可以实现跨文件可见(需要声明)。相比之下,`static` 修饰的函数仅在 _定义_ 该函数的文件中可见,而 `static` 修饰的变量仅在 _定义_ 该变量的文件(或文件中的块)中可见: ``` static int n1;    /* scope is the file */ @@ -491,18 +491,18 @@ void func() { } ``` -如果在所有块之外定义了 **static** 变量,例如上面的 **n1**,该变量的作用域就是定义变量的文件。无论在何处定义 **static** 变量,变量的存储都在内存的静态区中。 +如果在所有块之外定义了 `static` 变量,例如上面的 `n1`,该变量的作用域就是定义变量的文件。无论在何处定义 `static` 变量,变量的存储都在内存的静态区中。 -**extern** 函数或变量在给定文件中的所有块之外定义,但这样定义的函数或变量也可以在其他文件中声明。典型的做法是在头文件中 _声明_ 这样的函数或变量,只要需要就可以包含进来。下面这些简短的例子阐述了这些棘手的问题。 +`extern` 函数或变量在给定文件中的所有块之外定义,但这样定义的函数或变量也可以在其他文件中声明。典型的做法是在头文件中 _声明_ 这样的函数或变量,只要需要就可以包含进来。下面这些简短的例子阐述了这些棘手的问题。 -假设 **extern** 函数 **foo** 在 **file1.c** 中 _定义_,有无关键字 **extern** 效果都一样: +假设 `extern` 函数 `foo` 在 `file1.c` 中 _定义_,有无关键字 `extern` 效果都一样: ``` /** file1.c **/ int foo(int n) { return n * 2; } /* definition has a body {...} */ ``` -必须在其他文件(或其中的块)中使用显式的 **extern** _声明_ 此函数才能使其可见。以下是使 **extern** 函数 **foo** 在文件 **file2.c** 中可见的声明语句: +必须在其他文件(或其中的块)中使用显式的 `extern` _声明_ 此函数才能使其可见。以下是使 `extern` 函数 `foo` 在文件 `file2.c` 中可见的声明语句: ``` /** file2.c: make function foo visible here **/ @@ -511,16 +511,16 @@ extern int foo(int); /* declaration (no body) */ 回想一下,函数声明没有用大括号括起来的主体,而函数定义会有这样的主体。 -为了便于查看,函数和变量声明通常会放在头文件中。准备好需要声明的源代码文件,然后就可以 **#include** 相关的头文件。下一节中的 **staticProg** 程序演示了这种方法。 +为了便于查看,函数和变量声明通常会放在头文件中。准备好需要声明的源代码文件,然后就可以 `#include` 相关的头文件。下一节中的 `staticProg` 程序演示了这种方法。 -至于 **extern** 的变量,规则就变得更棘手了(很抱歉增加了难度!)。任何 **extern** 的对象——无论函数或变量——必须 _定义_ 在所有块之外。此外,在所有块之外定义的变量默认为 **extern**: +至于 `extern` 的变量,规则就变得更棘手了(很抱歉增加了难度!)。任何 `extern` 的对象——无论函数或变量——必须 _定义_ 在所有块之外。此外,在所有块之外定义的变量默认为 `extern`: ``` /** outside all blocks **/ int n; /* defaults to extern */ ``` -但是,只有在变量的 _定义_ 中显式初始化变量时,**extern** 才能在变量的 _定义_ 中显式修饰(LCTT译注:换言之,如果下列代码中的 `int n1;` 行前加上 **extern**,该行就由 _定义_ 变成了 _声明_): +但是,只有在变量的 _定义_ 中显式初始化变量时,`extern` 才能在变量的 _定义_ 中显式修饰(LCTT 译注:换言之,如果下列代码中的 `int n1;` 行前加上 `extern`,该行就由 _定义_ 变成了 _声明_): ``` /** file1.c: outside all blocks **/ @@ -529,18 +529,18 @@ extern int n2 = -1; /* ok, initialized explicitly */ int n3 = 9876;      /* ok, extern by default and initialized explicitly */ ``` -要使在 **file1.c** 中定义为 **extern** 的变量在另一个文件(例如 **file2.c**)中可见,该变量必须在 **file2.c** 中显式 _声明_ 为 **extern** 并且不能初始化(初始化会将声明转换为定义): +要使在 `file1.c` 中定义为 `extern` 的变量在另一个文件(例如 `file2.c`)中可见,该变量必须在 `file2.c` 中显式 _声明_ 为 `extern` 并且不能初始化(初始化会将声明转换为定义): ``` /** file2.c **/ extern int n1; /* declaration of n1 defined in file1.c */ ``` -为了避免与 **extern** 变量混淆,经验是在 _声明_ 中显式使用 **extern**(必须),但不要在 _定义_ 中使用(非必须且棘手)。对于函数,**extern** 在定义中是可选使用的,但在声明中是必须使用的。下一节中的 **staticProg** 示例会把这些点整合到一个完整的程序中。 +为了避免与 `extern` 变量混淆,经验是在 _声明_ 中显式使用 `extern`(必须),但不要在 _定义_ 中使用(非必须且棘手)。对于函数,`extern` 在定义中是可选使用的,但在声明中是必须使用的。下一节中的 `staticProg` 示例会把这些点整合到一个完整的程序中。 ### staticProg 示例 -**staticProg** 程序由三个文件组成:两个 C 语言源文件(**static1.c** 和 **static2.c**)以及一个头文件(**static.h**),头文件中包含两个声明: +`staticProg` 程序由三个文件组成:两个 C 语言源文件(`static1.c` 和 `static2.c`)以及一个头文件(`static.h`),头文件中包含两个声明: ``` /** header file static.h **/ @@ -549,7 +549,7 @@ extern int global_nums[NumCount];  /* array declaration */ extern void fill_array();          /* function declaration */ ``` -两个声明中的 **extern**,一个用于数组,另一个用于函数,强调对象在别处(“外部”)_定义_:数组 **global_nums** 在文件 **static1.c** 中定义(没有显式的 **extern**),函数 **fill_array** 在文件 **static2.c** 中定义(也没有显式的 **extern**)。每个源文件都包含了头文件 **static.h**。**static1.c** 文件定义了两个驻留在内存静态区域中的数组(**global_nums** 和 **more_nums**)。第二个数组有 **static** 修饰,这将其作用域限制为定义数组的文件 (**static1.c**)。如前所述, **extern** 修饰的 **global_nums** 则可以实现在多个文件中可见。 +两个声明中的 `extern`,一个用于数组,另一个用于函数,强调对象在别处(“外部”)_定义_:数组 `global_nums` 在文件 `static1.c` 中定义(没有显式的 `extern`),函数 `fill_array` 在文件 `static2.c` 中定义(也没有显式的 `extern`)。每个源文件都包含了头文件 `static.h`。`static1.c` 文件定义了两个驻留在内存静态区域中的数组(`global_nums` 和 `more_nums`)。第二个数组有 `static` 修饰,这将其作用域限制为定义数组的文件 (`static1.c`)。如前所述, `extern` 修饰的 `global_nums` 则可以实现在多个文件中可见。 ``` /** static1.c **/ @@ -576,7 +576,7 @@ int main() { } ``` -下面的 **static2.c** 文件中定义了 **fill_array** 函数,该函数由 **main**(在 **static1.c** 文件中)调用;**fill_array** 函数会给名为 **global_nums** 的 **extern** 数组中的元素赋值,该数组在文件 **static1.c** 中定义。使用两个文件的唯一目的是凸显 **extern** 变量或函数能够跨文件可见。 +下面的 `static2.c` 文件中定义了 `fill_array` 函数,该函数由 `main`(在 `static1.c` 文件中)调用;`fill_array` 函数会给名为 `global_nums` 的 `extern` 数组中的元素赋值,该数组在文件 `static1.c` 中定义。使用两个文件的唯一目的是凸显 `extern` 变量或函数能够跨文件可见。 ``` /** static2.c **/ @@ -588,7 +588,7 @@ void fill_array() { /** definition **/ } ``` -**staticProg** 程序可以如下编译: +`staticProg` 程序可以用如下编译: ``` % gcc -o staticProg static1.c static2.c @@ -596,13 +596,13 @@ void fill_array() { /** definition **/ ### 从汇编语言看更多细节 -现代 C 编译器能够处理 C 和汇编语言的任意组合。编译 C 源文件时,编译器首先将 C 代码翻译成汇编语言。这是对从上文 **static1.c** 文件生成的汇编语言进行保存的命令: +现代 C 编译器能够处理 C 和汇编语言的任意组合。编译 C 源文件时,编译器首先将 C 代码翻译成汇编语言。这是对从上文 `static1.c` 文件生成的汇编语言进行保存的命令: ``` % gcc -S static1.c ``` -生成的文件就是 **static1.s**。这是文件顶部的一段代码,额外添加了行号以提高可读性: +生成的文件就是 `static1.s`。这是文件顶部的一段代码,额外添加了行号以提高可读性: ```     .file    "static1.c"          ## line  1 @@ -620,25 +620,25 @@ main:                             ## line 12 ... ``` -诸如 **.file**(第 1 行)之类的汇编语言指令以句点开头。顾名思义,指令会指导汇编程序将汇编语言翻译成机器代码。**.rodata** 指令(第 6 行)表示后面是只读对象,包括字符串常量 **"%4i\t%4i\n"**(第 8 行),**main** 函数(第 12 行)会使用此字符串常量来实现格式化输出。作为标签引入(通过末尾的冒号实现)的 **main** 函数(第 12 行),同样也是只读的。 +诸如 `.file`(第 1 行)之类的汇编语言指令以句点开头。顾名思义,指令会指导汇编程序将汇编语言翻译成机器代码。`.rodata` 指令(第 6 行)表示后面是只读对象,包括字符串常量 `"%4i\t%4i\n"`(第 8 行),`main` 函数(第 12 行)会使用此字符串常量来实现格式化输出。作为标签引入(通过末尾的冒号实现)的 `main` 函数(第 12 行),同样也是只读的。 -在汇编语言中,标签就是地址。标签 **main:**(第 12 行)标记了 **main** 函数代码开始的地址,标签 **.LC0**:(第 7 行)标记了格式化字符串开头所在的地址。 +在汇编语言中,标签就是地址。标签 `main:`(第 12 行)标记了 `main` 函数代码开始的地址,标签 `.LC0:`(第 7 行)标记了格式化字符串开头所在的地址。 -**global_nums**(第 3 行)和 **more_nums**(第 4 行)数组的定义包含了两个数字:400 是每个数组中的总字节数,32 是每个数组(含 100 个 **int** 元素)中每个元素的比特数。(第 5 行中的 **.comm** 指令表示 **common name**,可以忽略。) +`global_nums`(第 3 行)和 `more_nums`(第 4 行)数组的定义包含了两个数字:400 是每个数组中的总字节数,32 是每个数组(含 100 个 `int` 元素)中每个元素的比特数。(第 5 行中的 `.comm` 指令表示 `common name`,可以忽略。) -两个数组定义的不同之处在于 **more_nums** 被标记为 **.local**(第 4 行),这意味着其作用域仅限于其所在文件 **static1.s**。相比之下,**global_nums** 数组就能在多个文件中实现可见,包括由 **static1.c** 和 **static2.c** 文件翻译成的汇编文件。 +两个数组定义的不同之处在于 `more_nums` 被标记为 `.local`(第 4 行),这意味着其作用域仅限于其所在文件 `static1.s`。相比之下,`global_nums` 数组就能在多个文件中实现可见,包括由 `static1.c` 和 `static2.c` 文件翻译成的汇编文件。 -最后,**.text** 指令在汇编代码段中出现了两次(第 2 行和第 9 行)。术语“text”表示“只读”,但也会涵盖一些读/写变量,例如两个数组中的元素。尽管本文展示的汇编语言是针对 Intel 架构的,但 Arm6 汇编也非常相似。对于这两种架构,**.text** 区域中的变量(本例中为两个数组中的元素)会自动初始化为零。 +最后,`.text` 指令在汇编代码段中出现了两次(第 2 行和第 9 行)。术语“text”表示“只读”,但也会涵盖一些读/写变量,例如两个数组中的元素。尽管本文展示的汇编语言是针对 Intel 架构的,但 Arm6 汇编也非常相似。对于这两种架构,`.text` 区域中的变量(本例中为两个数组中的元素)会自动初始化为零。 ### 总结 C 语言中的内存高效和内存安全编程准则很容易说明,但可能会很难遵循,尤其是在调用设计不佳的库的时候。准则如下: * 尽可能使用栈存储,进而鼓励编译器将通用寄存器用作暂存器,实现优化。栈存储代表了高效的内存使用并促进了代码的整洁和模块化。永远不要返回指向基于栈的存储的指针。 - * 小心使用堆存储。C(和 C++)中的重难点是确保动态分配的存储尽快解除分配。良好的编程习惯和工具(如 **valgrind**)有助于攻关这些重难点。优先选用自身提供释放函数的库,例如 **nestedHeap** 代码示例中的 **free_all** 释放函数。 - * 谨慎使用静态存储,因为这种存储会自始至终地影响进程的内存占用。特别是尽量避免使用 **extern** 和 **static** 数组。 + * 小心使用堆存储。C(和 C++)中的重难点是确保动态分配的存储尽快解除分配。良好的编程习惯和工具(如 `valgrind`)有助于攻关这些重难点。优先选用自身提供释放函数的库,例如 `nestedHeap` 代码示例中的 `free_all` 释放函数。 + * 谨慎使用静态存储,因为这种存储会自始至终地影响进程的内存占用。特别是尽量避免使用 `extern` 和 `static` 数组。 -本文 C 语言代码示例可在我的网站 () 上找到。 +本文 C 语言代码示例可在我的网站()上找到。 -------------------------------------------------------------------------------- @@ -647,7 +647,7 @@ via: https://opensource.com/article/21/8/memory-programming-c 作者:[Marty Kalin][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 3097d12a0d3f2f7cb5ddaa56e8b2d0c3111c6963 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 Oct 2021 10:14:32 +0800 Subject: [PATCH 0582/1588] PUB @unigeorge https://linux.cn/article-13845-1.html --- .../20210813 Code memory safety and efficiency by example.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210813 Code memory safety and efficiency by example.md (99%) diff --git a/translated/tech/20210813 Code memory safety and efficiency by example.md b/published/20210813 Code memory safety and efficiency by example.md similarity index 99% rename from translated/tech/20210813 Code memory safety and efficiency by example.md rename to published/20210813 Code memory safety and efficiency by example.md index 37b2d9985b..d962653d8f 100644 --- a/translated/tech/20210813 Code memory safety and efficiency by example.md +++ b/published/20210813 Code memory safety and efficiency by example.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13845-1.html" 实例讲解代码之内存安全与效率 ====== From c448df2cfd368dad6cc640278e1f22516af43ca0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 Oct 2021 11:03:25 +0800 Subject: [PATCH 0583/1588] PRF @wxy --- ...721 Run GitHub Actions on Fedora CoreOS.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md b/translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md index 9badd6a20e..60b032190c 100644 --- a/translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md +++ b/translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md @@ -3,7 +3,7 @@ [#]: author: (Clément Verna https://fedoramagazine.org/author/cverna/) [#]: collector: (lujun9972) [#]: translator: (wxy) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) @@ -14,7 +14,7 @@ [GitHub Actions][3] 是一项为快速建立持续集成和交付(CI/CD)工作流程而提供的服务。这些工作流程在被称为“运行器runner”的主机上运行。GitHub 提供的 [托管运行器][4] 的操作系统的选择是有限的(Windows Server、Ubuntu、MacOS)。 -另一个选择是使用 [自我托管][5] 运行器,这让仓库管理员对运行器有更多控制。自我托管的运行程序是专门为某个版本库或组织服务的。下面的文章介绍了使用 Fedora CoreOS 配置自我托管运行程序的步骤。 +另一个选择是使用 [自托管][5] 的运行器,这让仓库管理员对运行器有更多控制。自托管的运行程序是专门为某个存储库或组织服务的。下面的文章介绍了使用 Fedora CoreOS 配置自托管运行程序的步骤。 ### 入门 @@ -51,11 +51,11 @@ storage: #### 注册和删除令牌 -为一个项目配置运行程序需要一个“令牌token”。这可以防止在没有正确权限的情况下从项目中注册或删除自我托管的运行器。GitHub 提供的令牌有一个小时的过期时间。如果运行器在这个时间之后重新启动,它将需要一个新的注册令牌。 +为一个项目配置运行器需要一个“令牌token”。这可以防止在没有正确权限的情况下从项目中注册或删除自托管的运行器。GitHub 提供的令牌有一个小时的过期时间。如果运行器在这个时间之后重新启动,它将需要一个新的注册令牌。 -该令牌可能有问题,特别是在 Fedora CoreOS 自动更新时。更新过程希望托管主机在收到新数据后至少每隔几周重启一次。 +该令牌可能出问题,特别是在 Fedora CoreOS 自动更新时。更新过程希望托管主机在收到新数据后至少每隔几周重启一次。 -幸运的是,可以使用 GitHub REST API 来获取这些令牌,并在主机每次重启时自动配置运行器。下面的 `manage-runner.sh` 脚本使用 API 来获取令牌,删除任何已经配置好的运行器,并用新的令牌注册运行器。 +幸运的是,可以使用 GitHub REST API 来获取这些令牌,并在托管主机每次重启时自动配置运行器。下面的 `manage-runner.sh` 脚本使用 API 来获取令牌,删除任何已经配置好的运行器,并用新的令牌注册运行器。 ``` #!/bin/bash @@ -73,7 +73,7 @@ REGISTRATION_TOKEN=$(curl -u ${GITHUB_USER}:${GITHUB_TOKEN} -X POST -H "Accept: /usr/local/sbin/actions-runner/config.sh --url https://github.com/cverna/fcos-actions-runner --token ${REGISTRATION_TOKEN} --labels fcos --unattended ``` -上面的脚本使用了一些环境变量,包含 GitHub 用户名和用于验证 REST API 请求的 [个人访问令牌][9]Personal Access Token。个人访问令牌需要存储库权限,以便成功检索运行者注册和移除令牌。该令牌是安全敏感的,所以最好将其存储在一个具有更严格权限的不同文件中。在这个例子中,这个文件是 `actions-runner`。 +上面的脚本使用了一些环境变量,包含 GitHub 用户名和用于验证 REST API 请求的 [个人访问令牌][9]Personal Access Token。个人访问令牌需要存储库权限,以便成功检索运行器的注册和移除令牌。该令牌是安全敏感信息,所以最好将其存储在一个具有更严格权限的不同文件中。在这个例子中,这个文件是 `actions-runner`。 ``` GITHUB_USER= @@ -142,7 +142,7 @@ systemd: 这将创建两个服务:`github-runner-configure.service`(在主机启动完成后运行一次)和 `github-runner.service`(运行 Actions 运行器二进制文件并等待新的 CI/CD 作业)。 -现在 Butane 配置已经完成,从中生成一个 Ignition 文件并配备一个Fedora CoreOS Actions 运行器。 +现在 Butane 配置已经完成,从中生成一个 Ignition 文件并配备一个 Fedora CoreOS Actions 运行器。 ``` $ podman run -i --rm -v $PWD:/code:z --workdir /code quay.io/coreos/butane:release --pretty --strict --files-dir /code config.yaml -o config.ignition @@ -150,9 +150,9 @@ $ podman run -i --rm -v $PWD:/code:z --workdir /code quay.io/coreos/butane:relea 一旦 Ignition 文件生成,它就可以用来在 [支持][10] Fedora CoreOS 的平台上配备一个运行器。 -### 配置一个 Action 来使用一个自我托管的运行器 +### 配置一个 Action 来使用一个自托管的运行器 -下面的测试 Action 工作流程将测试 FCOS 的自我托管的工作者。在你的 git 存储库中创建以下文件 `.github/workflows/main.yml`。 +下面的测试 Action 工作流程将测试 FCOS 的自托管的运行器。在你的 git 存储库中创建以下文件 `.github/workflows/main.yml`。 ``` # This is a basic workflow to help you get started with Actions @@ -195,7 +195,7 @@ via: https://fedoramagazine.org/run-github-actions-on-fedora-coreos/ 作者:[Clément Verna][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 ce496fbf792a052a046f7702bbee408b8091bcd9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 Oct 2021 11:03:57 +0800 Subject: [PATCH 0584/1588] PUB @wxy https://linux.cn/article-13846-1.html --- .../20210721 Run GitHub Actions on Fedora CoreOS.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210721 Run GitHub Actions on Fedora CoreOS.md (99%) diff --git a/translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md b/published/20210721 Run GitHub Actions on Fedora CoreOS.md similarity index 99% rename from translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md rename to published/20210721 Run GitHub Actions on Fedora CoreOS.md index 60b032190c..0a6ce8b4b6 100644 --- a/translated/tech/20210721 Run GitHub Actions on Fedora CoreOS.md +++ b/published/20210721 Run GitHub Actions on Fedora CoreOS.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13846-1.html) 在 Fedora CoreOS 上运行 GitHub Actions ====== From 1e9fd6f8bbbee7dbedd592bafb86e7c238fa6088 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 3 Oct 2021 11:11:24 +0800 Subject: [PATCH 0585/1588] APL --- ...Comparing Linux Mint and Fedora- Which One Should You Use.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md b/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md index 631a60e504..f12afb8fea 100644 --- a/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md +++ b/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md @@ -2,7 +2,7 @@ [#]: via: (https://itsfoss.com/linux-mint-vs-fedora/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 83c5cdc2d530eff26773b71912c72b56a6ddc06a Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sun, 3 Oct 2021 20:25:39 +0800 Subject: [PATCH 0586/1588] translated --- ...an by writing a -guess the number- game.md | 134 ------------------ ...an by writing a -guess the number- game.md | 129 +++++++++++++++++ 2 files changed, 129 insertions(+), 134 deletions(-) delete mode 100644 sources/tech/20210104 Learn Fortran by writing a -guess the number- game.md create mode 100644 translated/tech/20210104 Learn Fortran by writing a -guess the number- game.md diff --git a/sources/tech/20210104 Learn Fortran by writing a -guess the number- game.md b/sources/tech/20210104 Learn Fortran by writing a -guess the number- game.md deleted file mode 100644 index 89292005f8..0000000000 --- a/sources/tech/20210104 Learn Fortran by writing a -guess the number- game.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Learn Fortran by writing a "guess the number" game) -[#]: via: (https://opensource.com/article/21/1/fortran) -[#]: author: (Jim Hall https://opensource.com/users/jim-hall) - -Learn Fortran by writing a "guess the number" game -====== -Because Fortran was written in the punched card era, its syntax is -pretty limited. But you can still write useful and interesting programs -with it. -![Person typing on a 1980's computer][1] - -The first compiled programming language I learned was Fortran 77. While growing up, I taught myself how to write programs in BASIC on the Apple II and later in QBasic on DOS. But when I went to university to study physics, I learned [Fortran][2]. - -Fortran used to be quite common in scientific computing. And once upon a time, all computer systems had a Fortran compiler. Fortran used to be as ubiquitous as Python is today. So if you were a physics student like me, working in the 1990s, you learned Fortran. - -I always thought Fortran was somewhat similar to BASIC, so I quickly took to Fortran whenever I needed to write a quick program to analyze lab data or perform some other numerical analysis. And when I got bored, I wrote a "Guess the number" game in Fortran, where the computer picks a number between one and 100 and asks me to guess the number. The program loops until I guess correctly. - -The "Guess the number" program exercises several concepts in programming languages: how to assign values to variables, how to write statements, and how to perform conditional evaluation and loops. It's a great practical experiment for learning a new programming language. - -### The basics of Fortran programming - -While Fortran has been updated over the years, I am most familiar with Fortran 77, the implementation I learned years ago. Fortran was created when programmers wrote programs on punched cards, so "classic" Fortran is limited to the data you could put on a punched card. That means you could only write classic Fortran programs with these limitations: - - * Only one line of source code per card is allowed. - * Only columns 1–72 are recognized (the last eight columns, 73-80, are reserved for the card sorter). - * Line numbers ("labels") are in columns 1–5. - * Program statements go in columns 7–72. - * To continue a program line, enter a continuation character (usually `+`) in column 6. - * To create a comment line, enter `C` or `*` in column 1. - * Only the characters `A` to `Z` (uppercase), `0` to `9` (numbers), and the special characters `= + - * / ( ) , . $ ' :` and space are used. - - - -With these limitations, you can still write very useful and interesting programs. - -### Guess the number in Fortran - -Explore Fortran by writing the "Guess the number" game. This is my implementation: - - -``` -CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -C     PROGRAM TO GUESS A NUMBER 1-100 -CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC -      PROGRAM GUESSNUM -      INTEGER SEED, NUMBER, GUESS - -      PRINT *, 'ENTER A RANDOM NUMBER SEED' -      READ *, SEED -      CALL SRAND(SEED) - -      NUMBER = INT( RAND(0) * 100 + 1 ) - -      PRINT *, 'GUESS A NUMBER BETWEEN 1 AND 100' - 10   READ *, GUESS - -      IF (GUESS.LT.NUMBER) THEN -         PRINT *, 'TOO LOW' -      ELSE IF (GUESS.GT.NUMBER) THEN -         PRINT *, 'TOO HIGH' -      ENDIF - -      IF (GUESS.NE.NUMBER) GOTO 10 - -      PRINT *, 'THATS RIGHT!' -      END -``` - -If you are familiar with other programming languages, you can probably figure out what this program is doing by reading the source code. The first three lines are a comment block to indicate the program's function. The fourth line, `PROGRAM GUESSNUM`, identifies this as a program, and it is closed by the `END` statement on the last line. - -After defining a few variables, the program prompts the user to enter a random number seed. A Fortran program cannot initialize the random number generator from the operating system, so you must always start the random number generator with a "seed" value and the `SRAND` subroutine. - -Fortran generates random numbers between 0 and 0.999... with the `RAND(0)` function. The `0` value tells the `RAND` function to generate another random number. Multiply this random number by 100 to generate a number between 0 and 99.999…, and then add 1 to get a value between 1 and 100.999… The `INT` function truncates this to an integer; thus, the variable `NUMBER` is a random number between 1 and 100. - -The program prompts the user, then enters a loop. Fortran doesn't support the `while` or `do-while` loops available in more modern programming languages. Instead, you must construct your own using labels (line numbers) and `GOTO` statements. That's why the `READ` statement has a line number; you can jump to this label with the `GOTO` at the end of the loop. - -Punched cards did not have the `<` (less than) or `>` (greater than) symbols, so Fortran adopted a different syntax to compare values. To test if one value is less than another, use the `.LT.` (less than) comparison. To test if a value is greater than another, use `.GT.` (greater than). Equal and not equal are `.EQ.` and `.NE.`, respectively. - -In each iteration of the loop, the program tests the user's guess. If the user's guess is less than the random number, the program prints `TOO LOW`, and if the guess is greater than the random number, the program prints `TOO HIGH`. The loop continues until the user's guess is the same as the random number. - -When the loop exits, the program prints `THATS RIGHT!` and ends immediately. - - -``` -$ gfortran -Wall -o guess guess.f - -$ ./guess - ENTER A RANDOM NUMBER SEED -93759 - GUESS A NUMBER BETWEEN 1 AND 100 -50 - TOO LOW -80 - TOO HIGH -60 - TOO LOW -70 - TOO LOW -75 - TOO HIGH -73 - TOO LOW -74 - THATS RIGHT! -``` - -Every time you run the program, the user needs to enter a different random number seed. If you always enter the same seed, the program will always pick the same random number. - -### Try it in other languages - -This "guess the number" game is a great introductory program when learning a new programming language because it exercises several common programming concepts in a pretty straightforward way. By implementing this simple game in different programming languages, you can demonstrate some core concepts and compare each language's details. - -Do you have a favorite programming language? How would you write the "guess the number" game in it? Follow this article series to see examples of other programming languages that might interest you. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/1/fortran - -作者:[Jim Hall][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/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) -[2]: https://en.wikipedia.org/wiki/Fortran diff --git a/translated/tech/20210104 Learn Fortran by writing a -guess the number- game.md b/translated/tech/20210104 Learn Fortran by writing a -guess the number- game.md new file mode 100644 index 0000000000..68103275ca --- /dev/null +++ b/translated/tech/20210104 Learn Fortran by writing a -guess the number- game.md @@ -0,0 +1,129 @@ +[#]: collector: (lujun9972) +[#]: translator: (unigeorge) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Learn Fortran by writing a "guess the number" game) +[#]: via: (https://opensource.com/article/21/1/fortran) +[#]: author: (Jim Hall https://opensource.com/users/jim-hall) + +通过写“猜数字”游戏学习 Fortran +====== + +Fortran 是在打孔卡时代编写的语言,因此它的语法非常有限。但你仍然可以用它编写有用和有趣的程序。 +![Person typing on a 1980's computer][1] + +Fortran 77 是我学习的第一门编译型编程语言。一开始时,我自学了如何在 Apple II 上用 BASIC 编写程序,后来又学会在 DOS 上用 QBasic 编写程序。但是当我去大学攻读物理学时,我又学习了 [Fortran][2]。 + +Fortran 曾经在科学计算中很常见。曾几何时,所有计算机系统都有一个 Fortran 编译器。Fortran 曾经像今天的 Python 一样无处不在。因此,如果你是像我这样的物理学专业学生,在 1990 年代工作,那你肯定学习了 Fortran。 + +我一直认为 Fortran 与 BASIC 有点相似,所以每当我需要编写一个简短程序,来分析实验室数据或执行其他一些数值分析时,我都会很快想到 Fortran。我在空闲时用 Fortran 编写了一个“猜数字”游戏,其中计算机会在 1 到 100 之间选择一个数字,并让我猜这个数字。程序会一直循环,直到我猜对了为止。 + +“猜数字”程序练习了编程语言中的几个概念:如何为变量赋值、如何编写语句以及如何执行条件判断和循环。这是学习新编程语言时一个很好的的实践案例。 + +### Fortran 编程基础 + +虽然 Fortran 这些年来一直在更新,但我最熟悉的还是 Fortran 77,这是我多年前学习的实现版本。Fortran 是程序员还在打孔卡上编程的年代创建的,因此“经典”Fortran 仅限于处理可以放在打孔卡上的数据。这意味着你只能编写符合以下限制条件的经典 Fortran 程序(LCTT 译注:后来的 Fortran 95 等版本已经对这些限制做了很大的改进,如有兴趣**建议直接学习新版**): + + * 每张卡只允许一行源代码。 + * 仅识别第 1-72 列(最后八列,73-80,保留给卡片分类器)。 + * 行号(“标签”)位于第 1-5 列。 + * 程序语句在第 7-72 列。 + * 要表示跨行,请在第 6 列中输入一个连续字符(通常是 `+`)。 + * 要创建注释行,请在第 1 列中输入 `C` 或 `*`。 + * 只有字符`A` 到`Z`(大写字母)、`0` 到`9`(数字)和特殊字符`= + - * / ( ) , . $ ' :` 和空格能够使用。 + +虽然有这些限制,你仍然可以编写非常有用和有趣的程序。 + +### 在 Fortran 中猜数字 + +通过编写“猜数字”游戏来探索 Fortran。这是我的实现代码: + +``` +CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +C     PROGRAM TO GUESS A NUMBER 1-100 +CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC +      PROGRAM GUESSNUM +      INTEGER SEED, NUMBER, GUESS + +      PRINT *, 'ENTER A RANDOM NUMBER SEED' +      READ *, SEED +      CALL SRAND(SEED) + +      NUMBER = INT( RAND(0) * 100 + 1 ) + +      PRINT *, 'GUESS A NUMBER BETWEEN 1 AND 100' + 10   READ *, GUESS + +      IF (GUESS.LT.NUMBER) THEN +         PRINT *, 'TOO LOW' +      ELSE IF (GUESS.GT.NUMBER) THEN +         PRINT *, 'TOO HIGH' +      ENDIF + +      IF (GUESS.NE.NUMBER) GOTO 10 + +      PRINT *, 'THATS RIGHT!' +      END +``` + +如果你熟悉其他编程语言,你大概可以通过阅读源代码来弄清楚这个程序在做什么。前三行是注释块,表示程序的功能。第四行 `PROGRAM GUESSNUM` 将其标识为一个 程序program,并由最后一行的 `END` 语句关闭。 + +定义变量后,程序会提示用户输入随机数种子。Fortran 程序无法从操作系统初始化随机数生成器,因此你必须始终使用“种子”值和 `SRAND` 子程序subroutine 启动随机数生成器。 + +Fortran 使用 `RAND(0)` 函数生成 0 到 0.999…… 之间的随机数。参数 `0` 告诉 `RAND` 函数生成一个随机数。将此随机数乘以 100 以生成 0 到 99.999…… 之间的数字,然后加 1 得到 1 到 100.999…… 之间的值。`INT` 函数将结果截断为整数;因此,变量 `NUMBER` 就是一个介于 1 到 100 之间的随机数。 + +程序会给出提示,然后进入一个循环。Fortran 不支持更现代的编程语言中可用的 `while` 或 `do-while` 循环(LCTT 译注:Fortran 95 等新版支持,也因此在一定程度上减少了 `GOTO` 的使用)。相反,你必须使用标签(行号)和 `GOTO` 语句来构建自己的循环。这就是 `READ` 语句有一个行号的原因:你可以在循环末尾使用 `GOTO` 跳转到此标签。 + +穿孔卡片没有 `<`(小于)和 `>`(大于)符号,因此 Fortran 采用了另一种语法来进行值比较。要测试一个值是否小于另一个值,请使用 `.LT.`(小于)。要测试一个值是否大于另一个值,请使用 `.GT.`(大于)。等于和不等于分别是 `.EQ.` 和 `.NE.`。 + +在每次循环中,程序都会验证用户的猜测值。如果用户的猜测值小于随机数,程序打印 `TOO LOW`,如果猜测大于随机数,程序打印 `TOO HIGH`。循环会一直持续,直到用户的猜测值等于目标随机数为止。 + +当循环退出时,程序打印 `THATS RIGHT!` 并立即结束运行。 + +``` +$ gfortran -Wall -o guess guess.f + +$ ./guess + ENTER A RANDOM NUMBER SEED +93759 + GUESS A NUMBER BETWEEN 1 AND 100 +50 + TOO LOW +80 + TOO HIGH +60 + TOO LOW +70 + TOO LOW +75 + TOO HIGH +73 + TOO LOW +74 + THATS RIGHT! +``` + +每次运行程序时,用户都需要输入不同的随机数种子。如果你总是输入相同的种子,程序给出的随机数也会一直不变。 + +### 在其他语言中尝试 + +在学习一门新的编程语言时,这个“猜数字”游戏是一个很好的入门程序,因为它以非常简单的方式练习了几个常见的编程概念。通过用不同的编程语言实现这个简单的游戏,你可以弄清一些核心概念以及比较每种语言的细节。 + +你有最喜欢的编程语言吗?如何用你最喜欢的语言来编写“猜数字”游戏?跟随本系列文章来查看你可能感兴趣的其他编程语言示例吧。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/1/fortran + +作者:[Jim Hall][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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/1980s-computer-yearbook.png?itok=eGOYEKK- (Person typing on a 1980's computer) +[2]: https://en.wikipedia.org/wiki/Fortran From 947701cfb1bcc2e6432ac99cb198d7a28d4c0b77 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 4 Oct 2021 05:07:01 +0800 Subject: [PATCH 0587/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211003?= =?UTF-8?q?=20Open=20Source=20Changed=20Linux=20Otherwise=20It=20Was=20Don?= =?UTF-8?q?e:=20Linus=20Torvalds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md --- ...x Otherwise It Was Done- Linus Torvalds.md | 59 +++++++++++++++++++ 1 file changed, 59 insertions(+) create mode 100644 sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md diff --git a/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md b/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md new file mode 100644 index 0000000000..2f3d727a51 --- /dev/null +++ b/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md @@ -0,0 +1,59 @@ +[#]: subject: "Open Source Changed Linux Otherwise It Was Done: Linus Torvalds" +[#]: via: "https://news.itsfoss.com/open-source-changed-linux-torvalds/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open Source Changed Linux Otherwise It Was Done: Linus Torvalds +====== + +You probably already know the story. 30 years ago, Finnish student Linus Torvalds created a UNIX-like operating system as a hobby project. + +What you do not know is that Torvalds thought that the hobby project was done, and he would have left it behind to work on some new and interesting project. + +So, what made his work on this ‘hobby project’ for 30 years? The answer is open source. + +### Open source changed Linux + +At the recently concluded [Open Source Summit North America event][1], Linus Torvalds shared some insights into the past, present and future of the Linux project. + +While remembering the beginning of the project, [Torvalds said][2] that he’d expected to leave behind Linux in a ‘done state’ to work for something new and interesting. + +> That was clearly then what open source changed. Because suddenly this project — that I probably would’ve left behind, if it was only up to me — I started getting questions about, and eventually patches — that just kept the motivation going. And here we are 30 years later, and it’s still what keeps the motivation going. + +Torvalds also added that as far as he is concerned, Linux is done for the past 29 years. Every other feature that has been added later is about what other people needed, wanted or were interested in. + +Many developers would relate to this. You work on a project and think that it has reached a ‘done’ state. If the project does not get enough traction, you lose interest to work on it and move to something ‘new and exciting’. The real motivation to continue the project comes from the users and the recognition. + +When asked about what they should be doing for the 50th anniversary of Linux, Torvalds said that he doesn’t see himself doing kernel programming at the age of 70. Then he also chipped in that he didn’t imagine himself doing kernel programming at the age of 50 as well and yet he is doing that at present. + +> “Somehow I don’t see myself doing kernel programming when I’m 70. But on the other hand, I didn’t see myself doing kernel programming when I was 50 either, a few years back. So… we’ll see.” + +It is always endearing to listen to Torvalds talking about Linux. So much to learn and to relate as an ardent Linux user, right? + +_Source: [The News Stack][2]_ + +#### 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/open-source-changed-linux-torvalds/ + +作者:[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://events.linuxfoundation.org/open-source-summit-north-america/ +[2]: https://thenewstack.io/linus-torvalds-on-community-rust-and-linuxs-longevity/ From a2dddeec2e8358271308f985eaaba7ff264df8f1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 4 Oct 2021 05:07:09 +0800 Subject: [PATCH 0588/1588] add done: 20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md --- sources/tech/20211003 .md | 16 ++++++++++++++++ sources/tech/20211004 .md | 16 ++++++++++++++++ 2 files changed, 32 insertions(+) create mode 100644 sources/tech/20211003 .md create mode 100644 sources/tech/20211004 .md diff --git a/sources/tech/20211003 .md b/sources/tech/20211003 .md new file mode 100644 index 0000000000..0edc18fcb5 --- /dev/null +++ b/sources/tech/20211003 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/10/linux-mint-20-3-christmas/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + diff --git a/sources/tech/20211004 .md b/sources/tech/20211004 .md new file mode 100644 index 0000000000..4eb560068f --- /dev/null +++ b/sources/tech/20211004 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/10/pop-os-21-10-arm64/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From c5c51ed12230dca68acd8c1fedc08b4bf058378f Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Oct 2021 10:53:37 +0800 Subject: [PATCH 0589/1588] Delete 20211003 .md --- sources/tech/20211003 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20211003 .md diff --git a/sources/tech/20211003 .md b/sources/tech/20211003 .md deleted file mode 100644 index 0edc18fcb5..0000000000 --- a/sources/tech/20211003 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/10/linux-mint-20-3-christmas/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From d7d3055984b37c4a70d30a8a0142207532c80c24 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 4 Oct 2021 10:53:51 +0800 Subject: [PATCH 0590/1588] Delete 20211004 .md --- sources/tech/20211004 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20211004 .md diff --git a/sources/tech/20211004 .md b/sources/tech/20211004 .md deleted file mode 100644 index 4eb560068f..0000000000 --- a/sources/tech/20211004 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/10/pop-os-21-10-arm64/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 4dd2050b64b9994e171706deba731078b5759b6f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 Oct 2021 12:16:52 +0800 Subject: [PATCH 0591/1588] PRF&TSL --- ...nt and Fedora- Which One Should You Use.md | 184 ------------------ ...nt and Fedora- Which One Should You Use.md | 184 ++++++++++++++++++ 2 files changed, 184 insertions(+), 184 deletions(-) delete mode 100644 sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md create mode 100644 translated/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md diff --git a/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md b/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md deleted file mode 100644 index f12afb8fea..0000000000 --- a/sources/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md +++ /dev/null @@ -1,184 +0,0 @@ -[#]: subject: (Comparing Linux Mint and Fedora: Which One Should You Use?) -[#]: via: (https://itsfoss.com/linux-mint-vs-fedora/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Comparing Linux Mint and Fedora: Which One Should You Use? -====== - -Linux Mint is a [popular Linux distribution tailored for beginners][1] while providing a similar experience to former Windows users. In fact, it does a [few things better than Ubuntu][2], which makes it a suitable choice for every type of user. - -It is completely community-powered, on top of Ubuntu as its base. - -On the other hand, Fedora is a cutting-edge distribution that focuses on incorporating exciting changes that eventually makes it way to Red Hat Enterprise Linux (RHEL). - -Unlike Linux Mint, Fedora does not exclusively focus on personal use (or non-developers). Even though they offer a workstation edition, they aim for developers and experienced Linux users. - -### Fedora or Mint: What Should You Go For? - -While we know that Fedora is not exactly geared towards Linux newbies, many users love using Fedora as their daily driver. So, in this article, we shall shed light on some differences between the two to help you pick one to use on your desktop machine. - -#### System Requirements & Hardware Compatibility - -![][3] - -Before choosing any Linux distribution, you should always go through the system requirements and check the hardware compatibility. - -Here, both Linux Mint and Fedora require at least 2 GB of RAM, 20 GB of disk space, and a 1024 x 768 resolution display to get an entry-level experience. - -Yes, the official documentation may mention 1 GB of RAM to start with but let us be practical of your use-case. Unless you have a vintage computer that you want to revive for a specific purpose, it is out of the equation. - -![Linux Mint Resource Usage][4] - -Technically, both support modern and old hardware. You will only know how it works along with the software/driver support when you get it installed. Unless you have a special peripheral or hardware component with specific features, hardware support may not be a big deal. - -Linux Mint 19 series still provide support for 32-bit systems and you can use it till April 2023. Fedora doesn’t support 32-bit systems anymore. - -#### Software Update Cycle - -![Linux Mint Update Manager][5] - -Linux Mint focuses on Long-Term Releases (LTS) with a five-year support. It will be maintained same as Ubuntu. But there is no paid extension like Ubuntu offers. - -Fedora does not offer an LTS release but pushes a new update every 6 months. Every version gets software support for 13 months. You get the ability to skip one version if you want. - -If you just want to have a Linux distro installed for years without requiring the latest technology/features in an update, Linux Mint is the way to go. - -But, if you want to the latest and greatest (which can also break your computing experience ins some rare cases) and accept to adapt with the major changes Fedora pushes, Fedora can be a choice. - -#### Desktop Environment Choices - -![Linux Mint Cinnamon Edition][6] - -Linux Mint provides three different [desktop environments][7] — **MATE, Cinnamon, and Xfce**. All of them will have the same update cycle and will be supported for five years from their release. - -Even though Fedora does not offer LTS releases, you get a variety of desktop choices in the form of Fedora spins. You get KDE, LXQt, MATE, Cinnamon, LXDE, and an edition with i3 tiling window manager baked in. - -![Fedora 34 with GNOME 40][8] - -So, if you want more choices out of the box, Fedora can be a quite exciting choice. - -#### Software Availability - -![Linux Mint’s Software Center and Package Manager][9] - -The default repositories of Linux Mint (or Ubuntu’s) offer a wide range of software to install. But Fedora’s default repository sticks only to open-source applications. - -Not just limited to that, Linux Mint also comes packed with [Synaptic Package Manager][10] which is an impressive lightweight tool to install software. - -Even though you can [enable third-party repositories in Fedora][11], it is yet an additional step. Also, the RPM Fusion repository may not be as huge as Ubuntu’s universe repository. - -![Fedora 34 Software Center][12] - -So, with Linux Mint, overall, you get more packages available to install and more ways to install software, out of the box. - -#### Ease of Use & Installation - -For an entirely new user, Ubuntu or any Ubuntu-based distribution generally fares well to start with. - -Starting from the [installation experience in Ubuntu][13] to the ease of [installing software][14] while having the option to opt for an LTS release is what a beginner finds handy. - -And, Linux Mint naturally presents the same benefits of Ubuntu with Ubiquity installer – hence, it offers a minimal learning curve, easy to install and easy to use. - -While Fedora is not complex by definition but the installation options, package manager, and lack of software in the default repositories may prove to be a time-consuming factor. - -If you’ve never tried it, I suggest you to go through our [Fedora installation guide for VirtualBox][15]. It is a good way to test the installation experience before trying it out on your production system of any sort. - -#### Out of the Box Experience - -The most hassle-free experience is usually the pleasant option. Well, for most people. - -Now, you need to understand that depending on the hardware configuration, every user might end up having a different “out-of-the-box” experience. - -But, for a reference, let me just give you my example for both Fedora and Linux Mint. - -Considering I’m rocking an NVIDIA GPU on my PC, I need to install the proprietary drivers for the best performance. - -![][16] - -And, when I booted up Linux Mint, installing the drivers were pretty easy using the **Driver Manager** app. - -But, with Fedora, even though I followed our guide on [installing Nvidia drivers in Fedora][17], I was presented with an error when I rebooted. - -![Installing NVIDIA drivers in Fedora][18] - -Not just that, for some reason, my wired network did not seem to be active – hence, I had no internet connectivity. - -Yes, you should always try to troubleshoot when you run into issues, but I did not need to do that for Linux Mint. So, in my experience, I will recommend Linux Mint with a better out of the experience. - -#### Documentation - -I would recommend going for [Fedora’s documentation][19] if you rely on resources and want to challenge yourself with a decent learning experience along the process. - -You will find up-to-date information for recent and latest Fedora releases, which is a good thing. - -On the other hand, [Linux Mint’s documentation][20] is not regularly updated but useful when you want to dig deeper. - -#### Community Support - -You will get a good community support for both. The [Linux Mint forums][21] is a basic platform which is easy to use and gets the job done. - -[Fedora’s forum][22] is powered by Discourse, which happens to be one of the most [popular modern open-source forum software][23]. - -#### Corporate vs Community Angle - -Fedora is backed up by the biggest open-source company [Red Hat][24] – so you get a good level of constant innovation and support for the long run. - -However, just because Fedora is not built for the daily computer users in mind, the choices made with every release may affect your user experience entirely. - -On the other hand, Linux Mint is completely backed up by a passionate Linux community focusing on making Linux easier and reliable for everyday use. Of course, it depends on Ubuntu as the base but Linux Mint does make bold changes if the community does not like something from the upstream. - -For instance, Linux Mint disabled snaps by default unlike official Ubuntu distro. So, you will have to [enable snaps in Linux Mint][25] if you want to use them. - -### Wrapping Up - -If you want a no-nonsense and easy to use operating system for your home computer, Linux Mint would be my suggestion. But, if you want to experience the latest and greatest, while taking a little adventure in your Linux learning experience, Fedora can be a good pick. - -While every operating system requires some form of troubleshooting and nothing can guarantee zero issues with your hardware, I think Linux Mint will have potentially no issues for the majority of the users. - -In any case, you can re-visit the comparison points mentioned above to see what matters most for your computer. - -What do you think? Would you pick Fedora over Mint? And, Why? Let me know in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/linux-mint-vs-fedora/ - -作者:[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://itsfoss.com/best-linux-beginners/ -[2]: https://itsfoss.com/linux-mint-vs-ubuntu/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-about.png?resize=1020%2C709&ssl=1 -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-resources.png?resize=800%2C293&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-update-manager.png?resize=819%2C612&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-cinnamon-desktop.png?resize=800%2C450&ssl=1 -[7]: https://itsfoss.com/best-linux-desktop-environments/ -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-desktop.png?resize=800%2C478&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-software-sources.png?resize=800%2C385&ssl=1 -[10]: https://itsfoss.com/synaptic-package-manager/ -[11]: https://itsfoss.com/fedora-third-party-repos/ -[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-software.png?resize=1055%2C691&ssl=1 -[13]: https://itsfoss.com/install-ubuntu/ -[14]: https://itsfoss.com/remove-install-software-ubuntu/ -[15]: https://itsfoss.com/install-fedora-in-virtualbox/ -[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/linux-mint-driver-manager.jpg?resize=800%2C548&ssl=1 -[17]: https://itsfoss.com/install-nvidia-drivers-fedora/ -[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-nvidia-driver-installation.png?resize=706%2C516&ssl=1 -[19]: https://docs.fedoraproject.org/en-US/docs/ -[20]: https://linuxmint.com/documentation.php -[21]: https://forums.linuxmint.com -[22]: https://ask.fedoraproject.org -[23]: https://itsfoss.com/open-source-forum-software/ -[24]: https://www.redhat.com/en -[25]: https://itsfoss.com/enable-snap-support-linux-mint/ diff --git a/translated/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md b/translated/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md new file mode 100644 index 0000000000..15b1c6425d --- /dev/null +++ b/translated/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md @@ -0,0 +1,184 @@ +[#]: subject: (Comparing Linux Mint and Fedora: Which One Should You Use?) +[#]: via: (https://itsfoss.com/linux-mint-vs-fedora/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux Mint 和 Fedora:应该使用哪一个? +====== + +Linux Mint 是一个 [为初学者定制的流行的 Linux 发行版][1],同时为用户提供了与 Windows 类似的体验。事实上,它有 [一些地方比 Ubuntu 做的更好][2],这使它成为每一类用户的合适选择。 + +它是基于 Ubuntu 的,完全由社区所支持。 + +另一方面,Fedora 是一个尝鲜发行版,它专注于纳入令人兴奋的变化,最终使其成为红帽企业 Linux(RHEL)的一部分。 + +与 Linux Mint 不同,Fedora 并不完全专注于个人(或非开发者)使用。即使他们提供了一个工作站版本,其目标也是开发者和有经验的 Linux 用户。 + +### Fedora 或 Mint,应该根据什么选择? + +虽然我们知道 Fedora 并不是完全面向 Linux 新手的,但许多用户喜欢使用 Fedora 作为他们的日常系统。因此,在这篇文章中,我们将阐明两者之间的一些区别,以帮助你选择一个在你的台式机上使用的操作系统。 + +#### 系统要求 & 硬件兼容性 + +![][3] + +在选择任何 Linux 发行版之前,你都应该看一下它的系统要求,并检查硬件兼容性。 + +在这方面,Linux Mint 和 Fedora 都需要至少 2GB 的内存、20GB 的磁盘空间,以及 1024 x 768 分辨率的显示器来获得入门级的体验。 + +是的,官方文件可能提到 1GB 内存就可以起步,但要看实际使用情况。除非你有一台复古的电脑,想为一个特定的目的恢复它,否则它就不在考虑范围之内。 + +![Linux Mint 资源使用情况][4] + +在技术上,两者都支持现代的和陈旧的硬件,你只有在安装时才会知道软件/驱动是否支持它。除非你有一个特殊的外围设备或具有特殊功能的硬件组件,否则硬件支持可能不是什么大问题。 + +Linux Mint 19 系列仍然提供了对 32 位系统的支持,你可以使用它到 2023 年 4 月。而 Fedora 已经不支持 32 位系统了。 + +#### 软件更新周期 + +![Linux Mint 更新管理器][5] + +Linux Mint 专注于长期发布版(LTS),支持时间为五年。它的维护方式与 Ubuntu 相同。但没有像 Ubuntu 那样提供付费的扩展支持。 + +Fedora 不提供 LTS 版本,而是每 6 个月推送一次新的更新,每个版本都会得到 13 个月的软件支持。如果你愿意,你可以跳过一个版本。 + +如果你只是想安装一个可以使用多年的 Linux 发行版,而不在乎是不是最新的技术/功能,那么 Linux Mint 是个不错的选择。 + +但是,如果你想要最新的和最伟大的 Linux 技术(在一些罕见的情况下,这也可能破坏你的计算体验),并接受适应 Fedora 推动的重大变化,Fedora 可以是一个选择。 + +#### 桌面环境的选择 + +![Linux Mint Cinnamon 版][6] + +Linux Mint 提供三种不同的 [桌面环境][7]:MATE、Cinnamon 和 Xfce。它们有相同的更新周期,并从发布之日起支持 5 年。 + +尽管 Fedora 不提供 LTS 版本,但你可以通过 Fedora spins 的形式选择各种桌面。你可以得到 KDE、LXQt、MATE、Cinnamon、LXDE,以及一个内置 i3 平铺窗口管理器的版本。 + +![Fedora 34 with GNOME 40][8] + +所以,如果你想有更多的选择,Fedora 可以是一个相当令人激动的选择。 + +#### 软件可用性 + +![Linux Mint 的软件中心和软件包管理器][9] + +Linux Mint(或 Ubuntu)的默认软件库提供了大量可以安装的软件,而 Fedora 的默认软件库只坚持提供开源软件。 + +不仅仅限于此,Linux Mint 还配备了 [Synaptic 软件包管理器][10],这是一个令人印象深刻的安装软件的轻量级工具。 + +尽管你可以 [在 Fedora 中启用第三方软件库][11],但这又是一个额外的步骤。而且,RPM Fusion 存储库可能没有 Ubuntu 的 universe 存储库那么庞大。 + +![Fedora 34 软件中心][12] + +所以,对于 Linux Mint 来说,总的来说,你可以得到更多可安装的软件包和各种安装软件的方法,开箱即用。 + +#### 使用和安装的便利性 + +对于一个 Linux 的新嫩用户来说,Ubuntu 或任何基于 Ubuntu 的发行版通常都是一个很好的开端。 + +从 [Ubuntu 的安装体验][13],到 [安装软件][14] 的简便性,同时还可以选择 LTS 版本,这让初学者觉得很方便。 + +而且,借助 Ubiquity 安装程序,Linux Mint 自然也有与 Ubuntu 相同的好处,因此,它的学习曲线最小,易于安装,易于使用。 + +虽然从表面上看 Fedora 并不复杂,但安装选项、软件包管理器以及默认存储库中缺乏的软件可能是一个耗时的因素。 + +如果你没有尝试过,我建议你试试我们的 [VirtualBox 版的 Fedora 安装指南][15]。这是一个测试安装体验的好方法,然后再在你的任何生产系统上进行尝试。 + +#### 开箱即用的体验 + +最省事的体验通常是令人愉快的选择。嗯,对大多数人来说。 + +现在,你需要明白,根据硬件配置的不同,每个用户最终可能会有不同的“开箱即用”体验。 + +但是,作为参考,让我给你举个 Fedora 和 Linux Mint 的例子。 + +考虑到我的电脑上使用的是 NVIDIA GPU,我需要安装专有的驱动程序以获得最佳性能。 + +![][16] + +而且,当我启动 Linux Mint 时,使用“驱动程序管理器”应用程序,安装驱动程序相当容易。 + +但是,对于 Fedora,即使我按照我们的 [在 Fedora 中安装 Nvidia 驱动程序][17] 的指南,我在重启时还是出现了一个错误。 + +![在 Fedora 中安装 NVIDIA 驱动程序][18]。 + +不仅如此,由于某些原因,我的有线网络似乎没有被激活,因此,我没有互联网连接。 + +是的,当你遇到问题时,你总是可以尝试着去排除故障,但是对于 Linux Mint,我不需要这么做。所以,根据我的经验,我会推荐 Linux Mint,它有更好的开箱体验。 + +#### 文档 + +如果你依赖于文档资源并想在这个过程中挑战自己,获得不错的学习经验,我推荐你去看看 [Fedora 的文档][19]。 + +你会发现最近和最新的 Fedora 版本的最新信息,这是件好事。 + +另一方面,[Linux Mint 的文档][20] 没有定期更新,但在你想深入挖掘时很有用。 + +#### 社区支持 + +你会得到一个良好的社区支持。[Linux Mint 的论坛][21] 是一个很基础的平台,容易使用并能解决问题。 + +[Fedora 的论坛][22] 是由 Discourse 驱动的,它是最 [流行的现代开源论坛软件][23] 之一。 + +#### 企业与社区的角度 + +Fedora 得到了最大的开源公司 [红帽][24] 的支持 —— 因此你可以得到良好的持续创新和长期的支持。 + +然而,正因为 Fedora 并不是为日常电脑用户而建立的,每一个版本的选择都可能完全影响你的用户体验。 + +另一方面,Linux Mint 完全由一个充满激情的 Linux 社区所支持,专注于使 Linux 在日常使用中更加容易和可靠。当然,它依赖于 Ubuntu 作为基础,但如果社区不喜欢上游的东西,Linux Mint 也会做出大胆的改变。 + +例如,Linux Mint 与 Ubuntu 官方发行版不同,默认情况下禁用了 snap。所以,如果你想使用它们,你就必须 [在 Linux Mint 中启用 snap][25]。 + +### 总结 + +如果你想为你的家用电脑选择一个没有问题的、易于使用的操作系统,我的建议是 Linux Mint。但是,如果你想体验最新的、最伟大的 Linux 操作系统,同时在你的 Linux 学习经历中进行一次小小的冒险,Fedora 可以是一个不错的选择。 + +虽然每个操作系统都需要某种形式的故障排除,没有什么能保证你的硬件完全不出问题,但我认为 Linux Mint 对大多数用户来说可能没有问题。 + +在任何情况下,你可以重新审视上面提到的比较点,看看什么对你的电脑最重要。 + +你怎么看?你会选择 Fedora 而不是 Mint 吗?还有,为什么?请在下面的评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-mint-vs-fedora/ + +作者:[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://itsfoss.com/best-linux-beginners/ +[2]: https://itsfoss.com/linux-mint-vs-ubuntu/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-about.png?resize=1020%2C709&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-resources.png?resize=800%2C293&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-update-manager.png?resize=819%2C612&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-cinnamon-desktop.png?resize=800%2C450&ssl=1 +[7]: https://itsfoss.com/best-linux-desktop-environments/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-desktop.png?resize=800%2C478&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/05/linux-mint-software-sources.png?resize=800%2C385&ssl=1 +[10]: https://itsfoss.com/synaptic-package-manager/ +[11]: https://itsfoss.com/fedora-third-party-repos/ +[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-34-software.png?resize=1055%2C691&ssl=1 +[13]: https://itsfoss.com/install-ubuntu/ +[14]: https://itsfoss.com/remove-install-software-ubuntu/ +[15]: https://itsfoss.com/install-fedora-in-virtualbox/ +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/03/linux-mint-driver-manager.jpg?resize=800%2C548&ssl=1 +[17]: https://itsfoss.com/install-nvidia-drivers-fedora/ +[18]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/05/fedora-nvidia-driver-installation.png?resize=706%2C516&ssl=1 +[19]: https://docs.fedoraproject.org/en-US/docs/ +[20]: https://linuxmint.com/documentation.php +[21]: https://forums.linuxmint.com +[22]: https://ask.fedoraproject.org +[23]: https://itsfoss.com/open-source-forum-software/ +[24]: https://www.redhat.com/en +[25]: https://itsfoss.com/enable-snap-support-linux-mint/ From d273f8f653ffd283e9f4ec4e3987772130438577 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 Oct 2021 12:37:06 +0800 Subject: [PATCH 0592/1588] PUB @wxy https://linux.cn/article-13848-1.html --- ...Comparing Linux Mint and Fedora- Which One Should You Use.md | 2 ++ 1 file changed, 2 insertions(+) rename {translated/tech => published}/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md (99%) diff --git a/translated/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md b/published/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md similarity index 99% rename from translated/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md rename to published/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md index 15b1c6425d..6e1772bacf 100644 --- a/translated/tech/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md +++ b/published/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md @@ -10,6 +10,8 @@ Linux Mint 和 Fedora:应该使用哪一个? ====== +![](https://img.linux.net.cn/data/attachment/album/202110/04/123523kzzm3x4yr2ppmfj9.jpg) + Linux Mint 是一个 [为初学者定制的流行的 Linux 发行版][1],同时为用户提供了与 Windows 类似的体验。事实上,它有 [一些地方比 Ubuntu 做的更好][2],这使它成为每一类用户的合适选择。 它是基于 Ubuntu 的,完全由社区所支持。 From 2236941e65f032261e754ff78907f69eb87ff779 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 Oct 2021 12:40:03 +0800 Subject: [PATCH 0593/1588] PRF --- ...Comparing Linux Mint and Fedora- Which One Should You Use.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md b/published/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md index 6e1772bacf..a53b8aef60 100644 --- a/published/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md +++ b/published/20210607 Comparing Linux Mint and Fedora- Which One Should You Use.md @@ -106,7 +106,7 @@ Linux Mint(或 Ubuntu)的默认软件库提供了大量可以安装的软件 但是,对于 Fedora,即使我按照我们的 [在 Fedora 中安装 Nvidia 驱动程序][17] 的指南,我在重启时还是出现了一个错误。 -![在 Fedora 中安装 NVIDIA 驱动程序][18]。 +![在 Fedora 中安装 NVIDIA 驱动程序][18] 不仅如此,由于某些原因,我的有线网络似乎没有被激活,因此,我没有互联网连接。 From daf8bb99be07b9d864b12b02ce970a4e2b49e914 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 Oct 2021 12:54:16 +0800 Subject: [PATCH 0594/1588] PRF&PUB @unigeorge https://linux.cn/article-13849-1.html --- ...tran by writing a -guess the number- game.md | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) rename {translated/tech => published}/20210104 Learn Fortran by writing a -guess the number- game.md (89%) diff --git a/translated/tech/20210104 Learn Fortran by writing a -guess the number- game.md b/published/20210104 Learn Fortran by writing a -guess the number- game.md similarity index 89% rename from translated/tech/20210104 Learn Fortran by writing a -guess the number- game.md rename to published/20210104 Learn Fortran by writing a -guess the number- game.md index 68103275ca..a39854453d 100644 --- a/translated/tech/20210104 Learn Fortran by writing a -guess the number- game.md +++ b/published/20210104 Learn Fortran by writing a -guess the number- game.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13849-1.html) [#]: subject: (Learn Fortran by writing a "guess the number" game) [#]: via: (https://opensource.com/article/21/1/fortran) [#]: author: (Jim Hall https://opensource.com/users/jim-hall) @@ -10,8 +10,9 @@ 通过写“猜数字”游戏学习 Fortran ====== -Fortran 是在打孔卡时代编写的语言,因此它的语法非常有限。但你仍然可以用它编写有用和有趣的程序。 -![Person typing on a 1980's computer][1] +> Fortran 是在打孔卡时代编写的语言,因此它的语法非常有限。但你仍然可以用它编写有用和有趣的程序。 + +![](https://img.linux.net.cn/data/attachment/album/202110/04/125311k6uwzpybabayyoag.jpg) Fortran 77 是我学习的第一门编译型编程语言。一开始时,我自学了如何在 Apple II 上用 BASIC 编写程序,后来又学会在 DOS 上用 QBasic 编写程序。但是当我去大学攻读物理学时,我又学习了 [Fortran][2]。 @@ -23,7 +24,7 @@ Fortran 曾经在科学计算中很常见。曾几何时,所有计算机系统 ### Fortran 编程基础 -虽然 Fortran 这些年来一直在更新,但我最熟悉的还是 Fortran 77,这是我多年前学习的实现版本。Fortran 是程序员还在打孔卡上编程的年代创建的,因此“经典”Fortran 仅限于处理可以放在打孔卡上的数据。这意味着你只能编写符合以下限制条件的经典 Fortran 程序(LCTT 译注:后来的 Fortran 95 等版本已经对这些限制做了很大的改进,如有兴趣**建议直接学习新版**): +虽然 Fortran 这些年来一直在更新,但我最熟悉的还是 Fortran 77,这是我多年前学习的实现版本。Fortran 是程序员还在打孔卡上编程的年代创建的,因此“经典” Fortran 仅限于处理可以放在打孔卡上的数据。这意味着你只能编写符合以下限制条件的经典 Fortran 程序(LCTT 译注:后来的 Fortran 95 等版本已经对这些限制做了很大的改进,如有兴趣**建议直接学习新版**): * 每张卡只允许一行源代码。 * 仅识别第 1-72 列(最后八列,73-80,保留给卡片分类器)。 @@ -31,7 +32,7 @@ Fortran 曾经在科学计算中很常见。曾几何时,所有计算机系统 * 程序语句在第 7-72 列。 * 要表示跨行,请在第 6 列中输入一个连续字符(通常是 `+`)。 * 要创建注释行,请在第 1 列中输入 `C` 或 `*`。 - * 只有字符`A` 到`Z`(大写字母)、`0` 到`9`(数字)和特殊字符`= + - * / ( ) , . $ ' :` 和空格能够使用。 + * 只有字符 `A` 到`Z`(大写字母)、`0` 到`9`(数字)和特殊字符 `= + - * / ( ) , . $ ' :` 和空格能够使用。 虽然有这些限制,你仍然可以编写非常有用和有趣的程序。 @@ -119,7 +120,7 @@ via: https://opensource.com/article/21/1/fortran 作者:[Jim Hall][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 af967bcc0a221c44d05d38cb38d3cdbb5399adae Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 Oct 2021 19:01:24 +0800 Subject: [PATCH 0595/1588] APL --- ...e Sucks- Here-s What You Can do to Reduce the Overheating.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md b/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md index bc8c45ad85..fb68e7963f 100644 --- a/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md +++ b/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/raspberry-pi-case-overheating/" [#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From abbac0424f0b325d7799adcd04152143a3a6491b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 Oct 2021 20:12:45 +0800 Subject: [PATCH 0596/1588] TSL&PRF --- ...at You Can do to Reduce the Overheating.md | 140 ------------------ ...at You Can do to Reduce the Overheating.md | 126 ++++++++++++++++ 2 files changed, 126 insertions(+), 140 deletions(-) delete mode 100644 sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md create mode 100644 translated/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md diff --git a/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md b/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md deleted file mode 100644 index fb68e7963f..0000000000 --- a/sources/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md +++ /dev/null @@ -1,140 +0,0 @@ -[#]: subject: "The Official Raspberry Pi 4 Case Sucks! Here’s What You Can do to Reduce the Overheating" -[#]: via: "https://itsfoss.com/raspberry-pi-case-overheating/" -[#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -The Official Raspberry Pi 4 Case Sucks! Here’s What You Can do to Reduce the Overheating -====== - -The [Raspberry Pi 4][1] is an absolute favorite among millions of people, especially in the nerd community, and I’m no exception. But did you know that the Pi throttles without proper cooling? - -Here, I’m going to describe some serious drawbacks in the [Official Raspberry Pi 4 Case][2] and also share some ways to mitigate them. - -![Raspberry Pi 4 official case][3] - -After the first boot, my Raspberry Pi 4 (8 GB RAM version) mounted inside the [Official Raspberry Pi 4 case][2], would shoot to 80 °C when the unattended upgrades kicked in. I was on Ubuntu with all [firmware updates][4] that are apparently supposed to [fix heating issues][5]. - -On idle, this hot vanilla and strawberry cake would never go less than 75°C. - -I could hardly use it until I removed the top white cover of the case. The temperature dropped to only around 67 °C on idle — Can you believe that? Even after I double-checked after a while with a reboot. This, obviously, still isn’t also quite acceptable. If I got the case and plan to use it for long-term purpose, why would I want to keep the case lid open all the time? - -And why is something like this happening? It’s all because of a very poor design of the official Raspberry Pi case. - -### The Official Raspberry Pi 4 Case is a Heat Monster! - -[Thermal throttling][6] in simple terms, is a reduction in the performance of your Pi processor (CPU) so that the temperature does not exceed extremely high temperatures (such as 80 °C) and [cause damage][7]. - -The case is built out of plastic — a poor conductor of heat (simple [old school physics][8]), and hence is unable to dissipate it effectively throughout the case and out of the Pi board. Therefore, the processor on the Pi board heats up and gets throttled down to an extremely inferior level of performance, once it literally reaches a temperature of an alarming degree. I noticed a 100% CPU usage during _**unattended upgrades**_ right after first boot with the CPU’s temperature at 80 °C. - -Beautiful though it may look, the official case delivers a big blow to the Pi’s performance. - -If you really want to get the most out of your Pi’s performance, you must take care of its cooling too. These heating issues cannot simply be ignored: - -#### Heat gets trapped - -Once you set up the Pi inside this case there is not even a single vent for that excess heat to escape. So it keeps getting accumulated inside until it reaches those crazy temps and triggers the throttle. - -#### No fan outlet (badly needed) - -The top white cover could have had a circular vent on top of the case for at least the [Official Raspberry Pi 4 Fan][9]. - -#### No passive cooling - -If the case had been of metal, it could have doubled up as heat-sink and dissipate the heat efficiently out of the processor residing on the Pi board. - -#### Other drawbacks apart from heating issues - -The official Pi 4 case has a few more drawbacks: - - 1. Inconvenient SD Card Management: It is not very convenient to assemble the Pi board inside the case and get the SD card port in the correct orientation to be able to switch cards later on. - 2. No Screwing System: No screws are provided, maybe because it could break the dummy holders on the base of the case that almost look like you could use four screws to fix the board securely onto the base. - - - -### What can you do to control the overheating in Raspberry Pi 4? - -After doing some intense research, I found some of the best cooling solutions available in the market – all thanks to our amazing modding community! - -#### Use an ice tower cooler - -I first found [an in-depth performance review of various Pi coolers at Jeff Geerling’s][10], who is known online as **[geerlingguy][11]**. I straightaway went for the ICE tower cooler after going through the temperature stats and assembled it: - -![Raspberry Pi 4 ice tower cooler][12] - -Preview | Product | Price | ----|---|---|--- -![GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi Heatsink for Raspberry Pi 4 Model B & Raspberry Pi 3B+ & Raspberry Pi 3 Model B][13] ![GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi Heatsink for Raspberry Pi 4 Model B & Raspberry Pi 3B+ & Raspberry Pi 3 Model B][13] | [GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi...][14] | $19.99[][15] | [Buy on Amazon][16] - -Temperatures dropped to 30 °C on idle and under load, it now stays at around 45 °C. I’m yet to mod a proper case for it. There are ready to purchase cases with enough space for the cooler. You may find such cases on Amazon or other online stores. - -No products found. - -#### Use an aluminum heat sink for passive cooling - -There is also a remarkable video online on [passive cooling][17], reviewing an aluminum heat-sink-as-a-case. - -A thermal pad is provided, which is equivalent to the thermal paste used on Desktop processors. On placing it in the manner shown in the video, the heat is dissipated out of the processor on the Pi board throughout the whole case. A wonderful magic of science! - -Preview | Product | Price | ----|---|---|--- -![Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive Cooling Case Compatible with Raspberry Pi 4 Model B Only][18] ![Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive Cooling Case Compatible with Raspberry Pi 4 Model B Only][18] | [Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive...][19] | $12.99[][15] | [Buy on Amazon][20] - -#### Modding the official Pi case - -If you still want to get the official case, it is advisable to at-least go for a fan mod: - -### Potential Manufacturing Solutions - -Here are some solutions that can make the whole process of manufacturing easier, by applying [DevOps][21] inspired improvements: - - * Think about it, that circular piece of plastic cut out from the top of the cover could be recycled to manufacture so many more Pi 4 cases in production. Isn’t it? It would clearly be a win-win scenario and also lowers costs as well! - - - * Aluminium is the most abundant metal on earth, but [global supply disruptions][22] can be challenging. Even then, there are other [conductivity solutions][23] to explore materials used for the designing the case. - - - -**Personal Notes** - -Hope this write-up helps you in getting the most out of your Raspberry Pi 4. It’s been a quite a while since I used to write here on _**It’s FOSS**_. Feels good to be back. I’d love to know your thoughts, suggestions, and experiences down in the comments below. Please do not hesitate to share. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/raspberry-pi-case-overheating/ - -作者:[Avimanyu Bandyopadhyay][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/avimanyu/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/raspberry-pi-4/ -[2]: https://www.raspberrypi.org/products/raspberry-pi-4-case/ -[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-4-official-case.webp?resize=800%2C533&ssl=1 -[4]: https://www.einfochips.com/blog/understanding-firmware-updates-the-whats-whys-and-hows/ -[5]: https://www.seeedstudio.com/blog/2019/11/29/raspberry-pi-4-firmware-update-pi-4-now-runs-cooler-than-ever/ -[6]: https://www.pcmag.com/encyclopedia/term/thermal-throttling -[7]: https://www.pcgamer.com/cpu-temperature-overheat/ -[8]: https://thermtest.com/stay-colder-for-longer-in-a-container-made-of-plastic-or-metal -[9]: https://www.raspberrypi.org/products/raspberry-pi-4-case-fan/ -[10]: https://www.jeffgeerling.com/blog/2019/best-way-keep-your-cool-running-raspberry-pi-4 -[11]: https://www.jeffgeerling.com/about -[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-4-ice-tower-cooler.webp?resize=480%2C360&ssl=1 -[13]: https://i0.wp.com/m.media-amazon.com/images/I/51g9gQC9k7L._SL160_.jpg?ssl=1 -[14]: https://www.amazon.com/dp/B07V35SXMC?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi Heatsink for Raspberry Pi 4 Model B & Raspberry Pi 3B+ & Raspberry Pi 3 Model B) -[15]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) -[16]: https://www.amazon.com/dp/B07V35SXMC?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) -[17]: https://buildabroad.org/2016/11/05/passive-cooling/ -[18]: https://i2.wp.com/m.media-amazon.com/images/I/41XGLQONCVS._SL160_.jpg?ssl=1 -[19]: https://www.amazon.com/dp/B07VD568FB?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive Cooling Case Compatible with Raspberry Pi 4 Model B Only) -[20]: https://www.amazon.com/dp/B07VD568FB?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Buy on Amazon) -[21]: https://linuxhandbook.com/what-is-devops/ -[22]: https://www.reuters.com/article/global-metals-idUSL1N2Q90GA -[23]: https://news.mit.edu/2018/engineers-turn-plastic-insulator-heat-conductor-0330 diff --git a/translated/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md b/translated/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md new file mode 100644 index 0000000000..9ff9fb14d1 --- /dev/null +++ b/translated/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md @@ -0,0 +1,126 @@ +[#]: subject: "The Official Raspberry Pi 4 Case Sucks! Here’s What You Can do to Reduce the Overheating" +[#]: via: "https://itsfoss.com/raspberry-pi-case-overheating/" +[#]: author: "Avimanyu Bandyopadhyay https://itsfoss.com/author/avimanyu/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +官方的树莓派 4 外壳很烂!怎么样减少过热? +====== + +![树莓派 4][1] 绝对是数百万人的最爱,特别是在极客社区里,我也不例外。但是你知道树莓派在没有适当冷却的情况下会限制性能吗? + +在这里,我将介绍 [树莓派 4 官方外壳][2] 的一些严重缺点,同时也分享一些缓解这些缺点的方法。 + +![树莓派 4 官方外壳][3] + +在第一次启动后,我的安装在 [树莓派 4 官方外壳][2] 内的树莓派 4(8GB 内存版),在无人值守的升级启动时,会高达 80℃。我在 Ubuntu 上进行了所有的 [固件更新][4],显然是为了 [解决发热问题][5]。 + +就算在空闲时,这个烫手的香草和草莓蛋糕也绝不会低于 75℃。 + +我几乎无法使用它,直到我取下外壳顶部的白色盖子。它闲置时的温度降到只有 67℃ 左右 —— 你相信吗?即使是在我重新启动一段时间后再次检查也是这样。很明显,这仍然是不太可接受。如果我买了这个外壳并打算长期使用,我为什么要一直把盖子打开? + +为什么会发生这样的事情?这都是因为官方的树莓派外壳的设计非常糟糕。 + +### 官方的树莓派 4 外壳是一个发热怪物! + +简单地说,[热节流][6] 就是降低你的树莓派处理器(CPU)的性能,以使温度不超过极限高温(如 80℃)而 [导致损坏][7]。 + +这个外壳是由塑料制成的,它是热的不良导体(简单的 [传统物理学][8] 知识),因此无法将热量有效地散布到整个外壳和板子之外。因此,板上的处理器会发热,一旦温度达到惊人的程度,它的性能就会被降到一个极低的水平。我注意到,在第一次开机后,在**无人值守**的情况下进行升级时,CPU 的温度为 80℃,CPU 的使用率为 100%。 + +虽然这个官方的外壳看起来很美,但它对树莓派的性能造成了很大的影响。 + +如果你真的想让你的树莓派发挥最大的性能,你也必须负责它的冷却。这些发热问题不能被简单地忽视。 + +#### 热量被困在内部 + +一旦你把树莓派安装在这个外壳里,它甚至没有一个通风口可以让多余的热量排出。所以热量就一直在里面积累,直到达到那些疯狂的温度并触发了节流阀。 + +#### 没有风扇通风口(非常需要) + +顶部的白色盖子上可以有一个圆形的通风口,至少可以把 [树莓派 4 的官方风扇][9] 放在上面使用。 + +#### 没有被动冷却 + +如果外壳是金属的,它就可以作为散热器,有效地将树莓派板上的处理器的热量散发出去。 + +#### 除了发热问题之外,还有其他的缺点 + +树莓派 4 官方外壳还有一些缺点: + + 1. 不便于 SD 卡管理:将树莓派板子装入外壳内,并将 SD 卡端口放在正确的方向上,以便以后能够换卡,这不是很方便。 + 2. 没有螺丝钉系统:没有提供螺丝,也许是因为它可能会破坏机箱底座上的假支架,这些假支架看起来就像你可以用四颗螺丝把板子牢牢地固定在底座上。 + +### 你可以做什么来控制树莓派 4 的过热? + +在做了一些紧张的研究之后,我找到了市场上一些最好的冷却解决方案 —— 这一切都要归功于我们了不起的改装社区。 + +#### 使用冰塔式冷却器 + +我首先发现了 [Jeff Geerling's][10] 对各种树莓派散热器的深入性能评估,他在网上被称为 [geerlingguy][11]。在看完温度统计后,我直接选择了冰塔式散热器,并组装了它: + +![树莓派 4 冰塔冷却器][12] + +它空闲和低载时的温度下降到 30℃,现在保持在 45℃ 左右。我还没有为它改装一个合适的外壳。我准备找个给冷却器提供了足够的空间的现成外壳。也许可以在亚马逊或其他网上商店找到这种外壳。 + +但我没有找到这种产品。 + +#### 使用铝制散热器进行被动散热 + +网上也有一个关于 [被动冷却][17] 的出色视频,测评了一个用铝制散热片做的外壳。 + +它提供了一个热垫,它相当于台式机处理器上使用的散热膏。按照视频中显示的方式放置它,热量就会从树莓派板上的处理器散发到整个外壳内。这就是科学的神奇之处! + +#### 改装官方的树莓派外壳 + +如果你仍然想买官方的外壳,建议你至少要做一个风扇的改装。 + +### 潜在的制造解决方案 + +这里有一些解决方案,通过应用 [DevOps][21] 启发的改进,可以使整个制造过程更容易。 + + * 想一想,从外壳顶部切下的那块圆形塑料可以回收,用来制造更多的树莓派 4 外壳,不是吗?这显然会是一个双赢的局面,同时也降低了成本! + * 铝是地球上最丰富的金属,但 [全球供应中断][22] 可能是一个挑战。即使如此,还有其他的 [导电性解决方案][23] 来探索用于设计案例的材料! + +### 总结 + +希望这篇文章能帮助你从树莓派 4 中获得最大的收益。我很想知道你的想法、建议和经验,请在下面的评论中留言。请不要犹豫地分享。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/raspberry-pi-case-overheating/ + +作者:[Avimanyu Bandyopadhyay][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/avimanyu/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/raspberry-pi-4/ +[2]: https://www.raspberrypi.org/products/raspberry-pi-4-case/ +[3]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-4-official-case.webp?resize=800%2C533&ssl=1 +[4]: https://www.einfochips.com/blog/understanding-firmware-updates-the-whats-whys-and-hows/ +[5]: https://www.seeedstudio.com/blog/2019/11/29/raspberry-pi-4-firmware-update-pi-4-now-runs-cooler-than-ever/ +[6]: https://www.pcmag.com/encyclopedia/term/thermal-throttling +[7]: https://www.pcgamer.com/cpu-temperature-overheat/ +[8]: https://thermtest.com/stay-colder-for-longer-in-a-container-made-of-plastic-or-metal +[9]: https://www.raspberrypi.org/products/raspberry-pi-4-case-fan/ +[10]: https://www.jeffgeerling.com/blog/2019/best-way-keep-your-cool-running-raspberry-pi-4 +[11]: https://www.jeffgeerling.com/about +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/raspberry-pi-4-ice-tower-cooler.webp?resize=480%2C360&ssl=1 +[13]: https://i0.wp.com/m.media-amazon.com/images/I/51g9gQC9k7L._SL160_.jpg?ssl=1 +[14]: https://www.amazon.com/dp/B07V35SXMC?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (GeeekPi Raspberry Pi Cooling Fan, Raspberry Pi ICE Tower Cooler, RGB Cooling Fan with Raspberry Pi Heatsink for Raspberry Pi 4 Model B & Raspberry Pi 3B+ & Raspberry Pi 3 Model B) +[15]: https://www.amazon.com/gp/prime/?tag=chmod7mediate-20 (Amazon Prime) +[16]: https://www.amazon.com/dp/B07V35SXMC?tag=chmod7mediate-20&linkCode=ogi&th=1&psc=1 (Buy on Amazon) +[17]: https://buildabroad.org/2016/11/05/passive-cooling/ +[18]: https://i2.wp.com/m.media-amazon.com/images/I/41XGLQONCVS._SL160_.jpg?ssl=1 +[19]: https://www.amazon.com/dp/B07VD568FB?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Geekworm Raspberry Pi 4 Armor Case, Raspberry Pi 4 Computer Model B Armor Aluminum Alloy Passive Cooling Case Compatible with Raspberry Pi 4 Model B Only) +[20]: https://www.amazon.com/dp/B07VD568FB?tag=chmod7mediate-20&linkCode=osi&th=1&psc=1 (Buy on Amazon) +[21]: https://linuxhandbook.com/what-is-devops/ +[22]: https://www.reuters.com/article/global-metals-idUSL1N2Q90GA +[23]: https://news.mit.edu/2018/engineers-turn-plastic-insulator-heat-conductor-0330 From ebdcda4f41ed601ba409199465cbde24c0dc8e97 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 4 Oct 2021 20:23:13 +0800 Subject: [PATCH 0597/1588] PUB @wxy https://linux.cn/article-13851-1.html --- ...s- Here-s What You Can do to Reduce the Overheating.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename {translated/tech => published}/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md (95%) diff --git a/translated/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md b/published/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md similarity index 95% rename from translated/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md rename to published/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md index 9ff9fb14d1..8b1b953f84 100644 --- a/translated/tech/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md +++ b/published/20211001 The Official Raspberry Pi 4 Case Sucks- Here-s What You Can do to Reduce the Overheating.md @@ -4,13 +4,15 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13851-1.html" 官方的树莓派 4 外壳很烂!怎么样减少过热? ====== -![树莓派 4][1] 绝对是数百万人的最爱,特别是在极客社区里,我也不例外。但是你知道树莓派在没有适当冷却的情况下会限制性能吗? +![](https://img.linux.net.cn/data/attachment/album/202110/04/201826ghpecyb43cxehi4y.jpg) + +[树莓派 4][1] 绝对是数百万人的最爱,特别是在极客社区里,我也不例外。但是你知道树莓派在没有适当冷却的情况下会限制性能吗? 在这里,我将介绍 [树莓派 4 官方外壳][2] 的一些严重缺点,同时也分享一些缓解这些缺点的方法。 From 41b8cb10b3067f600cdce93034828f3dd5a861bc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 Oct 2021 05:03:47 +0800 Subject: [PATCH 0598/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211005?= =?UTF-8?q?=20Markets:=20An=20Open-Source=20App=20to=20Keep=20Track=20of?= =?UTF-8?q?=20Your=20Investments=20for=20Linux=20Desktop=20and=20Phones?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211005 Markets- An Open-Source App to Keep Track of Your Investments for Linux Desktop and Phones.md --- ...nvestments for Linux Desktop and Phones.md | 94 +++++++++++++++++++ 1 file changed, 94 insertions(+) create mode 100644 sources/tech/20211005 Markets- An Open-Source App to Keep Track of Your Investments for Linux Desktop and Phones.md diff --git a/sources/tech/20211005 Markets- An Open-Source App to Keep Track of Your Investments for Linux Desktop and Phones.md b/sources/tech/20211005 Markets- An Open-Source App to Keep Track of Your Investments for Linux Desktop and Phones.md new file mode 100644 index 0000000000..ed5b98429f --- /dev/null +++ b/sources/tech/20211005 Markets- An Open-Source App to Keep Track of Your Investments for Linux Desktop and Phones.md @@ -0,0 +1,94 @@ +[#]: subject: "Markets: An Open-Source App to Keep Track of Your Investments for Linux Desktop and Phones" +[#]: via: "https://itsfoss.com/markets/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Markets: An Open-Source App to Keep Track of Your Investments for Linux Desktop and Phones +====== + +_**Brief:** A Linux app to help you quickly track market movements._ + +Usually, you would log in to a service on your web browser to monitor and track the market for investment opportunities if you’re an investor/trader. + +But, what if you want an app for your Linux desktop and Linux phone? Considering we do have a few for Android/iOS smartphones, it should come in handy for Linux devices as well! + +### Monitor Stocks From Across the Globe via Yahoo Finance + +![][1] + +“Markets” utilizes the data from Yahoo Finance to provide you the required information about stocks, cryptocurrencies, currencies, and more. + +While it is a simple desktop-focused app, it is available for Linux smartphones, and it offers a couple of valuable functionalities. Let me list the key highlights of what you can expect. + +![][2] + +### Features of Markets + +With Markets, you get to track, monitor, and analyze market trends and make investment decisions. + +There are a couple of features along the way that include: + + * Ability to customize the update interval + * Build a personal portfolio + * Add any symbol or currency + * View time in international format + * Dark mode + * Supports Linux phones (PinePhone, Librem5) + * Selectively delete stock monitors + + + +As mentioned previously, it is a dead-simple Linux application to help you track financial data. + +![][3] + +And, I’d say it works pretty well and lets you quickly search for a stock, commodity, and others to build a personal portfolio on your Linux desktop quickly. + +With a dark mode, it is a breeze to look at it and track market movements. + +You can select from the existing list of markets added and delete as per your selection. And, the international time format is useful. As you can notice in the screenshot, the time mentions the timezone you’re at by default, which should be useful. + +Also, from the listings, you can click on it to launch the browser window for full details on Yahoo Finance; this is how it’ll look like: + +![][4] + +### Installing Markets in Linux + +It is available as a Flatpak app for Linux distributions and can be found in [AUR][5] for Arch users. For Linux phones, they recommend installing it from the source. + +To install it from the terminal, you just need to type in: + +``` +flatpak install flathub com.bitstower.Markets +``` + +You can explorer building instructions and other information on their [GitHub page][6]. + +[Markets (Flathub)][7] + +Do you prefer to use an app on your Linux desktop to track financial data quickly? Let me know your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/markets/ + +作者:[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/10/markets.png?resize=741%2C626&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/markets-search.png?resize=626%2C651&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/markets-dark-mode.png?resize=559%2C475&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/yahoo-tesla.png?resize=800%2C451&ssl=1 +[5]: https://itsfoss.com/aur-arch-linux/ +[6]: https://github.com/bitstower/markets +[7]: https://flathub.org/apps/details/com.bitstower.Markets From 69f30fdb56a82d2b989f2d899aaee56392d5c4c9 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 Oct 2021 05:03:55 +0800 Subject: [PATCH 0599/1588] add done: 20211005 Markets- An Open-Source App to Keep Track of Your Investments for Linux Desktop and Phones.md --- sources/tech/20211005 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20211005 .md diff --git a/sources/tech/20211005 .md b/sources/tech/20211005 .md new file mode 100644 index 0000000000..9edb764851 --- /dev/null +++ b/sources/tech/20211005 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/recover-corrupted-grub-2-bootloader-centos-8-rhel-8/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/recover-corrupted-grub-2-bootloader-centos-8-rhel-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 bf1ae6f02fbd355be904218324f500b9ff9c8403 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 Oct 2021 05:04:14 +0800 Subject: [PATCH 0600/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211004?= =?UTF-8?q?=20How=20I=20use=20Vagrant=20with=20libvirt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211004 How I use Vagrant with libvirt.md --- ...20211004 How I use Vagrant with libvirt.md | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 sources/tech/20211004 How I use Vagrant with libvirt.md diff --git a/sources/tech/20211004 How I use Vagrant with libvirt.md b/sources/tech/20211004 How I use Vagrant with libvirt.md new file mode 100644 index 0000000000..198d512bc1 --- /dev/null +++ b/sources/tech/20211004 How I use Vagrant with libvirt.md @@ -0,0 +1,221 @@ +[#]: subject: "How I use Vagrant with libvirt" +[#]: via: "https://opensource.com/article/21/10/vagrant-libvirt" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use Vagrant with libvirt +====== +When a virtual machine is what you need, Vagrant may be just the best +way to get it. +![Computer laptop in space][1] + +I'll admit it: I'm a fan of Linux. While I've used Slackware on workstations and Red Hat Enterprise Linux (RHEL) on servers for years, I love seeing how other distributions do things. What's more, I really like to test applications and scripts I write on other distributions to ensure portability. In fact, that's one of the great advantages of Linux, as I see it: You can download a distro and test your software on it for free. You can't do that with a closed OS, at least not without either breaking an EULA or paying to play, and even then, you're often signing up to download several gigabytes just to test an application that's no more than a few hundred megabytes. But Linux is open source, so there's rarely an excuse to ignore at least the three or four main distros, except that setting up a virtual machine can take a lot of clicks and sometimes complex virtual networking. At least, that used to be the excuse until Vagrant changed the virtual machine workflow for developers. + +### What is Vagrant + +Vagrant is a simple virtual machine manager for your terminal. It allows you to easily pull a minimal and pre-built virtual machine from the Internet, run it locally, and SSH into it in just a few steps. It's the quickest you'll ever set up a virtual machine. It's ideal for web developers needing a test web server, programmers who need to test an application across distributions, and hobbyists who enjoy seeing how different distributions work. + +Vagrant itself is relatively minimal, too. It's not a virtualization framework itself. It only manages your virtual machines ("boxes" in Vagrant terminology). It can use VirtualBox or, through a plug-in, the lightweight libvirt project as a backend. + +### What is libvirt + +The libvirt project is a toolkit designed to manage virtualization, with support for [KVM][2], [QEMU][3], [LXC][4], and more. You might think of it as a sort of virtual machine API, allowing developers to write friendly applications that make it easy for users to orchestrate virtualization through libvirt. I use libvirt as the backend for Vagrant because it's useful across several applications, including virt-manager and [GNOME Boxes][5]. + +### Installing Vagrant + +You can install Vagrant from [vagrantup.com/downloads][6]. There are builds available for Debian-based systems, CentOS-based systems, macOS, Windows, and more. + +For CentOS, Fedora, or similar, you get an RPM package, which you can install with `dnf`: + + +``` +`$ sudo dnf install ./vagrant_X.Y.ZZ_x86_64.rpm` +``` + +On Debian, Linux Mint, Elementary, and similar, you get a DEB package, which you can install with `apt`: + + +``` +`$ sudo apt install ./vagrant_X.Y.ZZ_x86_64.deb` +``` + +### Installing libvirt and support packages + +On Linux, your distribution may already have libvirt installed, but to enable integration with Vagrant you need a few other packages, too. Install these with your package manager. + +On Fedora, CentOS, and similar: + + +``` +$ sudo dnf install gcc libvirt \ +libvirt-devel libxml2-devel \ +make ruby-devel libguestfs-tools +``` + +On Debian, Linux Mint, and similar: + + +``` +$ sudo apt install build-dep vagrant ruby-libvirt \ +qemu libvirt-daemon-system libvirt-clients ebtables \ +dnsmasq-base libxslt-dev libxml2-dev libvirt-dev \ +zlib1g-dev ruby-dev libguestfs-tools +``` + +Depending on your distribution, you may have to start the `libvirt` daemon: + + +``` +`$ sudo systemctl start libvirtd` +``` + +### Installing the Vagrant-libvirt plugin + +In Vagrant, libvirt is enabled through a plug-in. Vagrant makes it easy to install a plug-in, so your first Vagrant command is one you'll rarely run again: + + +``` +`$ vagrant plugin install vagrant-libvirt` +``` + +Now that the libvirt plug-in is installed, you can start using virtual machines. + +### Setting up your Vagrant environment + +To start with Vagrant, create a directory called `~/Vagrant`. This is where your `Vagrantfiles` are stored. + + +``` +`$ mkdir ~/Vagrant` +``` + +In this directory, create a subdirectory to represent a distro you want to download. For instance, assume you need a CentOS test box. + +Create a CentOS directory, and then change to it: + + +``` +$ mkdir ~/Vagrant/centos +$ cd ~/Vagrant/centos +``` + +Now you need to find a virtual machine so you can convert the directory you've just made into a Vagrant environment. + +### Finding a Vagrant virtual machine + +Broadly speaking, Vagrant boxes come from three different places: Hashicorp (the maintainers of Vagrant), maintainers of distributions, and people like you and me. Some images are minimal, intended to serve as a base for customization. In contrast, others try to solve a specific need (for instance, you might find a LAMP stack image ready for web development). You can find images by browsing or searching the main hub for boxes [app.vagrantup.com/boxes/search][7]. + +For this example, search for "centos" and find the entry named `generic/centos8`. Click on the image for instructions on how to use the virtual machine. The instructions come in two varieties:  + + * The code you need for a Vagrantfile + * The command you need to use the box from a terminal + + + +The latter is the more straightforward method: + + +``` +`$ vagrant init generic/centos8` +``` + +The `init` subcommand creates a configuration file, called a Vagrantfile, in your current directory, which transforms that directory into a Vagrant environment. At any time, you can view a list of known Vagrant environments using the `global-status` subcommand: + + +``` +$ vagrant global-status +id       name    provider state   directory +\------------------------------------------- +49c797f  default libvirt running /home/tux/Vagrant/centos8 +``` + +### Starting a virtual machine with Vagrant + +Once you've run the `init` command, you can start your virtual machine with `vagrant up`: + + +``` +`$ vagrant up` +``` + +This causes Vagrant to download the virtual machine image if it doesn't already exist locally, set up a virtual network, and configure your box. + +### Entering a Vagrant virtual machine  + +Once your virtual machine is up and running, you can log in to it with `vagrant ssh`: + + +``` +$ vagrant ssh +box$ +``` + +You connect to the box running in your current Vagrant environment. Once logged in, you can run all the commands native to that host. It's a virtual machine running its own kernel, with emulated hardware and common Linux software. + +### Leaving a Vagrant virtual machine + +To leave your Vagrant virtual machine, log out of the host as you normally exit a Linux computer: + + +``` +`box$ exit` +``` + +Alternately, you can power the virtual machine down: + + +``` +`box$ sudo poweroff` +``` + +You can also stop the machine from running using the `vagrant` command: + + +``` +`box$ vagrant halt` +``` + +### Destroying a Vagrant virtual machine + +When finished with a Vagrant virtual machine, you can destroy it: + + +``` +`$ vagrant destroy` +``` + +Alternately, you can remove a virtual machine using the global `box` subcommand: + + +``` +`$ vagrant box remove generic/centos8` +``` + +### Vagrant is easy + +Vagrant makes virtual machines trivial, disposable, and fast. When you need a test environment or a fake server to ping or develop on, or a clean lab computer for experimentation or monitoring, you can get one with Vagrant. Some people think virtual machines aren't relevant now that containers have taken over servers, but virtual machines have unique traits that make them useful. They run their own kernel, have a full and unique stack separate from the host machine, and use emulated hardware. When a virtual machine is what you need, Vagrant may be just the best way to get it. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/vagrant-libvirt + +作者:[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/computer_space_graphic_cosmic.png?itok=wu493YbB (Computer laptop in space) +[2]: https://opensource.com/article/20/8/virt-tools#kvm +[3]: https://opensource.com/article/20/8/virt-tools#qemu +[4]: https://opensource.com/article/18/11/behind-scenes-linux-containers +[5]: https://opensource.com/article/19/5/getting-started-gnome-boxes-virtualization +[6]: https://www.vagrantup.com/downloads +[7]: https://app.vagrantup.com/boxes/search From 1164a6da1c10ad33a083411583f1d29f995ca598 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 Oct 2021 05:04:31 +0800 Subject: [PATCH 0601/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211004?= =?UTF-8?q?=20Launching=20a=20DevOps=20to=20DevSecOps=20transformation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211004 Launching a DevOps to DevSecOps transformation.md --- ...ng a DevOps to DevSecOps transformation.md | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 sources/tech/20211004 Launching a DevOps to DevSecOps transformation.md diff --git a/sources/tech/20211004 Launching a DevOps to DevSecOps transformation.md b/sources/tech/20211004 Launching a DevOps to DevSecOps transformation.md new file mode 100644 index 0000000000..250315de64 --- /dev/null +++ b/sources/tech/20211004 Launching a DevOps to DevSecOps transformation.md @@ -0,0 +1,64 @@ +[#]: subject: "Launching a DevOps to DevSecOps transformation" +[#]: via: "https://opensource.com/article/21/10/devops-to-devsecops" +[#]: author: "Will Kelly https://opensource.com/users/willkelly" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Launching a DevOps to DevSecOps transformation +====== +The move toward DevSecOps is accelerating—here's what you need to know. +![Tips and gears turning][1] + +Widespread adoption of DevSecOps is inevitable. Security and delivery velocity are unrealistic expectations as part of a [waterfall software development life cycle][2] (SDLC). Businesses and government agencies are under constant pressure to deliver new features and functionality to their customers, constituents, and employees. Recent high-profile software supply chain breaches and President Biden's [Executive Order][3] to improve the nation's cybersecurity also increases the urgency for businesses and governments to move to DevSecOps. + +All of that means, sooner or later, your enterprise will need to integrate security with its DevOps process. + +Historically, cybersecurity teams focused on app security only at the end of a long, laborious waterfall SDLC, after scanning and remediating security issues. This model has shown cracks with age. Customer and market demands for new features, security, and compliance are at the top of executives' minds. [Digital transformation][4] efforts aimed at adjusting to the new world of work during and after the pandemic have made software security a higher priority. A DevOps process that makes security an afterthought is out of step with software users and consumers. + +What's needed is a DevOps-to-DevSecOps transformation. Fortunately, cloud computing in the commercial and public sectors, combined with the influence of open source software (OSS), now gives development teams the tools, processes, and frameworks to deliver software at higher velocity while maintaining quality and security. + +DevSecOps brings your security and DevOps teams to work together during the development life cycle. To make that transition, you will need collaboration from your developers, cybersecurity experts, sysadmins, business stakeholders, and even your executives. + +### Assessing DevOps and DevSecOps + +DevOps combines cultural philosophies, best practices, and tools that allow your organization to deliver applications and services more rapidly. Shifting to daily and weekly releases enables you to reduce your quarterly or monthly releases. Using DevOps can also help you grow and improve your products more rapidly than traditional waterfall software development processes and siloed infrastructure management. + +While preserving the best qualities of DevOps, DevSecOps incorporates security in every stage of the cycle. It knocks down the silos standing between your development, security, and operations teams. Benefits of DevSecOps include: + + * Prevention of security incidents before they happen: By integrating DevSecOps within your CI/CD toolchain, you're helping your teams by detecting and resolving issues before they occur in production. + * Faster response to security issues: DevSecOps increases your security focus through continuous assessments while giving you actionable data to make informed decisions about the security posture of apps in development and ready to enter production. + * Accelerated feature velocity: DevSecOps teams have the data and tools to mitigate unforeseen risks better. + * Lower security budget: DevSecOps enables streamlined resources, solutions, and processes, allowing you to simplify your development lifecycle by design. + + + +We're at _peak Ops_ in many industries. Rest assured, the definitions of DevOps and DevSecOps will merge in the months and years to come, if only for the sake of enterprise sanity and management. + +### DevSecOps and OSS + +DevSecOps can also play a vital role in the integration of OSS into enterprise applications. OSS and DevSecOps are becoming increasingly intertwined, especially as enterprises seek to improve the security of their software supply chains. DevSecOps can serve as an OSS remediation tool because it permits scanning automation throughout each pipeline phase. OSS is also foundational for adopting and security software containers and Kubernetes. + +### Final thoughts + +Before your organization embarks on a DevOps to DevSecOps transformation, take a step back and define DevSecOps for your teams. Cut through the marketing. Talk about the results you hope your teams will achieve. Instill a culture of openness and collaboration, and be sure to listen to the positive and negative vantage points of your development, operations, and Quality Assurance (QA) teams. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/devops-to-devsecops + +作者:[Will Kelly][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/willkelly +[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://en.wikipedia.org/wiki/Waterfall_model +[3]: https://www.whitehouse.gov/briefing-room/presidential-actions/2021/05/12/executive-order-on-improving-the-nations-cybersecurity/ +[4]: https://enterprisersproject.com/what-is-digital-transformation From 2b5387dea3dae44934776a0bb52a0e37cff1bf1a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 5 Oct 2021 05:05:38 +0800 Subject: [PATCH 0602/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211004?= =?UTF-8?q?=20It=20Seems=20Pop=20OS=20Linux=20Will=20Soon=20be=20Available?= =?UTF-8?q?=20on=20Raspberry=20Pi=20and=20Other=20ARM=20Devices?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md --- ...e on Raspberry Pi and Other ARM Devices.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md diff --git a/sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md b/sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md new file mode 100644 index 0000000000..7a5d77b46d --- /dev/null +++ b/sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md @@ -0,0 +1,79 @@ +[#]: subject: "It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices" +[#]: via: "https://news.itsfoss.com/pop-os-raspberry-pi-coming-soon/" +[#]: author: "Abhishek https://news.itsfoss.com/author/root/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices +====== + +There was a time when only lightweight [operating systems were available for ARM devices like Ra][1]spberry Pi. Why? Because earlier ARM devices had low end hardware with limited RAM and CPU. + +It all changed when Raspberry Pi 4 targeted desktop users with its 8 GB variant and doubled down on it with the introduction of Raspberry Pi 400. + +This resulted in bringing the support of mainstream desktop Linux distributions to Raspberry Pi. Thanks to that, you can now [install Ubuntu desktop on Raspberry Pi][2]. + +Since Ubuntu desktop now supports ARM devices, other Ubuntu-based distros should join the ARM bandwagon soon. And it seems Pop!_OS is ready to board it. + +### Pop OS coming soon on Raspberry Pi! + +System76’s Principal Engineer and maintainer of Pop!_OS, Jeremy Soller shared a teaser photo on Twitter recently. The image is basically a screenshot of Neofetch running in terminal. + +> [pic.twitter.com/ehfGXwtsBf][3] +> +> — Jeremy Soller (@jeremy_soller) [September 28, 2021][4] + +If you look closely, you can see that some details that indicate that it is running on a Raspberry Pi device. + +![][5] + +The host name indicates Raspberry Pi and so does the BCM2835 CPU (chip used on Raspberry Pi devices). You can also notice the aarch64 in the OS name. + +In addition to that, Jeremy also shared a repository link that contains Pop OS packages for ARM devices. Here’s the [link][6]. + +> 😉 +> +> — Jeremy Soller (@jeremy_soller) [September 28, 2021][7] + +### How soon? + +There is no other information available from Systm76 on this front. But if I have to make a guess, I would say that the upcoming Pop!_OS 21.10 version will have an ARM version for Raspberry Pi like devices. + +This is not a blind guess. The ARM repository link shared by Jeremy clearly mentions ‘impish’ in its directory structure. Impish Indri is the codename for the upcoming [Ubuntu 21.10 slated for release][8] on 14th October. + +Pop!_OS 21.10 follows the release of Ubuntu 21.10 and should be released soon afterwards. All this gives us enough clue to surmise that Pop!_OS is coming to Raspberry Pi devices this month. + +This is indeed a good thing because Pop!_OS is popular among developers. This could mean more developers using Raspberry Pi as their development environment. + +I am delighted to see this development. How about you? + +#### 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/pop-os-raspberry-pi-coming-soon/ + +作者:[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://itsfoss.com/raspberry-pi-os/ +[2]: https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/ +[3]: https://t.co/ehfGXwtsBf +[4]: https://twitter.com/jeremy_soller/status/1442977756623429640?ref_src=twsrc%5Etfw +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://apt.pop-os.org/release/dists/impish/main/binary-arm64/ +[7]: https://twitter.com/jeremy_soller/status/1442976088053796870?ref_src=twsrc%5Etfw +[8]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/ From 35a05561d61850ed12a8f39f63e0d40781a8689d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 5 Oct 2021 09:52:14 +0800 Subject: [PATCH 0603/1588] Delete 20211005 .md --- sources/tech/20211005 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20211005 .md diff --git a/sources/tech/20211005 .md b/sources/tech/20211005 .md deleted file mode 100644 index 9edb764851..0000000000 --- a/sources/tech/20211005 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/recover-corrupted-grub-2-bootloader-centos-8-rhel-8/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/recover-corrupted-grub-2-bootloader-centos-8-rhel-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 7cd21137d9b1461ed9bdf58d0323465c3fecaaf4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 Oct 2021 10:02:10 +0800 Subject: [PATCH 0604/1588] APL --- sources/tech/20211001 8 reasons why I learned Core Java.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211001 8 reasons why I learned Core Java.md b/sources/tech/20211001 8 reasons why I learned Core Java.md index d42e020c30..686294a0e9 100644 --- a/sources/tech/20211001 8 reasons why I learned Core Java.md +++ b/sources/tech/20211001 8 reasons why I learned Core Java.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/why-i-learned-core-java" [#]: author: "Shantam Sahai https://opensource.com/users/shantam-sahai" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 00402895b326e3cd3f48757c671b6d861ff30dc6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 Oct 2021 10:51:50 +0800 Subject: [PATCH 0605/1588] TSL&PRF --- ...11001 8 reasons why I learned Core Java.md | 99 ------------------- ...11001 8 reasons why I learned Core Java.md | 97 ++++++++++++++++++ 2 files changed, 97 insertions(+), 99 deletions(-) delete mode 100644 sources/tech/20211001 8 reasons why I learned Core Java.md create mode 100644 translated/tech/20211001 8 reasons why I learned Core Java.md diff --git a/sources/tech/20211001 8 reasons why I learned Core Java.md b/sources/tech/20211001 8 reasons why I learned Core Java.md deleted file mode 100644 index 686294a0e9..0000000000 --- a/sources/tech/20211001 8 reasons why I learned Core Java.md +++ /dev/null @@ -1,99 +0,0 @@ -[#]: subject: "8 reasons why I learned Core Java" -[#]: via: "https://opensource.com/article/21/10/why-i-learned-core-java" -[#]: author: "Shantam Sahai https://opensource.com/users/shantam-sahai" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -8 reasons why I learned Core Java -====== -Understanding Core Java gives you a significant advantage when learning -all of the related tools built on top of it. -![Learning and studying technology is the key to success][1] - -Computer programming, also known as *coding *for short, is not about which language you use. It's about developing programming logic and learning to think like a programmer. The language you start with should be the one that helps you the most in this endeavor. So you have to ask yourself the question: "What do you want to do as a programmer?" - -For example, if you want to work on Android app development, video game development, desktop GUI applications, or just general software development, I think learning Java is an excellent option. It's the language I chose, and it has made a whole world of programming available to me. In India, where I live, the average salary of a Java programmer is around 5.9 Lakhs per Annum (LPA) (it can be as high as 10 LPA, depending on your experience.) - -Java is a vast language, though, with lots of frameworks and variants to choose from. _Core Java_ is the term the tech industry has developed to refer to the central components of the Java language—the thing that people use to write the frameworks and has developed the cottage industry around Java. I believe that Core Java is one of the most powerful skills you can acquire because understanding the basics of Java gives you a significant advantage when learning all of the related tools built on top of it. - -Here are the top eight reasons I chose Core Java, and I think you should too: - -### 1\. Java is an evolving programming language - -Java has significant corporate backing, but the most important component in Java development is [OpenJDK][2]—the open source Java Development Kit. With a mission statement to promote and maintain open source, open innovation, and open standards, the OpenJDK community is committed to improving and maintaining an open source implementation of Java and its toolchain. - -Innovations and conveniences get added with every release, making Java easier for developers and users alike. For instance, it was just in Java 11 that they added the ability to run .java files. Now, all it takes to run a single-file Java application is the `java` command, no compilation required: - - -``` -$ java ./hello.java - -Hello world -``` - -You can use Java to program applications for the web, mobile, or desktop. It's a highly versatile language. It has many interesting features such as dynamic coding, multiple security features, platform-independent characteristics, and network-centric design. - -### 2\. Java anchors android app development - -You can use Java to create Android apps. The Android market is enormous, and the demand for mobile programmers is only growing. Even if you're not interested in becoming a professional app developer, the ability to customize your mobile experience is a powerful one, and Java makes it possible. - -And it's easier than you might think! Learning Core Java makes it easy for you to pick up Android development kits or frameworks that export to mobile platforms, like [Processing][3]. - -### 3\. Rich APIs make Java easy to use - -Java's API (Application Programming Interface) includes classes, packages, interfaces, and more. Java has mainly three types of APIs:  - - * Official Java Core APIs - * Optimal official Java APIs - * Unofficial APIs - - - -An API makes programming easier because you can construct applications without knowing their inside implementations. In my experience, many companies prefer Java over other options because of the strength of the Java API. - -### 4\. Open source libraries - -There are nearly endless open source libraries for Java, including Maven, Guava, Apache Commons, Jhipster, and much more. You can copy, study, and share resources from these libraries. They make programming more accessible, faster, cheaper, and more educational. - -### 5\. Java has reliable development tools - -Java has some of my favorite IDEs (Integrated Development Environments), including [Eclipse][4], [NetBeans][5], [BlueJ][6], and IntelliJ IDEA. They provide debugging, syntax highlighting, code completion, language support, automated refactoring, and more. In short, IDEs play an essential role in Java's success and in your success as you learn it! - -### 6\. Demand for Java developers in India - -Giants like Google, Netflix, and Instagram use Java for backend development. Indian companies are actively looking to hire Java programmers to develop Android apps, new APIs, and microservices on the cloud. This demand translates to more job opportunities. - -### 7\. The Java programming community is huge - -The community of Java programmers is vast. It ranges from groups of beginners to experts. I have found the community to be welcoming and helpful when you ask for support. Most importantly, I've learned tons of new tricks by involving myself in online discussions. Being a part of the community has been a vital way for me to keep up with the latest trends, learn more about the language, and keep up with development. - -### 8\. Java is platform-independent - -The fact that Java is platform-independent makes it highly valuable. Java source code is compiled down to bitcode, which runs on the Java Virtual Machine (JVM). Any platform running a JVM (and all the major platforms do) can run your Java application. You write once and run everywhere! And this isn't just a theoretical position: Java has actually achieved this. You can write Java on whatever platform you develop on and deliver it to all your target platforms. - -There are many resources online to learn Java, including a [cheat sheet][7] here on Opensource.com. There's also a great [online Java course][8] available in Hindi for free. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/why-i-learned-core-java - -作者:[Shantam Sahai][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/shantam-sahai -[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://developer.ibm.com/components/open-jdk/ -[3]: http://processing.org/ -[4]: https://opensource.com/article/20/12/eclipse -[5]: https://opensource.com/article/20/12/netbeans -[6]: https://opensource.com/article/20/7/ide-java#bluej -[7]: https://opensource.com/downloads/java-cheat-sheet -[8]: https://www.learnvern.com/course/core-java-programming-tutorial diff --git a/translated/tech/20211001 8 reasons why I learned Core Java.md b/translated/tech/20211001 8 reasons why I learned Core Java.md new file mode 100644 index 0000000000..58f2a47d83 --- /dev/null +++ b/translated/tech/20211001 8 reasons why I learned Core Java.md @@ -0,0 +1,97 @@ +[#]: subject: "8 reasons why I learned Core Java" +[#]: via: "https://opensource.com/article/21/10/why-i-learned-core-java" +[#]: author: "Shantam Sahai https://opensource.com/users/shantam-sahai" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +学习 Core Java 的 8 个原因 +====== + +> 在学习建立在 Java 之上的所有相关工具时,了解 Core Java 会给你带来很大的优势。 + +![学习和研究技术是成功的关键][1] + +计算机编程(也被称为 *编码*)的重点不是使用哪种编程语言,而是发展编程逻辑和学习像程序员一样思考。你一开始使用的编程语言应该是在这一努力过程中对你帮助最大的语言。因此,你必须问自己一个问题,“作为一个程序员,你想开发什么?” + +例如,如果你想从事安卓应用开发、视频游戏开发、桌面 GUI 应用,或者只是一般的软件开发,我认为学习 Java 是一个很好的选择。我选择的语言是 Java,它为我提供了一个完整的编程世界。在我居住的印度,Java 程序员的平均工资约为每年 59 万印度卢比(LPA)(根据你的经验,可以高达 100 LPA)。 + +不过,Java 是一种庞大的语言,有很多框架和变体可供选择。Core Java 是科技行业发展出来的术语,指的是 Java 语言的中心组件,人们用它来编写框架,并围绕 Java 发展了丰富的产业。我认为,Core Java 是你能获得的最强大的技能之一,因为在学习建立在它之上的所有相关工具时,了解 Java 的基础知识会给你带来巨大的优势。 + +以下是我选择 Core Java 的八大理由,我想你也会认可: + +### 1、Java 是一种不断发展的编程语言 + +Java 有重要的企业支持,但 Java 开发中最重要的组成部分是 [OpenJDK][2],这是个开源的 Java 开发工具包。OpenJDK 社区以促进和维护开发源码、开放创新和开放标准为使命,致力于改进和维护 Java 及其工具链的开源实现。 + +它的每一个版本都会增加创新和便利,使 Java 对开发者和用户都更容易。例如,就在 Java 11 中,他们增加了运行 .java 文件的能力。现在,运行一个单文件的 Java 应用程序所需要的只是 `java` 命令,不需要进行编译: + +``` +$ java ./hello.java + +Hello world +``` + +你可以使用 Java 做 Web、移动或桌面的应用程序编程。它是一种高度通用的语言。它有许多有趣的特点,如动态编码、多种安全功能、平台无关的特点和以网络为中心的设计。 + +### 2、Java 锚定了安卓应用开发 + +你可以使用 Java 来创建安卓用程序。安卓市场巨大,对移动程序员的需求只会越来越大。即使你对成为一个专业的应用程序开发人员不感兴趣,定制你的移动体验的能力也是很强大的,而 Java 使之成为可能。 + +而且,这比你想象的要容易得多!学习 Core Java 可以让你轻松地掌握安卓开发工具包或可以输出到移动平台的框架,如 [Processing][3]。 + +### 3、丰富的 API 使得 Java 易于使用 + +Java 的 API(应用编程接口Application Programming Interface)包括类、包、接口等。Java 主要有三种类型的 API: + + * 官方的 Java Core API + * 最佳的官方 Java API + * 非官方的 API + +API 使编程更容易,因为你可以在不知道其内部实现的情况下构建应用程序。根据我的经验,许多公司喜欢用 Java 而不是其他选择,就是因为 Java API 的力量。 + +### 4、开源库 + +几乎有无穷无尽的 Java 开源库,包括 Maven、Guava、Apache Commons、Jhipster,等等。你可以复制、学习和分享这些库的资源。它们使编程更容易获得、更快、更便宜,也更有教育意义。 + +### 5、Java 有可靠的开发工具 + +Java 有一些我最喜欢的 IDE(集成开发环境Integrated Development Environments),包括 [Eclipse][4]、[NetBeans][5]、[BlueJ][6] 和 IntelliJ IDEA。它们提供了调试、语法高亮、代码补完、语言支持、自动重构等功能。简而言之,IDE 在 Java 的成功和你在 Java 学习中起着至关重要的作用! + +### 6、印度对 Java 开发人员的需求 + +谷歌、Netflix 和 Instagram 等巨头都使用 Java 进行后台开发。印度公司正在积极寻找雇用 Java 程序员来开发安卓应用程序、新的 API 和云上的微服务。这种需求转化为更多的工作机会。 + +### 7、Java 有庞大的编程社区 + +Java 程序员的社区庞大,囊括了从初学者到专家的所有人。我发现这个社区很热情待人,当你寻求支持的时候,他们会给予帮助。最重要的是,通过参与在线讨论,我学到了大量的新技巧。作为社区的一分子,这是我了解最新趋势、学习更多语言和跟上发展的重要途径。 + +### 8、Java 是独立于平台 + +Java 是平台无关的,这一点使它具有很高的价值。Java 源代码被编译成字节码,在 Java 虚拟机(JVM)上运行。任何运行 JVM 的平台(支持所有主要平台)都可以运行你的 Java 应用程序。你只需写一次,就可以在任何地方运行!这并不只是理论上的,Java 实际上已经实现了这一点。你可以在你开发的任何平台上编写 Java,并将其交付给你的所有目标平台。 + +网上有很多学习 Java 的资源,包括 Opensource.com 上有一个 [速查表][7]。还有一个很好的 [在线 Java 课程][8],可以用印地语免费学习。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/why-i-learned-core-java + +作者:[Shantam Sahai][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/shantam-sahai +[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://developer.ibm.com/components/open-jdk/ +[3]: http://processing.org/ +[4]: https://opensource.com/article/20/12/eclipse +[5]: https://opensource.com/article/20/12/netbeans +[6]: https://opensource.com/article/20/7/ide-java#bluej +[7]: https://opensource.com/downloads/java-cheat-sheet +[8]: https://www.learnvern.com/course/core-java-programming-tutorial From 6c1aefb84a2ca1549085f4c402008cc26718ec08 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 Oct 2021 11:03:36 +0800 Subject: [PATCH 0606/1588] APL --- .../tech/20210818 below- a time traveling resource monitor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210818 below- a time traveling resource monitor.md b/sources/tech/20210818 below- a time traveling resource monitor.md index 0b55e8b14b..2016e92dc8 100644 --- a/sources/tech/20210818 below- a time traveling resource monitor.md +++ b/sources/tech/20210818 below- a time traveling resource monitor.md @@ -2,7 +2,7 @@ [#]: via: "https://fedoramagazine.org/below-a-time-traveling-resource-monitor/" [#]: author: "Daniel Xu https://fedoramagazine.org/author/dxuu/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 3e91d556b157e2bb14cca14d90e48c8d98c219e9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 Oct 2021 14:38:54 +0800 Subject: [PATCH 0607/1588] TSL --- ...elow- a time traveling resource monitor.md | 111 ------------------ ...elow- a time traveling resource monitor.md | 108 +++++++++++++++++ 2 files changed, 108 insertions(+), 111 deletions(-) delete mode 100644 sources/tech/20210818 below- a time traveling resource monitor.md create mode 100644 translated/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 deleted file mode 100644 index 2016e92dc8..0000000000 --- a/sources/tech/20210818 below- a time traveling resource monitor.md +++ /dev/null @@ -1,111 +0,0 @@ -[#]: 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: "wxy" -[#]: 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 diff --git a/translated/tech/20210818 below- a time traveling resource monitor.md b/translated/tech/20210818 below- a time traveling resource monitor.md new file mode 100644 index 0000000000..2571c2d3d4 --- /dev/null +++ b/translated/tech/20210818 below- a time traveling resource monitor.md @@ -0,0 +1,108 @@ +[#]: 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: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Below:一个时间旅行的资源监控器 +====== + +![][1] + +在这篇文章中,我们将介绍 below:一个用于现代 Linux 系统的 Apache 2.0 许可的资源监视器。below 允许你重放以前记录的数据。 + +### 背景 + +内核的主要职责之一是调解对资源的访问。有时这可能意味着分配物理内存,使多个进程可以共享同一主机。其他时候,它可能意味着确保 CPU 时间的公平分配。在所有这些情况下,内核提供了机制,而将策略留给了“别人”。在最近,这个“别人”通常是 systemd 或 dockerd 这样的运行时。运行时接受来自调度器或最终用户的输入(类似于运行什么和如何运行)并在内核上转动正确的旋钮和拉动正确的杠杆,从而使工作负载能够*好好*工作。 + +在一个完美的世界里,故事就到此结束了。然而,现实情况是,资源管理是一个复杂的、相当不透明的技术混合体,在几十年里计算技术不断发展。尽管其中一些技术有各种缺陷和死角,但最终的结果,容器运作得比较好。虽然用户通常不需要关心这些细节,但对于基础设施运营商来说,对他们的技术架构拥有可见性是至关重要的。可见性和可调试性对于检测和调查错误配置、问题和系统性故障至关重要。 + +让事情变得更加复杂的是,资源中断往往难以重现。经常需要花费数周时间等待一个问题重新出现,以便调查其根本原因。规模的扩大进一步加剧了这个问题:我们不能在*每台*主机上运行一个自定义脚本,希望在错误再次发生时记录下关键状态的片段。因此,需要更复杂的工具。这就出现了 below。 + +### ### 动机 + +历史上,Facebook 一直是 [atop][5] 的忠实用户。`atop` 是一个用于 Linux 的性能监视器,能够报告所有进程的活动以及各种系统级活动。与 `htop` 等工具相比,`atop` 最引人注目的功能之一是能够作为一个守护程序记录历史数据。这听起来是一个简单的功能,但在实践中,这使得调试无数的生产问题成为可能。有了足够长的数据保留,就有可能在时间上回溯,查看在问题或故障发生之前、期间和之后的主机状态。 + +不幸的是,随着时间的推移,人们发现`atop` 有某些不足之处。首先,[控制组][6]cgroup 已经成为控制和监视 Linux 机器上资源的实际方式。`atop` 仍然缺乏对这一基本构建模块的支持。第二,`atop` 用自定义的 delta 压缩方法在磁盘上存储数据。这在正常情况下运行良好,但在沉重的资源压力下,主机很可能会丢失数据点。由于使用了 delta 压缩,在数据最重要的时间段内,数据可能会大面积丢失。第三,用户体验有一个陡峭的学习曲线。我们经常听到 `atop` 的资深用户说,他们喜欢密集的布局和众多的键盘绑定。然而,这也是一把双刃剑。当一个刚进入这个领域的人想要调试一个生产问题时,他们现在要同时解决两个问题:手头的问题和如何使用 `atop`。 + +`below` 是由 Facebook 的资源控制团队为其设计和开发的,并得到了 `atop` 生产用户的投入。顾名思义,资源控制团队负责的是规模化的资源管理。该团队由内核开发人员、容器运行时开发人员和硬件人员组成。认识到下一代系统监控器的机会,我们在设计 `below` 时考虑到以下几点: + + * 易用性:`below` 必须既能为新用户提供直观的体验,又能为日常用户提供强大的功能。 + *有意义的统计数据:`below` 显示准确和有用的统计数据。即便可以,但我们尽量避免收集和倾倒统计数字。 + * 灵活性:当默认设置不合适时,我们允许用户自定义他们的体验。例如包括可配置的键绑定、可配置的默认视图,以及脚本界面(默认为终端用户接口)。 + +### 安装 + +安装该软件包: + +``` +# dnf install -y below +``` + +打开记录守护进程: + +``` +# systemctl enable --now below +``` + +### 快速介绍 + +`below` 最常用的模式是重放模式。顾名思义,重放模式是重放以前记录的数据。假设你已经启动了记录守护程序,那么通过运行以下程序启动一个会话: + +``` +$ below replay --time "5 minutes ago" +``` + +然后你会看到控制组视图: + +![][2] + +如果你不知道该怎么操作,或者忘记了一个键位,按 `?` 可以进入帮助菜单。 + +屏幕的最上方是状态栏。状态栏显示关于当前样本的信息。你可以通过按 `t` 和 `T` 分别向前和向后移动样本。中间的部分是系统概览。系统概览包含了关于整个系统的统计数据,一般来说,这些数据总是很有用的。第三部分也是最下面的部分是多用途视图。上面的图片显示了控制组视图。此外,还有进程和系统视图,分别通过按 `p` 和` s` 来访问。 + +按 `↑` 和 `↓` 来移动列表选择。按回车键来折叠和展开控制组。假设你发现了一个感兴趣的控制组,你想看看它里面有哪些进程在运行。要放大进程视图,选择控制组并按 `z`: + +![][3] + +再按 `z` 返回到控制组视图。这个视图有时会有点长。如果你对你要找的东西有一个模糊的概念,你可以通过按 `/` 并输入一个过滤器来过滤控制组名称。 + +![][4] + +在这一点上,你可能已经注意到了一个我们还没有探索过的标签系统。要在标签中向前和向后循环,可以分别按 `Tab` 和 `Shift` + `Tab`。我们把这个问题留给读者去做练习。 + +### 其他功能 + +在底层下,`below` 有一个强大的设计和架构。Facebook 正在不断升级到更新的内核,所以我们从不假设数据源是可用的。这种默契的假设使得内核和 `below `版本之间能够完全向前和向后兼容。此外,每个数据点都被 zstd 压缩并完整地存储。这解决了我们看到的 `atop` 在大规模时的 delta 压缩问题。根据我们的测试,我们的每个样本压缩可以达到平均 5 倍的压缩率。 + +`below` 也使用 [eBPF][8] 来收集关于短暂进程(生存时间短于数据收集间隔的进程)的信息。相比之下,`atop` 使用 BSD 进程核算来实现这一功能,这是一个已知的缓慢且容易发生优先级转换的内核接口。 + +对于用户来说,`below` 还支持实时模式和一个转储接口。实时模式将记录守护程序和 TUI 会话合并到一个进程中。这对于浏览系统状态是很方便的,不需要为数据存储投入长期运行的守护程序或磁盘空间。转储接口是一个可编写脚本的接口,用于所有的 `below` 数据存储。转储既强大又灵活,详细的数据以 CSV、JSON 和人类可读格式提供。 + +### 总结 + +`below` 是一个 Apache 2.0 许可的开源项目,我们(`below` 的开发者)认为它比资源监控领域的现有工具具有引人注目的优势。我们已经花了大量的精力来准备 `below`,以提供开源使用,所以我们希望读者和社区有机会尝试 `below`,并报告错误和功能要求。 + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/below-a-time-traveling-resource-monitor/ + +作者:[Daniel Xu][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://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 +[5]: +[6]: +[7]: \ No newline at end of file From e70fc460e31dd291bdcd832587dd3fee140e912a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 Oct 2021 14:58:47 +0800 Subject: [PATCH 0608/1588] PRF @mengxinayan --- .../20210728 Kernel tracing with trace-cmd.md | 60 ++++++++++--------- 1 file changed, 33 insertions(+), 27 deletions(-) diff --git a/translated/tech/20210728 Kernel tracing with trace-cmd.md b/translated/tech/20210728 Kernel tracing with trace-cmd.md index f2f2633110..b0bd534721 100644 --- a/translated/tech/20210728 Kernel tracing with trace-cmd.md +++ b/translated/tech/20210728 Kernel tracing with trace-cmd.md @@ -3,16 +3,18 @@ [#]: author: (Gaurav Kamathe https://opensource.com/users/gkamathe) [#]: collector: (lujun9972) [#]: translator: (mengxinayan) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) 使用 trace-cmd 追踪内核 ====== -trace-cmd 是一个容易使用且特性众多的,可用来追踪内核函数的命令。 -![Puzzle pieces coming together to form a computer screen][1] -在 [之前的文章][2] 里,我介绍了如何利用 `ftrace` 来追踪内核函数。通过写入和读出文件来使用 `ftrace` 会变得很枯燥,所以在它周围使用了一个包装器来运行带有选项的命令,以启用和禁用追踪,设置过滤器,查看输出,清除输出等等。 +> trace-cmd 是一个易于使用,且特性众多、可用来追踪内核函数的命令。 + +![](https://img.linux.net.cn/data/attachment/album/202110/05/145818d2i9tgjetzj8itqg.jpg) + +在 [之前的文章][2] 里,我介绍了如何利用 `ftrace` 来追踪内核函数。通过写入和读出文件来使用 `ftrace` 会变得很枯燥,所以我对它做了一个封装来运行带有选项的命令,以启用和禁用追踪、设置过滤器、查看输出、清除输出等等。 [trace-cmd][3] 命令是一个可以帮助你做到这一点的工具。在这篇文章中,我使用 `trace-cmd` 来执行我在 `ftrace` 文章中所做的相同任务。由于会经常参考那篇文章,建议在阅读这篇文章之前先阅读它。 @@ -27,7 +29,7 @@ trace-cmd 是一个容易使用且特性众多的,可用来追踪内核函数 none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) ``` -然而,你需要手动尝试安装 `trace-cmd` 命令: +不过,你需要手动尝试安装 `trace-cmd` 命令: ``` # dnf install trace-cmd -y @@ -35,16 +37,16 @@ none on /sys/kernel/tracing type tracefs (rw,relatime,seclabel) ### 列出可用的追踪器 -当使用 `ftrace` 时,你必须查看文件的内容以了解有哪些追踪器可用。但使用 `trace-cmd`,你可以通过以下方式获得这些信息。 +当使用 `ftrace` 时,你必须查看文件的内容以了解有哪些追踪器可用。但使用 `trace-cmd`,你可以通过以下方式获得这些信息: ``` # trace-cmd list -t hwlat blk mmiotrace function_graph wakeup_dl wakeup_rt wakeup function nop ``` -### 启用函数(function)追踪器 +### 启用函数追踪器 -在我之前的文章中,我使用了两个追踪器,在这里我也会这么做。用 `function` 启用你的第一个追踪器。 +在我 [之前的文章][2] 中,我使用了两个追踪器,在这里我也会这么做。用 `function` 启用你的第一个追踪器: ``` $ trace-cmd start -p function @@ -53,7 +55,7 @@ $ trace-cmd start -p function ### 查看追踪输出 -一旦追踪器被启用,你可以通过使用 `show` 参数来查看输出。这只显示了前20行,以保持例子的简短(见我之前的文章对输出的解释)。 +一旦追踪器被启用,你可以通过使用 `show` 参数来查看输出。这只显示了前 20 行以保持例子的简短(见我之前的文章对输出的解释): ``` # trace-cmd show | head -20 @@ -83,24 +85,28 @@ $ trace-cmd start -p function 追踪将会在后台继续运行,你可以继续用 `show` 查看输出。 -要停止追踪,请运行带有 `stop` 参数的 `trace-cmd` 命令。 +要停止追踪,请运行带有 `stop` 参数的 `trace-cmd` 命令: + ``` # trace-cmd stop ``` -要清除缓冲区,用 `clear` 参数运行它。 + +要清除缓冲区,用 `clear` 参数运行它: + ``` # trace-cmd clear ``` -### 启用 函数调用图(function_graph) 追踪器 +### 启用函数调用图追踪器 运行第二个追踪器,通过 `function_graph` 参数来启用它。 + ``` # trace-cmd start -p function_graph Plugin 'function_graph' ``` -再次使用 `show` 参数查看输出。正如预期的那样,输出与第一次追踪输出略有不同。这一次,它包括一个**函数调用**链。 +再次使用 `show` 参数查看输出。正如预期的那样,输出与第一次追踪输出略有不同。这一次,它包括一个**函数调用**链: ``` # trace-cmd show | head -20 @@ -126,7 +132,7 @@ $ trace-cmd start -p function 4) | __cond_resched() { ``` -使用 `stop` 和 `clear` 命令来停止追踪和清楚缓存区。 +使用 `stop` 和 `clear` 命令来停止追踪和清除缓存区: ``` # trace-cmd stop @@ -135,14 +141,14 @@ $ trace-cmd start -p function ### 调整追踪以增加深度 -如果你想在函数调用中看到更多的深度,你可以对追踪器进行调整。 +如果你想在函数调用中看到更多的深度,你可以对追踪器进行调整: ``` # trace-cmd start -p function_graph --max-graph-depth 5 plugin 'function_graph' ``` -现在,当你将这个输出与你之前看到的进行比较时,你应该看到更多的嵌套函数调用。 +现在,当你将这个输出与你之前看到的进行比较时,你应该看到更多的嵌套函数调用: ``` # trace-cmd show | head -20 @@ -170,7 +176,7 @@ $ trace-cmd start -p function ### 了解可被追踪的函数 -如果你想只追踪某些函数而忽略其他的,你需要知道确切的函数名称。你可以用 `list -f` 参数来得到它们。例如搜索常见的内核函数 `kmalloc`,它被用来在内核中分配内存。 +如果你想只追踪某些函数而忽略其他的,你需要知道确切的函数名称。你可以用 `list -f` 参数来得到它们。例如搜索常见的内核函数 `kmalloc`,它被用来在内核中分配内存: ``` # trace-cmd list -f | grep kmalloc @@ -198,7 +204,7 @@ __kmalloc_node_track_caller ### 追踪内核模块相关的函数 -你也可以追踪与特定内核模块相关的函数。假设你想追踪 `kvm` 内核模块相关的功能,你可以通过以下方式来实现。确保该模块已经加载。 +你也可以追踪与特定内核模块相关的函数。假设你想追踪 `kvm` 内核模块相关的功能,你可以通过以下方式来实现。请确保该模块已经加载: ``` # lsmod | grep kvm_intel @@ -228,7 +234,7 @@ vmx_dump_sel [kvm_intel] 现在你知道了如何找到感兴趣的函数,请用一个例子把这些内容用于时间。就像前面的文章一样,试着追踪与文件系统相关的函数。我的测试系统上的文件系统是 `ext4`。 -这个过程略有不同;你在运行命令时,不需要**启动**,而是在**记录**参数后面加上你想追踪的函数的 "模式"。你还需要指定你想要的追踪器;在这种情况下,就是 `function_graph`。该命令会继续记录追踪,直到你用 `Ctrl+C` 停止它。所以几秒钟后,按 `Ctrl+C` 停止追踪。 +这个过程略有不同;你在运行命令时,不使用 `start` 参数,而是在 `record` 参数后面加上你想追踪的函数的“模式”。你还需要指定你想要的追踪器;在这种情况下,就是 `function_graph`。该命令会继续记录追踪,直到你用 `Ctrl+C` 停止它。所以几秒钟后,按 `Ctrl+C` 停止追踪: ``` # trace-cmd list -f | grep ^ext4_ @@ -244,7 +250,7 @@ CPU0 data recorded at offset=0x856000 ### 查看追踪记录 -要查看你之前的追踪记录,运行带有 `report` 参数的命令。从输出结果来看,很明显过滤器起作用了,你只看到 `ext4` 相关的函数追踪。 +要查看你之前的追踪记录,运行带有 `report` 参数的命令。从输出结果来看,很明显过滤器起作用了,你只看到 `ext4` 相关的函数追踪: ``` # trace-cmd report | head -20 @@ -267,14 +273,14 @@ cpus=8 ### 追踪一个特定的 PID -假设你想追踪与一个进程(PID)有关的函数。打开另一个终端,注意运行中的 shell 的PID。 +假设你想追踪与一个进程(PID)有关的函数。打开另一个终端,注意运行中的 shell 的PID: ``` # echo $$ 10885 ``` -再次运行 `record` 命令,用 `-P` 选项传递PID。这一次,让终端运行(也就是说,先不要按 `Ctrl+C` )。 +再次运行 `record` 命令,用 `-P` 选项传递PID。这一次,让终端运行(也就是说,先不要按 `Ctrl+C` ): ``` # trace-cmd record -P 10885 -p function_graph @@ -284,7 +290,7 @@ Hit Ctrl^C to stop recording ### 在 shell 上运行一些命令 -移动到另一个终端,在那里你有一个以特定PID运行的shell,并运行任何命令,例如,`ls` 命令用来列出文件。 +移动到另一个终端,在那里你有一个以特定 PID 运行的 shell,并运行任何命令,例如,`ls` 命令用来列出文件: ``` # ls @@ -294,7 +300,7 @@ v8-compile-cache-1000 [...] ``` -移动到你启用追踪的终端,按 `Ctrl+C` 停止追踪。 +移动到你启用追踪的终端,按 `Ctrl+C` 停止追踪: ``` # trace-cmd record -P 10885 -p function_graph @@ -306,7 +312,7 @@ CPU1 data recorded at offset=0x856000 [...] ``` -在追踪的输出中,你可以看到左边是 PID 和 Bash shell,右边是与之相关的函数调用。这对于缩小你的追踪范围是非常方便的。 +在追踪的输出中,你可以看到左边是 PID 和 Bash shell,右边是与之相关的函数调用。这对于缩小你的追踪范围是非常方便的: ``` # trace-cmd report | head -20 @@ -337,12 +343,12 @@ via: https://opensource.com/article/21/7/linux-kernel-trace-cmd 作者:[Gaurav Kamathe][a] 选题:[lujun9972][b] 译者:[萌新阿岩](https://github.com/mengxinayan) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [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/puzzle_computer_solve_fix_tool.png?itok=U0pH1uwj (Puzzle pieces coming together to form a computer screen) -[2]: https://opensource.com/article/21/7/analyze-linux-kernel-ftrace +[2]: https://linux.cn/article-13752-1.html [3]: https://lwn.net/Articles/410200/ From 9227fcf69baba25805d94f5e937fe1d7ff1f3c3a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 5 Oct 2021 14:59:38 +0800 Subject: [PATCH 0609/1588] PUB @mengxinayan https://linux.cn/article-13852-1.html --- .../20210728 Kernel tracing with trace-cmd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210728 Kernel tracing with trace-cmd.md (99%) diff --git a/translated/tech/20210728 Kernel tracing with trace-cmd.md b/published/20210728 Kernel tracing with trace-cmd.md similarity index 99% rename from translated/tech/20210728 Kernel tracing with trace-cmd.md rename to published/20210728 Kernel tracing with trace-cmd.md index b0bd534721..1b4f6dfc9f 100644 --- a/translated/tech/20210728 Kernel tracing with trace-cmd.md +++ b/published/20210728 Kernel tracing with trace-cmd.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (mengxinayan) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13852-1.html) 使用 trace-cmd 追踪内核 ====== From b34fbdc9457791731246800371131869937ab753 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 6 Oct 2021 05:02:53 +0800 Subject: [PATCH 0610/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211005?= =?UTF-8?q?=20Get=20podman=20up=20and=20running=20on=20Windows=20using=20L?= =?UTF-8?q?inux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211005 Get podman up and running on Windows using Linux.md --- ...n up and running on Windows using Linux.md | 146 ++++++++++++++++++ 1 file changed, 146 insertions(+) create mode 100644 sources/tech/20211005 Get podman up and running on Windows using Linux.md diff --git a/sources/tech/20211005 Get podman up and running on Windows using Linux.md b/sources/tech/20211005 Get podman up and running on Windows using Linux.md new file mode 100644 index 0000000000..ddbca0e519 --- /dev/null +++ b/sources/tech/20211005 Get podman up and running on Windows using Linux.md @@ -0,0 +1,146 @@ +[#]: subject: "Get podman up and running on Windows using Linux" +[#]: via: "https://opensource.com/article/21/10/podman-windows-wsl" +[#]: author: "Stephen Cuppett https://opensource.com/users/cuppett" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Get podman up and running on Windows using Linux +====== +Enable WSL 2 guests to run the podman, skopeo, or buildah commands from +within Windows using the Linux distribution of your choice. +![Penguin driving a car with a yellow background][1] + +WSL 2, the second iteration of the Windows Subsystem for Linux, allows you to run a Linux environment natively on Windows, without the overhead of a virtual machine (VM). It integrates nicely with Windows, too, and provides you access to most of the command-line tools, utilities, and applications you're used to on Linux. + +This guide shows you how to enable WSL 2 guests to run the `podman`, `skopeo`, or `buildah` commands from within Windows using the Linux distribution of your choice (available from the Microsoft store). Coming from a Fedora Linux host OS starting point, I was curious how to enable and use tools I'm most familiar with from within Windows. + +### Prerequisite: WSL 2 + +To install WSL 2, go to the [WSL installation][2] page. + +Use Powershell to ensure that WSL 2 is enabled by default: + +`PS> wsl –set-default-version 2` + +For information on key differences between WSL 1 and WSL 2, see the [WSL documentation][3]. + +The Windows Subsystem for Linux has come a long way. Microsoft has worked hard to make the separation between the host Windows OS and the guest Linux operating system virtually invisible. Special drivers in the kernels of each system make it easy to run commands between various shells and command windows and enable mutual filesystem access. + +You can confirm you are correctly using the WSL 2 kernel with the following command and output in any of the guests: + + +``` +$ uname -a +Linux BLD 5.10.16.3-microsoft.standard-WSL2 #1 SMP Fri Apr 2 22:23:49 +UTC 2021 x86_64 x86_64 GNU/Linux +``` + +WSL 1 guests report a kernel version as 4.14 or similar. + +Small touches in your guests can make the integration even more seamless, including symlinking of various home directory files (.aws, .sh, .config, and so on). There is a hint of how this can be achieved right from the $HOME directory: + +![$HOME directory][4] + +(Stephen Cuppett, [CC BY-SA 4.0][5]) + +### Install a Linux distribution + +To install a Linux distribution, find your favorite in the Microsoft Store. + +![screenshot of Fedora Remix purchase in the Microsoft store][6] + +(Stephen Cuppett, [CC BY-SA 4.0][5]) + +For this article, I'm using Fedora, but other distributions are available to try. Podman works well across distributions, so you can use whatever distribution you're most familiar with. There may be some minor configuration adjustments required, but those are generally documented by the distribution and podman documentation. I chose Fedora because it was the distribution that required no extra setup to get the latest podman working. + +On the first launch, the VM and related technologies are installed. You'll be prompted to select a password for the first user (which gets sudo access). + +### Install podman + +Once your Linux distribution has been installed and configured with a user, you can install podman as usual: + +`$ sudo dnf install podman` + +After a few moments, podman is installed and ready to go. You can check that everything is working as expected: + + +``` +$ podman info +host: +  arch: amd64 +  buildahVersion: 1.22.3 +  cgroupControllers: [] +  cgroupManager: cgroupfs +  cgroupVersion: v1 +[...] +version: +  APIVersion: 3.3.1 +  OsArch: linux/amd64 +  Version: 3.3.1 +``` + +From there, you can build images and use podman as you usually would. + +Thanks to WSL integration, podman is even accessible and usable from PowerShell or the command prompt: + +![screenshot example of Windows PowerShell][7] + +(Stephen Cuppett, [CC BY-SA 4.0][5]) + +Installing and using the `buildah` and `skopeo` commands is exactly the same process. + +### Busybox test + +As a simple test to see `podman` at work, you can pull and run a Busybox container. [BusyBox][8] is an open source (GPL) project providing simple implementations of nearly 400 common commands, including `ls, mv, ln, mkdir, more, ps, gzip, bzip2, tar`, and `grep`, which makes it a fittingly minimal environment for containers and for simple tests like this one. + +First, search the default image repository for a Busybox container. You can do this in either your Linux terminal or in Powershell. + + +``` +$ podman search busybox +INDEX       NAME                             DESCRIPTION                     +docker.io   docker.io/library/busybox        Busybox base image                   +docker.io   docker.io/radial/busyboxplus     Full-chain... +docker.io   docker.io/yauritux/busybox-curl  Busybox with CURL +``` + +Run the one you want to try: + + +``` +$ podman run -it docker.io/library/busybox +/ # +``` + +You can use the container, run a few commands to verify that everything works as expected, then leave it with the exit command. + +### Get started + +I'll admit I was surprised how readily the current Linux distributions out there, podman, and the Windows subsystem worked together here. It's obvious a lot of great work has gone into Windows' container tooling and integration with Linux. I'm hopeful this guide helps others get to this same launching point easily and start being productive. + +There are many good candidates for deep follow-up, including working with volumes, exposing networked services between the guest and the host, and exposing Linux capabilities in those containers. With so many tools available, I have great confidence that the community will make short work of digging through them! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/podman-windows-wsl + +作者:[Stephen Cuppett][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/cuppett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://docs.microsoft.com/en-us/windows/wsl/install +[3]: https://docs.microsoft.com/en-us/windows/wsl/about +[4]: https://opensource.com/sites/default/files/uploads/home_directory_0.png (directory) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://opensource.com/sites/default/files/uploads/fedora_remix_0.png (Fedora Remix) +[7]: https://opensource.com/sites/default/files/uploads/power_shell.png (Windows PowerShell) +[8]: https://opensource.com/article/21/8/what-busybox From 0c94b8d89c110ce31c2132d0e518328bd95e4f58 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 6 Oct 2021 05:03:31 +0800 Subject: [PATCH 0611/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211005?= =?UTF-8?q?=20Tools=20to=20explore=20BGP?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211005 Tools to explore BGP.md --- sources/tech/20211005 Tools to explore BGP.md | 374 ++++++++++++++++++ 1 file changed, 374 insertions(+) create mode 100644 sources/tech/20211005 Tools to explore BGP.md diff --git a/sources/tech/20211005 Tools to explore BGP.md b/sources/tech/20211005 Tools to explore BGP.md new file mode 100644 index 0000000000..ee03790758 --- /dev/null +++ b/sources/tech/20211005 Tools to explore BGP.md @@ -0,0 +1,374 @@ +[#]: subject: "Tools to explore BGP" +[#]: via: "https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Tools to explore BGP +====== + +Yesterday there was a big Facebook outage caused by BGP. I’ve been vaguely interested in learning more about BGP for a long time, so I was reading a couple of articles. + +I got frustrated because none of the articles showed me how I could actually look up information related to BGP on my computer, so I [wrote a tweet asking for tools][1]. + +I got a bunch of useful replies as always, so this blog post shows some tools you can use to look up BGP information. There might be an above average number of things wrong in this post because I don’t understand BGP that well. + +### I can’t publish BGP routes + +One of the reasons I’ve never learned much about BGP is – as far as I know, I don’t have access to publish BGP routes on the internet. + +With most networking protocols, you can pretty trivially get access to implement the protocol yourself if you want. For example you can: + + * issue your own TLS certificates + * write your own HTTP server + * write your own TCP implementation + * write your own authoritative DNS server for your domain (I’m trying to do that right now for a small project) + * set up your own certificate authority + + + +But with BGP, I think that unless you own your own ASN, you can’t publish routes yourself! (you _could_ implement BGP on your home network, but that feels a bit boring to me, when I experiment with things I like them to actually be on the real internet). + +Anyway, even though I can’t experiment with it, I still think it’s super interesting because I love networking, so I’m going to show you some tools I found to learn about BGP :) + +First let’s talk through some BGP terminology though. I’m going to go pretty fast because I’m more interested in the tools and there are a lot of high level explanations of BGP out there (like this [cloudflare post][2]). + +### What’s an AS (“autonomous system”) + +The first thing we need to understand is an AS. Every AS: + + 1. is owned by an organization (usually a large organization like your ISP, a government, a university, Facebook, etc) + 2. controls a specific set of IP addresses (for example my ISP’s AS includes 247,808 IP addresses) + 3. has a number (like 1403) + + + +Here are some observations I made about ASes just by doing some experimentation: + + * Some fairly big tech companies don’t have their own AS. For example, I looked up Patreon on BGPView, and as far as I can tell they don’t own as AS – their main site (patreon.com, [104.16.6.49][3]) is in Cloudflare’s AS. + * An AS can include IPs in many countries. Facebook’s AS ([AS32934][4]) definitely has IP addresses in Singapore, Canada, Nigeria, Kenya, the US, and more countries. + * It seems like IP address can be in more than one AS. For example, if I look up [209.216.230.240][5], it has 2 ASNs associated with it – AS6130 and AS21581. Apparently when this happens the more specific route takes priority – so packets to that IP would get routed to AS21581. + + + +### what’s a BGP route? + +There are a lot of routers on the internet. For example, my ISP has routers. + +When I send my ISP a packet (for example by running `ping 129.134.30.0`), my ISP’s routers needs to figure out how to actually get my packet to the IP address `129.134.30.0`. + +The way the router figures this out is that it has a **route table** – it has a list of a bunch of IP ranges (like `129.134.30.0/23`), and routes it knows about to get to that subnet. + +Here’s an example of a real route for `129.134.30.0/23`: (one of Facebook’s subnets). This one isn’t from my ISP. + +``` +11670 32934 + 206.108.35.2 from 206.108.35.254 (206.108.35.254) + Origin IGP, metric 0, valid, external + Community: 3856:55000 + Last update: Mon Oct 4 21:17:33 2021 +``` + +I think that this is saying that one path to `129.134.30.0` is through the machine `206.108.35.2`, which is on its local network. So the router might send my ping packet to `206.108.35.2` next, and then `206.108.35.2` will know how to get it to Facebook. The two numbers at the beginning (`11670 32934`) are ASNs. + +### what’s BGP? + +My understanding of BGP is very shaky, but it’s a protocol that companies use to advertise BGP routes. + +What happened yesterday with Facebook is that they basically made BGP announcements withdrawing all their BGP routes, so every router in the world deleted all of its routes related to Facebook, so no traffic could get there. + +Okay, now that we’ve covered some basic terminology, let’s talk about tools you can use to look at autonomous systems and BGP! + +### tool 1: look at your ISP’s AS with BGPView + +To make this AS thing less abstract, let’s use a tool called [BGPView][6] to look at a real AS. + +My ISP (EBOX) owns [AS 1403][7]. Here are the [IP addresses my ISP owns][8]. If I look up my computer’s public IPv4 address, I can check that it’s one of the IP addresses my ISP owns – it’s in the `104.163.128.0/17` block. + +BGPView also has this graph of how my ISP is connected to other ASes + +![][9] + +### tool 2: `traceroute -A` and `mtr -z` + +Okay, so we’re interested in autonomous systems. Let’s see which ASes I go through from + +`traceroute` and `mtr` both have options to tell you the ASN for every IP you go through. The flags are `traceroute -A` and `mtr -z`, respectively. + +Let’s see which autonomous systems I go through on my way to facebook.com with `mtr`! + +``` +$ mtr -z facebook.com + 1. AS??? LEDE.lan + 2. AS1403 104-163-190-1.qc.cable.ebox.net + 3. AS??? 10.170.192.58 + 4. AS1403 0.et-5-2-0.er1.mtl7.yul.ebox.ca + 5. AS1403 0.ae17.er2.mtl3.yul.ebox.ca + 6. AS1403 0.ae0.er1.151fw.yyz.ebox.ca + 7. AS??? facebook-a.ip4.torontointernetxchange.net + 8. AS32934 po103.psw01.yyz1.tfbnw.net + 9. AS32934 157.240.38.75 +10. AS32934 edge-star-mini-shv-01-yyz1.facebook.com +``` + +This is interesting – it looks like we go directly from my ISP’s AS (1403) to Facebook’s AS (32934), with an “internet exchange” in between. + +I’m not sure what an [internet exchange][10] is but I know that it’s an extremely important part of the internet. That’s going to be for another day though. My best guess is that it’s the part of the internet that enables “peering” – like an IX is a server room with a gigantic switch with infinite bandwith in it where a bunch of different companies put their computers so they can send each other packets. + +### mtr looks up ASNs with DNS + +I got curious about how mtr looks up ASNs, so I used strace. I saw that it looked like it was using DNS, so I ran [dnspeep][11], and voila! + +``` +$ sudo dnspeep +... +TXT 1.190.163.104.origin.asn.cymru.com 192.168.1.1 TXT: 1403 | 104.163.176.0/20 | CA | arin | 2014-08-14, TXT: 1403 | 104.163.160.0/19 | CA | arin | 2014-08-14, TXT: 1403 | 104.163.128.0/17 | CA | arin | 2014-08-14 +... +``` + +So it looks like we can find the ASN for `104.163.190.1` by looking up the `txt` record on `1.190.163.104.origin.asn.cymru.com`, like this: + +``` +$ dig txt 1.190.163.104.origin.asn.cymru.com +1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.160.0/19 | CA | arin | 2014-08-14" +1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.128.0/17 | CA | arin | 2014-08-14" +1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.176.0/20 | CA | arin | 2014-08-14" +``` + +That’s cool! Let’s keep moving though. + +### tool 3: the packet clearing house looking glass + +PCH (“packet clearing house”) is the organization that runs a lot of internet exchange points. A “looking glass” seems to be a generic term for a web form that lets you run network commands from another person’s computer. There are looking glasses that don’t support BGP, but I’m just interested in ones that show you information about BGP routes. + +Here’s the PCH looking glass: . + +In the web form on that site, I picked the Toronto IX (“TORIX”), since that’s what `mtr` said I was using to go to facebook.com. + +**thing 1: “show ip bgp summary”** + +Here’s the output. I’ve redacted some of it: + +``` +IPv4 Unicast Summary: +BGP router identifier 74.80.118.4, local AS number 3856 vrf-id 0 +BGP table version 33061919 +RIB entries 513241, using 90 MiB of memory +Peers 147, using 3003 KiB of memory +Peer groups 8, using 512 bytes of memory + +Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd +... +206.108.34.248 4 1403 484672 466938 0 0 0 05w3d03h 50 +... +206.108.35.2 4 32934 482088 466714 0 0 0 01w6d07h 38 +206.108.35.3 4 32934 482019 466475 0 0 0 01w0d06h 38 +... + +Total number of neighbors 147 +``` + +My understanding of what this is saying is that the Toronto Internet Exchange (“TORIX”) is directly connected to both my ISP (EBOX, AS 1403) and Facebook (AS 32934). + +**thing 2: “show ip bgp 129.134.30.0”** + +Here’s the output of picking “show ip bgp” for `129.134.30.0` (one of Facebook’s IP addresses): + +``` +BGP routing table entry for 129.134.30.0/23 +Paths: (4 available, best #4, table default) + Advertised to non peer-group peers: + 206.220.231.55 + 11670 32934 + 206.108.35.2 from 206.108.35.254 (206.108.35.254) + Origin IGP, metric 0, valid, external + Community: 3856:55000 + Last update: Mon Oct 4 21:17:33 2021 + + 11670 32934 + 206.108.35.2 from 206.108.35.253 (206.108.35.253) + Origin IGP, metric 0, valid, external + Community: 3856:55000 + Last update: Mon Oct 4 21:17:31 2021 + + 32934 + 206.108.35.3 from 206.108.35.3 (157.240.58.225) + Origin IGP, metric 0, valid, external, multipath + Community: 3856:55000 + Last update: Mon Oct 4 21:17:27 2021 + + 32934 + 206.108.35.2 from 206.108.35.2 (157.240.58.182) + Origin IGP, metric 0, valid, external, multipath, best (Older Path) + Community: 3856:55000 + Last update: Mon Oct 4 21:17:27 2021 +``` + +This seems to be saying that there are 4 routes to Facebook from that internet exchange. + +**the quebec internet exchange doesn’t seem to know anything about Facebook** + +I also tried the same thing from the Quebec internet exchange QIX (which is presumably closer to me, since I live in Montreal and not Toronto). But the QIX doesn’t seem to know anything about Facebook – when I put in `129.134.30.0` it just says “% Network not in table”. + +So I guess that’s why I was sent through the Toronto IX and not the Quebec one. + +### more BGP looking glasses + +Here are some more websites with looking glasses that will give you similar information from other points of view. They all seem to support the same `show ip bgp` syntax, maybe because they’re running the same software? I’m not sure. + + * + * + * + + + +There seem to be a LOT of these looking glass services out there, way more than just those 3 lists. + +Here’s an example session with one of the servers on this list: route-views.routeviews.org. This time I connected via telnet and not through a web form, but the output looks like it’s in the same format. + +``` +$ telnet route-views.routeviews.org + +route-views>show ip bgp 31.13.80.36 + +BGP routing table entry for 31.13.80.0/24, version 1053404087 +Paths: (23 available, best #2, table default) + Not advertised to any peer + Refresh Epoch 1 + 3267 1299 32934 + 194.85.40.15 from 194.85.40.15 (185.141.126.1) + Origin IGP, metric 0, localpref 100, valid, external + path 7FE0C3340190 RPKI State valid + rx pathid: 0, tx pathid: 0 + Refresh Epoch 1 + 6939 32934 + 64.71.137.241 from 64.71.137.241 (216.218.252.164) + Origin IGP, localpref 100, valid, external, best + path 7FE135DB6500 RPKI State valid + rx pathid: 0, tx pathid: 0x0 + Refresh Epoch 1 + 701 174 32934 + 137.39.3.55 from 137.39.3.55 (137.39.3.55) + Origin IGP, localpref 100, valid, external + path 7FE1604D3AF0 RPKI State valid + rx pathid: 0, tx pathid: 0 + Refresh Epoch 1 + 20912 3257 1299 32934 + 212.66.96.126 from 212.66.96.126 (212.66.96.126) + Origin IGP, localpref 100, valid, external + Community: 3257:8095 3257:30622 3257:50001 3257:53900 3257:53904 20912:65004 + path 7FE1195AF140 RPKI State valid + rx pathid: 0, tx pathid: 0 + Refresh Epoch 1 + 7660 2516 1299 32934 + 203.181.248.168 from 203.181.248.168 (203.181.248.168) + Origin IGP, localpref 100, valid, external + Community: 2516:1030 7660:9001 + path 7FE0D195E7D0 RPKI State valid + rx pathid: 0, tx pathid: 0 +``` + +Here there are a few options for routes: + + * `3267 1299 32934` + * `6939 32934` + * `701 174 32934` + * `20912 3257 1299 32934` + * `7660 2516 1299 32934` + + + +I think the reason there’s more than one AS in all of these is that `31.13.80.36` is a Facebook IP address in Toronto, so this server (which is maybe on the US west coast, I’m not sure) is not able to connect to it directly, it needs to go to another AS first. So all of the routes have one or more ASNs + +The shortest one is 6939 (“Hurricane Electric”), which is a “global internet backbone”. They also have their own [hurricane electric looking glass][12] page. + +### tool 4: BGPlay + +All the other tools so far have just shown us the current state of Facebook routing where everything is fine, but this 4th tool lets us see the history of this Facebook BGP internet disaster! It’s a GUI tool so I’m going to include a bunch of screenshots. + +The tool is at . I typed in the IP address 129.134.30.12 (one of Facebook’s IPs), if you want to play along. + +First, let’s look at the state of things before everything went wrong. I clicked in the timeline at 13:11:28 on Oct. 4, and got this: + +![][13] + +I originally found this very overwhelming. What’s happening? But then someone on Twitter pointed out that the next place to look is to click on the timeline right _after_ the Facebook disaster happened (at 18:38 on Oct. 4). + +![][14] + +It’s pretty clear that something is wrong in this picture – all the BGP routes are gone! oh no! + +The text at the top shows the last Facebook BGP route disappearing: + +``` +Type: W > withdrawal Involving: 129.134.30.0/24 +Short description: The route 50869, 25091, 32934 has been withdrawn. +Date and time: 2021-10-04 16:02:33 Collected by: 20-91.206.53.12 +``` + +If I then click the “fast forward” button, we see the BGP routes start to come back: + +![][15] + +The first one announced is `137409 32934`. I don’t think this is _actually_ the first one announced though – there are a lot of route announcements inside the same second (at 2021-10-04 21:00:40), and I think the ordering inside BGPlay is arbitrary. + +If I click the “fast forward” button again, more and more routes start to come back and routing starts to go back to normal + +I found looking at this outage in BGPlay really fun, even though the interface is pretty confusing at first. + +### maybe it is important to understand a little about BGP? + +I started out this post by saying you can’t change BGP routes BGP, but then I remembered that in 2016 or 2017 there was a [Telia routing issue][16] that caused us some minor network at work. And when that happens, it is actually useful to understand why your customers can’t reach your site, even if it’s totally out of your control. I didn’t know about any of these tools at that time but I would have liked to! + +I think for most companies all you can do to respond to outages caused by someone else’s bad BGP routes is “do nothing and wait for it to get fixed”, but it’s nice to be able to _confidently_ do nothing. + +### some ways to publish BGP routes + +If you want to (as a hobbyist) actually publish BGP routes, here are some links from the comments: + + * [a guide to getting your own ASN][17] + * [dn42][18] seems to have a playground for BGP (it’s not on the public internet, but it does have other people on it which seems more fun than just doing BGP by yourself at home) + + + +### that’s all for now + +I think there are a lot more BGP tools (like PCH has a bunch of [daily snapshots of routing data][19] which look like fun), but this post is already pretty long and there are other things I need to do today. + +I was surprised by how much information I could get about BGP just as a regular person, I always think of it as a “secret network wizard” thing but apparently there are all kind of public machines anybody can just telnet to and use to look at the route tables! Who knew! + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/ + +作者:[Julia 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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/b0rk/status/1445199475195236356 +[2]: https://blog.cloudflare.com/october-2021-facebook-outage/ +[3]: https://bgpview.io/ip/104.16.6.49 +[4]: https://bgpview.io/asn/32934#prefixes-v4 +[5]: https://bgpview.io/ip/209.216.230.240 +[6]: https://bgpview.io +[7]: https://bgpview.io/asn/1403 +[8]: https://bgpview.io/asn/1403#prefixes-v4 +[9]: https://jvns.ca/images/ebox-graph.png +[10]: https://en.wikipedia.org/wiki/Internet_exchange_point +[11]: https://github.com/jvns/dnspeep/ +[12]: https://lg.he.net/ +[13]: https://jvns.ca/images/bgplay-before.png +[14]: https://jvns.ca/images/bgplay-after.png +[15]: https://jvns.ca/images/bgplay-return.png +[16]: https://news.ycombinator.com/item?id=14246888 +[17]: https://labs.ripe.net/author/samir_jafferali/build-your-own-anycast-network-in-nine-steps/ +[18]: https://dn42.eu/Home +[19]: https://www.pch.net/resources/Routing_Data/IPv4_daily_snapshots/ From cf444883450485892e2a7ebbfd045afbf0c4c176 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 6 Oct 2021 05:03:56 +0800 Subject: [PATCH 0612/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211005?= =?UTF-8?q?=20GNOME=2042=20to=20Introduce=20a=20System-wide=20Dark=20Style?= =?UTF-8?q?=20Preference,=20Thanks=20to=20elementary=20OS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md --- ...yle Preference, Thanks to elementary OS.md | 79 +++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md diff --git a/sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md b/sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md new file mode 100644 index 0000000000..de58e11b9a --- /dev/null +++ b/sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md @@ -0,0 +1,79 @@ +[#]: subject: "GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS" +[#]: via: "https://news.itsfoss.com/gnome-42-dark-style-preference/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS +====== + +There’s still time for GNOME 42, but it looks like it will implement a system-wide dark mode preference similar to [elementary OS 6][1]. + +If you have been reading our coverages, you must have noticed mentioning it as one of the [best elementary OS 6 features][2]. + +And for all the right reasons. Unlike a GTK theme change, elementary OS 6 approached the dark style preference as an opt-in preference that application developers can detect and choose to respect. + +Even though this means that there’s more to be expected from the app developers, but when successful, it should result in a consistent dark mode experience. + +In a [blog post][3] by GNOME developer _Alex_, he mentioned that GNOME would be following elementary OS’s approach while making it a standard to introduce a system-wide dark style preference in GNOME 42. + +### Consistent Dark Mode Experience Even with Flatpak Sandbox + +When it comes to a GTK theme, it is often a problem for Flatpak applications to inherit it because of the sandboxing. + +However, with an implementation planned for GNOME 42, any application (including Flatpak apps) can access the settings portal and know the dark style preference without cutting down the security provided by the sandboxing. + +This work aims to ensure that every type of application (built with any toolkit) and on any desktop should be able to detect and respect the dark style preference. + +The only difference between elementary OS and GNOME’s implementation will be the use of libadwaita API with GNOME 42. You may want to check out an older [blog post][4] by Adrien, another GNOME developer, to know more about Libadwaita. + +Alex also shared a video giving a sneak peek at how the transitions may look like (which is, of course, a work in progress). + +![][5] + +As you can notice, application developers need to update their applications to respect this preference to make the switch/transition from light/dark mode a seamless experience. + +And, further, to bring this change to GNOME 42, there is a couple of significant development work remaining: + + * A preference option in the settings menu that’s easy to use (probably under “Background/Appearance” settings) + * A switch in gnome-shell to quickly toggle the preference + * Day/night scheduling option + * A dark mode version of the wallpaper synchronized to the preference + + + +### Wrapping Up + +The core and first-party applications will have to support the dark style preference before GNOME 42 release to kick things off. + +While third-party developers should also get on the bandwagon, given the difference this makes, it would take time for all your essential/favorite tools to support it. + +_What do you think about GNOME 42 bringing a system-wide dark mode preference, following the footsteps of elementary OS? You are welcome to 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/gnome-42-dark-style-preference/ + +作者:[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]: https://news.itsfoss.com/elementary-os-6-features/ +[3]: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/ +[4]: https://aplazas.pages.gitlab.gnome.org/blog/blog/2021/03/31/introducing-libadwaita.html +[5]: https://i0.wp.com/i.ytimg.com/vi/urXch15ySGU/hqdefault.jpg?w=780&ssl=1 From b9e21411036dfc07aea5d295ead4090dec6e46b5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 Oct 2021 09:31:55 +0800 Subject: [PATCH 0613/1588] PRF @wxy --- ...elow- a time traveling resource monitor.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20210818 below- a time traveling resource monitor.md b/translated/tech/20210818 below- a time traveling resource monitor.md index 2571c2d3d4..04408a72ad 100644 --- a/translated/tech/20210818 below- a time traveling resource monitor.md +++ b/translated/tech/20210818 below- a time traveling resource monitor.md @@ -3,7 +3,7 @@ [#]: author: "Daniel Xu https://fedoramagazine.org/author/dxuu/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " @@ -12,23 +12,23 @@ Below:一个时间旅行的资源监控器 ![][1] -在这篇文章中,我们将介绍 below:一个用于现代 Linux 系统的 Apache 2.0 许可的资源监视器。below 允许你重放以前记录的数据。 +在这篇文章中,我们将介绍 `below`:一个用于现代 Linux 系统的 Apache 2.0 许可的资源监视器。`below` 可以让你重放以前记录的数据。 ### 背景 -内核的主要职责之一是调解对资源的访问。有时这可能意味着分配物理内存,使多个进程可以共享同一主机。其他时候,它可能意味着确保 CPU 时间的公平分配。在所有这些情况下,内核提供了机制,而将策略留给了“别人”。在最近,这个“别人”通常是 systemd 或 dockerd 这样的运行时。运行时接受来自调度器或最终用户的输入(类似于运行什么和如何运行)并在内核上转动正确的旋钮和拉动正确的杠杆,从而使工作负载能够*好好*工作。 +内核的主要职责之一是调度对资源的访问。有时这可能意味着分配物理内存,使多个进程可以共享同一主机。其他时候,它可能意味着确保 CPU 时间的公平分配。在这些场景里,内核提供了机制,而将策略留给了“别人”。近来,这个“别人”通常是 systemd 或 dockerd 这样的运行时。运行时接受来自调度器或最终用户的输入(类似于运行什么和如何运行)并在内核上转动正确的旋钮和拉动正确的杠杆,从而使工作负载能够*好好*工作。 -在一个完美的世界里,故事就到此结束了。然而,现实情况是,资源管理是一个复杂的、相当不透明的技术混合体,在几十年里计算技术不断发展。尽管其中一些技术有各种缺陷和死角,但最终的结果,容器运作得比较好。虽然用户通常不需要关心这些细节,但对于基础设施运营商来说,对他们的技术架构拥有可见性是至关重要的。可见性和可调试性对于检测和调查错误配置、问题和系统性故障至关重要。 +在一个完美的世界里,故事就到此结束了。然而,现实情况是,资源管理是一个复杂的、相当不透明的技术混合体,在几十年里计算技术不断发展。尽管其中一些技术有各种缺陷和死角,但最终的结果是,容器运作得比较好。虽然用户通常不需要关心这些细节,但对于基础设施运营商来说,对他们的技术架构拥有可见性是至关重要的。可见性和可调试性对于检测和调查错误的配置、问题和系统性故障至关重要。 -让事情变得更加复杂的是,资源中断往往难以重现。经常需要花费数周时间等待一个问题重新出现,以便调查其根本原因。规模的扩大进一步加剧了这个问题:我们不能在*每台*主机上运行一个自定义脚本,希望在错误再次发生时记录下关键状态的片段。因此,需要更复杂的工具。这就出现了 below。 +让事情变得更加复杂的是,资源中断往往难以重现。经常需要花费数周时间等待一个问题重新出现,以便调查其根本原因。规模的扩大进一步加剧了这个问题:我们不能在*每台*主机上运行一个自定义脚本,希望在错误再次发生时记录下关键状态的片段。因此,需要更复杂的工具。这就出现了 `below`。 -### ### 动机 +### 动机 历史上,Facebook 一直是 [atop][5] 的忠实用户。`atop` 是一个用于 Linux 的性能监视器,能够报告所有进程的活动以及各种系统级活动。与 `htop` 等工具相比,`atop` 最引人注目的功能之一是能够作为一个守护程序记录历史数据。这听起来是一个简单的功能,但在实践中,这使得调试无数的生产问题成为可能。有了足够长的数据保留,就有可能在时间上回溯,查看在问题或故障发生之前、期间和之后的主机状态。 不幸的是,随着时间的推移,人们发现`atop` 有某些不足之处。首先,[控制组][6]cgroup 已经成为控制和监视 Linux 机器上资源的实际方式。`atop` 仍然缺乏对这一基本构建模块的支持。第二,`atop` 用自定义的 delta 压缩方法在磁盘上存储数据。这在正常情况下运行良好,但在沉重的资源压力下,主机很可能会丢失数据点。由于使用了 delta 压缩,在数据最重要的时间段内,数据可能会大面积丢失。第三,用户体验有一个陡峭的学习曲线。我们经常听到 `atop` 的资深用户说,他们喜欢密集的布局和众多的键盘绑定。然而,这也是一把双刃剑。当一个刚进入这个领域的人想要调试一个生产问题时,他们现在要同时解决两个问题:手头的问题和如何使用 `atop`。 -`below` 是由 Facebook 的资源控制团队为其设计和开发的,并得到了 `atop` 生产用户的投入。顾名思义,资源控制团队负责的是规模化的资源管理。该团队由内核开发人员、容器运行时开发人员和硬件人员组成。认识到下一代系统监控器的机会,我们在设计 `below` 时考虑到以下几点: +`below` 是由 Facebook 的资源控制团队为其设计和开发的,并得到了 `atop` 生产环境用户的支持。顾名思义,资源控制团队负责的是规模化的资源管理。该团队由内核开发人员、容器运行时开发人员和硬件人员组成。认识到下一代系统监控器的机会,我们在设计 `below` 时考虑到以下几点: * 易用性:`below` 必须既能为新用户提供直观的体验,又能为日常用户提供强大的功能。 *有意义的统计数据:`below` 显示准确和有用的统计数据。即便可以,但我们尽量避免收集和倾倒统计数字。 @@ -76,9 +76,9 @@ $ below replay --time "5 minutes ago" ### 其他功能 -在底层下,`below` 有一个强大的设计和架构。Facebook 正在不断升级到更新的内核,所以我们从不假设数据源是可用的。这种默契的假设使得内核和 `below `版本之间能够完全向前和向后兼容。此外,每个数据点都被 zstd 压缩并完整地存储。这解决了我们看到的 `atop` 在大规模时的 delta 压缩问题。根据我们的测试,我们的每个样本压缩可以达到平均 5 倍的压缩率。 +在底层,`below` 有一个强大的设计和架构。Facebook 正在不断升级到更新的内核,所以我们从不假设数据源是可用的。这种默契的假设使得内核和 `below `版本之间能够完全向前和向后兼容。此外,每个数据点都用 zstd 压缩并完整地存储。这解决了我们看到的 `atop` 在大规模时的 delta 压缩问题。根据我们的测试,我们的每个样本压缩可以达到平均 5 倍的压缩率。 -`below` 也使用 [eBPF][8] 来收集关于短暂进程(生存时间短于数据收集间隔的进程)的信息。相比之下,`atop` 使用 BSD 进程核算来实现这一功能,这是一个已知的缓慢且容易发生优先级转换的内核接口。 +`below` 也使用 [eBPF][8] 来收集关于短暂进程(生存时间短于数据收集间隔的进程)的信息。相比之下,`atop` 使用 BSD 进程核算来实现这一功能,这是一个已知缓慢且容易发生优先级转换的内核接口。 对于用户来说,`below` 还支持实时模式和一个转储接口。实时模式将记录守护程序和 TUI 会话合并到一个进程中。这对于浏览系统状态是很方便的,不需要为数据存储投入长期运行的守护程序或磁盘空间。转储接口是一个可编写脚本的接口,用于所有的 `below` 数据存储。转储既强大又灵活,详细的数据以 CSV、JSON 和人类可读格式提供。 @@ -93,7 +93,7 @@ via: https://fedoramagazine.org/below-a-time-traveling-resource-monitor/ 作者:[Daniel Xu][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 f36c32f8b3045a793d2563dc9312000ccb9a0edf Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 Oct 2021 09:36:14 +0800 Subject: [PATCH 0614/1588] PUB @wxy https://linux.cn/article-13854-1.html --- .../20210818 below- a time traveling resource monitor.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) rename {translated/tech => published}/20210818 below- a time traveling resource monitor.md (98%) diff --git a/translated/tech/20210818 below- a time traveling resource monitor.md b/published/20210818 below- a time traveling resource monitor.md similarity index 98% rename from translated/tech/20210818 below- a time traveling resource monitor.md rename to published/20210818 below- a time traveling resource monitor.md index 04408a72ad..7212fecec1 100644 --- a/translated/tech/20210818 below- a time traveling resource monitor.md +++ b/published/20210818 below- a time traveling resource monitor.md @@ -4,16 +4,18 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13854-1.html" Below:一个时间旅行的资源监控器 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202110/06/093522hdsb82nm1cb4b4b6.jpg) 在这篇文章中,我们将介绍 `below`:一个用于现代 Linux 系统的 Apache 2.0 许可的资源监视器。`below` 可以让你重放以前记录的数据。 +![][1] + ### 背景 内核的主要职责之一是调度对资源的访问。有时这可能意味着分配物理内存,使多个进程可以共享同一主机。其他时候,它可能意味着确保 CPU 时间的公平分配。在这些场景里,内核提供了机制,而将策略留给了“别人”。近来,这个“别人”通常是 systemd 或 dockerd 这样的运行时。运行时接受来自调度器或最终用户的输入(类似于运行什么和如何运行)并在内核上转动正确的旋钮和拉动正确的杠杆,从而使工作负载能够*好好*工作。 From 589e4fa0cce0aa555e4a4f616e1fdc502f77af02 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 Oct 2021 09:49:58 +0800 Subject: [PATCH 0615/1588] PUB @wxy https://linux.cn/article-13855-1.html --- .../20211001 8 reasons why I learned Core Java.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/tech => published}/20211001 8 reasons why I learned Core Java.md (97%) diff --git a/translated/tech/20211001 8 reasons why I learned Core Java.md b/published/20211001 8 reasons why I learned Core Java.md similarity index 97% rename from translated/tech/20211001 8 reasons why I learned Core Java.md rename to published/20211001 8 reasons why I learned Core Java.md index 58f2a47d83..b7359fbbf1 100644 --- a/translated/tech/20211001 8 reasons why I learned Core Java.md +++ b/published/20211001 8 reasons why I learned Core Java.md @@ -4,15 +4,15 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13855-1.html" 学习 Core Java 的 8 个原因 ====== > 在学习建立在 Java 之上的所有相关工具时,了解 Core Java 会给你带来很大的优势。 -![学习和研究技术是成功的关键][1] +![](https://img.linux.net.cn/data/attachment/album/202110/06/094720iax1d49c5sc0sd48.jpg) 计算机编程(也被称为 *编码*)的重点不是使用哪种编程语言,而是发展编程逻辑和学习像程序员一样思考。你一开始使用的编程语言应该是在这一努力过程中对你帮助最大的语言。因此,你必须问自己一个问题,“作为一个程序员,你想开发什么?” From e514d68ea8e3fcf2864b46bb9634f27c6e1784dc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 Oct 2021 09:53:12 +0800 Subject: [PATCH 0616/1588] APL --- sources/tech/20211005 Tools to explore BGP.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211005 Tools to explore BGP.md b/sources/tech/20211005 Tools to explore BGP.md index ee03790758..97cfa57a78 100644 --- a/sources/tech/20211005 Tools to explore BGP.md +++ b/sources/tech/20211005 Tools to explore BGP.md @@ -2,7 +2,7 @@ [#]: via: "https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/" [#]: author: "Julia Evans https://jvns.ca/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 4fcac05659c8677968f3347d81e0b72fb1335d5b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 6 Oct 2021 11:14:54 +0800 Subject: [PATCH 0617/1588] TSL --- sources/tech/20211005 Tools to explore BGP.md | 374 ------------------ .../tech/20211005 Tools to explore BGP.md | 362 +++++++++++++++++ 2 files changed, 362 insertions(+), 374 deletions(-) delete mode 100644 sources/tech/20211005 Tools to explore BGP.md create mode 100644 translated/tech/20211005 Tools to explore BGP.md diff --git a/sources/tech/20211005 Tools to explore BGP.md b/sources/tech/20211005 Tools to explore BGP.md deleted file mode 100644 index 97cfa57a78..0000000000 --- a/sources/tech/20211005 Tools to explore BGP.md +++ /dev/null @@ -1,374 +0,0 @@ -[#]: subject: "Tools to explore BGP" -[#]: via: "https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/" -[#]: author: "Julia Evans https://jvns.ca/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Tools to explore BGP -====== - -Yesterday there was a big Facebook outage caused by BGP. I’ve been vaguely interested in learning more about BGP for a long time, so I was reading a couple of articles. - -I got frustrated because none of the articles showed me how I could actually look up information related to BGP on my computer, so I [wrote a tweet asking for tools][1]. - -I got a bunch of useful replies as always, so this blog post shows some tools you can use to look up BGP information. There might be an above average number of things wrong in this post because I don’t understand BGP that well. - -### I can’t publish BGP routes - -One of the reasons I’ve never learned much about BGP is – as far as I know, I don’t have access to publish BGP routes on the internet. - -With most networking protocols, you can pretty trivially get access to implement the protocol yourself if you want. For example you can: - - * issue your own TLS certificates - * write your own HTTP server - * write your own TCP implementation - * write your own authoritative DNS server for your domain (I’m trying to do that right now for a small project) - * set up your own certificate authority - - - -But with BGP, I think that unless you own your own ASN, you can’t publish routes yourself! (you _could_ implement BGP on your home network, but that feels a bit boring to me, when I experiment with things I like them to actually be on the real internet). - -Anyway, even though I can’t experiment with it, I still think it’s super interesting because I love networking, so I’m going to show you some tools I found to learn about BGP :) - -First let’s talk through some BGP terminology though. I’m going to go pretty fast because I’m more interested in the tools and there are a lot of high level explanations of BGP out there (like this [cloudflare post][2]). - -### What’s an AS (“autonomous system”) - -The first thing we need to understand is an AS. Every AS: - - 1. is owned by an organization (usually a large organization like your ISP, a government, a university, Facebook, etc) - 2. controls a specific set of IP addresses (for example my ISP’s AS includes 247,808 IP addresses) - 3. has a number (like 1403) - - - -Here are some observations I made about ASes just by doing some experimentation: - - * Some fairly big tech companies don’t have their own AS. For example, I looked up Patreon on BGPView, and as far as I can tell they don’t own as AS – their main site (patreon.com, [104.16.6.49][3]) is in Cloudflare’s AS. - * An AS can include IPs in many countries. Facebook’s AS ([AS32934][4]) definitely has IP addresses in Singapore, Canada, Nigeria, Kenya, the US, and more countries. - * It seems like IP address can be in more than one AS. For example, if I look up [209.216.230.240][5], it has 2 ASNs associated with it – AS6130 and AS21581. Apparently when this happens the more specific route takes priority – so packets to that IP would get routed to AS21581. - - - -### what’s a BGP route? - -There are a lot of routers on the internet. For example, my ISP has routers. - -When I send my ISP a packet (for example by running `ping 129.134.30.0`), my ISP’s routers needs to figure out how to actually get my packet to the IP address `129.134.30.0`. - -The way the router figures this out is that it has a **route table** – it has a list of a bunch of IP ranges (like `129.134.30.0/23`), and routes it knows about to get to that subnet. - -Here’s an example of a real route for `129.134.30.0/23`: (one of Facebook’s subnets). This one isn’t from my ISP. - -``` -11670 32934 - 206.108.35.2 from 206.108.35.254 (206.108.35.254) - Origin IGP, metric 0, valid, external - Community: 3856:55000 - Last update: Mon Oct 4 21:17:33 2021 -``` - -I think that this is saying that one path to `129.134.30.0` is through the machine `206.108.35.2`, which is on its local network. So the router might send my ping packet to `206.108.35.2` next, and then `206.108.35.2` will know how to get it to Facebook. The two numbers at the beginning (`11670 32934`) are ASNs. - -### what’s BGP? - -My understanding of BGP is very shaky, but it’s a protocol that companies use to advertise BGP routes. - -What happened yesterday with Facebook is that they basically made BGP announcements withdrawing all their BGP routes, so every router in the world deleted all of its routes related to Facebook, so no traffic could get there. - -Okay, now that we’ve covered some basic terminology, let’s talk about tools you can use to look at autonomous systems and BGP! - -### tool 1: look at your ISP’s AS with BGPView - -To make this AS thing less abstract, let’s use a tool called [BGPView][6] to look at a real AS. - -My ISP (EBOX) owns [AS 1403][7]. Here are the [IP addresses my ISP owns][8]. If I look up my computer’s public IPv4 address, I can check that it’s one of the IP addresses my ISP owns – it’s in the `104.163.128.0/17` block. - -BGPView also has this graph of how my ISP is connected to other ASes - -![][9] - -### tool 2: `traceroute -A` and `mtr -z` - -Okay, so we’re interested in autonomous systems. Let’s see which ASes I go through from - -`traceroute` and `mtr` both have options to tell you the ASN for every IP you go through. The flags are `traceroute -A` and `mtr -z`, respectively. - -Let’s see which autonomous systems I go through on my way to facebook.com with `mtr`! - -``` -$ mtr -z facebook.com - 1. AS??? LEDE.lan - 2. AS1403 104-163-190-1.qc.cable.ebox.net - 3. AS??? 10.170.192.58 - 4. AS1403 0.et-5-2-0.er1.mtl7.yul.ebox.ca - 5. AS1403 0.ae17.er2.mtl3.yul.ebox.ca - 6. AS1403 0.ae0.er1.151fw.yyz.ebox.ca - 7. AS??? facebook-a.ip4.torontointernetxchange.net - 8. AS32934 po103.psw01.yyz1.tfbnw.net - 9. AS32934 157.240.38.75 -10. AS32934 edge-star-mini-shv-01-yyz1.facebook.com -``` - -This is interesting – it looks like we go directly from my ISP’s AS (1403) to Facebook’s AS (32934), with an “internet exchange” in between. - -I’m not sure what an [internet exchange][10] is but I know that it’s an extremely important part of the internet. That’s going to be for another day though. My best guess is that it’s the part of the internet that enables “peering” – like an IX is a server room with a gigantic switch with infinite bandwith in it where a bunch of different companies put their computers so they can send each other packets. - -### mtr looks up ASNs with DNS - -I got curious about how mtr looks up ASNs, so I used strace. I saw that it looked like it was using DNS, so I ran [dnspeep][11], and voila! - -``` -$ sudo dnspeep -... -TXT 1.190.163.104.origin.asn.cymru.com 192.168.1.1 TXT: 1403 | 104.163.176.0/20 | CA | arin | 2014-08-14, TXT: 1403 | 104.163.160.0/19 | CA | arin | 2014-08-14, TXT: 1403 | 104.163.128.0/17 | CA | arin | 2014-08-14 -... -``` - -So it looks like we can find the ASN for `104.163.190.1` by looking up the `txt` record on `1.190.163.104.origin.asn.cymru.com`, like this: - -``` -$ dig txt 1.190.163.104.origin.asn.cymru.com -1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.160.0/19 | CA | arin | 2014-08-14" -1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.128.0/17 | CA | arin | 2014-08-14" -1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.176.0/20 | CA | arin | 2014-08-14" -``` - -That’s cool! Let’s keep moving though. - -### tool 3: the packet clearing house looking glass - -PCH (“packet clearing house”) is the organization that runs a lot of internet exchange points. A “looking glass” seems to be a generic term for a web form that lets you run network commands from another person’s computer. There are looking glasses that don’t support BGP, but I’m just interested in ones that show you information about BGP routes. - -Here’s the PCH looking glass: . - -In the web form on that site, I picked the Toronto IX (“TORIX”), since that’s what `mtr` said I was using to go to facebook.com. - -**thing 1: “show ip bgp summary”** - -Here’s the output. I’ve redacted some of it: - -``` -IPv4 Unicast Summary: -BGP router identifier 74.80.118.4, local AS number 3856 vrf-id 0 -BGP table version 33061919 -RIB entries 513241, using 90 MiB of memory -Peers 147, using 3003 KiB of memory -Peer groups 8, using 512 bytes of memory - -Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd -... -206.108.34.248 4 1403 484672 466938 0 0 0 05w3d03h 50 -... -206.108.35.2 4 32934 482088 466714 0 0 0 01w6d07h 38 -206.108.35.3 4 32934 482019 466475 0 0 0 01w0d06h 38 -... - -Total number of neighbors 147 -``` - -My understanding of what this is saying is that the Toronto Internet Exchange (“TORIX”) is directly connected to both my ISP (EBOX, AS 1403) and Facebook (AS 32934). - -**thing 2: “show ip bgp 129.134.30.0”** - -Here’s the output of picking “show ip bgp” for `129.134.30.0` (one of Facebook’s IP addresses): - -``` -BGP routing table entry for 129.134.30.0/23 -Paths: (4 available, best #4, table default) - Advertised to non peer-group peers: - 206.220.231.55 - 11670 32934 - 206.108.35.2 from 206.108.35.254 (206.108.35.254) - Origin IGP, metric 0, valid, external - Community: 3856:55000 - Last update: Mon Oct 4 21:17:33 2021 - - 11670 32934 - 206.108.35.2 from 206.108.35.253 (206.108.35.253) - Origin IGP, metric 0, valid, external - Community: 3856:55000 - Last update: Mon Oct 4 21:17:31 2021 - - 32934 - 206.108.35.3 from 206.108.35.3 (157.240.58.225) - Origin IGP, metric 0, valid, external, multipath - Community: 3856:55000 - Last update: Mon Oct 4 21:17:27 2021 - - 32934 - 206.108.35.2 from 206.108.35.2 (157.240.58.182) - Origin IGP, metric 0, valid, external, multipath, best (Older Path) - Community: 3856:55000 - Last update: Mon Oct 4 21:17:27 2021 -``` - -This seems to be saying that there are 4 routes to Facebook from that internet exchange. - -**the quebec internet exchange doesn’t seem to know anything about Facebook** - -I also tried the same thing from the Quebec internet exchange QIX (which is presumably closer to me, since I live in Montreal and not Toronto). But the QIX doesn’t seem to know anything about Facebook – when I put in `129.134.30.0` it just says “% Network not in table”. - -So I guess that’s why I was sent through the Toronto IX and not the Quebec one. - -### more BGP looking glasses - -Here are some more websites with looking glasses that will give you similar information from other points of view. They all seem to support the same `show ip bgp` syntax, maybe because they’re running the same software? I’m not sure. - - * - * - * - - - -There seem to be a LOT of these looking glass services out there, way more than just those 3 lists. - -Here’s an example session with one of the servers on this list: route-views.routeviews.org. This time I connected via telnet and not through a web form, but the output looks like it’s in the same format. - -``` -$ telnet route-views.routeviews.org - -route-views>show ip bgp 31.13.80.36 - -BGP routing table entry for 31.13.80.0/24, version 1053404087 -Paths: (23 available, best #2, table default) - Not advertised to any peer - Refresh Epoch 1 - 3267 1299 32934 - 194.85.40.15 from 194.85.40.15 (185.141.126.1) - Origin IGP, metric 0, localpref 100, valid, external - path 7FE0C3340190 RPKI State valid - rx pathid: 0, tx pathid: 0 - Refresh Epoch 1 - 6939 32934 - 64.71.137.241 from 64.71.137.241 (216.218.252.164) - Origin IGP, localpref 100, valid, external, best - path 7FE135DB6500 RPKI State valid - rx pathid: 0, tx pathid: 0x0 - Refresh Epoch 1 - 701 174 32934 - 137.39.3.55 from 137.39.3.55 (137.39.3.55) - Origin IGP, localpref 100, valid, external - path 7FE1604D3AF0 RPKI State valid - rx pathid: 0, tx pathid: 0 - Refresh Epoch 1 - 20912 3257 1299 32934 - 212.66.96.126 from 212.66.96.126 (212.66.96.126) - Origin IGP, localpref 100, valid, external - Community: 3257:8095 3257:30622 3257:50001 3257:53900 3257:53904 20912:65004 - path 7FE1195AF140 RPKI State valid - rx pathid: 0, tx pathid: 0 - Refresh Epoch 1 - 7660 2516 1299 32934 - 203.181.248.168 from 203.181.248.168 (203.181.248.168) - Origin IGP, localpref 100, valid, external - Community: 2516:1030 7660:9001 - path 7FE0D195E7D0 RPKI State valid - rx pathid: 0, tx pathid: 0 -``` - -Here there are a few options for routes: - - * `3267 1299 32934` - * `6939 32934` - * `701 174 32934` - * `20912 3257 1299 32934` - * `7660 2516 1299 32934` - - - -I think the reason there’s more than one AS in all of these is that `31.13.80.36` is a Facebook IP address in Toronto, so this server (which is maybe on the US west coast, I’m not sure) is not able to connect to it directly, it needs to go to another AS first. So all of the routes have one or more ASNs - -The shortest one is 6939 (“Hurricane Electric”), which is a “global internet backbone”. They also have their own [hurricane electric looking glass][12] page. - -### tool 4: BGPlay - -All the other tools so far have just shown us the current state of Facebook routing where everything is fine, but this 4th tool lets us see the history of this Facebook BGP internet disaster! It’s a GUI tool so I’m going to include a bunch of screenshots. - -The tool is at . I typed in the IP address 129.134.30.12 (one of Facebook’s IPs), if you want to play along. - -First, let’s look at the state of things before everything went wrong. I clicked in the timeline at 13:11:28 on Oct. 4, and got this: - -![][13] - -I originally found this very overwhelming. What’s happening? But then someone on Twitter pointed out that the next place to look is to click on the timeline right _after_ the Facebook disaster happened (at 18:38 on Oct. 4). - -![][14] - -It’s pretty clear that something is wrong in this picture – all the BGP routes are gone! oh no! - -The text at the top shows the last Facebook BGP route disappearing: - -``` -Type: W > withdrawal Involving: 129.134.30.0/24 -Short description: The route 50869, 25091, 32934 has been withdrawn. -Date and time: 2021-10-04 16:02:33 Collected by: 20-91.206.53.12 -``` - -If I then click the “fast forward” button, we see the BGP routes start to come back: - -![][15] - -The first one announced is `137409 32934`. I don’t think this is _actually_ the first one announced though – there are a lot of route announcements inside the same second (at 2021-10-04 21:00:40), and I think the ordering inside BGPlay is arbitrary. - -If I click the “fast forward” button again, more and more routes start to come back and routing starts to go back to normal - -I found looking at this outage in BGPlay really fun, even though the interface is pretty confusing at first. - -### maybe it is important to understand a little about BGP? - -I started out this post by saying you can’t change BGP routes BGP, but then I remembered that in 2016 or 2017 there was a [Telia routing issue][16] that caused us some minor network at work. And when that happens, it is actually useful to understand why your customers can’t reach your site, even if it’s totally out of your control. I didn’t know about any of these tools at that time but I would have liked to! - -I think for most companies all you can do to respond to outages caused by someone else’s bad BGP routes is “do nothing and wait for it to get fixed”, but it’s nice to be able to _confidently_ do nothing. - -### some ways to publish BGP routes - -If you want to (as a hobbyist) actually publish BGP routes, here are some links from the comments: - - * [a guide to getting your own ASN][17] - * [dn42][18] seems to have a playground for BGP (it’s not on the public internet, but it does have other people on it which seems more fun than just doing BGP by yourself at home) - - - -### that’s all for now - -I think there are a lot more BGP tools (like PCH has a bunch of [daily snapshots of routing data][19] which look like fun), but this post is already pretty long and there are other things I need to do today. - -I was surprised by how much information I could get about BGP just as a regular person, I always think of it as a “secret network wizard” thing but apparently there are all kind of public machines anybody can just telnet to and use to look at the route tables! Who knew! - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/ - -作者:[Julia 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://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://twitter.com/b0rk/status/1445199475195236356 -[2]: https://blog.cloudflare.com/october-2021-facebook-outage/ -[3]: https://bgpview.io/ip/104.16.6.49 -[4]: https://bgpview.io/asn/32934#prefixes-v4 -[5]: https://bgpview.io/ip/209.216.230.240 -[6]: https://bgpview.io -[7]: https://bgpview.io/asn/1403 -[8]: https://bgpview.io/asn/1403#prefixes-v4 -[9]: https://jvns.ca/images/ebox-graph.png -[10]: https://en.wikipedia.org/wiki/Internet_exchange_point -[11]: https://github.com/jvns/dnspeep/ -[12]: https://lg.he.net/ -[13]: https://jvns.ca/images/bgplay-before.png -[14]: https://jvns.ca/images/bgplay-after.png -[15]: https://jvns.ca/images/bgplay-return.png -[16]: https://news.ycombinator.com/item?id=14246888 -[17]: https://labs.ripe.net/author/samir_jafferali/build-your-own-anycast-network-in-nine-steps/ -[18]: https://dn42.eu/Home -[19]: https://www.pch.net/resources/Routing_Data/IPv4_daily_snapshots/ diff --git a/translated/tech/20211005 Tools to explore BGP.md b/translated/tech/20211005 Tools to explore BGP.md new file mode 100644 index 0000000000..9dfb0a0be9 --- /dev/null +++ b/translated/tech/20211005 Tools to explore BGP.md @@ -0,0 +1,362 @@ +[#]: subject: "Tools to explore BGP" +[#]: via: "https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +由 Facebook 事故引发的 BGP 工具探索 +====== + +昨天,Facebook 发生了由 BGP 引起的离线事故。我对学习更多关于 BGP 的知识已经隐约感兴趣了很长时间,所以我阅读了一些文章。 + +我感到很沮丧,因为没有一篇文章告诉我如何在我的电脑上实际查找与 BGP 有关的信息,因此我 [写了一条询问有关工具的推特][1]。 + +我一如既往地得到了一堆有用的回复,所以这篇博文展示了一些你可以用来查询 BGP 信息的工具。这篇文章中可能会有较多的错误,因为我对 BGP 不是很了解。 + +### 我不能发布 BGP 路由 + +我从来没有了解过 BGP 的原因之一是,据我所知,我没有在互联网上发布 BGP 路由的权限。 + +对于大多数网络协议,如果需要,你可以非常轻松地自己实现该协议。例如,你可以: + + * 发行你自己的 TLS 证书 + * 编写你自己的 HTTP 服务器 + * 编写你自己的 TCP 实现 + * 为你的域名编写你自己的权威 DNS 服务器(我现在正在为一个小项目尝试这样做)。 + *建立你自己的证书机构(CA) + +但是对于 BGP,我认为除非你拥有自己的 ASN,否则你不能自己发布路由(你*可以*在你的家庭网络上实现 BGP,但这对我来说有点无聊,当我做实验的时候,我希望它们真的在真正的互联网上)。 + +无论如何,尽管我不能用它做实验,但我仍然认为它超级有趣,因为我喜欢网络,所以我将向你展示我找到的一些工具来学习 BGP。 + +首先我们来谈谈 BGP 的一些术语。我打算很快掠过,因为我对工具更感兴趣,而且网上有很多关于 BGP 的高水平解释(比如这篇 [cloudflare 的文章][2])。 + +### AS 是什么? + +我们首先需要了解的是 AS(“自治系统autonomous system”)。每个 AS: + + 1. 由一个组织拥有(通常是一个大型组织,如你的 ISP、政府、大学、Facebook 等)。 + 2.控制一组特定的 IP 地址(例如,我的 ISP 的 AS 包括 247,808 个 IP 地址)。 + 3. 有一个编号 ASN(如 1403)。 + +下面是我通过做一些实验对 AS 的一些观察: + + * 一些相当大的科技公司并没有自己的 AS。例如,我在 BGPView 上查看了 Patreon,就我所知,他们没有自己的 AS,他们的主要网站(patreon.com,[104.16.6.49][3])在 Cloudflare 的 AS 中。 + * 一个 AS 可以包括许多国家的 IP。Facebook 的 AS([AS32934][4])肯定有新加坡、加拿大、尼日利亚、肯尼亚、美国和其他国家的 IP 地址。 + * 似乎 IP 地址可以在一个以上的 AS 中。例如,如果我查找[209.216.230.240][5],它有 2 个 ASN 与之相关:AS6130 和 AS21581。显然,当这种情况发生时,更具体的路线会被优先考虑--所以到该 IP 的数据包会被路由到 AS21581。 + +### 什么是 BGP 路由? + +互联网上有很多的路由器。例如,我的 ISP 就有路由器。 + +当我给我的 ISP 发送一个数据包时(例如通过运行 `ping 129.134.30.0`),我的 ISP 的路由器需要弄清楚如何将我的数据包实际送到 IP 地址 `129.134.30.0`。 + +路由器计算的方法是,它有一个**路由表**:有一堆 IP 地址范围的列表(比如 `129.134.30.0/23`),以及它知道的到达该子网的路由。 + +下面是一个 `129.134.30.0/23` 的真实路由的例子(Facebook 的一个子网)。这不是来自我的 ISP。 + +``` +11670 32934 + 206.108.35.2 from 206.108.35.254 (206.108.35.254) + Origin IGP, metric 0, valid, external + Community: 3856:55000 + Last update: Mon Oct 4 21:17:33 2021 +``` + +我认为这是在说通往 `129.134.30.0` 的一条路径是通过机器 `206.108.35.2`,这是在它的本地网络上。所以路由器接下来可能会把我的 ping 包发送到 `206.108.35.2`,然后 `206.108.35.2` 会知道如何把它送到 Facebook。开头的两个数字(`11670 32934`)是 ASN。 + +### BGP 是什么? + +我对 BGP 的理解很不牢靠,但它是一个公司用来公布 BGP 路由的协议。 + +昨天发生在 Facebook 身上的事情基本上是他们发布了一个 BGP 公告,撤销了他们所有的 BGP 路由,所以世界上的每个路由器都删除了所有与 Facebook 有关的路由,没有流量可以到达那里。 + +好了,现在我们已经涵盖了一些基本的术语,让我们来谈谈你可以用来查看 AS 和 BGP 的工具吧! + +### 工具 1:用 BGPView 查看你的 ISP 的 AS + +为了使 AS 这个东西不那么抽象,让我们用一个叫做 [BGPView][6]的 工具来看看一个真实的 AS。 + +我的 ISP(EBOX)拥有 [AS 1403][7]。下面是 [我的 ISP 拥有的 IP 地址][8]。如果我查找我的计算机的公共 IPv4 地址,我可以看到它是我的 ISP 拥有的IP地址之一:它在 `104.163.128.0/17` 块中。 + +BGPView 也有这个图,显示了我的 ISP 与其他 AS 的连接情况。 + +![][9] + +### 工具 2:traceroute -A 和 mtr -z + +好了,我们感兴趣的是 AS 。让我们看看我从哪些 AS 中穿过。 + +`traceroute` 和 `mtr` 都有选项可以告诉你每个 IP 的 ASN。其选项分别是 `traceroute -A` 和 `mtr -z`。 + +让我们看看我用 `mtr` 在去 facebook.com 的路上经过了哪些自治系统! + +``` +$ mtr -z facebook.com + 1. AS??? LEDE.lan + 2. AS1403 104-163-190-1.qc.cable.ebox.net + 3. AS??? 10.170.192.58 + 4. AS1403 0.et-5-2-0.er1.mtl7.yul.ebox.ca + 5. AS1403 0.ae17.er2.mtl3.yul.ebox.ca + 6. AS1403 0.ae0.er1.151fw.yyz.ebox.ca + 7. AS??? facebook-a.ip4.torontointernetxchange.net + 8. AS32934 po103.psw01.yyz1.tfbnw.net + 9. AS32934 157.240.38.75 +10. AS32934 edge-star-mini-shv-01-yyz1.facebook.com +``` + +这很有意思,看起来我们直接从我的 ISP 的 AS(1403)到 Facebook 的 AS(32934),中间有一个“互联网交换”。 + +我不确定 [互联网交换][10]internet exchange(IX)是什么,但我知道它是互联网的一个极其重要的部分。不过这将是以后的事了。我最好的猜测是,它是互联网中实现“对等”的部分,就假设它是一个有巨大的交换机的机房,里面有无限的带宽,一堆不同的公司把他们的电脑放在里面,这样他们就可以互相发送数据包。 + +### mtr 用 DNS 查找 ASN + +我对 `mtr` 如何查找 ASN 感到好奇,所以我使用了 `strace`。我看到它看起来像是在使用 DNS,所以我运行了 [dnspeep][11],然后就看到了! + +``` +$ sudo dnspeep +... +TXT 1.190.163.104.origin.asn.cymru.com 192.168.1.1 TXT: 1403 | 104.163.176.0/20 | CA | arin | 2014-08-14, TXT: 1403 | 104.163.160.0/19 | CA | arin | 2014-08-14, TXT: 1403 | 104.163.128.0/17 | CA | arin | 2014-08-14 +... +``` + +所以,看起来我们可以通过查找 `1.190.163.104.origin.asn.cymru.com` 上的 `txt` 记录找到 `104.163.190.1` 的 ASN,像这样: + +``` +$ dig txt 1.190.163.104.origin.asn.cymru.com +1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.160.0/19 | CA | arin | 2014-08-14" +1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.128.0/17 | CA | arin | 2014-08-14" +1.190.163.104.origin.asn.cymru.com. 13911 IN TXT "1403 | 104.163.176.0/20 | CA | arin | 2014-08-14" +``` + +这很好!让我们继续前进吧。 + +### 工具 3:数据包交换所的观察镜 + +PCH(“数据包交换所packet clearing house”)是运行大量互联网交换点的组织。“观察镜looking glass”似乎是一个通用术语,指的是让你从另一个人的计算机上运行网络命令的 Web 表单。有一些观察镜不支持 BGP,但我只对那些能显示 BGP 路由信息的观察镜感兴趣。 + +这里是 PCH 的观察镜: 。 + +在该网站的 Web 表单中,我选择了多伦多 IX(“TORIX”),因为 `mtr` 说我是用它来访问 facebook.com 的。 + +#### 操作 1:显示 ip bgp 摘要 + +下面是输出结果。我修改了其中的一些内容: + +``` +IPv4 Unicast Summary: +BGP router identifier 74.80.118.4, local AS number 3856 vrf-id 0 +BGP table version 33061919 +RIB entries 513241, using 90 MiB of memory +Peers 147, using 3003 KiB of memory +Peer groups 8, using 512 bytes of memory + +Neighbor V AS MsgRcvd MsgSent TblVer InQ OutQ Up/Down State/PfxRcd +... +206.108.34.248 4 1403 484672 466938 0 0 0 05w3d03h 50 +... +206.108.35.2 4 32934 482088 466714 0 0 0 01w6d07h 38 +206.108.35.3 4 32934 482019 466475 0 0 0 01w0d06h 38 +... + +Total number of neighbors 147 +``` + +我的理解是,多伦多 IX(“TORIX”)直接连接到我的 ISP (EBOX,AS 1403)和 Facebook(AS 32934)。 + +#### 操作 2:显示 ip bgp 129.134.30.0 + +这是挑选自 `show ip bgp` 对 `129.134.30.0`(Facebook 的一个 IP 地址)的输出: + +``` +BGP routing table entry for 129.134.30.0/23 +Paths: (4 available, best #4, table default) + Advertised to non peer-group peers: + 206.220.231.55 + 11670 32934 + 206.108.35.2 from 206.108.35.254 (206.108.35.254) + Origin IGP, metric 0, valid, external + Community: 3856:55000 + Last update: Mon Oct 4 21:17:33 2021 + + 11670 32934 + 206.108.35.2 from 206.108.35.253 (206.108.35.253) + Origin IGP, metric 0, valid, external + Community: 3856:55000 + Last update: Mon Oct 4 21:17:31 2021 + + 32934 + 206.108.35.3 from 206.108.35.3 (157.240.58.225) + Origin IGP, metric 0, valid, external, multipath + Community: 3856:55000 + Last update: Mon Oct 4 21:17:27 2021 + + 32934 + 206.108.35.2 from 206.108.35.2 (157.240.58.182) + Origin IGP, metric 0, valid, external, multipath, best (Older Path) + Community: 3856:55000 + Last update: Mon Oct 4 21:17:27 2021 +``` + +这似乎是在说,从该 IX 到 Facebook 有 4 条路线。 + +**魁北克 IX 似乎对 Facebook 一无所知**。 + +我也试过从魁北克 IX(“QIX”,它可能离我更近,因为我住在蒙特利尔而不是多伦多)做同样的事情。但 QIX 似乎对 Facebook 一无所知:当我输入`129.134.30.0` 时,它只是说 “% 网络不在表中”。 + +所以我想这就是为什么我被送到多伦多 IX 而不是魁北克的 IX。 + +#### 更多的 BGP 观察镜 + +这里还有一些带观察镜的网站,可以从其他角度给你类似的信息。它们似乎都支持相同的 `show ip bgp` 语法,也许是因为他们运行的是同一个软件?我不太确定。 + + * + * + * + +似乎有很多这样的观察镜服务,远不止这 3 个列表: + +这里有一个与这个列表上的一个服务器进行会话的例子:route-views.routeviews.org。这次我是通过 telnet 连接的,而不是通过 Web 表单,但输出的格式看起来是一样的。 + +``` +$ telnet route-views.routeviews.org + +route-views>show ip bgp 31.13.80.36 + +BGP routing table entry for 31.13.80.0/24, version 1053404087 +Paths: (23 available, best #2, table default) + Not advertised to any peer + Refresh Epoch 1 + 3267 1299 32934 + 194.85.40.15 from 194.85.40.15 (185.141.126.1) + Origin IGP, metric 0, localpref 100, valid, external + path 7FE0C3340190 RPKI State valid + rx pathid: 0, tx pathid: 0 + Refresh Epoch 1 + 6939 32934 + 64.71.137.241 from 64.71.137.241 (216.218.252.164) + Origin IGP, localpref 100, valid, external, best + path 7FE135DB6500 RPKI State valid + rx pathid: 0, tx pathid: 0x0 + Refresh Epoch 1 + 701 174 32934 + 137.39.3.55 from 137.39.3.55 (137.39.3.55) + Origin IGP, localpref 100, valid, external + path 7FE1604D3AF0 RPKI State valid + rx pathid: 0, tx pathid: 0 + Refresh Epoch 1 + 20912 3257 1299 32934 + 212.66.96.126 from 212.66.96.126 (212.66.96.126) + Origin IGP, localpref 100, valid, external + Community: 3257:8095 3257:30622 3257:50001 3257:53900 3257:53904 20912:65004 + path 7FE1195AF140 RPKI State valid + rx pathid: 0, tx pathid: 0 + Refresh Epoch 1 + 7660 2516 1299 32934 + 203.181.248.168 from 203.181.248.168 (203.181.248.168) + Origin IGP, localpref 100, valid, external + Community: 2516:1030 7660:9001 + path 7FE0D195E7D0 RPKI State valid + rx pathid: 0, tx pathid: 0 +``` + +这里有几个路由的选择: + + * `3267 1299 32934` + * `6939 32934` + * `701 174 32934` + * `20912 3257 1299 32934` + * `7660 2516 1299 32934` + +我想这些都有不止一个 AS 的原因是,`31.13.80.36` 是 Facebook 在多伦多的 IP 地址,所以这个服务器(可能在美国西海岸,我不确定)不能直接连接到它,它需要先到另一个 AS。所以所有的路由都有一个或多个 ASN + +最短的是 6939(“Hurricane Electric”),它是一个 “全球互联网骨干”。他们也有自己的 [Hurricane Electric 观察镜][12] 页面。 + +### 工具 4:BGPlay + +到目前为止,所有其他的工具都只是向我们展示了 Facebook 路由的当前状态,其中一切正常,但这第四个工具让我们看到了这个 Facebook BGP 互联网灾难的历史 这是一个 GUI 工具,所以我将包括一堆屏幕截图。 + +该工具在 。我输入了 IP 地址 129.134.30.12(Facebook 的一个 IP),如果你想一起试试。 + +首先,让我们看看一切出错之前的状态。我点击了在 10 月 4 日 13:11:28 的时间线,得到了这个结果: + +![][13] + +我最初发现这很让人不知所措。发生了什么事?但后来有人在推特上指出,下一个要看的地方是点击 Facebook 灾难发生后的时间线(10 月 4 日 18 点 38 分)。 + +![][14] + +很明显,这张图有问题:所有的 BGP 路线都不见了!哦,不要! + +顶部的文字显示了最后一条 Facebook BGP 路由的消失: + +``` +Type: W > withdrawal Involving: 129.134.30.0/24 +Short description: The route 50869, 25091, 32934 has been withdrawn. +Date and time: 2021-10-04 16:02:33 Collected by: 20-91.206.53.12 +``` + +如果我再点击“快进fast forward”按钮,我们看到 BGP 路由开始回来了。 + +![][15] + +第一个宣告的是 `137409 32934`。但我不认为这实际上是第一个宣布的,在同一秒内有很多路由宣告(在 2021-10-04 21:00:40),我认为 BGPlay 内部的排序是任意的。 + +如果我再次点击“快进fast forward”按钮,越来越多的路由开始回来,路由开始恢复正常。 + +我发现在 BGPlay 里看这个故障真的很有趣,尽管一开始界面很混乱。 + +### 也许了解一下 BGP 是很重要的? + +我在这篇文章的开头说,你不能改变 BGP 路由,但后来我想起在 2016 年或 2017 年,有一个 [Telia 路由问题][16],给我们的工作造成了一些小的网络问题。而当这种情况发生时,了解为什么你的客户无法到达你的网站其实是很有用的,即使它完全不受你控制。当时我不知道这些工具,但我希望能知道! + +我认为对于大多数公司来说,应对由其他人的错误 BGP 路由造成的中断,你所能做的就是“什么都不做,等待它得到修复”,但能够_自信地_什么都不做是很好的。 + +### 一些发布 BGP 路由的方法 + +如果你想(作为一个业余爱好者)真正发布 BGP 路由,这里有一些评论中的链接: + + * [获取你自己的 ASN 的指南][17] + * [dn42][18] 似乎有一个 BGP 的实验场(它不在公共互联网上,但确实有其他人在上面,这似乎比自己在家里做 BGP 实验更有趣 + +### 目前就这些了 + +我想还有很多 BGP 工具(比如 PCH 有一堆 [路由数据的每日快照][19],看起来很有趣),但这篇文章已经很长了,而且我今天还有其他事情要做。 + +我对我作为一个普通人可以得到这么多关于 BGP 的信息感到惊讶,我一直认为它是一个“秘密的网络巫师”这样的东西,但显然有各种公共机器,任何人都可以直接 telnet 到它并用来查看路由表!没想到! + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/ + +作者:[Julia 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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://twitter.com/b0rk/status/1445199475195236356 +[2]: https://blog.cloudflare.com/october-2021-facebook-outage/ +[3]: https://bgpview.io/ip/104.16.6.49 +[4]: https://bgpview.io/asn/32934#prefixes-v4 +[5]: https://bgpview.io/ip/209.216.230.240 +[6]: https://bgpview.io +[7]: https://bgpview.io/asn/1403 +[8]: https://bgpview.io/asn/1403#prefixes-v4 +[9]: https://jvns.ca/images/ebox-graph.png +[10]: https://en.wikipedia.org/wiki/Internet_exchange_point +[11]: https://github.com/jvns/dnspeep/ +[12]: https://lg.he.net/ +[13]: https://jvns.ca/images/bgplay-before.png +[14]: https://jvns.ca/images/bgplay-after.png +[15]: https://jvns.ca/images/bgplay-return.png +[16]: https://news.ycombinator.com/item?id=14246888 +[17]: https://labs.ripe.net/author/samir_jafferali/build-your-own-anycast-network-in-nine-steps/ +[18]: https://dn42.eu/Home +[19]: https://www.pch.net/resources/Routing_Data/IPv4_daily_snapshots/ From d79d44470f48e80b23c3d4b4894aaba31b8fff0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=98=BF=E4=B9=9D?= <2220238842@qq.com> Date: Wed, 6 Oct 2021 18:36:52 +0800 Subject: [PATCH 0618/1588] translating --- sources/tech/20200307 Compose music as code using Sonic Pi.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200307 Compose music as code using Sonic Pi.md b/sources/tech/20200307 Compose music as code using Sonic Pi.md index 6944a5f6ea..2f5d2a01a8 100644 --- a/sources/tech/20200307 Compose music as code using Sonic Pi.md +++ b/sources/tech/20200307 Compose music as code using Sonic Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (anine09) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -108,7 +108,7 @@ via: https://opensource.com/article/20/3/sonic-pi 作者:[Matt Bargenquast][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[译者ID](https://github.com/anine09) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From e123e6a8898e328d383eb65283a425a5203fe70d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 Oct 2021 05:03:39 +0800 Subject: [PATCH 0619/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211006?= =?UTF-8?q?=20Check=20Java=20processes=20on=20Linux=20with=20the=20jps=20c?= =?UTF-8?q?ommand?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211006 Check Java processes on Linux with the jps command.md --- ...processes on Linux with the jps command.md | 73 +++++++++++++++++++ 1 file changed, 73 insertions(+) create mode 100644 sources/tech/20211006 Check Java processes on Linux with the jps command.md diff --git a/sources/tech/20211006 Check Java processes on Linux with the jps command.md b/sources/tech/20211006 Check Java processes on Linux with the jps command.md new file mode 100644 index 0000000000..b7c1c0cdfe --- /dev/null +++ b/sources/tech/20211006 Check Java processes on Linux with the jps command.md @@ -0,0 +1,73 @@ +[#]: subject: "Check Java processes on Linux with the jps command" +[#]: via: "https://opensource.com/article/21/10/check-java-jps" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Check Java processes on Linux with the jps command +====== +With many processes running on a system, it's useful to have a quick way +to identify only Java with the jps command. +![Coffee beans][1] + +On Linux, there are commands to view processes running on your system. A process is any ongoing event being managed by the kernel. A process is spawned when you launch an application, but there are also 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 more. The utilities, such as those included in the [procps-ng package][2], that monitor these processes tend to be intentionally generic. They look at all processes on your computer so you can filter the list based on what you need to know. + +On Linux, you can view processes with the `ps` command. It is the simplest way to view the running processes on your system. + + +``` +$ ps +    PID TTY          TIME CMD +   4486 pts/0    00:00:00 bash +  66930 pts/0    00:00:00 ps +``` + +You can use the `ps` command to view running Java processes on a system also by piping output to `grep`. + + +``` +$ ps ax |grep java +  67604 pts/1    Sl+    0:18 /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc34.x86_64/bin/java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties -jar /home/alan/wildfly/24.0.1/jboss-modules.jar -mp /home/alan/wildfly/24.0.1/modules org.jboss.as.standalone -Djboss.home.dir=/home/alan/wildfly/24.0.1 -Djboss.server.base.dir=/home/alan/wildfly/24.0.1/standalone +``` + +OpenJDK, however, has its very own specific process monitor. The Java Virtual Machine Process Status (jps) tool allows you to scan for each running instance of the Java Virtual Machine (JVM) on your system. + +To view a similar output as seen in the `ps` command, use the `-v` option. This is useful, partly because it requires less typing. + + +``` +$ jps -v +67604 jboss-modules.jar -D[Standalone] -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties +``` + +The default `jps` output provides the process identifier and the class name or Jar file name of each detected instance. + + +``` +$ jps +67604 jboss-modules.jar +69430 Jps +``` + +**Note:** The man page for `jps` states that it is experimental and unsupported. Still, it's a nice-to-have option because often many processes are running on a system, and having a quick way to identify only Java is useful. + +Because Java is still a popular language today, being familiar with the Java Development Kit and Runtime Environment remains important. They contain many tools applicable to the development and maintenance of Java applications. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/check-java-jps + +作者:[Alan Formy-Duval][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/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/java-coffee-beans.jpg?itok=3hkjX5We (Coffee beans) +[2]: https://opensource.com/article/21/8/linux-procps-ng From d544b412f527fd30c1e6d54d7194052c1a115232 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 Oct 2021 05:03:48 +0800 Subject: [PATCH 0620/1588] add done: 20211006 Check Java processes on Linux with the jps command.md --- sources/tech/20211007 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20211007 .md diff --git a/sources/tech/20211007 .md b/sources/tech/20211007 .md new file mode 100644 index 0000000000..05999a471f --- /dev/null +++ b/sources/tech/20211007 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/repair-corrupted-xfs-filesystem-root-partition-rhel-8/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/repair-corrupted-xfs-filesystem-root-partition-rhel-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 1b773d1cb92d5dfe374607bb2ce59f1d2068eefb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 Oct 2021 05:03:57 +0800 Subject: [PATCH 0621/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211006?= =?UTF-8?q?=20Following=20a=20DevSecOps=20maturity=20model?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211006 Following a DevSecOps maturity model.md --- ...06 Following a DevSecOps maturity model.md | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 sources/tech/20211006 Following a DevSecOps maturity model.md diff --git a/sources/tech/20211006 Following a DevSecOps maturity model.md b/sources/tech/20211006 Following a DevSecOps maturity model.md new file mode 100644 index 0000000000..ed092f3416 --- /dev/null +++ b/sources/tech/20211006 Following a DevSecOps maturity model.md @@ -0,0 +1,66 @@ +[#]: subject: "Following a DevSecOps maturity model" +[#]: via: "https://opensource.com/article/21/10/devsecops-maturity-model" +[#]: author: "Will Kelly https://opensource.com/users/willkelly" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Following a DevSecOps maturity model +====== +Following a maturity model also helps tell a story that includes the +people, process, and technology changes that come with a +DevOps-to-DevSecOps transformation. +![Sunlight coming through the tree branches][1] + +[DevSecOps][2] is in many ways another level of DevOps maturity for an enterprise. Executive management and other stakeholders understand the concept of a maturity model, making it a helpful way to explain the value of this shift. Following a maturity model also helps you tell a story that includes the people, process, and technology changes that come with a DevOps-to-DevSecOps transformation. + +Here are four typical levels of DevSecOps maturity: + +### Level 1: pre-DevOps (no automation) + +At this level, developers perform every task manually, including creating and testing applications and systems. Team management, processes, and application security are still at a very ad hoc level. + +Take the extra step to capture your lessons learned and the challenges of your pre-DevOps development era. You need to know your history, so you don't repeat it in the future. + +### Level 2: early DevOps/DevSecOps (lightweight automation) + +Development teams standardize on some form of a DevOps toolchain to implement Infrastructure-as-Code and Compliance-as-Code. DevSecOps adoption is at the department or even just at the team level. + +Mentioning DevOps and DevSecOps interchangeably in this phase is deliberate. Some organizations will fast-forward from traditional waterfall development straight to a DevSecOps model. At level 2, DevOps/DevSecOps and lightweight automation is the domain of innovative and more forward-thinking development teams. Developers are driven to find a better way to do things, either as a result of their own initiative or because a customer is asking for a DevOps approach. + +Making it from level 2 to level 3 depends upon communicating and selling the successes of your early adopters of DevSecOps to the rest of your organization. Be sure to keep in touch with your early adopters and encourage them to share their DevOps and DevSecOps wins with the rest of their peers. Early win stories resonate much better than managerial mandates. + +### Level 3: DevOps to DevSecOps transition (advanced automation) + +DevSecOps grows into a corporate or agency-wide strategy. With organization-wide support, an automation strategy for application and infrastructure development and management takes form. DevOps teams can now improve their existing processes using containers, Kubernetes (K8s), and public cloud services. + +Bottom line: Organizations at this advanced phase of DevSecOps maturity are deploying applications at scale. + +### Level 4: full DevSecOps (full automation) + +Such an expert state of DevSecOps maturity will be elusive for all but the most prominent and well-funded enterprises, those who must routinely meet the most strict cybersecurity and compliance demands. An organization that reaches this level of maturity is API and cloud-native first. These organizations are also implementing emerging technologies such as [microservices][3], [serverless][4], and [artificial intelligence/machine learning (AI/ML)][5] to strengthen their application development and infrastructure security. + +### Final thoughts + +Only when you track the maturity of your processes, team culture, and tooling do you get the best current and future-state views of your organization's progress to DevSecOps. The pandemic pushed many teams to remote work in the past 18 months. As a result, teams had to mature their processes and mature them quickly to ensure their organization could still deliver to their customers. DevSecOps brings together the very cultural, collaboration, and toolchain improvements that development teams require to deliver secure and compliant software in their new world of work. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/devsecops-maturity-model + +作者:[Will Kelly][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/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/jan-huber-tree.jpg?itok=CRBwhuMA (Sunlight coming through the tree branches) +[2]: https://www.redhat.com/en/topics/devops/what-is-devsecops +[3]: https://opensource.com/resources/what-are-microservices +[4]: https://opensource.com/article/21/1/devapps-strategies +[5]: https://opensource.com/tags/ai-and-machine-learning From c56d75057dea78dc8430bcc6de24678170c5a159 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 7 Oct 2021 05:04:23 +0800 Subject: [PATCH 0622/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211006?= =?UTF-8?q?=20DirectX=2011/12=20Games=20like=20Cyberpunk=202077=20Can=20Us?= =?UTF-8?q?e=20NVIDIA=20DLSS=20With=20Proton=20Experimental=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md --- ... DLSS With Proton Experimental on Linux.md | 96 +++++++++++++++++++ 1 file changed, 96 insertions(+) create mode 100644 sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md diff --git a/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md b/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md new file mode 100644 index 0000000000..334e19bce4 --- /dev/null +++ b/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md @@ -0,0 +1,96 @@ +[#]: subject: "DirectX 11/12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux" +[#]: via: "https://news.itsfoss.com/nvidia-dlss-dx-11-12-proton/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +DirectX 11/12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux +====== + +In June, Nvidia [announced][1] the support for **DLSS** in Linux via Steam Proton and a beta driver for Vulkan-based games. + +DLSS stands for Deep Learning Super Sampling. It utilizes deep learning algorithms powered by Tensor cores found in RTX GPUs to upscale images inside games. This results in clearer and sharper images along with higher framerates. + +![Source: NVIDIA][2] + +This [upscaling technology is similar][3] to AMD’s Fidelity FX and even closer to Intel’s upcoming XeSS, both open-source, unlike DLSS. Gamers already have the benefit of making use of Fidelity FX through [GloriousEggroll’s][4] custom Proton GE versions. + +Moreover, NVIDIA also planned to expand support to DirectX games by this fall. + +And, finally, with the latest Proton Experiment support, that’s happening. Linux gamers using Nvidia GPUs can now play their favorite DX11/12 based games with DLSS. + +There couldn’t be a better time for this addition, considering we will be able to play various multiplayer games soon on Linux with the [support for BattleEye & Easy-Anti Cheat added to Proton][5]. + +### Major Updates to Steam Play Proton + +Along with a wave of improvements in Proton 6.3-7, Valve has finally managed to add DLSS support into Proton’s Experimental branch for DirectX 11/12 games a few days ago. + +Previously, a beta driver was required to use DLSS for Vulkan-based games like DOOM Eternal. + +But, that isn’t the case anymore—although the latest drivers are recommended. + +To complement this, DXVK and the Steamworks SDK have also been updated to the latest development versions. Additionally, performance issues for specific games and other bugs have also been fixed. + +You can check Proton’s [official GitHub changelog][6] to explore the list of improvements for all the games supported so far. + +### Enabling DLSS for DX11/12 Games + +Enabling DLSS is a straightforward process. + +First, you have to make sure that your Windows game runs on Proton Experimental. + +This can be done by right-clicking on the game and selecting Properties. Then under Compatibility, you need to tick the “Force the use of a specific Steam Play compatibility tool” checkbox. Next, choose Proton Experimental from the drop-down menu. + +![][7] + +Finally, you need to insert the command `PROTON_HIDE_NVIDIA_GPU=0 PROTON_ENABLE_NVAPI=1 %command%` in **Launch Options**. + +![][8] + +That’s it! You’re all set to play your games with DLSS! + +### Summing Up + +Nvidia DLSS is a much-needed feature for many games, given the difference it makes. + +Linux did not have full-fledged support for DLSS from the get-go. But, it looks like it will soon be available in a future stable Proton version along with necessary improvements. + +Linux gamers can finally experience better frame rates and visual quality for many games with their RTX-based GPUs. + +Although I use Fidelity FX on my AMD graphics card, I still crave to try out DLSS on an RTX GPU! + +_How do you feel about the arrival of Nvidia’s DLSS? Will you be trying it out soon? Feel free to share your comments below._ + +**Via:** [GamingOnLinux][9] + +#### 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/nvidia-dlss-dx-11-12-proton/ + +作者:[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://www.nvidia.com/en-us/geforce/news/june-2021-rtx-dlss-game-update/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://news.itsfoss.com/intel-xess-open-source/ +[4]: https://github.com/GloriousEggroll/proton-ge-custom +[5]: https://news.itsfoss.com/easy-anti-cheat-linux/ +[6]: https://github.com/ValveSoftware/Proton/wiki/Changelog +[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[9]: https://www.gamingonlinux.com/2021/10/proton-experimental-expands-nvidia-dlss-support-on-linux-to-directx-11-titles From ab4f55b2c388b858870cd1a915c78ebe4c1bbea9 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 7 Oct 2021 08:39:24 +0800 Subject: [PATCH 0623/1588] Delete 20211007 .md --- sources/tech/20211007 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20211007 .md diff --git a/sources/tech/20211007 .md b/sources/tech/20211007 .md deleted file mode 100644 index 05999a471f..0000000000 --- a/sources/tech/20211007 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/repair-corrupted-xfs-filesystem-root-partition-rhel-8/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/repair-corrupted-xfs-filesystem-root-partition-rhel-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 22a468289e84fd5a1a2f36fa143539613d9cc9a3 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 Oct 2021 09:38:33 +0800 Subject: [PATCH 0624/1588] PRF @wxy --- .../tech/20211005 Tools to explore BGP.md | 52 ++++++++++--------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/translated/tech/20211005 Tools to explore BGP.md b/translated/tech/20211005 Tools to explore BGP.md index 9dfb0a0be9..e8b888796c 100644 --- a/translated/tech/20211005 Tools to explore BGP.md +++ b/translated/tech/20211005 Tools to explore BGP.md @@ -3,13 +3,15 @@ [#]: author: "Julia Evans https://jvns.ca/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 由 Facebook 事故引发的 BGP 工具探索 ====== +![](https://img.linux.net.cn/data/attachment/album/202110/07/093743krr8ftrpvgfrvffx.jpg) + 昨天,Facebook 发生了由 BGP 引起的离线事故。我对学习更多关于 BGP 的知识已经隐约感兴趣了很长时间,所以我阅读了一些文章。 我感到很沮丧,因为没有一篇文章告诉我如何在我的电脑上实际查找与 BGP 有关的信息,因此我 [写了一条询问有关工具的推特][1]。 @@ -25,12 +27,12 @@ * 发行你自己的 TLS 证书 * 编写你自己的 HTTP 服务器 * 编写你自己的 TCP 实现 - * 为你的域名编写你自己的权威 DNS 服务器(我现在正在为一个小项目尝试这样做)。 - *建立你自己的证书机构(CA) + * 为你的域名编写你自己的权威 DNS 服务器(我现在正在为一个小项目尝试这样做) + * 建立你自己的证书机构(CA) 但是对于 BGP,我认为除非你拥有自己的 ASN,否则你不能自己发布路由(你*可以*在你的家庭网络上实现 BGP,但这对我来说有点无聊,当我做实验的时候,我希望它们真的在真正的互联网上)。 -无论如何,尽管我不能用它做实验,但我仍然认为它超级有趣,因为我喜欢网络,所以我将向你展示我找到的一些工具来学习 BGP。 +无论如何,尽管我不能用它做实验,但我仍然认为它超级有趣,因为我喜欢网络,所以我将向你展示我找到的一些用来学习 BGP 的工具。 首先我们来谈谈 BGP 的一些术语。我打算很快掠过,因为我对工具更感兴趣,而且网上有很多关于 BGP 的高水平解释(比如这篇 [cloudflare 的文章][2])。 @@ -39,14 +41,14 @@ 我们首先需要了解的是 AS(“自治系统autonomous system”)。每个 AS: 1. 由一个组织拥有(通常是一个大型组织,如你的 ISP、政府、大学、Facebook 等)。 - 2.控制一组特定的 IP 地址(例如,我的 ISP 的 AS 包括 247,808 个 IP 地址)。 + 2. 控制一组特定的 IP 地址(例如,我的 ISP 的 AS 包括 247,808 个 IP 地址)。 3. 有一个编号 ASN(如 1403)。 下面是我通过做一些实验对 AS 的一些观察: - * 一些相当大的科技公司并没有自己的 AS。例如,我在 BGPView 上查看了 Patreon,就我所知,他们没有自己的 AS,他们的主要网站(patreon.com,[104.16.6.49][3])在 Cloudflare 的 AS 中。 + * 一些相当大的科技公司并没有自己的 AS。例如,我在 BGPView 上查看了 Patreon,就我所知,他们没有自己的 AS,他们的主要网站(`patreon.com`,[104.16.6.49][3])在 Cloudflare 的 AS 中。 * 一个 AS 可以包括许多国家的 IP。Facebook 的 AS([AS32934][4])肯定有新加坡、加拿大、尼日利亚、肯尼亚、美国和其他国家的 IP 地址。 - * 似乎 IP 地址可以在一个以上的 AS 中。例如,如果我查找[209.216.230.240][5],它有 2 个 ASN 与之相关:AS6130 和 AS21581。显然,当这种情况发生时,更具体的路线会被优先考虑--所以到该 IP 的数据包会被路由到 AS21581。 + * 似乎 IP 地址可以在一个以上的 AS 中。例如,如果我查找 [209.216.230.240][5],它有 2 个 ASN 与之相关:`AS6130` 和 `AS21581`。显然,当这种情况发生时,更具体的路线会被优先考虑 —— 所以到该 IP 的数据包会被路由到 `AS21581`。 ### 什么是 BGP 路由? @@ -54,9 +56,9 @@ 当我给我的 ISP 发送一个数据包时(例如通过运行 `ping 129.134.30.0`),我的 ISP 的路由器需要弄清楚如何将我的数据包实际送到 IP 地址 `129.134.30.0`。 -路由器计算的方法是,它有一个**路由表**:有一堆 IP 地址范围的列表(比如 `129.134.30.0/23`),以及它知道的到达该子网的路由。 +路由器计算的方法是,它有一个**路由表**:这是个有一堆 IP 地址范围的列表(比如 `129.134.30.0/23`),以及它知道的到达该子网的路由。 -下面是一个 `129.134.30.0/23` 的真实路由的例子(Facebook 的一个子网)。这不是来自我的 ISP。 +下面是一个 `129.134.30.0/23` (Facebook 的一个子网)的真实路由的例子。这不是来自我的 ISP。 ``` 11670 32934 @@ -70,7 +72,7 @@ ### BGP 是什么? -我对 BGP 的理解很不牢靠,但它是一个公司用来公布 BGP 路由的协议。 +我对 BGP 的理解非常浅薄,它是一个公司用来公布 BGP 路由的协议。 昨天发生在 Facebook 身上的事情基本上是他们发布了一个 BGP 公告,撤销了他们所有的 BGP 路由,所以世界上的每个路由器都删除了所有与 Facebook 有关的路由,没有流量可以到达那里。 @@ -80,7 +82,7 @@ 为了使 AS 这个东西不那么抽象,让我们用一个叫做 [BGPView][6]的 工具来看看一个真实的 AS。 -我的 ISP(EBOX)拥有 [AS 1403][7]。下面是 [我的 ISP 拥有的 IP 地址][8]。如果我查找我的计算机的公共 IPv4 地址,我可以看到它是我的 ISP 拥有的IP地址之一:它在 `104.163.128.0/17` 块中。 +我的 ISP(EBOX)拥有 [AS 1403][7]。这是 [我的 ISP 拥有的 IP 地址][8]。如果我查找我的计算机的公共 IPv4 地址,我可以看到它是我的 ISP 拥有的IP地址之一:它在 `104.163.128.0/17` 块中。 BGPView 也有这个图,显示了我的 ISP 与其他 AS 的连接情况。 @@ -92,7 +94,7 @@ BGPView 也有这个图,显示了我的 ISP 与其他 AS 的连接情况。 `traceroute` 和 `mtr` 都有选项可以告诉你每个 IP 的 ASN。其选项分别是 `traceroute -A` 和 `mtr -z`。 -让我们看看我用 `mtr` 在去 facebook.com 的路上经过了哪些自治系统! +让我们看看我用 `mtr` 在去 `facebook.com` 的路上经过了哪些 AS! ``` $ mtr -z facebook.com @@ -108,11 +110,11 @@ $ mtr -z facebook.com 10. AS32934 edge-star-mini-shv-01-yyz1.facebook.com ``` -这很有意思,看起来我们直接从我的 ISP 的 AS(1403)到 Facebook 的 AS(32934),中间有一个“互联网交换”。 +这很有意思,看起来我们直接从我的 ISP 的 AS(`1403`)到 Facebook 的 AS(`32934`),中间有一个“互联网交换”。 -我不确定 [互联网交换][10]internet exchange(IX)是什么,但我知道它是互联网的一个极其重要的部分。不过这将是以后的事了。我最好的猜测是,它是互联网中实现“对等”的部分,就假设它是一个有巨大的交换机的机房,里面有无限的带宽,一堆不同的公司把他们的电脑放在里面,这样他们就可以互相发送数据包。 +> 我不确定 [互联网交换][10]internet exchange(IX)是什么,但我知道它是互联网的一个极其重要的部分。不过这将是以后的事了。我猜是,它是互联网中实现“对等”的部分,就假设它是一个有巨大的交换机的机房,里面有无限的带宽,一堆不同的公司把他们的电脑放在里面,这样他们就可以互相发送数据包。 -### mtr 用 DNS 查找 ASN +#### mtr 用 DNS 查找 ASN 我对 `mtr` 如何查找 ASN 感到好奇,所以我使用了 `strace`。我看到它看起来像是在使用 DNS,所以我运行了 [dnspeep][11],然后就看到了! @@ -140,7 +142,7 @@ PCH(“数据包交换所packet clearing house”)是 这里是 PCH 的观察镜: 。 -在该网站的 Web 表单中,我选择了多伦多 IX(“TORIX”),因为 `mtr` 说我是用它来访问 facebook.com 的。 +在该网站的 Web 表单中,我选择了多伦多 IX(“TORIX”),因为 `mtr` 说我是用它来访问 `facebook.com` 的。 #### 操作 1:显示 ip bgp 摘要 @@ -169,7 +171,7 @@ Total number of neighbors 147 #### 操作 2:显示 ip bgp 129.134.30.0 -这是挑选自 `show ip bgp` 对 `129.134.30.0`(Facebook 的一个 IP 地址)的输出: +这是筛选自 `show ip bgp` 对 `129.134.30.0`(Facebook 的一个 IP 地址)的输出: ``` BGP routing table entry for 129.134.30.0/23 @@ -217,9 +219,9 @@ Paths: (4 available, best #4, table default) * * -似乎有很多这样的观察镜服务,远不止这 3 个列表: +似乎有很多这样的观察镜服务,远不止这 3 个列表。 -这里有一个与这个列表上的一个服务器进行会话的例子:route-views.routeviews.org。这次我是通过 telnet 连接的,而不是通过 Web 表单,但输出的格式看起来是一样的。 +这里有一个与这个列表上的一个服务器进行会话的例子:`route-views.routeviews.org`。这次我是通过 telnet 连接的,而不是通过 Web 表单,但输出的格式看起来是一样的。 ``` $ telnet route-views.routeviews.org @@ -271,15 +273,15 @@ Paths: (23 available, best #2, table default) * `20912 3257 1299 32934` * `7660 2516 1299 32934` -我想这些都有不止一个 AS 的原因是,`31.13.80.36` 是 Facebook 在多伦多的 IP 地址,所以这个服务器(可能在美国西海岸,我不确定)不能直接连接到它,它需要先到另一个 AS。所以所有的路由都有一个或多个 ASN +我想这些都有不止一个 AS 的原因是,`31.13.80.36` 是 Facebook 在多伦多的 IP 地址,所以这个服务器(可能在美国西海岸,我不确定)不能直接连接到它,它需要先到另一个 AS。所以所有的路由都有一个或多个 ASN。 -最短的是 6939(“Hurricane Electric”),它是一个 “全球互联网骨干”。他们也有自己的 [Hurricane Electric 观察镜][12] 页面。 +最短的是 `6939`(“Hurricane Electric”),它是一个 “全球互联网骨干”。他们也有自己的 [Hurricane Electric 观察镜][12] 页面。 ### 工具 4:BGPlay -到目前为止,所有其他的工具都只是向我们展示了 Facebook 路由的当前状态,其中一切正常,但这第四个工具让我们看到了这个 Facebook BGP 互联网灾难的历史 这是一个 GUI 工具,所以我将包括一堆屏幕截图。 +到目前为止,所有其他的工具都只是向我们展示了 Facebook 路由的当前状态,其中一切正常,但这第四个工具让我们看到了这个 Facebook BGP 互联网灾难的历史。这是一个 GUI 工具,所以我将包括一堆屏幕截图。 -该工具在 。我输入了 IP 地址 129.134.30.12(Facebook 的一个 IP),如果你想一起试试。 +该工具在 。我输入了 IP 地址 `129.134.30.12`(Facebook 的一个 IP),如果你想一起试试。 首先,让我们看看一切出错之前的状态。我点击了在 10 月 4 日 13:11:28 的时间线,得到了这个结果: @@ -320,7 +322,7 @@ Date and time: 2021-10-04 16:02:33 Collected by: 20-91.206.53.12 如果你想(作为一个业余爱好者)真正发布 BGP 路由,这里有一些评论中的链接: * [获取你自己的 ASN 的指南][17] - * [dn42][18] 似乎有一个 BGP 的实验场(它不在公共互联网上,但确实有其他人在上面,这似乎比自己在家里做 BGP 实验更有趣 + * [dn42][18] 似乎有一个 BGP 的实验场(它不在公共互联网上,但确实有其他人在上面,这似乎比自己在家里做 BGP 实验更有趣) ### 目前就这些了 @@ -335,7 +337,7 @@ via: https://jvns.ca/blog/2021/10/05/tools-to-look-at-bgp-routes/ 作者:[Julia 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 82237a7445036e105f315f698c10ee39b4886006 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 Oct 2021 09:39:11 +0800 Subject: [PATCH 0625/1588] PUB @wxy https://linux.cn/article-13857-1.html --- .../tech => published}/20211005 Tools to explore BGP.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211005 Tools to explore BGP.md (99%) diff --git a/translated/tech/20211005 Tools to explore BGP.md b/published/20211005 Tools to explore BGP.md similarity index 99% rename from translated/tech/20211005 Tools to explore BGP.md rename to published/20211005 Tools to explore BGP.md index e8b888796c..5b9e728692 100644 --- a/translated/tech/20211005 Tools to explore BGP.md +++ b/published/20211005 Tools to explore BGP.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13857-1.html" 由 Facebook 事故引发的 BGP 工具探索 ====== From be3b47c87b0b331c9c2eba721330241644d81f59 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 Oct 2021 10:07:43 +0800 Subject: [PATCH 0626/1588] APL --- .../tech/20211002 Monitor your Java on Linux with jconsole.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211002 Monitor your Java on Linux with jconsole.md b/sources/tech/20211002 Monitor your Java on Linux with jconsole.md index 3d75ccd24b..9774cd9a00 100644 --- a/sources/tech/20211002 Monitor your Java on Linux with jconsole.md +++ b/sources/tech/20211002 Monitor your Java on Linux with jconsole.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/monitor-java-linux-jconsole" [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 886238663a0b77315c945c102265c5b5d68edda3 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Thu, 7 Oct 2021 10:19:03 +0800 Subject: [PATCH 0627/1588] APL --- ...1006 Check Java processes on Linux with the jps command.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20211006 Check Java processes on Linux with the jps command.md b/sources/tech/20211006 Check Java processes on Linux with the jps command.md index b7c1c0cdfe..e6c11e3e86 100644 --- a/sources/tech/20211006 Check Java processes on Linux with the jps command.md +++ b/sources/tech/20211006 Check Java processes on Linux with the jps command.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/check-java-jps" [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -62,7 +62,7 @@ via: https://opensource.com/article/21/10/check-java-jps 作者:[Alan Formy-Duval][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 ee82ce9853a0d021b9fed383689f6db470575f08 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 Oct 2021 10:32:10 +0800 Subject: [PATCH 0628/1588] TSL&PRF --- ...onitor your Java on Linux with jconsole.md | 122 ------------------ ...onitor your Java on Linux with jconsole.md | 104 +++++++++++++++ 2 files changed, 104 insertions(+), 122 deletions(-) delete mode 100644 sources/tech/20211002 Monitor your Java on Linux with jconsole.md create mode 100644 translated/tech/20211002 Monitor your Java on Linux with jconsole.md diff --git a/sources/tech/20211002 Monitor your Java on Linux with jconsole.md b/sources/tech/20211002 Monitor your Java on Linux with jconsole.md deleted file mode 100644 index 9774cd9a00..0000000000 --- a/sources/tech/20211002 Monitor your Java on Linux with jconsole.md +++ /dev/null @@ -1,122 +0,0 @@ -[#]: subject: "Monitor your Java on Linux with jconsole" -[#]: via: "https://opensource.com/article/21/10/monitor-java-linux-jconsole" -[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Monitor your Java on Linux with jconsole -====== -How to use the Java monitoring and management console included in the -Java Development Kit. -![Puzzle pieces coming together to form a computer screen][1] - -The Java Development Kit (JDK) provides binaries, tools, and compilers for the development of Java applications. One helpful tool included is jconsole. - -To demonstrate, I will use the WildFly J2EE application server, which is part of the JBOSS open source application server project. First, I start up a standalone instance. - - -``` -~/wildfly/24.0.1/bin$ ./standalone.sh -========================================================================= - -  JBoss Bootstrap Environment - -  JBOSS_HOME: /home/alan/wildfly/24.0.1 - -  JAVA: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-5.fc34.x86_64/bin/java -``` - -Now, in another terminal, I type `jconsole`. - - -``` -$ jconsole -``` - -Upon launching, jconsole lists local instances. Select Local Process, then select the name of the process and click Connect. That is all it takes to connect and begin using jconsole with a running Java Virtual Machine (JVM). - -![jconsole new connection screen with local processes][2] - -(Alan Formy-Duvall, [CC BY-SA 4.0][3]) - -### Overview - -The Java Monitoring and Management Console shows the process identifier (PID) at the top of the dashboard. The Overview tab has four graphs to show the vitals for Heap Memory Usage, Threads, Classes, and CPU Usage. - -![jconsole dashboard showing heap memory usage, threads, classes, and CPU usage][4] - -(Alan Formy-Duvall, [CC BY-SA 4.0][3]) - -The tabs along the top provide more detailed views of each area. - -### Memory - -The Memory tab displays graphs of various aspects of the memory being used by the JVM. The amount of the server system memory allocated to the JVM is called the heap. This screen also provides details about usage by the internal components of the heap, such as the Eden Space, Old Gen, and the Survivor Space. You can manually request a garbage collection action as well. - -![jconsole memory tab][5] - -(Alan Formy-Duvall, [CC BY-SA 4.0][3]) - -### Threads - -The Threads tab shows how many threads are running. You can also manually check for deadlocks. - -![jconsole thread dashboard showing number of threads over time and a scrolling list of threads][6] - -(Alan Formy-Duvall, [CC BY-SA 4.0][3]) - -### Classes - -The classes tab tells you how many classes are loaded and how many have been unloaded. - -![jconsole classes tab showing number of loaded classes over time][7] - -(Alan Formy-Duvall, [CC BY-SA 4.0][3]) - -### VM Summary - -The VM Summary tab provides many details about the application and the host system. You can learn which operating system and architecture you are on, the total amount of system memory, the number of CPUs, and even swap space. - -![jconsole VMsummary tab ][8] - -(Alan Formy-Duvall, [CC BY-SA 4.0][3]) - -Further details about the JVM shown in the summary include current and maximum heap size and information about the garbage collectors in use. The bottom pane lists all of the arguments passed to the JVM. - -### MBeans - -The last tab, MBeans, lets you drill down through all of the MBeans to view attributes and values for each. - -![MBeans tab][9] - -(Alan Formy-Duvall, [CC BY-SA 4.0][3]) - -### Conclusion - -Java has been around a long time, and it continues to power millions of systems worldwide. Plenty of development environments and monitoring systems are available, but having a tool like jconsole included in the base kit can be highly valuable. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/monitor-java-linux-jconsole - -作者:[Alan Formy-Duval][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/alanfdoss -[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://opensource.com/sites/default/files/uploads/jconsole_new_connection_local.png (new connection) -[3]: https://creativecommons.org/licenses/by-sa/4.0/deed.ast -[4]: https://opensource.com/sites/default/files/uploads/jconsole_tab_overview.png (tab overview) -[5]: https://opensource.com/sites/default/files/uploads/jconsole_tab_memory.png (memory tab) -[6]: https://opensource.com/sites/default/files/uploads/jconsole_tab_threads.png (threads tab) -[7]: https://opensource.com/sites/default/files/uploads/jconsole_tab_classes.png (classes tab) -[8]: https://opensource.com/sites/default/files/uploads/jconsole_tab_vm-summary.png (VMsummary tab ) -[9]: https://opensource.com/sites/default/files/uploads/jconsole_tab_mbeans.png (MBeans tab) diff --git a/translated/tech/20211002 Monitor your Java on Linux with jconsole.md b/translated/tech/20211002 Monitor your Java on Linux with jconsole.md new file mode 100644 index 0000000000..d0a888fd40 --- /dev/null +++ b/translated/tech/20211002 Monitor your Java on Linux with jconsole.md @@ -0,0 +1,104 @@ +[#]: subject: "Monitor your Java on Linux with jconsole" +[#]: via: "https://opensource.com/article/21/10/monitor-java-linux-jconsole" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +用 jconsole 在 Linux 上监控你的 Java +====== + +> 如何使用 Java 开发工具包中的 Java 监控和管理控制台。 + +![拼图拼成的电脑屏幕][1] + +Java 开发工具包(JDK)提供了开发 Java 应用程序的二进制文件、工具和编译器。其中一个有用的工具是 `jconsole`。 + +为了演示,我将使用 WildFly J2EE 应用服务器,它是 JBOSS 开源应用服务器项目的一部分。首先,我启动了一个独立的实例。 + +``` +~/wildfly/24.0.1/bin$ ./standalone.sh +========================================================================= +  JBoss Bootstrap Environment +  JBOSS_HOME: /home/alan/wildfly/24.0.1 +  JAVA: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-5.fc34.x86_64/bin/java +``` + +现在,在另一个终端,我输入 `jconsole`。 + +``` +$ jconsole +``` + +启动后,jconsole 会列出本地实例。选择“本地进程Local Process”,然后选择进程的名称并点击“连接Connect”。这就是连接并开始使用运行中的 Java 虚拟机(JVM)的 jconsole 的全部过程。 + +![jconsole 与本地进程的新连接屏幕][2] + +### 概述 + +这个 Java 监控和管理控制台在仪表板的顶部显示进程标识符(PID)。“概述Overview”标签有四个图表,显示“堆内存使用情况Heap Memory Usage”、“线程Threads”、“Classes”和“CPU 使用情况CPU Usage”的重要信息。 + +![jconsole 仪表板显示堆内存使用量、线程、类和 CPU 使用量][4] + +沿着顶部的标签提供每个区域的更详细的视图。 + +### 内存 + +“内存Memory”标签显示 JVM 所使用的内存的各个方面的图表。分配给 JVM 的服务器系统内存的数量被称为“Heap”。这个屏幕还提供了关于堆的内部组件使用情况的详细信息,例如 Eden Space、Old Gen 和 Survivor Space。你也可以手动请求一个垃圾收集动作。 + +![jconsole 内存标签][5] + +### 线程 + +“线程Threads”标签显示有多少线程在运行。你也可以手动检查是否存在死锁。 + +![jconsole 线程仪表板显示了随时间变化的线程数量和滚动的线程列表][6] + +### 类 + +“Classes”标签告诉你有多少类被加载,有多少被卸载。 + +![jconsole 类标签显示随着时间推移加载的类数量][7] + +### 虚拟机摘要 + +“虚拟机摘要VM Summary”标签提供了许多关于应用程序和主机系统的细节。你可以了解你所处的操作系统和架构、系统内存总量、CPU 数量,甚至交换空间。 + +![jconsole 虚拟机摘要标签][8] + +摘要中显示的关于 JVM 的进一步细节,包括当前和最大的堆大小以及正在使用的垃圾收集器的信息。底部的窗格列出了传递给 JVM 的所有参数。 + +### MBeans + +最后一个标签,MBeans,让你通过所有的 MBeans 向下钻取,以查看每个 MBeans 的属性和值。 + +![MBeans 标签][9] + +### 总结 + +Java 已经存在了很长时间,它将继续为全球数百万的系统提供动力。有很多开发环境和监控系统可以使用,但在基本工具包中包含像 `jconsole` 这样的工具会非常有价值。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/monitor-java-linux-jconsole + +作者:[Alan Formy-Duval][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/alanfdoss +[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://opensource.com/sites/default/files/uploads/jconsole_new_connection_local.png (new connection) +[3]: https://creativecommons.org/licenses/by-sa/4.0/deed.ast +[4]: https://opensource.com/sites/default/files/uploads/jconsole_tab_overview.png (tab overview) +[5]: https://opensource.com/sites/default/files/uploads/jconsole_tab_memory.png (memory tab) +[6]: https://opensource.com/sites/default/files/uploads/jconsole_tab_threads.png (threads tab) +[7]: https://opensource.com/sites/default/files/uploads/jconsole_tab_classes.png (classes tab) +[8]: https://opensource.com/sites/default/files/uploads/jconsole_tab_vm-summary.png (VMsummary tab ) +[9]: https://opensource.com/sites/default/files/uploads/jconsole_tab_mbeans.png (MBeans tab) From b631fcf0246d14ab8de8a8eef8e533502ad1a59a Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Thu, 7 Oct 2021 10:50:07 +0800 Subject: [PATCH 0629/1588] finished --- ...processes on Linux with the jps command.md | 21 +++++++++---------- 1 file changed, 10 insertions(+), 11 deletions(-) rename {sources => translated}/tech/20211006 Check Java processes on Linux with the jps command.md (62%) diff --git a/sources/tech/20211006 Check Java processes on Linux with the jps command.md b/translated/tech/20211006 Check Java processes on Linux with the jps command.md similarity index 62% rename from sources/tech/20211006 Check Java processes on Linux with the jps command.md rename to translated/tech/20211006 Check Java processes on Linux with the jps command.md index e6c11e3e86..c8b986badd 100644 --- a/sources/tech/20211006 Check Java processes on Linux with the jps command.md +++ b/translated/tech/20211006 Check Java processes on Linux with the jps command.md @@ -7,15 +7,14 @@ [#]: publisher: " " [#]: url: " " -Check Java processes on Linux with the jps command +使用 jps 命令监测 Linux 上的 Java 进程 ====== -With many processes running on a system, it's useful to have a quick way -to identify only Java with the jps command. +系统上会运行很多进程,使用 jps 命令快速识别 Java 进程是一个很有用的方法。 ![Coffee beans][1] -On Linux, there are commands to view processes running on your system. A process is any ongoing event being managed by the kernel. A process is spawned when you launch an application, but there are also 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 more. The utilities, such as those included in the [procps-ng package][2], that monitor these processes tend to be intentionally generic. They look at all processes on your computer so you can filter the list based on what you need to know. +在 Linux 上,有一些命令可以用于查看系统上运行的进程。进程是指的是由内核管理的正在进行的事件。每当启动应用程序时,就会产生一个进程,但也有许多进程在计算机后台运行,像保持系统时间准确的程序、监视新文件系统的程序、索引化文件的程序等。有一些实用程序可以用来监测这些进程,比如包含在 [procps-ng 包][2] 中的那些程序,但它们往往都是对各种进程通用的。它们会查看计算机上的所有进程,你可以根据想要的内容来过滤结果列表。 -On Linux, you can view processes with the `ps` command. It is the simplest way to view the running processes on your system. +在 Linux 上,可以使用 `ps` 命令查看进程。这是查看系统上正在运行的进程的最简单方法。 ``` @@ -25,7 +24,7 @@ $ ps   66930 pts/0    00:00:00 ps ``` -You can use the `ps` command to view running Java processes on a system also by piping output to `grep`. +你也可以使用 `ps` 命令,将结果输出到管道符 `grep`,从而查看系统上运行的 Java 进程,。 ``` @@ -33,9 +32,9 @@ $ ps ax |grep java   67604 pts/1    Sl+    0:18 /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc34.x86_64/bin/java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties -jar /home/alan/wildfly/24.0.1/jboss-modules.jar -mp /home/alan/wildfly/24.0.1/modules org.jboss.as.standalone -Djboss.home.dir=/home/alan/wildfly/24.0.1 -Djboss.server.base.dir=/home/alan/wildfly/24.0.1/standalone ``` -OpenJDK, however, has its very own specific process monitor. The Java Virtual Machine Process Status (jps) tool allows you to scan for each running instance of the Java Virtual Machine (JVM) on your system. +然而,OpenJDK 有自己的特定进程监视器。Java 虚拟机进程状态 (jps) 工具可以帮你扫描系统上每个运行的 Java 虚拟机 (JVM) 实例。 -To view a similar output as seen in the `ps` command, use the `-v` option. This is useful, partly because it requires less typing. +要想实现与 `ps` 命令类似的输出,可以使用 `-v` 选项。这很实用,因为与 `ps` 相比,它可以减少你的输入。 ``` @@ -43,7 +42,7 @@ $ jps -v 67604 jboss-modules.jar -D[Standalone] -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties ``` -The default `jps` output provides the process identifier and the class name or Jar file name of each detected instance. +`jps` 的默认输出会给出每个检测到的实例的进程标识符,以及类名或 Jar 文件名。 ``` @@ -52,9 +51,9 @@ $ jps 69430 Jps ``` -**Note:** The man page for `jps` states that it is experimental and unsupported. Still, it's a nice-to-have option because often many processes are running on a system, and having a quick way to identify only Java is useful. +**注意:** `jps` 的手册页指出此命令是试验性且不受支持的。尽管如此,它仍然是一个不错的选择,因为通常一个系统上运行着许多进程,有这样一种只识别 Java 进程的快速方法是很有用的。 -Because Java is still a popular language today, being familiar with the Java Development Kit and Runtime Environment remains important. They contain many tools applicable to the development and maintenance of Java applications. +当下的 Java 仍然是一种流行的语言,所以熟悉 Java 开发工具包和运行时环境仍然很重要。它们里面包含着许多适用于 Java 应用程序开发和维护的工具。 -------------------------------------------------------------------------------- From 64cb51848d14242b17d372daf101422f6c5106eb Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 Oct 2021 12:26:25 +0800 Subject: [PATCH 0630/1588] APL --- ...-like Browsers That Are Better Than Google Chrome in 2021.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md b/sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md index d0de8fbccf..f6bd4eb0bd 100644 --- a/sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md +++ b/sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md @@ -2,7 +2,7 @@ [#]: via: (https://news.itsfoss.com/chrome-like-browsers-2021/) [#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (wxy) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From dbbc677c403f0e2c39b96f6b2bbc70965a60ed68 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 Oct 2021 13:16:24 +0800 Subject: [PATCH 0631/1588] TSL&PRF --- ...t Are Better Than Google Chrome in 2021.md | 200 ------------------ ...t Are Better Than Google Chrome in 2021.md | 180 ++++++++++++++++ 2 files changed, 180 insertions(+), 200 deletions(-) delete mode 100644 sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md create mode 100644 translated/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md diff --git a/sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md b/sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md deleted file mode 100644 index f6bd4eb0bd..0000000000 --- a/sources/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md +++ /dev/null @@ -1,200 +0,0 @@ -[#]: subject: (Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021) -[#]: via: (https://news.itsfoss.com/chrome-like-browsers-2021/) -[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) -[#]: collector: (lujun9972) -[#]: translator: (wxy) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) - -Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021 -====== - -Want to switch away from Google? But, looking for something potentially better than Google Chrome (and similar) for your Linux system? - -Fortunately, there are multiple Google Chrome alternatives that you can try. - -Each of them brings something interesting to the table, while also keeping the fantastic compatibility Chrome is known for. Read on to find out more about these browsers. - -### Options That Are Better Than Google Chrome - -**Note:** _While [free and open-source software plays a crucial role in replacing big tech][1], any choice available on Linux other than Google Chrome should be a good start. Hence, you will find some non-FOSS options as well._ - -In my opinion, the best alternatives to Chrome are Chromium-based, meaning that they share the same DNA with Chrome. The advantage of this is that they already have feature parity with Chrome, while having more time to add their own. - -Also, if you want, you can explore [opensource alternatives to Chrome][2] that are not based on Chromium. - -In any case, even if the alternatives to Google Chrome do not seem superior to you, it is worth a try to move away from Big Tech. - -The result of this is a collection of browsers that are equal or better than Chrome in various aspects. Without further ado, here are my top five picks for Chrome-like browsers that are better than Chrome itself: - - * **UnGoogled Chromium** - * **Brave** - * **Microsoft Edge** - * **Vivaldi** - * **Opera** - - - -This list is in no order of ranking. - -### 1\. UnGoogled Chromium - -![][3] - -**Features:** - - * Removal of functionality specific to Google domains. - * Blocking of internal requests to Google at runtime. - * Stripping Google binaries from the source code. - * Many new command-line switches and `chrome://flags` entries. - * Forces all pop-ups into tabs. - - - -For the privacy fans out there, this browser will be a godsend. While it may look identical to Chrome, it has many privacy tweaks under-the-hood. - -As the name suggests, the biggest setback for Chrome users will be the absence of Google’s service integrations. This also means no more internal requests to Google, Google URL tracking, and much more. - -It does not boast anything extraordinary to protect your privacy, but it should be better than Google Chrome. - -You can choose to explore and toggle privacy settings at will through the Chrome flags settings as well. - -All-in-all, UnGoogled Chromium provides a familiar browsing experience, with a suite of privacy features added in as well. It is reliable and is also compatible with the large ecosystem of Chrome extensions. - -[UnGoogled Chromium][4] - -### 2\. Brave - -![][3] - -**Features:** - - * Built-in ad blocker. - * Faster page loading times. - * Brave rewards program. - * Ability to synchronise between devices. - * Chrome web store support. - - - -When Brave first marched onto the stage in 2016, people around the world were gawking at its privacy and performance features. At launch, these included a built-in ad-blocker and a new UI. - -Since then, the browser has gained many more features, including a rewards program and [Tor][5] integration. This has led it to become one of the fastest-growing browsers. - -[Brave][6] - -### 3\. Microsoft Edge - -![][3] - -**Features:** - - * Chrome Web Store support - * Child browsing mode (additional protection and simpler UI) - * Good PDF editing tools - * Built-in coupon finder - * Reader Mode - * Built-in password generator - - - -When Microsoft Edge first released alongside Windows 10 in 2015, it was widely criticized for being slow and buggy. However, in early 2020 it was completely remade using the Chromium web engine. - -This is the same engine Chrome is based on. The result of this is a modern and fast browsing experience. One perk of this transition is the web browser’s ability to run on many different platforms, from Windows 7 and macOS to Ubuntu and other Linux-based distros. - -I know, if you hate Microsoft for some reason, this may not entice you – but Microsoft Edge for Linux is a serious alternative to Google Chrome. - -[Microsoft Edge (Beta)][7] - -### 4\. Vivaldi - -![][3] - -**Features:** - - * Built-in translator - * Vivaldi Email (Beta) - * Feed Reader (Beta) - * Vivaldi Calendar (Beta) - * Highly customizable UI - * Built-in Ad Blocker - * Chrome Web Store support - * Tab grouping - * Split-screen tabs - - - -First released in 2016, Vivaldi has quickly risen the ranks in browser wars. Originally designed for Opera users disgruntled by its transition from the [Presto][8] [layout engine][9], it has managed to re-implement many of the features lost during Opera’s transition to Chromium. - -Amazingly, it has managed to do this all while being based on Chromium (the very reason Opera dropped these features). - -The latest [Vivaldi 4.0 release][10] also turned the tables with several features for power users. - -While it isn’t 100% FOSS, 93% of its source code is available, with only the UI being proprietary. Considering Vivaldi’s development team actively focus on Linux users for improvement, this could be a worthy tradeoff due to the sheer number of features Vivaldi offers. - -[Vivaldi][11] - -### 5\. Opera - -![][3] - -**Features:** - - * Built-in VPN - * Easy access to social media - * Built-in cryptocurrency wallet - * Fraud and malware protection - * Highly visible website security badge - - - -While it has never been the king of web browsers, Opera has always been present in the debate over which browser to use. Originally based on its in-house Presto Layout Engine, it switched over to Chromium in 2013. - -Unfortunately, this switch meant that the Opera team was forced to drop some of its most well-known features, paving the way for alternatives such as Vivaldi and Firefox to fill the space Opera had left. - -That isn’t to say that Opera is without features. It contains many, some of which are listed below. - -[Opera][12] - -### Wrapping Up - -Here we have listed a wide variety of browsers tailored to all kinds of users on any desktop platform. - -No matter whether you want more features, a better user interface, or something that helps you get away from Google, there is an option for you. - -Since all these browsers are based on Chromium, they all offer a good compatibility and user experience like Chrome. So, switch to one of these Chrome-like browsers and enjoy the freedom that each of them grants! - -_What’s your favorite alternative to Google Chrome on Linux in 2021? Let me know 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/chrome-like-browsers-2021/ - -作者:[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/save-privacy-with-foss/ -[2]: https://itsfoss.com/open-source-browsers-linux/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQxNiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://github.com/Eloston/ungoogled-chromium -[5]: https://itsfoss.com/tor-guide/ -[6]: https://brave.com -[7]: https://www.microsoftedgeinsider.com/en-us/download -[8]: https://en.wikipedia.org/wiki/Presto_(browser_engine) -[9]: https://en.wikipedia.org/wiki/Browser_engine -[10]: https://news.itsfoss.com/vivaldi-4-0-release/ -[11]: https://vivaldi.com -[12]: https://www.opera.com diff --git a/translated/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md b/translated/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md new file mode 100644 index 0000000000..dfb9fc76b1 --- /dev/null +++ b/translated/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md @@ -0,0 +1,180 @@ +[#]: subject: (Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021) +[#]: via: (https://news.itsfoss.com/chrome-like-browsers-2021/) +[#]: author: (Jacob Crume https://news.itsfoss.com/author/jacob/) +[#]: collector: (lujun9972) +[#]: translator: (wxy) +[#]: reviewer: (wxy) +[#]: publisher: ( ) +[#]: url: ( ) + +Linux 上 5 个基于 Chromium 的浏览器 +====== + +> 谷歌浏览器可能不是 Linux 用户的最佳浏览器。在这里,我们探讨了 Linux 平台的其他潜在选择。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/chrome-alternatives-2021.png?w=1200&ssl=1) + +想摆脱谷歌?想为你的 Linux 系统寻找可能比谷歌浏览器(和类似的)更好的浏览器? + +幸运的是,有多个谷歌浏览器的替代品,你可以试试。 + +它们中的每一个都带来了一些有趣的东西,同时也保持了 Chrome 所特有的奇妙兼容性。请继续阅读,了解这些浏览器的更多信息。 + +### 比谷歌浏览器更好的选择 + +> 注:虽然 [自由和开源软件在取代科技巨头方面扮演着关键角色][1],但除了谷歌浏览器之外,Linux 上的任何选择都是一个好的开始。因此,你也会发现一些非 FOSS 的选择。 + +在我看来,Chrome 的最佳替代品是基于 Chromium 的浏览器,这意味着它们与 Chrome 共享相同的基因。这样做的好处是,它们已经拥有与 Chrome 相同的功能,同时有更多时间来增加自己的功能。 + +另外,如果你愿意,你可以了解一下不基于 Chromium 的 [Chrome 开源替代品][2]。 + +无论如何,即使谷歌浏览器的替代品对你来说并不优越,也值得尝试远离科技巨头。 + +我们收集了一些在各方面与 Chrome 相当或更好的浏览器。闲话少说,以下是我挑选的五款比 Chrome 本身更好的类似 Chrome 的浏览器: + + * UnGoogled Chromium + * Brave + * Edge + * Vivaldi + * Opera + +这份名单没有排名顺序。 + +### 1、UnGoogled Chromium + +![][13] + +特点: + + * 移除针对谷歌域名的功能 + * 在运行时阻止对 Google 的内部请求 + * 从源代码中剥离谷歌的二进制文件 + * 许多新的命令行开关和 `chrome://flags` 条目 + * 强制所有弹出式窗口为标签 + +对于那些隐私爱好者来说,[UnGoogled Chromium][4] 浏览器将是一个天赐良机。虽然它可能看起来与 Chrome 相同,但它有许多隐私方面的调整。 + +顾名思义,对于 Chrome 浏览器的用户来说,最大的倒退将是没有谷歌的服务集成。但这也意味着不再有对谷歌的内部请求、谷歌网址跟踪等等。 + +它没有吹嘘任何非凡的东西来保护你的隐私,但它应该比谷歌浏览器更好。 + +你也可以选择通过 `chrome://flags` 设置来探索和切换隐私设置。 + +总而言之,UnGoogled Chromium 提供了一种熟悉的浏览体验,同时还加入了一套隐私功能。它是可靠的,而且还与 Chrome 扩展程序庞大的生态系统兼容。 + +### 2、Brave + +![][14] + +特点: + + * 内置广告拦截器 + * 更快的页面加载时间 + * Brave 奖励计划 + * 能够在设备之间进行同步 + * 支持 Chrome Web 商店 + +当 [Brave][6] 在 2016 年首次登上舞台时,世界各地的人们都震惊于它的隐私和性能特点。在发布时,这包括了一个内置的广告屏蔽器和一个新的用户界面。 + +从那时起,该浏览器有了更多的功能,包括奖励计划和 [Tor][5] 整合。这使得它成为增长最快的浏览器之一。 + +### 3、Edge + +![][15] + +特点: + + * 支持 Chrome Web 商店 + * 儿童浏览模式(额外的保护和更简单的用户界面) + * 良好的 PDF 编辑工具 + * 内置优惠券搜索器 + * 阅读模式 + * 内置密码生成器 + +当微软 [Edge][7] 在 2015 年首次与 Windows 10 一起发布时,它因缓慢和有缺陷而被广泛批评。然而,在 2020 年初,它使用 Chromium Web 引擎完全重新制作了。 + +这也是 Chrome 浏览器所基于的引擎,这提供了现代和快速的浏览体验。这种转变的一个好处是 Web 浏览器能够在许多不同的平台上运行,从 Windows 7 和 macOS 到 Ubuntu 和其他基于 Linux 的发行版。 + +我知道,如果你因为某些原因讨厌微软,这可能不会吸引你 —— 但 Linux 版的微软 Edge 是谷歌 Chrome 浏览器的一个重要替代品。 + +### 4、Vivaldi + +![][16] + +特点: + + * 内置翻译器 + * Vivaldi Email(Beta) + * Feed 阅读器(Beta) + * Vivaldi 日历(Beta) + * 可高度定制的用户界面 + * 内置广告拦截器 + * 支持 Chrome Web 商店 + * 标签分组 + * 分屏标签 + +[Vivaldi][11] 于 2016 年首次发布,它在浏览器大战中迅速崛起。它最初是为对 [Presto][8] [布局引擎][9] 过渡不满的 Opera 用户设计的,它已经成功地重新实现了 Opera 过渡到 Chromium 期间失去的许多功能。 + +令人惊讶的是,它在基于 Chromium 的情况下还能做到这一点(正是 Opera 放弃这些功能的原因)。 + +最新的 [Vivaldi 4.0 版本][10] 也为高级用户提供了一些功能。 + +虽然它不是 100% 的自由软件,但其 93% 的源代码是可用的,只有用户界面是专有的。考虑到 Vivaldi 的开发团队积极关注着 Linux 用户的改进,Vivaldi 提供了大量的功能,这可能是一个值得权衡的结果。 + +### 5、Opera + +![][17] + +特点: + + * 内置虚拟专用网络 + * 轻松访问社交媒体 + * 内置加密货币钱包 + * 欺诈和恶意软件保护 + * 高度可见的网站安全徽章 + +虽然 [Opera][12] 从未成为 Web 浏览器之王,但它一直存在于关于使用何种浏览器的争论中。它最初是基于其内部的 Presto 布局引擎的,在 2013 年切换到 Chromium。 + +不幸的是,这一转换意味着 Opera 团队被迫放弃了其最知名的一些功能,为 Vivaldi 和 Firefox 等替代品填补 Opera 留下的空间铺平道路。 + +这并不是说 Opera 缺乏功能,它包含了许多功能。 + +### 总结 + +在这里,我们列出了为 Linux 桌面平台上用户量身定做的浏览器。 + +无论你是想要更多的功能、更好的用户界面,还是想要帮助你摆脱谷歌的束缚,都有一个选择适合你。 + +由于所有这些浏览器都是基于 Chromium 的,它们都能像 Chrome 一样提供良好的兼容性和用户体验。因此,请切换到这些类似 Chrome 的浏览器中,享受它们各自赋予的自由吧。 + +2021 年,你最喜欢的 Linux 上谷歌浏览器的替代品是什么?请在下面的评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/chrome-like-browsers-2021/ + +作者:[Jacob Crume][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/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://news.itsfoss.com/save-privacy-with-foss/ +[2]: https://itsfoss.com/open-source-browsers-linux/ +[4]: https://github.com/Eloston/ungoogled-chromium +[5]: https://itsfoss.com/tor-guide/ +[6]: https://brave.com +[7]: https://www.microsoftedgeinsider.com/en-us/download +[8]: https://en.wikipedia.org/wiki/Presto_(browser_engine) +[9]: https://en.wikipedia.org/wiki/Browser_engine +[10]: https://news.itsfoss.com/vivaldi-4-0-release/ +[11]: https://vivaldi.com +[12]: https://www.opera.com +[13]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/05/ungoogled-chromium-screenshot.png?w=1366&ssl=1 +[14]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/brave-homepage.png?w=1366&ssl=1 +[15]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/edge-homepage.png?w=1366&ssl=1 +[16]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/vivaldi-4.0-homepage.png?w=1366&ssl=1 +[17]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/06/opera-homepage.png?w=1366&ssl=1 \ No newline at end of file From f68e780dc0ce985feaa6bf4ef5ef7154cee5abd1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 7 Oct 2021 13:20:05 +0800 Subject: [PATCH 0632/1588] PUB @wxy https://linux.cn/article-13858-1.html --- ...ike Browsers That Are Better Than Google Chrome in 2021.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md (99%) diff --git a/translated/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md b/published/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md similarity index 99% rename from translated/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md rename to published/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md index dfb9fc76b1..ea7ebdd97e 100644 --- a/translated/tech/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md +++ b/published/20210616 Top 5 Chrome-like Browsers That Are Better Than Google Chrome in 2021.md @@ -4,8 +4,8 @@ [#]: collector: (lujun9972) [#]: translator: (wxy) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13858-1.html) Linux 上 5 个基于 Chromium 的浏览器 ====== From ed5ff0b20ae2d5438b183de39688b92dadb6cece Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 8 Oct 2021 05:02:29 +0800 Subject: [PATCH 0633/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211008?= =?UTF-8?q?=20How=20to=20Install=20Vivaldi=20Browser=20on=20Ubuntu=20and?= =?UTF-8?q?=20Other=20Linux=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md --- ...on Ubuntu and Other Linux Distributions.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md b/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..a58f299afa --- /dev/null +++ b/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,161 @@ +[#]: subject: "How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions" +[#]: via: "https://itsfoss.com/install-vivaldi-ubuntu-linux/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions +====== + +_**Brief: Learn how to install Vivaldi web browser on Ubuntu, Debian and several other Linux distributions in this beginner’s tutorial. You’ll also learn about updating it and removing it.**_ + +[Vivaldi][1] is an increasingly popular web browser. It is based on Chromium, so you have Chrome like features, but it adds several other features to give a different, intuitive interface. + +It comes with tab grouping, ad blocker, mouse gestures, notes manager and even allows adding macros. You could even use split viewing to view multiple pages at once. It also respects your privacy, unlike Chrome. + +![Tab tiling for split viewing multiple websites at once][2] + +You can understand the popularity of this browser from the fact that [Manjaro Linux recently replaced Firefox with Vivaldi as the default browser][3] in some of its variants. + +If you want to try it, let me show how to install Vivaldi on Linux. You’ll learn: + + * GUI and command line methods for installing Vivaldi + * Tips on updating Vivaldi to the newest version + * Steps for removing Vivaldi from Ubuntu + + + +Non-FOSS alert! + +Vivaldi is not complete open source software. It’s UI is closed source. It’s been covered here because Vivaldi team took effort in making its software available on Linux. + +### Installing Vivaldi on Ubuntu [GUI Method] + +The good thing is that Vivaldi provides pre-built binaries in DEB form for Ubuntu/Debian based distros and in RPM form for Fedora, Red Hat and SUSE. + +It is available for both 32 bit and 64-bit platforms, as well as [ARM devices like Raspberry Pi][4]. + +![Vivaldi provides installer for several types of Linux distributions][5] + +The installation process is really simple. You go to the Vivaldi web page and download the appropriate installer file and then double click on it to install it. That’s it. + +I’ll show the steps in detail for Ubuntu/Debian. You can use similar steps for other distributions. + +#### Step 1: Download Vivaldi + +Go to the Vivaldi’s download page and download the DEB file for Ubuntu. + +[Download Vivaldi][6] + +![Download DEB file for Ubuntu/Debian][7] + +#### Step 2: Install the downloaded DEB file + +Go to the Downloads folder where you have the deb file downloaded. [Installing deb file][8] is easy. Either just double-click on it or right click to open it with software center. + +![Right click on the downloaded deb file and open it with Software Install][9] + +It will open the software center application and here, you can see the option to install Vivaldi. Just hit the Install button. + +![Hit the Install button][10] + +You’ll be asked to enter your system’s account password. Enter that and you should have it installed in a few seconds. You’ll see that Install option changes to remove. This is an indication that Vivaldi is now installed. + +#### Step 3: Using Vivaldi + +Open the system menu by pressing the super (Windows) key and searching for Vivaldi. Click on the Vivaldi icon. + +![Search for Vivaldi in the system menu][11] + +You’ll see a screen like this on the first run. + +![Vivaldi running in Ubuntu][12] + +Now that you know the this method, let me quickly show how to install Vivaldi on Ubuntu and Debian from the terminal. + +### Method 2: Installing Vivaldi on Ubuntu and Debian from the command line + +Open a terminal and make sure that you have wget installed for [downloading files in the command line.][13] + +``` +sudo apt install wget +``` + +Next, get the public key of the Vivaldi repository and add it to your system so that your system trusts the packages coming from it. If interested, read [this article about adding external repository in Ubuntu][14]. + +``` +wget -qO- https://repo.vivaldi.com/archive/linux_signing_key.pub | sudo apt-key add - +``` + +Once the key has been added, add Vivaldi repository as well: + +``` +sudo add-apt-repository 'deb https://repo.vivaldi.com/archive/deb/ stable main' +``` + +Now you are almost set. Update the package cache and install it. + +``` +sudo apt update && sudo apt install vivaldi-stable +``` + +And that’s it. Search for it in the menu and start it from there. + +### Updating Vivaldi on Ubuntu + +Both GUI and command line methods add the Vivaldi repository to your system. This means that whenever there is a new Vivaldi release, you get it along with the system updates. + +![Vivaldi repo is added to the system][15] + +Basically, you update the Ubuntu system and it updates the Vivaldi browser if there is a new version available. + +![Vivaldi browser is updated with the system updates][16] + +### Removing Vivaldi from Ubuntu + +If you do not like Vivaldi or no longer want to use it, you can surely remove it. Now, to [uninstall applications from Ubuntu][17], you may use Software Center but it won’t find the external, third-party installed software. + +You’ll have to use the terminal now even though you used GUI method to install it. That’s really easy. Open a terminal and use the command below: + +``` +sudo apt remove vivaldi-stable +``` + +Sudo gives you [root access in Ubuntu][18]. You’ll have to enter your account’s password. While entering the password, nothing is seen on the screen. That’s normal. Enter the password blindly and it will be removed. + +I hope you find this tutorial helpful in installing and using Vivaldi on Linux. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-vivaldi-ubuntu-linux/ + +作者:[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://vivaldi.com/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/tab-tiling.webp?resize=800%2C448&ssl=1 +[3]: https://news.itsfoss.com/vivaldi-replaces-firefox-manjaro/ +[4]: https://itsfoss.com/raspberry-pi-alternatives/ +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/downloading-vivaldi-linux.webp?resize=800%2C541&ssl=1 +[6]: https://vivaldi.com/download/ +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/vivaldi-download-linux.webp?resize=800%2C438&ssl=1 +[8]: https://itsfoss.com/install-deb-files-ubuntu/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/installing-vivaldi-ubuntu.webp?resize=800%2C466&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/install-vivaldi-ubuntu-software.png?resize=800%2C407&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/running-vivaldi-in-ubuntu.png?resize=703%2C229&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Vivaldi-in-Ubuntu.webp?resize=800%2C450&ssl=1 +[13]: https://itsfoss.com/download-files-from-linux-terminal/ +[14]: https://itsfoss.com/adding-external-repositories-ubuntu/ +[15]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/Vivaldi-repo-ubuntu.png?resize=800%2C403&ssl=1 +[16]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/06/chrome-edge-update-ubuntu.png?resize=716%2C421&ssl=1 +[17]: https://itsfoss.com/uninstall-programs-ubuntu/ +[18]: https://itsfoss.com/root-user-ubuntu/ From 774efa5311bd59521b95e146c58d40f43619a825 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 8 Oct 2021 05:03:49 +0800 Subject: [PATCH 0634/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211007?= =?UTF-8?q?=20Rotate=20and=20archive=20logs=20with=20the=20Linux=20logrota?= =?UTF-8?q?te=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md --- ...e logs with the Linux logrotate command.md | 228 ++++++++++++++++++ 1 file changed, 228 insertions(+) create mode 100644 sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md diff --git a/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md b/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md new file mode 100644 index 0000000000..007e41cd22 --- /dev/null +++ b/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md @@ -0,0 +1,228 @@ +[#]: subject: "Rotate and archive logs with the Linux logrotate command" +[#]: via: "https://opensource.com/article/21/10/linux-logrotate" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Rotate and archive logs with the Linux logrotate command +====== +Keep log files fresh with this Linux command. Download the new logrotate +cheat sheet. +![Logs stacked up and to the right in front of a green tree forest][1] + +Logs are great for finding out what an application is doing or troubleshooting a possible problem. Almost every application we deal with generates logs, and we want the applications we develop ourselves to generate them too. The more verbose the logs, the more information we have. But left to themselves, logs can grow to an unmanageable size, and they can, in turn, become a problem of their own. So it's a good idea to keep them trimmed down, keep the ones we're going to need, and archive the rest. + +### Basics + +The `logrotate` utility is excellent at managing logs. It can rotate them, compress them, email them, delete them, archive them, and start fresh ones when you need them. + +Running `logrotate` is pretty simple—just run `logrotate -vs state-file config-file`. In the above command, the `v` option enables verbose mode, `s` specifies a state file, and the final `config-file` mentions the configuration file, where you specify what you need done. + +### Hands-on + +Let's check out a `logrotate` configuration that is running silently on our system, managing the wealth of logs we find in the `/var/log` directory. Check out the current files in that directory. Do you see a lot of `*.[number].gz` files? That’s what `logrotate` is doing. You can find the configuration file for this under `/etc/logrotate.d/rsyslog`. Mine looks like this: + + +``` +/var/log/syslog +{ +        rotate 7 +        daily +        missingok +        notifempty +        delaycompress +        compress +        postrotate +                reload rsyslog >/dev/null 2>&1 || true +        endscript +} + +/var/log/mail.info +/var/log/mail.warn +/var/log/mail.err +/var/log/mail.log +/var/log/daemon.log +/var/log/kern.log +/var/log/auth.log +/var/log/user.log +/var/log/lpr.log +/var/log/cron.log +/var/log/debug +/var/log/messages + +{ +        rotate 4 +        weekly +        missingok +        notifempty +        compress +        delaycompress +        sharedscripts +        postrotate +                reload rsyslog >/dev/null 2>&1 || true +        endscript +} +``` + +The file starts with defining the instructions for rotating the `/var/log/syslog` file and the instructions are contained within the curly braces that follow. Here’s what they mean: + + * `rotate 7`: Keep logs from the last seven rotations. Then start deleting them. + * `daily`: Rotate the log daily. Along with `rotate 7`, this would mean that logs would be kept for the last seven days. Other options are `weekly`, `monthly`, `yearly`. There is also a `size` parameter that will rotate log files if their size increases beyond a specified limit—for example, `size 10k`, `size 10M`, `size 10G`, etc. If nothing is specified, logs will be rotated whenever `logrotate` runs. You can even run `logrotate` in a `cron` to use it at more specific time intervals. + * `missingok`: It’s okay if the log file is missing. Don’t Panic. + * `notifempty`: Don’t rotate if the log file is empty. + * `delaycompress`: If compression is on, delay compression until the next rotation. This allows at least one rotated but uncompressed file to be present. Useful if you want yesterday’s logs to stay uncompressed for troubleshooting. It is also helpful if some program might still write to the old file until it is restarted/reloaded, like Apache. + * `compress`: Compression is on. Use `nocompress` to turn it off. + * `postrotate/endscript`: Run the script within this section after rotation. Helpful in doing cleanup stuff. There is also a `prerotate/endscript` for doing things before rotation begins. + + + +Can you figure out what the next section does for all those files mentioned in the configuration above? The only additional parameter in the second section is `sharedscripts`, which tells `logrotate` to not run the section within `postrotate/endscript` until all log rotation is complete. It prevents the script from being executed for every log rotated and runs once at the end. + +### Something New + +I’m using the following configuration for dealing with Nginx access and error logs on my system. + + +``` +/var/log/nginx/access.log +/var/log/nginx/error.log  { +        size 1 +        missingok +        notifempty +        create 544 www-data adm +        rotate 30 +        compress +        delaycompress +        dateext +        dateformat -%Y-%m-%d-%s +        sharedscripts +        extension .log +        postrotate +                service nginx reload +        endscript +} +``` + +The above script can be run using: + + +``` +logrotate -vs state-file /tmp/logrotate +``` + +Running the command for the first time gives this output: + + +``` +reading config file /tmp/logrotate +extension is now .log + +Handling 1 logs + +rotating pattern: /var/log/nginx/access.log +/var/log/nginx/error.log   1 bytes (30 rotations) +empty log files are not rotated, old logs are removed +considering log /var/log/nginx/access.log +  log needs rotating +considering log /var/log/nginx/error.log +  log does not need rotating +rotating log /var/log/nginx/access.log, log->rotateCount is 30 +Converted ' -%Y-%m-%d-%s' -> '-%Y-%m-%d-%s' +dateext suffix '-2021-08-27-1485508250' +glob pattern '-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' +glob finding logs to compress failed +glob finding old rotated logs failed +renaming /var/log/nginx/access.log to /var/log/nginx/access-2021-08-27-1485508250.log +creating new /var/log/nginx/access.log mode = 0544 uid = 33 gid = 4 +running postrotate script +* Reloading nginx configuration nginx +``` + +And running it a second time: + + +``` +reading config file /tmp/logrotate +extension is now .log + +Handling 1 logs + +rotating pattern: /var/log/nginx/access.log +/var/log/nginx/error.log   1 bytes (30 rotations) +empty log files are not rotated, old logs are removed +considering log /var/log/nginx/access.log +  log needs rotating +considering log /var/log/nginx/error.log +  log does not need rotating +rotating log /var/log/nginx/access.log, log->rotateCount is 30 +Converted ' -%Y-%m-%d-%s' -> '-%Y-%m-%d-%s' +dateext suffix '-2021-08-27-1485508280' +glob pattern '-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' +compressing log with: /bin/gzip +renaming /var/log/nginx/access.log to /var/log/nginx/access-2021-08-27-1485508280.log +creating new /var/log/nginx/access.log mode = 0544 uid = 33 gid = 4 +running postrotate script +* Reloading nginx configuration nginx +``` + +And running it a third time: + + +``` +reading config file /tmp/logrotate +extension is now .log + +Handling 1 logs + +rotating pattern: /var/log/nginx/access.log +/var/log/nginx/error.log   1 bytes (30 rotations) +empty log files are not rotated, old logs are removed +considering log /var/log/nginx/access.log +  log needs rotating +considering log /var/log/nginx/error.log +  log does not need rotating +rotating log /var/log/nginx/access.log, log->rotateCount is 30 +Converted ' -%Y-%m-%d-%s' -> '-%Y-%m-%d-%s' +dateext suffix '-2021-08-27-1485508316' +glob pattern '-[0-9][0-9][0-9][0-9]-[0-9][0-9]-[0-9][0-9]-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]' +compressing log with: /bin/gzip +renaming /var/log/nginx/access.log to /var/log/nginx/access-2021-08-27-1485508316.log +creating new /var/log/nginx/access.log mode = 0544 uid = 33 gid = 4 +running postrotate script +* Reloading nginx configuration nginx +``` + +The contents of the state file look like this: + + +``` +logrotate state -- version 2 +"/var/log/nginx/error.log" 2021-08-27-9:0:0 +"/var/log/nginx/access.log" 2021-08-27-9:11:56 +``` + +[**Download the Linux logrotate cheat sheet.**][2] + +* * * + +_This article was originally published on the [author's personal blog][3] and has been adapted with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-logrotate + +作者:[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/oliver-paaske-unsplash.jpg?itok=bv0sZSSB (Logs stacked up and to the right in front of a green tree forest) +[2]: https://opensource.com/downloads/logrotate-cheat-sheet +[3]: https://notes.ayushsharma.in/2017/01/fiddling-with-logrotate From 391d4f1ac8d38e79470071d6cdba454a7755b33b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 8 Oct 2021 05:04:07 +0800 Subject: [PATCH 0635/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211007?= =?UTF-8?q?=203=20phases=20to=20start=20a=20DevSecOps=20transformation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211007 3 phases to start a DevSecOps transformation.md --- ...ses to start a DevSecOps transformation.md | 115 ++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 sources/tech/20211007 3 phases to start a DevSecOps transformation.md diff --git a/sources/tech/20211007 3 phases to start a DevSecOps transformation.md b/sources/tech/20211007 3 phases to start a DevSecOps transformation.md new file mode 100644 index 0000000000..3c671d4a86 --- /dev/null +++ b/sources/tech/20211007 3 phases to start a DevSecOps transformation.md @@ -0,0 +1,115 @@ +[#]: subject: "3 phases to start a DevSecOps transformation" +[#]: via: "https://opensource.com/article/21/10/first-phases-devsecops-transformation" +[#]: author: "Will Kelly https://opensource.com/users/willkelly" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 phases to start a DevSecOps transformation +====== +Taking the right steps at the right time smooths the path toward full +adoption. +![Green graph of measurements][1] + +DevSecOps is another step in the DevOps journey for your organization. Breaking down your transformation into phases facilitates working directly with developers and other team members. A phased approach also allows you to get feedback from those affected by the change and iterate as necessary. + +Here are the first three phases of a DevSecOps transformation: + +### Phase 1: analysis, education, and training + +In phase 1, you do the preliminary work necessary to make DevSecOps the next step in your DevOps journey. + +This phase is even more critical for your teams if you're moving from a waterfall software development lifecycle (SDLC) model. Making that leap may require you to put more time and effort into DevOps training to bridge any knowledge gaps between your current processes and DevSecOps. + +#### Analyze your development process maturity + +Whether DevSecOps is just the next step in your DevSecOps journey or you're making your initial foray into DevSecOps straight from a waterfall SDLC, analyzing the [maturity of your software development process][2] is a critical step. An effective analysis includes: + + * Documenting the current state of any processes + * Gathering any reporting data about your current development processes + * Identifying what's working and not working in your development processes by interviewing key developers + + + +#### Define DevSecOps for your organization + +DevOps and now DevSecOps can mean many things to people. Software vendor marketing and the open source software (OSS) community each put their spin on the definition of DevSecOps. Spare your teams from any misunderstandings and document your definition of DevSecOps. A clear definition includes: + + * What DevSecOps means to your organization + * The expected outcomes after moving to DevSecOps + * The tools and processes your organization is putting into place to ensure employee success + + + +Writing a definition is not merely creating a project charter for your DevOps to DevSecOps transformation; it identifies your true north. + +#### Foster a DevSecOps culture + +You can't _buy_ DevSecOps. Your managers and key technology team members need to work together to foster DevSecOps cultural philosophies to set a foundation for your DevOps to DevSecOps transformation. + +Here are some vital elements of DevSecOps culture that are important to foster during and after your transformation: + +##### Continuous feedback + +Remote DevSecOps teams have their advantages and disadvantages with continuous feedback. The manager's role is not simply to deliver feedback on the DevSecOps team's performance. Instead, the purpose of feedback is to enable teams to collaborate more effectively. [Open source chat tools][3] provide the instant communication necessary for DevSecOps teams to collaborate in real time. + +##### Container-based architectures + +DevSecOps sets the stage for moving to container-based architectures that can be another cultural change for DevOps teams. A proper and robust implementation of containers changes developer and operations cultures because it changes how architects design solutions, programmers create code, and operations teams maintain production applications. + +##### Team autonomy + +DevSecOps is no place for micromanagers at any level of your organization. A standard part of DevSecOps culture is enabling your teams to choose their tools and create processes based on their work. DevSecOps also promotes distributed decision making that supports greater agility and innovation. + +##### DevSecOps training + +Providing security training to your developers is another step towards making security part of everyone's job. Training could take the form of in-house developer training in casual formats such as lunch-and-learns, or it could include more formal training classes conducted by your organization's training department. + +Depending on your security ambitions (and budget), there is always the option to send your DevOps team members to get a DevSecOps vendor certification, such as the DevSecOps Foundation certification from the [DevOps Institute][4] or the Certified DevSecOps Professional (CDP) from [Practical DevSecOps][5]. + +### Phase 2: integrate security into your DevOps lifecycle + +During phase 2 of your DevOps to DevSecOps transformation, you integrate security processes and tools into your DevOps life cycle. If your enterprise is already using DevOps toolchains, this phase integrates security tools into your existing DevOps toolchains. This phase is also the time to perform a security audit on your continuous integration and continuous delivery/deployment (CI/CD) toolchains to ensure security. + +Suppose your organization takes the fast track to DevSecOps from a waterfall SDLC or other legacy development process. In that case, security needs to become a requirement of your CI/CD toolchain build. + +### Phase 3: introduce automation into your DevOps lifecycle + +The automation phase includes analysis, outreach, and experimentation. Applying automation to everyday software development tasks such as quality assurance and security checks isn't an exact science. Expect a push and pull between your executives and development teams. Executives often want to automate as much as possible, even to the extreme. Developers and sysadmins are going to approach automation more cautiously. + +Automation is foundational to DevSecOps because it removes the prospect of human error from some everyday build tasks and security checks. If you're building and running cloud workloads, you need automation. + +How well the automation tools are implemented determines how effectively you can enforce security practices and facilitate security sign-offs. + +Here are some tips for introducing automation into your DevOps toolchain: + + * Dispel the notion in your management and stakeholders that you'll be able to automate every task along with your toolchain. Engage with your stakeholders to learn their automation priorities and take that feedback into an automation strategy for your DevOps teams. + * Engage with your development teams — not just the team leads and managers — about how automation can help them perform their jobs. Listen to their concerns with empathy and answer their questions with definitive answers. + * Create an automation roadmap that charts how you'll introduce automation into your toolchains. Start small and expand with automation across your toolchains. Seek a small project such as a patch or a feature update to test your implementation plan. + * Automate one build, quality assurance, or security check for one of your DevOps teams as a proof-of-concept project. Document your findings from this small project, especially the lessons learned and any other feedback from the DevOps team members working on the project. + * Communicate the successes, lessons learned, and, yes, even the mistakes made on the pilot project to your stakeholders and internal DevOps community. + + + +You can use your existing DevOps center of excellence or DevSecOps center of excellence as an opportunity to gather input from employees from across your organization about how automation affects their work. Otherwise, look for formal and informal channels in your development and operations organizations to gain the input. For example, informal lunch and learns, group chat channels, or team meetings can be ideal for gathering input depending on your corporate culture. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/first-phases-devsecops-transformation + +作者:[Will Kelly][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/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/metrics_lead-steps-measure.png?itok=DG7rFZPk (Green graph of measurements) +[2]: https://opensource.com/article/21/10/devsecops-maturity-model +[3]: https://opensource.com/article/20/4/open-source-chat +[4]: https://www.devopsinstitute.com/ +[5]: http://practical-devsecops.com/ From b98a107bdf0416544fca9ae4306f533334d28f36 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 8 Oct 2021 08:51:08 +0800 Subject: [PATCH 0636/1588] translated --- ... your Linux distribution-s repositories.md | 123 ------------------ ... your Linux distribution-s repositories.md | 122 +++++++++++++++++ 2 files changed, 122 insertions(+), 123 deletions(-) delete mode 100644 sources/tech/20210927 Install Java from your Linux distribution-s repositories.md create mode 100644 translated/tech/20210927 Install Java from your Linux distribution-s repositories.md diff --git a/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md b/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md deleted file mode 100644 index 2a763b96f2..0000000000 --- a/sources/tech/20210927 Install Java from your Linux distribution-s repositories.md +++ /dev/null @@ -1,123 +0,0 @@ -[#]: subject: "Install Java from your Linux distribution's repositories" -[#]: via: "https://opensource.com/article/21/9/install-java-linux-repositories" -[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Install Java from your Linux distribution's repositories -====== -Regardless of which distribution and package manager you prefer, it is -easy to get Java on your Linux system. -![Coffee beans and a cup of coffee][1] - -There are a number of different ways to install Java on your Linux desktop. An obvious route is to use the packages provided in your Linux distribution. Note that this doesn’t work for everyone; for example, some users may need a very specific version of Java. - -Before you can start, you must determine “which Java” you need. Do you just need to run some `.class` files or a `.jar` file? Or are you writing some code that you need to compile? - -In my case, most of the Java I run is Java that I have (at least partly) written myself, so it always makes sense to install the full Java Development Kit, or JDK, which comes with a Java compiler, libraries, and some really useful utilities. And of course, hereabouts, we give preference to the open source JDK, called [OpenJDK][2]. - -Since I primarily work on the Ubuntu Linux distribution, my package manager is `apt`. I can use `apt` to find out which OpenJDK packages are available: - - -``` -`apt list OpenJDK\*` -``` - -The output of this command looks like: - - -``` -Listing... Done -openjdk-11-dbg/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 -openjdk-11-dbg/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 -openjdk-11-demo/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 -openjdk-11-demo/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 -openjdk-11-doc/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 11.0.11+9-0ubuntu2 all -openjdk-11-jdk-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 -openjdk-11-jdk-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 -openjdk-11-jdk/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 -openjdk-11-jdk/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 -openjdk-11-jre-dcevm/hirsute 11.0.10+1-1 amd64 -openjdk-11-jre-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 -openjdk-11-jre-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 -openjdk-11-jre-zero/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 -openjdk-11-jre-zero/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 -openjdk-11-jre/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 -openjdk-11-jre/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 -openjdk-11-source/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 11.0.11+9-0ubuntu2 all -openjdk-15-dbg/hirsute 15.0.3+3-1 amd64 -openjdk-15-dbg/hirsute 15.0.3+3-1 i386 -openjdk-15-demo/hirsute 15.0.3+3-1 amd64 -... -openjdk-8-jre/hirsute-updates,hirsute-security 8u292-b10-0ubuntu1 i386 -openjdk-8-source/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 8u292-b10-0ubuntu1 all -``` - -I have elided quite a few lines above with `...`. - -It turns out that, even though I’m limiting myself to the OpenJDK, I still have plenty of options for: - - * The architecture (in my case, whether i386 or amd64). - * The version of Java (in my case, whether 8, 11, 15, 16, 17). - * The pure OpenJDK or the headless version. - * The Java Runtime Environment or JRE. - * Options for debugging, demo, source code, etc. - - - -Again, in my case, primarily, I’m just interested in the pure vanilla OpenJDK. - -Supposing then I want to install the Java 11 version of the plain vanilla OpenJDK for my amd64 architecture, I can type: - - -``` -`sudo apt install -a=amd64 openjdk-11-jdk` -``` - -A few minutes later, I’ll be able to compile, run, debug, and package my Java code. - -Note that it’s quite possible, and sometimes even desirable, to have multiple versions of Java installed simultaneously. In the case of Ubuntu, there is a useful utility called `update-java-alternatives` that [displays and configures which java environment][3] to use at any point in time. - -Those of you using a different Linux distro can, in general, take a similar approach. Several other distros (such as Debian and Mint) also use `apt`, though the available packages may differ. Other distros use different package managers. For example, [the Fedora documentation page for Installing Java][4] shows how to use the Fedora `dnf` package manager to handle the installation. First, to show the available version, type: - - -``` -`dnf search openjdk` -``` - -Next, to install the full development x86_64 architecture version, type: - - -``` -`sudo dnf install java-11-openjdk-devel.x86_64` -``` - -Similarly, Fedora provides the `alternatives` utility to [display and configure the Java environment][5]. - -For another example, the [wonderful Arch Linux wiki][6] shows the corresponding package is `jdk11-openjdk`**.** The wiki also explains many other important details related to using Java in Arch, such as using the `archlinux-java` utility to show what Java environments are installed or select a different default environment. Arch uses a package manager called `pacman`, which is also documented [here on the Arch Linux wiki][7]. - -Regardless of which distribution and package manager you prefer, it is easy to get Java on your Linux system. Consider version and function, of course, before installing. Also keep in mind that there are options for managing two or more Java versions on the same computer. Most of my examples used `apt`, but keep in mind the `dnf` options, too. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/install-java-linux-repositories - -作者:[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/java-coffee-mug.jpg?itok=Bj6rQo8r (Coffee beans and a cup of coffee) -[2]: https://openjdk.java.net/ -[3]: http://manpages.ubuntu.com/manpages/hirsute/man8/update-java-alternatives.8.html -[4]: https://docs.fedoraproject.org/en-US/quick-docs/installing-java/ -[5]: https://tecadmin.net/install-java-on-fedora/ -[6]: https://wiki.archlinux.org/title/java#OpenJDK -[7]: https://wiki.archlinux.org/title/pacman#Querying_package_databases diff --git a/translated/tech/20210927 Install Java from your Linux distribution-s repositories.md b/translated/tech/20210927 Install Java from your Linux distribution-s repositories.md new file mode 100644 index 0000000000..c04dd813fd --- /dev/null +++ b/translated/tech/20210927 Install Java from your Linux distribution-s repositories.md @@ -0,0 +1,122 @@ +[#]: subject: "Install Java from your Linux distribution's repositories" +[#]: via: "https://opensource.com/article/21/9/install-java-linux-repositories" +[#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +从你的 Linux 发行版的仓库中安装 Java +====== +无论你喜欢哪个发行版和包管理器,都可以都很容易在您的 Linux 系统上安装 Java。 +![Coffee beans and a cup of coffee][1] + +有许多不同的方法可以把 Java 安装到你的 Linux 桌面上。一个明显的途径是使用你的 Linux 发行版中提供的软件包。请注意,这并不适合所有人。例如,有些用户可能需要一个非常具体的 Java 版本。 + +在你开始之前,你必须确定你需要“哪种 Java”。你是否只需要运行一些 `.class` 文件或 `.jar` 文件?还是你正在编写一些需要编译的代码? + +就我而言,我运行的大部分 Java 都是我自己(至少部分)编写的 Java,所以安装完整的 Java 开发工具包(或称 JDK)总是有意义的,它包含了 Java 编译器、库和一些非常有用的工具。当然,在这里,我们更倾向于使用开源的 JDK,称为 [OpenJDK][2]。 + +由于我主要在 Ubuntu Linux 发行版上工作,我的软件包管理器是 `apt`。我可以用 `apt` 来查找哪些 OpenJDK 包是可用的: + + +``` +`apt list OpenJDK\*` +``` + +这个命令的输出看起来像这样: + + +``` +Listing... Done +openjdk-11-dbg/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-dbg/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-demo/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-demo/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-doc/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 11.0.11+9-0ubuntu2 all +openjdk-11-jdk-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jdk-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-jdk/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jdk/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-jre-dcevm/hirsute 11.0.10+1-1 amd64 +openjdk-11-jre-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jre-headless/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-jre-zero/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jre-zero/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-jre/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 +openjdk-11-jre/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 i386 +openjdk-11-source/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 11.0.11+9-0ubuntu2 all +openjdk-15-dbg/hirsute 15.0.3+3-1 amd64 +openjdk-15-dbg/hirsute 15.0.3+3-1 i386 +openjdk-15-demo/hirsute 15.0.3+3-1 amd64 +... +openjdk-8-jre/hirsute-updates,hirsute-security 8u292-b10-0ubuntu1 i386 +openjdk-8-source/hirsute-updates,hirsute-updates,hirsute-security,hirsute-security 8u292-b10-0ubuntu1 all +``` + +我在上面用 `...` 省略了不少行。 + +事实证明,即使我把自己限制在 OpenJDK 中,我仍然有很多选择: + + * 架构(在我的例子中,是 i386 还是 amd64)。 + * Java 的版本(就我而言,是 8、11、15、16、17)。 + * 纯粹的 OpenJDK 或无头版本。 + * Java 运行时环境(或称 JRE)。 + * 调试、演示、源代码等选项。 + + + +同样,在我的案例中,我主要是对纯粹的 vanilla OpenJDK 感兴趣。 + +假设我想为我的 amd64 架构安装 Java 11 版本的纯 vanilla OpenJDK,我可以输入: + + +``` +`sudo apt install -a=amd64 openjdk-11-jdk` +``` + +几分钟后,我就可以编译、运行、调试和打包我的 Java 代码了。 + +注意,同时安装多个版本的 Java 是很有可能的,有时甚至是理想的。在 Ubuntu 中,有一个有用的工具,叫做 `update-java-alternatives`,它可以[显示和配置在任何时候使用哪个 Java 环境][3]。 + +那些使用不同 Linux 发行版的人,一般来说,可以采取类似的方法。其他几个发行版(如 Debian 和 Mint)也使用 `apt` ,尽管可用的软件包可能不同。其他发行版使用不同的软件包管理器。例如,[Fedora 安装 Java 的文档页面][4]显示了如何使用 Fedora `dnf` 包管理器来处理安装。首先,为了显示可用的版本,输入: + + +``` +`dnf search openjdk` +``` + +接下来,要安装完整的开发 x86_64 架构版本,请输入: + + +``` +`sudo dnf install java-11-openjdk-devel.x86_64` +``` + +同样地,Fedora 提供了 `alternatives` 工具来[显示和配置 Java 环境][5]。 + +再比如,[很棒的 Arch Linux wiki][6] 显示对应的软件包是 `jdk11-openjdk`。wiki 还解释了许多与在 Arch 中使用 Java 有关的其他重要细节,比如使用 `archlinux-java` 工具来显示安装了哪些 Java 环境或选择一个不同的默认环境。Arch 使用一个叫 `pacman` 的包管理器,它也有文档[在 Arch Linux wiki 上][7]。 + +不管你喜欢哪个发行版和软件包管理器,在你的 Linux 系统上获得 Java 是很容易的。当然,在安装之前,要考虑版本和功能。还要记住,在同一台电脑上有管理两个或多个 Java 版本的选项。我的大多数例子都使用了 `apt`,但也要记得 `dnf` 选项。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/install-java-linux-repositories + +作者:[Chris Hermansen][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/clhermansen +[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://openjdk.java.net/ +[3]: http://manpages.ubuntu.com/manpages/hirsute/man8/update-java-alternatives.8.html +[4]: https://docs.fedoraproject.org/en-US/quick-docs/installing-java/ +[5]: https://tecadmin.net/install-java-on-fedora/ +[6]: https://wiki.archlinux.org/title/java#OpenJDK +[7]: https://wiki.archlinux.org/title/pacman#Querying_package_databases From 72ac2032afe866d589bef697228365e746b301fc Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 8 Oct 2021 08:57:41 +0800 Subject: [PATCH 0637/1588] translated --- ...1001 -e- cloud is a deGoogled Alternative to Google Drive.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md b/sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md index 5d83613107..496e8212b5 100644 --- a/sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md +++ b/sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/e-cloud/" [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From aac331c1748d1b1b6bd3cfa9e346ffbca35ba0ea Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 8 Oct 2021 13:12:30 +0800 Subject: [PATCH 0638/1588] PUB @wxy https://linux.cn/article-13860-1.html --- ...11002 Monitor your Java on Linux with jconsole.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) rename {translated/tech => published}/20211002 Monitor your Java on Linux with jconsole.md (87%) diff --git a/translated/tech/20211002 Monitor your Java on Linux with jconsole.md b/published/20211002 Monitor your Java on Linux with jconsole.md similarity index 87% rename from translated/tech/20211002 Monitor your Java on Linux with jconsole.md rename to published/20211002 Monitor your Java on Linux with jconsole.md index d0a888fd40..737b990907 100644 --- a/translated/tech/20211002 Monitor your Java on Linux with jconsole.md +++ b/published/20211002 Monitor your Java on Linux with jconsole.md @@ -4,15 +4,15 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13860-1.html" 用 jconsole 在 Linux 上监控你的 Java ====== > 如何使用 Java 开发工具包中的 Java 监控和管理控制台。 -![拼图拼成的电脑屏幕][1] +![](https://img.linux.net.cn/data/attachment/album/202110/08/131129bf3h3gv18388fl11.jpg) Java 开发工具包(JDK)提供了开发 Java 应用程序的二进制文件、工具和编译器。其中一个有用的工具是 `jconsole`。 @@ -26,7 +26,7 @@ Java 开发工具包(JDK)提供了开发 Java 应用程序的二进制文件   JAVA: /usr/lib/jvm/java-11-openjdk-11.0.11.0.9-5.fc34.x86_64/bin/java ``` -现在,在另一个终端,我输入 `jconsole`。 +现在,在另一个终端,输入 `jconsole`。 ``` $ jconsole @@ -46,7 +46,7 @@ $ jconsole ### 内存 -“内存Memory”标签显示 JVM 所使用的内存的各个方面的图表。分配给 JVM 的服务器系统内存的数量被称为“Heap”。这个屏幕还提供了关于堆的内部组件使用情况的详细信息,例如 Eden Space、Old Gen 和 Survivor Space。你也可以手动请求一个垃圾收集动作。 +“内存Memory”标签显示 JVM 所使用的内存的各个方面的图表。分配给 JVM 的服务器系统内存量被称为“Heap”。这个屏幕还提供了关于堆的内部组件使用情况的详细信息,例如 “伊甸园Eden Space”、“老年代Old Gen” 和 “幸存者区Survivor Space”。你也可以手动请求一个垃圾收集动作。 ![jconsole 内存标签][5] @@ -78,7 +78,7 @@ $ jconsole ### 总结 -Java 已经存在了很长时间,它将继续为全球数百万的系统提供动力。有很多开发环境和监控系统可以使用,但在基本工具包中包含像 `jconsole` 这样的工具会非常有价值。 +Java 已经存在了很长时间,它将继续为全球数百万的系统提供动力。有很多开发环境和监控系统可以使用,但像 `jconsole` 这样的包含在基本工具包中的工具非常有价值。 -------------------------------------------------------------------------------- From d005f8de3ba8610761f8bf823c519ebfe1150f5f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 8 Oct 2021 14:15:58 +0800 Subject: [PATCH 0639/1588] APL --- .../20210809 NMState- A declarative networking config tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210809 NMState- A declarative networking config tool.md b/sources/tech/20210809 NMState- A declarative networking config tool.md index 21e95b6ea9..dd4caa0dff 100644 --- a/sources/tech/20210809 NMState- A declarative networking config tool.md +++ b/sources/tech/20210809 NMState- A declarative networking config tool.md @@ -2,7 +2,7 @@ [#]: via: "https://fedoramagazine.org/nmstate-a-declarative-networking-config-tool/" [#]: author: "Maurizio Garcia https://fedoramagazine.org/author/malgnuz/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 76f44fb915ac250033705ffe95ab49c31e369055 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 8 Oct 2021 14:55:24 +0800 Subject: [PATCH 0640/1588] TSL&PRF --- ...e- A declarative networking config tool.md | 108 ++++++++---------- 1 file changed, 49 insertions(+), 59 deletions(-) rename {sources => translated}/tech/20210809 NMState- A declarative networking config tool.md (69%) diff --git a/sources/tech/20210809 NMState- A declarative networking config tool.md b/translated/tech/20210809 NMState- A declarative networking config tool.md similarity index 69% rename from sources/tech/20210809 NMState- A declarative networking config tool.md rename to translated/tech/20210809 NMState- A declarative networking config tool.md index dd4caa0dff..1ea9af52c3 100644 --- a/sources/tech/20210809 NMState- A declarative networking config tool.md +++ b/translated/tech/20210809 NMState- A declarative networking config tool.md @@ -3,42 +3,40 @@ [#]: author: "Maurizio Garcia https://fedoramagazine.org/author/malgnuz/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -NMState: A declarative networking config tool +NMState:一个声明式网络配置工具 ====== ![][1] -Comic excerpted from photo by [Bee Felten-Leidel][2] on [Unsplash][3] +这篇文章描述并演示了 NMState,这是一个使用声明式方法配置主机的网络管理器。这意味着你可以通过 API 定义所需的配置状态,而工具则通过提供者provider来应用配置。 -This article describes and demonstrates NMState, a network manager that uses a declarative approach to configure hosts. This means you define the desired configuration state through an API and the tool applies the configuration through a provider. +### 配置方法:命令式与声明式 -### Configuration approaches: imperative vs declarative +网络管理有时候是一项非常复杂的任务,这取决于环境的规模和多样性。在 IT 的早期,网络管理依赖于网络管理员在网络设备上手动执行命令。如今,基础设施即代码Infrastructure as Code(IaC)允许以不同的方式将这些任务自动化。z这基本上有两种方法:命令式或声明式。 -Networking management can be a very complex task depending on the size and diversity of the environment. In the early days of IT, networking management relied on manual procedures performed by network administrators over networking devices. Nowadays, Infrastructure as Code (IaC) allows automation of those tasks in a different way. There are, essentially two approaches: imperative or declarative. +在命令式方法中,你会定义“如何”达到所需的配置状态。而在声明式范式里则定义了“什么”是所需的配置状态,所以它不确定哪些步骤是必需的,也不确定它们必须以何种顺序执行。这种方法目前正在聚集更多的人员参与,你可以在目前使用的大多数管理和编排工具上找到它。 -In an imperative approach you define “how” you will arrive at a desired configuration state. The declarative paradigm defines “what” is the desired configuration state, so it does not shape which steps are required nor in which order they must be performed. This approach is currently gathering more adepts and you can find it on most of the management and orchestration tools currently used. +### NMState:一个声明式的工具 -### NMState: a declarative tool +NMState 是一个网络管理器,允许你按照声明式方法配置主机。这意味着你通过一个北向的声明式 API 定义所需的配置状态,这个工具通过南向的提供者provider应用配置。 -NMState is a network manager that allows you to configure hosts following a declarative approach. It means you define the desired configuration state through a northbound declarative API and this tool applies the configuration through a southbound provider. +目前 NMState 支持的唯一的提供者是 NetworkManager,它是为 Fedora Linux 提供网络功能的主要服务。不过,NMState 的开发计划中将逐渐增加其他提供者。 -Currently the only provider supported by NMState is NetworkManager, which is the main service to address networking capabilities on Fedora Linux. However, the development life cycle of NMState will add other providers gradually. +关于 NMState 的进一步信息,请访问其项目 [站点][4] 或 GitHub [仓库][5]。 -For further information regarding NMState please visit either its project [site][4] or github [repository][5]. +### 安装 -### Installation - -NMState is available on Fedora Linux 29+ and requires NetworkManager 1.26 or later installed and running on the system. The following shows the installation on Fedora Linux 34: +NMState 在 Fedora Linux 29+ 上可用,需要在系统上安装并运行 NetworkManager 1.26 或更高版本。下面是在 Fedora Linux 34 上的安装情况: ``` $ sudo dnf -y install nmstate -… -output omitted -… +... +输出节略 +... Installed: NetworkManager-config-server-1:1.30.4-1.fc34.noarch gobject-introspection-1.68.0-3.fc34.x86_64 nispor-1.0.1-2.fc34.x86_64 nmstate-1.0.3-2.fc34.noarch python3-gobject-base-3.40.1-1.fc34.x86_64 python3-libnmstate-1.0.3-2.fc34.noarch python3-nispor-1.0.1-2.fc34.noarch python3-varlink-30.3.1-2.fc34.noarch @@ -46,18 +44,18 @@ Installed: Complete! ``` -At this point you can use _nmstatectl_ as a command line tool for NMState. Please refer to either _nmstatectl –help_ or _man nmstatectl_ for further information about this tool. +这样,你可以使用 `nmstatectl` 作为 NMState 的命令行工具。请参考 `nmstatectl -help` 或 `man nmstatectl` 以了解关于这个工具的进一步信息。 -### Using NMstate +### 使用 NMstate -Start by checking the NMState version installed in the system: +首先要检查系统中安装的 NMState 版本: ``` $ nmstatectl version 1.0.3 ``` -Check the current configuration of a networking interface, e.g. the _eth0_ configuration: +检查一个网络接口的当前配置,例如 `eth0` 的配置: ``` $ nmstatectl show eth0 @@ -124,29 +122,23 @@ interfaces: mtu: 1500 ``` - As you can see above the networking configuration shows four main sections: +正如你在上面看到的,这个网络配置显示了四个主要部分: - * **dns-resolver**: this section has the nameserver configuration for this interface. - * **route-rules**: it states the routing rules.  - * **routes**: it includes both dynamic and static routes. - * **Interfaces**: this section describes both ipv4 and ipv6 settings. + * `dns-resolver`:这部分是这个接口的名字服务器配置。 + * `route-rules`:它说明了路由规则。  + * `routes`:它包括动态和静态路由。 + * `interfaces`:这部分描述了 ipv4 和 ipv6 设置。 +### 修改配置 +你可以在两种模式下修改所需的配置状态: -### Modify the configuration + * 交互式:通过 `nmstatectl edit` 编辑接口配置。这个命令调用环境变量 `EDITOR` 定义的文本编辑器,因此可以用 yaml 格式编辑网络状态。完成编辑后,NMState 将应用新的网络配置,除非有语法错误。 + * 基于文件的:使用 `nmstatectl apply` 应用接口配置,它从先前创建的 yaml 或 json 文件中导入一个所需的配置状态。 -You can modify the desired configuration state in two modes:  +下面几节告诉你如何使用 NMState 来改变网络配置。这些改变可能会对系统造成破坏,所以建议在测试系统或客户虚拟机上执行这些任务,直到你对 NMState 有更好的理解。 - * **Interactive**: editing the interface configuration through _nmstatectl edit_. This command invokes the text editor defined by the environment variable EDITOR so the network state can be edited in yaml format. After finishing the edition NMState will apply the new network configuration unless there are syntax errors. - - - * **File-based**: applying the interface configuration using _nmstatectl apply_ which imports a desired configuration state from a yaml or json file earlier created. - - - -The following sections show you how to change the networking configuration using NMState. These changes can be disruptive to the system so the recommendation is to perform these tasks on a test system or guest VM till you get a better understanding of NMState. - -The test system in use herehas two Ethernet interfaces: _eth0_ and _eth1_: +这里使用的测试系统有两个以太网接口,`eth0` 和 `eth1`: ``` $ ip -br -4 a @@ -155,11 +147,9 @@ eth0 UP 192.168.122.238/24 eth1 UP 192.168.122.108/24 ``` -#### Example of interactive configuration mode: +#### 互动配置模式的例子 -``` -Change the MTU of eth0 interface to 9000 bytes using the nmstatectl edit command as follows (all changes are in bold): -``` +使用 `nmstatectl edit` 命令将 `eth0` 接口的 MTU 改为 9000 字节,如下所示: ``` $ sudo nmstatectl edit eth0 @@ -222,7 +212,7 @@ interfaces: mtu: 9000 ``` -After saving and exiting the edito, NMState applies the new network desired state: +在保存并退出编辑器后,NMState 应用新的网络期望状态: ``` 2021-06-29 11:29:05,726 root DEBUG Nmstate version: 1.0.3 @@ -232,7 +222,7 @@ After saving and exiting the edito, NMState applies the new network desired stat 2021-06-29 11:29:05,792 root DEBUG Async action: Update profile uuid:2bdee700-f62b-365a-bd1d-69d9c31a9f0c iface:eth0 type:ethernet finished ``` -Now, use both the _ip_ command and also the _eth0_ configuration file to check that the _MTU_ of _eth0_ is 9000 bytes. +现在,使用 `ip` 命令和 `eth0` 的配置文件来检查 `eth0` 的 `MTU` 是不是 9000 字节。 ``` $ ip link show eth0 @@ -273,11 +263,11 @@ ra-timeout=2147483647 [proxy] ``` -#### Example of file-based configuration mode: +#### 基于文件的配置模式的例子 -Let’s use the file-based approach to set a new config state. In this case disable the IPv6 configuration in _eth1_ interface. +让我们使用基于文件的方法来设置一个新的配置状态。这里我们禁用 `eth1` 接口的 IPv6 配置。 -First, create a yaml file to define the desired state of the _eth1_ interface. Use _nmstatectl show_ to save the current settings then _nmstatectl edit_ to disable IPv6. Again, all changes are in bold and deletions are shown with strike-through: +首先,创建一个 yaml 文件来定义 `eth1` 接口的期望状态。使用 `nmstatectl show` 来保存当前设置,然后使用 `nmstatectl edit` 来禁用 IPv6。 ``` $ nmstatectl show eth1 > eth1.yaml @@ -341,7 +331,7 @@ interfaces: mtu: 1500 ``` -After saving the new configuration, use it to apply the new state: +保存新的配置后,用它来应用新的状态: ``` $ sudo nmstatectl apply eth1.yaml @@ -402,7 +392,7 @@ interfaces: mtu: 1500 ``` -You can check that the _eth1_ interface does not have any IPv6 configured: +你可以检查看到 `eth1` 接口没有配置任何 IPv6: ``` $ ip -br a @@ -440,11 +430,11 @@ method=disabled [proxy] ``` -#### Applying changes temporarily +#### 临时应用改变 -An interesting feature of NMState allows you to configure a desired networking state temporarily. In case you are satisfied with the configuration you can commit it afterwards. Otherwise it will rollback when the timeout expires (default is 60 sec). +NMState 的一个有趣的功能允许你临时配置一个期望的网络状态。如果你对这个配置感到满意,你可以事后提交。否则,当超时(默认为 60 秒)过后,它将回滚。 -Modify the _eth1_ configuration from the previous example so it has an IPv4 static address instead of getting it dynamically by DHCP. +修改前面例子中的 `eth1` 配置,使它有一个 IPv4 静态地址,而不是通过 DHCP 动态获得。 ``` $ vi eth1.yaml @@ -498,7 +488,7 @@ interfaces: mtu: 1500 ``` -Now, apply this config temporarily using the option _no-commit_ so it will be valid only for 30 seconds. This can be done adding the option _–timeout_. Meanwhile, we will run the _ip  -br a_ command three times to see how the IPv4 address configured in _eth1_ interface changes and then the configuration rolls back. +现在,使用选项 `no-commit` 临时应用这个配置,让它只在 30 秒内有效。这可以通过添加选项 `timeout` 来完成。同时,我们将运行 `ip -br a` 命令三次,看看配置在 `eth1` 接口的 IPv4 地址是如何变化的,然后配置就会回滚。 ``` $ ip -br a && sudo nmstatectl apply --no-commit --timeout 30 eth1.yaml && sleep 10 && ip -br a && sleep 25 && ip -br a @@ -561,13 +551,13 @@ eth0 UP 192.168.122.238/24 fe80::5054:ff:fe91:e44e/64 eth1 UP 192.168.122.108/24 ``` -As you can see from above, the _eth1_ IP address changed temporarily from 192.168.122.108 to 192.168.122.110 and then it returned to 192.168.122.108 after the timeout expired. +从上面可以看到,`eth1` 的 IP 地址从 `192.168.122.108` 暂时变成了 `192.168.122.110`,然后在超时结束后又回到了 `192.168.122.108`。 -### Conclusion +### 总结 -NMState is a declarative networking configuration tool that currently applies the desired networking configuration state in a host through the NetworkManager API. This state can be defined either interactively using a text editor or with a file-based approach creating a yaml or json file. +NMState 是一个声明式的网络配置工具,目前可以通过 NetworkManager API 在主机中应用所需的网络配置状态。这种状态既可以用文本编辑器交互式地定义,也可以用基于文件的方法创建一个 yaml 或 json 文件。 -This kind of tool provides Infrastructure as Code, it allows the automation of networking tasks and also reduces potential misconfigurations or unstable networking scenarios that could arise using legacy configuration methods. +这种工具提供了“基础设施即代码”,它可以自动化网络任务,也减少了使用传统配置方法可能出现的潜在错误配置或不稳定的网络情况。 -------------------------------------------------------------------------------- @@ -575,8 +565,8 @@ via: https://fedoramagazine.org/nmstate-a-declarative-networking-config-tool/ 作者:[Maurizio Garcia][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[wxy](https://github.com/wxy) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b4999922d5aea7ac513d3d5ddb5bd9d44aa86530 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 8 Oct 2021 14:59:02 +0800 Subject: [PATCH 0641/1588] PUB @wxy https://linux.cn/article-13861-1.html --- ...0210809 NMState- A declarative networking config tool.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/translated/tech/20210809 NMState- A declarative networking config tool.md b/translated/tech/20210809 NMState- A declarative networking config tool.md index 1ea9af52c3..2f15c78d84 100644 --- a/translated/tech/20210809 NMState- A declarative networking config tool.md +++ b/translated/tech/20210809 NMState- A declarative networking config tool.md @@ -4,13 +4,13 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13861-1.html" NMState:一个声明式网络配置工具 ====== -![][1] +![](https://img.linux.net.cn/data/attachment/album/202110/08/145714mqcyh6sshchomyot.jpg) 这篇文章描述并演示了 NMState,这是一个使用声明式方法配置主机的网络管理器。这意味着你可以通过 API 定义所需的配置状态,而工具则通过提供者provider来应用配置。 From 1a071c5f877b30724c2d7dd93544491f8b2aff28 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 9 Oct 2021 05:02:45 +0800 Subject: [PATCH 0642/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211008?= =?UTF-8?q?=203=20more=20phases=20of=20DevSecOps=20transformation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211008 3 more phases of DevSecOps transformation.md --- ...more phases of DevSecOps transformation.md | 65 +++++++++++++++++++ 1 file changed, 65 insertions(+) create mode 100644 sources/tech/20211008 3 more phases of DevSecOps transformation.md diff --git a/sources/tech/20211008 3 more phases of DevSecOps transformation.md b/sources/tech/20211008 3 more phases of DevSecOps transformation.md new file mode 100644 index 0000000000..9f4d5eeb0e --- /dev/null +++ b/sources/tech/20211008 3 more phases of DevSecOps transformation.md @@ -0,0 +1,65 @@ +[#]: subject: "3 more phases of DevSecOps transformation" +[#]: via: "https://opensource.com/article/21/10/last-phases-devsecops-transformation" +[#]: author: "Will Kelly https://opensource.com/users/willkelly" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 more phases of DevSecOps transformation +====== +Ensure you reach your goals by continuing a step-by-step approach to +DevSecOps. +![Gold trophy on green background][1] + +Making a major operations transition must be a long-term and well-planned process. Because DevSecOps is an important step in the DevOps journey for your organization, you are more likely to find success if you introduce and implement your transformation in phases. + +In my [previous article][2], I explained the first three phases of making this change. This article presents three additional phases of DevSecOps transformation you must work through to achieve your goals. Finishing these phases requires that you foster team collaboration to carry your organization through security changes, going live with DevSecOps, and putting the tools in place for continuous learning and iteration of your DevSecOps toolchain and processes. + +### Phase 4: collaborate on security changes to your DevOps toolchains + +Some security changes on the move to DevSecOps may adversely affect operations and even security compliance. Changes to tools, processes, and even staffing sometimes change the way teams work. + +Your development, operations, and security teams must collaborate before deployment and at other touchpoints to set priorities. Security teams sometimes prioritize a security measure that adversely impacts operations. Likewise, your developers probably overlook some holes caused by system configurations that could compromise the security and compliance of your systems. + +Predeployment reviews provide a prime collaboration channel. When you conduct predeployment reviews during your DevOps to DevSecOps transformation, you give your developers and security staff a forum through which they can educate each other on their team's priorities and informed tradeoffs. + +### Phase 5: execute on DevSecOps + +As your organization crosses into phase 5 of your DevOps to DevSecOps transformation, it's time to execute your plans with one or more teams. Don't move to Phase 5 as an entire organization. Instead, look for natural breaks in your project teams' schedules for them to move to a DevSecOps model. For example, say that one of your DevOps teams has just launched a new product release. After catching their collective breath, they're working on bug fixes that come in from the field. Don't interrupt their flow with a full-on move to DevSecOps during an in-progress project. + +Look for new project opportunities to begin executing on DevSecOps. Such an approach offers the following advantages: + + * Providing teams a clean slate to learn a new process from the beginning, not midstream during a project + * Enabling you to include process and tools training as part of the project kickoff process + * Affording the chance to bring your developers, operations, and security teams together to discuss mutual expectations for the project + * Giving teams a chance to learn to work together better during the new workflows that DevSecOps brings to an organization + + + +### Phase 6: pursue continuous learning and iteration + +There is no formal end to an adequately executed shift from DevOps to DevSecOps. After your organization moves to DevSecOps and adopts the principles and foundations, the learning and iteration need to continue past the transformation. + +As there is no single accepted DevSecOps definition for the industry, you can expect to learn a lot as your DevSecOps journey gains momentum and your processes mature. You also need to prepare your organization for changes in DevOps and DevSecOps philosophies that might benefit your internal efforts. + +### Final thoughts + +The phases I outline in this series are general guidelines for a path toward achieving your DevSecOps transformation. The emphasis on collaboration is deliberate because your enterprise's particular circumstances could require that you modify these phases to achieve your transformation. Even if you need to make substantial changes to these phases, having a graduated implementation roadmap will get you much closer to success. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/last-phases-devsecops-transformation + +作者:[Will Kelly][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/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/trophy_celebrate.png?itok=jGnRHBq2 (Gold trophy on green background) +[2]: https://opensource.com/article/21/10/first-phases-devsecops-transformation From 2c0aa6266a9841144283727191751b2fa46dd7b4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 9 Oct 2021 05:03:01 +0800 Subject: [PATCH 0643/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211008?= =?UTF-8?q?=203=20new=20features=20of=20the=20latest=20OpenPGP.js=20versio?= =?UTF-8?q?n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211008 3 new features of the latest OpenPGP.js version.md --- ...atures of the latest OpenPGP.js version.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/tech/20211008 3 new features of the latest OpenPGP.js version.md diff --git a/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md b/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md new file mode 100644 index 0000000000..c966e80965 --- /dev/null +++ b/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md @@ -0,0 +1,71 @@ +[#]: subject: "3 new features of the latest OpenPGP.js version" +[#]: via: "https://opensource.com/article/21/10/openpgpjs" +[#]: author: "Daniel Huigens https://opensource.com/users/twiss" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 new features of the latest OpenPGP.js version +====== +OpenPGP.js is a cryptography library that implements the OpenPGP +standard, most commonly used for email encryption. +![email or newsletters via inbox and browser][1] + +[OpenPGP.js][2] is a cryptography library that implements the [OpenPGP standard][3], most commonly used for email encryption. ProtonMail, Mailvelope, and FlowCrypt all use OpenPGP.js, to name a few. That means the OpenPGP.js library encrypts millions of users' messages. + +The OpenPGP standard, first published in the 1990s, like almost anything, requires maintenance and updating for both security and usability. A "crypto refresh" of the standard [is in the works][4], which adds modern encryption algorithms and deprecates outdated ones. To improve usability, various email applications now allow users to seamlessly encrypt their communication—without managing their keys or those of their contacts. + +First released in 2014, OpenPGP.js began based on an early prototype called GPG4Browsers, which is based on several scripts by Herbert Hanewinkel (among other contributors). The second version of OpenPGP.js, released in 2016, was completely reworked to use Uint8Arrays instead of strings (which significantly increased its performance) and modern ES6 modules rather than CommonJS modules internally. Versions 3 and 4, both released in 2018, added support for Elliptic-curve cryptography (ECC) and streaming, respectively. + +My team and I continue working on OpenPGP.js to ensure its evolution as an easy-to-use library for strong encryption. + +### 1\. Elliptic-curve cryptography by default + +In OpenPGP.js version 4, RSA was used when generating new keys by default. Although ECC is faster and more secure, Curve25519 had not been standardized in the OpenPGP specification yet. The crypto refresh draft does include Curve25519, and it is expected to be included "as is" in the next version of the OpenPGP specification, so OpenPGP.js version 5 now generates keys using ECC by default. + +### 2\. Import only the modules you need + +Similarly, while OpenPGP.js used ES6 modules internally for years, version 4 still didn't publish a proper ES6 module. Instead, it published only a Univeral Module Definition (UMD) module that could run both in the browser and on Node.js. In version 5, this changes by publishing separate modules for the browser and Node.js (both ES6 and non-ES6), making it easier for library users to import OpenPGP.js on all platforms and (when using the ES6 module) only import the parts they need. This is enabled in large part by switching the build system to [rollup][5]. + +### 3\. Reject weak cryptography + +There are also many other security improvements. For example, 1024-bit RSA keys, ElGamal, and DSA keys are considered insecure and are rejected by default. Additionally, where version 4 already defaulted to AES-encryption, version 5 now refuses to encrypt using weaker algorithms entirely by default, even if the public key claims to only support a weaker algorithm. It instead assumes that all OpenPGP implementations support AES (which has been the case for a very long time). + +### What's next for OpenPGP.js + +Looking ahead, there are some security improvements to make. Key fingerprints, used to identify public keys, still use SHA-1, though a fix for this is planned in the crypto refresh. In the meantime, it is recommended to use different means to ascertain the authenticity of any public key used for encryption, such as by fetching the entire key directly from the recipient's domain using the proposed [Web Key Directory (WKD)][6] standard—already implemented by various [email providers][7]. WKD support was built into OpenPGP.js version 4 but is a separate module in version 5 to keep the main library lean. + +Similarly, when encrypting messages or files with a password rather than a public key (uncommon when using OpenPGP for email encryption, but more so when used for encrypted backups, for example), the password is converted to a symmetric key using a relatively weak key derivation function (KDF). It is thus advisable for applications to pass the user's password through a strong KDF, such as [Argon2][8] or [scrypt][9], before passing it to OpenPGP.js. Hopefully, the crypto refresh will include one of these algorithms to implement in a future version of OpenPGP.js. + +### How to use OpenPGP.js version 5 + +For now, though, OpenPGP.js version 5 has been [published][10] to the npm package registry. If you like, feel free to try it out! Feedback is welcome in the [discussions tab][11] on GitHub. Please note, however, that while OpenPGP.js is a general-purpose encryption library, its primary use case is in situations where compatibility with the OpenPGP specification is required (for example, when sending or receiving PGP-encrypted email). For other use cases, a different library may be a more appropriate or performant choice. In general, of course, be careful when rolling any crypto. + +Thanks for reading, and here's to securing the future of email! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/openpgpjs + +作者:[Daniel Huigens][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/twiss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) +[2]: https://github.com/openpgpjs/openpgpjs +[3]: https://tools.ietf.org/html/rfc4880 +[4]: https://datatracker.ietf.org/doc/charter-ietf-openpgp/ +[5]: https://rollupjs.org/ +[6]: https://datatracker.ietf.org/doc/html/draft-koch-openpgp-webkey-service +[7]: https://wiki.gnupg.org/WKD#Mail_Service_Providers_offering_WKD +[8]: https://en.wikipedia.org/wiki/Argon2 +[9]: https://en.wikipedia.org/wiki/Scrypt +[10]: https://www.npmjs.com/package/openpgp +[11]: https://github.com/openpgpjs/openpgpjs/discussions From 299318418436c7f1fca030393f1a03ac5e91ec53 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 9 Oct 2021 08:30:33 +0800 Subject: [PATCH 0644/1588] translated --- ...n Open-Source Translation App for Linux.md | 102 ------------------ ...n Open-Source Translation App for Linux.md | 102 ++++++++++++++++++ 2 files changed, 102 insertions(+), 102 deletions(-) delete mode 100644 sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md create mode 100644 translated/tech/20210929 Dialect- An Open-Source Translation App for Linux.md diff --git a/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md b/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md deleted file mode 100644 index f2d8192562..0000000000 --- a/sources/tech/20210929 Dialect- An Open-Source Translation App for Linux.md +++ /dev/null @@ -1,102 +0,0 @@ -[#]: subject: "Dialect: An Open-Source Translation App for Linux" -[#]: via: "https://itsfoss.com/dialect/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Dialect: An Open-Source Translation App for Linux -====== - -_**Brief:** Dialect is a straightforward app that lets you translate between languages using web services. To explore more, let us take a closer look._ - -While you can launch the web browser and directly use any translation service to get the job done, a desktop app can sometimes come in handy. - -Dialect is a simple translation app that utilizes web services to translate while giving you some extra abilities. - -### Open-Source Translation App with Google Translate & LibreTranslate - -![][1] - -Dialect is primarily an app tailored for GNOME desktops, but it should work fine with other desktop environments. - -It lets you quickly translate languages along with a few extra options. - -At its core, it lets you choose between Google Translate or LibreTranslate as the translation service. - -Even though LibreTranslate cannot come close to Google Translate’s accuracy, featuring it as an option to switch is an excellent addition. At least, for some basic usage, if a user does not want to utilize Google’s services, you have an alternative ready on your desktop. - -### Features of Dialect - -![][2] - -Along with the ability to switch translation services, you get a few more tweaks: - - * Pronunciation - * Text to Speech functionality (Google) - * Dark mode - * Translation shortcut - * Live Translation - * Clipboard buttons to quickly copy/paste - * Translation history (undo/redo) - - - -As you can notice in the screenshot, the live translation feature may get your IP addressed banned from using the service because of API abuse. - -![][3] - -I tried using LibreTranslate (as shown in the image above) and Google Translate with the live translation feature enabled, and it worked fine. - -Maybe if you rely on translations quite often, you may want to avoid the feature. But, for my quick usage, the services didn’t ban by IP address for quite a few test runs. - -It is important to note that you can specify a custom LibreTranslate instance if you want. By default, it uses “translate.astian.org” as the instance. - -You may not find a separate translation history section, but the arrow buttons in the top-left corner of the window will let you see your previous translations and the translation settings as well. - -So, it works as a redo/undo feature as well. - -### Installing Dialect in Linux - -Dialect is available as a [Flatpak][4]. So, you should be able to install it on any Linux distro of your choice. If you are new to this, you might want to check out our [Flatpak guide][5] for help. - -First, add Flathub repo: - -``` -flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo -``` - -And then install the application: - -``` -flatpak install flathub com.github.gi_lom.dialect -``` - -Once installed, look for it in the system menu and start it from there. - -You can also explore its [GitHub page][6] for more information. - -[Dialect][7] - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/dialect/ - -作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-screenshot.png?resize=800%2C331&ssl=1 -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-app-options.png?resize=800%2C470&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-libretranslate.png?resize=800%2C326&ssl=1 -[4]: https://itsfoss.com/what-is-flatpak/ -[5]: https://itsfoss.com/flatpak-guide/ -[6]: https://github.com/dialect-app/dialect/ -[7]: https://flathub.org/apps/details/com.github.gi_lom.dialect diff --git a/translated/tech/20210929 Dialect- An Open-Source Translation App for Linux.md b/translated/tech/20210929 Dialect- An Open-Source Translation App for Linux.md new file mode 100644 index 0000000000..0c4176f011 --- /dev/null +++ b/translated/tech/20210929 Dialect- An Open-Source Translation App for Linux.md @@ -0,0 +1,102 @@ +[#]: subject: "Dialect: An Open-Source Translation App for Linux" +[#]: via: "https://itsfoss.com/dialect/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Dialect:Linux 下的开源翻译应用 +====== + +_**简介:**Dialect 是一个简单明了的应用,可以让你使用网络服务进行语言间的翻译。为了探索更多,让我们仔细看看。_ + +虽然你可以启动网络浏览器并直接使用任何翻译服务来完成工作,但桌面应用有时会派上用场。 + +Dialect 是一个简单的翻译应用,利用网络服务进行翻译,同时给你一些额外的能力。 + +### 使用谷歌翻译和 LibreTranslate 的开源翻译应用 + +![][1] + +Dialect 主要是一个为 GNOME 桌面定制的应用,但它在其他桌面环境下也应该能正常工作。 + +它可以让你快速翻译语言,同时还有一些额外的选项。 + +在其核心部分,它让你在谷歌翻译或 LibreTranslate 之间选择翻译服务。 + +尽管 LibreTranslate 不能接近谷歌翻译的准确性,但把它作为一个选项来切换是一个很好的补充。至少,对于一些基本的用法,如果用户不想利用谷歌的服务,你的桌面上就有一个备选方案。 + +### Dialect 的特点 + +![][2] + +除了切换翻译服务外,你还能得到: + + * 发音 + * 文本到语音功能(谷歌) + * 黑暗模式 + * 翻译快捷方式 + * 实时翻译 + * 剪贴板按钮可快速复制/粘贴 + * 翻译历史(撤销/重做)。 + + + +正如你在截图中所注意到的,实时翻译功能可能会因为滥用 API 而使你的 IP 地址被禁止使用该服务。 + +![][3] + +我试着使用 LibreTranslate(如上图所示)和谷歌翻译,并启用实时翻译功能,它工作得很好。 + +也许,如果你经常依赖翻译,你可能想避免这个功能。但是,对于我的临时使用,在相当多的测试中,这些服务并没有按 IP 地址禁止。 + +重要的是要注意,如果你想,你可以指定一个自定义的 LibreTranslate 实例。默认情况下,它使用 “translate.astian.org” 作为实例。 + +你可能找不到一个单独的翻译历史部分,但窗口左上角的箭头按钮会让你看到你以前的翻译和翻译设置。 + +所以,它也可以作为一个重做/撤销的功能。 + +### 在 Linux 中安装 Dialect + +Dialect 是以 [Flatpak][4] 的形式提供的。所以,你应该能够在你选择的任何 Linux 发行版上安装它。如果你是新手,你可能想看看我们的 [Flatpak 指南][5]以获得帮助。 + +首先,添加Flathub 仓库: + +``` +flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo +``` + +然后安装应用: + +``` +flatpak install flathub com.github.gi_lom.dialect +``` + +安装后,在系统菜单中寻找它,并从那里启动它。 + +你也可以浏览它的 [GitHub 页面][6]了解更多信息。 + +[Dialect][7] + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/dialect/ + +作者:[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://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-screenshot.png?resize=800%2C331&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-app-options.png?resize=800%2C470&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/dialect-libretranslate.png?resize=800%2C326&ssl=1 +[4]: https://itsfoss.com/what-is-flatpak/ +[5]: https://itsfoss.com/flatpak-guide/ +[6]: https://github.com/dialect-app/dialect/ +[7]: https://flathub.org/apps/details/com.github.gi_lom.dialect From ca25fde04efa42cec8098ec9ef6777264f87f258 Mon Sep 17 00:00:00 2001 From: geekpi Date: Sat, 9 Oct 2021 08:36:47 +0800 Subject: [PATCH 0645/1588] translating --- .../20211008 3 new features of the latest OpenPGP.js version.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md b/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md index c966e80965..d46866e3ba 100644 --- a/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md +++ b/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/openpgpjs" [#]: author: "Daniel Huigens https://opensource.com/users/twiss" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 47c0f5f685a84dd49134fbfac76e9697ca2deb33 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 Oct 2021 09:06:10 +0800 Subject: [PATCH 0646/1588] PUB --- .../20210809 NMState- A declarative networking config tool.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {translated/tech => published}/20210809 NMState- A declarative networking config tool.md (100%) diff --git a/translated/tech/20210809 NMState- A declarative networking config tool.md b/published/20210809 NMState- A declarative networking config tool.md similarity index 100% rename from translated/tech/20210809 NMState- A declarative networking config tool.md rename to published/20210809 NMState- A declarative networking config tool.md From 99682e305b6154cc28bad6782b4f77ec5a9a83e9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 Oct 2021 09:29:00 +0800 Subject: [PATCH 0647/1588] PRF&PUB @geekpi https://linux.cn/article-13864-1.html --- ... your Linux distribution-s repositories.md | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) rename {translated/tech => published}/20210927 Install Java from your Linux distribution-s repositories.md (63%) diff --git a/translated/tech/20210927 Install Java from your Linux distribution-s repositories.md b/published/20210927 Install Java from your Linux distribution-s repositories.md similarity index 63% rename from translated/tech/20210927 Install Java from your Linux distribution-s repositories.md rename to published/20210927 Install Java from your Linux distribution-s repositories.md index c04dd813fd..f2de6c0c60 100644 --- a/translated/tech/20210927 Install Java from your Linux distribution-s repositories.md +++ b/published/20210927 Install Java from your Linux distribution-s repositories.md @@ -3,16 +3,18 @@ [#]: author: "Chris Hermansen https://opensource.com/users/clhermansen" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13864-1.html" -从你的 Linux 发行版的仓库中安装 Java +如何从 Linux 发行版的仓库中安装 Java ====== -无论你喜欢哪个发行版和包管理器,都可以都很容易在您的 Linux 系统上安装 Java。 -![Coffee beans and a cup of coffee][1] -有许多不同的方法可以把 Java 安装到你的 Linux 桌面上。一个明显的途径是使用你的 Linux 发行版中提供的软件包。请注意,这并不适合所有人。例如,有些用户可能需要一个非常具体的 Java 版本。 +> 无论你喜欢哪个发行版和包管理器,都可以都很容易地在你的 Linux 系统上安装 Java。 + +![](https://img.linux.net.cn/data/attachment/album/202110/09/092717ean17be0alz10kt5.jpg) + +把 Java 安装到你的 Linux 桌面上有多种方法。一个明显的方式是使用你的 Linux 发行版中提供的软件包。请注意,这并不适合所有人。例如,有些用户可能需要一个非常具体的 Java 版本。 在你开始之前,你必须确定你需要“哪种 Java”。你是否只需要运行一些 `.class` 文件或 `.jar` 文件?还是你正在编写一些需要编译的代码? @@ -20,14 +22,12 @@ 由于我主要在 Ubuntu Linux 发行版上工作,我的软件包管理器是 `apt`。我可以用 `apt` 来查找哪些 OpenJDK 包是可用的: - ``` -`apt list OpenJDK\*` +apt list OpenJDK\* ``` 这个命令的输出看起来像这样: - ``` Listing... Done openjdk-11-dbg/hirsute-updates,hirsute-security 11.0.11+9-0ubuntu2 amd64 @@ -57,48 +57,43 @@ openjdk-8-source/hirsute-updates,hirsute-updates,hirsute-security,hirsute-securi 我在上面用 `...` 省略了不少行。 -事实证明,即使我把自己限制在 OpenJDK 中,我仍然有很多选择: +事实证明,即使限制在 OpenJDK 中,我仍然有很多选择: - * 架构(在我的例子中,是 i386 还是 amd64)。 - * Java 的版本(就我而言,是 8、11、15、16、17)。 + * 不同的架构(在我的例子中,i386 还是 amd64)。 + * 不同的 Java 版本(就我而言,有 8、11、15、16、17 等)。 * 纯粹的 OpenJDK 或无头版本。 - * Java 运行时环境(或称 JRE)。 - * 调试、演示、源代码等选项。 + * Java 运行时环境(JRE)。 + * 用于调试、演示,以及是否包含源代码等。 +同样,在我的情况中,我主要对纯粹的普通 OpenJDK 感兴趣。 - -同样,在我的案例中,我主要是对纯粹的 vanilla OpenJDK 感兴趣。 - -假设我想为我的 amd64 架构安装 Java 11 版本的纯 vanilla OpenJDK,我可以输入: - +假设我想为我的 amd64 架构安装 Java 11 版本的普通 OpenJDK,我可以输入: ``` -`sudo apt install -a=amd64 openjdk-11-jdk` +sudo apt install -a=amd64 openjdk-11-jdk ``` 几分钟后,我就可以编译、运行、调试和打包我的 Java 代码了。 -注意,同时安装多个版本的 Java 是很有可能的,有时甚至是理想的。在 Ubuntu 中,有一个有用的工具,叫做 `update-java-alternatives`,它可以[显示和配置在任何时候使用哪个 Java 环境][3]。 - -那些使用不同 Linux 发行版的人,一般来说,可以采取类似的方法。其他几个发行版(如 Debian 和 Mint)也使用 `apt` ,尽管可用的软件包可能不同。其他发行版使用不同的软件包管理器。例如,[Fedora 安装 Java 的文档页面][4]显示了如何使用 Fedora `dnf` 包管理器来处理安装。首先,为了显示可用的版本,输入: +注意,很有可能需要同时安装多个版本的 Java,有时甚至是必要的。在 Ubuntu 中,有一个有用的工具,叫做 `update-java-alternatives`,它可以 [显示并配置在使用哪个 Java 环境][3]。 +那些使用不同 Linux 发行版的人,一般来说,可以采取类似的方法。其他的几个发行版(如 Debian 和 Mint)也使用 `apt` ,尽管可用的软件包可能不同。发行版可能使用不同的软件包管理器。例如, [Fedora 安装 Java 的文档页面][4] 显示了如何使用 Fedora `dnf` 包管理器来处理安装。首先,为了显示可用的版本,输入: ``` -`dnf search openjdk` +dnf search openjdk ``` 接下来,要安装完整的开发 x86_64 架构版本,请输入: - ``` -`sudo dnf install java-11-openjdk-devel.x86_64` +sudo dnf install java-11-openjdk-devel.x86_64 ``` -同样地,Fedora 提供了 `alternatives` 工具来[显示和配置 Java 环境][5]。 +同样地,Fedora 提供了 `alternatives` 工具来 [显示和配置 Java 环境][5]。 -再比如,[很棒的 Arch Linux wiki][6] 显示对应的软件包是 `jdk11-openjdk`。wiki 还解释了许多与在 Arch 中使用 Java 有关的其他重要细节,比如使用 `archlinux-java` 工具来显示安装了哪些 Java 环境或选择一个不同的默认环境。Arch 使用一个叫 `pacman` 的包管理器,它也有文档[在 Arch Linux wiki 上][7]。 +再比如,[很棒的 Arch Linux 维基][6] 显示对应的软件包是 `jdk11-openjdk`。该维基还解释了许多在 Arch 中使用 Java 的其他重要细节,比如使用 `archlinux-java` 工具来显示安装了哪些 Java 环境或选择一个不同的默认环境。Arch 使用一个叫 `pacman` 的包管理器,它也有文档 [在 Arch Linux 维基上][7]。 -不管你喜欢哪个发行版和软件包管理器,在你的 Linux 系统上获得 Java 是很容易的。当然,在安装之前,要考虑版本和功能。还要记住,在同一台电脑上有管理两个或多个 Java 版本的选项。我的大多数例子都使用了 `apt`,但也要记得 `dnf` 选项。 +不管你喜欢哪个发行版和软件包管理器,在你的 Linux 系统上获得 Java 是很容易的。当然,在安装之前,要考虑版本和功能。还要记住,在同一台电脑上有管理两个或多个 Java 版本的方法。我的大多数例子都使用了 `apt`,但也要记得可以选择使用 `dnf`。 -------------------------------------------------------------------------------- @@ -107,7 +102,7 @@ via: https://opensource.com/article/21/9/install-java-linux-repositories 作者:[Chris Hermansen][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 c0809a4ae23b25181f431679ba13542457f75e26 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 Oct 2021 09:44:23 +0800 Subject: [PATCH 0648/1588] APL --- ...077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md b/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md index 334e19bce4..8bb0f9c8fe 100644 --- a/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md +++ b/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/nvidia-dlss-dx-11-12-proton/" [#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 72620e572786d5ab50315e447898d950a2bdc9be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 Oct 2021 10:32:34 +0800 Subject: [PATCH 0649/1588] TSL&PRF --- ... DLSS With Proton Experimental on Linux.md | 96 ------------------- ... DLSS With Proton Experimental on Linux.md | 94 ++++++++++++++++++ 2 files changed, 94 insertions(+), 96 deletions(-) delete mode 100644 sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md create mode 100644 translated/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md diff --git a/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md b/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md deleted file mode 100644 index 8bb0f9c8fe..0000000000 --- a/sources/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md +++ /dev/null @@ -1,96 +0,0 @@ -[#]: subject: "DirectX 11/12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux" -[#]: via: "https://news.itsfoss.com/nvidia-dlss-dx-11-12-proton/" -[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -DirectX 11/12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux -====== - -In June, Nvidia [announced][1] the support for **DLSS** in Linux via Steam Proton and a beta driver for Vulkan-based games. - -DLSS stands for Deep Learning Super Sampling. It utilizes deep learning algorithms powered by Tensor cores found in RTX GPUs to upscale images inside games. This results in clearer and sharper images along with higher framerates. - -![Source: NVIDIA][2] - -This [upscaling technology is similar][3] to AMD’s Fidelity FX and even closer to Intel’s upcoming XeSS, both open-source, unlike DLSS. Gamers already have the benefit of making use of Fidelity FX through [GloriousEggroll’s][4] custom Proton GE versions. - -Moreover, NVIDIA also planned to expand support to DirectX games by this fall. - -And, finally, with the latest Proton Experiment support, that’s happening. Linux gamers using Nvidia GPUs can now play their favorite DX11/12 based games with DLSS. - -There couldn’t be a better time for this addition, considering we will be able to play various multiplayer games soon on Linux with the [support for BattleEye & Easy-Anti Cheat added to Proton][5]. - -### Major Updates to Steam Play Proton - -Along with a wave of improvements in Proton 6.3-7, Valve has finally managed to add DLSS support into Proton’s Experimental branch for DirectX 11/12 games a few days ago. - -Previously, a beta driver was required to use DLSS for Vulkan-based games like DOOM Eternal. - -But, that isn’t the case anymore—although the latest drivers are recommended. - -To complement this, DXVK and the Steamworks SDK have also been updated to the latest development versions. Additionally, performance issues for specific games and other bugs have also been fixed. - -You can check Proton’s [official GitHub changelog][6] to explore the list of improvements for all the games supported so far. - -### Enabling DLSS for DX11/12 Games - -Enabling DLSS is a straightforward process. - -First, you have to make sure that your Windows game runs on Proton Experimental. - -This can be done by right-clicking on the game and selecting Properties. Then under Compatibility, you need to tick the “Force the use of a specific Steam Play compatibility tool” checkbox. Next, choose Proton Experimental from the drop-down menu. - -![][7] - -Finally, you need to insert the command `PROTON_HIDE_NVIDIA_GPU=0 PROTON_ENABLE_NVAPI=1 %command%` in **Launch Options**. - -![][8] - -That’s it! You’re all set to play your games with DLSS! - -### Summing Up - -Nvidia DLSS is a much-needed feature for many games, given the difference it makes. - -Linux did not have full-fledged support for DLSS from the get-go. But, it looks like it will soon be available in a future stable Proton version along with necessary improvements. - -Linux gamers can finally experience better frame rates and visual quality for many games with their RTX-based GPUs. - -Although I use Fidelity FX on my AMD graphics card, I still crave to try out DLSS on an RTX GPU! - -_How do you feel about the arrival of Nvidia’s DLSS? Will you be trying it out soon? Feel free to share your comments below._ - -**Via:** [GamingOnLinux][9] - -#### 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/nvidia-dlss-dx-11-12-proton/ - -作者:[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://www.nvidia.com/en-us/geforce/news/june-2021-rtx-dlss-game-update/ -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQwOCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://news.itsfoss.com/intel-xess-open-source/ -[4]: https://github.com/GloriousEggroll/proton-ge-custom -[5]: https://news.itsfoss.com/easy-anti-cheat-linux/ -[6]: https://github.com/ValveSoftware/Proton/wiki/Changelog -[7]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ3NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[8]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[9]: https://www.gamingonlinux.com/2021/10/proton-experimental-expands-nvidia-dlss-support-on-linux-to-directx-11-titles diff --git a/translated/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md b/translated/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md new file mode 100644 index 0000000000..8aeb95218c --- /dev/null +++ b/translated/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md @@ -0,0 +1,94 @@ +[#]: subject: "DirectX 11/12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux" +[#]: via: "https://news.itsfoss.com/nvidia-dlss-dx-11-12-proton/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +《赛博朋克 2077》等 DirectX 11/12 游戏可在 Linux 上体验 DLSS 了 +====== + +> 通过 Steam Proton 的实验版本,期待已久的 Nvidia DLSS 支持在 Linux 上的 DirectX 11/12 大作中出现。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/nvidia-dlss-proton.png?w=1200&ssl=1) + +6 月,英伟达 [宣布][1] 通过 Steam Proton 支持 Linux 中的 DLSS,并为基于 Vulkan 的游戏提供了测试版驱动程序。 + +DLSS 是指深度学习超级采样Deep Learning Super Sampling。它利用由 RTX GPU 中的 Tensor 核心提供支持的深度学习算法来提升游戏中的图像。这将使图像更清晰、更锐利,并提高帧率。 + +![来源:英伟达][2] + +这种 [升级技术][3] 类似于 AMD 的 Fidelity FX,甚至更接近于英特尔即将推出的 XeSS,与 DLSS 不同的是这两者都是开源的。玩家已经可以通过 [GloriousEggroll][4] 的定制 Proton GE 版本体验到 Fidelity FX。 + +此外,英伟达还计划在今年秋天之前将支持范围扩大到 DirectX 游戏。 + +而且,随着最新的 Proton 实验性支持,这一切终于实现了。使用英伟达 GPU 的 Linux 游戏玩家现在可以用 DLSS 玩他们最喜欢的基于 DX11/12 的游戏。 + +考虑到我们很快就能在 Linux 上玩各种多人游戏,并且 [Proton 中添加了对 BattleEye & Easy-Anti Cheat 的支持][5],这是进行这项添加的最好时机。 + +### Steam Porton 的重大更新 + +几天前,伴随着 Proton 6.3-7 的一波改进,Valve 终于设法将 DLSS 支持添加到 Proton 的 DirectX 11/12 游戏实验分支中。 + +在此之前,需要一个测试版驱动程序才能将 DLSS 用于基于 Vulkan 的游戏,例如 DOOM Eternal。 + +但是,现在不再如此 —— 尽管推荐使用最新的驱动程序。 + +作为补充,DXVK 和 Steamworks SDK 也已经更新到最新的开发版本。此外,还修复了特定游戏的性能问题和其他错误。 + +你可以查看 Proton 的 [官方 GitHub 更新日志][6] 来了解到目前为止支持的所有游戏的改进列表。 + +### 为 DX11/12 游戏启用 DLSS + +启用 DLSS 是一个简单明了的过程。 + +首先,你必须确保你的 Windows 游戏可以在 Proton Experimental 上运行。 + +这可以通过右键点击游戏并选择“属性Properties”来完成。然后在“兼容性Compatibility”下,你需要勾选“强制使用特定的 Steam Play 兼容工具Force the use of a specific Steam Play compatibility tool”复选框。接下来,从下拉菜单中选择 “Proton Experimental”。 + +![][7] + +最后,你需要在“启动选项Launch Options”中插入命令:`PROTON_HIDE_NVIDIA_GPU=0 PROTON_ENABLE_NVAPI=1 %command%` 。 + +![][8] + +这就行了。你就可以用 DLSS 玩你的游戏了! + +### 总结 + +英伟达 DLSS 对于许多游戏来说是一个非常需要的功能,因为它的作用很大。 + +Linux 从一开始就没有对 DLSS 的全面支持。但是,看起来它很快就会在未来的 Proton 稳定版本中提供,并进行必要的改进。 + +Linux 玩家终于可以用基于 RTX 的 GPU 在许多游戏中体验到更好的帧率和视觉质量。 + +虽然我在 AMD 显卡上使用 Fidelity FX,但我仍然渴望在 RTX GPU 上尝试 DLSS! + +你对英伟达 DLSS 的到来有什么感觉?你会很快尝试它吗?欢迎在下面分享你的评论。 + +转自:[GamingOnLinux][9]。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/nvidia-dlss-dx-11-12-proton/ + +作者:[Rishabh Moharir][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/rishabh/ +[b]: https://github.com/lujun9972 +[1]: https://www.nvidia.com/en-us/geforce/news/june-2021-rtx-dlss-game-update/ +[2]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/DLSS_RDD2.jpg?w=800&ssl=1 +[3]: https://news.itsfoss.com/intel-xess-open-source/ +[4]: https://github.com/GloriousEggroll/proton-ge-custom +[5]: https://news.itsfoss.com/easy-anti-cheat-linux/ +[6]: https://github.com/ValveSoftware/Proton/wiki/Changelog +[7]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/Compatibility.png?w=836&ssl=1 +[8]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/Commands-1.png?w=831&ssl=1 +[9]: https://www.gamingonlinux.com/2021/10/proton-experimental-expands-nvidia-dlss-support-on-linux-to-directx-11-titles From f12723e4d55eea6874c7615d5accda12f1e3252e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 9 Oct 2021 10:35:29 +0800 Subject: [PATCH 0650/1588] PUB @wxy https://linux.cn/article-13865-1.html --- ...7 Can Use NVIDIA DLSS With Proton Experimental on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md (98%) diff --git a/translated/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md b/published/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md similarity index 98% rename from translated/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md rename to published/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md index 8aeb95218c..6ae2ebe009 100644 --- a/translated/news/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md +++ b/published/20211006 DirectX 11-12 Games like Cyberpunk 2077 Can Use NVIDIA DLSS With Proton Experimental on Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13865-1.html" 《赛博朋克 2077》等 DirectX 11/12 游戏可在 Linux 上体验 DLSS 了 ====== From 8830cc13492ebe4e66b632aa5f68a7d86e82940d Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sat, 9 Oct 2021 12:33:31 +0800 Subject: [PATCH 0651/1588] translating --- .../20200228 How to process real-time data with Apache.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200228 How to process real-time data with Apache.md b/sources/tech/20200228 How to process real-time data with Apache.md index 7bf16741b4..2f1c8e18a0 100644 --- a/sources/tech/20200228 How to process real-time data with Apache.md +++ b/sources/tech/20200228 How to process real-time data with Apache.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (unigeorge) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -69,7 +69,7 @@ via: https://opensource.com/article/20/2/real-time-data-processing 作者:[Simon Crosby][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 9d74817078a19f8a05791ea868ed5c098ddfc8a0 Mon Sep 17 00:00:00 2001 From: YungeGuo Date: Sat, 9 Oct 2021 16:17:59 +0800 Subject: [PATCH 0652/1588] translated --- ...aging resources with cgroups in systemd.md | 106 +++++++++--------- 1 file changed, 53 insertions(+), 53 deletions(-) rename {sources => translated}/tech/20201029 Managing resources with cgroups in systemd.md (65%) diff --git a/sources/tech/20201029 Managing resources with cgroups in systemd.md b/translated/tech/20201029 Managing resources with cgroups in systemd.md similarity index 65% rename from sources/tech/20201029 Managing resources with cgroups in systemd.md rename to translated/tech/20201029 Managing resources with cgroups in systemd.md index f9c03cd94c..0a78495f78 100644 --- a/sources/tech/20201029 Managing resources with cgroups in systemd.md +++ b/translated/tech/20201029 Managing resources with cgroups in systemd.md @@ -7,30 +7,31 @@ [#]: via: (https://opensource.com/article/20/10/cgroups) [#]: author: (David Both https://opensource.com/users/dboth) -Managing resources with cgroups in systemd +在 systemd 中使用 cgroup 管理资源 ====== -Cgroups manage resources per application rather than by the individual -processes that make up an application. + +cgroup 按照应用管理资源,而不是按照组成应用的单个进程。 + ![Business woman on laptop sitting in front of window][1] -There is little more frustrating to me as a sysadmin than unexpectedly running out of a computing resource. On more than one occasion, I have filled all available disk space in a partition, run out of RAM, and not had enough CPU time to perform my tasks in a reasonable amount of time. Resource management is one of the most important tasks that sysadmins do. +作为一个系统管理员,没有事情比意外地耗尽计算资源让我更觉得沮丧。我曾不止一次填满了一个分区的所有可用磁盘空间、耗尽内存、以及没有足够的 CPU 时间在合理的时间内处理我的任务。资源管理是系统管理员最重要的工作之一。 -The point of resource management is to ensure that all processes have relatively equal access to the system resources they need. Resource management also involves ensuring that RAM, hard drive space, and CPU capacity are added when necessary or rationed when that is not possible. In addition, users who hog system resources, whether intentionally or accidentally, should be prevented from doing so. +资源管理的关键是保证所有的进程能够相对公平的访问需要的系统资源。资源管理还包括确保在需要时添加内存、硬盘驱动器空间、还有 CPU 容量;或者在无法添加时限制资源的使用。此外,应该阻止独占系统资源的用户,无论其是否有意。 -There are tools that enable sysadmins to monitor and manage various system resources. For example, [top][2] and similar tools allow you to monitor the use of memory, I/O, storage (disk, SSD, etc.), network, swap space, CPU usage, and more. These tools, particularly those that are CPU-centric, are mostly based on the paradigm that the running process is the unit of control. At best, they provide a way to adjust the nice number–and through that, the priority—or to kill a running process. (For information about nice numbers, see [_Monitoring Linux and Windows hosts with Glances_][3].) -Other tools based on traditional resource management in a SystemV environment are managed by the `/etc/security/limits.conf` file and the local configuration files located in the `/etc/security/limits.d` directory. Resources can be limited in a fairly crude but useful manner by user or group. Resources that can be managed include various aspects of RAM, total CPU time per day, total amount of data, priority, nice number, number of concurrent logins, number of processes, maximum file size, and more. +系统管理员可以通过一些工具监控和管理不同的系统资源。例如,[top][2] 和类似的工具允许你监控内存、I/O、存储(磁盘,SSD等)、网络、交换空间、CPU 的用量等。这些工具,尤其是以 CPU 为中心的工具,大部分基于运行的进程是控制的基本单位的模型。他们最多只是提供了一种方式来调整 nice 数字——从而修改优先级——或者杀死一个运行的进程。(要了解 nice 数字的信息,查看[_使用 Glances 监控 Linux 和 Windows 主机_][3])。 -### Using cgroups for process management +SystemV 环境中基于传统的资源管理的其他工具,由 `/etc/security/limits.conf` 文件和 `/etc/security/limits.d` 中的本地配置文件控制。资源可以按照用户或组以一种相当粗糙但实用的方式限制。可以管理的资源包括 RAM 的各个方面、每日的总 CPU 时间、数据总量、优先级、nice 数字、同时登陆的数量、进程数、文件大小的最大值等。 -One major difference between [systemd and SystemV][4] is how they handle processes. SystemV treats each process as an entity unto itself. systemd collects related processes into control groups, called [cgroups][5] (short for control groups), and manages system resources for the cgroup as a whole. This means resources can be managed per application rather than by the individual processes that make up an application. +### 使用 cgroup 管理进程 -The control units for cgroups are called slice units. Slices are a conceptualization that allows systemd to order processes in a tree format for ease of management. +[systemd 和 SystemV][4] 之间的一个主要差异是管理进程的方式。SystemV 将每个进程当做指向自身的一个实体。systemd 将相关的进程集中到一个控制组,称作 [cgroup][5](控制组的简称),并将 cgroup 作为一个整体管理系统资源。这意味着资源能够基于应用管理,而不是组成应用的单个进程。 -### Viewing cgroups +cgroup 的控制单元称作切片单元。切片是允许 systemd 以树状格式控制程序次序,从而简化管理的概念化。 -I'll start with some commands that allow you to view various types of information about cgroups. The `systemctl status ` command displays slice information about a specified service, including its slice. This example shows the `at` daemon: +### 查看 cgroup +我将从一些允许你查看不同类型 cgroup 信息的命令开始。 `systemctl status ` 命令显示一个特定服务的切片信息,包括服务的切片。这个例子展示了 `at` 守护进程: ``` [root@testvm1 ~]# systemctl status atd.service @@ -49,10 +50,9 @@ Sep 23 12:18:24 testvm1.both.org systemd[1]: Started Deferred execution schedule [root@testvm1 ~]# ``` -This is an excellent example of one reason that I find systemd more usable than SystemV and the old init program. There is so much more information here than SystemV could provide. The cgroup entry includes the hierarchical structure where the `system.slice` is systemd (PID 1), and the `atd.service` is one level below and part of the `system.slice`. The second line of the cgroup entry also shows the process ID (PID) and the command used to start the daemon. - -The `systemctl` command shows multiple cgroup entries. The `--all` option shows all slices, including those that are not currently active: +这是一个我感到 systemd 比 SystemV 和旧的初始化程序更好用的原因的绝佳示例。这里的信息远比 SystemV 能够提供的丰富。cgroup 项包括的层级结构中,`system.slice` 是 systemd(PID 1),`atd.service` 在下一层,是 `system.slice` 的一部分。cgroup 项的第二行还显示了进程 ID(PID)和启动守护进程使用的命令。 +`systemctl` 命令列出多个 cgroup 项,`--all` 参数列出所有的切片,包括当前没有激活的: ``` [root@testvm1 ~]# systemctl -t slice --all @@ -78,14 +78,13 @@ To show all installed unit files use 'systemctl list-unit-files'. [root@testvm1 ~]# ``` -The first thing to notice about this data is that it shows user slices for UIDs 0 (root) and 1000, which is my user login. This shows only the slices and not the services that are part of each slice. This data shows that a slice is created for each user at the time they log in. This can provide a way to manage all of a user's tasks as a single cgroup entity. +关于这个数据,第一个需要注意的是数据显示了 UID 0(root)和 1000 的用户切片,1000 是我登陆的用户。这里列出了组成每个切片的切片部分,而不是服务。还说明了每个用户登录时都会为其创建一个切片,这为将一个用户的所有任务作为单个 cgroup 项进行管理提供了一种方式。 -### Explore the cgroup hierarchy +### 探索 cgroup 层次结构 -All is well and good so far, but cgroups are hierarchical, and all of the service units run as members of one of the cgroups. Viewing that hierarchy is easy and uses one old command and one new one that is part of systemd. - -The `ps` command can be used to map the processes and their locations in the cgroup hierarchy. Note that it is necessary to specify the desired data columns when using the `ps` command. I significantly reduced the volume of output from this command below, but I tried to leave enough so you can get a feel for what you might find on your systems: +目前为止一切顺利,但是 cgroup 是分层的,所有的服务单元作为其中一个 cgroup 的成员运行。要查看这个层次结构很简单,使用 systemd 的一个旧命令和一个新命令即可。 +`ps` 命令可以用于映射进程的和其所处的 cgroup 层次。注意使用 `ps` 命令时需要指明想要的数据列。我大幅削减了下面命令的输出数量,但是试图保留足够的数据,以便你能够对自己系统上的输出有所感受: ``` [root@testvm1 ~]# ps xawf -eo pid,user,cgroup,args @@ -162,10 +161,9 @@ ons Action Buttons Log out, lock or other system actions <SNIP> ``` -You can view the entire hierarchy with the `systemd-cgls` command, which is a bit simpler because it does not require any complex options. - -I have shortened this tree view considerably. as well, but I left enough to give you some idea of the amount of data as well as the types of entries you should see when you do this on your system. I did this on one of my virtual machines, and it is about 200 lines long; the amount of data from my primary workstation is about 250 lines: +你可以使用 `systemd-cgls` 命令查看整个层次结构,这个命令不需要任何的复杂参数,更加简单。 +我也大幅缩短了这个树状结构,但是保留了足够多的输出,以便你能够了解在自己的系统上执行这个命令时应该看到的数据总量和条目类型。我在我的一个虚拟机上执行了这个命令,输出大概有 200 行;我的主要工作站的输出大概有 250 行。 ``` [root@testvm1 ~]# systemd-cgls @@ -263,43 +261,45 @@ Control group /:  <SNIP> ``` -This tree view shows all of the user and system slices and the services and programs running in each cgroup. Notice the units called "scopes," which group related programs into a management unit, within the `user-1000.slice` in the listing above. The `user-1000.slice/session-7.scope` cgroup contains the GUI desktop program hierarchy, starting with the LXDM display manager session and all of its subtasks, including things like the Bash shell and the Thunar GUI file manager. +这个树状视图显示了所有的用户和系统切片,以及每个 cgroup 内正在运行的服务和程序。注意叫作“范围”的单元,它将相关的程序组成一个管理单元,在上面列出的结果中就是 `user-1000.slice`。`user-1000.slice/session-7.scope` cgroup 包含了 GUI 桌面程序层次结构,以 LXDM 显示管理器会话和其所有的子任务开始,包括像 Bash 命令行解释器和 Thunar GUI 文件管理器之类的程序。 -Scope units are not defined in configuration files but are generated programmatically as the result of starting groups of related programs. Scope units do not create or start the processes running as part of that cgroup. All processes within the scope are equal, and there is no internal hierarchy. The life of a scope begins when the first process is created and ends when the last process is destroyed. +配置文件中不定义范围单元,而是作为启动相关程序组的结果程序化生成的。范围单元不创建或启动作为 cgroup 组成部分运行的进程。范围内的所有进程都是平等的,没有内部的层次结构。范围的生命周期在第一个进程创建时开始,在最后一个进程销毁时结束。 -Open several windows on your desktop, such as terminal emulators, LibreOffice, or whatever you want, then switch to an available virtual console and start something like `top` or [Midnight Commander][11]. Run the `systemd-cgls` command on your host, and take note of the overall hierarchy and the scope units. +在你的桌面打开多个窗口,比如终端模拟器、LibreOffice、或者任何你想打开的,然后切换到一个可用的虚拟控制台,启动类似 `top` 或 [Midnight Commander][11] 的程序。在主机运行 `systemd-cgls` 命令,留意整体的层次结构和范围单元。 -The `systemd-cgls` command provides a more complete representation of the cgroup hierarchy (and details of the units that make it up) than any other command I have found. I prefer its cleaner representation of the tree than what the `ps` command provides. +`systemd-cgls` 命令提供的 cgroup 层次结构表示(以及组成 cgroup 单元的细节),比我见过的其他任何指令都要完整。和 `ps` 命令提供的输出相比,我喜欢 `systemd-cgls` 命令更简洁的树形表示。 -### With a little help from my friends +### 来自朋友们的一点帮助 -After covering these basics, I had planned to go into more detail about cgroups and how to use them, but I discovered a series of four excellent articles by Red Hat's [Steve Ovens][12] on Opensource.com's sister site [Enable Sysadmin][13]. Rather then basically rewriting Steve's articles, I decided it would be much better to take advantage of his cgroup expertise by linking to them: +介绍完这些基础知识后,我曾计划过深入研究 cgroup 的更多细节,以及如何使用,但是我在 Opensource.com 的姐妹网站 [Enable Sysadmin][13] 上发现了一系列四篇优秀文章,由 Red Hat 公司的 [Steve Ovens][12] 所作。与其从头重写 Steve 的文章,我觉得倒不如通过链接到这些文章,利用他的 cgroup 专业知识: - 1. [A Linux sysadmin's introduction to cgroups][14] - 2. [How to manage cgroups with CPUShares][15] - 3. [Managing cgroups the hard way—manually][16] - 4. [Managing cgroups with systemd][17] + 1. [一个 Linux 系统管理员对 cgroup 的介绍][14] + 2. [如何用 CPUShares 管理 cgroup][15] + 3. [用更难的方式——手动管理 cgroup][16] + 4. [用 systemd 管理 cgroup][17] + +像我一样享受这些文章并从中汲取知识吧。 + +### 其他资源 + +因特网上充斥着大量关于 systemd 的信息,但大部分都简短生硬、愚钝、甚至令人误解。除了本文提到的资源,下面的网页提供了关于 systemd 启动更详细可靠的信息。自从我开始这一系列的文章来反映我所做的研究以来,这个的列表已经变长了。 + + * Fedora 项目有一个优质实用的 [systemd 指南][18],几乎有你使用 systemd 配置、管理、维 +护一个 Fedora 计算机需要知道的一切。 + * Fedora 项目还有一个好用的[速查表][19],交叉引用了古老的 SystemV 命令和对应的 systemd 命令。 + * [systemd.unit(5) 手册页][20]包含了一个不错的单元文件中段的列表,以及这些段的配置选项和简洁的描述。 + * Red Hat 文档包含了一个[单元文件结构][21]的有用描述,还有一些其他的重要信息。 + * 要获取 systemd 的详细技术信息和创立的原因,查看 Freedesktop.org 的 [systemd 描 +述][22]。这个使我发现过的最棒页面之一,因为其中包含了许多指向其他重要准确文档的链接。 + + * Linux.com 上 ”systemd 的更多乐趣 " 提供了更高级的 systemd [信息和提示][23]。 + * 查看 [systemd.resource-control(5)][24] 的手册页 + * 查看 [_Linux 内核用户和管理员指南_][25]中的[控制组 v2 条目][26]。 - -Enjoy and learn from them, as I did. - -### Other 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. This list has grown since I started this series of articles to reflect the research I have done. - - * The Fedora Project has a good, practical [guide][18] [to systemd][18]. 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][19] that cross-references the old SystemV commands to comparable systemd ones. - * The [systemd.unit(5) manual page][20] contains a nice list of unit file sections and their configuration options along with concise descriptions of each. - * Red Hat documentation contains a good description of the [Unit file structure][21] as well as other important information. - * For detailed technical information about systemd and the reasons for creating it, check out Freedesktop.org's [description of systemd][22]. This page is one of the best I have found because it contains many links to other important and accurate documentation. - * Linux.com's "More systemd fun" offers more advanced systemd [information and tips][23]. - * See the man page for [systemd.resource-control(5)][24]. - * In [_The Linux kernel user's and administrator's guide_][25], see the [Control Group v2][26] entry. - - - -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. +还有一系列针对系统管理员的深度技术文章,由 systemd 的设计者和主要开发者 Lennart +Poettering 所作。这些文章写于 2010 年 4 月到 2011 年 9 月之间,但在当下仍然像当时一样有 +价值。关于 systemd 及其生态的许多其他优秀的作品都是基于这些文章的。 * [Rethinking PID 1][27] * [systemd for Administrators, Part I][28] @@ -322,7 +322,7 @@ via: https://opensource.com/article/20/10/cgroups 作者:[David Both][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[YungeG](https://github.com/YungeG) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 34842d03e59df3dba90a36e9c73abd53d843d9b3 Mon Sep 17 00:00:00 2001 From: imgradeone <30969327+imgradeone@users.noreply.github.com> Date: Sat, 9 Oct 2021 21:51:39 +0800 Subject: [PATCH 0653/1588] Update 20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md --- ...l Vivaldi Browser on Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md b/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md index a58f299afa..7dbdeece74 100644 --- a/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-vivaldi-ubuntu-linux/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "imgradeone" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 3f1f6e0377917321322ce89490f74eb1d8682d8f 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: Sat, 9 Oct 2021 22:38:50 +0800 Subject: [PATCH 0654/1588] Update 20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md --- ...on Ubuntu and Other Linux Distributions.md | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md b/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md index 7dbdeece74..62c81df583 100644 --- a/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md @@ -7,18 +7,20 @@ [#]: publisher: " " [#]: url: " " -How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions +如何在 Ubuntu 和其他 Linux 发行版中安装 Vivaldi 浏览器 ====== -_**Brief: Learn how to install Vivaldi web browser on Ubuntu, Debian and several other Linux distributions in this beginner’s tutorial. You’ll also learn about updating it and removing it.**_ +> 您将在本篇新手教程中学习如何在 Ubuntu、Debian 及其他 Linux 发行版中安装 Vivaldi 网页浏览器,同时本教程也将介绍如何更新和卸载该软件。 -[Vivaldi][1] is an increasingly popular web browser. It is based on Chromium, so you have Chrome like features, but it adds several other features to give a different, intuitive interface. +[Vivaldi][1] 是一款关注度逐步上升的网页浏览器。它基于 Chromium 内核,因此它拥有和 Chrome 类似的功能,但它也新增了一些其他特色功能,让这款浏览器与众不同、更为直观。 -It comes with tab grouping, ad blocker, mouse gestures, notes manager and even allows adding macros. You could even use split viewing to view multiple pages at once. It also respects your privacy, unlike Chrome. +它内置了标签组、广告拦截、鼠标手势、笔记管理,甚至还有命令连锁。你甚至可以借助页面平铺来一次性浏览多个页面。当然,相比于 Chrome,Vivaldi 更加尊重你的隐私。 -![Tab tiling for split viewing multiple websites at once][2] +![页面平铺,一次性浏览多个页面][2] -You can understand the popularity of this browser from the fact that [Manjaro Linux recently replaced Firefox with Vivaldi as the default browser][3] in some of its variants. +你可以从 [Manjaro Linux 近期使用 Vivaldi 取代 Firefox 作为部分分支的默认浏览器][3] 这件事来了解 Vivaldi 浏览器的受欢迎程度。 + +如果你想尝试一下 If you want to try it, let me show how to install Vivaldi on Linux. You’ll learn: @@ -26,11 +28,9 @@ If you want to try it, let me show how to install Vivaldi on Linux. You’ll lea * Tips on updating Vivaldi to the newest version * Steps for removing Vivaldi from Ubuntu - - -Non-FOSS alert! - -Vivaldi is not complete open source software. It’s UI is closed source. It’s been covered here because Vivaldi team took effort in making its software available on Linux. +> 非自由软件(Non-FOSS)警告! +> +> Vivaldi is not complete open source software. It’s UI is closed source. It’s been covered here because Vivaldi team took effort in making its software available on Linux. ### Installing Vivaldi on Ubuntu [GUI Method] From e70384a0b070228473c978cbb03ab0e06e234626 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 10 Oct 2021 05:02:33 +0800 Subject: [PATCH 0655/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211010?= =?UTF-8?q?=20Best=20Linux=20Distributions=20Based=20on=20KDE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211010 Best Linux Distributions Based on KDE.md --- ...0 Best Linux Distributions Based on KDE.md | 221 ++++++++++++++++++ 1 file changed, 221 insertions(+) create mode 100644 sources/tech/20211010 Best Linux Distributions Based on KDE.md diff --git a/sources/tech/20211010 Best Linux Distributions Based on KDE.md b/sources/tech/20211010 Best Linux Distributions Based on KDE.md new file mode 100644 index 0000000000..44955e4795 --- /dev/null +++ b/sources/tech/20211010 Best Linux Distributions Based on KDE.md @@ -0,0 +1,221 @@ +[#]: subject: "Best Linux Distributions Based on KDE" +[#]: via: "https://itsfoss.com/best-kde-distributions/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Best Linux Distributions Based on KDE +====== + +KDE is one of the most customizable and fastest desktop environments out there. While you can always install KDE if you know-how, it is best to choose a Linux distribution that comes with KDE out-of-the-box. + +Here, let me list some of the best KDE-based Linux distros. + +### Linux Distributions With KDE Onboard + +No matter what you choose as your preferred distro, you can refer to our [KDE customization guide][1] to tweak your experience. + +**Note:** The list is in no particular order of ranking. + +### 1\. KDE Neon + +![][2] + +Key Highlights: + + * Official KDE distribution + * Latest stable KDE Plasma version + * Focuses on latest KDE software + * Not a perfect replacement as a desktop distro + + + +KDE Neon is one of the exciting choices if you want to get your hands on the latest KDE Plasma experience. + +Even if it utilizes a stable Ubuntu LTS base, you always get the newest KDE version delivered as soon as it is released. + +Unlike any other distros, it does not focus on a complete desktop user experience but the KDE software packages. So, it may not be the perfect desktop replacement for everyone. However, if you focus on using the latest KDE software, KDE Neon is a decent choice. + +The User Edition is what you need to opt for, but you also have the choice to try “Testing” or “Unstable” editions if you are willing to try pre-released features. + +If you wonder how it differs from Kubuntu, you should check out [KDE Neon vs Kubuntu][3] comparison to explore it. + +[KDE Neon][4] + +### 2\. Kubuntu + +![][5] + +Key Highlights: + + * An Ubuntu-based desktop-focused Linux distro + * Offers both LTS and non-LTS versions + * Good hardware compatibility + + + +Kubuntu should be an excellent distro for your Linux desktop if the KDE software suite is not your focus. + +Kubuntu is an official flavor of Ubuntu, which provides three years of updates for its LTS editions. Unlike KDE Neon, you get better support for various applications and are not just limited to KDE software. + +You get the option to opt for an LTS edition or a non-LTS version to get the latest Ubuntu features. + +Kubuntu has improved hardware compatibility when compared to some other KDE-based distros. Considering, it powers a variety of laptops that include Kubuntu Focus, Slimbook, and more, the hardware compatibility is something that you can rely on. + +### 3\. Manjaro KDE + +![][6] + +Key Highlights: + + * Arch-based Linux distro + * Rolling-release updates + * Presents a slight learning curve to new Linux users + + + +Manjaro is an Arch-Linux-based distribution that makes it easy to use Arch as a desktop Linux platform. + +It follows a rolling-release schedule, which should help you get the latest packages quickly without worrying about the software update period. + +If you are a new Linux user, you may want to stick to Flatpak or Snaps to install any application. While Manjaro makes it easy to use Arch, it does present a slight learning curve to new users. So, you might want to check the [Arch wiki][7] to explore more. + +### 4\. Fedora KDE Spin + +Key Highlights: + + * A unique KDE-based Linux distribution (if you don’t prefer mainstream Ubuntu/Arch distros) + * Tailored for workstations and servers + * May not be convenient for new Linux users + * Hardware compatibility can be an issue + + + +Fedora is an independent distribution (not based on Ubuntu/Arch) that acts as an upstream for Red Hat Enterprise Linux. + +And, Fedora spin editions feature alternate desktops for users. If you want KDE, you need to download Fedora’s KDE spin. + +Like KDE Neon, Fedora does not focus on providing a great desktop experience but aims to implement the latest technology useful for a workstation or server. + +So, if you are confident to tackle any issues/challenges that come with newer technology implementations on a Linux distro, Fedora KDE spin can be a good choice. + +[Fedora KDE Spin][8] + +### 5\. openSUSE + +![][9] + +Key Highlights: + + * Suitable for system administrators and developers requiring access to several tools + * Two different editions available including a stable and a rolling-release + + + +openSUSE is yet another independent Linux distribution featuring the KDE desktop by default. While it pitches itself as one of the choices for desktop users, I have had hardware compatibility issues in the past. + +However, it can be a good choice for system administrators or developers who want to access tools like YaST, Open Build Service, Kiwi, and more on their desktop, out-of-the-box. + +It offers a stable edition and a rolling-release version. As per your requirements, choose what’s best for you. + +[openSUSE][10] + +### 6\. Garuda Linux + +![][11] + +Key Highlights: + + * Rolling-release distro + * BTRFS as the default filesystem + * Comes with essential pre-installed GUI tools to make the Arch Linux experience easy + + + +Garuda Linux is a modern Arch-based distribution that focuses on a customized experience out-of-the-box. + +The KDE version (or the Dr460nized edition) offers a beautiful experience while tweaking it with a macOS-like workflow. + +Of course, if you are an experienced Linux user, you may customize your existing distribution to mimic the same experience. + +As a cherry on top, Garuda Linux also provides different variants of its KDE editions, one with pre-installing gaming tools, one for penetration testing, and another as an essential Linux desktop system. + +[Garuda Linux][12] + +### 7\. Nitrux OS + +![][13] + +Key Highlights: + + * Debian-based distribution for a change + * Unique desktop experience + + + +A Debian-based Linux distribution that features KDE out-of-the-box. Unlike Kubuntu, Nitrux may end up offering faster KDE plasma updates and newer Linux Kernel upgrades. + +Nitrux OS offers a beautiful and unique experience while featuring its NX Desktop. + +If you want to try something different with KDE onboard, Nitrux OS would be a great pick. + +[Nitrux OS][14] + +### 8\. MX Linux KDE + +![][15] + +Key Highlights: + + * Debian-based distro + * Lightweight + * Useful MX Tools pre-installed + + + +Don’t need the looks but want a simple and customizable KDE desktop with a Debian base? MX Linux KDE edition should be a fantastic choice as it is known for its snappy performance and pre-installed essential tools baked in. + +You also get several KDE themes if you want to tweak the default user experience. + +[MX Linux][16] + +### Wrapping Up + +In addition to this list, several other Linux distributions feature KDE desktop as their preferred choice. + +Nitrux OS should be a unique pick overall, and if you want to move away from Ubuntu-based distributions, there are solid arch-based distros like Garuda Linux and Manjaro to try. + +What is your favorite KDE-based Linux distribution? Do you focus on out-of-the-box customization or prefer to customize the KDE experience yourself? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-kde-distributions/ + +作者:[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://itsfoss.com/kde-customization +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/08/kde-neon-information-20-04.jpg?resize=800%2C397&ssl=1 +[3]: https://itsfoss.com/kde-neon-vs-kubuntu/ +[4]: https://neon.kde.org/index +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-kde.jpg?resize=800%2C450&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/manjaro-20-desktop.jpeg?resize=800%2C440&ssl=1 +[7]: https://wiki.archlinux.org +[8]: https://spins.fedoraproject.org/en/kde/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/opensuse-kde.png?resize=800%2C423&ssl=1 +[10]: https://www.opensuse.org +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/Garuda-Linux-review.png?resize=800%2C450&ssl=1 +[12]: https://garudalinux.org +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/nitrux-os-kde.png?resize=800%2C450&ssl=1 +[14]: https://nxos.org +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde.jpg?resize=800%2C452&ssl=1 +[16]: https://mxlinux.org From ec86df3d2e935bd8d2edde6c1f29be678c2f8c6c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 10 Oct 2021 05:03:59 +0800 Subject: [PATCH 0656/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211008?= =?UTF-8?q?=20Feren=20OS=202021.10=20Release=20Introduces=20a=20New=20Fire?= =?UTF-8?q?fox=20Configuration=20and=20UI=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md --- ...refox Configuration and UI Improvements.md | 93 +++++++++++++++++++ 1 file changed, 93 insertions(+) create mode 100644 sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md diff --git a/sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md b/sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md new file mode 100644 index 0000000000..863cd52336 --- /dev/null +++ b/sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md @@ -0,0 +1,93 @@ +[#]: subject: "Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements" +[#]: via: "https://news.itsfoss.com/feren-os-2021-10-release/" +[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements +====== + +Feren OS is a Linux/GNU distribution based on Ubuntu. + +The latest 2021.10 release, codenamed ‘Gallium’, presents new features and changes. Let’s take a look at them. + +### Feren OS 2021.10: What’s New? + +#### A New Configuration For Mozilla Firefox + +![][1] + +Feren OS 2021.10 aims to offer a hassle-free Mozilla web browsing experience by removing the unnecessary elements of the browser. + +For new users, Mozilla Firefox comes pre-installed with a new configuration. Things like [removing the title bar from Mozilla Firefox][2], getting rid of distractions in a new tab, are some of the configurations made. + +Overall, these are the changes made to Firefox: + + * Compact Mode and no title bar by default + * No Pocket by default + * The Library is now in the toolbar (as was intended by Mozilla themselves during early Proton design ideas) instead of Pocket’s button + * Skipped Welcome Screens to allow you to get right into the action + + + +If you have never launched Firefox (or have a fresh install of Feren OS), you will get the configuration out-of-the-box. In either case, you will have to install the **firefox-config-feren** package from the web browser manager. + +#### New Splash Screen + +The new update comes with a redesigned splash screen. As a consequence, now it looks smoother and more elegant, especially when transitioning from the login screen to the desktop. + +![][3] + +#### Refreshed Lock Screen + +The new lock screen is a mixture of the Feren OS login screen’s design style and KDE plasma’s lock screen features. + +![Feren OS 2021.10 Lock Screen][4] + +As a result, it combines elegance and functionality. From the lock screen, you will have access to your music, a virtual keyboard, and more. + +![Feren OS 2021.10 Login Screen][4] + +#### New Wallpapers + +With every new release, you can notice some new wallpapers. And, Feren OS 2021.10 is no exception. + +Some interesting wallpapers have been added from sources like Unsplash and some were removed. + +### Upgrading & Downloading + +You should be easily able to get the new update from the update manager. In case you run into issues, you can refer to the [official blog post][5] for a solution to fix the most common problem encountered when updating. + +For more details on this release, refer to [the official announcement][6]. + +[Download Feren OS 2021.10][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/feren-os-2021-10-release/ + +作者:[Omar Maarof][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/omar/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://itsfoss.com/remove-title-bar-firefox/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MyIgd2lkdGg9IjcwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM1OCIgd2lkdGg9IjcwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://medium.com/feren-os/the-repository-keyring-expired-heres-how-to-renew-it-bd50dd874aac +[6]: https://medium.com/feren-os/feren-os-2021-10-iterative-improvements-993aab5dba51 +[7]: https://ferenos.weebly.com/get-feren-os.html From 720ca85479b5eaaed8d912b8609e9304d786ed97 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 10 Oct 2021 05:04:09 +0800 Subject: [PATCH 0657/1588] add done: 20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md --- sources/tech/20211010 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20211010 .md diff --git a/sources/tech/20211010 .md b/sources/tech/20211010 .md new file mode 100644 index 0000000000..2c12f65567 --- /dev/null +++ b/sources/tech/20211010 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/10/dark-mode-browser/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From d542cd6bbbefe76fc21f7f55a9cd9f77e0ffee6e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 10 Oct 2021 05:04:23 +0800 Subject: [PATCH 0658/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211008?= =?UTF-8?q?=20TUXEDO=E2=80=99s=20Linux=20Gaming=20Ultrabook=20=E2=80=9CInf?= =?UTF-8?q?inityBook=20Pro=2014=E2=80=9D=20Now=20Sports=20an=20RTX=203050?= =?UTF-8?q?=20Ti=20and=203K=20Display?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md --- ...ow Sports an RTX 3050 Ti and 3K Display.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md diff --git a/sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md b/sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md new file mode 100644 index 0000000000..019b613536 --- /dev/null +++ b/sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md @@ -0,0 +1,85 @@ +[#]: subject: "TUXEDO’s Linux Gaming Ultrabook “InfinityBook Pro 14” Now Sports an RTX 3050 Ti and 3K Display" +[#]: via: "https://news.itsfoss.com/tuxedos-infinitybook-14/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +TUXEDO’s Linux Gaming Ultrabook “InfinityBook Pro 14” Now Sports an RTX 3050 Ti and 3K Display +====== + +Tuxedo has recently unveiled its latest and exciting revision to its InfinityBook Pro 14. Despite weighing just around one kg, this sleek-looking ultrabook packs in impressive specs and can pretty much run various AAA games. Let’s take a look at what this laptop has to offer. + +### Updated Specifications + +![Source: Tuxedo][1] + +#### Processor Upgrade + +The refreshed offering has updated the processors to high-performance **Intel Core i5-11300H and Core i7-11370H** instead of the power-saving chips in the previous iteration. + +In case you didn’t know, the performance-oriented chips can utilize up to 60 watts (TDP) to provide you the enhanced performance. + +#### New-Gen RTX Graphics + +As for the graphics side, you’ll find NVIDIA’s mid-range **GeForce RTX 3050 Ti** along with the integrated Iris Xe graphics. This is a power-efficient MaxQ variant that promises a TGP of 35 watts. + +Considering this as a mid-tier GPU, it should be enough for gaming with 1080p settings. + +Do note there are no 3050ti available in the market separately. It is currently limited to OEMs/laptops. + +This graphics card is very beneficial for gamers on the go as it supports NVIDIA’s DLSS, like all RTX GPUs, for a stepped-up gaming experience. + +Also, it’s never been a better time because Linux gamers can now [enable DLSS for DX11/12 and Vulkan-based games like Cyberpunk 2077][2]. + +### Other Features + +If you’re worried about cooling, fret not. The laptop comes with an all-new cooling system that contains two heat pipes and two fans. Thus, working under heavy workloads is no longer an issue. + +As for the storage and memory, two M.2 NVME SSD slots and dual-channel RAM up to 64 GB can be seen. + +The I/O ports include an HDMI 2.0, USB-C 3.2 Gen2, two USB-A 3.2 Gen1 ports, an SD card reader, and a Thunderbolt 4 port. + +Finally, a large **53 Wh battery** is also included that ensures 12 hours (idle) of runtime. This is pretty helpful to that stunning 14 inch **Omnia 3K IPS display.** + +### Availability and Pricing + +The InfinityBook Pro 14 **starts at 1180 EUR** and goes all the way **up to 1770 EUR** if you need the 3K Omnia display and Core i7-11370H. + +Preorders have already started from Oct 6th. You can head to its official website to explore more about the product and its availability. + +[TUXEDO Computers][3] + +### Wrapping Up + +This is one beast of an ultrabook that doubles as a gaming laptop. However, I don’t understand the inclusion of 3050ti with a 3K display. So, if you are looking for other options, I would suggest [exploring other places to buy Linux laptops][4]. + +Users frequently on the go will find this laptop useful for both work and play, thanks to the laptop’s weight and power. + +_What do you think about this laptop? Do share your thoughts 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/tuxedos-infinitybook-14/ + +作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://news.itsfoss.com/nvidia-dlss-dx-11-12-proton/ +[3]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks/10-14-inch/TUXEDO-InfinityBook-Pro-14-Gen6.tuxedo# +[4]: https://itsfoss.com/get-linux-laptops/ From b74404757e1fd42846c1f559cfdeb1029e635d97 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, 10 Oct 2021 10:00:45 +0800 Subject: [PATCH 0659/1588] Update 20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md --- ...on Ubuntu and Other Linux Distributions.md | 88 +++++++++---------- 1 file changed, 43 insertions(+), 45 deletions(-) diff --git a/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md b/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md index 62c81df583..31dd4d01c2 100644 --- a/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md @@ -20,113 +20,111 @@ 你可以从 [Manjaro Linux 近期使用 Vivaldi 取代 Firefox 作为部分分支的默认浏览器][3] 这件事来了解 Vivaldi 浏览器的受欢迎程度。 -如果你想尝试一下 +如果你想尝试一下这款浏览器的话,接下来让我告诉你,如何在 Linux 上安装 Vivaldi。你将了解到: -If you want to try it, let me show how to install Vivaldi on Linux. You’ll learn: - - * GUI and command line methods for installing Vivaldi - * Tips on updating Vivaldi to the newest version - * Steps for removing Vivaldi from Ubuntu + * 安装 Vivaldi 的 GUI 和命令行方式 + * 将 Vivaldi 更新到最新版本的提示 + * 在 Ubuntu 中卸载 Vivaldi 的方式 > 非自由软件(Non-FOSS)警告! > -> Vivaldi is not complete open source software. It’s UI is closed source. It’s been covered here because Vivaldi team took effort in making its software available on Linux. +> Vivaldi 并非完全的开源软件。它的 UI 界面是闭源的。之所以在这里介绍这款浏览器,是因为 Vivaldi 团队正努力让该软件在 Linux 平台上可用。 -### Installing Vivaldi on Ubuntu [GUI Method] +### 在 Ubuntu 中安装 Vivaldi [GUI 方式] -The good thing is that Vivaldi provides pre-built binaries in DEB form for Ubuntu/Debian based distros and in RPM form for Fedora, Red Hat and SUSE. +好消息是,Vivaldi 提供了预先构建好的安装包,包括 Ubuntu/Debian 的 DEB 文件,以及 Fedora、Red Hat、SUSE 的 RPM 文件、 -It is available for both 32 bit and 64-bit platforms, as well as [ARM devices like Raspberry Pi][4]. +它支持 32 位和 64 位平台,也支持 [像树莓派之类的 ARM 设备][4]。 -![Vivaldi provides installer for several types of Linux distributions][5] +![Vivaldi 为各类 Linux 发行版提供了安装包][5] -The installation process is really simple. You go to the Vivaldi web page and download the appropriate installer file and then double click on it to install it. That’s it. +安装过程非常简单。你只需要前往 Vivaldi 的官网下载正确的安装包文件,双击打开,然后安装,大功告成。 -I’ll show the steps in detail for Ubuntu/Debian. You can use similar steps for other distributions. +我将详细介绍在 Ubuntu/Debian 下的安装过程。对于其他类型的发行版,你可以使用类似的步骤。 -#### Step 1: Download Vivaldi +#### 第 1 步:下载 Vivaldi -Go to the Vivaldi’s download page and download the DEB file for Ubuntu. +前往 Vivaldi 的下载页面,下载支持 Ubuntu 的 DEB 格式安装包。 -[Download Vivaldi][6] +[下载 Vivaldi][6] -![Download DEB file for Ubuntu/Debian][7] +![下载支持 Ubuntu/Debian 的 DEB 安装包][7] -#### Step 2: Install the downloaded DEB file +#### 第 2 步:安装刚刚下载的 DEB 文件 -Go to the Downloads folder where you have the deb file downloaded. [Installing deb file][8] is easy. Either just double-click on it or right click to open it with software center. +前往你刚刚下载 DEB 文件的下载文件夹。[安装 DEB 文件][8] 非常简单,只需要双击打开,或者右键后使用软件中心打开即可。 -![Right click on the downloaded deb file and open it with Software Install][9] +![右键点击下载的 DEB 文件并用软件中心打开以安装][9] -It will open the software center application and here, you can see the option to install Vivaldi. Just hit the Install button. +这将打开软件中心,在这里可以看到安装 Vivaldi 的选项。点击安装按钮即可。 -![Hit the Install button][10] +![点击安装按钮][10] -You’ll be asked to enter your system’s account password. Enter that and you should have it installed in a few seconds. You’ll see that Install option changes to remove. This is an indication that Vivaldi is now installed. +您将需要输入系统账户的密码,输入密码授权后,Vivaldi 很快就能完成安装,随后安装按钮也变成了移除按钮。这表明 Vivaldi 已经安装完成了。 -#### Step 3: Using Vivaldi +#### 第 3 步:使用 Vivaldi -Open the system menu by pressing the super (Windows) key and searching for Vivaldi. Click on the Vivaldi icon. +按下 Super(Windows)键打开系统菜单,搜索 Vivaldi,然后单击 Vivaldi 的图标。 -![Search for Vivaldi in the system menu][11] +![在系统菜单中搜索 Vivaldi][11] -You’ll see a screen like this on the first run. +首次启动时,你将看到如下界面。 -![Vivaldi running in Ubuntu][12] +![运行于 Ubuntu 的 Vivaldi][12] -Now that you know the this method, let me quickly show how to install Vivaldi on Ubuntu and Debian from the terminal. +既然你已经知道了这个方法,那我接下来将展示在 Ubuntu/Debian 使用终端安装 Vivaldi 的方法。 -### Method 2: Installing Vivaldi on Ubuntu and Debian from the command line +### 方式 2:借助终端,在 Ubuntu/Debian 上安装 Vivaldi -Open a terminal and make sure that you have wget installed for [downloading files in the command line.][13] +打开终端,确认你已经安装了用于 [在命令行下下载文件][13] 的 wget。 ``` sudo apt install wget ``` -Next, get the public key of the Vivaldi repository and add it to your system so that your system trusts the packages coming from it. If interested, read [this article about adding external repository in Ubuntu][14]. +接下来,获取 Vivaldi 仓库的公钥并添加到系统,以让系统信任该来源的软件包。如果你感兴趣的话,你可以阅读 [关于在 Ubuntu 添加第三方软件仓库的文章][14]。 ``` wget -qO- https://repo.vivaldi.com/archive/linux_signing_key.pub | sudo apt-key add - ``` -Once the key has been added, add Vivaldi repository as well: +添加完该密钥后,再添加 Vivaldi 的仓库: ``` sudo add-apt-repository 'deb https://repo.vivaldi.com/archive/deb/ stable main' ``` -Now you are almost set. Update the package cache and install it. +现在距离完成也只有一步之遥了。更新软件仓库缓存并安装 Vivaldi。 ``` sudo apt update && sudo apt install vivaldi-stable ``` -And that’s it. Search for it in the menu and start it from there. +大功告成。现在,前往系统菜单搜索并启动 Vivaldi 吧。 -### Updating Vivaldi on Ubuntu +### 在 Ubuntu 中更新 Vivaldi -Both GUI and command line methods add the Vivaldi repository to your system. This means that whenever there is a new Vivaldi release, you get it along with the system updates. +GUI 和命令行这两种方式都会在系统里添加 Vivaldi 的仓库。这意味着,只要 Vivaldi 发布了新版本,你就可以在系统更新中一并获取 Vivaldi 的更新。 -![Vivaldi repo is added to the system][15] +![已添加到系统中的 Vivaldi 仓库][15] -Basically, you update the Ubuntu system and it updates the Vivaldi browser if there is a new version available. +一般情况下,你更新 Ubuntu 系统时,如果 Vivaldi 发布了新版本,那么 Vivaldi 也同时会被更新。 -![Vivaldi browser is updated with the system updates][16] +![Vivaldi 浏览器会跟随系统更新][16] -### Removing Vivaldi from Ubuntu +### 在 Ubuntu 中卸载 Vivaldi -If you do not like Vivaldi or no longer want to use it, you can surely remove it. Now, to [uninstall applications from Ubuntu][17], you may use Software Center but it won’t find the external, third-party installed software. +如果你不喜欢 Vivaldi 或者不再使用,你可以直接卸载。现在,如果你想 [在 Ubuntu 中卸载软件][17],你可能会想到软件中心,但软件中心不会查找到外部和第三方的软件包。 -You’ll have to use the terminal now even though you used GUI method to install it. That’s really easy. Open a terminal and use the command below: +目前你必须使用终端卸载 Vivaldi,即便你使用 GUI 方式安装。其实这也很简单,打开终端,输入以下命令: ``` sudo apt remove vivaldi-stable ``` -Sudo gives you [root access in Ubuntu][18]. You’ll have to enter your account’s password. While entering the password, nothing is seen on the screen. That’s normal. Enter the password blindly and it will be removed. +sudo 会 [在 Ubuntu 中给予你 root 权限][18]。你需要输入当前账户的密码。输入密码时,你可能不会在屏幕上看见输入密码的痕迹。这是正常现象,直接输入密码即可,随后 Vivaldi 将被卸载。 -I hope you find this tutorial helpful in installing and using Vivaldi on Linux. +希望这篇关于如何在 Linux 安装 Vivaldi 的教程对你有用。 -------------------------------------------------------------------------------- From b273869bb0d143071f4bdb7bbe52e91a51d5895a Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 10 Oct 2021 10:26:53 +0800 Subject: [PATCH 0660/1588] Delete 20211010 .md --- sources/tech/20211010 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20211010 .md diff --git a/sources/tech/20211010 .md b/sources/tech/20211010 .md deleted file mode 100644 index 2c12f65567..0000000000 --- a/sources/tech/20211010 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/10/dark-mode-browser/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 02c9434b2dc75c860b860ab77e199c6ae2f90011 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, 10 Oct 2021 11:31:43 +0800 Subject: [PATCH 0661/1588] move --- ...all Vivaldi Browser on Ubuntu and Other Linux Distributions.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md (100%) diff --git a/sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md b/translated/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md similarity index 100% rename from sources/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md rename to translated/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md From 10a542f5510908e6c3f75ec7306e2ab8f035a559 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 Oct 2021 11:58:42 +0800 Subject: [PATCH 0662/1588] PRF&PUB @geekpi https://linux.cn/article-13868-1.html --- ...n Open-Source Translation App for Linux.md | 44 +++++++++---------- 1 file changed, 21 insertions(+), 23 deletions(-) rename {translated/tech => published}/20210929 Dialect- An Open-Source Translation App for Linux.md (56%) diff --git a/translated/tech/20210929 Dialect- An Open-Source Translation App for Linux.md b/published/20210929 Dialect- An Open-Source Translation App for Linux.md similarity index 56% rename from translated/tech/20210929 Dialect- An Open-Source Translation App for Linux.md rename to published/20210929 Dialect- An Open-Source Translation App for Linux.md index 0c4176f011..073ad4a64f 100644 --- a/translated/tech/20210929 Dialect- An Open-Source Translation App for Linux.md +++ b/published/20210929 Dialect- An Open-Source Translation App for Linux.md @@ -3,66 +3,66 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13868-1.html" Dialect:Linux 下的开源翻译应用 ====== -_**简介:**Dialect 是一个简单明了的应用,可以让你使用网络服务进行语言间的翻译。为了探索更多,让我们仔细看看。_ +![](https://img.linux.net.cn/data/attachment/album/202110/10/115724t5xgx8agu8asag0u.jpg) -虽然你可以启动网络浏览器并直接使用任何翻译服务来完成工作,但桌面应用有时会派上用场。 +> Dialect 是一个简单明了的应用,可以让你使用 Web 服务进行语言间的翻译。想要了解更多的话,让我们来一窥究竟。 -Dialect 是一个简单的翻译应用,利用网络服务进行翻译,同时给你一些额外的能力。 +虽然你可以启动 Web 浏览器并直接使用任何翻译服务来完成工作,但桌面应用有时会派上用场。 + +Dialect 是一个简单的翻译应用,可以利用 Web 服务进行翻译,同时给你一些额外的能力。 ### 使用谷歌翻译和 LibreTranslate 的开源翻译应用 ![][1] -Dialect 主要是一个为 GNOME 桌面定制的应用,但它在其他桌面环境下也应该能正常工作。 +Dialect 是一个主要为 GNOME 桌面定制的应用,但它在其他桌面环境下也应该能正常工作。 它可以让你快速翻译语言,同时还有一些额外的选项。 -在其核心部分,它让你在谷歌翻译或 LibreTranslate 之间选择翻译服务。 +在其核心部分,你可以选择谷歌翻译或 LibreTranslate 翻译服务。 -尽管 LibreTranslate 不能接近谷歌翻译的准确性,但把它作为一个选项来切换是一个很好的补充。至少,对于一些基本的用法,如果用户不想利用谷歌的服务,你的桌面上就有一个备选方案。 +尽管 LibreTranslate 达不到谷歌翻译的准确性,但把它作为一个选项来切换是一个很好的补充。至少,对于一些基本的用法,如果用户不想利用谷歌的服务,你的桌面上就有一个备选方案。 ### Dialect 的特点 ![][2] -除了切换翻译服务外,你还能得到: +除了切换翻译服务外,你还能得到如下个功能: * 发音 - * 文本到语音功能(谷歌) + * 文本到语音(TTS)功能(谷歌) * 黑暗模式 * 翻译快捷方式 * 实时翻译 * 剪贴板按钮可快速复制/粘贴 - * 翻译历史(撤销/重做)。 + * 翻译历史(撤销/重做) - - -正如你在截图中所注意到的,实时翻译功能可能会因为滥用 API 而使你的 IP 地址被禁止使用该服务。 +正如你在截图中所注意到的,实时翻译功能可能会因为滥用 API 而使你的 IP 地址被禁止使用服务。 ![][3] 我试着使用 LibreTranslate(如上图所示)和谷歌翻译,并启用实时翻译功能,它工作得很好。 -也许,如果你经常依赖翻译,你可能想避免这个功能。但是,对于我的临时使用,在相当多的测试中,这些服务并没有按 IP 地址禁止。 +也许,如果你经常依赖翻译,你可能想避免这个实时翻译。但是,对于我的临时使用,在相当多的测试中,该服务并没有导致 IP 地址被禁止。 重要的是要注意,如果你想,你可以指定一个自定义的 LibreTranslate 实例。默认情况下,它使用 “translate.astian.org” 作为实例。 -你可能找不到一个单独的翻译历史部分,但窗口左上角的箭头按钮会让你看到你以前的翻译和翻译设置。 +你可能找不到一个单独显示的翻译历史区域,但窗口左上角的箭头按钮会让你看到你以前的翻译,以及翻译设置。 所以,它也可以作为一个重做/撤销的功能。 ### 在 Linux 中安装 Dialect -Dialect 是以 [Flatpak][4] 的形式提供的。所以,你应该能够在你选择的任何 Linux 发行版上安装它。如果你是新手,你可能想看看我们的 [Flatpak 指南][5]以获得帮助。 +[Dialect][7] 是以 [Flatpak][4] 的形式提供的。所以,你应该能够在你选择的任何 Linux 发行版上安装它。如果你是新手,你可能想看看我们的 [Flatpak 指南][5] 以获得帮助。 -首先,添加Flathub 仓库: +首先,添加 Flathub 仓库: ``` flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo @@ -76,9 +76,7 @@ flatpak install flathub com.github.gi_lom.dialect 安装后,在系统菜单中寻找它,并从那里启动它。 -你也可以浏览它的 [GitHub 页面][6]了解更多信息。 - -[Dialect][7] +你也可以浏览它的 [GitHub 页面][6] 了解更多信息。 -------------------------------------------------------------------------------- @@ -87,7 +85,7 @@ via: https://itsfoss.com/dialect/ 作者:[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 6eae18d2209f322af585dfa542e7d3162b3963be Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 Oct 2021 14:16:23 +0800 Subject: [PATCH 0663/1588] APL --- sources/tech/20210929 Install Java manually on Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210929 Install Java manually on Linux.md b/sources/tech/20210929 Install Java manually on Linux.md index 62f170cd7e..dd879ba100 100644 --- a/sources/tech/20210929 Install Java manually on Linux.md +++ b/sources/tech/20210929 Install Java manually on Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/install-java-manually-linux" [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 6af6f3554c167f3c6d731328607615a102accb42 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 Oct 2021 14:39:20 +0800 Subject: [PATCH 0664/1588] TSL&PRF --- ...20210929 Install Java manually on Linux.md | 123 ------------------ ...20210929 Install Java manually on Linux.md | 118 +++++++++++++++++ 2 files changed, 118 insertions(+), 123 deletions(-) delete mode 100644 sources/tech/20210929 Install Java manually on Linux.md create mode 100644 translated/tech/20210929 Install Java manually on Linux.md diff --git a/sources/tech/20210929 Install Java manually on Linux.md b/sources/tech/20210929 Install Java manually on Linux.md deleted file mode 100644 index dd879ba100..0000000000 --- a/sources/tech/20210929 Install Java manually on Linux.md +++ /dev/null @@ -1,123 +0,0 @@ -[#]: subject: "Install Java manually on Linux" -[#]: via: "https://opensource.com/article/21/9/install-java-manually-linux" -[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Install Java manually on Linux -====== -Manual installation provides the user with the highest level of control -over the Java runtime environment. -![Penguin driving a car with a yellow background][1] - -It is easy to use your Linux distribution's package management tool to install the Java software packages. However, sometimes you need to do a manual installation of Java. This is of particular importance to administrators of Java-based application servers such as Tomcat or JBoss. Many open source and proprietary software products rely on these services. - -### Developer or Runtime kit? - -The Java Virtual Machine (JVM) is provided in two different forms: The Java Development Kit (JDK) or the Java Runtime Environment (JRE). - -Software developers usually need the JDK. It contains the binaries necessary for compiling, running, and testing the source code. To deploy a pre-built Java application generally only requires the JRE. It doesn't include the compilers and other development tools. The JRE is typically installed in production environments due to increased security and space limitations. - -### Get Java - -You can download open source Java software from the internet. You can find downloads of OpenJDK tarballs at [Red Hat Developer][2], [Adoptium.net][3], or the [Zulu Community edition][4] from Azul. - -### Install Java - -Set up a directory to hold the Java files. I like to create one simply called `java` so I can download and extract the tarball in a dedicated directory. - - -``` -`$ mkdir -p java/jdk` -``` - -Let's use the JDK in this example. Save the downloaded file to the `jdk` directory. Then change into that directory: - - -``` -$ cd java/jdk -$ ls -OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz -``` - -Extract the tarball. Note that `tar` will create a new directory: - - -``` -$ tar xvzf OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz -$ ls -jdk-11.0.12+7 OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz -``` - -Confirm the version of the new JVM using the `-version` option: - - -``` -$ cd jdk-11.0.12+7/bin -$ ./java -version -``` - -The version output of the JVM looks similar to this: - - -``` -openjdk version "11.0.12" 2021-07-20 -OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7) -OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode) -``` - -#### Environment variables - -To ensure that a given application works correctly, it needs to know exactly how to locate the JVM. Two main variables should be set: **JAVA_HOME** and **PATH**: - - -``` -$ echo $JAVA_HOME -$ echo $PATH -``` - -These can be set in the user's `.bashrc` file. Make sure that the variables come after [any existing code that sets **PATH**][5]: - - -``` -#Set the JAVA_HOME -export JAVA_HOME=~/java/jdk/jdk-11.0.12+7 -#Add the JAVA_HOME to the PATH -export PATH="$JAVA_HOME/bin:$PATH" -``` - -### Manual install situations - -Different situations require a manual installation of Java. Consider the following three scenarios. - -One situation could be a requirement for a different, perhaps older, version of Java that is not available in your Linux distribution's software repositories. - -Another example could be a security-driven decision that Java will not be installed on an operating system by default or at the "root level." - -A third situation could be the need for several different versions of Java, usually because multiple instances of a J2EE web application are running on the same server. This OS sharing is less common today due to the increased usage of virtual machines and containers to isolate processes. However, the need to maintain varying container images continues to make the understanding of manual installation vital. - -### Wrap up - -I demonstrated how I like to install the Java runtime environment but feel free to make up a convention that works best for your needs. Ultimately, manual installation provides the user with the highest level of control over the Java runtime environment. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/install-java-manually-linux - -作者:[Alan Formy-Duval][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/alanfdoss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) -[2]: https://developers.redhat.com/products/openjdk/download -[3]: https://adoptium.net/%20%22https://Adoptium.net%22 -[4]: https://www.azul.com/downloads/zulu-community%20%22https://www.azul.com/downloads/zulu-community%22 -[5]: https://opensource.com/article/17/6/set-path-linux diff --git a/translated/tech/20210929 Install Java manually on Linux.md b/translated/tech/20210929 Install Java manually on Linux.md new file mode 100644 index 0000000000..0bfee62ddd --- /dev/null +++ b/translated/tech/20210929 Install Java manually on Linux.md @@ -0,0 +1,118 @@ +[#]: subject: "Install Java manually on Linux" +[#]: via: "https://opensource.com/article/21/9/install-java-manually-linux" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +如何在 Linux 上手动安装 Java +====== + +> 手动安装可以让用户更好的控制 Java 运行时环境。 + +![](https://img.linux.net.cn/data/attachment/album/202110/10/143844wm2x4d18b1mb8md1.jpg) + +[使用 Linux 发行版的软件包管理工具来安装 Java 软件包][6] 是很容易的。然而,有时你需要手动安装 Java。这对基于 Java 的应用服务器(如 Tomcat 或 JBoss)的管理员特别重要。许多开源和专有软件产品都依赖于这些服务。 + +### 开发者或运行时套件? + +Java 虚拟机Java Virtual Machine(JVM)以两种不同的形式提供:Java 开发工具包Java Development Kit(JDK)或 Java 运行时环境Java Runtime Environment(JRE)。 + +软件开发人员通常需要 JDK。它包含编译、运行和测试源代码所需的二进制文件。部署一个预先建立的 Java 应用程序通常只需要 JRE。它不包括编译器和其他开发工具。由于安全性的提高和空间的限制,通常在生产环境中安装 JRE。 + +### 获取 Java + +你可以从网上下载开源的 Java 软件。你可以在 [Red Hat Developer][2]、[Adoptium.net][3] 下载 OpenJDK 打包文件,或从 Azul 下载 [Zulu 社区版][4] 。 + +### 安装 Java + +设置一个目录来存放 Java 文件。我喜欢创建一个简单的名为 `java` 的目录,这样我就可以在一个专门的目录中下载并解压打包文件: + +``` +$ mkdir -p java/jdk +``` + +让我们在这个例子中使用 JDK。将下载的文件保存到 `jdk` 目录下。然后换到该目录: + +``` +$ cd java/jdk +$ ls +OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz +``` + +提取该打包文件。注意,`tar` 会创建一个新的目录: + +``` +$ tar xvzf OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz +$ ls +jdk-11.0.12+7 OpenJDK11U-jdk_x64_linux_hotspot_11.0.12_7.tar.gz +``` + +使用 `-version` 选项确认新 JVM 的版本。 + +``` +$ cd jdk-11.0.12+7/bin +$ ./java -version +``` + +JVM 的版本输出看起来类似这样: + +``` +openjdk version "11.0.12" 2021-07-20 +OpenJDK Runtime Environment Temurin-11.0.12+7 (build 11.0.12+7) +OpenJDK 64-Bit Server VM Temurin-11.0.12+7 (build 11.0.12+7, mixed mode) +``` + +#### 环境变量 + +为了确保一个特定的应用程序能够正常工作,它需要确切地知道如何定位 JVM。有两个主要的变量需要设置:`JAVA_HOME` 和 `PATH`。 + +``` +$ echo $JAVA_HOME +$ echo $PATH +``` + +这些可以在用户的 `.bashrc` 文件中设置。确保这些变量出现在 [任何设置 PATH 的现有代码][5] 之后: + +``` +#Set the JAVA_HOME +export JAVA_HOME=~/java/jdk/jdk-11.0.12+7 +#Add the JAVA_HOME to the PATH +export PATH="$JAVA_HOME/bin:$PATH" +``` + +### 手动安装的情况 + +有几种情况需要手动安装 Java。请考虑以下三种情况: + +一种情况可能是要求使用不同的,也许是较早的,在你的 Linux 发行版的软件库中已经没有的 Java 版本。 + +另一个例子可能是由安全推动的决定,即 Java 不会被默认安装在操作系统上或在“根级别”上。 + +第三种情况是可能需要几个不同版本的 Java,通常是因为 J2EE Web 应用程序的多个实例在同一台服务器上运行。由于越来越多地使用虚拟机和容器来隔离进程,这种操作系统共享在今天已经不太常见了。然而,由于需要维护不同的容器镜像,对手动安装的理解仍然至关重要。 + +### 总结 + +我演示了我手动安装 Java 运行时环境的方式,但你可以制定一个最适合你需求的惯例。最终,手动安装让用户可以更好的控制 Java 运行时环境。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/install-java-manually-linux + +作者:[Alan Formy-Duval][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/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background) +[2]: https://developers.redhat.com/products/openjdk/download +[3]: https://adoptium.net/ +[4]: https://www.azul.com/downloads/zulu-community +[5]: https://opensource.com/article/17/6/set-path-linux +[6]: https://linux.cn/article-13864-1.html \ No newline at end of file From d510d3fa141c4ac9cf2a28b557238e844abd83b7 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 10 Oct 2021 14:41:14 +0800 Subject: [PATCH 0665/1588] PUB @wxy https://linux.cn/article-13869-1.html --- .../20210929 Install Java manually on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210929 Install Java manually on Linux.md (98%) diff --git a/translated/tech/20210929 Install Java manually on Linux.md b/published/20210929 Install Java manually on Linux.md similarity index 98% rename from translated/tech/20210929 Install Java manually on Linux.md rename to published/20210929 Install Java manually on Linux.md index 0bfee62ddd..32ba846089 100644 --- a/translated/tech/20210929 Install Java manually on Linux.md +++ b/published/20210929 Install Java manually on Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13869-1.html" 如何在 Linux 上手动安装 Java ====== From 789ef8c6f1ea05cc295e59c6fcb2e56d9c8bc6e2 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 11 Oct 2021 03:50:25 +0800 Subject: [PATCH 0666/1588] =?UTF-8?q?Revert=20"[=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=E7=94=B3=E9=A2=86]How=20to=20examine=20processes=20running=20o?= =?UTF-8?q?n=20Linux"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit ce6df47bbbb1ac43043d08a79bf2f0c85093e9d3. --- .../20200515 How to examine processes running on Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200515 How to examine processes running on Linux.md b/sources/tech/20200515 How to examine processes running on Linux.md index 92e75e679b..0659ab04f9 100644 --- a/sources/tech/20200515 How to examine processes running on Linux.md +++ b/sources/tech/20200515 How to examine processes running on Linux.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (runningwater) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -221,7 +221,7 @@ via: https://www.networkworld.com/article/3543232/how-to-examine-processes-runni 作者:[Sandra Henry-Stocker][a] 选题:[lujun9972][b] -译者:[runningwater](https://github.com/runningwater) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From b6bd932cfcd4aca1a3a04efd2fa628152f4ba5e3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 11 Oct 2021 05:04:10 +0800 Subject: [PATCH 0667/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211010?= =?UTF-8?q?=20Here=E2=80=99s=20Why=20You=20Can=20Consider=20Linux=20as=20a?= =?UTF-8?q?=20Content=20Creator?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md --- ...Can Consider Linux as a Content Creator.md | 151 ++++++++++++++++++ 1 file changed, 151 insertions(+) create mode 100644 sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md diff --git a/sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md b/sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md new file mode 100644 index 0000000000..79d986bf2a --- /dev/null +++ b/sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md @@ -0,0 +1,151 @@ +[#]: subject: "Here’s Why You Can Consider Linux as a Content Creator" +[#]: via: "https://news.itsfoss.com/linux-content-creator-choice/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Here’s Why You Can Consider Linux as a Content Creator +====== + +Rewind to four/five years back, I did not use Linux as my daily driver. Yes, in a virtual machine or dual-boot, sure. + +I stuck with Windows saying – “Linux isn’t user-friendly, and it’s all about the commands/terminal.” + +In my defense, I did not know a lot of things back then. But, when I finally took the leap of faith and started using Linux as a daily driver, I began to explore how things work and was blown away by many things. + +Including some of the compelling reasons why [Linux is better than Windows][1]. + +It took me a couple of days to understand the fundamentals and learn about the software utilities not available for Linux. + +But, surprisingly, I did not need to use Windows for most of my tasks, except multiplayer gaming. And, thanks to Valve, that’s about to change with the [support for BattleEye, and Easy-Anti Cheat added to Linux][2]. + +Fret not; I’m not one of those who recommends ditching other operating systems. You should always use what you are comfortable with. + +But, in this article, I want to highlight a few things why you may want to switch to Linux as a content creator like myself. + +### Efficient System Resource Usage + +![][3] + +I’m not exaggerating here, but if you are going to use [one of the best Linux distributions][4], your system resources will thank you for choosing Linux. + +Considering my scenario, I have an i5-7400 processor coupled with 16 GB of RAM. + +When I boot into Windows, the startup programs like the antivirus, software tools for peripherals, and others already eat up about 30-40% of my RAM. + +And, when I start using the browser or any other resource-intensive application, I barely get to multi-task freely. + +When it comes to Linux, unless I open many tabs in the browser or multiple programs, it does not consume a lot of memory out-of-the-box. + +Windows has a lot of services/processes running in the background, and you need to put in some effort to “de-bloat” your experience. But, Linux does not require such tweaks to manage the resources; it already does it well. + +I know it isn’t exactly an “Apples to Apples” comparison. Still, I would consider myself somewhat a power user with a lot of browser tabs active to research and multiple applications (communication, productivity, virtual machine program, etc.) while constantly monitoring system performance. + +Hence, in my experience, _I feel I can do more with Linux using the same resources compared to Windows._ + +And, as a content creator, you probably know how important it is to have an efficient system that maximizes your productivity without being a strain on your life. + +### Is It All About the Web Browsers? + +![][3] + +Let’s face it—most of the tools are being available as web services. While some programs/utilities may stick to native offerings, everything else is increasingly relying on cloud computing to help you get things done via the web browser. + +So, you should evaluate the tools you use and whether they are platform-dependent or not. + +If not, all you need to use is the web browser. + +To give you an example, I utilize a lot of tools right from the web browser like: + + * [Canva][5] + * [Microsoft Office 365][6] + * Web-based feed readers like Feedly, Inoreader + * Todist + * [CryptPad][7] + + + +And, if that’s the case, do you think there’s any reason to consider Windows? I’ll leave that up to you. + +Linux supports all the major web browsers, including Microsoft Edge. + +### Hassle-free Experience + +![][3] + +As a content creator, the less you worry about troubleshooting issues on your computer, the more time you save. + +I’m sure you know how Microsoft’s Windows fairs when it comes to buggy updates. Now and then, I will have to re-configure my audio settings or update the graphics driver, re-install programs, and clean junk files after an update. + +And, there have been a few instances where I just get stuck looking at the welcome screen after an update, annoyed by a feature added by Microsoft, and some more. + +Regarding my Linux experience, other than some NVIDIA graphics drivers issues (for some distributions like Fedora), I never had to troubleshoot for anything else. It has been a hassle-free journey so far! + +So, I focus on my work without even worrying about an update screwing up my system. + +The only inconvenience I found with Linux was developing the habit of – “_Distro hopping_,” meaning trying new Linux distributions. Considering there are a lot of choices for your desktop OS, you may be encouraged to try another distribution looking at its features. + +Here, let me point you to [Zorin OS 16][8] and [elementary OS 6][9] if you aren’t already using them (good luck!). + +### Applications for Audio, Video, and Digital Art/Photo + +While some users may warn you that Linux does not offer good application support, the answer isn’t that straightforward. + +Yes, you do not have the support for the Adobe suite and some commercial applications. But you do have alternatives. + +Of course, if you swear by a specific software tool, Linux is a big no for you. But, if you do not have specific requirements, you can always choose to explore the exciting alternatives available. + +You can find capable video editors like Kdenlive, tools like GIMP, and several other applications used by professionals. + +To get a better idea, you might want to check: + + * [Free video editors for Linux][10] + * [Tools for digital artists][11] + * [Audio editing tools][12] + + + +There are some decent, social media specific, browser-based video editors are also available. + +### Wrapping Up + +Overall, I believe that Linux can be a perfectly suitable choice for content creators and creative professionals. + +Linux as a desktop platform has improved a lot. And, with several Linux distributions pushing forward to enhance user experience, security, and reliability, it is an uncommon but beneficial choice that comes with benefits! + +What do you think about Linux as a choice for content creators? Let me know what you think 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/linux-content-creator-choice/ + +作者:[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/linux-better-than-windows/ +[2]: https://news.itsfoss.com/easy-anti-cheat-linux/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://itsfoss.com/best-linux-distributions/ +[5]: http://partner.canva.com/yRbxmN +[6]: https://www.office.com +[7]: https://itsfoss.com/cryptpad/ +[8]: https://news.itsfoss.com/zorin-os-16-features/ +[9]: https://news.itsfoss.com/elementary-os-6-features/ +[10]: https://itsfoss.com/best-video-editing-software-linux/ +[11]: https://itsfoss.com/best-linux-graphic-design-software/ +[12]: https://itsfoss.com/best-audio-editors-linux/ From 2f1a0dd54dc2131a64ef502c8c9b65137911b40d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 11 Oct 2021 05:04:19 +0800 Subject: [PATCH 0668/1588] add done: 20211010 Here-s Why You Can Consider Linux as a Content Creator.md --- sources/tech/20211011 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20211011 .md diff --git a/sources/tech/20211011 .md b/sources/tech/20211011 .md new file mode 100644 index 0000000000..1e72aeb17a --- /dev/null +++ b/sources/tech/20211011 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/10/ethernet-splitter-speed/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 67f85d5eeb50209847cc95bbd6224490f82e1114 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 11 Oct 2021 08:58:16 +0800 Subject: [PATCH 0669/1588] translated --- ...a deGoogled Alternative to Google Drive.md | 77 ------------------- ...a deGoogled Alternative to Google Drive.md | 72 +++++++++++++++++ 2 files changed, 72 insertions(+), 77 deletions(-) delete mode 100644 sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md create mode 100644 translated/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md diff --git a/sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md b/sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md deleted file mode 100644 index 496e8212b5..0000000000 --- a/sources/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md +++ /dev/null @@ -1,77 +0,0 @@ -[#]: subject: "/e/ cloud is a deGoogled Alternative to Google Drive" -[#]: via: "https://news.itsfoss.com/e-cloud/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -/e/ cloud is a deGoogled Alternative to Google Drive -====== - -Google Drive is a popular cloud storage service that works great for the most part. - -However, it may not be the most private option out there. So, to take total control of your data, the best way is to spin up a [Nextcloud][1] instance and store your essential data while getting access to other collaboration tools. - -While that sounds good to hear, not everyone can put the effort to create and maintain their instance. This is where ecloud comes in—built by the same team behind [**/e/ OS**, the de-googled Android operating system][2]. - -ecloud pitches itself primarily as a new private alternative to Google Drive and offers a mailbox to replace Gmail. - -### /e/ cloud: Nextcloud & OnlyOffice With Mailbox - -![][3] - -When you create an /e/ account, it gives you a private email address **[xyz@e.email][4]** - -And, along with the email address, you get **1 GB** free ecloud storage space and a collaboration platform powered by Nextcloud and OnlyOffice at its core. - -So, if you want to utilize Nextcloud and OnlyOffice to replace Google’s suite of tools without setting it up all yourself, /e/ cloud can be a compelling privacy-centric choice. - -![][5] - -In addition to the file storage and document support with OnlyOffice, you can also use a calendar, store notes, and add tasks. - -Hence, it can also be a decent privacy-focused collaboration platform that you can use for free. - -If you want more storage, you can upgrade your subscription to a paid plan where you opt for 20 to 1 TB of storage as required with monthly/yearly billing options. The pricing plans start as low as **$3/month**. - -Undoubtedly, it should be a seamless experience if you are using /e/ OS on your phone or a /e/ smartphone. - -But, you can also use it on any device using third-party mail clients and the Nextcloud mobile app. - -[Sign Up for /e/ cloud][6] - -### Wrapping Up - -Considering it is relatively new, several features are planned to be added that include end-to-end encryption, migration from Google Drive, and more. - -You can sign up for an account and try it out free. - -_What do you think about a mainstream solution like /e/ cloud that uses Nextcloud at its core to help you manage/store files securely in addition to email and collaboration services?_ - -#### 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/e-cloud/ - -作者:[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/nextcloud/ -[2]: https://itsfoss.com/e-os-review/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: mailto:xyz@e.email -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://e.foundation/e-email-invite/ diff --git a/translated/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md b/translated/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md new file mode 100644 index 0000000000..0abef81544 --- /dev/null +++ b/translated/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md @@ -0,0 +1,72 @@ +[#]: subject: "/e/ cloud is a deGoogled Alternative to Google Drive" +[#]: via: "https://news.itsfoss.com/e-cloud/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +/e/ cloud 是一个去谷歌化的 Google Drive 替代方案 +====== + +Google Drive 是一种流行的云存储服务,在大多数情况下效果很好。 + +然而,它可能不是最隐私的选择。因此,要完全控制你的数据,最好的办法是启动一个 [Nextcloud][1] 实例,存储你的基本数据,同时访问其他协作工具。 + +虽然这听起来不错,但不是每个人都能投入精力来创建和维护他们的实例。这就是 ecloud 上场的时候了,它是由 [**/e/ OS**,一个去谷歌化的安卓操作系统][2]背后的同一个团队建立的。 + +ecloud 主要将自己定位为 Google Drive 的一个新的私人替代品,并提供一个邮箱来取代 Gmail。 + +### /e/ cloud:带邮箱的 Nextcloud 及 OnlyOffice + +![][3] + +当你创建一个 /e/ 账户时,它会给你一个私人电子邮件地址 **[xyz@e.email][4]**。 + +而且,同邮箱地址一起,你会得到 **1GB** 的免费 ecloud 存储空间和一个由 Nextcloud 和 OnlyOffice 为核心的协作平台。 + +因此,如果你想利用 Nextcloud 和 OnlyOffice 来取代谷歌的工具套件,而不需要自己全部设置,/e/ cloud 可以成为一个引人注目的以隐私为中心的选择。 + +![][5] + +除了 OnlyOffice 的文件存储和文档支持外,你还可以使用日历,存储笔记,并添加任务。 + +因此,它也可以成为一个体面的以隐私为中心的协作平台,你可以免费使用。 + +如果你想要更多的存储空间,你可以将你的订阅升级到付费计划,你可以根据需要选择 20 到 1TB 的存储空间,并按月/年计费。定价计划起价低至 **3 美元/月**。 + +毫无疑问,如果你在手机上使用 /e/ 操作系统或 /e/ 智能手机,这应该是一种无缝体验。 + +但是,你也可以使用第三方邮件客户端和 Nextcloud 移动应用在任何设备上使用它。 + +[Sign Up for /e/ cloud][6] + +### 总结 + +考虑到它相对较新,计划增加几个功能,包括端到端加密,从 Google Drive 迁移等。 + +你可以注册一个帐户并免费试用。 + +_你认为像 /e/ cloud 这样以 Nextcloud 为核心的主流解决方案,除了电子邮件和协作服务外,还能帮助你安全地管理/存储文件吗?_ + + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/e-cloud/ + +作者:[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://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/nextcloud/ +[2]: https://itsfoss.com/e-os-review/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: mailto:xyz@e.email +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://e.foundation/e-email-invite/ From decfb789d495ec6acd0cb8546ba22e37145d2386 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 11 Oct 2021 09:04:36 +0800 Subject: [PATCH 0670/1588] translating --- .../20210930 How I use Ansible and anacron for automation.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210930 How I use Ansible and anacron for automation.md b/sources/tech/20210930 How I use Ansible and anacron for automation.md index 78de59d790..7df9a4d6be 100644 --- a/sources/tech/20210930 How I use Ansible and anacron for automation.md +++ b/sources/tech/20210930 How I use Ansible and anacron for automation.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/ansible-anacron-automation" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 8273e16b25b89eae016b90842334489fa62066be Mon Sep 17 00:00:00 2001 From: SamMa Date: Mon, 11 Oct 2021 09:39:16 +0800 Subject: [PATCH 0671/1588] Update 20211006 Check Java processes on Linux with the jps command.md --- ...processes on Linux with the jps command.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/translated/tech/20211006 Check Java processes on Linux with the jps command.md b/translated/tech/20211006 Check Java processes on Linux with the jps command.md index c8b986badd..b806986107 100644 --- a/translated/tech/20211006 Check Java processes on Linux with the jps command.md +++ b/translated/tech/20211006 Check Java processes on Linux with the jps command.md @@ -3,18 +3,18 @@ [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "turbokernel" [#]: publisher: " " [#]: url: " " -使用 jps 命令监测 Linux 上的 Java 进程 +在 Linux 上使用 jps 命令检查 Java 进程 ====== -系统上会运行很多进程,使用 jps 命令快速识别 Java 进程是一个很有用的方法。 +系统上运行着诸多进程,通过 jps 命令能够快速有效识别 Java 进程。 ![Coffee beans][1] -在 Linux 上,有一些命令可以用于查看系统上运行的进程。进程是指的是由内核管理的正在进行的事件。每当启动应用程序时,就会产生一个进程,但也有许多进程在计算机后台运行,像保持系统时间准确的程序、监视新文件系统的程序、索引化文件的程序等。有一些实用程序可以用来监测这些进程,比如包含在 [procps-ng 包][2] 中的那些程序,但它们往往都是对各种进程通用的。它们会查看计算机上的所有进程,你可以根据想要的内容来过滤结果列表。 +在 Linux 中,有一些用于查看系统上运行进程的命令。进程是指由内核管理的正在进行的事件。每启动一个应用程序时,就会产生一个进程,但也有许多在计算机后台运行的进程,如保持系统时间准确的进程、监听新文件系统的进程、索引化文件的进程等。有一些可以用来监测这些进程的实用程序,比如包含在 [procps-ng 包][2] 中的程序,但它们往往都是对各种进程通用的。它们会查看计算机上的所有进程,你可以根据需要过滤结果列表。 -在 Linux 上,可以使用 `ps` 命令查看进程。这是查看系统上正在运行的进程的最简单方法。 +在 Linux 中,可以通过 `ps` 命令查看进程。这是查看当前系统上运行进程最简单的方法。 ``` @@ -24,7 +24,7 @@ $ ps   66930 pts/0    00:00:00 ps ``` -你也可以使用 `ps` 命令,将结果输出到管道符 `grep`,从而查看系统上运行的 Java 进程,。 +你也可以通过 `ps` 命令,并配合结果输出管道符进行 `grep`,从而查看系统上运行的 Java 进程,。 ``` @@ -32,9 +32,9 @@ $ ps ax |grep java   67604 pts/1    Sl+    0:18 /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc34.x86_64/bin/java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties -jar /home/alan/wildfly/24.0.1/jboss-modules.jar -mp /home/alan/wildfly/24.0.1/modules org.jboss.as.standalone -Djboss.home.dir=/home/alan/wildfly/24.0.1 -Djboss.server.base.dir=/home/alan/wildfly/24.0.1/standalone ``` -然而,OpenJDK 有自己的特定进程监视器。Java 虚拟机进程状态 (jps) 工具可以帮你扫描系统上每个运行的 Java 虚拟机 (JVM) 实例。 +然而,OpenJDK 有自己专属的进程监视器。Java 虚拟机进程状态 (jps) 工具可以帮你扫描系统上所有运行的 Java 虚拟机 (JVM) 实例。 -要想实现与 `ps` 命令类似的输出,可以使用 `-v` 选项。这很实用,因为与 `ps` 相比,它可以减少你的输入。 +要想实现与 `ps` 命令类似的输出,可以使用 `-v` 选项。这很实用,这与 `ps` 相比,可以减少你的输入。 ``` @@ -42,7 +42,7 @@ $ jps -v 67604 jboss-modules.jar -D[Standalone] -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties ``` -`jps` 的默认输出会给出每个检测到的实例的进程标识符,以及类名或 Jar 文件名。 +`jps` 命令的默认输出包含进程标识符,类名或 Jar 文件名。 ``` @@ -51,9 +51,9 @@ $ jps 69430 Jps ``` -**注意:** `jps` 的手册页指出此命令是试验性且不受支持的。尽管如此,它仍然是一个不错的选择,因为通常一个系统上运行着许多进程,有这样一种只识别 Java 进程的快速方法是很有用的。 +**注意:** `jps` 的手册页指出此命令是试验性且不受支持的。尽管如此,它仍然是一个不错的选择,因为一个系统通常运行着许多进程,这种只识别 Java 进程的快速方法是很有用的。 -当下的 Java 仍然是一种流行的语言,所以熟悉 Java 开发工具包和运行时环境仍然很重要。它们里面包含着许多适用于 Java 应用程序开发和维护的工具。 +当下的 Java 仍然是一种流行的语言,所以熟悉 Java 开发工具包和运行时环境仍然很重要。它们包含着许多适用于 Java 应用程序开发和维护的工具。 -------------------------------------------------------------------------------- @@ -62,7 +62,7 @@ via: https://opensource.com/article/21/10/check-java-jps 作者:[Alan Formy-Duval][a] 选题:[lujun9972][b] 译者:[unigeorge](https://github.com/unigeorge) -校对:[校对者ID](https://github.com/校对者ID) +校对:[turbokernel](https://github.com/turbokernel) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 84048542ef6fe46ff6e5618bb845f9683832dd69 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 11 Oct 2021 10:14:32 +0800 Subject: [PATCH 0672/1588] Delete 20211011 .md --- sources/tech/20211011 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20211011 .md diff --git a/sources/tech/20211011 .md b/sources/tech/20211011 .md deleted file mode 100644 index 1e72aeb17a..0000000000 --- a/sources/tech/20211011 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/10/ethernet-splitter-speed/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 9e0326fc2797e4c8281187619b49a93fef871833 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 11 Oct 2021 10:29:22 +0800 Subject: [PATCH 0673/1588] PUB @unigeorge @turbokernel https://linux.cn/article-13871-1.html --- ... processes on Linux with the jps command.md | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) rename {translated/tech => published}/20211006 Check Java processes on Linux with the jps command.md (69%) diff --git a/translated/tech/20211006 Check Java processes on Linux with the jps command.md b/published/20211006 Check Java processes on Linux with the jps command.md similarity index 69% rename from translated/tech/20211006 Check Java processes on Linux with the jps command.md rename to published/20211006 Check Java processes on Linux with the jps command.md index b806986107..b43db9696d 100644 --- a/translated/tech/20211006 Check Java processes on Linux with the jps command.md +++ b/published/20211006 Check Java processes on Linux with the jps command.md @@ -4,19 +4,20 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "turbokernel" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13871-1.html" 在 Linux 上使用 jps 命令检查 Java 进程 ====== -系统上运行着诸多进程,通过 jps 命令能够快速有效识别 Java 进程。 -![Coffee beans][1] + +> 系统上运行着诸多进程,通过 `jps` 命令能够快速有效识别 Java 进程。 + +![](https://img.linux.net.cn/data/attachment/album/202110/11/102806lhhtyalq2lv2vbte.jpg) 在 Linux 中,有一些用于查看系统上运行进程的命令。进程是指由内核管理的正在进行的事件。每启动一个应用程序时,就会产生一个进程,但也有许多在计算机后台运行的进程,如保持系统时间准确的进程、监听新文件系统的进程、索引化文件的进程等。有一些可以用来监测这些进程的实用程序,比如包含在 [procps-ng 包][2] 中的程序,但它们往往都是对各种进程通用的。它们会查看计算机上的所有进程,你可以根据需要过滤结果列表。 在 Linux 中,可以通过 `ps` 命令查看进程。这是查看当前系统上运行进程最简单的方法。 - ``` $ ps     PID TTY          TIME CMD @@ -26,17 +27,15 @@ $ ps 你也可以通过 `ps` 命令,并配合结果输出管道符进行 `grep`,从而查看系统上运行的 Java 进程,。 - ``` $ ps ax |grep java -  67604 pts/1    Sl+    0:18 /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc34.x86_64/bin/java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties -jar /home/alan/wildfly/24.0.1/jboss-modules.jar -mp /home/alan/wildfly/24.0.1/modules org.jboss.as.standalone -Djboss.home.dir=/home/alan/wildfly/24.0.1 -Djboss.server.base.dir=/home/alan/wildfly/24.0.1/standalone + 67604 pts/1 Sl+ 0:18 /usr/lib/jvm/java-11-openjdk-11.0.12.0.7-4.fc34.x86_64/bin/java -D[Standalone] -server -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties -jar /home/alan/wildfly/24.0.1/jboss-modules.jar -mp /home/alan/wildfly/24.0.1/modules org.jboss.as.standalone -Djboss.home.dir=/home/alan/wildfly/24.0.1 -Djboss.server.base.dir=/home/alan/wildfly/24.0.1/standalone ``` -然而,OpenJDK 有自己专属的进程监视器。Java 虚拟机进程状态 (jps) 工具可以帮你扫描系统上所有运行的 Java 虚拟机 (JVM) 实例。 +然而,OpenJDK 有自己专属的进程监视器。Java 虚拟机进程状态Java Virtual Machine Process Status(jps)工具可以帮你扫描系统上所有运行的 Java 虚拟机(JVM)实例。 要想实现与 `ps` 命令类似的输出,可以使用 `-v` 选项。这很实用,这与 `ps` 相比,可以减少你的输入。 - ``` $ jps -v 67604 jboss-modules.jar -D[Standalone] -Xms64m -Xmx512m -XX:MetaspaceSize=96M -XX:MaxMetaspaceSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true --add-exports=java.desktop/sun.awt=ALL-UNNAMED --add-exports=java.naming/com.sun.jndi.ldap=ALL-UNNAMED --add-opens=java.base/java.lang=ALL-UNNAMED --add-opens=java.base/java.lang.invoke=ALL-UNNAMED --add-opens=java.base/java.io=ALL-UNNAMED --add-opens=java.base/java.security=ALL-UNNAMED --add-opens=java.base/java.util=ALL-UNNAMED --add-opens=java.management/javax.management=ALL-UNNAMED --add-opens=java.naming/javax.naming=ALL-UNNAMED -Dorg.jboss.boot.log.file=/home/alan/wildfly/24.0.1/standalone/log/server.log -Dlogging.configuration=file:/home/alan/wildfly/24.0.1/standalone/configuration/logging.properties @@ -44,7 +43,6 @@ $ jps -v `jps` 命令的默认输出包含进程标识符,类名或 Jar 文件名。 - ``` $ jps 67604 jboss-modules.jar From fec4edca04bebd94164b3df85352c0c999e55975 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 11 Oct 2021 10:35:01 +0800 Subject: [PATCH 0674/1588] APL --- sources/tech/20211010 Best Linux Distributions Based on KDE.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211010 Best Linux Distributions Based on KDE.md b/sources/tech/20211010 Best Linux Distributions Based on KDE.md index 44955e4795..ec42fb8056 100644 --- a/sources/tech/20211010 Best Linux Distributions Based on KDE.md +++ b/sources/tech/20211010 Best Linux Distributions Based on KDE.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/best-kde-distributions/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From e2b66c38d5090ccf3ba2411c355248726567087f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 11 Oct 2021 11:50:42 +0800 Subject: [PATCH 0675/1588] TSL&PRF --- ...0 Best Linux Distributions Based on KDE.md | 221 ------------------ ...0 Best Linux Distributions Based on KDE.md | 191 +++++++++++++++ 2 files changed, 191 insertions(+), 221 deletions(-) delete mode 100644 sources/tech/20211010 Best Linux Distributions Based on KDE.md create mode 100644 translated/tech/20211010 Best Linux Distributions Based on KDE.md diff --git a/sources/tech/20211010 Best Linux Distributions Based on KDE.md b/sources/tech/20211010 Best Linux Distributions Based on KDE.md deleted file mode 100644 index ec42fb8056..0000000000 --- a/sources/tech/20211010 Best Linux Distributions Based on KDE.md +++ /dev/null @@ -1,221 +0,0 @@ -[#]: subject: "Best Linux Distributions Based on KDE" -[#]: via: "https://itsfoss.com/best-kde-distributions/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Best Linux Distributions Based on KDE -====== - -KDE is one of the most customizable and fastest desktop environments out there. While you can always install KDE if you know-how, it is best to choose a Linux distribution that comes with KDE out-of-the-box. - -Here, let me list some of the best KDE-based Linux distros. - -### Linux Distributions With KDE Onboard - -No matter what you choose as your preferred distro, you can refer to our [KDE customization guide][1] to tweak your experience. - -**Note:** The list is in no particular order of ranking. - -### 1\. KDE Neon - -![][2] - -Key Highlights: - - * Official KDE distribution - * Latest stable KDE Plasma version - * Focuses on latest KDE software - * Not a perfect replacement as a desktop distro - - - -KDE Neon is one of the exciting choices if you want to get your hands on the latest KDE Plasma experience. - -Even if it utilizes a stable Ubuntu LTS base, you always get the newest KDE version delivered as soon as it is released. - -Unlike any other distros, it does not focus on a complete desktop user experience but the KDE software packages. So, it may not be the perfect desktop replacement for everyone. However, if you focus on using the latest KDE software, KDE Neon is a decent choice. - -The User Edition is what you need to opt for, but you also have the choice to try “Testing” or “Unstable” editions if you are willing to try pre-released features. - -If you wonder how it differs from Kubuntu, you should check out [KDE Neon vs Kubuntu][3] comparison to explore it. - -[KDE Neon][4] - -### 2\. Kubuntu - -![][5] - -Key Highlights: - - * An Ubuntu-based desktop-focused Linux distro - * Offers both LTS and non-LTS versions - * Good hardware compatibility - - - -Kubuntu should be an excellent distro for your Linux desktop if the KDE software suite is not your focus. - -Kubuntu is an official flavor of Ubuntu, which provides three years of updates for its LTS editions. Unlike KDE Neon, you get better support for various applications and are not just limited to KDE software. - -You get the option to opt for an LTS edition or a non-LTS version to get the latest Ubuntu features. - -Kubuntu has improved hardware compatibility when compared to some other KDE-based distros. Considering, it powers a variety of laptops that include Kubuntu Focus, Slimbook, and more, the hardware compatibility is something that you can rely on. - -### 3\. Manjaro KDE - -![][6] - -Key Highlights: - - * Arch-based Linux distro - * Rolling-release updates - * Presents a slight learning curve to new Linux users - - - -Manjaro is an Arch-Linux-based distribution that makes it easy to use Arch as a desktop Linux platform. - -It follows a rolling-release schedule, which should help you get the latest packages quickly without worrying about the software update period. - -If you are a new Linux user, you may want to stick to Flatpak or Snaps to install any application. While Manjaro makes it easy to use Arch, it does present a slight learning curve to new users. So, you might want to check the [Arch wiki][7] to explore more. - -### 4\. Fedora KDE Spin - -Key Highlights: - - * A unique KDE-based Linux distribution (if you don’t prefer mainstream Ubuntu/Arch distros) - * Tailored for workstations and servers - * May not be convenient for new Linux users - * Hardware compatibility can be an issue - - - -Fedora is an independent distribution (not based on Ubuntu/Arch) that acts as an upstream for Red Hat Enterprise Linux. - -And, Fedora spin editions feature alternate desktops for users. If you want KDE, you need to download Fedora’s KDE spin. - -Like KDE Neon, Fedora does not focus on providing a great desktop experience but aims to implement the latest technology useful for a workstation or server. - -So, if you are confident to tackle any issues/challenges that come with newer technology implementations on a Linux distro, Fedora KDE spin can be a good choice. - -[Fedora KDE Spin][8] - -### 5\. openSUSE - -![][9] - -Key Highlights: - - * Suitable for system administrators and developers requiring access to several tools - * Two different editions available including a stable and a rolling-release - - - -openSUSE is yet another independent Linux distribution featuring the KDE desktop by default. While it pitches itself as one of the choices for desktop users, I have had hardware compatibility issues in the past. - -However, it can be a good choice for system administrators or developers who want to access tools like YaST, Open Build Service, Kiwi, and more on their desktop, out-of-the-box. - -It offers a stable edition and a rolling-release version. As per your requirements, choose what’s best for you. - -[openSUSE][10] - -### 6\. Garuda Linux - -![][11] - -Key Highlights: - - * Rolling-release distro - * BTRFS as the default filesystem - * Comes with essential pre-installed GUI tools to make the Arch Linux experience easy - - - -Garuda Linux is a modern Arch-based distribution that focuses on a customized experience out-of-the-box. - -The KDE version (or the Dr460nized edition) offers a beautiful experience while tweaking it with a macOS-like workflow. - -Of course, if you are an experienced Linux user, you may customize your existing distribution to mimic the same experience. - -As a cherry on top, Garuda Linux also provides different variants of its KDE editions, one with pre-installing gaming tools, one for penetration testing, and another as an essential Linux desktop system. - -[Garuda Linux][12] - -### 7\. Nitrux OS - -![][13] - -Key Highlights: - - * Debian-based distribution for a change - * Unique desktop experience - - - -A Debian-based Linux distribution that features KDE out-of-the-box. Unlike Kubuntu, Nitrux may end up offering faster KDE plasma updates and newer Linux Kernel upgrades. - -Nitrux OS offers a beautiful and unique experience while featuring its NX Desktop. - -If you want to try something different with KDE onboard, Nitrux OS would be a great pick. - -[Nitrux OS][14] - -### 8\. MX Linux KDE - -![][15] - -Key Highlights: - - * Debian-based distro - * Lightweight - * Useful MX Tools pre-installed - - - -Don’t need the looks but want a simple and customizable KDE desktop with a Debian base? MX Linux KDE edition should be a fantastic choice as it is known for its snappy performance and pre-installed essential tools baked in. - -You also get several KDE themes if you want to tweak the default user experience. - -[MX Linux][16] - -### Wrapping Up - -In addition to this list, several other Linux distributions feature KDE desktop as their preferred choice. - -Nitrux OS should be a unique pick overall, and if you want to move away from Ubuntu-based distributions, there are solid arch-based distros like Garuda Linux and Manjaro to try. - -What is your favorite KDE-based Linux distribution? Do you focus on out-of-the-box customization or prefer to customize the KDE experience yourself? - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/best-kde-distributions/ - -作者:[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://itsfoss.com/kde-customization -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/08/kde-neon-information-20-04.jpg?resize=800%2C397&ssl=1 -[3]: https://itsfoss.com/kde-neon-vs-kubuntu/ -[4]: https://neon.kde.org/index -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-kde.jpg?resize=800%2C450&ssl=1 -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/manjaro-20-desktop.jpeg?resize=800%2C440&ssl=1 -[7]: https://wiki.archlinux.org -[8]: https://spins.fedoraproject.org/en/kde/ -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/opensuse-kde.png?resize=800%2C423&ssl=1 -[10]: https://www.opensuse.org -[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/Garuda-Linux-review.png?resize=800%2C450&ssl=1 -[12]: https://garudalinux.org -[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/nitrux-os-kde.png?resize=800%2C450&ssl=1 -[14]: https://nxos.org -[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde.jpg?resize=800%2C452&ssl=1 -[16]: https://mxlinux.org diff --git a/translated/tech/20211010 Best Linux Distributions Based on KDE.md b/translated/tech/20211010 Best Linux Distributions Based on KDE.md new file mode 100644 index 0000000000..f5e31ec324 --- /dev/null +++ b/translated/tech/20211010 Best Linux Distributions Based on KDE.md @@ -0,0 +1,191 @@ +[#]: subject: "Best Linux Distributions Based on KDE" +[#]: via: "https://itsfoss.com/best-kde-distributions/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +基于 KDE 的最佳 Linux 发行版 +====== + +KDE 是目前最具定制性和最快速的桌面环境之一。虽然你可以随时安装 KDE,但最好选择一个 KDE 开箱即用的 Linux 发行版。 + +在这里,让我列出一些最好的基于 KDE 的 Linux 发行版。 + +无论你选择什么作为你的首选发行版,你都可以参考我们的 [KDE 定制指南][1] 来调整你的体验。 + +注意:该列表没有特定的排名顺序。 + +### 1、KDE Neon + +![][2] + +主要亮点: + + * 官方 KDE 发行版 + * 最新的 KDE Plasma 稳定版 + * 专注于最新的 KDE 软件 + * 不是桌面发行版的完美替代品 + +如果你想获得 KDE Plasma 的最新体验,[KDE Neon][4] 是最佳选择之一。 + +即使它是建立在稳定版的 Ubuntu LTS 基础之上,你也总是能在最新的 KDE 版本发布后立即得到交付。 + +与其他发行版不同,它不注重完整的桌面用户体验,而是重点关注在 KDE 软件包上。所以,它可能不是每个人的完美桌面替代品。然而,如果你希望使用最新的 KDE 软件,KDE Neon 是一个不错的选择。 + +其“用户版”应该是你需要的,但如果你愿意尝试预先发布的功能,你也可以选择尝试“测试版”或“不稳定版”。 + +如果你想知道它与 Kubuntu 有什么不同,你应该查看 [KDE Neon vs Kubuntu][3] 的比较来探索它。 + +### 2、Kubuntu + +![][5] + +主要亮点: + + * 基于 Ubuntu 的以桌面为重点的 Linux 发行版 + * 提供 LTS 和非 LTS 版本 + * 良好的硬件兼容性 + +如果 KDE 软件套件不是你关注的重点,那么 Kubuntu 应该是你可以作为 Linux 桌面使用的一个优秀发行版。 + +Kubuntu 是 Ubuntu 的一个官方版本,它为其 LTS 版本提供了三年的更新支持。与 KDE Neon 不同的是,你可以得到对各种应用程序更好的支持,而不仅仅是局限于 KDE 软件。 + +你可以选择 LTS 版或非 LTS 版来获得最新的 Ubuntu 功能。 + +与其他一些基于 KDE 的发行版相比,Kubuntu 具有更好的硬件兼容性。考虑到它可以为各种笔记本电脑提供动力,如 Kubuntu Focus、Slimbook 等,其硬件兼容性是你可以信赖的。 + +### 3、Manjaro KDE + +![][6] + +主要亮点: + + * 基于 Arch 的 Linux 发行版 + * 滚动式发布更新 + * 对于新的 Linux 用户来说学习难度不大 + +Manjaro 是一个基于 Arch Linux 的发行版,它使得使用 Arch 作为桌面 Linux 平台变得容易。 + +它按照滚动发布的时间表进行发布,这应该有助于你快速获得最新的软件包,而不必担心软件更新时间。 + +如果你是一个新的 Linux 用户,你可以考虑一直使用 Flatpak 或 Snaps 来安装各种应用程序。虽然 Manjaro 让你很容易使用 Arch,但它对新用户来说多多少少还是有一点学习曲线。所以,你可能需要查看 [Arch 维基][7] 来了解更多信息。 + +### 4、Fedora KDE Spin + +主要亮点: + + * 一个独特的基于 KDE 的 Linux 发行版(如果你不喜欢主流的 Ubuntu/Arch 发行版) + * 为工作站和服务器量身定做 + * 对于新的 Linux 用户来说可能需要适应 + * 硬件兼容性可能是个问题 + +Fedora 是一个独立的发行版(不基于 Ubuntu/Arch),作为 Red Hat Enterprise Linux 的上游。 + +而 Fedora Spin 版为用户提供了各种备用的桌面。如果你想要 KDE,你需要下载 Fedora 的 KDE Spin。 + +像 KDE Neon 一样,Fedora 并不专注于提供一个最佳的桌面体验,而是旨在实验对工作站或服务器有用的最新技术。 + +因此,如果你有信心解决 Linux 发行版上较新技术实现所带来的任何问题/挑战,[Fedora KDE Spin][8] 是一个不错的选择。 + +### 5、openSUSE + +![][9] + +主要亮点: + + * 适用于需要使用多种工具的系统管理员和开发人员 + * 有两个不同的版本,包括稳定版和滚动版 + +[openSUSE][10] 是另一个独立的 Linux 发行版,默认采用 KDE 桌面。虽然它把自己定位为桌面用户的选择之一,但我在过去曾遇到过硬件兼容性问题。 + +然而,对于想在桌面上使用 YaST、Open Build Service、Kiwi 等工具的系统管理员或开发者来说,它是一个很好的选择,开箱即用。 + +它提供了一个稳定版和一个滚动发布版。根据你的要求选择最适合你的。 + +### 6、Garuda Linux + +![][11] + +主要亮点: + + * 滚动发布的发行版 + * BTRFS 作为默认文件系统 + * 预装了基本的 GUI 工具,使 Arch Linux 的使用变得简单 + +[Garuda Linux][12] 是一个基于 Arch 的现代发行版,专注于开箱即用的定制体验。 + +KDE 版本(或 Dr460nized 版本)提供了漂亮的体验,同时可使用类似 macOS 的工作流程进行调整。 + +当然,如果你是一个有经验的 Linux 用户,你可以定制你现有的发行版来模仿同样的体验。 + +锦上添花的是,Garuda Linux 还提供了其 KDE 版本的不同变体,一个预装了游戏工具,一个用于渗透测试,另一个作为基本的 Linux 桌面系统。 + +### 7、Nitrux OS + +![][13] + +主要亮点: + + * 基于 Debian 的发行版,不同的风格 + * 独特的桌面体验 + +一个基于 Debian 的 Linux 发行版,具有开箱即用的 KDE。与 Kubuntu 不同,Nitrux 最终可能提供的是一个更快的 KDE Plasma 更新和较新的 Linux 内核升级。 + +[Nitrux OS][14] 在以其 NX 桌面为特色的同时,提供了一个美丽而独特的体验。 + +如果你想尝试一些不同的 KDE 搭载,Nitrux OS 将是一个不错的选择。 + +### 8、MX Linux KDE + +![][15] + +主要亮点: + + * 基于 Debian 的发行版 + * 轻量级 + * 预装了有用的 MX 工具 + +不在意外观,但想要一个简单的、可定制的、基于 Debian 的 KDE 桌面?[MX Linux KDE 版][16] 应该是一个很好的选择,因为它以迅捷的性能和预装的基本工具而闻名。 + +如果你想调整默认的用户体验,你还可以得到几个 KDE 主题。 + +### 总结 + +在这个列表之外,其他几个 Linux 发行版也将 KDE 桌面作为他们的首选。 + +总体来说,Nitrux OS 应该是一个独特的选择,如果你想远离基于 Ubuntu 的发行版,还有像 Garuda Linux 和 Manjaro 这样基于 Arch 的可靠发行版可以尝试。 + +你最喜欢的基于 KDE 的 Linux 发行版是什么?你是专注于开箱即用的定制,还是喜欢自己定制 KDE 体验? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/best-kde-distributions/ + +作者:[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://itsfoss.com/kde-customization +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/08/kde-neon-information-20-04.jpg?resize=800%2C397&ssl=1 +[3]: https://itsfoss.com/kde-neon-vs-kubuntu/ +[4]: https://neon.kde.org/index +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-kde.jpg?resize=800%2C450&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/11/manjaro-20-desktop.jpeg?resize=800%2C440&ssl=1 +[7]: https://wiki.archlinux.org +[8]: https://spins.fedoraproject.org/en/kde/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/opensuse-kde.png?resize=800%2C423&ssl=1 +[10]: https://www.opensuse.org +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/12/Garuda-Linux-review.png?resize=800%2C450&ssl=1 +[12]: https://garudalinux.org +[13]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/nitrux-os-kde.png?resize=800%2C450&ssl=1 +[14]: https://nxos.org +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/08/mx-linux-19-2-kde.jpg?resize=800%2C452&ssl=1 +[16]: https://mxlinux.org From b04551a3da57e8fc66c8bb0d42d39b14b418f68a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 11 Oct 2021 11:56:33 +0800 Subject: [PATCH 0676/1588] PUB @wxy --- .../20211010 Best Linux Distributions Based on KDE.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211010 Best Linux Distributions Based on KDE.md (98%) diff --git a/translated/tech/20211010 Best Linux Distributions Based on KDE.md b/published/20211010 Best Linux Distributions Based on KDE.md similarity index 98% rename from translated/tech/20211010 Best Linux Distributions Based on KDE.md rename to published/20211010 Best Linux Distributions Based on KDE.md index f5e31ec324..3c4f2d2fe5 100644 --- a/translated/tech/20211010 Best Linux Distributions Based on KDE.md +++ b/published/20211010 Best Linux Distributions Based on KDE.md @@ -4,12 +4,14 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13872-1.html" 基于 KDE 的最佳 Linux 发行版 ====== +![](https://img.linux.net.cn/data/attachment/album/202110/11/115436wngdi7vndoodjnfd.jpg) + KDE 是目前最具定制性和最快速的桌面环境之一。虽然你可以随时安装 KDE,但最好选择一个 KDE 开箱即用的 Linux 发行版。 在这里,让我列出一些最好的基于 KDE 的 Linux 发行版。 From d7e6571fc09935adee9f7fd57bff959afdad2b1d Mon Sep 17 00:00:00 2001 From: perfiffer Date: Mon, 11 Oct 2021 22:38:34 +0800 Subject: [PATCH 0677/1588] translated by perfiffer --- ...20210923 Build your website with Jekyll.md | 189 ------------------ ...20210923 Build your website with Jekyll.md | 177 ++++++++++++++++ 2 files changed, 177 insertions(+), 189 deletions(-) delete mode 100644 sources/tech/20210923 Build your website with Jekyll.md create mode 100644 translated/tech/20210923 Build your website with Jekyll.md diff --git a/sources/tech/20210923 Build your website with Jekyll.md b/sources/tech/20210923 Build your website with Jekyll.md deleted file mode 100644 index c322fe4937..0000000000 --- a/sources/tech/20210923 Build your website with Jekyll.md +++ /dev/null @@ -1,189 +0,0 @@ -[#]: subject: "Build your website with Jekyll" -[#]: via: "https://opensource.com/article/21/9/build-website-jekyll" -[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" -[#]: collector: "lujun9972" -[#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Build your website with Jekyll -====== -Jekyll is an open source static site generator. You can write your -content in Markdown, use HTML/CSS for structure and presentation, and -Jekyll compiles it all into static HTML. -![Person using a laptop][1] - -Static website generators and JAMStack have taken off in recent years. And with good reason. There is no need for complex backends with only static HTML, CSS, and Javascript to serve. Not having backends means better security, lower operational overhead, and cheaper hosting. A win-win-win! - -In this article, I'm going to talk about Jekyll. As of this writing, [my personal website uses Jekyll][2]. Jekyll uses a Ruby engine to convert articles written in Markdown to generate HTML. [Sass][3] allows merging complex CSS rules into flat files. [Liquid][4] allows some programmatic control over otherwise static content. - -### Install Jekyll - -The [Jekyll website][5] has installation instructions for Linux, MacOS, and Windows. After installation, the [Quickstart guide][6] will set up a basic Hello-World project. - -Now visit `http://localhost:4000` in your browser. You should see your default "awesome" blog. - -![Default "awesome" blog][7] - -Screenshot by Ayush Sharma, [CC BY-SA 4.0][8] - -### Directory structure - -The default site contains the following files and folders: - - * `_posts`: Your blog entries. - * `_site`: The final compiled static website. - * `about.markdown`: Content for the about page. - * `index.markdown`: Content for the home page. - * `404.html`: Content for the 404 page. - * `_config.yml`: Site-wide configuration for Jekyll. - - - -### Creating new blog entries - -Creating posts is simple. All you need to do is create a new file under `_posts` with the proper format and extension, and you’re all set. - -A valid file name is `2021-08-29-welcome-to-jekyll.markdown`. A post file must contain what Jekyll calls the YAML Front Matter. It’s a special section at the beginning of the file with the metadata. If you see the default post, you’ll see the following: - - -``` -\--- -layout: post -title: "Welcome to Jekyll!" -date:  2021-08-29 11:28:12 +0530 -categories: jekyll update -\--- -``` - -Jekyll uses the above metadata, and you can also define custom `key: value` pairs. If you need some inspiration, [have a look at my website's front matter][9]. Aside from the front matter, you can [use in-built Jekyll variables][10] to customize your website. - -Let’s create a new post. Create `2021-08-29-ayushsharma.markdown` in the `_posts` folder. Add the following content: - - -``` -\--- -layout: post -title:  "Check out ayushsharma.in!" -date:   2021-08-29 12:00:00 +0530 -categories: mycategory -\--- -This is my first post. - -# This is a heading. - -## This is another heading. - -This is a [link]() - -This is my category: -``` - -If the `jekyll serve` command is still running, refresh the page, and you'll see the new entry below. - -![New blog entry][11] - -Screenshot by Ayush Sharma, [CC BY-SA 4.0][8] - -Congrats on creating your first article! The process may seem simple, but there's a lot you can do with Jekyll. Using simple markdown, you can generate an archive of posts, syntax highlighting for code snippets, and separate pages for posts in one category. - -### Drafts - -If you're not ready to publish your content yet, you can create a new `_drafts` folder. Markdown files in this folder are only rendered by passing the `--drafts` argument. - -### Layouts and Includes - -Note the front matter of the two articles in our `_posts` folder, and you'll see `layout: post` in the Front Matter. The `_layout` folder contains all the layouts. You won't find them in your source code because Jekyll loads them by default. The default source code used by Jekyll is [here][12]. If you follow the link, you'll see that the `post` layout uses the [`default` layout][13]. The default layout contains the code `{{ content }}` which is where content is injected. The layout files will also contain `include` directives. These load files from the [`includes` folder][14] and allow composing a page using different components. - -Overall, this is how layouts work—you define them in the front matter and inject your content within them. Includes provide other sections of the page to compose a whole page. This is a standard web-design technique—defining header, footer, aside, and content elements and then injecting content within them. This is the real power of static site generators—full programmatic control over assembling your website with final compilation into static HTML. - -### Pages - -Not all content on your website will be an article or a blog post. You'll need about pages, contact pages, project pages, or portfolio pages. This is where Pages come in. They work exactly like Posts do, meaning they're markdown files with front matter. But they don't go in the `_posts` directory. They either stay in your project root or in folders of their own. For Layouts and Includes, you can use the same ones as you do for your Posts or create new ones. Jekyll is very flexible and you can be as creative as you want! Your default blog already has `index.markdown` and `about.markdown`. Feel free to customize them as you wish. - -### Data files - -Data files live in the `_data` directory, and can be `.yml`, `.json`, or `.csv`. For example, a `_data/members.yml` file may contain: - - -``` -\- name: A - github: a@a - -\- name: B - github: b@b - -\- name: C - github: c@c -``` - -Jekyll reads these during site generation. You can access them using `site.data.members`. - - -``` -<ul> -{ % for member in site.data.members %} - <li> - <a href="[https://github.com/"\>][15] -      { { member.name }} - </a> - </li> -{ % endfor %} -</ul> -``` - -### Permalinks - -Your `_config.yml` file defines the format of your permalinks. You can [use a variety of default variables][16] to assemble your own custom permalink. - -### Building your final website - -The command `jekyll serve `is great for local testing. But once you're done with local testing, you'll want to build the final artifact to publish. The command `jekyll build --source source_dir --destination destination_dir` builds your website into the `_site` folder. Note that this folder is cleaned up before every build, so don't place important things in there. Once you have the content, you can host it on a static hosting service of your choosing. - -You should now have a decent overall grasp of what Jekyll is capable of and what the main bits and pieces do. If you’re looking for inspiration, the official [JAMStack website has some amazing examples][17]. - -![Example Jekyll sites from JAMStack][18] - -Screenshot by Ayush Sharma, [CC BY-SA 4.0][8] - -Happy coding :) - -* * * - -_This article was originally published on the [author's personal blog][19] and has been adapted with permission._ - -See how Jekyll, an open source generator of static HTML files, makes running a blog as easy as... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/build-website-jekyll - -作者:[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/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop) -[2]: https://gitlab.com/ayush-sharma/ayushsharma-in -[3]: https://sass-lang.com/ -[4]: https://shopify.github.io/liquid/ -[5]: https://jekyllrb.com/docs/installation/ -[6]: https://jekyllrb.com/docs/ -[7]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-welcome-to-jekyll.png (Default "awesome" blog) -[8]: https://creativecommons.org/licenses/by-sa/4.0/ -[9]: https://gitlab.com/ayush-sharma/ayushsharma-in/-/blob/2.0/_posts/2021-07-15-the-evolution-of-ayushsharma-in.md -[10]: https://jekyllrb.com/docs/variables/ -[11]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-new-article.png (New blog entry) -[12]: https://github.com/jekyll/minima/blob/master/_layouts/post.html -[13]: https://github.com/jekyll/minima/blob/master/_layouts/default.html#L12 -[14]: https://github.com/jekyll/minima/tree/master/_includes -[15]: https://github.com/"\> -[16]: https://jekyllrb.com/docs/permalinks/ -[17]: https://jamstack.org/examples/ -[18]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-jamstack-examples.png (Example Jekyll sites from JAMStack) -[19]: https://notes.ayushsharma.in/2021/08/introduction-to-jekyll diff --git a/translated/tech/20210923 Build your website with Jekyll.md b/translated/tech/20210923 Build your website with Jekyll.md new file mode 100644 index 0000000000..b46e6f1a6f --- /dev/null +++ b/translated/tech/20210923 Build your website with Jekyll.md @@ -0,0 +1,177 @@ +[#]: subject: "Build your website with Jekyll" +[#]: via: "https://opensource.com/article/21/9/build-website-jekyll" +[#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" +[#]: collector: "lujun9972" +[#]: translator: "perfiffer" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +使用 Jekyll 构建你的网站 +====== +Jekyll 是一个开源的静态的网站生成器。你可以使用 Markdown 编写内容,使用 HTML/CSS 来构建和展示,Jekyll 会将其编译为静态的 HTML。 +![Person using a laptop][1] + +静态网站生成器和 JAMStack 近年来开始流行。而且理由很充分。不需要复杂的后端,只需要静态的 HTML、CSS 和 Javascript。没有后端意味着更好的安全性、更低的运营开销和更便宜的托管。双赢! + +在本文中,我将讨论 Jekyll。在撰写本文时,[我的个人网站使用 Jekyll][2]。Jekyll 使用 Ruby 引擎将用 Markdown 编写的文章转换成 HTML。[Sass][3] 可以将复杂的 CSS 规则应用到平面文件中。[Liquid][4] 允许对静态内容进行编程控制。 + +### 安装 Jekyll + +[Jekyll 网站][5] 提供 Linux、MacOS 和 Windows 安装说明。安装完成之后,[快速引导][6] 将会安装一个基础的 Hello-World 项目。 + +现在在你的浏览器访问 `http://localhost:4000`。你可以看到一个默认的很棒的博客。 + +![Default "awesome" blog][7] + +### 目录结构 + +站点默认包含以下的文件和文件夹: + + * `_posts`: 你的博客条目。 + * `_site`: 最终编译的静态网站文件。 + * `about.markdown`: 关于页面内容。 + * `index.markdown`: 主页页面内容。 + * `404.html`: 404 页面内容。 + * `_config.yml`: Jekyll 的全站配置文件。 + + +### 创建新的博客条目 + +创建帖子很简单。你需要做的就是在 `_post` 目录下使用正确的格式和扩展名创建一个新文件,这样就完成了。 + +有效的文件名像 `2021-08-29-welcome-to-jekyll.markdown`这样。一个博客文件必须包含 Jekyll 所称的 YAML 前置。它是包含元数据的文件开头的一个特殊部分。如果你看到默认的帖子,你可以看到以下内容: + +``` +--- +layout: post +title: "Welcome to Jekyll!" +date:  2021-08-29 11:28:12 +0530 +categories: jekyll update +--- +``` + +Jekyll 使用上面的元数据,你可以自定义 `key: value` 键值对。如果你需要一些灵感,[请查看我的网站前置内容][9]。除了前面的问题,你还可以[使用内置的 Jekyll 变量][10] 来自定义你的网站。 + +让我们创建一个新的帖子。在 `_posts` 文件夹下创建 `2021-08-29-ayushsharma.markdown`。内容如下: + +``` +--- +layout: post +title:  "Check out ayushsharma.in!" +date:   2021-08-29 12:00:00 +0530 +categories: mycategory +--- +This is my first post. + +# This is a heading. + +## This is another heading. + +This is a [link]() + +This is my category: +``` + +如果 `jekyll serve` 命令仍在运行,刷新页面,你将看到下面的新条目。 + +![New blog entry][11] + +恭喜你创建了你的第一篇文章!这个过程看起来很简单,但是你可以通过 Jekyll 做很多事情。使用简单的 Markdown,你可以归档博客、代码片段的高亮显示以及帖子的分类管理。 + +### 草稿 + +如果你还没准备好发布你的内容,你可以创建一个 `_drafts` 文件夹。此文件夹中的 Markdown 文件仅通过传递 `--drafts--` 参数来呈现。 + +### 布局和包含 + +请注意 `_post` 文件夹中两篇文章的前面内容,你将在前置内容中看到 `layout: post`。`_layout` 文件夹中包含所有布局。你不会在源代码中找到它们,因为 Jekyll 默认加载它们。Jekyll 使用的默认源代码在[这里][12]。如果你点击链接,你可以看到博客布局使用默认布局。默认布局包含 `{{ content }}` 注入内容的代码。布局文件还将包含 `include` 指令。它们从[包含文件夹][14]加载文件并允许使用不同的组件组成页面。 + +总的来说,这就是布局的工作方式-你在最前面定义它们并将你的内容注入其中。Includes 提供页面的其它部分以组成整个页面。这是一种标准的网页设计技术--定义页眉、页脚、旁白和内容元素,然后在其中注入内容。这就是静态站点生成器的真正威力--完全以编程的方式控制将你的网站组装起来并最终编译成静态的 HTML。 + +### 页面 + +你网站上的所有内容并不都是文章或博客。你将需要关于页面、联系页面、项目页面或投资组合页面。这就是 Pages 的用武之地。它们的工作方式与 Posts 完全一样,这意味着它们是带有前置块的 Markdown 文件。但它们不会进入 `_posts` 目录。它们要么保留在你的项目根目录中,要么保留在它们自己的文件夹中。对于布局和包含,你可以使用与帖子相同的布局或创建新帖子。 Jekyll 非常灵活,你可以随心所欲地发挥你的创意!你的默认博客已经有 `index.markdown` 和 `about.markdown`。随意自定义它们。 + +### 数据文件 + +数据文件位于 `_data` 目录中,可以是 `.yml`,`.json`,`.csv` 格式文件。例如,一个 `_data/members.yml` 文件可能包含: + +``` +- name: A + github: a@a + +- name: B + github: b@b + +- name: C + github: c@c +``` + +Jekyll 在网站生成的时候读取这些内容。你可以通过 `site.data.members` 访问它们。 + + +``` + +``` + +### 永久链接 + +你的 `_config.yml` 文件定义了永久链接的格式。你可以使用各种默认变量来组合你自己的自定义永久链接。 + +### 构建你最终的网站 + +命令 `jekyll serve` 非常适合本地测试。但是一旦你完成了本地测试,你将需要构建要发布的最终工作。命令 `jekyll build --source source_dir --destination destination_dir` 将你的网站构建到 `_site` 文件夹中。请注意,此文件夹在每次构建之前都会被清理,所以不要将重要的东西放在那里。获得内容后,你可以将其托管在你的静态托管服务上。 + +你现在应该对 Jekyll 的功能以及主要部分的功能有一个全面的了解。如果你正在寻找灵感,官方 [JAMStack 网站上有一些很棒的例子][17]。 + +![Example Jekyll sites from JAMStack][18] + +快乐编码 :) + +* * * + +本文首发于[作者个人博客][19],经授权改编。 + +了解 Jekyll,一个静态 HTML 文件的开源生成器,如何让运行博客变得像... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/build-website-jekyll + +作者:[Ayush Sharma][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/ayushsharma +[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://gitlab.com/ayush-sharma/ayushsharma-in +[3]: https://sass-lang.com/ +[4]: https://shopify.github.io/liquid/ +[5]: https://jekyllrb.com/docs/installation/ +[6]: https://jekyllrb.com/docs/ +[7]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-welcome-to-jekyll.png (Default "awesome" blog) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://gitlab.com/ayush-sharma/ayushsharma-in/-/blob/2.0/_posts/2021-07-15-the-evolution-of-ayushsharma-in.md +[10]: https://jekyllrb.com/docs/variables/ +[11]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-new-article.png (New blog entry) +[12]: https://github.com/jekyll/minima/blob/master/_layouts/post.html +[13]: https://github.com/jekyll/minima/blob/master/_layouts/default.html#L12 +[14]: https://github.com/jekyll/minima/tree/master/_includes +[15]: https://github.com/"\> +[16]: https://jekyllrb.com/docs/permalinks/ +[17]: https://jamstack.org/examples/ +[18]: https://opensource.com/sites/default/files/uploads/2016-08-15-introduction-to-jekyll-jamstack-examples.png (Example Jekyll sites from JAMStack) +[19]: https://notes.ayushsharma.in/2021/08/introduction-to-jekyll From 299de03b94ac0b59e24dde757e827cdb180272d1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 12 Oct 2021 05:03:23 +0800 Subject: [PATCH 0678/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211012?= =?UTF-8?q?=20Seahorse:=20Manage=20Your=20Passwords=20&=20Encryption=20Key?= =?UTF-8?q?s=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md --- ...ur Passwords - Encryption Keys in Linux.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md diff --git a/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md b/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md new file mode 100644 index 0000000000..4117f0be59 --- /dev/null +++ b/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md @@ -0,0 +1,92 @@ +[#]: subject: "Seahorse: Manage Your Passwords & Encryption Keys in Linux" +[#]: via: "https://itsfoss.com/seahorse/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Seahorse: Manage Your Passwords & Encryption Keys in Linux +====== + +_**Brief:**_ _A simple open-source password and encryption key manager app, let’s explore what it has to offer and how you can get it installed._ + +We often tend to ignore many default/pre-installed applications, especially when numerous tools and utilities are baked in. + +One such helpful tool that you can use on various Linux distributions is **GNOME’s Seahorse**. + +### Seahorse: GNOME’s Password & Encryption Key Manager + +![][1] + +Primarily, Seahorse is an application that comes pre-installed with GNOME desktop and tailored for the same. + +However, you can use it on just about any Linux distribution of your choice. It is a simple and effective utility to manage your passwords and encryption keys / keyring locally. + +You might want to read about the [concept of keyring in Linux][2] if it’s a first for you. + +If you are not a fan of cloud-based password managers, Seahorse can be a great solution to your requirements. Even though it looks straightforward, there are a few essential features that you may find useful. + +Of course, you should also explore some of the [best password managers available for Linux][3] if your priority doesn’t involve managing encryption keys (or local storage). + +### Features of Seahorse + +While you can easily use it as a local (offline) password manager, there are a couple of things that you can do with Seahorse to step up your security management when dealing with encryption keys as well. + +![][4] + +Some key highlights are: + + * Ability to store Secure Shell key (used to access remote computers/servers) + * Store GPG keys used to secure emails and files + * Supports adding password keyring for application and networks + * Securely store private key of a certificate + * Store a password / secret phrase + * Ability to import files and quickly store them + * Find remote keys + * Sync and publish keys + * Ability to find/copy VPN password + + + +![][5] + +### Installing Seahorse in Linux + +If you are using a GNOME-based distribution, you should already have it installed. You need to look for “Seahorse” or “Passwords” to find it. + +In other cases, you can search for it in the software center. It should work fine with KDE, LXQt, and different desktop environments as per my quick tests. + +![][6] + +Moreover, you can find its [Flatpak package][7] available. So, no matter the Linux distribution you are using, Seahorse can be installed. + +If you are using Arch Linux, you should also find it in [AUR][8]. + +[Seahorse][9] + +What do you think about using Seahorse to replace other password managers? Were you already using it to manage encryption keys? Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/seahorse/ + +作者:[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/10/seahorse-password-keys.png?resize=800%2C613&ssl=1 +[2]: https://itsfoss.com/ubuntu-keyring/ +[3]: https://itsfoss.com/password-managers-linux/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-login.png?resize=800%2C583&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-keys.png?resize=800%2C579&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-software.png?resize=800%2C508&ssl=1 +[7]: https://www.flathub.org/apps/details/org.gnome.seahorse.Application +[8]: https://itsfoss.com/aur-arch-linux/ +[9]: https://wiki.gnome.org/Apps/Seahorse/ From ba3f8e12e4578fffc72135454c8b7257b2586eb7 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 12 Oct 2021 05:03:32 +0800 Subject: [PATCH 0679/1588] add done: 20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md --- sources/tech/20211012 .md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 sources/tech/20211012 .md diff --git a/sources/tech/20211012 .md b/sources/tech/20211012 .md new file mode 100644 index 0000000000..95837b07b5 --- /dev/null +++ b/sources/tech/20211012 .md @@ -0,0 +1,25 @@ +[#]: subject: "" +[#]: via: "https://www.2daygeek.com/check-hardware-raid-configuration-linux/" +[#]: author: " " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + +-------------------------------------------------------------------------------- + +via: https://www.2daygeek.com/check-hardware-raid-configuration-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 2899fe638efd097942847d1abf7b5f6f06d4ff86 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 12 Oct 2021 05:04:03 +0800 Subject: [PATCH 0680/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211011?= =?UTF-8?q?=20What=20is=20a=20hostname=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211011 What is a hostname.md --- sources/tech/20211011 What is a hostname.md | 117 ++++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20211011 What is a hostname.md diff --git a/sources/tech/20211011 What is a hostname.md b/sources/tech/20211011 What is a hostname.md new file mode 100644 index 0000000000..e4954843e0 --- /dev/null +++ b/sources/tech/20211011 What is a hostname.md @@ -0,0 +1,117 @@ +[#]: subject: "What is a hostname?" +[#]: via: "https://opensource.com/article/21/10/what-hostname" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is a hostname? +====== +Hostnames are labels for humans to refer to a specific computer. +![Computer screen with files or windows open][1] + +Computers have network addresses, but they're usually difficult for humans to remember. Hostnames are labels intended to help humans refer to a specific computer. Instead of navigating to 192..168.1.4, for instance, you might navigate to  `linuxlaptop `or `linuxlaptop.local`. + +### Addresses and Names + +All networked computers (also referred to as hosts) need an address—a unique number associated with it that allows for datagrams to route among them for correct data communications. This is known as the Internet Protocol (IP) address. The number 54.204.39.132 is an Internet Protocol version 4 (IPv4) address. The newer IPv6 addresses are much longer, like this: 2001:0db6:3c4d:0017:0000:0000:2a2f:1a2b. WHOA! That is going to be hard to memorize! + + +``` +`$ ip addr show` +``` + +Computers can also be given labels. Known as the hostname, these are friendly names for easier reference. I could set my computer's hostname to be _copperhead_. As long as that name is unique on the network, all other users and computers can refer to it as copperhead instead of the IP address number. + + +``` +`$ hostname -s` +``` + +You can update your computer's hostname. + +Read Seth Kenlon's article [How to change a hostname on Linux][2] to learn how to do that on Linux. + +#### Fully qualified domain name + +Technically, the hostname includes a domain name. If my domain name is mycompany.com, then together—delimited by periods, my computer's hostname is copperhead.mycompany.com. This forms a fully qualified domain name (FQDN). This is important because the IP address resolves to the FQDN. + + +``` +`host.domain.topleveldomain` +``` + +For example: `www.example.com` is a fully qualified domain name. + +Your domain name is generally determined already, so you're only responsible for providing the host portion. This article focuses on the host.  + +#### Name resolution + +The process of translating the IP address to the corresponding hostname is known as name resolution. The first place that this occurs is in a local hosts table. Linux uses the file `/etc/hosts` to store this table. + + +``` +`cat /etc/hosts` +``` + +There is also a hierarchical and decentralized network-based system that provides resolution called the Domain Name System (DNS). This is when the FQDN becomes really important. + + +``` +`$ dig www.opensource.com` +``` + +### Fun with names + +It can be fun to think up names for our computers. If you have many, you could use a theme. I once worked for a company that named all of its servers after snakes. + +A later company I worked for, where I was a data center manager, used beer brands. It was exciting when we received a new server because I would email the development team for suggestions. We had roughly 100 servers. These provided an interesting list that reflected the diversity of the company. We had everything from coors and bud to amstel and deleriumtremens. We had tiger and singha and sapporo and many others too! + +We thought it was cool! Then again, imagine what happens when you try to remember that lowenbrau is the virtualization server with the most RAM and peroni is the SQL database server and heineken is the new domain controller, particularly for new employees in a rapidly growing company. + +### Conventions + +Hostnames are the choice of the owner, of course, so have fun with it. However, depending on the environment, it might make more sense to use names that are easy to remember or based on a naming convention that lends to being descriptive to the host.  + +#### Useful names + +If you want to forego the fun and helpfully name your systems, perhaps consider their function. Database servers might be named database1, database2, database3, and so on. Web servers might be webserver1, webserver2, and so on. + +#### Positional names + +I have used a technique with many clients to name server hosts with sets of characters in positions that describe an aspect of that system that helps identification. For example, if I were working on a Business Process Management (BPM) system for the Department of the Interior (DOI), I would incorporate their acronyms in the naming convention. + +Furthermore, just as with many large corporations, financial institutions, and governments, they might have various data centers located in disparate geographical locations for purposes of performance or disaster recovery. So, say, a data center on the East coast of the North American continent is referred to as ED, and those on the West coast are WD. East Data center and West Data center. + +All of this information would come together in a name such as doibpm1ed or doibpm1wd. So, while these names don't look like much, someone working on this project would readily be able to identify each as to their purpose and location, and the name may even help to obfuscate their usage to would-be mal-actors. In other words, the owner could choose naming that would only make sense to insiders.  + +### Internet standards + +Several standards govern hostnames. You can find these in Requests for Comment (RFC) maintained by The Internet Engineering Task Force (IETF). As of now, adhere to the following: + + *  A hostname should be between 1 and 63 ASCII characters in length + *  A FQDN has a maximum length of 253 ASCII characters + *  Case-insensitive + *  Allowed characters: a to z, 0 to 9, - (hyphen), and _ (underscore) + + + +I hope this article helps to clarify hostnames. Have some fun and be creative. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/what-hostname + +作者:[Alan Formy-Duval][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/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://opensource.com/article/21/10/how-change-hostname-linux From 9f0065dc0090729eb4a99557c70ecd1511241e5c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 12 Oct 2021 08:18:52 +0800 Subject: [PATCH 0681/1588] Delete 20211012 .md --- sources/tech/20211012 .md | 25 ------------------------- 1 file changed, 25 deletions(-) delete mode 100644 sources/tech/20211012 .md diff --git a/sources/tech/20211012 .md b/sources/tech/20211012 .md deleted file mode 100644 index 95837b07b5..0000000000 --- a/sources/tech/20211012 .md +++ /dev/null @@ -1,25 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.2daygeek.com/check-hardware-raid-configuration-linux/" -[#]: author: " " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - --------------------------------------------------------------------------------- - -via: https://www.2daygeek.com/check-hardware-raid-configuration-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 2d64f9362bb0750d028a211b0223718b467156d2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 12 Oct 2021 08:51:21 +0800 Subject: [PATCH 0682/1588] translated --- ...atures of the latest OpenPGP.js version.md | 71 ------------------- ...atures of the latest OpenPGP.js version.md | 70 ++++++++++++++++++ 2 files changed, 70 insertions(+), 71 deletions(-) delete mode 100644 sources/tech/20211008 3 new features of the latest OpenPGP.js version.md create mode 100644 translated/tech/20211008 3 new features of the latest OpenPGP.js version.md diff --git a/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md b/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md deleted file mode 100644 index d46866e3ba..0000000000 --- a/sources/tech/20211008 3 new features of the latest OpenPGP.js version.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: subject: "3 new features of the latest OpenPGP.js version" -[#]: via: "https://opensource.com/article/21/10/openpgpjs" -[#]: author: "Daniel Huigens https://opensource.com/users/twiss" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -3 new features of the latest OpenPGP.js version -====== -OpenPGP.js is a cryptography library that implements the OpenPGP -standard, most commonly used for email encryption. -![email or newsletters via inbox and browser][1] - -[OpenPGP.js][2] is a cryptography library that implements the [OpenPGP standard][3], most commonly used for email encryption. ProtonMail, Mailvelope, and FlowCrypt all use OpenPGP.js, to name a few. That means the OpenPGP.js library encrypts millions of users' messages. - -The OpenPGP standard, first published in the 1990s, like almost anything, requires maintenance and updating for both security and usability. A "crypto refresh" of the standard [is in the works][4], which adds modern encryption algorithms and deprecates outdated ones. To improve usability, various email applications now allow users to seamlessly encrypt their communication—without managing their keys or those of their contacts. - -First released in 2014, OpenPGP.js began based on an early prototype called GPG4Browsers, which is based on several scripts by Herbert Hanewinkel (among other contributors). The second version of OpenPGP.js, released in 2016, was completely reworked to use Uint8Arrays instead of strings (which significantly increased its performance) and modern ES6 modules rather than CommonJS modules internally. Versions 3 and 4, both released in 2018, added support for Elliptic-curve cryptography (ECC) and streaming, respectively. - -My team and I continue working on OpenPGP.js to ensure its evolution as an easy-to-use library for strong encryption. - -### 1\. Elliptic-curve cryptography by default - -In OpenPGP.js version 4, RSA was used when generating new keys by default. Although ECC is faster and more secure, Curve25519 had not been standardized in the OpenPGP specification yet. The crypto refresh draft does include Curve25519, and it is expected to be included "as is" in the next version of the OpenPGP specification, so OpenPGP.js version 5 now generates keys using ECC by default. - -### 2\. Import only the modules you need - -Similarly, while OpenPGP.js used ES6 modules internally for years, version 4 still didn't publish a proper ES6 module. Instead, it published only a Univeral Module Definition (UMD) module that could run both in the browser and on Node.js. In version 5, this changes by publishing separate modules for the browser and Node.js (both ES6 and non-ES6), making it easier for library users to import OpenPGP.js on all platforms and (when using the ES6 module) only import the parts they need. This is enabled in large part by switching the build system to [rollup][5]. - -### 3\. Reject weak cryptography - -There are also many other security improvements. For example, 1024-bit RSA keys, ElGamal, and DSA keys are considered insecure and are rejected by default. Additionally, where version 4 already defaulted to AES-encryption, version 5 now refuses to encrypt using weaker algorithms entirely by default, even if the public key claims to only support a weaker algorithm. It instead assumes that all OpenPGP implementations support AES (which has been the case for a very long time). - -### What's next for OpenPGP.js - -Looking ahead, there are some security improvements to make. Key fingerprints, used to identify public keys, still use SHA-1, though a fix for this is planned in the crypto refresh. In the meantime, it is recommended to use different means to ascertain the authenticity of any public key used for encryption, such as by fetching the entire key directly from the recipient's domain using the proposed [Web Key Directory (WKD)][6] standard—already implemented by various [email providers][7]. WKD support was built into OpenPGP.js version 4 but is a separate module in version 5 to keep the main library lean. - -Similarly, when encrypting messages or files with a password rather than a public key (uncommon when using OpenPGP for email encryption, but more so when used for encrypted backups, for example), the password is converted to a symmetric key using a relatively weak key derivation function (KDF). It is thus advisable for applications to pass the user's password through a strong KDF, such as [Argon2][8] or [scrypt][9], before passing it to OpenPGP.js. Hopefully, the crypto refresh will include one of these algorithms to implement in a future version of OpenPGP.js. - -### How to use OpenPGP.js version 5 - -For now, though, OpenPGP.js version 5 has been [published][10] to the npm package registry. If you like, feel free to try it out! Feedback is welcome in the [discussions tab][11] on GitHub. Please note, however, that while OpenPGP.js is a general-purpose encryption library, its primary use case is in situations where compatibility with the OpenPGP specification is required (for example, when sending or receiving PGP-encrypted email). For other use cases, a different library may be a more appropriate or performant choice. In general, of course, be careful when rolling any crypto. - -Thanks for reading, and here's to securing the future of email! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/openpgpjs - -作者:[Daniel Huigens][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/twiss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) -[2]: https://github.com/openpgpjs/openpgpjs -[3]: https://tools.ietf.org/html/rfc4880 -[4]: https://datatracker.ietf.org/doc/charter-ietf-openpgp/ -[5]: https://rollupjs.org/ -[6]: https://datatracker.ietf.org/doc/html/draft-koch-openpgp-webkey-service -[7]: https://wiki.gnupg.org/WKD#Mail_Service_Providers_offering_WKD -[8]: https://en.wikipedia.org/wiki/Argon2 -[9]: https://en.wikipedia.org/wiki/Scrypt -[10]: https://www.npmjs.com/package/openpgp -[11]: https://github.com/openpgpjs/openpgpjs/discussions diff --git a/translated/tech/20211008 3 new features of the latest OpenPGP.js version.md b/translated/tech/20211008 3 new features of the latest OpenPGP.js version.md new file mode 100644 index 0000000000..0fc380ce85 --- /dev/null +++ b/translated/tech/20211008 3 new features of the latest OpenPGP.js version.md @@ -0,0 +1,70 @@ +[#]: subject: "3 new features of the latest OpenPGP.js version" +[#]: via: "https://opensource.com/article/21/10/openpgpjs" +[#]: author: "Daniel Huigens https://opensource.com/users/twiss" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +最新 OpenPGP.js 版本的 3 个新功能 +====== +OpenPGP.js 是一个实现了 OpenPGP 标准的密码学库,最常用于电子邮件加密。 +![email or newsletters via inbox and browser][1] + +[OpenPGP.js][2]是一个实现了 [OpenPGP 标准][3]的密码学库,最常用于电子邮件加密。ProtonMail、Mailvelope 和 FlowCrypt 都使用 OpenPGP.js,这仅仅是其中一些。这意味着 OpenPGP.js 库对数百万用户的信息进行了加密。 + +OpenPGP 标准首次发布于 20 世纪 90 年代,像几乎任何东西一样,需要维护和更新,以保证安全和可用性。该标准的“加密刷新”[正在进行中][4],它增加了现代的加密算法并废除了过时的算法。为了提高可用性,各种电子邮件应用程序现在允许用户无缝加密他们的通信,用户无需管理他们的密钥或他们的联系人的密钥。 + +OpenPGP.js 于 2014 年首次发布,开始基于一个名为 GPG4Browsers 的早期原型,该原型基于 Herbert Hanewinkel(以及其他贡献者)的几个脚本。OpenPGP.js 的第二个版本于 2016 年发布,完全重新设计,使用 Uint8Arrays 而不是字符串(这大大增加了其性能),并在内部使用现代 ES6 模块而不是 CommonJS 模块。第 3 和第 4 版都是在 2018 年发布的,分别增加了对椭圆曲线加密法(ECC)和流媒体的支持。 + +我和我的团队继续在 OpenPGP.js 上工作,以确保其发展为一个易于使用的强加密库。 + +### 1\. 默认的椭圆曲线加密 + +在 OpenPGP.js 第 4 版中,生成新密钥时默认使用 RSA。虽然 ECC 更快、更安全,但 Curve25519 还没有在 OpenPGP 规范中得到标准化。加密刷新草案包括了 Curve25519,并且预计它将“按原样”包含在下一版本的 OpenPGP 规范中,因此 OpenPGP.js 第 5 版现在默认使用 ECC 生成密钥。 + +### 2\. 只导入你需要的模块 + +同样,虽然 OpenPGP.js 内部使用 ES6 模块多年,但第 4 版仍然没有发布一个合适的 ES6 模块。相反,它只发布了一个通用模块定义(UMD)模块,可以在浏览器和 Node.js 上运行。在第 5 版中,这种情况有所改变,为浏览器和 Node.js 发布了单独的模块(包括 ES6 和非 ES6),使库用户更容易在所有平台上导入 OpenPGP.js ,且(当使用 ES6 模块时)只导入他们需要的部分。这在很大程度上是通过将构建系统切换到 [rollup][5] 来实现的。 + +### 3\. 拒绝弱加密技术 + +还有许多其他的安全改进。例如,1024 位 RSA 密钥、ElGamal 和 DSA 密钥被认为是不安全的,并被默认拒绝。此外,第 4 版已经默认使用 AES 加密,第 5 版现在完全默认拒绝使用较弱的算法进行加密,即使公钥声称只支持较弱的算法。相反,它假定所有的 OpenPGP 实现都支持 AES(这种情况已经存在很长时间了)。 + +### OpenPGP.js 的下一步是什么? + +展望未来,有一些安全方面的改进要做。用于识别公钥的密钥指纹仍然使用 SHA-1,尽管在加密技术更新中计划对此进行修复。同时,建议使用不同的方法来确定用于加密的任何公钥的真实性,例如使用提议的[网络密钥目录 (WKD)][6]标准直接从收件人的域中获取整个密钥,这已经由各种[电子邮件提供商][7]实现。WKD 支持内置于 OpenPGP.js 第 4 版,但在第 5 版中是一个单独的模块,以保持主库的精简。 + +同样,当用密码而不是公钥加密信息或文件时(例如:在使用 OpenPGP 进行电子邮件加密时不常见,但在用于加密备份时更常见),密码会使用相对较弱的密钥衍生函数(KDF)转换为对称密钥。因此,建议应用在将用户的密码传递给 OpenPGP.js 之前,先通过一个强大的 KDF,如 [Argon2][8] 或 [scrypt][9]。希望加密技术的刷新会包括这些算法中的一种,以便在未来的 OpenPGP.js 版本中实现。 + +### 如何使用 OpenPGP.js 第 5 版 + +不过现在,OpenPGP.js 第 5 版已经[发布][10]到 npm 仓库。如果你喜欢,可以随时试用!欢迎在 GitHub 的[讨论标签][11]中进行反馈。然而,请注意,虽然 OpenPGP.js 是一个通用的加密库,但它的主要使用情况是在需要与 OpenPGP 规范兼容的情况下(例如,在发送或接收 PGP 加密的电子邮件时)。对于其他的使用情况,不同的库可能是一个更合适或性能更好的选择。当然,总的来说,在推广任何加密技术时都要小心。 + +感谢阅读,这里是保护电子邮件的未来! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/openpgpjs + +作者:[Daniel Huigens][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/twiss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/newsletter_email_mail_web_browser.jpg?itok=Lo91H9UH (email or newsletters via inbox and browser) +[2]: https://github.com/openpgpjs/openpgpjs +[3]: https://tools.ietf.org/html/rfc4880 +[4]: https://datatracker.ietf.org/doc/charter-ietf-openpgp/ +[5]: https://rollupjs.org/ +[6]: https://datatracker.ietf.org/doc/html/draft-koch-openpgp-webkey-service +[7]: https://wiki.gnupg.org/WKD#Mail_Service_Providers_offering_WKD +[8]: https://en.wikipedia.org/wiki/Argon2 +[9]: https://en.wikipedia.org/wiki/Scrypt +[10]: https://www.npmjs.com/package/openpgp +[11]: https://github.com/openpgpjs/openpgpjs/discussions From 178edae198dee86ea9ea8f97ed96d645d1e8ed21 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 12 Oct 2021 08:55:05 +0800 Subject: [PATCH 0683/1588] translated --- ...eahorse- Manage Your Passwords - Encryption Keys in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md b/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md index 4117f0be59..31c53b4e9c 100644 --- a/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md +++ b/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/seahorse/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 85f5f18201ae9ec4d645d867ff3000f8c78ba326 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 12 Oct 2021 12:31:21 +0800 Subject: [PATCH 0684/1588] PRF&PUB @geekpi https://linux.cn/article-13874-1.html --- ...a deGoogled Alternative to Google Drive.md | 77 +++++++++++++++++++ ...a deGoogled Alternative to Google Drive.md | 72 ----------------- 2 files changed, 77 insertions(+), 72 deletions(-) create mode 100644 published/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md delete mode 100644 translated/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md diff --git a/published/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md b/published/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md new file mode 100644 index 0000000000..6234cfe8b9 --- /dev/null +++ b/published/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md @@ -0,0 +1,77 @@ +[#]: subject: "/e/ cloud is a deGoogled Alternative to Google Drive" +[#]: via: "https://news.itsfoss.com/e-cloud/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13874-1.html" + +/e/ 云:一个去谷歌化的 Google Drive 替代方案 +====== + +![](https://img.linux.net.cn/data/attachment/album/202110/12/122933awf0z9vnqdzslv1q.jpg) + +> /e/ 云是 e.foundation 使用 Nextcloud 等开源工具创立的,以作为 Google Drive 和 Gmail 的替代品。 + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ecloud-ft.png?w=1200&ssl=1) + +Google Drive 是一种流行的云存储服务,在大多数情况下效果很好。 + +然而,它可能不是最关注隐私的选择。因此,要完全控制你的数据,最好的办法是启动一个 [Nextcloud][1] 实例,存储你的基本数据,并可以访问其他协作工具。 + +虽然这听起来不错,但不是每个人都能投入精力来创建和维护他们的实例。这就是 /e/ 云上场的时候了,它是由 [去谷歌化的安卓操作系统 /e/ 操作系统][2] 背后的同一个团队建立的。 + +/e/ 云主要将自己定位为一个新的 Google Drive 私人替代品,并提供一个取代 Gmail 的邮箱。 + +### /e/ 云:带有邮箱的 Nextcloud 及 OnlyOffice + +![][3] + +当你创建一个 /e/ 账户时,它会给你一个私人电子邮件地址 [xyz@e.email][4]。 + +而且,同邮箱地址一起,你会得到 1GB 的免费 /e/ 云存储空间和一个由 Nextcloud 和 OnlyOffice 为核心的协作平台。 + +因此,如果你想利用 Nextcloud 和 OnlyOffice 来取代谷歌的工具套件,而不需要自己全部设置,/e/ 云可以成为一个引人注目的以隐私为中心的选择。 + +![][5] + +除了 OnlyOffice 的文件存储和文档支持外,你还可以使用日历,存储笔记,并添加任务。 + +因此,它也可以成为一个正式的以隐私为中心的协作平台,你可以免费使用。 + +如果你想要更多的存储空间,你可以将你的订阅升级到付费计划,你可以根据需要选择 20 到 1TB 的存储空间,并按月/年计费。定价计划起价低至 3 美元/月。 + +毫无疑问,如果你在手机上使用 /e/ 操作系统或使用一个 /e/ 智能电话,这应该是一种无缝体验。 + +但是,你也可以使用第三方邮件客户端和 Nextcloud 移动应用在任何设备上使用它。 + +- [注册 /e/ 云][6] + +### 总结 + +考虑到它相对较新,正计划增加几个功能,包括端到端加密,从 Google Drive 迁移等。 + +你可以注册一个帐户并免费试用。 + +对于像 /e/ 云这样以 Nextcloud 为核心的主流解决方案,除了电子邮件和协作服务外,还能帮助你安全地管理/存储文件,你觉得怎么样? + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/e-cloud/ + +作者:[Ankush Das][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://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/nextcloud/ +[2]: https://itsfoss.com/e-os-review/ +[3]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ecloud.png?resize=1568%2C772&ssl=1 +[4]: mailto:xyz@e.email +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ecloud-files.png?resize=1568%2C787&ssl=1 +[6]: https://e.foundation/e-email-invite/ diff --git a/translated/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md b/translated/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md deleted file mode 100644 index 0abef81544..0000000000 --- a/translated/tech/20211001 -e- cloud is a deGoogled Alternative to Google Drive.md +++ /dev/null @@ -1,72 +0,0 @@ -[#]: subject: "/e/ cloud is a deGoogled Alternative to Google Drive" -[#]: via: "https://news.itsfoss.com/e-cloud/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -/e/ cloud 是一个去谷歌化的 Google Drive 替代方案 -====== - -Google Drive 是一种流行的云存储服务,在大多数情况下效果很好。 - -然而,它可能不是最隐私的选择。因此,要完全控制你的数据,最好的办法是启动一个 [Nextcloud][1] 实例,存储你的基本数据,同时访问其他协作工具。 - -虽然这听起来不错,但不是每个人都能投入精力来创建和维护他们的实例。这就是 ecloud 上场的时候了,它是由 [**/e/ OS**,一个去谷歌化的安卓操作系统][2]背后的同一个团队建立的。 - -ecloud 主要将自己定位为 Google Drive 的一个新的私人替代品,并提供一个邮箱来取代 Gmail。 - -### /e/ cloud:带邮箱的 Nextcloud 及 OnlyOffice - -![][3] - -当你创建一个 /e/ 账户时,它会给你一个私人电子邮件地址 **[xyz@e.email][4]**。 - -而且,同邮箱地址一起,你会得到 **1GB** 的免费 ecloud 存储空间和一个由 Nextcloud 和 OnlyOffice 为核心的协作平台。 - -因此,如果你想利用 Nextcloud 和 OnlyOffice 来取代谷歌的工具套件,而不需要自己全部设置,/e/ cloud 可以成为一个引人注目的以隐私为中心的选择。 - -![][5] - -除了 OnlyOffice 的文件存储和文档支持外,你还可以使用日历,存储笔记,并添加任务。 - -因此,它也可以成为一个体面的以隐私为中心的协作平台,你可以免费使用。 - -如果你想要更多的存储空间,你可以将你的订阅升级到付费计划,你可以根据需要选择 20 到 1TB 的存储空间,并按月/年计费。定价计划起价低至 **3 美元/月**。 - -毫无疑问,如果你在手机上使用 /e/ 操作系统或 /e/ 智能手机,这应该是一种无缝体验。 - -但是,你也可以使用第三方邮件客户端和 Nextcloud 移动应用在任何设备上使用它。 - -[Sign Up for /e/ cloud][6] - -### 总结 - -考虑到它相对较新,计划增加几个功能,包括端到端加密,从 Google Drive 迁移等。 - -你可以注册一个帐户并免费试用。 - -_你认为像 /e/ cloud 这样以 Nextcloud 为核心的主流解决方案,除了电子邮件和协作服务外,还能帮助你安全地管理/存储文件吗?_ - - --------------------------------------------------------------------------------- - -via: https://news.itsfoss.com/e-cloud/ - -作者:[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://news.itsfoss.com/author/ankush/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/nextcloud/ -[2]: https://itsfoss.com/e-os-review/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4NCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: mailto:xyz@e.email -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://e.foundation/e-email-invite/ From 88d3f27ec3d4854d8826242f00c0335f76e212f1 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 12 Oct 2021 14:54:19 +0800 Subject: [PATCH 0685/1588] PRF --- ...20210923 Build your website with Jekyll.md | 60 +++++++++---------- 1 file changed, 28 insertions(+), 32 deletions(-) diff --git a/translated/tech/20210923 Build your website with Jekyll.md b/translated/tech/20210923 Build your website with Jekyll.md index b46e6f1a6f..93fe195959 100644 --- a/translated/tech/20210923 Build your website with Jekyll.md +++ b/translated/tech/20210923 Build your website with Jekyll.md @@ -3,44 +3,45 @@ [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 使用 Jekyll 构建你的网站 ====== -Jekyll 是一个开源的静态的网站生成器。你可以使用 Markdown 编写内容,使用 HTML/CSS 来构建和展示,Jekyll 会将其编译为静态的 HTML。 -![Person using a laptop][1] -静态网站生成器和 JAMStack 近年来开始流行。而且理由很充分。不需要复杂的后端,只需要静态的 HTML、CSS 和 Javascript。没有后端意味着更好的安全性、更低的运营开销和更便宜的托管。双赢! +> Jekyll 是一个开源的静态网站生成器。你可以使用 Markdown 编写内容,使用 HTML/CSS 来构建和展示,Jekyll 会将其编译为静态的 HTML。 -在本文中,我将讨论 Jekyll。在撰写本文时,[我的个人网站使用 Jekyll][2]。Jekyll 使用 Ruby 引擎将用 Markdown 编写的文章转换成 HTML。[Sass][3] 可以将复杂的 CSS 规则应用到平面文件中。[Liquid][4] 允许对静态内容进行编程控制。 +![](https://img.linux.net.cn/data/attachment/album/202110/12/145349rblj459naj74j5nr.jpg) + +近年来开始流行静态网站生成器和 JAMStack,而且理由很充分,它们不需要复杂的后端,只需要静态的 HTML、CSS 和 Javascript。没有后端意味着更好的安全性、更低的运营开销和更便宜的托管。双赢! + +在本文中,我将讨论 Jekyll。在撰写本文时,[我的个人网站使用的是 Jekyll][2]。Jekyll 使用 Ruby 引擎将用 Markdown 编写的文章转换成 HTML。[Sass][3] 可以将复杂的 CSS 规则应用到普通文本文件中。[Liquid][4] 允许对静态内容进行编程控制。 ### 安装 Jekyll -[Jekyll 网站][5] 提供 Linux、MacOS 和 Windows 安装说明。安装完成之后,[快速引导][6] 将会安装一个基础的 Hello-World 项目。 +[Jekyll 网站][5] 提供了 Linux、MacOS 和 Windows 安装说明。安装完成之后,[快速引导][6] 将会安装一个基础的 Hello-World 项目。 -现在在你的浏览器访问 `http://localhost:4000`。你可以看到一个默认的很棒的博客。 +现在在你的浏览器访问 `http://localhost:4000`,你可以看到你的默认“真棒”博客。 ![Default "awesome" blog][7] ### 目录结构 -站点默认包含以下的文件和文件夹: +这个默认站点包含以下的文件和文件夹: - * `_posts`: 你的博客条目。 - * `_site`: 最终编译的静态网站文件。 - * `about.markdown`: 关于页面内容。 - * `index.markdown`: 主页页面内容。 - * `404.html`: 404 页面内容。 + * `_posts`: 你的博客文章。 + * `_site`: 最终编译成的静态网站文件。 + * `about.markdown`: “关于页”的内容。 + * `index.markdown`: “主页”的内容。 + * `404.html`: “404 页”的内容。 * `_config.yml`: Jekyll 的全站配置文件。 - -### 创建新的博客条目 +### 创建新的博客帖子 创建帖子很简单。你需要做的就是在 `_post` 目录下使用正确的格式和扩展名创建一个新文件,这样就完成了。 -有效的文件名像 `2021-08-29-welcome-to-jekyll.markdown`这样。一个博客文件必须包含 Jekyll 所称的 YAML 前置。它是包含元数据的文件开头的一个特殊部分。如果你看到默认的帖子,你可以看到以下内容: +有效的文件名像 `2021-08-29-welcome-to-jekyll.markdown` 这样。一个博客文件必须包含 Jekyll 所谓的 YAML 卷首块Front Matter。它是文件开头的一个包含元数据的特殊部分。如果你查看默认的帖子,你可以看到以下内容: ``` --- @@ -51,7 +52,7 @@ categories: jekyll update --- ``` -Jekyll 使用上面的元数据,你可以自定义 `key: value` 键值对。如果你需要一些灵感,[请查看我的网站前置内容][9]。除了前面的问题,你还可以[使用内置的 Jekyll 变量][10] 来自定义你的网站。 +Jekyll 会使用上面的元数据,你也可以自定义 `key: value` 键值对。如果你需要一些提示,[请查看我的网站的卷首][9]。除了前面的问题,你还可以 [使用内置的 Jekyll 变量][10] 来自定义你的网站。 让我们创建一个新的帖子。在 `_posts` 文件夹下创建 `2021-08-29-ayushsharma.markdown`。内容如下: @@ -73,11 +74,11 @@ This is a [link]() This is my category: ``` -如果 `jekyll serve` 命令仍在运行,刷新页面,你将看到下面的新条目。 +如果 `jekyll serve` 命令仍在运行,刷新页面,你将看到下面的新帖子。 ![New blog entry][11] -恭喜你创建了你的第一篇文章!这个过程看起来很简单,但是你可以通过 Jekyll 做很多事情。使用简单的 Markdown,你可以归档博客、代码片段的高亮显示以及帖子的分类管理。 +恭喜你创建了你的第一篇帖子!这个过程看起来很简单,但是你可以通过 Jekyll 做很多事情。使用简单的 Markdown,你可以归档博客、高亮显示代码片段以及分类管理帖子。 ### 草稿 @@ -85,17 +86,17 @@ This is my category: ### 布局和包含 -请注意 `_post` 文件夹中两篇文章的前面内容,你将在前置内容中看到 `layout: post`。`_layout` 文件夹中包含所有布局。你不会在源代码中找到它们,因为 Jekyll 默认加载它们。Jekyll 使用的默认源代码在[这里][12]。如果你点击链接,你可以看到博客布局使用默认布局。默认布局包含 `{{ content }}` 注入内容的代码。布局文件还将包含 `include` 指令。它们从[包含文件夹][14]加载文件并允许使用不同的组件组成页面。 +请注意 `_post` 文件夹中两篇文章的卷首块,你将在其中看到 `layout: post`。`_layout` 文件夹中包含所有布局。你不会在源代码中找到它们,因为 Jekyll 默认加载它们。Jekyll 使用的默认源代码在 [这里][12]。如果你点击该链接,你可以看到 `post` 的布局使用了默认(`default`)布局。默认布局包含的代码 `{{ content }}` 是注入内容的地方。布局文件还将包含 `include` 指令。它们从 [`include` 文件夹][14] 加载文件,并使用不同的组件组成页面。 -总的来说,这就是布局的工作方式-你在最前面定义它们并将你的内容注入其中。Includes 提供页面的其它部分以组成整个页面。这是一种标准的网页设计技术--定义页眉、页脚、旁白和内容元素,然后在其中注入内容。这就是静态站点生成器的真正威力--完全以编程的方式控制将你的网站组装起来并最终编译成静态的 HTML。 +总的来说,这就是布局的工作方式:你在卷首块定义它们并将你的内容注入其中。而包含则提供了页面的其它部分以组成整个页面。这是一种标准的网页设计技术:定义页眉、页脚、旁白和内容元素,然后在其中注入内容。这就是静态站点生成器的真正威力,完全以编程的方式控制,将你的网站组装起来并最终编译成静态的 HTML。 ### 页面 -你网站上的所有内容并不都是文章或博客。你将需要关于页面、联系页面、项目页面或投资组合页面。这就是 Pages 的用武之地。它们的工作方式与 Posts 完全一样,这意味着它们是带有前置块的 Markdown 文件。但它们不会进入 `_posts` 目录。它们要么保留在你的项目根目录中,要么保留在它们自己的文件夹中。对于布局和包含,你可以使用与帖子相同的布局或创建新帖子。 Jekyll 非常灵活,你可以随心所欲地发挥你的创意!你的默认博客已经有 `index.markdown` 和 `about.markdown`。随意自定义它们。 +你网站上的所有内容并不都是文章或博客。你需要“关于”页面、“联系”页面、“项目”页面或“作品”页面。这就是“页面”的用武之地。它们的工作方式与“帖子”完全一样,这意味着它们是带有卷首块的 Markdown 文件。但它们不会放到 `_posts` 目录。它们要么保留在你的项目根目录中,要么保留在它们自己的文件夹中。对于布局和包含,你可以使用与帖子相同的布局或创建新帖子。 Jekyll 非常灵活,你可以随心所欲地发挥你的创意!你的默认博客已经有 `index.markdown` 和 `about.markdown`。请随意自定义它们。 ### 数据文件 -数据文件位于 `_data` 目录中,可以是 `.yml`,`.json`,`.csv` 格式文件。例如,一个 `_data/members.yml` 文件可能包含: +数据文件位于 `_data` 目录中,可以是 `.yml`、`.json`、`.csv` 等格式的文件。例如,一个 `_data/members.yml` 文件可能包含: ``` - name: A @@ -110,7 +111,6 @@ This is my category: Jekyll 在网站生成的时候读取这些内容。你可以通过 `site.data.members` 访问它们。 - ```
    { % for member in site.data.members % } @@ -129,19 +129,15 @@ Jekyll 在网站生成的时候读取这些内容。你可以通过 `site.data.m ### 构建你最终的网站 -命令 `jekyll serve` 非常适合本地测试。但是一旦你完成了本地测试,你将需要构建要发布的最终工作。命令 `jekyll build --source source_dir --destination destination_dir` 将你的网站构建到 `_site` 文件夹中。请注意,此文件夹在每次构建之前都会被清理,所以不要将重要的东西放在那里。获得内容后,你可以将其托管在你的静态托管服务上。 +命令 `jekyll serve` 非常适合本地测试。但是一旦你完成了本地测试,你将需要构建要发布的最终工作。命令 `jekyll build --source source_dir --destination destination_dir` 将你的网站构建到 `_site` 文件夹中。请注意,此文件夹在每次构建之前都会被清理,所以不要将重要的东西放在那里。生成内容后,你可以将其托管在你的静态托管服务上。 你现在应该对 Jekyll 的功能以及主要部分的功能有一个全面的了解。如果你正在寻找灵感,官方 [JAMStack 网站上有一些很棒的例子][17]。 ![Example Jekyll sites from JAMStack][18] -快乐编码 :) +编码快乐。 -* * * - -本文首发于[作者个人博客][19],经授权改编。 - -了解 Jekyll,一个静态 HTML 文件的开源生成器,如何让运行博客变得像... +本文首发于 [作者个人博客][19],经授权改编。 -------------------------------------------------------------------------------- @@ -150,7 +146,7 @@ via: https://opensource.com/article/21/9/build-website-jekyll 作者:[Ayush Sharma][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 8537bbef8a8b26d4fe0b1132ca24598dae178ce0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 12 Oct 2021 14:55:18 +0800 Subject: [PATCH 0686/1588] PUB @perfiffer https://linux.cn/article-13875-1.html --- .../20210923 Build your website with Jekyll.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210923 Build your website with Jekyll.md (99%) diff --git a/translated/tech/20210923 Build your website with Jekyll.md b/published/20210923 Build your website with Jekyll.md similarity index 99% rename from translated/tech/20210923 Build your website with Jekyll.md rename to published/20210923 Build your website with Jekyll.md index 93fe195959..b0b5ccd10d 100644 --- a/translated/tech/20210923 Build your website with Jekyll.md +++ b/published/20210923 Build your website with Jekyll.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "perfiffer" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13875-1.html" 使用 Jekyll 构建你的网站 ====== From fdb248d3e1b0cfcfc8edc13cb5012a11382c2a06 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Tue, 12 Oct 2021 23:21:53 +0800 Subject: [PATCH 0687/1588] finished --- ...w to process real-time data with Apache.md | 87 ------------------- ...w to process real-time data with Apache.md | 82 +++++++++++++++++ 2 files changed, 82 insertions(+), 87 deletions(-) delete mode 100644 sources/tech/20200228 How to process real-time data with Apache.md create mode 100644 translated/tech/20200228 How to process real-time data with Apache.md diff --git a/sources/tech/20200228 How to process real-time data with Apache.md b/sources/tech/20200228 How to process real-time data with Apache.md deleted file mode 100644 index 2f1c8e18a0..0000000000 --- a/sources/tech/20200228 How to process real-time data with Apache.md +++ /dev/null @@ -1,87 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How to process real-time data with Apache) -[#]: via: (https://opensource.com/article/20/2/real-time-data-processing) -[#]: author: (Simon Crosby https://opensource.com/users/simon-crosby) - -How to process real-time data with Apache -====== -Open source is leading the way with a rich canvas of projects for -processing real-time events. -![Alarm clocks with different time][1] - -In the "always-on" future with billions of connected devices, storing raw data for analysis later will not be an option because users want accurate responses in real time. Prediction of failures and other context-sensitive conditions require data to be processed in real time—certainly before it hits a database. - -It's tempting to simply say "the cloud will scale" to meet demands to process streaming data in real time, but some simple examples show that it can never meet the need for real-time responsiveness to boundless data streams. In these situations—from mobile devices to IoT—a new paradigm is needed. Whereas cloud computing relies on a "store then analyze" big data approach, there is a critical need for software frameworks that are comfortable instantly processing endless, noisy, and voluminous streams of data as they arrive to permit a real-time response, prediction, or insight. - -For example, the city of Palo Alto, Calif. produces more streaming data from its traffic infrastructure per day than the Twitter Firehose. That's a lot of data. Predicting city traffic for consumers like Uber, Lyft, and FedEx requires real-time analysis, learning, and prediction. Event processing in the cloud leads to an inescapable latency of about half a second per event. - -We need a simple yet powerful programming paradigm that lets applications process boundless data streams on the fly in these and similar situations: - - * Data volumes are huge, or moving raw data is expensive. - * Data is generated by widely distributed assets (such as mobile devices). - * Data is of ephemeral value, and analysis can't wait. - * It is critical to always have the latest insight, and extrapolation won't do. - - - -### Publish and subscribe - -A key architectural pattern in the domain of event-driven systems is the concept of pub/sub or publish/subscribe messaging. This is an asynchronous communication method in which messages are delivered from _publishers_ (anything producing data) to *subscribers (*applications that process data). Pub/sub decouples arbitrary numbers of senders from an unknown set of consumers. - -In pub/sub, sources _publish_ events for a _topic_ to a _broker_ that stores them in the order in which they are received. An application _subscribes_ to one or more _topics_, and the _broker_ forwards matching events. Apache Kafka and Pulsar and CNCF NATS are pub/sub systems. Cloud services for pub/sub include Google Pub/Sub, AWS Kinesis, Azure Service Bus, Confluent Cloud, and others. - -Pub/sub systems do not _run_ subscriber applications—they simply _deliver_ data to topic subscribers. - -Streaming data often contains events that are updates to the state of applications or infrastructure. When choosing an architecture to process data, the role of a data-distribution system such as a pub/sub framework is limited. The "how" of the consumer application lies beyond the scope of the pub/sub system. This leaves an enormous amount of complexity for the developer to manage. So-called stream processors are a special kind of subscriber that analyzes data on the fly and delivers results back to the same broker. - -### Apache Spark - -[Apache Spark][2] is a unified analytics engine for large-scale data processing. Often, Apache Spark Streaming is used as a stream processor, for example, to feed machine learning models with new data. Spark Streaming breaks data into mini-batches that are each independently analyzed by a Spark model or some other system. The stream of events is grouped into mini-batches for analysis, but the stream processor itself must be elastic: - - * The stream processor must be capable of scaling with the data rate, even across servers and clouds, and also balance load across instances, ensuring resilience and other application-layer needs. - * It must be able to analyze data from sources that report at widely different rates, meaning it must be stateful—or store state in a database. This latter approach is often used when Spark Streaming is used as the stream processor and can cause performance problems when ultra-low latency responses are needed. - - - -A related project, [Apache Samza][3], offers a way to process real-time event streams, and to scale elastically using [Hadoop Yarn][4] or [Apache Mesos][5] to manage compute resources. - -### Solving the problem of scaling data - -It's important to note that even Samza cannot entirely alleviate data processing demands for the application developer. Scaling data rates mean that tasks to process events need to be load-balanced across many instances, and the only way to share the resulting application-layer state between instances is to use a database. However, the moment state coordination between tasks of an application devolves to a database, there is an inevitable knock-on effect upon performance. Moreover, the choice of database is crucial. As the system scales, cluster management for the database becomes the next potential bottleneck. - -This can be solved with alternative solutions that are stateful, elastic, and can be used in place of a stream processor. At the application level (within each container or instance), these solutions build a stateful model of concurrent, interlinked "web agents" on the fly from streaming updates. Agents are concurrent "nano-services" that consume raw data for a single source and maintain their state. Agents interlink to share state based on real-world relationships between sources found in the data, such as containment and proximity. Agents thus form a graph of concurrent services that can analyze their own state and the states of agents to which they are linked. Each agent provides a nano-service for a single data source that converts from raw data to state and analyzes, learns, and predicts from its own changes and those of its linked subgraph. - -These solutions simplify application architecture by allowing agents—digital twins of real-world sources—to be widely distributed, even while maintaining the distributed graph that interlinks them at the application layer. This is because the links are URLs that map to the current runtime execution instance of the solution and the agent itself. In this way, the application seamlessly scales across instances without DevOps concerns. Agents consume data and maintain state. They also compute over their own state and that of other agents. Because agents are stateful, there is no need for a database, and insights are computed at memory speed. - -### Reading world data with open source - -There is a sea change afoot in the way we view data: Instead of the database being the system of record, the real world is, and digital twins of real-world things can continuously stream their state. Fortunately, the open source community is leading the way with a rich canvas of projects for processing real-time events. From pub/sub, where the most active communities are Apache Kafka, Pulsar, and CNCF NATS, to the analytical frameworks that continually process streamed data, including Apache Spark, [Flink][6], [Beam][7], Samza, and Apache-licensed [SwimOS][8] and [Hazelcast][9], developers have the widest choices of software systems. Specifically, there is no richer set of proprietary software frameworks available. Developers have spoken, and the future of software is open source. - -Introduction to Apache Hadoop, an open source software framework for storage and large scale... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/2/real-time-data-processing - -作者:[Simon Crosby][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/simon-crosby -[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://spark.apache.org/ -[3]: https://samza.apache.org/ -[4]: https://hadoop.apache.org/ -[5]: http://mesos.apache.org/ -[6]: https://flink.apache.org/ -[7]: https://beam.apache.org -[8]: https://github.com/swimos/swim -[9]: https://hazelcast.com/ diff --git a/translated/tech/20200228 How to process real-time data with Apache.md b/translated/tech/20200228 How to process real-time data with Apache.md new file mode 100644 index 0000000000..30a2909289 --- /dev/null +++ b/translated/tech/20200228 How to process real-time data with Apache.md @@ -0,0 +1,82 @@ +[#]: collector: (lujun9972) +[#]: translator: (unigeorge) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to process real-time data with Apache) +[#]: via: (https://opensource.com/article/20/2/real-time-data-processing) +[#]: author: (Simon Crosby https://opensource.com/users/simon-crosby) + +如何使用 Apache 软件处理实时数据 +====== + +开源社区在处理实时事件的项目丰富度方面处于领先地位。 + +![Alarm clocks with different time][1] + +在“永不下线”的未来,入网设备规模可能会达到数十亿。存储原始数据,日后再进行分析的方案将不再能满足需求,因为用户需要实时且准确的响应。要对故障等敏感状况进行预测,实时处理数据也必不可少——数据到达数据库后再处理肯定是来不及的。 + +有人可能会说,“云可扩展性”能够满足实时处理流数据的需求,但一些简单的例子就能表明它永远无法满足对无界数据流进行实时响应的需求。从移动设备到物联网,都需要一种新的范式来满足需求。尽管云计算依赖对大数据“先存储后分析”的方案,但也迫切需要一种能够处理持续、杂乱和海量数据流的软件框架,并在数据流到达时立即对其进行处理,以保证实时的响应、预测和对数据的洞悉。 + +例如,在加利福尼亚州的帕洛阿尔托市,每天从基础交通设施产生的流数据比 Twitter Firehose 还要多。这是很大的数据量。为 Uber、Lyft 和 FedEx 等消费者预测城市交通需要实时的分析、学习和预测。云处理不可避免地导致每个事件大约会有半秒的延迟。 + +我们需要一个简单而强大的编程范式,让应用程序在类似下面的情况时能够动态处理无界数据流: + + * 数据量巨大,或原始数据的移动成本很高。 + * 数据由广泛分布的资产(例如移动设备)生成。 + * 数据具有转瞬即逝的价值,即时分析迫在眉睫。 + * 需要始终洞悉最新数据情况,外推法行不通。 + +### 发布和订阅 + +事件驱动系统领域中有一个关键架构模式:发布/订阅(publish/subscribe) 消息传递模式。这是一种异步通信方法,其中消息会从 _发布者_(数据产生方)传递到 _订阅者_(处理数据的应用程序)。发布/订阅模式可以将消息发送者与消费者分离开来。 + +在发布/订阅模式中,消息源会 _发布_ 针对某个 _topic_(主题) 的 事件(event) 至 _broker_(服务端),后者按接收顺序存储它们。应用程序可以 _订阅_ 一个或多个 _topic_,然后 _broker_ 会转发匹配的事件。 Apache Kafka 和 Pulsar 以及 CNCF NATS 是发布/订阅系统。 发布/订阅的云服务包括 Google Pub/Sub、AWS Kinesis、Azure Service Bus、Confluent Cloud 等。(LCTT译注:本段部分术语英文名称更为泛用,针对这些术语,正文采用英文,仅在括号中标注其对应中文。) + +发布/订阅系统不会 _运行_ 订阅者应用程序,它们只是 _传递_ 数据给相应 topic 的订阅者。 + +流数据通常包含应用程序或基础架构状态更新的事件。在选择架构来处理数据时,发布/订阅框架等数据分发系统的作用是有限的。消费者应用程序的“处理方式”超出了发布/订阅系统的范围。这让开发人员的管理变得极具复杂性。所谓的流处理器是一种特殊的订阅者,可以动态分析数据并将结果返回给同一个 broker。 + +### Apache Spark + +[Apache Spark][2] 是用于大规模数据处理的统一分析引擎。通常将 Apache Spark Streaming 用作流处理器,例如给机器学习模型提供新数据。Spark Streaming 将数据分成小批量,每个小批量都由 Spark 模型或其他系统独立分析。事件流可以被分组成小批量以进行分析,但流处理器本身必须具有弹性: + + * 流处理器必须能够根据数据速率进行扩展,甚至要能够跨越服务器和云,并且还可以跨实例实现负载均衡,以确保弹性和其他应用层的需求。 + * 它必须能够分析来自不同来源的数据,这些数据源的报告速率可能相差很大。这意味着它必须是有状态的,或者将状态存储在数据库中。当使用 Spark Streaming 作为流处理器时,通常会使用后一种方法,这种方法在需要超低延迟响应时可能会存在性能问题。 + +相关项目 [Apache Samza][3] 也提供了一种处理实时事件流的方法,并使用 [Hadoop Yarn][4] 或 [Apache Mesos][5] 来管理计算资源,以便进行弹性扩展。 + +### 解决数据扩展问题 + +需要注意的是,即使是 Samza 也不能完全减轻开发人员的数据处理需求。扩展数据规模意味着处理事件的任务需要跨多个实例进行负载均衡,而使用数据库是实例间共享结果应用层状态的唯一方法。然而,当应用程序任务之间的状态协调转移到数据库时,对性能会产生不可避免的连锁反应。此外,数据库的选择也至关重要。随着系统的扩展,数据库的集群管理会成为下一个潜在的瓶颈。 + +这个问题可以通过有状态、有弹性的替代方案来解决,并且这样的解决方案可以用来代替流处理器。在应用程序级别(容器或实例内),这些解决方案依据流的更新,动态构建并发、互连的“web 代理”的有状态模型。代理是并发的“微服务”,它们消费单一来源的原始数据并维护它们的状态。基于数据中发现的源之间的真实关系(如包含和临近),代理实现互连以共享状态。代理也因此形成了一个并发服务图,可以分析它们自己的状态和链接到的代理的状态。数据源将原始数据转换为状态,并根据自身及其链接子图的变化进行分析、学习和预测,每个代理都为单个这样的数据源提供微服务。 + +这些解决方案允许大量的代理(真实数据源的数字类比)分布,甚至还有在应用层使代理互连的分布式图,从而简化了应用架构。这是因为代理之间互连的本质,是映射到解决方案的当前运行时执行实例和代理本身的 URL。通过这种方式,应用程序可以跨实例无缝扩展,而无需担心 DevOps 问题。代理消费数据并维护状态,还会计算自己和其他代理的状态。由于代理是有状态的,因此不需要数据库,并且数据洞察是以内存速度计算的。 + +### 使用开源阅读数据世界 + +我们查看数据的方式正在发生翻天覆地的变化:不再将数据库用作记录系统,取而代之的是现实世界,现实世界事物的数字类比可以不断地传输它们的状态。幸运的是,开源社区在处理实时事件的项目丰富度方面处于领先地位。从发布/订阅模式(其中最活跃的社区是 Apache Kafka、Pulsar 和 CNCF NATS)到持续处理流数据的分析框架,包括 Apache Spark、[Flink][6]、[Beam][7]、Samza,以及 Apache 许可的 [SwimOS][8] 和 [Hazelcast][9],对开发人员来说,可选择项目非常之多。可以说,没有什么地方比开源社区的专有软件框架更多了。试看软件的未来,必是开源的天下。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/2/real-time-data-processing + +作者:[Simon Crosby][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/simon-crosby +[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://spark.apache.org/ +[3]: https://samza.apache.org/ +[4]: https://hadoop.apache.org/ +[5]: http://mesos.apache.org/ +[6]: https://flink.apache.org/ +[7]: https://beam.apache.org +[8]: https://github.com/swimos/swim +[9]: https://hazelcast.com/ From a83946801756c944e527f2f367b5dc09434a0cd0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 13 Oct 2021 05:02:30 +0800 Subject: [PATCH 0688/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211013?= =?UTF-8?q?=20Beginner=E2=80=99s=20Guide=20to=20Installing=20Pop!=5FOS=20L?= =?UTF-8?q?inux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211013 Beginner-s Guide to Installing Pop-_OS Linux.md --- ...ner-s Guide to Installing Pop-_OS Linux.md | 211 ++++++++++++++++++ 1 file changed, 211 insertions(+) create mode 100644 sources/tech/20211013 Beginner-s Guide to Installing Pop-_OS Linux.md diff --git a/sources/tech/20211013 Beginner-s Guide to Installing Pop-_OS Linux.md b/sources/tech/20211013 Beginner-s Guide to Installing Pop-_OS Linux.md new file mode 100644 index 0000000000..9652299ec8 --- /dev/null +++ b/sources/tech/20211013 Beginner-s Guide to Installing Pop-_OS Linux.md @@ -0,0 +1,211 @@ +[#]: subject: "Beginner’s Guide to Installing Pop!_OS Linux" +[#]: via: "https://itsfoss.com/install-pop-os/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Beginner’s Guide to Installing Pop!_OS Linux +====== + +_**Brief: Learn to install Pop OS Linux distribution by replacing all other operating systems on your computer.**_ + +[Pop!_OS][1] is the Linux distribution created by System76 and is based on Ubuntu. Since System76 sells [Linux-first laptops and desktops][2], their Linux distribution, even though is based on Ubuntu, provides support for bleeding edge hardware (only if the newer Linux kernel does not create a conflict for currently supported hardware). + +Out of all the new Linux distributions out there, the user-base of Pop!_OS just “popped” out of nowhere. Considering it is a _relatively_ new distro among a plethora of other “well established distros” like Ubuntu, Manjaro, Mint etc; this is a big achievement! + +This isn’t an opinion article on why you should [use Pop OS over Ubuntu][3], but a guide, for you to get started with Linux on your PC by installing Pop!_OS on it. + +### Choosing the instllation method for Pop OS + +There are multiple ways to install Pop!_OS (and all other Linux distros) on your computer. + + 1. Install Pop!_OS as a Virtual Machine [using VirtualBox][4] on your PC **without affecting your current Windows install**. + 2. Install Pop!_OS alongside Windows; AKA [dual boot][5] (even though the linked guide is for Ubuntu, it should work for Pop!_OS; **make sure to turn off “Secure Boot”**). + 3. Replace Windows 10/11 with Pop!_OS. + + + +I highly recommend that you [try out Pop!_OS in VirtualBox][4] before installing it on your computer, specially if you are new to Linux. + +_**This tutorial covers installation of Pop!_OS replacing Windows**_, and below are the hardware requirements for Pop!_OS. + + * A 4 GB USB drive to create a Live USB drive + * Any 64-bit x86 CPU (any 64-bit Intel or AMD CPU) + * At least 4 GB of RAM is recommended + * A minimum of 20 GB of storage (to store the OS) + + + +_**WARNING: This guide assumes you want to replace Windows on your PC with a Linux distro of your choice (Pop!_OS in this case) and it results in wiping your drive clean. Please make sure you have backed up all of your important data before proceeding further.**_ + +### Choose the version of Pop!_OS to install + +![][6] + +Just like Ubuntu, Pop!_OS comes in two variants. All LTS releases are supported for 5 years from release date. Canonical releases a LTS version of Ubuntu in April of every even numbered year. + +A new Non-LTS version is released every 6 months (in April and September, every year) and that particular version is supported only for 9 months from release date. + +As of writing this article, Pop!_OS is available in two (technically four, but we will get to that later) versions. Current LTS release is “Pop!_OS 20.04 LTS” and “Pop!_OS 21.04”. And soon enough, version 21.10 will be released. + +Because Nvidia does not have open source drivers, installing Nvidia GPU Drivers ends up causing problems to your Linux installation if not done correctly. Therefore, System76 offers two variants for each version of Pop!_OS. + +Pop!_OS 20.04 LTS is [available in two variants][7] (more details in next section). + + * For users with a Nvidia GPU in their computer + * For users with an AMD (and/or an Intel for iGPU and for the [upcoming dGPU][8]) users. + + + +If you are not sure, [check the graphics card][9] on your system and choose the appropriate version while downloading. + +### Installing Pop!_OS + +In this guide, I’ll be using the non-Nvidia version of Pop!_OS 20.04 LTS (but the installer steps will be the same for every variant of the same version). + +#### Step 1: Create a live USB + +Visit System76’s website to download a copy of Pop!_OS. + +[Download Pop!_OS][1] + +![Pop!_OS ISO selection menu][10] + +Select “Pop!_OS 20.04 LTS” (#1) and then click on either the normal ISO (#2) or the Nvidia-specific ISO (#3) to start downloading it. + +After you have downloaded a copy of ISO that is suitable for your use case and machine, your next step will be to create a live installer for Pop!_OS. A live installer is a full copy of the OS for you to tinker with, before you feel that the OS of your liking and also compatible with your hardware. + +Sometimes the distribution of your choice might not have good support for the proprietary components like WiFi, GPU etc included in your laptop/desktop. Now is the time to test your hardware compatibility. + +_**NOTE: Any data stored on your USB stick will be erased at this step, make sure you do not have anything important on the flash drive.**_ + +You have access to numerous tools to create a live USB stick. Some of them are: + + * [balenaEtcher][11] (available on Mac, Windows and Linux) + * [UNetbootin][12] (available on Mac, Windows and Linux) + * [Rufus][13] (available only on Windows) + * [Ventoy][14] (available on Windows and Linux) + + + +On Windows, you can use Rufus to [create a live USB from Windows][15]. You may also use Etcher for Windows, Linux and macOS. It is really simple. Just start the application, browse the downloaded ISO and hit the flash button. + +![A generic example of creating live Linux USB with Etcher][16] + +#### Step 2: Booting from the live Pop OS USB + +Once you have created the live USB, you need to tell our computer to boot from the USB stick instead of the disk on which Windows is installed. + +To do that, restart your computer. And once you see your computer vendor’s logo (HP, Dell, Asus, Gigabyte, ASRock etc) press either the F2 or F10 or F12 or Delete key to enter your computer’s BIOS/UEFI. This key will differ based on your computer vendor, for most desktops it is usually the Delete key, and for most laptops it is the F2 key. If still in doubt, a quick web search should tell you which key to press for your system. + +![BIOS/UEFI boot menu keys][17] + +On modern computers with UEFI, you don’t even need to go in UEFI. You can directly hit a specific key like F12 (my computer vendor has F12) and you’ll see a boot menu. From there directly select your USB stick. + +![UEFI boot menu][18] + +For people who have an older BIOS/UEFI, go under the section where it says Boot (do note, the steps will vary from vendor to vendor) and select your USB drive instead of your SSD/HDD. And reboot. + +![UEFI/BIOS boot drive selection][19] + +Your computer should now boot from the live USB you just created. + +#### Step 4: Start installing Pop!_OS + +You should be in the Pop!_OS live environment now. On your computer screen, you will see an installer asking you for setup details like your preferred Language, Country and Keyboard Layout. + +![Pop!_OS Installation screen][20] + +Once you have selected your Language, Country and Keyboard Layout, you will see this screen. You technically have 3 options. + +![Pop!_OS Installation types, plus Demo Mode][21] + + * Clean Install (#1): This option will erase your entire disk and install Pop!_OS on it. + * Custom (Advanced) (#2): This option will allow you to specify things like root partition, if you want a different home partition, use another file system for your root partition, resize partitions, use a different sized swap partition etc. + * Try Demo Mode (#3): An option in the bottom left of the installer that allows you to test drive Pop!_OS as if it was actually installed on your computer without actually touching your drive contents. + + + +**For the scope of this tutorial, proceed by selecting Clean Install.** + +Next up, specify a drive where you want to install Pop!_OS on. In case your computer has multiple drives, you will see each drive labelled along with it’s size so you can be assured if the drive you have selected is the one you have decided to install Pop!_OS on. + +![Pop!_OS Drive selection options][22] + +You will be prompted to provide your name and a username for your user. Your username will be the name of your home folder. + +![Pop!_OS User’s Name and username input][23] + +Up next, set a password for your user. + +![Pop!_OS User password input][24] + +The final step includes setting up Drive Encryption. If someone has physical access to your computer, your data on the disk can be accessed using a live operating system (like the live USB you created). + +The disk encryption prevents that. However, you must never forget the password or you’ll never be able to use the disk again. + +It is up to you if you want to encrypt the disk. + +![Pop!_OS Drive Encryption options][25] + +The installer will give you three options for encryption. + + * Don’t Encrypt (#1): Does not encrypt your drive. Not recommended for security conscious users + * Use user password for drive encryption (#2): This will tell the installer to use the same password for your user and for drive encryption. If you use this option, make sure your user has a strong password. + * Set Password (#3): Use a different password for encrypting drive. + + + +Whichever you choose, the installation should start now. Below is a screenshot showing the installer screen. + +![Pop!_OS Installation screen, plus log button][26] + +Just in case you encounter any error(s) during this step, click on the button placed at the bottom right edge of installer with “$_” (annotated as “Log” in the screenshot above) in it. It is the installer log. Posting a few lines from the bottom of this log should help others from [our community forum][27] or any other forums help you diagnose the issue causing installation errors. + +Please wait for a few minutes for the installer to finish installing and it will provide you with two options, Reboot or Shut Down. Power off your computer and remove the USB drive. + +Congratulations! You just installed Pop!_OS on your computer! Let me know if you face any issues. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-pop-os/ + +作者:[Pratham 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://itsfoss.com/author/pratham/ +[b]: https://github.com/lujun9972 +[1]: https://pop.system76.com/ +[2]: https://itsfoss.com/get-linux-laptops/ +[3]: https://itsfoss.com/pop-os-vs-ubuntu/ +[4]: https://itsfoss.com/install-linux-in-virtualbox/ +[5]: https://itsfoss.com/install-ubuntu-1404-dual-boot-mode-windows-8-81-uefi/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/POP_OS-Installation.png?resize=800%2C450&ssl=1 +[7]: https://pop.system76.com +[8]: https://www.phoronix.com/scan.php?page=news_item&px=Intel-DG1-Status-XDC2021 +[9]: https://itsfoss.com/check-graphics-card-linux/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/pop-os-download-options.webp?resize=800%2C740&ssl=1 +[11]: https://www.balena.io/etcher/ +[12]: https://unetbootin.github.io +[13]: https://rufus.ie/en/ +[14]: https://www.ventoy.net/en/index.html +[15]: https://itsfoss.com/create-live-usb-of-ubuntu-in-windows/%5D +[16]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/11/balena-etcher-create-linux-live-usb.png?resize=800%2C450&ssl=1 +[17]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-01-bios-uefi-boot-menu-keys.webp?resize=732%2C366&ssl=1 +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-02-boot-menu.webp?resize=731%2C364&ssl=1 +[19]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-03-select-boot-drive-3.webp?resize=800%2C399&ssl=1 +[20]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-01-installer-init.webp?resize=800%2C595&ssl=1 +[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-02-installation-options.webp?resize=800%2C595&ssl=1 +[22]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-03-drive-selection.webp?resize=800%2C595&ssl=1 +[23]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-04-name-and-username-selection.webp?resize=800%2C595&ssl=1 +[24]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-05-password-setup-screen.webp?resize=800%2C595&ssl=1 +[25]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-06-drive-encryption-options.webp?resize=800%2C595&ssl=1 +[26]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/04-08-installation.webp?resize=800%2C595&ssl=1 +[27]: https://itsfoss.community/ From faa800326b8290a6886ae30ca1a944b9961370a0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 13 Oct 2021 05:03:26 +0800 Subject: [PATCH 0689/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211012?= =?UTF-8?q?=20Create=20a=20timer=20on=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211012 Create a timer on Linux.md --- .../tech/20211012 Create a timer on Linux.md | 277 ++++++++++++++++++ 1 file changed, 277 insertions(+) create mode 100644 sources/tech/20211012 Create a timer on Linux.md diff --git a/sources/tech/20211012 Create a timer on Linux.md b/sources/tech/20211012 Create a timer on Linux.md new file mode 100644 index 0000000000..2cbfa013aa --- /dev/null +++ b/sources/tech/20211012 Create a timer on Linux.md @@ -0,0 +1,277 @@ +[#]: subject: "Create a timer on Linux" +[#]: via: "https://opensource.com/article/21/10/linux-timers" +[#]: author: "Stephan Avenwedde https://opensource.com/users/hansic99" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Create a timer on Linux +====== +A tutorial showing how to create a POSIX-compliant interval timer. +![Team checklist][1] + +The timing of certain events is a common task for a developer. Common scenarios for timers are watchdogs, cyclic execution of tasks, or scheduling events for a specific time. In this article, I show how to create a POSIX-compliant interval timer using [timer_create(...)][2]. + +You can download the source code for the following examples from [GitHub][3]. + +### Prepare Qt Creator + +I used [Qt Creator][4] as the IDE for this example. To run and debug the example code in Qt Creator, clone the [GitHub][3] repository, open Qt Creator, and go to **File -> Open File or Project...** and choose the **CMakeLists.txt**: + +![Qt Creator open project][5] + +Open a project in Qt Creator (CC-BY-SA 4.0) + +After selecting the toolchain, click on **Configure Project**. The project contains three independent examples (we will only cover two of them in this article). With the green-marked menu, switch between the configurations for each example and activate **Run in terminal** for each of them (see the yellow mark below). The currently active example for building and debugging can be selected over the **Debug** button on the bottom left corner (see the orange mark below): + +![Project configuration][6] + +Project configuration (CC-BY-SA 4.0) + +### Threading timer + +Let's take a look at the _simple_threading_timer.c_ example. This is the simplest one: It shows how an interval timer is created, which calls the function **expired** on expiration. On each expiration, a new thread is created in which the function **expiration** is called. + + +``` +#include <stdio.h> +#include <stdlib.h> +#include <time.h> +#include <signal.h> +#include <unistd.h> +#include <string.h> +#include <errno.h> + +void expired(union sigval timer_data); + +pid_t gettid(void); + +struct t_eventData{ +    int myData; +}; + +int main() +{ +    int res = 0; +    timer_t timerId = 0; + +    struct t_eventData eventData = { .myData = 0 }; + +    /*  sigevent specifies behaviour on expiration  */ +    struct sigevent sev = { 0 }; + +    /* specify start delay and interval +     * it_value and it_interval must not be zero */ + +    struct itimerspec its = {   .it_value.tv_sec  = 1, +                                .it_value.tv_nsec = 0, +                                .it_interval.tv_sec  = 1, +                                .it_interval.tv_nsec = 0 +                            }; + +    [printf][7]("Simple Threading Timer - thread-id: %d\n", gettid()); + +    sev.sigev_notify = SIGEV_THREAD; +    sev.sigev_notify_function = &expired; +    sev.sigev_value.sival_ptr = &eventData; + +    /* create timer */ +    res = timer_create(CLOCK_REALTIME, &sev, &timerId); + +    if (res != 0){ +        [fprintf][8](stderr, "Error timer_create: %s\n", [strerror][9](errno)); +        [exit][10](-1); +    } + +    /* start timer */ +    res = timer_settime(timerId, 0, &its, NULL); + +    if (res != 0){ +        [fprintf][8](stderr, "Error timer_settime: %s\n", [strerror][9](errno)); +        [exit][10](-1); +    } + +    [printf][7]("Press ETNER Key to Exit\n"); +    while([getchar][11]()!='\n'){} +    return 0; +} + +void expired(union sigval timer_data){ +    struct t_eventData *data = timer_data.sival_ptr; +    [printf][7]("Timer fired %d - thread-id: %d\n", ++data->myData, gettid()); +} +``` + +The advantage of this approach is its small footprint, in terms of code and simple debugging. The disadvantage is the additional overhead due to the creation of a new thread on expiration and, consequently, the less deterministic behavior. + +### Interrupt Signal Timer + +Another possibility to be notified by an expired timer is based on a [kernel signal][12]. Instead of creating a new thread each time the timer expires, the kernel sends a signal to the process, the process is interrupted, and the corresponding signal handler is called. + +As the default action when receiving a signal is to terminate the process (see [signal][13] man page), we have to prepare Qt Creator in advance so that properly debugging is possible. + +The default behavior of Qt Creator when the debuggee receives a signal is: + + * Interrupt execution and switch to the debugger context. + * Display a pop-up window that notifies the user about the reception of a signal. + + + +Both actions are not wanted as the reception of a signal is part of our application. + +Qt Creator uses GDB in the background. In order to prevent GDB from stopping the execution when the process receives a signal, go to **Tools** -> **Options**, select **Debugger**, and navigate to **Locals & Expressions**. Add the following expression to _Debugging Helper Customization_: + + +``` +`handle SIG34 nostop pass` +``` + +![Signal no stop with error][14] + +Sig 34 no stop with error (CC-BY-SA 4.0) + +You can find more information about GDB signal handling in the [GDB documentation][15]. + +Next, we want to suppress the pop-up window that notifies us every time a signal is received when we stop in the signal handler: + +![Signal 34 pop up box][16] + +Signal 34 pop-up box (CC-BY-SA 4.0) + +To do so, navigate to the tab **GDB** and uncheck the marked checkbox: + +![Timer signal windows][17] + +Timer signal windows (CC-BY-SA 4.0) + +Now you can properly debug the _signal_interrupt_timer_. The actual implementation of the signal timer is a bit more complex: + + +``` +#include <stdio.h> +#include <stdlib.h> +#include <signal.h> +#include <unistd.h> +#include <signal.h> +#include <time.h> +#include <unistd.h> +#include <errno.h> +#include <string.h> + +#define UNUSED(x) (void)(x) + +static void handler(int sig, siginfo_t *si, void *uc); +pid_t gettid(void); + +struct t_eventData{ +    int myData; +}; + +int main() +{ +    int res = 0; +    timer_t timerId = 0; + +    struct sigevent sev = { 0 }; +    struct t_eventData eventData = { .myData = 0 }; + +    /* specifies the action when receiving a signal */ +    struct sigaction sa = { 0 }; + +    /* specify start delay and interval */ +    struct itimerspec its = {   .it_value.tv_sec  = 1, +                                .it_value.tv_nsec = 0, +                                .it_interval.tv_sec  = 1, +                                .it_interval.tv_nsec = 0 +                            }; + +    [printf][7]("Signal Interrupt Timer - thread-id: %d\n", gettid()); + +    sev.sigev_notify = SIGEV_SIGNAL; // Linux-specific +    sev.sigev_signo = SIGRTMIN; +    sev.sigev_value.sival_ptr = &eventData; + +    /* create timer */ +    res = timer_create(CLOCK_REALTIME, &sev, &timerId); + +    if ( res != 0){ +        [fprintf][8](stderr, "Error timer_create: %s\n", [strerror][9](errno)); +        [exit][10](-1); +    } + +    /* specifz signal and handler */ +    sa.sa_flags = SA_SIGINFO; +    sa.sa_sigaction = handler; + +    /* Initialize signal */ +    sigemptyset(&sa.sa_mask); + +    [printf][7]("Establishing handler for signal %d\n", SIGRTMIN); + +    /* Register signal handler */ +    if (sigaction(SIGRTMIN, &sa, NULL) == -1){ +        [fprintf][8](stderr, "Error sigaction: %s\n", [strerror][9](errno)); +        [exit][10](-1); +    } + +    /* start timer */ +    res = timer_settime(timerId, 0, &its, NULL); + +    if ( res != 0){ +        [fprintf][8](stderr, "Error timer_settime: %s\n", [strerror][9](errno)); +        [exit][10](-1); +    } + +    [printf][7]("Press ENTER to Exit\n"); +    while([getchar][11]()!='\n'){} +    return 0; +} + +static void +handler(int sig, siginfo_t *si, void *uc) +{ +    UNUSED(sig); +    UNUSED(uc); +    struct t_eventData *data = (struct t_eventData *) si->_sifields._rt.si_sigval.sival_ptr; +    [printf][7]("Timer fired %d - thread-id: %d\n", ++data->myData, gettid()); +} +``` + +In contrast to the threading timer, we have to initialize the signal and register a signal handler. This approach is more performant as it won't cause the creation of additional threads. For this reason, the execution of the signal handler is also more deterministic. The drawback is clearly the extra configuration effort to debug this properly. + +### Summary + +Both methods described in this article are close-to-the-kernel implementations of timers. Even if the [timer_create(...)][2] function is part of the POSIX specification, it is not possible to compile the sample code on a FreeBSD system due to small differences in data structures. Besides this drawback, such an implementation gives you fine-grained control for general-purpose timing applications. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-timers + +作者:[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/checklist_todo_clock_time_team.png?itok=1z528Q0y (Team checklist) +[2]: https://linux.die.net/man/2/timer_create +[3]: https://github.com/hANSIc99/posix_timers +[4]: https://www.qt.io/product/development-tools +[5]: https://opensource.com/sites/default/files/posix_timers_open_project_0.png +[6]: https://opensource.com/sites/default/files/posix_timers_project_configuration_2.png +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fprintf.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/strerror.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/exit.html +[11]: http://www.opengroup.org/onlinepubs/009695399/functions/getchar.html +[12]: https://man7.org/linux/man-pages/man3/signal.3p.html +[13]: https://linux.die.net/man/7/signal +[14]: https://opensource.com/sites/default/files/posix_timers_sig34_nostop_pass.png +[15]: https://sourceware.org/gdb/onlinedocs/gdb/Signals.html +[16]: https://opensource.com/sites/default/files/posix_timers_sig34_pop_up_2.png +[17]: https://opensource.com/sites/default/files/posix_timers_signal_windows.png From e2d68bf9a6f81b4a7723a958eaa412b3e8311e1c Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 13 Oct 2021 08:46:13 +0800 Subject: [PATCH 0690/1588] translated --- ... use Ansible and anacron for automation.md | 135 ------------------ 1 file changed, 135 deletions(-) delete mode 100644 sources/tech/20210930 How I use Ansible and anacron for automation.md diff --git a/sources/tech/20210930 How I use Ansible and anacron for automation.md b/sources/tech/20210930 How I use Ansible and anacron for automation.md deleted file mode 100644 index 7df9a4d6be..0000000000 --- a/sources/tech/20210930 How I use Ansible and anacron for automation.md +++ /dev/null @@ -1,135 +0,0 @@ -[#]: subject: "How I use Ansible and anacron for automation" -[#]: via: "https://opensource.com/article/21/9/ansible-anacron-automation" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How I use Ansible and anacron for automation -====== -With anacron, I can drop scripts and Ansible playbooks into place for -all manner of trivial tasks. -![Woman programming][1] - -Automation is the great IT and DevOps ideal, but in my experience, anything that's not immediately convenient may as well not exist at all. There have been many times when I've come up with a pretty good solution for some task, and I'll even script it, but I stop short of making it literally automated because the infrastructure for easy automation doesn't exist on the machine I'm working on. - -My favorite easy automation tool used to be the cron system—old, reliable, user-facing, and (aside from a scheduling syntax I can never commit to memory) simple. However, the problem with cron is that it assumes a computer is on 24 hours a day, every day. After missing one too many scheduled backups, I discovered [anacron][2], the cron system based on timestamps rather than scheduled times. If your computer is off when a job would typically have run, anacron ensures that it's run when the computer is back on. Creating a job is as easy as dropping a shell script into one of three directories: `cron.daily`, `cron.weekly`, or `cron.monthly` (you can define more if you want). With anacron, I find myself dropping scripts and Ansible playbooks into place for all manner of trivial tasks, including pop-up reminders of upcoming due dates or events. - -It's a simple and obvious solution to a modern problem, but it does me no good if anacron isn't installed on the computer. - -### Software setup with Ansible - -Any time I set up a new computer, whether it's a laptop, workstation, or server, I install anacron. That's easy, but an anacron install only provides the anacron command. It doesn't set up the anacron user environment. So I created an Ansible playbook to set up what the user needs to use anacron and install the anacron command. - -First, the standard Ansible boilerplate: - - -``` -\--- -\- hosts: localhost -  tasks: -``` - -### Creating directories with Ansible - -Next, I create the directory tree I use for anacron. You can think of this as a sort of transparent crontab. - - -``` -    - name: create directory tree -      ansible.builtin.file: -        path: "{{ item }}" -        state: directory -      with_items: -        - '~/.local/etc/cron.daily' -        - '~/.local/etc/cron.weekly' -        - '~/.local/etc/cron.monthly' -        - '~/.var/spool/anacron' -``` - -The syntax of this might seem a little strange, but it's actually a loop. The `with_items:` directive defines four directories to create, and Ansible iterates over the `ansible.builtin.file:` directive once for each directory (the directory name populates the `{{ item }}` variable). As with everything in Ansible, there's no error or conflict if the directory already exists. - -### Copying files with Ansible - -The `ansible.builtin.copy` module copies files from one location to another. For this to work, I needed to create a file called `anacrontab`. It's not an Ansible playbook, so I keep it in my `~/Ansible/data` directory, where I keep support files for my playbooks. - - -``` -    - name: copy anacrontab into place -      ansible.builtin.copy: -        src: ~/Ansible/data/anacrontab -        dest: ~/.local/etc/anacrontab -        mode: '0755' -``` - -My `anacrontab` file is simple and mimics the one some distributions install by default into `/etc/anacron`: - - -``` -SHELL=/bin/sh -PATH=/sbin:/bin:/usr/sbin:/usr/bin -1  0  cron.day    run-parts $HOME/.local/etc/cron.daily/ -7  0  cron.wek    run-parts $HOME/.local/etc/cron.weekly/ -30 0  cron.mon    run-parts $HOME/.local/etc/cron.monthly/ -``` - -### Running anacron on login - -Most Linux distributions configure anacron to read jobs from `/etc/anacron`. I mostly use anacron as a regular user, so I launch anacron from my login `~/.profile`. I don't want to have to remember to configure that myself, so I have Ansible do it. I use the `ansible.builtin.lineinfile` module, which creates `~/.profile` if it doesn't already exist and inserts the anacron launch line. - - -``` -    - name: add local anacrontab to .profile -      ansible.builtin.lineinfile: -        path: ~/.profile -        regexp: '^/usr/sbin/anacron' -        line: '/usr/sbin/anacron -t ~/.local/etc/anacrontab' -        create: true -``` - -### Installing anacron with Ansible - -For most of my systems, the `dnf` module would work for package installation, but my workstation runs Slackware (which uses `slackpkg`), and sometimes a different Linux distro makes its way into my collection. The `ansible.builtin.package` module provides a generic interface to package installation, so I use it for this playbook. Luckily, I haven't come across a repo that names `anacron` anything but `anacron`, so for now, I don't have to account for potential differences in package names. - -This is actually a separate play because package installation requires privilege escalation, provided by the `becomes: true` directive. - - -``` -\- hosts: localhost -  become: true -  tasks: -    - name: install anacron -      ansible.builtin.package: -        name: anacron -        state: present -``` - -### Using anacron and Ansible for easy automation - -To install anacron with Ansible, I run the playbook: - - -``` -`$ ansible-playbook ~/Ansible/setup-anacron.yaml` -``` - -From then on, I can write shell scripts to perform some trivial but repetitive task and copy it into `~/.local/etc/cron.daily` to have it automatically run once a day (or thereabouts). I also write Ansible playbooks for tasks such as [cleaning out my downloads folder][3]. I place my playbooks in `~/Ansible`, which is where I keep my Ansible plays, and then create a shell script in `~/.local/etc/cron.daily` to execute the play. It's easy, painless, and quickly becomes second nature. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/ansible-anacron-automation - -作者:[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/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) -[2]: https://opensource.com/article/21/2/linux-automation -[3]: https://opensource.com/article/21/9/keep-folders-tidy-ansible From 7ce6a86ec0b6d308b686a27072eca7b6fcff91d9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 13 Oct 2021 08:48:43 +0800 Subject: [PATCH 0691/1588] translated --- ... use Ansible and anacron for automation.md | 134 ++++++++++++++++++ 1 file changed, 134 insertions(+) create mode 100644 translated/tech/20210930 How I use Ansible and anacron for automation.md diff --git a/translated/tech/20210930 How I use Ansible and anacron for automation.md b/translated/tech/20210930 How I use Ansible and anacron for automation.md new file mode 100644 index 0000000000..879e79cb57 --- /dev/null +++ b/translated/tech/20210930 How I use Ansible and anacron for automation.md @@ -0,0 +1,134 @@ +[#]: subject: "How I use Ansible and anacron for automation" +[#]: via: "https://opensource.com/article/21/9/ansible-anacron-automation" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +我如何使用 Ansible 和 anacron 实现自动化 +====== +有了 anacron,我可以把脚本和 Ansible playbooks 放到合适的地方,以完成各种琐碎的任务。 +![Woman programming][1] + +自动化是很好的 IT 和 DevOps 的理想,但根据我的经验,任何不方便的东西可能根本不存在。有很多次,我为某些任务想出了一个很好的解决方案,我甚至会编写脚本,但我没有让它真正实现自动化,因为在我工作的机器上不存在易于自动化的基础设施。 + +我最喜欢的简易自动化工具曾经是 cron 系统,它古老、可靠、面向用户,而且(除了一个我永远无法记住的调度语法)简单。然而,cron 的问题是,它假定一台电脑每天 24 小时都在工作。在错过了太多预定的备份之后,我发现了 [anacron][2],一个基于时间戳而非预定时间的 cron 系统。如果你的电脑在通常情况下运行时处于关闭状态,Anacron 会确保它在电脑重新开启时运行。创建一个作业就像把一个 shell 脚本放到三个目录中一样简单。`cron.day`、`cron.weekly` 或者 `cron.monthly` (如果你想的话,你可以定义更多)。有了 anacron,我发现自己把脚本和 Ansible playbook 放到了各种琐碎的任务中,包括弹出到期和事件提醒。 + +这是一个现代问题的简单而明显的解决方案,但如果 anacron 没有安装在电脑上,它对我没有好处。 + +### 用 Ansible 进行软件设置 + +任何时候我设置一台新的计算机,无论是笔记本电脑、工作站还是服务器,我都会安装 anacron。这很简单,但是 anacron 的安装只提供了 anacron 命令。它并没有设置 Anacron 的用户环境。所以我创建了一个 Ansible playbook 来设置用户需要什么来使用 anacron 并安装 anacron 命令。 + +首先,标准的Ansible模板: + + +``` +\--- +\- hosts: localhost + tasks: +``` + +### 用 Ansible 创建目录 + +接下来,我创建了用于 Anacron 的目录树。你可以把它看成是一种透明的 crontab。 + + +``` + - name: create directory tree + ansible.builtin.file: + path: "{{ item }}" + state: directory + with_items: + - '~/.local/etc/cron.daily' + - '~/.local/etc/cron.weekly' + - '~/.local/etc/cron.monthly' + - '~/.var/spool/anacron' +``` + +这个语法可能看起来有点奇怪,但它实际上是一个循环。`with_items:` 指令定义了四个要创建的目录,Ansible 在 `ansible.buildin.file:` 指令中为每个目录迭代一次(目录名填充了 `{{ item }}` 变量)。与 Ansible 中的一切一样,如果目录已经存在,就不会有错误或冲突。 + +### 用 Ansible 复制文件 + +`ansible.buildin.copy` 模块将文件从一个地方复制到另一个地方。为了让它工作,我需要创建一个叫做 `anacrontab` 的文件。它不是 Ansible playbook,所以我把它放在我的 `~/Ansible/data` 目录下,那里是我的 playbook 的支持文件。 + + +``` + - name: copy anacrontab into place + ansible.builtin.copy: + src: ~/Ansible/data/anacrontab + dest: ~/.local/etc/anacrontab + mode: '0755' +``` + +我的 `anacrontab` 文件很简单,模仿了一些发行版默认安装在 `/etc/anacron` 中的文件: + + +``` +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +1 0 cron.day run-parts $HOME/.local/etc/cron.daily/ +7 0 cron.wek run-parts $HOME/.local/etc/cron.weekly/ +30 0 cron.mon run-parts $HOME/.local/etc/cron.monthly/ +``` + +### 登录时运行 anacron + +大多数 Linux 发行版将 anacron 配置为从 `/etc/anacron` 读取作业。我主要是作为一个普通用户使用 anacron,所以我从我的登录账号 `~/.profile`启动 anacron。我不想让自己记住这些配置,所以我让 Ansible 来做。我使用 `ansible.buildin.lineinfile` 模块,它会在 `~/.profile` 不存在时创建它,并插入 anacron 的启动行。 + + +``` + - name: add local anacrontab to .profile + ansible.builtin.lineinfile: + path: ~/.profile + regexp: '^/usr/sbin/anacron' + line: '/usr/sbin/anacron -t ~/.local/etc/anacrontab' + create: true +``` + +### 用 Ansible 安装 anacron + +对于我的大多数系统来说,`dnf` 模块可以用来安装软件包,但我的工作站运行的是 Slackware(使用 `slackpkg`),有时不同的 Linux 发行版也会进入我的收藏。`ansible.buildin.package` 模块提供了一个安装软件包的通用接口,所以我把它用在这个 playbook 上。幸运的是,我还没有遇到一个仓库将 `anacron` 命名为 `anacron`,所以现在,我不必考虑软件包名称的潜在差异。 + +这实际上是一个单独的 playbook,因为软件包的安装需要权限升级,它由 `becomes: true` 指令提供。 + + +``` +\- hosts: localhost + become: true + tasks: + - name: install anacron + ansible.builtin.package: + name: anacron + state: present +``` + +### 使用 anacron 和 Ansible 实现轻松自动化 + +为了用 Ansible 安装 anacron,我运行 playbook: + + +``` +`$ ansible-playbook ~/Ansible/setup-anacron.yaml` +``` + +从这里起,我就可以编写 shell 脚本来执行一些琐碎但重复的任务,然后把它复制到 `~/.local/etc/cron.daily`,让它每天自动运行一次(或者大约如此)。我还为诸如[清理下载文件夹][3]之类的任务编写了 Ansible playbook。我把我的 playbook 放在 `~/Ansible` 里,这是我保存 Ansible playbook 的地方,然后在 `~/.local/etc/cron.daily` 里创建一个 shell 脚本来执行这个 playbook。这很简单,不费吹灰之力,而且很快第二天也自然如此。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/ansible-anacron-automation + +作者:[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/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://opensource.com/article/21/2/linux-automation +[3]: https://opensource.com/article/21/9/keep-folders-tidy-ansible From a4a331f4eb9c7565536ef9fef8426c24e9ea9a75 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 13 Oct 2021 08:50:20 +0800 Subject: [PATCH 0692/1588] translating --- ...001 How to Install Google Chrome on Debian and Kali Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md b/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md index 253966335e..a3fb8467ef 100644 --- a/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md +++ b/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-chrome-debian-kali-linux/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 88b8a2805f998a25c649733f48d4f19df70d58d4 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Wed, 13 Oct 2021 09:43:40 +0800 Subject: [PATCH 0693/1588] translating by perfiffer --- ... Rotate and archive logs with the Linux logrotate command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md b/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md index 007e41cd22..e28262bbdc 100644 --- a/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md +++ b/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/linux-logrotate" [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 5c4468fe0ad27e2f6a1d8eb793cb9cb2972285dd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 Oct 2021 14:27:10 +0800 Subject: [PATCH 0694/1588] PRF&PUB @imgradeone https://linux.cn/article-13877-1.html --- ...on Ubuntu and Other Linux Distributions.md | 44 ++++++++++--------- 1 file changed, 23 insertions(+), 21 deletions(-) rename {translated/tech => published}/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md (77%) diff --git a/translated/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md b/published/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md similarity index 77% rename from translated/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md rename to published/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md index 31dd4d01c2..315ab7790f 100644 --- a/translated/tech/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md +++ b/published/20211008 How to Install Vivaldi Browser on Ubuntu and Other Linux Distributions.md @@ -3,36 +3,38 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "imgradeone" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13877-1.html" -如何在 Ubuntu 和其他 Linux 发行版中安装 Vivaldi 浏览器 +[初级] 如何在 Ubuntu 中安装 Vivaldi 浏览器 ====== -> 您将在本篇新手教程中学习如何在 Ubuntu、Debian 及其他 Linux 发行版中安装 Vivaldi 网页浏览器,同时本教程也将介绍如何更新和卸载该软件。 +![](https://img.linux.net.cn/data/attachment/album/202110/13/142545reotvtqgqpfvmmvp.jpg) -[Vivaldi][1] 是一款关注度逐步上升的网页浏览器。它基于 Chromium 内核,因此它拥有和 Chrome 类似的功能,但它也新增了一些其他特色功能,让这款浏览器与众不同、更为直观。 +> 你将在本篇新手教程中学习如何在 Ubuntu、Debian 及其他 Linux 发行版中安装 Vivaldi 网页浏览器,同时本教程也将介绍如何更新和卸载该软件。 -它内置了标签组、广告拦截、鼠标手势、笔记管理,甚至还有命令连锁。你甚至可以借助页面平铺来一次性浏览多个页面。当然,相比于 Chrome,Vivaldi 更加尊重你的隐私。 +[Vivaldi][1] 是一款日益流行的网页浏览器。它基于 Chromium 内核,因此它拥有和 Chrome 类似的功能,但它也新增了一些其他特色功能,让这款浏览器与众不同、更为直观。 -![页面平铺,一次性浏览多个页面][2] +它内置了标签组、广告拦截、鼠标手势、笔记管理,甚至还有命令连锁。你甚至可以借助切分视图来一次性浏览多个页面。当然,相比于 Chrome,Vivaldi 更加尊重你的隐私。 -你可以从 [Manjaro Linux 近期使用 Vivaldi 取代 Firefox 作为部分分支的默认浏览器][3] 这件事来了解 Vivaldi 浏览器的受欢迎程度。 +![标签平铺,一次性分割浏览多个页面][2] + +[Manjaro Linux 近期使用 Vivaldi 取代 Firefox 作为其部分变体的默认浏览器][3],你可以从这件事来了解 Vivaldi 浏览器的受欢迎程度。 如果你想尝试一下这款浏览器的话,接下来让我告诉你,如何在 Linux 上安装 Vivaldi。你将了解到: * 安装 Vivaldi 的 GUI 和命令行方式 - * 将 Vivaldi 更新到最新版本的提示 + * 将 Vivaldi 更新到最新版本的技巧 * 在 Ubuntu 中卸载 Vivaldi 的方式 -> 非自由软件(Non-FOSS)警告! +> **非自由软件警告!** > > Vivaldi 并非完全的开源软件。它的 UI 界面是闭源的。之所以在这里介绍这款浏览器,是因为 Vivaldi 团队正努力让该软件在 Linux 平台上可用。 -### 在 Ubuntu 中安装 Vivaldi [GUI 方式] +### 方式 1:在 Ubuntu 中安装 Vivaldi [GUI 方式] -好消息是,Vivaldi 提供了预先构建好的安装包,包括 Ubuntu/Debian 的 DEB 文件,以及 Fedora、Red Hat、SUSE 的 RPM 文件、 +好消息是,Vivaldi 提供了预先构建好的安装包,包括 Ubuntu/Debian 的 DEB 文件,以及 Fedora、Red Hat、SUSE 的 RPM 文件。 它支持 32 位和 64 位平台,也支持 [像树莓派之类的 ARM 设备][4]。 @@ -46,7 +48,7 @@ 前往 Vivaldi 的下载页面,下载支持 Ubuntu 的 DEB 格式安装包。 -[下载 Vivaldi][6] +- [下载 Vivaldi][6] ![下载支持 Ubuntu/Debian 的 DEB 安装包][7] @@ -60,11 +62,11 @@ ![点击安装按钮][10] -您将需要输入系统账户的密码,输入密码授权后,Vivaldi 很快就能完成安装,随后安装按钮也变成了移除按钮。这表明 Vivaldi 已经安装完成了。 +你将需要输入系统账户的密码,输入密码授权后,Vivaldi 很快就能完成安装,随后安装按钮也变成了移除按钮。这表明 Vivaldi 已经安装完成了。 #### 第 3 步:使用 Vivaldi -按下 Super(Windows)键打开系统菜单,搜索 Vivaldi,然后单击 Vivaldi 的图标。 +按下 `Super`(`Windows`)键打开系统菜单,搜索 Vivaldi,然后单击 Vivaldi 的图标。 ![在系统菜单中搜索 Vivaldi][11] @@ -76,7 +78,7 @@ ### 方式 2:借助终端,在 Ubuntu/Debian 上安装 Vivaldi -打开终端,确认你已经安装了用于 [在命令行下下载文件][13] 的 wget。 +打开终端,确认你已经安装了用于 [在命令行下下载文件][13] 的 `wget`。 ``` sudo apt install wget @@ -116,13 +118,13 @@ GUI 和命令行这两种方式都会在系统里添加 Vivaldi 的仓库。这 如果你不喜欢 Vivaldi 或者不再使用,你可以直接卸载。现在,如果你想 [在 Ubuntu 中卸载软件][17],你可能会想到软件中心,但软件中心不会查找到外部和第三方的软件包。 -目前你必须使用终端卸载 Vivaldi,即便你使用 GUI 方式安装。其实这也很简单,打开终端,输入以下命令: +目前你必须使用终端卸载 Vivaldi,即便你是使用 GUI 方式安装的。其实这也很简单,打开终端,输入以下命令: ``` sudo apt remove vivaldi-stable ``` -sudo 会 [在 Ubuntu 中给予你 root 权限][18]。你需要输入当前账户的密码。输入密码时,你可能不会在屏幕上看见输入密码的痕迹。这是正常现象,直接输入密码即可,随后 Vivaldi 将被卸载。 +`sudo` 会 [在 Ubuntu 中给予你 root 权限][18]。你需要输入当前账户的密码。输入密码时,你可能不会在屏幕上看见输入密码的痕迹。这是正常现象,直接输入密码即可,随后 Vivaldi 将被卸载。 希望这篇关于如何在 Linux 安装 Vivaldi 的教程对你有用。 @@ -132,8 +134,8 @@ via: https://itsfoss.com/install-vivaldi-ubuntu-linux/ 作者:[Abhishek Prakash][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 408d9ae28876ca6f51283269ad1337d06994de25 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Wed, 13 Oct 2021 15:07:31 +0800 Subject: [PATCH 0695/1588] translating by george --- ...Define and optimize data partitions in Apache Cassandra.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md b/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md index d28f0daee0..240855e188 100644 --- a/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md +++ b/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (unigeorge) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) @@ -136,7 +136,7 @@ via: https://opensource.com/article/20/5/apache-cassandra 作者:[Anil Inamdar][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 c858a630fcb2f54a8641b28c8e8f0d550fec29c2 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 13 Oct 2021 15:51:31 +0800 Subject: [PATCH 0696/1588] PRF&PUB @geekpi https://linux.cn/article-13879-1.html --- ... use Ansible and anacron for automation.md | 129 +++++++++++++++++ ... use Ansible and anacron for automation.md | 134 ------------------ 2 files changed, 129 insertions(+), 134 deletions(-) create mode 100644 published/20210930 How I use Ansible and anacron for automation.md delete mode 100644 translated/tech/20210930 How I use Ansible and anacron for automation.md diff --git a/published/20210930 How I use Ansible and anacron for automation.md b/published/20210930 How I use Ansible and anacron for automation.md new file mode 100644 index 0000000000..bde30f2bb5 --- /dev/null +++ b/published/20210930 How I use Ansible and anacron for automation.md @@ -0,0 +1,129 @@ +[#]: subject: "How I use Ansible and anacron for automation" +[#]: via: "https://opensource.com/article/21/9/ansible-anacron-automation" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13879-1.html" + +我如何使用 Ansible 和 anacron 实现自动化 +====== + +> 有了 anacron,我可以把脚本和 Ansible 剧本放到合适的地方,以完成各种琐碎的任务。 + +![](https://img.linux.net.cn/data/attachment/album/202110/13/155036tc0c7th906cc96mm.jpg) + +自动化是伟大的 IT 和 DevOps 理想,但根据我的经验,可能根本不存在什么不方便的东西。有很多次,我为某些任务想出了一个很好的解决方案,我甚至会编写脚本,但我没有让它真正实现自动化,因为在我工作的机器上不存在易于自动化的基础设施。 + +我最喜欢的简易自动化工具曾经是 cron 系统,它古老、可靠、面向用户,而且简单(除了一个我永远无法记住的调度语法之外)。然而,cron 的问题是,它假定一台电脑每天 24 小时都在工作。在错过了太多预定的备份之后,我发现了 [anacron][2],一个基于时间戳而非预定时间的 cron 系统。如果你的电脑在通常情况下运行时处于关闭状态,anacron 会确保它在电脑重新开启时运行。创建一个作业只需要简单地把一个 shell 脚本放到三个目录中:`cron.day`、`cron.weekly` 或者 `cron.monthly` (如果你想的话,你可以定义更多)。有了 anacron,我发现自己把脚本和 Ansible 剧本用在了各种琐碎的任务中,包括弹出到期和事件提醒。 + +这是一个现代问题的简单而明显的解决方案,但如果 anacron 没有安装在电脑上,那它对我就没有用。 + +### 用 Ansible 进行软件设置 + +任何时候我设置一台新的计算机,无论是笔记本电脑、工作站还是服务器,我都会安装 anacron。这很简单,但是 anacron 的安装只提供了 `anacron` 命令。它并没有设置 anacron 的用户环境。所以我创建了一个 Ansible 剧本来设置用户需要什么来使用 anacron 并安装 `anacron` 命令。 + +首先,标准的 Ansible 模板: + +``` +--- +- hosts: localhost + tasks: +``` + +### 用 Ansible 创建目录 + +接下来,我创建了用于 Anacron 的目录树。你可以把它看成是一种透明的 crontab。 + +``` + - name: create directory tree + ansible.builtin.file: + path: "{{ item }}" + state: directory + with_items: + - '~/.local/etc/cron.daily' + - '~/.local/etc/cron.weekly' + - '~/.local/etc/cron.monthly' + - '~/.var/spool/anacron' +``` + +这个语法可能看起来有点奇怪,但它实际上是一个循环。`with_items:` 指令定义了四个要创建的目录,Ansible 在 `ansible.buildin.file:` 指令中为每个目录迭代一次(目录名填充了 `{{ item }}` 变量)。与 Ansible 中的一切一样,如果目录已经存在,不会有错误或冲突。 + +### 用 Ansible 复制文件 + +`ansible.buildin.copy` 模块将文件从一个地方复制到另一个地方。为了让它工作,我需要创建一个叫做 `anacrontab` 的文件。它不是 Ansible 剧本,所以我把它放在我的 `~/Ansible/data` 目录下,那里是我的剧本的支持文件。 + +``` + - name: copy anacrontab into place + ansible.builtin.copy: + src: ~/Ansible/data/anacrontab + dest: ~/.local/etc/anacrontab + mode: '0755' +``` + +我的 `anacrontab` 文件很简单,模仿了一些发行版默认安装在 `/etc/anacron` 中的文件: + +``` +SHELL=/bin/sh +PATH=/sbin:/bin:/usr/sbin:/usr/bin +1 0 cron.day run-parts $HOME/.local/etc/cron.daily/ +7 0 cron.wek run-parts $HOME/.local/etc/cron.weekly/ +30 0 cron.mon run-parts $HOME/.local/etc/cron.monthly/ +``` + +### 登录时运行 anacron + +大多数 Linux 发行版将 anacron 配置为从 `/etc/anacron` 读取作业。我主要是作为一个普通用户使用 anacron,所以我从我的登录账号 `~/.profile` 启动 anacron。我不想让自己记住这些配置,所以我让 Ansible 来做。我使用 `ansible.buildin.lineinfile` 模块,它会在 `~/.profile` 不存在时创建它,并插入 anacron 的启动行。 + +``` + - name: add local anacrontab to .profile + ansible.builtin.lineinfile: + path: ~/.profile + regexp: '^/usr/sbin/anacron' + line: '/usr/sbin/anacron -t ~/.local/etc/anacrontab' + create: true +``` + +### 用 Ansible 安装 anacron + +对于我的大多数系统来说,`dnf` 模块可以用来安装软件包,但我的工作站运行的是 Slackware(使用 `slackpkg`),有时不同的 Linux 发行版也会进入我的收藏。`ansible.buildin.package` 模块提供了一个安装软件包的通用接口,所以我把它用在这个剧本上。幸运的是,我还没有遇到一个名为 `anacron` 的仓库不是 `anacron`,所以现在,我不必考虑软件包名称的潜在差异。 + +这实际上是一个单独的剧本,因为软件包的安装需要权限升级,它由 `becomes: true` 指令提供。 + +``` +- hosts: localhost + become: true + tasks: + - name: install anacron + ansible.builtin.package: + name: anacron + state: present +``` + +### 使用 anacron 和 Ansible 实现轻松自动化 + +为了用 Ansible 安装 anacron,我运行该剧本: + +``` +$ ansible-playbook ~/Ansible/setup-anacron.yaml +``` + +从此,我就可以编写 shell 脚本来执行一些琐碎但重复的任务,然后把它复制到 `~/.local/etc/cron.daily`,让它每天自动运行一次(或者大约如此)。我还为诸如 [清理下载文件夹][3] 之类的任务编写了 Ansible 剧本。我把我的剧本放在 `~/Ansible` 里,这是我保存 Ansible 剧本的地方,然后在 `~/.local/etc/cron.daily` 里创建一个 shell 脚本来执行这个剧本。这很简单,不费吹灰之力,而且很快成为习惯。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/ansible-anacron-automation + +作者:[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/lead-images/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) +[2]: https://opensource.com/article/21/2/linux-automation +[3]: https://opensource.com/article/21/9/keep-folders-tidy-ansible diff --git a/translated/tech/20210930 How I use Ansible and anacron for automation.md b/translated/tech/20210930 How I use Ansible and anacron for automation.md deleted file mode 100644 index 879e79cb57..0000000000 --- a/translated/tech/20210930 How I use Ansible and anacron for automation.md +++ /dev/null @@ -1,134 +0,0 @@ -[#]: subject: "How I use Ansible and anacron for automation" -[#]: via: "https://opensource.com/article/21/9/ansible-anacron-automation" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -我如何使用 Ansible 和 anacron 实现自动化 -====== -有了 anacron,我可以把脚本和 Ansible playbooks 放到合适的地方,以完成各种琐碎的任务。 -![Woman programming][1] - -自动化是很好的 IT 和 DevOps 的理想,但根据我的经验,任何不方便的东西可能根本不存在。有很多次,我为某些任务想出了一个很好的解决方案,我甚至会编写脚本,但我没有让它真正实现自动化,因为在我工作的机器上不存在易于自动化的基础设施。 - -我最喜欢的简易自动化工具曾经是 cron 系统,它古老、可靠、面向用户,而且(除了一个我永远无法记住的调度语法)简单。然而,cron 的问题是,它假定一台电脑每天 24 小时都在工作。在错过了太多预定的备份之后,我发现了 [anacron][2],一个基于时间戳而非预定时间的 cron 系统。如果你的电脑在通常情况下运行时处于关闭状态,Anacron 会确保它在电脑重新开启时运行。创建一个作业就像把一个 shell 脚本放到三个目录中一样简单。`cron.day`、`cron.weekly` 或者 `cron.monthly` (如果你想的话,你可以定义更多)。有了 anacron,我发现自己把脚本和 Ansible playbook 放到了各种琐碎的任务中,包括弹出到期和事件提醒。 - -这是一个现代问题的简单而明显的解决方案,但如果 anacron 没有安装在电脑上,它对我没有好处。 - -### 用 Ansible 进行软件设置 - -任何时候我设置一台新的计算机,无论是笔记本电脑、工作站还是服务器,我都会安装 anacron。这很简单,但是 anacron 的安装只提供了 anacron 命令。它并没有设置 Anacron 的用户环境。所以我创建了一个 Ansible playbook 来设置用户需要什么来使用 anacron 并安装 anacron 命令。 - -首先,标准的Ansible模板: - - -``` -\--- -\- hosts: localhost - tasks: -``` - -### 用 Ansible 创建目录 - -接下来,我创建了用于 Anacron 的目录树。你可以把它看成是一种透明的 crontab。 - - -``` - - name: create directory tree - ansible.builtin.file: - path: "{{ item }}" - state: directory - with_items: - - '~/.local/etc/cron.daily' - - '~/.local/etc/cron.weekly' - - '~/.local/etc/cron.monthly' - - '~/.var/spool/anacron' -``` - -这个语法可能看起来有点奇怪,但它实际上是一个循环。`with_items:` 指令定义了四个要创建的目录,Ansible 在 `ansible.buildin.file:` 指令中为每个目录迭代一次(目录名填充了 `{{ item }}` 变量)。与 Ansible 中的一切一样,如果目录已经存在,就不会有错误或冲突。 - -### 用 Ansible 复制文件 - -`ansible.buildin.copy` 模块将文件从一个地方复制到另一个地方。为了让它工作,我需要创建一个叫做 `anacrontab` 的文件。它不是 Ansible playbook,所以我把它放在我的 `~/Ansible/data` 目录下,那里是我的 playbook 的支持文件。 - - -``` - - name: copy anacrontab into place - ansible.builtin.copy: - src: ~/Ansible/data/anacrontab - dest: ~/.local/etc/anacrontab - mode: '0755' -``` - -我的 `anacrontab` 文件很简单,模仿了一些发行版默认安装在 `/etc/anacron` 中的文件: - - -``` -SHELL=/bin/sh -PATH=/sbin:/bin:/usr/sbin:/usr/bin -1 0 cron.day run-parts $HOME/.local/etc/cron.daily/ -7 0 cron.wek run-parts $HOME/.local/etc/cron.weekly/ -30 0 cron.mon run-parts $HOME/.local/etc/cron.monthly/ -``` - -### 登录时运行 anacron - -大多数 Linux 发行版将 anacron 配置为从 `/etc/anacron` 读取作业。我主要是作为一个普通用户使用 anacron,所以我从我的登录账号 `~/.profile`启动 anacron。我不想让自己记住这些配置,所以我让 Ansible 来做。我使用 `ansible.buildin.lineinfile` 模块,它会在 `~/.profile` 不存在时创建它,并插入 anacron 的启动行。 - - -``` - - name: add local anacrontab to .profile - ansible.builtin.lineinfile: - path: ~/.profile - regexp: '^/usr/sbin/anacron' - line: '/usr/sbin/anacron -t ~/.local/etc/anacrontab' - create: true -``` - -### 用 Ansible 安装 anacron - -对于我的大多数系统来说,`dnf` 模块可以用来安装软件包,但我的工作站运行的是 Slackware(使用 `slackpkg`),有时不同的 Linux 发行版也会进入我的收藏。`ansible.buildin.package` 模块提供了一个安装软件包的通用接口,所以我把它用在这个 playbook 上。幸运的是,我还没有遇到一个仓库将 `anacron` 命名为 `anacron`,所以现在,我不必考虑软件包名称的潜在差异。 - -这实际上是一个单独的 playbook,因为软件包的安装需要权限升级,它由 `becomes: true` 指令提供。 - - -``` -\- hosts: localhost - become: true - tasks: - - name: install anacron - ansible.builtin.package: - name: anacron - state: present -``` - -### 使用 anacron 和 Ansible 实现轻松自动化 - -为了用 Ansible 安装 anacron,我运行 playbook: - - -``` -`$ ansible-playbook ~/Ansible/setup-anacron.yaml` -``` - -从这里起,我就可以编写 shell 脚本来执行一些琐碎但重复的任务,然后把它复制到 `~/.local/etc/cron.daily`,让它每天自动运行一次(或者大约如此)。我还为诸如[清理下载文件夹][3]之类的任务编写了 Ansible playbook。我把我的 playbook 放在 `~/Ansible` 里,这是我保存 Ansible playbook 的地方,然后在 `~/.local/etc/cron.daily` 里创建一个 shell 脚本来执行这个 playbook。这很简单,不费吹灰之力,而且很快第二天也自然如此。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/ansible-anacron-automation - -作者:[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/programming-code-keyboard-laptop-music-headphones.png?itok=EQZ2WKzy (Woman programming) -[2]: https://opensource.com/article/21/2/linux-automation -[3]: https://opensource.com/article/21/9/keep-folders-tidy-ansible From 6881c7c920d7e14c65b7c39c93b83264b0c549c3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 14 Oct 2021 05:02:31 +0800 Subject: [PATCH 0697/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211013?= =?UTF-8?q?=205=20markdown=20editors=20I=20recommend=20trying?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211013 5 markdown editors I recommend trying.md --- ...3 5 markdown editors I recommend trying.md | 85 +++++++++++++++++++ 1 file changed, 85 insertions(+) create mode 100644 sources/tech/20211013 5 markdown editors I recommend trying.md diff --git a/sources/tech/20211013 5 markdown editors I recommend trying.md b/sources/tech/20211013 5 markdown editors I recommend trying.md new file mode 100644 index 0000000000..275c438515 --- /dev/null +++ b/sources/tech/20211013 5 markdown editors I recommend trying.md @@ -0,0 +1,85 @@ +[#]: subject: "5 markdown editors I recommend trying" +[#]: via: "https://opensource.com/article/21/10/markdown-editors" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 markdown editors I recommend trying +====== +Everyone has their favorite markdown editor. Here are a few I have +tried. +![A pink typewriter][1] + +You can use markdown for anything—formatting websites, authoring books, and writing technical documentation are just some of its uses. I love how easy it is to create rich documents. Everyone has their favorite markdown editor. I have used several on my markdown journey. Here are five markdown editors I have considered.  + + 1. [Abricotine][2] is an open source editor released under the [GPL v.3.0][3]. You can enter formatting by hand or use the menu to insert [Github flavored Markdown][4]. Abricotine allows you to preview text elements like headers, images, math, embedded videos, and to-do lists as you type. The editor is limited to exporting documents as HTML. You can use Abricotine on Linux, macOS, and Windows. + +![Abricontine][5] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + 2. [MarkText][7] is a simple markdown editor. It has many features, and it does a good job of handling documents formatted in markdown. MarkText also supports Github flavored Markdown, which allows you to add tables and blocks of code with syntax highlighting. It supports real-time preview and has a simple interface. MarkText is licensed under [MIT][8]. It supports output in HTML and PDF. MarkText is available on Linux, macOS, and Windows. + +![MarkText][9] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + 3. [Ghostwriter][10] Is a markdown editor for Linux and Windows. According to users of its website: "Enjoy a distraction-free writing experience, including a full-screen mode and a clean interface. With markdown, you can write now and format later." It has built-in light and dark themes that come by default, or you can write your own. You can preview documents as live HTML that you can copy and paste directly into a blog or export into another format. Ghostwriter is released under the [GPL v.3.0][11]. + +![Ghostwriter][12] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + 4. [Atom][13] is billed as a hackable text editor for the twenty-first century. It can function as a markdown editor too. It runs on Linux, Windows, and macOS and is released with an [MIT][14] license. It supports Github flavored Markdown, and **Ctrl**+**Shift**+**M** opens a preview panel so you can easily see the HTML preview. You can get started easily by creating a file and saving it with the `.md` file extension. This tells Atom that it is a markdown file. Atom automatically applies the right packages and syntax highlighting. + +![Atom][15] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + 5. [VSCodium][16] is the free open source code release of Microsoft's VSCode editor without the telemetry built into the stock Microsoft product. It is released with an [MIT][17] license and provides all the functionality of VSCode without the proprietary features. In addition to its other features, VSCodium can function as a markdown editor. Create a new file, click **Select a Language**, choose _Markdown_ and begin writing your code. Easily preview the text by pressing **Ctrl**-**Shift**+**V** and then toggle back to the editor. You can also easily extend the markdown editor by adding an extension. This is my favorite is [markdown editor][18] and it has an [MIT][19] license. + +![VSCodium][20] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + + + +What's your favorite markdown editor? Let us know in the comments. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/markdown-editors + +作者:[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/osdc-docdish-typewriter-pink.png?itok=OXJBtyYf (A pink typewriter) +[2]: https://abricotine.brrd.fr/ +[3]: https://github.com/brrd/abricotine/blob/develop/LICENSE +[4]: https://guides.github.com/features/mastering-markdown/ +[5]: https://opensource.com/sites/default/files/uploads/1_abricontine.png (Abricontine) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://marktext.app/ +[8]: https://github.com/marktext/marktext/blob/develop/LICENSE +[9]: https://opensource.com/sites/default/files/uploads/2_marktext.png (MarkText) +[10]: https://wereturtle.github.io/ghostwriter/ +[11]: https://github.com/wereturtle/ghostwriter/blob/master/COPYING +[12]: https://opensource.com/sites/default/files/uploads/3_ghostwriter.png (Ghostwriter) +[13]: https://atom.io/ +[14]: https://github.com/atom/atom/blob/master/LICENSE.md +[15]: https://opensource.com/sites/default/files/uploads/4_atom.png (Atom) +[16]: https://vscodium.com/ +[17]: https://github.com/VSCodium/vscodium/blob/master/LICENSE +[18]: https://github.com/zaaack/vscode-markdown-editor +[19]: https://github.com/zaaack/vscode-markdown-editor/blob/master/LICENSE +[20]: https://opensource.com/sites/default/files/uploads/5_vscodium.png (VSCodium) From a5674663785d7bc730ad8a702888dde7cde6c281 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 14 Oct 2021 08:52:44 +0800 Subject: [PATCH 0698/1588] translated --- ...ur Passwords - Encryption Keys in Linux.md | 92 ------------------- 1 file changed, 92 deletions(-) delete mode 100644 sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md diff --git a/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md b/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md deleted file mode 100644 index 31c53b4e9c..0000000000 --- a/sources/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md +++ /dev/null @@ -1,92 +0,0 @@ -[#]: subject: "Seahorse: Manage Your Passwords & Encryption Keys in Linux" -[#]: via: "https://itsfoss.com/seahorse/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Seahorse: Manage Your Passwords & Encryption Keys in Linux -====== - -_**Brief:**_ _A simple open-source password and encryption key manager app, let’s explore what it has to offer and how you can get it installed._ - -We often tend to ignore many default/pre-installed applications, especially when numerous tools and utilities are baked in. - -One such helpful tool that you can use on various Linux distributions is **GNOME’s Seahorse**. - -### Seahorse: GNOME’s Password & Encryption Key Manager - -![][1] - -Primarily, Seahorse is an application that comes pre-installed with GNOME desktop and tailored for the same. - -However, you can use it on just about any Linux distribution of your choice. It is a simple and effective utility to manage your passwords and encryption keys / keyring locally. - -You might want to read about the [concept of keyring in Linux][2] if it’s a first for you. - -If you are not a fan of cloud-based password managers, Seahorse can be a great solution to your requirements. Even though it looks straightforward, there are a few essential features that you may find useful. - -Of course, you should also explore some of the [best password managers available for Linux][3] if your priority doesn’t involve managing encryption keys (or local storage). - -### Features of Seahorse - -While you can easily use it as a local (offline) password manager, there are a couple of things that you can do with Seahorse to step up your security management when dealing with encryption keys as well. - -![][4] - -Some key highlights are: - - * Ability to store Secure Shell key (used to access remote computers/servers) - * Store GPG keys used to secure emails and files - * Supports adding password keyring for application and networks - * Securely store private key of a certificate - * Store a password / secret phrase - * Ability to import files and quickly store them - * Find remote keys - * Sync and publish keys - * Ability to find/copy VPN password - - - -![][5] - -### Installing Seahorse in Linux - -If you are using a GNOME-based distribution, you should already have it installed. You need to look for “Seahorse” or “Passwords” to find it. - -In other cases, you can search for it in the software center. It should work fine with KDE, LXQt, and different desktop environments as per my quick tests. - -![][6] - -Moreover, you can find its [Flatpak package][7] available. So, no matter the Linux distribution you are using, Seahorse can be installed. - -If you are using Arch Linux, you should also find it in [AUR][8]. - -[Seahorse][9] - -What do you think about using Seahorse to replace other password managers? Were you already using it to manage encryption keys? Let me know your thoughts in the comments below. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/seahorse/ - -作者:[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/10/seahorse-password-keys.png?resize=800%2C613&ssl=1 -[2]: https://itsfoss.com/ubuntu-keyring/ -[3]: https://itsfoss.com/password-managers-linux/ -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-login.png?resize=800%2C583&ssl=1 -[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-keys.png?resize=800%2C579&ssl=1 -[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-software.png?resize=800%2C508&ssl=1 -[7]: https://www.flathub.org/apps/details/org.gnome.seahorse.Application -[8]: https://itsfoss.com/aur-arch-linux/ -[9]: https://wiki.gnome.org/Apps/Seahorse/ From f05616a814110962c4e0a9d045eac1118a49907a Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 14 Oct 2021 08:53:32 +0800 Subject: [PATCH 0699/1588] translated --- ...ur Passwords - Encryption Keys in Linux.md | 92 +++++++++++++++++++ 1 file changed, 92 insertions(+) create mode 100644 translated/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md diff --git a/translated/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md b/translated/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md new file mode 100644 index 0000000000..a63a3a6ff8 --- /dev/null +++ b/translated/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md @@ -0,0 +1,92 @@ +[#]: subject: "Seahorse: Manage Your Passwords & Encryption Keys in Linux" +[#]: via: "https://itsfoss.com/seahorse/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Seahorse:在 Linux 中管理你的密码和加密密钥 +====== + +_***简介:***_ 一个简单的开源密码和加密密钥管理器应用,让我们来探讨一下它的功能和如何安装它。 + +我们经常倾向于忽视许多默认/预装的应用,尤其是在内置了大量工具和实用程序时。 + +你可以在各种 Linux 发行版上使用的这样一个有用的工具是 **GNOME 的 Seahorse**。 + +### Seahorse:GNOME 的密码及加密密钥管理器 + +![][1] + +主要来说,Seahorse 是一个预装在 GNOME 桌面的应用,并为其量身定做。 + +然而,你可以在你选择的任何 Linux 发行版上使用它。它是一个简单而有效的工具,可以在本地管理你的密码和加密密钥/keyring。 + +如果你是第一次使用,你可能想读一下 [Linux 中 keyring 的概念][2]。 + +如果你不喜欢基于云的密码管理器,Seahorse 可以很好地解决你的要求。尽管它看起来很简单,但有几个基本功能你可能会觉得很有用。 + +当然,如果你的优先事项不涉及管理加密密钥(或本地存储),你也应该探索一些[可用于 Linux 的最佳密码管理器][3] 。 + +### Seahorse 的特点 + +虽然你可以很容易地把它作为一个本地(离线)密码管理器,但在处理加密密钥时,你也可以用 Seahorse 做一些事情来加强你的安全管理。 + +![][4] + +一些关键的亮点是: + + * 能够存储 SSH 密钥(用于访问远程计算机/服务器) + * 存储用于保护电子邮件和文件的 GPG 密钥 + * 支持为应用和网络添加密码 keyring + * 安全地存储证书的私钥 + * 存储一个密码/密语 + * 能够导入文件并快速存储它们 + * 查找远程密钥 + * 同步和发布密钥 + * 能够查找/复制 VPN 密码 + + + +![][5] + +### 在 Linux 中安装 Seahorse + +如果你使用的是基于 GNOME 的发行版,你应该已经安装了它。你可以搜索 “Seahorse” 或者 “Passwords” 来找到它。 + +在其他情况下,你可以在软件中心搜索到它。根据我的快速测试,它在 KDE、LXQt 和不同的桌面环境下应该可以正常工作。 + +![][6] + +此外,你可以找到它的 [Flatpak 包][7]。所以,无论你使用的是哪种 Linux 发行版,都可以安装 Seahorse。 + +如果你使用的是 Arch Linux,你也应该在 [AUR][8] 中找到它。 + +[Seahorse][9] + +你对使用 Seahorse 来取代其他密码管理器有何看法?你是否已经用它来管理加密密钥?请在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/seahorse/ + +作者:[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://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-password-keys.png?resize=800%2C613&ssl=1 +[2]: https://itsfoss.com/ubuntu-keyring/ +[3]: https://itsfoss.com/password-managers-linux/ +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-login.png?resize=800%2C583&ssl=1 +[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-keys.png?resize=800%2C579&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/seahorse-software.png?resize=800%2C508&ssl=1 +[7]: https://www.flathub.org/apps/details/org.gnome.seahorse.Application +[8]: https://itsfoss.com/aur-arch-linux/ +[9]: https://wiki.gnome.org/Apps/Seahorse/ From fc53c9b7530da401c3c99bcfbbb8df939e48ea97 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 14 Oct 2021 08:55:03 +0800 Subject: [PATCH 0700/1588] translating --- sources/tech/20211011 What is a hostname.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211011 What is a hostname.md b/sources/tech/20211011 What is a hostname.md index e4954843e0..ba4f0a62b2 100644 --- a/sources/tech/20211011 What is a hostname.md +++ b/sources/tech/20211011 What is a hostname.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/what-hostname" [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From e03e59f1d75eaabac40f20aaf07b6322d78d08df Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 14 Oct 2021 11:46:47 +0800 Subject: [PATCH 0701/1588] PRF --- ...aging resources with cgroups in systemd.md | 408 +++++++++--------- 1 file changed, 201 insertions(+), 207 deletions(-) diff --git a/translated/tech/20201029 Managing resources with cgroups in systemd.md b/translated/tech/20201029 Managing resources with cgroups in systemd.md index 0a78495f78..ea5606f61f 100644 --- a/translated/tech/20201029 Managing resources with cgroups in systemd.md +++ b/translated/tech/20201029 Managing resources with cgroups in systemd.md @@ -1,164 +1,163 @@ [#]: collector: (lujun9972) [#]: translator: (YungeG) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Managing resources with cgroups in systemd) [#]: via: (https://opensource.com/article/20/10/cgroups) [#]: author: (David Both https://opensource.com/users/dboth) -在 systemd 中使用 cgroup 管理资源 +在 systemd 中使用控制组管理资源 ====== -cgroup 按照应用管理资源,而不是按照组成应用的单个进程。 +> 控制组可以按照应用管理资源,而不是按照组成应用的单个进程。 -![Business woman on laptop sitting in front of window][1] +![](https://img.linux.net.cn/data/attachment/album/202110/14/114622by5jdu87u4vng272.jpg) 作为一个系统管理员,没有事情比意外地耗尽计算资源让我更觉得沮丧。我曾不止一次填满了一个分区的所有可用磁盘空间、耗尽内存、以及没有足够的 CPU 时间在合理的时间内处理我的任务。资源管理是系统管理员最重要的工作之一。 -资源管理的关键是保证所有的进程能够相对公平的访问需要的系统资源。资源管理还包括确保在需要时添加内存、硬盘驱动器空间、还有 CPU 容量;或者在无法添加时限制资源的使用。此外,应该阻止独占系统资源的用户,无论其是否有意。 +资源管理的关键是保证所有的进程能够相对公平的访问需要的系统资源。资源管理还包括确保在需要时添加内存、硬盘驱动器空间、还有 CPU 处理能力;或者在无法添加时限制资源的使用。此外,应该阻止独占系统资源的用户,无论其是否有意。 +系统管理员可以通过一些工具监控和管理不同的系统资源。例如,[top][2] 和类似的工具允许你监控内存、I/O、存储(磁盘、SSD 等)、网络、交换空间、CPU 的用量等。这些工具,尤其是那些以 CPU 为中心的工具,大部分基于以运行的进程为基本单位进行控制的模型。它们最多只是提供了一种方式来调整 `nice` 数字,从而修改优先级,或者杀死一个运行的进程。(要了解 `nice` 数字的信息,查看 [使用 Glances 监控 Linux 和 Windows 主机][3])。 -系统管理员可以通过一些工具监控和管理不同的系统资源。例如,[top][2] 和类似的工具允许你监控内存、I/O、存储(磁盘,SSD等)、网络、交换空间、CPU 的用量等。这些工具,尤其是以 CPU 为中心的工具,大部分基于运行的进程是控制的基本单位的模型。他们最多只是提供了一种方式来调整 nice 数字——从而修改优先级——或者杀死一个运行的进程。(要了解 nice 数字的信息,查看[_使用 Glances 监控 Linux 和 Windows 主机_][3])。 +SystemV 环境中基于传统的资源管理的其他工具,由 `/etc/security/limits.conf` 文件和 `/etc/security/limits.d` 中的本地配置文件控制。资源可以按照用户或组以一种相对粗糙但实用的方式限制。可以管理的资源包括内存的各个方面、每日的总 CPU 时间、数据总量、优先级、`nice` 数字、并发登录的数量、进程数、文件大小的最大值等。 -SystemV 环境中基于传统的资源管理的其他工具,由 `/etc/security/limits.conf` 文件和 `/etc/security/limits.d` 中的本地配置文件控制。资源可以按照用户或组以一种相当粗糙但实用的方式限制。可以管理的资源包括 RAM 的各个方面、每日的总 CPU 时间、数据总量、优先级、nice 数字、同时登陆的数量、进程数、文件大小的最大值等。 +### 使用控制组管理进程 -### 使用 cgroup 管理进程 +[systemd 和 SystemV][4] 之间的一个主要差异是管理进程的方式。SystemV 将每个进程视作一个独立的实体。systemd 将相关的进程集中到一个控制组,简写做 [cgroup][5],并将控制组作为一个整体管理系统资源。这意味着资源能够基于应用管理,而不是由组成应用的各个进程来管理。 -[systemd 和 SystemV][4] 之间的一个主要差异是管理进程的方式。SystemV 将每个进程当做指向自身的一个实体。systemd 将相关的进程集中到一个控制组,称作 [cgroup][5](控制组的简称),并将 cgroup 作为一个整体管理系统资源。这意味着资源能够基于应用管理,而不是组成应用的单个进程。 +控制组的控制单元称作切片单元slice unit。切片是允许 systemd 以树状格式控制程序次序,从而简化管理的概念化。 -cgroup 的控制单元称作切片单元。切片是允许 systemd 以树状格式控制程序次序,从而简化管理的概念化。 +### 查看控制组 -### 查看 cgroup - -我将从一些允许你查看不同类型 cgroup 信息的命令开始。 `systemctl status ` 命令显示一个特定服务的切片信息,包括服务的切片。这个例子展示了 `at` 守护进程: +我将从一些允许你查看不同类型控制组信息的命令开始。 `systemctl status ` 命令显示一个特定服务的切片信息,包括服务的切片。这个例子展示了 `at` 守护进程: ``` [root@testvm1 ~]# systemctl status atd.service ● atd.service - Deferred execution scheduler -     Loaded: loaded (/usr/lib/systemd/system/atd.service; enabled; vendor preset: enabled) -     Active: active (running) since Wed 2020-09-23 12:18:24 EDT; 1 day 3h ago -       Docs: man:atd(8) -   Main PID: 1010 (atd) -      Tasks: 1 (limit: 14760) -     Memory: 440.0K -        CPU: 5ms -     CGroup: /system.slice/atd.service -             └─1010 /usr/sbin/atd -f + Loaded: loaded (/usr/lib/systemd/system/atd.service; enabled; vendor preset: enabled) + Active: active (running) since Wed 2020-09-23 12:18:24 EDT; 1 day 3h ago + Docs: man:atd(8) + Main PID: 1010 (atd) + Tasks: 1 (limit: 14760) + Memory: 440.0K + CPU: 5ms + CGroup: /system.slice/atd.service + └─1010 /usr/sbin/atd -f Sep 23 12:18:24 testvm1.both.org systemd[1]: Started Deferred execution scheduler. [root@testvm1 ~]# ``` -这是一个我感到 systemd 比 SystemV 和旧的初始化程序更好用的原因的绝佳示例。这里的信息远比 SystemV 能够提供的丰富。cgroup 项包括的层级结构中,`system.slice` 是 systemd(PID 1),`atd.service` 在下一层,是 `system.slice` 的一部分。cgroup 项的第二行还显示了进程 ID(PID)和启动守护进程使用的命令。 +这是一个我感到 systemd 比 SystemV 和旧的初始化程序更好用的原因的绝佳示例。这里的信息远比 SystemV 能够提供的丰富。`CGroup` 项包括的层级结构中,`system.slice` 是 systemd(PID 1),`atd.service` 在下一层,是 `system.slice` 的一部分。`CGroup` 项的第二行还显示了进程 ID(PID)和启动守护进程使用的命令。 -`systemctl` 命令列出多个 cgroup 项,`--all` 参数列出所有的切片,包括当前没有激活的: +`systemctl` 命令可以列出多个控制组项,`--all` 参数列出所有的切片,包括当前没有激活的切片: ``` [root@testvm1 ~]# systemctl -t slice --all -  UNIT                             LOAD   ACTIVE   SUB    DESCRIPTION                     -  -.slice                          loaded active   active Root Slice                       -  system-getty.slice               loaded active   active system-getty.slice               -  system-lvm2\x2dpvscan.slice      loaded active   active system-lvm2\x2dpvscan.slice     -  system-modprobe.slice            loaded active   active system-modprobe.slice           -  system-sshd\x2dkeygen.slice      loaded active   active system-sshd\x2dkeygen.slice     -  system-systemd\x2dcoredump.slice loaded inactive dead   system-systemd\x2dcoredump.slice -  system-systemd\x2dfsck.slice     loaded active   active system-systemd\x2dfsck.slice     -  system.slice                     loaded active   active System Slice                     -  user-0.slice                     loaded active   active User Slice of UID 0             -  user-1000.slice                  loaded active   active User Slice of UID 1000           -  user.slice                       loaded active   active User and Session Slice           + UNIT LOAD ACTIVE SUB DESCRIPTION + -.slice loaded active active Root Slice + system-getty.slice loaded active active system-getty.slice + system-lvm2\x2dpvscan.slice loaded active active system-lvm2\x2dpvscan.slice + system-modprobe.slice loaded active active system-modprobe.slice + system-sshd\x2dkeygen.slice loaded active active system-sshd\x2dkeygen.slice + system-systemd\x2dcoredump.slice loaded inactive dead system-systemd\x2dcoredump.slice + system-systemd\x2dfsck.slice loaded active active system-systemd\x2dfsck.slice + system.slice loaded active active System Slice + user-0.slice loaded active active User Slice of UID 0 + user-1000.slice loaded active active User Slice of UID 1000 + user.slice loaded active active User and Session Slice -LOAD   = Reflects whether the unit definition was properly loaded. +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. +SUB = The low-level unit activation state, values depend on unit type. 11 loaded units listed. To show all installed unit files use 'systemctl list-unit-files'. [root@testvm1 ~]# ``` -关于这个数据,第一个需要注意的是数据显示了 UID 0(root)和 1000 的用户切片,1000 是我登陆的用户。这里列出了组成每个切片的切片部分,而不是服务。还说明了每个用户登录时都会为其创建一个切片,这为将一个用户的所有任务作为单个 cgroup 项进行管理提供了一种方式。 +关于这个数据,第一个需要注意的是数据显示了 UID 0(root)和 UID 1000 的用户切片,UID 1000 是我登录的用户。这里列出了组成每个切片的切片部分,而不是服务。还说明了每个用户登录时都会为其创建一个切片,这为将一个用户的所有任务作为单个控制组项进行管理提供了一种方式。 -### 探索 cgroup 层次结构 +### 探索控制组的层次结构 -目前为止一切顺利,但是 cgroup 是分层的,所有的服务单元作为其中一个 cgroup 的成员运行。要查看这个层次结构很简单,使用 systemd 的一个旧命令和一个新命令即可。 +目前为止一切顺利,但是控制组是分层的,所有的服务单元作为其中一个控制组的成员运行。要查看这个层次结构很简单,使用一个旧命令和 systemd 的一个新命令即可。 -`ps` 命令可以用于映射进程的和其所处的 cgroup 层次。注意使用 `ps` 命令时需要指明想要的数据列。我大幅削减了下面命令的输出数量,但是试图保留足够的数据,以便你能够对自己系统上的输出有所感受: +`ps` 命令可以用于映射进程的和其所处的控制组层次。注意使用 `ps` 命令时需要指明想要的数据列。我大幅削减了下面命令的输出数量,但是试图保留足够的数据,以便你能够对自己系统上的输出有所感受: ``` [root@testvm1 ~]# ps xawf -eo pid,user,cgroup,args -    PID USER     CGROUP                      COMMAND -      2 root     -                           [kthreadd] -      3 root     -                            \\_ [rcu_gp] -      4 root     -                            \\_ [rcu_par_gp] -      6 root     -                            \\_ [kworker/0:0H-kblockd] -      9 root     -                            \\_ [mm_percpu_wq] -     10 root     -                            \\_ [ksoftirqd/0] -     11 root     -                            \\_ [rcu_sched] -     12 root     -                            \\_ [migration/0] -     13 root     -                            \\_ [cpuhp/0] -     14 root     -                            \\_ [cpuhp/1] -<SNIP> - 625406 root     -                            \\_ [kworker/3:0-ata_sff] - 625409 root     -                            \\_ [kworker/u8:0-events_unbound] -      1 root     0::/init.scope              /usr/lib/systemd/systemd --switched-root --system --deserialize 30 -    588 root     0::/system.slice/systemd-jo /usr/lib/systemd/systemd-journald -    599 root     0::/system.slice/systemd-ud /usr/lib/systemd/systemd-udevd -    741 root     0::/system.slice/auditd.ser /sbin/auditd -    743 root     0::/system.slice/auditd.ser  \\_ /usr/sbin/sedispatch -    764 root     0::/system.slice/ModemManag /usr/sbin/ModemManager -    765 root     0::/system.slice/NetworkMan /usr/sbin/NetworkManager --no-daemon -    767 root     0::/system.slice/irqbalance /usr/sbin/irqbalance --foreground -    779 root     0::/system.slice/mcelog.ser /usr/sbin/mcelog --ignorenodev --daemon --foreground -    781 root     0::/system.slice/rngd.servi /sbin/rngd -f -    782 root     0::/system.slice/rsyslog.se /usr/sbin/rsyslogd -n -<SNIP> -    893 root     0::/system.slice/sshd.servi sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups -   1130 root     0::/user.slice/user-0.slice  \\_ sshd: root [priv] -   1147 root     0::/user.slice/user-0.slice  |   \\_ sshd: root@pts/0 -   1148 root     0::/user.slice/user-0.slice  |       \\_ -bash -   1321 root     0::/user.slice/user-0.slice  |           \\_ screen -   1322 root     0::/user.slice/user-0.slice  |               \\_ SCREEN -   1323 root     0::/user.slice/user-0.slice  |                   \\_ /bin/bash - 498801 root     0::/user.slice/user-0.slice  |                   |   \\_ man systemd.resource-control - 498813 root     0::/user.slice/user-0.slice  |                   |       \\_ less -   1351 root     0::/user.slice/user-0.slice  |                   \\_ /bin/bash - 123293 root     0::/user.slice/user-0.slice  |                   |   \\_ man systemd.slice - 123305 root     0::/user.slice/user-0.slice  |                   |       \\_ less -   1380 root     0::/user.slice/user-0.slice  |                   \\_ /bin/bash - 625412 root     0::/user.slice/user-0.slice  |                   |   \\_ ps xawf -eo pid,user,cgroup,args - 625413 root     0::/user.slice/user-0.slice  |                   |   \\_ less - 246795 root     0::/user.slice/user-0.slice  |                   \\_ /bin/bash - 625338 root     0::/user.slice/user-0.slice  |                       \\_ /usr/bin/mc -P /var/tmp/mc-root/mc.pwd.246795 - 625340 root     0::/user.slice/user-0.slice  |                           \\_ bash -rcfile .bashrc -   1218 root     0::/user.slice/user-1000.sl  \\_ sshd: dboth [priv] -   1233 dboth    0::/user.slice/user-1000.sl      \\_ sshd: dboth@pts/1 -   1235 dboth    0::/user.slice/user-1000.sl          \\_ -bash -<SNIP> -   1010 root     0::/system.slice/atd.servic /usr/sbin/atd -f -   1011 root     0::/system.slice/crond.serv /usr/sbin/crond -n -   1098 root     0::/system.slice/lxdm.servi /usr/sbin/lxdm-binary -   1106 root     0::/system.slice/lxdm.servi  \\_ /usr/libexec/Xorg -background none :0 vt01 -nolisten tcp -novtswitch -auth /var/run/lxdm/lxdm-:0.auth - 370621 root     0::/user.slice/user-1000.sl  \\_ /usr/libexec/lxdm-session - 370631 dboth    0::/user.slice/user-1000.sl      \\_ xfce4-session - 370841 dboth    0::/user.slice/user-1000.sl          \\_ /usr/bin/ssh-agent /bin/sh -c exec -l bash -c "/usr/bin/startxfce4" - 370911 dboth    0::/user.slice/user-1000.sl          \\_ xfwm4 --display :0.0 --sm-client-id 2dead44ab-0b4d-4101-bca4-e6771f4a8ac2 - 370930 dboth    0::/user.slice/user-1000.sl          \\_ xfce4-panel --display :0.0 --sm-client-id 2ce38b8ef-86fd-4189-ace5-deec1d0e0952 - 370942 dboth    0::/user.slice/user-1000.sl          |   \\_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libsystray.so 6 23068680 systr + PID USER CGROUP COMMAND + 2 root - [kthreadd] + 3 root - \_ [rcu_gp] + 4 root - \_ [rcu_par_gp] + 6 root - \_ [kworker/0:0H-kblockd] + 9 root - \_ [mm_percpu_wq] + 10 root - \_ [ksoftirqd/0] + 11 root - \_ [rcu_sched] + 12 root - \_ [migration/0] + 13 root - \_ [cpuhp/0] + 14 root - \_ [cpuhp/1] +<删节> + 625406 root - \_ [kworker/3:0-ata_sff] + 625409 root - \_ [kworker/u8:0-events_unbound] + 1 root 0::/init.scope /usr/lib/systemd/systemd --switched-root --system --deserialize 30 + 588 root 0::/system.slice/systemd-jo /usr/lib/systemd/systemd-journald + 599 root 0::/system.slice/systemd-ud /usr/lib/systemd/systemd-udevd + 741 root 0::/system.slice/auditd.ser /sbin/auditd + 743 root 0::/system.slice/auditd.ser \_ /usr/sbin/sedispatch + 764 root 0::/system.slice/ModemManag /usr/sbin/ModemManager + 765 root 0::/system.slice/NetworkMan /usr/sbin/NetworkManager --no-daemon + 767 root 0::/system.slice/irqbalance /usr/sbin/irqbalance --foreground + 779 root 0::/system.slice/mcelog.ser /usr/sbin/mcelog --ignorenodev --daemon --foreground + 781 root 0::/system.slice/rngd.servi /sbin/rngd -f + 782 root 0::/system.slice/rsyslog.se /usr/sbin/rsyslogd -n +<删节> + 893 root 0::/system.slice/sshd.servi sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups + 1130 root 0::/user.slice/user-0.slice \_ sshd: root [priv] + 1147 root 0::/user.slice/user-0.slice | \_ sshd: root@pts/0 + 1148 root 0::/user.slice/user-0.slice | \_ -bash + 1321 root 0::/user.slice/user-0.slice | \_ screen + 1322 root 0::/user.slice/user-0.slice | \_ SCREEN + 1323 root 0::/user.slice/user-0.slice | \_ /bin/bash + 498801 root 0::/user.slice/user-0.slice | | \_ man systemd.resource-control + 498813 root 0::/user.slice/user-0.slice | | \_ less + 1351 root 0::/user.slice/user-0.slice | \_ /bin/bash + 123293 root 0::/user.slice/user-0.slice | | \_ man systemd.slice + 123305 root 0::/user.slice/user-0.slice | | \_ less + 1380 root 0::/user.slice/user-0.slice | \_ /bin/bash + 625412 root 0::/user.slice/user-0.slice | | \_ ps xawf -eo pid,user,cgroup,args + 625413 root 0::/user.slice/user-0.slice | | \_ less + 246795 root 0::/user.slice/user-0.slice | \_ /bin/bash + 625338 root 0::/user.slice/user-0.slice | \_ /usr/bin/mc -P /var/tmp/mc-root/mc.pwd.246795 + 625340 root 0::/user.slice/user-0.slice | \_ bash -rcfile .bashrc + 1218 root 0::/user.slice/user-1000.sl \_ sshd: dboth [priv] + 1233 dboth 0::/user.slice/user-1000.sl \_ sshd: dboth@pts/1 + 1235 dboth 0::/user.slice/user-1000.sl \_ -bash +<删节> + 1010 root 0::/system.slice/atd.servic /usr/sbin/atd -f + 1011 root 0::/system.slice/crond.serv /usr/sbin/crond -n + 1098 root 0::/system.slice/lxdm.servi /usr/sbin/lxdm-binary + 1106 root 0::/system.slice/lxdm.servi \_ /usr/libexec/Xorg -background none :0 vt01 -nolisten tcp -novtswitch -auth /var/run/lxdm/lxdm-:0.auth + 370621 root 0::/user.slice/user-1000.sl \_ /usr/libexec/lxdm-session + 370631 dboth 0::/user.slice/user-1000.sl \_ xfce4-session + 370841 dboth 0::/user.slice/user-1000.sl \_ /usr/bin/ssh-agent /bin/sh -c exec -l bash -c "/usr/bin/startxfce4" + 370911 dboth 0::/user.slice/user-1000.sl \_ xfwm4 --display :0.0 --sm-client-id 2dead44ab-0b4d-4101-bca4-e6771f4a8ac2 + 370930 dboth 0::/user.slice/user-1000.sl \_ xfce4-panel --display :0.0 --sm-client-id 2ce38b8ef-86fd-4189-ace5-deec1d0e0952 + 370942 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libsystray.so 6 23068680 systr ay Notification Area Area where notification icons appear - 370943 dboth    0::/user.slice/user-1000.sl          |   \\_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libpulseaudio-plugin.so 8 2306 + 370943 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libpulseaudio-plugin.so 8 2306 8681 pulseaudio PulseAudio Plugin Adjust the audio volume of the PulseAudio sound system - 370944 dboth    0::/user.slice/user-1000.sl          |   \\_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libxfce4powermanager.so 9 2306 + 370944 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libxfce4powermanager.so 9 2306 8682 power-manager-plugin Power Manager Plugin Display the battery levels of your devices and control the brightness of your display - 370945 dboth    0::/user.slice/user-1000.sl          |   \\_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libnotification-plugin.so 10 2 + 370945 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libnotification-plugin.so 10 2 3068683 notification-plugin Notification Plugin Notification plugin for the Xfce panel - 370948 dboth    0::/user.slice/user-1000.sl          |   \\_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libactions.so 14 23068684 acti + 370948 dboth 0::/user.slice/user-1000.sl | \_ /usr/lib64/xfce4/panel/wrapper-2.0 /usr/lib64/xfce4/panel/plugins/libactions.so 14 23068684 acti ons Action Buttons Log out, lock or other system actions - 370934 dboth    0::/user.slice/user-1000.sl          \\_ Thunar --sm-client-id 2cfc809d8-4e1d-497a-a5c5-6e4fa509c3fb --daemon - 370939 dboth    0::/user.slice/user-1000.sl          \\_ xfdesktop --display :0.0 --sm-client-id 299be0608-4dca-4055-b4d6-55ec6e73a324 - 370962 dboth    0::/user.slice/user-1000.sl          \\_ nm-applet -<SNIP> + 370934 dboth 0::/user.slice/user-1000.sl \_ Thunar --sm-client-id 2cfc809d8-4e1d-497a-a5c5-6e4fa509c3fb --daemon + 370939 dboth 0::/user.slice/user-1000.sl \_ xfdesktop --display :0.0 --sm-client-id 299be0608-4dca-4055-b4d6-55ec6e73a324 + 370962 dboth 0::/user.slice/user-1000.sl \_ nm-applet +<删节> ``` 你可以使用 `systemd-cgls` 命令查看整个层次结构,这个命令不需要任何的复杂参数,更加简单。 @@ -172,14 +171,14 @@ Control group /: ├─user.slice │ ├─user-0.slice │ │ ├─session-1.scope -│ │ │ ├─  1130 sshd: root [priv] -│ │ │ ├─  1147 sshd: root@pts/0 -│ │ │ ├─  1148 -bash -│ │ │ ├─  1321 screen -│ │ │ ├─  1322 SCREEN -│ │ │ ├─  1323 /bin/bash -│ │ │ ├─  1351 /bin/bash -│ │ │ ├─  1380 /bin/bash +│ │ │ ├─ 1130 sshd: root [priv] +│ │ │ ├─ 1147 sshd: root@pts/0 +│ │ │ ├─ 1148 -bash +│ │ │ ├─ 1321 screen +│ │ │ ├─ 1322 SCREEN +│ │ │ ├─ 1323 /bin/bash +│ │ │ ├─ 1351 /bin/bash +│ │ │ ├─ 1380 /bin/bash │ │ │ ├─123293 man systemd.slice │ │ │ ├─123305 less │ │ │ ├─246795 /bin/bash @@ -187,115 +186,112 @@ Control group /: │ │ │ ├─371383 less │ │ │ ├─371469 systemd-cgls │ │ │ └─371470 less -│ │ └─[user@0.service][6] … -│ │   ├─dbus-broker.service -│ │   │ ├─1170 /usr/bin/dbus-broker-launch --scope user -│ │   │ └─1171 dbus-broker --log 4 --controller 12 --machine-id 3bccd1140fca488187f8a1439c832f07 --max-bytes 100000000000000 --max-fds 25000000000000 --max-> -│ │   ├─gvfs-daemon.service -│ │   │ └─1173 /usr/libexec/gvfsd -│ │   └─init.scope -│ │     ├─1137 /usr/lib/systemd/systemd --user -│ │     └─1138 (sd-pam) +│ │ └─user@0.service … +│ │ ├─dbus-broker.service +│ │ │ ├─1170 /usr/bin/dbus-broker-launch --scope user +│ │ │ └─1171 dbus-broker --log 4 --controller 12 --machine-id 3bccd1140fca488187f8a1439c832f07 --max-bytes 100000000000000 --max-fds 25000000000000 --max-> +│ │ ├─gvfs-daemon.service +│ │ │ └─1173 /usr/libexec/gvfsd +│ │ └─init.scope +│ │ ├─1137 /usr/lib/systemd/systemd --user +│ │ └─1138 (sd-pam) │ └─user-1000.slice -│   ├─[user@1000.service][7] … -│   │ ├─dbus\x2d:1.2\x2dorg.xfce.Xfconf.slice -│   │ │ └─dbus-:[1.2-org.xfce.Xfconf@0.service][8] -│   │ │   └─370748 /usr/lib64/xfce4/xfconf/xfconfd -│   │ ├─dbus\x2d:1.2\x2dca.desrt.dconf.slice -│   │ │ └─dbus-:[1.2-ca.desrt.dconf@0.service][9] -│   │ │   └─371262 /usr/libexec/dconf-service -│   │ ├─dbus-broker.service -│   │ │ ├─1260 /usr/bin/dbus-broker-launch --scope user -│   │ │ └─1261 dbus-broker --log 4 --controller 11 --machine-id -<SNIP> -│   │ └─gvfs-mtp-volume-monitor.service -│   │   └─370987 /usr/libexec/gvfs-mtp-volume-monitor -│   ├─session-3.scope -│   │ ├─1218 sshd: dboth [priv] -│   │ ├─1233 sshd: dboth@pts/1 -│   │ └─1235 -bash -│   └─session-7.scope -│     ├─370621 /usr/libexec/lxdm-session -│     ├─370631 xfce4-session -│     ├─370805 /usr/bin/VBoxClient --clipboard -│     ├─370806 /usr/bin/VBoxClient --clipboard -│     ├─370817 /usr/bin/VBoxClient --seamless -│     ├─370818 /usr/bin/VBoxClient --seamless -│     ├─370824 /usr/bin/VBoxClient --draganddrop -│     ├─370825 /usr/bin/VBoxClient --draganddrop -│     ├─370841 /usr/bin/ssh-agent /bin/sh -c exec -l bash -c "/usr/bin/startxfce4" -│     ├─370910 /bin/gpg-agent --sh --daemon --write-env-file /home/dboth/.cache/gpg-agent-info -│     ├─370911 xfwm4 --display :0.0 --sm-client-id 2dead44ab-0b4d-4101-bca4-e6771f4a8ac2 -│     ├─370923 xfsettingsd --display :0.0 --sm-client-id 261b4a437-3029-461c-9551-68c2c42f4fef -│     ├─370930 xfce4-panel --display :0.0 --sm-client-id 2ce38b8ef-86fd-4189-ace5-deec1d0e0952 -│     ├─370934 Thunar --sm-client-id 2cfc809d8-4e1d-497a-a5c5-6e4fa509c3fb --daemon -│     ├─370939 xfdesktop --display :0.0 --sm-client-id 299be0608-4dca-4055-b4d6-55ec6e73a324 -<SNIP> +│ ├─user@1000.service … +│ │ ├─dbus\x2d:1.2\x2dorg.xfce.Xfconf.slice +│ │ │ └─dbus-:1.2-org.xfce.Xfconf@0.service +│ │ │ └─370748 /usr/lib64/xfce4/xfconf/xfconfd +│ │ ├─dbus\x2d:1.2\x2dca.desrt.dconf.slice +│ │ │ └─dbus-:1.2-ca.desrt.dconf@0.service +│ │ │ └─371262 /usr/libexec/dconf-service +│ │ ├─dbus-broker.service +│ │ │ ├─1260 /usr/bin/dbus-broker-launch --scope user +│ │ │ └─1261 dbus-broker --log 4 --controller 11 --machine-id +<删节> +│ │ └─gvfs-mtp-volume-monitor.service +│ │ └─370987 /usr/libexec/gvfs-mtp-volume-monitor +│ ├─session-3.scope +│ │ ├─1218 sshd: dboth [priv] +│ │ ├─1233 sshd: dboth@pts/1 +│ │ └─1235 -bash +│ └─session-7.scope +│ ├─370621 /usr/libexec/lxdm-session +│ ├─370631 xfce4-session +│ ├─370805 /usr/bin/VBoxClient --clipboard +│ ├─370806 /usr/bin/VBoxClient --clipboard +│ ├─370817 /usr/bin/VBoxClient --seamless +│ ├─370818 /usr/bin/VBoxClient --seamless +│ ├─370824 /usr/bin/VBoxClient --draganddrop +│ ├─370825 /usr/bin/VBoxClient --draganddrop +│ ├─370841 /usr/bin/ssh-agent /bin/sh -c exec -l bash -c "/usr/bin/startxfce4" +│ ├─370910 /bin/gpg-agent --sh --daemon --write-env-file /home/dboth/.cache/gpg-agent-info +│ ├─370911 xfwm4 --display :0.0 --sm-client-id 2dead44ab-0b4d-4101-bca4-e6771f4a8ac2 +│ ├─370923 xfsettingsd --display :0.0 --sm-client-id 261b4a437-3029-461c-9551-68c2c42f4fef +│ ├─370930 xfce4-panel --display :0.0 --sm-client-id 2ce38b8ef-86fd-4189-ace5-deec1d0e0952 +│ ├─370934 Thunar --sm-client-id 2cfc809d8-4e1d-497a-a5c5-6e4fa509c3fb --daemon +│ ├─370939 xfdesktop --display :0.0 --sm-client-id 299be0608-4dca-4055-b4d6-55ec6e73a324 +<删节> └─system.slice -  ├─rngd.service -  │ └─1650 /sbin/rngd -f -  ├─irqbalance.service -  │ └─1631 /usr/sbin/irqbalance --foreground -  ├─fprintd.service -  │ └─303383 /usr/libexec/fprintd -  ├─systemd-udevd.service -  │ └─956 /usr/lib/systemd/systemd-udevd -<SNIP> -  ├─systemd-journald.service -  │ └─588 /usr/lib/systemd/systemd-journald -  ├─atd.service -  │ └─1010 /usr/sbin/atd -f -  ├─system-dbus\x2d:1.10\x2dorg.freedesktop.problems.slice -  │ └─dbus-:[1.10-org.freedesktop.problems@0.service][10] -  │   └─371197 /usr/sbin/abrt-dbus -t133 -  ├─sshd.service -  │ └─893 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups -  ├─vboxservice.service -  │ └─802 /usr/sbin/VBoxService -f -  ├─crond.service -  │ └─1011 /usr/sbin/crond -n -  ├─NetworkManager.service -  │ └─765 /usr/sbin/NetworkManager --no-daemon -  ├─switcheroo-control.service -  │ └─787 /usr/libexec/switcheroo-control - <SNIP> + ├─rngd.service + │ └─1650 /sbin/rngd -f + ├─irqbalance.service + │ └─1631 /usr/sbin/irqbalance --foreground + ├─fprintd.service + │ └─303383 /usr/libexec/fprintd + ├─systemd-udevd.service + │ └─956 /usr/lib/systemd/systemd-udevd +<删节> + ├─systemd-journald.service + │ └─588 /usr/lib/systemd/systemd-journald + ├─atd.service + │ └─1010 /usr/sbin/atd -f + ├─system-dbus\x2d:1.10\x2dorg.freedesktop.problems.slice + │ └─dbus-:1.10-org.freedesktop.problems@0.service + │ └─371197 /usr/sbin/abrt-dbus -t133 + ├─sshd.service + │ └─893 sshd: /usr/sbin/sshd -D [listener] 0 of 10-100 startups + ├─vboxservice.service + │ └─802 /usr/sbin/VBoxService -f + ├─crond.service + │ └─1011 /usr/sbin/crond -n + ├─NetworkManager.service + │ └─765 /usr/sbin/NetworkManager --no-daemon + ├─switcheroo-control.service + │ └─787 /usr/libexec/switcheroo-control + <删节> ``` -这个树状视图显示了所有的用户和系统切片,以及每个 cgroup 内正在运行的服务和程序。注意叫作“范围”的单元,它将相关的程序组成一个管理单元,在上面列出的结果中就是 `user-1000.slice`。`user-1000.slice/session-7.scope` cgroup 包含了 GUI 桌面程序层次结构,以 LXDM 显示管理器会话和其所有的子任务开始,包括像 Bash 命令行解释器和 Thunar GUI 文件管理器之类的程序。 +这个树状视图显示了所有的用户和系统切片,以及每个控制组内正在运行的服务和程序。注意叫作 `scope`(范围)的单元,它将相关的程序组成一个管理单元,在上面列出的结果中就是 `user-1000.slice`。`user-1000.slice/session-7.scope` 控制组包含了 GUI 桌面程序层次结构,以 LXDM 显示管理器会话和其所有的子任务开始,包括像 Bash 命令行解释器和 Thunar GUI 文件管理器之类的程序。 -配置文件中不定义范围单元,而是作为启动相关程序组的结果程序化生成的。范围单元不创建或启动作为 cgroup 组成部分运行的进程。范围内的所有进程都是平等的,没有内部的层次结构。范围的生命周期在第一个进程创建时开始,在最后一个进程销毁时结束。 +配置文件中不定义范围单元,而是作为启动相关程序组的结果程序化生成的。范围单元不创建或启动作为控制组的组成部分运行的进程。范围内的所有进程都是平等的,没有内部的层次结构。一个范围的生命周期在第一个进程创建时开始,在最后一个进程销毁时结束。 在你的桌面打开多个窗口,比如终端模拟器、LibreOffice、或者任何你想打开的,然后切换到一个可用的虚拟控制台,启动类似 `top` 或 [Midnight Commander][11] 的程序。在主机运行 `systemd-cgls` 命令,留意整体的层次结构和范围单元。 -`systemd-cgls` 命令提供的 cgroup 层次结构表示(以及组成 cgroup 单元的细节),比我见过的其他任何指令都要完整。和 `ps` 命令提供的输出相比,我喜欢 `systemd-cgls` 命令更简洁的树形表示。 +`systemd-cgls` 命令提供的控制组层次结构表示(以及组成控制组单元的细节),比我见过的其他任何指令都要完整。和 `ps` 命令提供的输出相比,我喜欢 `systemd-cgls` 命令更简洁的树形表示。 ### 来自朋友们的一点帮助 -介绍完这些基础知识后,我曾计划过深入研究 cgroup 的更多细节,以及如何使用,但是我在 Opensource.com 的姐妹网站 [Enable Sysadmin][13] 上发现了一系列四篇优秀文章,由 Red Hat 公司的 [Steve Ovens][12] 所作。与其从头重写 Steve 的文章,我觉得倒不如通过链接到这些文章,利用他的 cgroup 专业知识: +介绍完这些基础知识后,我曾计划过深入研究控制组的更多细节,以及如何使用,但是我在 Opensource.com 的姐妹网站 [Enable Sysadmin][13] 上发现了一系列四篇优秀文章,由 Red Hat 公司的 [Steve Ovens][12] 所作。与其从头重写 Steve 的文章,我觉得倒不如通过链接到这些文章,利用他的控制组专业知识: - 1. [一个 Linux 系统管理员对 cgroup 的介绍][14] - 2. [如何用 CPUShares 管理 cgroup][15] - 3. [用更难的方式——手动管理 cgroup][16] - 4. [用 systemd 管理 cgroup][17] + 1. [一个 Linux 系统管理员对控制组的介绍][14] + 2. [如何用 CPUShares 管理控制组][15] + 3. [用更难的方式,手动管理控制组][16] + 4. [用 systemd 管理控制组][17] 像我一样享受这些文章并从中汲取知识吧。 ### 其他资源 -因特网上充斥着大量关于 systemd 的信息,但大部分都简短生硬、愚钝、甚至令人误解。除了本文提到的资源,下面的网页提供了关于 systemd 启动更详细可靠的信息。自从我开始这一系列的文章来反映我所做的研究以来,这个的列表已经变长了。 +互联网上充斥着大量关于 systemd 的信息,但大部分都简短生硬、愚钝、甚至令人误解。除了本文提到的资源,下面的网页提供了关于 systemd 启动更详细可靠的信息。自从我开始这一系列的文章来反映我所做的研究以来,这个的列表已经变长了。 - * Fedora 项目有一个优质实用的 [systemd 指南][18],几乎有你使用 systemd 配置、管理、维 -护一个 Fedora 计算机需要知道的一切。 - * Fedora 项目还有一个好用的[速查表][19],交叉引用了古老的 SystemV 命令和对应的 systemd 命令。 - * [systemd.unit(5) 手册页][20]包含了一个不错的单元文件中段的列表,以及这些段的配置选项和简洁的描述。 - * Red Hat 文档包含了一个[单元文件结构][21]的有用描述,还有一些其他的重要信息。 + * Fedora 项目有一个优质实用的 [systemd 指南][18],几乎有你使用 systemd 配置、管理、维护一个 Fedora 计算机需要知道的一切。 + * Fedora 项目还有一个好用的 [速查表][19],交叉引用了古老的 SystemV 命令和对应的 systemd 命令。 + * [systemd.unit(5) 手册页][20] 包含了一个不错的单元文件中各个节的列表,以及这些节的配置选项和简洁的描述。 + * Red Hat 文档包含了一个 [单元文件结构][21] 的有用描述,还有一些其他的重要信息。 * 要获取 systemd 的详细技术信息和创立的原因,查看 Freedesktop.org 的 [systemd 描 述][22]。这个使我发现过的最棒页面之一,因为其中包含了许多指向其他重要准确文档的链接。 - - * Linux.com 上 ”systemd 的更多乐趣 " 提供了更高级的 systemd [信息和提示][23]。 + * Linux.com 上 “systemd 的更多乐趣” 提供了更高级的 systemd [信息和提示][23]。 * 查看 [systemd.resource-control(5)][24] 的手册页 - * 查看 [_Linux 内核用户和管理员指南_][25]中的[控制组 v2 条目][26]。 - + * 查看 [_Linux 内核用户和管理员指南_][25] 中的 [控制组 v2 条目][26]。 还有一系列针对系统管理员的深度技术文章,由 systemd 的设计者和主要开发者 Lennart Poettering 所作。这些文章写于 2010 年 4 月到 2011 年 9 月之间,但在当下仍然像当时一样有 @@ -314,8 +310,6 @@ Poettering 所作。这些文章写于 2010 年 4 月到 2011 年 9 月之间, * [systemd for Administrators, Part X][37] * [systemd for Administrators, Part XI][38] - - -------------------------------------------------------------------------------- via: https://opensource.com/article/20/10/cgroups @@ -323,7 +317,7 @@ via: https://opensource.com/article/20/10/cgroups 作者:[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 8dd2de438192d799135dd3918352287fec2c710b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 14 Oct 2021 11:47:43 +0800 Subject: [PATCH 0702/1588] PUB @YungeG https://linux.cn/article-13881-1.html --- .../20201029 Managing resources with cgroups in systemd.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201029 Managing resources with cgroups in systemd.md (99%) diff --git a/translated/tech/20201029 Managing resources with cgroups in systemd.md b/published/20201029 Managing resources with cgroups in systemd.md similarity index 99% rename from translated/tech/20201029 Managing resources with cgroups in systemd.md rename to published/20201029 Managing resources with cgroups in systemd.md index ea5606f61f..b897c6cd6a 100644 --- a/translated/tech/20201029 Managing resources with cgroups in systemd.md +++ b/published/20201029 Managing resources with cgroups in systemd.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (YungeG) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13881-1.html) [#]: subject: (Managing resources with cgroups in systemd) [#]: via: (https://opensource.com/article/20/10/cgroups) [#]: author: (David Both https://opensource.com/users/dboth) From fd5161afc75d504436b111a72f6008bd2a45e51d Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Fri, 15 Oct 2021 00:20:21 +0800 Subject: [PATCH 0703/1588] translated --- ...ize data partitions in Apache Cassandra.md | 150 ------------------ ...ize data partitions in Apache Cassandra.md | 143 +++++++++++++++++ 2 files changed, 143 insertions(+), 150 deletions(-) delete mode 100644 sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md create mode 100644 translated/tech/20200504 Define and optimize data partitions in Apache Cassandra.md diff --git a/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md b/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md deleted file mode 100644 index 240855e188..0000000000 --- a/sources/tech/20200504 Define and optimize data partitions in Apache Cassandra.md +++ /dev/null @@ -1,150 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (Define and optimize data partitions in Apache Cassandra) -[#]: via: (https://opensource.com/article/20/5/apache-cassandra) -[#]: author: (Anil Inamdar https://opensource.com/users/anil-inamdar) - -Define and optimize data partitions in Apache Cassandra -====== -Apache Cassandra is built for speed and scalability; here's how to get -the most out of those benefits. -![Person standing in front of a giant computer screen with numbers, data][1] - -Apache Cassandra is a database. But it's not just any database; it's a replicating database designed and tuned for scalability, high availability, low-latency, and performance. Cassandra can help your data survive regional outages, hardware failure, and what many admins would consider excessive amounts of data. - -Having a thorough command of data partitions enables you to achieve superior Cassandra cluster design, performance, and scalability. In this article, I'll examine how to define partitions and how Cassandra uses them, as well as the most critical best practices and known issues you ought to be aware of. - -To set the scene: partitions are chunks of data that serve as the atomic unit for key database-related functions like data distribution, replication, and indexing. Distributed data systems commonly distribute incoming data into these partitions, performing the partitioning with simple mathematical functions such as identity or hashing, and using a "partition key" to group data by partition. For example, consider a case where server logs arrive as incoming data. Using the "identity" partitioning function and the timestamps of each log (rounded to the hour value) for the partition key, we can partition this data such that each partition holds one hour of the logs. - -### Data partitions in Cassandra - -Cassandra operates as a distributed system and adheres to the data partitioning principles described above. With Cassandra, data partitioning relies on an algorithm configured at the cluster level, and a partition key configured at the table level. - -![Cassandra data partition][2] - -Cassandra Query Language (CQL) uses the familiar SQL table, row, and column terminologies. In the example diagram above, the table configuration includes the partition key within its primary key, with the format: Primary Key = Partition Key + [Clustering Columns]. - -A primary key in Cassandra represents both a unique data partition and a data arrangement inside a partition. Data arrangement information is provided by optional clustering columns. Each unique partition key represents a set of table rows managed in a server, as well as all servers that manage its replicas. - -### Defining primary keys in CQL - -The following four examples demonstrate how a primary key can be represented in CQL syntax. The sets of rows produced by these definitions are generally considered a partition. - -#### Definition 1 (partition key: log_hour, clustering columns: none) - - -``` -CREATE TABLE server_logs( -   log_hour TIMESTAMP PRIMARYKEY, -   log_level text, -   message text, -   server text -   ) -``` - -Here, all rows that share a **log_hour** go into the same partition. - -#### Definition 2 (partition key: log_hour, clustering columns: log_level) - - -``` -CREATE TABLE server_logs( -   log_hour TIMESTAMP, -   log_level text, -   message text, -   server text, -   PRIMARY KEY (log_hour, log_level) -   ) -``` - -This definition uses the same partition key as Definition 1, but here all rows in each partition are arranged in ascending order by **log_level**. - -#### Definition 3 (partition key: log_hour, server, clustering columns: none) - - -``` -CREATE TABLE server_logs( -   log_hour TIMESTAMP, -   log_level text, -   message text, -   server text, -   PRIMARY KEY ((log_hour, server)) -   ) -``` - -In this definition, all rows share a **log_hour** for each distinct **server** as a single partition. - -#### Definition 4 (partition key: log_hour, server, clustering columns: log_level) - - -``` -CREATE TABLE server_logs( -   log_hour TIMESTAMP, -   log_level text, -   message text, -   server text, -   PRIMARY KEY ((log_hour, server),log_level) -   )WITH CLUSTERING ORDER BY (column3 DESC); -``` - -This definition uses the same partition as Definition 3 but arranges the rows within a partition in descending order by **log_level**. - -### How Cassandra uses the partition key - -Cassandra relies on the partition key to determine which node to store data on and where to locate data when it's needed. Cassandra performs these read and write operations by looking at a partition key in a table, and using tokens (a long value out of range -2^63 to +2^63-1) for data distribution and indexing. These tokens are mapped to partition keys by using a partitioner, which applies a partitioning function that converts any partition key to a token. Through this token mechanism, every node of a Cassandra cluster owns a set of data partitions. The partition key then enables data indexing on each node. - -![Cassandra cluster with 3 nodes and token-based ownership][3] - -A Cassandra cluster with three nodes and token-based ownership. This is a simplistic representation: the actual implementation uses [Vnodes][4]. - -### Data partition impacts on Cassandra clusters - -Careful partition key design is crucial to achieving the ideal partition size for the use case. Getting it right allows for even data distribution and strong I/O performance. Partition size has several impacts on Cassandra clusters you need to be aware of: - - * Read performance—In order to find partitions in SSTables files on disk, Cassandra uses data structures that include caches, indexes, and index summaries. Partitions that are too large reduce the efficiency of maintaining these data structures – and will negatively impact performance as a result. Cassandra releases have made strides in this area: in particular, version 3.6 and above of the Cassandra engine introduce storage improvements that deliver better performance for large partitions and resilience against memory issues and crashes. - * Memory usage— Large partitions place greater pressure on the JVM heap, increasing its size while also making the garbage collection mechanism less efficient. - * Cassandra repairs—Large partitions make it more difficult for Cassandra to perform its repair maintenance operations, which keep data consistent by comparing data across replicas. - * Tombstone eviction—Not as mean as it sounds, Cassandra uses unique markers known as "tombstones" to mark data for deletion. Large partitions can make that deletion process more difficult if there isn't an appropriate data deletion pattern and compaction strategy in place. - - - -While these impacts may make it tempting to simply design partition keys that yield especially small partitions, the data access pattern is also highly influential on ideal partition size (for more information, read this in-depth guide to [Cassandra data modeling][5]). The data access pattern can be defined as how a table is queried, including all of the table's **select** queries. Ideally, CQL select queries should have just one partition key in the **where** clause—that is to say, Cassandra is most efficient when queries can get needed data from a single partition, instead of many smaller ones. - -### Best practices for partition key design - -Following best practices for partition key design helps you get to an ideal partition size. As a rule of thumb, the maximum partition size in Cassandra should stay under 100MB. Ideally, it should be under 10MB. While Cassandra versions 3.6 and newer make larger partition sizes more viable, careful testing and benchmarking must be performed for each workload to ensure a partition key design supports desired cluster performance. - -Specifically, these best practices should be considered as part of any partition key design: - - * The goal for a partition key must be to fit an ideal amount of data into each partition for supporting the needs of its access pattern. - * A partition key should disallow unbounded partitions: those that may grow indefinitely in size over time. For instance, in the **server_logs** examples above, using the server column as a partition key would create unbounded partitions as the number of server logs continues to increase. In contrast, using **log_hour** limits each partition to an hour of data. - * A partition key should also avoid creating a partition skew, in which partitions grow unevenly, and some are able to grow without limit over time. In the **server_logs** examples, using the server column in a scenario where one server generates considerably more logs than others would produce a partition skew. To avoid this, a useful technique is to introduce another attribute from the table to force an even distribution, even if it's necessary to create a dummy column to do so. - * It's helpful to partition time-series data with a partition key that uses a time element as well as other attributes. This protects against unbounded partitions, enables access patterns to use the time attribute in querying specific data, and allows for time-bound data deletion. The examples above each demonstrate this by using the **log_hour** time attribute. - - - -Several tools are available to help test, analyze, and monitor Cassandra partitions to check that a chosen schema is efficient and effective. By carefully designing partition keys to align well with the data and needs of the solution at hand, and following best practices to optimize partition size, you can utilize data partitions that more fully deliver on the scalability and performance potential of a Cassandra deployment. - -Dani and Jon will give a three hour tutorial at OSCON this year called: Becoming friends with... - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/20/5/apache-cassandra - -作者:[Anil Inamdar][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/anil-inamdar -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) -[2]: https://opensource.com/sites/default/files/uploads/apache_cassandra_1_0.png (Cassandra data partition) -[3]: https://opensource.com/sites/default/files/uploads/apache_cassandra_2_0.png (Cassandra cluster with 3 nodes and token-based ownership) -[4]: https://www.instaclustr.com/cassandra-vnodes-how-many-should-i-use/ -[5]: https://www.instaclustr.com/resource/6-step-guide-to-apache-cassandra-data-modelling-white-paper/ diff --git a/translated/tech/20200504 Define and optimize data partitions in Apache Cassandra.md b/translated/tech/20200504 Define and optimize data partitions in Apache Cassandra.md new file mode 100644 index 0000000000..5c555bee9a --- /dev/null +++ b/translated/tech/20200504 Define and optimize data partitions in Apache Cassandra.md @@ -0,0 +1,143 @@ +[#]: collector: (lujun9972) +[#]: translator: (unigeorge) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Define and optimize data partitions in Apache Cassandra) +[#]: via: (https://opensource.com/article/20/5/apache-cassandra) +[#]: author: (Anil Inamdar https://opensource.com/users/anil-inamdar) + +在 Apache Cassandra 中定义和优化数据分区 +====== + +速度和可扩展性 是 Apache Cassandra 不变的追求;来学习一下如何充分发挥它的专长吧。 +![Person standing in front of a giant computer screen with numbers, data][1] + +Apache Cassandra 是一个数据库,但又不是一个简单的数据库;它是一个复制数据库,专为可扩展性、高可用性、低延迟和良好性能而设计调整。Cassandra 可以帮你的数据在区域中断、硬件故障时,以及很多管理员认为数据量过多的情况下幸免于难。 + +全面掌握数据分区知识,你就能让 Cassandra 集群实现良好的设计、极高的性能和可扩展性。在本文中,我将探究如何定义分区,Cassandra 如何使用这些分区,以及一些你应该了解的最佳实践方案和已知问题。 + +基本概念是这样的: 供数据库关键函数(如数据分发、复制和索引化)使用的原子单元,单个这样的数据块就是一个分区。分布式数据系统通常会把传入的数据分配到这些分区中,使用简单的数学函数(例如 identity 或 hashing 函数)执行分区过程,并用得到的 “分区键” 对数据分组,进一步再形成分区。例如,假设传入数据是服务器日志,使用“identity”分区函数和每个日志的时间戳(四舍五入到小时值)作为分区键,我们可以对这些数据进行分区,实现每个分区各保存一小时的日志的目的。 + +### Cassandra 中的数据分区 + +Cassandra 作为分布式系统运行,并且符合前述数据分区原则。使用 Cassandra,数据分区依赖于在集群级别配置的算法和在表级别配置的分区键。 + +![Cassandra data partition][2] + +Cassandra 查询语言 (CQL) 使用大家很熟悉的 SQL 表、行、列等术语。在上面的示例图中,表配置的主键中包含了分区键,具体格式为:主键Primary Key = 分区键Partition Key + [聚簇列]Clustering Columns 。 + +Cassandra 中的主键既定义了唯一的数据分区,也包含着分区内的数据排列依据信息。数据排列信息取决于聚簇列(非必需项)。每个唯一的分区键代表着服务器(包括其副本所在的服务器)中管理的若干行,。 + +### 在 CQL 中定义主键 + +接下来的四个示例演示了如何使用 CQL 语法表示主键。定义主键会让数据行分到不同的集合里,通常这些集合就是分区。 + +#### 定义方式 1(分区键:log_hour,聚簇列:无) + + +``` +CREATE TABLE server_logs( +   log_hour TIMESTAMP PRIMARYKEY, +   log_level text, +   message text, +   server text +   ) +``` + +这里,有相同 **log_hour** 的所有行都会进入同一个分区。 + +#### 定义方式 2(分区键:log_hour,聚簇列:log_level) + + +``` +CREATE TABLE server_logs( +   log_hour TIMESTAMP, +   log_level text, +   message text, +   server text, +   PRIMARY KEY (log_hour, log_level) +   ) +``` + +此定义方式与方式 1 使用了相同的分区键,但此方式中,每个分区的所有行都会按 **log_level** 升序排列。 + +#### 定义方式 3(分区键:log_hour,server,聚簇列:无) + + +``` +CREATE TABLE server_logs( +   log_hour TIMESTAMP, +   log_level text, +   message text, +   server text, +   PRIMARY KEY ((log_hour, server)) +   ) +``` + +在此定义中,**server** 和 **log_hour** 字段都相同的行才会进入同一个分区。 + +#### 定义方式 4(分区键:log_hour,server,聚簇列:log_level) + +``` +CREATE TABLE server_logs( +   log_hour TIMESTAMP, +   log_level text, +   message text, +   server text, +   PRIMARY KEY ((log_hour, server),log_level) +   )WITH CLUSTERING ORDER BY (column3 DESC); +``` + +此定义方式与方式 3 分区相同,但分区内的行会依照 **log_level** 降序排列。 + +### Cassandra 如何使用分区键 + +Cassandra 依靠分区键来确定在哪个节点上存储数据,以及在需要时定位数据。Cassandra 通过查看表中的分区键来执行这些读取和写入操作,并使用令牌tokens(一个 -2^63 到 +2^63-1 范围内的 long 类型值)来进行数据分布和索引。这些令牌通过分区器映射到分区键,分区器使用了将分区键转换为令牌的分区函数。通过这种令牌机制,Cassandra 集群的每个节点都拥有一组数据分区。然后分区键在每个节点上启用数据索引。 + +![Cassandra cluster with 3 nodes and token-based ownership][3] + +图中显示了一个三节点的 Cassandra 集群以及相应的令牌范围分配。这只是一个简单的示意图:具体实现过程使用了 [Vnodes][4]。 + +### 数据分区对 Cassandra 集群的影响 + +用心的分区键设计对于实现用例的理想分区大小至关重要。合理的分区可以实现均匀的数据分布和强大的 I/O 性能。分区大小对 Cassandra 集群有若干需要注意的影响: + + * 读取性能——为了在磁盘上的 SSTables 文件中找到分区,Cassandra 使用缓存、索引和索引摘要等数据结构。过大的分区会降低这些数据结构的维护效率,从而对性能产生负面影响。Cassandra 新版本在这方面取得了长足的进步:特别是 3.6 及其以上版本的 Cassandra 引擎引入了存储改进,针对大型分区,可以提供更好的性能,以及更强的应对内存问题和崩溃的弹性。 + * 内存使用——大分区会对 JVM 堆产生更大的压力,同时分区的增大也降低了垃圾收集机制的效率。 + * Cassandra 修复——大分区使 Cassandra 执行修复维护操作(通过跨副本比较数据来保持数据一致)时更加困难。 + * “墓碑”删除——听起来可能有点骇人,Cassandra 使用称为“墓碑”tombstones的独特标记来记录要删除的数据。如果没有合适的数据删除模式和压缩策略,大分区会使删除过程变得更加困难。 + +虽然这些影响可能会让人更倾向于简单地设计能产生小分区的分区键,但数据访问模式对理想的分区大小也有很大影响(有关更多信息,请阅读关于 [Cassandra 数据建模][5] 的深入讲解) )。数据访问模式可以定义为表的查询方式,包括表的所有 **select** 查询。 理想情况下,CQL 选择查询应该在 **where** 子句中只使用一个分区键。也就是说,当查询可以从单个分区,而不是许多较小的分区获取所需数据时,Cassandra 是最有效率的。 + +### 分区键设计的最佳实践 + +遵循分区键设计的最佳实践原则,这会帮你得到理想的分区大小。根据经验,Cassandra 中的最大分区应保持在 100MB 以下。理想情况下,它应该小于 10MB。虽然 Cassandra 3.6 及其以上版本能更好地支持大分区,但也必须对每个工作负载进行仔细的测试和基准测试,以确保分区键设计能够支持所需的集群性能。 + +具体来说,这些最佳实践原则适用于任何分区键设计: + + * 分区键的目标必须是将理想数量的数据放入每个分区,以支持其访问模式的需求。 + * 分区键应禁止无界分区:那些大小可能随着时间无限增长的分区。例如,在上面的 **server_logs** 示例中,随着服务器日志数量的不断增加,使用服务器列作为分区键就会产生无界分区。相比之下,使用 **log_hour** 将每个分区限制为一个小时数据的方案会更好。 + * 分区键还应避免产生分区倾斜,即分区增长不均匀,有些分区可能随着时间的推移而不受限制地增长。在 **server_logs** 示例中,在一台服务器生成的日志远多于其他服务器的情况下使用服务器列会产生分区倾斜。为了避免这种情况,可以从表中引入另一个属性来强制均匀分布,即使要创建一个虚拟列来这样做,也是值得的。 + * 使用时间元素和其他属性的组合分区键,这对时间序列数据分区很有帮助。这种方式可以防止无界分区,使访问模式能够在查询特定数据时使用时间属性,而且能够对特定时间段内的数据进行删除。上面的每个示例都使用了 **log_hour** 时间属性来演示这一点。 + +还有一些工具可用于帮助测试、分析和监控 Cassandra 分区,以检查所选模式是否高效。通过仔细设计分区键,使解决方案的数据和需求保持一致,并遵循最佳实践原则来优化分区大小,你就可以充分利用数据分区,更好地发挥 Cassandra 的可扩展性和性能潜力。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/5/apache-cassandra + +作者:[Anil Inamdar][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/anil-inamdar +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data) +[2]: https://opensource.com/sites/default/files/uploads/apache_cassandra_1_0.png (Cassandra data partition) +[3]: https://opensource.com/sites/default/files/uploads/apache_cassandra_2_0.png (Cassandra cluster with 3 nodes and token-based ownership) +[4]: https://www.instaclustr.com/cassandra-vnodes-how-many-should-i-use/ +[5]: https://www.instaclustr.com/resource/6-step-guide-to-apache-cassandra-data-modelling-white-paper/ From 18a09225ec746ebc988a8bc66abc5a101453c5fa Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 Oct 2021 05:02:30 +0800 Subject: [PATCH 0704/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211015?= =?UTF-8?q?=20How=20to=20Upgrade=20to=20Ubuntu=2021.10=20Right=20Now?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md --- ...ow to Upgrade to Ubuntu 21.10 Right Now.md | 67 +++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md diff --git a/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md b/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md new file mode 100644 index 0000000000..60d9111048 --- /dev/null +++ b/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md @@ -0,0 +1,67 @@ +[#]: subject: "How to Upgrade to Ubuntu 21.10 Right Now" +[#]: via: "https://itsfoss.com/upgrade-ubuntu-to-newer-version/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Upgrade to Ubuntu 21.10 Right Now +====== + +[Ubuntu 21.10 ‘Impish Indri’ has just been released][1]. If you are using Ubuntu 21.04, you should be provided the option to upgrade to Ubuntu 21.10. + +![Ubuntu 21.04 users should eventually be notified for the upgrade][2] + +However, this roll out will be gradual. This means not everyone will be notified about the availability of the new version immediately. It may take a couple of weeks before you see the upgrade option. + +But what if you are itching to get your hands on Ubuntu 21.10 that comes with GNOME 40 and other new features? Do you really have to wait? The answer is no. + +### Upgrading to Ubuntu 21.10 from Ubuntu 21.04 right now + +Here’s what you do. Open the Software & Updates application: + +![Start the Software & Updates application][3] + +And make sure that you have set “**Notify me of a new Ubuntu version**” to “**For any new version**” under the **Updates** tab. + +![Make sure that settings are right for new Ubuntu version notification][4] + +Now open a terminal and enter the following command to make sure that your system is updated: + +``` +sudo apt update && sudo apt upgrade +``` + +Once your Ubuntu 21.04 system has all the updates installed, run the update manager to look for development release (Ubuntu 21.10 in this case). + +``` +update-manager -d +``` + +It will open the Update Manager tool that looks for updates. Since you have already updated the system, it won’t find new updates to install. However, it will see that Ubuntu 21.10 is now available. + +![Hit the upgrade button][2] + +You can hit the upgrade button and follow the on-screen option to start the upgrade procedure. You should have good internet speed to download the 2 GB worth of updates. Make sure that your system stays connected to a power source during the upgrade. + +Enjoy Ubuntu 21.10! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/upgrade-ubuntu-to-newer-version/ + +作者:[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://news.itsfoss.com/ubuntu-21-10-release/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/upgrade-to-Ubuntu-21-10.webp?resize=797%2C287&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/software-and-updates.webp?resize=800%2C166&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ubuntu-upgrade-settings.webp?resize=800%2C338&ssl=1 From 83a2a63178f062204d4210fdf82f1f24a52ca7a5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 Oct 2021 05:02:38 +0800 Subject: [PATCH 0705/1588] add done: 20211015 How to Upgrade to Ubuntu 21.10 Right Now.md --- sources/tech/20211014 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20211014 .md diff --git a/sources/tech/20211014 .md b/sources/tech/20211014 .md new file mode 100644 index 0000000000..f1c1150f34 --- /dev/null +++ b/sources/tech/20211014 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/10/wsl-app-why/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 6e02fe666e05e5ba7942729cca110813e4c8231e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 Oct 2021 05:02:52 +0800 Subject: [PATCH 0706/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211015?= =?UTF-8?q?=20How=20to=20Find=20and=20Kill=20Zombie=20Process=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md --- ...o Find and Kill Zombie Process in Linux.md | 127 ++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md diff --git a/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md b/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md new file mode 100644 index 0000000000..ace4502ca6 --- /dev/null +++ b/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md @@ -0,0 +1,127 @@ +[#]: subject: "How to Find and Kill Zombie Process in Linux" +[#]: via: "https://itsfoss.com/kill-zombie-process-linux/" +[#]: author: "Marco Carmona https://itsfoss.com/author/marco/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Find and Kill Zombie Process in Linux +====== + +_**Brief: This is a quick tip on finding zombie processes in Linux and then killing them. You also learn a thing or two about processes and zombie processes.**_ + +Before you learn about Zombie process, let me recall what is a process in Linux. + +In a few words, a [process][1] is a running instance of a program in performance. It can be foreground (interactive process) or background (not interactive or automatic process). It can be a parent (creator of other processes during run-time) or child (process created by others) process. + +In Linux, except for the first init (or systemd) process with PID 0, every other process has a parent process. Processes also have their own child processes. + +Don’t believe me? Use the `pstree` command in terminal to look at the process tree to see the ‘family tree’ of your system’s processes. + +### What is a Zombie process in Linux? + +When a child process dies, the parent process is informed so that it can do some clean up like freeing up memory etc. However, child process goes into zombie state if the parent process is not aware of its death. For the parent, the child still exists but the child process is actually dead. This is how zombie processes (also known as defunct processes) are created and stay in the system. + +Here’s an excellent funny take on the zombie process by Turnoff.us: + +![Image credit: Turnoff.us][2] + +### Do you really need to worry about Zombie processes? + +Here is important to say that zombie processes are not as dangerous as its name can sound. + +The problem may arise if your system has limited RAM or if there are too many zombie processes eating up RAM. Also, most Linux processes can have maximum PID set to 32768. If there are no available IDs for other productive tasks, your system may crash. + +This rarely happens, but it’s a possibility, specially if a poorly coded program starts inducing numerous zombie processes. + +In such case, it would be a good idea to find and kill zombie process. + +### How to find zombie processes? + +A process in Linux can have one of the following states: + + * D = uninterruptible sleep + * I = idle + * R = running + * S = sleeping + * T = stopped by job control signal + * t = stopped by debugger during trace + * Z = zombie + + + +But where can you see the processes and their respective status? One easy way is to use the terminal and the [top command][3]. + +![Top command show processes and their status][4] + +As you can see in the screenshot above, there are 250 total tasks (or processes), 1 is running, 248 processes are sleeping and 1 is in zombie state. + +Now, the question arises, how to kill the zombie process? + +### How to find and kill a zombie process? Can a zombie process be killed? + +![][5] + +A zombie process is already dead. How do you kill an already dead process? + +In the zombie movies, you shoot the zombies in the head or burn it. That’s not an option here. You can burn your system for killing the zombie process but that’s not a feasible solution ;) + +Some people suggests sending SIGCHLD signal to the parent process. But it is more likely to be ignored. The other option to kill the zombie process is to kill its parent process. That sounds brutal but that’s the only sure shot way of killing zombie processes. + +So, first, let’s list the zombie processes to know their ID. It can be achieved by [using the ps command][6] like this in the terminal. + +``` +ps ux | awk '{if($8=="Z+") print}' +``` + +The 8th column in the output of the ps ux command displays the state of a process. You are asking to print all the matching lines where the state of a process is Z+ (indicating zombie state). + +Once you have identified its process ID, let’s get its parent’s process ID. + +``` +ps -o ppid= -p +``` + +Alternatively, you can combine the above two commands in the following fashion where it directly provides the PID of the zombie process and the PID of its parent process. + +``` +ps -A -ostat,pid,ppid | grep -e '[zZ]' +``` + +Here you get the parent process ID, so [finally kill the process][7] by typing the command line with its respective ID process obtained before. + +``` +kill -9 +``` + +![Killing parent process][8] + +You can verify if the zombie process is killed or not by running the ps command again or even the top command. + +Congrats! Now you know how to eliminate zombie processes. + +_With inputs from Abhishek Prakash._ + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kill-zombie-process-linux/ + +作者:[Marco Carmona][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/marco/ +[b]: https://github.com/lujun9972 +[1]: https://tldp.org/LDP/tlk/kernel/processes.html +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/zombies-turnoff.webp?resize=800%2C467&ssl=1 +[3]: https://linuxhandbook.com/top-command/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/top-command-view.png?resize=800%2C474&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/kill-zombie-process-linux.jpg?resize=800%2C450&ssl=1 +[6]: https://linuxhandbook.com/ps-command/ +[7]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/killing-parent-process.png?resize=800%2C180&ssl=1 From 04e824f5c882a0a5baf832479772c3df488ac8e5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 Oct 2021 05:03:14 +0800 Subject: [PATCH 0707/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211014?= =?UTF-8?q?=209=20ways=20to=20use=20open=20source=20every=20day?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211014 9 ways to use open source every day.md --- ...014 9 ways to use open source every day.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20211014 9 ways to use open source every day.md diff --git a/sources/tech/20211014 9 ways to use open source every day.md b/sources/tech/20211014 9 ways to use open source every day.md new file mode 100644 index 0000000000..836627323c --- /dev/null +++ b/sources/tech/20211014 9 ways to use open source every day.md @@ -0,0 +1,112 @@ +[#]: subject: "9 ways to use open source every day" +[#]: via: "https://opensource.com/article/21/10/open-source-tools" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +9 ways to use open source every day +====== +You may be surprised to learn that the tools you use every day are open +source. +![Tools illustration][1] + +Recently I was invited to present on free and open resources that are available on the web. This presentation was part of a local effort to keep our community working—sponsored by the [Foster Center][2] at St. Bonaventure University near my home. Some of the resources I shared were not open source and merely cost $0, but many of the tools were also open source. + +It was interesting to see how many folks recognized the tools I mentioned. Many people are unaware that the tools they use every day are open source, and they can share them with others.  + +### Open source browsers + +Using the web requires a good browser, and [Firefox is open source][3], which some of the folks I was presenting to were unaware of. In addition to being open source, Firefox is strongly conscious of privacy, which is a growing concern for many users. Interestingly, though, even Microsoft's new browser is based on the open source Chromium project.  + +### Open source web privacy + +Another way to protect your privacy and improve your web experience, in general, is to use uBlock Origin to block advertisements. According to their website: + +> uBlock Origin is a free and open source, cross-platform browser extension for content filtering—primarily aimed at neutralizing privacy invasion in an efficient, user-friendly method. + +The code is [GPL v. 3.0][4].  + +The Electronic Frontier Foundation (EFF) also maintains [Privacy Badger][5], a web browser extension licensed under the GPL v.3.0. According to their Github repository, it's: + +> A browser extension that automatically learns to block invisible trackers. Instead of keeping lists of what to block, Privacy Badger automatically discovers trackers based on their behavior. + +In addition to privacy, my presentation shared the importance of secure passwords. My audience learned about [Bitwarden][6]. Many folks had no idea how to generate secure passwords, differentiate from one website to another, and store them securely. I demonstrated how the software worked to create passwords and use Bitwarden to store those passwords in the cloud. I explained how users could access those credentials as browser plugins, desktop and laptop applications, and on Android or iOS mobile devices.  + +### Open source messaging + +I spoke of the ubiquity of text messaging but also its inherent insecurity. The audience was not aware of [Signal][7]. I have been using Signal for a couple of years and regularly encourage others to consider it as a secure messaging platform. It is easy to [install Signal][8] on Linux, macOS, Windows, [Android][9], and [iOS][10], and it offers excellent support [documentation][11] with detailed installation instructions for each operating system. Signal uses your existing mobile number, provided it can send and receive SMS and phone calls. The first time you set up Signal on your mobile phone, the application can search your address books for any of your contacts using Signal.  + +### Open source office tools + +No presentation on open source tools is complete without mentioning my favorite content creation tool, which is [LibreOffice][12]. Despite its popularity, many are unaware that it exists and the freedom that comes with its use. I use it every day to write articles. I use it instead of Excel, and sometimes I used it for presentations. You can download it and install it for Linux, macOS, and Windows. One of the beauties of LibreOffice is that you really own your documents. You don't need an expensive program to access them. + +### Open source blog builder + +[WordPress][13] is my favorite blogging engine, and there are myriad ways you can use it, whether sharing your own opinions on world events, a low-cost writing platform for your [students][14], or a web presence for your [business][15]. + +### Open source media repository + +While creating content, you will need images that you can easily and legally share to illustrate your work. [OpenClipart][16] is my go-to. There are thousands of images available in various popular formats for inclusion in your LibreOffice documents and blog posts. In addition, you can find images that you can share with the proper attribution by visiting [Creative Commons][17]. Creative Commons offers licensing that makes sharing easier. Creative Commons is an extension of copyright that makes sharing easier. Be sure to familiarize yourself with the nuances of the licenses.  + +### Open source video conferencing + +The pandemic has changed the paradigm for conferences and meetups. Jitsi, Big Blue Button, and several others have revolutionized how we interact and learn as reported [here][18] by Chris Hermansen.  + +### Open source educational resources + +Open educational resources have liberated learning. With [OER Commons][19], you can find content to meet your needs, from pre-kindergarten to graduate and professional degrees, and it is openly licensed so that you can use it and share it with others. Massachusetts Institute of Technology (MIT) Open Courseware is nearly all of MIT's undergraduate and graduate content offered under a Creative Commons [non-commercial share-alike][20] license. [OpenStax][21], an open textbook initiative at Rice University, offers peer-reviewed textbooks that are openly licensed and available for free.  + +### Open source podcast tools + +Podcasts have become a great way to catch up on the latest [open source news][22] for me. Have you thought of starting your own podcast? There are a couple of great open source tools that I am familiar with that provide ways to make that a reality. [Audacity][23] is my favorite recording application. I have used it to flip my classroom instruction, record interviews, and experiment with sound effects. It is a 16-track audio editor that you can use in a variety of ways. If you have something to say or a skill to teach, you should use [Open Broadcaster Software][24]. + +### Linux + +Finally, introduce your friends to Linux, which many of them still don't know about, and let them experience all the readily available free software.  + +In addition to the talk recorded and shared on [YouTube][25], I compiled a list of links to the resources and shared them on [GitHub][26]. + +There are lots of non-code ways to contribute to open source: Here are three alternatives. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/open-source-tools + +作者:[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/tools_hardware_purple.png?itok=3NdVoYhl (Tools illustration) +[2]: https://www.sbu.edu/academics/schools-at-sbu/school-of-business/foster-center-for-responsible-leadership/foster-center-events +[3]: https://opensource.com/article/21/9/switch-to-firefox +[4]: https://github.com/gorhill/uBlock +[5]: https://privacybadger.org/ +[6]: https://github.com/bitwarden +[7]: https://opensource.com/article/19/10/secure-private-messaging +[8]: https://signal.org/download/ +[9]: https://play.google.com/store/apps/details?id=org.thoughtcrime.securesms&referrer=utm_source%3DOWS%26utm_medium%3DWeb%26utm_campaign%3DNav +[10]: https://apps.apple.com/us/app/signal-private-messenger/id874139669 +[11]: https://support.signal.org/ +[12]: https://opensource.com/article/21/9/libreoffice-tips +[13]: https://opensource.com/article/18/10/setting-wordpress-raspberry-pi +[14]: https://opensource.com/article/20/4/wordpress-virtual-machine +[15]: https://opensource.com/article/21/3/wordpress-plugins-retail +[16]: https://openclipart.org/ +[17]: https://search.creativecommons.org/ +[18]: https://opensource.com/article/20/5/open-source-video-conferencing +[19]: https://www.oercommons.org/ +[20]: https://ocw.mit.edu/help/faq-cite-ocw-content/ +[21]: https://openstax.org/ +[22]: https://opensource.com/article/19/10/linux-podcasts-Jupiter-Broadcasting +[23]: https://opensource.com/article/20/4/audacity +[24]: https://opensource.com/article/20/4/open-source-live-stream +[25]: https://youtu.be/aUgaYtN_sUU +[26]: https://github.com/donwatkins/Presentations/blob/master/fostercenter.md From 152b6d461cf23e197cb1f89d5bb612eaba37f958 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 Oct 2021 05:03:29 +0800 Subject: [PATCH 0708/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211014?= =?UTF-8?q?=205=20common=20bugs=20in=20C=20programming=20and=20how=20to=20?= =?UTF-8?q?fix=20them?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211014 5 common bugs in C programming and how to fix them.md --- ...gs in C programming and how to fix them.md | 415 ++++++++++++++++++ 1 file changed, 415 insertions(+) create mode 100644 sources/tech/20211014 5 common bugs in C programming and how to fix them.md diff --git a/sources/tech/20211014 5 common bugs in C programming and how to fix them.md b/sources/tech/20211014 5 common bugs in C programming and how to fix them.md new file mode 100644 index 0000000000..da8700c22a --- /dev/null +++ b/sources/tech/20211014 5 common bugs in C programming and how to fix them.md @@ -0,0 +1,415 @@ +[#]: subject: "5 common bugs in C programming and how to fix them" +[#]: via: "https://opensource.com/article/21/10/programming-bugs" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 common bugs in C programming and how to fix them +====== +Five ways to make your C programs more resilient and reliable. +![Bug tracking magnifying glass on computer screen][1] + +Even the best programmers can create programming bugs. Depending on what your program does, these bugs could introduce security vulnerabilities, cause the program to crash, or create unexpected behavior. + +The C programming language sometimes gets a bad reputation because it is not memory safe like more recent programming languages, including Rust. But with a little extra code, you can avoid the most common and most serious C programming bugs. Here are five bugs that can break your application and how you can avoid them: + +### 1\. Uninitialized variables + +When the program starts up, the system will assign it a block of memory that the program uses to store data. That means your variables will get whatever random value was in memory when the program started. + +Some environments will intentionally "zero out" the memory as the program starts up, so every variable starts with a zero value. And it can be tempting to assume in your programs that all variables will begin at zero. However, the C programming specification says that the system does not initialize variables. + +Consider a sample program that uses a few variables and two arrays: + + +``` +#include <stdio.h> +#include <stdlib.h> + +int +main() +{ +  int i, j, k; +  int numbers[5]; +  int *array; + +  [puts][2]("These variables are not initialized:"); + +  [printf][3]("  i = %d\n", i); +  [printf][3]("  j = %d\n", j); +  [printf][3]("  k = %d\n", k); + +  [puts][2]("This array is not initialized:"); + +  for (i = 0; i < 5; i++) { +    [printf][3]("  numbers[%d] = %d\n", i, numbers[i]); +  } + +  [puts][2]("malloc an array ..."); +  array = [malloc][4](sizeof(int) * 5); + +  if (array) { +    [puts][2]("This malloc'ed array is not initialized:"); + +    for (i = 0; i < 5; i++) { +      [printf][3]("  array[%d] = %d\n", i, array[i]); +    } + +    [free][5](array); +  } + +  /* done */ + +  [puts][2]("Ok"); +  return 0; +} +``` + +The program does not initialize the variables, so they start with whatever values the system had in memory at the time. Compiling and running this program on my Linux system, you'll see that some variables happen to have "zero" values, but others do not: + + +``` +These variables are not initialized: +  i = 0 +  j = 0 +  k = 32766 +This array is not initialized: +  numbers[0] = 0 +  numbers[1] = 0 +  numbers[2] = 4199024 +  numbers[3] = 0 +  numbers[4] = 0 +malloc an array ... +This malloc'ed array is not initialized: +  array[0] = 0 +  array[1] = 0 +  array[2] = 0 +  array[3] = 0 +  array[4] = 0 +Ok +``` + +Fortunately, the `i` and `j` variables start at zero, but `k` has a starting value of 32766. In the numbers array, most elements also happen to start with zero, except the third element, which gets an initial value of 4199024. + +Compiling the same program on a different system further shows the danger in uninitialized variables. Don't assume "all the world runs Linux" because one day, your program might run on a different platform. For example, here's the same program running on FreeDOS: + + +``` +These variables are not initialized: +  i = 0 +  j = 1074 +  k = 3120 +This array is not initialized: +  numbers[0] = 3106 +  numbers[1] = 1224 +  numbers[2] = 784 +  numbers[3] = 2926 +  numbers[4] = 1224 +malloc an array ... +This malloc'ed array is not initialized: +  array[0] = 3136 +  array[1] = 3136 +  array[2] = 14499 +  array[3] = -5886 +  array[4] = 219 +Ok +``` + +Always initialize your program's variables. If you assume a variable will start with a zero value, add the extra code to assign zero to the variable. This extra bit of typing upfront will save you headaches and debugging later on. + +### 2\. Going outside of array bounds + +In C, arrays start at array index zero. That means an array that is ten elements long goes from 0 to 9, or an array that is a thousand elements long goes from 0 to 999. + +Some programmers sometimes forget this and introduce "off by one" bugs where they reference the array starting at one. In an array that is five elements long, the value the programmer intended to find at array element "5" is not actually the fifth element of the array. Instead, it is some other value in memory, not associated with the array at all. + +Here's an example that goes well outside the array bounds. The program starts with an array that's only five elements long but references array elements from outside that range: + + +``` +#include <stdio.h> +#include <stdlib.h> + +int +main() +{ +  int i; +  int numbers[5]; +  int *array; + +  /* test 1 */ + +  [puts][2]("This array has five elements (0 to 4)"); + +  /* initalize the array */ +  for (i = 0; i < 5; i++) { +    numbers[i] = i; +  } + +  /* oops, this goes beyond the array bounds: */ +  for (i = 0; i < 10; i++) { +    [printf][3]("  numbers[%d] = %d\n", i, numbers[i]); +  } + +  /* test 2 */ + +  [puts][2]("malloc an array ..."); + +  array = [malloc][4](sizeof(int) * 5); + +  if (array) { +    [puts][2]("This malloc'ed array also has five elements (0 to 4)"); + +    /* initalize the array */ +    for (i = 0; i < 5; i++) { +      array[i] = i; +    } + +    /* oops, this goes beyond the array bounds: */ +    for (i = 0; i < 10; i++) { +      [printf][3]("  array[%d] = %d\n", i, array[i]); +    } + +    [free][5](array); +  } + +  /* done */ + +  [puts][2]("Ok"); +  return 0; +} +``` + +Note that the program initializes all the values of the array, from 0 to 4, but then tries to read 0 to 9 instead of 0 to 4. The first five values are correct, but after that you don’t know what the values will be: + + +``` +This array has five elements (0 to 4) +  numbers[0] = 0 +  numbers[1] = 1 +  numbers[2] = 2 +  numbers[3] = 3 +  numbers[4] = 4 +  numbers[5] = 0 +  numbers[6] = 4198512 +  numbers[7] = 0 +  numbers[8] = 1326609712 +  numbers[9] = 32764 +malloc an array ... +This malloc'ed array also has five elements (0 to 4) +  array[0] = 0 +  array[1] = 1 +  array[2] = 2 +  array[3] = 3 +  array[4] = 4 +  array[5] = 0 +  array[6] = 133441 +  array[7] = 0 +  array[8] = 0 +  array[9] = 0 +Ok +``` + +When referencing arrays, always keep track of its size. Store that in a variable; don't hard-code an array size. Otherwise, your program might stray outside the array bounds when you later update it to use a different array size, but you forget to change the hard-coded array length. + +### 3\. Overflowing a string + +Strings are just arrays of a different kind. In the C programming language, a string is an array of `char` values, with a zero character to indicate the end of the string. + +And so, like arrays, you need to avoid going outside the range of the string. This is sometimes called _overflowing a string_. + +One easy way to overflow a string is to read data with the `gets` function. The `gets` function is very dangerous because it doesn't know how much data it can store in a string, and it naively reads data from the user. This is fine if your user enters short strings like `foo` but can be disastrous when the user enters a value that is too long for your string value. + +Here's a sample program that reads a city name using the `gets` function. In this program, I've also added a few unused variables to show how string overflow can affect other data: + + +``` +#include <stdio.h> +#include <string.h> + +int +main() +{ +  char name[10];                       /* Such as "Chicago" */ +  int var1 = 1, var2 = 2; + +  /* show initial values */ + +  [printf][3]("var1 = %d; var2 = %d\n", var1, var2); + +  /* this is bad .. please don't use gets */ + +  [puts][2]("Where do you live?"); +  [gets][6](name); + +  /* show ending values */ + +  [printf][3]("<%s> is length %d\n", name, [strlen][7](name)); +  [printf][3]("var1 = %d; var2 = %d\n", var1, var2); + +  /* done */ + +  [puts][2]("Ok"); +  return 0; +} +``` + +That program works fine when you test for similarly short city names, like `Chicago` in Illinois or `Raleigh` in North Carolina: + + +``` +var1 = 1; var2 = 2 +Where do you live? +Raleigh +<Raleigh> is length 7 +var1 = 1; var2 = 2 +Ok +``` + +The Welsh town of `Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch` has one of the longest names in the world. At 58 characters, this string goes well beyond the 10 characters reserved in the `name` variable. As a result, the program stores values in other areas of memory, including the values of `var1` and `var2`: + + +``` +var1 = 1; var2 = 2 +Where do you live? +Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch +<Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch> is length 58 +var1 = 2036821625; var2 = 2003266668 +Ok +Segmentation fault (core dumped) +``` + +Before aborting, the program used the long string to overwrite other parts of memory. Note that `var1` and `var2` no longer have their starting values of `1` and `2`. + +Avoid `gets`, and use safer methods to read user data. For example, the `getline` function will allocate enough memory to store user input, so the user cannot accidentally overflow the string by entering a long value. + +### 4\. Freeing memory twice + +One of the rules of good C programming is, "if you allocate memory, you should free it." Programs can allocate memory for arrays and strings using the `malloc` function, which reserves a block of memory and returns a pointer to the starting address in memory. Later, the program can release the memory using the `free` function, which uses the pointer to mark the memory as unused. + +However, you should only use the `free` function once. Calling `free` a second time will result in unexpected behavior that will probably break your program. Here's a short example program to show that. It allocates memory, then immediately releases it. But like a forgetful-but-methodical programmer, I also freed the memory at the end of the program, resulting in freeing the same memory twice: + + +``` +#include <stdio.h> +#include <stdlib.h> + +int +main() +{ +  int *array; + +  [puts][2]("malloc an array ..."); + +  array = [malloc][4](sizeof(int) * 5); + +  if (array) { +    [puts][2]("malloc succeeded"); + +    [puts][2]("Free the array..."); +    [free][5](array); +  } + +  [puts][2]("Free the array..."); +  [free][5](array); + +  [puts][2]("Ok"); +} +``` + +Running this program causes a dramatic failure on the second use of the `free` function: + + +``` +malloc an array ... +malloc succeeded +Free the array... +Free the array... +free(): double free detected in tcache 2 +Aborted (core dumped) +``` + +Avoid calling `free` more than once on an array or string. One way to avoid freeing memory twice is to locate the `malloc` and `free` functions in the same function. + +For example, a solitaire program might allocate memory for a deck of cards in the main function, then use that deck in other functions to play the game. Free the memory in the main function, rather than some other function. Keeping the `malloc` and `free` statements together helps to avoid freeing memory more than once. + +### 5\. Using invalid file pointers + +Files are a handy way to store data. For example, you might store configuration data for your program in a file called `config.dat`. The Bash shell reads its initial script from `.bash_profile` in the user's home directory. The GNU Emacs editor looks for the file `.emacs` for its starting values. And the Zoom meeting client uses the `zoomus.conf` file to read its program configuration. + +So the ability to read data from a file is important for pretty much all programs. But what if the file you want to read isn't there? + +To read a file in C, you first open the file using the `fopen` function, which returns a stream pointer to the file. You can use this pointer with other functions to read data, such as `fgetc` to read the file one character at a time. + +If the file you want to read isn't there or isn't readable by your program, then the `fopen` function will return `NULL` as the file pointer, which is an indication the file pointer is invalid. But here's a sample program that innocently does not check if `fopen` returned `NULL` and tries to read the file regardless: + + +``` +#include <stdio.h> + +int +main() +{ +  FILE *pfile; +  int ch; + +  [puts][2]("Open the FILE.TXT file ..."); + +  pfile = [fopen][8]("FILE.TXT", "r"); + +  /* you should check if the file pointer is valid, but we skipped that */ + +  [puts][2]("Now display the contents of FILE.TXT ..."); + +  while ((ch = [fgetc][9](pfile)) != EOF) { +    [printf][3]("<%c>", ch); +  } + +  [fclose][10](pfile); + +  /* done */ + +  [puts][2]("Ok"); +  return 0; +} +``` + +When you run this program, the first call to `fgetc` results in a spectacular failure, and the program immediately aborts: + + +``` +Open the FILE.TXT file ... +Now display the contents of FILE.TXT ... +Segmentation fault (core dumped) +``` + +Always check the file pointer to ensure it's valid. For example, after calling `fopen` to open a file, check the pointer's value with something like `if (pfile != NULL)` to ensure that the pointer is something you can use. + +We all make mistakes, and programming bugs happen to the best of programmers. But if you follow these guidelines and add a little extra code to check for these five types of bugs, you can avoid the most serious C programming mistakes. A few lines of code up front to catch these errors may save you hours of debugging later. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/programming-bugs + +作者:[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/bug_software_issue_tracking_computer_screen.jpg?itok=6qfIHR5y (Bug tracking magnifying glass on computer screen) +[2]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[3]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/free.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/gets.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html From a1896bd58c4c73dc6ec45eb903c84e1a65aebf76 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 Oct 2021 05:06:11 +0800 Subject: [PATCH 0709/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211014?= =?UTF-8?q?=20Ubuntu=2021.10=20is=20Available=20Now!=20Finally=20Brings=20?= =?UTF-8?q?the=20Much=20Awaited=20GNOME=2040=20With=20Ubuntu=20Twist?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md --- ...Much Awaited GNOME 40 With Ubuntu Twist.md | 140 ++++++++++++++++++ 1 file changed, 140 insertions(+) create mode 100644 sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md diff --git a/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md b/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md new file mode 100644 index 0000000000..bb9eb8a0fc --- /dev/null +++ b/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md @@ -0,0 +1,140 @@ +[#]: subject: "Ubuntu 21.10 is Available Now! Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist" +[#]: via: "https://news.itsfoss.com/ubuntu-21-10-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ubuntu 21.10 is Available Now! Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist +====== + +Ubuntu 21.10 is the last non-LTS release before the next big LTS update. Codenamed, Impish Indri, Ubuntu 21.10 will be supported for **nine months until July 2022**. + +Unless you want to try the latest and greatest features, you should stick to Ubuntu 20.04 LTS and wait for Ubuntu 22.04 LTS. + +Now that you can download and install Ubuntu 21.10 on your systems, let me highlight a few things about this update. + +### Ubuntu 21.10 “Impish Indri”: What’s New? + +![][1] + +Ubuntu 21.10 comes baked with several significant changes. Some of the most impactful improvements include: + + * New installer + * Addition of GNOME 40 + * Ditching the mixed theme and opting for light/dark theming + * Including Linux Kernel 5.13 + * Inclusion of PulseAudio 15 with Bluetooth LDAC support + * Wayland session with Nvidia proprietary driver + + + +GNOME 40 can be a refreshing change with Ubuntu but you can only tell that after you experience it. To give you a quick idea, here’s what you can expect with all the changes included in this release. + +### Refreshed Installer + +![][2] + +While Ubuntu’s installer was easy to use and newbie-friendly, Canonical wants to take it up a notch by giving the installer a visual and technical overhaul. + +The dev team utilizes Flutter to make the installer consistent across all other Ubuntu flavors and system configurations. + +![][3] + +### GNOME 40 + +![][1] + +Ubuntu’s desktop experience blends in with GNOME 40 without offering any confusing layouts. The dock remains and the horizontal activity overview works seamlessly with that. + +Of course, all the improvements in [GNOME 40][4] like core app updates, workspace changes, and more carry over to Ubuntu 21.10 with a few teaks from Canonical. + +Personally, I didn’t like the workflow with GNOME 40, but you may want to take it up for a spin. + +### Changes in Theme + +![][5] + +I like the improved color scheme that aims to blend in better with Canonical’s branding for Ubuntu. + +However, the mixed (Standard) theme was a bit problematic when it came to being consistent with applications and overall theme selection. + +Going forward with Ubuntu 21.10, you will only notice a dark and light theme while the light being the default choice out-of-the-box. If you’re curious, you can read our [past coverage to know more about this change][6]. + +### Linux Kernel 5.13 + +The addition of Linux Kernel 5.13 adds support for future Intel and AMD chips along with initial Apple M1 support. + +You can explore more about [Linux Kernel 5.13][7] but overall, it should give you way better hardware compatibility. + +### PulseAudio 15 With Bluetooth LDAC Support + +Considering that more Bluetooth headphones now support LDAC, you get to utilize the capability when using Ubuntu 21.10 on your desktop. + +Fret not, if you do not want to try a non-LTS release, Ubuntu 22.04 LTS will include the same improvement. So, you will have to be patient till next year to make use of that. + +In addition to that, PulseAudio 15 brings in a range of improvements, you can refer to its [official changelog to know more about that.][8] + +### Wayland Session with NVIDIA Proprietary Driver + +Now, even if you use the proprietary NVIDIA drivers, you will be able to switch to a Wayland session if you need it. + +### Other Changes in Ubuntu 21.10 + +![][9] + +Ubuntu 21.10 release brings in a host of quality changes to its cloud images, Raspberry Pi support, and security as well. + +Some of those notable changes include: + + * [Including Firefox as a Snap by default][10] + * Package updates to LibreOffice, Thunderbird + * Ubuntu server improvements + * New PHP default to 8.0.8 + + + +If you want to explore all the technical details, you might want to refer to the [official release notes][11]. + +### Download and Upgrade to Ubuntu 21.10 + +You can opt for a fresh installation or [upgrade from Ubuntu][12] 21.04 to Ubuntu 21.10 using the software updater. + +Do note that if you are using Ubuntu 20.04 LTS, it is recommended to wait for the next LTS release, unless you know what you are doing. + +[Download Ubuntu 21.10][13] + +#### 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/ubuntu-21-10-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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://news.itsfoss.com/gnome-40-release/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://news.itsfoss.com/ubuntu-21-10-theme-change/ +[7]: https://news.itsfoss.com/linux-kernel-5-13-release/ +[8]: https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/15.0/ +[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU1MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[10]: https://news.itsfoss.com/ubuntu-firefox-snap-default/ +[11]: https://discourse.ubuntu.com/t/impish-indri-release-notes/21951 +[12]: https://itsfoss.com/upgrade-ubuntu-to-newer-version/ +[13]: https://releases.ubuntu.com/21.10/ From da7bae1202cc48af7a9c2e53f6d7eee8cbdc4643 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 Oct 2021 05:06:19 +0800 Subject: [PATCH 0710/1588] add done: 20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md --- sources/tech/20211015 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20211015 .md diff --git a/sources/tech/20211015 .md b/sources/tech/20211015 .md new file mode 100644 index 0000000000..18be05ead6 --- /dev/null +++ b/sources/tech/20211015 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/10/kde-plasma-5-23-release/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 8df09480a336955a7a7ea392da69679c49299dba Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 15 Oct 2021 05:06:31 +0800 Subject: [PATCH 0711/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211014?= =?UTF-8?q?=20KDE=20Plasma=205.23=20Release=20Marks=20its=2025th=20Anniver?= =?UTF-8?q?sary=20With=20Exciting=20Improvements?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md --- ... Anniversary With Exciting Improvements.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md diff --git a/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md b/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md new file mode 100644 index 0000000000..09923e5317 --- /dev/null +++ b/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md @@ -0,0 +1,136 @@ +[#]: subject: "KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements" +[#]: via: "https://news.itsfoss.com/kde-plasma-5-23-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements +====== + +For years, KDE Plasma has been among the most-used desktop environments. This is due to its seemingly endless customization options, flashy looks, and feature-filled updates. + +With KDE Plasma 5.23, the desktop environment marks 25 years of work. Hence, this release is also known as Plasma 25th Anniversary Edition. + +It’s just wild to imagine that Matthias Ettrich (founder of KDE) [reached out to a newsgroup][1] back on **October 14, 1996**, to get help from fellow programmers for his “Kool Desktop Environment” project. + +And, look, where we are now… + +In this update, we get to see some significant UI improvements, both within Plasma and third-party apps. + +### KDE Plasma 5.23: What’s New? + +This update brings many improvements, including: + + * Desktop accent colors + * New breeze theme + * New power management quick control + * More customization options for the app launcher + * Hundreds of bugfixes + + + +Here, we will be looking at all these new improvements. + +![][2] + +#### Desktop Accent Colors + +![][3] + +In System Settings, you will find an option to change the accent color of your desktop. You can choose a custom color of your choice or blend in with the theme applied by default. + +#### New Breeze Theme + +![][4] + +This update brings a brand-new Breeze theme: Breeze – Blue Ocean. The default theme has improved over the years, and this time, it focuses on making the visuals clearer and accessible. + +Overall, the new theme provides a glossy look. In addition to the theme, the icons have been made more prominent; a loading gear icon has been added. And, many such subtle differences have made their way to KDE Plasma 5.23 to enhance the look and feel of the desktop. + +As developer Nate Graham said during the beta releases: + +> There is a lot of time left to tweak the final appearance as needed, but overall I think it’s really nice, and I hope you’re as excited about it as I am + +#### Enhanced Search Functionality in System Settings + +To make it easier to find what you’re looking for, KDE Plasma 5.23 has added more combinations of keywords that quickly suggests the related settings you look for using the search bar. + +#### System Tray Improvements + +![][5] + +While the system tray already offers many controls, you get finer options to monitor your connected networks and access the clipboard. + +The system tray has also improved the overall look when displaying the active media being played. + +#### New Power Management Quick Control + +With the release of Linux 5.12, a power management feature was added. Now, KDE has introduced an easy way of adjusting this, which comes in new quick control. + +It has three options: Power Saver, Balanced, and Performance. All it takes is a single click to save the battery and tweak the performance as needed. + +#### Improvements to Application Launcher + +![][6] + +With Plasma 5.21, KDE introduced a new app launcher called Kickoff. While it was generally well-received, some users did complain about the fewer customization options compared to the older launcher. + +Fortunately, Plasma 5.23 fixes this, introducing some brand-new customization options for Kickoff. These include the ability to: + + * Iconify the Power and User controls + * Choose list or grid view for all items, not just the favourites menu + * New keyboard shortcut to quickly focus on the search bar (CTRL+F) + * A new pin button added to the top-right corner to keep the application launcher active + + + +Overall, I expect these new options to be quite popular among users, especially those using KDE, because of its incredible customization options. + +### Other Improvements + +Other usual improvements include: + + * Making Wayland sessions better + * Improved data transparency through the Feedback applicatino + * Performance improvements to KDE’s Discover (app center) + + + +To explore more about the release, you can check out the [official announcement post][7] and its [changelog][8]. + +### Wrapping Up + +While not the biggest release ever, this is a significant release with valuable additions marking its 25th anniversary. As always, you should receive the updates sometime within the next few months, depending on your distribution. + +_What do you think about the improvements with KDE Plasma 5.23? Let me know 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/kde-plasma-5-23-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://groups.google.com/g/de.comp.os.linux.misc/c/SDbiV3Iat_s/m/zv_D_2ctS8sJ?pli=1 +[2]: https://i0.wp.com/i.ytimg.com/vi/RMXViPlehAo/hqdefault.jpg?w=780&ssl=1 +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM3MiIgd2lkdGg9Ijc0MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwOCIgd2lkdGg9IjM2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2MiIgd2lkdGg9IjQ2NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2OCIgd2lkdGg9IjY5OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[7]: https://kde.org/announcements/plasma/5/5.23.0/ +[8]: https://kde.org/announcements/changelogs/plasma/5/5.22.5-5.23.0/ From fa8280871d9d9b4d77e6769b7525d417e873d5f3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 15 Oct 2021 08:38:58 +0800 Subject: [PATCH 0712/1588] translating --- ... Google Chrome on Debian and Kali Linux.md | 160 ----------------- ... Google Chrome on Debian and Kali Linux.md | 161 ++++++++++++++++++ 2 files changed, 161 insertions(+), 160 deletions(-) delete mode 100644 sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md create mode 100644 translated/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md diff --git a/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md b/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md deleted file mode 100644 index a3fb8467ef..0000000000 --- a/sources/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md +++ /dev/null @@ -1,160 +0,0 @@ -[#]: subject: "How to Install Google Chrome on Debian and Kali Linux" -[#]: via: "https://itsfoss.com/install-chrome-debian-kali-linux/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install Google Chrome on Debian and Kali Linux -====== - -Debian and Debian-based Kali Linux come with Firefox as the default web browser. But this does not mean that you cannot install other web browsers in it. - -Google Chrome is hugely popular and you probably already use it on other systems. If you want to install Chrome on Debian, you can surely do so. - -You won’t find Google Chrome in the repositories of Debian because it is not open source software but you can download and install it from Chrome website. - -In this tutorial, I’ll show you two methods of installing Chrome on Debian: - - * GUI method - * Command line method - - - -Let’s start with the GUI method first. - -_**Note: I am using Debian in the examples here but since Kali Linux is based on Debian, the same methods are also applicable to Kali Linux.**_ - -### Method 1: Installing Chrome on Debian Graphically - -This is a no-brainer. You go to the Google Chrome website, download the deb file and double lick on it to install it. I am going to show the steps in detail so that it is easy for you to follow it. - -Go to Google Chrome’s website. - -[Get Google Chrome][1] - -You’ll see the option to download Google Chrome. - -![Click on the Download Chrome button][2] - -When you click on the download button, it gives you two options for downloading the installer file. Go with the one that says Debian/Ubuntu. - -![Download the Chrome installer file for Debian][3] - -**Please note that Google Chrome is NOT available for 32-bit systems.** - -In the next screen, you should opt for saving the file to the computer instead of opening it in software center for installation. This way, the downloaded file will be saved in the Downloads folder instead of the temp directory. - -![Save the downloaded DEB file for Google Chrome][4] - -Go to the Download folders and right click on the downloaded deb file and choose to open it with Software Install. - -![Right click on the downloaded DEB file and open with Software Install][5] - -It will then open the software center and you should see the option to install Chrome now. Click on the install button. - -![Click on the install button][6] - -You’ll be asked to enter your account’s password. This is the same password you use to log into your system. - -![Enter your account’s password][7] - -In less than a minute, Google Chrome will be installed. You should see a remove option now which indicates that the software is installed. - -![Chrome is now installed][8] - -Once Chrome is installed on Debian, search for it in the system menu and start it. - -![Start Google Chrome][9] - -It will ask to be your default browser and send the crash reports to Google. You can uncheck either or both options. And then you can see Google Chrome browser window. - -![][10] - -If you log into your Google account, you should be able to sync your passwords, bookmarks and other browsing data here. Enjoy it! - -Another thing, after installing Chrome, you can delete the downloaded DEB file from your system. It is not needed anymore, not even for uninstalling Chrome. - -### Method 2: Install Google Chrome on Debian from the terminal - -What you just saw above can be easily achieved in the terminal. - -First, make sure that your package cache is refreshed and you have wget installed for [downloading files from the web in the terminal][11]. - -``` -sudo apt update && sudo apt install wget -``` - -The next option is to download the .deb file of Google Chrome: - -``` -wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb -``` - -Once downloaded, you can [install the deb file in the terminal][12] with apt command like this: - -``` -sudo apt install ./google-chrome-stable_current_amd64.deb -``` - -Once the installation completes, you can start using Chrome. - -### Bonus tip: Updating Google Chrome - -Both methods add Google’s repository to your system. You can see it in your sources.lis.d directory: - -``` -cat /etc/apt/sources.list.d/google-chrome.list -``` - -This means that Google Chrome will be updated with other system updates in Debian and Kali Linux. You know [how to update your Kali Linux][13] or Debian system in command line? Just use this command: - -``` -sudo apt update && sudo apt upgrade -y -``` - -### Uninstall Google Chrome from your system - -Even if you chose to install Chrome on Debian using the GUI method, you’ll have to use the terminal to remove it. - -Don’t worry. It’s really just one command: - -``` -sudo apt purge google-chrome-stable -``` - -Enter your account password when asked. Nothing is displayed on the screen when you type the password. That’s okay. Type it and press enter and confirm the deletion. - -![][14] - -Well, that’s about it. I hope you find this tutorial helpful. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-chrome-debian-kali-linux/ - -作者:[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://www.google.com/chrome/ -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/download-chrome-on-debian.webp?resize=800%2C344&ssl=1 -[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/downloading-google-chrome.webp?resize=800%2C512&ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/save-downloaded-chrome-installer-file-debian.webp?resize=800%2C430&ssl=1 -[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/open-deb-file-with-software-install.webp?resize=800%2C419&ssl=1 -[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-chrome-debian.webp?resize=800%2C408&ssl=1 -[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/enter-account-password-while-installing-deb-file.webp?resize=800%2C420&ssl=1 -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/chrome-installed-debian.webp?resize=800%2C384&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-chrome-debian.webp?resize=800%2C276&ssl=1 -[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Chrom-in-Debian.webp?resize=800%2C450&ssl=1 -[11]: https://itsfoss.com/download-files-from-linux-terminal/ -[12]: https://itsfoss.com/install-deb-files-ubuntu/ -[13]: https://linuxhandbook.com/update-kali-linux/ -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp?resize=800%2C450&ssl=1 diff --git a/translated/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md b/translated/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md new file mode 100644 index 0000000000..2b5aae849a --- /dev/null +++ b/translated/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md @@ -0,0 +1,161 @@ +[#]: subject: "How to Install Google Chrome on Debian and Kali Linux" +[#]: via: "https://itsfoss.com/install-chrome-debian-kali-linux/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Debian 和 Kali Linux 上安装 Google Chrome +====== + +Debian 和基于 Debian 的 Kali Linux 将 Firefox 作为默认的网络浏览器。但这并不意味着你不能在其中安装其他网络浏览器。 + +Google Chrome 浏览器非常流行,你可能已经在其他系统上使用它了。如果你想在 Debian 上安装 Chrome,你肯定可以这样做。 + +你在 Debian 的软件库中找不到 Google Chrome,因为它不是开源软件,但你可以从 Chrome 网站下载并安装它。 + +在本教程中,我将向你展示在 Debian 上安装 Chrome 的两种方法: + + * GUI 方法 + * 命令行方法 + + + +让我们先从 GUI 方法开始。 + +_**注意:我在这里的例子中使用的是 Debian,但由于 Kali Linux 是基于 Debian 的,所以同样的方法也适用于 Kali Linux。**_ + + +### 方法 1: 在 Debian 上以图形方式安装 Chrome 浏览器 + +这是一个不费吹灰之力的方法。你去 Google Chrome 网站,下载 deb 文件,然后双击它来安装它。我将详细地展示这些步骤,这样你就能很容易地掌握了。 + +前往 Google Chrome 的网站。 + +[Get Google Chrome][1] + +你会看到下载 Google Chrome 的选项。 + +![Click on the Download Chrome button][2] + +当你点击下载按钮时,它会给你两个下载安装文件的选项。选择写着 Debian/Ubuntu 的那个。 + +![Download the Chrome installer file for Debian][3] + +**请注意,谷歌浏览器不适用于 32 位系统。** + +接下来,你应该选择将文件保存到电脑中,而不是在软件中心打开进行安装。这样一来,下载的文件将被保存在下载文件夹中,而不是临时目录中。 + +![Save the downloaded DEB file for Google Chrome][4] + +进入下载文件夹,右击下载的 DEB 文件,选择用 Software Install 打开它。 + +![Right click on the downloaded DEB file and open with Software Install][5] + +它将打开软件中心,你应该看到现在安装 Chrome 浏览器的选项。点击安装按钮。 + +![Click on the install button][6] + +你会被要求输入账户的密码。这是你用来登录系统的同一密码。 + +![Enter your account’s password][7] + +在不到一分钟的时间里,Google Chrome 就会安装完毕。你现在应该看到一个删除选项,这表明软件已经安装完毕。 + +![Chrome is now installed][8] + +当 Chrome 在 Debian 上安装完毕,在系统菜单中搜索它并启动它。 + +![Start Google Chrome][9] + +它将要求成为你的默认浏览器,并将崩溃报告发送给谷歌。你可以取消勾选这两个选项。然后你就可以看到谷歌浏览器的窗口。 + +![][10] + +如果你登录了你的谷歌账户,你应该可以在这里同步你的密码、书签和其他浏览数据。好好享受吧! + +还有一点,安装完 Chrome 后,你可以从系统中删除下载的 DEB 文件。不再需要它了,甚至在卸载 Chrome 时也不需要。 + +### 方法 2:在 Debian 上从终端安装 Google Chrome + +你刚才看到的内容可以在终端中轻松实现。 + +首先,确保你的软件包缓存已经刷新,并且你已经安装了wget,用于[在终端中从网上下载文件][11]。 + +``` +sudo apt update && sudo apt install wget +``` + +接下来是下载 Google Chrome 的 .deb 文件。 + +``` +wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb +``` + +下载后,你可以用 apt 命令[在终端安装 deb 文件][12],像这样: + +``` +sudo apt install ./google-chrome-stable_current_amd64.deb +``` + +安装完成后,你就可以开始使用 Chrome 了。 + +### 额外提示:更新 Google Chrome + +这两种方法都会将谷歌的软件库添加到你的系统中。你可以在你的 sources.lis.d 目录中看到它: + +``` +cat /etc/apt/sources.list.d/google-chrome.list +``` + +这意味着 Google Chrome 将与 Debian 和 Kali Linux 中的其他系统更新一起被更新。你知道[如何在命令行中更新你的 Kali Linux][13] 或 Debian 系统么?只要使用这个命令: + +``` +sudo apt update && sudo apt upgrade -y +``` + +### 从你的系统中卸载 Google Chrome + +即使你选择用 GUI 方法在 Debian 上安装 Chrome,你也必须使用终端来删除它。 + +不要担心。这其实只是一个命令: + +``` +sudo apt purge google-chrome-stable +``` + +根据要求输入你的账户密码。当你输入密码时,屏幕上没有任何显示。这没关系。输入它并按回车键,确认删除。 + +![][14] + +好了,就这些了。我希望你觉得这个教程有帮助。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-chrome-debian-kali-linux/ + +作者:[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://www.google.com/chrome/ +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/download-chrome-on-debian.webp?resize=800%2C344&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/downloading-google-chrome.webp?resize=800%2C512&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/save-downloaded-chrome-installer-file-debian.webp?resize=800%2C430&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/open-deb-file-with-software-install.webp?resize=800%2C419&ssl=1 +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/installing-chrome-debian.webp?resize=800%2C408&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/09/enter-account-password-while-installing-deb-file.webp?resize=800%2C420&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/chrome-installed-debian.webp?resize=800%2C384&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/start-chrome-debian.webp?resize=800%2C276&ssl=1 +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/Chrom-in-Debian.webp?resize=800%2C450&ssl=1 +[11]: https://itsfoss.com/download-files-from-linux-terminal/ +[12]: https://itsfoss.com/install-deb-files-ubuntu/ +[13]: https://linuxhandbook.com/update-kali-linux/ +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/09/remove-google-chrome-ubuntu.webp?resize=800%2C450&ssl=1 From 059de537aa95e47257f346dfd20208358bff9ca1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 15 Oct 2021 08:42:10 +0800 Subject: [PATCH 0713/1588] translating --- sources/tech/20211013 5 markdown editors I recommend trying.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211013 5 markdown editors I recommend trying.md b/sources/tech/20211013 5 markdown editors I recommend trying.md index 275c438515..7ebbe75afe 100644 --- a/sources/tech/20211013 5 markdown editors I recommend trying.md +++ b/sources/tech/20211013 5 markdown editors I recommend trying.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/markdown-editors" [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From a444b08cdd9808edc8f9cb5b06952f3a11901164 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 15 Oct 2021 10:54:08 +0800 Subject: [PATCH 0714/1588] Delete 20211015 .md --- sources/tech/20211015 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20211015 .md diff --git a/sources/tech/20211015 .md b/sources/tech/20211015 .md deleted file mode 100644 index 18be05ead6..0000000000 --- a/sources/tech/20211015 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/10/kde-plasma-5-23-release/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 4297f99bb703e3988fa4d9799a6a68f86b05c9f0 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 15 Oct 2021 11:37:15 +0800 Subject: [PATCH 0715/1588] Delete 20211014 .md --- sources/tech/20211014 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20211014 .md diff --git a/sources/tech/20211014 .md b/sources/tech/20211014 .md deleted file mode 100644 index f1c1150f34..0000000000 --- a/sources/tech/20211014 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/10/wsl-app-why/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 5eea84015fb62541d878e334b5194935f721d715 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 15 Oct 2021 12:05:40 +0800 Subject: [PATCH 0716/1588] PRF&PUB @geekpi https://linux.cn/article-13884-1.html --- ...ur Passwords - Encryption Keys in Linux.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md (82%) diff --git a/translated/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md b/published/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md similarity index 82% rename from translated/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md rename to published/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md index a63a3a6ff8..744568a383 100644 --- a/translated/tech/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md +++ b/published/20211012 Seahorse- Manage Your Passwords - Encryption Keys in Linux.md @@ -3,14 +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-13884-1.html" Seahorse:在 Linux 中管理你的密码和加密密钥 ====== -_***简介:***_ 一个简单的开源密码和加密密钥管理器应用,让我们来探讨一下它的功能和如何安装它。 +![](https://img.linux.net.cn/data/attachment/album/202110/15/120409ltfmw33c5xpw5bcx.jpg) + +> Seahorse 是一个简洁的开源密码和加密密钥管理器,让我们来探讨一下它的功能和如何安装它。 我们经常倾向于忽视许多默认/预装的应用,尤其是在内置了大量工具和实用程序时。 @@ -22,13 +24,13 @@ _***简介:***_ 一个简单的开源密码和加密密钥管理器应用, 主要来说,Seahorse 是一个预装在 GNOME 桌面的应用,并为其量身定做。 -然而,你可以在你选择的任何 Linux 发行版上使用它。它是一个简单而有效的工具,可以在本地管理你的密码和加密密钥/keyring。 +然而,你可以在你选择的任何 Linux 发行版上使用它。它是一个简单而有效的工具,可以在本地管理你的密码和加密密钥/钥匙环。 -如果你是第一次使用,你可能想读一下 [Linux 中 keyring 的概念][2]。 +如果你是第一次使用,你可能想读一下 [Linux 中钥匙环的概念][2]。 如果你不喜欢基于云的密码管理器,Seahorse 可以很好地解决你的要求。尽管它看起来很简单,但有几个基本功能你可能会觉得很有用。 -当然,如果你的优先事项不涉及管理加密密钥(或本地存储),你也应该探索一些[可用于 Linux 的最佳密码管理器][3] 。 +当然,如果你的不太涉及管理加密密钥(或本地存储),你也应该探索一些 [可用于 Linux 的最佳密码管理器][3] 。 ### Seahorse 的特点 @@ -40,7 +42,7 @@ _***简介:***_ 一个简单的开源密码和加密密钥管理器应用, * 能够存储 SSH 密钥(用于访问远程计算机/服务器) * 存储用于保护电子邮件和文件的 GPG 密钥 - * 支持为应用和网络添加密码 keyring + * 支持为应用和网络添加密码钥匙环 * 安全地存储证书的私钥 * 存储一个密码/密语 * 能够导入文件并快速存储它们 @@ -48,8 +50,6 @@ _***简介:***_ 一个简单的开源密码和加密密钥管理器应用, * 同步和发布密钥 * 能够查找/复制 VPN 密码 - - ![][5] ### 在 Linux 中安装 Seahorse @@ -64,7 +64,7 @@ _***简介:***_ 一个简单的开源密码和加密密钥管理器应用, 如果你使用的是 Arch Linux,你也应该在 [AUR][8] 中找到它。 -[Seahorse][9] +- [Seahorse][9] 你对使用 Seahorse 来取代其他密码管理器有何看法?你是否已经用它来管理加密密钥?请在下面的评论中告诉我你的想法。 @@ -75,7 +75,7 @@ via: https://itsfoss.com/seahorse/ 作者:[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 ffbc6db706c2e76e253ef86b7929eab56d1303c5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 15 Oct 2021 12:08:33 +0800 Subject: [PATCH 0717/1588] APL --- ...ase Marks its 25th Anniversary With Exciting Improvements.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md b/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md index 09923e5317..ffe1db625d 100644 --- a/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md +++ b/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/kde-plasma-5-23-release/" [#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 1e3adeeffd9d0cc4d422c6d782c1c76203607d4a Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 15 Oct 2021 13:38:08 +0800 Subject: [PATCH 0718/1588] TSL&PRF --- ... Anniversary With Exciting Improvements.md | 136 ------------------ ... Anniversary With Exciting Improvements.md | 126 ++++++++++++++++ 2 files changed, 126 insertions(+), 136 deletions(-) delete mode 100644 sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md create mode 100644 translated/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md diff --git a/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md b/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md deleted file mode 100644 index ffe1db625d..0000000000 --- a/sources/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md +++ /dev/null @@ -1,136 +0,0 @@ -[#]: subject: "KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements" -[#]: via: "https://news.itsfoss.com/kde-plasma-5-23-release/" -[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements -====== - -For years, KDE Plasma has been among the most-used desktop environments. This is due to its seemingly endless customization options, flashy looks, and feature-filled updates. - -With KDE Plasma 5.23, the desktop environment marks 25 years of work. Hence, this release is also known as Plasma 25th Anniversary Edition. - -It’s just wild to imagine that Matthias Ettrich (founder of KDE) [reached out to a newsgroup][1] back on **October 14, 1996**, to get help from fellow programmers for his “Kool Desktop Environment” project. - -And, look, where we are now… - -In this update, we get to see some significant UI improvements, both within Plasma and third-party apps. - -### KDE Plasma 5.23: What’s New? - -This update brings many improvements, including: - - * Desktop accent colors - * New breeze theme - * New power management quick control - * More customization options for the app launcher - * Hundreds of bugfixes - - - -Here, we will be looking at all these new improvements. - -![][2] - -#### Desktop Accent Colors - -![][3] - -In System Settings, you will find an option to change the accent color of your desktop. You can choose a custom color of your choice or blend in with the theme applied by default. - -#### New Breeze Theme - -![][4] - -This update brings a brand-new Breeze theme: Breeze – Blue Ocean. The default theme has improved over the years, and this time, it focuses on making the visuals clearer and accessible. - -Overall, the new theme provides a glossy look. In addition to the theme, the icons have been made more prominent; a loading gear icon has been added. And, many such subtle differences have made their way to KDE Plasma 5.23 to enhance the look and feel of the desktop. - -As developer Nate Graham said during the beta releases: - -> There is a lot of time left to tweak the final appearance as needed, but overall I think it’s really nice, and I hope you’re as excited about it as I am - -#### Enhanced Search Functionality in System Settings - -To make it easier to find what you’re looking for, KDE Plasma 5.23 has added more combinations of keywords that quickly suggests the related settings you look for using the search bar. - -#### System Tray Improvements - -![][5] - -While the system tray already offers many controls, you get finer options to monitor your connected networks and access the clipboard. - -The system tray has also improved the overall look when displaying the active media being played. - -#### New Power Management Quick Control - -With the release of Linux 5.12, a power management feature was added. Now, KDE has introduced an easy way of adjusting this, which comes in new quick control. - -It has three options: Power Saver, Balanced, and Performance. All it takes is a single click to save the battery and tweak the performance as needed. - -#### Improvements to Application Launcher - -![][6] - -With Plasma 5.21, KDE introduced a new app launcher called Kickoff. While it was generally well-received, some users did complain about the fewer customization options compared to the older launcher. - -Fortunately, Plasma 5.23 fixes this, introducing some brand-new customization options for Kickoff. These include the ability to: - - * Iconify the Power and User controls - * Choose list or grid view for all items, not just the favourites menu - * New keyboard shortcut to quickly focus on the search bar (CTRL+F) - * A new pin button added to the top-right corner to keep the application launcher active - - - -Overall, I expect these new options to be quite popular among users, especially those using KDE, because of its incredible customization options. - -### Other Improvements - -Other usual improvements include: - - * Making Wayland sessions better - * Improved data transparency through the Feedback applicatino - * Performance improvements to KDE’s Discover (app center) - - - -To explore more about the release, you can check out the [official announcement post][7] and its [changelog][8]. - -### Wrapping Up - -While not the biggest release ever, this is a significant release with valuable additions marking its 25th anniversary. As always, you should receive the updates sometime within the next few months, depending on your distribution. - -_What do you think about the improvements with KDE Plasma 5.23? Let me know 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/kde-plasma-5-23-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://groups.google.com/g/de.comp.os.linux.misc/c/SDbiV3Iat_s/m/zv_D_2ctS8sJ?pli=1 -[2]: https://i0.wp.com/i.ytimg.com/vi/RMXViPlehAo/hqdefault.jpg?w=780&ssl=1 -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM3MiIgd2lkdGg9Ijc0MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjMwOCIgd2lkdGg9IjM2OCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2MiIgd2lkdGg9IjQ2NiIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2OCIgd2lkdGg9IjY5OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[7]: https://kde.org/announcements/plasma/5/5.23.0/ -[8]: https://kde.org/announcements/changelogs/plasma/5/5.22.5-5.23.0/ diff --git a/translated/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md b/translated/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md new file mode 100644 index 0000000000..b73844b005 --- /dev/null +++ b/translated/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md @@ -0,0 +1,126 @@ +[#]: subject: "KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements" +[#]: via: "https://news.itsfoss.com/kde-plasma-5-23-release/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +纪念 25 周年:KDE Plasma 5.23 发布 +====== + +![](https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/kde-plasma-5-23-ft.png?w=1200&ssl=1) + +多年来,KDE Plasma 一直是最常用的桌面环境之一。这是因为它似乎有无穷无尽的定制选项、华丽的外观和有料的更新。 + +随着 KDE Plasma 5.23 的发布,这个桌面环境已经工作了 25 年。因此,这个版本也被称为 “Plasma 25 周年版”。 + +让我们回想一下,1996 年 10 月 14 日,KDE 的创始人 Matthias Ettrich [向一个新闻组][1] 发出了呼唤,为他的 “Kool 桌面环境Kool Desktop Environment(KDE)” 项目寻求其他程序员的帮助。 + +而你看,KDE 现在呢? + +在这次更新中,我们可以看到包括 Plasma 内部和第三方应用程序在内的一些重大 UI 改进。 + +### KDE Plasma 5.23: 有什么新东西? + +这次更新带来了许多改进,包括: + + * 桌面重点颜色 + * 新的 Breeze 主题 + * 新的电源管理快速控制 + * 应用程序启动器有更多的自定义选项 + * 数以百计的错误修复 + +在这里,我们将看到所有这些新的改进: + +![视频](https://youtu.be/RMXViPlehAo) + +#### 桌面重点颜色 + +![][3] + +在系统设置中,你会发现有一个可以改变你的桌面重点颜色的选项,你可以选择一个你喜欢的自定义颜色或与默认应用的主题相融合的颜色。 + +#### 新的 Breeze 主题 + +![][4] + +这次更新带来了全新的 Breeze 主题:Breeze - Blue Ocean。默认主题经过多年的改进,这一次,它侧重于使视觉效果更加清晰和易于识别。 + +总的来说,新的主题提供了顺滑的外观。除了主题之外,图标也变得更加突出;增加了一个加载齿轮图标。而且,许许多多这样的细微变化已经进入了 KDE Plasma 5.23,以增强桌面的外观和感觉。 + +正如开发者 Nate Graham 在测试版发布时所说: + +> 还有很多时间可以根据需要调整最终的外观,但总的来说,我认为它真的很棒了,我希望你和我一样喜欢它。 + +#### 系统设置中增强的搜索功能 + +为了更容易找到你要找的东西,KDE Plasma 5.23 增加了更多的关键词组合,以使你使用搜索栏寻找时可以快速提示你相关设置。 + +#### 系统托盘的改进 + +![][5] + +虽然系统托盘已经提供了许多控制,但现在监控你连接的网络以及访问剪贴板有了更精细的选项。 + +系统托盘也改进了显示正在播放的活动媒体时的整体外观。 + +#### 新的电源管理快速控制 + +随着 Linux 5.12 的发布,增加了一个电源管理功能。现在,KDE 引入了一种简单的调整方式,它出现在新的快速控制中。 + +它有三个选项:节电、平衡和性能。只需要一次点击就可以节省电池电力并根据需要调整性能。 + +#### 应用程序启动器的改进 + +![][6] + +在 Plasma 5.21 中,KDE 引入了一个新的应用程序启动器,叫做 Kickoff。虽然它受到了普遍欢迎,但一些用户也抱怨与旧的启动器相比,自定义选项较少。 + +好在 Plasma 5.23 解决了这个问题,为 Kickoff 引入了一些全新的自定义选项。这些选项包括以下能力: + + * 图标化电源和用户控件 + * 所有项目都采用选择列表或网格视图,而不仅仅是收藏夹菜单 + * 新的键盘快捷键 `CTRL+F` 可以快速聚焦到搜索栏 + * 在右上角添加了一个新的按针状按钮,以保持应用程序启动器处于活动状态 + +总的来说,我预计用户会相当受欢迎这些新选项,特别是那些因为它有如此之多的定制选项而使用 KDE 的用户。 + +### 其他改进措施 + +其他的常规改进包括: + + * 优化了 Wayland 会话 + * 通过“反馈”程序提高了数据透明度 + * 改进了 KDE 的 Discover(应用中心)的性能 + +要探索更多关于该版本的信息,你可以查看 [官方公告][7] 及其 [更新日志][8]。 + +### 总结 + +虽然不是有史以来最大的版本,但这是一个重要的版本,具有纪念其 25 周年的宝贵补充。像往常一样,你应该在未来几个月内的某个时候收到更新,这取决于你的发行版。 + +你对 KDE Plasma 5.23 的改进有什么看法?请在下面的评论中告诉我。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/kde-plasma-5-23-release/ + +作者:[Jacob Crume][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/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://groups.google.com/g/de.comp.os.linux.misc/c/SDbiV3Iat_s/m/zv_D_2ctS8sJ?pli=1 +[2]: https://i0.wp.com/i.ytimg.com/vi/RMXViPlehAo/hqdefault.jpg?w=780&ssl=1 +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/system-settings-accent-colour.png?w=743&ssl=1 +[4]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/breeze-application-style.png?w=368&ssl=1 +[5]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/plasma-nm.png?w=466&ssl=1 +[6]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/kickoff.png?w=699&ssl=1 +[7]: https://kde.org/announcements/plasma/5/5.23.0/ +[8]: https://kde.org/announcements/changelogs/plasma/5/5.22.5-5.23.0/ From 5c908a8b5b8a3eaecca535d4b9b01878bcca96c0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 15 Oct 2021 13:42:41 +0800 Subject: [PATCH 0719/1588] PUB @wxy https://linux.cn/article-13885-1.html --- ...e Marks its 25th Anniversary With Exciting Improvements.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md (98%) diff --git a/translated/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md b/published/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md similarity index 98% rename from translated/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md rename to published/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md index b73844b005..d8df723097 100644 --- a/translated/news/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md +++ b/published/20211014 KDE Plasma 5.23 Release Marks its 25th Anniversary With Exciting Improvements.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13885-1.html" 纪念 25 周年:KDE Plasma 5.23 发布 ====== From 95be2e7591fbf56ea6b3c2f8f9071e39ffb67fa9 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Fri, 15 Oct 2021 17:30:11 +0800 Subject: [PATCH 0720/1588] translating by unigeorge --- ...1014 5 common bugs in C programming and how to fix them.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20211014 5 common bugs in C programming and how to fix them.md b/sources/tech/20211014 5 common bugs in C programming and how to fix them.md index da8700c22a..c5abbb2755 100644 --- a/sources/tech/20211014 5 common bugs in C programming and how to fix them.md +++ b/sources/tech/20211014 5 common bugs in C programming and how to fix them.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/programming-bugs" [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -396,7 +396,7 @@ via: https://opensource.com/article/21/10/programming-bugs 作者:[Jim Hall][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 9c96d0b66874847091b89ed4fc618616286ce3f6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 16 Oct 2021 05:02:34 +0800 Subject: [PATCH 0721/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211015?= =?UTF-8?q?=203=20ways=20to=20manage=20RPG=20character=20sheets=20with=20o?= =?UTF-8?q?pen=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211015 3 ways to manage RPG character sheets with open source.md --- ...e RPG character sheets with open source.md | 250 ++++++++++++++++++ 1 file changed, 250 insertions(+) create mode 100644 sources/tech/20211015 3 ways to manage RPG character sheets with open source.md diff --git a/sources/tech/20211015 3 ways to manage RPG character sheets with open source.md b/sources/tech/20211015 3 ways to manage RPG character sheets with open source.md new file mode 100644 index 0000000000..180dcf11cf --- /dev/null +++ b/sources/tech/20211015 3 ways to manage RPG character sheets with open source.md @@ -0,0 +1,250 @@ +[#]: subject: "3 ways to manage RPG character sheets with open source" +[#]: via: "https://opensource.com/article/21/10/manage-rpg-character-sheets" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 ways to manage RPG character sheets with open source +====== +Learn about two terminal commands and a desktop application. +![Dice on a keyboard][1] + +It's that time of year again for gamers everywhere. + +Tomorrow is [Free RPG Day][2], a day when publishers across the tabletop role-playing game industry release games for players both new and experienced, and they're all completely free. Although Free RPG Day was canceled in 2020, it's back this year as a live event with some virtual support by way of free RPG sampler downloads from [Dungeon Crawl Classics][3] and [Paizo][4]. And if the event's virtual offerings aren't enough, you might check out my list of [open source tabletop RPGs.][5] + +Over the past two years, like most people, I've been playing my tabletop games online. I use [open source video conferencing][6] and some [shared mapping software][7]. Don't get me wrong: I love my pen and paper for analog games. To this day, I rarely leave home without my 2E5 quad book so I can sketch out dungeon maps on the go. But I find my computer desk gets pretty cluttered between RPG sourcebooks, splat books, random tables, dice tower, dice, and character sheets. To clear some space, I've recently adopted a digital system for my character sheets, for both my player characters and non-player characters when I DM. + +### Digital character sheets + +Typically, a character sheet is filled out in pencil on old-fashioned physical paper. It's a time-honored tradition that I've done since the late '80s, and even more experienced players have been doing since the late '70s. Going digital can be a big step away from something that might feel like an intrinsic part of the game. I sympathize with that sentiment, and I don't take my digital character sheets lightly. + +When I decide to maintain a character with the aid of a computer, I insist on substantial benefit for my divergence. I've tried two different options for digital character sheets, and one of my players invented a third. They're all open source, and I believe they each have unique advantages that make them worth trying out. + +### pc + +The `pc` command reads character data as an INI file, then lets you query it by category or by attribute. The format is relatively flexible, making it suitable for most RPG systems, whether you play D&D, Swords & Wizardry, Pathfinder, Starfinder, Stardrifter, or something else. + +The syntax for an INI file is so simple that it's almost intuitive. Each heading is enclosed in brackets, and each stat is a key and value pair. + +Here's a small sample: + + +``` +[Character] +Name=Skullerix +Level=5 +Class=Fighter +Ancestry=Human + +[Health] +AC=14 +HP=43 +Max=66 +``` + +The limitation to this format is that you can't have single-value attributes. That means that if you want to list attributes that get a proficiency bonus in D&D 5th Edition, you can't just list the attributes: + + +``` +[Save] +DEX +INT +``` + +Instead, you must force them to be a pair. + +In D&D 5e, it's easy to come up with a value. These saving throws are highlighted only because your proficiency bonus applies to them, so I just make a note of the character's current bonus: + + +``` +[Save] +DEX=3 +INT=3 +``` + +In other systems, there may be attributes that simply don't have a value and really are meant just to be listed. In that case, you can either set a value to itself or to `True`: + + +``` +[Save] +DEX=DEX +INT=True +``` + +Once you've entered your character's data into the INI format, you can query it with the `pc` command. The command requires the `--character` or `-c option` along with the character sheet file you want to query. With no further arguments, you get a listing of the entire character sheet. + +Add a heading name to view all stats within one category: + + +``` +$ pc -c skullerix.ini Character +Character: +Name: Skullerix +Level: 5 +Class: Fighter +Ancestry: Human +``` + +Provide a heading name plus a key name to view the value of a specific stat: + + +``` +$ pc -c skullerix.ini Character Level +Level: 5 +``` + +If you're like me and play lots of games, you can keep all of your characters in the default location `~/.local/share/pc,` then query them without the path or file extension. + +For instance, say you have `froese.ini, kitaro.ini`, and `wendy.ini<` in `~/.local/share/pc`: + + +``` +$ pc -c kitaro Character Class +Class: Wizard +$ pc -c wendy Health AC +23 +$ pc -c froese Save INT +3 +``` + +To see the characters in your default folder, use the `--list` or `-l` option: + + +``` +$ pc --list +froese.ini +kitaro.ini +wendy.ini +``` + +The pc project is written in Lua and is available from its [Gitlab repository][8]. + +### PCGen + +PCGen is an application designed to help you build and maintain characters. It even has knowledge of the rules of the system it's assisting you with. Far from just a configuration file generator, PCGen is a database of open source rules and how they relate to one another over the course of a character's life. + +PCGen can build characters for D&D 5e, Pathfinder 1e, Starfinder, and Fantasy Craft. When you first launch PCGen, you can download rule definitions for each game. The files are small, but depending on what you want to install, there can be a lot of files to download. + +You only have to do it once, though, and PCGen tends to everything else but clicking the button to start the download for each system. + +Once you have everything downloaded, you can start creating characters by selecting **New** from the **File** menu. + +PCGen keeps track of incomplete tasks in the panel labeled **Things to be done**, and it helps you proceed through the process of satisfying each requirement until you've got a complete character. + +![PCGen dashboard showing a character summary][9] + +(Seth Kenlon, CC BY-SA 4.0) + +PCGen does all calculations for you, so you don't have to figure out your skill ranks, how a proficiency bonus affects your rolls, and other computations. Better yet, you don't have to calculate how your scores change as you level up or even what benefits you get with each new level. You'll have choices to make at each level, but you don't have to flip through your rulebook in hopes you're not missing anything significant. + +One of my favorite things about PCGen is its ability to render your character sheet when finished. + +On paper, your eyes probably know exactly where to look to find your proficiency bonus, or skill ranks, or other character stats. In some formats, you lose that when you go digital. PCGen has a built-in renderer and can show you your character in standard character sheet layouts that an experienced player will likely find familiar. + +![A traditional-looking RPG character sheet rendered by PC Gen][10] + +(Seth Kenlon, CC BY-SA 4.0) + +PCGen is an ENnie award winner, and it's well deserved. Maintaining a character is easy with PCGen, and it's an application I find myself opening on lazy afternoons just for the fun of building something new. + + * On Linux, download PCGen's universal installer from [pcgen.org.][11] You must have [Java installed][12].) Run `pcgen.sh` to launch the application. + * On macOS, download PCGen's universal installer from [pcgen.org][11]. You must have [Java installed][13].) Run `pcgen.sh` to launch the application. + * On Windows, download PCGen's Windows installer from [pcgen.org][11]. You must also [install Java][14]. + + + +### Player character XML + +One of the advantages of using a terminal command to query character sheets is that you gain independence from the layout. + +Playing several game systems can be taxing, because nearly every system has its own layout. With a terminal command, however, instead of looking over sheets of paper for data, you look up the same information quickly by letting your computer do the scanning. + +One of the projects I've been enjoying lately for character tracking is the d project, which uses XML to express character stats and the `xmllint` command to query it. The d project features a few utilities: + + * `d` command rolls dice (include FUDGE die). + * `v` command queries character sheets. + * The `e` command initializes your home directory by placing files in predictable locations. + + + +Because [XML is so flexible][15], this format allows you to devise your own schema, depending on what works best for your system. + +For example, a class-based system like D&D or Pathfinder may benefit from a section for special class features, while a skill-based system might have a simple schema with no categories. + +Here's a simple example: + + +``` +<char> +  <name>Robin Hood</name> +  <health>20</health> +  <acrobat>5</acrobat> +  <archery>8</archery> +  <disguise>3</disguise> +</char> +``` + +First, export the location of the character sheet: + + +``` +`$ export CHAR_SHEET=~/.config/char/robin.xml` +``` + +Alternately, you can initialize your home directory with the `e` command, which creates the `~/.config/char` directory and defines the `CHAR_SHEET` variable in your `.bashrc` file: + + +``` +`$ e init` +``` + +After you've got your environment configured, you can query your character sheet: + + +``` +$ ./v char.name +<name>Robin Hood</name> +$ ./v char.archery +<archery>7</archery> +``` + +Functionally, `v` is similar to the `pc` script, but because it uses XML, there are a lot of possibilities for how you view it. With XSL, you could style your XML-based character sheet and give it a layout for users who aren't comfortable in the terminal but still retain the XML source for those who are. + +### Open source at the open table + +Whether you're looking for a complex application like PCGen to guide you through character creation or simple utilities like pc or d to quickly query character stats, open source has plenty of options for you. + +And the choice of tooling is precisely what makes it such a pleasure to do your analog game in a digital remote setting. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/manage-rpg-character-sheets + +作者:[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/dice-keys_0.jpg?itok=PGEs3ZXa (Dice on a keyboard) +[2]: https://www.freerpgday.com/ +[3]: https://goodman-games.com/blog/2021/10/06/pdf-previews-of-our-free-rpg-day-releases/ +[4]: https://paizo.com/community/blog/v5748dyo6shte +[5]: https://opensource.com/article/20/7/free-rpg-day +[6]: https://opensource.com/article/21/9/alternatives-zoom +[7]: https://opensource.com/article/19/6/how-use-maptools +[8]: https://gitlab.com/slackermedia/pc +[9]: https://opensource.com/sites/default/files/uploads/pcgen-build.png (Character building with PCGEN) +[10]: https://opensource.com/sites/default/files/uploads/pcgen-render.png (rendered character sheet) +[11]: http://pcgen.org/download/ +[12]: https://opensource.com/article/19/11/install-java-linux +[13]: https://opensource.com/article/20/7/install-java-mac +[14]: https://access.redhat.com/documentation/pt-br/openjdk/11/html-single/installing_and_using_openjdk_11_for_windows/index +[15]: https://opensource.com/article/21/7/what-xml From 982021aa8a5dec1d6a4bd748da95de428bd7a283 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 16 Oct 2021 05:02:50 +0800 Subject: [PATCH 0722/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211015?= =?UTF-8?q?=20Reach=20your=20open=20source=20community=20with=20content=20?= =?UTF-8?q?marketing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211015 Reach your open source community with content marketing.md --- ...source community with content marketing.md | 88 +++++++++++++++++++ 1 file changed, 88 insertions(+) create mode 100644 sources/tech/20211015 Reach your open source community with content marketing.md diff --git a/sources/tech/20211015 Reach your open source community with content marketing.md b/sources/tech/20211015 Reach your open source community with content marketing.md new file mode 100644 index 0000000000..a015772be1 --- /dev/null +++ b/sources/tech/20211015 Reach your open source community with content marketing.md @@ -0,0 +1,88 @@ +[#]: subject: "Reach your open source community with content marketing" +[#]: via: "https://opensource.com/article/21/10/content-marketing-open-source-community" +[#]: author: "Will Kelly https://opensource.com/users/willkelly" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Reach your open source community with content marketing +====== +Technology and content marketing teams can work together to reach the +community around an open source software project. +![people in different locations who are part of the same team][1] + +Both startups and more established firms are increasingly turning to content marketing as a way of reaching prospective customers. + +However, corporate marketers often consider the open source software (OSS) community a challenge to reach. This article features ways your technology and content marketing teams can work together to target and reach the community around an OSS project your organization supports. + +### Content marketing: a definition + +You can find multiple definitions of content marketing online. For this article, I define content marketing as the creation and sharing of online content, such as blog posts, white papers, videos, and social media posts. This content doesn't explicitly promote a brand or products, but it is still designed to gain the attention of prospective buyers for a company's products and solutions. + +Content marketing and [thought leadership][2] have become intertwined, which you can use to your advantage by taking content marketing targeting other audiences and repurposing it for the OSS community. Publish content to your OSS community that helps the community around your OSS project. Think of tutorials, code snippets, and other content that can help your OSS users become more effective. + +Software vendors can also be thought leaders through content marketing. Enterprises are seeking solutions for their technology, digital transformation, and other challenges. While there are paid media publishers doing excellent work, there's always more work to be done. Vendor-sponsored content can be a valuable source of information. + +### Content marketing in an OSS world + +Vendors with open source and enterprise products need to approach content marketing for open source users, focusing on the values and development practices of the open source community. + +#### Treat content as another contribution to the open source community + +Content plays a vital role in the open source community. Your content can serve as another contribution to the open source communities you serve as long as you focus on the key elements: + + * Ensuring your content has technical depth + * Excluding anything sales from your content such as pricing or information about how to upgrade to the enterprise version of your software + * Keeping marketing of your enterprise's products out of your content such as talk of a feature that’s only in your enterprise version but not your OSS + + + +Your content marketing to the open source community shouldn't be about driving sales. Instead, think about contributing to the community you want to build around your open source software. If you're treating your blog posts and white papers as vendor agnostic, with a focus on education and outreach, you've already taken a step towards content marketing suited to an open source community. + +#### Partner your marketing team with open source advocates + +Marketing teams may not be familiar with the ways of the open source community. If that's the case in your organization, consider partnering your content marketing manager with your open source advocates. Partnering could take a few forms: + + * Partner your content marketing manager with your developer relations team + * Join your content marketing with your [open source program office][3] efforts + * Involve your in-house open source developers with your content marketing projects as content creators and technical reviewers + + + +Open source is about community. Partnering your content marketing with employees already active in OSS gives your content marketing manager an entry into the community. While you can't expect your marketing team to be OSS advocates, you can set expectations for them to learn firsthand about the community in much the same way they learned about the industry. + +#### Create open source personas and messaging + +While personas and messaging remain challenges for some software vendors, publishing content to an open source community means reaching a new audience. You need to create new open source personas and messaging to go along with your marketing team's other personas and messaging. + +To get open source messaging right, you need to involve your in-house open source advocates and SMEs in the ideation and creation of the messaging. Avoid outsourcing these crucial steps to a third-party marketing consultant. People who work directly with your open source community are the best resources to understand the audience and what messages may resonate with them. Open source experts tapped to help with corporate messaging should be prepared to educate their marketing colleagues in the [open source ethos.][4] + +#### Keep listening and iterating + +Content marketing to your open source community shouldn't be a one-time effort. Blogging is an ideal content marketing channel for the open source community for this reason. Take the time to listen to what's going on in your OSS community and what they still need to learn about your open source offerings. A straightforward way to do this is to have your content marketing manager or other marketing representation join your online community. + +Iteration is a necessity with content marketing to the OSS community. In particular, take time to police your content drafts for anything that sounds like selling. Don’t forget to update your police your messaging, blogs, and blog calendar for selling too. Consider segmenting your blog’s OSS content in it’s own category if you haven’t done so already.** ** + +### Last thoughts + +Content marketing to an open source community requires becoming an educator and thought leader delivering content that contributes to your open source users' experiences and product journey. While your salespeople will be looking for customer conversions through your open source content marketing (and they should be!), keep your focus on community content and collaboration. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/content-marketing-open-source-community + +作者:[Will Kelly][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/willkelly +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/connection_people_team_collaboration.png?itok=0_vQT8xV (people in different locations who are part of the same team) +[2]: https://thoughtleadershiplab.com/what-is-a-thought-leader/ +[3]: https://opensource.com/article/20/5/open-source-program-office +[4]: https://www.agrowingculture.org/open-source-ethos/ From 21649478140d6ebb8dbfd65eb248ce85f6960595 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sat, 16 Oct 2021 08:25:23 +0800 Subject: [PATCH 0723/1588] Rename sources/tech/20211015 Reach your open source community with content marketing.md to sources/talk/20211015 Reach your open source community with content marketing.md --- ...015 Reach your open source community with content marketing.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20211015 Reach your open source community with content marketing.md (100%) diff --git a/sources/tech/20211015 Reach your open source community with content marketing.md b/sources/talk/20211015 Reach your open source community with content marketing.md similarity index 100% rename from sources/tech/20211015 Reach your open source community with content marketing.md rename to sources/talk/20211015 Reach your open source community with content marketing.md From e0e8f5ac697c4ce8267480658b0736db4b5c6f78 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 16 Oct 2021 08:37:03 +0800 Subject: [PATCH 0724/1588] APL --- ...inally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md b/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md index bb9eb8a0fc..45c205c83e 100644 --- a/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md +++ b/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/ubuntu-21-10-release/" [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 06d9a0c42580f9ee1f90962a9bf185b4a11332ce Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 16 Oct 2021 09:31:06 +0800 Subject: [PATCH 0725/1588] Update 20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md --- ...rce Changed Linux Otherwise It Was Done- Linus Torvalds.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md b/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md index 2f3d727a51..86785b2163 100644 --- a/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md +++ b/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/open-source-changed-linux-torvalds/" [#]: author: "Abhishek https://news.itsfoss.com/author/root/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "zd200572" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -48,7 +48,7 @@ via: https://news.itsfoss.com/open-source-changed-linux-torvalds/ 作者:[Abhishek][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[zd200572](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 2caf35241e6541e610e5cfdca47fdc38672dbdce Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 16 Oct 2021 10:01:06 +0800 Subject: [PATCH 0726/1588] TSL&PRF --- ...Much Awaited GNOME 40 With Ubuntu Twist.md | 140 ------------------ ...Much Awaited GNOME 40 With Ubuntu Twist.md | 135 +++++++++++++++++ 2 files changed, 135 insertions(+), 140 deletions(-) delete mode 100644 sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md create mode 100644 translated/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md diff --git a/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md b/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md deleted file mode 100644 index 45c205c83e..0000000000 --- a/sources/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md +++ /dev/null @@ -1,140 +0,0 @@ -[#]: subject: "Ubuntu 21.10 is Available Now! Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist" -[#]: via: "https://news.itsfoss.com/ubuntu-21-10-release/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Ubuntu 21.10 is Available Now! Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist -====== - -Ubuntu 21.10 is the last non-LTS release before the next big LTS update. Codenamed, Impish Indri, Ubuntu 21.10 will be supported for **nine months until July 2022**. - -Unless you want to try the latest and greatest features, you should stick to Ubuntu 20.04 LTS and wait for Ubuntu 22.04 LTS. - -Now that you can download and install Ubuntu 21.10 on your systems, let me highlight a few things about this update. - -### Ubuntu 21.10 “Impish Indri”: What’s New? - -![][1] - -Ubuntu 21.10 comes baked with several significant changes. Some of the most impactful improvements include: - - * New installer - * Addition of GNOME 40 - * Ditching the mixed theme and opting for light/dark theming - * Including Linux Kernel 5.13 - * Inclusion of PulseAudio 15 with Bluetooth LDAC support - * Wayland session with Nvidia proprietary driver - - - -GNOME 40 can be a refreshing change with Ubuntu but you can only tell that after you experience it. To give you a quick idea, here’s what you can expect with all the changes included in this release. - -### Refreshed Installer - -![][2] - -While Ubuntu’s installer was easy to use and newbie-friendly, Canonical wants to take it up a notch by giving the installer a visual and technical overhaul. - -The dev team utilizes Flutter to make the installer consistent across all other Ubuntu flavors and system configurations. - -![][3] - -### GNOME 40 - -![][1] - -Ubuntu’s desktop experience blends in with GNOME 40 without offering any confusing layouts. The dock remains and the horizontal activity overview works seamlessly with that. - -Of course, all the improvements in [GNOME 40][4] like core app updates, workspace changes, and more carry over to Ubuntu 21.10 with a few teaks from Canonical. - -Personally, I didn’t like the workflow with GNOME 40, but you may want to take it up for a spin. - -### Changes in Theme - -![][5] - -I like the improved color scheme that aims to blend in better with Canonical’s branding for Ubuntu. - -However, the mixed (Standard) theme was a bit problematic when it came to being consistent with applications and overall theme selection. - -Going forward with Ubuntu 21.10, you will only notice a dark and light theme while the light being the default choice out-of-the-box. If you’re curious, you can read our [past coverage to know more about this change][6]. - -### Linux Kernel 5.13 - -The addition of Linux Kernel 5.13 adds support for future Intel and AMD chips along with initial Apple M1 support. - -You can explore more about [Linux Kernel 5.13][7] but overall, it should give you way better hardware compatibility. - -### PulseAudio 15 With Bluetooth LDAC Support - -Considering that more Bluetooth headphones now support LDAC, you get to utilize the capability when using Ubuntu 21.10 on your desktop. - -Fret not, if you do not want to try a non-LTS release, Ubuntu 22.04 LTS will include the same improvement. So, you will have to be patient till next year to make use of that. - -In addition to that, PulseAudio 15 brings in a range of improvements, you can refer to its [official changelog to know more about that.][8] - -### Wayland Session with NVIDIA Proprietary Driver - -Now, even if you use the proprietary NVIDIA drivers, you will be able to switch to a Wayland session if you need it. - -### Other Changes in Ubuntu 21.10 - -![][9] - -Ubuntu 21.10 release brings in a host of quality changes to its cloud images, Raspberry Pi support, and security as well. - -Some of those notable changes include: - - * [Including Firefox as a Snap by default][10] - * Package updates to LibreOffice, Thunderbird - * Ubuntu server improvements - * New PHP default to 8.0.8 - - - -If you want to explore all the technical details, you might want to refer to the [official release notes][11]. - -### Download and Upgrade to Ubuntu 21.10 - -You can opt for a fresh installation or [upgrade from Ubuntu][12] 21.04 to Ubuntu 21.10 using the software updater. - -Do note that if you are using Ubuntu 20.04 LTS, it is recommended to wait for the next LTS release, unless you know what you are doing. - -[Download Ubuntu 21.10][13] - -#### 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/ubuntu-21-10-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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4NiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjYwMCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://news.itsfoss.com/gnome-40-release/ -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://news.itsfoss.com/ubuntu-21-10-theme-change/ -[7]: https://news.itsfoss.com/linux-kernel-5-13-release/ -[8]: https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/15.0/ -[9]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU1MiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[10]: https://news.itsfoss.com/ubuntu-firefox-snap-default/ -[11]: https://discourse.ubuntu.com/t/impish-indri-release-notes/21951 -[12]: https://itsfoss.com/upgrade-ubuntu-to-newer-version/ -[13]: https://releases.ubuntu.com/21.10/ diff --git a/translated/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md b/translated/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md new file mode 100644 index 0000000000..fce816f77e --- /dev/null +++ b/translated/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md @@ -0,0 +1,135 @@ +[#]: subject: "Ubuntu 21.10 is Available Now! Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist" +[#]: via: "https://news.itsfoss.com/ubuntu-21-10-release/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +Ubuntu 21.10 版现已发布!终于带来了 Ubuntu 特色的 GNOME 40 +====== + +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-release-date.png?w=1200&ssl=1) + +> Ubuntu 21.10 是一个激动人心的版本,包含了 GNOME 40 和几个显著的变化。准备已经驶向了 Ubuntu 22.04 LTS 吗? + +Ubuntu 21.10 是下一个大型 LTS 更新之前的最后一个非 LTS 版本。代号为 Impish Indri 的 Ubuntu 21.10 将被支持**九个月,直到 2022 年 7 月**。 + +除非你想尝试最新和最棒的功能,否则你应该坚持使用 Ubuntu 20.04 LTS 并等待 Ubuntu 22.04 LTS。 + +现在你可以下载 Ubuntu 21.10 并在你的系统上安装,让我重点介绍一下这次更新的几个亮点。 + +### Ubuntu 21.10 “Impish Indri” 有何新变化? + +![][1] + +Ubuntu 21.10 出炉时有几个重大变化。一些最有影响的改进包括: + + * 新的安装程序 + * 增加了 GNOME 40 + * 抛弃了混合主题,选择了浅色/深色主题 + * 包括 Linux 内核 5.13 + * 加入了支持蓝牙 LDAC 的 PulseAudio 15 + * 带有 Nvidia 专有驱动程序的 Wayland 会话 + +GNOME 40 可以说是 Ubuntu 中令人耳目一新的变化,但你只有在体验之后才能知道。为了让你快速感受一下,下面是这个版本中你可以期待的所有变化。 + +#### 粉饰一新的安装程序 + +![][2] + +虽然 Ubuntu 的安装程序很容易使用,对新手也很友好,但 Canonical 希望通过对安装程序进行视觉和技术上的改造,使其更上一层楼。 + +开发团队利用 Flutter 使安装程序在所有其他 Ubuntu 口味和系统配置中保持一致。 + +![][3] + +#### GNOME 40 + +![][5] + +Ubuntu 的桌面体验与 GNOME 40 融为一体,没有提供任何混乱的布局。停靠区依然存在,水平活动概览也与之无缝衔接。 + +当然,[GNOME 40][4] 中的所有改进,如核心应用程序的更新、工作区的改变等等,都会延续到 Ubuntu 21.10 中,只是 Canonical 做了一些改动。 + +就我个人而言,我并不喜欢 GNOME 40 的工作流程,但你可能会想体验一下。 + +#### 主题的变化 + +![][9] + +我喜欢改进后的颜色方案,其目的是为了更好地与 Canonical 的 Ubuntu 品牌相融合。 + +然而,当涉及到与应用程序和整体主题选择的一致性时,混合(标准)主题是有点问题的。 + +在 Ubuntu 21.10 中,你会看到深色和浅色主题,而浅色是开箱即用的默认选择。如果你想进一步了解,你可以阅读我们的 [过去的报道以更多了解这一变化][6]。 + +#### Linux 内核 5.13 + +Linux 内核 5.13 的加入增加了对未来的英特尔和 AMD 芯片的支持,以及对苹果 M1 的初步支持。 + +你可以就一步了解 [Linux 内核 5.13][7] 的信息,但总的来说,它应该给你更好的硬件兼容性。 + +#### PulseAudio 15 支持蓝牙 LDAC + +考虑到现在有更多的蓝牙耳机支持 LDAC,当你在桌面上使用 Ubuntu 21.10 时,你可以利用这一功能。 + +别担心,如果你不想尝试非 LTS 版本,Ubuntu 22.04 LTS 将包括同样的改进。所以,你必须耐心等待,直到明年才能利用这一点。 + +除此之外,PulseAudio 15 还带来了一系列的改进,你可以参考它的 [官方更新日志以了解更多信息][8] 。 + +#### Wayland 会话与 NVIDIA 专有驱动程序 + +现在,即使你使用 NVIDIA 专有的驱动程序,如果你需要也可以切换到 Wayland 会话。 + +#### Ubuntu 21.10 中的其他变化 + +![][14] + +Ubuntu 21.10 版本为其云镜像、树莓派支持和安全性带来了一系列高质量的变化。 + +其中一些值得注意的变化包括: + + * [Firefox 默认采用 Snap][10] + * LibreOffice、Thunderbird 更新 + * Ubuntu Sever 的改进 + * 新的 PHP 默认为 8.0.8 + +如果你想探索所有的技术细节,你可能想参考一下 [官方发布说明][11]。 + +### 下载并升级到 Ubuntu 21.10 + +你可以选择全新安装或使用软件升级器 [从 Ubuntu 21.04 升级][12] 到 Ubuntu 21.10。 + +请注意,如果你正在使用 Ubuntu 20.04 LTS,建议等待下一个 LTS 版本,除非你知道自己在做什么。 + +- [下载Ubuntu 21.10][13] + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/ubuntu-21-10-release/ + +作者:[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/10/ubuntu-21-10-full.png?w=1200&ssl=1 +[2]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/02/new-ubuntu-installer.png?w=1012&ssl=1 +[3]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-new-installer.png?w=960&ssl=1 +[4]: https://news.itsfoss.com/gnome-40-release/ +[5]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-new-gnome-40.png?resize=1568%2C776&ssl=1 +[6]: https://news.itsfoss.com/ubuntu-21-10-theme-change/ +[7]: https://news.itsfoss.com/linux-kernel-5-13-release/ +[8]: https://www.freedesktop.org/wiki/Software/PulseAudio/Notes/15.0/ +[9]: https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-appearance.png?w=1062&ssl=1 +[10]: https://news.itsfoss.com/ubuntu-firefox-snap-default/ +[11]: https://discourse.ubuntu.com/t/impish-indri-release-notes/21951 +[12]: https://itsfoss.com/upgrade-ubuntu-to-newer-version/ +[13]: https://releases.ubuntu.com/21.10/ +[14]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-21-10-about.png?w=1054&ssl=1 \ No newline at end of file From c7a7d176ca45894a89a2b3d4d637128e66867079 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 16 Oct 2021 10:12:42 +0800 Subject: [PATCH 0727/1588] PUB @wxy https://linux.cn/article-13887-1.html --- ...ally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md (98%) diff --git a/translated/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md b/published/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md similarity index 98% rename from translated/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md rename to published/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md index fce816f77e..e211dcafa9 100644 --- a/translated/news/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md +++ b/published/20211014 Ubuntu 21.10 is Available Now- Finally Brings the Much Awaited GNOME 40 With Ubuntu Twist.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13887-1.html" Ubuntu 21.10 版现已发布!终于带来了 Ubuntu 特色的 GNOME 40 ====== From 94630c97eaa7651ed5b78efa4b788bf98b4801e1 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 16 Oct 2021 10:41:30 +0800 Subject: [PATCH 0728/1588] Update 20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md --- ...x Otherwise It Was Done- Linus Torvalds.md | 41 ++++++++++--------- 1 file changed, 22 insertions(+), 19 deletions(-) diff --git a/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md b/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md index 86785b2163..bdce237938 100644 --- a/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md +++ b/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md @@ -2,45 +2,48 @@ [#]: via: "https://news.itsfoss.com/open-source-changed-linux-torvalds/" [#]: author: "Abhishek https://news.itsfoss.com/author/root/" [#]: collector: "lujun9972" -[#]: translator: "zd200572" +[#]: translator: " " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " -Open Source Changed Linux Otherwise It Was Done: Linus Torvalds +开源改变了Linux, 否则它就完了:Linus Torvalds + ====== -You probably already know the story. 30 years ago, Finnish student Linus Torvalds created a UNIX-like operating system as a hobby project. -What you do not know is that Torvalds thought that the hobby project was done, and he would have left it behind to work on some new and interesting project. +你可能已经知道这个故事,30年前,芬兰学生Linus Torvalds创建了一个类UNIX操作系统,作为一个业余项目。 -So, what made his work on this ‘hobby project’ for 30 years? The answer is open source. +你不知道的是,Torvalds认为这个业余项目已经完成,他会把它抛在脑后,他将从事一些新的和有趣的项目。 -### Open source changed Linux -At the recently concluded [Open Source Summit North America event][1], Linus Torvalds shared some insights into the past, present and future of the Linux project. +所以,是什么让他在这个”业余项目"工作了30年呢?答案是开源。 -While remembering the beginning of the project, [Torvalds said][2] that he’d expected to leave behind Linux in a ‘done state’ to work for something new and interesting. +### 开源改变了Linux -> That was clearly then what open source changed. Because suddenly this project — that I probably would’ve left behind, if it was only up to me — I started getting questions about, and eventually patches — that just kept the motivation going. And here we are 30 years later, and it’s still what keeps the motivation going. +在最近结束的[北美开源峰会][1]上,Linus Torvalds分享了一些关于Linux项目过去、现在和未来的见解。 -Torvalds also added that as far as he is concerned, Linux is done for the past 29 years. Every other feature that has been added later is about what other people needed, wanted or were interested in. +当回忆起这个项目的最初情况,[Torvalds说][2]他期望离开Linux这个“完成状态”的项目,去做些新的和更有趣的工作。 -Many developers would relate to this. You work on a project and think that it has reached a ‘done’ state. If the project does not get enough traction, you lose interest to work on it and move to something ‘new and exciting’. The real motivation to continue the project comes from the users and the recognition. -When asked about what they should be doing for the 50th anniversary of Linux, Torvalds said that he doesn’t see himself doing kernel programming at the age of 70. Then he also chipped in that he didn’t imagine himself doing kernel programming at the age of 50 as well and yet he is doing that at present. +> 显然是开源改变了这一切。因为突然这个项目,我可能会留下,如果这仅取决于我,我开始得到问题,最后打补丁,这让我的动力得以继续。现在30年过去了,这仍然是保持动力的原因。 -> “Somehow I don’t see myself doing kernel programming when I’m 70. But on the other hand, I didn’t see myself doing kernel programming when I was 50 either, a few years back. So… we’ll see.” +Torvalds还补充说,就他而言,Linux在过去29年里一直这样做。以后添加的所有其他功能,都是其他人需要、想要或感兴趣的。 + +许多开发人员都会涉及到这一点。你工作在一个“完成”的项目上,如果这个项目没有获得足够的吸引力,你将会失去兴趣去做它,并转移到“新的和更有趣的”东西上。实际上继续这个项目的真正动力来自用户和认可。 + + +当被问及Linux50周年要做些什么时,Torvalds说,他不想看到自己在70岁继续内核编程。他也插话说,他没想到自己在50岁还在从事内核编程,但是他现在正在做。 + + +> ”不知何故,我不能想像我70岁还做内核编程。但是另一方面,几年前,我也不能想到自己50岁还做内核编程,所以。。。我们拭目以待。“ + +听Torvalds谈论Linux总是很可爱的,作为一个热心的Linux用户,有这么多需要学习和联系的东西,对吗? -It is always endearing to listen to Torvalds talking about Linux. So much to learn and to relate as an ardent Linux user, right? _Source: [The News Stack][2]_ -#### 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 -------------------------------------------------------------------------------- @@ -48,7 +51,7 @@ via: https://news.itsfoss.com/open-source-changed-linux-torvalds/ 作者:[Abhishek][a] 选题:[lujun9972][b] -译者:[zd200572](https://github.com/译者ID) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From f6362d0c7a4c38c5542b39d227f9e64b3aba5f12 Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 16 Oct 2021 10:46:20 +0800 Subject: [PATCH 0729/1588] Update 20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md --- ...e Changed Linux Otherwise It Was Done- Linus Torvalds.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md b/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md index bdce237938..d40b3e0010 100644 --- a/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md +++ b/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md @@ -17,7 +17,7 @@ 你不知道的是,Torvalds认为这个业余项目已经完成,他会把它抛在脑后,他将从事一些新的和有趣的项目。 -所以,是什么让他在这个”业余项目"工作了30年呢?答案是开源。 +所以,是什么让他在这个”业余项目"上工作了30年呢?答案是开源。 ### 开源改变了Linux @@ -30,10 +30,10 @@ Torvalds还补充说,就他而言,Linux在过去29年里一直这样做。以后添加的所有其他功能,都是其他人需要、想要或感兴趣的。 -许多开发人员都会涉及到这一点。你工作在一个“完成”的项目上,如果这个项目没有获得足够的吸引力,你将会失去兴趣去做它,并转移到“新的和更有趣的”东西上。实际上继续这个项目的真正动力来自用户和认可。 +许多开发人员都会面临这一点。你工作在一个“完成”的项目上,如果这个项目没有获得足够的吸引力,你将会失去兴趣去做它,并转移到“新的和更有趣的”东西上。实际上继续这个项目的真正动力来自用户和认可。 -当被问及Linux50周年要做些什么时,Torvalds说,他不想看到自己在70岁继续内核编程。他也插话说,他没想到自己在50岁还在从事内核编程,但是他现在正在做。 +当被问及Linux 50周年要做些什么时,Torvalds说,他不想看到自己在70岁继续内核编程。他也插话说,他没想到自己在50岁还在从事内核编程,但是他现在正在做。 > ”不知何故,我不能想像我70岁还做内核编程。但是另一方面,几年前,我也不能想到自己50岁还做内核编程,所以。。。我们拭目以待。“ From d46dffe1500aca5a615b2ef741f10978b8aea30e Mon Sep 17 00:00:00 2001 From: Dong Zhao Date: Sat, 16 Oct 2021 10:47:10 +0800 Subject: [PATCH 0730/1588] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E8=AF=91=E6=96=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 提交译文 --- ... Source Changed Linux Otherwise It Was Done- Linus Torvalds.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename {sources => translated}/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md (100%) diff --git a/sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md b/translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md similarity index 100% rename from sources/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md rename to translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md From d12b97e0707fe597535ecdcb2944514b2f4ee0d0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 16 Oct 2021 11:58:27 +0800 Subject: [PATCH 0731/1588] PRF&PUB @geekpi https://linux.cn/article-13888-1.html --- ...atures of the latest OpenPGP.js version.md | 34 ++++++++++--------- 1 file changed, 18 insertions(+), 16 deletions(-) rename {translated/tech => published}/20211008 3 new features of the latest OpenPGP.js version.md (56%) diff --git a/translated/tech/20211008 3 new features of the latest OpenPGP.js version.md b/published/20211008 3 new features of the latest OpenPGP.js version.md similarity index 56% rename from translated/tech/20211008 3 new features of the latest OpenPGP.js version.md rename to published/20211008 3 new features of the latest OpenPGP.js version.md index 0fc380ce85..6f0e1851a8 100644 --- a/translated/tech/20211008 3 new features of the latest OpenPGP.js version.md +++ b/published/20211008 3 new features of the latest OpenPGP.js version.md @@ -3,44 +3,46 @@ [#]: author: "Daniel Huigens https://opensource.com/users/twiss" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13888-1.html" 最新 OpenPGP.js 版本的 3 个新功能 ====== -OpenPGP.js 是一个实现了 OpenPGP 标准的密码学库,最常用于电子邮件加密。 -![email or newsletters via inbox and browser][1] -[OpenPGP.js][2]是一个实现了 [OpenPGP 标准][3]的密码学库,最常用于电子邮件加密。ProtonMail、Mailvelope 和 FlowCrypt 都使用 OpenPGP.js,这仅仅是其中一些。这意味着 OpenPGP.js 库对数百万用户的信息进行了加密。 +> OpenPGP.js 是一个实现了 OpenPGP 标准的密码学库,最常用于电子邮件加密。 -OpenPGP 标准首次发布于 20 世纪 90 年代,像几乎任何东西一样,需要维护和更新,以保证安全和可用性。该标准的“加密刷新”[正在进行中][4],它增加了现代的加密算法并废除了过时的算法。为了提高可用性,各种电子邮件应用程序现在允许用户无缝加密他们的通信,用户无需管理他们的密钥或他们的联系人的密钥。 +![](https://img.linux.net.cn/data/attachment/album/202110/16/115721k1vi1ekzip1kpqkg.jpg) -OpenPGP.js 于 2014 年首次发布,开始基于一个名为 GPG4Browsers 的早期原型,该原型基于 Herbert Hanewinkel(以及其他贡献者)的几个脚本。OpenPGP.js 的第二个版本于 2016 年发布,完全重新设计,使用 Uint8Arrays 而不是字符串(这大大增加了其性能),并在内部使用现代 ES6 模块而不是 CommonJS 模块。第 3 和第 4 版都是在 2018 年发布的,分别增加了对椭圆曲线加密法(ECC)和流媒体的支持。 +[OpenPGP.js][2] 是一个实现了 [OpenPGP 标准][3] 的密码学库,最常用于电子邮件加密。ProtonMail、Mailvelope 和 FlowCrypt 都使用 OpenPGP.js,这还仅仅是其中一些。也就是说 OpenPGP.js 库对数百万用户的信息进行了加密。 + +OpenPGP 标准首次发布于 20 世纪 90 年代,像几乎任何东西一样,需要维护和更新,以保证安全和可用性。该标准的“加密刷新” [正在进行中][4],它增加了现代的加密算法并废除了过时的算法。为了提高可用性,各种电子邮件应用程序现在允许用户无缝加密他们的通信,用户无需管理他们的密钥或他们的联系人的密钥。 + +OpenPGP.js 于 2014 年首次发布,开始基于一个名为 GPG4Browsers 的早期原型,该原型基于 Herbert Hanewinkel(以及其他贡献者)的几个脚本。OpenPGP.js 的第二个版本于 2016 年发布,完全重新设计,使用 Uint8Arrays 而不是字符串(这大大增加了其性能),并在内部使用现代 ES6 模块而不是 CommonJS 模块。第 3 和第 4 版都是在 2018 年发布的,分别增加了对椭圆曲线加密法(ECC)和流的支持。 我和我的团队继续在 OpenPGP.js 上工作,以确保其发展为一个易于使用的强加密库。 -### 1\. 默认的椭圆曲线加密 +### 1、默认的椭圆曲线加密 在 OpenPGP.js 第 4 版中,生成新密钥时默认使用 RSA。虽然 ECC 更快、更安全,但 Curve25519 还没有在 OpenPGP 规范中得到标准化。加密刷新草案包括了 Curve25519,并且预计它将“按原样”包含在下一版本的 OpenPGP 规范中,因此 OpenPGP.js 第 5 版现在默认使用 ECC 生成密钥。 -### 2\. 只导入你需要的模块 +### 2、只导入你需要的模块 -同样,虽然 OpenPGP.js 内部使用 ES6 模块多年,但第 4 版仍然没有发布一个合适的 ES6 模块。相反,它只发布了一个通用模块定义(UMD)模块,可以在浏览器和 Node.js 上运行。在第 5 版中,这种情况有所改变,为浏览器和 Node.js 发布了单独的模块(包括 ES6 和非 ES6),使库用户更容易在所有平台上导入 OpenPGP.js ,且(当使用 ES6 模块时)只导入他们需要的部分。这在很大程度上是通过将构建系统切换到 [rollup][5] 来实现的。 +同样,虽然 OpenPGP.js 内部使用 ES6 模块多年,但第 4 版仍然没有发布一个合适的 ES6 模块。相反,它只发布了一个通用模块定义Univeral Module Definition(UMD)模块,可以在浏览器和 Node.js 上运行。在第 5 版中,这种情况有所改变,为浏览器和 Node.js 发布了单独的模块(包括 ES6 和非 ES6),使库用户更容易在所有平台上导入 OpenPGP.js ,且(当使用 ES6 模块时)只导入他们需要的部分。这在很大程度上是通过将构建系统切换到 [rollup][5] 来实现的。 -### 3\. 拒绝弱加密技术 +### 3、拒绝弱加密技术 还有许多其他的安全改进。例如,1024 位 RSA 密钥、ElGamal 和 DSA 密钥被认为是不安全的,并被默认拒绝。此外,第 4 版已经默认使用 AES 加密,第 5 版现在完全默认拒绝使用较弱的算法进行加密,即使公钥声称只支持较弱的算法。相反,它假定所有的 OpenPGP 实现都支持 AES(这种情况已经存在很长时间了)。 ### OpenPGP.js 的下一步是什么? -展望未来,有一些安全方面的改进要做。用于识别公钥的密钥指纹仍然使用 SHA-1,尽管在加密技术更新中计划对此进行修复。同时,建议使用不同的方法来确定用于加密的任何公钥的真实性,例如使用提议的[网络密钥目录 (WKD)][6]标准直接从收件人的域中获取整个密钥,这已经由各种[电子邮件提供商][7]实现。WKD 支持内置于 OpenPGP.js 第 4 版,但在第 5 版中是一个单独的模块,以保持主库的精简。 +展望未来,有一些安全方面的改进要做。用于识别公钥的密钥指纹仍然使用 SHA-1,尽管在加密技术更新中计划对此进行修复。同时,建议使用不同的方法来确定用于加密的任何公钥的真实性,例如使用提议的 [网络密钥目录][6]Web Key Directory(WKD)标准直接从收件人的域中获取整个密钥,这已经由各种 [电子邮件提供商][7] 实现。WKD 支持内置于 OpenPGP.js 第 4 版,但在第 5 版中是一个单独的模块,以保持主库的精简。 -同样,当用密码而不是公钥加密信息或文件时(例如:在使用 OpenPGP 进行电子邮件加密时不常见,但在用于加密备份时更常见),密码会使用相对较弱的密钥衍生函数(KDF)转换为对称密钥。因此,建议应用在将用户的密码传递给 OpenPGP.js 之前,先通过一个强大的 KDF,如 [Argon2][8] 或 [scrypt][9]。希望加密技术的刷新会包括这些算法中的一种,以便在未来的 OpenPGP.js 版本中实现。 +同样,当用密码而不是公钥加密信息或文件时(例如:在使用 OpenPGP 进行电子邮件加密时不常见,但在用于加密备份时更常见),密码会使用相对较弱的密钥衍生函数Key Derivation Function(KDF)转换为对称密钥。因此,建议应用在将用户的密码传递给 OpenPGP.js 之前,先通过一个强大的 KDF,如 [Argon2][8] 或 [scrypt][9]。希望加密刷新草案会包括这些算法中的一种,以便在未来的 OpenPGP.js 版本中实现。 ### 如何使用 OpenPGP.js 第 5 版 -不过现在,OpenPGP.js 第 5 版已经[发布][10]到 npm 仓库。如果你喜欢,可以随时试用!欢迎在 GitHub 的[讨论标签][11]中进行反馈。然而,请注意,虽然 OpenPGP.js 是一个通用的加密库,但它的主要使用情况是在需要与 OpenPGP 规范兼容的情况下(例如,在发送或接收 PGP 加密的电子邮件时)。对于其他的使用情况,不同的库可能是一个更合适或性能更好的选择。当然,总的来说,在推广任何加密技术时都要小心。 +不过现在,OpenPGP.js 第 5 版已经 [发布][10] 到 npm 仓库。如果你喜欢,可以随时试用!欢迎在 GitHub 的 [讨论版][11] 中进行反馈。然而,请注意,虽然 OpenPGP.js 是一个通用的加密库,但它的主要使用情况是在需要与 OpenPGP 规范兼容的情况下(例如,在发送或接收 PGP 加密的电子邮件时)。对于其他的使用情况,不同的库可能是一个更合适或性能更好的选择。当然,总的来说,在尝试使用任何加密技术时都要小心。 感谢阅读,这里是保护电子邮件的未来! @@ -51,7 +53,7 @@ via: https://opensource.com/article/21/10/openpgpjs 作者:[Daniel Huigens][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 a1353748cf1cfe86da8515ad007e5bc52500d4fc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 17 Oct 2021 05:02:27 +0800 Subject: [PATCH 0732/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211017?= =?UTF-8?q?=20Visual=20Studio=20Code=20or=20Atom=3F=20Which=20Code=20Edito?= =?UTF-8?q?r=20Should=20You=20Use=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211017 Visual Studio Code or Atom- Which Code Editor Should You Use.md --- ... Atom- Which Code Editor Should You Use.md | 103 ++++++++++++++++++ 1 file changed, 103 insertions(+) create mode 100644 sources/tech/20211017 Visual Studio Code or Atom- Which Code Editor Should You Use.md diff --git a/sources/tech/20211017 Visual Studio Code or Atom- Which Code Editor Should You Use.md b/sources/tech/20211017 Visual Studio Code or Atom- Which Code Editor Should You Use.md new file mode 100644 index 0000000000..988dee27a2 --- /dev/null +++ b/sources/tech/20211017 Visual Studio Code or Atom- Which Code Editor Should You Use.md @@ -0,0 +1,103 @@ +[#]: subject: "Visual Studio Code or Atom? Which Code Editor Should You Use?" +[#]: via: "https://itsfoss.com/visual-studio-code-vs-atom/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Visual Studio Code or Atom? Which Code Editor Should You Use? +====== + +Finding a [good open source code editor][1] is not hard these days, choosing one can be. + +Microsoft’s [Visual Studio Code][2] and GitHub’s [Atom][3] are two of the most popular, feature-rich, IDE-like code editors that have a huge user base and fan following. + +Both VS Code and Atom belong to Microsoft now because Atom’s original developer GitHub is now owned by Microsoft. They have an interesting, modern UI with a pretty looking native dark theme. Both editors use [Electron][4] for the user interface. + +The similarities are plenty and this is why it is easy to get confused between choosing one of them for your coding set up. + +If you cannot make up your mind and want to compare and choose between one VS Code and Atom, this article should help you decide for yourself. + +### Visual Studio Code + +![Visual Studio Code’s User Interface with a busy project interface][5] + +[Visual Studio Code][2] (A.K.A. VS Code) is one of the modern open source code editors. Its user-base explode because of its IDE-like features but still remaining relatively light on resources. + +Visual Studio Code was made by Microsoft and is available on Linux, macOS and Windows. Microsoft released _most_ of the source code of Visual Studio Code on [GitHub][6] under the MIT License on 18th November 2015. + +VS Code developers have done some fantastic optimizations with Electron to make it as lightweight and efficient as possible. And since Electron apps work on a majority of operating systems, users of Linux, macOS and Windows can all benefit from these optimizations. + +[Installing VS Code on Linux][7] is pretty simple too. It is in fact available in the software center of many distributions. + +#### Why you should opt for Visual Studio Code + + * Visual Studio Code is [generally] chosen by folks who want a near-IDE functionality from the start and do not want to fiddle with their code editor. + * Visual Studio Code, even though based on Electron, has very little overhead compared to other Electron apps (GitHub’s Atom). + * More out-of-the-box functionality like Microsoft’s IntelliSense auto-complete, Git integration, Markdown support. + * Plug-ins can only add features, themes and add support for new languages; and this plug-in constraint ensures the editor’s core stays familiar even after adding new plug-ins. + + + +The binary releases [distributed by Microsoft][8] are still proprietary freeware. [VSCodium][9] builds upon the publicly open source code of Visual Studio Code. However, the discussion on VSCodium is beyond the scope of this article, except for considering it as a viable alternative to Visual Studio Code if you want the functionality Visual Studio Code offers, but without any proprietary elements to it. + +### Atom + +![User Interface of the Atom editor][10] + +[GitHub’s Atom][3] is another free and open source code editor available for Linux, macOS and Windows. Atom is a desktop application made with Electron for easy package development using JavaScript. + +Atom’s source code was released under the MIT License [on GitHub][11]. Since Atom is a GitHub product, it has Git Control embedded in it. + +Atom is dubbed as the “hackable text editor for the 21st Century” because of it complete customizability using HTML, CSS and JS. + +Like VS Code, you can easily [install Atom on Linux][12] and other platforms. + +#### Reasons to choose Atom + + * Atom is preferred by people who want a bare-bones editor and want to build upon it because of Atom’s hackable nature. + * In-built Git and complete GitHub integration; not surprising considering it is developed by GitHub + * [Atom’s plug-ins][13] are very easy to search, install and upgrade, from the app itself. + * Plug-ins available for Atom are very extensible, and can end up completely changing the editor’s functionality and end up creating almost a new editor; It truly is “hackable”. + * Atom’s binary releases and its source code are fully open source (unlike Visual Studio Code’s binary releases containing proprietary parts + telemetry). + * You can [turn Atom from a code editor to IDE][14] with smarter context-aware auto-completion, code navigation features, document formatting and more. + + + +### Conclusion + +Both Atom and VS Code are built on Electron. But Microsoft has done more optimization on VS Code to make it as lightweight as possible. + +At this point, VS Code is like Ubuntu, ships with almost everything out of the box. While Atom is like Arch, minimal and extremely hackable (extendable). + +Both, Atom and VS Code technically are under Microsoft and eventually will reach feature parity. Hence, it is best to go with the editor your community (Web dev/Soft dev) leans towards and pave the path ahead. Maybe you end up with Vim! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/visual-studio-code-vs-atom/ + +作者:[Pratham 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://itsfoss.com/author/pratham/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[2]: https://code.visualstudio.com/ +[3]: https://atom.io/ +[4]: https://www.electronjs.org/ +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/04_visual_studio_code.png?resize=800%2C544&ssl=1 +[6]: https://github.com/microsoft/vscode +[7]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[8]: https://code.visualstudio.com/Download +[9]: https://vscodium.com/ +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/05_atom.png?resize=800%2C527&ssl=1 +[11]: https://github.com/atom/atom +[12]: https://itsfoss.com/install-atom-ubuntu/ +[13]: https://itsfoss.com/install-packages-in-atom/ +[14]: https://ide.atom.io/ From bc845a015db60608263e1f6379c0e30048699764 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 17 Oct 2021 05:02:49 +0800 Subject: [PATCH 0733/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211016?= =?UTF-8?q?=205=20open=20source=20tabletop=20RPGs=20you=20should=20try?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211016 5 open source tabletop RPGs you should try.md --- ...pen source tabletop RPGs you should try.md | 122 ++++++++++++++++++ 1 file changed, 122 insertions(+) create mode 100644 sources/tech/20211016 5 open source tabletop RPGs you should try.md diff --git a/sources/tech/20211016 5 open source tabletop RPGs you should try.md b/sources/tech/20211016 5 open source tabletop RPGs you should try.md new file mode 100644 index 0000000000..77d5c6b122 --- /dev/null +++ b/sources/tech/20211016 5 open source tabletop RPGs you should try.md @@ -0,0 +1,122 @@ +[#]: subject: "5 open source tabletop RPGs you should try" +[#]: via: "https://opensource.com/article/21/10/rpg-tabletop-games" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +5 open source tabletop RPGs you should try +====== +Open source games to download for both casual and experienced gamers. +![Gaming on a grid with penguin pawns][1] + +Open source arrived in the pen-and-paper RPG industry back at the turn of the century, when Wizards of the Coast, publisher of [Magic: The Gathering][2] and Dungeons & Dragons, developed the [Open Game License (OGL)][3]. Many publishers have since adopted the OGL themselves or use similar licenses, such as [Creative Commons][4]. + +Today is [Free RPG Day][5]. It's the one day a year you can go to your friendly local game store and pick up, at no cost, a free tabletop role-playing game from some of the biggest publishers in the hobby. If you don't have a local game store or can't get out to a game store, some free RPG sampler downloads are available from [Dungeon Crawl Classics][6] and [Paizo][7]. But not everything for Free RPG Day is available as a download, so I've collected five of my favorite open source tabletop games that you can download and play. + +![OSRIC][8] + +Image ©2021 OSRIC project + +### OSRIC + +The Old School Reference and Index Compilation (OSRIC) project effectively reimplements the rules for the world's first role-playing game: the original edition of Dungeons & Dragons. These are the rules used in the late 1970s to early 1980s, so players can experience role-playing games as they were when they were just getting started. + +There's nothing wrong with the original D&D rules, of course. You can still find copies of the original books on the bookshelves of many gamers (myself included). However, the original rules aren't in print anymore, so they're not easy to obtain, and they certainly aren't being developed or updated to account for omissions. + +The gaming industry has also come a long way since the early '80s. [Instruction books for games][9] used to be written more like encyclopedia entries than entertainment, but OSRIC seeks to bring the fun of the original game to a new generation of gamers, and to gamers looking to return to the glory of gaming days past. Regardless of which category you fit into, OSRIC is worth downloading. + +Get it from [osricrpg.com][10]. + +### Stardrifter + +Not all RPG is high fantasy. + +The Stardrifter project is a rules-light science fiction game that helps your gaming group experience stories in the style of rousing space operas like _Star Trek, The Repairman_ by Harry Harrison, _Foundation_, and _Blake 7_, or tales you might read in _Amazing Stories_ or _Starlog._ + +Character creation is quick, and it's mostly skill-based. It took me a few minutes to roll up a character and a little longer to mull over what kind of background and skillset my character would have. + +The dice system is easy: roll under your attribute score on a d20 for success. The gamemaster doesn't have to set difficulty classes or other thresholds, although situational modifiers can be applied to reflect extreme circumstances (sometimes in your favor, sometimes to your detriment). + +It's an elegant system, and its rulebook is an easy and entertaining read. I especially enjoy the artwork, which consists of scans from classic (now public domain) science fiction comic books. + +But wait, there's more! + +A natural characteristic of many open source RPGs is that they don't feature extensive worldbuilding. Sometimes that's by design because the game intends for the gamemaster to do the worldbuilding, but sometimes it's down to a lack of staffing. Stardrifter, however, is unique because it became an RPG only after it was a series of novels. As a result, there's plenty of worldbuilding already done for the Stardrifter universe. You can start exploring Stardrifter by [downloading the books and short stories][11] in either print or audio form, and you can get a detailed overview of daily life in the Stardrifter universe from the [Voice from the Void][11] podcast. + +The game was developed and released on [GitLab][12], and the whole production studio responsible for this miniature multimedia empire runs on Linux. + +![One-Page Dungeon][13] + +CC BY-SA Keith Indi Salamunia + +### One-Page Dungeon Contest + +Did I mention today is Free RPG Day? + +Well, it's also the reveal of the [One-Page Dungeon Contest][14] winners! The One-Page Dungeon Contest is an annual event in which inventive gamemasters devise a dungeon that fits on one page and submit it for judging. There are officially winners, but really everyone wins, because all submissions are published in a Creative Commons collection that you can download and play through over the course of—probably—years. + +As fun as adventure modules are, many gaming groups actually don't get all the way through a 64- or 250-page adventure. It's often more realistic to aim for just a single dungeon crawl. Play one dungeon every weekend, and one collection of One-Page Dungeon Contest entries will last you at least a full year. + +I love how inventive the One-Page Dungeons are, too. Sure, some are straightforward dungeon delves, and those are welcome stalwarts of each collection, but others are daring and experimental. It makes for an unexpected game every time. The published dungeons tend to be indifferent to system, too, so as long as you're playing a game in which dungeons are an expected story vehicle, you can use these. + +And because it's an annual community project, you can start planning your submission for next year! + +### Dungeon of the Dungeons + +When you have a one-page dungeon, it might be convenient to have a one-page rulebook. + +The [Dungeon of the Dungeons][15] project is _technically_ one page (front and back). It's a Creative Commons-licensed game system based around a mechanic that gives bonuses to players for answering questions relating to their character's motivations. + +For example, if you're playing a Bard and you're taking an action that draws attention to yourself, you add a bonus point to your dice roll. On the other hand, if you're taking an action that does _not_ draw attention to yourself, you gain no bonus point to your roll. + +The result is that players are compelled to roleplay their characters true to their character class. + +Because the class definitions consist of one sentence, it's trivial to invent custom ones between games. With rules as simple as two sparse pages, this is an easy and fun system for a casual game or for new players. + +### FATE + +The [FATE][16] system is a simple and elegant game that relies on a point-buy mechanic enabling players to influence their rolls. Using _Fate points_, players can change the narrative of a game when it matters the most. + +And the narrative is paramount in FATE. It's considered a game system that's light on rules so that players can focus on collaborative storytelling and gaming. + +FATE is licensed under the Creative Commons license, so it's the foundation for many variants. It's been documented in as little as [a single page][17], so there's no excuse not to get started with a FATE game if it sounds like something you'd enjoy. + +### Open gaming + +Open source gaming drives the modern tabletop RPG industry, but open source being what it is, it's also the product of independent creators everywhere. + +Enjoy this year's Free RPG Day with a new game system or a new adventure for a system you already play. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/rpg-tabletop-games + +作者:[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/game_pawn_grid_linux.png?itok=4gERzRkg (Gaming on a grid with penguin pawns) +[2]: https://opensource.com/article/21/9/magic-the-gathering-assistant +[3]: http://www.opengamingfoundation.org/licenses.html +[4]: https://opensource.com/article/20/1/what-creative-commons +[5]: http://freerpgday.com/ +[6]: https://goodman-games.com/blog/2021/10/06/pdf-previews-of-our-free-rpg-day-releases/ +[7]: https://paizo.com/community/blog/v5748dyo6shte +[8]: https://opensource.com/sites/default/files/osric-splash.jpg (OSRIC) +[9]: https://opensource.com/life/16/11/software-documentation-tabletop-gaming +[10]: https://osricrpg.com/get.php +[11]: https://davidcollinsrivera.com/#stardrifter +[12]: https://gitlab.com/x1101/stardrifter-rpg +[13]: https://opensource.com/sites/default/files/keith-indi-salamunia.png (One-Page Dungeon) +[14]: https://www.dungeoncontest.com/ +[15]: https://thedevteam.itch.io/dungeons-of-the-dungeons +[16]: https://www.faterpg.com/licensing/licensing-fate-cc-by/ +[17]: https://zanrick.itch.io/pocket-fate From 99590d265f6ebf827c122079ab5cbaf2c8a89bf0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 17 Oct 2021 05:05:45 +0800 Subject: [PATCH 0734/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211016?= =?UTF-8?q?=20helloSystem,=20the=20Mac-like=20FreeBSD=20OS,=20Takes=20Anot?= =?UTF-8?q?her=20Step=20Towards=20Full=20Release?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md --- ...Takes Another Step Towards Full Release.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md diff --git a/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md b/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md new file mode 100644 index 0000000000..a75704c898 --- /dev/null +++ b/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md @@ -0,0 +1,118 @@ +[#]: subject: "helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release" +[#]: via: "https://news.itsfoss.com/hellosystem-towards-first-release/" +[#]: author: "John Paul Wohlscheid https://news.itsfoss.com/author/john/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release +====== + +Recently, the helloSystem devs released the newest version of their operating system. helloSystem is a newer project that wants to create a simple and easy to use operating system and is based on FreeBSD. Let’s take a look at what that means to you and me. + +### What is helloSystem? + +![helloSystem’s About screen][1] + +Most of you have probably never heard of [helloSystem][2] before. The project was started by the [creator of AppImage][3], [Simon Peter][4], early last year. Simon’s goal is to create a “friendly [Libre Desktop][5] operating system with focus on simplicity, minimalist elegance, and usability”. + +Simon takes inspiration from the simpler operating system of the 80s and 90s, specifically **early MacOS**, specifically [System 1][6]. If you just look at screenshots of the system in action, you may be tempted to say, “I don’t see what the fuss is all about. There are a bunch of Linux distros or themes that look just like MacOS.” + +The project goes beyond merely looking like MacOS, it wants to return to a simpler, easier to use design. According to the [website][7], “helloSystem is a desktop system for creators with a focus on simplicity, elegance, and usability. Its design follows the “Less, but better” philosophy. It is intended as a system for “mere mortals”, welcoming to switchers from the Mac.” You can find out more about Simon’s thoughts on what he plans for helloSystem by watching his presentation at [FOSDEM 21][8]. + +Just like the [suckless project][9], Simon created a list of “[Welcome and unwelcome technologies][10]“. The approved list of technologies include: + + * Qt + * mDNSResponder + * Python + * Go + + + +![helloSystem’s Welcome screen][1] + +The list of “unwelcome technologies” includes stuff that Simon considers “too complex or deemed aesthetically unpleasant”. These include: + + * Touch + * btrfs + * Gnome + * GTK + * Client-side window decorations + * Wayland + * Pipewire + * XDG Desktop spec + * Fonts that are metrically compatible to, but make no attempt at being visually similar to, original typefaces + * Package managers for end-user applications + * Configuration files, IP addresses + * D-Bus + * Security that restricts what the user or applications can do + * polkit + * Caps Lock key + * URIs for local files + + + +![Installing Inkscape on helloSystem][1] + +### How helloSystem Works + +I’d better explain a little about how helloSystem works. Just like MacOS, the desktop has a global menu at the top of the screen and a dock at the bottom. Also like MacOS’s Finder, helloSystem has a file manager (named Filer) that also handles window management. + +In the upper left, you’ll find a “System” menu that you can use to access applications. (You can also type the name of an application in the search box in the upper left corner.) helloSystem only has a couple of basic applications installed out of the box. If you click on an application that is not installed, helloSystem will download and install an AppImage of that application. + +Under the hood, helloSystem is based on FreeBSD 12.2. It has ZFS enable by default. It does not have a passwords or user account system. This doesn’t mean that they are disregarding security. According to the [site][10], “This is NOT to say that Security in general is not important. It is to say that it needs to be implemented in a way that it doesn’t restrict the legitimate user (owner) of the device from truly “owning” the device”. + +### New Features in the Latest Release + +![helloSystem’s Utilities window][1] + +This latest release of helloSystem includes quite a few graphical and minor changes and updates, including: + + * Switched from Openbox to the KWin window manager + * Properly centered window titles + * Windows snap to certain sizes when dragged to the edge of the screen, similar to “Aero Snap” + * Simplified user interface for Desktop Settings; changes are now applied immediately + * Remove tabs in file manager to simplify user interface + * New Battery applet for the Menu to show the battery fill level + * The Trash icon on the Desktop no longer has a “Move to Trash” context menu item + * Animation when minimizing and un-minimizing windows + * Animations on window resize + * Tuned kernel configuration for optimized sound + * Simplified “Get Info” dialog in file manager + + + +You can see the rest of the changes [here][11]. You can also download the latest .iso file from the same link. Give it a try and let us know what you think. + +#### 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/hellosystem-towards-first-release/ + +作者:[John Paul Wohlscheid][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/john/ +[b]: https://github.com/lujun9972 +[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: https://github.com/helloSystem/hello +[3]: https://itsfoss.com/appimage-interview/ +[4]: https://github.com/probonopd +[5]: https://medium.com/@probonopd/bring-back-the-ease-of-80s-and-90s-personal-computing-393738c5e2a1 +[6]: https://github.com/helloSystem/hello/wiki#design-principles +[7]: https://hellosystem.github.io/docs/ +[8]: https://fosdem.org/2021/schedule/event/hello_bsd/ +[9]: https://suckless.org/sucks/ +[10]: https://github.com/helloSystem/hello/wiki/Welcome-and-unwelcome-technologies +[11]: https://github.com/helloSystem/ISO/releases/tag/r0.6.0 From 9899bba93ee97341239f5923254d942cd6c6e8ca Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sun, 17 Oct 2021 05:05:53 +0800 Subject: [PATCH 0735/1588] add done: 20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md --- sources/tech/20211017 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20211017 .md diff --git a/sources/tech/20211017 .md b/sources/tech/20211017 .md new file mode 100644 index 0000000000..95f6fce5ad --- /dev/null +++ b/sources/tech/20211017 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/10/upgrade-ubuntu-21-10-from-21-04/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From f9ce79fec011be33f4254e131fa135fa59252e6c Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Sun, 17 Oct 2021 08:49:53 +0800 Subject: [PATCH 0736/1588] Delete 20211017 .md --- sources/tech/20211017 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20211017 .md diff --git a/sources/tech/20211017 .md b/sources/tech/20211017 .md deleted file mode 100644 index 95f6fce5ad..0000000000 --- a/sources/tech/20211017 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/10/upgrade-ubuntu-21-10-from-21-04/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 3fbd21644e30979128e6a2cae0adfca9e819bed8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 Oct 2021 09:04:52 +0800 Subject: [PATCH 0737/1588] =?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 @silentdawn-zz @zpl1025 @fisherue --- ...urce Game for Linux Adds Switch Support.md | 88 ---------- ...e on Raspberry Pi and Other ARM Devices.md | 79 --------- ...yle Preference, Thanks to elementary OS.md | 79 --------- ...refox Configuration and UI Improvements.md | 93 ----------- ...ow Sports an RTX 3050 Ti and 3K Display.md | 85 ---------- ...Can Consider Linux as a Content Creator.md | 151 ------------------ ...vices- Monitoring Files and Directories.md | 2 +- ...evelop GUI apps using Flutter on Fedora.md | 2 +- ...ide to the Linux terminal for beginners.md | 7 +- ... Print from anywhere with CUPS on Linux.md | 4 +- 10 files changed, 7 insertions(+), 583 deletions(-) delete mode 100644 sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md delete mode 100644 sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md delete mode 100644 sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md delete mode 100644 sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md delete mode 100644 sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md delete mode 100644 sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md diff --git a/sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md b/sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md deleted file mode 100644 index a953f29b63..0000000000 --- a/sources/news/20210929 SuperTuxKart 1.3 Release- Open Source Game for Linux Adds Switch Support.md +++ /dev/null @@ -1,88 +0,0 @@ -[#]: subject: "SuperTuxKart 1.3 Release: Open Source Game for Linux Adds Switch Support" -[#]: via: "https://news.itsfoss.com/supertuxkart-1-3-release/" -[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -SuperTuxKart 1.3 Release: Open Source Game for Linux Adds Switch Support -====== - -One of the most popular open-source games, SuperTuxKart, has finally received a significant update after a gap of almost a year. It is a free and cross-platform 3D kart-racing game available for Linux, macOS, Windows, and Android. - -Just like Mario Kart, you can choose from a vast catalog of characters (based on mascots of open-source projects) racing in unique karts using special items to win races in various arenas. The game also features various racing modes, including a story Mode and an online Mode, to keep you engaged. - -Let us see what’s new with the latest release. - -### Nintendo Switch Port - -![Source: blog.supertuxkart.net][1] - -SuperTuxKart is now (unofficially) playable on the Switch. This has been possible due to the SDL2 implementation that was already used in the previous 1.2 release. To play the game, you will need to have **Homebrew** installed on your console. - -Moreover, the game also supports force feedback for the Joy-Cons and other controllers. This will undoubtedly make the game more lively whenever there are effects on-screen. - -### New Arenas - -Two new arenas — Ancient Colosseum Labyrinth and Alien Signal — have been introduced. - -![Source: blog.supertuxkart.net][2] - -The Ancient Colosseum Labyrinth is based on the Roman Colosseum with a dark setting and a secret tunnel. On the other hand, the Alien Signal is another arena inspired by a SETI-styled location with strange markings on the ground. - -The Las Dunas Soccer Stadium has also been updated and now houses a symmetrical soccer field. - -Lastly, lap line extensions have been added to various tracks. This means the lap will be counted even if you drive slightly off the main road. - -### GUI Improvements - -A major feature that will improve the gameplay experience is the introduction of **render resolution**. Using the slider, you can sacrifice the resolution for better frame rates on low-end systems. - -The high score selection screen now has its independent menu and displays the best times for normal races, egg hunts, and time trials. - -You can also open links in the game. Specifically, the links in a text/instruction that pops up in the game. This is possible, thanks to the SDL2 SDL_OpenURL. - -Blender 2.8 was officially used by artists to create tracks, maps, and more. - -### Redesigned Karts - -![Source: blog.supertuxkart.net][3] - -Your favorite characters like GNU, Adiumy and Emule have undergone visual changes. Sara the Racer is now replaced by Pepper, the mascot of Pepper&Carrot. - -You can refer to the [official release notes][4] for detailed information about the update. - -[Download SuperTuxKart 1.3][5] - -### Wrapping Up - -Overall, SuperTuxKart 1.3 has brought in exciting changes and fixes. Nintendo Switch users will now have something fresh to try out and play! - -What do you think about this release? Will you be willing to try it out on your Switch? Do share your thoughts 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/supertuxkart-1-3-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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjczMiIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM2NSIgd2lkdGg9IjY0OSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI2NCIgd2lkdGg9IjI0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://blog.supertuxkart.net/2021/09/supertuxkart-13-release.html -[5]: https://github.com/supertuxkart/stk-code/releases/tag/1.3 diff --git a/sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md b/sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md deleted file mode 100644 index 7a5d77b46d..0000000000 --- a/sources/news/20211004 It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices.md +++ /dev/null @@ -1,79 +0,0 @@ -[#]: subject: "It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices" -[#]: via: "https://news.itsfoss.com/pop-os-raspberry-pi-coming-soon/" -[#]: author: "Abhishek https://news.itsfoss.com/author/root/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -It Seems Pop OS Linux Will Soon be Available on Raspberry Pi and Other ARM Devices -====== - -There was a time when only lightweight [operating systems were available for ARM devices like Ra][1]spberry Pi. Why? Because earlier ARM devices had low end hardware with limited RAM and CPU. - -It all changed when Raspberry Pi 4 targeted desktop users with its 8 GB variant and doubled down on it with the introduction of Raspberry Pi 400. - -This resulted in bringing the support of mainstream desktop Linux distributions to Raspberry Pi. Thanks to that, you can now [install Ubuntu desktop on Raspberry Pi][2]. - -Since Ubuntu desktop now supports ARM devices, other Ubuntu-based distros should join the ARM bandwagon soon. And it seems Pop!_OS is ready to board it. - -### Pop OS coming soon on Raspberry Pi! - -System76’s Principal Engineer and maintainer of Pop!_OS, Jeremy Soller shared a teaser photo on Twitter recently. The image is basically a screenshot of Neofetch running in terminal. - -> [pic.twitter.com/ehfGXwtsBf][3] -> -> — Jeremy Soller (@jeremy_soller) [September 28, 2021][4] - -If you look closely, you can see that some details that indicate that it is running on a Raspberry Pi device. - -![][5] - -The host name indicates Raspberry Pi and so does the BCM2835 CPU (chip used on Raspberry Pi devices). You can also notice the aarch64 in the OS name. - -In addition to that, Jeremy also shared a repository link that contains Pop OS packages for ARM devices. Here’s the [link][6]. - -> 😉 -> -> — Jeremy Soller (@jeremy_soller) [September 28, 2021][7] - -### How soon? - -There is no other information available from Systm76 on this front. But if I have to make a guess, I would say that the upcoming Pop!_OS 21.10 version will have an ARM version for Raspberry Pi like devices. - -This is not a blind guess. The ARM repository link shared by Jeremy clearly mentions ‘impish’ in its directory structure. Impish Indri is the codename for the upcoming [Ubuntu 21.10 slated for release][8] on 14th October. - -Pop!_OS 21.10 follows the release of Ubuntu 21.10 and should be released soon afterwards. All this gives us enough clue to surmise that Pop!_OS is coming to Raspberry Pi devices this month. - -This is indeed a good thing because Pop!_OS is popular among developers. This could mean more developers using Raspberry Pi as their development environment. - -I am delighted to see this development. How about you? - -#### 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/pop-os-raspberry-pi-coming-soon/ - -作者:[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://itsfoss.com/raspberry-pi-os/ -[2]: https://itsfoss.com/install-ubuntu-desktop-raspberry-pi/ -[3]: https://t.co/ehfGXwtsBf -[4]: https://twitter.com/jeremy_soller/status/1442977756623429640?ref_src=twsrc%5Etfw -[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ2OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[6]: https://apt.pop-os.org/release/dists/impish/main/binary-arm64/ -[7]: https://twitter.com/jeremy_soller/status/1442976088053796870?ref_src=twsrc%5Etfw -[8]: https://news.itsfoss.com/ubuntu-21-10-release-schedule/ diff --git a/sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md b/sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md deleted file mode 100644 index de58e11b9a..0000000000 --- a/sources/news/20211005 GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS.md +++ /dev/null @@ -1,79 +0,0 @@ -[#]: subject: "GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS" -[#]: via: "https://news.itsfoss.com/gnome-42-dark-style-preference/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -GNOME 42 to Introduce a System-wide Dark Style Preference, Thanks to elementary OS -====== - -There’s still time for GNOME 42, but it looks like it will implement a system-wide dark mode preference similar to [elementary OS 6][1]. - -If you have been reading our coverages, you must have noticed mentioning it as one of the [best elementary OS 6 features][2]. - -And for all the right reasons. Unlike a GTK theme change, elementary OS 6 approached the dark style preference as an opt-in preference that application developers can detect and choose to respect. - -Even though this means that there’s more to be expected from the app developers, but when successful, it should result in a consistent dark mode experience. - -In a [blog post][3] by GNOME developer _Alex_, he mentioned that GNOME would be following elementary OS’s approach while making it a standard to introduce a system-wide dark style preference in GNOME 42. - -### Consistent Dark Mode Experience Even with Flatpak Sandbox - -When it comes to a GTK theme, it is often a problem for Flatpak applications to inherit it because of the sandboxing. - -However, with an implementation planned for GNOME 42, any application (including Flatpak apps) can access the settings portal and know the dark style preference without cutting down the security provided by the sandboxing. - -This work aims to ensure that every type of application (built with any toolkit) and on any desktop should be able to detect and respect the dark style preference. - -The only difference between elementary OS and GNOME’s implementation will be the use of libadwaita API with GNOME 42. You may want to check out an older [blog post][4] by Adrien, another GNOME developer, to know more about Libadwaita. - -Alex also shared a video giving a sneak peek at how the transitions may look like (which is, of course, a work in progress). - -![][5] - -As you can notice, application developers need to update their applications to respect this preference to make the switch/transition from light/dark mode a seamless experience. - -And, further, to bring this change to GNOME 42, there is a couple of significant development work remaining: - - * A preference option in the settings menu that’s easy to use (probably under “Background/Appearance” settings) - * A switch in gnome-shell to quickly toggle the preference - * Day/night scheduling option - * A dark mode version of the wallpaper synchronized to the preference - - - -### Wrapping Up - -The core and first-party applications will have to support the dark style preference before GNOME 42 release to kick things off. - -While third-party developers should also get on the bandwagon, given the difference this makes, it would take time for all your essential/favorite tools to support it. - -_What do you think about GNOME 42 bringing a system-wide dark mode preference, following the footsteps of elementary OS? You are welcome to 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/gnome-42-dark-style-preference/ - -作者:[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]: https://news.itsfoss.com/elementary-os-6-features/ -[3]: https://blogs.gnome.org/alexm/2021/10/04/dark-style-preference/ -[4]: https://aplazas.pages.gitlab.gnome.org/blog/blog/2021/03/31/introducing-libadwaita.html -[5]: https://i0.wp.com/i.ytimg.com/vi/urXch15ySGU/hqdefault.jpg?w=780&ssl=1 diff --git a/sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md b/sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md deleted file mode 100644 index 863cd52336..0000000000 --- a/sources/news/20211008 Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements.md +++ /dev/null @@ -1,93 +0,0 @@ -[#]: subject: "Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements" -[#]: via: "https://news.itsfoss.com/feren-os-2021-10-release/" -[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Feren OS 2021.10 Release Introduces a New Firefox Configuration and UI Improvements -====== - -Feren OS is a Linux/GNU distribution based on Ubuntu. - -The latest 2021.10 release, codenamed ‘Gallium’, presents new features and changes. Let’s take a look at them. - -### Feren OS 2021.10: What’s New? - -#### A New Configuration For Mozilla Firefox - -![][1] - -Feren OS 2021.10 aims to offer a hassle-free Mozilla web browsing experience by removing the unnecessary elements of the browser. - -For new users, Mozilla Firefox comes pre-installed with a new configuration. Things like [removing the title bar from Mozilla Firefox][2], getting rid of distractions in a new tab, are some of the configurations made. - -Overall, these are the changes made to Firefox: - - * Compact Mode and no title bar by default - * No Pocket by default - * The Library is now in the toolbar (as was intended by Mozilla themselves during early Proton design ideas) instead of Pocket’s button - * Skipped Welcome Screens to allow you to get right into the action - - - -If you have never launched Firefox (or have a fresh install of Feren OS), you will get the configuration out-of-the-box. In either case, you will have to install the **firefox-config-feren** package from the web browser manager. - -#### New Splash Screen - -The new update comes with a redesigned splash screen. As a consequence, now it looks smoother and more elegant, especially when transitioning from the login screen to the desktop. - -![][3] - -#### Refreshed Lock Screen - -The new lock screen is a mixture of the Feren OS login screen’s design style and KDE plasma’s lock screen features. - -![Feren OS 2021.10 Lock Screen][4] - -As a result, it combines elegance and functionality. From the lock screen, you will have access to your music, a virtual keyboard, and more. - -![Feren OS 2021.10 Login Screen][4] - -#### New Wallpapers - -With every new release, you can notice some new wallpapers. And, Feren OS 2021.10 is no exception. - -Some interesting wallpapers have been added from sources like Unsplash and some were removed. - -### Upgrading & Downloading - -You should be easily able to get the new update from the update manager. In case you run into issues, you can refer to the [official blog post][5] for a solution to fix the most common problem encountered when updating. - -For more details on this release, refer to [the official announcement][6]. - -[Download Feren OS 2021.10][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/feren-os-2021-10-release/ - -作者:[Omar Maarof][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/omar/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://itsfoss.com/remove-title-bar-firefox/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM5MyIgd2lkdGg9IjcwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM1OCIgd2lkdGg9IjcwMCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://medium.com/feren-os/the-repository-keyring-expired-heres-how-to-renew-it-bd50dd874aac -[6]: https://medium.com/feren-os/feren-os-2021-10-iterative-improvements-993aab5dba51 -[7]: https://ferenos.weebly.com/get-feren-os.html diff --git a/sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md b/sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md deleted file mode 100644 index 019b613536..0000000000 --- a/sources/news/20211008 TUXEDO-s Linux Gaming Ultrabook -InfinityBook Pro 14- Now Sports an RTX 3050 Ti and 3K Display.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: subject: "TUXEDO’s Linux Gaming Ultrabook “InfinityBook Pro 14” Now Sports an RTX 3050 Ti and 3K Display" -[#]: via: "https://news.itsfoss.com/tuxedos-infinitybook-14/" -[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -TUXEDO’s Linux Gaming Ultrabook “InfinityBook Pro 14” Now Sports an RTX 3050 Ti and 3K Display -====== - -Tuxedo has recently unveiled its latest and exciting revision to its InfinityBook Pro 14. Despite weighing just around one kg, this sleek-looking ultrabook packs in impressive specs and can pretty much run various AAA games. Let’s take a look at what this laptop has to offer. - -### Updated Specifications - -![Source: Tuxedo][1] - -#### Processor Upgrade - -The refreshed offering has updated the processors to high-performance **Intel Core i5-11300H and Core i7-11370H** instead of the power-saving chips in the previous iteration. - -In case you didn’t know, the performance-oriented chips can utilize up to 60 watts (TDP) to provide you the enhanced performance. - -#### New-Gen RTX Graphics - -As for the graphics side, you’ll find NVIDIA’s mid-range **GeForce RTX 3050 Ti** along with the integrated Iris Xe graphics. This is a power-efficient MaxQ variant that promises a TGP of 35 watts. - -Considering this as a mid-tier GPU, it should be enough for gaming with 1080p settings. - -Do note there are no 3050ti available in the market separately. It is currently limited to OEMs/laptops. - -This graphics card is very beneficial for gamers on the go as it supports NVIDIA’s DLSS, like all RTX GPUs, for a stepped-up gaming experience. - -Also, it’s never been a better time because Linux gamers can now [enable DLSS for DX11/12 and Vulkan-based games like Cyberpunk 2077][2]. - -### Other Features - -If you’re worried about cooling, fret not. The laptop comes with an all-new cooling system that contains two heat pipes and two fans. Thus, working under heavy workloads is no longer an issue. - -As for the storage and memory, two M.2 NVME SSD slots and dual-channel RAM up to 64 GB can be seen. - -The I/O ports include an HDMI 2.0, USB-C 3.2 Gen2, two USB-A 3.2 Gen1 ports, an SD card reader, and a Thunderbolt 4 port. - -Finally, a large **53 Wh battery** is also included that ensures 12 hours (idle) of runtime. This is pretty helpful to that stunning 14 inch **Omnia 3K IPS display.** - -### Availability and Pricing - -The InfinityBook Pro 14 **starts at 1180 EUR** and goes all the way **up to 1770 EUR** if you need the 3K Omnia display and Core i7-11370H. - -Preorders have already started from Oct 6th. You can head to its official website to explore more about the product and its availability. - -[TUXEDO Computers][3] - -### Wrapping Up - -This is one beast of an ultrabook that doubles as a gaming laptop. However, I don’t understand the inclusion of 3050ti with a 3K display. So, if you are looking for other options, I would suggest [exploring other places to buy Linux laptops][4]. - -Users frequently on the go will find this laptop useful for both work and play, thanks to the laptop’s weight and power. - -_What do you think about this laptop? Do share your thoughts 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/tuxedos-infinitybook-14/ - -作者:[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]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU2NyIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://news.itsfoss.com/nvidia-dlss-dx-11-12-proton/ -[3]: https://www.tuxedocomputers.com/en/Linux-Hardware/Linux-Notebooks/10-14-inch/TUXEDO-InfinityBook-Pro-14-Gen6.tuxedo# -[4]: https://itsfoss.com/get-linux-laptops/ diff --git a/sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md b/sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md deleted file mode 100644 index 79d986bf2a..0000000000 --- a/sources/news/20211010 Here-s Why You Can Consider Linux as a Content Creator.md +++ /dev/null @@ -1,151 +0,0 @@ -[#]: subject: "Here’s Why You Can Consider Linux as a Content Creator" -[#]: via: "https://news.itsfoss.com/linux-content-creator-choice/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Here’s Why You Can Consider Linux as a Content Creator -====== - -Rewind to four/five years back, I did not use Linux as my daily driver. Yes, in a virtual machine or dual-boot, sure. - -I stuck with Windows saying – “Linux isn’t user-friendly, and it’s all about the commands/terminal.” - -In my defense, I did not know a lot of things back then. But, when I finally took the leap of faith and started using Linux as a daily driver, I began to explore how things work and was blown away by many things. - -Including some of the compelling reasons why [Linux is better than Windows][1]. - -It took me a couple of days to understand the fundamentals and learn about the software utilities not available for Linux. - -But, surprisingly, I did not need to use Windows for most of my tasks, except multiplayer gaming. And, thanks to Valve, that’s about to change with the [support for BattleEye, and Easy-Anti Cheat added to Linux][2]. - -Fret not; I’m not one of those who recommends ditching other operating systems. You should always use what you are comfortable with. - -But, in this article, I want to highlight a few things why you may want to switch to Linux as a content creator like myself. - -### Efficient System Resource Usage - -![][3] - -I’m not exaggerating here, but if you are going to use [one of the best Linux distributions][4], your system resources will thank you for choosing Linux. - -Considering my scenario, I have an i5-7400 processor coupled with 16 GB of RAM. - -When I boot into Windows, the startup programs like the antivirus, software tools for peripherals, and others already eat up about 30-40% of my RAM. - -And, when I start using the browser or any other resource-intensive application, I barely get to multi-task freely. - -When it comes to Linux, unless I open many tabs in the browser or multiple programs, it does not consume a lot of memory out-of-the-box. - -Windows has a lot of services/processes running in the background, and you need to put in some effort to “de-bloat” your experience. But, Linux does not require such tweaks to manage the resources; it already does it well. - -I know it isn’t exactly an “Apples to Apples” comparison. Still, I would consider myself somewhat a power user with a lot of browser tabs active to research and multiple applications (communication, productivity, virtual machine program, etc.) while constantly monitoring system performance. - -Hence, in my experience, _I feel I can do more with Linux using the same resources compared to Windows._ - -And, as a content creator, you probably know how important it is to have an efficient system that maximizes your productivity without being a strain on your life. - -### Is It All About the Web Browsers? - -![][3] - -Let’s face it—most of the tools are being available as web services. While some programs/utilities may stick to native offerings, everything else is increasingly relying on cloud computing to help you get things done via the web browser. - -So, you should evaluate the tools you use and whether they are platform-dependent or not. - -If not, all you need to use is the web browser. - -To give you an example, I utilize a lot of tools right from the web browser like: - - * [Canva][5] - * [Microsoft Office 365][6] - * Web-based feed readers like Feedly, Inoreader - * Todist - * [CryptPad][7] - - - -And, if that’s the case, do you think there’s any reason to consider Windows? I’ll leave that up to you. - -Linux supports all the major web browsers, including Microsoft Edge. - -### Hassle-free Experience - -![][3] - -As a content creator, the less you worry about troubleshooting issues on your computer, the more time you save. - -I’m sure you know how Microsoft’s Windows fairs when it comes to buggy updates. Now and then, I will have to re-configure my audio settings or update the graphics driver, re-install programs, and clean junk files after an update. - -And, there have been a few instances where I just get stuck looking at the welcome screen after an update, annoyed by a feature added by Microsoft, and some more. - -Regarding my Linux experience, other than some NVIDIA graphics drivers issues (for some distributions like Fedora), I never had to troubleshoot for anything else. It has been a hassle-free journey so far! - -So, I focus on my work without even worrying about an update screwing up my system. - -The only inconvenience I found with Linux was developing the habit of – “_Distro hopping_,” meaning trying new Linux distributions. Considering there are a lot of choices for your desktop OS, you may be encouraged to try another distribution looking at its features. - -Here, let me point you to [Zorin OS 16][8] and [elementary OS 6][9] if you aren’t already using them (good luck!). - -### Applications for Audio, Video, and Digital Art/Photo - -While some users may warn you that Linux does not offer good application support, the answer isn’t that straightforward. - -Yes, you do not have the support for the Adobe suite and some commercial applications. But you do have alternatives. - -Of course, if you swear by a specific software tool, Linux is a big no for you. But, if you do not have specific requirements, you can always choose to explore the exciting alternatives available. - -You can find capable video editors like Kdenlive, tools like GIMP, and several other applications used by professionals. - -To get a better idea, you might want to check: - - * [Free video editors for Linux][10] - * [Tools for digital artists][11] - * [Audio editing tools][12] - - - -There are some decent, social media specific, browser-based video editors are also available. - -### Wrapping Up - -Overall, I believe that Linux can be a perfectly suitable choice for content creators and creative professionals. - -Linux as a desktop platform has improved a lot. And, with several Linux distributions pushing forward to enhance user experience, security, and reliability, it is an uncommon but beneficial choice that comes with benefits! - -What do you think about Linux as a choice for content creators? Let me know what you think 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/linux-content-creator-choice/ - -作者:[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/linux-better-than-windows/ -[2]: https://news.itsfoss.com/easy-anti-cheat-linux/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: https://itsfoss.com/best-linux-distributions/ -[5]: http://partner.canva.com/yRbxmN -[6]: https://www.office.com -[7]: https://itsfoss.com/cryptpad/ -[8]: https://news.itsfoss.com/zorin-os-16-features/ -[9]: https://news.itsfoss.com/elementary-os-6-features/ -[10]: https://itsfoss.com/best-video-editing-software-linux/ -[11]: https://itsfoss.com/best-linux-graphic-design-software/ -[12]: https://itsfoss.com/best-audio-editors-linux/ diff --git a/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md b/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md index 81e9aa5958..601132a33f 100644 --- a/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md +++ b/sources/tech/20180619 Systemd Services- Monitoring Files and Directories.md @@ -137,7 +137,7 @@ via: https://www.linux.com/blog/learn/intro-to-linux/2018/6/systemd-services-mon 作者:[Paul Brown][a] 选题:[lujun9972][b] -译者:[silentdawn-zz](https://github.com/译者ID) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 diff --git a/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md b/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md index 9770fc567d..afff65b34e 100644 --- a/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md +++ b/sources/tech/20200115 Develop GUI apps using Flutter on Fedora.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: (zpl1025) +[#]: translator: ( ) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) 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 3be4d832de..1bdf2b16a6 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: "fisherue " +[#]: translator: " " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -108,7 +108,7 @@ via: https://opensource.com/article/21/8/linux-terminal 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID][c] +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 @@ -126,5 +126,4 @@ via: https://opensource.com/article/21/8/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 -[c]: https://github.com/fisherue +[12]: https://opensource.com/downloads/bash-scripting-ebook \ No newline at end of file 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 69d7925905..025dce01e1 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: "fisherue " +[#]: translator: " " [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -99,7 +99,7 @@ via: https://opensource.com/article/21/8/share-printer-cups 作者:[Seth Kenlon][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/fisherue) +译者:[译者ID](https://github.com/译者ID) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From c62f575ce0dcf0a35bcff28bc3a531684c5e7b07 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 Oct 2021 10:11:00 +0800 Subject: [PATCH 0738/1588] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zd200572 文字还需要进一步润色,在通过翻译工具辅助之后,最好通读几遍。 另外,元数据里面没写你的 id --- ...x Otherwise It Was Done- Linus Torvalds.md | 45 +++++++++---------- 1 file changed, 20 insertions(+), 25 deletions(-) diff --git a/translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md b/translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md index d40b3e0010..662a4f75e2 100644 --- a/translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md +++ b/translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md @@ -2,48 +2,43 @@ [#]: via: "https://news.itsfoss.com/open-source-changed-linux-torvalds/" [#]: author: "Abhishek https://news.itsfoss.com/author/root/" [#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " +[#]: translator: "zd200572" +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -开源改变了Linux, 否则它就完了:Linus Torvalds - +Linus Torvalds :开源改变了 Linux, 否则它就完了 ====== +> Linux 本来会像其他业余项目一样被抛在后面,但开源改变了这一点。 -你可能已经知道这个故事,30年前,芬兰学生Linus Torvalds创建了一个类UNIX操作系统,作为一个业余项目。 +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/torvalds-linux-kernel.png?w=1200&ssl=1) -你不知道的是,Torvalds认为这个业余项目已经完成,他会把它抛在脑后,他将从事一些新的和有趣的项目。 +你可能已经知道这个故事,30 年前,芬兰学生 Linus Torvalds 开发了一个业余项目,创建了一个类 UNIX 操作系统。 +你不知道的是,Torvalds 认为这个业余项目已经完成了,他本想把它抛在脑后,做一些新的、有趣的项目。 -所以,是什么让他在这个”业余项目"上工作了30年呢?答案是开源。 +那么,是什么让他在这个“业余项目”上工作了 30 年呢?答案是开源。 -### 开源改变了Linux +### 开源改变了 Linux -在最近结束的[北美开源峰会][1]上,Linus Torvalds分享了一些关于Linux项目过去、现在和未来的见解。 +在最近结束的 [北美开源峰会][1] 上,Linus Torvalds 分享了一些关于 Linux 项目过去、现在和未来的见解。 -当回忆起这个项目的最初情况,[Torvalds说][2]他期望离开Linux这个“完成状态”的项目,去做些新的和更有趣的工作。 +当回忆起这个项目的最初情况时,[Torvalds 说][2] 他本以为会以“已完成的状态”抛下 Linux 这个项目,而去做些新的、有趣的事情。 +> 显然是开源改变了这一切。这个项目,如果是由我来决定,我可能会把它抛在一边,但是突然间,我开始收到各种问题,最后还有人们提交的补丁,这使得我的动力不断持续。现在 30 年过去了,这仍然是动力所在。 -> 显然是开源改变了这一切。因为突然这个项目,我可能会留下,如果这仅取决于我,我开始得到问题,最后打补丁,这让我的动力得以继续。现在30年过去了,这仍然是保持动力的原因。 +Torvalds 还补充说,就他而言,Linux 在过去 29 年里已经完成了。以后添加的每一个其他的功能,都是其他人需要、想要或感兴趣的。 -Torvalds还补充说,就他而言,Linux在过去29年里一直这样做。以后添加的所有其他功能,都是其他人需要、想要或感兴趣的。 +许多开发人员都会遇到这种情况。你在一个项目上工作,认为它已经达到“完成”的状态了,如果这个项目没有足够的吸引力,你就会对它失去兴趣,转而去做一些“新的、有趣的”事情。实际上继续这个项目的真正动力来自用户和认可。 -许多开发人员都会面临这一点。你工作在一个“完成”的项目上,如果这个项目没有获得足够的吸引力,你将会失去兴趣去做它,并转移到“新的和更有趣的”东西上。实际上继续这个项目的真正动力来自用户和认可。 +当被问及 Linux 50 周年要做些什么时,Torvalds 说,他不认为自己在 70 岁的时候还能继续做内核编程。然后他还补充说,他也没想过自己在 50 岁还在做内核编程,但他现在却在做这个事情。 +> “不知何故,我不认为我 70 岁还能做内核编程。但是另一方面,几年前,我也没想到自己 50 岁还在做内核编程,所以……我们拭目以待。” -当被问及Linux 50周年要做些什么时,Torvalds说,他不想看到自己在70岁继续内核编程。他也插话说,他没想到自己在50岁还在从事内核编程,但是他现在正在做。 - - -> ”不知何故,我不能想像我70岁还做内核编程。但是另一方面,几年前,我也不能想到自己50岁还做内核编程,所以。。。我们拭目以待。“ - -听Torvalds谈论Linux总是很可爱的,作为一个热心的Linux用户,有这么多需要学习和联系的东西,对吗? - - -_Source: [The News Stack][2]_ - +我们总是愿意听 Torvalds 谈论 Linux,作为一个热心的 Linux 用户,我们还有如此多需要学习和交流的东西! +来源:[The News Stack][2] -------------------------------------------------------------------------------- @@ -51,8 +46,8 @@ via: https://news.itsfoss.com/open-source-changed-linux-torvalds/ 作者:[Abhishek][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) -校对:[校对者ID](https://github.com/校对者ID) +译者:[zd200572](https://github.com/zd200572) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From 698607f8afceb1fb9ecda551eb51a3e1ec62d4b8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 Oct 2021 10:11:33 +0800 Subject: [PATCH 0739/1588] PUB @zd200572 https://linux.cn/article-13890-1.html --- ...rce Changed Linux Otherwise It Was Done- Linus Torvalds.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md (97%) diff --git a/translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md b/published/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md similarity index 97% rename from translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md rename to published/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md index 662a4f75e2..792706a9e8 100644 --- a/translated/news/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md +++ b/published/20211003 Open Source Changed Linux Otherwise It Was Done- Linus Torvalds.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zd200572" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13890-1.html" Linus Torvalds :开源改变了 Linux, 否则它就完了 ====== From 03e7f484322365f3aea88723859333f71f615fe0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 Oct 2021 10:56:30 +0800 Subject: [PATCH 0740/1588] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @unigeorge 关于在业界一些常见未翻译的词汇,我觉得还是翻译过来比较好。这些没翻译,只是因为受众和推广程度不够。 --- ...w to process real-time data with Apache.md | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/translated/tech/20200228 How to process real-time data with Apache.md b/translated/tech/20200228 How to process real-time data with Apache.md index 30a2909289..dd7e43d317 100644 --- a/translated/tech/20200228 How to process real-time data with Apache.md +++ b/translated/tech/20200228 How to process real-time data with Apache.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (How to process real-time data with Apache) @@ -10,13 +10,13 @@ 如何使用 Apache 软件处理实时数据 ====== -开源社区在处理实时事件的项目丰富度方面处于领先地位。 +> 开源以丰富的项目画布引领着处理实时事件的方向。 -![Alarm clocks with different time][1] +![](https://img.linux.net.cn/data/attachment/album/202110/17/105502opl53qrmj950j3mv.jpg) -在“永不下线”的未来,入网设备规模可能会达到数十亿。存储原始数据,日后再进行分析的方案将不再能满足需求,因为用户需要实时且准确的响应。要对故障等敏感状况进行预测,实时处理数据也必不可少——数据到达数据库后再处理肯定是来不及的。 +在“永不下线”的未来,入网设备规模可能会达到数十亿。存储原始数据,日后再进行分析的方案将不再能满足需求,因为用户需要实时且准确的响应。要对故障等对环境敏感的状况进行预测,实时处理数据也必不可少 —— 数据到达数据库后再处理肯定是来不及的。 -有人可能会说,“云可扩展性”能够满足实时处理流数据的需求,但一些简单的例子就能表明它永远无法满足对无界数据流进行实时响应的需求。从移动设备到物联网,都需要一种新的范式来满足需求。尽管云计算依赖对大数据“先存储后分析”的方案,但也迫切需要一种能够处理持续、杂乱和海量数据流的软件框架,并在数据流到达时立即对其进行处理,以保证实时的响应、预测和对数据的洞悉。 +有人可能会说,“云可扩展性”能够满足实时处理流数据的需求,但一些简单的例子就能表明它永远无法满足对无界数据流进行实时响应的需求。从移动设备到物联网,都需要一种新的范式来满足需求。尽管云计算依赖于对大数据“先存储后分析”的方案,但也迫切需要一种能够处理持续、杂乱和海量数据流的软件框架,并在数据流到达时立即对其进行处理,以保证实时的响应、预测和对数据的洞悉。 例如,在加利福尼亚州的帕洛阿尔托市,每天从基础交通设施产生的流数据比 Twitter Firehose 还要多。这是很大的数据量。为 Uber、Lyft 和 FedEx 等消费者预测城市交通需要实时的分析、学习和预测。云处理不可避免地导致每个事件大约会有半秒的延迟。 @@ -29,13 +29,13 @@ ### 发布和订阅 -事件驱动系统领域中有一个关键架构模式:发布/订阅(publish/subscribe) 消息传递模式。这是一种异步通信方法,其中消息会从 _发布者_(数据产生方)传递到 _订阅者_(处理数据的应用程序)。发布/订阅模式可以将消息发送者与消费者分离开来。 +事件驱动系统领域中有一个关键架构模式:发布/订阅publish/subscribe 消息传递模式。这是一种异步通信方法,其中消息会从 _发布者_(数据产生方)传递到 _订阅者_(处理数据的应用程序)。发布/订阅模式可以将消息发送者与消费者分离开来。 -在发布/订阅模式中,消息源会 _发布_ 针对某个 _topic_(主题) 的 事件(event) 至 _broker_(服务端),后者按接收顺序存储它们。应用程序可以 _订阅_ 一个或多个 _topic_,然后 _broker_ 会转发匹配的事件。 Apache Kafka 和 Pulsar 以及 CNCF NATS 是发布/订阅系统。 发布/订阅的云服务包括 Google Pub/Sub、AWS Kinesis、Azure Service Bus、Confluent Cloud 等。(LCTT译注:本段部分术语英文名称更为泛用,针对这些术语,正文采用英文,仅在括号中标注其对应中文。) +在发布/订阅模式中,消息源会 _发布_ 针对某个 主题topic事件event服务端broker,后者按接收顺序存储它们。应用程序可以 _订阅_ 一个或多个 _主题_,然后 _服务端_ 会转发匹配的事件。 Apache Kafka 和 Pulsar 以及 CNCF NATS 是发布/订阅系统。 发布/订阅的云服务包括 Google Pub/Sub、AWS Kinesis、Azure Service Bus、Confluent Cloud 等。(LCTT 译注:本段部分术语英文名称更为泛用,针对这些术语,采用了中英文标注。) -发布/订阅系统不会 _运行_ 订阅者应用程序,它们只是 _传递_ 数据给相应 topic 的订阅者。 +发布/订阅系统不会 _运行_ 订阅者应用程序,它们只是 _传递_ 数据给相应主题的订阅者。 -流数据通常包含应用程序或基础架构状态更新的事件。在选择架构来处理数据时,发布/订阅框架等数据分发系统的作用是有限的。消费者应用程序的“处理方式”超出了发布/订阅系统的范围。这让开发人员的管理变得极具复杂性。所谓的流处理器是一种特殊的订阅者,可以动态分析数据并将结果返回给同一个 broker。 +流数据通常包含应用程序或基础架构状态更新的事件。在选择架构来处理数据时,发布/订阅框架等数据分发系统的作用是有限的。消费者应用程序的“处理方式”超出了发布/订阅系统的范围。这让开发人员的管理变得极具复杂性。所谓的流处理器是一种特殊的订阅者,可以动态分析数据并将结果返回给同一个服务端。 ### Apache Spark @@ -65,7 +65,7 @@ via: https://opensource.com/article/20/2/real-time-data-processing 作者:[Simon Crosby][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 781af4ef5f7f51ecbf45783c481ff02846bd3ed6 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 17 Oct 2021 10:58:51 +0800 Subject: [PATCH 0741/1588] PUB @unigeorge https://linux.cn/article-13891-1.html --- .../20200228 How to process real-time data with Apache.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20200228 How to process real-time data with Apache.md (99%) diff --git a/translated/tech/20200228 How to process real-time data with Apache.md b/published/20200228 How to process real-time data with Apache.md similarity index 99% rename from translated/tech/20200228 How to process real-time data with Apache.md rename to published/20200228 How to process real-time data with Apache.md index dd7e43d317..7d4b4189b2 100644 --- a/translated/tech/20200228 How to process real-time data with Apache.md +++ b/published/20200228 How to process real-time data with Apache.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13891-1.html) [#]: subject: (How to process real-time data with Apache) [#]: via: (https://opensource.com/article/20/2/real-time-data-processing) [#]: author: (Simon Crosby https://opensource.com/users/simon-crosby) From 44b0fde894a01abbbcc2f8ce307c32ed5c65894b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 18 Oct 2021 05:02:32 +0800 Subject: [PATCH 0742/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211017?= =?UTF-8?q?=20How=20I=20use=20open=20source=20to=20play=20RPGs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211017 How I use open source to play RPGs.md --- ...1017 How I use open source to play RPGs.md | 111 ++++++++++++++++++ 1 file changed, 111 insertions(+) create mode 100644 sources/tech/20211017 How I use open source to play RPGs.md diff --git a/sources/tech/20211017 How I use open source to play RPGs.md b/sources/tech/20211017 How I use open source to play RPGs.md new file mode 100644 index 0000000000..89f0b6e3a0 --- /dev/null +++ b/sources/tech/20211017 How I use open source to play RPGs.md @@ -0,0 +1,111 @@ +[#]: subject: "How I use open source to play RPGs" +[#]: via: "https://opensource.com/article/21/10/open-source-rpgs" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I use open source to play RPGs +====== +Find an open source tool for almost every element of role-playing games. +![Dice as a random number generator][1] + +I play a lot of tabletop role-playing games (RPGs), in terms of both frequency and variety. Generally, I prefer playing RPGs in person with friends, but over the past two years, I've been playing online. + +At first, I wasn't sure how to run a long-term game online. I knew there were a lot of tools out there to make it possible, but none of them interested me until I discovered the world of open source online tabletop gaming. With a small collection of open source applications, I've been able to run all my games exclusively on open source. + +It's a good time of year for it, too, because it was recently [Free RPG Day][2]. On FreeRPG Day, publishers across the tabletop role-playing game industry release, free of charge, games to encourage players to try new games and new adventures. Although it was canceled in 2020, it's back this year as a live event with some virtual support by way of free RPG sampler downloads from [Dungeon Crawl Classics][3] and [Paizo][4]. + +And if the event's virtual offerings aren't enough, I've compiled a list of [5 open source tabletop RPGs you may not have tried yet][5]. + +When you're ready to start playing, try some of these open source tools and see how much they can enhance your gameplay. + +### Chat + +The most basic—and technically speaking, the only—requirement for an RPG game online is communication. It's the medium of the game: players need a way to talk. + +There are a few good options for this. I find that [Mumble][6] is the tool with the lowest demand on bandwidth. It's a voice-only chat application that can use the very efficient Opus codec to get everyone talking for hours at a time without interruption. + +![Mumble client][7] + +CC BY-SA Seth Kenlon + +There are public instances all around the world, so after downloading the Mumble client, you can join any of them that are open and use it to run a game online. There's a push-to-talk setting, so you can cut out background noise, which is a welcome feature when the rest of your household doesn't halt all of its activity just for your tabletop session. + +There's also a text chat client for asides. My gaming groups usually use the chat to post links relevant to the game, but you could also use it for off-topic chatter in an attempt to keep the spoken game on topic. + +If your players prefer facial cues or are just used to video chat web apps, then [Jitsi][8] is an excellent substitute for in-person gatherings around a table. Jitsi is mostly like every other video chat application you've ever used, except possibly even easier. You can set up a room, invite friends, keep out strangers, and play for hours. Muting and going off-camera are intuitive, the interface is attractive, and new features are being developed and introduced regularly. + +![Jitsi][9] + +CC BY-SA Seth Kenlon + +Both Mumble and Jitsi have clients for both desktop and mobiles, so anyone can play no matter what device they're on. + +### Character sheets + +I've already posted about my [digital character sheet][10] solutions, but any RPG player knows that there's more to managing a character than just stats. + +During a game online that spanned several sessions, I found there was a lot of downtime between games. It occurred to me that, while I found it unreasonable to demand that my players calculate encumbrance during a live pen-and-paper game, it's pretty easy to request them to track encumbrance when everything's digital. + +There are plenty of spreadsheets available online, but the open source option is [Ethercalc][11]. With instances all over the world, it's easy to find a free Ethercalc host. Alternately, you can use Podman or Docker to easily install and run your own instance. + +![Ethercalc spreadsheet of inventory][12] + +Seth Kenlon, CC-BY-SA 4.0 + +Ethercalc provides the essentials: a shared ledger so players can track the items their party is carrying (and who's holding one at any given time), the weight of each item, and the value. Items get entered as the party collects loot during the game, so they know when they're too burdened to pick up something new. + +Between sessions, the shared spreadsheet can be referenced and organized so that the PCs know what to sell or stuff into a bag of holding or what they can safely drop when better loot presents itself next session. + +### Maps + +Mythic Table is an open source shared mapping system for tabletop games. That means you can load an image to serve as the map of your game and move digital tokens on the map to represent where players' characters are located. + +Since [last I wrote about Mythic Table][13], it's run a successful Kickstarter campaign to ensure its continued development. It's also gained several new features, most notably a "fog of war" feature that allows the dungeon master to blank out the map and reveal only the parts that players have explored. + +![A dungeon map rendered by Mythic Table and user interface choices for chat, maps, and characters][14] + +Seth Kenlon, CC-BY-SA 4.0 + +I've been running two games on Mythic Table for the past few months, and it's been an excellent and straightforward map system. Conveniently, it also features a digital dice roller, so if your players lack dice or you prefer to roll dice in the open, you have a shared dice pool. + +You can try Mythic Table at [mythictable.com][15] or visit their code repository on [Github][16]. + +### Open gaming on open source + +The open source tools I use are universal, so they work with whatever game system you decide to play. Because they're all open source, they can be used online by all your players regardless of what OS they use, and they can all be self-hosted. + +If you're a programmer as well as a gamer, visit their Git repositories and see if there's anything you can contribute. If you're a gamer or a gamemaster, try the tools out the next time you sit down at a digital game table. You might be surprised at just how few online accounts you actually need to have to use some of the best applications available for gaming. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/open-source-rpgs + +作者:[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/header_dice.png?itok=dOMrHopO (Dice as a random number generator) +[2]: https://www.freerpgday.com/ +[3]: https://goodman-games.com/blog/2021/10/06/pdf-previews-of-our-free-rpg-day-releases/ +[4]: https://paizo.com/community/blog/v5748dyo6shte +[5]: https://opensource.com/article/21/10/rpg-tabletop-games +[6]: http://mumble.info/ +[7]: https://opensource.com/sites/default/files/mumble-client.png (Mumble client) +[8]: https://jitsi.org/ +[9]: https://opensource.com/sites/default/files/jitsi-client.jpg (Jitsi) +[10]: https://opensource.com/article/21/10/3-ways-manage-your-character-sheets-open-source +[11]: http://ethercalc.net/ +[12]: https://opensource.com/sites/default/files/uploads/ethercalc.jpeg (Ethercalc) +[13]: https://opensource.com/article/20/11/open-source-battle-maps +[14]: https://opensource.com/sites/default/files/uploads/mythic.jpeg (Mythic Table) +[15]: http://mythictable.com/ +[16]: https://gitlab.com/mythicteam/mythictable From 55387069192d3ed13fa4fda7365fcac079795452 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 18 Oct 2021 05:05:05 +0800 Subject: [PATCH 0743/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211017?= =?UTF-8?q?=20Systemd-free=20Linux=20Distro=20Devuan=20Releases=20Version?= =?UTF-8?q?=204.0=20Based=20on=20Debian=2011?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211017 Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11.md --- ...Releases Version 4.0 Based on Debian 11.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/news/20211017 Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11.md diff --git a/sources/news/20211017 Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11.md b/sources/news/20211017 Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11.md new file mode 100644 index 0000000000..481458f191 --- /dev/null +++ b/sources/news/20211017 Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11.md @@ -0,0 +1,84 @@ +[#]: subject: "Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11" +[#]: via: "https://news.itsfoss.com/devuan-4-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11 +====== + +The developers of Devuan GNU+Linux have recently released the latest stable version – Devuan “Chimaera” 4.0. For those who aren’t aware, Devuan is a fork of Debian that doesn’t use systemd but init as its software suite. + +Let’s take a look at what this new release has to offer. + +### Key Highlights + +The latest release is now based on [Debian 11 “Bullseye”][1] and uses the Linux Kernel 5.10. As mentioned before, you have to choose between init systems – OpenRC, sysvinit, and runit. + +![Source: devuan.org][2] + +#### Refreshed UI + +A new bootloader screen and desktop theming have been introduced. + +The release note states – + +> Improved desktop support – virtually all desktop environments available in Debian are now part of Devuan, systemd-free + +This means you don’t necessarily have to use the default XFCE as the desktop environment. As for desktop managers, gdm3 and ssdm have now been included. + +#### Improved Accessibility + +The installer is completely based on Debian 11’s installer. Thus, all procedures described in Debian’s wiki will apply here too. + +You can now disable task-speech accessibility if you intend to install a console-only system and avoid unnecessary dependencies. + +Lastly, you can successfully install a desktop environment without installing PulseAudio. The GUI or console installation sessions will use hardware or software speech synthesis instead. This also includes using a refreshable braille display. + +#### Fixes and Updates to Certain Packages + +Do note that wicd, the network manager, will no longer be available due to its dependence on the obsolete python2. Instead, you can use other alternatives such as network-manager and connman. + +It had been noticed that newer AMD CPUs caused the system to boot to a black screen. To solve this issue, the release notes clearly mention the user to install the firmware-amd-graphics package from the non-free repository. The non-free repositories will be available during the install time. + +If you’re upgrading from the previous release, Devuan 3 Beowolf, you may notice missing XFCE app icons. This can easily be solved by running a simple command mentioned in the release notes. + +For more details, you can refer to their [official release notes.][3] + +### Summing Up + +Devuan 4.0 looks like an interesting release, especially for those who want a Debian-like experience but without systemd. + +Users running the older versions of Devuan and those looking to migrate from Debian can head over to the [official website’s guide][4]. New users willing to give Devuan 4.0 a try can use the link below. + +[Get Devuan Chimaera 4.0][5] + +_How do you find Devuan when compared to Debian? Would you like to try it out?_ + +#### 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/devuan-4-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://news.itsfoss.com/debian-11-feature/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4MCIgd2lkdGg9IjY0MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://files.devuan.org/devuan_chimaera/Release_notes.txt +[4]: https://www.devuan.org/os/install +[5]: https://www.devuan.org/get-devuan From 2963f57f19a97bde01a5c6567cc3962a587e1d86 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 18 Oct 2021 05:05:14 +0800 Subject: [PATCH 0744/1588] add done: 20211017 Systemd-free Linux Distro Devuan Releases Version 4.0 Based on Debian 11.md --- sources/tech/20211018 .md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 sources/tech/20211018 .md diff --git a/sources/tech/20211018 .md b/sources/tech/20211018 .md new file mode 100644 index 0000000000..ac68f6d16e --- /dev/null +++ b/sources/tech/20211018 .md @@ -0,0 +1,16 @@ +[#]: subject: "" +[#]: via: "https://www.debugpoint.com/2021/10/pinephone-pro-announcement/" +[#]: author: "[Arindam] + +Posted by Arindam + +Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + + +====== + From 275e7bf80ab51a919f83b898ac73d2b887de6b05 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Mon, 18 Oct 2021 07:20:20 +0800 Subject: [PATCH 0745/1588] Delete 20211018 .md --- sources/tech/20211018 .md | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 sources/tech/20211018 .md diff --git a/sources/tech/20211018 .md b/sources/tech/20211018 .md deleted file mode 100644 index ac68f6d16e..0000000000 --- a/sources/tech/20211018 .md +++ /dev/null @@ -1,16 +0,0 @@ -[#]: subject: "" -[#]: via: "https://www.debugpoint.com/2021/10/pinephone-pro-announcement/" -[#]: author: "[Arindam] - -Posted by Arindam - -Creator of debugpoint.com. All time Linux user and open-source supporter. Connect with me via Telegram, Twitter, or send us an email. " -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - - -====== - From 28d8c8f28dcc11c00310b217c1aa4bb977d92221 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 18 Oct 2021 08:47:43 +0800 Subject: [PATCH 0746/1588] translated --- sources/tech/20211011 What is a hostname.md | 117 ----------------- .../tech/20211011 What is a hostname.md | 118 ++++++++++++++++++ 2 files changed, 118 insertions(+), 117 deletions(-) delete mode 100644 sources/tech/20211011 What is a hostname.md create mode 100644 translated/tech/20211011 What is a hostname.md diff --git a/sources/tech/20211011 What is a hostname.md b/sources/tech/20211011 What is a hostname.md deleted file mode 100644 index ba4f0a62b2..0000000000 --- a/sources/tech/20211011 What is a hostname.md +++ /dev/null @@ -1,117 +0,0 @@ -[#]: subject: "What is a hostname?" -[#]: via: "https://opensource.com/article/21/10/what-hostname" -[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -What is a hostname? -====== -Hostnames are labels for humans to refer to a specific computer. -![Computer screen with files or windows open][1] - -Computers have network addresses, but they're usually difficult for humans to remember. Hostnames are labels intended to help humans refer to a specific computer. Instead of navigating to 192..168.1.4, for instance, you might navigate to  `linuxlaptop `or `linuxlaptop.local`. - -### Addresses and Names - -All networked computers (also referred to as hosts) need an address—a unique number associated with it that allows for datagrams to route among them for correct data communications. This is known as the Internet Protocol (IP) address. The number 54.204.39.132 is an Internet Protocol version 4 (IPv4) address. The newer IPv6 addresses are much longer, like this: 2001:0db6:3c4d:0017:0000:0000:2a2f:1a2b. WHOA! That is going to be hard to memorize! - - -``` -`$ ip addr show` -``` - -Computers can also be given labels. Known as the hostname, these are friendly names for easier reference. I could set my computer's hostname to be _copperhead_. As long as that name is unique on the network, all other users and computers can refer to it as copperhead instead of the IP address number. - - -``` -`$ hostname -s` -``` - -You can update your computer's hostname. - -Read Seth Kenlon's article [How to change a hostname on Linux][2] to learn how to do that on Linux. - -#### Fully qualified domain name - -Technically, the hostname includes a domain name. If my domain name is mycompany.com, then together—delimited by periods, my computer's hostname is copperhead.mycompany.com. This forms a fully qualified domain name (FQDN). This is important because the IP address resolves to the FQDN. - - -``` -`host.domain.topleveldomain` -``` - -For example: `www.example.com` is a fully qualified domain name. - -Your domain name is generally determined already, so you're only responsible for providing the host portion. This article focuses on the host.  - -#### Name resolution - -The process of translating the IP address to the corresponding hostname is known as name resolution. The first place that this occurs is in a local hosts table. Linux uses the file `/etc/hosts` to store this table. - - -``` -`cat /etc/hosts` -``` - -There is also a hierarchical and decentralized network-based system that provides resolution called the Domain Name System (DNS). This is when the FQDN becomes really important. - - -``` -`$ dig www.opensource.com` -``` - -### Fun with names - -It can be fun to think up names for our computers. If you have many, you could use a theme. I once worked for a company that named all of its servers after snakes. - -A later company I worked for, where I was a data center manager, used beer brands. It was exciting when we received a new server because I would email the development team for suggestions. We had roughly 100 servers. These provided an interesting list that reflected the diversity of the company. We had everything from coors and bud to amstel and deleriumtremens. We had tiger and singha and sapporo and many others too! - -We thought it was cool! Then again, imagine what happens when you try to remember that lowenbrau is the virtualization server with the most RAM and peroni is the SQL database server and heineken is the new domain controller, particularly for new employees in a rapidly growing company. - -### Conventions - -Hostnames are the choice of the owner, of course, so have fun with it. However, depending on the environment, it might make more sense to use names that are easy to remember or based on a naming convention that lends to being descriptive to the host.  - -#### Useful names - -If you want to forego the fun and helpfully name your systems, perhaps consider their function. Database servers might be named database1, database2, database3, and so on. Web servers might be webserver1, webserver2, and so on. - -#### Positional names - -I have used a technique with many clients to name server hosts with sets of characters in positions that describe an aspect of that system that helps identification. For example, if I were working on a Business Process Management (BPM) system for the Department of the Interior (DOI), I would incorporate their acronyms in the naming convention. - -Furthermore, just as with many large corporations, financial institutions, and governments, they might have various data centers located in disparate geographical locations for purposes of performance or disaster recovery. So, say, a data center on the East coast of the North American continent is referred to as ED, and those on the West coast are WD. East Data center and West Data center. - -All of this information would come together in a name such as doibpm1ed or doibpm1wd. So, while these names don't look like much, someone working on this project would readily be able to identify each as to their purpose and location, and the name may even help to obfuscate their usage to would-be mal-actors. In other words, the owner could choose naming that would only make sense to insiders.  - -### Internet standards - -Several standards govern hostnames. You can find these in Requests for Comment (RFC) maintained by The Internet Engineering Task Force (IETF). As of now, adhere to the following: - - *  A hostname should be between 1 and 63 ASCII characters in length - *  A FQDN has a maximum length of 253 ASCII characters - *  Case-insensitive - *  Allowed characters: a to z, 0 to 9, - (hyphen), and _ (underscore) - - - -I hope this article helps to clarify hostnames. Have some fun and be creative. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/what-hostname - -作者:[Alan Formy-Duval][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/alanfdoss -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) -[2]: https://opensource.com/article/21/10/how-change-hostname-linux diff --git a/translated/tech/20211011 What is a hostname.md b/translated/tech/20211011 What is a hostname.md new file mode 100644 index 0000000000..84d90b73fa --- /dev/null +++ b/translated/tech/20211011 What is a hostname.md @@ -0,0 +1,118 @@ +[#]: subject: "What is a hostname?" +[#]: via: "https://opensource.com/article/21/10/what-hostname" +[#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +什么是主机名? +====== +主机名是人类用来指代特定计算机的标签。 +![Computer screen with files or windows open][1] + +计算机有网络地址,但人类通常很难记住它们。主机名是帮助人类参考特定计算机的标签。例如,你可能不会导航到 192.168.1.4,而是导航到 `linuxlaptop` 或 `linuxlaptop.local`。 + +### 地址和名称 + +所有联网的计算机(也被称为主机)都需要一个地址:一个与之相关的唯一数字,以使数据报文能够在它们之间进行正确的数据通信。这就是所谓的互联网协议(IP)地址。数字 54.204.39.132 是一个互联网协议第四版(IPv4)地址。较新的 IPv6 地址要长得多,像这样:2001:0db6:3c4d:0017:0000:0000:2a2f:1a2b. 哇!这将是很难记住的! + + +``` +`$ ip addr show` +``` + +计算机也可以被赋予标签。被称为主机名,这些是友好的名称,便于参考。我可以把我的计算机的主机名设置为 _copperhead_。只要这个名字在网络上是唯一的,所有其他用户和计算机都可以把 copperhead 作为地址,而不是 IP 地址。 + + +``` +`$ hostname -s` +``` + +你可以更新你的计算机的主机名。 + +阅读 Seth Kenlon 的文章[如何在 Linux 上更改主机名][2],了解如何在 Linux 上这样做。 + +#### 完全限定域名 + +从技术上讲,主机名包括一个域名。如果我的域名是 mycompany.com,那么我的计算机的主机名是 copperhead.mycompany.com,以句点分隔。这就形成了一个完全限定域名(FQDN)。这很重要,因为 IP 地址可以解析为 FQDN。 + + +``` +`host.domain.topleveldomain` +``` + +例如:`www.example.com` 是一个完全限定域名。 + +你的域名一般已经确定了,所以你只负责提供主机部分。本文的重点是主机。 + +#### 名称解析 + +将 IP 地址转换为相应的主机名的过程被称为名称解析。这个过程首先发生在本地主机表中。Linux 使用文件 `/etc/hosts` 来存储这个表。 + + +``` +`cat /etc/hosts` +``` + +还有一个分层的、去中心化的基于网络的系统提供解析,称为域名系统(DNS)。这时 FQDN 变得非常重要。 + + +``` +`$ dig www.opensource.com` +``` + +### 名称的乐趣 + +为我们的计算机起名字可能很有趣。如果你有很多,你可以使用一个主题。我曾经为一家公司工作,该公司将所有的服务器都以蛇命名。 + +后来我工作的一家公司,我是一个数据中心经理,使用啤酒品牌。当我们收到一个新的服务器时,这很令人兴奋,因为我会给开发团队发邮件征求建议。我们大约有 100 台服务器。这些提供了一个有趣的清单,反映了公司的多样性。我们有从库尔斯和布德到阿姆斯特尔和德勒里姆特雷门斯的一切。我们有老虎、辛哈和萨波洛等等! + +我们认为这很酷!然后,想象一下,当你试图记住 lowenbrau 是拥有最多内存的虚拟化服务器,peroni 是 SQL 数据库服务器,heineken 是新的域控制器时,会发生什么,特别是对于一个快速发展的公司的新员工。 + +### 约定 + +当然,主机名是所有者的选择,所以请尽情发挥。然而,根据环境的不同,使用容易记忆的名字或基于命名惯例的名字可能更有意义,因为这些名字有利于描述主机。 + +#### 有用的名字 + +如果你想放弃有趣的东西,并对你的系统进行有益的命名,也许可以考虑它们的功能。数据库服务器可以被命名为 database1、database2、database3 等等。网络服务器可以命名为 webserver1、webserver2 等等。 + +#### 位置名称 + +我在许多客户那里使用了一种技术,用一组字符的位置来命名服务器主机,这些字符描述了该系统的一个方面,有助于识别。例如,如果我正在为内政部(DOI)开发一个业务流程管理(BPM)系统,我就会在命名规则中加入他们的缩写词。 + +此外,就像许多大型企业、金融机构和政府一样,他们可能有不同的数据中心,位于不同的地理位置,以达到性能或灾难恢复的目的。因此,比如说,位于北美大陆东海岸的数据中心被称为 ED(East Data center),而位于西海岸的数据中心则是 WD(West Data center)。 + +所有这些信息将汇集到一个名称中,如 doibpm1ed 或 doibpm1wd。因此,虽然这些名字看起来不长,但在这个项目上工作的人可以很容易地识别它们的目的和位置,而且这个名字甚至可以对潜在的恶意者混淆它们的用途。换句话说,业主可以选择只对内部人员有意义的命名方式 + +### 互联网标准 + +Several standards govern hostnames. You can find these in Requests for Comment (RFC) maintained by The Internet Engineering Task Force (IETF). As of now, adhere to the following: +有几个标准管理着主机名。你可以在互联网工程任务组(IETF)维护的请求评论(RFC)中找到这些标准。从现在起,请遵守以下规定: + + * 主机名的长度应该在 1 到 63 个 ASCII 字符之间 + * 一个 FQDN 的最大长度为 253 个 ASCII 字符 + * 不区分大小写 + * 允许的字符:a 到 z,0 到 9,-(连字符),和 \_(下划线)。 + + + +我希望这篇文章能帮助澄清主机名。玩得开心,发挥创意。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/what-hostname + +作者:[Alan Formy-Duval][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/alanfdoss +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://opensource.com/article/21/10/how-change-hostname-linux From 543722df1fcc289d1bef90b29dfafb48f628a8ba Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 18 Oct 2021 08:53:46 +0800 Subject: [PATCH 0747/1588] translating --- .../tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md b/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md index 60d9111048..ee94e9b48d 100644 --- a/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md +++ b/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/upgrade-ubuntu-to-newer-version/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 6a88e74c5ada8fc25bab8956850e071f51359dfd Mon Sep 17 00:00:00 2001 From: Patrick Zeng Date: Mon, 18 Oct 2021 10:49:19 +0800 Subject: [PATCH 0748/1588] Update 20211015 How to Find and Kill Zombie Process in Linux.md MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit zengyi1001 申请翻译 --- .../20211015 How to Find and Kill Zombie Process in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md b/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md index ace4502ca6..b5d435d81e 100644 --- a/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md +++ b/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/kill-zombie-process-linux/" [#]: author: "Marco Carmona https://itsfoss.com/author/marco/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "zengyi1001" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 4aef26d98314d26a83568dc22077bc530b8e59a0 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Mon, 18 Oct 2021 13:33:30 +0800 Subject: [PATCH 0749/1588] translated --- ...gs in C programming and how to fix them.md | 415 ------------------ ...gs in C programming and how to fix them.md | 408 +++++++++++++++++ 2 files changed, 408 insertions(+), 415 deletions(-) delete mode 100644 sources/tech/20211014 5 common bugs in C programming and how to fix them.md create mode 100644 translated/tech/20211014 5 common bugs in C programming and how to fix them.md diff --git a/sources/tech/20211014 5 common bugs in C programming and how to fix them.md b/sources/tech/20211014 5 common bugs in C programming and how to fix them.md deleted file mode 100644 index c5abbb2755..0000000000 --- a/sources/tech/20211014 5 common bugs in C programming and how to fix them.md +++ /dev/null @@ -1,415 +0,0 @@ -[#]: subject: "5 common bugs in C programming and how to fix them" -[#]: via: "https://opensource.com/article/21/10/programming-bugs" -[#]: author: "Jim Hall https://opensource.com/users/jim-hall" -[#]: collector: "lujun9972" -[#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -5 common bugs in C programming and how to fix them -====== -Five ways to make your C programs more resilient and reliable. -![Bug tracking magnifying glass on computer screen][1] - -Even the best programmers can create programming bugs. Depending on what your program does, these bugs could introduce security vulnerabilities, cause the program to crash, or create unexpected behavior. - -The C programming language sometimes gets a bad reputation because it is not memory safe like more recent programming languages, including Rust. But with a little extra code, you can avoid the most common and most serious C programming bugs. Here are five bugs that can break your application and how you can avoid them: - -### 1\. Uninitialized variables - -When the program starts up, the system will assign it a block of memory that the program uses to store data. That means your variables will get whatever random value was in memory when the program started. - -Some environments will intentionally "zero out" the memory as the program starts up, so every variable starts with a zero value. And it can be tempting to assume in your programs that all variables will begin at zero. However, the C programming specification says that the system does not initialize variables. - -Consider a sample program that uses a few variables and two arrays: - - -``` -#include <stdio.h> -#include <stdlib.h> - -int -main() -{ -  int i, j, k; -  int numbers[5]; -  int *array; - -  [puts][2]("These variables are not initialized:"); - -  [printf][3]("  i = %d\n", i); -  [printf][3]("  j = %d\n", j); -  [printf][3]("  k = %d\n", k); - -  [puts][2]("This array is not initialized:"); - -  for (i = 0; i < 5; i++) { -    [printf][3]("  numbers[%d] = %d\n", i, numbers[i]); -  } - -  [puts][2]("malloc an array ..."); -  array = [malloc][4](sizeof(int) * 5); - -  if (array) { -    [puts][2]("This malloc'ed array is not initialized:"); - -    for (i = 0; i < 5; i++) { -      [printf][3]("  array[%d] = %d\n", i, array[i]); -    } - -    [free][5](array); -  } - -  /* done */ - -  [puts][2]("Ok"); -  return 0; -} -``` - -The program does not initialize the variables, so they start with whatever values the system had in memory at the time. Compiling and running this program on my Linux system, you'll see that some variables happen to have "zero" values, but others do not: - - -``` -These variables are not initialized: -  i = 0 -  j = 0 -  k = 32766 -This array is not initialized: -  numbers[0] = 0 -  numbers[1] = 0 -  numbers[2] = 4199024 -  numbers[3] = 0 -  numbers[4] = 0 -malloc an array ... -This malloc'ed array is not initialized: -  array[0] = 0 -  array[1] = 0 -  array[2] = 0 -  array[3] = 0 -  array[4] = 0 -Ok -``` - -Fortunately, the `i` and `j` variables start at zero, but `k` has a starting value of 32766. In the numbers array, most elements also happen to start with zero, except the third element, which gets an initial value of 4199024. - -Compiling the same program on a different system further shows the danger in uninitialized variables. Don't assume "all the world runs Linux" because one day, your program might run on a different platform. For example, here's the same program running on FreeDOS: - - -``` -These variables are not initialized: -  i = 0 -  j = 1074 -  k = 3120 -This array is not initialized: -  numbers[0] = 3106 -  numbers[1] = 1224 -  numbers[2] = 784 -  numbers[3] = 2926 -  numbers[4] = 1224 -malloc an array ... -This malloc'ed array is not initialized: -  array[0] = 3136 -  array[1] = 3136 -  array[2] = 14499 -  array[3] = -5886 -  array[4] = 219 -Ok -``` - -Always initialize your program's variables. If you assume a variable will start with a zero value, add the extra code to assign zero to the variable. This extra bit of typing upfront will save you headaches and debugging later on. - -### 2\. Going outside of array bounds - -In C, arrays start at array index zero. That means an array that is ten elements long goes from 0 to 9, or an array that is a thousand elements long goes from 0 to 999. - -Some programmers sometimes forget this and introduce "off by one" bugs where they reference the array starting at one. In an array that is five elements long, the value the programmer intended to find at array element "5" is not actually the fifth element of the array. Instead, it is some other value in memory, not associated with the array at all. - -Here's an example that goes well outside the array bounds. The program starts with an array that's only five elements long but references array elements from outside that range: - - -``` -#include <stdio.h> -#include <stdlib.h> - -int -main() -{ -  int i; -  int numbers[5]; -  int *array; - -  /* test 1 */ - -  [puts][2]("This array has five elements (0 to 4)"); - -  /* initalize the array */ -  for (i = 0; i < 5; i++) { -    numbers[i] = i; -  } - -  /* oops, this goes beyond the array bounds: */ -  for (i = 0; i < 10; i++) { -    [printf][3]("  numbers[%d] = %d\n", i, numbers[i]); -  } - -  /* test 2 */ - -  [puts][2]("malloc an array ..."); - -  array = [malloc][4](sizeof(int) * 5); - -  if (array) { -    [puts][2]("This malloc'ed array also has five elements (0 to 4)"); - -    /* initalize the array */ -    for (i = 0; i < 5; i++) { -      array[i] = i; -    } - -    /* oops, this goes beyond the array bounds: */ -    for (i = 0; i < 10; i++) { -      [printf][3]("  array[%d] = %d\n", i, array[i]); -    } - -    [free][5](array); -  } - -  /* done */ - -  [puts][2]("Ok"); -  return 0; -} -``` - -Note that the program initializes all the values of the array, from 0 to 4, but then tries to read 0 to 9 instead of 0 to 4. The first five values are correct, but after that you don’t know what the values will be: - - -``` -This array has five elements (0 to 4) -  numbers[0] = 0 -  numbers[1] = 1 -  numbers[2] = 2 -  numbers[3] = 3 -  numbers[4] = 4 -  numbers[5] = 0 -  numbers[6] = 4198512 -  numbers[7] = 0 -  numbers[8] = 1326609712 -  numbers[9] = 32764 -malloc an array ... -This malloc'ed array also has five elements (0 to 4) -  array[0] = 0 -  array[1] = 1 -  array[2] = 2 -  array[3] = 3 -  array[4] = 4 -  array[5] = 0 -  array[6] = 133441 -  array[7] = 0 -  array[8] = 0 -  array[9] = 0 -Ok -``` - -When referencing arrays, always keep track of its size. Store that in a variable; don't hard-code an array size. Otherwise, your program might stray outside the array bounds when you later update it to use a different array size, but you forget to change the hard-coded array length. - -### 3\. Overflowing a string - -Strings are just arrays of a different kind. In the C programming language, a string is an array of `char` values, with a zero character to indicate the end of the string. - -And so, like arrays, you need to avoid going outside the range of the string. This is sometimes called _overflowing a string_. - -One easy way to overflow a string is to read data with the `gets` function. The `gets` function is very dangerous because it doesn't know how much data it can store in a string, and it naively reads data from the user. This is fine if your user enters short strings like `foo` but can be disastrous when the user enters a value that is too long for your string value. - -Here's a sample program that reads a city name using the `gets` function. In this program, I've also added a few unused variables to show how string overflow can affect other data: - - -``` -#include <stdio.h> -#include <string.h> - -int -main() -{ -  char name[10];                       /* Such as "Chicago" */ -  int var1 = 1, var2 = 2; - -  /* show initial values */ - -  [printf][3]("var1 = %d; var2 = %d\n", var1, var2); - -  /* this is bad .. please don't use gets */ - -  [puts][2]("Where do you live?"); -  [gets][6](name); - -  /* show ending values */ - -  [printf][3]("<%s> is length %d\n", name, [strlen][7](name)); -  [printf][3]("var1 = %d; var2 = %d\n", var1, var2); - -  /* done */ - -  [puts][2]("Ok"); -  return 0; -} -``` - -That program works fine when you test for similarly short city names, like `Chicago` in Illinois or `Raleigh` in North Carolina: - - -``` -var1 = 1; var2 = 2 -Where do you live? -Raleigh -<Raleigh> is length 7 -var1 = 1; var2 = 2 -Ok -``` - -The Welsh town of `Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch` has one of the longest names in the world. At 58 characters, this string goes well beyond the 10 characters reserved in the `name` variable. As a result, the program stores values in other areas of memory, including the values of `var1` and `var2`: - - -``` -var1 = 1; var2 = 2 -Where do you live? -Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch -<Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch> is length 58 -var1 = 2036821625; var2 = 2003266668 -Ok -Segmentation fault (core dumped) -``` - -Before aborting, the program used the long string to overwrite other parts of memory. Note that `var1` and `var2` no longer have their starting values of `1` and `2`. - -Avoid `gets`, and use safer methods to read user data. For example, the `getline` function will allocate enough memory to store user input, so the user cannot accidentally overflow the string by entering a long value. - -### 4\. Freeing memory twice - -One of the rules of good C programming is, "if you allocate memory, you should free it." Programs can allocate memory for arrays and strings using the `malloc` function, which reserves a block of memory and returns a pointer to the starting address in memory. Later, the program can release the memory using the `free` function, which uses the pointer to mark the memory as unused. - -However, you should only use the `free` function once. Calling `free` a second time will result in unexpected behavior that will probably break your program. Here's a short example program to show that. It allocates memory, then immediately releases it. But like a forgetful-but-methodical programmer, I also freed the memory at the end of the program, resulting in freeing the same memory twice: - - -``` -#include <stdio.h> -#include <stdlib.h> - -int -main() -{ -  int *array; - -  [puts][2]("malloc an array ..."); - -  array = [malloc][4](sizeof(int) * 5); - -  if (array) { -    [puts][2]("malloc succeeded"); - -    [puts][2]("Free the array..."); -    [free][5](array); -  } - -  [puts][2]("Free the array..."); -  [free][5](array); - -  [puts][2]("Ok"); -} -``` - -Running this program causes a dramatic failure on the second use of the `free` function: - - -``` -malloc an array ... -malloc succeeded -Free the array... -Free the array... -free(): double free detected in tcache 2 -Aborted (core dumped) -``` - -Avoid calling `free` more than once on an array or string. One way to avoid freeing memory twice is to locate the `malloc` and `free` functions in the same function. - -For example, a solitaire program might allocate memory for a deck of cards in the main function, then use that deck in other functions to play the game. Free the memory in the main function, rather than some other function. Keeping the `malloc` and `free` statements together helps to avoid freeing memory more than once. - -### 5\. Using invalid file pointers - -Files are a handy way to store data. For example, you might store configuration data for your program in a file called `config.dat`. The Bash shell reads its initial script from `.bash_profile` in the user's home directory. The GNU Emacs editor looks for the file `.emacs` for its starting values. And the Zoom meeting client uses the `zoomus.conf` file to read its program configuration. - -So the ability to read data from a file is important for pretty much all programs. But what if the file you want to read isn't there? - -To read a file in C, you first open the file using the `fopen` function, which returns a stream pointer to the file. You can use this pointer with other functions to read data, such as `fgetc` to read the file one character at a time. - -If the file you want to read isn't there or isn't readable by your program, then the `fopen` function will return `NULL` as the file pointer, which is an indication the file pointer is invalid. But here's a sample program that innocently does not check if `fopen` returned `NULL` and tries to read the file regardless: - - -``` -#include <stdio.h> - -int -main() -{ -  FILE *pfile; -  int ch; - -  [puts][2]("Open the FILE.TXT file ..."); - -  pfile = [fopen][8]("FILE.TXT", "r"); - -  /* you should check if the file pointer is valid, but we skipped that */ - -  [puts][2]("Now display the contents of FILE.TXT ..."); - -  while ((ch = [fgetc][9](pfile)) != EOF) { -    [printf][3]("<%c>", ch); -  } - -  [fclose][10](pfile); - -  /* done */ - -  [puts][2]("Ok"); -  return 0; -} -``` - -When you run this program, the first call to `fgetc` results in a spectacular failure, and the program immediately aborts: - - -``` -Open the FILE.TXT file ... -Now display the contents of FILE.TXT ... -Segmentation fault (core dumped) -``` - -Always check the file pointer to ensure it's valid. For example, after calling `fopen` to open a file, check the pointer's value with something like `if (pfile != NULL)` to ensure that the pointer is something you can use. - -We all make mistakes, and programming bugs happen to the best of programmers. But if you follow these guidelines and add a little extra code to check for these five types of bugs, you can avoid the most serious C programming mistakes. A few lines of code up front to catch these errors may save you hours of debugging later. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/programming-bugs - -作者:[Jim Hall][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/jim-hall -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug_software_issue_tracking_computer_screen.jpg?itok=6qfIHR5y (Bug tracking magnifying glass on computer screen) -[2]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html -[3]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html -[4]: http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html -[5]: http://www.opengroup.org/onlinepubs/009695399/functions/free.html -[6]: http://www.opengroup.org/onlinepubs/009695399/functions/gets.html -[7]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html -[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html -[9]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html -[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html diff --git a/translated/tech/20211014 5 common bugs in C programming and how to fix them.md b/translated/tech/20211014 5 common bugs in C programming and how to fix them.md new file mode 100644 index 0000000000..1b435b6413 --- /dev/null +++ b/translated/tech/20211014 5 common bugs in C programming and how to fix them.md @@ -0,0 +1,408 @@ +[#]: subject: "5 common bugs in C programming and how to fix them" +[#]: via: "https://opensource.com/article/21/10/programming-bugs" +[#]: author: "Jim Hall https://opensource.com/users/jim-hall" +[#]: collector: "lujun9972" +[#]: translator: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +C 语言编程中的 5 个常见 bug 及对应解决方案 +====== + +增强 C 语言程序弹性和可靠性的五种方法。 +![Bug tracking magnifying glass on computer screen][1] + +即使是最好的程序员也无法完全避免 bug。这些 bug 可能会引入安全漏洞、导致程序崩溃或产生意外操作,具体影响要取决于程序的运行逻辑。 + +C 语言有时名声不太好,因为它不像近期的编程语言(比如 Rust)那样具有内存安全性。但是通过额外的代码,一些最常见和严重的 C 语言 bug 是可以避免的。下文讲解了可能影响应用程序的五个 bug 以及避免这些 bug 的方法: + +### 1\. 未初始化的变量 + +程序启动时,系统会为其分配一块内存以供存储数据。这意味着程序启动时,变量将获得内存中的一个随机值。 + +有些编程环境会在程序启动时特意将内存“清零”,因此每个变量都得以有初始的零值。程序中的变量都以零值作为初始值,听上去是很不错的。但是在 C 编程规范中,系统并不会初始化变量。 + +看一下这个使用了若干变量和两个数组的示例程序: + + +``` +#include +#include + +int +main() +{ +  int i, j, k; +  int numbers[5]; +  int *array; + +  [puts][2]("These variables are not initialized:"); + +  [printf][3]("  i = %d\n", i); +  [printf][3]("  j = %d\n", j); +  [printf][3]("  k = %d\n", k); + +  [puts][2]("This array is not initialized:"); + +  for (i = 0; i < 5; i++) { +    [printf][3]("  numbers[%d] = %d\n", i, numbers[i]); +  } + +  [puts][2]("malloc an array ..."); +  array = [malloc][4](sizeof(int) * 5); + +  if (array) { +    [puts][2]("This malloc'ed array is not initialized:"); + +    for (i = 0; i < 5; i++) { +      [printf][3]("  array[%d] = %d\n", i, array[i]); +    } + +    [free][5](array); +  } + +  /* done */ + +  [puts][2]("Ok"); +  return 0; +} +``` + +这个程序不会初始化变量,所以变量以系统内存中的随机值作为初始值。在我的 Linux 系统上编译和运行这个程序,会看到一些变量恰巧有“零”值,但其他变量并没有: + +``` +These variables are not initialized: +  i = 0 +  j = 0 +  k = 32766 +This array is not initialized: +  numbers[0] = 0 +  numbers[1] = 0 +  numbers[2] = 4199024 +  numbers[3] = 0 +  numbers[4] = 0 +malloc an array ... +This malloc'ed array is not initialized: +  array[0] = 0 +  array[1] = 0 +  array[2] = 0 +  array[3] = 0 +  array[4] = 0 +Ok +``` + +很幸运,`i` 和 `j` 变量是从零值开始的,但 `k` 的起始值为 32766。在 numbers 数组中,大多数元素也恰好从零值开始,只有第三个元素的初始值为 4199024。 + +在不同的系统上编译相同的程序,可以进一步显示未初始化变量的危险性。不要误以为“全世界都在运行 Linux”,你的程序很可能某天在其他平台上运行。例如,下面是在 FreeDOS 上运行相同程序的结果: + +``` +These variables are not initialized: +  i = 0 +  j = 1074 +  k = 3120 +This array is not initialized: +  numbers[0] = 3106 +  numbers[1] = 1224 +  numbers[2] = 784 +  numbers[3] = 2926 +  numbers[4] = 1224 +malloc an array ... +This malloc'ed array is not initialized: +  array[0] = 3136 +  array[1] = 3136 +  array[2] = 14499 +  array[3] = -5886 +  array[4] = 219 +Ok +``` + +永远都要记得初始化程序的变量。如果你想让变量将以零值作为初始值,请额外添加代码将零分配给该变量。预先编好这些额外的代码,这会有助于减少日后让人头疼的 debug 过程。 + +### 2\. 数组越界 + +C 语言中,数组索引从零开始。这意味着对于长度为 10 的数组,索引是从 0 到 9;长度为 1000 的数组,索引则是从 0 到 999。 + +程序员有时会忘记这一点,他们从索引 1 开始引用数组,产生了“大小差一”off by one bug。在长度为 5 的数组中,程序员在索引“5”处使用的值,实际上并不是数组的第 5 个元素。相反,它是内存中的一些其他值,根本与此数组无关。 + +这是一个数组越界的示例程序。该程序使用了一个只含有 5 个元素的数组,但却引用了该范围之外的数组元素: + +``` +#include +#include + +int +main() +{ +  int i; +  int numbers[5]; +  int *array; + +  /* test 1 */ + +  [puts][2]("This array has five elements (0 to 4)"); + +  /* initalize the array */ +  for (i = 0; i < 5; i++) { +    numbers[i] = i; +  } + +  /* oops, this goes beyond the array bounds: */ +  for (i = 0; i < 10; i++) { +    [printf][3]("  numbers[%d] = %d\n", i, numbers[i]); +  } + +  /* test 2 */ + +  [puts][2]("malloc an array ..."); + +  array = [malloc][4](sizeof(int) * 5); + +  if (array) { +    [puts][2]("This malloc'ed array also has five elements (0 to 4)"); + +    /* initalize the array */ +    for (i = 0; i < 5; i++) { +      array[i] = i; +    } + +    /* oops, this goes beyond the array bounds: */ +    for (i = 0; i < 10; i++) { +      [printf][3]("  array[%d] = %d\n", i, array[i]); +    } + +    [free][5](array); +  } + +  /* done */ + +  [puts][2]("Ok"); +  return 0; +} +``` + +可以看到,程序初始化了数组的所有值(从索引 0 到 4),然后从索引 0 开始读取,结尾是索引 9 而不是索引 4。前五个值是正确的,再后面的值会让你不知所以: + +``` +This array has five elements (0 to 4) +  numbers[0] = 0 +  numbers[1] = 1 +  numbers[2] = 2 +  numbers[3] = 3 +  numbers[4] = 4 +  numbers[5] = 0 +  numbers[6] = 4198512 +  numbers[7] = 0 +  numbers[8] = 1326609712 +  numbers[9] = 32764 +malloc an array ... +This malloc'ed array also has five elements (0 to 4) +  array[0] = 0 +  array[1] = 1 +  array[2] = 2 +  array[3] = 3 +  array[4] = 4 +  array[5] = 0 +  array[6] = 133441 +  array[7] = 0 +  array[8] = 0 +  array[9] = 0 +Ok +``` + +引用数组时,始终要记得追踪数组大小。将数组大小存储在变量中;不要对数组大小进行硬编码hard-code。否则,如果后期该标识符指向另一个不同大小的数组,却忘记更改硬编码的数组长度 +时,程序就可能会发生数组越界。 + +### 3\. 字符串溢出 + +字符串只是特定类型的数组。在 C 语言中,字符串是一个由 `char` 类型值组成的数组,其中用一个零字符表示字符串的结尾。 + +因此,与数组一样,要注意避免超出字符串的范围。有时也称之为 _字符串溢出_。 + +使用 `gets` 函数读取数据是一种很容易发生字符串溢出的行为方式。`gets` 函数非常危险,因为它不知道在一个字符串中可以存储多少数据,只会机械地从用户那里读取数据。如果用户输入像 `foo` 这样的短字符串,不会发生意外;但是当用户输入的值超过字符串长度时,后果可能是灾难性的。 + +下面是一个使用 `gets` 函数读取城市名称的示例程序。在这个程序中,我还添加了一些未使用的变量,来展示字符串溢出对其他数据的影响: + +``` +#include +#include + +int +main() +{ +  char name[10];                       /* Such as "Chicago" */ +  int var1 = 1, var2 = 2; + +  /* show initial values */ + +  [printf][3]("var1 = %d; var2 = %d\n", var1, var2); + +  /* this is bad .. please don't use gets */ + +  [puts][2]("Where do you live?"); +  [gets][6](name); + +  /* show ending values */ + +  [printf][3]("<%s> is length %d\n", name, [strlen][7](name)); +  [printf][3]("var1 = %d; var2 = %d\n", var1, var2); + +  /* done */ + +  [puts][2]("Ok"); +  return 0; +} +``` + +当您测试类似的短城市名称时,该程序运行良好,例如伊利诺伊州的`芝加哥`Chicago或北卡罗来纳州的`罗利`Raleigh: + +``` +var1 = 1; var2 = 2 +Where do you live? +Raleigh + is length 7 +var1 = 1; var2 = 2 +Ok +``` + +威尔士小镇 `Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch` 有着世界上最长的名字之一。这个字符串有 58 个字符,远远超出了 `name` 变量中保留的 10 个字符。结果,程序将值存储在内存的其他区域,覆盖了 `var1` 和 `var2` 的值: + +``` +var1 = 1; var2 = 2 +Where do you live? +Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch + is length 58 +var1 = 2036821625; var2 = 2003266668 +Ok +Segmentation fault (core dumped) +``` + +在运行结束之前,程序会用长字符串覆盖内存的其他部分区域。注意,`var1` 和 `var2` 的值不再是起始的 `1` 和 `2`。 + +避免使用 `gets` 函数,改用更安全的方法来读取用户数据。例如,`getline` 函数会分配足够的内存来存储用户输入,因此不会因输入长值而发生意外的字符串溢出。 + +### 4\. 重复释放内存 + +“分配的内存要手动释放”是良好的 C 语言编程原则之一。程序可以使用 `malloc` 函数为数组和字符串分配内存,该函数会开辟一块内存,并返回一个指向内存中起始地址的指针。之后,程序可以使用 `free` 函数释放内存,该函数会使用指针将内存标记为未使用。 + +但是,你应该只使用一次 `free` 函数。第二次调用 `free` 会导致意外的后果,可能会毁掉你的程序。下面是一个针对此点的简短示例程序。程序分配了内存,然后立即释放了它。但为了模仿一个健忘但有条理的程序员,我在程序结束时又一次释放了内存,导致两次释放了相同的内存: + +``` +#include +#include + +int +main() +{ +  int *array; + +  [puts][2]("malloc an array ..."); + +  array = [malloc][4](sizeof(int) * 5); + +  if (array) { +    [puts][2]("malloc succeeded"); + +    [puts][2]("Free the array..."); +    [free][5](array); +  } + +  [puts][2]("Free the array..."); +  [free][5](array); + +  [puts][2]("Ok"); +} +``` + +运行这个程序会导致第二次使用 `free` 函数时出现戏剧性的失败: + +``` +malloc an array ... +malloc succeeded +Free the array... +Free the array... +free(): double free detected in tcache 2 +Aborted (core dumped) +``` + +要记得避免在数组或字符串上多次调用 `free`。将 `malloc` 和 `free` 函数定位在同一个函数中,这是避免重复释放内存的一种方法。 + +例如,一个纸牌游戏程序可能会在主函数中为一副牌分配内存,然后在其他函数中使用这副牌来玩游戏。记得在主函数,而不是其他函数中释放内存。将 `malloc` 和 `free` 语句放在一起有助于避免多次释放内存。 + +### 5\. 使用无效的文件指针 + +文件是一种便捷的数据存储方式。例如,你可以将程序的配置数据存储在 `config.dat` 文件中。Bash shell 会从用户家目录中的`.bash_profile` 读取初始化脚本。GNU Emacs 编辑器会寻找文件 `.emacs` 以从中确定起始值。而 Zoom 会议客户端使用 `zoomus.conf` 文件读取其程序配置。 + +所以,从文件中读取数据的能力几乎对所有程序都很重要。但是假如要读取的文件不存在,会发生什么呢? + +在 C 语言中读取文件,首先要用 `fopen` 函数打开文件,该函数会返回指向文件的流指针。你可以结合其他函数,使用这个指针来读取数据,例如 `fgetc` 会逐个字符地读取文件。 + +If the file you want to read isn't there or isn't readable by your program, then the `fopen` function will return `NULL` as the file pointer, which is an indication the file pointer is invalid. But here's a sample program that innocently does not check if `fopen` returned `NULL` and tries to read the file regardless: + +如果要读取的文件不存在或程序没有读取权限,`fopen` 函数会返回 `NULL` 作为文件指针,这表示文件指针无效。但是这里有一个示例程序,它机械地直接去读取文件,不检查 `fopen` 是否返回了 `NULL`: + +``` +#include + +int +main() +{ +  FILE *pfile; +  int ch; + +  [puts][2]("Open the FILE.TXT file ..."); + +  pfile = [fopen][8]("FILE.TXT", "r"); + +  /* you should check if the file pointer is valid, but we skipped that */ + +  [puts][2]("Now display the contents of FILE.TXT ..."); + +  while ((ch = [fgetc][9](pfile)) != EOF) { +    [printf][3]("<%c>", ch); +  } + +  [fclose][10](pfile); + +  /* done */ + +  [puts][2]("Ok"); +  return 0; +} +``` + +当你运行这个程序时,第一次调用 `fgetc` 会失败,程序会立即中止: + +``` +Open the FILE.TXT file ... +Now display the contents of FILE.TXT ... +Segmentation fault (core dumped) +``` + +始终检查文件指针以确保其有效。例如,在调用 `fopen` 打开一个文件后,用类似 `if (pfile != NULL)` 的语句检查指针,以确保指针是可以使用的。 + +人都会犯错,最优秀的程序员也会产生编程 bug。但是,遵循上面这些准则,添加一些额外的代码来检查这五种类型的 bug,就可以避免最严重的 C 语言编程错误。提前编写几行代码来捕获这些错误,可能会帮你节省数小时的调试时间。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/programming-bugs + +作者:[Jim Hall][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/jim-hall +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/bug_software_issue_tracking_computer_screen.jpg?itok=6qfIHR5y (Bug tracking magnifying glass on computer screen) +[2]: http://www.opengroup.org/onlinepubs/009695399/functions/puts.html +[3]: http://www.opengroup.org/onlinepubs/009695399/functions/printf.html +[4]: http://www.opengroup.org/onlinepubs/009695399/functions/malloc.html +[5]: http://www.opengroup.org/onlinepubs/009695399/functions/free.html +[6]: http://www.opengroup.org/onlinepubs/009695399/functions/gets.html +[7]: http://www.opengroup.org/onlinepubs/009695399/functions/strlen.html +[8]: http://www.opengroup.org/onlinepubs/009695399/functions/fopen.html +[9]: http://www.opengroup.org/onlinepubs/009695399/functions/fgetc.html +[10]: http://www.opengroup.org/onlinepubs/009695399/functions/fclose.html From 44f8c8e99651ea5e89e4064b9041f8e9e2e5bb6b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 Oct 2021 17:41:56 +0800 Subject: [PATCH 0750/1588] PRF @unigeorge --- ...gs in C programming and how to fix them.md | 279 +++++++++--------- 1 file changed, 138 insertions(+), 141 deletions(-) diff --git a/translated/tech/20211014 5 common bugs in C programming and how to fix them.md b/translated/tech/20211014 5 common bugs in C programming and how to fix them.md index 1b435b6413..184799af84 100644 --- a/translated/tech/20211014 5 common bugs in C programming and how to fix them.md +++ b/translated/tech/20211014 5 common bugs in C programming and how to fix them.md @@ -3,21 +3,22 @@ [#]: author: "Jim Hall https://opensource.com/users/jim-hall" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -C 语言编程中的 5 个常见 bug 及对应解决方案 +C 语言编程中的 5 个常见错误及对应解决方案 ====== -增强 C 语言程序弹性和可靠性的五种方法。 -![Bug tracking magnifying glass on computer screen][1] +> 增强 C 语言程序的弹性和可靠性的五种方法。 -即使是最好的程序员也无法完全避免 bug。这些 bug 可能会引入安全漏洞、导致程序崩溃或产生意外操作,具体影响要取决于程序的运行逻辑。 +![](https://img.linux.net.cn/data/attachment/album/202110/18/174123p4cz99skp9zz4nf4.jpg) -C 语言有时名声不太好,因为它不像近期的编程语言(比如 Rust)那样具有内存安全性。但是通过额外的代码,一些最常见和严重的 C 语言 bug 是可以避免的。下文讲解了可能影响应用程序的五个 bug 以及避免这些 bug 的方法: +即使是最好的程序员也无法完全避免错误。这些错误可能会引入安全漏洞、导致程序崩溃或产生意外操作,具体影响要取决于程序的运行逻辑。 -### 1\. 未初始化的变量 +C 语言有时名声不太好,因为它不像近期的编程语言(比如 Rust)那样具有内存安全性。但是通过额外的代码,一些最常见和严重的 C 语言错误是可以避免的。下文讲解了可能影响应用程序的五个错误以及避免它们的方法: + +### 1、未初始化的变量 程序启动时,系统会为其分配一块内存以供存储数据。这意味着程序启动时,变量将获得内存中的一个随机值。 @@ -25,7 +26,6 @@ C 语言有时名声不太好,因为它不像近期的编程语言(比如 Ru 看一下这个使用了若干变量和两个数组的示例程序: - ``` #include #include @@ -33,39 +33,39 @@ C 语言有时名声不太好,因为它不像近期的编程语言(比如 Ru int main() { -  int i, j, k; -  int numbers[5]; -  int *array; + int i, j, k; + int numbers[5]; + int *array; -  [puts][2]("These variables are not initialized:"); + puts("These variables are not initialized:"); -  [printf][3]("  i = %d\n", i); -  [printf][3]("  j = %d\n", j); -  [printf][3]("  k = %d\n", k); + printf(" i = %d\n", i); + printf(" j = %d\n", j); + printf(" k = %d\n", k); -  [puts][2]("This array is not initialized:"); + puts("This array is not initialized:"); -  for (i = 0; i < 5; i++) { -    [printf][3]("  numbers[%d] = %d\n", i, numbers[i]); -  } + for (i = 0; i < 5; i++) { + printf(" numbers[%d] = %d\n", i, numbers[i]); + } -  [puts][2]("malloc an array ..."); -  array = [malloc][4](sizeof(int) * 5); + puts("malloc an array ..."); + array = malloc(sizeof(int) * 5); -  if (array) { -    [puts][2]("This malloc'ed array is not initialized:"); + if (array) { + puts("This malloc'ed array is not initialized:"); -    for (i = 0; i < 5; i++) { -      [printf][3]("  array[%d] = %d\n", i, array[i]); -    } + for (i = 0; i < 5; i++) { + printf(" array[%d] = %d\n", i, array[i]); + } -    [free][5](array); -  } + free(array); + } -  /* done */ + /* done */ -  [puts][2]("Ok"); -  return 0; + puts("Ok"); + return 0; } ``` @@ -73,57 +73,57 @@ main() ``` These variables are not initialized: -  i = 0 -  j = 0 -  k = 32766 + i = 0 + j = 0 + k = 32766 This array is not initialized: -  numbers[0] = 0 -  numbers[1] = 0 -  numbers[2] = 4199024 -  numbers[3] = 0 -  numbers[4] = 0 + numbers[0] = 0 + numbers[1] = 0 + numbers[2] = 4199024 + numbers[3] = 0 + numbers[4] = 0 malloc an array ... This malloc'ed array is not initialized: -  array[0] = 0 -  array[1] = 0 -  array[2] = 0 -  array[3] = 0 -  array[4] = 0 + array[0] = 0 + array[1] = 0 + array[2] = 0 + array[3] = 0 + array[4] = 0 Ok ``` -很幸运,`i` 和 `j` 变量是从零值开始的,但 `k` 的起始值为 32766。在 numbers 数组中,大多数元素也恰好从零值开始,只有第三个元素的初始值为 4199024。 +很幸运,`i` 和 `j` 变量是从零值开始的,但 `k` 的起始值为 32766。在 `numbers` 数组中,大多数元素也恰好从零值开始,只有第三个元素的初始值为 4199024。 在不同的系统上编译相同的程序,可以进一步显示未初始化变量的危险性。不要误以为“全世界都在运行 Linux”,你的程序很可能某天在其他平台上运行。例如,下面是在 FreeDOS 上运行相同程序的结果: ``` These variables are not initialized: -  i = 0 -  j = 1074 -  k = 3120 + i = 0 + j = 1074 + k = 3120 This array is not initialized: -  numbers[0] = 3106 -  numbers[1] = 1224 -  numbers[2] = 784 -  numbers[3] = 2926 -  numbers[4] = 1224 + numbers[0] = 3106 + numbers[1] = 1224 + numbers[2] = 784 + numbers[3] = 2926 + numbers[4] = 1224 malloc an array ... This malloc'ed array is not initialized: -  array[0] = 3136 -  array[1] = 3136 -  array[2] = 14499 -  array[3] = -5886 -  array[4] = 219 + array[0] = 3136 + array[1] = 3136 + array[2] = 14499 + array[3] = -5886 + array[4] = 219 Ok ``` -永远都要记得初始化程序的变量。如果你想让变量将以零值作为初始值,请额外添加代码将零分配给该变量。预先编好这些额外的代码,这会有助于减少日后让人头疼的 debug 过程。 +永远都要记得初始化程序的变量。如果你想让变量将以零值作为初始值,请额外添加代码将零分配给该变量。预先编好这些额外的代码,这会有助于减少日后让人头疼的调试过程。 -### 2\. 数组越界 +### 2、数组越界 C 语言中,数组索引从零开始。这意味着对于长度为 10 的数组,索引是从 0 到 9;长度为 1000 的数组,索引则是从 0 到 999。 -程序员有时会忘记这一点,他们从索引 1 开始引用数组,产生了“大小差一”off by one bug。在长度为 5 的数组中,程序员在索引“5”处使用的值,实际上并不是数组的第 5 个元素。相反,它是内存中的一些其他值,根本与此数组无关。 +程序员有时会忘记这一点,他们从索引 1 开始引用数组,产生了“大小差一”off by one错误。在长度为 5 的数组中,程序员在索引“5”处使用的值,实际上并不是数组的第 5 个元素。相反,它是内存中的一些其他值,根本与此数组无关。 这是一个数组越界的示例程序。该程序使用了一个只含有 5 个元素的数组,但却引用了该范围之外的数组元素: @@ -134,50 +134,50 @@ C 语言中,数组索引从零开始。这意味着对于长度为 10 的数 int main() { -  int i; -  int numbers[5]; -  int *array; + int i; + int numbers[5]; + int *array; -  /* test 1 */ + /* test 1 */ -  [puts][2]("This array has five elements (0 to 4)"); + puts("This array has five elements (0 to 4)"); -  /* initalize the array */ -  for (i = 0; i < 5; i++) { -    numbers[i] = i; -  } + /* initalize the array */ + for (i = 0; i < 5; i++) { + numbers[i] = i; + } -  /* oops, this goes beyond the array bounds: */ -  for (i = 0; i < 10; i++) { -    [printf][3]("  numbers[%d] = %d\n", i, numbers[i]); -  } + /* oops, this goes beyond the array bounds: */ + for (i = 0; i < 10; i++) { + printf(" numbers[%d] = %d\n", i, numbers[i]); + } -  /* test 2 */ + /* test 2 */ -  [puts][2]("malloc an array ..."); + puts("malloc an array ..."); -  array = [malloc][4](sizeof(int) * 5); + array = malloc(sizeof(int) * 5); -  if (array) { -    [puts][2]("This malloc'ed array also has five elements (0 to 4)"); + if (array) { + puts("This malloc'ed array also has five elements (0 to 4)"); -    /* initalize the array */ -    for (i = 0; i < 5; i++) { -      array[i] = i; -    } + /* initalize the array */ + for (i = 0; i < 5; i++) { + array[i] = i; + } -    /* oops, this goes beyond the array bounds: */ -    for (i = 0; i < 10; i++) { -      [printf][3]("  array[%d] = %d\n", i, array[i]); -    } + /* oops, this goes beyond the array bounds: */ + for (i = 0; i < 10; i++) { + printf(" array[%d] = %d\n", i, array[i]); + } -    [free][5](array); -  } + free(array); + } -  /* done */ + /* done */ -  [puts][2]("Ok"); -  return 0; + puts("Ok"); + return 0; } ``` @@ -210,10 +210,9 @@ This malloc'ed array also has five elements (0 to 4) Ok ``` -引用数组时,始终要记得追踪数组大小。将数组大小存储在变量中;不要对数组大小进行硬编码hard-code。否则,如果后期该标识符指向另一个不同大小的数组,却忘记更改硬编码的数组长度 -时,程序就可能会发生数组越界。 +引用数组时,始终要记得追踪数组大小。将数组大小存储在变量中;不要对数组大小进行硬编码hard-code。否则,如果后期该标识符指向另一个不同大小的数组,却忘记更改硬编码的数组长度时,程序就可能会发生数组越界。 -### 3\. 字符串溢出 +### 3、字符串溢出 字符串只是特定类型的数组。在 C 语言中,字符串是一个由 `char` 类型值组成的数组,其中用一个零字符表示字符串的结尾。 @@ -230,31 +229,31 @@ Ok int main() { -  char name[10];                       /* Such as "Chicago" */ -  int var1 = 1, var2 = 2; + char name[10]; /* Such as "Chicago" */ + int var1 = 1, var2 = 2; -  /* show initial values */ + /* show initial values */ -  [printf][3]("var1 = %d; var2 = %d\n", var1, var2); + printf("var1 = %d; var2 = %d\n", var1, var2); -  /* this is bad .. please don't use gets */ + /* this is bad .. please don't use gets */ -  [puts][2]("Where do you live?"); -  [gets][6](name); + puts("Where do you live?"); + gets(name); -  /* show ending values */ + /* show ending values */ -  [printf][3]("<%s> is length %d\n", name, [strlen][7](name)); -  [printf][3]("var1 = %d; var2 = %d\n", var1, var2); + printf("<%s> is length %d\n", name, strlen(name)); + printf("var1 = %d; var2 = %d\n", var1, var2); -  /* done */ + /* done */ -  [puts][2]("Ok"); -  return 0; + puts("Ok"); + return 0; } ``` -当您测试类似的短城市名称时,该程序运行良好,例如伊利诺伊州的`芝加哥`Chicago或北卡罗来纳州的`罗利`Raleigh: +当你测试类似的短城市名称时,该程序运行良好,例如伊利诺伊州的 `Chicago` 或北卡罗来纳州的`Raleigh`: ``` var1 = 1; var2 = 2 @@ -265,7 +264,7 @@ var1 = 1; var2 = 2 Ok ``` -威尔士小镇 `Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch` 有着世界上最长的名字之一。这个字符串有 58 个字符,远远超出了 `name` 变量中保留的 10 个字符。结果,程序将值存储在内存的其他区域,覆盖了 `var1` 和 `var2` 的值: +威尔士的小镇 `Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch` 有着世界上最长的名字之一。这个字符串有 58 个字符,远远超出了 `name` 变量中保留的 10 个字符。结果,程序将值存储在内存的其他区域,覆盖了 `var1` 和 `var2` 的值: ``` var1 = 1; var2 = 2 @@ -281,7 +280,7 @@ Segmentation fault (core dumped) 避免使用 `gets` 函数,改用更安全的方法来读取用户数据。例如,`getline` 函数会分配足够的内存来存储用户输入,因此不会因输入长值而发生意外的字符串溢出。 -### 4\. 重复释放内存 +### 4、重复释放内存 “分配的内存要手动释放”是良好的 C 语言编程原则之一。程序可以使用 `malloc` 函数为数组和字符串分配内存,该函数会开辟一块内存,并返回一个指向内存中起始地址的指针。之后,程序可以使用 `free` 函数释放内存,该函数会使用指针将内存标记为未使用。 @@ -294,23 +293,23 @@ Segmentation fault (core dumped) int main() { -  int *array; + int *array; -  [puts][2]("malloc an array ..."); + puts("malloc an array ..."); -  array = [malloc][4](sizeof(int) * 5); + array = malloc(sizeof(int) * 5); -  if (array) { -    [puts][2]("malloc succeeded"); + if (array) { + puts("malloc succeeded"); -    [puts][2]("Free the array..."); -    [free][5](array); -  } + puts("Free the array..."); + free(array); + } -  [puts][2]("Free the array..."); -  [free][5](array); + puts("Free the array..."); + free(array); -  [puts][2]("Ok"); + puts("Ok"); } ``` @@ -329,16 +328,14 @@ Aborted (core dumped) 例如,一个纸牌游戏程序可能会在主函数中为一副牌分配内存,然后在其他函数中使用这副牌来玩游戏。记得在主函数,而不是其他函数中释放内存。将 `malloc` 和 `free` 语句放在一起有助于避免多次释放内存。 -### 5\. 使用无效的文件指针 +### 5、使用无效的文件指针 -文件是一种便捷的数据存储方式。例如,你可以将程序的配置数据存储在 `config.dat` 文件中。Bash shell 会从用户家目录中的`.bash_profile` 读取初始化脚本。GNU Emacs 编辑器会寻找文件 `.emacs` 以从中确定起始值。而 Zoom 会议客户端使用 `zoomus.conf` 文件读取其程序配置。 +文件是一种便捷的数据存储方式。例如,你可以将程序的配置数据存储在 `config.dat` 文件中。Bash shell 会从用户家目录中的 `.bash_profile` 读取初始化脚本。GNU Emacs 编辑器会寻找文件 `.emacs` 以从中确定起始值。而 Zoom 会议客户端使用 `zoomus.conf` 文件读取其程序配置。 所以,从文件中读取数据的能力几乎对所有程序都很重要。但是假如要读取的文件不存在,会发生什么呢? 在 C 语言中读取文件,首先要用 `fopen` 函数打开文件,该函数会返回指向文件的流指针。你可以结合其他函数,使用这个指针来读取数据,例如 `fgetc` 会逐个字符地读取文件。 -If the file you want to read isn't there or isn't readable by your program, then the `fopen` function will return `NULL` as the file pointer, which is an indication the file pointer is invalid. But here's a sample program that innocently does not check if `fopen` returned `NULL` and tries to read the file regardless: - 如果要读取的文件不存在或程序没有读取权限,`fopen` 函数会返回 `NULL` 作为文件指针,这表示文件指针无效。但是这里有一个示例程序,它机械地直接去读取文件,不检查 `fopen` 是否返回了 `NULL`: ``` @@ -347,27 +344,27 @@ If the file you want to read isn't there or isn't readable by your program, then int main() { -  FILE *pfile; -  int ch; + FILE *pfile; + int ch; -  [puts][2]("Open the FILE.TXT file ..."); + puts("Open the FILE.TXT file ..."); -  pfile = [fopen][8]("FILE.TXT", "r"); + pfile = fopen("FILE.TXT", "r"); -  /* you should check if the file pointer is valid, but we skipped that */ + /* you should check if the file pointer is valid, but we skipped that */ -  [puts][2]("Now display the contents of FILE.TXT ..."); + puts("Now display the contents of FILE.TXT ..."); -  while ((ch = [fgetc][9](pfile)) != EOF) { -    [printf][3]("<%c>", ch); -  } + while ((ch = fgetc(pfile)) != EOF) { + printf("<%c>", ch); + } -  [fclose][10](pfile); + fclose(pfile); -  /* done */ + /* done */ -  [puts][2]("Ok"); -  return 0; + puts("Ok"); + return 0; } ``` @@ -381,7 +378,7 @@ Segmentation fault (core dumped) 始终检查文件指针以确保其有效。例如,在调用 `fopen` 打开一个文件后,用类似 `if (pfile != NULL)` 的语句检查指针,以确保指针是可以使用的。 -人都会犯错,最优秀的程序员也会产生编程 bug。但是,遵循上面这些准则,添加一些额外的代码来检查这五种类型的 bug,就可以避免最严重的 C 语言编程错误。提前编写几行代码来捕获这些错误,可能会帮你节省数小时的调试时间。 +人都会犯错,最优秀的程序员也会产生编程错误。但是,遵循上面这些准则,添加一些额外的代码来检查这五种类型的错误,就可以避免最严重的 C 语言编程错误。提前编写几行代码来捕获这些错误,可能会帮你节省数小时的调试时间。 -------------------------------------------------------------------------------- @@ -390,7 +387,7 @@ via: https://opensource.com/article/21/10/programming-bugs 作者:[Jim Hall][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 4d322f44dd8485c0b4481a716328a9308db1ae4f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 Oct 2021 17:42:53 +0800 Subject: [PATCH 0751/1588] PRF&PUB @unigeorge https://linux.cn/article-13894-1.html --- ...1014 5 common bugs in C programming and how to fix them.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211014 5 common bugs in C programming and how to fix them.md (99%) diff --git a/translated/tech/20211014 5 common bugs in C programming and how to fix them.md b/published/20211014 5 common bugs in C programming and how to fix them.md similarity index 99% rename from translated/tech/20211014 5 common bugs in C programming and how to fix them.md rename to published/20211014 5 common bugs in C programming and how to fix them.md index 184799af84..e7023e39e7 100644 --- a/translated/tech/20211014 5 common bugs in C programming and how to fix them.md +++ b/published/20211014 5 common bugs in C programming and how to fix them.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13894-1.html" C 语言编程中的 5 个常见错误及对应解决方案 ====== From 0ef0ca6a7b58549c81dbb53c65b8697ee18fb79e Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 18 Oct 2021 17:58:16 +0800 Subject: [PATCH 0752/1588] PRF&PUB @geekpi https://linux.cn/article-13895-1.html --- ... Google Chrome on Debian and Kali Linux.md | 53 +++++++++---------- 1 file changed, 26 insertions(+), 27 deletions(-) rename {translated/tech => published}/20211001 How to Install Google Chrome on Debian and Kali Linux.md (69%) diff --git a/translated/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md b/published/20211001 How to Install Google Chrome on Debian and Kali Linux.md similarity index 69% rename from translated/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md rename to published/20211001 How to Install Google Chrome on Debian and Kali Linux.md index 2b5aae849a..8e49872ca7 100644 --- a/translated/tech/20211001 How to Install Google Chrome on Debian and Kali Linux.md +++ b/published/20211001 How to Install Google Chrome on Debian and Kali Linux.md @@ -3,40 +3,39 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13895-1.html" -如何在 Debian 和 Kali Linux 上安装 Google Chrome +如何在 Debian 和 Kali Linux 上安装 Chrome 浏览器 ====== -Debian 和基于 Debian 的 Kali Linux 将 Firefox 作为默认的网络浏览器。但这并不意味着你不能在其中安装其他网络浏览器。 +> Debian 和基于 Debian 的 Kali Linux 将 Firefox 作为默认的网页浏览器。但这并不意味着你不能在其中安装其他网页浏览器。 -Google Chrome 浏览器非常流行,你可能已经在其他系统上使用它了。如果你想在 Debian 上安装 Chrome,你肯定可以这样做。 +![](https://img.linux.net.cn/data/attachment/album/202110/18/175716cfvxnvf05b5je1ax.jpg) -你在 Debian 的软件库中找不到 Google Chrome,因为它不是开源软件,但你可以从 Chrome 网站下载并安装它。 +Chrome 浏览器非常流行,你可能已经在其他系统上使用它了。如果你想在 Debian 上安装 Chrome,你肯定可以这样做。 + +你在 Debian 的软件库中找不到 Chrome,因为它不是开源软件,但你可以从 Chrome 网站下载并安装它。 在本教程中,我将向你展示在 Debian 上安装 Chrome 的两种方法: * GUI 方法 * 命令行方法 - - 让我们先从 GUI 方法开始。 -_**注意:我在这里的例子中使用的是 Debian,但由于 Kali Linux 是基于 Debian 的,所以同样的方法也适用于 Kali Linux。**_ - +> 注意:我在这里的例子中使用的是 Debian,但由于 Kali Linux 是基于 Debian 的,所以同样的方法也适用于 Kali Linux。 ### 方法 1: 在 Debian 上以图形方式安装 Chrome 浏览器 -这是一个不费吹灰之力的方法。你去 Google Chrome 网站,下载 deb 文件,然后双击它来安装它。我将详细地展示这些步骤,这样你就能很容易地掌握了。 +这是一个不费吹灰之力的方法。你去 Chrome 网站,下载 deb 文件,然后双击它来安装它。我将详细地展示这些步骤,这样你就能很容易地掌握了。 -前往 Google Chrome 的网站。 +前往 Chrome 的网站。 [Get Google Chrome][1] -你会看到下载 Google Chrome 的选项。 +你会看到下载 Chrome 的选项。 ![Click on the Download Chrome button][2] @@ -44,13 +43,13 @@ _**注意:我在这里的例子中使用的是 Debian,但由于 Kali Linux ![Download the Chrome installer file for Debian][3] -**请注意,谷歌浏览器不适用于 32 位系统。** +**请注意,Chrome 浏览器不适用于 32 位系统。** 接下来,你应该选择将文件保存到电脑中,而不是在软件中心打开进行安装。这样一来,下载的文件将被保存在下载文件夹中,而不是临时目录中。 ![Save the downloaded DEB file for Google Chrome][4] -进入下载文件夹,右击下载的 DEB 文件,选择用 Software Install 打开它。 +进入下载文件夹,右击下载的 DEB 文件,选择用 “Software Install” 打开它。 ![Right click on the downloaded DEB file and open with Software Install][5] @@ -62,7 +61,7 @@ _**注意:我在这里的例子中使用的是 Debian,但由于 Kali Linux ![Enter your account’s password][7] -在不到一分钟的时间里,Google Chrome 就会安装完毕。你现在应该看到一个删除选项,这表明软件已经安装完毕。 +在不到一分钟的时间里,Chrome 就会安装完毕。你现在应该看到一个删除选项,这表明软件已经安装完毕。 ![Chrome is now installed][8] @@ -74,27 +73,27 @@ _**注意:我在这里的例子中使用的是 Debian,但由于 Kali Linux ![][10] -如果你登录了你的谷歌账户,你应该可以在这里同步你的密码、书签和其他浏览数据。好好享受吧! +如果你登录了你的谷歌账户,你应该可以在这里同步你的密码、书签和其他浏览数据。好好体验吧! 还有一点,安装完 Chrome 后,你可以从系统中删除下载的 DEB 文件。不再需要它了,甚至在卸载 Chrome 时也不需要。 -### 方法 2:在 Debian 上从终端安装 Google Chrome +### 方法 2:在 Debian 上从终端安装 Chrome 你刚才看到的内容可以在终端中轻松实现。 -首先,确保你的软件包缓存已经刷新,并且你已经安装了wget,用于[在终端中从网上下载文件][11]。 +首先,确保你的软件包缓存已经刷新,并且你已经安装了 `wget`,用于 [在终端中从网上下载文件][11]。 ``` sudo apt update && sudo apt install wget ``` -接下来是下载 Google Chrome 的 .deb 文件。 +接下来是下载 Chrome 的 .deb 文件。 ``` wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb ``` -下载后,你可以用 apt 命令[在终端安装 deb 文件][12],像这样: +下载后,你可以用 `apt` 命令 [在终端安装 deb 文件][12],像这样: ``` sudo apt install ./google-chrome-stable_current_amd64.deb @@ -102,21 +101,21 @@ sudo apt install ./google-chrome-stable_current_amd64.deb 安装完成后,你就可以开始使用 Chrome 了。 -### 额外提示:更新 Google Chrome +### 额外提示:更新 Chrome -这两种方法都会将谷歌的软件库添加到你的系统中。你可以在你的 sources.lis.d 目录中看到它: +这两种方法都会将谷歌的软件库添加到你的系统中。你可以在你的 `sources.list.d` 目录中看到它: ``` cat /etc/apt/sources.list.d/google-chrome.list ``` -这意味着 Google Chrome 将与 Debian 和 Kali Linux 中的其他系统更新一起被更新。你知道[如何在命令行中更新你的 Kali Linux][13] 或 Debian 系统么?只要使用这个命令: +这意味着 Chrome 将与 Debian 和 Kali Linux 中的其他系统更新一起被更新。你知道 [如何在命令行中更新你的 Kali Linux][13] 或 Debian 系统么?只要使用这个命令: ``` sudo apt update && sudo apt upgrade -y ``` -### 从你的系统中卸载 Google Chrome +### 从你的系统中卸载 Chrome 即使你选择用 GUI 方法在 Debian 上安装 Chrome,你也必须使用终端来删除它。 @@ -139,7 +138,7 @@ via: https://itsfoss.com/install-chrome-debian-kali-linux/ 作者:[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 c33be1a0faf22022cb3b07b703d736ac2852a47b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 19 Oct 2021 05:02:31 +0800 Subject: [PATCH 0753/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211019?= =?UTF-8?q?=20Annotator:=20Open-Source=20App=20for=20Linux=20to=20Easily?= =?UTF-8?q?=20Add=20Essential=20Annotations=20to=20Your=20Images?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md --- ...dd Essential Annotations to Your Images.md | 95 +++++++++++++++++++ 1 file changed, 95 insertions(+) create mode 100644 sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md diff --git a/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md b/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md new file mode 100644 index 0000000000..5b0ab80344 --- /dev/null +++ b/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md @@ -0,0 +1,95 @@ +[#]: subject: "Annotator: Open-Source App for Linux to Easily Add Essential Annotations to Your Images" +[#]: via: "https://itsfoss.com/annotator/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Annotator: Open-Source App for Linux to Easily Add Essential Annotations to Your Images +====== + +_**Brief:**_ _An exciting and useful annotation tool with additional features for Linux systems._ + +When it comes to image manipulation and editing, there are many tools available. However, options like GIMP are not necessarily the solution to everything. + +Yes, GIMP offers plenty of features for beginners and advanced users, but it could be time-consuming to learn something and apply visual enhancements to any image you want. + +Annotator is an impressive open-source tool that lets you do a lot of things in a couple of clicks. + +### Annotator: Open-Source Image Annotation Tool + +![][1] + +Annotator lets you quickly add shapes, texts, and other visual elements. This is useful for a variety of use-cases. + +The tool is easy to use and offers a simple user interface. And, you also get a variety of features to enhance the images you want. + +### Features of Annotator + +![Adding icons to images][2] + +Not just limited to adding enhancements to an image, but you also get some other functionalities with Annotator. Some of the key features are: + + * Ability to add a text + * Customize the text color, adjust the size, tweak the highlight color, and more + * Use magnifying tool to focus on a particular point in image + * Tweak the magnifier to change the angle, and size + * Add visual icons to express something + * Use pencil to write, useful for trackpad users + * Blur tool to obfuscate important or unnecessary details + * Counter icons to highlight important any sort of order in an image + * Supports multiple fonts + * Adjust the border width and lines for shapes and texts + * Various shapes like arrow, circle, and star available + * Ability to resize and crop images + + + +![][3] + +### Installing Annotator in Linux + +Primarily, Annotator is available on AppCenter for elementaryOS. But, fortunately, it is a Flatpak package, so that you can install it on any Linux distribution. + +All you need to do is head to the AppCenter store’s link and then download/open the **Flatpak ref** file using the software installer. We have more information on this in our [Flatpak guide][4], if you need help. + +[Annotator][5] + +To build from the source or explore more about it, you can check out its [GitHub page][6]. + +### Thoughts on Using Annotator + +I find it useful for my work, considering we need to deal with various screenshots every day. And, the more descriptive, the better the images for our readers to understand. + +Usually, I use Flameshot as my screenshot tool and add annotations available through it. There are other [screenshot tools available for Linux][7], but I prefer Flameshot for its quick annotation features. + +However, you cannot use Flameshot or any other screenshot tool to add annotations to existing images. + +Hence, Annotator came in handy to edit existing screenshots or any other images needed. + +All of its features worked well in my brief usage, but I’d want to edit and re-size the text to be more intuitive. Other than that, I have no complaints. + +I’d recommend you give this a try if you need to add highlights/annotations to the images on your system. Let me know your thoughts in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/annotator/ + +作者:[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/10/annotator.png?resize=800%2C573&ssl=1 +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/annotator-screenshot.png?resize=800%2C410&ssl=1 +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/annotator-resize.png?resize=800%2C490&ssl=1 +[4]: https://itsfoss.com/flatpak-guide/ +[5]: https://appcenter.elementary.io/com.github.phase1geo.annotator/ +[6]: https://github.com/phase1geo/Annotator +[7]: https://itsfoss.com/take-screenshot-linux/ From 857f1eec4decc33f7584676e9a9d2b61f56626b0 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 19 Oct 2021 05:02:45 +0800 Subject: [PATCH 0754/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211019?= =?UTF-8?q?=20Linux=20Tablets:=20What=20are=20Your=20Options=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211019 Linux Tablets- What are Your Options.md --- ...19 Linux Tablets- What are Your Options.md | 136 ++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 sources/tech/20211019 Linux Tablets- What are Your Options.md diff --git a/sources/tech/20211019 Linux Tablets- What are Your Options.md b/sources/tech/20211019 Linux Tablets- What are Your Options.md new file mode 100644 index 0000000000..3fcc869aa6 --- /dev/null +++ b/sources/tech/20211019 Linux Tablets- What are Your Options.md @@ -0,0 +1,136 @@ +[#]: subject: "Linux Tablets: What are Your Options?" +[#]: via: "https://itsfoss.com/linux-tablets/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Linux Tablets: What are Your Options? +====== + +There are plenty of [Linux-based laptops available][1]. There are also [mini-PCs preloaded with Linux][2]. + +A few [Linux-based smartphones][3] are also present in the market. + +How about tablets? Are there some good Linux-based tablets? The answer is not straightforward. + +Many Linux-only system manufacturers focus on creating desktop computers. This is primarily due to the fact that the Linux experience on touch devices is no where close to what Android and iOS provide. + +Does this mean you cannot use Linux on a tablet? Not really. There are a few options available for the early adapters and DIY tinkerers. Let’s see what options do you have in the name of Linux tablets. + +### Ubuntu Touch + +![Ubuntu Touch OS on BQ tablets][4] + +Alright! This is not a gadget but an operating system. But this does give you option to install a touch-friendly version of Ubuntu on some old Android tablet. + +Mind the word ‘some’. Officially, Ubuntu Touch [supports][5] on Nexus 7, Lenovo M10, Xperia Z4 and BQ Aquaris tablets. You may even try to install Ubuntu Touch on some other tablet of yours. It may not work 100% but could still be pretty much useable. + +Ubuntu Touch was a project by Ubuntu team but they [discontinued it in 2017][6]. [UBports][7] has taken the responsibility of continuing this project and they are doing a good job at it with their limited resources. + +All in all, if you have an experimental temperament and want to give another life to your old Android tablet, Ubuntu Touch could be your weekend project. + +[Ubuntu Touch][8] + +### Pine Tab + +![PineTab][9] + +Pine64 started with its single board computer Pine A64 as a [Raspberry Pi alternative][10]. It launched several Pine-branded products over the time. This list includes low cast [PineTime smartwatch][11], Pinebook laptop, PinePhone smartphone and PineTab tablet. + +These Pine devices are often inexpensive and allow the user full control on the gadget. This tinkering attitude has helped it gathered a huge fan following of open source DIY enthusiasts. + +The PineTab basically uses the same component as the Pine64 single board computers with touchscreen and keyboard. It’s not the prettiest looking gadget out there but then, it does not intend to be one. + +The specifications are basic with an HD IPS capacitive touchscreen, Allwinner A64 chipset, Quad-core CPU and 2 GB RAM. + +It’s not something that can compete with an iPad or Galaxy Tab but it allows you to install a distribution of your choice and configure it as you want. + +Please keep in mind that Pine has limited stock, so consider yourself lucky if you can see this device available for purchase. + +[PineTab][12] + +### PineNote + +![PineNote][13] + +Another Pine device that is slightly different from the PineTab you saw in the previous section. + +The PineTab is a Linux tablet for browsing internet, using applications and playing games. The PineNote is for taking notes and reading books and documents. + +It has a Eink display that you may have seen on e-book readers like Kindle. Apart from letting you experience an e-book reader, PineNote also allows you to take note with a Wacom Pen. + +PineNote has Quad-core Rockchip, multi-touch Eink panel, 4 GB RAm and 128 GB eMMC storage. It is also one of the rare few gadgets that has a higher than usual price tag of $399. + +Please keep in mind that PineNote is in early developments and is accepting orders only from developers. + +[PineNote][14] + +### JingPad + +![JingPad on my desk][15] + +Perhaps one of the rare few projects that aim to provide a ‘consumer level Linux tablet’. They have premium, custom hardware on the high end side. It has 11″ 2K AMOLED displaym 8 GB RAM, Unisoc Tiger T7510 Octa Core processor along with magnetic keyboard. + +Altogether, things look quite good on the paper, at least from the hardware perspective. Premium hardware comes at premium pricing, of course. The device could cost between $600-$800. + +JingPad also has its own Linux based, touch-friendly operating system called JingOS. The operating system is still under heavy development and should be ready by end of first quarter of 2022. + +Want to know more about JingPad? Read [my experience with JingPad and JingOS in this detailed review][16]. + +[JingPad][17] + +### RasPad + +![RasPad][18] + +RasPad is a kit for Raspberry Pi devices to turn it into a functional touch based device. Unlike the regular tabs, this is not a flat device but has a wedge shaped body. This makes it easier to use at desks. + +RasPad is created specially for Raspberry Pi devices and you can use most of its ports easily. There is a dedicated RasPad OS but you are free to use the regular Raspbian OS or Ubuntu or any other Raspberry Pi operating system. Do consider touch friendliness while choosing the OS. + +Please keep in mind that Raspberry Pi device is NOT included in the kit. You’ll have to buy it separately. + +[RasPad][19] + +### What’s your choice? + +I know we are still far from a good alternative Linux tablet that could compete with at least the Android tablets in the market. But at least we have some options available and that’s a silver lining. + +Do you already own any of the above listed devices? How is your experience with it? + +If you had to choose only one of them, which is your choice for the ideal Linux tablet? + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/linux-tablets/ + +作者:[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/get-linux-laptops/ +[2]: https://itsfoss.com/linux-based-mini-pc/ +[3]: https://itsfoss.com/linux-phones/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/ubuntu-touch.jpg?resize=755%2C537&ssl=1 +[5]: https://devices.ubuntu-touch.io/ +[6]: https://itsfoss.com/ubuntu-unity-shutdown/ +[7]: https://ubports.com/ +[8]: https://ubuntu-touch.io/ +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/PineTab.jpg?resize=800%2C742&ssl=1 +[10]: https://itsfoss.com/raspberry-pi-alternatives/ +[11]: https://itsfoss.com/pinetime-linux-smartwatch/ +[12]: https://pine64.com/product/pinetab-10-1-linux-tablet-with-detached-backlit-keyboard/?v=0446c16e2e66 +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/PineNote-tab.jpg?resize=800%2C615&ssl=1 +[14]: https://www.pine64.org/pinenote/ +[15]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/09/jingpad-keyboard-angle.webp?resize=800%2C600&ssl=1 +[16]: https://itsfoss.com/jingpad-a1-review/ +[17]: https://en.jingos.com/jingpad-a1/ +[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/raspad.webp?resize=800%2C614&ssl=1 +[19]: https://raspad.com/products/raspadv3 From fd41c091c7d34cc90c2f19583ed09f1e29a929ac Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 19 Oct 2021 05:03:01 +0800 Subject: [PATCH 0755/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211019?= =?UTF-8?q?=20What=20is=20Build=20Essential=20Package=20in=20Ubuntu=3F=20H?= =?UTF-8?q?ow=20to=20Install=20it=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211019 What is Build Essential Package in Ubuntu- How to Install it.md --- ...al Package in Ubuntu- How to Install it.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20211019 What is Build Essential Package in Ubuntu- How to Install it.md diff --git a/sources/tech/20211019 What is Build Essential Package in Ubuntu- How to Install it.md b/sources/tech/20211019 What is Build Essential Package in Ubuntu- How to Install it.md new file mode 100644 index 0000000000..5157311fb6 --- /dev/null +++ b/sources/tech/20211019 What is Build Essential Package in Ubuntu- How to Install it.md @@ -0,0 +1,114 @@ +[#]: subject: "What is Build Essential Package in Ubuntu? How to Install it?" +[#]: via: "https://itsfoss.com/build-essential-ubuntu/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What is Build Essential Package in Ubuntu? How to Install it? +====== + +_**Brief: This is a quick tip to inform new Ubuntu users about the build-essential package, its usefulness and the installation steps.**_ + +Installing build-essential package in Ubuntu is as simple as typing this command in the terminal: + +``` +sudo apt update && sudo apt install build-essential +``` + +But there are several questions around it that you may want answers to: + + * What is build essential package? + * What does it contain? + * Why should you install it (if install at all)? + * How to install it? + * How to remove it? + + + +### What is build-essential package in Ubuntu? + +The build-essential package actually belongs to Debian. It is not a piece of software in itself. It contains a list of packages that are required to create a Debian package (deb). These packages are libc, gcc, g++, make, dpkg-dev etc. The build-essential package contains those required packages as dependencies, so when you install build-essential, you install all those packages in one single command. + +Please do NOT consider build-essential to be a super package that will magically install all kind of development tools from Ruby to Go for you in a single command. It has some development tool but not all. + +#### Why would you want to install build-essential package? + +It is used for creating DEB packages from the source code of an application. An average user does not go around creating DEB packages everyday, right? + +However, some users may use their Ubuntu Linux system for software development. You want to [run c program in Ubuntu][1], you need gcc compiler. You want to [run C++ programs in Ubuntu][2], you need g++ compiler. If you have to use an unusual software that is only available from the source code, your system will throw [make command not found error][3] because you need to install make tool first. + +All this can be installed individually, of course. However, it is much easier to take advantage of the build-essential package and install all these development tools at once. That’s the benefit you get. + +It is like the [ubuntu-restricted-extras package that allows you to install several media codecs][4] at once. + +Now that you know the advantage of this package, let’s see how to install it. + +### Installing build-essential package in Ubuntu Linux + +![][5] + +Open a terminal in Ubuntu by pressing the Ctrl+Alt+T shortcut and enter the following command: + +``` +sudo apt update +``` + +With sudo command, you’ll be asked to enter your account’s password. When you type it, nothing is displayed on the screen. That is fine. That’s how it works in most Linux systems. Type your password blindly and press enter. + +![][6] + +The apt update command refreshes the local package cache. This is essential for a fresh Ubuntu install. + +After that, run the following command to install build-essential tool: + +``` +sudo apt install build-essential +``` + +It should show all the packages it is going to install. Press Y when asked for confirmation: + +![][7] + +Wait a bit for the installation to complete. That’s it. + +### Removing build-essential tool from Ubuntu + +Keeping those development tools won’t harm your system. but if you are running low on the disk space, you may consider removing it. + +Removing software is easy in Ubuntu thanks to the apt remove command: + +``` +sudo apt remove build-essential +``` + +It will be a good idea to run the autoremove command to remove the residual dependency packages as well: + +``` +sudo apt autoremove +``` + +You know all the essential about build-essential package now (pun intended). Enjoy it :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/build-essential-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/run-c-program-linux/ +[2]: https://itsfoss.com/c-plus-plus-ubuntu/ +[3]: https://itsfoss.com/make-command-not-found-ubuntu/ +[4]: https://itsfoss.com/install-media-codecs-ubuntu/ +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/Build-Essential-Ubuntu.png?resize=800%2C450&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/apt-update.png?resize=800%2C467&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/install-build-essential-ubuntu.png?resize=800%2C434&ssl=1 From 5ac84d700d28175bc3f60ff58f32eb1b0e01b59b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 19 Oct 2021 05:03:23 +0800 Subject: [PATCH 0756/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211018?= =?UTF-8?q?=204=20Linux=20tools=20to=20erase=20your=20data?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211018 4 Linux tools to erase your data.md --- ...211018 4 Linux tools to erase your data.md | 123 ++++++++++++++++++ 1 file changed, 123 insertions(+) create mode 100644 sources/tech/20211018 4 Linux tools to erase your data.md diff --git a/sources/tech/20211018 4 Linux tools to erase your data.md b/sources/tech/20211018 4 Linux tools to erase your data.md new file mode 100644 index 0000000000..89a5cdee96 --- /dev/null +++ b/sources/tech/20211018 4 Linux tools to erase your data.md @@ -0,0 +1,123 @@ +[#]: subject: "4 Linux tools to erase your data" +[#]: via: "https://opensource.com/article/21/10/linux-tools-erase-data" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 Linux tools to erase your data +====== +Erase data from your hard disk drive with these open source tools. +![Tools in a cloud][1] + +One of the best ways to keep your data secure is by only writing data to an encrypted hard drive. On a standard drive, it's possible to view data just by mounting the drive as if it were a thumb drive, and it's even possible to display and recover even deleted data with tools like [Scalpel][2] and [Testdisk][3]. But on an encrypted drive, data is unreadable without a decryption key (usually a passphrase you enter when mounting the drive.) + +Encryption can be established when you install your OS, and some operating systems even make it possible to activate encryption any time after installation. + +What do you do when you're selling a computer or replacing a drive that never got encrypted in the first place, though? + +The next best thing to encrypting your data from the start is by erasing the data when you're finished with the drive. + +### Responsible caretaker + +I'm frequently called on to help clients upgrade an old computer. Invariably, they're more than willing to help me recycle them so that they can be used by someone else. I'm happy to refurbish these older computers and refit them with a newer solid-state drive, dramatically improving performance. + +However, it's not a good idea to just throw an old drive in the trash. It needs to be erased and then disposed of properly. Rather than leave the drives in the original computer, I remove them, place them in a drive enclosure, and connect them to my Linux computer. Several Linux utilities can easily accomplish this. One of them is the **Gnu Shred** tool. + +### GNU Shred + + +``` +`$ sudo shred -vfz /dev/sdX` +``` + +Shred has many options: + + * n - the number of overwrites. The default is three. + * u - overwrite and delete. + * s - the number of bytes to shred. + * v - show extended information. + * f - force the change of permissions to allow writing if necessary. + * z - add a final overwrite with zeros to hide shredding. + + + +Use `shred --help` for more information + +### ShredOS + +ShredOS is a live Linux distribution with the sole purpose of erasing the entire contents of a drive. It was developed after a similar distribution, called DBAN, was discontinued. It uses the `nwipe` application, which is a fork of DBAN's `dwipe`. You can make a bootable USB drive by downloading the 32 bit or 64 bit image and writing it to a drive with the `dd` command on Linux and macOS: + + +``` +`$ sudo dd if=shredos.img of=/dev/sdX bs=4M status=progress` +``` + +Alternately, you can use the [Etcher][4] tool on Linux, macOS, and Windows. + +### The dd command + +A common method for erasing drives is with the Linux `dd` command. Nearly every Linux installation comes with the `dd` utility installed. Make sure that the drive is not mounted. + + +``` +`$ sudo umount /dev/sdXY -l` +``` + +If you want to write zeros over your entire target disk, issue the following command. It will probably be an overnight job. + + +``` +`$ sudo dd if=/dev/urandom of=/dev/sdX bs=10M` +``` + +**Warning**: Be sure that you know where you are on your system and target the correct drive so that you don't accidentally erase your own data. + +### Nvme-cli + +If your computer contains one of the newer NVMe drives, you can install the [nvme-cli][5] utilities and use the `sanitize` option to erase your drive. + +The command `nvme sanitize help` command provides you with a list of sanitize options, which include the following: + + * \--no-dealloc, -d - No deallocate after sanitize. + * \--oipbp, -i - Overwrite invert pattern between passes. + * \--owpass=, -n - Overwrite pass count. + * \--ause, -u - Allow unrestricted sanitize exit. + * \--sanact=, -a - Sanitize action. + * \--ovrpat=, -p - Overwrite pattern. + + + +Here is the command I use: + + +``` +`$ sudo nvme sanitize /dev/nvme0nX` +``` + +The same warnings apply here as with the format process: back up important data first because this command erases it! + +### Information management + +The information you keep on your computer is important. It belongs to you and to know one else. When you're selling off a computer or disposing of a hard drive, make sure you've cleared it of your data with one of these great tools. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-tools-erase-data + +作者:[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/cloud_tools_hardware.png?itok=PGjJenqT (Tools in a cloud) +[2]: https://www.redhat.com/sysadmin/find-lost-files-scalpel +[3]: https://www.redhat.com/sysadmin/recover-partition-files-testdisk +[4]: https://opensource.com/article/18/7/getting-started-etcherio +[5]: https://opensource.com/article/21/9/nvme-cli From f61a0e1088b30ecaa1b293884bc0957d8a7d8cc1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 19 Oct 2021 05:03:37 +0800 Subject: [PATCH 0757/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211018?= =?UTF-8?q?=20Get=20memory=20use=20statistics=20with=20this=20Linux=20comm?= =?UTF-8?q?and-line=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md --- ...stics with this Linux command-line tool.md | 126 ++++++++++++++++++ 1 file changed, 126 insertions(+) create mode 100644 sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md diff --git a/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md b/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md new file mode 100644 index 0000000000..85b30408bc --- /dev/null +++ b/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md @@ -0,0 +1,126 @@ +[#]: subject: "Get memory use statistics with this Linux command-line tool" +[#]: via: "https://opensource.com/article/21/10/memory-stats-linux-smem" +[#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Get memory use statistics with this Linux command-line tool +====== +The smem command allows you to quickly view your web applications' +memory use. +![Programming at a browser, orange hands][1] + +In my programming work, I often need to know the memory used by web applications. A rough estimate is usually enough before getting down to details and browser profiling tools. + +To interrogate memory use on Linux or macOS, people typically use [top][2] or [htop][3]. I'd love to see a single number: How much RAM did a process take. But statistics shown by these utilities can be hard to understand. With web browsers, it's even more complicated because they often run many separate processes. They all show up in top output as a long list, each with its own individual metrics. + +![Memory usage using htop][4] + +(Tomasz Waraksa, [CC BY-SA 4.0][5]) + +### Enter smem command + +Luckily there is [smem][6], another command-line utility for viewing memory use statistics. Install it with your package manager of choice, for example: + + +``` +`sudo apt install smem` +``` + +To get total memory use by [Firefox][7], do: + + +``` +`smem -c pss -P firefox -k -t | tail -n 1` +``` + +What happens here? + + * `-c` switch specifies columns to show. I'm only interested in _the pss_ column, which shows memory allocated by a process. + * `-P` switch filters processes to include only those with _firefox_ in the name + * `-k` switch tells to show memory use in mega/gigabytes instead of plain bytes + * `-t` switch displays the totals + * `tail -n 1` filter outputs only the last line, just where the totals are + + + +The output is as simple as it gets: + + +``` +$ smem -t -k -c pss -P firefox | tail -n 1 +4.9G +``` + +Straight to the point! And, after another busy day of work, with over fifty opened tabs, Firefox still uses only 5 GB. Take that, Google Chrome ;-) + +#### Even easier with a script + +For convenience, create a little script named `memory-use`, which takes the process name as a parameter. I keep all my scripts in `~/bin`, so: + + +``` +`echo 'smem -c pss -P "$1" -k -t | tail -n 1' > ~/bin/memory-use && chmod +x ~/bin/memory-use` +``` + +Now I can measure memory use of any application as easy as: + + +``` +memory-use firefox +memory-use chrome +memory-use slack +``` + +#### And there is even more! + +The utility can do much more than show the total memory use. It can even generate graphic output. + +For example: + + +``` +`smem --pie name -c pss` +``` + +Shows something like this: + +![Pie chart output from smem][8] + +(Tomasz Waraksa, [CC BY-SA 4.0][5]) + +For more details, I recommend looking into [smem man pages][6]. + +You can find another great tutorial at . + +Enjoy! + +* * * + +_This article originally appeared on the [author's blog][9] and is republished with permission._ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/memory-stats-linux-smem + +作者:[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/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) +[2]: https://linux.die.net/man/1/top +[3]: https://linux.die.net/man/1/htop +[4]: https://opensource.com/sites/default/files/uploads/1_htop.png (Memory usage using htop) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://linux.die.net/man/8/smem +[7]: https://www.mozilla.org/en-US/firefox/ +[8]: https://opensource.com/sites/default/files/uploads/2_smem-pie-chart.png (Pie chart output from smem) +[9]: https://letsdebug.it/post/26-measure-application-memory-use-on-linux/ From a63fdcd414fb6dabf3d783753c0bfd8801d94aa5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 19 Oct 2021 05:04:29 +0800 Subject: [PATCH 0758/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211019?= =?UTF-8?q?=20Dash=20to=20Dock=20is=20Finally=20Available=20for=20GNOME=20?= =?UTF-8?q?40?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md --- ... Dock is Finally Available for GNOME 40.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md diff --git a/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md b/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md new file mode 100644 index 0000000000..a87279cce7 --- /dev/null +++ b/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md @@ -0,0 +1,71 @@ +[#]: subject: "Dash to Dock is Finally Available for GNOME 40" +[#]: via: "https://news.itsfoss.com/dash-to-dock-gnome-40/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Dash to Dock is Finally Available for GNOME 40 +====== + +Dash to Dock is one of the most [useful GNOME extensions][1] for years now. With the introduction of [GNOME 40][2], many failed to make the extension work with it. + +Of course, being a popular option, the support for GNOME 40 was expected to be added soon enough. And, finally, it is here! + +If you did not know, GNOME 40 includes a horizontal workspace view, which affected the workflow for some, but Ubuntu did not move the dock even with GNOME 40. + +So, you can still use Dash to Dock to get a horizontal dock from the overview area. + +### Dash to Dock v70 Drops Support for Older GNOME Shells + +![][3] + +With Dash to Dock v70, you get the necessary support for GNOME 40 and accurately GNOME shell 3.34. + +However, the technical changes made to the extension to support GNOME 40 also meant that the new version could no longer work with older versions. + +If you are not running GNOME 40, you can still use the older v69, which should work well. And, except GNOME 40 support addition, there’s nothing different feature-wise. + +It will be interesting to see future releases for the extension from now on. Will they consider adding two different packages with new features for various Gnome shells? Let us wait for that. + +### Here’s How To Install Dash to Dock + +![][4] + +You can install the extension right from the [GNOME extension website][5] with a simple toggle. In case you are new to this, I recommend going through our [guide on installing GNOME extensions][6] to get started. + +[Dash to Dock GNOME Extension][5] + +It is worth noting that you need to use a compatible web browser to install the extension. While it should work with most browsers ([Chromium-based browsers][7] should work), Firefox’s snap-packaged browser in Ubuntu 21.10 may not work, as reported initially by [OMG!Ubuntu][8]. + +Have you tried the extension yet? Feel free to 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/dash-to-dock-gnome-40/ + +作者:[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/best-gnome-extensions/ +[2]: https://news.itsfoss.com/gnome-40-release/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI1MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://extensions.gnome.org/extension/307/dash-to-dock/ +[6]: https://itsfoss.com/gnome-shell-extensions/ +[7]: https://news.itsfoss.com/chrome-like-browsers-2021/ +[8]: https://www.omgubuntu.co.uk/2021/10/dash-to-dock-official-gnome-40-support? From 38cbf81c4475b75ea6bf041efac770cbd7157657 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 19 Oct 2021 05:04:43 +0800 Subject: [PATCH 0759/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211018?= =?UTF-8?q?=20PinePhone=20Pro=20is=20an=20Affordable=20Linux=20Flagship=20?= =?UTF-8?q?Smartphone=20That=20Could=20Replace=20Your=20Android?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md --- ...rtphone That Could Replace Your Android.md | 118 ++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md diff --git a/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md b/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md new file mode 100644 index 0000000000..d1d1592103 --- /dev/null +++ b/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md @@ -0,0 +1,118 @@ +[#]: subject: "PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android" +[#]: via: "https://news.itsfoss.com/pinephone-pro-introduced/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android +====== + +Back in 2019, when Pine64 announced the PinePhone, no one expected it to become as popular. Within just two years, Pine64 has managed to build a community of tens of thousands of developers and users, all working together to make Linux usable on a mobile phone. + +Now, Pine64 is widening the audience for Linux phones with the announcement of the PinePhone Pro. This device has many incredible new features, all of which put it on par with many mid-range Android phones. + +### PinePhone Pro Features + +![][1] + +Compared to the original PinePhone, the PinePhone Pro is a massive upgrade. The most notable of these upgrades is the usage of the Rockchip Hexa-core RK3399S SoC, which should provide a significant performance boost. Some other notable features and upgrades include: + + * 4GB LPDDR4 RAM + * 128GB storage + microSD card slot + * 6″ IPS display with ** Gorilla Glass 4* * + * 13 MP (rear) + 5 MP (front) cameras + + + +Let us explore more details on that. + +#### Better Performance + +![][2] + +By far the most significant upgrade, the inclusion of the RK3399S SoC is the result of a collaborative effort by Pine64 and Rockchip. This impressively powerful SoC packs 6 CPU cores, as well as a quad-core Mali T860 GPU. + +This combination delivers significant performance gains, putting the PinePhone Pro in a similar performance bracket to most mid-range Android phones. The result is a much faster system capable of running many desktop-class applications such as GIMP for photo editing and RetroArch for emulation. + +![][3] + +Overall, this upgrade will significantly improve the user experience for both developers and consumers. + +#### More Memory (RAM) + +Considering when smartphones have started to offer 6 GB RAM as the base variants, a Linux smartphone should also use extra memory to keep things smooth. Although a lot of work has gone into optimizing this, more RAM is always beneficial. + +The PinePhone Pro offers 4 GB of RAM, allowing greater versatility when docked and a few more open applications when used as a phone. I’m pretty excited about this, as it should enable more games to be emulated, increasing the PinePhone Pro’s appeal as an entertainment device. + +#### Upgraded Storage + +One of the biggest challenges I faced with my original PinePhone was the lack of storage. From watching movies to playing emulated games, I constantly had to delete files to have enough storage. + +With the PinePhone Pro, however, Pine64 has fixed this, offering it with 128 GB of flash storage, which should be enough for anyone. + +#### Improved Display + +![][4] + +While not precisely a sore point of the original PinePhone, the display has been upgraded with the PinePhone Pro to be larger and have Gorilla Glass 4. This is highly welcome, as the phone should now offer significantly improved scratch resistance and more usable screen real estate. + +While it would have been nice to see an AMOLED panel, this would have increased the price somewhat, possibly reducing the device’s appeal. Overall, I am happy with this upgrade, and I’m sure many users will be too. + +#### Essential Camera Upgrades + +For me, at least, the original PinePhone’s cameras were a pretty big sore point. The primary shooter, which was just 5 MP, was accompanied by a tiny 2 MP front camera, neither of which produced very high-quality images. + +The main shooter from the original PinePhone has been moved to the front of the PinePhone Pro. This is paired with a 13 MP Sony sensor capable of 4K video recording and much higher quality images. + +Users can finally utilize their Linux smartphones to take photos to share across social media platforms. + +### Can You Upgrade Your Original PinePhone? + +This was one of the first questions I asked when I saw the announcement. Unfortunately, it is not feasible to upgrade your PinePhone to a PinePhone Pro mainboard. I think Pine64 explains it pretty well: + +> While the PinePhone Pro’s mainboard will fit the PinePhone, the chassis, IPS display panel, cameras, the daughterboard, and thermal dissipation systems are all different. For instance, the PinePhone Pro’s cameras will not fit into the PinePhone chassis and are electrically incompatible with PinePhone Pro’s mainboard. Thermal dissipation is another important consideration, as the higher heat output may not be trivial to overcome in the original PinePhone’s chassis. + +Although Pine64 doesn’t recommend upgrading your original PinePhone’s mainboard, I think it would still be interesting to see what could be achieved by trying. While disappointing, it should also be noted that Pine64 has no intention of stopping the development of the original PinePhone, as it is perfect for people wanting a cheap Linux phone for fundamental usage. + +### Wrapping Up + +Overall, I am incredibly excited to see yet another device enter the Linux phone market, especially one as well-supported as the PinePhone Pro will (hopefully) be. Despite the **$399** price tag, I think that many people will flock to buy this phone. + +If you think you might be one of those people, you will have to wait a few months for the official release. + +However, developers wanting to receive an early unit can now click the button below to preorder the PinePhone Pro. + +For more details on the availability and specifications of PinePhone Pro, you should head to their [official website][5]. + +[Preorder The PinePhone Pro][6] + +_Are you going to get a PinePhone Pro?_ _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/pinephone-pro-introduced/ + +作者:[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,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://i0.wp.com/i.ytimg.com/vi/pCxDcMdr_fo/hqdefault.jpg?w=780&ssl=1 +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY1NyIgd2lkdGg9IjQ2NSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://www.pine64.org/pinephonepro/ +[6]: https://preorder.pine64.org/ From 86ec10871640b8fe6c2ef7bcd07a5dbd9089a511 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 19 Oct 2021 08:54:29 +0800 Subject: [PATCH 0760/1588] translated --- ...3 5 markdown editors I recommend trying.md | 85 ------------------- ...3 5 markdown editors I recommend trying.md | 84 ++++++++++++++++++ 2 files changed, 84 insertions(+), 85 deletions(-) delete mode 100644 sources/tech/20211013 5 markdown editors I recommend trying.md create mode 100644 translated/tech/20211013 5 markdown editors I recommend trying.md diff --git a/sources/tech/20211013 5 markdown editors I recommend trying.md b/sources/tech/20211013 5 markdown editors I recommend trying.md deleted file mode 100644 index 7ebbe75afe..0000000000 --- a/sources/tech/20211013 5 markdown editors I recommend trying.md +++ /dev/null @@ -1,85 +0,0 @@ -[#]: subject: "5 markdown editors I recommend trying" -[#]: via: "https://opensource.com/article/21/10/markdown-editors" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -5 markdown editors I recommend trying -====== -Everyone has their favorite markdown editor. Here are a few I have -tried. -![A pink typewriter][1] - -You can use markdown for anything—formatting websites, authoring books, and writing technical documentation are just some of its uses. I love how easy it is to create rich documents. Everyone has their favorite markdown editor. I have used several on my markdown journey. Here are five markdown editors I have considered.  - - 1. [Abricotine][2] is an open source editor released under the [GPL v.3.0][3]. You can enter formatting by hand or use the menu to insert [Github flavored Markdown][4]. Abricotine allows you to preview text elements like headers, images, math, embedded videos, and to-do lists as you type. The editor is limited to exporting documents as HTML. You can use Abricotine on Linux, macOS, and Windows. - -![Abricontine][5] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - 2. [MarkText][7] is a simple markdown editor. It has many features, and it does a good job of handling documents formatted in markdown. MarkText also supports Github flavored Markdown, which allows you to add tables and blocks of code with syntax highlighting. It supports real-time preview and has a simple interface. MarkText is licensed under [MIT][8]. It supports output in HTML and PDF. MarkText is available on Linux, macOS, and Windows. - -![MarkText][9] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - 3. [Ghostwriter][10] Is a markdown editor for Linux and Windows. According to users of its website: "Enjoy a distraction-free writing experience, including a full-screen mode and a clean interface. With markdown, you can write now and format later." It has built-in light and dark themes that come by default, or you can write your own. You can preview documents as live HTML that you can copy and paste directly into a blog or export into another format. Ghostwriter is released under the [GPL v.3.0][11]. - -![Ghostwriter][12] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - 4. [Atom][13] is billed as a hackable text editor for the twenty-first century. It can function as a markdown editor too. It runs on Linux, Windows, and macOS and is released with an [MIT][14] license. It supports Github flavored Markdown, and **Ctrl**+**Shift**+**M** opens a preview panel so you can easily see the HTML preview. You can get started easily by creating a file and saving it with the `.md` file extension. This tells Atom that it is a markdown file. Atom automatically applies the right packages and syntax highlighting. - -![Atom][15] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - 5. [VSCodium][16] is the free open source code release of Microsoft's VSCode editor without the telemetry built into the stock Microsoft product. It is released with an [MIT][17] license and provides all the functionality of VSCode without the proprietary features. In addition to its other features, VSCodium can function as a markdown editor. Create a new file, click **Select a Language**, choose _Markdown_ and begin writing your code. Easily preview the text by pressing **Ctrl**-**Shift**+**V** and then toggle back to the editor. You can also easily extend the markdown editor by adding an extension. This is my favorite is [markdown editor][18] and it has an [MIT][19] license. - -![VSCodium][20] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - - - -What's your favorite markdown editor? Let us know in the comments. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/markdown-editors - -作者:[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/osdc-docdish-typewriter-pink.png?itok=OXJBtyYf (A pink typewriter) -[2]: https://abricotine.brrd.fr/ -[3]: https://github.com/brrd/abricotine/blob/develop/LICENSE -[4]: https://guides.github.com/features/mastering-markdown/ -[5]: https://opensource.com/sites/default/files/uploads/1_abricontine.png (Abricontine) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://marktext.app/ -[8]: https://github.com/marktext/marktext/blob/develop/LICENSE -[9]: https://opensource.com/sites/default/files/uploads/2_marktext.png (MarkText) -[10]: https://wereturtle.github.io/ghostwriter/ -[11]: https://github.com/wereturtle/ghostwriter/blob/master/COPYING -[12]: https://opensource.com/sites/default/files/uploads/3_ghostwriter.png (Ghostwriter) -[13]: https://atom.io/ -[14]: https://github.com/atom/atom/blob/master/LICENSE.md -[15]: https://opensource.com/sites/default/files/uploads/4_atom.png (Atom) -[16]: https://vscodium.com/ -[17]: https://github.com/VSCodium/vscodium/blob/master/LICENSE -[18]: https://github.com/zaaack/vscode-markdown-editor -[19]: https://github.com/zaaack/vscode-markdown-editor/blob/master/LICENSE -[20]: https://opensource.com/sites/default/files/uploads/5_vscodium.png (VSCodium) diff --git a/translated/tech/20211013 5 markdown editors I recommend trying.md b/translated/tech/20211013 5 markdown editors I recommend trying.md new file mode 100644 index 0000000000..69472684eb --- /dev/null +++ b/translated/tech/20211013 5 markdown editors I recommend trying.md @@ -0,0 +1,84 @@ +[#]: subject: "5 markdown editors I recommend trying" +[#]: via: "https://opensource.com/article/21/10/markdown-editors" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +我推荐尝试的 5 个 markdown 编辑器 +====== +每个人都有自己喜欢的 markdown 编辑器。这里有几个我已经试过的。 +![A pink typewriter][1] + +你可以用 markdown 做任何事情:格式化网站、编写书籍和撰写技术文档只是它的一些用途。我喜欢它创建富文本文档是如此简单。每个人都有自己喜欢的 markdown 编辑器。在我的 markdown 之旅中,我使用了好几个。下面是我考虑过的五个 markdown 编辑器。 + + 1. [Abricotine][2] 是一个在 [GPL v.3.0][3] 下发布的开源编辑器。你可以用手输入格式,或者使用菜单插入 [Github 风格的 Markdown][4]。Abricotine 允许你在输入时预览文本元素,如标题、图片、数学、嵌入式视频和待办事项。该编辑器仅限于将文件导出为 HTML。你可以在 Linux、macOS 和 Windows 上使用 Abricotine。 + +![Abricontine][5] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + 2. [MarkText][7] 是一个简单的 markdown 编辑器。它有很多功能,而且在处理以 markdown 为格式的文件方面做得很好。MarkText 也支持 Github 风格的 Markdown,它允许你添加表格和带有语法高亮的代码块。它支持实时预览,并且有一个简单的界面。MarkText 是在 [MIT][8] 下授权的。它支持 HTML 和 PDF 格式的输出。MarkText 可以在 Linux、macOS 和 Windows 上使用。 + +![MarkText][9] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + 3. [Ghostwriter][10] 是一个用于 Linux 和 Windows 的 markdown 编辑器。根据其网站用户的说法。“享受无干扰的写作体验,包括全屏模式和简洁的界面。有了 markdown,你可以现在写,以后再格式化”。它有内置的默认的浅色和深色主题,或者你可以自己编写。你可以将文件预览为实时 HTML,你可以直接复制和粘贴到博客中,或导出为其他格式。Ghostwriter 是在[GPL v.3.0][11] 下发布的。 + +![Ghostwriter][12] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + 4. [Atom][13] 被称为 21 世纪的可自定义文本编辑器。它也可以作为一个 markdown 编辑器使用。它可以在 Linux、Windows 和 macOS上运行,并以 [MIT][14]许可证发布。它支持 Github 风格的 Markdown,并且 **Ctrl**+**Shift**+**M** 可以打开一个预览面板,这样你就可以轻松地看到 HTML 预览。你可以通过创建一个文件并以 `.md` 文件扩展名保存来轻松入门。这告诉 Atom 它是一个 markdown 文件。Atom 会自动应用正确的包和语法高亮。 + +![Atom][15] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + 5. [VSCodium][16] 是微软的 VSCode 编辑器的免费开源版本,没有内置在微软产品中的遥测技术。它以 [MIT][17] 许可证发布,并提供了 VSCode 的所有功能,而没有专利特性。除了其他功能外,VSCodium 还可以作为一个 markdown 编辑器。创建一个新文件,点击 **Select a Language**,选择 _Markdown_,然后开始写你的代码。通过按 **Ctrl**-**Shift**+**V** 轻松预览文本,然后再切换回编辑器。你也可以通过添加一个扩展来轻松地扩展 markdown 编辑器。我最喜欢的是 [markdown editor][18],它是 [MIT][19] 许可证。 + +![VSCodium][20] + +(Seth Kenlon, [CC BY-SA 4.0][6]) + + + + +你最喜欢的 Markdown 编辑器是什么? 让我们在评论中知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/markdown-editors + +作者:[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/osdc-docdish-typewriter-pink.png?itok=OXJBtyYf (A pink typewriter) +[2]: https://abricotine.brrd.fr/ +[3]: https://github.com/brrd/abricotine/blob/develop/LICENSE +[4]: https://guides.github.com/features/mastering-markdown/ +[5]: https://opensource.com/sites/default/files/uploads/1_abricontine.png (Abricontine) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://marktext.app/ +[8]: https://github.com/marktext/marktext/blob/develop/LICENSE +[9]: https://opensource.com/sites/default/files/uploads/2_marktext.png (MarkText) +[10]: https://wereturtle.github.io/ghostwriter/ +[11]: https://github.com/wereturtle/ghostwriter/blob/master/COPYING +[12]: https://opensource.com/sites/default/files/uploads/3_ghostwriter.png (Ghostwriter) +[13]: https://atom.io/ +[14]: https://github.com/atom/atom/blob/master/LICENSE.md +[15]: https://opensource.com/sites/default/files/uploads/4_atom.png (Atom) +[16]: https://vscodium.com/ +[17]: https://github.com/VSCodium/vscodium/blob/master/LICENSE +[18]: https://github.com/zaaack/vscode-markdown-editor +[19]: https://github.com/zaaack/vscode-markdown-editor/blob/master/LICENSE +[20]: https://opensource.com/sites/default/files/uploads/5_vscodium.png (VSCodium) From 05be8bde605aff6c8dd03a92946ff543655197c1 Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 19 Oct 2021 08:57:30 +0800 Subject: [PATCH 0761/1588] translating --- sources/tech/20211018 4 Linux tools to erase your data.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211018 4 Linux tools to erase your data.md b/sources/tech/20211018 4 Linux tools to erase your data.md index 89a5cdee96..59a30d6111 100644 --- a/sources/tech/20211018 4 Linux tools to erase your data.md +++ b/sources/tech/20211018 4 Linux tools to erase your data.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/linux-tools-erase-data" [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 8c9292414545d8ebb53a69513fdf79ea72f21575 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 19 Oct 2021 13:43:53 +0800 Subject: [PATCH 0762/1588] PRF @geekpi --- .../tech/20211011 What is a hostname.md | 57 +++++++++---------- 1 file changed, 26 insertions(+), 31 deletions(-) diff --git a/translated/tech/20211011 What is a hostname.md b/translated/tech/20211011 What is a hostname.md index 84d90b73fa..031878e49f 100644 --- a/translated/tech/20211011 What is a hostname.md +++ b/translated/tech/20211011 What is a hostname.md @@ -3,44 +3,43 @@ [#]: author: "Alan Formy-Duval https://opensource.com/users/alanfdoss" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " -什么是主机名? +浅谈主机名 ====== -主机名是人类用来指代特定计算机的标签。 -![Computer screen with files or windows open][1] -计算机有网络地址,但人类通常很难记住它们。主机名是帮助人类参考特定计算机的标签。例如,你可能不会导航到 192.168.1.4,而是导航到 `linuxlaptop` 或 `linuxlaptop.local`。 +> 主机名是人类用来指代特定计算机的标签。 + +![](https://img.linux.net.cn/data/attachment/album/202110/19/134329lwni9tlq9h3u4f4o.jpg) + +计算机有网络地址,但人类通常很难记住它们。主机名是帮助人类参考特定计算机的标签。例如,你可能不会导航到 `192.168.1.4`,而是导航到 `linuxlaptop` 或 `linuxlaptop.local`。 ### 地址和名称 -所有联网的计算机(也被称为主机)都需要一个地址:一个与之相关的唯一数字,以使数据报文能够在它们之间进行正确的数据通信。这就是所谓的互联网协议(IP)地址。数字 54.204.39.132 是一个互联网协议第四版(IPv4)地址。较新的 IPv6 地址要长得多,像这样:2001:0db6:3c4d:0017:0000:0000:2a2f:1a2b. 哇!这将是很难记住的! - +所有联网的计算机(也被称为主机host)都需要一个地址:一个与之相关的唯一数字,以使数据报文能够在它们之间进行正确的数据通信。这就是所谓的互联网协议Internet Protocol(IP)地址。数字 `54.204.39.132` 是一个互联网协议第四版Internet Protocol version 4(IPv4)地址。较新的 IPv6 地址要长得多,像这样:`2001:0db6:3c4d:0017:0000:0000:2a2f:1a2b`。 哇!这将是很难记住的! ``` -`$ ip addr show` +$ ip addr show ``` -计算机也可以被赋予标签。被称为主机名,这些是友好的名称,便于参考。我可以把我的计算机的主机名设置为 _copperhead_。只要这个名字在网络上是唯一的,所有其他用户和计算机都可以把 copperhead 作为地址,而不是 IP 地址。 - +计算机也可以被赋予标签。被称为主机名hostname,这些是友好的名称,便于参考。我可以把我的计算机的主机名设置为 `copperhead`。只要这个名字在网络上是唯一的,所有其他用户和计算机都可以把 `copperhead` 作为地址,而不是 IP 地址。 ``` -`$ hostname -s` +$ hostname -s ``` 你可以更新你的计算机的主机名。 -阅读 Seth Kenlon 的文章[如何在 Linux 上更改主机名][2],了解如何在 Linux 上这样做。 +阅读 Seth Kenlon 的文章 [如何在 Linux 上更改主机名][2],了解如何在 Linux 上这样做。 #### 完全限定域名 -从技术上讲,主机名包括一个域名。如果我的域名是 mycompany.com,那么我的计算机的主机名是 copperhead.mycompany.com,以句点分隔。这就形成了一个完全限定域名(FQDN)。这很重要,因为 IP 地址可以解析为 FQDN。 - +从技术上讲,主机名包括一个域名。如果我的域名是 `mycompany.com`,那么我的计算机的主机名是 `copperhead.mycompany.com`,以句点分隔。这就形成了一个完全限定域名fully qualified domain name(FQDN)。这很重要,因为 IP 地址可以解析为 FQDN。 ``` -`host.domain.topleveldomain` +host.domain.topleveldomain ``` 例如:`www.example.com` 是一个完全限定域名。 @@ -51,33 +50,32 @@ 将 IP 地址转换为相应的主机名的过程被称为名称解析。这个过程首先发生在本地主机表中。Linux 使用文件 `/etc/hosts` 来存储这个表。 - ``` -`cat /etc/hosts` +cat /etc/hosts ``` -还有一个分层的、去中心化的基于网络的系统提供解析,称为域名系统(DNS)。这时 FQDN 变得非常重要。 +还有一个分层的、去中心化的基于网络的系统提供解析,称为域名系统Domain Name System(DNS)。这时 FQDN 变得非常重要。 ``` -`$ dig www.opensource.com` +$ dig www.opensource.com ``` ### 名称的乐趣 为我们的计算机起名字可能很有趣。如果你有很多,你可以使用一个主题。我曾经为一家公司工作,该公司将所有的服务器都以蛇命名。 -后来我工作的一家公司,我是一个数据中心经理,使用啤酒品牌。当我们收到一个新的服务器时,这很令人兴奋,因为我会给开发团队发邮件征求建议。我们大约有 100 台服务器。这些提供了一个有趣的清单,反映了公司的多样性。我们有从库尔斯和布德到阿姆斯特尔和德勒里姆特雷门斯的一切。我们有老虎、辛哈和萨波洛等等! +后来我工作的一家公司,我是一个数据中心经理,使用啤酒品牌。当我们收到一个新的服务器时,这很令人兴奋,因为我会给开发团队发邮件征求建议。我们大约有 100 台服务器。这些提供了一个有趣的清单,反映了公司的多样性。我们有从库尔斯和百威到阿姆斯特尔和浅粉象的一切。我们有虎牌啤酒、胜狮啤酒和札幌啤酒等等! -我们认为这很酷!然后,想象一下,当你试图记住 lowenbrau 是拥有最多内存的虚拟化服务器,peroni 是 SQL 数据库服务器,heineken 是新的域控制器时,会发生什么,特别是对于一个快速发展的公司的新员工。 +我们认为这很酷!然后,想象一下,当你试图记住卢云堡是拥有最多内存的虚拟化服务器,佩罗尼是 SQL 数据库服务器,喜力是新的域控制器时,会发生什么,特别是对于一个快速发展的公司的新员工。 -### 约定 +### 惯例 当然,主机名是所有者的选择,所以请尽情发挥。然而,根据环境的不同,使用容易记忆的名字或基于命名惯例的名字可能更有意义,因为这些名字有利于描述主机。 #### 有用的名字 -如果你想放弃有趣的东西,并对你的系统进行有益的命名,也许可以考虑它们的功能。数据库服务器可以被命名为 database1、database2、database3 等等。网络服务器可以命名为 webserver1、webserver2 等等。 +如果你想放弃有趣的东西,并对你的系统进行有益的命名,也许可以考虑它们的功能。数据库服务器可以被命名为 `database1`、`database2`、`database3` 等等。Web 服务器可以命名为 `webserver1`、`webserver2` 等等。 #### 位置名称 @@ -85,21 +83,18 @@ 此外,就像许多大型企业、金融机构和政府一样,他们可能有不同的数据中心,位于不同的地理位置,以达到性能或灾难恢复的目的。因此,比如说,位于北美大陆东海岸的数据中心被称为 ED(East Data center),而位于西海岸的数据中心则是 WD(West Data center)。 -所有这些信息将汇集到一个名称中,如 doibpm1ed 或 doibpm1wd。因此,虽然这些名字看起来不长,但在这个项目上工作的人可以很容易地识别它们的目的和位置,而且这个名字甚至可以对潜在的恶意者混淆它们的用途。换句话说,业主可以选择只对内部人员有意义的命名方式 +所有这些信息将汇集到一个名称中,如 `doibpm1ed` 或 `doibpm1wd`。因此,虽然这些名字看起来不长,但在这个项目上工作的人可以很容易地识别它们的目的和位置,而且这个名字甚至可以对潜在的恶意者混淆它们的用途。换句话说,业主可以选择只对内部人员有意义的命名方式 ### 互联网标准 -Several standards govern hostnames. You can find these in Requests for Comment (RFC) maintained by The Internet Engineering Task Force (IETF). As of now, adhere to the following: -有几个标准管理着主机名。你可以在互联网工程任务组(IETF)维护的请求评论(RFC)中找到这些标准。从现在起,请遵守以下规定: +有几个标准管理着主机名。你可以在互联网工程任务组Internet Engineering Task Force(IETF)维护的意见征求Requests for Comment(RFC)中找到这些标准。由此,请遵守以下规定: * 主机名的长度应该在 1 到 63 个 ASCII 字符之间 * 一个 FQDN 的最大长度为 253 个 ASCII 字符 * 不区分大小写 - * 允许的字符:a 到 z,0 到 9,-(连字符),和 \_(下划线)。 + * 允许的字符:`a` 到 `z`,`0` 到 `9`,`-`(连字符),和 `_`(下划线)。 - - -我希望这篇文章能帮助澄清主机名。玩得开心,发挥创意。 +我希望这篇文章能帮助你澄清主机名。玩得开心,发挥创意。 -------------------------------------------------------------------------------- @@ -108,7 +103,7 @@ via: https://opensource.com/article/21/10/what-hostname 作者:[Alan Formy-Duval][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 9e696372c181671680edde1659b64076cd394e6f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 19 Oct 2021 13:44:42 +0800 Subject: [PATCH 0763/1588] PUB @geekpi https://linux.cn/article-13897-1.html --- {translated/tech => published}/20211011 What is a hostname.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211011 What is a hostname.md (98%) diff --git a/translated/tech/20211011 What is a hostname.md b/published/20211011 What is a hostname.md similarity index 98% rename from translated/tech/20211011 What is a hostname.md rename to published/20211011 What is a hostname.md index 031878e49f..7088418f1d 100644 --- a/translated/tech/20211011 What is a hostname.md +++ b/published/20211011 What is a hostname.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "geekpi" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13897-1.html" 浅谈主机名 ====== From 02e3bcad332b4f851fc77b8a30dac3a89ad182a6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 20 Oct 2021 05:02:25 +0800 Subject: [PATCH 0764/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211020?= =?UTF-8?q?=20GitUI:=20A=20Blazing=20Fast=20Terminal=20Client=20for=20Git?= =?UTF-8?q?=20Written=20in=20Rust?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md --- ...Terminal Client for Git Written in Rust.md | 100 ++++++++++++++++++ 1 file changed, 100 insertions(+) create mode 100644 sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md diff --git a/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md b/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md new file mode 100644 index 0000000000..65205f69ca --- /dev/null +++ b/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md @@ -0,0 +1,100 @@ +[#]: subject: "GitUI: A Blazing Fast Terminal Client for Git Written in Rust" +[#]: via: "https://itsfoss.com/gitui/" +[#]: author: "Marco Carmona https://itsfoss.com/author/marco/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +GitUI: A Blazing Fast Terminal Client for Git Written in Rust +====== + +The [basic Git commands][1] are good enough for the usual clone, add, commit push. + +But if you are working on a large project with multiple contributors, you may need to visualize things. A GUI tool gives a better view on the diff, stash and blame. + +But then, if you are a terminal dweller, who wants the comfort of GUI with Git, I have got a good tool for you. + +It is called GitUI and it provides user experience and comfort similar to a git GUI but right in your terminal. It is portable, fast, free and open source. + +### GitUI: A terminal based tool for Git + +[GitUI][2] is not the first Git client for Linux terminal. So, what makes GitUI different than other similar projects like [lazygit][3] or [tig][4]? + +GitUI developer has shared some benchmark in the README file of the project. + +| Time | Memory (GB) | Binary (MB) | Freezes | Crashes +---|---|---|---|---|--- +gitui | 24 s | 0.17 | 1.4 | No | No +lazygit | 57 s | 2.6 | 16 | Yes | Sometimes +tig | 4 m 20 s | 1.3 | 0.6 | Sometimes | No + +Comparison between GitUI, LazyGit, and Tig; simple user interfaces for Git + +Most of this optimization comes from the use of Rust programming language. + +_**Note: This program is in early stages of development and is not production ready yet.**_ + +### Installing GitUI on Linux + +Needless to say, you should have [Git installed on your system][5] already. + +To use GitUI, you need to [install Rust support for your Linux distribution][6] first. + +In a terminal, use the following command: + +``` +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +![Installing Rust on Linux][7] + +Go with option 1 when you are asked for a choice. When script finishes installation, set the configuration right with this command: + +``` +source $HOME/.cargo/env +``` + +Now that you have Rust and its package manager Cargo installed, use the Cargo command to install GitUI: + +``` +cargo install gitui +``` + +And you’re ready to use GitUI, for that just type `gitui` in the terminal to run it. I made some sample files to play with Git and GitUI. + +![Starting gitui on terminal][8] + +It’s important to mention that the interface has a fast and intuitive keyboard-only control. Everything is as easy as type the correct letter to stage, commit, branch, or push your files into your git repository. + +Something that really gets me excited was that you can not only do the four actions before, but you can also **edit** each file, **pull** it, **blame** it, **navigate** inside it, and more things; everything without existing from the interface. Awesome, isn’t it? + +![More functions inside the interface][9] + +Felicitations! Now you know how to install GitUI and how it looks like in your terminal. + +If you like the project, start its repository on [GitHub][2]. If you use some other tool to manage Git, please suggest your favorite in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gitui/ + +作者:[Marco Carmona][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/marco/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/basic-git-commands-cheat-sheet/ +[2]: https://github.com/Extrawurst/gitui +[3]: https://github.com/jesseduffield/lazygit +[4]: https://jonas.github.io/tig/ +[5]: https://itsfoss.com/install-git-ubuntu/ +[6]: https://itsfoss.com/install-rust-cargo-ubuntu-linux/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Installing-Rust-step-1.png?resize=800%2C471&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Starting-GitUI-on-terminal.png?resize=800%2C471&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/More-functions-inside-the-interface.png?resize=800%2C471&ssl=1 From de2d75b92b11971acfca4a4db14f20df6e33e194 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 20 Oct 2021 05:02:43 +0800 Subject: [PATCH 0765/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211020?= =?UTF-8?q?=20How=20to=20Install=20Rust=20and=20Cargo=20on=20Ubuntu=20and?= =?UTF-8?q?=20Other=20Linux=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md --- ...on Ubuntu and Other Linux Distributions.md | 178 ++++++++++++++++++ 1 file changed, 178 insertions(+) create mode 100644 sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md b/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..b757160c7e --- /dev/null +++ b/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,178 @@ +[#]: subject: "How to Install Rust and Cargo on Ubuntu and Other Linux Distributions" +[#]: via: "https://itsfoss.com/install-rust-cargo-ubuntu-linux/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Rust and Cargo on Ubuntu and Other Linux Distributions +====== + +_**Brief: Learn various ways of installing Rust programming language on Linux along with its package manager Cargo.**_ + +Ever since Mozilla dumped [Rust][1], it has gained even more prominence and popularity. Don’t just take my words for it. [Rust is going to be included in the Linux kernel][2], only the second programming language after C. + +Many developers have also started making awesome command line based tools in Rust. These tools are often available through the [Cargo package manager][3]. + +This is why it matters to install Rust support in Linux, both for the programmers and the end users. + +Officially, Rust documents suggest installing Rust in Linux by downloading and executing the installer script in this manner: + +``` +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +That could work. However, your distribution probably already packages Rust. Using your distribution’s [package manager][4] is also an option. + +Let me walk you through the Rust installation steps for both official Rust way and package manager way. + +### Method 1: Installing Rust on any Linux using the official method + +There are a couple of advantages of this method: + + * You get the latest Rust and Cargo version + * Rust is only installed for the current user, not system-wide + * You do not need to be root or have sudo access to install Rust for yourself this way + + + +A few people dislike downloading and [running shell scripts][5] off the internet, even if it is coming from the official sources. However, since it does not need root access and the script is coming from the official sources, it should be safe to install it this way. + +First, make sure that you have Curl installed. Use your distribution’s package manager to install it, if it is not already installed. You can [install Curl on Ubuntu][6] and Debian using the apt command: + +``` +sudo apt install curl +``` + +Next, use this command to download the script and run it: + +``` +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +![][7] + +It will ask your input for the kind of installation you want. Go with option 1: + +![][8] + +Once the script finishes the installation process, you need to source the configuration file to make the changes available for your shell. + +![][9] + +Source the file: + +``` +source $HOME/.cargo/env +``` + +Once it is done, verify that rust is available for you by checking the installed version: + +``` +rustc --version +``` + +![Verifying Rust installation][10] + +Super cool. If there is a new version of Rust released, you can update the installed one using: + +``` +rustup update +``` + +Let me quickly show how to remove rust installed this way before you see the other installation method. + +#### Removing Rust installed the official way + +In a terminal, use the following command to remove Rust from your system: + +``` +rustup self uninstall +``` + +Press Y when asked and you’ll have Rust removed from the system. + +![Removing Rust from Linux][11] + +That’s settled then. Let’s see how to use the apt command to install Rust on Ubuntu. + +### Method 2: Installing Rust support on Ubuntu using apt + +Why would you want to use the package manager? + + * It installs Rust system wide and thus makes it available for all the users on the system + * It gets updated centrally with other system updates (if your distribution adds a new version of Rust) + + + +There are two main Rust packages available in Ubuntu: + + * rustc: The rust compiler used for Rust programming language + * cargo: Cargo is the Rust package manager and it automatically installs rustc + + + +As a regular user, you would be using Cargo for installing Rust based applications. As a programmer, you’ll need Cargo for getting other Rust packages or create your own. + +Since Cargo includes rustc, I would advise installing it so that all required packages are installed in one go. + +``` +sudo apt install cargo +``` + +You’ll be asked to enter your account’s password. + +![][12] + +You are, of course, free to use `apt install rustc` and install only Rust. That choice lies with you. + +You may verify that Rust is installed for you and all the other users (if you want to): + +![][13] + +That’s good. Let me quickly show the uninstall step as well. + +#### Removing Rust using apt remove + +To remove Rust, you can remove Cargo first and then use the autoremove command to remove the dependencies installed with it. + +``` +sudo apt remove cargo +``` + +Now run the autoremove: + +``` +sudo apt autoremove +``` + +That’s it. You now know all the essentials about installing Rust on Ubuntu and other Linux distributions. Questions and suggestions are always welcome. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-rust-cargo-ubuntu-linux/ + +作者:[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://www.rust-lang.org/ +[2]: https://www.zdnet.com/article/rust-in-the-linux-kernel-why-it-matters-and-whats-happening-next/ +[3]: https://crates.io/ +[4]: https://itsfoss.com/package-manager/ +[5]: https://itsfoss.com/run-shell-script-linux/ +[6]: https://itsfoss.com/install-curl-ubuntu/ +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/installing-rust-linux-1.png?resize=800%2C448&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/installing-rust-linux-2.png?resize=800%2C448&ssl=1 +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/installing-rust-linux-3.png?resize=800%2C448&ssl=1 +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/verify-rust-version.png?resize=800%2C236&ssl=1 +[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/remove-rust-linux.png?resize=800%2C378&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/install-rust-using-apt-ubuntu.png?resize=759%2C481&ssl=1 +[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/verify-rust-install-ubuntu.png?resize=741%2C329&ssl=1 From a778acd7ad7875036ff1627660e03127fe0fa467 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 20 Oct 2021 05:03:04 +0800 Subject: [PATCH 0766/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211019?= =?UTF-8?q?=20Why=20Mark=20Text=20is=20my=20favorite=20markdown=20editor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211019 Why Mark Text is my favorite markdown editor.md --- ...ark Text is my favorite markdown editor.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/tech/20211019 Why Mark Text is my favorite markdown editor.md diff --git a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md b/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md new file mode 100644 index 0000000000..dcd5521a5e --- /dev/null +++ b/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md @@ -0,0 +1,97 @@ +[#]: subject: "Why Mark Text is my favorite markdown editor" +[#]: via: "https://opensource.com/article/21/10/mark-text-markdown-editor" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Why Mark Text is my favorite markdown editor +====== +Mark Text has tools that make it easy to write markdown while at the +same time providing a simple interface that just gets out of my way. +![Typewriter keys in multicolor][1] + +I got introduced to the markdown format a few years ago when I began to explore Jupyter Notebooks. Many of the other writers at Opensource.com knew markdown, but it was a skill that was unfamiliar to me. + +Markdown is a standard way of writing text, in which you use minimal notation to _markup_ how you want the text styled. For instance, instead of clicking a button to make a word bold, you surround the word with two asterisks (**word**). This has two effects: + + * Visually suggests emboldened text when viewed as plain text + * Appears as bold, given a good text converter or renderer (such as Pandoc or a good markdown text editor) + + + +One of the greatest advantages of markdown is that most of its notation is intuitive and derived from habits most of us already have. It just makes sense to emphasize words with asterisks, mark headlines with characters to set them apart, and so on. + +Everyone spoke highly of it, but I wasn't sure why I would need to learn and use markdown. However, I'm a curious person, and I began to explore markdown and how it might figure into my writing. + +### Learning markdown + +I enjoyed using a markdown [cheat sheet][2] as I learned. I found markdown to be an excellent tool for writing anything, and I love that I don't even need a special markdown editor. Any text editor can write markdown because markdown uses standard text to denote style. So I started using simple editors like Vim or gedit (or any other editor) and consulted the cheat sheet to remember the simple formatting rules. + +I've been journaling this year as a way of organizing my thoughts and learning more about markdown. I've recently tried the [Ghostwriter][3] text editor, an excellent editor with some extra markdown-specific features. Markdown has become so popular now that many editors incorporate or make it their focus to include syntax highlighting, hints, and other features that make it easy to work in markdown. They're not must-have features, but when you have them, they're nice to have.  + +### Trying Mark Text + +While reading a blog, I discovered [Mark Text][4]. Mark Text has tools that make it easy to write markdown while at the same time providing a simple interface that just gets out of my way. Mark Text has six themes: Three light and three dark themes. Dark themes are easier for me to use. The [user documentation][5] is excellent, and there is markdown [syntax help][6] available too.  + +### Markdown in real time + +Mark Text provides a real-time preview with a clean and simple interface. It supports the [Commonmark][7] spec, Github Flavored Markdown spec, and Pandoc Markdown. According to its website, Mark Text also supports markdown extensions like KaTex, front matter, and emoji. It outputs HTML and PDF files.  + +Mark Text has various editing modes like typewriter mode, source code mode, and focus mode. Adding images is a snap, as you can simply copy and paste them from your clipboard. + +A pop-up at the upper left of the Mark Text window displays the number of characters and paragraphs entered so far. That's really helpful as a writer. + +Saving files is easy from the menu at the upper left of the Mark Text window or use **Ctrl+S**. In fact, the menus of Mark Text look friendly and familiar to anyone who's used to a basic text editor or word processor. + +![Mark Text file menu][8] + +(Don Watkins, [CC BY-SA 4.0][9]) + +I love that Mark Text supports various formats with simple keystroke shortcuts, including table blocks, diagrams, in-line formats, math formula blocks, and other code blocks. + +You can download Mark Text for your operating system from the following links: + + * [Linux][10] + * [macOS][11] + * [Windows][12] + + + +Mark Text is open source with an [MIT][13] license. You can always [download][14] the latest version. + +Alternatively, you can install Mark Text on macOS with `brew install --cask mark-text` and on Windows with [Chocolatey][15] by entering `choco install marktext`. + +Mark Text is always looking for sponsors and developers. The project has a [guide][16] for contributors. In addition, you can support the project on Patreon and Open Collective. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/mark-text-markdown-editor + +作者:[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/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor) +[2]: https://opensource.com/downloads/cheat-sheet-markdown +[3]: https://wereturtle.github.io/ghostwriter/ +[4]: https://marktext.app/ +[5]: https://github.com/marktext/marktext/blob/master/docs/README.md +[6]: https://github.com/marktext/marktext/blob/master/docs/MARKDOWN_SYNTAX.md +[7]: https://commonmark.org/ +[8]: https://opensource.com/sites/default/files/uploads/mark-test-file-menu.png (Mark Text file menu) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://github.com/marktext/marktext/releases/latest/download/marktext-x86_64.AppImage +[11]: https://github.com/marktext/marktext/releases/latest/download/marktext.dmg +[12]: https://github.com/marktext/marktext/releases/latest/download/marktext-setup.exe +[13]: https://github.com/marktext/marktext/blob/develop/LICENSE +[14]: https://github.com/marktext/marktext/releases +[15]: https://chocolatey.org/ +[16]: https://github.com/marktext/marktext/blob/develop/CONTRIBUTING.md From 8e64202262ffad5578286c5a44d2aae82cbd5082 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 20 Oct 2021 05:05:10 +0800 Subject: [PATCH 0767/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211019?= =?UTF-8?q?=20Valve=20is=20Reviewing=20Games=20Compatible=20with=20SteamOS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211019 Valve is Reviewing Games Compatible with SteamOS.md --- ...Reviewing Games Compatible with SteamOS.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/news/20211019 Valve is Reviewing Games Compatible with SteamOS.md diff --git a/sources/news/20211019 Valve is Reviewing Games Compatible with SteamOS.md b/sources/news/20211019 Valve is Reviewing Games Compatible with SteamOS.md new file mode 100644 index 0000000000..56cf9b0342 --- /dev/null +++ b/sources/news/20211019 Valve is Reviewing Games Compatible with SteamOS.md @@ -0,0 +1,86 @@ +[#]: subject: "Valve is Reviewing Games Compatible with SteamOS" +[#]: via: "https://news.itsfoss.com/steamdeck-verified/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Valve is Reviewing Games Compatible with SteamOS +====== + +With the introduction of Steam Deck, the future of gaming in Linux is more promising than ever. + +The presence of Steam Deck has already made it possible to [bring in anti-cheat engine support to Linux][1]. If you did not know, Steam Deck is powered by the upcoming new [SteamOS][2] (based on Arch Linux). + +And, now, to make things better, Valve has announced to introduce new compatibility badges to showcase games on Steam that should work with Steam Deck powered by SteamOS. + +### Steam Deck Verified: What Does it Mean? + +![][3] + +Like what we mentioned about referring ProtonDB to check compatibility in our [Linux gaming guide][4], Valve aims to verify every game that works with Steam Deck. + +As shown in the image above, it will display four categories of compatibility badges. Accordingly, you can decide if you want to try the game on the Steam Deck console or not. + +Valve plans to thoroughly review the games for Steam Deck compatibility and update the status with every new update made to the game. + +Overall, the games will be tested to fulfill the following criteria: + + * Full controller support. + * Should support the default 1280 x 800 (or 1280 x 720) resolution of Steam Deck. + * Without any warnings displayed as a seamless experience. + * If running through Proton, the game needs to support it. + + + +![][5] + +The compatibility badge will also display detailed insights on what you can expect as per the status. + +And, if you are a developer, you can go through the [official details of the review process][6] to make your game compatible. + +### Does This Mean You Won’t Need ProtonDB for Linux Desktop Gaming? + +![][7] + +While I cannot confirm that, but it raises the potential for it. + +As of now, Linux gamers utilize the community portal [ProtonDB][8] to check if a Windows-only game works with Linux. + +With Steam Deck verified, if the compatibility badges are shown cross-platform, it could be useful for Linux desktops. Technically, Steam Deck is still Linux, but your PC’s hardware configuration is not the same. + +But, it would be useful to rely on Valve’s official review process to launch a game on Steam without worrying about its compatibility on your Linux desktop. + +We can only hope for better when it comes to gaming on Linux. + +_What do you think about Valve’s new compatibility checking initiative for Steam Deck? Feel free to let me know your thoughts._ + +#### 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/steamdeck-verified/ + +作者:[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/easy-anti-cheat-linux/ +[2]: https://itsfoss.com/steamos/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjM4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: https://itsfoss.com/linux-gaming-guide/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://partner.steamgames.com/doc/steamdeck/compat +[7]: https://i1.wp.com/i.ytimg.com/vi/_OAqvtlgfGA/hqdefault.jpg?w=780&ssl=1 +[8]: http://protondb.com/ From e9d3384fad15e3bfac717c0eb4f00435143791da Mon Sep 17 00:00:00 2001 From: perfiffer Date: Wed, 20 Oct 2021 08:35:05 +0800 Subject: [PATCH 0768/1588] translated --- ...e logs with the Linux logrotate command.md | 67 ++++++++----------- 1 file changed, 29 insertions(+), 38 deletions(-) rename {sources => translated}/tech/20211007 Rotate and archive logs with the Linux logrotate command.md (55%) diff --git a/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md b/translated/tech/20211007 Rotate and archive logs with the Linux logrotate command.md similarity index 55% rename from sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md rename to translated/tech/20211007 Rotate and archive logs with the Linux logrotate command.md index e28262bbdc..53c58af648 100644 --- a/sources/tech/20211007 Rotate and archive logs with the Linux logrotate command.md +++ b/translated/tech/20211007 Rotate and archive logs with the Linux logrotate command.md @@ -7,24 +7,22 @@ [#]: publisher: " " [#]: url: " " -Rotate and archive logs with the Linux logrotate command +使用 Linux `logrotate` 命令轮转和归档日志 ====== -Keep log files fresh with this Linux command. Download the new logrotate -cheat sheet. +使用此 Linux 命令保持日志文件更新。下载新的 `logrotate` 备忘单。 ![Logs stacked up and to the right in front of a green tree forest][1] -Logs are great for finding out what an application is doing or troubleshooting a possible problem. Almost every application we deal with generates logs, and we want the applications we develop ourselves to generate them too. The more verbose the logs, the more information we have. But left to themselves, logs can grow to an unmanageable size, and they can, in turn, become a problem of their own. So it's a good idea to keep them trimmed down, keep the ones we're going to need, and archive the rest. +日志非常适合找出应用程序在做什么或对可能的问题进行故障排除。几乎我们处理的每个应用程序都会生成日志,我们希望我们自己开发的应用程序也生成日志。日志越详细,我们拥有的信息就越多。但放任不管,日志可能会增长到无法管理的大小,反过来,它们可能会成为它们自己的问题。因此,最好将它们进行裁剪,保留我们需要的那些,并将其余的归档。 -### Basics +### 基本功能 -The `logrotate` utility is excellent at managing logs. It can rotate them, compress them, email them, delete them, archive them, and start fresh ones when you need them. +`logrotate` 实用程序在管理日志方面非常出色。它可以轮转日志、压缩日志、通过电子邮件发送日志、删除日志、归档日志,并在你需要时开始记录最新的。 -Running `logrotate` is pretty simple—just run `logrotate -vs state-file config-file`. In the above command, the `v` option enables verbose mode, `s` specifies a state file, and the final `config-file` mentions the configuration file, where you specify what you need done. +运行 `logrotate` 非常简单——只需要运行 `logrotate -vs state-file config-file`。在上面的命令中,`v` 选项开启详细模式,`s` 指定一个状态文件,最后的 `config-file` 是配置文件,你可以指定需要做什么。 -### Hands-on - -Let's check out a `logrotate` configuration that is running silently on our system, managing the wealth of logs we find in the `/var/log` directory. Check out the current files in that directory. Do you see a lot of `*.[number].gz` files? That’s what `logrotate` is doing. You can find the configuration file for this under `/etc/logrotate.d/rsyslog`. Mine looks like this: +### 实战演练 +让我们看看在我们的系统上静默运行的 `logrotate` 配置,管理我们在 `/var/log` 目录中找到的大量日志。查看该目录中的当前文件。你是否看到很多 `*.[number].gz` 文件?这就是 `logrotate` 正在做的。你可以在 `/etc/logrotate.d/rsyslog` 下找到此配置文件。我的配置文件如下: ``` /var/log/syslog @@ -36,7 +34,7 @@ Let's check out a `logrotate` configuration that is running silently on our sy         delaycompress         compress         postrotate -                reload rsyslog >/dev/null 2>&1 || true +                reload rsyslog > /dev/null 2>&1 || true         endscript } @@ -62,29 +60,26 @@ Let's check out a `logrotate` configuration that is running silently on our sy         delaycompress         sharedscripts         postrotate -                reload rsyslog >/dev/null 2>&1 || true +                reload rsyslog > /dev/null 2>&1 || true         endscript } ``` -The file starts with defining the instructions for rotating the `/var/log/syslog` file and the instructions are contained within the curly braces that follow. Here’s what they mean: +该文件首先定义了轮转 `/var/log/syslog` 文件的说明,这些说明包含在后面的花括号中。以下是它们的含义: - * `rotate 7`: Keep logs from the last seven rotations. Then start deleting them. - * `daily`: Rotate the log daily. Along with `rotate 7`, this would mean that logs would be kept for the last seven days. Other options are `weekly`, `monthly`, `yearly`. There is also a `size` parameter that will rotate log files if their size increases beyond a specified limit—for example, `size 10k`, `size 10M`, `size 10G`, etc. If nothing is specified, logs will be rotated whenever `logrotate` runs. You can even run `logrotate` in a `cron` to use it at more specific time intervals. - * `missingok`: It’s okay if the log file is missing. Don’t Panic. - * `notifempty`: Don’t rotate if the log file is empty. - * `delaycompress`: If compression is on, delay compression until the next rotation. This allows at least one rotated but uncompressed file to be present. Useful if you want yesterday’s logs to stay uncompressed for troubleshooting. It is also helpful if some program might still write to the old file until it is restarted/reloaded, like Apache. - * `compress`: Compression is on. Use `nocompress` to turn it off. - * `postrotate/endscript`: Run the script within this section after rotation. Helpful in doing cleanup stuff. There is also a `prerotate/endscript` for doing things before rotation begins. + * `rotate 7`: 保留最近 7 次轮转的日志。然后开始删除它们。 + * `daily`: 每天轮转日志,与 `rotate 7` 一起使用,这意味着日志将保留过去 7 天。其它选项是每周、每月、每年。还有一个大小参数,如果日志文件的大小增加超过指定的限制(例如,大小 10k、大小 10M、大小 10G 等),则将轮转日志文件。如果未指定任何内容,日志将在运行 `logrotate` 时轮转。你甚至可以在 cron 中运行 `logrotate` 以便在更具体的时间间隔内使用它。 + * `missingok`: 如果日志文件丢失也没关系。不要惊慌。 + * `notifempty`: 日志文件为空时不轮转。 + * `delaycompress`: 如果压缩已打开,则将压缩延迟到下一次轮转。这允许至少存在一个轮转但未压缩的文件。如果你希望昨天的日志保持未压缩以便进行故障排除,那么此配置会很有用。如果某些程序在重新启动/重新加载之前可能仍然写入旧文件,这也很有帮助,例如 Apache。 + * `compress`: 开启压缩,使用 `nocompress` 关闭它。 + * `postrotate/endscript`: 轮转后运行此部分中的脚本。有助于做清理工作。还有一个 `prerotate/endscript` 用于在轮转开始之前执行操作。 +你能弄清楚下一节对上面配置中提到的所有文件做了什么吗?第二部分中唯一的附加参数是 `sharedscripts`,它告诉 `logrotate` 在所有日志轮转完成之前不要运行 `postrotate/endscript` 中的部分。它可以防止脚本在每一次轮转时执行,只在之后一次轮转完成时执行。 +### 看点新的东西 -Can you figure out what the next section does for all those files mentioned in the configuration above? The only additional parameter in the second section is `sharedscripts`, which tells `logrotate` to not run the section within `postrotate/endscript` until all log rotation is complete. It prevents the script from being executed for every log rotated and runs once at the end. - -### Something New - -I’m using the following configuration for dealing with Nginx access and error logs on my system. - +我使用下面的配置来处理我系统上的 `Nginx` 的访问和错误日志。 ``` /var/log/nginx/access.log @@ -106,15 +101,13 @@ I’m using the following configuration for dealing with Nginx access and error } ``` -The above script can be run using: - +上面的脚本可以使用: ``` logrotate -vs state-file /tmp/logrotate ``` -Running the command for the first time gives this output: - +第一次运行该命令会给出以下输出: ``` reading config file /tmp/logrotate @@ -141,7 +134,7 @@ running postrotate script * Reloading nginx configuration nginx ``` -And running it a second time: +第二次运行它: ``` @@ -168,8 +161,7 @@ running postrotate script * Reloading nginx configuration nginx ``` -And running it a third time: - +第三次运行它: ``` reading config file /tmp/logrotate @@ -195,8 +187,7 @@ running postrotate script * Reloading nginx configuration nginx ``` -The contents of the state file look like this: - +状态文件的内容如下所示: ``` logrotate state -- version 2 @@ -204,11 +195,11 @@ logrotate state -- version 2 "/var/log/nginx/access.log" 2021-08-27-9:11:56 ``` -[**Download the Linux logrotate cheat sheet.**][2] +[**下载 Linux logrotate 备忘单**][2] * * * -_This article was originally published on the [author's personal blog][3] and has been adapted with permission._ +本文首发于[作者个人博客][3],经授权改编。 -------------------------------------------------------------------------------- @@ -216,7 +207,7 @@ via: https://opensource.com/article/21/10/linux-logrotate 作者:[Ayush Sharma][a] 选题:[lujun9972][b] -译者:[译者ID](https://github.com/译者ID) +译者:[perfiffer](https://github.com/perfiffer) 校对:[校对者ID](https://github.com/校对者ID) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From d3451776508c6dbb132965fe8adb33cc01540e6f Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 20 Oct 2021 08:41:14 +0800 Subject: [PATCH 0769/1588] translated --- ...ow to Upgrade to Ubuntu 21.10 Right Now.md | 67 ------------------- ...ow to Upgrade to Ubuntu 21.10 Right Now.md | 67 +++++++++++++++++++ 2 files changed, 67 insertions(+), 67 deletions(-) delete mode 100644 sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md create mode 100644 translated/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md diff --git a/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md b/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md deleted file mode 100644 index ee94e9b48d..0000000000 --- a/sources/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md +++ /dev/null @@ -1,67 +0,0 @@ -[#]: subject: "How to Upgrade to Ubuntu 21.10 Right Now" -[#]: via: "https://itsfoss.com/upgrade-ubuntu-to-newer-version/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Upgrade to Ubuntu 21.10 Right Now -====== - -[Ubuntu 21.10 ‘Impish Indri’ has just been released][1]. If you are using Ubuntu 21.04, you should be provided the option to upgrade to Ubuntu 21.10. - -![Ubuntu 21.04 users should eventually be notified for the upgrade][2] - -However, this roll out will be gradual. This means not everyone will be notified about the availability of the new version immediately. It may take a couple of weeks before you see the upgrade option. - -But what if you are itching to get your hands on Ubuntu 21.10 that comes with GNOME 40 and other new features? Do you really have to wait? The answer is no. - -### Upgrading to Ubuntu 21.10 from Ubuntu 21.04 right now - -Here’s what you do. Open the Software & Updates application: - -![Start the Software & Updates application][3] - -And make sure that you have set “**Notify me of a new Ubuntu version**” to “**For any new version**” under the **Updates** tab. - -![Make sure that settings are right for new Ubuntu version notification][4] - -Now open a terminal and enter the following command to make sure that your system is updated: - -``` -sudo apt update && sudo apt upgrade -``` - -Once your Ubuntu 21.04 system has all the updates installed, run the update manager to look for development release (Ubuntu 21.10 in this case). - -``` -update-manager -d -``` - -It will open the Update Manager tool that looks for updates. Since you have already updated the system, it won’t find new updates to install. However, it will see that Ubuntu 21.10 is now available. - -![Hit the upgrade button][2] - -You can hit the upgrade button and follow the on-screen option to start the upgrade procedure. You should have good internet speed to download the 2 GB worth of updates. Make sure that your system stays connected to a power source during the upgrade. - -Enjoy Ubuntu 21.10! - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/upgrade-ubuntu-to-newer-version/ - -作者:[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://news.itsfoss.com/ubuntu-21-10-release/ -[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/upgrade-to-Ubuntu-21-10.webp?resize=797%2C287&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/software-and-updates.webp?resize=800%2C166&ssl=1 -[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ubuntu-upgrade-settings.webp?resize=800%2C338&ssl=1 diff --git a/translated/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md b/translated/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md new file mode 100644 index 0000000000..a8a189f5ff --- /dev/null +++ b/translated/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md @@ -0,0 +1,67 @@ +[#]: subject: "How to Upgrade to Ubuntu 21.10 Right Now" +[#]: via: "https://itsfoss.com/upgrade-ubuntu-to-newer-version/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何现在就升级到 Ubuntu 21.10 +====== + +[Ubuntu 21.10 “Impish Indri” 刚刚发布][1]。如果你正在使用 Ubuntu 21.04,你应该有升级到 Ubuntu 21.10 的选项。 + +![Ubuntu 21.04 users should eventually be notified for the upgrade][2] + +然而,这种推出将是逐步的。这意味着不是每个人都会立即得到关于新版本可用性的通知。在你看到升级选项之前,可能需要几周的时间。 + +但是,如果你迫不及待地想获得带有 GNOME 40 和其他新功能的 Ubuntu 21.10 呢?你真的需要等待吗?答案是否定的。 + +### 现在就从 Ubuntu 21.04 升级到 Ubuntu 21.10 + +以下是你要做的。打开软件和更新应用: + +![Start the Software & Updates application][3] + +并确保你在**更新**标签下将“**通知我新的 Ubuntu 版本**”设置为“**为任何新版本**”。 + +![Make sure that settings are right for new Ubuntu version notification][4] + +现在打开终端,输入以下命令,以确保你的系统已经更新: + +``` +sudo apt update && sudo apt upgrade +``` + +当你的 Ubuntu 21.04 系统安装了所有的更新,运行更新管理器来寻找开发版本(本例中为 Ubuntu 21.10)。 + +``` +update-manager -d +``` + +它将打开寻找更新的更新管理器。由于你已经更新了系统,它不会找到新的更新来安装。然而,它将看到 Ubuntu 21.10 现在已经可用。 + +![Hit the upgrade button][2] + +你可以点击升级按钮,按照屏幕上的选项开始升级程序。你应该有良好的网络速度来下载 2GB 的更新。确保你的系统在升级过程中保持与电源的连接。 + +享受 Ubuntu 21.10! + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/upgrade-ubuntu-to-newer-version/ + +作者:[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://news.itsfoss.com/ubuntu-21-10-release/ +[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/upgrade-to-Ubuntu-21-10.webp?resize=797%2C287&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/software-and-updates.webp?resize=800%2C166&ssl=1 +[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ubuntu-upgrade-settings.webp?resize=800%2C338&ssl=1 From 8fa764224625f70e3e64c5b8b7f9fb647a0508c3 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 20 Oct 2021 08:47:33 +0800 Subject: [PATCH 0770/1588] translated --- ...t memory use statistics with this Linux command-line tool.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md b/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md index 85b30408bc..6d9ff731ed 100644 --- a/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md +++ b/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/memory-stats-linux-smem" [#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From d5f41920fcb9388db5bbf291a4554f67566ce9b4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 20 Oct 2021 09:13:20 +0800 Subject: [PATCH 0771/1588] APL --- ...Linux Flagship Smartphone That Could Replace Your Android.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md b/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md index d1d1592103..2c9887d94b 100644 --- a/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md +++ b/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/pinephone-pro-introduced/" [#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 7962517c49aabb5c7c7d7749e241918e567d1e32 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 20 Oct 2021 10:02:41 +0800 Subject: [PATCH 0772/1588] TSL&PRF --- ...rtphone That Could Replace Your Android.md | 118 ------------------ ...rtphone That Could Replace Your Android.md | 114 +++++++++++++++++ 2 files changed, 114 insertions(+), 118 deletions(-) delete mode 100644 sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md create mode 100644 translated/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md diff --git a/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md b/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md deleted file mode 100644 index 2c9887d94b..0000000000 --- a/sources/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: subject: "PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android" -[#]: via: "https://news.itsfoss.com/pinephone-pro-introduced/" -[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android -====== - -Back in 2019, when Pine64 announced the PinePhone, no one expected it to become as popular. Within just two years, Pine64 has managed to build a community of tens of thousands of developers and users, all working together to make Linux usable on a mobile phone. - -Now, Pine64 is widening the audience for Linux phones with the announcement of the PinePhone Pro. This device has many incredible new features, all of which put it on par with many mid-range Android phones. - -### PinePhone Pro Features - -![][1] - -Compared to the original PinePhone, the PinePhone Pro is a massive upgrade. The most notable of these upgrades is the usage of the Rockchip Hexa-core RK3399S SoC, which should provide a significant performance boost. Some other notable features and upgrades include: - - * 4GB LPDDR4 RAM - * 128GB storage + microSD card slot - * 6″ IPS display with ** Gorilla Glass 4* * - * 13 MP (rear) + 5 MP (front) cameras - - - -Let us explore more details on that. - -#### Better Performance - -![][2] - -By far the most significant upgrade, the inclusion of the RK3399S SoC is the result of a collaborative effort by Pine64 and Rockchip. This impressively powerful SoC packs 6 CPU cores, as well as a quad-core Mali T860 GPU. - -This combination delivers significant performance gains, putting the PinePhone Pro in a similar performance bracket to most mid-range Android phones. The result is a much faster system capable of running many desktop-class applications such as GIMP for photo editing and RetroArch for emulation. - -![][3] - -Overall, this upgrade will significantly improve the user experience for both developers and consumers. - -#### More Memory (RAM) - -Considering when smartphones have started to offer 6 GB RAM as the base variants, a Linux smartphone should also use extra memory to keep things smooth. Although a lot of work has gone into optimizing this, more RAM is always beneficial. - -The PinePhone Pro offers 4 GB of RAM, allowing greater versatility when docked and a few more open applications when used as a phone. I’m pretty excited about this, as it should enable more games to be emulated, increasing the PinePhone Pro’s appeal as an entertainment device. - -#### Upgraded Storage - -One of the biggest challenges I faced with my original PinePhone was the lack of storage. From watching movies to playing emulated games, I constantly had to delete files to have enough storage. - -With the PinePhone Pro, however, Pine64 has fixed this, offering it with 128 GB of flash storage, which should be enough for anyone. - -#### Improved Display - -![][4] - -While not precisely a sore point of the original PinePhone, the display has been upgraded with the PinePhone Pro to be larger and have Gorilla Glass 4. This is highly welcome, as the phone should now offer significantly improved scratch resistance and more usable screen real estate. - -While it would have been nice to see an AMOLED panel, this would have increased the price somewhat, possibly reducing the device’s appeal. Overall, I am happy with this upgrade, and I’m sure many users will be too. - -#### Essential Camera Upgrades - -For me, at least, the original PinePhone’s cameras were a pretty big sore point. The primary shooter, which was just 5 MP, was accompanied by a tiny 2 MP front camera, neither of which produced very high-quality images. - -The main shooter from the original PinePhone has been moved to the front of the PinePhone Pro. This is paired with a 13 MP Sony sensor capable of 4K video recording and much higher quality images. - -Users can finally utilize their Linux smartphones to take photos to share across social media platforms. - -### Can You Upgrade Your Original PinePhone? - -This was one of the first questions I asked when I saw the announcement. Unfortunately, it is not feasible to upgrade your PinePhone to a PinePhone Pro mainboard. I think Pine64 explains it pretty well: - -> While the PinePhone Pro’s mainboard will fit the PinePhone, the chassis, IPS display panel, cameras, the daughterboard, and thermal dissipation systems are all different. For instance, the PinePhone Pro’s cameras will not fit into the PinePhone chassis and are electrically incompatible with PinePhone Pro’s mainboard. Thermal dissipation is another important consideration, as the higher heat output may not be trivial to overcome in the original PinePhone’s chassis. - -Although Pine64 doesn’t recommend upgrading your original PinePhone’s mainboard, I think it would still be interesting to see what could be achieved by trying. While disappointing, it should also be noted that Pine64 has no intention of stopping the development of the original PinePhone, as it is perfect for people wanting a cheap Linux phone for fundamental usage. - -### Wrapping Up - -Overall, I am incredibly excited to see yet another device enter the Linux phone market, especially one as well-supported as the PinePhone Pro will (hopefully) be. Despite the **$399** price tag, I think that many people will flock to buy this phone. - -If you think you might be one of those people, you will have to wait a few months for the official release. - -However, developers wanting to receive an early unit can now click the button below to preorder the PinePhone Pro. - -For more details on the availability and specifications of PinePhone Pro, you should head to their [official website][5]. - -[Preorder The PinePhone Pro][6] - -_Are you going to get a PinePhone Pro?_ _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/pinephone-pro-introduced/ - -作者:[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,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9Ijc4MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[3]: https://i0.wp.com/i.ytimg.com/vi/pCxDcMdr_fo/hqdefault.jpg?w=780&ssl=1 -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjY1NyIgd2lkdGg9IjQ2NSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://www.pine64.org/pinephonepro/ -[6]: https://preorder.pine64.org/ diff --git a/translated/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md b/translated/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md new file mode 100644 index 0000000000..c349e8e384 --- /dev/null +++ b/translated/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md @@ -0,0 +1,114 @@ +[#]: subject: "PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android" +[#]: via: "https://news.itsfoss.com/pinephone-pro-introduced/" +[#]: author: "Jacob Crume https://news.itsfoss.com/author/jacob/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +PinePhone Pro:一款价位适中的 Linux 旗舰智能手机 +====== + +> 售价 399 美元的 PinePhone Pro 是一款 Linux 智能手机,或许有潜力取代一些预算相当的 Android 设备。但作为消费者,还需要等待几个月。 + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/PinePhone-Pro-ft.png?w=1200&ssl=1) + +早在 2019 年,当 Pine64 宣布推出 PinePhone 时,没有人想到它会变得如此受欢迎。在短短两年间,Pine64 已经成功建立了一个由数万名开发者和用户组成的社区,大家一起努力使 Linux 完美地跑在了手机上。 + +现在,随着 PinePhone Pro 的宣布,Pine64 正在扩大 Linux 手机的受众范围。这个设备有许多令人难以置信的新功能,所有这些都使它可以与许多中档 Android 手机相提并论。 + +- [视频](https://youtu.be/wP2-6Z74W44) + +### PinePhone Pro 功能 + +![][1] + +与原来的 PinePhone 相比,PinePhone Pro 带来了巨大的升级。这些升级中最值得注意的是使用了 Rockchip 的六核 RK3399S SoC 芯片,这应该能显著地提升性能。其他一些值得注意的功能和升级还有: + + * 4GB LPDDR4 内存 + * 128GB 存储 + microSD 卡插槽 + * 6 英寸 IPS 显示屏,采用 **大猩猩 4 号玻璃**。 + * 1300 万像素(后置)+ 500 万像素(前置)的摄像头 + +让我们来探讨一下这方面的更多细节。 + +#### 性能更好 + +![][2] + +到目前为止,最重要的升级是 RK3399S SoC 的加入,它是 Pine64 和 Rockchip 合作的结果。这个令人印象深刻的强大 SoC 包含 6 个 CPU 核心,以及一个四核 Mali T860 GPU。 + +这一组合带来了显著的性能提升,使得 PinePhone Pro 的性能与大多数中档安卓手机相当。这带来了一个更快的系统,能够运行许多桌面级应用程序,如用于照片编辑的 GIMP 和用于仿真游戏的 RetroArch。 + +总的来说,这次升级将大大改善开发者和消费者的用户体验。 + +#### 内存更多 + +考虑到智能手机已经开始提供 6GB 内存作为基本变体时,Linux 智能手机也应该使用更多的内存来保持流畅。虽然在优化方面已经做了很多工作,但更多的内存总是有益的。 + +PinePhone Pro 提供了 4GB 的内存,当放在基座上时可以有更大的通用性,当作为手机使用时可以多打开几个应用程序。我对此感到非常兴奋,因为它应该能够模拟更多的游戏,增加 PinePhone Pro 作为娱乐设备的吸引力。 + +#### 存储空间升级 + +我的原版的 PinePhone 面临的最大挑战之一是存储空间不足。从看电影到玩仿真游戏,我不得不不断地删除文件以获得足够的存储空间。 + +然而,在 PinePhone Pro 上,Pine64 已经解决了这个问题,它提供了 128GB 的闪存,这对任何人来说都足够了。 + +#### 显示屏改进 + +![][4] + +虽然这并不是原版 PinePhone 的痛点,但 PinePhone Pro 的显示屏已经升级,变得更大,采用了大猩猩 4 号玻璃。这是非常值得欢迎的,这款手机现在应该可以提供明显改善的防刮伤性能和更多可用的屏幕空间。 + +虽然 AMOLED 面板会很好,但这在一定程度上会提高价格,可能会降低设备的吸引力。总的来说,我对这次升级很满意,我相信许多用户也是这样。 + +#### 相机升级 + +至少对我来说,原版的 PinePhone 的摄像头是一个相当大的痛点。主摄像头只有 500 万像素,还有一个小小的 200 万像素的前置摄像头,这两个摄像头都不能拍出非常高质量的图像。 + +原版的 PinePhone 的主摄像头已被移到 PinePhone Pro 的前面。它与一个 1300 万像素的索尼摄像头传感器相配,能够录制 4K 视频和提供更高的图像质量。 + +用户终于可以用他们的 Linux 智能手机来拍摄照片,在社交媒体平台上分享了。 + +### 你可以升级你的原版 PinePhone 吗? + +这是我看到该公告时问的第一个问题。不幸的是,将你的 PinePhone 升级到 PinePhone Pro 主板是不可行的。我认为 Pine64 解释得很好: + +> 虽然 PinePhone Pro 的主板尺寸适合 PinePhone,但机框、IPS 显示面板、摄像头、子板和散热系统都不同。例如,PinePhone Pro 的摄像头就不适合 PinePhone 的机框,而且与 PinePhone Pro 的主板在电气上不兼容。散热是另一个重要的考虑因素,因为在原来的 PinePhone 的机框中,较高的热量输出可能不能简单地忽略,这需要克服解决。 + +虽然 Pine64 不建议升级你原来的 PinePhone 的主板,但我认为尝试一下还是很有意思的。虽然令人失望,但也应该注意到,Pine64 并不打算停止原来的 PinePhone 开发,因为它对于想要一个便宜的 Linux 手机作为基本用途的人来说是完美的。 + +### 总结 + +总的来说,我非常兴奋地看到又一个设备进入 Linux 手机市场,尤其是像 PinePhone Pro 这样将得到良好支持(希望是这样)的设备。尽管其价格是 399 美元,但我认为很多人都会蜂拥而至购买这款手机。 + +如果你认为你可能是这些人中的一员,但你得等待几个月后的正式发布。 + +然而,想要获得早期设备的开发者现在可以点击下面的按钮来预购 PinePhone Pro。 + +- [预购PinePhone Pro][6] + +关于 PinePhone Pro 的可用性和规格的更多细节,你应该去他们的 [官方网站][5] 看看。 + +你要买 PinePhone Pro 吗?请在下面的评论中告诉我! + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/pinephone-pro-introduced/ + +作者:[Jacob Crume][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/jacob/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/pinephone-pro.png?w=1024&ssl=1 +[2]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/pinephoneProMainBoard.jpg?w=1024&ssl=1 +[3]: https://i0.wp.com/i.ytimg.com/vi/pCxDcMdr_fo/hqdefault.jpg?w=780&ssl=1 +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/PinePhonePro.png?w=465&ssl=1 +[5]: https://www.pine64.org/pinephonepro/ +[6]: https://preorder.pine64.org/ From 7bb7eb4075f035bf326afd856e6034bd56375653 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 20 Oct 2021 10:11:59 +0800 Subject: [PATCH 0773/1588] PUB @wxy https://linux.cn/article-13901-1.html --- ...x Flagship Smartphone That Could Replace Your Android.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/news => published}/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md (97%) diff --git a/translated/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md b/published/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md similarity index 97% rename from translated/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md rename to published/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md index c349e8e384..ab6426afea 100644 --- a/translated/news/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md +++ b/published/20211018 PinePhone Pro is an Affordable Linux Flagship Smartphone That Could Replace Your Android.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13901-1.html" PinePhone Pro:一款价位适中的 Linux 旗舰智能手机 ====== @@ -18,7 +18,7 @@ PinePhone Pro:一款价位适中的 Linux 旗舰智能手机 现在,随着 PinePhone Pro 的宣布,Pine64 正在扩大 Linux 手机的受众范围。这个设备有许多令人难以置信的新功能,所有这些都使它可以与许多中档 Android 手机相提并论。 -- [视频](https://youtu.be/wP2-6Z74W44) +- [视频](https://img.linux.net.cn/static/video/Meet%20the%20PinePhone%20Pro%20_%20PINE64-wP2-6Z74W44.mp4) ### PinePhone Pro 功能 From 22f2ba38baa3b25d03115312b3bc7017fa1df522 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 20 Oct 2021 10:52:24 +0800 Subject: [PATCH 0774/1588] PRF&PUB @geekpi https://linux.cn/article-13902-1.html --- ...ow to Upgrade to Ubuntu 21.10 Right Now.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) rename {translated/tech => published}/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md (60%) diff --git a/translated/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md b/published/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md similarity index 60% rename from translated/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md rename to published/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md index a8a189f5ff..dd8a75ea34 100644 --- a/translated/tech/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md +++ b/published/20211015 How to Upgrade to Ubuntu 21.10 Right Now.md @@ -3,28 +3,28 @@ [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13902-1.html" 如何现在就升级到 Ubuntu 21.10 ====== [Ubuntu 21.10 “Impish Indri” 刚刚发布][1]。如果你正在使用 Ubuntu 21.04,你应该有升级到 Ubuntu 21.10 的选项。 -![Ubuntu 21.04 users should eventually be notified for the upgrade][2] +![](https://img.linux.net.cn/data/attachment/album/202110/20/105035l6ig4lkjnk5cipuw.jpg) -然而,这种推出将是逐步的。这意味着不是每个人都会立即得到关于新版本可用性的通知。在你看到升级选项之前,可能需要几周的时间。 +然而,这种推出将是逐步的。这意味着不是每个人都会立即得到新版本可用的通知。在你看到升级选项之前,可能需要几周的时间。 -但是,如果你迫不及待地想获得带有 GNOME 40 和其他新功能的 Ubuntu 21.10 呢?你真的需要等待吗?答案是否定的。 +但是,如果你迫不及待地想获得带有 GNOME 40 和其他新功能的 Ubuntu 21.10 呢?你真的需要等待吗?不用。 ### 现在就从 Ubuntu 21.04 升级到 Ubuntu 21.10 -以下是你要做的。打开软件和更新应用: +以下是你要做的。打开“软件和更新Software & Updates”应用: ![Start the Software & Updates application][3] -并确保你在**更新**标签下将“**通知我新的 Ubuntu 版本**”设置为“**为任何新版本**”。 +并确保你在“更新Updates”标签下将“通知我新的 Ubuntu 版本Notify me of a new Ubuntu version”设置为“任何新版本For any new version”。 ![Make sure that settings are right for new Ubuntu version notification][4] @@ -40,11 +40,11 @@ sudo apt update && sudo apt upgrade update-manager -d ``` -它将打开寻找更新的更新管理器。由于你已经更新了系统,它不会找到新的更新来安装。然而,它将看到 Ubuntu 21.10 现在已经可用。 +它将打开寻找更新的“更新管理器Update Manager”。由于你已经更新了系统,它不会找到新的更新来安装。然而,它将看到 Ubuntu 21.10 现在已经可用。 ![Hit the upgrade button][2] -你可以点击升级按钮,按照屏幕上的选项开始升级程序。你应该有良好的网络速度来下载 2GB 的更新。确保你的系统在升级过程中保持与电源的连接。 +你可以点击“升级Upgrade”按钮,按照屏幕上的选项开始升级程序。你需要有良好的网络速度来下载 2GB 的更新。确保你的系统在升级过程中保持与电源的连接。 享受 Ubuntu 21.10! @@ -55,13 +55,13 @@ via: https://itsfoss.com/upgrade-ubuntu-to-newer-version/ 作者:[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/) 荣誉推出 [a]: https://itsfoss.com/author/abhishek/ [b]: https://github.com/lujun9972 -[1]: https://news.itsfoss.com/ubuntu-21-10-release/ +[1]: https://linux.cn/article-13887-1.html [2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/upgrade-to-Ubuntu-21-10.webp?resize=797%2C287&ssl=1 [3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/software-and-updates.webp?resize=800%2C166&ssl=1 [4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ubuntu-upgrade-settings.webp?resize=800%2C338&ssl=1 From 151caa060ab69d5d918441625f39cf92db056929 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 21 Oct 2021 05:02:47 +0800 Subject: [PATCH 0775/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211021?= =?UTF-8?q?=20How=20to=20Convert=20a=20Webpage=20to=20PDF=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md --- ...ow to Convert a Webpage to PDF in Linux.md | 131 ++++++++++++++++++ 1 file changed, 131 insertions(+) create mode 100644 sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md diff --git a/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md b/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md new file mode 100644 index 0000000000..cbec186093 --- /dev/null +++ b/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md @@ -0,0 +1,131 @@ +[#]: subject: "How to Convert a Webpage to PDF in Linux" +[#]: via: "https://itsfoss.com/convert-webpage-pdf-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Convert a Webpage to PDF in Linux +====== + +Saving a webpage as a PDF comes in handy when you archive certain resources or use them for educational purposes. + +But, how do you convert a webpage to PDF in Linux? + +_**You can either choose to go the easy way out using the web browser (GUI) on every Linux distribution or use the terminal to turn a webpage into a PDF file.**_ + +Here, I shall mention both the methods to help you get the job done. + +### Method 1: Converting a Webpage to PDF Using Web Browser + +Even though I use Mozilla Firefox for this tutorial, you can do the same thing with any of the [best browsers available for Linux.][1] + +![][2] + +1\. Load up the webpage you want to convert. + +2\. Head to the browser menu to find the “**Print**” option or use the keyboard shortcut “**Ctrl + P**.” + +3\. By default, it should let you save it as a PDF. You need to hit “Save,” and choose the destination and save the webpage. + +![Save webpage as PDF in Mozilla Firefox][3] + +The one major problem with this simple approach is that it includes all the elements on the page. This may include comments, footer etc. You may use a PDF editor to remove parts of it but that’s an additional task. + +_**A better option is to utilize a browser extension like [Print Friendly][4]. It allows you to edit and remove parts of the webpage before downloading the PDF.**_ + +### Method 2: Converting a Webpage to PDF or Images Using the Terminal + +You probably already know that you can [browse internet in Linux terminal][5] and even [download files using the command line][6]. That’s not surprising considering you can do a lot more in the terminal, including downloading a webpage as PDF. + +A nifty open-source command-line tools **wkhtmltopdf** and **wkhtmltoimage** come to the rescue that lets you convert any HTML webpage to a PDF or image file. + +It utilizes the Qt WebKit rendering engine to get the task done. You can explore its [GitHub page][7] for more information. + +You should be able to install it from the default repository of your Linux distribution. For Ubuntu-based distros, you can type in the command: + +``` +sudo apt install wkhtmltopdf +``` + +It is pretty straightforward to use no matter whether you want to convert it to a PDF or image file: + +![][8] + +To convert a webpage into a PDF, type in: + +``` +wkhtmltopdf URL/domain filename.pdf +``` + +As an example, here’s how it would look: + +``` +wkhtmltopdf linuxmint.com mint.pdf +``` + +You can choose to use the complete URL as “** or use the domain name as shown in the example above. + +The file generated will be saved in the home directory by default. + +You also get a few exciting options when converting a webpage. + +For instance, you can **apply a grayscale filter to the PDF file**, **make multiple copies of the page** in the same file, and **exclude images** during conversion. + +The grayscale filter may not work on every webpage, but you can try that using the command: + +``` +wkhtmltopdf -g google.com googlepage.pdf +``` + +To make multiple copies of pages in the same PDF file, the command would be: + +``` +wkhtmltopdf --copies 2 linuxmint.com mint.pdf +``` + +And, if you want to exclude images from the web pages, just type: + +``` +wkhtmltopdf --no-images linuxmint.com mint.pdf +``` + +Additionally, if you want to convert a webpage as an image, the command would look like this: + +``` +wkhtmltoimage linuxmint.com mint.png +``` + +Note that unlike the GUI method using a browser, using these tools via the terminal has its limitation. It does not seem to convert web pages utilizing any <iframe> code snippets successfully. + +Sites like ours and even DuckDuckGo didn’t convert to PDF or an image. However, simple HTML sites like Linuxmint.com, Ubuntu.com, Google.com, worked like charm. + +### Wrapping Up + +To get the best results, saving a webpage as a PDF using a browser seems to be the way to go. But, if you want more options and go through the terminal, the **wkhtmltopdf** utility should come in handy. + +How do you prefer to convert web pages to PDF in Linux? Feel free to share your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/convert-webpage-pdf-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://itsfoss.com/best-browsers-ubuntu-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-save-webpage-pdf.png?resize=800%2C536&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-firefox-print-pdf-1.png?resize=602%2C584&ssl=1 +[4]: https://www.printfriendly.com/ +[5]: https://itsfoss.com/terminal-web-browsers/ +[6]: https://itsfoss.com/download-files-from-linux-terminal/ +[7]: https://github.com/wkhtmltopdf/wkhtmltopdf +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/htmltopdf-mint.png?resize=736%2C344&ssl=1 From 99e7f32494db1f6f603c505251c85a8ed990655c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 21 Oct 2021 05:03:09 +0800 Subject: [PATCH 0776/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211020?= =?UTF-8?q?=20Diagnose=20connectivity=20issues=20with=20the=20Linux=20ping?= =?UTF-8?q?=20command?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211020 Diagnose connectivity issues with the Linux ping command.md --- ...vity issues with the Linux ping command.md | 162 ++++++++++++++++++ 1 file changed, 162 insertions(+) create mode 100644 sources/tech/20211020 Diagnose connectivity issues with the Linux ping command.md diff --git a/sources/tech/20211020 Diagnose connectivity issues with the Linux ping command.md b/sources/tech/20211020 Diagnose connectivity issues with the Linux ping command.md new file mode 100644 index 0000000000..2af97315bf --- /dev/null +++ b/sources/tech/20211020 Diagnose connectivity issues with the Linux ping command.md @@ -0,0 +1,162 @@ +[#]: subject: "Diagnose connectivity issues with the Linux ping command" +[#]: via: "https://opensource.com/article/21/10/linux-ping-command" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Diagnose connectivity issues with the Linux ping command +====== +One of the most fundamental diagnostic tools for networked connectivity +is the ping command. +![World locations with red dots with a sun burst background][1] + +Networked computers are so common these days that most of us take it for granted that a computer on one side of a room can contact one on the other side of the room, much less the other side of the world. When it works as designed, networking is what makes the Internet, the cloud, file shares, media streaming, remote administration, printing, and much more possible. When something goes wrong, it can sometimes be challenging to diagnose. One of the most fundamental diagnostic tools for networked connectivity is the `ping` command. + +### The basic ping + +When you can't reach a computer on your local network, or a server on the Internet, you can ping it. A ping sends an Internet Control Message Protocol (ICMP) packet to a destination IP address. ICMP is, by design, a rudimentary format used mostly for diagnostics: It's essentially a call and response signal. + +But there's an order to troubleshooting, and it starts as close to home as possible. When in doubt, first ping your own computer to ensure you're running a networking stack. The computer you're operating is also called your _localhost_, and it has a special IP address assigned for speaking to itself: 12.0.0.1. + +The `ping`** **command understands the _localhost_ hostname, its IP address, and a shortcut of just `0`. + +You can control how many signals you send with the `-c` (as in _count_)** **option. + + +``` +$ ping 0 -c1 +PING 0 (127.0.0.1) 56(84) bytes of data. +64 bytes from 127.0.0.1: icmp_seq=1 ttl=64 time=0.069 ms + +\--- 0 ping statistics --- +1 packets transmitted, 1 received, 0% packet loss, time 0ms +rtt min/avg/max/mdev = 0.069/0.069/0.069/0.000 ms +``` + +After you've established that your local networking stack is up and running, you can ping your router. The address of a router usually starts with 192,168, or 10. The exact IP address depends on your router's configuration. + +When you don't specify how many pings to send, you can stop `ping` from running with **Ctrl**+**C**. + + +``` +$ ping 192.168.0.1  +PING 192.168.0.1 (192.168.0.1) 56(84) bytes of data. +From 192.168.0.100: icmp_seq=2 Redirect Host(New nexthop: 192.168.0.1) +From 192.168.0.100: icmp_seq=3 Redirect Host(New nexthop: 192.168.0.1) +From 192.168.0.100: icmp_seq=4 Redirect Host(New nexthop: 192.168.0.1) +From 192.168.0.100: icmp_seq=5 Redirect Host(New nexthop: 192.168.0.1) +^C +``` + +If you can reach your router, that means your wired or wireless connection is working.  + +What about other hosts on my network? You can ping all kinds of devices. Not all are guaranteed to respond (some devices drop ICMP packets), but many do. For instance, I can ping my printer: + + +``` +`$ ping 192.168.0.4 ` +``` + +### Pinging beyond your network + +Beyond establishing that your own network is working as expected, you can also ping out into the wider world beyond your router. Again, not all servers are permitted to receive, much less respond to, ICMP. However, there are some that do, and a vital server to the working of the Internet is a nameserver. + +Google's DNS server is relatively easy to remember, and it does respond to pings: + + +``` +$ ping -c 2 8.8.8.8 +PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. +64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=53.3 ms +64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=53.5 ms + +\--- 8.8.8.8 ping statistics --- +2 packets transmitted, 2 received, 0% packet loss, time 1000ms +rtt min/avg/max/mdev = 53.304/53.424/53.544/0.120 ms +``` + +When a site has apparently disappeared, you might be able to probe the worldwide DNS network to find out what its host server's address is, and then ping that server. This at least tells you whether the host is down or whether it's just a web server issue. + +For example, say you're trying unsuccessfully to reach example.com. First, find the IP address using the `host` command: + + +``` +$ host example.com +example.com has address 93.184.216.34 +example.com has IPv6 address 2606:2800:220:1:248:1893:25c8:1946 +example.com mail is handled by 0 +``` + +And then ping the website's host by IP: + + +``` +`$ ping 93.184.216.34 -c 1` +``` + +### Ping and IPv6 + +Ping works over IPv4 as well as IPv6. Using only one of them explicitly can be enforced by specifying `-4` or `-6`.  + +### Packet size + +You can change the size of the ICMP packets you're sending with the `-s` option. The default packet size is 56, which translates into 64 ICMP data bytes when combined with the 8-byte header. This command sends 43 bytes: + + +``` +`$ ping -s 35 -c 5 8.8.8.8` +``` + +You can print a timestamp before each ping report in your terminal with the `-D` option. This provides the UNIX epoch time, plus microseconds: + + +``` +$ ping -D 8.8.8.8  +PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data. +[1634013430.297468] 64 bytes from 8.8.8.8: icmp_seq=1 ttl=116 time=53.3 ms +[1634013431.298738] 64 bytes from 8.8.8.8: icmp_seq=2 ttl=116 time=53.1 ms +``` + +### Ping time + +You can change the time interval between pings using the `-i` option. This changes the ping interval to two seconds: + + +``` +`$ ping -s 2 ` +``` + +You can also stop pinging after some value of time (in seconds) with the `-w` option: + + +``` +`$ ping -w 6` +``` + +### Variants + +There are many implementations of ping. The `iputils` package provides a `ping` command, [Busybox ][2]has a `ping` command, and there's one from BSD and others. There's even a GUI for `ping`: Gping is available for Linux, macOS, and Windows. You can find more information for `gping` on [Github][3].  + +### Learn to ping + +The `ping` command is simple, but it can be eyes and ears out on the vast expanse that is your network. Next time you have connectivity issues, let `ping` be the first tool you turn to. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-ping-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/world_remote_teams.png?itok=Wk1yBFv6 (World locations with red dots with a sun burst background) +[2]: https://opensource.com/article/21/8/what-busybox +[3]: https://github.com/orf/gping From 72d61afdf892a26a790d49ff6a409b16a18c9492 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 21 Oct 2021 05:03:27 +0800 Subject: [PATCH 0777/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211020?= =?UTF-8?q?=20Inspect=20the=20capabilities=20of=20ELF=20binaries=20with=20?= =?UTF-8?q?this=20open=20source=20tool?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211020 Inspect the capabilities of ELF binaries with this open source tool.md --- ...ELF binaries with this open source tool.md | 324 ++++++++++++++++++ 1 file changed, 324 insertions(+) create mode 100644 sources/tech/20211020 Inspect the capabilities of ELF binaries with this open source tool.md diff --git a/sources/tech/20211020 Inspect the capabilities of ELF binaries with this open source tool.md b/sources/tech/20211020 Inspect the capabilities of ELF binaries with this open source tool.md new file mode 100644 index 0000000000..d17fe316d1 --- /dev/null +++ b/sources/tech/20211020 Inspect the capabilities of ELF binaries with this open source tool.md @@ -0,0 +1,324 @@ +[#]: subject: "Inspect the capabilities of ELF binaries with this open source tool" +[#]: via: "https://opensource.com/article/21/10/linux-elf-capa" +[#]: author: "Gaurav Kamathe https://opensource.com/users/gkamathe" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Inspect the capabilities of ELF binaries with this open source tool +====== +Use capa to reveal all the mysteries of ELF binaries. +![Puzzle pieces coming together to form a computer screen][1] + +If Linux is your primary working environment, then you might be familiar with the Executable and Linkable Format ([ELF][2]), the main file format used for executables, libraries, core-dumps, and more, on Linux. I've written articles covering native Linux tools to understand ELF binaries, beginning with [how ELF binaries are built][3], followed by some general tips on how to [analyze ELF binaries][4]. If you are not familiar with ELF and executables in general, I suggest reading these articles first. + +### Introducing Capa + +Capa is an [open-source project][5] from Mandiant (a cybersecurity company). In the project's own words, _capa detects capabilities in executable files_. Although the primary target of Capa is unknown and possibly malicious executables, the examples in this article run Capa on day-to-day Linux utilities to see how the tool works. + +Given that most malware is Windows-based, earlier Capa versions only supported the PE file format, a dominant Windows executable format. However, starting with v3.0.0, support for ELF files has been added (thanks to [Intezer][6]). + +### What are capabilities? + +What does the concept of _capabilities_ actually mean, especially in the context of executable files? Programs or software fulfill certain computing needs or solve a problem. To keep things simple, our requirements could vary from finding a file, reading/writing to a file, running a program, logging some data to a log file, opening a network connection, etc. We then use a programming language of our choice with specific instructions to fulfill these tasks and compile the program. The resulting binary or executables then performs these tasks on the user's behalf, so the resulting executable is _capable_ of carrying out the above tasks. + +Looking at the source code, it's easy to identify what a program does or what its intent is. However, once the program is compiled as an executable, the source code is converted to machine language and is no longer part of the resulting executable (unless compiled with debug info). We can still make some sense of it by looking at the equivalent assembly instructions backed by some knowledge of the Linux API (glibc/system calls), however, it's difficult. Tools like de-compilers do exist which try to convert the assembly to a pseudo-code of what might have been the original source code. However, it isn't a one-to-one match, and it is only a best-effort attempt. + +### Why another tool? + +If we have multiple native Linux tools to analyze binaries, why do we need another one? The existing tools aid developers in troubleshooting and debugging issues that might arise during development. They are often the first step for initial analysis on unknown binaries, however, they are not sufficient. + +Sometimes what is needed isn't lengthy disassembly or long pseudo-code, but just a quick summary of the capabilities seen in the binary based on its API usage. Often, malicious binaries and malware employ some anti-analysis or anti-reversing techniques that render such native tools helpless. + +Capa's primary audience is malware or security researchers who often come across unknown binaries for which source code isn't available. They need to identify if it's malware or a benign executable. An initial first step is finding out what the executable can do before moving to dynamic analysis. This can be done with some pre-defined rule sets matched against a popular framework (ATT&CK). Native Linux tools were not designed for such uses. + +### Getting Capa + +Download a pre-built Capa Linux program from [here][7]. You must use v3.0.0 or above. Capa is programmed in Python, however the downloaded program isn't a `.py` file that the Python interpreter can execute. It is instead an ELF executable that runs directly from the Linux command line. + + +``` +$ pwd +/root/CAPA +$ +$ wget -q +$ +$ file capa-v3.0.2-linux.zip +capa-v3.0.2-linux.zip: Zip archive data, at least v2.0 to extract +$ +$ unzip capa-v3.0.2-linux.zip +Archive:  capa-v3.0.2-linux.zip +  inflating: capa                     +$ +$ ls -l capa +-rwxr-xr-x. 1 root root 41282976 Sep 28 18:29 capa +$ +$ file capa +capa: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=1da3a1d77c7109ce6444919f4a15e7e6c63d02fa, stripped +``` + +### Command line options + +Capa comes with a variety of command line options. This article visits a few of them, beginning with the help content: + + +``` +$ ./capa -h +usage: capa [-h] [--version] [-v] [-vv] [-d] [-q] [--color {auto,always,never}] [-f {auto,pe,elf,sc32,sc64,freeze}] +            [-b {vivisect,smda}] [-r RULES] [-s SIGNATURES] [-t TAG] [-j] +            sample + +The FLARE team's open-source tool to identify capabilities in executable files. + +<< snip >> +$ +``` + +Use this command to check if the required version of Capa (v3 and above) is running: + + +``` +$ ./capa --version +capa v3.0.2-0-gead8a83 +``` + +### Capa output and the MITRE ATT&CK framework + +Capa output can be a bit overwhelming, so first run it on a simple utility, such as `pwd`. The `pwd` command on Linux prints the current working directory and is a common command. Please note that `pwd` might be a shell-inbuilt for you (no separate executable) depending on the distro you are using. Identify its path using the `which` command first and then provide the complete path to Capa. Here is an example: + + +``` +$ which pwd +/usr/bin/pwd +$ +$ file /usr/bin/pwd +/usr/bin/pwd: ELF 64-bit LSB pie executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=ec306ddd72ce7be19dfc1e62328bb89b6b3a6df5, for GNU/Linux 3.2.0, stripped +$ +$ ./capa -f elf /usr/bin/pwd +loading : 100%| 633/633 [00:00<00:00, 2409.72 rules/s] +matching: 100%| 76/76 [00:01<00:00, 38.87 functions/s, skipped 0 library functions] ++------------------------+------------------------------------------------------------------------------------+ +| md5                    | 8d50bbd7fea04735a70f21cca5063efe                                                   | +| sha1                   | 7d9df581bc3d34c9fb93058be2cdb9a8c04ec061                                           | +| sha256                 | 53205e6ef4e1e7e80745adc09c00f946ae98ccf6f8eb9c4535bd29188f7f1d91                   | +| os                     | linux                                                                              | +| format                 | elf                                                                                | +| arch                   | amd64                                                                              | +| path                   | /usr/bin/pwd                                                                       | ++------------------------+------------------------------------------------------------------------------------+ + ++------------------------+------------------------------------------------------------------------------------+ +| ATT&CK Tactic          | ATT&CK Technique                                                                   | +|------------------------+------------------------------------------------------------------------------------| +| DISCOVERY              | File and Directory Discovery:: T1083                                               | ++------------------------+------------------------------------------------------------------------------------+ + ++-----------------------------+-------------------------------------------------------------------------------+ +| MBC Objective               | MBC Behavior                                                                  | +|-----------------------------+-------------------------------------------------------------------------------| +| FILE SYSTEM                 | Writes File:: [C0052]                                                         | ++-----------------------------+-------------------------------------------------------------------------------+ + ++------------------------------------------------------+------------------------------------------------------+ +| CAPABILITY                                           | NAMESPACE                                            | +|------------------------------------------------------+------------------------------------------------------| +| enumerate files on Linux (2 matches)                 | host-interaction/file-system/files/list              | +| write file on Linux                                  | host-interaction/file-system/write                   | ++------------------------------------------------------+------------------------------------------------------+ +``` + +Run Capa with the `-f elf` argument to tell it that the executable to analyze is in the ELF file format. This option might be required for unknown binaries; however, Capa is perfectly capable of detecting the format on its own and doing the analysis, so you can skip this option if required. In the beginning, you will see a loading/matching message as Capa loads its rules from the backend and then analyzes the executable and matches those rules against it. Skip displaying this by adding the `-q` option to all commands. + +Capa output is divided into various sections. The first section uniquely identifies the binary using its md5, sha1, or sha256 hash followed by the operating system, file format, and architecture information. This information is often critical when dealing with executables. In the following sections, Capa uses the ATT&CK Tactic and Technique to match the capabilities. If you are unfamiliar with what ATT&CK means, please refer to the [MITRE ATT&CK Framework here][8]. + +MITRE ATT&CK is best described in the project's own words: + +> MITRE ATT&CK® is a globally-accessible knowledge base of adversary tactics and techniques based on real-world observations. + +You can match the output of Capa in the following two sections with that of the MITRE ATT&CK framework. I shall skip this part in this article. + +Finally, in the Capability section, you can see two specific capabilities listed out: + + +``` +enumerate files on Linux +write file on Linux +``` + +Compare this with the nature of the `pwd` program, which needs to show the current directory. Here it matches the first capability (remember the concept of everything is a file in Linux). What about the second part, which says _writing file_? We certainly haven't written `pwd` output to any file. However, remember `pwd` needs to write the current directory location to the terminal; how else will the output be printed? If you are still unsure of how this works, run the following command and match the output. If you are unfamiliar with `strace` or what it does, I have an article covering it [here][9]. Focus on the _write_ system call toward the end of the article where the `pwd` executable needs to write the directory path (string) to **1**, which stands for standard out. In our case, that is the terminal. + + +``` +$ strace -f  /usr/bin/pwd +execve("/usr/bin/pwd", ["/usr/bin/pwd"], 0x7ffd7983a238 /* 49 vars */) = 0 +brk(NULL) + +<< snip >> + +write(1, "/root/CAPA\n", 11/root/CAPA +)            = 11 +close(1)                                = 0 +close(2)                                = 0 +exit_group(0)                           = ? ++++ exited with 0 +++ +``` + +### Running Capa on different Linux utilities + +Now that you know how to run Capa, I highly recommend you try it on various day-to-day Linux utilities. When choosing utilities try to be as diverse as possible. For example, select utilities that work with file systems or storage commands, such as `ls`, `mount`, `cat`, `echo`, etc. Next, move to network utilities, like `netstat`, `ss`, `telnet`, etc., where you will find the network capabilities of an executable. Extend it to more extensive programs daemons like `sshd` to see crypto-related capabilities, followed by `systemd`, `bash`, etc. + +A word of caution, don't be too spooked if you see rules that match malware for these native utilities. For example, when analyzing systemd, Capa showed matches for COMMAND AND CONTROL based on the capability to receive data from a network. This capability could be used by genuine programs for legitimate cases, while malware could use it for malicious purposes. + +### Running in Debug mode + +If you wish to see how Capa finds all these capabilities in an executable, provide the `-d` flag, which displays additional information on the screen that might help understand its inner working. Use this data and look for clues in the source code on GitHub. + + +``` +`$ ./capa -q /usr/sbin/sshd -d` +``` + +The first thing to notice is that Capa saves rules to a temp directory and reads them from there: + + +``` +`DEBUG:capa:reading rules from directory /tmp/_MEIKUG6Oj/rules` +``` + +The debug output shows it loaded various rules from this directory. As an example, see how it tried to identify the hostname of a machine: + + +``` +`DEBUG:capa:loaded rule: 'get hostname' with scope: function` +``` + +With this information, it's easy to look up the rule. Simply go to the `rules` directory and `grep` for the specific rule name like the example below. The rule is stated in a .yml file. + + +``` +$ grep -irn "name: get hostname" * +rules/host-interaction/os/hostname/get-hostname.yml:3:    name: get hostname +``` + +Check for the `-api` sections where various APIs are listed. Capa looks for the `gethostname` API usage (on Linux), and you can see the Windows equivalent listed there, too. + + +``` +$ cat _MEIKUG6Oj/rules/host-interaction/os/hostname/get-hostname.yml +rule: +  meta: +    name: get hostname +    namespace: host-interaction/os/hostname + +<< snip >> + +  features: +    - or: +      - api: kernel32.GetComputerName +      - api: kernel32.GetComputerNameEx +      - api: GetComputerObjectName +      - api: ws2_32.gethostname +      - api: gethostname +``` + +You can find more information about this specific system call on Linux using the man page. + + +``` +$ man 2 gethostname + +GETHOSTNAME(2)                          Linux Programmer's Manual                               GETHOSTNAME(2) + +NAME +       gethostname, sethostname - get/set hostname + +<< snip >> +``` + +### Verbose usage + +Another good way to identify which API's Capa is looking for is using the verbose mode, as shown below. This simple example displays the usage of `opendir`, `readdir`, and `fwrite` APIs: + + +``` +$ ./capa  -q /usr/bin/pwd -vv +enumerate files on Linux (2 matches) + +<< snip >> + +        api: opendir @ 0x20052E8 +        api: readdir @ 0x2005369, 0x200548A + +write file on Linux + +<< snip >> + +    os: linux +    or: +      api: fwrite @ 0x2002CB5 +``` + +### Custom rules + +As with other good tools, Capa allows you to extend it by adding your own rules. This hint was also given in the debug output, if you noticed. + + +``` +`$ capa --signature ./path/to/signatures/ /path/to/executable` +``` + +### Specific rules only + +You can also look for specific rules instead of having Capa trying to match every rule. Do this by adding the `-t` flag followed by the exact rule name: + + +``` +`$ ./capa -t "create process on Linux" /usr/sbin/sshd -q -j` +``` + +Display the rule name from the .yml files within the `rules` directory. For example: + + +``` +$ grep name rules/host-interaction/process/create/create-process-on-linux.yml +    name: create process on Linux +``` + +### Output format + +Finally, Capa allows output in JSON format using the `-j` flag. This flag helps consume the information quickly and aid automation. This example command requires that the [jq command][10] is installed: + + +``` +`$ ./capa -t "create process on Linux" /usr/sbin/sshd -q -j | jq .` +``` + +### Wrap up + +Capa is a worthy addition to the much-needed tools for ELF executables. I say _much-needed_ because we regularly see cases of Linux malware now. Tools on Linux must catch up to tackle these threats. You can play around with Capa and try it on various executables, and also write your own rules and add them upstream for the benefit of the community. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-elf-capa + +作者:[Gaurav Kamathe][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/gkamathe +[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://en.wikipedia.org/wiki/Executable_and_Linkable_Format +[3]: https://opensource.com/article/19/10/gnu-binutils +[4]: https://opensource.com/article/20/4/linux-binary-analysis +[5]: https://github.com/mandiant/capa +[6]: https://www.intezer.com/ +[7]: http://github.com/mandiant/capa/releases +[8]: https://attack.mitre.org/ +[9]: https://opensource.com/article/19/10/strace +[10]: https://stedolan.github.io/jq/ From e985549debc79ccee758b28033ce2e3a08bec2f8 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 21 Oct 2021 08:55:26 +0800 Subject: [PATCH 0778/1588] translated --- ...211018 4 Linux tools to erase your data.md | 123 ------------------ ...211018 4 Linux tools to erase your data.md | 123 ++++++++++++++++++ 2 files changed, 123 insertions(+), 123 deletions(-) delete mode 100644 sources/tech/20211018 4 Linux tools to erase your data.md create mode 100644 translated/tech/20211018 4 Linux tools to erase your data.md diff --git a/sources/tech/20211018 4 Linux tools to erase your data.md b/sources/tech/20211018 4 Linux tools to erase your data.md deleted file mode 100644 index 59a30d6111..0000000000 --- a/sources/tech/20211018 4 Linux tools to erase your data.md +++ /dev/null @@ -1,123 +0,0 @@ -[#]: subject: "4 Linux tools to erase your data" -[#]: via: "https://opensource.com/article/21/10/linux-tools-erase-data" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -4 Linux tools to erase your data -====== -Erase data from your hard disk drive with these open source tools. -![Tools in a cloud][1] - -One of the best ways to keep your data secure is by only writing data to an encrypted hard drive. On a standard drive, it's possible to view data just by mounting the drive as if it were a thumb drive, and it's even possible to display and recover even deleted data with tools like [Scalpel][2] and [Testdisk][3]. But on an encrypted drive, data is unreadable without a decryption key (usually a passphrase you enter when mounting the drive.) - -Encryption can be established when you install your OS, and some operating systems even make it possible to activate encryption any time after installation. - -What do you do when you're selling a computer or replacing a drive that never got encrypted in the first place, though? - -The next best thing to encrypting your data from the start is by erasing the data when you're finished with the drive. - -### Responsible caretaker - -I'm frequently called on to help clients upgrade an old computer. Invariably, they're more than willing to help me recycle them so that they can be used by someone else. I'm happy to refurbish these older computers and refit them with a newer solid-state drive, dramatically improving performance. - -However, it's not a good idea to just throw an old drive in the trash. It needs to be erased and then disposed of properly. Rather than leave the drives in the original computer, I remove them, place them in a drive enclosure, and connect them to my Linux computer. Several Linux utilities can easily accomplish this. One of them is the **Gnu Shred** tool. - -### GNU Shred - - -``` -`$ sudo shred -vfz /dev/sdX` -``` - -Shred has many options: - - * n - the number of overwrites. The default is three. - * u - overwrite and delete. - * s - the number of bytes to shred. - * v - show extended information. - * f - force the change of permissions to allow writing if necessary. - * z - add a final overwrite with zeros to hide shredding. - - - -Use `shred --help` for more information - -### ShredOS - -ShredOS is a live Linux distribution with the sole purpose of erasing the entire contents of a drive. It was developed after a similar distribution, called DBAN, was discontinued. It uses the `nwipe` application, which is a fork of DBAN's `dwipe`. You can make a bootable USB drive by downloading the 32 bit or 64 bit image and writing it to a drive with the `dd` command on Linux and macOS: - - -``` -`$ sudo dd if=shredos.img of=/dev/sdX bs=4M status=progress` -``` - -Alternately, you can use the [Etcher][4] tool on Linux, macOS, and Windows. - -### The dd command - -A common method for erasing drives is with the Linux `dd` command. Nearly every Linux installation comes with the `dd` utility installed. Make sure that the drive is not mounted. - - -``` -`$ sudo umount /dev/sdXY -l` -``` - -If you want to write zeros over your entire target disk, issue the following command. It will probably be an overnight job. - - -``` -`$ sudo dd if=/dev/urandom of=/dev/sdX bs=10M` -``` - -**Warning**: Be sure that you know where you are on your system and target the correct drive so that you don't accidentally erase your own data. - -### Nvme-cli - -If your computer contains one of the newer NVMe drives, you can install the [nvme-cli][5] utilities and use the `sanitize` option to erase your drive. - -The command `nvme sanitize help` command provides you with a list of sanitize options, which include the following: - - * \--no-dealloc, -d - No deallocate after sanitize. - * \--oipbp, -i - Overwrite invert pattern between passes. - * \--owpass=, -n - Overwrite pass count. - * \--ause, -u - Allow unrestricted sanitize exit. - * \--sanact=, -a - Sanitize action. - * \--ovrpat=, -p - Overwrite pattern. - - - -Here is the command I use: - - -``` -`$ sudo nvme sanitize /dev/nvme0nX` -``` - -The same warnings apply here as with the format process: back up important data first because this command erases it! - -### Information management - -The information you keep on your computer is important. It belongs to you and to know one else. When you're selling off a computer or disposing of a hard drive, make sure you've cleared it of your data with one of these great tools. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/linux-tools-erase-data - -作者:[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/cloud_tools_hardware.png?itok=PGjJenqT (Tools in a cloud) -[2]: https://www.redhat.com/sysadmin/find-lost-files-scalpel -[3]: https://www.redhat.com/sysadmin/recover-partition-files-testdisk -[4]: https://opensource.com/article/18/7/getting-started-etcherio -[5]: https://opensource.com/article/21/9/nvme-cli diff --git a/translated/tech/20211018 4 Linux tools to erase your data.md b/translated/tech/20211018 4 Linux tools to erase your data.md new file mode 100644 index 0000000000..55572d7984 --- /dev/null +++ b/translated/tech/20211018 4 Linux tools to erase your data.md @@ -0,0 +1,123 @@ +[#]: subject: "4 Linux tools to erase your data" +[#]: via: "https://opensource.com/article/21/10/linux-tools-erase-data" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +4 个 Linux 工具来清除你的数据 +====== +用这些开源工具从你的硬盘驱动器中删除数据。 +![Tools in a cloud][1] + +保持数据安全的最好方法之一是只向加密的硬盘驱动器写入数据。在一个标准的硬盘上,只要把硬盘挂载就可以查看数据,就像 U 盘一样,甚至可以用 [Scalpel][2] 和 [Testdisk][3] 等工具显示和恢复已删除的数据。但是在一个加密的驱动器上,如果没有解密密钥(通常是你在挂载驱动器时输入的密码),数据是无法被读取的。 + +加密可以在你安装操作系统时建立,有些操作系统甚至可以在安装后的任何时候激活加密功能。 + +但是,当你卖掉一台电脑或更换一个一开始就没有被加密的驱动器时,你该怎么办呢? + +与从一开始就加密你的数据相比,最好的办法是在你用完硬盘后删除数据。 + +### 负责任的看管者 + +我经常被要求帮助客户升级一台旧电脑。无一例外,他们更愿意帮助我回收它们,使它们能被别人使用。我很乐意翻新这些旧电脑,用较新的固态驱动器来改装它们,极大地提高性能。 + +然而,把一个旧驱动器扔进垃圾桶并不是一个好主意。它需要被擦除,然后被妥善处理。我没有把硬盘留在原来的电脑里,而是把它们取出来,放在一个硬盘盒里,然后把它们连接到我的 Linux 电脑上。有几个 Linux 工具可以很容易地完成这个任务。其中一个是 **Gnu Shred**。 + +### GNU Shred + + +``` +`$ sudo shred -vfz /dev/sdX` +``` + +Shred 有许多选项: + + * n - 覆盖的次数。默认是三次。 + * u - 覆盖和删除。 + * s - 要粉碎的字节数。 + * v - 显示扩展信息。 + * f - 必要时强制改变权限以允许写入。 + * z - 最后用 0 覆盖来隐藏粉碎。 + + + +使用 `shred --help` 获取更多信息 + +### ShredOS + +ShredOS 是一个 Live Linux 发行版,它的唯一目的是清除驱动器的全部内容。它是在一个名为 DBAN 的类似发行版停止维护后开发的。它使用 `nwipe` 应用,它是 DBAN 的 `dwipe` 的一个分叉。你可以通过下载 32 位或 64 位镜像,并在 Linux 和 macOS 上使用 `dd` 命令将其写入驱动器来制作一个可启动的 USB 驱动器: + + +``` +`$ sudo dd if=shredos.img of=/dev/sdX bs=4M status=progress` +``` + +另外,你可以在 Linux、macOS 和 Windows 上使用 [Etcher][4] 工具。 + +### dd 命令 + +清除驱动器的一个常见方法是使用 Linux 的 `dd` 命令。几乎所有的 Linux 安装都安装了 `dd` 工具。确保该驱动器没有被挂载。 + + +``` +`$ sudo umount /dev/sdXY -l` +``` + +如果你想在整个目标磁盘上写零,执行以下命令。这可能会是一个通宵的工作。 + + +``` +`$ sudo dd if=/dev/urandom of=/dev/sdX bs=10M` +``` + +**警告**:请确保你知道你在系统中的位置,并以正确的驱动器为目标,这样你就不会意外地删除自己的数据。 + +### Nvme-cli + +如果你的计算机包含一个较新的 NVMe 驱动器,你可以安装 [nvme-cli][5] 程序,并使用 `sanitize` 选项来清除你的驱动器。 + +`nvme sanitize help` 命令为你提供了一个 sanitize 选项的列表,其中包括以下内容: + + * \--no-dealloc, -d - sanitize 后不解除分配。 + * \--oipbp, -i - 在通道之间覆盖反转模式。 + * \--owpass=, -n - 覆盖通道次数。 + * \--ause, -u - 允许 sanitize 无限制退出。 + * \--sanact=, -a - Sanitize 行为。 + * \--ovrpat=, -p - 覆盖模式。 + + + +下面是我使用的命令: + + +``` +`$ sudo nvme sanitize /dev/nvme0nX` +``` + +这里的警告与格式化过程相同:首先备份重要的数据,因为这个命令会擦除这些数据! + +### 信息管理 + +你保存在计算机上的信息是很重要的。它属于你,也属于其他任何人。当你卖掉一台电脑或处理一个硬盘时,确保你已经用这些很棒的工具之一清除了你的数据。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-tools-erase-data + +作者:[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/cloud_tools_hardware.png?itok=PGjJenqT (Tools in a cloud) +[2]: https://www.redhat.com/sysadmin/find-lost-files-scalpel +[3]: https://www.redhat.com/sysadmin/recover-partition-files-testdisk +[4]: https://opensource.com/article/18/7/getting-started-etcherio +[5]: https://opensource.com/article/21/9/nvme-cli From 1087eb727163eeb0dc202bf2835b1e5bd0521038 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 21 Oct 2021 09:04:53 +0800 Subject: [PATCH 0779/1588] translating --- ...I- A Blazing Fast Terminal Client for Git Written in Rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md b/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md index 65205f69ca..99a3479d17 100644 --- a/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md +++ b/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/gitui/" [#]: author: "Marco Carmona https://itsfoss.com/author/marco/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 64c50af1ef22b48544b8c0fc410e288117833c7f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 Oct 2021 09:59:44 +0800 Subject: [PATCH 0780/1588] PUB @geekpi https://linux.cn/article-13904-1.html --- ...3 5 markdown editors I recommend trying.md | 83 ++++++++++++++++++ ...3 5 markdown editors I recommend trying.md | 84 ------------------- 2 files changed, 83 insertions(+), 84 deletions(-) create mode 100644 published/20211013 5 markdown editors I recommend trying.md delete mode 100644 translated/tech/20211013 5 markdown editors I recommend trying.md diff --git a/published/20211013 5 markdown editors I recommend trying.md b/published/20211013 5 markdown editors I recommend trying.md new file mode 100644 index 0000000000..d107ec755a --- /dev/null +++ b/published/20211013 5 markdown editors I recommend trying.md @@ -0,0 +1,83 @@ +[#]: subject: "5 markdown editors I recommend trying" +[#]: via: "https://opensource.com/article/21/10/markdown-editors" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13904-1.html" + +我推荐尝试的 5 个 Markdown 编辑器 +====== + +> 每个人都有自己喜欢的 Markdown 编辑器。这里有几个我已经试过的。 + +![](https://img.linux.net.cn/data/attachment/album/202110/21/095837n8q1s3hqc1og1fsq.jpg) + +你可以用 Markdown 做任何事情:给网站排版、编写书籍和撰写技术文档只是它的一些用途。我喜欢它创建富文本文档可以如此简单。每个人都有自己喜欢的 Markdown 编辑器。在我的 Markdown 之旅中,我使用了好几个。下面是我考虑过的五个 Markdown 编辑器。 + +### Abricotine + +[Abricotine][2] 是一个在 [GPLv][3] 下发布的开源编辑器。你可以手动输入格式,或者使用菜单插入 [GitHub 风格的 Markdown][4]。Abricotine 允许你在输入时预览文本元素,如标题、图片、数学、嵌入式视频和待办事项。该编辑器只能将文件导出为 HTML。你可以在 Linux、macOS 和 Windows 上使用 Abricotine。 + +![Abricontine][5] + +### MarkText + +[MarkText][7] 是一个简单的 Markdown 编辑器。它有很多功能,而且在处理 Markdown 格式的文件方面做得很好。MarkText 也支持 GitHub 风格的 Markdown,它允许你添加表格和带有语法高亮的代码块。它支持实时预览,并且有一个简单的界面。MarkText 是在 [MIT][8] 下授权的。它支持 HTML 和 PDF 格式的输出。MarkText 可以在 Linux、macOS 和 Windows 上使用。 + +![MarkText][9] + +### Ghostwriter + +[Ghostwriter][10] 是一个用于 Linux 和 Windows 的 Markdown 编辑器。根据其网站用户的说法。“享受无干扰的写作体验,包括全屏模式和简洁的界面。有了 Markdown,你可以现在写,以后再格式化”。它有内置的默认的浅色和深色主题,或者你可以自己编写。你可以将文件实时按 HTML 预览,你可以直接复制和粘贴到博客中,或导出为其他格式。Ghostwriter 是在 [GPLv3][11] 下发布的。 + +![Ghostwriter][12] + +### Atom + +[Atom][13] 被称为 21 世纪的可自定义文本编辑器。它也可以作为一个 Markdown 编辑器使用。它可以在 Linux、Windows 和 macOS上运行,并以 [MIT][14] 许可证发布。它支持 GitHub 风格的 Markdown,并且按下 `Ctrl+Shift+M` 可以打开一个预览面板,这样你就可以轻松地看到 HTML 预览。你可以通过创建一个文件并以 `.md` 文件扩展名保存来轻松入门。这告诉 Atom 它是一个 Markdown 文件。Atom 会自动应用正确的包和语法高亮。 + +![Atom][15] + +### VSCodium + +[VSCodium][16] 是微软的 VSCode 编辑器的自由开源版本,没有内置在微软产品中的遥测技术。它以 [MIT][17] 许可证发布,并提供了 VSCode 的所有功能,而没有专有特性。除了其他功能外,VSCodium 还可以作为一个 Markdown 编辑器。创建一个新文件,点击 “选择一个语言”,选择 “Markdown”,然后开始写你的代码。通过按 `Ctrl-Shift+V` 轻松预览文本,然后再切换回编辑器。你也可以通过添加一个扩展来轻松地扩展 Markdown 编辑器。我最喜欢的插件是 [Markdown editor][18],它是 [MIT][19] 许可证。 + +![VSCodium][20] + +你最喜欢的 Markdown 编辑器是什么? 让我们在评论中知道。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/markdown-editors + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriter-pink.png?itok=OXJBtyYf (A pink typewriter) +[2]: https://abricotine.brrd.fr/ +[3]: https://github.com/brrd/abricotine/blob/develop/LICENSE +[4]: https://guides.github.com/features/mastering-markdown/ +[5]: https://opensource.com/sites/default/files/uploads/1_abricontine.png (Abricontine) +[6]: https://creativecommons.org/licenses/by-sa/4.0/ +[7]: https://marktext.app/ +[8]: https://github.com/marktext/marktext/blob/develop/LICENSE +[9]: https://opensource.com/sites/default/files/uploads/2_marktext.png (MarkText) +[10]: https://wereturtle.github.io/ghostwriter/ +[11]: https://github.com/wereturtle/ghostwriter/blob/master/COPYING +[12]: https://opensource.com/sites/default/files/uploads/3_ghostwriter.png (Ghostwriter) +[13]: https://atom.io/ +[14]: https://github.com/atom/atom/blob/master/LICENSE.md +[15]: https://opensource.com/sites/default/files/uploads/4_atom.png (Atom) +[16]: https://vscodium.com/ +[17]: https://github.com/VSCodium/vscodium/blob/master/LICENSE +[18]: https://github.com/zaaack/vscode-markdown-editor +[19]: https://github.com/zaaack/vscode-markdown-editor/blob/master/LICENSE +[20]: https://opensource.com/sites/default/files/uploads/5_vscodium.png (VSCodium) diff --git a/translated/tech/20211013 5 markdown editors I recommend trying.md b/translated/tech/20211013 5 markdown editors I recommend trying.md deleted file mode 100644 index 69472684eb..0000000000 --- a/translated/tech/20211013 5 markdown editors I recommend trying.md +++ /dev/null @@ -1,84 +0,0 @@ -[#]: subject: "5 markdown editors I recommend trying" -[#]: via: "https://opensource.com/article/21/10/markdown-editors" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -我推荐尝试的 5 个 markdown 编辑器 -====== -每个人都有自己喜欢的 markdown 编辑器。这里有几个我已经试过的。 -![A pink typewriter][1] - -你可以用 markdown 做任何事情:格式化网站、编写书籍和撰写技术文档只是它的一些用途。我喜欢它创建富文本文档是如此简单。每个人都有自己喜欢的 markdown 编辑器。在我的 markdown 之旅中,我使用了好几个。下面是我考虑过的五个 markdown 编辑器。 - - 1. [Abricotine][2] 是一个在 [GPL v.3.0][3] 下发布的开源编辑器。你可以用手输入格式,或者使用菜单插入 [Github 风格的 Markdown][4]。Abricotine 允许你在输入时预览文本元素,如标题、图片、数学、嵌入式视频和待办事项。该编辑器仅限于将文件导出为 HTML。你可以在 Linux、macOS 和 Windows 上使用 Abricotine。 - -![Abricontine][5] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - 2. [MarkText][7] 是一个简单的 markdown 编辑器。它有很多功能,而且在处理以 markdown 为格式的文件方面做得很好。MarkText 也支持 Github 风格的 Markdown,它允许你添加表格和带有语法高亮的代码块。它支持实时预览,并且有一个简单的界面。MarkText 是在 [MIT][8] 下授权的。它支持 HTML 和 PDF 格式的输出。MarkText 可以在 Linux、macOS 和 Windows 上使用。 - -![MarkText][9] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - 3. [Ghostwriter][10] 是一个用于 Linux 和 Windows 的 markdown 编辑器。根据其网站用户的说法。“享受无干扰的写作体验,包括全屏模式和简洁的界面。有了 markdown,你可以现在写,以后再格式化”。它有内置的默认的浅色和深色主题,或者你可以自己编写。你可以将文件预览为实时 HTML,你可以直接复制和粘贴到博客中,或导出为其他格式。Ghostwriter 是在[GPL v.3.0][11] 下发布的。 - -![Ghostwriter][12] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - 4. [Atom][13] 被称为 21 世纪的可自定义文本编辑器。它也可以作为一个 markdown 编辑器使用。它可以在 Linux、Windows 和 macOS上运行,并以 [MIT][14]许可证发布。它支持 Github 风格的 Markdown,并且 **Ctrl**+**Shift**+**M** 可以打开一个预览面板,这样你就可以轻松地看到 HTML 预览。你可以通过创建一个文件并以 `.md` 文件扩展名保存来轻松入门。这告诉 Atom 它是一个 markdown 文件。Atom 会自动应用正确的包和语法高亮。 - -![Atom][15] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - 5. [VSCodium][16] 是微软的 VSCode 编辑器的免费开源版本,没有内置在微软产品中的遥测技术。它以 [MIT][17] 许可证发布,并提供了 VSCode 的所有功能,而没有专利特性。除了其他功能外,VSCodium 还可以作为一个 markdown 编辑器。创建一个新文件,点击 **Select a Language**,选择 _Markdown_,然后开始写你的代码。通过按 **Ctrl**-**Shift**+**V** 轻松预览文本,然后再切换回编辑器。你也可以通过添加一个扩展来轻松地扩展 markdown 编辑器。我最喜欢的是 [markdown editor][18],它是 [MIT][19] 许可证。 - -![VSCodium][20] - -(Seth Kenlon, [CC BY-SA 4.0][6]) - - - - -你最喜欢的 Markdown 编辑器是什么? 让我们在评论中知道。 - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/markdown-editors - -作者:[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/osdc-docdish-typewriter-pink.png?itok=OXJBtyYf (A pink typewriter) -[2]: https://abricotine.brrd.fr/ -[3]: https://github.com/brrd/abricotine/blob/develop/LICENSE -[4]: https://guides.github.com/features/mastering-markdown/ -[5]: https://opensource.com/sites/default/files/uploads/1_abricontine.png (Abricontine) -[6]: https://creativecommons.org/licenses/by-sa/4.0/ -[7]: https://marktext.app/ -[8]: https://github.com/marktext/marktext/blob/develop/LICENSE -[9]: https://opensource.com/sites/default/files/uploads/2_marktext.png (MarkText) -[10]: https://wereturtle.github.io/ghostwriter/ -[11]: https://github.com/wereturtle/ghostwriter/blob/master/COPYING -[12]: https://opensource.com/sites/default/files/uploads/3_ghostwriter.png (Ghostwriter) -[13]: https://atom.io/ -[14]: https://github.com/atom/atom/blob/master/LICENSE.md -[15]: https://opensource.com/sites/default/files/uploads/4_atom.png (Atom) -[16]: https://vscodium.com/ -[17]: https://github.com/VSCodium/vscodium/blob/master/LICENSE -[18]: https://github.com/zaaack/vscode-markdown-editor -[19]: https://github.com/zaaack/vscode-markdown-editor/blob/master/LICENSE -[20]: https://opensource.com/sites/default/files/uploads/5_vscodium.png (VSCodium) From 26ced96049605f034e56b9221e8f447200af6071 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 Oct 2021 10:20:14 +0800 Subject: [PATCH 0781/1588] APL --- .../20211019 Dash to Dock is Finally Available for GNOME 40.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md b/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md index a87279cce7..7bc9ca8e98 100644 --- a/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md +++ b/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/dash-to-dock-gnome-40/" [#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From a6621d9933930dbfe5677ebd478e733718b33f64 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 Oct 2021 11:01:20 +0800 Subject: [PATCH 0782/1588] TSL&PRF --- ... Dock is Finally Available for GNOME 40.md | 71 ------------------- ... Dock is Finally Available for GNOME 40.md | 69 ++++++++++++++++++ 2 files changed, 69 insertions(+), 71 deletions(-) delete mode 100644 sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md create mode 100644 translated/news/20211019 Dash to Dock is Finally Available for GNOME 40.md diff --git a/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md b/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md deleted file mode 100644 index 7bc9ca8e98..0000000000 --- a/sources/news/20211019 Dash to Dock is Finally Available for GNOME 40.md +++ /dev/null @@ -1,71 +0,0 @@ -[#]: subject: "Dash to Dock is Finally Available for GNOME 40" -[#]: via: "https://news.itsfoss.com/dash-to-dock-gnome-40/" -[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Dash to Dock is Finally Available for GNOME 40 -====== - -Dash to Dock is one of the most [useful GNOME extensions][1] for years now. With the introduction of [GNOME 40][2], many failed to make the extension work with it. - -Of course, being a popular option, the support for GNOME 40 was expected to be added soon enough. And, finally, it is here! - -If you did not know, GNOME 40 includes a horizontal workspace view, which affected the workflow for some, but Ubuntu did not move the dock even with GNOME 40. - -So, you can still use Dash to Dock to get a horizontal dock from the overview area. - -### Dash to Dock v70 Drops Support for Older GNOME Shells - -![][3] - -With Dash to Dock v70, you get the necessary support for GNOME 40 and accurately GNOME shell 3.34. - -However, the technical changes made to the extension to support GNOME 40 also meant that the new version could no longer work with older versions. - -If you are not running GNOME 40, you can still use the older v69, which should work well. And, except GNOME 40 support addition, there’s nothing different feature-wise. - -It will be interesting to see future releases for the extension from now on. Will they consider adding two different packages with new features for various Gnome shells? Let us wait for that. - -### Here’s How To Install Dash to Dock - -![][4] - -You can install the extension right from the [GNOME extension website][5] with a simple toggle. In case you are new to this, I recommend going through our [guide on installing GNOME extensions][6] to get started. - -[Dash to Dock GNOME Extension][5] - -It is worth noting that you need to use a compatible web browser to install the extension. While it should work with most browsers ([Chromium-based browsers][7] should work), Firefox’s snap-packaged browser in Ubuntu 21.10 may not work, as reported initially by [OMG!Ubuntu][8]. - -Have you tried the extension yet? Feel free to 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/dash-to-dock-gnome-40/ - -作者:[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/best-gnome-extensions/ -[2]: https://news.itsfoss.com/gnome-40-release/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjI1MCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://extensions.gnome.org/extension/307/dash-to-dock/ -[6]: https://itsfoss.com/gnome-shell-extensions/ -[7]: https://news.itsfoss.com/chrome-like-browsers-2021/ -[8]: https://www.omgubuntu.co.uk/2021/10/dash-to-dock-official-gnome-40-support? diff --git a/translated/news/20211019 Dash to Dock is Finally Available for GNOME 40.md b/translated/news/20211019 Dash to Dock is Finally Available for GNOME 40.md new file mode 100644 index 0000000000..162236afec --- /dev/null +++ b/translated/news/20211019 Dash to Dock is Finally Available for GNOME 40.md @@ -0,0 +1,69 @@ +[#]: subject: "Dash to Dock is Finally Available for GNOME 40" +[#]: via: "https://news.itsfoss.com/dash-to-dock-gnome-40/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +Dash to Dock 终于可以在 GNOME 40 上使用了 +====== + +> Dash to Dock v70 增加了对 GNOME 40 的支持,并放弃了对较旧版本的 GNOME Shell 的支持。但是,你可以继续使用旧版本。 + +![](https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/ubuntu-dock.png?w=1200&ssl=1) + +Dash to Dock 是多年来最 [有用的 GNOME 扩展][1] 之一。随着 [GNOME 40][2] 的引入,很多人都没能让这个扩展在它上面工作起来。 + +当然,作为一个流行的扩展,对 GNOME 40 的支持预计很快就会被加入。终于,它来了! + +如果你不知道,GNOME 40 包括一个水平工作区视图,这影响了一些人的工作流程,但 Ubuntu 即使在 GNOME 40 中也没有移动 Dock 的打算。 + +所以,你仍然可以使用 Dash to Dock 来从概览区得到一个水平的 Dock。 + +### Dash to Dock v70 放弃了对旧的 GNOME Shell 的支持 + +![][3] + +Dash to Dock v70,对 GNOME 40 和特定的 3.34 版的 GNOME Shell 提供了支持。 + +然而,为了支持 GNOME 40 而对扩展所做的技术修改也意味着新版本的扩展不能再与旧版本的 GNOME Shell 一起工作。 + +如果你没有运行 GNOME 40,你仍然可以使用旧的 v69,它应该可以很好地工作。而且,除了增加了对 GNOME 40 的支持,在功能上也没有什么不同。 + +该扩展的未来发展可能很有趣,他们是否会考虑为不同的 GNOME Shell 版本而增加不同的扩展软件包,并提供新的功能?让我们拭目以待。 + +### 安装 Dash to Dock 的方法 + +![][4] + +你可以从 [GNOME 扩展网站][5] 中通过简单的切换按钮来安装这个扩展。如果你是新手,我建议通过我们的 [GNOME 扩展安装指南][6] 来开始。 + +- [Dash to Dock GNOME 扩展][5] + +值得注意的是,你需要使用一个兼容的网页浏览器来安装这个扩展。虽然它应该可以在大多数浏览器上使用([基于 Chromium 的浏览器][7] 应该可以),但正如 [OMG! Ubuntu][8] 最初报道的那样,Ubuntu 21.10 中 Snap 打包的 Firefox 浏览器可能无法使用。 + +你试过这个扩展了吗?欢迎在下面的评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/dash-to-dock-gnome-40/ + +作者:[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://itsfoss.com/best-gnome-extensions/ +[2]: https://news.itsfoss.com/gnome-40-release/ +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/dash-to-dock.jpeg?w=1366&ssl=1 +[4]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/gnome-dash-dock-extension.png?w=1259&ssl=1 +[5]: https://extensions.gnome.org/extension/307/dash-to-dock/ +[6]: https://itsfoss.com/gnome-shell-extensions/ +[7]: https://news.itsfoss.com/chrome-like-browsers-2021/ +[8]: https://www.omgubuntu.co.uk/2021/10/dash-to-dock-official-gnome-40-support? From 60c03a925d4d67ade8e0f6dba4c9fd653aa11a8f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 21 Oct 2021 11:06:33 +0800 Subject: [PATCH 0783/1588] PUB @wxy https://linux.cn/article-13905-1.html --- ...20211019 Dash to Dock is Finally Available for GNOME 40.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20211019 Dash to Dock is Finally Available for GNOME 40.md (97%) diff --git a/translated/news/20211019 Dash to Dock is Finally Available for GNOME 40.md b/published/20211019 Dash to Dock is Finally Available for GNOME 40.md similarity index 97% rename from translated/news/20211019 Dash to Dock is Finally Available for GNOME 40.md rename to published/20211019 Dash to Dock is Finally Available for GNOME 40.md index 162236afec..a4a68bb887 100644 --- a/translated/news/20211019 Dash to Dock is Finally Available for GNOME 40.md +++ b/published/20211019 Dash to Dock is Finally Available for GNOME 40.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13905-1.html" Dash to Dock 终于可以在 GNOME 40 上使用了 ====== From d1bcfe301066e2579eaf7daff6b63908a9ed1a5b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 22 Oct 2021 05:02:38 +0800 Subject: [PATCH 0784/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211022?= =?UTF-8?q?=20How=20to=20Install=20Visual=20Studio=20Code=20Extensions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211022 How to Install Visual Studio Code Extensions.md --- ...o Install Visual Studio Code Extensions.md | 142 ++++++++++++++++++ 1 file changed, 142 insertions(+) create mode 100644 sources/tech/20211022 How to Install Visual Studio Code Extensions.md diff --git a/sources/tech/20211022 How to Install Visual Studio Code Extensions.md b/sources/tech/20211022 How to Install Visual Studio Code Extensions.md new file mode 100644 index 0000000000..3eebef5da2 --- /dev/null +++ b/sources/tech/20211022 How to Install Visual Studio Code Extensions.md @@ -0,0 +1,142 @@ +[#]: subject: "How to Install Visual Studio Code Extensions" +[#]: via: "https://itsfoss.com/install-vs-code-extensions/" +[#]: author: "Pratham Patel https://itsfoss.com/author/pratham/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install Visual Studio Code Extensions +====== + +_**Brief: Learn how to search for extensions and install them in Visual Studio Code editor. Both GUI and command line methods have been discussed.**_ + +Microsoft’s [Visual Studio Code][1] is perhaps the most popular [open source code editor][2], after Vim (of course). + +Visual Studio Code provides an amazing “out of the box” experience by providing almost all of the IDE like features. But there are always things you wish Visual Studio Code could do. _“The grass is always greener on the other side.”_ + +The [Visual Studio Code Marketplace][3] is exactly where you will find the extensions for Visual Studio Code. Extensions that are published on the Visual Studio Code Marketplace are scanned for viruses before they are published. So these extensions can be [trusted][4]. + +### Installing extensions in Visual Studio Code + +You don’t need to go to the Marketplace website for installing extensions. You can install and manage extensions right from the editor itself. + +I hope you have [Visual Studio Code installed on Linux][5] or whichever operating system you are using. + +Open Visual Studio Code, and to the left most side, is the Activity Bar. The last button on the Activity Bar is the Extensions button. Clicking on that will expose you to the enormous wealth of the extensions available for installation on Visual Studio Code. + +![Accessing the Extensions tab in VS Code][6] + +_**You can also press the Shortcut Key combination `Ctrl + Shift + X` to launch the Extensions side pane.**_ + +If you do not have any extensions installed, you will see a list of the most popular extensions available on the Visual Studio Code Marketplace. There are extensions you wish Visual Studio Code already had. And then, some day you will discover an extension and wonder how you lived without it! + +#### Find an extension and install it from the editor (GUI method) + +Now is the time to try out that `vim` thing Linux people talk about *nudge nudge* ;) + +Just kidding. Let us install something more beginner friendly and something that a beginner can easily take advantage of, without much practice. + +Click on **Visual Studio IntelliCode** (#1) extension from the list presented of the most popular extensions. + +![How to install an extension like Visual Studio IntelliCode][7] + +Simply clicking on the **Install** button (#2) will install the **Visual Studio IntelliCode** extension. This extension gives you AI-predicted suggestions while you are writing code. + +Once installed, you will be able to take full advantage of this extension. Try typing a block of code in your preferred programming language and check if the suggested AI autocomplete is working out for you, and not causing any kind of slowdown in your workflow. + +![Managing an installed extension in Visual Studio Code][8] + +If you dislike any of the installed extension, you can simply click on the **Uninstall** button (#2) to completely remove the unwanted extension. + +If you have multiple extensions installed, and if you feel like one of the installed extensions is causing you problems – say like sudden crashes; You can simply disable one (or multiple) extension(s) simply by clicking on the **Disable** button (#1) and check if extension _x_ was acting up or was it extension _y_, or was it something different altogether. + +Considering that extension removal and re-installation takes a long time, disabling extensions can be handy when you have multiple extensions installed. + +#### Alternate method: Install extensions using the terminal + +Did you know you could install a Visual Studio Code extension from the terminal itself? Well, now you do! + +To install an extension from your terminal, you need to know the extension name and publisher name in the order of `publisher.extension`. For an example, if you want to install the same extension as you did before, Visual Studio IntelliCode, it’s publisher name and extension name is `VisualStudioExptTeam.vscodeintellicode`. + +To find out this unique identifier of any extension, firstly, [visit the Visual Studio Code Marketplace][9] in your browser of choice. + +![A screenshot of what Visual Studio Code Marketplace looks like][10] + +Then search for any extension, for this tutorial, I will focus on installing Visual Studio IntelliCode. And then open the page of the extension that you want to install. + +![Search for Visual Studio IntelliCode and open the extension webpage][11] + +Once you have the web page of your extension open, you will see a code block. In the screenshot of the extension web page below is the highlighted unique identifier of the extension. + +![Unique identifier of the extension Visual Studio Code][12] + +Once you have the unique code of the extension you desire to install – **VisualStudioExptTeam.vscodeintellicode** in this case, you can proceed by running the following command in your terminal. + +``` +code --install-extension VisualStudioExptTeam.vscodeintellicode +``` + +Like the GUI, the command line interface also allows you to install, disable, remove and manage extensions. + +There is a handy flag that will give you a list of all the extensions you have installed. You can do that by running the following command: + +``` +code --list-extensions +``` + +To disable a single extension, run this command: + +``` +code --disable-extension +``` + +If you want to disable all extensions, you can run the following command: + +``` +code --disable-extensions +``` + +The above command will disable **all** installed extensions. This will help you diagnose if extensions are causing problems or is it Visual Studio Code itself. + +Now, if you want to completely remove any extension, use this command: + +``` +code --uninstall-extension +``` + +### Conclusion + +I find it much easier to use the editor for installing VS Code extensions. It’s straight in the editor where I code after all. + +Once you are comfortable tinkering with Visual Studio Code, maybe checkout this article pointing out some [useful keyboard shortcuts for Visual Studio Code][13] that might help you get even more productive! + +Happy coding, fellow *nix user! :) + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-vs-code-extensions/ + +作者:[Pratham 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://itsfoss.com/author/pratham/ +[b]: https://github.com/lujun9972 +[1]: https://code.visualstudio.com/ +[2]: https://itsfoss.com/best-modern-open-source-code-editors-for-linux/ +[3]: https://marketplace.visualstudio.com/VSCode +[4]: https://code.visualstudio.com/docs/editor/extension-marketplace#_can-i-trust-extensions-from-the-marketplace +[5]: https://itsfoss.com/install-visual-studio-code-ubuntu/ +[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/01-all-extensions-1.webp?resize=800%2C450&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/02-select-intellicode-1.webp?resize=800%2C450&ssl=1 +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/03-intellicode-installation-done-1.webp?resize=800%2C450&ssl=1 +[9]: https://marketplace.visualstudio.com/ +[10]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/visual_studio_code_marketplace.webp?resize=800%2C450&ssl=1 +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/visual_stuido_code_ext_search.webp?resize=800%2C450&ssl=1 +[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/vs_code_extension_identifier.webp?resize=800%2C450&ssl=1 +[13]: https://itsfoss.com/vs-code-shortcuts/ From 9e2641520eadd864e49591e2f760256b37471601 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 22 Oct 2021 05:03:10 +0800 Subject: [PATCH 0785/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211021?= =?UTF-8?q?=207=20handy=20tricks=20for=20using=20the=20Linux=20wget=20comm?= =?UTF-8?q?and?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211021 7 handy tricks for using the Linux wget command.md --- ...tricks for using the Linux wget command.md | 194 ++++++++++++++++++ 1 file changed, 194 insertions(+) create mode 100644 sources/tech/20211021 7 handy tricks for using the Linux wget command.md diff --git a/sources/tech/20211021 7 handy tricks for using the Linux wget command.md b/sources/tech/20211021 7 handy tricks for using the Linux wget command.md new file mode 100644 index 0000000000..7ae4828e3c --- /dev/null +++ b/sources/tech/20211021 7 handy tricks for using the Linux wget command.md @@ -0,0 +1,194 @@ +[#]: subject: "7 handy tricks for using the Linux wget command" +[#]: via: "https://opensource.com/article/21/10/linux-wget-command" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +7 handy tricks for using the Linux wget command +====== +Download files from the internet in your Linux terminal. Get the most +out of the wget command with our new cheat sheet. +![Computer screen with files or windows open][1] + +Wget is a free utility to download files from the web. It gets data from the Internet and saves it to a file or displays it in your terminal. This is literally also what web browsers do, such as Firefox or Chromium, except by default, they _render_ the information in a graphical window and usually require a user to be actively controlling them. The `wget` utility is designed to be non-interactive, meaning you can script or schedule `wget` to download files whether you're at your computer or not. + +### Download a file with wget + +You can download a file with `wget` by providing a link to a specific URL. If you provide a URL that defaults to `index.html`, then the index page gets downloaded. By default, the file is downloaded into a file of the same name in your current working directory. + + +``` +$ wget +\--2021-09-20 17:23:47-- +Resolving example.com... 93.184.216.34, 2606:2800:220:1:248:1893:25c8:1946 +Connecting to example.com|93.184.216.34|:80... connected. +HTTP request sent, awaiting response... 200 OK +Length: 1256 (1.2K) [text/html] +Saving to: 'index.html' +``` + +You can make `wget` send the data to standard out (`stdout`) instead by using the `--output-document` with a dash `-` character: + + +``` +$ wget \--output-document - | head -n4 +<!doctype html> +<html> +<head> +   <title>Example Domain</title> +``` + +You can use the `--output-document` option (`-O` for short) to name your download whatever you want: + + +``` +`$ wget http://example.com --output-document foo.html` +``` + +### Continue a partial download + +If you're downloading a very large file, you might find that you have to interrupt the download. With the `--continue` (`-c` for short), `wget` can determine where the download left off and continue the file transfer. That means the next time you download a 4 GB Linux distribution ISO you don't ever have to go back to the start when something goes wrong. + + +``` +`$ wget --continue https://example.com/linux-distro.iso` +``` + +### Download a sequence of files + +If it's not one big file but several files that you need to download, `wget` can help you with that. Assuming you know the location and filename pattern of the files you want to download, you can use Bash syntax to specify the start and end points between a range of integers to represent a sequence of filenames: + + +``` +`$ wget http://example.com/file_{1..4}.webp` +``` + +### Mirror a whole site + +You can download an entire site, including its directory structure, using the `--mirror` option. This option is the same as running `--recursive --level inf --timestamping --no-remove-listing`, which means it's infinitely recursive, so you're getting everything on the domain you specify. Depending on how old the website is, that could mean you're getting a lot more content than you realize. + +If you're using `wget` to archive a site, then the options `--no-cookies --page-requisites --convert-links` are also useful to ensure that every page is fresh, complete, and that the site copy is more or less self-contained. + +### Modify HTML headers + +Protocols used for data exchange have a lot of metadata embedded in the packets computers send to communicate. HTTP headers are components of the initial portion of data. When you browse a website, your browser sends HTTP request headers. Use the `--debug` option to see what header information `wget` sends with each request: + + +``` +$ wget --debug example.com +\---request begin--- +GET / HTTP/1.1 +User-Agent: Wget/1.19.5 (linux-gnu) +Accept: */* +Accept-Encoding: identity +Host: example.com +Connection: Keep-Alive + +\---request end--- +``` + +You can modify your request header with the `--header` option. For instance, it's sometimes useful to mimic a specific browser, either for testing or to account for poorly coded sites that only work correctly for specific user agents. + +To identify as Microsoft Edge running on Windows: + + +``` +`$ wget --debug --header="User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36 Edg/91.0.864.59" http://example.com` +``` + +You can also masquerade as a specific mobile device: + + +``` +$ wget --debug \ +\--header="User-Agent: Mozilla/5.0 (iPhone; CPU iPhone OS 13_5_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.1.1 Mobile/15E148 Safari/604.1" \ + +``` + +### Viewing response headers + +In the same way header information is sent with browser requests, header information is also included in responses. You can see response headers with the `--debug` option: + + +``` +$ wget --debug example.com +[...] +\---response begin--- +HTTP/1.1 200 OK +Accept-Ranges: bytes +Age: 188102 +Cache-Control: max-age=604800 +Content-Type: text/html; charset=UTF-8 +Etag: "3147526947" +Server: ECS (sab/574F) +Vary: Accept-Encoding +X-Cache: HIT +Content-Length: 1256 + +\---response end--- +200 OK +Registered socket 3 for persistent reuse. +URI content encoding = 'UTF-8' +Length: 1256 (1.2K) [text/html] +Saving to: 'index.html' +``` + +### Responding to a 301 response + +A 200 response code means that everything has worked as expected. A 301 response, on the other hand, means that an URL has been moved permanently to a different location. It's a common way for a website admin to relocate content while leaving a "trail" so people visiting the old location can still find it. By default, `wget` follows redirects, and that's probably what you normally want it to do. + +However, you can control what `wget` does when it encounters a 301 response with the `--max-redirect` option. You can set it to `0` to follow no redirects: + + +``` +$ wget --max-redirect 0 +\--2021-09-21 11:01:35-- +Resolving iana.org... 192.0.43.8, 2001:500:88:200::8 +Connecting to iana.org|192.0.43.8|:80... connected. +HTTP request sent, awaiting response... 301 Moved Permanently +Location: [following] +0 redirections exceeded. +``` + +Alternately, you can set it to some other number to control how many redirects `wget` follows. + +#### Expand a shortened URL + +The `--max-redirect` option is useful for looking at shortened URLs before actually visiting them. Shortened URLs can be useful for print media, in which users can't just copy and paste a long URL, or on social networks with character limits (this isn't as much of an issue on a modern and [open source social network like Mastodon][2]). However, they can also be a little dangerous because their destination is, by nature, concealed. By combining the `--head` option to view just the HTTP headers, and the `--location` option to unravel the final destination of an URL, you can peek into a shortened URL without loading the full resource: + + +``` +$ wget --max-redirect 0 "" +\--2021-09-21 11:32:04-- +Resolving bit.ly... 67.199.248.10, 67.199.248.11 +Connecting to bit.ly|67.199.248.10|:443... connected. +HTTP request sent, awaiting response... 301 Moved Permanently +Location: [following] +0 redirections exceeded. +``` + +The penultimate line of output, starting with **Location**, reveals the intended destination. + +### Use wget + +Once you practice thinking about the process of exploring the web as a single command, `wget` becomes a fast and efficient way to pull information you need from the Internet without bothering with a graphical interface. To help you build it into your usual workflow, we've created a cheat sheet with common `wget` uses and syntax, including an overview of using it to query an API. [**Download the Linux `wget` cheat sheet here.**][3] + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/linux-wget-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/browser_screen_windows_files.png?itok=kLTeQUbY (Computer screen with files or windows open) +[2]: https://opensource.com/article/17/4/guide-to-mastodon +[3]: https://opensource.com/downloads/linux-wget-cheat-sheet From 748af1b1f8e80cf88dad9e654bb9b93700ead508 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 22 Oct 2021 05:03:56 +0800 Subject: [PATCH 0786/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211021?= =?UTF-8?q?=20How=20to=20get=20useful=20answers=20to=20your=20questions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211021 How to get useful answers to your questions.md --- ...to get useful answers to your questions.md | 183 ++++++++++++++++++ 1 file changed, 183 insertions(+) create mode 100644 sources/tech/20211021 How to get useful answers to your questions.md diff --git a/sources/tech/20211021 How to get useful answers to your questions.md b/sources/tech/20211021 How to get useful answers to your questions.md new file mode 100644 index 0000000000..cae22969ff --- /dev/null +++ b/sources/tech/20211021 How to get useful answers to your questions.md @@ -0,0 +1,183 @@ +[#]: subject: "How to get useful answers to your questions" +[#]: via: "https://jvns.ca/blog/2021/10/21/how-to-get-useful-answers-to-your-questions/" +[#]: author: "Julia Evans https://jvns.ca/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to get useful answers to your questions +====== + +5 years ago I wrote a post called [how to ask good questions][1]. I still really like that post, but it’s missing a few of the tactics I use to get useful answers like “interrupt people when they’re going off on an irrelevant tangent”. + +### what can go wrong when asking questions + +Often when I ask a vague or underspecified question, what happens is one of: + + 1. the person starts by explaining a bunch of stuff I already know + 2. the person explains some things which I don’t know, but which I don’t think are relevant to my problem + 3. the person starts giving a relevant explanation, but using terminology that I don’t understand, so I still end up being confused + + + +None of these give me the answer to my question and this can be quite frustrating (it often feels condescending when someone embarks on a lengthy explanation of things I already know, even if they had no way of knowing that I already know those things), so let’s talk about I try to avoid situations like this and get the answers I need. + +Before we talk about interrupting, I want to talk about my 2 favourite question-asking tactics again – asking yes/no questions and stating your understanding. + +### ask yes/no questions + +My favourite tactic is to ask a yes/no question. What I love about this is that there’s a much lower chance that the person answering will go off on an irrelevant tangent – they’ll almost always say something useful to me. + +I find that it’s often possible to come up with yes/no questions even when discussing a complicated topic. For example, here are a bunch of yes/no questions I asked a friend when trying to learn a little bit about databases from them: + + * how often do you expect db failovers to happen? like every week? + * do you need to scale up by hand? + * are fb/dropbox both using mysql? + * does fb have some kind of custom proprietary mysql management software? + * is this because mysql and postgres were designed at a time when people didn’t think failover was something you’d have to do that frequently? + * i still don’t really understand that blog post about replsets, like is he saying that mongodb replication is easier to set up than mysql replication? + * is orchestrator a proxy? + * is the goal of the replicas you’re talking about to be read replicas for performance? + * do you route queries to a shard based on the id you’re searching for? + * is the point that with compression it takes extra time to read but it doesn’t matter because you almost never read? + + + +The answers to yes/no questions usually aren’t just “yes” or “no” – for all of those questions my friend elaborated on the answer, and the elaborations were always useful to me. + +You’ll notice that some of those questions are “check my understanding” questions – like “do you route queries to a shard based on the id you’re searching for?” was my previous understanding of how database sharding worked, and I wanted to check if it was correct or not. + +I also find that yes/no questions get me answers faster because they’re relatively easy to answer quickly. + +### state your current understanding + +My second favourite tactic is to state my understanding of how the system works. + +Here’s an example from the “asking good questions” post of a “state your understanding” [email I sent to the rkt-dev mailing list][2]: + +> I’ve been trying to understand why the tree store / image store are designed the way they are in rkt. +> +> My current understanding of how _Docker_’s image storage on disk works right now (from ) is: +> +> * every layer gets one directory, which is basically that layer’s filesystem +> * at runtime, they all get stacked (via whatever CoW filesystem you’re using) +> * every time you do IO, you go through the stack of directories (or however these overlay drivers work) +> + +> +> my current understanding of rkt’s image storage on disk is: (from the “image lifecycle” section here: ) +> +> * every layer gets an image in the image store +> * when you run an ACI file, all the images that that ACI depends on get unpacked and copied into a single directory (in the tree store) +> + +> +> guess at why rkt decided to architect its storage differently from Docker: +> +> 1. having very deep overlay filesystems can be expensive +> 2. so if you have a lot of layers, copying them all into a directory (the “tree store”) results in better performance +> + +> +> So rkt is trading more space used on disk (every image in the image store gets copied at least once) for better runtime performance (there are no deep chains of overlays) +> +> Is this right? Have I misunderstood what rkt does (or what Docker does?) Are there other reasons for the difference? + +This: + + * states my goal (understand rkt’s design choices) + * states my understanding of how rkt and docker work + * makes some guesses at the goal so that people can confirm/deny + + + +This question got a [great reply][3], which among other things pointed out something that I’d totally missed – that the ACI format is a DAG instead of a linked list, which I think means that you could install Debian packages in any order and not have to rebuild everything if you remove an `apt-get install` in the middle of your Dockerfile. + +I also find the process of writing down my understanding is really helpful by itself just to clarify my own thoughts – sometimes by the time I’m done I’ve answered my own question :) + +Stating your understanding is a kind of yes/no question – “this is my understanding of how X works, is that right or wrong?”. Often the answer is going to be “right in some ways and wrong in others”, but even so it makes the job of the answerer a lot easier. + +Okay! Now let’s talk about interrupting a little bit. + +### be willing to interrupt + +If someone goes off on a very long explanation that isn’t helping me at all, I think it’s important to interrupt them. This can feel rude, but ultimately it’s more efficient for everyone – it’s a waste of both their time and my time to continue. + +Usually I’ll interrupt by asking a more specific question, because usually if someone has gone off on a long irrelevant explanation it’s because I asked an overly vague question to start with. + +### don’t accept responses that don’t answer your question + +If someone finishes a statement that doesn’t answer you question, it’s important not to leave it there! Keep asking questions! + +a couple of ways you can do this: + + 1. ask a much more specific question (like a yes/no question) that’s in the direction of what you actually wanted to know + 2. ask them to clarify some terminology you didn’t understand (what’s an X?) + + + +### take a minute to think + +Sometimes when asking someone a question, they’ll tell me new information that’s really surprising. For example, I recently learned that Javascript async/await isn’t implemented with coroutines (I thought it was because AFAIK Python async/await is implemented with coroutines). + +I was pretty surprised by this, and I really needed to stop and think about what the implications of that were and what other questions I had about how Javascript works based on that new piece of information. + +If this happens in a real-time conversation sometimes I’ll literally say something like “wait, that’s surprising to me, let me think for a minute” and try to incorporate the new data and come up with another question. + +### it takes a little bit of confidence + +All of these things – being willing to interrupt, not accepting responses that don’t answer your questions, and asking for a minute to think – require a little bit of confidence! + +In the past when I’ve struggled with confidence, I’ve sometimes thought “oh, this explanation is probably really good, I’m just not smart enough to understand it”, and kind of accepted it. And even today I sometimes find it hard to keep asking questions when someone says a lot of words I don’t understand. + +It helps me to remember that: + + 1. people usually want to help (even if their first explanation was full of confusing jargon) + 2. if I can get even 1 useful piece of information by the end of the conversation, it’s a victory (like the answer to a yes/no question that I previously didn’t know the answer to) + + + +One of the reasons I dislike a lot of “how to ask questions” advice out there is that it actually tries to _undermine_ the reader’s confidence – the assumption is that the people answering the questions are Super Smart Perfect People and you’re probably wasting their time with your dumb questions. But in reality (at least when at work) your coworkers answering the questions are probably smart well-meaning people who want to help but aren’t always able to answer questions very clearly, so you need to ask follow up questions to get answers. + +### how to give useful answers + +There’s also a lot you can do to try not to be the person who goes off on a long explanation that doesn’t help the person you’re talking to at all. + +I wrote about this already in [how to answer question in a helpful way][4], but the main thing I do is pause periodically and check in. I’ll often say something like “does that make sense?“. (though this doesn’t always work, sometimes people will say “yes” even if they’re confused) + +It’s especially important to check in if: + + 1. You haven’t explained a concept before (because your initial explanation will probably not be very good) + 2. You don’t know the person you’re talking to very well (because you’ll probably make incorrect assumptions about what they know / don’t know) + + + +### being good at extracting information is a superpower + +Some developers know a lot but aren’t very good at explaining what they know. I’m not trying to make a value judgement about that here (different people have different strengths! explaining things is extremely hard to do well!). + +I’ve found that instead of being mad that some people aren’t great at explaining things, it’s more effective for me to get better at asking questions that will get me the answers I need. + +This really expands the set of people I can learn from – instead of finding someone who can easily give a clear explanation, I just need to find _someone_ who has the information I want and then ask them specific questions until I’ve learned what I want to know. And I’ve found that most people really do want to be helpful, so they’re very happy to answer questions. + +And if you get good at asking questions, you can often find a set of questions that will get you the answers you want pretty quickly, so it’s a good use of everyone’s time! + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2021/10/21/how-to-get-useful-answers-to-your-questions/ + +作者:[Julia 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://jvns.ca/ +[b]: https://github.com/lujun9972 +[1]: https://jvns.ca/blog/good-questions/ +[2]: https://groups.google.com/g/rkt-dev/c/bhGeR3pUfPY +[3]: https://groups.google.com/g/rkt-dev/c/bhGeR3pUfPY/m/PYEKLIr9AwAJ +[4]: https://jvns.ca/blog/answer-questions-well/ From 2a1401b57cd49c2d10190f1d86bf49cfd35b7e7b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 22 Oct 2021 05:04:07 +0800 Subject: [PATCH 0787/1588] add done: 20211021 How to get useful answers to your questions.md --- ... to know about Kubernetes NetworkPolicy.md | 86 +++++++++++++++++++ 1 file changed, 86 insertions(+) create mode 100644 sources/tech/20211021 What you need to know about Kubernetes NetworkPolicy.md diff --git a/sources/tech/20211021 What you need to know about Kubernetes NetworkPolicy.md b/sources/tech/20211021 What you need to know about Kubernetes NetworkPolicy.md new file mode 100644 index 0000000000..552f8eea99 --- /dev/null +++ b/sources/tech/20211021 What you need to know about Kubernetes NetworkPolicy.md @@ -0,0 +1,86 @@ +[#]: subject: "What you need to know about Kubernetes NetworkPolicy" +[#]: via: "https://opensource.com/article/21/10/kubernetes-networkpolicy" +[#]: author: "Mike Calizo https://opensource.com/users/mcalizo" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +What you need to know about Kubernetes NetworkPolicy +====== +Understanding Kubernetes NetworkPolicy is one of the fundamental +requirements to learn before deploying an application to Kubernetes. +![Parts, modules, containers for software][1] + +With a growing number of cloud-native applications going to production through Kubernetes adoption, security is an important checkpoint that you must consider early in the process. When designing a cloud-native application, it is very important to embed a security strategy up front. Failure to do so leads to lingering security issues that can cause project delays and ultimately cost you unnecessary stress and money. + +For years, people left security at the end—until their deployment was about to go into production. That practice causes delays on deliverables because each organization has security standards to adhere to, which are either bypassed or not followed with a lot of accepted risks to make the deliverables. + +Understanding Kubernetes NetworkPolicy can be daunting for people just starting to learn the ins and outs of Kubernetes implementation. But this is one of the fundamental requirements that you must learn before deploying an application to your Kubernetes cluster. When learning Kubernetes and cloud-native application patterns, make your slogan "Don't leave security behind!" + +## The NetworkPolicy concept + +[NetworkPolicy][2] replaces firewall appliances in the data center context that you know—as pods to compute instances, network plugins to router and switches, and volumes to storage area network (SAN). + +By default, the Kubernetes NetworkPolicy allows [pods][3] to receive traffic from anywhere. If you are not concerned about security for your pods, then that might be OK. But if you are running a critical workload, then you need to secure your pods. The way to control the traffic flow within the cluster (including ingress and egress traffic) is through NetworkPolicies. + +To enable NetworkPolicy, you need a [network plugin][4] that supports NetworkPolicy. Otherwise, any rules you applied become useless. + +There a different network plugins [listed on Kubernetes.io][4]: + + * CNI plugins: adhere to the [Container Network Interface][5] (CNI) specification, designed for interoperability. + * Kubernetes follows the [v0.4.0][6] release of the CNI specification. + * Kubernetes plugin: implements basic `cbr0` using the `bridge` and `host-local` CNI plugins. + + + +## Applying a network policy + +To apply a network policy, you need a working Kubernetes cluster with a network plugin that supports NetworkPolicy. + +But first, you need to understand how to use NetworkPolicy in the context of Kubernetes. The Kubernetes NetworkPolicy allows [pods][3] to receive traffic from anywhere. This is not ideal. To secure the pods, you must understand the endpoints pods can communicate within the Kubernetes construct. + + 1. Pod-to-pod communication using `podSelector`. [code] - namespaceSelector: +    matchLabels: +      project: myproject +``` + 2. Namespace-to-namespace communication and namespace-to-pod communication using `namespaceSelector` and/or a combination of `podSelector` and `namespaceSelector`. [code] - namespaceSelector: +    matchLabels: +      project: myproject +\- podSelector: +    matchLabels: +      role: frontend +``` + 3. IP blocks communication for pods using `ipBlock` to define which `IP CIDR` blocks dictate the source and destination. [code] - ipBlock: +        cidr: 172.17.0.0/16 +        except: +        - 172.17.1.0/24 +``` +Note the difference between pod, namespace, and IP-based policy. For pod and namespace-based NetworkPolicy, you use `selector` to control traffic, while for IP-based NetworkPolicy, controls get defined using `IP blocks` (CIDR ranges). + +Putting it together, a NetworkPolicy should look like the following: +``` + + +apiVersion: networking.k8s.io/v1 +kind: NetworkPolicy +metadata: +  name: test-network-policy +  namespace: default +spec: +  podSelector: +    matchLabels: +      app: backend +  policyTypes: +  - Ingress +  - Egress +  ingress: +  - from: +    - ipBlock: +        cidr: 172.17.0.0/16 +        except: +        - 192.168.1.0/24 +    - namespaceSelector: +        matchLabels: +          projec \ No newline at end of file From 45ad2a58792e708461f2b94a38e2958d0c822824 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 22 Oct 2021 05:04:34 +0800 Subject: [PATCH 0788/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211021?= =?UTF-8?q?=20Here=E2=80=99s=20Why=20Raspberry=20Pi=20is=20Increasing=20it?= =?UTF-8?q?s=20Price?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211021 Here-s Why Raspberry Pi is Increasing its Price.md --- ...hy Raspberry Pi is Increasing its Price.md | 82 +++++++++++++++++++ 1 file changed, 82 insertions(+) create mode 100644 sources/news/20211021 Here-s Why Raspberry Pi is Increasing its Price.md diff --git a/sources/news/20211021 Here-s Why Raspberry Pi is Increasing its Price.md b/sources/news/20211021 Here-s Why Raspberry Pi is Increasing its Price.md new file mode 100644 index 0000000000..dcfef4633c --- /dev/null +++ b/sources/news/20211021 Here-s Why Raspberry Pi is Increasing its Price.md @@ -0,0 +1,82 @@ +[#]: subject: "Here’s Why Raspberry Pi is Increasing its Price" +[#]: via: "https://news.itsfoss.com/raspberry-pi-price-hike/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Here’s Why Raspberry Pi is Increasing its Price +====== + +It may not be a good time for best pricing when it comes to motherboards, CPUs, and GPUs. However, Raspberry Pi boards continued to sail through most of 2020-2021 without an increase in its price. + +But, recently, Raspberry Pi announced its first-ever price hike ever, so why is that happening? + +### Supply Chain Issues: What is it Exactly? + +The entire semiconductor industry is suffering from an incredibly high demand and short supply situation. + +Amidst the COVID-19 pandemic, the requirements for electronic components, gadgets, and computers have shot up. + +Of course, the GPU (graphics card) shortage is the worst of them. But, overall, if a product uses a chip, it is tough to readily manufacture as of now. + +Every major company has been investing to ramp up the work in a foundry to get more chips out. However, considering an unprecedented demand globally, it will take at least a few years to fulfill the current orders and move on. + +Raspberry Pi managed to survive 2020 and most of 2021 without significant issues in manufacturing boards as per the demands. + +While Raspberry Pi 4 launch price and its availability were not initially affected by a large margin, it could not escape the supply chain issues forever. + +Hence, Raspberry Pi predicts that they cannot meet the rise in demands as they would expect compared to their capacity of manufacturing. And, this is why they are increasing the pricing for some of their products. + +### Raspberry Pi Price Hike: What Changes? + +The affected products include the Raspberry Pi Zero and the 2 GB variant of the Raspberry Pi 4. + +While they intended to manufacture more this year, they will make about seven million units in 2021 due to supply chain issues. + +The Raspberry Pi 4 2GB variant was priced at $35 replacing the 1 GB option. However, it is now priced back at **$45**, temporarily. + +And, the 1 GB Raspberry Pi 4 option is making a comeback at **$35**. This way, you get more options, but the one with more memory gets expensive. + +For now, they will focus on Compute Module 3, Compute Module 3+, and Raspberry Pi 3B. + +So, it is worth noting that if you are looking for a Raspberry Pi 3B+, you might want to consider Raspberry Pi 4. In other words, the older Raspberry Pi models like 3B+ and Zero may not have a good availability throughout this year (and the next). + +### Is It a Permanent Price Change? + +Considering Raspberry Pi managed to maintain the pricing even with the global chip shortage, we can be confident that they can bring the old price back soon. + +Here’s what they mention in their [official announcement][1]: + +> These changes in pricing are not here to stay. As global supply chain issues moderate, we’ll keep revisiting this issue, and we want to get pricing back to where it was as fast as we can. + +In addition to the unfortunate price hike, they also say that they currently predict a sound capacity of supply to be able to support existing Raspberry Pi 4 customers along with users migrating from Raspberry Pi 3B+ as well: + +> The good news is that we’ve been able to hold the line on pricing for all but one of our products; that we expect to have enough 28nm silicon over the next twelve months to support both our existing Raspberry Pi 4 and Compute Module 4 customers, and customers migrating from Raspberry Pi 3B+; and that we see early signs that the supply chain situation is starting to ease. + +Given that they are essentially going back to their old pricing, I think that the business users and tinkerers do not have a lot to worry about. + +_What do you think about its price hike? Feel free to enter the comments section below to share your thoughts._ + +#### 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/raspberry-pi-price-hike/ + +作者:[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://www.raspberrypi.com/news/supply-chain-shortages-and-our-first-ever-price-increase/ From c634c48518f6e22362d5bc1f9d375c28e368c2c3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Fri, 22 Oct 2021 05:04:57 +0800 Subject: [PATCH 0789/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211021?= =?UTF-8?q?=20FreeOffice=202021=20is=20Here=20for=20Linux=20With=20Enhance?= =?UTF-8?q?d=20Compatibility=20and=20New=20Features=20to=20Rival=20Microso?= =?UTF-8?q?ft=20Office?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211021 FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office.md --- ... New Features to Rival Microsoft Office.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 sources/news/20211021 FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office.md diff --git a/sources/news/20211021 FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office.md b/sources/news/20211021 FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office.md new file mode 100644 index 0000000000..b4df877cbb --- /dev/null +++ b/sources/news/20211021 FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office.md @@ -0,0 +1,84 @@ +[#]: subject: "FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office" +[#]: via: "https://news.itsfoss.com/freeoffice-2021-release/" +[#]: author: "Rishabh Moharir https://news.itsfoss.com/author/rishabh/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +FreeOffice 2021 is Here for Linux With Enhanced Compatibility and New Features to Rival Microsoft Office +====== + +The German-based software developer has just announced the latest upgrade to its popular FreeOffice series. FreeOffice 21, as a free alternative to Microsoft Office. + +It is a complete software suite aimed at productivity. It contains three apps – TextMaker 21, PlanMaker 21, and Presentations 21 – that serve as alternatives to Word, Excel, and PowerPoint. The UI is very similar to MS Office’s ribbon layout, although you can choose the classic layout instead. + +FreeOffice 21 is based on the commercial suite SoftMaker Office 21, which is also available for Linux. Even though it lacks certain features compared to SoftMaker Office, FreeOffice is reasonably sufficient for home or office use. + +This makes it one of the best office suites and [other open-source Microsoft Office alternatives][1] on Linux. + +Let’s get to know what the latest release has in store for us. + +**Note:** We have covered products that are not open-source from SoftMaker because they are also available for Linux. And, the same goes for FreeOffice 2021. + +### Major Highlights + +The eye-catching feature of the release is the flawless compatibility with MS Office formats. It supports the modern file formats DOCX, XLSX, and PPTX. This means you can easily open, edit and save your friend’s MS Office files. Thus, there’s no hassle of exporting and converting file formats anymore. + +Another important highlight is using a single license for Linux, macOS, and Windows concurrently. This is helpful if you want to use FreeOffice on more than one PC, like your workstation or your sibling’s laptop. + +Other newly added features include initial support for SVG graphic format and improved import-export functions. + +#### TextMaker 2021 Improvements + +![Source: Presskit][2] + +You can now simultaneously use footnotes and endnotes in the same document. + +Moreover, TextMaker can even open the older Microsoft DOC format and ODT format utilized by OpenOffice and LibreOffice. + +#### PlanMaker 2021 Improvements + +![Source: Presskit][2] + +Power users will find it comforting to know that functions, like conditional formatting and extended pivot tables using PlanMaker, will be compatible with Excel 2021, 2019, and 365. + +#### Presentations 2021 Improvements + +![Source: Presskit][2] + +Users who like to focus on the visual aspects of the slides can find more animations, slide transitions, and effects. These are now based on OpenGL for smoother performance. + +### Wrapping Up + +FreeOffice 21 seems to be a good update, especially if you were looking for a free office suite with better compatibility with Microsoft Office. + +FreeOffice is available for Linux along with macOS and Windows, entirely **free of cost**. You can find DEB, RPM packages, along with a tar package for other Linux distributions. + +[Download FreeOffice 21][3] + +_Do you use SoftMaker FreeOffice as your daily driver? If not, do you plan to check it out?_ + +#### 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/freeoffice-2021-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/best-free-open-source-alternatives-microsoft-office/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQ4OCIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://www.freeoffice.com/en/download From 52819cfbf54229a64bc1c5825fb89a13205fb75b Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 22 Oct 2021 08:39:32 +0800 Subject: [PATCH 0790/1588] translated --- ...stics with this Linux command-line tool.md | 126 ------------------ ...stics with this Linux command-line tool.md | 124 +++++++++++++++++ 2 files changed, 124 insertions(+), 126 deletions(-) delete mode 100644 sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md create mode 100644 translated/tech/20211018 Get memory use statistics with this Linux command-line tool.md diff --git a/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md b/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md deleted file mode 100644 index 6d9ff731ed..0000000000 --- a/sources/tech/20211018 Get memory use statistics with this Linux command-line tool.md +++ /dev/null @@ -1,126 +0,0 @@ -[#]: subject: "Get memory use statistics with this Linux command-line tool" -[#]: via: "https://opensource.com/article/21/10/memory-stats-linux-smem" -[#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Get memory use statistics with this Linux command-line tool -====== -The smem command allows you to quickly view your web applications' -memory use. -![Programming at a browser, orange hands][1] - -In my programming work, I often need to know the memory used by web applications. A rough estimate is usually enough before getting down to details and browser profiling tools. - -To interrogate memory use on Linux or macOS, people typically use [top][2] or [htop][3]. I'd love to see a single number: How much RAM did a process take. But statistics shown by these utilities can be hard to understand. With web browsers, it's even more complicated because they often run many separate processes. They all show up in top output as a long list, each with its own individual metrics. - -![Memory usage using htop][4] - -(Tomasz Waraksa, [CC BY-SA 4.0][5]) - -### Enter smem command - -Luckily there is [smem][6], another command-line utility for viewing memory use statistics. Install it with your package manager of choice, for example: - - -``` -`sudo apt install smem` -``` - -To get total memory use by [Firefox][7], do: - - -``` -`smem -c pss -P firefox -k -t | tail -n 1` -``` - -What happens here? - - * `-c` switch specifies columns to show. I'm only interested in _the pss_ column, which shows memory allocated by a process. - * `-P` switch filters processes to include only those with _firefox_ in the name - * `-k` switch tells to show memory use in mega/gigabytes instead of plain bytes - * `-t` switch displays the totals - * `tail -n 1` filter outputs only the last line, just where the totals are - - - -The output is as simple as it gets: - - -``` -$ smem -t -k -c pss -P firefox | tail -n 1 -4.9G -``` - -Straight to the point! And, after another busy day of work, with over fifty opened tabs, Firefox still uses only 5 GB. Take that, Google Chrome ;-) - -#### Even easier with a script - -For convenience, create a little script named `memory-use`, which takes the process name as a parameter. I keep all my scripts in `~/bin`, so: - - -``` -`echo 'smem -c pss -P "$1" -k -t | tail -n 1' > ~/bin/memory-use && chmod +x ~/bin/memory-use` -``` - -Now I can measure memory use of any application as easy as: - - -``` -memory-use firefox -memory-use chrome -memory-use slack -``` - -#### And there is even more! - -The utility can do much more than show the total memory use. It can even generate graphic output. - -For example: - - -``` -`smem --pie name -c pss` -``` - -Shows something like this: - -![Pie chart output from smem][8] - -(Tomasz Waraksa, [CC BY-SA 4.0][5]) - -For more details, I recommend looking into [smem man pages][6]. - -You can find another great tutorial at . - -Enjoy! - -* * * - -_This article originally appeared on the [author's blog][9] and is republished with permission._ - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/memory-stats-linux-smem - -作者:[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/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) -[2]: https://linux.die.net/man/1/top -[3]: https://linux.die.net/man/1/htop -[4]: https://opensource.com/sites/default/files/uploads/1_htop.png (Memory usage using htop) -[5]: https://creativecommons.org/licenses/by-sa/4.0/ -[6]: https://linux.die.net/man/8/smem -[7]: https://www.mozilla.org/en-US/firefox/ -[8]: https://opensource.com/sites/default/files/uploads/2_smem-pie-chart.png (Pie chart output from smem) -[9]: https://letsdebug.it/post/26-measure-application-memory-use-on-linux/ diff --git a/translated/tech/20211018 Get memory use statistics with this Linux command-line tool.md b/translated/tech/20211018 Get memory use statistics with this Linux command-line tool.md new file mode 100644 index 0000000000..fc79aaedd6 --- /dev/null +++ b/translated/tech/20211018 Get memory use statistics with this Linux command-line tool.md @@ -0,0 +1,124 @@ +[#]: subject: "Get memory use statistics with this Linux command-line tool" +[#]: via: "https://opensource.com/article/21/10/memory-stats-linux-smem" +[#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +用这个 Linux 命令行工具获取内存使用统计信息 +====== +smem 命令允许你快速查看你的 Web 应用的内存使用情况。 +![Programming at a browser, orange hands][1] + +在我的编程工作中,我经常需要了解网络应用的内存使用情况。在深入研究细节和浏览器剖析工具之前,一个粗略的估计通常就足够了。 + +为了询问 Linux 或 macOS 上的内存使用情况,人们通常使用 [top][2] 或 [htp][3]。我很想看到一个单一的数字:一个进程占用了多少内存。但这些工具所显示的统计数据可能很难理解。对于网络浏览器来说,它甚至更加复杂,因为它们经常运行许多独立的进程。它们都在 top 输出中显示为一个长长的列表,每一个都有自己的单独指标。 + +![Memory usage using htop][4] + +(Tomasz Waraksa, [CC BY-SA 4.0][5]) + +### 输入 smem 命令 + +幸运的是有 [smem][6],另一个用于查看内存使用统计的命令行工具。用你选择的包管理器安装它,例如: + + +``` +`sudo apt install smem` +``` + +要获得 [Firefox][7] 的总内存使用量,请执行: + + +``` +`smem -c pss -P firefox -k -t | tail -n 1` +``` + +这里发生了什么? + + * `-c` 开关指定要显示的列。我只对 _pss_ 列感兴趣,它显示一个进程分配的内存。 + * `-P` 开关过滤进程,只包括那些名字里有 _firefox_ 的进程。 + * `-k` 开关显示以 MB/GB 为单位的内存使用情况,而不是单纯的字节数 + * `-t` 开关显示总数 + * `tail -n 1` 过滤器只输出最后一行,也就是总数的地方。 + + + +输出是非常简单的: + + +``` +$ smem -t -k -c pss -P firefox | tail -n 1 +4.9G +``` + +开门见山! 而且,经过又一天忙碌的工作,打开了 50 多个选项卡,Firefox 仍然只使用 5 GB。看看吧,Google Chrome ;-) + +#### 用一个脚本更容易 + +为了方便起见,创建一个名为 `memory-use` 的小脚本,它将进程名称作为参数。我把所有的脚本都放在 `~/bin`里,所以: + + +``` +`echo 'smem -c pss -P "$1" -k -t | tail -n 1' > ~/bin/memory-use && chmod +x ~/bin/memory-use` +``` + +现在我可以很容易地测量任何应用的内存使用: + + +``` +memory-use firefox +memory-use chrome +memory-use slack +``` + +#### 还有更多! + +该工具不仅可以显示总的内存使用情况。它甚至可以生成图形输出。 + +比如: + +``` +`smem --pie name -c pss` +``` + +显示类似这样的内容: + +![Pie chart output from smem][8] + +(Tomasz Waraksa, [CC BY-SA 4.0][5]) + +关于更多的细节,我建议查看 [smem 手册页][6]。 + +你可以在 上找到另一个很棒的教程。 + +享受吧! + +* * * + +_本文最初出现在[作者的博客][9]上,并经许可转载。_ + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/memory-stats-linux-smem + +作者:[Tomasz Waraksa][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/tomasz +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_code_keyboard_orange_hands.png?itok=G6tJ_64Y (Programming at a browser, orange hands) +[2]: https://linux.die.net/man/1/top +[3]: https://linux.die.net/man/1/htop +[4]: https://opensource.com/sites/default/files/uploads/1_htop.png (Memory usage using htop) +[5]: https://creativecommons.org/licenses/by-sa/4.0/ +[6]: https://linux.die.net/man/8/smem +[7]: https://www.mozilla.org/en-US/firefox/ +[8]: https://opensource.com/sites/default/files/uploads/2_smem-pie-chart.png (Pie chart output from smem) +[9]: https://letsdebug.it/post/26-measure-application-memory-use-on-linux/ From 0a185870fc8014594ecb8861c6feb75af86ee1f2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Fri, 22 Oct 2021 08:44:59 +0800 Subject: [PATCH 0791/1588] translating --- .../tech/20211021 How to Convert a Webpage to PDF in Linux.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md b/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md index cbec186093..be817f5967 100644 --- a/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md +++ b/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/convert-webpage-pdf-linux/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From b8e59474c5aef42e38c20d82ee908dc3ba313778 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Fri, 22 Oct 2021 10:14:09 +0800 Subject: [PATCH 0792/1588] Delete 20211021 How to get useful answers to your questions.md --- ...to get useful answers to your questions.md | 183 ------------------ 1 file changed, 183 deletions(-) delete mode 100644 sources/tech/20211021 How to get useful answers to your questions.md diff --git a/sources/tech/20211021 How to get useful answers to your questions.md b/sources/tech/20211021 How to get useful answers to your questions.md deleted file mode 100644 index cae22969ff..0000000000 --- a/sources/tech/20211021 How to get useful answers to your questions.md +++ /dev/null @@ -1,183 +0,0 @@ -[#]: subject: "How to get useful answers to your questions" -[#]: via: "https://jvns.ca/blog/2021/10/21/how-to-get-useful-answers-to-your-questions/" -[#]: author: "Julia Evans https://jvns.ca/" -[#]: collector: "lujun9972" -[#]: translator: " " -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to get useful answers to your questions -====== - -5 years ago I wrote a post called [how to ask good questions][1]. I still really like that post, but it’s missing a few of the tactics I use to get useful answers like “interrupt people when they’re going off on an irrelevant tangent”. - -### what can go wrong when asking questions - -Often when I ask a vague or underspecified question, what happens is one of: - - 1. the person starts by explaining a bunch of stuff I already know - 2. the person explains some things which I don’t know, but which I don’t think are relevant to my problem - 3. the person starts giving a relevant explanation, but using terminology that I don’t understand, so I still end up being confused - - - -None of these give me the answer to my question and this can be quite frustrating (it often feels condescending when someone embarks on a lengthy explanation of things I already know, even if they had no way of knowing that I already know those things), so let’s talk about I try to avoid situations like this and get the answers I need. - -Before we talk about interrupting, I want to talk about my 2 favourite question-asking tactics again – asking yes/no questions and stating your understanding. - -### ask yes/no questions - -My favourite tactic is to ask a yes/no question. What I love about this is that there’s a much lower chance that the person answering will go off on an irrelevant tangent – they’ll almost always say something useful to me. - -I find that it’s often possible to come up with yes/no questions even when discussing a complicated topic. For example, here are a bunch of yes/no questions I asked a friend when trying to learn a little bit about databases from them: - - * how often do you expect db failovers to happen? like every week? - * do you need to scale up by hand? - * are fb/dropbox both using mysql? - * does fb have some kind of custom proprietary mysql management software? - * is this because mysql and postgres were designed at a time when people didn’t think failover was something you’d have to do that frequently? - * i still don’t really understand that blog post about replsets, like is he saying that mongodb replication is easier to set up than mysql replication? - * is orchestrator a proxy? - * is the goal of the replicas you’re talking about to be read replicas for performance? - * do you route queries to a shard based on the id you’re searching for? - * is the point that with compression it takes extra time to read but it doesn’t matter because you almost never read? - - - -The answers to yes/no questions usually aren’t just “yes” or “no” – for all of those questions my friend elaborated on the answer, and the elaborations were always useful to me. - -You’ll notice that some of those questions are “check my understanding” questions – like “do you route queries to a shard based on the id you’re searching for?” was my previous understanding of how database sharding worked, and I wanted to check if it was correct or not. - -I also find that yes/no questions get me answers faster because they’re relatively easy to answer quickly. - -### state your current understanding - -My second favourite tactic is to state my understanding of how the system works. - -Here’s an example from the “asking good questions” post of a “state your understanding” [email I sent to the rkt-dev mailing list][2]: - -> I’ve been trying to understand why the tree store / image store are designed the way they are in rkt. -> -> My current understanding of how _Docker_’s image storage on disk works right now (from ) is: -> -> * every layer gets one directory, which is basically that layer’s filesystem -> * at runtime, they all get stacked (via whatever CoW filesystem you’re using) -> * every time you do IO, you go through the stack of directories (or however these overlay drivers work) -> - -> -> my current understanding of rkt’s image storage on disk is: (from the “image lifecycle” section here: ) -> -> * every layer gets an image in the image store -> * when you run an ACI file, all the images that that ACI depends on get unpacked and copied into a single directory (in the tree store) -> - -> -> guess at why rkt decided to architect its storage differently from Docker: -> -> 1. having very deep overlay filesystems can be expensive -> 2. so if you have a lot of layers, copying them all into a directory (the “tree store”) results in better performance -> - -> -> So rkt is trading more space used on disk (every image in the image store gets copied at least once) for better runtime performance (there are no deep chains of overlays) -> -> Is this right? Have I misunderstood what rkt does (or what Docker does?) Are there other reasons for the difference? - -This: - - * states my goal (understand rkt’s design choices) - * states my understanding of how rkt and docker work - * makes some guesses at the goal so that people can confirm/deny - - - -This question got a [great reply][3], which among other things pointed out something that I’d totally missed – that the ACI format is a DAG instead of a linked list, which I think means that you could install Debian packages in any order and not have to rebuild everything if you remove an `apt-get install` in the middle of your Dockerfile. - -I also find the process of writing down my understanding is really helpful by itself just to clarify my own thoughts – sometimes by the time I’m done I’ve answered my own question :) - -Stating your understanding is a kind of yes/no question – “this is my understanding of how X works, is that right or wrong?”. Often the answer is going to be “right in some ways and wrong in others”, but even so it makes the job of the answerer a lot easier. - -Okay! Now let’s talk about interrupting a little bit. - -### be willing to interrupt - -If someone goes off on a very long explanation that isn’t helping me at all, I think it’s important to interrupt them. This can feel rude, but ultimately it’s more efficient for everyone – it’s a waste of both their time and my time to continue. - -Usually I’ll interrupt by asking a more specific question, because usually if someone has gone off on a long irrelevant explanation it’s because I asked an overly vague question to start with. - -### don’t accept responses that don’t answer your question - -If someone finishes a statement that doesn’t answer you question, it’s important not to leave it there! Keep asking questions! - -a couple of ways you can do this: - - 1. ask a much more specific question (like a yes/no question) that’s in the direction of what you actually wanted to know - 2. ask them to clarify some terminology you didn’t understand (what’s an X?) - - - -### take a minute to think - -Sometimes when asking someone a question, they’ll tell me new information that’s really surprising. For example, I recently learned that Javascript async/await isn’t implemented with coroutines (I thought it was because AFAIK Python async/await is implemented with coroutines). - -I was pretty surprised by this, and I really needed to stop and think about what the implications of that were and what other questions I had about how Javascript works based on that new piece of information. - -If this happens in a real-time conversation sometimes I’ll literally say something like “wait, that’s surprising to me, let me think for a minute” and try to incorporate the new data and come up with another question. - -### it takes a little bit of confidence - -All of these things – being willing to interrupt, not accepting responses that don’t answer your questions, and asking for a minute to think – require a little bit of confidence! - -In the past when I’ve struggled with confidence, I’ve sometimes thought “oh, this explanation is probably really good, I’m just not smart enough to understand it”, and kind of accepted it. And even today I sometimes find it hard to keep asking questions when someone says a lot of words I don’t understand. - -It helps me to remember that: - - 1. people usually want to help (even if their first explanation was full of confusing jargon) - 2. if I can get even 1 useful piece of information by the end of the conversation, it’s a victory (like the answer to a yes/no question that I previously didn’t know the answer to) - - - -One of the reasons I dislike a lot of “how to ask questions” advice out there is that it actually tries to _undermine_ the reader’s confidence – the assumption is that the people answering the questions are Super Smart Perfect People and you’re probably wasting their time with your dumb questions. But in reality (at least when at work) your coworkers answering the questions are probably smart well-meaning people who want to help but aren’t always able to answer questions very clearly, so you need to ask follow up questions to get answers. - -### how to give useful answers - -There’s also a lot you can do to try not to be the person who goes off on a long explanation that doesn’t help the person you’re talking to at all. - -I wrote about this already in [how to answer question in a helpful way][4], but the main thing I do is pause periodically and check in. I’ll often say something like “does that make sense?“. (though this doesn’t always work, sometimes people will say “yes” even if they’re confused) - -It’s especially important to check in if: - - 1. You haven’t explained a concept before (because your initial explanation will probably not be very good) - 2. You don’t know the person you’re talking to very well (because you’ll probably make incorrect assumptions about what they know / don’t know) - - - -### being good at extracting information is a superpower - -Some developers know a lot but aren’t very good at explaining what they know. I’m not trying to make a value judgement about that here (different people have different strengths! explaining things is extremely hard to do well!). - -I’ve found that instead of being mad that some people aren’t great at explaining things, it’s more effective for me to get better at asking questions that will get me the answers I need. - -This really expands the set of people I can learn from – instead of finding someone who can easily give a clear explanation, I just need to find _someone_ who has the information I want and then ask them specific questions until I’ve learned what I want to know. And I’ve found that most people really do want to be helpful, so they’re very happy to answer questions. - -And if you get good at asking questions, you can often find a set of questions that will get you the answers you want pretty quickly, so it’s a good use of everyone’s time! - --------------------------------------------------------------------------------- - -via: https://jvns.ca/blog/2021/10/21/how-to-get-useful-answers-to-your-questions/ - -作者:[Julia 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://jvns.ca/ -[b]: https://github.com/lujun9972 -[1]: https://jvns.ca/blog/good-questions/ -[2]: https://groups.google.com/g/rkt-dev/c/bhGeR3pUfPY -[3]: https://groups.google.com/g/rkt-dev/c/bhGeR3pUfPY/m/PYEKLIr9AwAJ -[4]: https://jvns.ca/blog/answer-questions-well/ From ba7a768bff7339be195e93a87199d6e016e5cfbe Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 22 Oct 2021 10:38:03 +0800 Subject: [PATCH 0793/1588] PRF&PUB @unigeorge https://linux.cn/article-13908-1.html --- ...ize data partitions in Apache Cassandra.md | 50 +++++++++---------- 1 file changed, 24 insertions(+), 26 deletions(-) rename {translated/tech => published}/20200504 Define and optimize data partitions in Apache Cassandra.md (63%) diff --git a/translated/tech/20200504 Define and optimize data partitions in Apache Cassandra.md b/published/20200504 Define and optimize data partitions in Apache Cassandra.md similarity index 63% rename from translated/tech/20200504 Define and optimize data partitions in Apache Cassandra.md rename to published/20200504 Define and optimize data partitions in Apache Cassandra.md index 5c555bee9a..2d5c833852 100644 --- a/translated/tech/20200504 Define and optimize data partitions in Apache Cassandra.md +++ b/published/20200504 Define and optimize data partitions in Apache Cassandra.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (unigeorge) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: reviewer: (wxy) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-13908-1.html) [#]: subject: (Define and optimize data partitions in Apache Cassandra) [#]: via: (https://opensource.com/article/20/5/apache-cassandra) [#]: author: (Anil Inamdar https://opensource.com/users/anil-inamdar) @@ -10,14 +10,15 @@ 在 Apache Cassandra 中定义和优化数据分区 ====== -速度和可扩展性 是 Apache Cassandra 不变的追求;来学习一下如何充分发挥它的专长吧。 -![Person standing in front of a giant computer screen with numbers, data][1] +> 速度和可扩展性是 Apache Cassandra 不变的追求;来学习一下如何充分发挥它的专长吧。 -Apache Cassandra 是一个数据库,但又不是一个简单的数据库;它是一个复制数据库,专为可扩展性、高可用性、低延迟和良好性能而设计调整。Cassandra 可以帮你的数据在区域中断、硬件故障时,以及很多管理员认为数据量过多的情况下幸免于难。 +![](https://img.linux.net.cn/data/attachment/album/202110/22/103651gse3iyiajyaagk34.jpg) + +Apache Cassandra 是一个数据库,但又不是一个简单的数据库;它是一个复制数据库,专为可扩展性、高可用性、低延迟和良好性能而设计调整。Cassandra 可以帮你的数据在区域性中断、硬件故障时,以及很多管理员认为数据量过多的情况下幸免于难。 全面掌握数据分区知识,你就能让 Cassandra 集群实现良好的设计、极高的性能和可扩展性。在本文中,我将探究如何定义分区,Cassandra 如何使用这些分区,以及一些你应该了解的最佳实践方案和已知问题。 -基本概念是这样的: 供数据库关键函数(如数据分发、复制和索引化)使用的原子单元,单个这样的数据块就是一个分区。分布式数据系统通常会把传入的数据分配到这些分区中,使用简单的数学函数(例如 identity 或 hashing 函数)执行分区过程,并用得到的 “分区键” 对数据分组,进一步再形成分区。例如,假设传入数据是服务器日志,使用“identity”分区函数和每个日志的时间戳(四舍五入到小时值)作为分区键,我们可以对这些数据进行分区,实现每个分区各保存一小时的日志的目的。 +基本概念是这样的: 供数据库关键函数(如数据分发、复制和索引化)使用的原子单元,单个这样的数据块就是一个分区。分布式数据系统通常会把传入的数据分配到这些分区中,使用简单的数学函数(例如 identity 或 hashing 函数)执行分区过程,并用得到的 “分区键” 对数据分组,进一步再形成分区。例如,假设传入数据是服务器日志,使用 “identity” 分区函数和每个日志的时间戳(四舍五入到小时值)作为分区键,我们可以对这些数据进行分区,实现每个分区各保存一小时的日志的目的。 ### Cassandra 中的数据分区 @@ -25,9 +26,9 @@ Cassandra 作为分布式系统运行,并且符合前述数据分区原则。 ![Cassandra data partition][2] -Cassandra 查询语言 (CQL) 使用大家很熟悉的 SQL 表、行、列等术语。在上面的示例图中,表配置的主键中包含了分区键,具体格式为:主键Primary Key = 分区键Partition Key + [聚簇列]Clustering Columns 。 +Cassandra 查询语言(CQL)使用大家很熟悉的 SQL 表、行、列等术语。在上面的示例图中,表配置的主键中包含了分区键,具体格式为:主键Primary Key = 分区键Partition Key + [聚簇列Clustering Columns] 。 -Cassandra 中的主键既定义了唯一的数据分区,也包含着分区内的数据排列依据信息。数据排列信息取决于聚簇列(非必需项)。每个唯一的分区键代表着服务器(包括其副本所在的服务器)中管理的若干行,。 +Cassandra 中的主键既定义了唯一的数据分区,也包含着分区内的数据排列依据信息。数据排列信息取决于聚簇列(非必需项)。每个唯一的分区键代表着服务器(包括其副本所在的服务器)中管理的若干行。 ### 在 CQL 中定义主键 @@ -35,7 +36,6 @@ Cassandra 中的主键既定义了唯一的数据分区,也包含着分区内 #### 定义方式 1(分区键:log_hour,聚簇列:无) - ``` CREATE TABLE server_logs(    log_hour TIMESTAMP PRIMARYKEY, @@ -45,11 +45,10 @@ CREATE TABLE server_logs(    ) ``` -这里,有相同 **log_hour** 的所有行都会进入同一个分区。 +这里,有相同 `log_hour` 的所有行都会进入同一个分区。 #### 定义方式 2(分区键:log_hour,聚簇列:log_level) - ``` CREATE TABLE server_logs(    log_hour TIMESTAMP, @@ -60,11 +59,10 @@ CREATE TABLE server_logs(    ) ``` -此定义方式与方式 1 使用了相同的分区键,但此方式中,每个分区的所有行都会按 **log_level** 升序排列。 +此定义方式与方式 1 使用了相同的分区键,但此方式中,每个分区的所有行都会按 `log_level` 升序排列。 #### 定义方式 3(分区键:log_hour,server,聚簇列:无) - ``` CREATE TABLE server_logs(    log_hour TIMESTAMP, @@ -75,7 +73,7 @@ CREATE TABLE server_logs(    ) ``` -在此定义中,**server** 和 **log_hour** 字段都相同的行才会进入同一个分区。 +在此定义中,`server` 和 `log_hour` 字段都相同的行才会进入同一个分区。 #### 定义方式 4(分区键:log_hour,server,聚簇列:log_level) @@ -89,11 +87,11 @@ CREATE TABLE server_logs(    )WITH CLUSTERING ORDER BY (column3 DESC); ``` -此定义方式与方式 3 分区相同,但分区内的行会依照 **log_level** 降序排列。 +此定义方式与方式 3 分区相同,但分区内的行会依照 `log_level` 降序排列。 ### Cassandra 如何使用分区键 -Cassandra 依靠分区键来确定在哪个节点上存储数据,以及在需要时定位数据。Cassandra 通过查看表中的分区键来执行这些读取和写入操作,并使用令牌tokens(一个 -2^63 到 +2^63-1 范围内的 long 类型值)来进行数据分布和索引。这些令牌通过分区器映射到分区键,分区器使用了将分区键转换为令牌的分区函数。通过这种令牌机制,Cassandra 集群的每个节点都拥有一组数据分区。然后分区键在每个节点上启用数据索引。 +Cassandra 依靠分区键来确定在哪个节点上存储数据,以及在需要时定位数据。Cassandra 通过查看表中的分区键来执行这些读取和写入操作,并使用令牌tokens(一个 $-2^{63}$ 到 $+2^{63}-1$ 范围内的 long 类型值)来进行数据分布和索引。这些令牌通过分区器映射到分区键,分区器使用了将分区键转换为令牌的分区函数。通过这种令牌机制,Cassandra 集群的每个节点都拥有一组数据分区。然后分区键在每个节点上启用数据索引。 ![Cassandra cluster with 3 nodes and token-based ownership][3] @@ -103,12 +101,12 @@ Cassandra 依靠分区键来确定在哪个节点上存储数据,以及在需 用心的分区键设计对于实现用例的理想分区大小至关重要。合理的分区可以实现均匀的数据分布和强大的 I/O 性能。分区大小对 Cassandra 集群有若干需要注意的影响: - * 读取性能——为了在磁盘上的 SSTables 文件中找到分区,Cassandra 使用缓存、索引和索引摘要等数据结构。过大的分区会降低这些数据结构的维护效率,从而对性能产生负面影响。Cassandra 新版本在这方面取得了长足的进步:特别是 3.6 及其以上版本的 Cassandra 引擎引入了存储改进,针对大型分区,可以提供更好的性能,以及更强的应对内存问题和崩溃的弹性。 - * 内存使用——大分区会对 JVM 堆产生更大的压力,同时分区的增大也降低了垃圾收集机制的效率。 - * Cassandra 修复——大分区使 Cassandra 执行修复维护操作(通过跨副本比较数据来保持数据一致)时更加困难。 - * “墓碑”删除——听起来可能有点骇人,Cassandra 使用称为“墓碑”tombstones的独特标记来记录要删除的数据。如果没有合适的数据删除模式和压缩策略,大分区会使删除过程变得更加困难。 + * 读取性能 —— 为了在磁盘上的 SSTables 文件中找到分区,Cassandra 使用缓存、索引和索引摘要等数据结构。过大的分区会降低这些数据结构的维护效率,从而对性能产生负面影响。Cassandra 新版本在这方面取得了长足的进步:特别是 3.6 及其以上版本的 Cassandra 引擎引入了存储改进,针对大型分区,可以提供更好的性能,以及更强的应对内存问题和崩溃的弹性。 + * 内存使用 —— 大分区会对 JVM 堆产生更大的压力,同时分区的增大也降低了垃圾收集机制的效率。 + * Cassandra 修复 —— 大分区使 Cassandra 执行修复维护操作(通过跨副本比较数据来保持数据一致)时更加困难。 + * “墓碑”删除 —— 听起来可能有点骇人,Cassandra 使用称为“墓碑tombstones”的独特标记来记录要删除的数据。如果没有合适的数据删除模式和压缩策略,大分区会使删除过程变得更加困难。 -虽然这些影响可能会让人更倾向于简单地设计能产生小分区的分区键,但数据访问模式对理想的分区大小也有很大影响(有关更多信息,请阅读关于 [Cassandra 数据建模][5] 的深入讲解) )。数据访问模式可以定义为表的查询方式,包括表的所有 **select** 查询。 理想情况下,CQL 选择查询应该在 **where** 子句中只使用一个分区键。也就是说,当查询可以从单个分区,而不是许多较小的分区获取所需数据时,Cassandra 是最有效率的。 +虽然这些影响可能会让人更倾向于简单地设计能产生小分区的分区键,但数据访问模式对理想的分区大小也有很大影响(有关更多信息,请阅读关于 [Cassandra 数据建模][5] 的深入讲解)。数据访问模式可以定义为表的查询方式,包括表的所有 `select` 查询。 理想情况下,CQL 选择查询应该在 `where` 子句中只使用一个分区键。也就是说,当查询可以从单个分区,而不是许多较小的分区获取所需数据时,Cassandra 是最有效率的。 ### 分区键设计的最佳实践 @@ -117,9 +115,9 @@ Cassandra 依靠分区键来确定在哪个节点上存储数据,以及在需 具体来说,这些最佳实践原则适用于任何分区键设计: * 分区键的目标必须是将理想数量的数据放入每个分区,以支持其访问模式的需求。 - * 分区键应禁止无界分区:那些大小可能随着时间无限增长的分区。例如,在上面的 **server_logs** 示例中,随着服务器日志数量的不断增加,使用服务器列作为分区键就会产生无界分区。相比之下,使用 **log_hour** 将每个分区限制为一个小时数据的方案会更好。 - * 分区键还应避免产生分区倾斜,即分区增长不均匀,有些分区可能随着时间的推移而不受限制地增长。在 **server_logs** 示例中,在一台服务器生成的日志远多于其他服务器的情况下使用服务器列会产生分区倾斜。为了避免这种情况,可以从表中引入另一个属性来强制均匀分布,即使要创建一个虚拟列来这样做,也是值得的。 - * 使用时间元素和其他属性的组合分区键,这对时间序列数据分区很有帮助。这种方式可以防止无界分区,使访问模式能够在查询特定数据时使用时间属性,而且能够对特定时间段内的数据进行删除。上面的每个示例都使用了 **log_hour** 时间属性来演示这一点。 + * 分区键应禁止无界分区:那些大小可能随着时间无限增长的分区。例如,在上面的 `server_logs` 示例中,随着服务器日志数量的不断增加,使用服务器列作为分区键就会产生无界分区。相比之下,使用 `log_hour` 将每个分区限制为一个小时数据的方案会更好。 + * 分区键还应避免产生分区倾斜,即分区增长不均匀,有些分区可能随着时间的推移而不受限制地增长。在 `server_logs` 示例中,在一台服务器生成的日志远多于其他服务器的情况下使用服务器列会产生分区倾斜。为了避免这种情况,可以从表中引入另一个属性来强制均匀分布,即使要创建一个虚拟列来这样做,也是值得的。 + * 使用时间元素和其他属性的组合分区键,这对时间序列数据分区很有帮助。这种方式可以防止无界分区,使访问模式能够在查询特定数据时使用时间属性,而且能够对特定时间段内的数据进行删除。上面的每个示例都使用了 `log_hour` 时间属性来演示这一点。 还有一些工具可用于帮助测试、分析和监控 Cassandra 分区,以检查所选模式是否高效。通过仔细设计分区键,使解决方案的数据和需求保持一致,并遵循最佳实践原则来优化分区大小,你就可以充分利用数据分区,更好地发挥 Cassandra 的可扩展性和性能潜力。 @@ -130,7 +128,7 @@ via: https://opensource.com/article/20/5/apache-cassandra 作者:[Anil Inamdar][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 a2ccbcdb5f8cde1e8f54c4449c1457625fbf3858 Mon Sep 17 00:00:00 2001 From: "patrick.zeng" Date: Fri, 22 Oct 2021 10:42:59 +0800 Subject: [PATCH 0794/1588] Translated 20211015 How... --- ...o Find and Kill Zombie Process in Linux.md | 127 ------------------ ...o Find and Kill Zombie Process in Linux.md | 117 ++++++++++++++++ 2 files changed, 117 insertions(+), 127 deletions(-) delete mode 100644 sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md create mode 100644 translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md diff --git a/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md b/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md deleted file mode 100644 index b5d435d81e..0000000000 --- a/sources/tech/20211015 How to Find and Kill Zombie Process in Linux.md +++ /dev/null @@ -1,127 +0,0 @@ -[#]: subject: "How to Find and Kill Zombie Process in Linux" -[#]: via: "https://itsfoss.com/kill-zombie-process-linux/" -[#]: author: "Marco Carmona https://itsfoss.com/author/marco/" -[#]: collector: "lujun9972" -[#]: translator: "zengyi1001" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Find and Kill Zombie Process in Linux -====== - -_**Brief: This is a quick tip on finding zombie processes in Linux and then killing them. You also learn a thing or two about processes and zombie processes.**_ - -Before you learn about Zombie process, let me recall what is a process in Linux. - -In a few words, a [process][1] is a running instance of a program in performance. It can be foreground (interactive process) or background (not interactive or automatic process). It can be a parent (creator of other processes during run-time) or child (process created by others) process. - -In Linux, except for the first init (or systemd) process with PID 0, every other process has a parent process. Processes also have their own child processes. - -Don’t believe me? Use the `pstree` command in terminal to look at the process tree to see the ‘family tree’ of your system’s processes. - -### What is a Zombie process in Linux? - -When a child process dies, the parent process is informed so that it can do some clean up like freeing up memory etc. However, child process goes into zombie state if the parent process is not aware of its death. For the parent, the child still exists but the child process is actually dead. This is how zombie processes (also known as defunct processes) are created and stay in the system. - -Here’s an excellent funny take on the zombie process by Turnoff.us: - -![Image credit: Turnoff.us][2] - -### Do you really need to worry about Zombie processes? - -Here is important to say that zombie processes are not as dangerous as its name can sound. - -The problem may arise if your system has limited RAM or if there are too many zombie processes eating up RAM. Also, most Linux processes can have maximum PID set to 32768. If there are no available IDs for other productive tasks, your system may crash. - -This rarely happens, but it’s a possibility, specially if a poorly coded program starts inducing numerous zombie processes. - -In such case, it would be a good idea to find and kill zombie process. - -### How to find zombie processes? - -A process in Linux can have one of the following states: - - * D = uninterruptible sleep - * I = idle - * R = running - * S = sleeping - * T = stopped by job control signal - * t = stopped by debugger during trace - * Z = zombie - - - -But where can you see the processes and their respective status? One easy way is to use the terminal and the [top command][3]. - -![Top command show processes and their status][4] - -As you can see in the screenshot above, there are 250 total tasks (or processes), 1 is running, 248 processes are sleeping and 1 is in zombie state. - -Now, the question arises, how to kill the zombie process? - -### How to find and kill a zombie process? Can a zombie process be killed? - -![][5] - -A zombie process is already dead. How do you kill an already dead process? - -In the zombie movies, you shoot the zombies in the head or burn it. That’s not an option here. You can burn your system for killing the zombie process but that’s not a feasible solution ;) - -Some people suggests sending SIGCHLD signal to the parent process. But it is more likely to be ignored. The other option to kill the zombie process is to kill its parent process. That sounds brutal but that’s the only sure shot way of killing zombie processes. - -So, first, let’s list the zombie processes to know their ID. It can be achieved by [using the ps command][6] like this in the terminal. - -``` -ps ux | awk '{if($8=="Z+") print}' -``` - -The 8th column in the output of the ps ux command displays the state of a process. You are asking to print all the matching lines where the state of a process is Z+ (indicating zombie state). - -Once you have identified its process ID, let’s get its parent’s process ID. - -``` -ps -o ppid= -p -``` - -Alternatively, you can combine the above two commands in the following fashion where it directly provides the PID of the zombie process and the PID of its parent process. - -``` -ps -A -ostat,pid,ppid | grep -e '[zZ]' -``` - -Here you get the parent process ID, so [finally kill the process][7] by typing the command line with its respective ID process obtained before. - -``` -kill -9 -``` - -![Killing parent process][8] - -You can verify if the zombie process is killed or not by running the ps command again or even the top command. - -Congrats! Now you know how to eliminate zombie processes. - -_With inputs from Abhishek Prakash._ - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/kill-zombie-process-linux/ - -作者:[Marco Carmona][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/marco/ -[b]: https://github.com/lujun9972 -[1]: https://tldp.org/LDP/tlk/kernel/processes.html -[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/zombies-turnoff.webp?resize=800%2C467&ssl=1 -[3]: https://linuxhandbook.com/top-command/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/top-command-view.png?resize=800%2C474&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/kill-zombie-process-linux.jpg?resize=800%2C450&ssl=1 -[6]: https://linuxhandbook.com/ps-command/ -[7]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/killing-parent-process.png?resize=800%2C180&ssl=1 diff --git a/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md b/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md new file mode 100644 index 0000000000..a654e365b3 --- /dev/null +++ b/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md @@ -0,0 +1,117 @@ +[#]: subject: "How to Find and Kill Zombie Process in Linux" +[#]: via: "https://itsfoss.com/kill-zombie-process-linux/" +[#]: author: "Marco Carmona https://itsfoss.com/author/marco/" +[#]: collector: "lujun9972" +[#]: translator: "zengyi1001" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何找到并杀掉 Linux 系统中的僵尸进程 +====== + +_**概述: 这是一个关于如何寻找 Linux 系统僵尸进程并杀死它们的小贴士。你也可以从中了解到关于进程和僵尸进程的一些知识。**_ + +在了解僵尸进程之前,让我们来复习一下什么是 Linux 进程 + +简而言之,[进程][1]是一个程序的运行实体。它可能运行在前端(比如有交互的进程),也可能运行在后端(比如无交互或自动运行的进程)。它可能是一个父进程(运行期间创建了其他进程),也可能是一个子进程(由其他进程所创建)。 + +在 Linux 系统中,除 PID 为 0 的第一个初始进程(或系统进程)外,其余进程都有父进程。进程也可以拥有自己的子进程。 + +不相信?可以试试在终端中使用 `pstree` 命令查看进程的树型结构,你能看到系统各个进程的 '家族树'。 + +### Linux系统里的僵尸进程是什么? +子进程死亡后,它的父进程会接收到通知去执行一些清理操作,如释放内存之类。然而,若父进程并未察觉到子进程死亡,子进程就会进入到“僵尸”状态。从父进程角度看,子进程仍然存在,即使子进程实际上已经死亡。这就是“僵尸进程”(也被称为“已消失进程“)是如何产生并存在于系统中的。 + +这里有一个来自 Turnoff.us 的关于僵尸进程的非常有趣的看法: +![Image credit: Turnoff.us][2] + +### 你真的需要关心僵尸进程吗? + +重点要说的是,僵尸进程并没有像它的名称那样看起来可怕。 + +但如果系统的 RAM 已经所剩不多或者有太多的僵尸进程在吃掉 RAM,问题会变得糟糕。同样,大部分 Linux 系统进程最大 PID 设置为 32768,如果过多僵尸进程导致其他重要任务没有 PID 可用,你的系统会发生崩溃。 + +这是真实可能发生的,它有一定的概率,特别当存在一个编码糟糕的程序开始大量产生僵尸进程的时候。 +在这种情况下,找到并杀死僵尸进程是一个明智的做法。 +### 如何找到僵尸进程 +Linux 系统中的进程可能处于如下状态中的一种: + * D = 不可中断 + * I = 空闲 + * R = 运行中 + * S = 休眠 + * T = 被调度信号终止 + * t = 被调试器终止 + * Z = 僵尸状态 + + + +那如何查看进程和它的当前状态呢?一个简单的方法是在终端中使用 [top 命令][3]. + +![Top command show processes and their status][4] + +正如你在上面截图中看到的,截图中共有 250 个任务(进程),其中 1 个处在 ”运行中“ 状态,248 个进程处于 “休眠” 状态,还有一个处于 “僵尸” 状态。 + +现在问题进入下一步,如何杀死 ”僵尸” 进程? + +### 如何找到并杀死一个僵尸进程?僵尸进程能被杀死吗? + +![][5] + +僵尸进程已经死了,要如何才能杀死一个已经死亡的进程呢? + +在僵尸电影中,你可以射击僵尸的头部或烧掉它们,但在这里是行不通的。你可以一把火烧了系统来杀死僵尸进程,但这并不是一个可行的方案 ;) + +一些人建议发送 SIGCHLD 给父进程,但这个信号很可能会被忽略。还有一个方法是杀死父进程来杀死僵尸进程,这听起来很野蛮,但它却是唯一能确保杀死僵尸进程的方法。 + +首先,通过在终端中 [使用 ps 命令][6] 我们列举僵尸进程,得到它们的进程 ID。 + +``` +ps ux | awk '{if($8=="Z+") print}' +``` + +ps ux 命令输出的第 8 列显示了进程状态。上述命令只会打印所有处在 Z+ 状态(表示僵尸状态)的进程。 +确认了进程 ID 后,我们可以得到它的父进程 ID。 + +``` +ps -o ppid= -p +``` + +你也可以将上述两个命令结合在一起,直接得到僵尸进程的 PID 及其父进程的 PID。 + +``` +ps -A -ostat,pid,ppid | grep -e '[zZ]' +``` + +现在你得到了父进程 ID,使用命令行和得到的 ID 号[终于可以杀死进程了][7]。 +``` +kill -9 +``` + +![Killing parent process][8] + +再次运行 ps 命令或 top 命令,你可以验证僵尸进程是否已经被杀死。 + +恭喜!现在你知道怎么清理僵尸进程了。 +Abhishek Prakash参与写作。 +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kill-zombie-process-linux/ + +作者:[Marco Carmona][a] +选题:[lujun9972][b] +译者:[zengyi1001](https://github.com/zengyi1001) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://itsfoss.com/author/marco/ +[b]: https://github.com/lujun9972 +[1]: https://tldp.org/LDP/tlk/kernel/processes.html +[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/zombies-turnoff.webp?resize=800%2C467&ssl=1 +[3]: https://linuxhandbook.com/top-command/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/top-command-view.png?resize=800%2C474&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/kill-zombie-process-linux.jpg?resize=800%2C450&ssl=1 +[6]: https://linuxhandbook.com/ps-command/ +[7]: https://itsfoss.com/how-to-find-the-process-id-of-a-program-and-kill-it-quick-tip/ +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/killing-parent-process.png?resize=800%2C180&ssl=1 From ae8744d039876103cf7a75c47e1d2235557d4644 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Fri, 22 Oct 2021 11:39:59 +0800 Subject: [PATCH 0795/1588] PRF&PUB @perfiffer https://linux.cn/article-13909-1.html --- ...e logs with the Linux logrotate command.md | 33 +++++++++---------- 1 file changed, 16 insertions(+), 17 deletions(-) rename {translated/tech => published}/20211007 Rotate and archive logs with the Linux logrotate command.md (88%) diff --git a/translated/tech/20211007 Rotate and archive logs with the Linux logrotate command.md b/published/20211007 Rotate and archive logs with the Linux logrotate command.md similarity index 88% rename from translated/tech/20211007 Rotate and archive logs with the Linux logrotate command.md rename to published/20211007 Rotate and archive logs with the Linux logrotate command.md index 53c58af648..54fed8f9b4 100644 --- a/translated/tech/20211007 Rotate and archive logs with the Linux logrotate command.md +++ b/published/20211007 Rotate and archive logs with the Linux logrotate command.md @@ -3,14 +3,16 @@ [#]: author: "Ayush Sharma https://opensource.com/users/ayushsharma" [#]: collector: "lujun9972" [#]: translator: "perfiffer" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13909-1.html" -使用 Linux `logrotate` 命令轮转和归档日志 +使用 logrotate 命令轮转和归档日志 ====== -使用此 Linux 命令保持日志文件更新。下载新的 `logrotate` 备忘单。 -![Logs stacked up and to the right in front of a green tree forest][1] + +> 使用此 Linux 命令保持日志文件更新。 + +![](https://img.linux.net.cn/data/attachment/album/202110/22/113833i6ikk4dzdm3y3hkk.jpg) 日志非常适合找出应用程序在做什么或对可能的问题进行故障排除。几乎我们处理的每个应用程序都会生成日志,我们希望我们自己开发的应用程序也生成日志。日志越详细,我们拥有的信息就越多。但放任不管,日志可能会增长到无法管理的大小,反过来,它们可能会成为它们自己的问题。因此,最好将它们进行裁剪,保留我们需要的那些,并将其余的归档。 @@ -22,7 +24,7 @@ ### 实战演练 -让我们看看在我们的系统上静默运行的 `logrotate` 配置,管理我们在 `/var/log` 目录中找到的大量日志。查看该目录中的当前文件。你是否看到很多 `*.[number].gz` 文件?这就是 `logrotate` 正在做的。你可以在 `/etc/logrotate.d/rsyslog` 下找到此配置文件。我的配置文件如下: +让我们看看在我们的系统上静默运行的 `logrotate` 配置,它管理我们在 `/var/log` 目录中找到的大量日志。查看该目录中的当前文件。你是否看到很多 `*.[number].gz` 文件?这就是 `logrotate` 正在做的。你可以在 `/etc/logrotate.d/rsyslog` 下找到此配置文件。我的配置文件如下: ``` /var/log/syslog @@ -67,15 +69,15 @@ 该文件首先定义了轮转 `/var/log/syslog` 文件的说明,这些说明包含在后面的花括号中。以下是它们的含义: - * `rotate 7`: 保留最近 7 次轮转的日志。然后开始删除它们。 + * `rotate 7`: 保留最近 7 次轮转的日志。然后开始删除超出的。 * `daily`: 每天轮转日志,与 `rotate 7` 一起使用,这意味着日志将保留过去 7 天。其它选项是每周、每月、每年。还有一个大小参数,如果日志文件的大小增加超过指定的限制(例如,大小 10k、大小 10M、大小 10G 等),则将轮转日志文件。如果未指定任何内容,日志将在运行 `logrotate` 时轮转。你甚至可以在 cron 中运行 `logrotate` 以便在更具体的时间间隔内使用它。 - * `missingok`: 如果日志文件丢失也没关系。不要惊慌。 + * `missingok`: 如果日志文件缺失也没关系。不要惊慌。 * `notifempty`: 日志文件为空时不轮转。 - * `delaycompress`: 如果压缩已打开,则将压缩延迟到下一次轮转。这允许至少存在一个轮转但未压缩的文件。如果你希望昨天的日志保持未压缩以便进行故障排除,那么此配置会很有用。如果某些程序在重新启动/重新加载之前可能仍然写入旧文件,这也很有帮助,例如 Apache。 * `compress`: 开启压缩,使用 `nocompress` 关闭它。 + * `delaycompress`: 如果压缩已打开,则将压缩延迟到下一次轮转。这允许至少存在一个轮转但未压缩的文件。如果你希望昨天的日志保持未压缩以便进行故障排除,那么此配置会很有用。如果某些程序在重新启动/重新加载之前可能仍然写入旧文件,这也很有帮助,例如 Apache。 * `postrotate/endscript`: 轮转后运行此部分中的脚本。有助于做清理工作。还有一个 `prerotate/endscript` 用于在轮转开始之前执行操作。 -你能弄清楚下一节对上面配置中提到的所有文件做了什么吗?第二部分中唯一的附加参数是 `sharedscripts`,它告诉 `logrotate` 在所有日志轮转完成之前不要运行 `postrotate/endscript` 中的部分。它可以防止脚本在每一次轮转时执行,只在之后一次轮转完成时执行。 +你能弄清楚下一节对上面配置中提到的所有文件做了什么吗?第二节中唯一多出的参数是 `sharedscripts`,它告诉 `logrotate` 在所有日志轮转完成之前不要运行 `postrotate/endscript` 中的部分。它可以防止脚本在每一次轮转时执行,只在最后一次轮转完成时执行。 ### 看点新的东西 @@ -101,7 +103,7 @@ } ``` -上面的脚本可以使用: +上面的脚本可以使用如下命令运行: ``` logrotate -vs state-file /tmp/logrotate @@ -136,7 +138,6 @@ running postrotate script 第二次运行它: - ``` reading config file /tmp/logrotate extension is now .log @@ -195,9 +196,7 @@ logrotate state -- version 2 "/var/log/nginx/access.log" 2021-08-27-9:11:56 ``` -[**下载 Linux logrotate 备忘单**][2] - -* * * +- [下载 Linux logrotate 备忘单][2] 本文首发于[作者个人博客][3],经授权改编。 @@ -208,7 +207,7 @@ via: https://opensource.com/article/21/10/linux-logrotate 作者:[Ayush Sharma][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 19744a0724974ead8a5b684d8937fbb25eca1420 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Fri, 22 Oct 2021 23:17:20 +0800 Subject: [PATCH 0796/1588] unigeorge translating --- sources/tech/20210911 Play with model trains in OpenTTD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sources/tech/20210911 Play with model trains in OpenTTD.md b/sources/tech/20210911 Play with model trains in OpenTTD.md index d636df830f..f04db160a7 100644 --- a/sources/tech/20210911 Play with model trains in OpenTTD.md +++ b/sources/tech/20210911 Play with model trains in OpenTTD.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/9/model-trains-openttd" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "unigeorge" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " @@ -179,7 +179,7 @@ via: https://opensource.com/article/21/9/model-trains-openttd 作者:[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 6b8724b5e0ba36e86d640f0725292b8f8ffb3f0c Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 23 Oct 2021 05:02:41 +0800 Subject: [PATCH 0797/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211023?= =?UTF-8?q?=20How=20to=20Install=20themes=20on=20Xubuntu=20and=20Other=20D?= =?UTF-8?q?istros=20Using=20Xfce=20Desktop=20Environment?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md --- ... Distros Using Xfce Desktop Environment.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) create mode 100644 sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md diff --git a/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md b/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md new file mode 100644 index 0000000000..2e32e3470e --- /dev/null +++ b/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md @@ -0,0 +1,113 @@ +[#]: subject: "How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment" +[#]: via: "https://itsfoss.com/install-themes-xfce-xubuntu/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment +====== + +_**Brief: This is a step-by-step beginner’s tutorial to show how to install themes and icons in Xubuntu and other Linux distributions that use Xfce desktop environment.**_ + +Installing themes on Xubuntu is similar to Ubuntu or any other Linux distribution. You put the theme files in the ~/.themes folder and then use a tool to change it. + +However, some options or the user interface will look different considering Xubuntu uses the [Xfce desktop environment][1]. This is why I created this specific tutorial to show the steps with proper screenshots. + +### Install new themes in Xubuntu (Xfce) + +To get started, you need to create a **.themes** folder in the home directory. Mind the dot (.) before the folder name. It’s important and hides the folder from normal view. + +To check if you already have it, you can [enable viewing hidden files][2] and then create it if it isn’t present. + +![][3] + +Once done, you need to download a theme. + +1\. You can browse for XFCE themes on the [Xfce-look][4] portal. All you have to do is download the archive (compressed) file. + +2\. Next, you need to [extract the zip file][5], as shown in the screenshot below. + +![][6] + +3\. Once you extract it, you will notice a folder appear, and you will have to copy it. + +![][7] + +4\. You will have to then paste this folder into the **.themes** directory that you created initially. + +![][8] + +5\. Finally, you need to head to the Appearance setting to find it listed and select it/apply it for it to take effect. + +![][9] + +As you notice in the screenshot below, the new theme has been added and applied: + +![][10] + +In addition to the theme, if you need to customize the icons of your Xubuntu desktop, you need to create another .icons folder in the home directory. + +Like you installed the theme, you will have to follow a similar process to apply the icon themes. + +To give you an example, let me highlight those steps here: + +### Adding icon themes in Xubuntu (Xfce) + +You can browse through the same [xfce-look portal][11] to look for complete icon themes. + +Or, you can explore some of the best [icon themes available for Ubuntu][12] that should work for Xubuntu as well. + +Once you find the one you like, download it, and extract it as shown below. + +![][13] + +Next, you will have to copy and paste the folder into the .**icons** folder. + +![][14] + +Now, you can head back to the Appearance settings and find the icon listed under the “Icons” available. + +To show you the difference, **I changed the default Xubuntu theme to adwaita-dark**, as you can see here: + +![][15] + +**Note**: Some icon or theme files may contain nested folders with different variants in it. You’ll notice that they do not appear in the appearance tool. If that’s the case, copy the inner folder directly in ~/.themes or ~/.icons folder. + +### Wrapping Up + +With both the style and icons tweaked, you can [customize your Xubuntu experience][16] to blend in with your taste. + +Do you prefer the default Xubuntu look or customize the look of it using different themes/icons? Let me know your thoughts in the comments. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-themes-xfce-xubuntu/ + +作者:[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://xfce.org/ +[2]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-hidden-files.png?resize=674%2C300&ssl=1 +[4]: https://www.xfce-look.org/browse?cat=138&ord=latest +[5]: https://itsfoss.com/unzip-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/extract-xubuntu-theme.png?resize=719%2C537&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/extracted-xubuntu-theme.png?resize=709%2C272&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/copy-theme-xubuntu.png?resize=705%2C328&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/appearance-xfce.png?resize=703%2C544&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xpro-xubuntu-theme.png?resize=1162%2C599&ssl=1 +[11]: https://www.xfce-look.org/browse?cat=132&ord=latest +[12]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme.png?resize=756%2C560&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-selection.png?resize=739%2C534&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-change.png?resize=1154%2C619&ssl=1 +[16]: https://itsfoss.com/customize-xfce/ From c15c8ed0dfad78e91b789d4eab140f180996a73e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 23 Oct 2021 05:03:07 +0800 Subject: [PATCH 0798/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211022?= =?UTF-8?q?=203=20tips=20for=20printing=20with=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211022 3 tips for printing with Linux.md --- ...20211022 3 tips for printing with Linux.md | 37 +++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 sources/tech/20211022 3 tips for printing with Linux.md diff --git a/sources/tech/20211022 3 tips for printing with Linux.md b/sources/tech/20211022 3 tips for printing with Linux.md new file mode 100644 index 0000000000..56ace22fd8 --- /dev/null +++ b/sources/tech/20211022 3 tips for printing with Linux.md @@ -0,0 +1,37 @@ +[#]: subject: "3 tips for printing with Linux" +[#]: via: "https://opensource.com/article/21/10/print-linux" +[#]: author: "Lauren Pritchett https://opensource.com/users/lauren-pritchett" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +3 tips for printing with Linux +====== +Learn how to set up your printer, print from anywhere, and print files +from your terminal all on Linux. +![Files in a folder][1] + +I have a confession to make. This may be an unpopular opinion. I actually enjoy reading documents on a piece of paper as opposed to digitally. When I want to try a new recipe, I print it out to follow it so I don't have to continually swipe my mobile device to keep up with the steps. I store all my favorite recipes in sheet protectors in a binder. I also like to print out coloring pages or activity sheets for my kids. There are a ton of options online or we [create our own][2]! + +Though I have a fond appreciation for printed documents, I have also had my fair share of printing nightmares. Paper jams, low ink, printer not found, the list of frustrating errors goes on and on. + +Thankfully, it is possible to print frustration-free on Linux. Below are three tutorials you need to get started printing on Linux. The first article walks through how to connect your printer to your Linux computer. Then, learn how to print from anywhere in your house using your home network. The last article teaches you how to print from your Linux terminal so you can live out all your productivity dreams. If you are in the market for a new printer, check out this article about [choosing a printer for Linux][3]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/print-linux + +作者:[Lauren Pritchett][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/lauren-pritchett +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/files_documents_paper_folder.png?itok=eIJWac15 (Files in a folder) +[2]: https://opensource.com/article/20/8/edit-images-python +[3]: https://opensource.com/article/18/11/choosing-printer-linux From 9f39488fb301f00fb0ed3453fd653dcbbf15b8c3 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 23 Oct 2021 05:04:02 +0800 Subject: [PATCH 0799/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211022?= =?UTF-8?q?=20Brave=20Browser=20Kicks=20Out=20Google=20as=20the=20Default?= =?UTF-8?q?=20Search=20Engine=20in=20Favor=20of=20its=20Own?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211022 Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own.md --- ...fault Search Engine in Favor of its Own.md | 71 +++++++++++++++++++ 1 file changed, 71 insertions(+) create mode 100644 sources/news/20211022 Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own.md diff --git a/sources/news/20211022 Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own.md b/sources/news/20211022 Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own.md new file mode 100644 index 0000000000..40fd7a5a36 --- /dev/null +++ b/sources/news/20211022 Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own.md @@ -0,0 +1,71 @@ +[#]: subject: "Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own" +[#]: via: "https://news.itsfoss.com/brave-replaces-google/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Brave Browser Kicks Out Google as the Default Search Engine in Favor of its Own +====== + +Brave is one of the [best web browsers available for Linux][1]. The browser uses Google as the default search engine for most of the regions. + +However, that is about to change with the recent announcement of Brave abandoning Google to favor its privacy-respecting search engine [Brave Search][2]. + +### Brave Search In, Google Out + +Google pays a lot of good money when it comes to keeping its search engine as the default in many web browsers. + +But, it seems that Brave plans to take on Google’s search engine by utilizing its offering ([Brave Search][3]) to replace it as the default search engine. + +Considering Brave Search is still in the beta phase, it is a bold move. + +The change is only for new users and is limited to a few countries (United States, Canada, and the United Kingdom). + +Brave Search also replaces Qwant and DuckDuckGo in France and Germany, respectively. + +Shortly, this change will be happening for more regions as well. + +If you already use Brave, your default search engine will not be changed automatically. Also, if you do not belong to one of the regions mentioned above, you need to change the default search engine to Brave Search, if you prefer it over Google. + +### Improving Brave Search in the Process + +With the new default selection, Brave Search should have the potential to receive more feedback on its search result index and quality. + +Hence, Brave has also launched the [Web Discovery Project][4] along with this change to let users opt-in to contribute anonymous data to help improve the search results. + +As of now, Brave Search does not include any advertisements. But, it will be adding advertisements soon and introducing a premium option to opt for an ad-free experience. + +### Closing Thoughts + +Brave Search is a promising alternative to Google’s search engine. Of course, it is not easy to offer a good search experience as good as Google, but it is refreshing to see shifting focus to other search engines. + +The brave web browser has a significant userbase among the chromium-based solutions. So, this change should let new users experience a different search engine promoting more healthy competition. + +What do you think about this? Let me know your thoughts. + +#### 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/brave-replaces-google/ + +作者:[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/best-browsers-ubuntu-linux/ +[2]: https://itsfoss.com/brave-search-features/ +[3]: https://search.brave.com/ +[4]: https://brave.com/privacy/browser/#web-discovery-project From ac22798d917bcb8e9debb14402720cb19b2fb37b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Sat, 23 Oct 2021 05:04:25 +0800 Subject: [PATCH 0800/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211022?= =?UTF-8?q?=20MX=20Linux=2021=20Stable=20Release=20is=20Finally=20Here=20I?= =?UTF-8?q?ntroducing=20a=20Fluxbox=20Edition?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md --- ...ally Here Introducing a Fluxbox Edition.md | 91 +++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md diff --git a/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md b/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md new file mode 100644 index 0000000000..fda2922e87 --- /dev/null +++ b/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md @@ -0,0 +1,91 @@ +[#]: subject: "MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition" +[#]: via: "https://news.itsfoss.com/mx-linux-21-release/" +[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition +====== + +[MX Linux][1] is a Debian-based Linux/GNU distribution aiming at elegance, stability, and performance. + +We previously covered its [new Fluxbox edition in the beta phase][2], but now the stable release is out. Let us explore what’s new with MX Linux 21 “Wildflower”. + +### MX Linux 21 Key Highlights + +![][3] + +MX Linux 21 is based on Debian 11 “Bullseye” running Linux Kernel 5.10LTS, and with the new update, you can find some new applications and upgrades to the current list. + +![][4] + +The “Wildflower” series included a new edition with **Fluxbox 1.3.7**, which will bring older computers back to life. In case you did not know, Fluxbox is a window manager that works seamlessly on high-end computers but is light on resources. + +For the installer, there is a new partition selection area. It comes with support for LVM(Logical Volume Manager). + +![MX Linux 21 has a neat graphical installer.][3] + +When booting your system, whether you are going with live boot or persistence, you can choose using the updated UEFI live system boot menu instead of the older console menus. + +For desktop environments, Xfce 4.16 and KDE Plasma 5.20 are the latest versions available. + +However, the Xfce edition is not yet available. + +A new handy utility that is presented is using the admin’s password by default for administrative tasks. However, you can turn it off if you do not need it. + +### Other Improvements + + * The installer and live system have been updated to the latest versions. + * Most of the translation functionality is still in progress. On the other hand, some parts of the translation are working flawlessly. + * The default package set now includes the [Mesa Vulkan][5] drivers. + * There is better support for Wifi for some Realtek hardware. + * The Debian security repository is enabled by default. + * Xfce has seen some improvements. One of which is an added samba shares plugin for the Thunar file manager. + * KDE has seen a fix regarding its file manager Dolphin. + + + +![][3] + +### Summing Up + +MX Linux 21 is currently the latest stable release. It is more elegant and more performant, so it is becoming more popular as a daily driver. + +Even though MX Linux is a relatively new Linux/GNU distribution compared to other popular options, it has a lot of potential for providing a complete operating system backed by Debian, the MX repository, and [antiX Linux][6]. + +You can refer to the [official announcement][7] for more details. + +[Download MX Linux 21][8] + +What do you think of this release? Do you happen to use MX Linux? 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/mx-linux-21-release/ + +作者:[Omar Maarof][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/omar/ +[b]: https://github.com/lujun9972 +[1]: https://mxlinux.org/ +[2]: https://news.itsfoss.com/mx-linux-21-fluxbox-beta-release/ +[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[5]: https://www.mesa3d.org/ +[6]: https://antixlinux.com/ +[7]: https://mxlinux.org/blog/mx-21-wildflower-released/ +[8]: https://mxlinux.org/download-links/ From 2fc3ee46ef5f6294702b6dd56dec7bb9153fcb1b Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 Oct 2021 10:08:10 +0800 Subject: [PATCH 0801/1588] APL --- ...ble Release is Finally Here Introducing a Fluxbox Edition.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md b/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md index fda2922e87..efdcbcc403 100644 --- a/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md +++ b/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/mx-linux-21-release/" [#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 0cd9c81ad6e2080edb0cd20296057aa119161775 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 Oct 2021 10:35:33 +0800 Subject: [PATCH 0802/1588] TSL&PRF --- ...ally Here Introducing a Fluxbox Edition.md | 91 ------------------- ...ally Here Introducing a Fluxbox Edition.md | 87 ++++++++++++++++++ 2 files changed, 87 insertions(+), 91 deletions(-) delete mode 100644 sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md create mode 100644 translated/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md diff --git a/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md b/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md deleted file mode 100644 index efdcbcc403..0000000000 --- a/sources/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md +++ /dev/null @@ -1,91 +0,0 @@ -[#]: subject: "MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition" -[#]: via: "https://news.itsfoss.com/mx-linux-21-release/" -[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition -====== - -[MX Linux][1] is a Debian-based Linux/GNU distribution aiming at elegance, stability, and performance. - -We previously covered its [new Fluxbox edition in the beta phase][2], but now the stable release is out. Let us explore what’s new with MX Linux 21 “Wildflower”. - -### MX Linux 21 Key Highlights - -![][3] - -MX Linux 21 is based on Debian 11 “Bullseye” running Linux Kernel 5.10LTS, and with the new update, you can find some new applications and upgrades to the current list. - -![][4] - -The “Wildflower” series included a new edition with **Fluxbox 1.3.7**, which will bring older computers back to life. In case you did not know, Fluxbox is a window manager that works seamlessly on high-end computers but is light on resources. - -For the installer, there is a new partition selection area. It comes with support for LVM(Logical Volume Manager). - -![MX Linux 21 has a neat graphical installer.][3] - -When booting your system, whether you are going with live boot or persistence, you can choose using the updated UEFI live system boot menu instead of the older console menus. - -For desktop environments, Xfce 4.16 and KDE Plasma 5.20 are the latest versions available. - -However, the Xfce edition is not yet available. - -A new handy utility that is presented is using the admin’s password by default for administrative tasks. However, you can turn it off if you do not need it. - -### Other Improvements - - * The installer and live system have been updated to the latest versions. - * Most of the translation functionality is still in progress. On the other hand, some parts of the translation are working flawlessly. - * The default package set now includes the [Mesa Vulkan][5] drivers. - * There is better support for Wifi for some Realtek hardware. - * The Debian security repository is enabled by default. - * Xfce has seen some improvements. One of which is an added samba shares plugin for the Thunar file manager. - * KDE has seen a fix regarding its file manager Dolphin. - - - -![][3] - -### Summing Up - -MX Linux 21 is currently the latest stable release. It is more elegant and more performant, so it is becoming more popular as a daily driver. - -Even though MX Linux is a relatively new Linux/GNU distribution compared to other popular options, it has a lot of potential for providing a complete operating system backed by Debian, the MX repository, and [antiX Linux][6]. - -You can refer to the [official announcement][7] for more details. - -[Download MX Linux 21][8] - -What do you think of this release? Do you happen to use MX Linux? 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/mx-linux-21-release/ - -作者:[Omar Maarof][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/omar/ -[b]: https://github.com/lujun9972 -[1]: https://mxlinux.org/ -[2]: https://news.itsfoss.com/mx-linux-21-fluxbox-beta-release/ -[3]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[4]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU0MSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[5]: https://www.mesa3d.org/ -[6]: https://antixlinux.com/ -[7]: https://mxlinux.org/blog/mx-21-wildflower-released/ -[8]: https://mxlinux.org/download-links/ diff --git a/translated/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md b/translated/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md new file mode 100644 index 0000000000..645467fd8c --- /dev/null +++ b/translated/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md @@ -0,0 +1,87 @@ +[#]: subject: "MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition" +[#]: via: "https://news.itsfoss.com/mx-linux-21-release/" +[#]: author: "Omar Maarof https://news.itsfoss.com/author/omar/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +MX Linux 21 稳定版发布 +====== + +> 基于 Debian 的 MX Linux 21 现已经推出,带来了一些不错的改进。 + +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/mx-linux-21-release-ft.png?w=1200&ssl=1) + +[MX Linux][1] 是一个基于 Debian 的 Linux/GNU 发行版,旨在追求优雅、稳定和性能。 + +我们之前报道过它的 [尚处于测试阶段的新 Fluxbox 版][2],但现在稳定版出来了。让我们来探讨一下 MX Linux 21 “Wildflower” 的新内容。 + +### MX Linux 21 主要亮点 + +![][3] + +MX Linux 21 基于 Debian 11 “Bullseye”,运行 Linux 5.10LTS 内核。在这次的新更新中,你可以发现一些新的应用和对当前应用的升级。 + +![][4] + +“Wildflower” 系列包括一个带有 Fluxbox 1.3.7 的新版本,它可以使旧电脑重新焕发活力。补充一下,Fluxbox 是一个窗口管理器,可以在高端计算机上无缝工作,但资源占用很少。 + +它的安装程序有一个新的分区选择区,支持 LVM(逻辑卷管理器)。 + +![MX Linux 21 有一个漂亮的图形化安装程序][3] + +当启动系统时,无论你是使用临时启动live boot还是持久化使用,你都可以选择使用新的 UEFI 临时系统启动菜单,而不是旧的控制台菜单。 + +对于桌面环境,Xfce 4.16 和 KDE Plasma 5.20 都是最新版本。 + +然而,还没有 Xfce 版。 + +它新提供的一个方便的工具是在管理任务中默认使用管理员密码。然而,如果你不需要它,你可以把它关掉。 + +### 其他改进 + + * 安装程序和临时系统已经更新到最新版本。 + * 大部分的翻译仍在进行中。另一方面,有些部分的翻译工作完成的很好的。 + * 默认软件包集现在包括 [Mesa Vulkan][5] 驱动。 + * 对某些 Realtek 硬件的 Wi-Fi 有了更好的支持。 + * 已默认启用 Debian 安全库。 + * Xfce 有了一些改进,其中之一是为 Thunar 文件管理器增加了一个 samba 共享插件。 + * KDE 对其文件管理器 Dolphin 进行了修复。 + +![][3] + +### 总结 + +MX Linux 21 是它目前最新的稳定版本。更加优雅,性能更强,因此更加适合作为日常使用。 + +尽管与其他流行的选择相比,MX Linux 是一个相对较新的 Linux/GNU 发行版,但它在提供一个由 Debian、MX 存储库和 [antiX Linux][6] 支持的完整操作系统方面有很大的潜力。 + +你可以参考 [官方公告][7] 了解更多细节。 + +- [下载 MX Linux 21][8] + +你对这个版本有什么看法?你碰巧在使用 MX Linux 吗?请在下面的评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/mx-linux-21-release/ + +作者:[Omar Maarof][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/omar/ +[b]: https://github.com/lujun9972 +[1]: https://mxlinux.org/ +[2]: https://news.itsfoss.com/mx-linux-21-fluxbox-beta-release/ +[3]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/09/MX_Linux_21-1.png?w=1366&ssl=1 +[4]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/08/mx-linux-21-fluxbox.png?w=902&ssl=1 +[5]: https://www.mesa3d.org/ +[6]: https://antixlinux.com/ +[7]: https://mxlinux.org/blog/mx-21-wildflower-released/ +[8]: https://mxlinux.org/download-links/ From 574eb1764f8c6787020373ca8364f7ff389a9ab5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 Oct 2021 10:39:45 +0800 Subject: [PATCH 0803/1588] PUB @wxy https://linux.cn/article-13912-1.html --- ...e Release is Finally Here Introducing a Fluxbox Edition.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/news => published}/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md (98%) diff --git a/translated/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md b/published/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md similarity index 98% rename from translated/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md rename to published/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md index 645467fd8c..0898a1ad7f 100644 --- a/translated/news/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md +++ b/published/20211022 MX Linux 21 Stable Release is Finally Here Introducing a Fluxbox Edition.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13912-1.html" MX Linux 21 稳定版发布 ====== From f8fa48f7e74980a090defbc7438bbb4999135ba5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sat, 23 Oct 2021 11:40:29 +0800 Subject: [PATCH 0804/1588] PRF&PUB @geekpi https://linux.cn/article-13913-1.html --- ...211018 4 Linux tools to erase your data.md | 67 +++++++++---------- 1 file changed, 30 insertions(+), 37 deletions(-) rename {translated/tech => published}/20211018 4 Linux tools to erase your data.md (69%) diff --git a/translated/tech/20211018 4 Linux tools to erase your data.md b/published/20211018 4 Linux tools to erase your data.md similarity index 69% rename from translated/tech/20211018 4 Linux tools to erase your data.md rename to published/20211018 4 Linux tools to erase your data.md index 55572d7984..2d6147082a 100644 --- a/translated/tech/20211018 4 Linux tools to erase your data.md +++ b/published/20211018 4 Linux tools to erase your data.md @@ -3,14 +3,16 @@ [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13913-1.html" -4 个 Linux 工具来清除你的数据 +4 个用来擦除数据的 Linux 工具 ====== -用这些开源工具从你的硬盘驱动器中删除数据。 -![Tools in a cloud][1] + +> 用这些开源工具从你的硬盘驱动器中擦除数据。 + +![](https://img.linux.net.cn/data/attachment/album/202110/23/113918sdojp6sj0odgis16.jpg) 保持数据安全的最好方法之一是只向加密的硬盘驱动器写入数据。在一个标准的硬盘上,只要把硬盘挂载就可以查看数据,就像 U 盘一样,甚至可以用 [Scalpel][2] 和 [Testdisk][3] 等工具显示和恢复已删除的数据。但是在一个加密的驱动器上,如果没有解密密钥(通常是你在挂载驱动器时输入的密码),数据是无法被读取的。 @@ -28,49 +30,43 @@ ### GNU Shred - ``` -`$ sudo shred -vfz /dev/sdX` +$ sudo shred -vfz /dev/sdX ``` Shred 有许多选项: - * n - 覆盖的次数。默认是三次。 - * u - 覆盖和删除。 - * s - 要粉碎的字节数。 - * v - 显示扩展信息。 - * f - 必要时强制改变权限以允许写入。 - * z - 最后用 0 覆盖来隐藏粉碎。 - - + * `-n` - 覆盖的次数。默认是三次。 + * `-u` - 覆盖并删除。 + * `-s` - 要粉碎的字节数。 + * `-v` - 显示扩展信息。 + * `-f` - 必要时强制改变权限以允许写入。 + * `-z` - 最后用 0 覆盖来隐藏粉碎。 使用 `shred --help` 获取更多信息 ### ShredOS -ShredOS 是一个 Live Linux 发行版,它的唯一目的是清除驱动器的全部内容。它是在一个名为 DBAN 的类似发行版停止维护后开发的。它使用 `nwipe` 应用,它是 DBAN 的 `dwipe` 的一个分叉。你可以通过下载 32 位或 64 位镜像,并在 Linux 和 macOS 上使用 `dd` 命令将其写入驱动器来制作一个可启动的 USB 驱动器: - +ShredOS 是一个即用Live Linux 发行版,它的唯一目的是清除驱动器的全部内容。它是在一个名为 DBAN 的类似发行版停止维护后开发的。它使用 `nwipe` 应用,它是 DBAN 的 `dwipe` 的一个分叉。你可以通过下载 32 位或 64 位镜像,并在 Linux 和 macOS 上使用 `dd` 命令将其写入驱动器来制作一个可启动的 USB 驱动器: ``` -`$ sudo dd if=shredos.img of=/dev/sdX bs=4M status=progress` +$ sudo dd if=shredos.img of=/dev/sdX bs=4M status=progress ``` -另外,你可以在 Linux、macOS 和 Windows 上使用 [Etcher][4] 工具。 +另外,你可以在 Linux、macOS 和 Windows 上使用 [Etcher][4] 工具烧录。 ### dd 命令 清除驱动器的一个常见方法是使用 Linux 的 `dd` 命令。几乎所有的 Linux 安装都安装了 `dd` 工具。确保该驱动器没有被挂载。 - ``` -`$ sudo umount /dev/sdXY -l` +$ sudo umount /dev/sdXY -l ``` -如果你想在整个目标磁盘上写零,执行以下命令。这可能会是一个通宵的工作。 - +如果你想在整个目标磁盘上写零,执行以下命令。这可能需要一个整个通宵。 ``` -`$ sudo dd if=/dev/urandom of=/dev/sdX bs=10M` +$ sudo dd if=/dev/urandom of=/dev/sdX bs=10M ``` **警告**:请确保你知道你在系统中的位置,并以正确的驱动器为目标,这样你就不会意外地删除自己的数据。 @@ -79,22 +75,19 @@ ShredOS 是一个 Live Linux 发行版,它的唯一目的是清除驱动器的 如果你的计算机包含一个较新的 NVMe 驱动器,你可以安装 [nvme-cli][5] 程序,并使用 `sanitize` 选项来清除你的驱动器。 -`nvme sanitize help` 命令为你提供了一个 sanitize 选项的列表,其中包括以下内容: - - * \--no-dealloc, -d - sanitize 后不解除分配。 - * \--oipbp, -i - 在通道之间覆盖反转模式。 - * \--owpass=, -n - 覆盖通道次数。 - * \--ause, -u - 允许 sanitize 无限制退出。 - * \--sanact=, -a - Sanitize 行为。 - * \--ovrpat=, -p - 覆盖模式。 - +`nvme sanitize help` 命令提供了选项列表: + * `--no-dealloc`、`-d` - 净化后不解除分配。 + * `--oipbp`、`-i` - 每次覆写后反转模式。 + * `--owpass=`、`-n` - 覆写次数。 + * `--ause`、`-u` - 允许无限制净化退出。 + * `--sanact=`、`-a` - 净化动作。 + * `--ovrpat=`、`-p` - 覆写模式。 下面是我使用的命令: - ``` -`$ sudo nvme sanitize /dev/nvme0nX` +$ sudo nvme sanitize /dev/nvme0nX ``` 这里的警告与格式化过程相同:首先备份重要的数据,因为这个命令会擦除这些数据! @@ -110,7 +103,7 @@ via: https://opensource.com/article/21/10/linux-tools-erase-data 作者:[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 8dfcddc632ffcbdfee5b811d966e813dd970e4f4 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 24 Oct 2021 08:56:36 +0800 Subject: [PATCH 0805/1588] APL --- ...-like FreeBSD OS, Takes Another Step Towards Full Release.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md b/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md index a75704c898..6ef508a6b5 100644 --- a/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md +++ b/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md @@ -2,7 +2,7 @@ [#]: via: "https://news.itsfoss.com/hellosystem-towards-first-release/" [#]: author: "John Paul Wohlscheid https://news.itsfoss.com/author/john/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From a53d06d720097dbd8f98ab98b52524b46a3d2fdd Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 24 Oct 2021 10:39:24 +0800 Subject: [PATCH 0806/1588] TSL&PRF --- ...Takes Another Step Towards Full Release.md | 118 ------------------ ...Takes Another Step Towards Full Release.md | 111 ++++++++++++++++ 2 files changed, 111 insertions(+), 118 deletions(-) delete mode 100644 sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md create mode 100644 translated/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md diff --git a/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md b/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md deleted file mode 100644 index 6ef508a6b5..0000000000 --- a/sources/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md +++ /dev/null @@ -1,118 +0,0 @@ -[#]: subject: "helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release" -[#]: via: "https://news.itsfoss.com/hellosystem-towards-first-release/" -[#]: author: "John Paul Wohlscheid https://news.itsfoss.com/author/john/" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release -====== - -Recently, the helloSystem devs released the newest version of their operating system. helloSystem is a newer project that wants to create a simple and easy to use operating system and is based on FreeBSD. Let’s take a look at what that means to you and me. - -### What is helloSystem? - -![helloSystem’s About screen][1] - -Most of you have probably never heard of [helloSystem][2] before. The project was started by the [creator of AppImage][3], [Simon Peter][4], early last year. Simon’s goal is to create a “friendly [Libre Desktop][5] operating system with focus on simplicity, minimalist elegance, and usability”. - -Simon takes inspiration from the simpler operating system of the 80s and 90s, specifically **early MacOS**, specifically [System 1][6]. If you just look at screenshots of the system in action, you may be tempted to say, “I don’t see what the fuss is all about. There are a bunch of Linux distros or themes that look just like MacOS.” - -The project goes beyond merely looking like MacOS, it wants to return to a simpler, easier to use design. According to the [website][7], “helloSystem is a desktop system for creators with a focus on simplicity, elegance, and usability. Its design follows the “Less, but better” philosophy. It is intended as a system for “mere mortals”, welcoming to switchers from the Mac.” You can find out more about Simon’s thoughts on what he plans for helloSystem by watching his presentation at [FOSDEM 21][8]. - -Just like the [suckless project][9], Simon created a list of “[Welcome and unwelcome technologies][10]“. The approved list of technologies include: - - * Qt - * mDNSResponder - * Python - * Go - - - -![helloSystem’s Welcome screen][1] - -The list of “unwelcome technologies” includes stuff that Simon considers “too complex or deemed aesthetically unpleasant”. These include: - - * Touch - * btrfs - * Gnome - * GTK - * Client-side window decorations - * Wayland - * Pipewire - * XDG Desktop spec - * Fonts that are metrically compatible to, but make no attempt at being visually similar to, original typefaces - * Package managers for end-user applications - * Configuration files, IP addresses - * D-Bus - * Security that restricts what the user or applications can do - * polkit - * Caps Lock key - * URIs for local files - - - -![Installing Inkscape on helloSystem][1] - -### How helloSystem Works - -I’d better explain a little about how helloSystem works. Just like MacOS, the desktop has a global menu at the top of the screen and a dock at the bottom. Also like MacOS’s Finder, helloSystem has a file manager (named Filer) that also handles window management. - -In the upper left, you’ll find a “System” menu that you can use to access applications. (You can also type the name of an application in the search box in the upper left corner.) helloSystem only has a couple of basic applications installed out of the box. If you click on an application that is not installed, helloSystem will download and install an AppImage of that application. - -Under the hood, helloSystem is based on FreeBSD 12.2. It has ZFS enable by default. It does not have a passwords or user account system. This doesn’t mean that they are disregarding security. According to the [site][10], “This is NOT to say that Security in general is not important. It is to say that it needs to be implemented in a way that it doesn’t restrict the legitimate user (owner) of the device from truly “owning” the device”. - -### New Features in the Latest Release - -![helloSystem’s Utilities window][1] - -This latest release of helloSystem includes quite a few graphical and minor changes and updates, including: - - * Switched from Openbox to the KWin window manager - * Properly centered window titles - * Windows snap to certain sizes when dragged to the edge of the screen, similar to “Aero Snap” - * Simplified user interface for Desktop Settings; changes are now applied immediately - * Remove tabs in file manager to simplify user interface - * New Battery applet for the Menu to show the battery fill level - * The Trash icon on the Desktop no longer has a “Move to Trash” context menu item - * Animation when minimizing and un-minimizing windows - * Animations on window resize - * Tuned kernel configuration for optimized sound - * Simplified “Get Info” dialog in file manager - - - -You can see the rest of the changes [here][11]. You can also download the latest .iso file from the same link. Give it a try and let us know what you think. - -#### 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/hellosystem-towards-first-release/ - -作者:[John Paul Wohlscheid][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/john/ -[b]: https://github.com/lujun9972 -[1]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjU4NSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= -[2]: https://github.com/helloSystem/hello -[3]: https://itsfoss.com/appimage-interview/ -[4]: https://github.com/probonopd -[5]: https://medium.com/@probonopd/bring-back-the-ease-of-80s-and-90s-personal-computing-393738c5e2a1 -[6]: https://github.com/helloSystem/hello/wiki#design-principles -[7]: https://hellosystem.github.io/docs/ -[8]: https://fosdem.org/2021/schedule/event/hello_bsd/ -[9]: https://suckless.org/sucks/ -[10]: https://github.com/helloSystem/hello/wiki/Welcome-and-unwelcome-technologies -[11]: https://github.com/helloSystem/ISO/releases/tag/r0.6.0 diff --git a/translated/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md b/translated/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md new file mode 100644 index 0000000000..22a8e6ac2e --- /dev/null +++ b/translated/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md @@ -0,0 +1,111 @@ +[#]: subject: "helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release" +[#]: via: "https://news.itsfoss.com/hellosystem-towards-first-release/" +[#]: author: "John Paul Wohlscheid https://news.itsfoss.com/author/john/" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +helloSystem:一款类似 Mac 的 FreeBSD 系统 +====== + +![](https://i1.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-system-bsd.jpg?w=1200&ssl=1) + +最近,helloSystem 的开发者发布了他们操作系统的最新版本。helloSystem 是一个较新的项目,希望以 FreeBSD 为基础创建一个简单易用的操作系统。让我们来看看这对你我意味着什么。 + +### helloSystem 简介 + +![helloSystem 的关于屏幕][1] + +你们中的大多数人可能以前从未听说过 [helloSystem][2]。该项目是由 [AppImage 的创建者][3] [Simon Peter][4] 在去年年初启动的。Simon 的目标是创建一个“友好的 [自由桌面][5] 操作系统,重点是简单、简约优雅和可用性。” + +Simon 从上世纪 80 、90 年代更为简单的操作系统中获得了灵感,特别是 **早期的 MacOS**,比如 [System 1][6]。如果你只是看一下系统运行的截图,你可能会想说,“我不明白这有什么好大惊小怪的。有一堆 Linux 发行版或主题,看起来就像 MacOS。” + +该项目不仅仅是看起来像 MacOS,它想回归到更简单、更容易使用的设计。据 [其网站][7] 上讲,“helloSystem 是一个面向创作者的桌面系统,注重简单、优雅和实用性。它的设计遵循 ‘少而精’ 的理念。它的目的是为 ‘普通人’ 提供一个系统,欢迎从 Mac 切换过来的人”。你可以通过观看 Simon 在 [FOSDEM 21][8] 上的演讲,了解更多关于他对 helloSystem 计划的想法。 + +就像 [Suckless 项目][9] 一样,Simon 创建了一个 “[欢迎和不欢迎的技术][10]” 列表。被批准的技术清单包括: + + * Qt + * mDNSResponder + * Python + * Go + +![helloSystem 的欢迎屏幕][12] + +“不受欢迎的技术”清单包括 Simon 认为“太复杂或被认为不美观”的东西。这些技术包括: + + * 触摸 + * btrfs + * Gnome + * GTK + * 客户端窗口装饰 + * Wayland + * Pipewire + * XDG 桌面规范 + * 与原始字体在度量上兼容的字体,但不试图在视觉上与原始字体相似 + * 最终用户应用程序的包管理器 + * 配置文件、IP 地址 + * D-Bus + * 通过限制用户或应用程序可以做的事情而提供的安全性 + * Polkit + * 大写锁定键 + * 本地文件的 URI + +![在 helloSystem 上安装 Inkscape][13] + +### helloSystem 如何工作 + +我最好解释一下 helloSystem 的工作方式。就像 MacOS 一样,桌面在屏幕顶部有一个全局菜单,底部有一个 Dock。与 MacOS 的 Finder 一样,helloSystem 也有一个文件管理器(名为 Filer),它也负责窗口管理。 + +在左上方,你会发现一个 “系统System” 菜单,你可以用它来访问应用程序。(你也可以在左上角的搜索框中输入应用程序的名称。)helloSystem 只安装了几个开箱即用的基本应用程序。如果你点击一个未安装的应用程序,helloSystem 会下载并安装该应用程序的 AppImage。 + +helloSystem 基于 FreeBSD 12.2。它默认启用了 ZFS。它没有密码或用户账户系统,但这并不意味着他们无视安全。据 [其网站][10] 讲,“这并不是说一般的安全问题不重要。而是说它需要以一种不会限制设备的合法用户(所有者)真正 ‘拥有’ 该设备的方式来实现。” + +### 最新版本中的新功能 + +![helloSystem 的实用程序窗口][14] + +最新版本的 helloSystem 包括不少图形方面的更新和小的变化,包括: + + * 从 Openbox 切换到 KWin 窗口管理器 + * 合理的窗口标题居中 + * 当窗口被拖到屏幕边缘时,会缩放到一定大小,类似于 “Aero Snap”。 + * 简化了 “桌面设置Desktop Settings” 的用户界面;现在更改会立即应用 + * 移除文件管理器中的标签以简化用户界面 + * 为菜单添加新的电池小程序,以显示电池充电量 + * 桌面上的垃圾箱图标不再有 “移动到垃圾箱Move to Trash” 的上下文菜单项 + * 最小化窗口和取消最小化窗口时的动画 + * 窗口大小调整时的动画 + * 调整内核配置以优化声音 + * 简化了文件管理器中的 “获取信息Get Info” 对话框 + +你可以在 [这里][11] 看到其余的变化。你也可以从同一个链接下载最新的 .iso 文件。试一试,让我们知道你的想法。 + +-------------------------------------------------------------------------------- + +via: https://news.itsfoss.com/hellosystem-towards-first-release/ + +作者:[John Paul Wohlscheid][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/john/ +[b]: https://github.com/lujun9972 +[1]: https://i2.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-about.jpg?w=850&ssl=1 +[2]: https://github.com/helloSystem/hello +[3]: https://itsfoss.com/appimage-interview/ +[4]: https://github.com/probonopd +[5]: https://medium.com/@probonopd/bring-back-the-ease-of-80s-and-90s-personal-computing-393738c5e2a1 +[6]: https://github.com/helloSystem/hello/wiki#design-principles +[7]: https://hellosystem.github.io/docs/ +[8]: https://fosdem.org/2021/schedule/event/hello_bsd/ +[9]: https://suckless.org/sucks/ +[10]: https://github.com/helloSystem/hello/wiki/Welcome-and-unwelcome-technologies +[11]: https://github.com/helloSystem/ISO/releases/tag/r0.6.0 +[12]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-welcome.jpg?w=850&ssl=1 +[13]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-install.jpg?w=850&ssl=1 +[14]: https://i0.wp.com/news.itsfoss.com/wp-content/uploads/2021/10/hello-utillities.jpg?w=850&ssl=1 \ No newline at end of file From 580f710770e144a7cdec696d14c4e5bb268fab54 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Sun, 24 Oct 2021 10:46:05 +0800 Subject: [PATCH 0807/1588] PUB @wxy https://linux.cn/article-13915-1.html --- ...e FreeBSD OS, Takes Another Step Towards Full Release.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) rename {translated/news => published}/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md (98%) diff --git a/translated/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md b/published/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md similarity index 98% rename from translated/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md rename to published/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md index 22a8e6ac2e..7aecb41222 100644 --- a/translated/news/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md +++ b/published/20211016 helloSystem, the Mac-like FreeBSD OS, Takes Another Step Towards Full Release.md @@ -3,9 +3,9 @@ [#]: author: "John Paul Wohlscheid https://news.itsfoss.com/author/john/" [#]: collector: "lujun9972" [#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13915-1.html" helloSystem:一款类似 Mac 的 FreeBSD 系统 ====== From d50279588904d5276919517e8b012463cf3dfdd6 Mon Sep 17 00:00:00 2001 From: Patrick Zeng Date: Sun, 24 Oct 2021 16:09:15 +0800 Subject: [PATCH 0808/1588] =?UTF-8?q?=E7=94=B3=E8=AF=B7=E7=BF=BB=E8=AF=91?= =?UTF-8?q?=207=20handy=20tricks=20for....=20(#23631)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: patrick.zeng --- .../20211021 7 handy tricks for using the Linux wget command.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211021 7 handy tricks for using the Linux wget command.md b/sources/tech/20211021 7 handy tricks for using the Linux wget command.md index 7ae4828e3c..705a424528 100644 --- a/sources/tech/20211021 7 handy tricks for using the Linux wget command.md +++ b/sources/tech/20211021 7 handy tricks for using the Linux wget command.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/linux-wget-command" [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "zengyi1001" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 42039e7786c8330d44ba33de303c1bfb26a032cb Mon Sep 17 00:00:00 2001 From: MjSeven Date: Sun, 24 Oct 2021 19:26:47 +0800 Subject: [PATCH 0809/1588] Translating --- sources/tech/20200629 Scaling a GraphQL Website.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200629 Scaling a GraphQL Website.md b/sources/tech/20200629 Scaling a GraphQL Website.md index 5389594701..5434cc1032 100644 --- a/sources/tech/20200629 Scaling a GraphQL Website.md +++ b/sources/tech/20200629 Scaling a GraphQL Website.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (MjSeven) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 41e434310dc05f7c4f89dd992ca09d84abd6c399 Mon Sep 17 00:00:00 2001 From: unigeorge <40418272+unigeorge@users.noreply.github.com> Date: Sun, 24 Oct 2021 20:40:56 +0800 Subject: [PATCH 0810/1588] translated --- ...10911 Play with model trains in OpenTTD.md | 206 ------------------ ...10911 Play with model trains in OpenTTD.md | 199 +++++++++++++++++ 2 files changed, 199 insertions(+), 206 deletions(-) delete mode 100644 sources/tech/20210911 Play with model trains in OpenTTD.md create mode 100644 translated/tech/20210911 Play with model trains in OpenTTD.md diff --git a/sources/tech/20210911 Play with model trains in OpenTTD.md b/sources/tech/20210911 Play with model trains in OpenTTD.md deleted file mode 100644 index f04db160a7..0000000000 --- a/sources/tech/20210911 Play with model trains in OpenTTD.md +++ /dev/null @@ -1,206 +0,0 @@ -[#]: subject: "Play with model trains in OpenTTD" -[#]: via: "https://opensource.com/article/21/9/model-trains-openttd" -[#]: author: "Seth Kenlon https://opensource.com/users/seth" -[#]: collector: "lujun9972" -[#]: translator: "unigeorge" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Play with model trains in OpenTTD -====== -Don't have room for a physical model train set? Try virtual trains with -OpenTTD. -![Old train][1] - -My father has always been fond of model trains, and I remember watching him building a track around the Christmas tree when I was young. When [Lego][2] train sets were released, he and I transitioned to them for their convenience and inherent extensibility. We built and operated Lego trains and monorail tracks over the course of many years. I've often imagined a possible future in which I have a garage or a basement dedicated to miniature landscapes and electric whistling trains. Then again, the probability of me diving that severely into yet another hobby is pretty low, so I was very happy to discover that _virtual_ model railways can provide me with much of the same satisfaction. The engine for my virtualized hobby is [OpenTTD][3], an open source simulation game based on an old '90s game called **Transport Tycoon Deluxe**. - -### Installing OpenTTD - -You can download OpenTTD for Linux, macOS, and Windows from [openttd.org/downloads][4]. - -If you're running Debian Linux or one of its derivatives, or even [running it on a Chromebook][5], you can download the `.deb` package. Install it with `apt`: - - -``` -`$ sudo apt install ./openttd*deb` -``` - -If you're using any other Linux distribution, download the generic installer and extract the package with [the `tar command`][6]: - - -``` -`$ tar xvf openttd-x.yy.z-linux*.tar.xz` -``` - -OpenTTD is also available on [Steam][7] for Linux, macOS, and Windows (Steam isn't open source, but it's a common cross-platform gaming client). - -### Launch OpenTTD - -If you installed OpenTTD, you can launch it from your application menu. - -If you're downloaded the generic package, change into the directory and launch the game using the local `openttd` command: - - -``` -$ cd openttd* -$ ./openttd & -``` - -The first time you launch OpenTTD, it alerts you that you must download a graphic set. This is automatically installed in the Steam edition, but it's a single-click in the stand-alone app. And anyway, because OpenTTD is open source, it's well modded, so you'll end up downloading a lot more than just the default graphics. - -After the graphics have been downloaded, you're presented with the quaintly diminutive interface. I find a 640x480 interface a little small, and while the old graphics do hearken back to simpler computing days, a slight upgrade for modern screens is helpful. For that reason, your first stop is the **Check online content** button. - -### Loading mods - -The **Content downloading** screen provides you with a window to approved OpenTTD mods, giving improved graphics, new music, train models, and map names appropriate to your location or interests. I use the New Zealand set, so all of my generated cities sound familiar, although, since 2020, I've started using the Fallout 3 set. There are _a lot_ of mods, so use the search bar in the top right to narrow your choices. - -Here are the mods I consider essential: - - * **abase** \- High res graphics. At nearly 300 MB, this is the largest download you're likely to need (the game itself is barely 50 MB). - * **OpenSFX** \- A sound set so you can hear the traffic in cities, the horns of the boating industry, and the very satisfying whistles of trains. - * **Town names** \- The default names of cities are fun, but I find it easier to remember names that feel local. - * **Trains** \- OpenTTD has a default set of train models that work perfectly well, but if you're a trainspotter already, then you might enjoy downloading some additional train sets. I use the NZR set, but there are many trains available, including trains from the UK, the USA, Austria, Belgium, Czech Republic, and on and on down the alphabet. - * **Beginner tutorial** \- A scenario to help you learn the game and its interface. - - - -### Game engine defaults - -Once you download your new assets, you must set them as your defaults. There are two places for this: Game engine defaults and in-game scripts and assets. - -![OpenTTD main menu][8] - -The OpenTTD menu (Seth Kenlon, [CC BY-SA 4.0][9]) - -Click the **Game Options** button. In the **Game Options** screen, adjust these settings: - - * Set the **screen resolution** to your preferred interface size. - * Set **base graphics set** to **abase.** - * Set **base sounds set** to **OpenSFX.** - - - -Close the **Game Options** screen. Your changes are saved automatically. - -### Game options - -From the main menu screen, click the **NewGRF Settings** button. - -![NewGRF settings window][10] - -The NewGRF settings menu (Seth Kenlon, [CC BY-SA 4.0][9]) - -Inactive mods are listed at the bottom of the **NewGRF Settings** window. To activate one, select it and click the **Add** button in the bottom left. Once you've chosen the mods to activate, click the **Apply** button. - -### Tutorial - -If you downloaded the **Beginner tutorial** scenario, you could learn OpenTTD by playing through it. To start the tutorial, click the **Play scenario** button near the top of the main menu screen. Select the tutorial and begin. - -The tutorial gives you a full tour of the game's interface, and it takes some time to get through it. - -### Quickstart - -By way of a quicker introduction, here's what you need to know: vehicles come from depots, and everything needs a schedule. By remembering those two rules, you can start building trains (and roads and seaports and airports) right away. - -#### **Build stations** - -To build a simple rail line between two cities, click the railway track icon in the top icon bar. - -![New icon bar - railway option][11] - -The new icon bar - railway option (Seth Kenlon, [CC BY-SA 4.0][9]) - -Railways start and end with stations, so I usually place a station at each end of my intended line. Click the train station icon (mouse over it to see its label). For a train station to serve a region, its area of effect must overlap with as much of the region as possible. To see a station's coverage, enable **Coverage area highlight** by clicking the **On** button at the bottom of the station dialog box. - -![Station coverage window][12] - -Station coverage information window (Seth Kenlon, [CC BY-SA 4.0][9]) - -The dark grid overlay represents coverage, while the white grid overlay shows the physical footprint of the station. As you hover over an area, the supplies that a station's coverage enables are listed in the station popup window. Start simple and create a single-track, 4-car platform. Do this twice between two cities on the map. - -![create station menu][13] - -The create station menu (Seth Kenlon, [CC BY-SA 4.0][9]) - -### Lay the rails - -Next, connect the stations with rails. The isometric view of OpenTTD takes some getting used to, but after clicking on the rail icons and clicking and dragging on the map, you start to get a feel for it. The X-rail icon provides an "autorail" mode, which aligns the track based on where in a square you click. - -Be careful as you lay your rails. OpenTTD is rather unforgiving, so once you click in a square, rails are constructed. You must use the dynamite icon to remove rails. Just like in real life, there's no undo button. - -### Train depot - -Trains come from a depot. So to add a train to your railway, you must add a depot somewhere along the line. Click the depot icon and place a depot near an existing rail. Connect the depot to an existing track to ensure your trains can get from the depot to the appropriate (in this simple example, the only) line. - -![create depot menu][14] - -The create depot menu (Seth Kenlon, [CC BY-SA 4.0][9]) - -### Model trains - -At long last, you get to add a virtual model train to your virtual railway. To create a train, click on your depot. - -Click the **New Vehicle** button at the bottom of the depot window to list available train engines and cars. The list you get depends partly on what models you've added from the downloadable content. Generally, there are three types of engines: Steam, diesel, and electric. Early in the game, which starts in the year 1950, you have only steam. As the years progress, you get innovative new models you can use as upgrades. - -![create train menu][15] - -The create train menu (Seth Kenlon, [CC BY-SA 4.0][9]) - -For now, create a simple train that includes an engine, a passenger car, and a mail car. If you want to add other kinds of cars, click on your stations to confirm the types of supplies they're able to accept (as determined by its area of coverage). - -### Create a train schedule - -Now that you have a railway and a train, you must create a train schedule. Schedules are attached to vehicles, so any time you add a new vehicle of any kind, you must add a schedule for it to be useful. - -To add a schedule to your train, click the number to the left of the train in its depot listing. This opens a viewport for the train, with buttons along the right side of the window. Click the arrow icon to see that train's schedule. - -![create schedule menu][16] - -The create schedule menu (Seth Kenlon, [CC BY-SA 4.0][9]) - -To create a schedule, click the **Go To** button at the bottom of the schedule window, and then click on the station you want to set as the first destination. Then click the next station. You can adjust loading and unloading requirements by selecting a stop in the schedule and browsing the options in the **Full load** and **Unload** drop-down menus, and you can adjust routes (should you develop new routes) in the **Non-stop** drop-down menu. The options are plentiful, and as cities grow and your map becomes more developed, you may have to adjust your strategy. - -But for now, click the red **Stopped** button at the bottom of your train viewport to put your train into service! - -![train moving from station to station][17] - -Train in service (Seth Kenlon, [CC BY-SA 4.0][9]) - -### Try OpenTTD - -OpenTTD is a simulator, but it's also a game, so you do have constraints, including a budget and parameters you might want to optimize. For instance, you can click on a city, farm, or factory to discover what kind of imports and exports are acceptable to it. You can borrow money by clicking the budget button in the bottom right corner of the OpenTTD window. And it's not just a virtual train set. You can build roads, airports, seaports, and more. Just remember that all vehicles need depots and schedules, and you're halfway to a successful virtual enterprise. - -OpenTTD has an active and enthusiastic community, [an extensive wiki][18], and there are lots of resources and tutorials available online. Download the game and give it a try! - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/9/model-trains-openttd - -作者:[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/train-plane-speed-big-machine.png?itok=f377dXKs (Old train) -[2]: https://opensource.com/article/20/6/open-source-virtual-lego -[3]: http://openttd.org -[4]: https://www.openttd.org/downloads/openttd-releases/latest.html -[5]: https://opensource.com/article/21/2/chromebook-linux -[6]: https://opensource.com/article/17/7/how-unzip-targz-file -[7]: https://store.steampowered.com/app/1536610/OpenTTD/ -[8]: https://opensource.com/sites/default/files/openttd-menu.jpg (OpenTTD menu) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://opensource.com/sites/default/files/openttd-newgrf.jpg (The NewGRF settings menu) -[11]: https://opensource.com/sites/default/files/openttd-iconbar-railway.jpg (The new icon bar - railway option) -[12]: https://opensource.com/sites/default/files/openttd-window-station.jpg (Station coverage information window) -[13]: https://opensource.com/sites/default/files/openttd-create-station.jpg (The create station menu) -[14]: https://opensource.com/sites/default/files/openttd-create-depot.jpg (Create depot menu) -[15]: https://opensource.com/sites/default/files/openttd-create-train.jpg (The create train menu) -[16]: https://opensource.com/sites/default/files/openttd-create-schedule.png (The create schedule menu) -[17]: https://opensource.com/sites/default/files/openttd-train.jpg (Train in service) -[18]: https://wiki.openttd.org/en/ diff --git a/translated/tech/20210911 Play with model trains in OpenTTD.md b/translated/tech/20210911 Play with model trains in OpenTTD.md new file mode 100644 index 0000000000..4b510e93ea --- /dev/null +++ b/translated/tech/20210911 Play with model trains in OpenTTD.md @@ -0,0 +1,199 @@ +[#]: subject: "Play with model trains in OpenTTD" +[#]: via: "https://opensource.com/article/21/9/model-trains-openttd" +[#]: author: "Seth Kenlon https://opensource.com/users/seth" +[#]: collector: "lujun9972" +[#]: translator: "unigeorge" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +在 OpenTTD 中玩模型火车 +====== + +想玩实体模型火车,却没有足够大的空间?试试 OenTTD 中的虚拟火车吧。 +![Old train][1] + +我父亲一直很喜欢火车模型,我记得我小时候,曾看着他在圣诞树周围建了一整条轨道。当[乐高][2]火车套装发布时,因其便利性和固有可扩展性,我们转而投向了乐高火车的怀抱。多年来,我们热衷于建造和改装乐高火车及单轨轨道。我经常想象,未来我会有一个车库或地下室,专门用于微型景观和电动汽笛火车。强调一下,我沉迷于另一个爱好的可能性非常低,所以当发现 _虚拟_ 模型铁路可以为我提供相同的满足感时,我很开心。我的虚拟爱好引擎是 [OpenTTD][3],这是一款基于名为 **Transport Tycoon Deluxe** 的 90 年代老游戏的开源模拟游戏。 + +### 安装 OpenTTD + +你可以在 [openttd.org/downloads][4] 下载适用于 Linux、macOS 和 Windows 的 OpenTTD。 + +如果你正使用 Debian Linux 或其衍生产品,甚至是[在使用 Chromebook][5],你可以下载 `.deb` 包。使用 `apt` 命令安装它: + +``` +$ sudo apt install ./openttd*deb +``` + +如果你在使用其他 Linux 发行版,请下载通用安装程序,并使用 [`tar` 命令][6]解压缩包: + +``` +$ tar xvf openttd-x.yy.z-linux*.tar.xz +``` + +OpenTTD 已经在 Linux、macOS 和 Windows 的 [Steam][7] 中上架(Steam 是一个非开源的,但是很常见的跨平台游戏客户端)。 + +### 启动 OpenTTD + +如果你安装了 OpenTTD,可以从应用程序菜单启动它。 + +如果你是下载了通用包,可以切换到游戏目录,使用本地的 `openttd` 命令启动游戏: + +``` +$ cd openttd* +$ ./openttd & +``` + +首次启动 OpenTTD 时,游戏会提示必须下载图形集,在 Steam 版中会自动安装,但在独立应用程序中需要单击一下鼠标。无论如何,因为 OpenTTD 是开源的,经过了很好的改进,所以在默认图形之外,你最终还会下载的还有很多其他图形。 + +下载图形集后,你会看到一个古色古香的小型界面。我觉得 640x480 的界面有点小,虽然旧图形界面确实更有年代感(那时计算能力还比较弱),但一些适配现代屏幕的轻度升级还是很好用的。因此,您的第一步操作就是点击“**检查在线内容**Check online content”按钮。 + +### 加载模组 + +“**内容下载**Content downloading”界面是一个查看已通过审查的 OpenTTD 模组mod的窗口,可以提供个性化的改进图形界面、全新音乐、火车模型和地图名称。我使用了新西兰全套配置,所以对我来说,生成的所有城市都很熟悉,尽管 2020 年我转而开始使用“辐射 3”套装了。模组 _非常多_,可以使用右上角的搜索栏来缩小选择范围。 + +下面是一些个人认为必备的模组: + + * **abase** \- 高分辨率图形。将近 300 MB,这可能是你玩此游戏需要的最大一次下载(游戏本身只有 50 MB)。 + * **OpenSFX** \- 一个声音合集。让你能听到城市中的交通声、船运的喇叭声以及很棒的火车汽笛声。 + * **Town names** \- 城镇名称。默认的城市名称很有趣,但我认为记一些本地化的名称更容易。 + * **Trains** \- 火车模组。OpenTTD 有一组运行良好的默认火车模型,但如果你已经是一名火车观察员,那你可能会喜欢下载一些额外的火车模型。我使用的是 NZR 火车合集,但还有很多火车也是可用的,包括来自英国、美国、奥地利、比利时、捷克共和国的车,以及按字母表顺序排列的许多其他火车。 + * **Beginner tutorial** \- 新手教程。是一个帮你学习游戏及界面的引导场景。 + +### 游戏引擎默认值 + +下载新“资产”后,你需要将它们设置为默认值。有两个设置的地方:游戏引擎默认值、游戏内脚本与资产。 + +![OpenTTD main menu][8] + +OpenTTD 菜单(Seth Kenlon, [CC BY-SA 4.0][9]) + +单击“**游戏选项**Game Options”按钮。 在**游戏选项**屏幕中,调整以下设置: + + * 将**屏幕分辨率**screen resolution设置为你喜欢的界面尺寸。 + * 将**基础图形集** base graphics set设置为 **abase**。 + * 将**基础声音设置**base sounds set设置为 **OpenSFX**。 + +关闭**游戏选项**屏幕。你的改动会自动保存。 + +### 游戏选项 + +在主菜单界面,单击“**NewGRF 设置**NewGRF Settings”按钮。 + +![NewGRF settings window][10] + +NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) + +未活动的模组显示在 **NewGRF 设置**窗口的下半部分。要激活一个未活动的模组,请选择它并单击左下角的“**添加**Add”按钮。选择要激活的模组后,再单击“**应用**Apply”按钮。 + +### 教程 + +如果你下载了“**初学者教程**Beginner tutorial”场景,可以通过它来学习 OpenTTD。开始教程请单击主菜单屏幕顶部附近的“**播放场景**Play scenario” 按钮,然后选择该教程并开始。 + +初学者教程有着游戏界面的完整浏览流程,全部完成需要花费一些时间。 + +### 快速开始 + +现在我们快速介绍一下,此处你要了解以下内容:车辆出自仓库,一切活动都需要时间表。记住这两条规则,你可以立即开始建造火车(以及道路、海港和机场)。 + +#### **建造车站** + +要在两个城市之间建立一条简单的铁路线,请单击顶部图标栏中的铁路轨道图标。 + +![New icon bar - railway option][11] + +新建图标栏——铁路选项(Seth Kenlon, [CC BY-SA 4.0][9]) + +铁路以车站开始和结束,所以我通常在预定线路的两端各放置一个车站。单击火车站图标(将鼠标悬停在其上方可查看其标签)。一个火车站要服务于一个地区,其作用范围必须与该地区尽量多地重叠。要查看车站的覆盖范围,请通过单击车站对话框底部的“**开启**On”按钮以启用**覆盖区域高亮**Coverage area highlight功能。 + +![Station coverage window][12] + +车站覆盖信息窗口(Seth Kenlon, [CC BY-SA 4.0][9]) + +黑色网格表示覆盖范围,而白色网格显示车站的物理占据范围。当你将鼠标悬停在一个区域上时,车站的覆盖范围所需耗材会在弹出窗口中列出。从简单的开始,创建一个单轨 4 辆车的站台。在地图上的两个城市之间重复执行此操作两次。 + +![create station menu][13] + +创建车站菜单(Seth Kenlon, [CC BY-SA 4.0][9]) + +### 铺设铁轨 + +接下来,用铁轨连接车站。 OpenTTD 的等距视图需要一些时间来适应,但是在单击铁路图标并在地图上单击拖动之后,你就开始大概有所了解了。X-rail 图标提供了“自动轨道”模式,该模式会根据用户单击的方块位置对齐轨道。 + +铺设导轨时要细心。OpenTTD 是不可撤回的,所以一旦点击一个正方形,轨道就会被构造出来。你必须使用炸药图标来移除导轨。和现实生活中一样,没有撤消按钮。 + +### 火车车库 + +火车来自车库depot。因此,要在铁路上添加火车,必须在沿线的某处添加一个车库。单击车库图标并在现有铁路附近放置。将车库连接到现有轨道,以确保您的火车可以从车库到达适当线路的(在此简单示例中,线路是唯一的)。 + +![create depot menu][14] + +建造车库菜单(Seth Kenlon, [CC BY-SA 4.0][9]) + +### 模型火车 + +终于,你可以将虚拟模型火车添加到虚拟铁路中了。要创建火车,请单击车库。 + +单击站点窗口底部的“**新建车辆**New Vehicle”按钮,会列出可用的火车引擎和汽车。列表会部分取决于你从可下载内容中添加的模型。一般来说,发动机分为三种:蒸汽发动机、柴油发动机和电动发动机。游戏内时间从 1950 年开始,所以早期你只有蒸汽可选。随着时间推进,你会获得可用于升级的创新型新模型。 + +![create train menu][15] + +创建火车菜单(Seth Kenlon, [CC BY-SA 4.0][9]) + +现在创建一个简单的火车,其中包括一节引擎、一节客车和一节邮车。如果想添加其他类型的车厢,请单击站点以确认它们的可提供车型(由其覆盖区域决定) + +### 创建火车时刻表 + +现在有了铁路和火车,还需要创建一个火车时刻表。时间表与车辆关联,因此无论何时添加新车,都要记得添加时间表,以让新车投入使用。 + +要为火车添加时刻表,请单击其车库列表中列车左侧的编号。这样可以打开火车视口,窗口右侧会有按钮。单击箭头图标即可查看该列车的时刻表。 + +![create schedule menu][16] + +创建时刻表菜单(Seth Kenlon, [CC BY-SA 4.0][9]) + +要创建时间表,请单击时间表窗口底部的“**前往**Go To”按钮,然后单击要设置成第一个目的地的车站。然后点击下一站。你可以在时间表中选择一个停靠点,浏览“**满载**Full load”和“**卸载**Unload”下拉菜单中的选项,以此调整装卸要求,并且可以在“**无停靠**Non-stop”下拉菜单中调整路线(如果开发了新路线)。选项有很多,随着城市发展和地图完善,你可能需要随时调整策略。 + +但是现在,单击火车视口底部的红色“**已停止**Stopped”按钮,让火车投入使用吧! + +![train moving from station to station][17] + +在役中的火车(Seth Kenlon, [CC BY-SA 4.0][9]) + +### 试试 OpenTTD 吧 + +OpenTTD 是一个模拟器,同时也是一个游戏,所以确实会有一些限制,比如你可能想要优化的预算和参数。例如,你可以单击一个城市、农场或工厂,了解其可接受的进出口类型。你可以通过单击 OpenTTD 窗口右下角的预算按钮来借钱。它不仅仅是一个虚拟的火车集合游戏。你还可以建造道路、机场、海港等。记得所有车辆都需要车库和时间表,你就在实现虚拟企业的路上成功了一半。 + +OpenTTD 有着活跃而热情的社区,以及[详细的维基][18],并且有大量的资源和教程在线可用。下载游戏并试试吧! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/9/model-trains-openttd + +作者:[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/train-plane-speed-big-machine.png?itok=f377dXKs (Old train) +[2]: https://opensource.com/article/20/6/open-source-virtual-lego +[3]: http://openttd.org +[4]: https://www.openttd.org/downloads/openttd-releases/latest.html +[5]: https://opensource.com/article/21/2/chromebook-linux +[6]: https://opensource.com/article/17/7/how-unzip-targz-file +[7]: https://store.steampowered.com/app/1536610/OpenTTD/ +[8]: https://opensource.com/sites/default/files/openttd-menu.jpg (OpenTTD menu) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://opensource.com/sites/default/files/openttd-newgrf.jpg (The NewGRF settings menu) +[11]: https://opensource.com/sites/default/files/openttd-iconbar-railway.jpg (The new icon bar - railway option) +[12]: https://opensource.com/sites/default/files/openttd-window-station.jpg (Station coverage information window) +[13]: https://opensource.com/sites/default/files/openttd-create-station.jpg (The create station menu) +[14]: https://opensource.com/sites/default/files/openttd-create-depot.jpg (Create depot menu) +[15]: https://opensource.com/sites/default/files/openttd-create-train.jpg (The create train menu) +[16]: https://opensource.com/sites/default/files/openttd-create-schedule.png (The create schedule menu) +[17]: https://opensource.com/sites/default/files/openttd-train.jpg (Train in service) +[18]: https://wiki.openttd.org/en/ From 8b2e42ba423526c6b0bad4d442fd118313da341b Mon Sep 17 00:00:00 2001 From: DarkSun Date: Mon, 25 Oct 2021 05:02:32 +0800 Subject: [PATCH 0811/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211024?= =?UTF-8?q?=20Open=20source=20gets=20dirty=20with=203D=20printing?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211024 Open source gets dirty with 3D printing.md --- ...Open source gets dirty with 3D printing.md | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) create mode 100644 sources/tech/20211024 Open source gets dirty with 3D printing.md diff --git a/sources/tech/20211024 Open source gets dirty with 3D printing.md b/sources/tech/20211024 Open source gets dirty with 3D printing.md new file mode 100644 index 0000000000..1d7937decc --- /dev/null +++ b/sources/tech/20211024 Open source gets dirty with 3D printing.md @@ -0,0 +1,75 @@ +[#]: subject: "Open source gets dirty with 3D printing" +[#]: via: "https://opensource.com/article/21/10/open-source-soil-science" +[#]: author: "Joshua Pearce https://opensource.com/users/jmpearce" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Open source gets dirty with 3D printing +====== +3D printing and open source technology enable advanced research for soil +science. +![Green sprout grass in dirt soil][1] + +Open source has touched a lot of scientific disciplines, but one area where it is missing is soil science. Until recently, you could only find it [in educational materials][2]. A team from the Université de Lorraine, INRAE in France, and Western University in Canada [bring open source to the soil science community][3]. + +Soil science experiments saw significant impact by the technological advances developed over the past decades. However, support for these experiments evolved very slowly, and soil science literally languished in the dirt. Researchers still take soil samples in the "traditional" way from specific fields. For this purpose, agricultural researchers determine which areas might contain the most suitable soil for an experiment in advance. This method leads to many approximations and uncontrolled parameters, which significantly complicates the analysis of the results. Thus, some studies require identical replicates. 3D printing offers an excellent opportunity to meet this need. + +![Collecting soil samples][4] + +Farmer-scientist field collaboration in collecting soil +and plant samples ([Flickr][5], [CC BY-NC-SA 4.0][6]) + +Modeling a porous structure for soil science must consider a combination of specifications (nature of the material, porosity, and location of specific substances or living organisms). In addition, using an engineering design approach improves the modeling process, and these become customizable and reproducible models—some of the bedrock properties of open source science. The model's main characteristics are identified and studied according to the complexity of the specific soil phenomena. With that modeling, you can achieve a design approach for defining a manufacturing process. + +One main challenge to support this design approach is developing software that allows soil scientists to create soil models according to their needs in terms of the soil structure. This software should be dedicated to scientific research and promote data sharing and exchange across an international community. + +Reproducing soil samples digitally helps academics and researchers conduct reproducible and participatory research networks that help better understand the specific soil parameters. One of the most critical challenges for soil modeling is the manufacturing of a soil structure. Until now, the most widespread method to replicate porous soil structures is using X-ray tomography to scan an actual sample. This process is expensive and time-consuming and does not readily provide an approach to customization. A new open source approach makes it possible for any soil scientist to design a porous soil structure. It is based on mathematical models rather than the dirty samples themselves—allowing researchers to design and parameterize their samples according to their desired experiments. + +![Settings and model of monolith with mix of different grain sizes][7] + +Settings and model of monolith with mix of different +grain sizes (Joshua Pearce, [CC BY-SA 4.0][8]) + +Developing an open source toolchain using a [Lua script][9], in the [IceSL][10] slicer with a GUI enables researchers to create and configure their digital soil models, called monoliths. Done without using meshing algorithms or STereoLithography (STL) files because those reduce the model's resolution.  + +Monolith examples are fabricated in polylactic acid using [open source fused filament fabrication technology][11] with a layer thickness of 0.20, 0.12, and 0.08 mm. The images generated from the digital model slicing are analyzed using open source [ImageJ][12] software. ImageJ provides information about internal geometrical shape (porosity, tortuosity, grain size distribution, and hydraulic conductivities). The results show that the developed script enables designing reproducible numerical models that imitate soil structures with defined pore and grain sizes in a range between coarse sand (from 1 mm diameter) to fine gravel (up to 12 mm diameter). + +![Monolith with offset root system][13] + +Monolith with offset root system  +(Joshua Pearce, [CC BY-SA 4.0][8]) + +Samples generated using the developed script would be expected to increase reproducibility and be more accessible because of the open source and low-cost methods involved. + +You can read the complete open access study here: [Open-Source Script for Design and 3D Printing of Porous Structures for Soil Science][14] by Romain Bedell, Alaa Hassan, Anne-Julie Tinet, Javier Arrieta-Escobar, Delphine Derrien, Marie-France Dignac, Vincent Boly, Stéphanie Ouvrard, and Joshua M. Pearce 2021, published in _Technologies_ 9, no. 3: 67. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/open-source-soil-science + +作者:[Joshua Pearce][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/jmpearce +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/roman-synkevych-unsplash.jpg?itok=lIeB57IW (Green sprout grass in dirt soil) +[2]: https://doi.org/10.4195/nse2017.06.0013 +[3]: https://doi.org/10.3390/technologies9030067 +[4]: https://opensource.com/sites/default/files/uploads/collecting_soil_samples.jpg (Collecting soil samples) +[5]: https://www.flickr.com/photos/cgiarclimate/38600771315/in/photostream/ +[6]: https://creativecommons.org/licenses/by-nc-sa/4.0/ +[7]: https://opensource.com/sites/default/files/uploads/monolith-w-mix-grain-sizes.png (Settings and model of monolith with mix of different grain sizes) +[8]: https://creativecommons.org/licenses/by-sa/4.0/ +[9]: https://github.com/RomainBedell/Porous_medium_generator +[10]: https://icesl.loria.fr/ +[11]: https://www.reprap.org/wiki/RepRap +[12]: https://imagej.nih.gov/ij/ +[13]: https://opensource.com/sites/default/files/uploads/monolith-w-offset-roots.png (Monolith with offset root system) +[14]: https://www.mdpi.com/2227-7080/9/3/67 From 7423c1502fa75611aec54b3557c7e0e9d47d7fec Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 25 Oct 2021 08:48:03 +0800 Subject: [PATCH 0812/1588] translated --- ...Terminal Client for Git Written in Rust.md | 100 ------------------ ...Terminal Client for Git Written in Rust.md | 100 ++++++++++++++++++ 2 files changed, 100 insertions(+), 100 deletions(-) delete mode 100644 sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md create mode 100644 translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md diff --git a/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md b/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md deleted file mode 100644 index 99a3479d17..0000000000 --- a/sources/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md +++ /dev/null @@ -1,100 +0,0 @@ -[#]: subject: "GitUI: A Blazing Fast Terminal Client for Git Written in Rust" -[#]: via: "https://itsfoss.com/gitui/" -[#]: author: "Marco Carmona https://itsfoss.com/author/marco/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -GitUI: A Blazing Fast Terminal Client for Git Written in Rust -====== - -The [basic Git commands][1] are good enough for the usual clone, add, commit push. - -But if you are working on a large project with multiple contributors, you may need to visualize things. A GUI tool gives a better view on the diff, stash and blame. - -But then, if you are a terminal dweller, who wants the comfort of GUI with Git, I have got a good tool for you. - -It is called GitUI and it provides user experience and comfort similar to a git GUI but right in your terminal. It is portable, fast, free and open source. - -### GitUI: A terminal based tool for Git - -[GitUI][2] is not the first Git client for Linux terminal. So, what makes GitUI different than other similar projects like [lazygit][3] or [tig][4]? - -GitUI developer has shared some benchmark in the README file of the project. - -| Time | Memory (GB) | Binary (MB) | Freezes | Crashes ----|---|---|---|---|--- -gitui | 24 s | 0.17 | 1.4 | No | No -lazygit | 57 s | 2.6 | 16 | Yes | Sometimes -tig | 4 m 20 s | 1.3 | 0.6 | Sometimes | No - -Comparison between GitUI, LazyGit, and Tig; simple user interfaces for Git - -Most of this optimization comes from the use of Rust programming language. - -_**Note: This program is in early stages of development and is not production ready yet.**_ - -### Installing GitUI on Linux - -Needless to say, you should have [Git installed on your system][5] already. - -To use GitUI, you need to [install Rust support for your Linux distribution][6] first. - -In a terminal, use the following command: - -``` -curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -``` - -![Installing Rust on Linux][7] - -Go with option 1 when you are asked for a choice. When script finishes installation, set the configuration right with this command: - -``` -source $HOME/.cargo/env -``` - -Now that you have Rust and its package manager Cargo installed, use the Cargo command to install GitUI: - -``` -cargo install gitui -``` - -And you’re ready to use GitUI, for that just type `gitui` in the terminal to run it. I made some sample files to play with Git and GitUI. - -![Starting gitui on terminal][8] - -It’s important to mention that the interface has a fast and intuitive keyboard-only control. Everything is as easy as type the correct letter to stage, commit, branch, or push your files into your git repository. - -Something that really gets me excited was that you can not only do the four actions before, but you can also **edit** each file, **pull** it, **blame** it, **navigate** inside it, and more things; everything without existing from the interface. Awesome, isn’t it? - -![More functions inside the interface][9] - -Felicitations! Now you know how to install GitUI and how it looks like in your terminal. - -If you like the project, start its repository on [GitHub][2]. If you use some other tool to manage Git, please suggest your favorite in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/gitui/ - -作者:[Marco Carmona][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/marco/ -[b]: https://github.com/lujun9972 -[1]: https://itsfoss.com/basic-git-commands-cheat-sheet/ -[2]: https://github.com/Extrawurst/gitui -[3]: https://github.com/jesseduffield/lazygit -[4]: https://jonas.github.io/tig/ -[5]: https://itsfoss.com/install-git-ubuntu/ -[6]: https://itsfoss.com/install-rust-cargo-ubuntu-linux/ -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Installing-Rust-step-1.png?resize=800%2C471&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Starting-GitUI-on-terminal.png?resize=800%2C471&ssl=1 -[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/More-functions-inside-the-interface.png?resize=800%2C471&ssl=1 diff --git a/translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md b/translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md new file mode 100644 index 0000000000..45785b2cfa --- /dev/null +++ b/translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md @@ -0,0 +1,100 @@ +[#]: subject: "GitUI: A Blazing Fast Terminal Client for Git Written in Rust" +[#]: via: "https://itsfoss.com/gitui/" +[#]: author: "Marco Carmona https://itsfoss.com/author/marco/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +GitUI: 用 Rust 编写的 Git 的快速命令行客户端 +====== + +[基本的 Git 命令][1] 对于通常的克隆、添加、提交推送已经足够好了。 + +但如果你在一个有多个贡献者的大型项目上工作,你可能需要将事情可视化。GUI 工具可以让你更好地了解 diff、stash 和 blame 的情况。 + +但是,如果你常用终端,想要 Git 的舒适性,我为你准备了一个好工具。 + +它叫 GitUI,它提供了类似于 Git GUI 的用户体验和舒适度,但就在你的终端中。它是可移植的、快速的、免费的和开源的。 + +### GitUI:一个基于终端的 Git 工具 + +[GitUI][2] 并不是第一个用于 Linux 终端的 Git 客户端。那么,是什么让 GitUI 与其他类似项目如 [lazygit][3] 或 [tig][4] 不同? + +GitUI 的开发者在项目的 README 文件中分享了一些基准数据。 + +| 时间 |内存(GB)| 二进制(MB)| 冻结 | 崩溃 +---|---|---|---|---|--- +gitui | 24 s | 0.17 | 1.4 | 否 | 否 +lazygit | 57 s | 2.6 | 16 | 是 | 有时 +tig | 4 m 20 s | 1.3 | 0.6 | 有时 | 否 + +GitUI、LazyGit 和 Tig 之间的比较。Git 的简单用户界面 + +这种优化大部分来自于 Rust 语言的使用。 + +_**注意:该程序处于早期开发阶段,还没有为生产做好准备。**_ + +### 在 Linux 上安装 GitUI + +不用说,你应该已经[在你的系统上安装了 Git][5]。 + +要使用 GitUI,首先需要 [为你的 Linux 发行版安装 Rust 支持][6]。 + +在终端中,使用以下命令: + +``` +curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh +``` + +![Installing Rust on Linux][7] + +当你被要求选择时,请选择选项 1。当脚本完成安装后,用这个命令正确设置配置: + +``` +source $HOME/.cargo/env +``` + +现在你已经安装了 Rust 和它的包管理器 Cargo,使用 Cargo 命令来安装 GitUI: + +``` +cargo install gitui +``` + +然后你就可以使用 GitUI了,只需在终端输入 `gitui`就可以运行了。我做了一些示例文件来测试 Git 和 GitUI。 + +![Starting gitui on terminal][8] + +值得一提的是,这个界面有一个快速而直观的纯键盘控制。一切都很简单,只需输入正确的字母即可将文件暂存、提交、分支或推送到 git 仓库中。 + +真正让我兴奋的是,你不仅可以做之前的四个动作,还可以**编辑**每个文件,**拉取**它,**blame** 它,在其中**导航**等等,这一切都无需退出界面。 很棒,不是吗? + +![More functions inside the interface][9] + +祝贺你! 现在你知道了如何安装 GitUI 以及它在你的终端中的样子。 + +如果你喜欢这个项目,请在 [GitHub][2] 上启动它的仓库。如果你使用其他工具来管理 Git,请在评论区提出你的建议。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/gitui/ + +作者:[Marco Carmona][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/marco/ +[b]: https://github.com/lujun9972 +[1]: https://itsfoss.com/basic-git-commands-cheat-sheet/ +[2]: https://github.com/Extrawurst/gitui +[3]: https://github.com/jesseduffield/lazygit +[4]: https://jonas.github.io/tig/ +[5]: https://itsfoss.com/install-git-ubuntu/ +[6]: https://itsfoss.com/install-rust-cargo-ubuntu-linux/ +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Installing-Rust-step-1.png?resize=800%2C471&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/Starting-GitUI-on-terminal.png?resize=800%2C471&ssl=1 +[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/More-functions-inside-the-interface.png?resize=800%2C471&ssl=1 From 244035c589467d81f42831a6b5d87a4177465434 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 25 Oct 2021 08:53:12 +0800 Subject: [PATCH 0813/1588] translating --- ... Xubuntu and Other Distros Using Xfce Desktop Environment.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md b/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md index 2e32e3470e..16eccaf8fd 100644 --- a/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md +++ b/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-themes-xfce-xubuntu/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 8ae86ff1b3f44a3a49ec75e63b82692e17f7e9f8 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 25 Oct 2021 10:19:52 +0800 Subject: [PATCH 0814/1588] PRF&PUB @geekpi https://linux.cn/article-13918-1.html --- ...stics with this Linux command-line tool.md | 61 ++++++++----------- 1 file changed, 25 insertions(+), 36 deletions(-) rename {translated/tech => published}/20211018 Get memory use statistics with this Linux command-line tool.md (61%) diff --git a/translated/tech/20211018 Get memory use statistics with this Linux command-line tool.md b/published/20211018 Get memory use statistics with this Linux command-line tool.md similarity index 61% rename from translated/tech/20211018 Get memory use statistics with this Linux command-line tool.md rename to published/20211018 Get memory use statistics with this Linux command-line tool.md index fc79aaedd6..be81b26066 100644 --- a/translated/tech/20211018 Get memory use statistics with this Linux command-line tool.md +++ b/published/20211018 Get memory use statistics with this Linux command-line tool.md @@ -3,71 +3,64 @@ [#]: author: "Tomasz Waraksa https://opensource.com/users/tomasz" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13918-1.html" -用这个 Linux 命令行工具获取内存使用统计信息 +用 smem 命令获取内存使用统计信息 ====== -smem 命令允许你快速查看你的 Web 应用的内存使用情况。 -![Programming at a browser, orange hands][1] -在我的编程工作中,我经常需要了解网络应用的内存使用情况。在深入研究细节和浏览器剖析工具之前,一个粗略的估计通常就足够了。 +> smem 命令允许你快速查看你的网页应用的内存使用情况。 -为了询问 Linux 或 macOS 上的内存使用情况,人们通常使用 [top][2] 或 [htp][3]。我很想看到一个单一的数字:一个进程占用了多少内存。但这些工具所显示的统计数据可能很难理解。对于网络浏览器来说,它甚至更加复杂,因为它们经常运行许多独立的进程。它们都在 top 输出中显示为一个长长的列表,每一个都有自己的单独指标。 +![](https://img.linux.net.cn/data/attachment/album/202110/25/101843emjjkmvk88gvyqgv.jpg) + +在我的编程工作中,我经常需要了解网页应用的内存使用情况。在深入研究细节和浏览器剖析工具之前,一个粗略的估计通常就足够了。 + +为了了解 Linux 或 macOS 上的内存使用情况,人们通常使用 [top][2] 或 [htop][3]。我很想看到一个单一的数字:一个进程占用了多少内存。但这些工具所显示的统计数据可能很难理解。对于网页浏览器来说,它甚至更加复杂,因为它们经常运行许多独立的进程。它们在 `top` 输出中显示为一个长长的列表,每一个都有自己的单独指标。 ![Memory usage using htop][4] -(Tomasz Waraksa, [CC BY-SA 4.0][5]) - -### 输入 smem 命令 +### smem 命令 幸运的是有 [smem][6],另一个用于查看内存使用统计的命令行工具。用你选择的包管理器安装它,例如: - ``` -`sudo apt install smem` +sudo apt install smem ``` 要获得 [Firefox][7] 的总内存使用量,请执行: - ``` -`smem -c pss -P firefox -k -t | tail -n 1` +smem -c pss -P firefox -k -t | tail -n 1 ``` -这里发生了什么? +这些开关做了什么? - * `-c` 开关指定要显示的列。我只对 _pss_ 列感兴趣,它显示一个进程分配的内存。 - * `-P` 开关过滤进程,只包括那些名字里有 _firefox_ 的进程。 - * `-k` 开关显示以 MB/GB 为单位的内存使用情况,而不是单纯的字节数 - * `-t` 开关显示总数 + * `-c` 开关指定要显示的列。我只对 `pss` 列感兴趣,它显示一个进程分配的内存。 + * `-P` 开关过滤进程,只包括那些名字里有 `firefox` 的进程。 + * `-k` 开关显示以 MB/GB 为单位的内存使用情况,而不是单纯的字节数。 + * `-t` 开关显示总数。 * `tail -n 1` 过滤器只输出最后一行,也就是总数的地方。 - - 输出是非常简单的: - ``` $ smem -t -k -c pss -P firefox | tail -n 1 4.9G ``` -开门见山! 而且,经过又一天忙碌的工作,打开了 50 多个选项卡,Firefox 仍然只使用 5 GB。看看吧,Google Chrome ;-) +开门见山!而且,经过又一天忙碌的工作,打开了 50 多个选项卡,Firefox 仍然只使用 5 GB。看看吧,Google Chrome。 #### 用一个脚本更容易 -为了方便起见,创建一个名为 `memory-use` 的小脚本,它将进程名称作为参数。我把所有的脚本都放在 `~/bin`里,所以: - +为了方便起见,我创建一个名为 `memory-use` 的小脚本,它将进程名称作为参数。我把所有的脚本都放在 `~/bin` 里,所以: ``` -`echo 'smem -c pss -P "$1" -k -t | tail -n 1' > ~/bin/memory-use && chmod +x ~/bin/memory-use` +echo 'smem -c pss -P "$1" -k -t | tail -n 1' > ~/bin/memory-use && chmod +x ~/bin/memory-use ``` 现在我可以很容易地测量任何应用的内存使用: - ``` memory-use firefox memory-use chrome @@ -81,24 +74,20 @@ memory-use slack 比如: ``` -`smem --pie name -c pss` +smem --pie name -c pss ``` 显示类似这样的内容: ![Pie chart output from smem][8] -(Tomasz Waraksa, [CC BY-SA 4.0][5]) - 关于更多的细节,我建议查看 [smem 手册页][6]。 你可以在 上找到另一个很棒的教程。 -享受吧! +希望你喜欢! -* * * - -_本文最初出现在[作者的博客][9]上,并经许可转载。_ +本文最初发表在[作者的博客][9]上,并经许可转载。 -------------------------------------------------------------------------------- @@ -107,7 +96,7 @@ via: https://opensource.com/article/21/10/memory-stats-linux-smem 作者:[Tomasz Waraksa][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 5dee3d83a9e8a617947fd296bb84e7c4f69725f5 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 25 Oct 2021 11:03:15 +0800 Subject: [PATCH 0815/1588] PRF MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zengyi1001 感谢您,完成了第一篇翻译贡献! --- ...o Find and Kill Zombie Process in Linux.md | 70 ++++++++++--------- 1 file changed, 38 insertions(+), 32 deletions(-) diff --git a/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md b/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md index a654e365b3..023f98ad02 100644 --- a/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md +++ b/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md @@ -3,97 +3,103 @@ [#]: author: "Marco Carmona https://itsfoss.com/author/marco/" [#]: collector: "lujun9972" [#]: translator: "zengyi1001" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 如何找到并杀掉 Linux 系统中的僵尸进程 ====== -_**概述: 这是一个关于如何寻找 Linux 系统僵尸进程并杀死它们的小贴士。你也可以从中了解到关于进程和僵尸进程的一些知识。**_ +![][5] -在了解僵尸进程之前,让我们来复习一下什么是 Linux 进程 +> 这是一个关于如何寻找 Linux 系统僵尸进程并杀死它们的小知识。你也可以从中了解到关于进程和僵尸进程的一些知识。 -简而言之,[进程][1]是一个程序的运行实体。它可能运行在前端(比如有交互的进程),也可能运行在后端(比如无交互或自动运行的进程)。它可能是一个父进程(运行期间创建了其他进程),也可能是一个子进程(由其他进程所创建)。 +在了解僵尸进程之前,让我们来复习一下什么是 Linux 进程。 -在 Linux 系统中,除 PID 为 0 的第一个初始进程(或系统进程)外,其余进程都有父进程。进程也可以拥有自己的子进程。 +简而言之,[进程][1] 是一个程序的运行实例。它可能运行在前端(比如有交互的进程),也可能运行在后端(比如无交互或自动运行的进程)。它可能是一个父进程(运行期间创建了其他进程),也可能是一个子进程(由其他进程所创建)。 -不相信?可以试试在终端中使用 `pstree` 命令查看进程的树型结构,你能看到系统各个进程的 '家族树'。 +在 Linux 系统中,除 PID 为 0 的第一个 `init` 进程(或 `systemd`)外,其余进程都有父进程。进程也可以拥有自己的子进程。 + +不相信?可以试试在终端中使用 `pstree` 命令查看进程的树型结构,你能看到系统各个进程的“家族树”。 ### Linux系统里的僵尸进程是什么? -子进程死亡后,它的父进程会接收到通知去执行一些清理操作,如释放内存之类。然而,若父进程并未察觉到子进程死亡,子进程就会进入到“僵尸”状态。从父进程角度看,子进程仍然存在,即使子进程实际上已经死亡。这就是“僵尸进程”(也被称为“已消失进程“)是如何产生并存在于系统中的。 -这里有一个来自 Turnoff.us 的关于僵尸进程的非常有趣的看法: +子进程死亡后,它的父进程会接收到通知去执行一些清理操作,如释放内存之类。然而,若父进程并未察觉到子进程死亡,子进程就会进入到“僵尸zombie”状态。从父进程角度看,子进程仍然存在,即使子进程实际上已经死亡。这就是“僵尸进程zombie process”(也被称为“已消失进程defunct process”)是如何产生并存在于系统中的。 + +这里有一个来自 [Turnoff.us](https://turnoff.us/geek/zombie-processes/) 的关于僵尸进程的非常有趣的看法: + ![Image credit: Turnoff.us][2] ### 你真的需要关心僵尸进程吗? 重点要说的是,僵尸进程并没有像它的名称那样看起来可怕。 -但如果系统的 RAM 已经所剩不多或者有太多的僵尸进程在吃掉 RAM,问题会变得糟糕。同样,大部分 Linux 系统进程最大 PID 设置为 32768,如果过多僵尸进程导致其他重要任务没有 PID 可用,你的系统会发生崩溃。 +但如果系统的内存已经所剩不多或者有太多的僵尸进程在吃掉内存,问题会变得糟糕。同样,大部分 Linux 系统进程最大 PID 设置为 32768,如果过多僵尸进程导致其他重要任务没有 PID 可用,你的系统会发生崩溃。 这是真实可能发生的,它有一定的概率,特别当存在一个编码糟糕的程序开始大量产生僵尸进程的时候。 + 在这种情况下,找到并杀死僵尸进程是一个明智的做法。 + ### 如何找到僵尸进程 + Linux 系统中的进程可能处于如下状态中的一种: - * D = 不可中断 - * I = 空闲 - * R = 运行中 - * S = 休眠 - * T = 被调度信号终止 - * t = 被调试器终止 - * Z = 僵尸状态 + * `D` = 不可中断的休眠 + * `I` = 空闲 + * `R` = 运行中 + * `S` = 休眠 + * `T` = 被调度信号终止 + * `t` = 被调试器终止 + * `Z` = 僵尸状态 - -那如何查看进程和它的当前状态呢?一个简单的方法是在终端中使用 [top 命令][3]. +那如何查看进程和它的当前状态呢?一个简单的方法是在终端中使用 [top 命令][3]。 ![Top command show processes and their status][4] -正如你在上面截图中看到的,截图中共有 250 个任务(进程),其中 1 个处在 ”运行中“ 状态,248 个进程处于 “休眠” 状态,还有一个处于 “僵尸” 状态。 +正如你在上面截图中看到的,截图中共有 250 个任务(进程),其中 1 个处在 “运行中running” 状态,248 个进程处于 “休眠sleep” 状态,还有一个处于 “僵尸zombie” 状态。 -现在问题进入下一步,如何杀死 ”僵尸” 进程? +现在问题进入下一步,如何杀死 “僵尸” 进程? ### 如何找到并杀死一个僵尸进程?僵尸进程能被杀死吗? -![][5] - 僵尸进程已经死了,要如何才能杀死一个已经死亡的进程呢? -在僵尸电影中,你可以射击僵尸的头部或烧掉它们,但在这里是行不通的。你可以一把火烧了系统来杀死僵尸进程,但这并不是一个可行的方案 ;) +在僵尸电影中,你可以射击僵尸的头部或烧掉它们,但在这里是行不通的。你可以一把火烧了系统来杀死僵尸进程,但这并不是一个可行的方案。 -一些人建议发送 SIGCHLD 给父进程,但这个信号很可能会被忽略。还有一个方法是杀死父进程来杀死僵尸进程,这听起来很野蛮,但它却是唯一能确保杀死僵尸进程的方法。 +一些人建议发送 `SIGCHLD` 给父进程,但这个信号很可能会被忽略。还有一个方法是杀死父进程来杀死僵尸进程,这听起来很野蛮,但它却是唯一能确保杀死僵尸进程的方法。 -首先,通过在终端中 [使用 ps 命令][6] 我们列举僵尸进程,得到它们的进程 ID。 +首先,通过在终端中 [使用 ps 命令][6] 我们列举僵尸进程,得到它们的进程 ID: ``` ps ux | awk '{if($8=="Z+") print}' ``` -ps ux 命令输出的第 8 列显示了进程状态。上述命令只会打印所有处在 Z+ 状态(表示僵尸状态)的进程。 -确认了进程 ID 后,我们可以得到它的父进程 ID。 +`ps ux` 命令输出的第 8 列显示了进程状态。上述命令只会打印所有处在 Z+ 状态(表示僵尸状态)的进程。 + +确认了进程 ID 后,我们可以得到它的父进程 ID: ``` ps -o ppid= -p ``` -你也可以将上述两个命令结合在一起,直接得到僵尸进程的 PID 及其父进程的 PID。 +你也可以将上述两个命令结合在一起,直接得到僵尸进程的 PID 及其父进程的 PID: ``` ps -A -ostat,pid,ppid | grep -e '[zZ]' ``` -现在你得到了父进程 ID,使用命令行和得到的 ID 号[终于可以杀死进程了][7]。 +现在你得到了父进程 ID,使用命令行和得到的 ID 号 [终于可以杀死进程了][7]: + ``` kill -9 ``` ![Killing parent process][8] -再次运行 ps 命令或 top 命令,你可以验证僵尸进程是否已经被杀死。 +再次运行 `ps` 命令或 `top` 命令,你可以验证僵尸进程是否已经被杀死。 恭喜!现在你知道怎么清理僵尸进程了。 -Abhishek Prakash参与写作。 + -------------------------------------------------------------------------------- via: https://itsfoss.com/kill-zombie-process-linux/ @@ -101,7 +107,7 @@ via: https://itsfoss.com/kill-zombie-process-linux/ 作者:[Marco Carmona][a] 选题:[lujun9972][b] 译者:[zengyi1001](https://github.com/zengyi1001) -校对:[校对者ID](https://github.com/校对者ID) +校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 From fe07f9f8f3f261fd6aa917231a36ce3f4835d042 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 25 Oct 2021 11:04:18 +0800 Subject: [PATCH 0816/1588] PUB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit @zengyi1001 本文首发地址:https://linux.cn/article-13919-1.html 您的 LCTT 专页:https://linux.cn/lctt/zengyi1001 --- .../20211015 How to Find and Kill Zombie Process in Linux.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211015 How to Find and Kill Zombie Process in Linux.md (98%) diff --git a/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md b/published/20211015 How to Find and Kill Zombie Process in Linux.md similarity index 98% rename from translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md rename to published/20211015 How to Find and Kill Zombie Process in Linux.md index 023f98ad02..a3a8dd3f29 100644 --- a/translated/tech/20211015 How to Find and Kill Zombie Process in Linux.md +++ b/published/20211015 How to Find and Kill Zombie Process in Linux.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "zengyi1001" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13919-1.html" 如何找到并杀掉 Linux 系统中的僵尸进程 ====== From 9851e3d4e312dc293f57ef9d43d5ec7a1da8d441 Mon Sep 17 00:00:00 2001 From: perfiffer Date: Mon, 25 Oct 2021 17:39:48 +0800 Subject: [PATCH 0817/1588] translating --- ...ll Rust and Cargo on Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md b/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md index b757160c7e..d2fd95e96b 100644 --- a/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20211020 How to Install Rust and Cargo on Ubuntu and Other Linux Distributions.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/install-rust-cargo-ubuntu-linux/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "perfiffer" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 4828c6b437de0a5e1a6b551508c671f77d272628 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Oct 2021 05:02:30 +0800 Subject: [PATCH 0818/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211026?= =?UTF-8?q?=20Fixing=20=E2=80=9CUnable=20to=20acquire=20dpkg=20frontend=20?= =?UTF-8?q?lock.=20Are=20You=20Root=3F=E2=80=9D=20Error=20on=20Ubuntu=20an?= =?UTF-8?q?d=20Other=20Linux=20Distributions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md --- ...on Ubuntu and Other Linux Distributions.md | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..c1b05e8b60 --- /dev/null +++ b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,114 @@ +[#]: subject: "Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions" +[#]: via: "https://itsfoss.com/fixed-are-you-root-error/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions +====== + +I am presuming you are quite new to Linux. + +You follow some tutorial on the internet that tells you to install a certain program or run some command. Probably it is something to do with a server. + +But when you run the command, you encounter this error: + +**E: Could not open lock file /var/lib/dpkg/lock-frontend – open (13: Permission denied) +E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?** + +A similar error is this one: + +dpkg: error: required read/write access to the dpkg database directory /var/lib/dpkg +**E: Sub-process dpkg –set-selections returned an error code (2) +E: Executing dpkg failed. Are you root?** + +Both errors ask you the same question: are you root? And that’s the answer to this problem. Become root. + +### Become root to avoid this error + +How do you [become root in Ubuntu][1] or Debian? You use the sudo command. + +Yes, that’s it. Whatever command you were running, just add sudo before it. + +``` +sudo your_command +``` + +![Running command with sudo][2] + +It will ask you to enter your user account password. Please keep in mind that nothing gets displayed on the screen when you type the password and that’s okay. + +There is nothing wrong with your system. In most Linux systems, password typing doesn’t show the usual asterisks or anything of that sort as a ‘security feature’. + +Just type your password and press enter after it. If the password was typed correctly, you should be able to run the command now. + +You can even use this handy [Linux command line trick][3] to run a previous command with sudo: + +``` +sudo !! +``` + +That was simple and works immediately, unless you do not have sudo access. Then, you’ll see a different error. + +### Seeing a ‘User is not in sudoer file’ error? + +![Some users cannot run commands with sudo][4] + +When you [install Ubuntu][5], you have to create a user account. This user is automatically granted sudo power to run commands as root when required. + +This happens on Ubuntu desktop, not servers. Most server distributions will have a separate root account. If you create a regular account separately, you’ll have to add the user to sudoer so that this normal user can use sudo. + +In the screenshot above, I had created this additional user but did not add it to the sudo group. This means that user ‘prakash’ here does not have rights to use the sudo command and hence the system complains that ‘prakash is not in sudoers file’. + +#### Where is the incident reported? + +An incorrect sudo attempt is added to the system logs. It logs the user name, the virtual terminal number, location from where the command was run and which command was run. + +![Incorrect sudo attempts are logged into the system][6] + +The location of these logs differ from distribution to distribution. + +Normally, you may find it in journalctl logs or /var/log/auth.log file in Ubuntu, /var/log/audit/audit.log file in Fedora. + +#### What can you do if a user is not in sudoer list? + +What can you do when you cannot use sudo with the current user account? First, [verify if the user has sudo rights or not. If not, here are some options for][7] you: + + * Log in as root or switch to root (if you have root password). + * [Add the user into sudoer list][8] (if you have admin/sudo rights from some other user account). + * If you are in multi-user Linux system and do not have root or sudo access yourself, ask your sytem administrator to either grant your user sudo access or install the application you wanted to install. + + + +### Did this help? + +Sudo is a very comprehensive security mechanism, and it is much more than just allowing a normal user to become root. It helps in auditing the system to know which user ran which command with sudo. It can also be configured to allow a certain user to run only certain commands with sudo. + +You won’t see such granular sudo configuration on desktop Linux where it is preconfigured to allow any user in the sudo group to run any command as root with sudo. More on sudo in some other article. + +I hope while solving this classic beginner problem, you get some initial insights into the sudo command. Let me know if you have further questions on this topic in the comment section. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fixed-are-you-root-error/ + +作者:[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/root-user-ubuntu/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/running-commands-with-sudo.webp?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/linux-command-tricks/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/not-in-sudoer-file-error-800x289.png?resize=800%2C289&ssl=1 +[5]: https://itsfoss.com/install-ubuntu/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/sudo-incident-reported.png?resize=800%2C339&ssl=1 +[7]: https://linuxhandbook.com/check-if-user-has-sudo-rights/ +[8]: https://linuxhandbook.com/create-sudo-user/ From b56a8bd3048125da9782e26d3b8cee5efc2a3403 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Oct 2021 05:02:46 +0800 Subject: [PATCH 0819/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211025?= =?UTF-8?q?=20Use=20Rust=20for=20embedded=20development?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211025 Use Rust for embedded development.md --- ...11025 Use Rust for embedded development.md | 297 ++++++++++++++++++ 1 file changed, 297 insertions(+) create mode 100644 sources/tech/20211025 Use Rust for embedded development.md diff --git a/sources/tech/20211025 Use Rust for embedded development.md b/sources/tech/20211025 Use Rust for embedded development.md new file mode 100644 index 0000000000..07bcab63da --- /dev/null +++ b/sources/tech/20211025 Use Rust for embedded development.md @@ -0,0 +1,297 @@ +[#]: subject: "Use Rust for embedded development" +[#]: via: "https://opensource.com/article/21/10/rust-embedded-development" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Use Rust for embedded development +====== +Rust's high performance, reliability, and productivity make it apt for +embedded systems. +![Ferris the crab under the sea, unofficial logo for Rust programming language][1] + +Over the past several years, Rust has gained a passionate following among programmers. Tech trends come and go, so it can be difficult to separate excitement just because something is new versus excitement over the merits of a technology, but I think Rust is a truly well-designed language. It aims to help developers build reliable and efficient software, and it was designed for that purpose from the ground up. There are key features you'll hear about Rust, and in this article, I demonstrate that many of these features are exactly why Rust also happens to be great for embedded systems. Here are some examples: + + * High performance: It's fast, with high memory utilization + * Reliability: Memory errors can be eliminated during compilation + * Productivity: Great documentation, a friendly compiler with useful error messages, and top-notch tooling. There's an integrated package manager and build tool, smart multi-editor support with auto-completion and type inspections, an auto-formatter, and more. + + + +### Why use Rust for embedded development? + +Rust is designed to guarantee both security and high performance. Embedded software can have problems, mostly due to memory. Rust is, in a way, a compiler-oriented language, so you can be sure that you're using memory safely while compiling. Here are some of the benefits of using Rust to develop on embedded devices: + + * Powerful static analysis + * Flexible memory + * Fearless concurrency + * Interoperability + * Portability + * Community-driven + + + +In this article, I use the open source [RT-Thread operating system][2] to demonstrate how to use Rust for embedded development. + +### How to call Rust in C + +When calling Rust code in C code, you must package the Rust source code as a static library file. When the C code compiles, link it in. + +#### Creating a static library with Rust + +There are two steps in this process. + +1\. Use `cargo init --lib rust_to_c` to build a lib library in Clion. Add the following code to the `lib.rs`. The following function evaluates the sum of two values of type **i32** and returns the result: + + +``` +#![no_std] +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn sum(a: i32, b: i32) -> i32 { +    a + b +} + +#[panic_handler] +fn panic(_info:&PanicInfo) -> !{ +    loop{} +} +``` + +2\. Add the following code to your `Cargo.toml` file to tell Rustc what type of library to generate: + + +``` +[lib] +name = "sum" +crate-type = ["staticlib"] +path = "src/lib.rs" +``` + +#### Cross-compilation + +You can cross-compile for your target. Assuming your embedded system is Arm-based, the steps are simple: + + +``` +`$ rustup target add armv7a-none-eabi` +``` + +2\. Generate the static library file: + + +``` +$ cargo build --target=armv7a-none-eabi --release --verbose +Fresh rust_to_c v0.1.0 +Finished release [optimized] target(s) in 0.01s +``` + +#### Generate Header File + +You need header files, too. + +1\. Install [cbindgen][3]. The `cbindgen` tool generates a C or C++11 header file from the Rust library: + + +``` +`$ cargo install --force cbindgen` +``` + +2\. Create a new `cbindgen.toml` file under your project folder. + +3\. Generate a header file: + + +``` +`$ cbindgen --config cbindgen.toml --crate rust_to_c --output sum.h` +``` + +#### Call the Rust library file + +Now you can make calls to your Rust libraries. + +1\. Put the generated `sum.h` and `sum.a` files into the `rt-thread/bsp/qemu-vexpress-a9/applications` directory. + +2\. Modify the `SConscript` file and add a static library: + + +``` +   from building import * +    +   cwd     = GetCurrentDir() +   src     = Glob('*.c') + Glob('*.cpp') +   CPPPATH = [cwd] +    +   LIBS = ["libsum.a"] +   LIBPATH = [GetCurrentDir()] +    +   group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, LIBS = LIBS, LIBPATH = LIBPATH) +    +   Return('group') +``` + +3\. Call the **sum** function in the main function, get the return value, and `printf` the value. + + +``` +   #include <stdint.h> +   #include <stdio.h> +   #include <stdlib.h> +   #include <rtthread.h> +   #include "sum.h" +    +   int main(void) +   { +       int32_t tmp; +    +       tmp = sum(1, 2); +       printf("call rust sum(1, 2) = %d\n", tmp); +    +       return 0; +   } +``` + +4\. In the RT-Thread [Env][4] environment, use `scons` to compile the project and run: + + +``` +$ scons -j6 +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +[...] +scons: done building targets. + +$ qemu.sh + \ | / +\- RT -     Thread Operating System + / | \     4.0.4 build Jul 28 2021 +2006 - 2021 Copyright by rt-thread team +lwIP-2.1.2 initialized! +[...] +call rust sum(1, 2) = 3 +``` + +### Add, subtract, multiply, and divide + +You can implement some complicated math in Rust. In the `lib.rs` file, use the Rust language to implement add, subtract, multiply, and divide: + + +``` +#![no_std] +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn add(a: i32, b: i32) -> i32 { +    a + b +} + +#[no_mangle] +pub extern "C" fn subtract(a: i32, b: i32) -> i32 { +    a - b +} + +#[no_mangle] +pub extern "C" fn multiply(a: i32, b: i32) -> i32 { +    a * b +} + +#[no_mangle] +pub extern "C" fn divide(a: i32, b: i32) -> i32 { +    a / b +} + +#[panic_handler] +fn panic(_info:&PanicInfo) -> !{ +    loop{} +} +``` + +Build your library files and header files and place them in the application directory. Use `scons` to compile. If errors appear during linking, find the solution on the official [Github page][5]. + +Modify the `rtconfig.py` file, and add the link parameter `--allow-multiple-definition`: + + +``` +       DEVICE = ' -march=armv7-a -marm -msoft-float' +       CFLAGS = DEVICE + ' -Wall' +       AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__ -I.' +       LINK_SCRIPT = 'link.lds' +       LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors,--allow-multiple-definition'+\ +                         ' -T %s' % LINK_SCRIPT +    +       CPATH = '' +       LPATH = '' +``` + +Compile and run QEMU to see your work. + +### Call C in Rust + +Rust can be called in C code, but what about calling C in your Rust code? The following is an example of calling the `rt_kprintf` C function in Rust code. + +First, modify the `lib.rs` file: + + +``` +    // The imported rt-thread functions list +    extern "C" { +        pub fn rt_kprintf(format: *const u8, ...); +    } +    +    #[no_mangle] +    pub extern "C" fn add(a: i32, b: i32) -> i32 { +        unsafe { +            rt_kprintf(b"this is from rust\n" as *const u8); +        } +        a + b +    } +``` + +Next, generate the library file: + + +``` +$ cargo build --target=armv7a-none-eabi --release --verbose +Compiling rust_to_c v0.1.0 +Running `rustc --crate-name sum --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=a +Finished release [optimized] target(s) in 0.11s +``` + +And now, to run the code, copy the library files generated by Rust into the application directory and rebuild: + + +``` +$ scons -j6 scons: Reading SConscript files ... scons: done reading SConscript files. [...] +scons: Building targets ... scons: done building targets. +``` + +Run QEMU again to see the results in your embedded image. + +### You can have it all + +Using Rust for your embedded development gives you all the features of Rust without the need to sacrifice flexibility or stability. Try Rust on your embedded system today. For more information about the process of embedded Rust (and about RT-Thread itself), check out the RT-Thread project's [YouTube channel][6]. And remember, embedded can be open, too. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/rust-embedded-development + +作者:[Alan Smithee][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/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rust_programming_crab_sea.png?itok=2eWLz8A5 (Ferris the crab under the sea, unofficial logo for Rust programming language) +[2]: https://github.com/RT-Thread/rt-thread +[3]: https://github.com/eqrion/cbindgen +[4]: https://www.rt-thread.io/download.html?download=Env +[5]: https://github.com/rust-lang/compiler-builtins/issues/353 +[6]: https://www.youtube.com/channel/UCdDHtIfSYPq4002r27ffqP From 3d21d3b61f19288760b341ff92ecd7f85faf5976 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 26 Oct 2021 05:03:08 +0800 Subject: [PATCH 0820/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[news]:=2020211025?= =?UTF-8?q?=20This=20Game=20Developer=20Loves=20the=20Linux=20Community=20?= =?UTF-8?q?for=20an=20Unusual=20Reason?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md --- ...e Linux Community for an Unusual Reason.md | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md diff --git a/sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md b/sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md new file mode 100644 index 0000000000..12fb0898ba --- /dev/null +++ b/sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md @@ -0,0 +1,97 @@ +[#]: subject: "This Game Developer Loves the Linux Community for an Unusual Reason" +[#]: via: "https://news.itsfoss.com/game-dev-loves-linux/" +[#]: author: "Ankush Das https://news.itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +This Game Developer Loves the Linux Community for an Unusual Reason +====== + +The Linux community, in general, is one of the most active and helpful communities out there. + +And, a significant chunk of that can also be toxic or aggressive to newbies or someone who tries to break traditions. + +However, a game developer seems to be appreciating the Linux community for complaining too much… + +Yes, you heard that right! But, that’s not the entire picture. Let me tell you more about it. + +### Reporting Bugs is Essential for Game Improvement + +Whether it is an indie game or a full-fledged AAA title, every game arrives with several bugs. + +For some studios, game testers try to spot the bugs before launch. But, no matter the effort, players will always notice something that the developers may not have. + +So, it is important for developers to work on the reported bugs for a better gaming experience. + +But, what if you do not get any bug reports even if the game encounters issues? + +Of course, you can invest a lot of time to find out the potential issues faced by players. Unfortunately, it is not possible to iron out everything yourself. + +This is why bug reports from players are an essential part of game development. + +And, to emphasize the importance of bug reports, the game developer of “**[ΔV: Rings of Saturn][1]**” shared some interesting information. + +### Linux Gamers Reported Over 38% Bug Reports With 5.8% Userbase + +![][2] + +Even though [gaming on Linux][3] is improving with the [addition of Easy Anti-Cheat, BattleEye][4], and many other new advancements, the user base is tiny when compared to Windows. + +However, the developer of “**ΔV: Rings of Saturn**” shares an insight where he mentions that out of all the players, Linux gamers reported a significant section of bugs considering the user base. + +![][5] + +Here’s what he said in a [Reddit thread][6]: + +> Percentages are easy to talk about, but when I read just them, I always wonder – what is the sample size? Is it small enough for the percentage to be just noise? +> +> As of today, I sold a little over 12,000 units of ΔV in total. 700 of these units were bought by Linux players. +> +> That’s 5.8%. I got 1040 bug reports in total, out of which roughly 400 are made by Linux players. That’s one report per 11.5 users on average, and one report per 1.75 Linux players. That’s right, an average Linux player will get you 650% more bug reports. + +Not just limited to the number of bug reports, most of the issues reported were well-detailed and could be reproduced or isolated with the details provided. + +So, the minority group of Linux gamers turns out to be more valuable in terms of giving feedback and helping improve the game compared to Windows users. + +Also, the issues spotted were hardly platform-specific. So, these reports will equally help gamers using Windows to play the game as well. + +The game developer adds: + +> It’s worth it to get the massive feedback boost and free, hundred-people strong QA team on your side. An invaluable asset for an independent game studio. + +Of course, no gamer is obliged to report errors in a game. But, this example highlighted by the game developer goes to show how passionate the Linux community can be along with the importance of bug reports. + +### Closing Thoughts + +Overall, I believe that you can always count on the Linux community. While some can be toxic, the majority of the users work towards helping each other and growing together as Linux users. + +What do you think about this particular insight of Linux users reporting more bug reports despite the number of users? Please don’t hesitate to 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/game-dev-loves-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://news.itsfoss.com/author/ankush/ +[b]: https://github.com/lujun9972 +[1]: https://store.steampowered.com/app/846030/V_Rings_of_Saturn/ +[2]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjQzOSIgd2lkdGg9Ijc4MCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[3]: https://itsfoss.com/linux-gaming-guide/ +[4]: https://news.itsfoss.com/easy-anti-cheat-linux/ +[5]: data:image/svg+xml;base64,PHN2ZyBoZWlnaHQ9IjUzNiIgd2lkdGg9Ijc2MyIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIiB2ZXJzaW9uPSIxLjEiLz4= +[6]: https://www.reddit.com/r/gamedev/comments/qeqn3b/despite_having_just_58_sales_over_38_of_bug/ From 3e67e69c35c158062c1d83acc993c5f15b8bdcad Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 26 Oct 2021 08:47:43 +0800 Subject: [PATCH 0821/1588] translated --- ...ow to Convert a Webpage to PDF in Linux.md | 131 ----------------- ...ow to Convert a Webpage to PDF in Linux.md | 132 ++++++++++++++++++ 2 files changed, 132 insertions(+), 131 deletions(-) delete mode 100644 sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md create mode 100644 translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md diff --git a/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md b/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md deleted file mode 100644 index be817f5967..0000000000 --- a/sources/tech/20211021 How to Convert a Webpage to PDF in Linux.md +++ /dev/null @@ -1,131 +0,0 @@ -[#]: subject: "How to Convert a Webpage to PDF in Linux" -[#]: via: "https://itsfoss.com/convert-webpage-pdf-linux/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Convert a Webpage to PDF in Linux -====== - -Saving a webpage as a PDF comes in handy when you archive certain resources or use them for educational purposes. - -But, how do you convert a webpage to PDF in Linux? - -_**You can either choose to go the easy way out using the web browser (GUI) on every Linux distribution or use the terminal to turn a webpage into a PDF file.**_ - -Here, I shall mention both the methods to help you get the job done. - -### Method 1: Converting a Webpage to PDF Using Web Browser - -Even though I use Mozilla Firefox for this tutorial, you can do the same thing with any of the [best browsers available for Linux.][1] - -![][2] - -1\. Load up the webpage you want to convert. - -2\. Head to the browser menu to find the “**Print**” option or use the keyboard shortcut “**Ctrl + P**.” - -3\. By default, it should let you save it as a PDF. You need to hit “Save,” and choose the destination and save the webpage. - -![Save webpage as PDF in Mozilla Firefox][3] - -The one major problem with this simple approach is that it includes all the elements on the page. This may include comments, footer etc. You may use a PDF editor to remove parts of it but that’s an additional task. - -_**A better option is to utilize a browser extension like [Print Friendly][4]. It allows you to edit and remove parts of the webpage before downloading the PDF.**_ - -### Method 2: Converting a Webpage to PDF or Images Using the Terminal - -You probably already know that you can [browse internet in Linux terminal][5] and even [download files using the command line][6]. That’s not surprising considering you can do a lot more in the terminal, including downloading a webpage as PDF. - -A nifty open-source command-line tools **wkhtmltopdf** and **wkhtmltoimage** come to the rescue that lets you convert any HTML webpage to a PDF or image file. - -It utilizes the Qt WebKit rendering engine to get the task done. You can explore its [GitHub page][7] for more information. - -You should be able to install it from the default repository of your Linux distribution. For Ubuntu-based distros, you can type in the command: - -``` -sudo apt install wkhtmltopdf -``` - -It is pretty straightforward to use no matter whether you want to convert it to a PDF or image file: - -![][8] - -To convert a webpage into a PDF, type in: - -``` -wkhtmltopdf URL/domain filename.pdf -``` - -As an example, here’s how it would look: - -``` -wkhtmltopdf linuxmint.com mint.pdf -``` - -You can choose to use the complete URL as “** or use the domain name as shown in the example above. - -The file generated will be saved in the home directory by default. - -You also get a few exciting options when converting a webpage. - -For instance, you can **apply a grayscale filter to the PDF file**, **make multiple copies of the page** in the same file, and **exclude images** during conversion. - -The grayscale filter may not work on every webpage, but you can try that using the command: - -``` -wkhtmltopdf -g google.com googlepage.pdf -``` - -To make multiple copies of pages in the same PDF file, the command would be: - -``` -wkhtmltopdf --copies 2 linuxmint.com mint.pdf -``` - -And, if you want to exclude images from the web pages, just type: - -``` -wkhtmltopdf --no-images linuxmint.com mint.pdf -``` - -Additionally, if you want to convert a webpage as an image, the command would look like this: - -``` -wkhtmltoimage linuxmint.com mint.png -``` - -Note that unlike the GUI method using a browser, using these tools via the terminal has its limitation. It does not seem to convert web pages utilizing any <iframe> code snippets successfully. - -Sites like ours and even DuckDuckGo didn’t convert to PDF or an image. However, simple HTML sites like Linuxmint.com, Ubuntu.com, Google.com, worked like charm. - -### Wrapping Up - -To get the best results, saving a webpage as a PDF using a browser seems to be the way to go. But, if you want more options and go through the terminal, the **wkhtmltopdf** utility should come in handy. - -How do you prefer to convert web pages to PDF in Linux? Feel free to share your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/convert-webpage-pdf-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://itsfoss.com/best-browsers-ubuntu-linux/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-save-webpage-pdf.png?resize=800%2C536&ssl=1 -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-firefox-print-pdf-1.png?resize=602%2C584&ssl=1 -[4]: https://www.printfriendly.com/ -[5]: https://itsfoss.com/terminal-web-browsers/ -[6]: https://itsfoss.com/download-files-from-linux-terminal/ -[7]: https://github.com/wkhtmltopdf/wkhtmltopdf -[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/htmltopdf-mint.png?resize=736%2C344&ssl=1 diff --git a/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md b/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md new file mode 100644 index 0000000000..252c46a043 --- /dev/null +++ b/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md @@ -0,0 +1,132 @@ +[#]: subject: "How to Convert a Webpage to PDF in Linux" +[#]: via: "https://itsfoss.com/convert-webpage-pdf-linux/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Linux 下将网页转换为 PDF 文件 +====== + +当你将某些资源存档或用于教育目的时,将网页保存为 PDF 是很方便的。 + +But, how do you convert a webpage to PDF in Linux? +但是,你如何在 Linux 中把一个网页转换成 PDF? + +_**你可以选择使用每个 Linux 发行版上的网页浏览器(GUI),或者使用终端将网页变成 PDF 文件。**_ + +在这里,我将提到这两种方法来帮助你完成工作。 + +### 方法 1:使用网页浏览器将网页转换为 PDF 文件 + +尽管我在本教程中使用的是 Mozilla Firefox,但你也可以用任何[可用于 Linux 的最佳浏览器][1]做同样的事情。 + +![][2] + +1\. 加载你想转换的网页。 + +2\. 在浏览器菜单中找到“**打印**”选项,或使用键盘快捷键 “**Ctrl + P**”。 + +3\. 默认情况下,它应该让你把它保存为 PDF。你需要点击“保存”,然后选择目的地并保存网页。 + +![Save webpage as PDF in Mozilla Firefox][3] + +这种简单方法的一个主要问题是,它包括页面上的所有元素。这可能包括评论、页脚等。你可以用一个 PDF 编辑器来删除部分内容,但这是一个额外的任务。 + +_**更好的选择是利用一个浏览器扩展,如 [Print Friendly][4]。它允许你在下载 PDF 之前编辑和删除网页的部分内容**_。 + +### 方法 2:使用终端将网页转换为 PDF 或图片 + +你可能已经知道,你可以[在 Linux 终端浏览互联网][5],甚至[使用命令行下载文件][6]。这并不奇怪,因为你可以在终端中做更多的事情,包括将网页下载为 PDF。 + +一个灵巧的开源命令行工具 **wkhtmltopdf** 和 **wkhtmltoimage** 来拯救你,让你把任何 HTML 网页转换成 PDF 或图像文件。 + +它使用 Qt WebKit 渲染引擎来完成这个任务。你可以浏览它的 [GitHub页面][7] 了解更多信息。 + +你应该能够从你的 Linux 发行版的默认仓库中安装它。对于基于 Ubuntu 的发行版,你可以输入以下命令: + +``` +sudo apt install wkhtmltopdf +``` + +无论你想把它转换为 PDF 还是图像文件,它的使用都是非常直接的: + +![][8] + +要将一个网页转换成 PDF,请输入: + +``` +wkhtmltopdf URL/domain filename.pdf +``` + +比如,类似于这样: + +``` +wkhtmltopdf linuxmint.com mint.pdf +``` + +你可以选择使用 “****” 完整的 URL 或使用域名,如上面的例子所示。 + +默认情况下,生成的文件将保存在主目录下。 + +在转换网页时,你还可以得到一些令人兴奋的选项。 + +例如,你可以**对 PDF 文件应用灰度过滤器**,在同一文件中**制作多个页面副本**,以及在转换过程中**排除**图像。 + +灰度过滤器不一定对每个网页都有效,但你可以用命令试试: + +``` +wkhtmltopdf -g google.com googlepage.pdf +``` + +要在同一个 PDF 文件中复制多个页面,命令是: + +``` +wkhtmltopdf --copies 2 linuxmint.com mint.pdf +``` + +而且,如果你想排除网页中的图像,只需输入: + +``` +wkhtmltopdf --no-images linuxmint.com mint.pdf +``` + +此外,如果你想把一个网页转换为图像,命令是这样的: + +``` +wkhtmltoimage linuxmint.com mint.png +``` + +注意,与使用浏览器的 GUI 方法不同,通过终端使用这些工具有其局限性。它似乎不能成功转换利用任何 <iframe> 代码片段的网页。 + +像我们的网站,甚至 DuckDuckGo 都没有转换为 PDF 或图像。然而,简单的 HTML 网站,如 Linuxmint.com、Ubuntu.com、Google.com 则非常有效。 + +### 总结 + +为了得到最好的结果,使用浏览器将网页保存为 PDF 似乎是个好办法。但是,如果你想有更多的选择并通过终端,**wkhtmltopdf** 工具应该会派上用场。 + +你喜欢如何在 Linux 中把网页转换为 PDF?欢迎在评论中分享你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/convert-webpage-pdf-linux/ + +作者:[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://itsfoss.com/best-browsers-ubuntu-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-save-webpage-pdf.png?resize=800%2C536&ssl=1 +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/mozilla-firefox-print-pdf-1.png?resize=602%2C584&ssl=1 +[4]: https://www.printfriendly.com/ +[5]: https://itsfoss.com/terminal-web-browsers/ +[6]: https://itsfoss.com/download-files-from-linux-terminal/ +[7]: https://github.com/wkhtmltopdf/wkhtmltopdf +[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/htmltopdf-mint.png?resize=736%2C344&ssl=1 From fa6848424cf6a65d18b0767fb5eac7739a83ea5b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 26 Oct 2021 08:50:15 +0800 Subject: [PATCH 0822/1588] Rename sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md to sources/talk/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md --- ...e Developer Loves the Linux Community for an Unusual Reason.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{news => talk}/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md (100%) diff --git a/sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md b/sources/talk/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md similarity index 100% rename from sources/news/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md rename to sources/talk/20211025 This Game Developer Loves the Linux Community for an Unusual Reason.md From 8d843c98bcf40d55f2125759d1a67976764ca6aa Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 26 Oct 2021 08:51:24 +0800 Subject: [PATCH 0823/1588] translating --- ... You Root-- Error on Ubuntu and Other Linux Distributions.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md index c1b05e8b60..d334666913 100644 --- a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md +++ b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/fixed-are-you-root-error/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 996f01192668c6a9eb7e20047281310d15ebce43 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 09:14:35 +0800 Subject: [PATCH 0824/1588] APL --- sources/tech/20211025 Use Rust for embedded development.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211025 Use Rust for embedded development.md b/sources/tech/20211025 Use Rust for embedded development.md index 07bcab63da..f3defee452 100644 --- a/sources/tech/20211025 Use Rust for embedded development.md +++ b/sources/tech/20211025 Use Rust for embedded development.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/rust-embedded-development" [#]: author: "Alan Smithee https://opensource.com/users/alansmithee" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 7f290b49cbeb659f3f91c9565e8aadb0d2f86e3c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 10:39:16 +0800 Subject: [PATCH 0825/1588] TSL&PRF --- ...11025 Use Rust for embedded development.md | 297 ------------------ ...11025 Use Rust for embedded development.md | 280 +++++++++++++++++ 2 files changed, 280 insertions(+), 297 deletions(-) delete mode 100644 sources/tech/20211025 Use Rust for embedded development.md create mode 100644 translated/tech/20211025 Use Rust for embedded development.md diff --git a/sources/tech/20211025 Use Rust for embedded development.md b/sources/tech/20211025 Use Rust for embedded development.md deleted file mode 100644 index f3defee452..0000000000 --- a/sources/tech/20211025 Use Rust for embedded development.md +++ /dev/null @@ -1,297 +0,0 @@ -[#]: subject: "Use Rust for embedded development" -[#]: via: "https://opensource.com/article/21/10/rust-embedded-development" -[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Use Rust for embedded development -====== -Rust's high performance, reliability, and productivity make it apt for -embedded systems. -![Ferris the crab under the sea, unofficial logo for Rust programming language][1] - -Over the past several years, Rust has gained a passionate following among programmers. Tech trends come and go, so it can be difficult to separate excitement just because something is new versus excitement over the merits of a technology, but I think Rust is a truly well-designed language. It aims to help developers build reliable and efficient software, and it was designed for that purpose from the ground up. There are key features you'll hear about Rust, and in this article, I demonstrate that many of these features are exactly why Rust also happens to be great for embedded systems. Here are some examples: - - * High performance: It's fast, with high memory utilization - * Reliability: Memory errors can be eliminated during compilation - * Productivity: Great documentation, a friendly compiler with useful error messages, and top-notch tooling. There's an integrated package manager and build tool, smart multi-editor support with auto-completion and type inspections, an auto-formatter, and more. - - - -### Why use Rust for embedded development? - -Rust is designed to guarantee both security and high performance. Embedded software can have problems, mostly due to memory. Rust is, in a way, a compiler-oriented language, so you can be sure that you're using memory safely while compiling. Here are some of the benefits of using Rust to develop on embedded devices: - - * Powerful static analysis - * Flexible memory - * Fearless concurrency - * Interoperability - * Portability - * Community-driven - - - -In this article, I use the open source [RT-Thread operating system][2] to demonstrate how to use Rust for embedded development. - -### How to call Rust in C - -When calling Rust code in C code, you must package the Rust source code as a static library file. When the C code compiles, link it in. - -#### Creating a static library with Rust - -There are two steps in this process. - -1\. Use `cargo init --lib rust_to_c` to build a lib library in Clion. Add the following code to the `lib.rs`. The following function evaluates the sum of two values of type **i32** and returns the result: - - -``` -#![no_std] -use core::panic::PanicInfo; - -#[no_mangle] -pub extern "C" fn sum(a: i32, b: i32) -> i32 { -    a + b -} - -#[panic_handler] -fn panic(_info:&PanicInfo) -> !{ -    loop{} -} -``` - -2\. Add the following code to your `Cargo.toml` file to tell Rustc what type of library to generate: - - -``` -[lib] -name = "sum" -crate-type = ["staticlib"] -path = "src/lib.rs" -``` - -#### Cross-compilation - -You can cross-compile for your target. Assuming your embedded system is Arm-based, the steps are simple: - - -``` -`$ rustup target add armv7a-none-eabi` -``` - -2\. Generate the static library file: - - -``` -$ cargo build --target=armv7a-none-eabi --release --verbose -Fresh rust_to_c v0.1.0 -Finished release [optimized] target(s) in 0.01s -``` - -#### Generate Header File - -You need header files, too. - -1\. Install [cbindgen][3]. The `cbindgen` tool generates a C or C++11 header file from the Rust library: - - -``` -`$ cargo install --force cbindgen` -``` - -2\. Create a new `cbindgen.toml` file under your project folder. - -3\. Generate a header file: - - -``` -`$ cbindgen --config cbindgen.toml --crate rust_to_c --output sum.h` -``` - -#### Call the Rust library file - -Now you can make calls to your Rust libraries. - -1\. Put the generated `sum.h` and `sum.a` files into the `rt-thread/bsp/qemu-vexpress-a9/applications` directory. - -2\. Modify the `SConscript` file and add a static library: - - -``` -   from building import * -    -   cwd     = GetCurrentDir() -   src     = Glob('*.c') + Glob('*.cpp') -   CPPPATH = [cwd] -    -   LIBS = ["libsum.a"] -   LIBPATH = [GetCurrentDir()] -    -   group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, LIBS = LIBS, LIBPATH = LIBPATH) -    -   Return('group') -``` - -3\. Call the **sum** function in the main function, get the return value, and `printf` the value. - - -``` -   #include <stdint.h> -   #include <stdio.h> -   #include <stdlib.h> -   #include <rtthread.h> -   #include "sum.h" -    -   int main(void) -   { -       int32_t tmp; -    -       tmp = sum(1, 2); -       printf("call rust sum(1, 2) = %d\n", tmp); -    -       return 0; -   } -``` - -4\. In the RT-Thread [Env][4] environment, use `scons` to compile the project and run: - - -``` -$ scons -j6 -scons: Reading SConscript files ... -scons: done reading SConscript files. -scons: Building targets ... -[...] -scons: done building targets. - -$ qemu.sh - \ | / -\- RT -     Thread Operating System - / | \     4.0.4 build Jul 28 2021 -2006 - 2021 Copyright by rt-thread team -lwIP-2.1.2 initialized! -[...] -call rust sum(1, 2) = 3 -``` - -### Add, subtract, multiply, and divide - -You can implement some complicated math in Rust. In the `lib.rs` file, use the Rust language to implement add, subtract, multiply, and divide: - - -``` -#![no_std] -use core::panic::PanicInfo; - -#[no_mangle] -pub extern "C" fn add(a: i32, b: i32) -> i32 { -    a + b -} - -#[no_mangle] -pub extern "C" fn subtract(a: i32, b: i32) -> i32 { -    a - b -} - -#[no_mangle] -pub extern "C" fn multiply(a: i32, b: i32) -> i32 { -    a * b -} - -#[no_mangle] -pub extern "C" fn divide(a: i32, b: i32) -> i32 { -    a / b -} - -#[panic_handler] -fn panic(_info:&PanicInfo) -> !{ -    loop{} -} -``` - -Build your library files and header files and place them in the application directory. Use `scons` to compile. If errors appear during linking, find the solution on the official [Github page][5]. - -Modify the `rtconfig.py` file, and add the link parameter `--allow-multiple-definition`: - - -``` -       DEVICE = ' -march=armv7-a -marm -msoft-float' -       CFLAGS = DEVICE + ' -Wall' -       AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__ -I.' -       LINK_SCRIPT = 'link.lds' -       LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors,--allow-multiple-definition'+\ -                         ' -T %s' % LINK_SCRIPT -    -       CPATH = '' -       LPATH = '' -``` - -Compile and run QEMU to see your work. - -### Call C in Rust - -Rust can be called in C code, but what about calling C in your Rust code? The following is an example of calling the `rt_kprintf` C function in Rust code. - -First, modify the `lib.rs` file: - - -``` -    // The imported rt-thread functions list -    extern "C" { -        pub fn rt_kprintf(format: *const u8, ...); -    } -    -    #[no_mangle] -    pub extern "C" fn add(a: i32, b: i32) -> i32 { -        unsafe { -            rt_kprintf(b"this is from rust\n" as *const u8); -        } -        a + b -    } -``` - -Next, generate the library file: - - -``` -$ cargo build --target=armv7a-none-eabi --release --verbose -Compiling rust_to_c v0.1.0 -Running `rustc --crate-name sum --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=a -Finished release [optimized] target(s) in 0.11s -``` - -And now, to run the code, copy the library files generated by Rust into the application directory and rebuild: - - -``` -$ scons -j6 scons: Reading SConscript files ... scons: done reading SConscript files. [...] -scons: Building targets ... scons: done building targets. -``` - -Run QEMU again to see the results in your embedded image. - -### You can have it all - -Using Rust for your embedded development gives you all the features of Rust without the need to sacrifice flexibility or stability. Try Rust on your embedded system today. For more information about the process of embedded Rust (and about RT-Thread itself), check out the RT-Thread project's [YouTube channel][6]. And remember, embedded can be open, too. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/rust-embedded-development - -作者:[Alan Smithee][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/alansmithee -[b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rust_programming_crab_sea.png?itok=2eWLz8A5 (Ferris the crab under the sea, unofficial logo for Rust programming language) -[2]: https://github.com/RT-Thread/rt-thread -[3]: https://github.com/eqrion/cbindgen -[4]: https://www.rt-thread.io/download.html?download=Env -[5]: https://github.com/rust-lang/compiler-builtins/issues/353 -[6]: https://www.youtube.com/channel/UCdDHtIfSYPq4002r27ffqP diff --git a/translated/tech/20211025 Use Rust for embedded development.md b/translated/tech/20211025 Use Rust for embedded development.md new file mode 100644 index 0000000000..a37cd61bf5 --- /dev/null +++ b/translated/tech/20211025 Use Rust for embedded development.md @@ -0,0 +1,280 @@ +[#]: subject: "Use Rust for embedded development" +[#]: via: "https://opensource.com/article/21/10/rust-embedded-development" +[#]: author: "Alan Smithee https://opensource.com/users/alansmithee" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +使用 Rust 进行嵌入式开发 +====== + +> Rust 的高性能、高可靠性和高生产力使它适合于嵌入式系统。 + +![](https://img.linux.net.cn/data/attachment/album/202110/26/103848djcdhjk0d2z1hc52.jpg) + +在过去的几年里,Rust 在程序员中获得了热情的追捧。技术潮流来来去去,所以很难将仅仅因为某项新技术而产生的兴奋与对某项技术的优点的兴奋区分开来,但我认为 Rust 是一种真正设计良好的语言。它的目标是帮助开发者建立可靠和高效的软件,而且它从一开始就是为这个目的设计的。你可能听过一些 Rust 的关键特性,在这篇文章中,我会证明这些特性正是 Rust 也恰好适合嵌入式系统的原因。比如: + + * 高性能:它速度快,内存利用率高 + * 可靠性:在编译过程中可以消除内存错误 + * 生产力:很棒的文档,友好的编译器,有用的错误信息,以及一流的工具化。它有一个集成的包管理器和构建工具,智能的多编辑器支持自动补完和类型检查、自动格式化等等。 + +### 为什么使用 Rust 进行嵌入式开发? + +Rust 的设计是为了保证安全和高性能。嵌入式软件会出现的问题主要是内存的问题。从某种程度上说,Rust 是一种面向编译器的语言,所以你可以确保在编译时安全使用内存。以下是使用 Rust 在嵌入式设备上开发的一些好处: + + * 强大的静态分析 + * 灵活的内存 + * 无畏的并发性 + * 互操作性 + * 可移植性 + * 社区驱动 + +在这篇文章中,我使用开源的 [RT-Thread 操作系统][2] 来演示如何使用 Rust 进行嵌入式开发。 + +### 如何在 C 语言中调用 Rust + +在 C 代码中调用 Rust 代码时,你必须将 Rust 源代码打包成静态库文件。当 C 代码编译时,将其链接进去。 + +#### 用 Rust 创建一个静态库 + +在这个过程中,有两个步骤: + +1、使用 `cargo init --lib rust_to_c` 在 Clion 中建立一个 `lib` 库。在 `lib.rs` 中加入以下代码。下面的函数计算两个类型为 `i32` 的值的总和并返回结果: + +``` +#![no_std] +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn sum(a: i32, b: i32) -> i32 { + a + b +} + +#[panic_handler] +fn panic(_info:&PanicInfo) -> !{ + loop{} +} +``` + +2、在你的 `Cargo.toml` 文件中添加以下代码,以告诉 Rustc 要生成什么类型的库: + +``` +[lib] +name = "sum" +crate-type = ["staticlib"] +path = "src/lib.rs" +``` + +#### 交叉编译 + +你可以针对你的目标平台进行交叉编译。假设你的嵌入式系统是基于 Arm 的,步骤很简单: + +``` +$ rustup target add armv7a-none-eabi +``` + +生成静态库文件: + +``` +$ cargo build --target=armv7a-none-eabi --release --verbose +Fresh rust_to_c v0.1.0 +Finished release [optimized] target(s) in 0.01s +``` + +#### 生成头文件 + +你也需要头文件: + +1、安装 [cbindgen][3]。`cbindgen` 工具会从 Rust 库中生成一个 C 或 C++11 的头文件: + +``` +$ cargo install --force cbindgen +``` + +2、在你的项目文件夹下创建一个新的 `cbindgen.toml` 文件。 + +3、生成一个头文件: + +``` +$ cbindgen --config cbindgen.toml --crate rust_to_c --output sum.h +``` + +#### 调用 Rust 库文件 + +现在你可以对你的 Rust 库进行调用了。 + +1、把生成的 `sum.h` 和 `sum.a` 文件放到 `rt-thread/bsp/qemu-vexpress-a9/applications` 目录下。 + +2、修改 `SConscript` 文件并添加一个静态库: + +``` +   from building import * +    +   cwd     = GetCurrentDir() +   src     = Glob('*.c') + Glob('*.cpp') +   CPPPATH = [cwd] +    +   LIBS = ["libsum.a"] +   LIBPATH = [GetCurrentDir()] +    +   group = DefineGroup('Applications', src, depend = [''], CPPPATH = CPPPATH, LIBS = LIBS, LIBPATH = LIBPATH) +    +   Return('group') +``` + +3、在主函数中调用 `sum` 函数,得到返回值,并 `printf` 该值: + +``` + #include + #include + #include + #include + #include "sum.h" + + int main(void) + { + int32_t tmp; + + tmp = sum(1, 2); + printf("call rust sum(1, 2) = %d\n", tmp); + + return 0; + } +``` + +4、在 RT-Thread [Env][4] 环境中,使用 `scons` 来编译项目并运行: + +``` +$ scons -j6 +scons: Reading SConscript files ... +scons: done reading SConscript files. +scons: Building targets ... +[...] +scons: done building targets. + +$ qemu.sh + \ | / +- RT - Thread Operating System + / | \ 4.0.4 build Jul 28 2021 +2006 - 2021 Copyright by rt-thread team +lwIP-2.1.2 initialized! +[...] +call rust sum(1, 2) = 3 +``` + +### 加、减、乘、除 + +你可以在 Rust 中实现一些复杂的数学运算。在 `lib.rs` 文件中,使用 Rust 语言来实现加、减、乘、除: + +``` +#![no_std] +use core::panic::PanicInfo; + +#[no_mangle] +pub extern "C" fn add(a: i32, b: i32) -> i32 { + a + b +} + +#[no_mangle] +pub extern "C" fn subtract(a: i32, b: i32) -> i32 { + a - b +} + +#[no_mangle] +pub extern "C" fn multiply(a: i32, b: i32) -> i32 { + a * b +} + +#[no_mangle] +pub extern "C" fn divide(a: i32, b: i32) -> i32 { + a / b +} + +#[panic_handler] +fn panic(_info:&PanicInfo) -> !{ + loop{} +} +``` + +构建你的库文件和头文件,并把它们放在应用程序目录中。使用 `scons` 来编译。如果在链接过程中出现错误,请在官方 [Github 页面][5] 中找到解决方案。 + +修改 `rtconfig.py` 文件,并添加链接参数 `--allow-multiple-definition`: + +``` + DEVICE = ' -march=armv7-a -marm -msoft-float' + CFLAGS = DEVICE + ' -Wall' + AFLAGS = ' -c' + DEVICE + ' -x assembler-with-cpp -D__ASSEMBLY__ -I.' + LINK_SCRIPT = 'link.lds' + LFLAGS = DEVICE + ' -nostartfiles -Wl,--gc-sections,-Map=rtthread.map,-cref,-u,system_vectors,--allow-multiple-definition'+\ + ' -T %s' % LINK_SCRIPT + + CPATH = '' + LPATH = '' +``` + +编译并运行 QEMU 来看看你的工作。 + +### 在 Rust 中调用 C 语言 + +Rust 可以在 C 代码中调用,但是如何在你的 Rust 代码中调用 C 呢?下面是一个在 Rust 代码中调用 `rt_kprintf` C 函数的例子。 + +首先,修改 `lib.rs` 文件: + +``` + // The imported rt-thread functions list + extern "C" { + pub fn rt_kprintf(format: *const u8, ...); + } + + #[no_mangle] + pub extern "C" fn add(a: i32, b: i32) -> i32 { + unsafe { + rt_kprintf(b"this is from rust\n" as *const u8); + } + a + b + } +``` + +接下来,生成库文件: + +``` +$ cargo build --target=armv7a-none-eabi --release --verbose +Compiling rust_to_c v0.1.0 +Running `rustc --crate-name sum --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type staticlib --emit=dep-info,link -C opt-level=3 -C embed-bitcode=no -C metadata=a +Finished release [optimized] target(s) in 0.11s +``` + +而现在,要运行代码,将 Rust 生成的库文件复制到应用程序目录中,然后重新构建: + +``` +$ scons -j6 scons: Reading SConscript files ... scons: done reading SConscript files. [...] +scons: Building targets ... scons: done building targets. +``` + +再次运行 QEMU,可以在你的嵌入式镜像中看到结果。 + +### 你可以拥有这一切 + +在你的嵌入式开发中使用 Rust,你可以获得 Rust 的所有功能,而不需要牺牲灵活性或稳定性。今天就在你的嵌入式系统上试试 Rust 吧。关于嵌入式 Rust 的过程(以及 RT-Thread 本身)的更多信息,请查看 RT-Thread 项目的 [YouTube 频道][6]。请记住,嵌入式也可以是开放的。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/rust-embedded-development + +作者:[Alan Smithee][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/alansmithee +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rust_programming_crab_sea.png?itok=2eWLz8A5 (Ferris the crab under the sea, unofficial logo for Rust programming language) +[2]: https://github.com/RT-Thread/rt-thread +[3]: https://github.com/eqrion/cbindgen +[4]: https://www.rt-thread.io/download.html?download=Env +[5]: https://github.com/rust-lang/compiler-builtins/issues/353 +[6]: https://www.youtube.com/channel/UCdDHtIfSYPq4002r27ffqP From 8dd37cf6a815088d7ca2445a0dc1af3c50de06cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 10:42:39 +0800 Subject: [PATCH 0826/1588] PUB @wxy https://linux.cn/article-13921-1.html --- .../20211025 Use Rust for embedded development.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211025 Use Rust for embedded development.md (99%) diff --git a/translated/tech/20211025 Use Rust for embedded development.md b/published/20211025 Use Rust for embedded development.md similarity index 99% rename from translated/tech/20211025 Use Rust for embedded development.md rename to published/20211025 Use Rust for embedded development.md index a37cd61bf5..2fbf555ec3 100644 --- a/translated/tech/20211025 Use Rust for embedded development.md +++ b/published/20211025 Use Rust for embedded development.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13921-1.html" 使用 Rust 进行嵌入式开发 ====== From 5b893b3f9c2b8c6ec6512942b27d539a18486f74 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 11:17:25 +0800 Subject: [PATCH 0827/1588] PRF&PUB @geekpi https://linux.cn/article-13922-1.html --- ...Terminal Client for Git Written in Rust.md | 28 ++++++++++--------- 1 file changed, 15 insertions(+), 13 deletions(-) rename {translated/tech => published}/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md (78%) diff --git a/translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md b/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md similarity index 78% rename from translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md rename to published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md index 45785b2cfa..a3e656cfa6 100644 --- a/translated/tech/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md +++ b/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md @@ -3,20 +3,22 @@ [#]: author: "Marco Carmona https://itsfoss.com/author/marco/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13922-1.html" GitUI: 用 Rust 编写的 Git 的快速命令行客户端 ====== +![](https://img.linux.net.cn/data/attachment/album/202110/26/111605achvngqr6ix6vv0p.jpg) + [基本的 Git 命令][1] 对于通常的克隆、添加、提交推送已经足够好了。 -但如果你在一个有多个贡献者的大型项目上工作,你可能需要将事情可视化。GUI 工具可以让你更好地了解 diff、stash 和 blame 的情况。 +但如果你在一个有多个贡献者的大型项目上工作,你可能需要将事情可视化。GUI 工具可以让你更好地了解 `diff`、`stash` 和 `blame` 的情况。 -但是,如果你常用终端,想要 Git 的舒适性,我为你准备了一个好工具。 +但是,如果你常用终端,又想要 Git 的舒适性,我为你准备了一个好工具。 -它叫 GitUI,它提供了类似于 Git GUI 的用户体验和舒适度,但就在你的终端中。它是可移植的、快速的、免费的和开源的。 +它叫 GitUI,它提供了类似于 Git GUI 的用户体验和舒适度,但就在你的终端中。它是可移植的、快速的、自由而开源的。 ### GitUI:一个基于终端的 Git 工具 @@ -30,15 +32,15 @@ gitui | 24 s | 0.17 | 1.4 | 否 | 否 lazygit | 57 s | 2.6 | 16 | 是 | 有时 tig | 4 m 20 s | 1.3 | 0.6 | 有时 | 否 -GitUI、LazyGit 和 Tig 之间的比较。Git 的简单用户界面 +*GitUI、LazyGit 和 Tig 之间的比较。* 这种优化大部分来自于 Rust 语言的使用。 -_**注意:该程序处于早期开发阶段,还没有为生产做好准备。**_ +**注意:该程序处于早期开发阶段,还没有为生产做好准备。** ### 在 Linux 上安装 GitUI -不用说,你应该已经[在你的系统上安装了 Git][5]。 +不用说,你应该已经 [在你的系统上安装了 Git][5]。 要使用 GitUI,首先需要 [为你的 Linux 发行版安装 Rust 支持][6]。 @@ -62,19 +64,19 @@ source $HOME/.cargo/env cargo install gitui ``` -然后你就可以使用 GitUI了,只需在终端输入 `gitui`就可以运行了。我做了一些示例文件来测试 Git 和 GitUI。 +然后你就可以使用 GitUI了,只需在终端输入 `gitui` 就可以运行了。我做了一些示例文件来测试 Git 和 GitUI。 ![Starting gitui on terminal][8] 值得一提的是,这个界面有一个快速而直观的纯键盘控制。一切都很简单,只需输入正确的字母即可将文件暂存、提交、分支或推送到 git 仓库中。 -真正让我兴奋的是,你不仅可以做之前的四个动作,还可以**编辑**每个文件,**拉取**它,**blame** 它,在其中**导航**等等,这一切都无需退出界面。 很棒,不是吗? +真正让我兴奋的是,你不仅可以做之前的四个动作,还可以**编辑**每个文件,**拉取**它,**追溯** 它,在其中**导航**等等,这一切都无需退出界面。 很棒,不是吗? ![More functions inside the interface][9] 祝贺你! 现在你知道了如何安装 GitUI 以及它在你的终端中的样子。 -如果你喜欢这个项目,请在 [GitHub][2] 上启动它的仓库。如果你使用其他工具来管理 Git,请在评论区提出你的建议。 +如果你喜欢这个项目,请在 [GitHub][2] 上点赞它的仓库。如果你使用其他工具来管理 Git,请在评论区提出你的建议。 -------------------------------------------------------------------------------- @@ -83,7 +85,7 @@ via: https://itsfoss.com/gitui/ 作者:[Marco Carmona][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 6fcd91b3cbb2c4222de6c980dfc59b18c11838af Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Tue, 26 Oct 2021 11:32:41 +0800 Subject: [PATCH 0828/1588] PRF --- ...I- A Blazing Fast Terminal Client for Git Written in Rust.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md b/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md index a3e656cfa6..51e442a5d6 100644 --- a/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md +++ b/published/20211020 GitUI- A Blazing Fast Terminal Client for Git Written in Rust.md @@ -26,7 +26,7 @@ GitUI: 用 Rust 编写的 Git 的快速命令行客户端 GitUI 的开发者在项目的 README 文件中分享了一些基准数据。 -| 时间 |内存(GB)| 二进制(MB)| 冻结 | 崩溃 +名称 | 时间 |内存(GB)| 二进制(MB)| 冻结 | 崩溃 ---|---|---|---|---|--- gitui | 24 s | 0.17 | 1.4 | 否 | 否 lazygit | 57 s | 2.6 | 16 | 是 | 有时 From 9c54e611a1534013d9fed3d159aa4d983e35f224 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 26 Oct 2021 17:01:24 +0800 Subject: [PATCH 0829/1588] Translating --- ...1 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md b/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md index 8d6dafd4d1..c27f3af3aa 100644 --- a/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md +++ b/sources/tech/20210911 How to Set JAVA_HOME Variable in Ubuntu Linux Correctly.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/set-java-home-ubuntu/" [#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "robsean" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 331e092c10d71f1e66e1b9d7f369af90d689804f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=83=91?= Date: Tue, 26 Oct 2021 17:03:46 +0800 Subject: [PATCH 0830/1588] Translating --- sources/tech/20210909 How to Change Color of Ubuntu Terminal.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md b/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md index c4cd318c4c..5981ab9d1a 100644 --- a/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md +++ b/sources/tech/20210909 How to Change Color of Ubuntu Terminal.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/change-terminal-color-ubuntu/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "robsean" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 677be8ac351edcdf146a7293a340b76ace8394f1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 Oct 2021 05:02:31 +0800 Subject: [PATCH 0831/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211027?= =?UTF-8?q?=20Ferdi:=20A=20Free=20&=20Open-Source=20Alternative=20to=20Fra?= =?UTF-8?q?nz=20&=20Rambox?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md --- ...en-Source Alternative to Franz - Rambox.md | 105 ++++++++++++++++++ 1 file changed, 105 insertions(+) create mode 100644 sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md diff --git a/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md b/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md new file mode 100644 index 0000000000..87b3549f4a --- /dev/null +++ b/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md @@ -0,0 +1,105 @@ +[#]: subject: "Ferdi: A Free & Open-Source Alternative to Franz & Rambox" +[#]: via: "https://itsfoss.com/ferdi/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Ferdi: A Free & Open-Source Alternative to Franz & Rambox +====== + +_**Brief:**_ _Ferdi is a promising open-source application with more free features as an alternative to Franz and Rambox. Let us explore more about it._ + +A single application to help you manage multiple services comes in handy when you do not want to do everything on your browser. While technically, you can, it may not be the most organized way of doing things. + +Hence, options like [Rambox][1] and [Franz][2] are pretty popular cross-platform solutions to sign in to several services and access all of them at a glance. + +Even though they both are available for Linux (and we’ve covered them separately), they offer limited features for free. + +In contrast, Ferdi is a fork of Franz offering many premium functionalities for free while aiming to provide a better experience. + +### Ferdi: Dabble With Multiple Applications in One Place + +![][3] + +Ferdi is a free and open-source application that lets you add multiple applications, including various messaging services, in one place. + +It also lets you customize various aspects of the application and its behavior. If you like applications like Rambox and Franz, you should explore more about Ferdi. + +### Features of Ferdi + +![][4] + +You can find tons of features available without needing to pay a premium. Here, I shall highlight some key features: + + * Cross-platform support (Linux, Windows, and macOS) + * Wide range of messaging services included (Slack, WhatsApp, Element, etc.) + * Supports signing in with Franz account + * Ability to password-protect messages + * Option to use your custom server + * Quick to-do list access with the option to use Franz Todo, Todoist, Microsoft To Do, Any.do, and more. + * Tweak performance by unloading applications when not in use (Hibernation) + * Private notification to hide your messages + * Do not disturb mode support + * Dark mode with the option to toggle every app added separately + * Cloud sync + * No restrictions on the number of accounts + * Ability to set up a proxy and connect through it + * Add multiple workspaces + + + +### Thoughts on Using Ferdi + +![][5] + +Just like Rambox and Franz, Ferdi won’t shy away from consuming a good chunk of your resources. So, you need to keep in mind whether you have enough memory (RAM) to have several applications active within Ferdi. + +It is good to have the option to unload applications when not in use. So, in case you are low on resources, you might want to utilize the Hibernation option. + +![][6] + +Ferdi also offers some advanced options like GPU acceleration, universal dark mode, privacy toggles, appearance customization, and more. You can even add custom services that you do not find listed. + +![][7] + +Overall, you get many features and choices when it comes to Ferdi. You should be able to organize multiple applications efficiently with the available set of options. + +### Installing Ferdi in Linux + +Ferdi offers multiple packages for easy installation on Linux. You can find a DEB/RPM package for Ubuntu/Fedora, an [AppImage file][8] for all other Linux distributions. + +They also provide a snap package along with the ability to install it via [AUR][9]. So, you have plenty of options to get it installed on your Linux computer. + +You can explore their [GitHub page][10] and head to its releases section to download them or visit the official site. + +[Download Ferdi][11] + +Have you tried Ferdi yet? Does it serve the purpose of replacing Franz or Rambox? Is it better? Share your experience in the comments down below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/ferdi/ + +作者:[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://itsfoss.com/rambox/ +[2]: https://itsfoss.com/franz-messaging-app/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-screenshot.png?resize=800%2C621&ssl=1 +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-screenshot-1.png?resize=800%2C584&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-custom-services.png?resize=800%2C586&ssl=1 +[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-workspaces.png?resize=800%2C627&ssl=1 +[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/ferdi-advanced-options.png?resize=800%2C541&ssl=1 +[8]: https://itsfoss.com/appimage-interview/ +[9]: https://itsfoss.com/aur-arch-linux/ +[10]: https://github.com/getferdi/ferdi +[11]: https://getferdi.com/ From 37ccb3c972a7fe8a8df53a3213cf8a54f2eb0fde Mon Sep 17 00:00:00 2001 From: DarkSun Date: Wed, 27 Oct 2021 05:02:52 +0800 Subject: [PATCH 0832/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211026?= =?UTF-8?q?=20Deploy=20Quarkus=20applications=20to=20Kubernetes=20using=20?= =?UTF-8?q?a=20Helm=20chart?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md --- ...ations to Kubernetes using a Helm chart.md | 161 ++++++++++++++++++ 1 file changed, 161 insertions(+) create mode 100644 sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md diff --git a/sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md b/sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md new file mode 100644 index 0000000000..a30b34c3cf --- /dev/null +++ b/sources/tech/20211026 Deploy Quarkus applications to Kubernetes using a Helm chart.md @@ -0,0 +1,161 @@ +[#]: subject: "Deploy Quarkus applications to Kubernetes using a Helm chart" +[#]: via: "https://opensource.com/article/21/10/quarkus-helm-chart" +[#]: author: "Daniel Oh https://opensource.com/users/daniel-oh" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Deploy Quarkus applications to Kubernetes using a Helm chart +====== +A developer's guide to serverless function deployment with Quarkus Helm +chart. +![Ships at sea on the web][1] + +Serverless functions are driving the fast adoption of DevOps development and deployment practices today. [Knative][2] on [Kubernetes][3] is one of the most popular serverless platforms to adopt serverless function architectures successfully. But developers must understand how serverless capabilities are specified using a combination of Kubernetes APIs, Knative resources, and function-oriented programming. DevOps teams also need to standardize runtime stacks (that is, application runtime, builder image, deployment configuration, and health check) to execute the functions on Kubernetes. What if you, a developer, could set this up with familiar technology and practice? + +This article guides you on the way developers can get started with serverless function deployment with the [Quarkus][4] [Helm][5] chart on Kubernetes. Furthermore, developers can avoid the extra work of developing a function from scratch, optimizing the application, and deploying it to Kubernetes. + +If you haven't experienced using Helm for cloud-native application deployments on Kubernetes, I will tell you what Helm is and what benefits you have with it. Helm is one of the most popular package managers for Kubernetes. Helm provides a chart that simplifies Kubernetes resources within a single package file for an application build and deployment. Developers can install the chart to Kubernetes using the Helm command-line interface or graphical dashboard. + +### Install Quarkus Helm chart + +In this article, you'll use [OpenShift Kubernetes Distribution][6] (OKD) built on Kubernetes with application lifecycle management functionality and DevOps tooling. If you haven't installed the Helm feature on your OKD cluster yet, follow the [installation document][7]. + +Before building a Quarkus application using a Quarkus Helm chart, you need to create pull and push secrets in your OKD cluster. You use the secrets to pull a builder image from an external container registry and then push it to the registry.  + +**Note:** You can skip this step if you don't need to use an external container registry during application build or deploy the application to the OKD cluster. + +Create a pull secret using the following [oc command][8]: + + +``` +$ oc create secret docker-registry my-pull-secret \ +\--docker-server=$SERVER_URL \ +\--docker-username=$USERNAME \ +\--docker-password=$PASSWORD \ +\--docker-email=$EMAIL +``` + +Then, create a push secret using the following command: + + +``` +$ oc create secret docker-registry my-push-secret \ +\--docker-server=$SERVER_URL \ +\--docker-username=$USERNAME \ +\--docker-password=$PASSWORD \ +\--docker-email=$EMAIL +``` + +Install the Quarkus Helm chart: + + +``` +$ helm repo add quarkus \ + +``` + +### Build and deploy Quarkus application using Helm chart + +Go to the **Developer** console in the OKD cluster, click on Helm chart in **+Add** menu. Then type in _quarkus_ in the search box. Click on the **Quarkus v0.0.3** helm chart, as shown below. + +**Note:** You'll need to create a _quarkus-helm project_ (namespace) to install a Quarkus Helm chart in your OKD cluster. + +![Search Quarkus Helm chart][9] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +Click on **Install Helm Chart**, as shown below. + +![Install Helm chart][11] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +Switch the editor to **YAML** view, then paste the following build and deploy configurations: + + +``` +build: +  uri: +  ref: master +  env: +    - name: S2I_SOURCE_DEPLOYMENTS_FILTER +      value: "*-runner.jar lib*" +deploy: +  readinessProbe: +    httpGet: +      path: /health/ready +      port: http +    tcpSocket: null +  livenessProbe: +    httpGet: +      path: /health/live +      port: http +    tcpSocket: null +``` + +Then, click on the **Install** button, as shown below. + +![YAML editor][12] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +Find more values to configure the Quarkus helm chart [here][13]. + +Once the chart gets installed successfully, you'll see the following Quarkus pod in the Topology view, as shown below. + +![Topology view][14] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +**Note:** You might see _ErrImagePull_ and _ImagePullBackOff_ in **Deployments** while the build is processing. Once the build completes, your image gets automatically rolled out. + +Click on the **Open URL** icon. It brings you to the **todos** application. Let's try to add a few items for fun, as shown below. + +![Todos applications][15] + +(Daniel Oh, [CC BY-SA 4.0][10]) + +### Conclusion + +You've learned the way developers can build Quarkus applications and deploy them to Kubernetes/OpenShift cluster in a few minutes using a Helm chart. The developers can manage the application runtime stack in terms of upgrade, rollback, uninstall, and add new configurations such as application health check, replication without changing the application source code or developing new Kubernetes manifestos with YAML files. This minimizes developers' burden to keep leveraging application runtimes other than implementing business logic on Kubernetes. For more information to follow on Quarkus journey here: + + * [A Java developer's guide to Quarkus][16] + * [3 reasons Quarkus 2.0 improves developer productivity on Linux][17] + * [Optimize Java serverless functions in Kubernetes][18] + + + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/quarkus-helm-chart + +作者:[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/kubernetes_containers_ship_lead.png?itok=9EUnSwci (Ships at sea on the web) +[2]: https://knative.dev/docs/ +[3]: https://opensource.com/article/19/6/reasons-kubernetes +[4]: https://quarkus.io/ +[5]: https://helm.sh/ +[6]: https://www.okd.io/ +[7]: https://docs.okd.io/latest/applications/working_with_helm_charts/installing-helm.html +[8]: https://docs.okd.io/latest/cli_reference/openshift_cli/getting-started-cli.html +[9]: https://opensource.com/sites/default/files/uploads/search-quarkus-helm-chart.png (Search Quarkus Helm chart) +[10]: https://creativecommons.org/licenses/by-sa/4.0/ +[11]: https://opensource.com/sites/default/files/uploads/install-hel-chart.png (Install Helm chart) +[12]: https://opensource.com/sites/default/files/uploads/yaml-editor.png (YAML editor) +[13]: https://github.com/redhat-developer/redhat-helm-charts/tree/master/alpha/quarkus-chart#values +[14]: https://opensource.com/sites/default/files/uploads/topology-view.png (Topology view) +[15]: https://opensource.com/sites/default/files/uploads/todos-applications.png (Todos applications) +[16]: https://opensource.com/article/21/8/java-quarkus-ebook +[17]: https://opensource.com/article/21/7/developer-productivity-linux +[18]: https://opensource.com/article/21/6/java-serverless-functions-kubernetes From 2d49fe81a50a2378f52f383347af4386abc5d6f9 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Oct 2021 08:33:58 +0800 Subject: [PATCH 0833/1588] translated --- ... Distros Using Xfce Desktop Environment.md | 113 ------------------ ... Distros Using Xfce Desktop Environment.md | 113 ++++++++++++++++++ 2 files changed, 113 insertions(+), 113 deletions(-) delete mode 100644 sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md create mode 100644 translated/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md diff --git a/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md b/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md deleted file mode 100644 index 16eccaf8fd..0000000000 --- a/sources/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md +++ /dev/null @@ -1,113 +0,0 @@ -[#]: subject: "How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment" -[#]: via: "https://itsfoss.com/install-themes-xfce-xubuntu/" -[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment -====== - -_**Brief: This is a step-by-step beginner’s tutorial to show how to install themes and icons in Xubuntu and other Linux distributions that use Xfce desktop environment.**_ - -Installing themes on Xubuntu is similar to Ubuntu or any other Linux distribution. You put the theme files in the ~/.themes folder and then use a tool to change it. - -However, some options or the user interface will look different considering Xubuntu uses the [Xfce desktop environment][1]. This is why I created this specific tutorial to show the steps with proper screenshots. - -### Install new themes in Xubuntu (Xfce) - -To get started, you need to create a **.themes** folder in the home directory. Mind the dot (.) before the folder name. It’s important and hides the folder from normal view. - -To check if you already have it, you can [enable viewing hidden files][2] and then create it if it isn’t present. - -![][3] - -Once done, you need to download a theme. - -1\. You can browse for XFCE themes on the [Xfce-look][4] portal. All you have to do is download the archive (compressed) file. - -2\. Next, you need to [extract the zip file][5], as shown in the screenshot below. - -![][6] - -3\. Once you extract it, you will notice a folder appear, and you will have to copy it. - -![][7] - -4\. You will have to then paste this folder into the **.themes** directory that you created initially. - -![][8] - -5\. Finally, you need to head to the Appearance setting to find it listed and select it/apply it for it to take effect. - -![][9] - -As you notice in the screenshot below, the new theme has been added and applied: - -![][10] - -In addition to the theme, if you need to customize the icons of your Xubuntu desktop, you need to create another .icons folder in the home directory. - -Like you installed the theme, you will have to follow a similar process to apply the icon themes. - -To give you an example, let me highlight those steps here: - -### Adding icon themes in Xubuntu (Xfce) - -You can browse through the same [xfce-look portal][11] to look for complete icon themes. - -Or, you can explore some of the best [icon themes available for Ubuntu][12] that should work for Xubuntu as well. - -Once you find the one you like, download it, and extract it as shown below. - -![][13] - -Next, you will have to copy and paste the folder into the .**icons** folder. - -![][14] - -Now, you can head back to the Appearance settings and find the icon listed under the “Icons” available. - -To show you the difference, **I changed the default Xubuntu theme to adwaita-dark**, as you can see here: - -![][15] - -**Note**: Some icon or theme files may contain nested folders with different variants in it. You’ll notice that they do not appear in the appearance tool. If that’s the case, copy the inner folder directly in ~/.themes or ~/.icons folder. - -### Wrapping Up - -With both the style and icons tweaked, you can [customize your Xubuntu experience][16] to blend in with your taste. - -Do you prefer the default Xubuntu look or customize the look of it using different themes/icons? Let me know your thoughts in the comments. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/install-themes-xfce-xubuntu/ - -作者:[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://xfce.org/ -[2]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ -[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-hidden-files.png?resize=674%2C300&ssl=1 -[4]: https://www.xfce-look.org/browse?cat=138&ord=latest -[5]: https://itsfoss.com/unzip-linux/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/extract-xubuntu-theme.png?resize=719%2C537&ssl=1 -[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/extracted-xubuntu-theme.png?resize=709%2C272&ssl=1 -[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/copy-theme-xubuntu.png?resize=705%2C328&ssl=1 -[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/appearance-xfce.png?resize=703%2C544&ssl=1 -[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xpro-xubuntu-theme.png?resize=1162%2C599&ssl=1 -[11]: https://www.xfce-look.org/browse?cat=132&ord=latest -[12]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ -[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme.png?resize=756%2C560&ssl=1 -[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-selection.png?resize=739%2C534&ssl=1 -[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-change.png?resize=1154%2C619&ssl=1 -[16]: https://itsfoss.com/customize-xfce/ diff --git a/translated/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md b/translated/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md new file mode 100644 index 0000000000..cc9182c5c9 --- /dev/null +++ b/translated/tech/20211023 How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment.md @@ -0,0 +1,113 @@ +[#]: subject: "How to Install themes on Xubuntu and Other Distros Using Xfce Desktop Environment" +[#]: via: "https://itsfoss.com/install-themes-xfce-xubuntu/" +[#]: author: "Ankush Das https://itsfoss.com/author/ankush/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +如何在 Xubuntu 和其他发行版上使用 Xfce 桌面环境安装主题 +====== + +_**简介:这是一个循序渐进的初学者教程,展示了如何在 Xubuntu 和其他使用 Xfce 桌面环境的 Linux 发行版中安装主题和图标。**_ + +在 Xubuntu 上安装主题与 Ubuntu 或其他 Linux 发行版类似。你把主题文件放在 ~/.themes 文件夹中,然后用一个工具来改变它。 + +然而,考虑到 Xubuntu 使用 [Xfce 桌面环境][1],一些选项或用户界面看起来会有所不同。这就是为什么我创建了这个教程,用适当的截图来展示步骤。 + +### 在 Xubuntu(Xfce)中安装新主题 + +开始前,你需要在主目录下创建一个 **.themes** 文件夹。注意文件夹名称前的点(.)。它很重要,可以从正常的视图中隐藏该文件夹。 + +要检查你是否已经有了它,你可以[启用查看隐藏文件][2],然后在它不存在的时候创建它。 + +![][3] + +完成后,你需要下载一个主题。 + +1\. 你可以在 [Xfce-look][4] 门户网站上浏览 XFCE 主题。你所要做的就是下载存档(压缩)文件。 + +2\. 接下来,你需要[解压缩文件][5],如下面的截图所示。 + +![][6] + +3\. 解压后,你会发现出现一个文件夹,你要复制它。 + +![][7] + +4\. 然后你要把这个文件夹粘贴到你最初创建的 **.themes** 目录中。 + +![][8] + +5\. 最后,你需要到外观设置中找到它,并选择它/应用它以使其生效。 + +![][9] + +正如你在下面的截图中注意到的,新的主题已经被添加和应用: + +![][10] + +除了主题之外,如果你需要定制你的 Xubuntu 桌面的图标,你需要在主目录中创建另一个 .icons 文件夹。 + +就像你安装主题一样,你将不得不遵循一个类似的过程来应用图标主题。 + +为了给你一个例子,让我在这里强调这些步骤: + +### 在 Xubuntu(Xfce) 中添加图标主题 + +你可以浏览同样的 [xfce-look portal][11] 来寻找完整的图标主题。 + +或者,你可以探索一些最好的[可用于 Ubuntu 的图标主题][12],它们应该也适用于 Xubuntu。 + +一旦你找到了你喜欢的,就下载它,并按下面的方式解压。 + +![][13] + +接下来,你需要把这个文件夹复制并粘贴到 **.icons** 文件夹中。 + +![][14] + +现在,你可以回到外观设置中,找到列在“图标”下的可用图标。 + +为了向你展示区别,**我把默认的 Xubuntu 主题改为 adwaita-dark**,你可以在这里看到: + +![][15] + +**注意**:一些图标或主题文件可能包含有不同变体的嵌套文件夹。你会注意到它们并没有出现在外观工具中。如果是这种情况,直接将内部文件夹复制到 ~/.themes 或 ~/.icons 文件夹中。 + +### 总结 + +通过对风格和图标的调整,你可以[定制你的 Xubuntu 体验][16]以融入你的品味。 + +你是喜欢默认的 Xubuntu 外观还是使用不同的主题/图标来定制它的外观?请在评论中告诉我你的想法。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/install-themes-xfce-xubuntu/ + +作者:[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://xfce.org/ +[2]: https://itsfoss.com/hide-folders-and-show-hidden-files-in-ubuntu-beginner-trick/ +[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-hidden-files.png?resize=674%2C300&ssl=1 +[4]: https://www.xfce-look.org/browse?cat=138&ord=latest +[5]: https://itsfoss.com/unzip-linux/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/extract-xubuntu-theme.png?resize=719%2C537&ssl=1 +[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/extracted-xubuntu-theme.png?resize=709%2C272&ssl=1 +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/copy-theme-xubuntu.png?resize=705%2C328&ssl=1 +[9]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/appearance-xfce.png?resize=703%2C544&ssl=1 +[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xpro-xubuntu-theme.png?resize=1162%2C599&ssl=1 +[11]: https://www.xfce-look.org/browse?cat=132&ord=latest +[12]: https://itsfoss.com/best-icon-themes-ubuntu-16-04/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme.png?resize=756%2C560&ssl=1 +[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-selection.png?resize=739%2C534&ssl=1 +[15]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/xubuntu-icon-theme-change.png?resize=1154%2C619&ssl=1 +[16]: https://itsfoss.com/customize-xfce/ From bb903069639dab9dc8465441ebe8a9b6d57a20d6 Mon Sep 17 00:00:00 2001 From: geekpi Date: Wed, 27 Oct 2021 08:39:34 +0800 Subject: [PATCH 0834/1588] translating --- ... Linux to Easily Add Essential Annotations to Your Images.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md b/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md index 5b0ab80344..5d0d20348b 100644 --- a/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md +++ b/sources/tech/20211019 Annotator- Open-Source App for Linux to Easily Add Essential Annotations to Your Images.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/annotator/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 10a7f74a5db85a4e708682ac21c1a13095c785dc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 10:03:53 +0800 Subject: [PATCH 0835/1588] PRF @unigeorge --- ...10911 Play with model trains in OpenTTD.md | 77 ++++++++++--------- 1 file changed, 39 insertions(+), 38 deletions(-) diff --git a/translated/tech/20210911 Play with model trains in OpenTTD.md b/translated/tech/20210911 Play with model trains in OpenTTD.md index 4b510e93ea..fc0236218a 100644 --- a/translated/tech/20210911 Play with model trains in OpenTTD.md +++ b/translated/tech/20210911 Play with model trains in OpenTTD.md @@ -3,17 +3,18 @@ [#]: author: "Seth Kenlon https://opensource.com/users/seth" [#]: collector: "lujun9972" [#]: translator: "unigeorge" -[#]: reviewer: " " +[#]: reviewer: "wxy" [#]: publisher: " " [#]: url: " " 在 OpenTTD 中玩模型火车 ====== -想玩实体模型火车,却没有足够大的空间?试试 OenTTD 中的虚拟火车吧。 -![Old train][1] +> 想玩实体模型火车,却没有足够大的空间?试试 OpenTTD 中的虚拟火车吧。 -我父亲一直很喜欢火车模型,我记得我小时候,曾看着他在圣诞树周围建了一整条轨道。当[乐高][2]火车套装发布时,因其便利性和固有可扩展性,我们转而投向了乐高火车的怀抱。多年来,我们热衷于建造和改装乐高火车及单轨轨道。我经常想象,未来我会有一个车库或地下室,专门用于微型景观和电动汽笛火车。强调一下,我沉迷于另一个爱好的可能性非常低,所以当发现 _虚拟_ 模型铁路可以为我提供相同的满足感时,我很开心。我的虚拟爱好引擎是 [OpenTTD][3],这是一款基于名为 **Transport Tycoon Deluxe** 的 90 年代老游戏的开源模拟游戏。 +![](https://img.linux.net.cn/data/attachment/album/202110/27/100255emc3x33icci0cacc.jpg) + +我父亲一直很喜欢火车模型,我记得我小时候,曾看着他在圣诞树周围建了一整条轨道。当 [乐高][2] 火车套装发布时,因其便利性和固有可扩展性,我们转而投向了乐高火车的怀抱。多年来,我们热衷于建造和改装乐高火车及单轨轨道。我经常想象,未来我会有一个车库或地下室,专门用于微型景观和电动汽笛火车。强调一下,我沉迷于另一个爱好的可能性非常低,所以当发现 _虚拟_ 模型铁路可以为我提供相同的满足感时,我很开心。我的虚拟爱好引擎是 [OpenTTD][3],这是一款基于名为 **Transport Tycoon Deluxe** 的 90 年代老游戏的开源模拟游戏。 ### 安装 OpenTTD @@ -25,7 +26,7 @@ $ sudo apt install ./openttd*deb ``` -如果你在使用其他 Linux 发行版,请下载通用安装程序,并使用 [`tar` 命令][6]解压缩包: +如果你在使用其他 Linux 发行版,请下载通用安装程序,并使用 [tar 命令][6]解压缩包: ``` $ tar xvf openttd-x.yy.z-linux*.tar.xz @@ -44,51 +45,51 @@ $ cd openttd* $ ./openttd & ``` -首次启动 OpenTTD 时,游戏会提示必须下载图形集,在 Steam 版中会自动安装,但在独立应用程序中需要单击一下鼠标。无论如何,因为 OpenTTD 是开源的,经过了很好的改进,所以在默认图形之外,你最终还会下载的还有很多其他图形。 +首次启动 OpenTTD 时,游戏会提示必须下载图像集,在 Steam 版中会自动安装,但在独立应用程序中需要单击一下鼠标。无论如何,因为 OpenTTD 是开源的,经过了很好的改进,所以在默认图像之外,你最终还会下载的还有很多其他图像。 -下载图形集后,你会看到一个古色古香的小型界面。我觉得 640x480 的界面有点小,虽然旧图形界面确实更有年代感(那时计算能力还比较弱),但一些适配现代屏幕的轻度升级还是很好用的。因此,您的第一步操作就是点击“**检查在线内容**Check online content”按钮。 +下载图像集后,你会看到一个古色古香的小型界面。我觉得 640x480 的界面有点小,虽然旧图像界面确实更有年代感(那时计算能力还比较弱),但一些适配现代屏幕的轻度升级还是很好用的。因此,你的第一步操作就是点击“检查在线内容Check online content”按钮。 ### 加载模组 -“**内容下载**Content downloading”界面是一个查看已通过审查的 OpenTTD 模组mod的窗口,可以提供个性化的改进图形界面、全新音乐、火车模型和地图名称。我使用了新西兰全套配置,所以对我来说,生成的所有城市都很熟悉,尽管 2020 年我转而开始使用“辐射 3”套装了。模组 _非常多_,可以使用右上角的搜索栏来缩小选择范围。 +“内容下载Content downloading”界面是一个查看已通过审查的 OpenTTD 模组mod的窗口,可以提供个性化的改进图像界面、全新音乐、火车模型和地图名称。我使用了新西兰全套配置,所以对我来说,生成的所有城市都很熟悉,尽管 2020 年我转而开始使用“辐射 3”套装了。模组 _非常多_,可以使用右上角的搜索栏来缩小选择范围。 下面是一些个人认为必备的模组: - * **abase** \- 高分辨率图形。将近 300 MB,这可能是你玩此游戏需要的最大一次下载(游戏本身只有 50 MB)。 - * **OpenSFX** \- 一个声音合集。让你能听到城市中的交通声、船运的喇叭声以及很棒的火车汽笛声。 - * **Town names** \- 城镇名称。默认的城市名称很有趣,但我认为记一些本地化的名称更容易。 - * **Trains** \- 火车模组。OpenTTD 有一组运行良好的默认火车模型,但如果你已经是一名火车观察员,那你可能会喜欢下载一些额外的火车模型。我使用的是 NZR 火车合集,但还有很多火车也是可用的,包括来自英国、美国、奥地利、比利时、捷克共和国的车,以及按字母表顺序排列的许多其他火车。 - * **Beginner tutorial** \- 新手教程。是一个帮你学习游戏及界面的引导场景。 + * **abase** - 高分辨率图像。将近 300 MB,这可能是你玩此游戏需要的最大一次下载(游戏本身只有 50 MB)。 + * **OpenSFX** - 一个声音合集。让你能听到城市中的交通声、船运的喇叭声以及很棒的火车汽笛声。 + * **Town names** - 城镇名称。默认的城市名称很有趣,但我认为记一些本地化的名称更容易。 + * **Trains** - 火车模组。OpenTTD 有一组运行良好的默认火车模型,但如果你已经是一名火车观察员,那你可能会喜欢下载一些额外的火车模型。我使用的是 NZR 火车合集,但还有很多火车也是可用的,包括来自英国、美国、奥地利、比利时、捷克共和国的车,以及按字母表顺序排列的许多其他火车。 + * **Beginner tutorial** - 新手教程。是一个帮你学习游戏及界面的引导场景。 ### 游戏引擎默认值 -下载新“资产”后,你需要将它们设置为默认值。有两个设置的地方:游戏引擎默认值、游戏内脚本与资产。 +下载新素材后,你需要将它们设置为默认值。有两个设置的地方:游戏引擎默认值、游戏内脚本与素材。 ![OpenTTD main menu][8] -OpenTTD 菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*OpenTTD 菜单(Seth Kenlon, [CC BY-SA 4.0][9])* -单击“**游戏选项**Game Options”按钮。 在**游戏选项**屏幕中,调整以下设置: +单击“游戏选项Game Options”按钮。 在游戏选项屏幕中,调整以下设置: - * 将**屏幕分辨率**screen resolution设置为你喜欢的界面尺寸。 - * 将**基础图形集** base graphics set设置为 **abase**。 - * 将**基础声音设置**base sounds set设置为 **OpenSFX**。 + * 将屏幕分辨率screen resolution设置为你喜欢的界面尺寸。 + * 将基础图像集 base graphics set设置为 **abase**。 + * 将基础声音设置base sounds set设置为 **OpenSFX**。 -关闭**游戏选项**屏幕。你的改动会自动保存。 +关闭游戏选项屏幕。你的改动会自动保存。 ### 游戏选项 -在主菜单界面,单击“**NewGRF 设置**NewGRF Settings”按钮。 +在主菜单界面,单击“NewGRF 设置NewGRF Settings”按钮。 ![NewGRF settings window][10] -NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9])* -未活动的模组显示在 **NewGRF 设置**窗口的下半部分。要激活一个未活动的模组,请选择它并单击左下角的“**添加**Add”按钮。选择要激活的模组后,再单击“**应用**Apply”按钮。 +未活动的模组显示在 NewGRF 设置窗口的下半部分。要激活一个未活动的模组,请选择它并单击左下角的“添加Add”按钮。选择要激活的模组后,再单击“应用Apply”按钮。 ### 教程 -如果你下载了“**初学者教程**Beginner tutorial”场景,可以通过它来学习 OpenTTD。开始教程请单击主菜单屏幕顶部附近的“**播放场景**Play scenario” 按钮,然后选择该教程并开始。 +如果你下载了“初学者教程Beginner tutorial”场景,可以通过它来学习 OpenTTD。开始教程请单击主菜单屏幕顶部附近的“播放场景Play scenario” 按钮,然后选择该教程并开始。 初学者教程有着游戏界面的完整浏览流程,全部完成需要花费一些时间。 @@ -96,25 +97,25 @@ NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) 现在我们快速介绍一下,此处你要了解以下内容:车辆出自仓库,一切活动都需要时间表。记住这两条规则,你可以立即开始建造火车(以及道路、海港和机场)。 -#### **建造车站** +#### 建造车站 要在两个城市之间建立一条简单的铁路线,请单击顶部图标栏中的铁路轨道图标。 ![New icon bar - railway option][11] -新建图标栏——铁路选项(Seth Kenlon, [CC BY-SA 4.0][9]) +*新建图标栏——铁路选项(Seth Kenlon, [CC BY-SA 4.0][9])* -铁路以车站开始和结束,所以我通常在预定线路的两端各放置一个车站。单击火车站图标(将鼠标悬停在其上方可查看其标签)。一个火车站要服务于一个地区,其作用范围必须与该地区尽量多地重叠。要查看车站的覆盖范围,请通过单击车站对话框底部的“**开启**On”按钮以启用**覆盖区域高亮**Coverage area highlight功能。 +铁路以车站开始和结束,所以我通常在预定线路的两端各放置一个车站。单击火车站图标(将鼠标悬停在其上方可查看其标签)。一个火车站要服务于一个地区,其作用范围必须与该地区尽量多地重叠。要查看车站的覆盖范围,请通过单击车站对话框底部的“开启On”按钮以启用覆盖区域高亮Coverage area highlight功能。 ![Station coverage window][12] -车站覆盖信息窗口(Seth Kenlon, [CC BY-SA 4.0][9]) +*车站覆盖信息窗口(Seth Kenlon, [CC BY-SA 4.0][9])* 黑色网格表示覆盖范围,而白色网格显示车站的物理占据范围。当你将鼠标悬停在一个区域上时,车站的覆盖范围所需耗材会在弹出窗口中列出。从简单的开始,创建一个单轨 4 辆车的站台。在地图上的两个城市之间重复执行此操作两次。 ![create station menu][13] -创建车站菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*创建车站菜单(Seth Kenlon, [CC BY-SA 4.0][9])* ### 铺设铁轨 @@ -124,21 +125,21 @@ NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) ### 火车车库 -火车来自车库depot。因此,要在铁路上添加火车,必须在沿线的某处添加一个车库。单击车库图标并在现有铁路附近放置。将车库连接到现有轨道,以确保您的火车可以从车库到达适当线路的(在此简单示例中,线路是唯一的)。 +火车来自车库depot。因此,要在铁路上添加火车,必须在沿线的某处添加一个车库。单击车库图标并在现有铁路附近放置。将车库连接到现有轨道,以确保你的火车可以从车库到达适当线路的(在此简单示例中,线路是唯一的)。 ![create depot menu][14] -建造车库菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*建造车库菜单(Seth Kenlon, [CC BY-SA 4.0][9])* ### 模型火车 终于,你可以将虚拟模型火车添加到虚拟铁路中了。要创建火车,请单击车库。 -单击站点窗口底部的“**新建车辆**New Vehicle”按钮,会列出可用的火车引擎和汽车。列表会部分取决于你从可下载内容中添加的模型。一般来说,发动机分为三种:蒸汽发动机、柴油发动机和电动发动机。游戏内时间从 1950 年开始,所以早期你只有蒸汽可选。随着时间推进,你会获得可用于升级的创新型新模型。 +单击站点窗口底部的“新建车辆New Vehicle”按钮,会列出可用的火车引擎和汽车。列表会部分取决于你从可下载内容中添加的模型。一般来说,发动机分为三种:蒸汽发动机、柴油发动机和电动发动机。游戏内时间从 1950 年开始,所以早期你只有蒸汽可选。随着时间推进,你会获得可用于升级的创新型新模型。 ![create train menu][15] -创建火车菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*创建火车菜单(Seth Kenlon, [CC BY-SA 4.0][9])* 现在创建一个简单的火车,其中包括一节引擎、一节客车和一节邮车。如果想添加其他类型的车厢,请单击站点以确认它们的可提供车型(由其覆盖区域决定) @@ -150,15 +151,15 @@ NewGRF 设置菜单(Seth Kenlon, [CC BY-SA 4.0][9]) ![create schedule menu][16] -创建时刻表菜单(Seth Kenlon, [CC BY-SA 4.0][9]) +*创建时刻表菜单(Seth Kenlon, [CC BY-SA 4.0][9])* -要创建时间表,请单击时间表窗口底部的“**前往**Go To”按钮,然后单击要设置成第一个目的地的车站。然后点击下一站。你可以在时间表中选择一个停靠点,浏览“**满载**Full load”和“**卸载**Unload”下拉菜单中的选项,以此调整装卸要求,并且可以在“**无停靠**Non-stop”下拉菜单中调整路线(如果开发了新路线)。选项有很多,随着城市发展和地图完善,你可能需要随时调整策略。 +要创建时间表,请单击时间表窗口底部的“前往Go To”按钮,然后单击要设置成第一个目的地的车站。然后点击下一站。你可以在时间表中选择一个停靠点,浏览“满载Full load”和“卸载Unload”下拉菜单中的选项,以此调整装卸要求,并且可以在“无停靠Non-stop”下拉菜单中调整路线(如果开发了新路线)。选项有很多,随着城市发展和地图完善,你可能需要随时调整策略。 -但是现在,单击火车视口底部的红色“**已停止**Stopped”按钮,让火车投入使用吧! +但是现在,单击火车视口底部的红色“已停止Stopped”按钮,让火车投入使用吧! ![train moving from station to station][17] -在役中的火车(Seth Kenlon, [CC BY-SA 4.0][9]) +*在役中的火车(Seth Kenlon, [CC BY-SA 4.0][9])* ### 试试 OpenTTD 吧 @@ -173,7 +174,7 @@ via: https://opensource.com/article/21/9/model-trains-openttd 作者:[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 dbd55563702106bc196229bc310c59e0751a6cc9 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 10:05:44 +0800 Subject: [PATCH 0836/1588] PUB @unigeorge https://linux.cn/article-13924-1.html --- .../20210911 Play with model trains in OpenTTD.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20210911 Play with model trains in OpenTTD.md (99%) diff --git a/translated/tech/20210911 Play with model trains in OpenTTD.md b/published/20210911 Play with model trains in OpenTTD.md similarity index 99% rename from translated/tech/20210911 Play with model trains in OpenTTD.md rename to published/20210911 Play with model trains in OpenTTD.md index fc0236218a..d07f1699f9 100644 --- a/translated/tech/20210911 Play with model trains in OpenTTD.md +++ b/published/20210911 Play with model trains in OpenTTD.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "unigeorge" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13924-1.html" 在 OpenTTD 中玩模型火车 ====== From a9126acdda4f4b5e34056ec65fe5626797770e3c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 12:15:58 +0800 Subject: [PATCH 0837/1588] APL --- .../20211019 Why Mark Text is my favorite markdown editor.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md b/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md index dcd5521a5e..418252b8ce 100644 --- a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md +++ b/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md @@ -2,7 +2,7 @@ [#]: via: "https://opensource.com/article/21/10/mark-text-markdown-editor" [#]: author: "Don Watkins https://opensource.com/users/don-watkins" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "wxy" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 262902a5bae7efc843b6636fc91992ce78106079 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 14:13:33 +0800 Subject: [PATCH 0838/1588] TSL&PRF --- ...ark Text is my favorite markdown editor.md | 97 ------------------- ...ark Text is my favorite markdown editor.md | 92 ++++++++++++++++++ 2 files changed, 92 insertions(+), 97 deletions(-) delete mode 100644 sources/tech/20211019 Why Mark Text is my favorite markdown editor.md create mode 100644 translated/tech/20211019 Why Mark Text is my favorite markdown editor.md diff --git a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md b/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md deleted file mode 100644 index 418252b8ce..0000000000 --- a/sources/tech/20211019 Why Mark Text is my favorite markdown editor.md +++ /dev/null @@ -1,97 +0,0 @@ -[#]: subject: "Why Mark Text is my favorite markdown editor" -[#]: via: "https://opensource.com/article/21/10/mark-text-markdown-editor" -[#]: author: "Don Watkins https://opensource.com/users/don-watkins" -[#]: collector: "lujun9972" -[#]: translator: "wxy" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Why Mark Text is my favorite markdown editor -====== -Mark Text has tools that make it easy to write markdown while at the -same time providing a simple interface that just gets out of my way. -![Typewriter keys in multicolor][1] - -I got introduced to the markdown format a few years ago when I began to explore Jupyter Notebooks. Many of the other writers at Opensource.com knew markdown, but it was a skill that was unfamiliar to me. - -Markdown is a standard way of writing text, in which you use minimal notation to _markup_ how you want the text styled. For instance, instead of clicking a button to make a word bold, you surround the word with two asterisks (**word**). This has two effects: - - * Visually suggests emboldened text when viewed as plain text - * Appears as bold, given a good text converter or renderer (such as Pandoc or a good markdown text editor) - - - -One of the greatest advantages of markdown is that most of its notation is intuitive and derived from habits most of us already have. It just makes sense to emphasize words with asterisks, mark headlines with characters to set them apart, and so on. - -Everyone spoke highly of it, but I wasn't sure why I would need to learn and use markdown. However, I'm a curious person, and I began to explore markdown and how it might figure into my writing. - -### Learning markdown - -I enjoyed using a markdown [cheat sheet][2] as I learned. I found markdown to be an excellent tool for writing anything, and I love that I don't even need a special markdown editor. Any text editor can write markdown because markdown uses standard text to denote style. So I started using simple editors like Vim or gedit (or any other editor) and consulted the cheat sheet to remember the simple formatting rules. - -I've been journaling this year as a way of organizing my thoughts and learning more about markdown. I've recently tried the [Ghostwriter][3] text editor, an excellent editor with some extra markdown-specific features. Markdown has become so popular now that many editors incorporate or make it their focus to include syntax highlighting, hints, and other features that make it easy to work in markdown. They're not must-have features, but when you have them, they're nice to have.  - -### Trying Mark Text - -While reading a blog, I discovered [Mark Text][4]. Mark Text has tools that make it easy to write markdown while at the same time providing a simple interface that just gets out of my way. Mark Text has six themes: Three light and three dark themes. Dark themes are easier for me to use. The [user documentation][5] is excellent, and there is markdown [syntax help][6] available too.  - -### Markdown in real time - -Mark Text provides a real-time preview with a clean and simple interface. It supports the [Commonmark][7] spec, Github Flavored Markdown spec, and Pandoc Markdown. According to its website, Mark Text also supports markdown extensions like KaTex, front matter, and emoji. It outputs HTML and PDF files.  - -Mark Text has various editing modes like typewriter mode, source code mode, and focus mode. Adding images is a snap, as you can simply copy and paste them from your clipboard. - -A pop-up at the upper left of the Mark Text window displays the number of characters and paragraphs entered so far. That's really helpful as a writer. - -Saving files is easy from the menu at the upper left of the Mark Text window or use **Ctrl+S**. In fact, the menus of Mark Text look friendly and familiar to anyone who's used to a basic text editor or word processor. - -![Mark Text file menu][8] - -(Don Watkins, [CC BY-SA 4.0][9]) - -I love that Mark Text supports various formats with simple keystroke shortcuts, including table blocks, diagrams, in-line formats, math formula blocks, and other code blocks. - -You can download Mark Text for your operating system from the following links: - - * [Linux][10] - * [macOS][11] - * [Windows][12] - - - -Mark Text is open source with an [MIT][13] license. You can always [download][14] the latest version. - -Alternatively, you can install Mark Text on macOS with `brew install --cask mark-text` and on Windows with [Chocolatey][15] by entering `choco install marktext`. - -Mark Text is always looking for sponsors and developers. The project has a [guide][16] for contributors. In addition, you can support the project on Patreon and Open Collective. - --------------------------------------------------------------------------------- - -via: https://opensource.com/article/21/10/mark-text-markdown-editor - -作者:[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/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor) -[2]: https://opensource.com/downloads/cheat-sheet-markdown -[3]: https://wereturtle.github.io/ghostwriter/ -[4]: https://marktext.app/ -[5]: https://github.com/marktext/marktext/blob/master/docs/README.md -[6]: https://github.com/marktext/marktext/blob/master/docs/MARKDOWN_SYNTAX.md -[7]: https://commonmark.org/ -[8]: https://opensource.com/sites/default/files/uploads/mark-test-file-menu.png (Mark Text file menu) -[9]: https://creativecommons.org/licenses/by-sa/4.0/ -[10]: https://github.com/marktext/marktext/releases/latest/download/marktext-x86_64.AppImage -[11]: https://github.com/marktext/marktext/releases/latest/download/marktext.dmg -[12]: https://github.com/marktext/marktext/releases/latest/download/marktext-setup.exe -[13]: https://github.com/marktext/marktext/blob/develop/LICENSE -[14]: https://github.com/marktext/marktext/releases -[15]: https://chocolatey.org/ -[16]: https://github.com/marktext/marktext/blob/develop/CONTRIBUTING.md diff --git a/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md b/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md new file mode 100644 index 0000000000..aa449595c1 --- /dev/null +++ b/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md @@ -0,0 +1,92 @@ +[#]: subject: "Why Mark Text is my favorite markdown editor" +[#]: via: "https://opensource.com/article/21/10/mark-text-markdown-editor" +[#]: author: "Don Watkins https://opensource.com/users/don-watkins" +[#]: collector: "lujun9972" +[#]: translator: "wxy" +[#]: reviewer: "wxy" +[#]: publisher: " " +[#]: url: " " + +Mark Text:我最喜欢的 Markdown 编辑器 +====== + +> Mark Text 拥有的工具使得撰写 Markdown 变得容易,同时又提供了一个不会打扰我的简单的界面。 + +![](https://img.linux.net.cn/data/attachment/album/202110/27/141244m9os557ss7au6oas.jpg) + +几年前,当我开始使用 Jupyter 笔记本时,我接触到了 Markdown 格式。许多作者都知道 Markdown,但这是我不熟悉的一种技能。 + +Markdown 是一种标准的文本写作方式,在这种方式中,你可以用精简的符号来标记你想要的文本样式。例如,你不用点击一个按钮来使一个词变粗体,而是用两个星号(`**word**`)包围这个词。这有两种效果: + + * 当作为纯文本查看时,视觉上显示出强调的文本 + * 如果有一个好的文本转换器或渲染器(如 Pandoc 或一个好的 Markdown 文本编辑器),就会显示为加粗。 + +Markdown 最大的优点之一是它的大部分符号都是直观的,并且来自我们大多数人已有的习惯。它使得用星号强调单词,用字符标记标题以区分它们等等变得很自然。 + +每个人都对它评价很高,但我不确定为什么我需要学习和使用 Markdown。然而,我是一个好奇的人,我开始探索 Markdown,以及它如何在我的写作中发挥作用。 + +### 学习 Markdown + +我很喜欢在学习时使用 [Markdown 速查表][2]。我发现 Markdown 是一个很好的工具,可以写任何内容,而且我很喜欢甚至不需要一个专门的 Markdown 编辑器这一点。任何文本编辑器都可以写 Markdown,因为 Markdown 使用标准文本来表示样式。我开始使用简单的编辑器,如 Vim 或 gedit(或任何其他编辑器),并查阅这个速查表以记住简单的格式化规则。 + +今年我一直在写日记,作为组织我的想法和学习更多关于 Markdown 的方法。我最近尝试了 [Ghostwriter][3] 文本编辑器,这是一个优秀的编辑器,有一些额外的 Markdown 特定功能。Markdown 现在已经变得非常流行了,许多编辑器都加入了语法高亮、提示和其他使 Markdown 编写变得容易的功能,或者将其作为重点。它们不是必须的功能,但当你拥有它们时,还是很好的。  + +### 尝试 Mark Text + +在阅读一个博客时,我发现了 [Mark Text][4]。Mark Text 使写 Markdown 变得很容易,同时提供了一个简单的界面,而且又不影响我。Mark Text 有六个主题,三个浅色和三个深色主题。深色主题对我来说更容易使用。它的 [用户文档][5] 非常好,而且也提供了 Markdown 的 [语法帮助][6]。  + +### Markdown 的实时预览 + +Mark Text 以简洁的界面提供了实时预览功能。它支持 [Commonmark][7] 规范、Github 风格的 Markdown 规范,以及 Pandoc Markdown。据其网站说,Mark Text 还支持 KaTex、front matter 和 emoji 等 Markdown 扩展。它还可以输出 HTML 和 PDF 文件。  + +Mark Text 有各种编辑模式,如打字模式、源代码模式和专注模式。添加图片是一件很容易的事,因为你可以简单地从剪贴板上复制和粘贴它们。 + +在 Mark Text 窗口的左上方有一个弹出窗口,显示迄今为止输入的字符和段落数量。作为一个作家,这真的很有帮助。 + +从 Mark Text 窗口左上方的菜单或使用 `Ctrl+S` 保存文件很容易。事实上,Mark Text 的菜单对任何习惯于基本文本编辑器或文字处理器的人来说都是友好和熟悉的。 + +![Mark Text 文件菜单][8] + +我喜欢 Mark Text 用简单的快捷键支持各种格式,包括表格块、图表、行内格式、数学公式块和其他代码块。 + +你可以从以下链接中为你的操作系统下载 Mark Text: + + * [Linux][10] + * [macOS][11] + * [Windows][12] + +Mark Text 以 [MIT][13] 许可证开源。你可以随时 [下载][14] 最新的版本。 + +另外,你可以用 `brew install --cask mark-text` 在 macOS 上安装 Mark Text,在 Windows 上用 [Chocolatey][15] 输入 `choco install marktext` 来安装它。 + +Mark Text 一直在寻找赞助商和开发者。该项目有一个给贡献者的 [指南][16]。此外,你可以在 Patreon 和 Open Collective 上支持该项目。 + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/mark-text-markdown-editor + +作者:[Don Watkins][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/don-watkins +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/osdc-docdish-typewriterkeys-3.png?itok=NyBwMdK_ (Typewriter keys in multicolor) +[2]: https://opensource.com/downloads/cheat-sheet-markdown +[3]: https://wereturtle.github.io/ghostwriter/ +[4]: https://marktext.app/ +[5]: https://github.com/marktext/marktext/blob/master/docs/README.md +[6]: https://github.com/marktext/marktext/blob/master/docs/MARKDOWN_SYNTAX.md +[7]: https://commonmark.org/ +[8]: https://opensource.com/sites/default/files/uploads/mark-test-file-menu.png (Mark Text file menu) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://github.com/marktext/marktext/releases/latest/download/marktext-x86_64.AppImage +[11]: https://github.com/marktext/marktext/releases/latest/download/marktext.dmg +[12]: https://github.com/marktext/marktext/releases/latest/download/marktext-setup.exe +[13]: https://github.com/marktext/marktext/blob/develop/LICENSE +[14]: https://github.com/marktext/marktext/releases +[15]: https://chocolatey.org/ +[16]: https://github.com/marktext/marktext/blob/develop/CONTRIBUTING.md From 06ec07a1529117198feceaa5f8860dfd1fee495f Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Wed, 27 Oct 2021 14:16:53 +0800 Subject: [PATCH 0839/1588] PUB @wxy https://linux.cn/article-13926-1.html --- .../20211019 Why Mark Text is my favorite markdown editor.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20211019 Why Mark Text is my favorite markdown editor.md (98%) diff --git a/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md b/published/20211019 Why Mark Text is my favorite markdown editor.md similarity index 98% rename from translated/tech/20211019 Why Mark Text is my favorite markdown editor.md rename to published/20211019 Why Mark Text is my favorite markdown editor.md index aa449595c1..847c4ceb2c 100644 --- a/translated/tech/20211019 Why Mark Text is my favorite markdown editor.md +++ b/published/20211019 Why Mark Text is my favorite markdown editor.md @@ -4,8 +4,8 @@ [#]: collector: "lujun9972" [#]: translator: "wxy" [#]: reviewer: "wxy" -[#]: publisher: " " -[#]: url: " " +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13926-1.html" Mark Text:我最喜欢的 Markdown 编辑器 ====== From d0af4673fb404857d0b2ddf74f113ebb3d88c58f Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Oct 2021 05:02:44 +0800 Subject: [PATCH 0840/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211027?= =?UTF-8?q?=20How=20I=20made=20an=20automated=20Jack-o'-lantern=20with=20a?= =?UTF-8?q?=20Raspberry=20Pi?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md --- ...ted Jack-o--lantern with a Raspberry Pi.md | 386 ++++++++++++++++++ 1 file changed, 386 insertions(+) create mode 100644 sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md diff --git a/sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md b/sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md new file mode 100644 index 0000000000..25c2e6f2f4 --- /dev/null +++ b/sources/tech/20211027 How I made an automated Jack-o--lantern with a Raspberry Pi.md @@ -0,0 +1,386 @@ +[#]: subject: "How I made an automated Jack-o'-lantern with a Raspberry Pi" +[#]: via: "https://opensource.com/article/21/10/halloween-raspberry-pi" +[#]: author: "Jessica Cherry https://opensource.com/users/cherrybomb" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +How I made an automated Jack-o'-lantern with a Raspberry Pi +====== +Here's my recipe for the perfect pumpkin Pi. +![A vignette of green, orange, and yellow pumpkins in front of a brick wall][1] + +It's almost Halloween, one of my favorite days and party times. This year, I decided to (pumpkin) spice up some of my decorations with automated motion sensing. This spooktacular article shows you how I made them, step by step, from building and wiring to coding. This is not your average weekend project—it takes a lot of supplies and building time. But it's a fun way to play around with Raspberry Pi and get in the spirit of this haunting holiday. + +### What you need for this project + + * One large plastic pumpkin + * One Raspberry Pi 4 (with peripherals) + * One Arduino starter kit that works with Raspberry Pi + * One hot glue gun + * Ribbon, ideally in holiday theme colors + + + +The items you'll need in the starter kit are one infrared motion sensor, a breadboard, two small LED lights, a ribbon to connect the breadboard to the Raspberry Pi, and cabling to configure all of these pieces together. You can find each of these items online, and I suggest the starter kit for the entertaining things you can do beyond this project. + +![Raspberry Pi computer board][2] + +Jess Cherry CC BY-SA 4.0 + +![Cables and and LEDs for the project][3] + +Jess Cherry CC BY-SA 4.0 + +![Project supplies including breadboard, cables, LEDs, and elements of the Arduino starter kit][4] + +Jess Cherry CC BY-SA 4.0 + +### Installing the Raspberry Pi OS and preconfiguration + +After receiving my Pi, including the SD card, I went online and followed the Raspberry Pi imager [instructions][5]. This allowed for quick installation of the OS onto the SD card. Note: you need the ability to put the SD card in an SD card-reader slot. I have an external attached SD card reader, but some computers have them built in. On your local computer, you also need a VNC viewer. + +After installing the OS and running updates, I had some extra steps to get everything to work correctly. To do this, you'll need the following: + + * Python 3 + * Python3-devel + * Pip + * RPi GPIO (pip install RPi.GPIO) + * A code editor (Thonny is on the Raspberry Pi OS) + + + +Next, set up a VNCviewer, so you can log in when you have the Pi hidden in your pumpkin. + +To do this, run the below command, then follow the instructions below. + +`sudo raspi-config` + +When this menu pops up, choose Interface Options: + +![Raspberry Pi Software Configuration Tool menu][6] + +Jess Cherry CC BY-SA 4.0 + +Next, choose VNC and enable it on the pop-up: + +![Raspberry Pi Software Configuration Tool menu of interface options][7] + +Jess Cherry CC BY-SA 4.0 + +You can also use Secure Shell (SSH) for this, but during the troubleshooting phase, I used VNC. When logged into your Raspberry Pi, gather the IP address and use it for SSH and a VNC connection. If you've moved rooms, you can also use your router or WiFi switch to tell you the IP address of the Pi. + +Now that everything is installed, you can move on to building your breadboard with lights. + +### Everyone should try pumpkin bread(board) + +Many people haven't seen or worked with a breadboard, so I've added pictures of my parts, starting with my base components. + +![GPIO Extension Board and Ribbon Cable][8] + +Jess Cherry CC BY-SA 4.0 + +![Breadboard][9] + +Jess Cherry CC BY-SA 4.0 + +These two pieces are put together with the extension shield in the center, as shown. + +![Breadboard with cables, pins, and ribbons, partially set up for the project][10] + +Jess Cherry CC BY-SA 4.0 + +The ribbon connects to the pin slot in the Raspberry Pi, making the board a new extension we can code and play with. The ribbon isn't required, it's just makes working with the GPIO pins convenient. If you don't want to purchase a ribbon, you can connect female-to-male jumper cables directly from the pins on the Pi to the breadboard. Here are the components you need: + + * Raspberry Pi (version 4 or 3) + * Breadboard + * GPIO expansion ribbon cable + * Jumper cables (x6 male-to-male) + * Resistor 220Ω + * HC-SR501 or any similar proximity sensor (x1) + * LED (x2) + + + +### Putting the board together + +Once you have all of the pieces, you can put everything together. First, take a look at how the pins are defined on the board. This is my personal extension board; the one you have may be different. The pin definitions matter when you get to coding, so keep very good track of your cabling. Below is the schematic of my extension. + +As you can see, the schematic has both the defined BCM (Broadcom SOC Channel) GPIO numbering on the physical board and the physical numbering you use within the code to create routines and functions. + +![Schematic of Raspberry Pi extension board][11] + +Jess Cherry CC BY-SA 4.0 + +Now it's time to connect some cabling. First, start with the sensor. I was provided with cables to connect in my kit, so I'll add pictures as I go. This is the sensor with a power(+) ground(-) and sensor connection to extension board(s). + +![Sensor illustration with power, ground, and sensor connection][12] + +Jess Cherry CC BY-SA 4.0 + +For the cable colors: power is red, ground is black, and yellow carries the sensor data. + +![Photo of a hand holding the sensor with black, red, and yellow cables][13] + +Jess Cherry CC BY-SA 4.0 + +I plug in the cables with power/red to the 5V pin, ground/black to the GRN pin, and sensor/yellow to the GPIO 17 pin, later to be defined as 11 in the code. + +![Breadboard with sensor cables attached][14] + +Jess Cherry CC BY-SA 4.0 + +Next, it's time to set up the lights. Each LED light has two pins, one shorter than the other. The long side (anode) always lines up with the pin cable, and the shorter (cathode) with the ground and resistor. + +![LED light with pin, cables, and resistor][15] + +Jess Cherry CC BY-SA 4.0 + +For the first light, I use GPIO18 (pin 12) and GPIO25 for the signal. This is important because the code communicates with these pins. You can change which pin you use, but then you must change the code. Here's a diagram of the end result: + +![Illustration of connections from breadboard to Raspberry Pi, sensor, and LEDs][16] + +Jess Cherry CC BY-SA 4.0 + +Now that everything is cabled up, it's time to start working on the code. + +### How to use a snake to set up a pumpkin + +If you've already installed Python 3, you have everything you need to start working through this line by line. In this example, I am using Python 3 with the RPI package. Start with the imported packages, RPI and time from sleep (this helps create the flicker effect described later in the tutorial). I called my Python file senseled.py, but you can name your file whatever you want. + + +``` +#!/usr/bin/env python3 + +import RPi.GPIO as GPIO +import os +from time import sleep +``` + +Next, define your two LED pins and sensor pin. Earlier in this post, I provided these pin numbers while wiring the card, so you can see those exact numbers below. + + +``` +ledPin1 = 12 # define ledPins +ledPin2 = 22 +sensorPin = 11 # define sensorPin +``` + +Since you have two lights to set up to flicker together in this example, I also created a defined array to use later: + +`leds = [ledPin1, ledPin2]` + +Next, define the setup of the board and pins using the RPi.GPIO package. To do this, set the mode on the board. I chose to use the physical numbering system in my setup, but you can use the BCM if you prefer. Remember that you can never use both. Here's an example of each: + + +``` +# for GPIO numbering, choose BCM +GPIO.setmode(GPIO.BCM) +  +# or, for pin numbering, choose BOARD +GPIO.setmode(GPIO.BOARD) +``` + +For this example, use the pin numbering in my setup. Set the two pins to output mode, which means all commands output to the lights. Then, set the sensor to input mode so that as the sensor sees movement, it inputs the data to the board to output the lights. This is what these definitions look like: + + +``` +def setup(): + GPIO.setmode(GPIO.BOARD) # use PHYSICAL GPIO Numbering + GPIO.setup(ledPin1, GPIO.OUT) # set ledPin to OUTPUT mode + GPIO.setup(ledPin2, GPIO.OUT) # set ledPin to OUTPUT mode + GPIO.setup(sensorPin, GPIO.IN) # set sensorPin to INPUT mode +``` + +Now that the board and pins are defined, you can put together your main function. For this, I use the array in a `for` loop, then an if statement based on the sensor input. If you are unfamiliar with these functions, you can check out this [quick guide][17]. + +If the sensor receives input, the LED output is high (powered on) for .03 seconds, then low (powered off) while printing the message `led turned on.` If the sensor receives no input, the LEDs are powered down while printing the message `led turned off`. + + +``` +def main(): + while True: + for led in leds: + if GPIO.input(sensorPin)==GPIO.HIGH: + GPIO.output(led, GPIO.HIGH) + sleep(.05) + GPIO.output(led, GPIO.LOW) + print ('led turned on >>>') + else : + GPIO.output(led, GPIO.LOW) # turn off led + print ('led turned off <<<') +``` + +While you can mathematically choose the brightness level, I found it easier to set the sleep timer between powering on and powering off. I set this after many tests of the amount of time needed to create a flickering candle effect. + +Finally, you need some clean up to release your resources when the program is ended: + + +``` +def destroy(): + GPIO.cleanup() # Release GPIO resource +``` + +Now that everything has been defined to run, you can run your code. Start the program, run the setup, try your main, and if a KeyboardInterrupt is received, destroy and clean everything up. + + +``` +if __name__ == '__main__': # Program entrance + print ('Program is starting...') + setup() + try: + main() + except KeyboardInterrupt: # Press ctrl-c to end the program. + destroy() +``` + +Now that you've created your program, the final result should look like this: + + +``` +#!/usr/bin/env python3 + +import RPi.GPIO as GPIO +import os +from time import sleep + +ledPin1 = 12 # define ledPins +ledPin2 = 22 +sensorPin = 11 # define sensorPin +leds = [ledPin1, ledPin2] + +def setup(): + GPIO.setmode(GPIO.BOARD) # use PHYSICAL GPIO Numbering + GPIO.setup(ledPin1, GPIO.OUT) # set ledPin to OUTPUT mode + GPIO.setup(ledPin2, GPIO.OUT) # set ledPin to OUTPUT mode + GPIO.setup(sensorPin, GPIO.IN) # set sensorPin to INPUT mode + +  +def main(): + while True: + for led in leds: + if GPIO.input(sensorPin)==GPIO.HIGH: + GPIO.output(led, GPIO.HIGH) + sleep(.05) + GPIO.output(led, GPIO.LOW) + print ('led turned on >>>') + else : + GPIO.output(led, GPIO.LOW) # turn off led + print ('led turned off <<<') +  + +def destroy(): + GPIO.cleanup() # Release GPIO resource + +if __name__ == '__main__': # Program entrance + print ('Program is starting...') + setup() + try: + main() + except KeyboardInterrupt: # Press ctrl-c to end the program. + destroy() +``` + +When it runs, it should look similar to this. (Note: I was still testing with sleep time during this recording.) + +### Time to bake that pumpkin + +To start, I had a very large plastic pumpkin gifted by our family to my husband and me. + +![A large, smiling orange jack o'lantern][18] + +Jess Cherry CC BY-SA 4.0 + +Originally, it had a plug in the back with a bulb that was burnt out, which is what inspired this idea in the first place. I realized I'd have to make some modifications, starting with cutting a hole in the bottom using a drill and jab saw. + +![A man drilling a hole in the bottom of a large plastic jack o'lantern][19] + +Jess Cherry CC BY-SA 4.0 + +![A hole that takes up most of the bottom of the plastic jack o'lantern][20] + +Jess Cherry CC BY-SA 4.0 + +Luckily, the pumpkin already had a hole in the back for the cord leading to the original light. I could stuff all the equipment inside the pumpkin, but I needed a way to hide the sensor. + +First, I had to make a spot for the sensor to be wired externally to the pumpkin, so I drilled a hole by the stem: + +![A small hole drilled in the brown stem of the jack o'lantern][21] + +Jess Cherry CC BY-SA 4.0 + +Then I put all the wiring for the sensor through the hole, which ended up posing another issue: the sensor is big and weird-looking. I went looking for a decorative way to resolve this. + +![The sensor hanging around the stem of the pumpkin, and a spool of ribbon][22] + +Jess Cherry CC BY-SA 4.0 + +I did, in fact, make the scariest ribbon decoration (covered in hot glue gun mush) in all of humanity, but you won't notice the sensor. + +![A large bow with orange, black, and patterned ribbon completely covers the sensor][23] + +Jess Cherry CC BY-SA 4.0 + +Finally, I put the Pi and extension card in the pumpkin and cabeled the power through the back. + +![The breadboard and cables fit inside the hole in the bottom of the jack o'lantern][24] + +Jess Cherry CC BY-SA 4.0 + +With everything cabled, I was ready to VNC into my Pi and turn on the Python, then wait for something to move to test it out. + +![VNC viewer with Python file running][25] + +Jess Cherry CC BY-SA 4.0 + +![senseled.py running, showing led turned off switching to led turned on][26] + +Jess Cherry CC BY-SA 4.0 + +### Post baking notes + +This was a really long and very researched build. As I said in the introduction, this isn't a weekend project. I knew nothing about breadboards when I started, and it took me a while to recode and determine exactly what I wanted. There are some very granular details I did not include here. For example, the sensor has two knobs that define how far it can pick up motion and how long the sensor input needs to continue. While this was a fantastic thing to learn, I would definitely do a lot of research before pursuing this journey. + +I did not get to one part of the project that I really wanted: the ability to connect to a Bluetooth device and make spooky noises. That said, playing with a Raspberry Pi is always fun to do, whether with home automation, weather tracking, or just silly decorations. I hope you enjoyed this walk-through and feel inspired to try something similar yourself. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/halloween-raspberry-pi + +作者:[Jessica Cherry][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/cherrybomb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/pumpkins.jpg?itok=00mvIoJf (A vignette of green, orange, and yellow pumpkins in front of a brick wall) +[2]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_1.png (Raspberry Pi computer board) +[3]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_3.png (Cables and LEDs) +[4]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_4.png (Project supplies) +[5]: https://www.raspberrypi.com/documentation/computers/getting-started.html#using-raspberry-pi-imager +[6]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_5.png (Menu) +[7]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_6.png (Menu) +[8]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_7.png (Board and cable) +[9]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_8.png (Breadboard) +[10]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_9.png (Partially set-up breadboard) +[11]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_11.png (Extension board) +[12]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_12.png (Sensor) +[13]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_13.png (Sensor with cables) +[14]: https://opensource.com/sites/default/files/uploads/pumpkin_pi15.png (Breadboard with sensor cables attached) +[15]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_16.png (Light setup) +[16]: https://opensource.com/sites/default/files/uploads/pumpkinpi_bb.jpeg (Illustration of connections) +[17]: https://opensource.com/article/18/3/loop-better-deeper-look-iteration-python +[18]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_18.png (the pumpkin) +[19]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_19.png (Drilling) +[20]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_20.png (Pumpkin hole) +[21]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_21.png (Sensor hole) +[22]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_24.png (The unhidden sensor) +[23]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_25.png (Sensor disguise ribbons) +[24]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_28.png (Enclosing the kit) +[25]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_29.png (VNC viewer) +[26]: https://opensource.com/sites/default/files/uploads/pumpkin_pi_31.png (LED turns on) From 65794625b1a31e602262f541c1c8dfa7c68a60d1 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Thu, 28 Oct 2021 05:03:01 +0800 Subject: [PATCH 0841/1588] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020211027?= =?UTF-8?q?=20Global=20communication=20in=20open=20source=20projects?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20211027 Global communication in open source projects.md --- ...l communication in open source projects.md | 112 ++++++++++++++++++ 1 file changed, 112 insertions(+) create mode 100644 sources/tech/20211027 Global communication in open source projects.md diff --git a/sources/tech/20211027 Global communication in open source projects.md b/sources/tech/20211027 Global communication in open source projects.md new file mode 100644 index 0000000000..1378fbae19 --- /dev/null +++ b/sources/tech/20211027 Global communication in open source projects.md @@ -0,0 +1,112 @@ +[#]: subject: "Global communication in open source projects" +[#]: via: "https://opensource.com/article/21/10/global-communication-open-source" +[#]: author: "Rachel Naegele https://opensource.com/users/ranaegele" +[#]: collector: "lujun9972" +[#]: translator: " " +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +Global communication in open source projects +====== +An interview with FreeDOS Project founder Jim Hall on communicating +effectively around the world. +![Globe up in the clouds][1] + +I am a current graduate student at the University of Minnesota, Twin Cities in the Scientific and Technical Communication MS program. The following is an interview I conducted with [Jim Hall][2] to learn about international professional communication strategies in the multinational group, the FreeDOS Project. + +**You started the [FreeDOS project][3] in 1994. How did you communicate with the global network of developers for this project at the beginning? How have your communication strategies for international communication changed over the years?** + +We've gone through a few different ways to communicate with each other. + +In the early 1990s, USENET was a common way to communicate with a group of people. USENET was very similar to a message forum, but it was globally distributed. Topics were arranged in groups. You could post a message in a USENET group, and someone else would see it and possibly reply to it. + +I posted the [first announcement][4] about FreeDOS on the comp.os.msdos.apps group. As we got started on FreeDOS, we used that group to discuss our development work. There are a few benefits of using a group like that: + + * It was global, so everyone could participate. + * It was asynchronous, so it didn't matter what timezone you lived in. + * It was open, so everyone could see the conversation. + + + +Around 1996, we moved from USENET to an email list. Email lists were very common at the time, and they remain popular for some uses, such as ours. With an email list, whenever someone sends a message to the list, everyone gets a copy. The downside is that very active email lists can fill up your inbox. But the FreeDOS email lists aren't as active these days as they once were, so our email lists don't tend to have a high bandwidth. + +Over the years, folks have experimented with other ways to communicate. Robert Riebisch at BTTR Software set up a general web-based discussion board called ["DOS Ain't Dead"][5] to discuss DOS projects in 1997, and it's still a popular forum for general DOS topics. You can also find FreeDOS topics discussed there. That's not our official discussion board, however; the official place for all FreeDOS development discussions is the [freedos-devel email list][6]. + +We use freedos-devel to discuss upcoming changes to the FreeDOS distribution, announce new versions of programs, ask for programming help, and generally talk about DOS development. + +**What communication issues have you run into while working with a global team? How did you resolve these issues?** + +With developers all around the world, in so many languages, from so many cultures, we have had our share of communication issues. + +Our de facto language on the email list is English. We never set that as a rule, but almost everyone communicates in English anyway. Sometimes a new subscriber to the email list sends a message in another language, but usually someone who speaks that language can reply to them. + +Inevitably, we do have miscommunication issues, usually because of cultural or language problems. For example, someone who doesn't speak English fluently might say something in an awkward way, and someone else might respond negatively to that. But these instances are pretty rare, I think. And we have strong [email list rules][7] that say (among other things) that you need to be nice to each other. And folks police each other pretty well; if there's an issue, it's usually short-lived. + +Other issues include culture clash. In international communication, there's a concept of [high-context and low-context][8] communicators. Germany is a typical example of a low-context culture: They get right to the point with very little small talk. Other cultures might see the German style as speaking bluntly, but to a German, that's just a natural way to communicate. On the other hand, Korea or Japan is a typical example of a high-context culture; it would be very unusual for a high-context communicator to talk about a problem in a very direct way. + +In the United States, we're more low context than high context, at about the one-quarter mark. + +One example of this culture clash is when a user from a high-context country emailed the list to report a bug. I suppose this person viewed a program bug as an embarrassment for the developer, so the person didn't address the bug directly. They didn't provide a specific description of the bug. The other developers on the email list didn't respond well to that. I recall replies along the lines of "What's the problem here?" or "What are you talking about?" All because we communicate differently depending on our background. + +**What have been the biggest challenges in creating a DOS for an international audience?** + +I'm really glad that we have some very active people in FreeDOS who are working on translating messages in all these programs. There are a few folks who contribute to FreeDOS by translating messages from one language to another and sharing those message files so we can use them in the FreeDOS distribution. + +FreeDOS is a small operating system with low memory constraints, so actually our biggest challenge has been technical. + +In a more modern system like Linux, you can provide message translation through a service like [catgets][9] or [gettext][10]. Both are programming libraries where the program says, "I need this string [text] in the user's preferred language," and the library gives the program that string. This is an example of internationalization, by providing translations in different languages. + +But writing a library like that can take a lot of memory, and a 16-bit operating system like DOS doesn't have a lot of memory to spare. So most early FreeDOS programs didn't bother dealing with it. If the programmer spoke English, they probably wrote their program to use English messages and to accept English input (such as "y" for "yes," and so on). + +Unfortunately, that meant someone in Spain or France or Portugal who didn't understand English would have a hard time using FreeDOS. So, I wrote a simplified version of catgets for FreeDOS called Cats. It provided the same catgets function feature set, which meant if you were porting or translating a program from Linux to run on FreeDOS, the catgets function would do the same thing. The programmer wouldn't need to change anything in the source code for the program to work on FreeDOS; they just used FreeDOS Cats. + +Catgets looks up a message or string using a _message catalog_ (a file that contains a list of messages in a specific language) and a pair of numbers called the _message set_ and the _message number._ The name catgets comes from the catalog to get a string in the user's preferred language. For example, a message to say "Hello" to the user might be stored in message set 1, as message number 2 in that message set. So you'd have this line in an English catalog file: + +`1.2:Hello` + +And you'd have other language catalog files that had the same messages translated to other languages. A Spanish catalog might have this line to represent the same message: + +`1.2:Hola` + +Tom Ehlert modified Cats to be even smaller but also much simpler. This version was named Kitten. Cats and Kitten solved the problem pretty well. A translator could create a message catalog by editing a plain text file, and someone else could use that right away. A lot of FreeDOS programs adopted Cats or Kitten to provide message internationalization. That solved a huge problem for us! + +Kitten is not the only solution. Different developers might solve the language problem in different ways. But Kitten is probably the most popular way to do it. + +**What are some of the main factors that you consider when communicating interculturally?** + +For me, I need to be aware of who I'm talking to when I send a message. If I'm emailing a specific person, I'll use the email they sent me as a guide to guess whether they prefer a high-context or low-context answer. If I don't know, I'll probably default to a lower context mode. That means I'll get to the point quickly, but it's okay to set up some context. + +If I'm writing for a more general audience (such as sending emails to our email list, posting an announcement to our website, or whatever), I'll also adopt the lower context communication mode. That's more important on a website, where many readers will probably click off the site if it's too wordy. + +**Using your time working on the FreeDOS project as a reference, what advice would you give to someone looking to increase their intercultural communication competence?** + +Ever since I learned about high-context vs. low-context communication styles, I've used that as a guide. For anyone who wants to increase their intercultural communication competence, I recommend learning the high- vs. low-context spectrum. Build your own understanding of where different cultures are placed on this spectrum: Italy tends to be around the middle, the UK tends to be around the one-third mark, and so on. + +Beyond that, I would recommend always assuming positive intent. If someone reached out to you in an email, read past any preconceptions about how that person communicated and find the message they wanted to convey. A high-context communicator will rarely hit an issue head-on, so you may need to read more carefully. A low-context communicator will probably seem very blunt, but they are just trying to get to the point quickly. + +Don't assume based on your own context. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/21/10/global-communication-open-source + +作者:[Rachel Naegele][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/ranaegele +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-globe.png?itok=_drXt4Tn (Globe up in the clouds) +[2]: https://opensource.com/users/jim-hall +[3]: https://www.freedos.org/ +[4]: https://groups.google.com/g/comp.os.msdos.apps/c/oQmT4ETcSzU/m/O1HR8PE2u-EJ +[5]: https://www.bttr-software.de/forum/board.php +[6]: http://lists.sourceforge.net/lists/listinfo/freedos-user +[7]: http://freedos.sourceforge.net/freedos/lists/remind.txt +[8]: https://en.wikipedia.org/wiki/High-context_and_low-context_cultures +[9]: https://www.ibm.com/docs/en/i/7.3?topic=functions-catgets-retrieve-message-from-message-catalog +[10]: https://www.gnu.org/software/gettext/manual/gettext.html From fc4fcadd9cf201370f2041c0b622befcb2f61776 Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Oct 2021 08:47:32 +0800 Subject: [PATCH 0842/1588] translated --- ...on Ubuntu and Other Linux Distributions.md | 114 ------------------ ...on Ubuntu and Other Linux Distributions.md | 114 ++++++++++++++++++ 2 files changed, 114 insertions(+), 114 deletions(-) delete mode 100644 sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md create mode 100644 translated/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md diff --git a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md b/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md deleted file mode 100644 index d334666913..0000000000 --- a/sources/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md +++ /dev/null @@ -1,114 +0,0 @@ -[#]: subject: "Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions" -[#]: via: "https://itsfoss.com/fixed-are-you-root-error/" -[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" -[#]: collector: "lujun9972" -[#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " - -Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions -====== - -I am presuming you are quite new to Linux. - -You follow some tutorial on the internet that tells you to install a certain program or run some command. Probably it is something to do with a server. - -But when you run the command, you encounter this error: - -**E: Could not open lock file /var/lib/dpkg/lock-frontend – open (13: Permission denied) -E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?** - -A similar error is this one: - -dpkg: error: required read/write access to the dpkg database directory /var/lib/dpkg -**E: Sub-process dpkg –set-selections returned an error code (2) -E: Executing dpkg failed. Are you root?** - -Both errors ask you the same question: are you root? And that’s the answer to this problem. Become root. - -### Become root to avoid this error - -How do you [become root in Ubuntu][1] or Debian? You use the sudo command. - -Yes, that’s it. Whatever command you were running, just add sudo before it. - -``` -sudo your_command -``` - -![Running command with sudo][2] - -It will ask you to enter your user account password. Please keep in mind that nothing gets displayed on the screen when you type the password and that’s okay. - -There is nothing wrong with your system. In most Linux systems, password typing doesn’t show the usual asterisks or anything of that sort as a ‘security feature’. - -Just type your password and press enter after it. If the password was typed correctly, you should be able to run the command now. - -You can even use this handy [Linux command line trick][3] to run a previous command with sudo: - -``` -sudo !! -``` - -That was simple and works immediately, unless you do not have sudo access. Then, you’ll see a different error. - -### Seeing a ‘User is not in sudoer file’ error? - -![Some users cannot run commands with sudo][4] - -When you [install Ubuntu][5], you have to create a user account. This user is automatically granted sudo power to run commands as root when required. - -This happens on Ubuntu desktop, not servers. Most server distributions will have a separate root account. If you create a regular account separately, you’ll have to add the user to sudoer so that this normal user can use sudo. - -In the screenshot above, I had created this additional user but did not add it to the sudo group. This means that user ‘prakash’ here does not have rights to use the sudo command and hence the system complains that ‘prakash is not in sudoers file’. - -#### Where is the incident reported? - -An incorrect sudo attempt is added to the system logs. It logs the user name, the virtual terminal number, location from where the command was run and which command was run. - -![Incorrect sudo attempts are logged into the system][6] - -The location of these logs differ from distribution to distribution. - -Normally, you may find it in journalctl logs or /var/log/auth.log file in Ubuntu, /var/log/audit/audit.log file in Fedora. - -#### What can you do if a user is not in sudoer list? - -What can you do when you cannot use sudo with the current user account? First, [verify if the user has sudo rights or not. If not, here are some options for][7] you: - - * Log in as root or switch to root (if you have root password). - * [Add the user into sudoer list][8] (if you have admin/sudo rights from some other user account). - * If you are in multi-user Linux system and do not have root or sudo access yourself, ask your sytem administrator to either grant your user sudo access or install the application you wanted to install. - - - -### Did this help? - -Sudo is a very comprehensive security mechanism, and it is much more than just allowing a normal user to become root. It helps in auditing the system to know which user ran which command with sudo. It can also be configured to allow a certain user to run only certain commands with sudo. - -You won’t see such granular sudo configuration on desktop Linux where it is preconfigured to allow any user in the sudo group to run any command as root with sudo. More on sudo in some other article. - -I hope while solving this classic beginner problem, you get some initial insights into the sudo command. Let me know if you have further questions on this topic in the comment section. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/fixed-are-you-root-error/ - -作者:[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/root-user-ubuntu/ -[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/running-commands-with-sudo.webp?resize=800%2C450&ssl=1 -[3]: https://itsfoss.com/linux-command-tricks/ -[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/not-in-sudoer-file-error-800x289.png?resize=800%2C289&ssl=1 -[5]: https://itsfoss.com/install-ubuntu/ -[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/sudo-incident-reported.png?resize=800%2C339&ssl=1 -[7]: https://linuxhandbook.com/check-if-user-has-sudo-rights/ -[8]: https://linuxhandbook.com/create-sudo-user/ diff --git a/translated/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md b/translated/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md new file mode 100644 index 0000000000..7f4bc0ba6d --- /dev/null +++ b/translated/tech/20211026 Fixing -Unable to acquire dpkg frontend lock. Are You Root-- Error on Ubuntu and Other Linux Distributions.md @@ -0,0 +1,114 @@ +[#]: subject: "Fixing “Unable to acquire dpkg frontend lock. Are You Root?” Error on Ubuntu and Other Linux Distributions" +[#]: via: "https://itsfoss.com/fixed-are-you-root-error/" +[#]: author: "Abhishek Prakash https://itsfoss.com/author/abhishek/" +[#]: collector: "lujun9972" +[#]: translator: "geekpi" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " + +修复在 Ubuntu 和其他 Linux 发行版上 “Unable to acquire dpkg frontend lock. Are You Root?” 的错误 +====== + +我假设你对 Linux 很陌生。 + +你按照网上的一些教程,告诉你要安装某个程序或运行某个命令。可能是与服务器有关的东西。 + +但当你运行这个命令时,你遇到了这个错误: + +**E: Could not open lock file /var/lib/dpkg/lock-frontend – open (13: Permission denied) +E: Unable to acquire the dpkg frontend lock (/var/lib/dpkg/lock-frontend), are you root?** + +或者类似的错误: + +dpkg: error: required read/write access to the dpkg database directory /var/lib/dpkg +**E: Sub-process dpkg –set-selections returned an error code (2) +E: Executing dpkg failed. Are you root?** + +这两个错误都在问你同一个问题:你是 root 吗?而这就是这个问题的答案。成为 root。 + +### 成为 root 以避免这个错误 + +你如何[在 Ubuntu][1] 或 Debian 中成为 root?你使用 sudo 命令。 + +是的,就是这样。无论你在运行什么命令,只要在它前面加上 sudo 即可。 + +``` +sudo your_command +``` + +![Running command with sudo][2] + +它将要求你输入你的用户账户密码。请记住,当你输入密码时,屏幕上不会显示任何东西,这也没关系。 + +你的系统没有任何问题。在大多数 Linux 系统中,输入密码时不会显示通常的星号或其他东西是一种“安全特性”。 + +只要输入密码,并在密码后按下回车键即可。如果密码输入正确,你现在应该可以运行该命令了。 + +你甚至可以使用这个方便的 [Linux 命令行技巧][3],用 sudo 运行以前的命令: + +``` +sudo !! +``` + +这很简单,而且立即生效,除非你没有 sudo 权限。然后,你会看到一个不同的错误。 + +### 看到一个 “User is not in sudoer file” 的错误? + +![Some users cannot run commands with sudo][4] + +当你[安装 Ubuntu][5] 时,你必须创建一个用户账户。这个用户被自动授予 sudo 权限,在需要时以 root 身份运行命令。 + +这发生在 Ubuntu 桌面上,而不是服务器上。大多数服务器发行版会有一个单独的 root 账户。如果你单独创建了一个普通账户,你就必须把这个用户添加到 sudoer 中,以便这个普通用户可以使用 sudo。 + +在上面的截图中,我已经创建了这个额外的用户,但没有将其添加到 sudo 组中。这意味着这里的用户 “prakash” 没有使用 sudo 命令的权限,因此系统抱怨 “prakash is not in sudoers file”。 + +#### 该事件在哪里报告? + +一个错误的 sudo 尝试被添加到系统日志中。它记录了用户名、虚拟终端号、运行命令的位置和运行的命令。 + +![Incorrect sudo attempts are logged into the system][6] + +这些日志的位置在不同的发行版中有所不同。 + +通常,在 Ubuntu 中你可以在 journalctl 日志或 /var/log/auth.log 文件中找到它,在 Fedora 中可以在 /var/log/audit/audit.log 文件中找到它。 + +#### 如果一个用户不在 sudoer 列表中,你能做什么? + +当你不能用当前的用户账户使用 sudo 时,你能做什么?首先,[验证该用户是否有 sudo 权限。如果没有,你可以有一些选择][7]: + + * 以 root 身份登录或切换 root 身份(如果你有 root 密码)。 + * [将该用户加入 sudoer 列表][8] (如果你有其他用户账户的管理/sudo 权限)。 + * 如果你在多用户的 Linux 系统中,自己没有 root 或 sudo 权限,请你的系统管理员授予你的用户 sudo 权限或安装你想安装的应用。 + + + +### 这有帮助吗? + +Sudo 是一个非常全面的安全机制,它不仅仅是允许一个普通用户成为 root。它有助于对系统进行审计,了解哪个用户用 sudo 运行了哪个命令。它还可以被配置为只允许某个用户用 sudo 运行某些命令。 + +你不会在桌面 Linux 上看到如此细化的 sudo 配置,在桌面 Linux 上,它被预先配置为允许 sudo 组中的任何用户以 sudo 的身份运行任何命令。关于 sudo 的更多信息,请参见其他文章。 + +我希望在解决这个经典的初学者问题时,你能对 sudo 命令有一些初步的了解。如果你对这个主题有进一步的问题,请在评论区告诉我。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/fixed-are-you-root-error/ + +作者:[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/root-user-ubuntu/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/running-commands-with-sudo.webp?resize=800%2C450&ssl=1 +[3]: https://itsfoss.com/linux-command-tricks/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2021/10/not-in-sudoer-file-error-800x289.png?resize=800%2C289&ssl=1 +[5]: https://itsfoss.com/install-ubuntu/ +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2021/10/sudo-incident-reported.png?resize=800%2C339&ssl=1 +[7]: https://linuxhandbook.com/check-if-user-has-sudo-rights/ +[8]: https://linuxhandbook.com/create-sudo-user/ From a98baed5736aa5cddbbdf14ad6e963c283b9e59d Mon Sep 17 00:00:00 2001 From: geekpi Date: Thu, 28 Oct 2021 08:52:32 +0800 Subject: [PATCH 0843/1588] translating --- ...Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md b/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md index 87b3549f4a..9d4ec0f2ac 100644 --- a/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md +++ b/sources/tech/20211027 Ferdi- A Free - Open-Source Alternative to Franz - Rambox.md @@ -2,7 +2,7 @@ [#]: via: "https://itsfoss.com/ferdi/" [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" -[#]: translator: " " +[#]: translator: "geekpi" [#]: reviewer: " " [#]: publisher: " " [#]: url: " " From 4f85f2e6a5a171ab02b2610e8768089a1cf671d5 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Thu, 28 Oct 2021 10:42:26 +0800 Subject: [PATCH 0844/1588] Rename sources/tech/20211027 Global communication in open source projects.md to sources/talk/20211027 Global communication in open source projects.md --- .../20211027 Global communication in open source projects.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20211027 Global communication in open source projects.md (100%) diff --git a/sources/tech/20211027 Global communication in open source projects.md b/sources/talk/20211027 Global communication in open source projects.md similarity index 100% rename from sources/tech/20211027 Global communication in open source projects.md rename to sources/talk/20211027 Global communication in open source projects.md From 25753d4bc8f1bef3a585b8520db13ea7ac62fed0 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Thu, 28 Oct 2021 11:20:09 +0800 Subject: [PATCH 0845/1588] PRF&PUB @geekpi https://linux.cn/article-13928-1.html --- ...ow to Convert a Webpage to PDF in Linux.md | 35 ++++++++++--------- 1 file changed, 18 insertions(+), 17 deletions(-) rename {translated/tech => published}/20211021 How to Convert a Webpage to PDF in Linux.md (71%) diff --git a/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md b/published/20211021 How to Convert a Webpage to PDF in Linux.md similarity index 71% rename from translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md rename to published/20211021 How to Convert a Webpage to PDF in Linux.md index 252c46a043..aa2a32d884 100644 --- a/translated/tech/20211021 How to Convert a Webpage to PDF in Linux.md +++ b/published/20211021 How to Convert a Webpage to PDF in Linux.md @@ -3,45 +3,46 @@ [#]: author: "Ankush Das https://itsfoss.com/author/ankush/" [#]: collector: "lujun9972" [#]: translator: "geekpi" -[#]: reviewer: " " -[#]: publisher: " " -[#]: url: " " +[#]: reviewer: "wxy" +[#]: publisher: "wxy" +[#]: url: "https://linux.cn/article-13928-1.html" 如何在 Linux 下将网页转换为 PDF 文件 ====== +![](https://img.linux.net.cn/data/attachment/album/202110/28/111738tncncbml6jwcz6s8.jpg) + 当你将某些资源存档或用于教育目的时,将网页保存为 PDF 是很方便的。 -But, how do you convert a webpage to PDF in Linux? 但是,你如何在 Linux 中把一个网页转换成 PDF? -_**你可以选择使用每个 Linux 发行版上的网页浏览器(GUI),或者使用终端将网页变成 PDF 文件。**_ +你可以选择使用每个 Linux 发行版上的网页浏览器(GUI),或者使用终端将网页变成 PDF 文件。 在这里,我将提到这两种方法来帮助你完成工作。 ### 方法 1:使用网页浏览器将网页转换为 PDF 文件 -尽管我在本教程中使用的是 Mozilla Firefox,但你也可以用任何[可用于 Linux 的最佳浏览器][1]做同样的事情。 +尽管我在本教程中使用的是 Mozilla Firefox,但你也可以用任何 [可用于 Linux 的最佳浏览器][1] 做同样的事情。 ![][2] -1\. 加载你想转换的网页。 +1、加载你想转换的网页。 -2\. 在浏览器菜单中找到“**打印**”选项,或使用键盘快捷键 “**Ctrl + P**”。 +2、在浏览器菜单中找到“**打印**”选项,或使用键盘快捷键 `Ctrl + P`。 -3\. 默认情况下,它应该让你把它保存为 PDF。你需要点击“保存”,然后选择目的地并保存网页。 +3、默认情况下,它应该让你把它保存为 PDF。你需要点击“保存”,然后选择目的地并保存网页。 ![Save webpage as PDF in Mozilla Firefox][3] 这种简单方法的一个主要问题是,它包括页面上的所有元素。这可能包括评论、页脚等。你可以用一个 PDF 编辑器来删除部分内容,但这是一个额外的任务。 -_**更好的选择是利用一个浏览器扩展,如 [Print Friendly][4]。它允许你在下载 PDF 之前编辑和删除网页的部分内容**_。 +更好的选择是利用一个浏览器扩展,如 [Print Friendly][4]。它允许你在下载 PDF 之前编辑和删除网页的部分内容。 ### 方法 2:使用终端将网页转换为 PDF 或图片 -你可能已经知道,你可以[在 Linux 终端浏览互联网][5],甚至[使用命令行下载文件][6]。这并不奇怪,因为你可以在终端中做更多的事情,包括将网页下载为 PDF。 +你可能已经知道,你可以 [在 Linux 终端浏览互联网][5],甚至 [使用命令行下载文件][6]。这并不奇怪,因为你可以在终端中做更多的事情,包括将网页下载为 PDF。 -一个灵巧的开源命令行工具 **wkhtmltopdf** 和 **wkhtmltoimage** 来拯救你,让你把任何 HTML 网页转换成 PDF 或图像文件。 +一个灵巧的开源命令行工具 `wkhtmltopdf` 和 `wkhtmltoimage` 可以帮到你,让你把任何 HTML 网页转换成 PDF 或图像文件。 它使用 Qt WebKit 渲染引擎来完成这个任务。你可以浏览它的 [GitHub页面][7] 了解更多信息。 @@ -67,11 +68,11 @@ wkhtmltopdf URL/domain filename.pdf wkhtmltopdf linuxmint.com mint.pdf ``` -你可以选择使用 “****” 完整的 URL 或使用域名,如上面的例子所示。 +你可以选择使用 `https://linuxmint.com` 这样完整的 URL 或使用域名,如上面的例子所示。 默认情况下,生成的文件将保存在主目录下。 -在转换网页时,你还可以得到一些令人兴奋的选项。 +在转换网页时,你还可以得到一些好玩的选项。 例如,你可以**对 PDF 文件应用灰度过滤器**,在同一文件中**制作多个页面副本**,以及在转换过程中**排除**图像。 @@ -99,13 +100,13 @@ wkhtmltopdf --no-images linuxmint.com mint.pdf wkhtmltoimage linuxmint.com mint.png ``` -注意,与使用浏览器的 GUI 方法不同,通过终端使用这些工具有其局限性。它似乎不能成功转换利用任何 <iframe> 代码片段的网页。 +注意,与使用浏览器的 GUI 方法不同,通过终端使用这些工具有其局限性。它似乎不能成功转换利用任何 `