From ab61622935f2375ad04b76cd15f212591e3d1bd2 Mon Sep 17 00:00:00 2001 From: geekpi Date: Mon, 26 Oct 2020 09:11:27 +0800 Subject: [PATCH 01/26] translting --- ...201006 Start using virtual tables in Apache Cassandra 4.0.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20201006 Start using virtual tables in Apache Cassandra 4.0.md b/sources/tech/20201006 Start using virtual tables in Apache Cassandra 4.0.md index 5cd6aa97fa..8b171df5c4 100644 --- a/sources/tech/20201006 Start using virtual tables in Apache Cassandra 4.0.md +++ b/sources/tech/20201006 Start using virtual tables in Apache Cassandra 4.0.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From d905cc8887c7cd1c4ae36a2df9650d8dddbc50ba Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Oct 2020 10:30:37 +0800 Subject: [PATCH 02/26] PRF @geekpi --- .../20201016 Set up ZFS on Linux with yum.md | 44 +++++++------------ 1 file changed, 17 insertions(+), 27 deletions(-) diff --git a/translated/tech/20201016 Set up ZFS on Linux with yum.md b/translated/tech/20201016 Set up ZFS on Linux with yum.md index cb61d4dc55..860b8c7f0d 100644 --- a/translated/tech/20201016 Set up ZFS on Linux with yum.md +++ b/translated/tech/20201016 Set up ZFS on Linux with yum.md @@ -1,6 +1,6 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (Set up ZFS on Linux with yum) @@ -9,29 +9,28 @@ 在 Linux 上使用 yum 设置 ZFS ====== -在 Fedora 上使用 yum 仓库里来使用最新的 ZFS 特性。 -![Puzzle pieces coming together to form a computer screen][1] -我是一名 Fedora Linux 用户,我每天都会运行 `yum upgrade`。虽然这个习惯使我能够运行所有最新的软件([Fedora 的四个基础][2]之一的 “First” (第一),它也做到了),但它也会提醒 [ZFS][3] 存储平台和新内核之间的任何不兼容。 +> 在 Fedora 上使用 yum 仓库来获取最新的 ZFS 特性。 + +![](https://img.linux.net.cn/data/attachment/album/202010/26/103028g9q3v3e391c9b62v.jpg) + +我是一名 Fedora Linux 用户,我每天都会运行 `yum upgrade`。虽然这个习惯使我能够运行所有最新的软件([Fedora 的四个基础][2]之一的 “First” ,它也做到了),但它也会提醒 [ZFS][3] 存储平台和新内核之间的不兼容性。 作为一名开发者,有时我需要最新的 ZFS 分支的新特性。例如,ZFS 2.0.0 包含了一个令人兴奋的新功能,它大大[提高了 ZVOL 同步性能][4],这对我这个 KVM 用户来说至关重要。但这意味着,如果我想使用 2.0.0 分支,我必须自己构建 ZFS。 -起初,我只是在每次内核更新后从它的 Git 仓库中手动编译 ZFS。如果我忘记了,ZFS 就会在下次启动时无法被识别。幸运的是,我很快就学会了如何为 ZFS 设置动态内核模块支持 ([DKMS][5])。然而,这个解决方案并不完美。首先,它没有利用强大的 [yum][6] 系统,而这个系统可以帮助解决依赖关系和升级。此外,使用 yum 在你自己的包和上游包之间进行切换是非常容易的。 +起初,我只是在每次内核更新后从它的 Git 仓库中手动编译 ZFS。如果我忘记了,ZFS 就会在下次启动时无法被识别。幸运的是,我很快就学会了如何为 ZFS 设置动态内核模块支持 ([DKMS][5])。然而,这个解决方案并不完美。首先,它没有利用强大的 [yum][6] 系统,而这个系统可以帮助解决依赖关系和升级。此外,使用 `yum` 在你自己的包和上游包之间进行切换是非常容易的。 -在本文中,我将演示如何设置 yum 仓库来打包 ZFS。这个方案有两个步骤: +在本文中,我将演示如何设置 `yum` 仓库来打包 ZFS。这个方案有两个步骤: 1. 从 ZFS 的 Git 仓库中创建 RPM 包。 - 2. 建立一个 yum 仓库来托管这些包。 - - + 2. 建立一个 `yum` 仓库来托管这些包。 ### 创建 RPM 包 -要创建 RPM 包,你需要安装 RPM 工具链。yum 提供了组来捆绑安装工具: - +要创建 RPM 包,你需要安装 RPM 工具链。`yum` 提供了一个组来捆绑安装这些工具: ``` -`sudo dnf group install 'C Development Tools and Libraries' 'RPM Development Tools'` +sudo dnf group install 'C Development Tools and Libraries' 'RPM Development Tools' ``` 安装完这些之后,你必须从 ZFS Git 仓库中安装构建 ZFS 所需的所有包。这些包属于三个组: @@ -40,9 +39,6 @@ 2. 用于构建 ZFS 内核和用户态工具的库。 3. 构建 RPM 包的库。 - - - ``` sudo dnf install libtool autoconf automake gettext createrepo \     libuuid-devel libblkid-devel openssl-devel libtirpc-devel \ @@ -60,10 +56,7 @@ sudo dnf install libtool autoconf automake gettext createrepo \ 1. 用 `git` 克隆仓库,并切换到你希望使用的分支/标签。 2. 运行 Autotools 生成一个 makefile。 - 3. 运行 `make rpm`,如果一切正常,RPM 文件将被放置在构建文件夹中。 - - - + 3. 运行 `make rpm`,如果一切正常,RPM 文件将被放置在 `build` 文件夹中。 ``` $ git clone --branch=zfs-2.0.0-rc3 zfs @@ -75,10 +68,9 @@ $ make rpm ### 建立一个 yum 仓库 -在 yum 中,仓库是一个服务器或本地路径,包括元数据和 RPM 文件。用户设置一个 INI 配置文件,`yum` 命令会自动解析元数据并下载相应的软件包。 - -Fedora 提供了 `createrepo` 工具来设置 yum 仓库。首先,创建仓库,并将 ZFS 文件夹中的所有 RPM 文件复制到仓库中。然后运行 `createrepo --update` 将所有的包加入到元数据中。 +在 `yum` 中,仓库是一个服务器或本地路径,包括元数据和 RPM 文件。用户设置一个 INI 配置文件,`yum` 命令会自动解析元数据并下载相应的软件包。 +Fedora 提供了 `createrepo` 工具来设置 `yum` 仓库。首先,创建仓库,并将 ZFS 文件夹中的所有 RPM 文件复制到仓库中。然后运行 `createrepo --update` 将所有的包加入到元数据中。 ``` $ sudo mkdir -p /var/lib/zfs.repo @@ -89,17 +81,15 @@ $ sudo createrepo --update /var/lib/zfs.repo 在 `/etc/yum.repos.d` 中创建一个新的配置文件来包含仓库路径: - ``` $ echo \ -"[zfs-local]\\\nname=ZFS Local\\\nbaseurl=file:///var/lib/zfs.repo\\\nenabled=1\\\ngpgcheck=0" |\ +"[zfs-local]\\nname=ZFS Local\\nbaseurl=file:///var/lib/zfs.repo\\nenabled=1\\ngpgcheck=0" |\ sudo tee /etc/yum.repos.d/zfs-local.repo $ sudo dnf --repo=zfs-local list available --refresh ``` -终于完成了!你已经有了一个可以使用的 yum 仓库和 ZFS 包。现在你只需要安装它们。 - +终于完成了!你已经有了一个可以使用的 `yum` 仓库和 ZFS 包。现在你只需要安装它们。 ``` $ sudo dnf install zfs @@ -115,7 +105,7 @@ via: https://opensource.com/article/20/10/zfs-dnf 作者:[Sheng Mao][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 57622fa6a549c05b6df036b50507368ba0c21797 Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Oct 2020 10:31:04 +0800 Subject: [PATCH 03/26] PUB @geekpi https://linux.cn/article-12754-1.html --- .../20201016 Set up ZFS on Linux with yum.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201016 Set up ZFS on Linux with yum.md (98%) diff --git a/translated/tech/20201016 Set up ZFS on Linux with yum.md b/published/20201016 Set up ZFS on Linux with yum.md similarity index 98% rename from translated/tech/20201016 Set up ZFS on Linux with yum.md rename to published/20201016 Set up ZFS on Linux with yum.md index 860b8c7f0d..1386118d8b 100644 --- a/translated/tech/20201016 Set up ZFS on Linux with yum.md +++ b/published/20201016 Set up ZFS on Linux with yum.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12754-1.html) [#]: subject: (Set up ZFS on Linux with yum) [#]: via: (https://opensource.com/article/20/10/zfs-dnf) [#]: author: (Sheng Mao https://opensource.com/users/ivzhh) From eaad5fd772388125e9d2afb28ec757b0a7b726e1 Mon Sep 17 00:00:00 2001 From: xiao-song-123 <463020345@qq.com> Date: Mon, 26 Oct 2020 11:29:12 +0800 Subject: [PATCH 04/26] Update 20201001 How open source underpins blockchain technology.md --- ...n source underpins blockchain technology.md | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/sources/tech/20201001 How open source underpins blockchain technology.md b/sources/tech/20201001 How open source underpins blockchain technology.md index 976fbf4411..c8c981d90d 100644 --- a/sources/tech/20201001 How open source underpins blockchain technology.md +++ b/sources/tech/20201001 How open source underpins blockchain technology.md @@ -1,11 +1,11 @@ -[#]: collector: (lujun9972) -[#]: translator: ( ) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (How open source underpins blockchain technology) -[#]: via: (https://opensource.com/article/20/10/open-source-blockchain) -[#]: author: (Matt Shealy https://opensource.com/users/mshealy) +[#]: collector: "lujun9972" +[#]: translator: "xiao-song-123" +[#]: reviewer: " " +[#]: publisher: " " +[#]: url: " " +[#]: subject: "How open source underpins blockchain technology" +[#]: via: "https://opensource.com/article/20/10/open-source-blockchain" +[#]: author: "Matt Shealy https://opensource.com/users/mshealy" How open source underpins blockchain technology ====== @@ -79,7 +79,7 @@ via: https://opensource.com/article/20/10/open-source-blockchain [a]: https://opensource.com/users/mshealy [b]: https://github.com/lujun9972 -[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ (cubes coming together to create a larger cube) +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cube_innovation_process_block_container.png?itok=vkPYmSRQ "cubes coming together to create a larger cube" [2]: https://www.linuxfoundation.org/wp-content/uploads/2020/08/2020_kernel_history_report_082720.pdf [3]: https://www.freecodecamp.org/news/what-is-a-dapp-a-guide-to-ethereum-dapps/ [4]: https://www.investopedia.com/ask/answers/063015/what-are-some-major-regulatory-agencies-responsible-overseeing-financial-institutions-us.asp From 48f0548fd77d1dd6e092d8a1c967ec255a60c04c Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Oct 2020 23:35:07 +0800 Subject: [PATCH 05/26] PRF @geekpi --- ...pp for Various Streaming Music Services.md | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/translated/tech/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md b/translated/tech/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md index 52a496be07..ecf2f46e68 100644 --- a/translated/tech/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md +++ b/translated/tech/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md @@ -1,32 +1,34 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) -[#]: reviewer: ( ) +[#]: reviewer: (wxy) [#]: publisher: ( ) [#]: url: ( ) [#]: subject: (MellowPlayer is a Desktop App for Various Streaming Music Services) [#]: via: (https://itsfoss.com/mellow-player/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) -MellowPlayer 是一款用于各种流媒体音乐服务的桌面应用 +MellowPlayer:一款用于各种流媒体音乐服务的桌面应用 ====== -_**简介:MellowPlayer 是一个免费开源的桌面应用,可以让你在 Linux 和 Windows 上整合基于网络的音乐流媒体服务。**_ +> MellowPlayer 是一个自由开源的桌面应用,可以让你在 Linux 和 Windows 上整合基于网络的音乐流媒体服务。 + +![][8] 毋庸置疑,很多用户都喜欢使用流媒体服务来收听自己喜欢的音乐,而不是从商店购买单首音乐或者下载收藏。 -当然,流媒体服务可以让你探索新的音乐,帮助艺术家轻松接触到更多的听众。但是,由于有许多的音乐流媒体服务([Soundcloud][1]、[Spotify][2]、[YouTube Music][3]、[Amazon Music][4] 等),因此当在使用电脑时,要有效地使用它们往往会变得很麻烦。 +当然,流媒体服务可以让你探索新的音乐,帮助艺术家轻松传播到更多的听众。但是,由于有许多的音乐流媒体服务([Soundcloud][1]、[Spotify][2]、[YouTube Music][3]、[Amazon Music][4] 等),因此当在使用电脑时,要有效地使用它们往往会变得很麻烦。 -你可以[在 Linux 上安装 Spotify][5],但没有 Amazon Music 的桌面应用。所以,有可能你无法从单一门户管理流媒体服务。 +你可以[在 Linux 上安装 Spotify][5],但没有 Amazon Music 的桌面应用,所以,有可能你无法从单一门户管理流媒体服务。 -如果一个桌面应用可以让你同时在 Windows 和 Linux 上免费整合流媒体服务呢?在本文中,我将介绍这样一款应用:“[MellowPlayer][6]”。 +如果一个桌面应用可以让你同时在 Windows 和 Linux 上免费整合流媒体服务呢?在本文中,我将介绍这样一款应用:[MellowPlayer][6]。 ### MellowPlayer: 集成各种流媒体音乐服务的开源应用 ![][7] -MellowPlayer 是一款免费开源的跨平台桌面应用,它可以让你整合多个流媒体服务,并在一个界面上管理它们。 +MellowPlayer 是一款自由开源的跨平台桌面应用,它可以让你整合多个流媒体服务,并在一个界面上管理它们。 -你可以整合多个支持的流媒体服务。你还可以从每个单独的服务中获得一定程度的控制权来调整你的体验。例如,你可以设置自动跳过广告或在 YouTube 上静音。 +你可以整合多个支持的流媒体服务。你还可以从每个服务中获得一定程度的控制权,来调整你的体验。例如,你可以设置在 YouTube 上自动跳过或静音广告。 对 Windows 和 Linux 的跨平台支持绝对是一个加分项。 @@ -36,25 +38,21 @@ MellowPlayer 是一款免费开源的跨平台桌面应用,它可以让你整 ### MellowPlayer 的特点 -![][8] - * 跨平台 (Windows 和 Linux) - * 免费且开源 - * 基于插件的应用,让你通过创建一个插件来添加新的服务 + * 自由且开源 + * 基于插件的应用,让你可以通过创建一个插件来添加新的服务 * 将服务作为本地桌面应用与系统托盘整合 * 支持热键 * 支持通知 * 收听历史 - - ### 在 Linux 上安装 MellowPlayer ![][9] -MellowPlayer 是以 [Flatpak 包][10]的形式提供的。我知道这让一些人很失望,但它在 Linux 中只有 Flaptak,WIndows 中只有一个可执行文件。如果你不知道,请按照我们的[在 Linux 上使用 Flatpak][11] 指南来开始使用。 +MellowPlayer 是以 [Flatpak 包][10]的形式提供的。我知道这让一些人很失望,但它在 Linux 中只有 Flaptak,Windows 中只有一个可执行文件。如果你不知道,请按照我们的[在 Linux 上使用 Flatpak][11] 指南来开始使用。 -[下载 MellowPlayer][12] +- [下载 MellowPlayer][12] ### 总结 @@ -71,7 +69,7 @@ via: https://itsfoss.com/mellow-player/ 作者:[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 d5ca879a272ccc50f2a75072eba535fa6d6245cc Mon Sep 17 00:00:00 2001 From: Xingyu Wang Date: Mon, 26 Oct 2020 23:37:38 +0800 Subject: [PATCH 06/26] PUB @geekpi https://linux.cn/article-12759-1.html --- ...r is a Desktop App for Various Streaming Music Services.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename {translated/tech => published}/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md (98%) diff --git a/translated/tech/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md b/published/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md similarity index 98% rename from translated/tech/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md rename to published/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md index ecf2f46e68..b9a67ba724 100644 --- a/translated/tech/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md +++ b/published/20201014 MellowPlayer is a Desktop App for Various Streaming Music Services.md @@ -1,8 +1,8 @@ [#]: collector: (lujun9972) [#]: translator: (geekpi) [#]: reviewer: (wxy) -[#]: publisher: ( ) -[#]: url: ( ) +[#]: publisher: (wxy) +[#]: url: (https://linux.cn/article-12759-1.html) [#]: subject: (MellowPlayer is a Desktop App for Various Streaming Music Services) [#]: via: (https://itsfoss.com/mellow-player/) [#]: author: (Ankush Das https://itsfoss.com/author/ankush/) From a1794ee4656d877ad345982a8a2b768688dc663d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:01:59 +0800 Subject: [PATCH 07/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201023=20Se?= =?UTF-8?q?cure=20NTP=20with=20NTS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201023 Secure NTP with NTS.md --- sources/tech/20201023 Secure NTP with NTS.md | 171 +++++++++++++++++++ 1 file changed, 171 insertions(+) create mode 100644 sources/tech/20201023 Secure NTP with NTS.md diff --git a/sources/tech/20201023 Secure NTP with NTS.md b/sources/tech/20201023 Secure NTP with NTS.md new file mode 100644 index 0000000000..00cfdfd20d --- /dev/null +++ b/sources/tech/20201023 Secure NTP with NTS.md @@ -0,0 +1,171 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Secure NTP with NTS) +[#]: via: (https://fedoramagazine.org/secure-ntp-with-nts/) +[#]: author: (Miroslav Lichvar https://fedoramagazine.org/author/mlichvar/) + +Secure NTP with NTS +====== + +![][1] + +Many computers use the Network Time Protocol (NTP) to synchronize their system clocks over the internet. NTP is one of the few unsecured internet protocols still in common use. An attacker that can observe network traffic between a client and server can feed the client with bogus data and, depending on the client’s implementation and configuration, force it to set its system clock to any time and date. Some programs and services might not work if the client’s system clock is not accurate. For example, a web browser will not work correctly if the web servers’ certificates appear to be expired according to the client’s system clock. Use Network Time Security (NTS) to secure NTP. + +Fedora 33[1][2] is the first Fedora release to support NTS. NTS is a new authentication mechanism for NTP. It enables clients to verify that the packets they receive from the server have not been modified while in transit. The only thing an attacker can do when NTS is enabled is drop or delay packets. See [RFC8915][3] for further details about NTS. + +NTP can be secured well with symmetric keys. Unfortunately, the server has to have a different key for each client and the keys have to be securely distributed. That might be practical with a private server on a local network, but it does not scale to a public server with millions of clients. + +NTS includes a Key Establishment (NTS-KE) protocol that automatically creates the encryption keys used between the server and its clients. It uses Transport Layer Security (TLS) on TCP port 4460. It is designed to scale to very large numbers of clients with a minimal impact on accuracy. The server does not need to keep any client-specific state. It provides clients with cookies, which are encrypted and contain the keys needed to authenticate the NTP packets. Privacy is one of the goals of NTS. The client gets a new cookie with each server response, so it doesn’t have to reuse cookies. This prevents passive observers from tracking clients migrating between networks. + +The default NTP client in Fedora is _chrony_. Chrony added NTS support in version 4.0. The default configuration hasn’t changed. Chrony still uses public servers from the [pool.ntp.org][4] project and NTS is not enabled by default. + +Currently, there are very few public NTP servers that support NTS. The two major providers are Cloudflare and Netnod. The [Cloudflare servers][5] are in various places around the world. They use anycast addresses that should allow most clients to reach a close server. The [Netnod servers][6] are located in Sweden. In the future we will probably see more public NTP servers with NTS support. + +A general recommendation for configuring NTP clients for best reliability is to have at least three working servers. For best accuracy, it is recommended to select close servers to minimize network latency and asymmetry caused by asymmetric network routing. If you are not concerned about fine-grained accuracy, you can ignore this recommendation and use any NTS servers you trust, no matter where they are located. + +If you do want high accuracy, but you don’t have a close NTS server, you can mix distant NTS servers with closer non-NTS servers. However, such a configuration is less secure than a configuration using NTS servers only. The attackers still cannot force the client to accept arbitrary time, but they do have a greater control over the client’s clock and its estimate of accuracy, which may be unacceptable in some environments. + +### Enable client NTS in the installer + +When installing Fedora 33, you can enable NTS in the _Time & Date_ dialog in the _Network Time_ configuration. Enter the name of the server and check the NTS support before clicking the **+** (Add) button. You can add one or more servers or pools with NTS. To remove the default pool of servers (_2.fedora.pool.ntp.org_), uncheck the corresponding mark in the _Use_ column. + +![Network Time configuration in Fedora installer][7] + +### Enable client NTS in the configuration file + +If you upgraded from a previous Fedora release, or you didn’t enable NTS in the installer, you can enable NTS directly in _/etc/chrony.conf_. Specify the server with the _nts_ option in addition to the recommended _iburst_ option. For example: + +``` +server time.cloudflare.com iburst nts +server nts.sth1.ntp.se iburst nts +server nts.sth2.ntp.se iburst nts +``` + +You should also allow the client to save the NTS keys and cookies to disk, so it doesn’t have to repeat the NTS-KE session on each start. Add the following line to _chrony.conf_, if it is not already present: + +``` +ntsdumpdir /var/lib/chrony +``` + +If you don’t want NTP servers provided by DHCP to be mixed with the servers you have specified, remove or comment out the following line in _chrony.conf_: + +``` +sourcedir /run/chrony-dhcp +``` + +After you have finished editing _chrony.conf_, save your changes and restart the _chronyd_ service: + +``` +systemctl restart chronyd +``` + +### Check client status + +Run the following command under the root user to check whether the NTS key establishment was successful: + +``` +# chronyc -N authdata +Name/IP address Mode KeyID Type KLen Last Atmp NAK Cook CLen +========================================================================= +time.cloudflare.com NTS 1 15 256 33m 0 0 8 100 +nts.sth1.ntp.se NTS 1 15 256 33m 0 0 8 100 +nts.sth2.ntp.se NTS 1 15 256 33m 0 0 8 100 +``` + +The _KeyID_, _Type_, and _KLen_ columns should have non-zero values. If they are zero, check the system log for error messages from _chronyd_. One possible cause of failure is a firewall is blocking the client’s connection to the server’s TCP port ( port 4460). + +Another possible cause of failure is a certificate that is failing to verify because the client’s clock is wrong. This is a chicken-or-the-egg type problem with NTS. You may need to manually correct the date or temporarily disable NTS in order to get NTS working. If your computer has a real-time clock, as almost all computers do, and it’s backed up by a good battery, this operation should be needed only once. + +If the computer doesn’t have a real-time clock or battery, as is common with some small ARM computers like the Raspberry Pi, you can add the _-s_ option to _/etc/sysconfig/chronyd_ to restore time saved on the last shutdown or reboot. The clock will be behind the true time, but if the computer wasn’t shut down for too long and the server’s certificates were not renewed too close to their expiration, it should be sufficient for the time checks to succeed. As a last resort, you can disable the time checks with the _nocerttimecheck_ directive. See the _chrony.conf(5)_ man page for details. + +Run the following command to confirm that the client is making NTP measurements: + +``` +# chronyc -N sources +MS Name/IP address Stratum Poll Reach LastRx Last sample +=============================================================================== +^* time.cloudflare.com 3 6 377 45 +355us[ +375us] +/- 11ms +^+ nts.sth1.ntp.se 1 6 377 44 +237us[ +237us] +/- 23ms +^+ nts.sth2.ntp.se 1 6 377 44 -170us[ -170us] +/- 22ms +``` + +The _Reach_ column should have a non-zero value; ideally 377. The value 377 shown above is an octal number. It indicates that the last eight requests all had a valid response. The validation check will include NTS authentication if enabled. If the value only rarely or never gets to 377, it indicates that NTP requests or responses are getting lost in the network. Some major network operators are known to have middleboxes that block or limit rate of large NTP packets as a mitigation for amplification attacks that exploit the monitoring protocol of _ntpd_. Unfortunately, this impacts NTS-protected NTP packets, even though they don’t cause any amplification. The NTP working group is considering an alternative port for NTP as a workaround for this issue. + +### Enable NTS on the server + +If you have your own NTP server running _chronyd_, you can enable server NTS support to allow its clients to be synchronized securely. If the server is a client of other servers, it should use NTS or a symmetric key for its own synchronization. The clients assume the synchronization chain is secured between all servers up to the primary time servers. + +Enabling server NTS is similar to enabling HTTPS on a web server. You just need a private key and certificate. The certificate could be signed by the Let’s Encrypt authority using the _certbot_ tool, for example. When you have the key and certificate file (including intermediate certificates), specify them in _chrony.conf_ with the following directives: + +``` +ntsserverkey /etc/pki/tls/private/foo.example.net.key +ntsservercert /etc/pki/tls/certs/foo.example.net.crt +``` + +Make sure the _ntsdumpdir_ directive mentioned previously in the client configuration is present in _chrony.conf_. It allows the server to save its keys to disk, so the clients of the server don’t have to get new keys and cookies when the server is restarted. + +Restart the _chronyd_ service: + +``` +systemctl restart chronyd +``` + +If there are no error messages in the system log from _chronyd_, it should be accepting client connections. If the server has a firewall, it needs to allow both the UDP 123 and TCP 4460 ports for NTP and NTS-KE respectively. + +You can perform a quick test from a client machine with the following command: + +``` +$ chronyd -Q -t 3 'server foo.example.net iburst nts maxsamples 1' +2020-10-13T12:00:52Z chronyd version 4.0 starting (+CMDMON +NTP +REFCLOCK +RTC +PRIVDROP +SCFILTER +SIGND +ASYNCDNS +NTS +SECHASH +IPV6 +DEBUG) +2020-10-13T12:00:52Z Disabled control of system clock +2020-10-13T12:00:55Z System clock wrong by -0.001032 seconds (ignored) +2020-10-13T12:00:55Z chronyd exiting +``` + +If you see a _System clock wrong_ message, it’s working correctly. + +On the server, you can use the following command to check how many NTS-KE connections and authenticated NTP packets it has handled: + +``` +# chronyc serverstats +NTP packets received : 2143106240 +NTP packets dropped : 117180834 +Command packets received : 16819527 +Command packets dropped : 0 +Client log records dropped : 574257223 +NTS-KE connections accepted: 104 +NTS-KE connections dropped : 0 +Authenticated NTP packets : 52139 +``` + +If you see non-zero _NTS-KE connections accepted_ and _Authenticated NTP packets_, it means at least some clients were able to connect to the NTS-KE port and send an authenticated NTP request. + +_— Cover photo by Louis. K on Unsplash —_ + +* * * + +1\. The Fedora 33 _Beta_ installer contains an older chrony prerelease which doesn’t work with current NTS servers because the NTS-KE port has changed. Consequently, in the Network Time configuration in the installer, the servers will always appear as not working. After installation, the chrony package needs to be updated before it will work with current servers. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/secure-ntp-with-nts/ + +作者:[Miroslav Lichvar][a] +选题:[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/mlichvar/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/10/secure-ntp-with-nts-816x345.jpg +[2]: tmp.rl0XC1HIGm#footnote1 +[3]: https://tools.ietf.org/html/rfc8915 +[4]: https://www.pool.ntp.org +[5]: https://developers.cloudflare.com/time-services/nts/usage +[6]: https://www.netnod.se/time-and-frequency/how-to-use-nts +[7]: https://fedoramagazine.org/wp-content/uploads/2020/10/anaconda-nts.png From 8d447ca112223e6c3f0f1479b7d37341013773fb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:02:12 +0800 Subject: [PATCH 08/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201021=20In?= =?UTF-8?q?cremental=20backup=20with=20Butterfly=20Backup?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201021 Incremental backup with Butterfly Backup.md --- ...ncremental backup with Butterfly Backup.md | 290 ++++++++++++++++++ 1 file changed, 290 insertions(+) create mode 100644 sources/tech/20201021 Incremental backup with Butterfly Backup.md diff --git a/sources/tech/20201021 Incremental backup with Butterfly Backup.md b/sources/tech/20201021 Incremental backup with Butterfly Backup.md new file mode 100644 index 0000000000..5c2b99d950 --- /dev/null +++ b/sources/tech/20201021 Incremental backup with Butterfly Backup.md @@ -0,0 +1,290 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Incremental backup with Butterfly Backup) +[#]: via: (https://fedoramagazine.org/butterfly-backup/) +[#]: author: (Matteo Guadrini https://fedoramagazine.org/author/matteoguadrini/) + +Incremental backup with Butterfly Backup +====== + +![][1] + +### Introduction + +This article explains how to make incremental or differential backups, with a catalog available to restore (or export) at the point you want, with [Butterfly Backup][2]. + +#### Requirements + +Butterfly Backup is a simple wrapper of rsync written in python; the first requirement is **[python3.3][3]** or higher (plus module [cryptography][4] for _init_ action). Other requirements are **[openssh][5]** and **[rsync][6]** (version 2.5 or higher). Ok, let’s go! + +[Editors note: rsync version 3.2.3 is already installed on Fedora 33 systems] + +``` +$ sudo dnf install python3 openssh rsync git +$ sudo pip3 install cryptography +``` + +### Installation + +After that, installing Butterfly Backup is very simple by using the following commands to clone the repository locally, and set up Butterfly Backup for use: + +``` +$ git clone https://github.com/MatteoGuadrini/Butterfly-Backup.git +$ cd Butterfly-Backup +$ sudo python3 setup.py +$ bb --help +$ man bb +``` + +To upgrade, you would use the same commands too. + +### Example + +Butterfly Backup is a server to client tool and is installed on a server (or workstation). The restore process restores the files into the specified client. This process shares some of the options available to the backup process. + +Backups are organized accord to precise catalog; this is an example: + +``` +$ tree destination/of/backup +. +├── destination +│ ├── hostname or ip of the PC under backup +│ │ ├── timestamp folder +│ │ │ ├── backup folders +│ │ │ ├── backup.log +│ │ │ └── restore.log +│ │ ├─── general.log +│ │ └─── symlink of last backup +│ +├── export.log +├── backup.list +└── .catalog.cfg +``` + +Butterfly Backup has six main operations, referred to as **actions**, you can get information about them with the _–help_ command. + +``` +$ bb --help +usage: bb [-h] [--verbose] [--log] [--dry-run] [--version] + {config,backup,restore,archive,list,export} ... + +Butterfly Backup + +optional arguments: + -h, --help show this help message and exit + --verbose, -v Enable verbosity + --log, -l Create a log + --dry-run, -N Dry run mode + --version, -V Print version + +action: + Valid action + + {config,backup,restore,archive,list,export} + Available actions + config Configuration options + backup Backup options + restore Restore options + archive Archive options + list List options + export Export options +``` + +#### Configuration + +Configuration mode is straight forward; If you’re already familiar with the exchange keys and OpenSSH, you probably won’t need it. First, you must create a configuration (rsa keys), for instance: + +``` +$ bb config --new +SUCCESS: New configuration successfully created! +``` + +After creating the configuration, the keys will be installed (copied) on the hosts you want to backup: + +``` +$ bb config --deploy host1 +Copying configuration to host1; write the password: +/usr/bin/ssh-copy-id: INFO: Source of key(s) to be installed: "/home/arthur/.ssh/id_rsa.pub" +/usr/bin/ssh-copy-id: INFO: attempting to log in with the new key(s), to filter out any that are already installed +/usr/bin/ssh-copy-id: INFO: 1 key(s) remain to be installed -- if you are prompted now it is to install the new keys +arthur@host1's password: + +Number of key(s) added: 1 + +Now try logging into the machine, with: "ssh 'arthur@host1'" +and check to make sure that only the key(s) you wanted were added. + +SUCCESS: Configuration copied successfully on host1! +``` + +#### Backup + +There are two backup modes: _single_ and _bulk_. +The most relevant features of the two backup modes are the parallelism and retention of old backups. See the two parameters _–parallel_ and _–retention_ in the [documentation][7]. + +##### Single backup + +The backup of a single machine consists in taking the files and folders indicated in the command line, and putting them into the cataloging structure indicated above. In other words, copy all file and folders of a machine into a path. + +This is an examples: + +``` +$ bb backup --computer host1 --destination /mnt/backup --data User Config --type Unix +Start backup on host1 +SUCCESS: Command rsync -ah --no-links arthur@host1:/home :/etc /mnt/backup/host1/2020_09_19__10_28 +``` + +##### Bulk backup + +Above all, bulk mode backups share the same options as single mode, with the difference that they accept a file containing a list of hostnames or ips. In this mode backups will performed in parallel (by default 5 machines at a time). Above all, if you want to run fewer or more machines in parallel, specify the _–parallel_ parameter. + +Incremental of the previous backup, for instance: + +``` +$ cat /home/arthur/pclist.txt +host1 +host2 +host3 +$ bb backup --list /home/arthur/pclist.txt --destination /mnt/backup --data User Config --type Unix +ERROR: The port 22 on host2 is closed! +ERROR: The port 22 on host3 is closed! +Start backup on host1 +SUCCESS: Command rsync -ahu --no-links --link-dest=/mnt/backup/host1/2020_09_19__10_28 arthur@host1:/home :/etc /mnt/backup/host1/2020_09_19__10_50 +``` + +There are four backup modes, which you specify with the _–mode_ flag: **Full** (backup all files) , **Mirror** (backup all files in mirror mode), **Differential** (is based on the latest _Full_ backup) and **Incremental** (is based on the latest backup). +The default mode is _Incremental_; _Full_ mode is set by default when the flag is not specified. + +#### Listing catalog + +The first time you run backup commands, the catalog is created. The catalog is used for future backups and all the restores that are made through Butterfly Backup. To query this catalog use the list command. +First, let’s query the catalog in our example: + +``` +$ bb list --catalog /mnt/backup + +BUTTERFLY BACKUP CATALOG + +Backup id: aba860b0-9944-11e8-a93f-005056a664e0 +Hostname or ip: host1 +Timestamp: 2020-09-19 10:28:12 + +Backup id: dd6de2f2-9a1e-11e8-82b0-005056a664e0 +Hostname or ip: host1 +Timestamp: 2020-09-19 10:50:59 +``` + +Press _q_ for exit and select a backup-id: + +``` +$ bb list --catalog /mnt/backup --backup-id dd6de2f2-9a1e-11e8-82b0-005056a664e0 +Backup id: dd6de2f2-9a1e-11e8-82b0-005056a664e0 +Hostname or ip: host1 +Type: Incremental +Timestamp: 2020-09-19 10:50:59 +Start: 2020-09-19 10:50:59 +Finish: 2020-09-19 11:43:51 +OS: Unix +ExitCode: 0 +Path: /mnt/backup/host1/2020_09_19__10_50 +List: backup.log +etc +home +``` + +To export the catalog list use it with an external tool like _cat_, include the _–_–_log_ flag: + +``` +$ bb list --catalog /mnt/backup --log +$ cat /mnt/backup/backup.list +``` + +#### Restore + +The restore process is the exact opposite of the backup process. It takes the files from a specific backup and push it to the destination computer. +This command perform a restore on the same machine of the backup, for instance: + +``` +$ bb restore --catalog /mnt/backup --backup-id dd6de2f2-9a1e-11e8-82b0-005056a664e0 --computer host1 --log +Want to do restore path /mnt/backup/host1/2020_09_19__10_50/etc? To continue [Y/N]? y +Want to do restore path /mnt/backup/host1/2020_09_19__10_50/home? To continue [Y/N]? y +SUCCESS: Command rsync -ahu -vP --log-file=/mnt/backup/host1/2020_09_19__10_50/restore.log /mnt/backup/host1/2020_09_19__10_50/etc arthur@host1:/restore_2020_09_19__10_50 +SUCCESS: Command rsync -ahu -vP --log-file=/mnt/backup/host1/2020_09_19__10_50/restore.log /mnt/backup/host1/2020_09_19__10_50/home/* arthur@host1:/home +``` + +> Without specifying the “_type_” flag that indicates the operating system on which the data are being retrieved, Butterfly Backup will select it directly from the catalog via the backup-id. + +#### Archive old backup + +Archive operations are used to store backups by saving disk space. + +``` +$ bb archive --catalog /mnt/backup/ --days 1 --destination /mnt/archive/ --verbose --log +INFO: Check archive this backup f65e5afe-9734-11e8-b0bb-005056a664e0. Folder /mnt/backup/host1/2020_09_18__17_50 +INFO: Check archive this backup 4f2b5f6e-9939-11e8-9ab6-005056a664e0. Folder /mnt/backup/host1/2020_09_15__07_26 +SUCCESS: Delete /mnt/backup/host1/2020_09_15__07_26 successfully. +SUCCESS: Archive /mnt/backup/host1/2020_09_15__07_26 successfully. +$ ls /mnt/archive +host1 +$ ls /mnt/archive/host1 +2020_09_15__07_26.zip +``` + +After that, look in the catalog and see that the backup was actually archived: + +``` +$ bb list --catalog /mnt/backup/ -i 4f2b5f6e-9939-11e8-9ab6-005056a664e0 +Backup id: 4f2b5f6e-9939-11e8-9ab6-005056a664e0 +Hostname or ip: host1 +Type: Incremental +Timestamp: 2020-09-15 07:26:46 +Start: 2020-09-15 07:26:46 +Finish: 2020-09-15 08:43:45 +OS: Unix +ExitCode: 0 +Path: /mnt/backup/host1/2020_09_15__07_26 +Archived: True +``` + +### Conclusion + +Butterfly Backup was born from a very complex need; this tool provides superpowers to rsync, automates the backup and restore process. In addition, the catalog allows you to have a system similar to a “time machine”. + +In conclusion, Butterfly Backup is a lightweight, versatile, simple and scriptable backup tool. + +One more thing; Easter egg: _**bb** -Vv_ + +Thank you for reading my post. + +Full documentation: [https://butterfly-backup.readthedocs.io/][7] +Github: + +* * * + +_Photo by [Manu M][8] on [Unsplash][9]_. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/butterfly-backup/ + +作者:[Matteo Guadrini][a] +选题:[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/matteoguadrini/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/09/butterfly-backup-816x345.jpg +[2]: https://matteoguadrini.github.io/Butterfly-Backup/ +[3]: https://fedoramagazine.org/help-port-python-packages-python-3/ +[4]: https://cryptography.io/en/latest/ +[5]: https://fedoramagazine.org/open-source-ssh-clients/ +[6]: https://fedoramagazine.org/scp-users-migration-guide-to-rsync/ +[7]: https://butterfly-backup.readthedocs.io/en/latest/ +[8]: https://unsplash.com/@leocub?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText +[9]: https://unsplash.com/s/photos/butterfly?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText From a3dc79bfe623f923a4bcbe3a299407f557f799eb Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:02:24 +0800 Subject: [PATCH 09/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201019=20We?= =?UTF-8?q?b=20of=20Trust,=20Part=202:=20Tutorial?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201019 Web of Trust, Part 2- Tutorial.md --- ...20201019 Web of Trust, Part 2- Tutorial.md | 198 ++++++++++++++++++ 1 file changed, 198 insertions(+) create mode 100644 sources/tech/20201019 Web of Trust, Part 2- Tutorial.md diff --git a/sources/tech/20201019 Web of Trust, Part 2- Tutorial.md b/sources/tech/20201019 Web of Trust, Part 2- Tutorial.md new file mode 100644 index 0000000000..b5e17fc7cc --- /dev/null +++ b/sources/tech/20201019 Web of Trust, Part 2- Tutorial.md @@ -0,0 +1,198 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Web of Trust, Part 2: Tutorial) +[#]: via: (https://fedoramagazine.org/web-of-trust-part-2-tutorial/) +[#]: author: (Kevin "Eonfge" Degeling https://fedoramagazine.org/author/eonfge/) + +Web of Trust, Part 2: Tutorial +====== + +![][1] + +["The spider web"][2] by [bluesbby][3] is licensed under [CC BY 2.0][4][][4] + +The [previous article][5] looked at how the Web of Trust works in concept, and how the Web of Trust is implemented at Fedora. In this article, you’ll learn how to do it yourself. The power of this system lies in everybody being able to validate the actions of others—if you know how to validate somebody’s work, you’re contributing to the strength of our shared security. + +### Choosing a project + +[Remmina][6] is a remote desktop client written in GTK+. It aims to be useful for system administrators and travelers who need to work with lots of remote computers in front of either large monitors or tiny netbooks. In the current age, where many people must work remotely or at least manage remote servers, the security of a program like Remmina is critical. Even if you do not use it yourself, you can contribute to the Web of Trust by checking it for others. + +The question is: how do you know that a given version of Remmina is good, and that the original developer—or distribution server—has not been compromised? + +For this tutorial, you’ll use [Flatpak][7] and the [Flathub][8] repository. Flatpak is intentionally well-suited for making verifiable rebuilds, which is one of the tenets of the Web of Trust. It’s easier to work with since it doesn’t require users to download independent development packages. Flatpak also uses techniques to prevent in‑flight tampering, using hashes to validate its read‑only state. As far as the Web of Trust is concerned, Flatpak is the future. + +For this guide, you use Remmina, but this guide generally applies to every application you use. It’s also not exclusive to Flatpak, and the general steps also apply to Fedora’s repositories. In fact, if you’re currently reading this article on Debian or Arch, you can still follow the instructions. If you want to follow along using traditional RPM repositories, make sure to check out [this article][9]. + +### Installing and checking + +To install Remmina, use the Software Center or run the following from a terminal: + +``` +flatpak install flathub org.remmina.Remmina -y +``` + +After installation, you’ll find the files in: + +``` +/var/lib/flatpak/app/org.remmina.Remmina/current/active/files/ +``` + +Open a terminal here and find the following directories using _ls -la_: + +``` +total 44 +drwxr-xr-x. 2 root root 4096 Jan 1 1970 bin +drwxr-xr-x. 3 root root 4096 Jan 1 1970 etc +drwxr-xr-x. 8 root root 4096 Jan 1 1970 lib +drwxr-xr-x. 2 root root 4096 Jan 1 1970 libexec +-rw-r--r--. 2 root root 18644 Aug 25 14:37 manifest.json +drwxr-xr-x. 2 root root 4096 Jan 1 1970 sbin +drwxr-xr-x. 15 root root 4096 Jan 1 1970 share +``` + +#### Getting the hashes + +In the _bin_ directory you will find the main binaries of the application, and in _lib_ you find all dependencies that Remmina uses. Now calculate a hash for _./bin/remmina_: + +``` +sha256sum ./bin/* +``` + +This will give you a list of numbers: checksums. Copy them to a temporary file, as this is the current version of Remmina that Flathub is distributing. These numbers have something special: only an exact copy of Remmina can give you the same numbers. Any change in the code—no matter how minor—will produce different numbers. + +Like Fedora’s Koji and Bodhi build and update services, Flathub has all its build servers in plain view. In the case of Flathub, look at [Buildbot][10] to see who is responsible for the official binaries of a package. Here you will find all of the logs, including all the failed builds and their paper trail. + +![][11] + +#### Getting the source + +The main Flathub project is hosted on GitHub, where the exact compile instructions (“manifest” in Flatpak terms) are visible for all to see. Open a new terminal in your Home folder. Clone the instructions, and possible submodules, using one command: + +``` +git clone --recurse-submodules https://github.com/flathub/org.remmina.Remmina +``` + +#### Developer tools + +Start off by installing the Flatpak Builder: + +``` +sudo dnf install flatpak-builder +``` + +After that, you’ll need to get the right SDK to rebuild Remmina. In the manifest, you’ll find the current SDK is. + +``` +"runtime": "org.gnome.Platform", + "runtime-version": "3.38", + "sdk": "org.gnome.Sdk", + "command": "remmina", +``` + +This indicates that you need the GNOME SDK, which you can install with: + +``` +flatpak install org.gnome.Sdk//3.38 +``` + +This provides the latest versions of the Free Desktop and GNOME SDK. There are also additional SDK’s for additional options, but those are beyond the scope of this tutorial. + +#### Generating your **own hashes** + +Now that everything is set up, compile your version of Remmina by running: + +``` +flatpak-builder build-dir org.remmina.Remmina.json --force-clean +``` + +After this, your terminal will print a lot of text, your fans will start spinning, and you’re compiling Remmina. If things do not go so smoothly, refer to the [Flatpak Documentation][12]; troubleshooting is beyond the scope of this tutorial. + +Once complete, you should have the directory ._/build-dir/files/_, which should contain the same layout as above. Now the moment of truth: it’s time to generate the hashes for the built project: + +``` +sha256sum ./bin/* +``` + +![][13] + +You should get exactly the same numbers. This proves that the version on Flathub is indeed the version that the Remmina developers and maintainers intended for you to run. This is great, because this shows that Flathub has not been compromised. The web of trust is strong, and you just made it a bit better. + +### Going deeper + +But what about the _./lib/_ directory? And what version of Remmina did you actually compile? This is where the Web of Trust starts to branch. First, you can also double-check the hashes of the _./lib/_ directory. Repeat the _sha256sum_ command using a different directory. + +But what version of Remmina did you compile? Well, that’s in the Manifest. In the text file you’ll find (usually at the bottom) the git repository and branch that you just used. At the time of this writing, that is: + +``` +"type": "git", +"url": "https://gitlab.com/Remmina/Remmina.git", +"tag": "v1.4.8", +"commit": "7ebc497062de66881b71bbe7f54dabfda0129ac2" +``` + +Here, you can decide to look at the Remmina code itself: + +``` +git clone --recurse-submodules https://gitlab.com/Remmina/Remmina.git +cd ./Remmina +git checkout tags/v1.4.8 +``` + +The last two commands are important, since they ensure that you are looking at the right version of Remmina. Make sure you use the corresponding tag of the Manifest file. you can see everything that you just built. + +### What if…? + +The question on some minds is: what if the hashes don’t match? Quoting a famous novel: “Don’t Panic.” There are multiple legitimate reasons as to why the hashes do not match. + +It might be that you are not looking at the same version. If you followed this guide to a T, it should give matching results, but minor errors will cause vastly different results. Repeat the process, and ask for help if you’re unsure if you’re making errors. Perhaps Remmina is in the process of updating. + +But if that still doesn’t justify the mismatch in hashes, go to the [maintainers of Remmina][14] on Flathub and open an issue. Assume good intentions, but you might be onto something that isn’t totally right. + +The most obvious upstream issue is that Remmina does not properly support reproducible builds yet. The code of Remmina needs to be written in such a way that repeating the same action twice, gives the same result. For developers, there is an [entire guide][15] on how to do that. If this is the case, there should be an issue on the upstream bug-tracker, and if it is not there, make sure that you create one by explaining your steps and the impact. + +If all else fails, and you’ve informed upstream about the discrepancies and they to don’t know what is happening, then it’s time to send an email to the Administrators of Flathub and the developer in question. + +### Conclusion + +At this point, you’ve gone through the entire process of validating a single piece of a bigger picture. Here, you can branch off in different directions: + + * Try another Flatpak application you like or use regularly + * Try the RPM version of Remmina + * Do a deep dive into the C code of Remmina + * Relax for a day, knowing that the Web of Trust is a collective effort + + + +In the grand scheme of things, we can all carry a small part of responsibility in the Web of Trust. By taking free/libre open source software (FLOSS) concepts and applying them in the real world, you can protect yourself and others. Last but not least, by understanding how the Web of Trust works you can see how FLOSS software provides unique protections. + +-------------------------------------------------------------------------------- + +via: https://fedoramagazine.org/web-of-trust-part-2-tutorial/ + +作者:[Kevin "Eonfge" Degeling][a] +选题:[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/eonfge/ +[b]: https://github.com/lujun9972 +[1]: https://fedoramagazine.org/wp-content/uploads/2020/09/weboftrust2-816x345.jpg +[2]: https://www.flickr.com/photos/17367470@N05/21329974875 +[3]: https://www.flickr.com/photos/17367470@N05 +[4]: https://creativecommons.org/licenses/by/2.0/?ref=ccsearch&atype=html +[5]: https://fedoramagazine.org/web-of-trust-part-1-concept/ +[6]: https://remmina.org/ +[7]: https://flatpak.org/ +[8]: https://flathub.org/home +[9]: https://fedoramagazine.org/how-rpm-packages-are-made-the-source-rpm/ +[10]: https://flathub.org/builds/#/ +[11]: https://fedoramagazine.org/wp-content/uploads/2020/09/Screenshot_2020-09-24-Flathub-builds-1024x434.png +[12]: https://docs.flatpak.org/en/latest/building.html +[13]: https://fedoramagazine.org/wp-content/uploads/2020/09/Screenshot-from-2020-09-22-21-49-47.png +[14]: https://github.com/flathub/org.remmina.Remmina +[15]: https://reproducible-builds.org/ From 49528742690609ab09df318a3b546dde2ac5f1cc Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:03:50 +0800 Subject: [PATCH 10/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201027=20Ma?= =?UTF-8?q?p=20Your=20Gamepad=20Buttons=20With=20Keyboard,=20Mouse,=20or?= =?UTF-8?q?=20Macros/Scripts=20Using=20AntiMicroX=20in=20Linux?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201027 Map Your Gamepad Buttons With Keyboard, Mouse, or Macros-Scripts Using AntiMicroX in Linux.md --- ...acros-Scripts Using AntiMicroX in Linux.md | 106 ++++++++++++++++++ 1 file changed, 106 insertions(+) create mode 100644 sources/tech/20201027 Map Your Gamepad Buttons With Keyboard, Mouse, or Macros-Scripts Using AntiMicroX in Linux.md diff --git a/sources/tech/20201027 Map Your Gamepad Buttons With Keyboard, Mouse, or Macros-Scripts Using AntiMicroX in Linux.md b/sources/tech/20201027 Map Your Gamepad Buttons With Keyboard, Mouse, or Macros-Scripts Using AntiMicroX in Linux.md new file mode 100644 index 0000000000..2fef431fa4 --- /dev/null +++ b/sources/tech/20201027 Map Your Gamepad Buttons With Keyboard, Mouse, or Macros-Scripts Using AntiMicroX in Linux.md @@ -0,0 +1,106 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Map Your Gamepad Buttons With Keyboard, Mouse, or Macros/Scripts Using AntiMicroX in Linux) +[#]: via: (https://itsfoss.com/antimicrox/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +Map Your Gamepad Buttons With Keyboard, Mouse, or Macros/Scripts Using AntiMicroX in Linux +====== + +_**Brief: AntiMicroX is a GUI tool to map your gamepad with your keyboard, mouse, or custom macros/scripts in Linux. Let’s take a closer look at it.**_ + +Gaming peripherals on Linux do not have a great reputation, but we do have some interesting open source tools that can make things easier for you. For instance, I’ve previously covered a tool [Piper which lets you configure your gaming mouse][1]. + +This time, let me introduce you to an exciting open source tool that lets you utilize your game pad by mapping it to your keyboard, mouse, scripts, or macros. + +![][2] + +In this article, I’ll mention why you might need it and its key features to help you know more about it. + +### AntiMicroX: An open source tool to map your gamepad + +Of course, this isn’t for everyone but an open source GUI tool for something useful, why not? + +Maybe you have a system that you utilize for media consumption (or as a [media server on Linux][3]). Or, maybe you want to use a desktop application using your gamepad. + +Also, you may want to use it to play a game that does not offer gamepad support. + +For such cases, AntiMicroX is a tool that you would want to explore (even if that’s just for fun). + +### Features of AntiMicroX + +![][4] + + * Map with keyboard buttons + * Controller mapping to make sure the host detects the correct triggers + * Multiple controller profile + * Ability to launch an executable using the gamepad + * Map with mouse buttons + * Gamepad calibration option + * Tweak Gamepad poll rate (if needed) + * Auto profile support + + + +### Installing AntiMicroX on Linux + +![][5] + +AntiMicroX offers a wide range of options to get it installed on a Linux distribution. You will find a DEB package, [Flatpak package][6], and an AppImage file. + +It is easy to [install it using the deb package][7]. In addition to that, you may refer to our [Flatpak guide][8] or [AppImage guide][9] to get started installing AntiMicroX as well. + +You can also build it from source if needed. Nevertheless, you should find all the necessary instructions in its [GitHub page][10] along with the packages in its [releases section][11]. + +[AntiMicroX][12] + +**Recommended Read:** + +![][13] + +#### [How to Configure Gaming Mouse on Linux Using Piper GUI Tool][1] + +Love gaming on Linux? Take your gaming to the next level by configuring your gaming mouse in Linux using Piper GUI application. + +### My Thoughts on Using AntiMicroX on Linux + +Surprisingly, mapping the game pad buttons was easier than you would expect. I was able to map the buttons with my keyboard and assign custom macros/scripts as well. + +Mapping the buttons with the mouse isn’t that simple and may not work well if you already have the mouse buttons assigned for different macros (like in my case). For gaming, it would be nice to calibrate and map the gamepad buttons properly before pairing it up with the keyboard buttons. + +It worked just fine with my generic controller. You can definitely try it out. + +Did you know about this? Have you tried it yet? Now that we’re looking for interesting open-source tools, do you know about anything else similar to this for [gaming on Linux][14]? + +Let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/antimicrox/ + +作者:[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/piper-configure-gaming-mouse-linux/ +[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/antimicrox-mapping.png?resize=800%2C557&ssl=1 +[3]: https://itsfoss.com/best-linux-media-server/ +[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/antimicrox-gamepad.jpg?resize=800%2C631&ssl=1 +[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/antimicrox-calibration.jpg?resize=800%2C637&ssl=1 +[6]: https://itsfoss.com/what-is-flatpak/ +[7]: https://itsfoss.com/install-deb-files-ubuntu/ +[8]: https://itsfoss.com/flatpak-guide/ +[9]: https://itsfoss.com/use-appimage-linux/ +[10]: https://github.com/AntiMicroX/antimicrox +[11]: https://github.com/AntiMicroX/antimicrox/releases +[12]: https://github.com/AntiMicroX/antimicrox/ +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/06/configuring-gaming-mouse-linux.png?fit=800%2C450&ssl=1 +[14]: https://itsfoss.com/linux-gaming-guide/ From 417fd2e748c3df55fe50bb03602356c72515c5cd Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:04:16 +0800 Subject: [PATCH 11/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201027=20KD?= =?UTF-8?q?E=20Neon=20vs=20Kubuntu:=20What=E2=80=99s=20the=20Difference=20?= =?UTF-8?q?Between=20the=20Two=20KDE=20Distribution=3F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201027 KDE Neon vs Kubuntu- What-s the Difference Between the Two KDE Distribution.md --- ...erence Between the Two KDE Distribution.md | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) create mode 100644 sources/tech/20201027 KDE Neon vs Kubuntu- What-s the Difference Between the Two KDE Distribution.md diff --git a/sources/tech/20201027 KDE Neon vs Kubuntu- What-s the Difference Between the Two KDE Distribution.md b/sources/tech/20201027 KDE Neon vs Kubuntu- What-s the Difference Between the Two KDE Distribution.md new file mode 100644 index 0000000000..7c109aa415 --- /dev/null +++ b/sources/tech/20201027 KDE Neon vs Kubuntu- What-s the Difference Between the Two KDE Distribution.md @@ -0,0 +1,125 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (KDE Neon vs Kubuntu: What’s the Difference Between the Two KDE Distribution?) +[#]: via: (https://itsfoss.com/kde-neon-vs-kubuntu/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +KDE Neon vs Kubuntu: What’s the Difference Between the Two KDE Distribution? +====== + +When you find two Linux distributions based on [Ubuntu][1] and powered up by [KDE][2], which one do you choose? + + * [Kubuntu][3] is the official KDE flavor from Ubuntu. + * [KDE Neon][4] is the Ubuntu-based distribution by KDE itself. + + + +I know it is often confusing especially if you have never used either of them but got them as recommendations for usage. Hence, to help you make a decision, I thought of compiling a list of differences (and similarities) between KDE Neon and Kubuntu. + +Let’s start with getting to know the similarities and then proceed with the differences. + +**Note:** _Depending on your system, your experience with the distributions might differ. So, take this article as a reference and not a “what’s better” comparison._ + +### KDE Neon vs Kubuntu: Feature wise comparison + +![][5] + +It’s always good to compare distribution based on their similarities. So, theoretically, I’ve tried to put down the most important differences. + +However, it is worth noting that the compatibility, performance, and the stability of the distros will vary depending on your hardware and hence, that has not been accounted here. + +#### Ubuntu as the Base + +![][6] + +Yes, both the Linux distributions are based on Ubuntu. However, KDE Neon is based only on the latest Ubuntu LTS release while Kubuntu offers an Ubuntu LTS based edition and a non-LTS edition as well. + +So, with KDE Neon, you would expect to get your hands on the latest Ubuntu features right after a few months of the next Ubuntu LTS release (2 years). But, with Kubuntu, you have got the option to opt for a non-LTS release and try on the latest Ubuntu releases with 6 months of software updates. + +KDE Neon does offer testing editions and developer editions but those are meant to test pre-release KDE software. + +#### KDE Plasma Desktop + +![][7] + +Even though both of the distros feature KDE plasma desktop and you can get the same level of customization, KDE Neon gets the latest KDE Plasma desktop release first. + +If you did not know already, KDE Neon is developed by the official KDE team and was announced by Jonathan Riddell (Founder of Kubuntu) after he was [forced out of Kubuntu by Canonical][8]. + +So, not just limited to the latest Plasma desktop, but if you want the latest and greatest of KDE as soon as possible, KDE Neon is the perfect choice for that. + +Kubuntu will eventually get the update for newer KDE software — but it will take time. If you’re not too sure about the latest KDE software/desktop and all you need is a stable KDE-powered system, you should go with Kubuntu LTS releases. + +#### Pre-installed Software + +Out of the box, you will find Kubuntu to have several essential tools and applications pre-installed. But, with KDE Neon, you would need to find and install several applications and tools. + +To give you some perspective, KDE Neon might turn out to be a lightweight distro when compared to Kubuntu. However, for new Linux users, they might find Kubuntu as an easy-to-use experience with more essential software and tools pre-installed. + +**Recommended Read:** + +![][9] + +#### [KDE Neon: KDE’s Very Own Linux Distribution Provides the Latest and Greatest of KDE With the Simplicity of Ubuntu][10] + +#### Software Updates + +If you are not using a metered connection, this may not matter at all. But, just for the sake of it, I should mention that KDE Neon gets more software updates considering the regular Ubuntu LTS fixes/updates along with KDE software updates. + +With Kubuntu, you just get the Ubuntu LTS updates (unless you’re using the non-LTS edition). So, technically, you can expect less number of updates. + +#### Ubuntu with KDE vs Plasma Experience + +![][11] + +I know if you haven’t tried both of them, you might think of them as pretty similar. But, Kubuntu is an official flavour of Ubuntu that focused more on the experience with Ubuntu on a KDE desktop environment. + +While KDE Neon is technically the same thing, but it is all about getting the best-in-class Plasma desktop experience with the latest stuff on board. + +Even though both the distributions work amazing out of the box, they have a different vision and the development proceeds on both them accordingly. You just have to decide what you want for yourself and choose one of them. + +#### Hardware Compatibility + +![Kubuntu Focus Laptop][12] + +As I mentioned earlier, this is not a fact-based point here. But, as per my quick look on the feedback or experiences shared by the users online, it seems that Kubuntu works with a wide range of old hardware along with new hardware (potentially dating back to 2012) while KDE Neon may not. + +It’s just a thing to keep in mind if you try KDE Neon and it doesn’t work for some reason. You know what to do. + +**Wrapping Up** + +So, what would it be? KDE Neon or Kubuntu? That’s really is your choice. + +Both are good choices for a [beginner-friendly Linux distribution][13] but if you want the latest KDE Plasma desktop, KDE Neon gets the edge here. You can read more about it in our [review of KDE Neon][10]. + +Feel free to let me know your thoughts in the comments down below and what do you find good/bad on either of them. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/kde-neon-vs-kubuntu/ + +作者:[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://ubuntu.com/ +[2]: https://kde.org/ +[3]: https://kubuntu.org +[4]: https://neon.kde.org +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-neon-vs-kubuntu.png?resize=800%2C450&ssl=1 +[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/01/install_ubuntu_8.jpg?resize=796%2C611&ssl=1 +[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/kde-plasma-5-20-feat.png?resize=800%2C394&ssl=1 +[8]: https://lwn.net/Articles/645973/ +[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/08/kde-neon-review.jpg?fit=800%2C450&ssl=1 +[10]: https://itsfoss.com/kde-neon-review/ +[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-kde.jpg?resize=800%2C450&ssl=1 +[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/kubuntu-focus-laptop.jpg?resize=800%2C600&ssl=1 +[13]: https://itsfoss.com/best-linux-beginners/ From d44fccb257f72aac1fbc9185aab5835508d7b63d Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:04:41 +0800 Subject: [PATCH 12/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201027=20Yo?= =?UTF-8?q?u=20can=20Surf=20Internet=20in=20Linux=20Terminal=20With=20Thes?= =?UTF-8?q?e=20Command=20Line=20Browsers?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201027 You can Surf Internet in Linux Terminal With These Command Line Browsers.md --- ...rminal With These Command Line Browsers.md | 170 ++++++++++++++++++ 1 file changed, 170 insertions(+) create mode 100644 sources/tech/20201027 You can Surf Internet in Linux Terminal With These Command Line Browsers.md diff --git a/sources/tech/20201027 You can Surf Internet in Linux Terminal With These Command Line Browsers.md b/sources/tech/20201027 You can Surf Internet in Linux Terminal With These Command Line Browsers.md new file mode 100644 index 0000000000..7c00882a6b --- /dev/null +++ b/sources/tech/20201027 You can Surf Internet in Linux Terminal With These Command Line Browsers.md @@ -0,0 +1,170 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (You can Surf Internet in Linux Terminal With These Command Line Browsers) +[#]: via: (https://itsfoss.com/terminal-web-browsers/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +You can Surf Internet in Linux Terminal With These Command Line Browsers +====== + +I’m guessing that you are probably using Firefox or a Chrome-based browser like [Brave][1] to read this article. Or, maybe, Google Chrome or [Chromium][2]. + +In other words, you are utilizing a GUI-based approach to browse the web. However, back in the days, people used the terminal to fetch resources and browse the web because everything was mostly text-based information. + +Even though you cannot get every information from a terminal now, you can still try the command line browsers for some text-based information and open a web page from the Linux terminal. + +Not just limited to that, but if you are accessing a remote server or stuck in a terminal without a GUI, a terminal web browser can prove to be useful as well. + +So, in this article, I will be mentioning some terminal based web browsers that you can try on Linux. + +### Best Terminal-based Web Browsers for Linux Users + +_**Note:** The list is in no particular order of ranking._ + +#### 1\. W3M + +![][3] + +w3m is a popular open-source text-based web browser for the terminal. Even though the original project is no longer active, an active version of it is being maintained by a different developer Tatsuya Kinoshita. + +w3m is quite simple, supports SSL connections, colors, and in-line images as well. Of course, depending on what resource you are trying to access, things might look different on your end. As per my quick test, it didn’t seem to load up [DuckDuckGo][4] but I could [use Google in terminal][5] just fine. + +You can simply type **w3m** in the terminal to get help after installation. If you’re curious, you can also check out the repository at [GitHub][6]. + +##### How to install and use w3m? + +W3M is available on most of the default repositories for any Debian-based Linux distribution. If you have an Arch-based distro, you might want to check [AUR][7] if it’s not available directly. + +For Ubuntu, you can install it by typing in: + +``` +sudo apt install w3m w3m-img +``` + +Here, we are installing the w3m package along with image extension for in-line image support. Next, to get started, you have to simply follow the command below: + +``` +w3m xyz.com +``` + +Of course, you need to replace xyz.com to any website that you want to browse/test. Finally, you should know that you can use the keyboard arrow keys to navigate and press enter when you want to take an action. + +To quit, you can press **SHIFT+Q**, and to go back to the previous page — **SHIFT+B**. Additional shortcuts include **SHIFT + T** to open a new tab and **SHIFT + U** to open a new URL. + +You can explore more about it by heading to its man page as well. + +#### 2\. Lynx + +![][8] + +Lynx is yet another open source command line browser which you can try. Fortunately, more websites tend to work when using Lynx, so I’d say it is definitely better in that aspect. I was able to load up DuckDuckGo and make it work. + +In addition to that, I also noticed that it lets you accept/deny cookies when visiting various web resources. You can set it to always accept or deny as well. So, that’s a good thing. + +On the other hand, the window does not re-size well while using it from the terminal. I haven’t looked for any solutions to that, so if you’re trying this out, you might want to do that. In either case, it works great and you get all the instructions for the keyboard shortcuts right when you launch it in the terminal. + +Note that it does not match the system terminal theme, so it will look different no matter how your terminal looks like. + +##### How to install Lynx? + +Unlike w3m, you do get some Win32 installers if you’re interested to try. But, on Linux, it is available on the most of the default repositories. + +For Ubuntu, you just need to type in: + +``` +sudo apt install lynx +``` + +To get started, you just have to follow the command below: + +``` +lynx examplewebsite.com +``` + +Here, you just need to replace the example website with the resource you want to visit. + +If you want to explore the packages for other Linux distros, you can check out their [official website resources][9]. + +#### 3\. Links2 + +![][10] + +Links2 is an interesting text-based browser that you can easily utilize on your terminal with a good user experience. It gives you a nice interface to type in the URL and then proceed as soon as you launch it. + +![][11] + +It is worth noting that the theme will depend on your terminal settings, I have it set as “black-green”, hence this is what you see. Once you launch it as a command line browser, you just need to press any key to bring the URL prompt or Q to quit it. It works good enough and renders text from most of the sites. + +Unlike Lynx, you do not get the ability to accept/reject cookies. Other than that, it seems to work just fine. + +##### How to install Links2? + +As you’d expect, you will find it available in the most of the default repositories. For Ubuntu, you can install it by typing the following command in the terminal: + +``` +sudo apt install links2 +``` + +You can refer to its [official][12] [][12][website][12] for packages or documentations if you want to install it on any other Linux distribution. + +#### 4\. eLinks + +![][13] + +eLinks is similar to Links2 — but it is no longer maintained. You will still find it in the default repositories of various distributions, hence, I kept it in this list. + +It does not blend in with your system terminal theme. So, this may not be a pretty experience as a text-based browser without a “dark” mode if you needed that. + +##### How to install eLinks? + +On Ubuntu, it is easy to install it. You just have to type in the following in the terminal: + +``` +sudo apt install elinks +``` + +For other Linux distributions, you should find it available on the standard repositories. But, you can refer to the [official installation instructions][14] if you do not find it in the repository. + +### Wrapping Up + +It’s no surprise that there aren’t a lot of text-based web browsers to run on the terminal. Some projects like [Browsh][15] have tried to present a modern Linux command-line browser but it did not work in my case. + +While tools like curl and wget allow you to [download files from the Linux command line][16], these terminal-based web browsers provide additional features. + +In addition to command-line browsers, you may also like to try some [command line games for Linux][17], if you want to play around in the terminal. + +What do you think about the text-based web browsers for Linux terminal? Feel free to let me know your thoughts in the comments below. + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/terminal-web-browsers/ + +作者:[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/brave-web-browser/ +[2]: https://itsfoss.com/install-chromium-ubuntu/ +[3]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/w3m-google.jpg?resize=800%2C463&ssl=1 +[4]: https://duckduckgo.com/ +[5]: https://itsfoss.com/review-googler-linux/ +[6]: https://github.com/tats/w3m +[7]: https://itsfoss.com/aur-arch-linux/ +[8]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/10/lynx-terminal.jpg?resize=800%2C497&ssl=1 +[9]: https://lynx.invisible-island.net/lynx-resources.html +[10]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/links2-terminal.jpg?resize=800%2C472&ssl=1 +[11]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/links2-terminal-welcome.jpg?resize=800%2C541&ssl=1 +[12]: http://links.twibright.com/download.php +[13]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/10/elinks-terminal.jpg?resize=800%2C465&ssl=1 +[14]: http://elinks.or.cz/documentation/installation.html +[15]: https://www.brow.sh/ +[16]: https://itsfoss.com/download-files-from-linux-terminal/ +[17]: https://itsfoss.com/best-command-line-games-linux/ From 9e109be39bcf2f7cfc846aacb6a8da70fcc86d20 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:05:59 +0800 Subject: [PATCH 13/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201026=20Ma?= =?UTF-8?q?nage=20content=20using=20Pulp=20Debian?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201026 Manage content using Pulp Debian.md --- ...201026 Manage content using Pulp Debian.md | 173 ++++++++++++++++++ 1 file changed, 173 insertions(+) create mode 100644 sources/tech/20201026 Manage content using Pulp Debian.md diff --git a/sources/tech/20201026 Manage content using Pulp Debian.md b/sources/tech/20201026 Manage content using Pulp Debian.md new file mode 100644 index 0000000000..3000b0f2f8 --- /dev/null +++ b/sources/tech/20201026 Manage content using Pulp Debian.md @@ -0,0 +1,173 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Manage content using Pulp Debian) +[#]: via: (https://opensource.com/article/20/10/pulp-debian) +[#]: author: (Maximilian Kolb https://opensource.com/users/kolb) + +Manage content using Pulp Debian +====== +Mirror, sync, upload, and publish Debian software packages with the +pulp_deb plugin. +![Gift box opens with colors coming out][1] + +Pulp is an open source repository management tool that helps you fetch, mirror, upload, and publish content within your organization. It can be used to [manage various types of content][2] such as software packages (from RPM packages to Ruby gems), as well as Ansible collections, container images, and even arbitrary files. + +A typical workflow starts with fetching software packages from an existing repository (for example, ) or adding packages manually (for private packages built within your organization). Then Pulp helps you make arbitrary collections of software packages that are consumable by clients. With it, you: + + * Gain control over what content is available for consumers + * Can use version control + * Reduce bandwidth and storage needs by providing a local, deduplicated source + + + +If you're new to Pulp, read Melanie Corr's introductory article on [how to manage your software repositories with Pulp][3]. + +### Manage Debian packages with Pulp + +Pulp relies on plugins to adequately handle different types of content. For example, the [Pulp RPM][4] plugin enables you to manage .rpm packages. With the [Pulp Debian][5] plugin, you can mirror, sync, upload, and publish .deb packages within APT repositories. The pulp_deb plugin is essential if you want to manage and provide consumable software packages for Linux distributions such as Debian and Ubuntu, and it's free and open source software provided and maintained by the Pulp community. + +With the Pulp Debian plugin, you can manage Debian content by synchronizing remote repositories, providing an interface to upload your own content, and publishing content to repositories. + +Pulp supports several different [Debian content types][6], including packages, package indices, Release Files, and more. "Content type" refers to either a specific artifact or metadata. For example, a content unit of type `package` refers to a .deb package. + +Synchronizing a remote repository is one of Pulp Debian plugin's main features, and it's one of the ways to obtain content. The synchronization process uses a [remote][7] definition that contains a URL, [distribution][8], components, and architectures: + + * The **URL** is the path to the remote APT repository. + * The **distribution** is the path between the `dists/` directory of the APT repository and the relevant `Release` file. This is usually (but not always) the codename or suite of the Debian-based Linux distribution (`buster` for Debian 10, `stretch` for Debian 9, `focal` for Ubuntu 20.04, and so on). Running `lsb_release -cs` on any Debian or Ubuntu host shows the distribution's codename. + * **Components** describe arbitrary subsets of repositories (`main`, `contrib`, or `non-free` for Debian, or `main`, `restricted`, `universe`, and `multiverse` for Ubuntu). You can use this to filter and categorize packages within an APT repository. + * The **architecture** refers to the processor architecture a software package can run on, most commonly `i386`, `amd64`, or `arm64`. If a software package does not depend on a specific processor architecture, the architecture may be set to `all`. + + + +Specifying a distribution is mandatory, whereas defining components and architectures is optional. If undefined, Pulp automatically syncs all packages without filtering for components or architectures. Pulp automatically verifies the [GNU Privacy Guard][9] signature of the `Release` File, should the corresponding GPG public key be assigned to the remote. + +### An example workflow + +It's easy to go from a remote repository to a verbatim publication with Pulp's [REST API][10]. The following API calls assume you're using [HTTPie][11]. + +Imagine you want to provide .deb packages to hosts within your organization. The following basic workflow guides your first steps in using Pulp and the Pulp Debian plugin. + +![Pulp Debian workflow][12] + +Image by Maximilian Kolb + +#### 1\. Create a local repository + +Start by creating a local repository in Pulp with a single API call. You can do this with HTTPie or the [curl command][13]: + + +``` +`http post http://:24817/pulp/api/v3/repositories/deb/apt/ name=` +``` + +#### 2\. Create a remote + +Next, create a remote. This API call requires a URL and an arbitrary `name` value. Defining a distribution and architecture is optional: + + +``` +`http post http://:24817/pulp/api/v3/remotes/deb/apt/ name="nginx.org" url="http://nginx.org/packages/debian" distributions="buster"` +``` + +Whether you define only one or multiple distributions, Pulp will later sync packages for all architectures, as they are undefined for this remote. + +#### 3\. Synchronize + +The third and final step to fetch remote content to Pulp is to sync the remote to your local repository. You do this by making a call to the sync API endpoint of your repository: + + +``` +`http post http://:24817/pulp/api/v3/repositories/deb/apt//sync/ remote=http://:24817/pulp/api/v3/remotes/deb/apt//` +``` + +In this sample command, each of the UUIDs refers to Pulp's internal references, displayed as `pulp_href` by the API. This step may take some time, depending on your environment, the size of the repository, and the available bandwidth. + +### Make your Pulp content consumable + +After acquiring content for Pulp through synchronization, it becomes consumable by clients. + +#### 1\. Create a publication + +Publications are always based on a Pulp repository. They contain extra settings on how to publish content. You can use the `APT` publisher on any repository of the APT type containing .deb packages. + +The following API call creates a publication in verbatim mode. That is, it provides the exact same structure and content of the remote repository: + + +``` +`http post http://:24817/pulp/api/v3/publications/deb/verbatim/ repository=/pulp/api/v3/repositories/deb/apt//` +``` + +Replace the UUID with the repository you want to publish. This step may take some time, depending on the size of the repository. + +#### 2\. Create a distribution + +A distribution takes the finished publication and serves it through the Pulp content app, which makes it available (or "consumable") by your users. In the context of a Debian system, this means that the repository can be added to `/etc/apt/sources.list` and used as a way to install software. + +The following API call requires the UUID of the publication created in the first step: + + +``` +`http post http://:24817/pulp/api/v3/distributions/deb/apt/ name="name_of_the_distribution" base_path="base_path_of_the_distribution" publication=http://:24817/pulp/api/v3/publications/deb/verbatim//` +``` + +The `base_path` value is part of the URL used by clients when referring to the APT repository, and the name can be arbitrary. Calling the distribution's API endpoint on a specific published distribution returns the URL of the Pulp repository: + + +``` +`http get http://:24817/pulp/api/v3/distributions/deb/apt//` +``` + +This URL is directly consumable by APT clients. It can now be added to `/etc/apt/sources.list` as a valid repository. + +### Pulp API + +Using these API calls lets you sync an APT repository to your own Pulp instance and republish it verbatim, without touching the packages, any metadata, or signatures. Refer to the [API documentation][6] and [feature overview][14] for further information and other modes of publication. + +### Open source flexibility + +One important aspect of Pulp and its plugin structure is that it's extremely flexible, in no small part due to its open source nature. You can run Pulp as a standalone service, but you don't have to. It can be integrated into something bigger. + +I work at [ATIX][15], where we've started using Pulp and the Pulp Debian plugin in a project called [orcharhino][16]. It's based on [Foreman][17] and includes the powerful [Katello][18] plugin for additional content-management capabilities, which itself relies on Pulp for repository management. With this, we've been able to manage our data center with automated system deployment, configuration management, and patch management. + +In other words, ATIX develops the Pulp Debian plugin primarily with a Katello use case in mind. Whether you need Katello or Pulp or just a specific Pulp plugin, you can rest assured that this modularity is by design. + +Using Pulp, you can mirror remote software repositories, host private software packages, and manage different types of content on one platform. + +Try [Pulp][19] and the [Pulp Debian][5] plugin today, and don't be afraid to join and ask the [community][20] for help. We welcome any and all feedback. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/pulp-debian + +作者:[Maximilian Kolb][a] +选题:[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/kolb +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_gift_giveaway_box_520x292.png?itok=w1YQhNH1 (Gift box opens with colors coming out) +[2]: https://pulpproject.org/content-plugins/#pulp-3-content-plugins-information +[3]: https://opensource.com/article/20/8/manage-repositories-pulp +[4]: https://github.com/pulp/pulp_rpm +[5]: https://github.com/pulp/pulp_deb +[6]: https://pulp-deb.readthedocs.io/en/latest/restapi.html +[7]: https://docs.pulpproject.org/pulpcore/glossary.html#term-Remote +[8]: https://docs.pulpproject.org/pulpcore/glossary.html#term-Distribution +[9]: https://gnupg.org/ +[10]: https://docs.pulpproject.org/pulpcore/restapi.html +[11]: https://httpie.org/ +[12]: https://opensource.com/sites/default/files/pulp-debian-workflow_0.jpg (Pulp Debian workflow) +[13]: https://www.redhat.com/sysadmin/use-curl-api +[14]: https://pulp-deb.readthedocs.io/en/latest/feature_overview.html +[15]: https://atix.de/en/ +[16]: https://orcharhino.com/ +[17]: https://theforeman.org/ +[18]: https://theforeman.org/plugins/katello +[19]: https://pulpproject.org/ +[20]: https://pulpproject.org/get_involved/ From 24695126e13aa4b85873073ed4e094e742073982 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:06:22 +0800 Subject: [PATCH 14/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201023=20Wh?= =?UTF-8?q?y=20it's=20important=20to=20keep=20the=20cloud=20open?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201023 Why it-s important to keep the cloud open.md --- ...y it-s important to keep the cloud open.md | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 sources/tech/20201023 Why it-s important to keep the cloud open.md diff --git a/sources/tech/20201023 Why it-s important to keep the cloud open.md b/sources/tech/20201023 Why it-s important to keep the cloud open.md new file mode 100644 index 0000000000..446eceb61b --- /dev/null +++ b/sources/tech/20201023 Why it-s important to keep the cloud open.md @@ -0,0 +1,87 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Why it's important to keep the cloud open) +[#]: via: (https://opensource.com/article/20/10/keep-cloud-open) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +Why it's important to keep the cloud open +====== +An open cloud helps developers maintain autonomy and security while +taking advantage of the power and reach of the cloud. +![Sky with clouds and grass][1] + +There's a famous sticker featured on many laptop lids; it goes something like this: "the 'cloud' is just somebody else's computer." + +There's a lot of truth to that sentiment, but it's not exactly technically accurate. In fact, cloud computing isn't just somebody else's computer; it's somebody else's _hundreds and thousands_ of computers. + +Years ago, "the cloud" did indeed just refer to the simplified graphic in a flowchart, so the illustrator didn't have to try to accurately depict the multiple networks that comprise the World Wide Web. Now, however, the cloud isn't just describing traffic or small-time remote file storage offers. The cloud of today is a _platform_ of interconnected computational nodes working together to keep containerized Linux images, each running a distinct service (or "microservice" in developer lingo), functioning as applications distributed over the whole world. + +The cloud is a computer, no different in theory than the device you're reading this article on, but very different in construction. For instance, you don't own the cloud. You might wonder how such a concept can possibly be compatible with the idea of open source and free software, methods of computing in which the user famously owns the software they run. Surely you can't own software when you don't even own the device it's installed on? + +### Open source and the cloud + +For several years now, the Internet has been something of a software neutral zone. The model of the Internet isn't the same as "traditional" software in which there's a one-to-one, or maybe a one-per-family, relationship between the app and the user. The Internet is built of servers, which run services intended for multiple users. You sign up for an account on a site, and, in the best-case scenario, you more or less "own" your user account and data, but you don't own the site. You can't stop your Internet service and bring up the website on your computer. The software "lives" on a server somewhere. Even when the software is open source, such as WordPress or Drupal, and even if you download it and install it locally on your own computer, you still don't possess the instance you created an account on. + +For this reason, even users very conscious of the threat of non-open software tend to overlook the question of software on the Internet. It can be increasingly difficult to recognize the importance of open source when even popular open source projects are hosted on Github (which uses a non-open web stack), Slack, or Discord instead of [Mattermost][2] or [Matrix][3] for chat; Google Docs instead of [Etherpad][4] for collaboration; Trello instead of [Phabricator][5] for [project management][6]; Jira for bug tracking; Gmail for communication, and so on. For as much as open source has won within software development and server hosting, it seems to willingly lock itself inside proprietary infrastructure. + +### Why the cloud is so powerful + +The problem doesn't end with infrastructure. The reason open source projects are locking themselves into proprietary systems for support is that the cloud itself is the computer, and the computer powered by the cloud is a lot more powerful than any developer's workstation. Not only does it have more processing power, but it also has a greater reach. An application you develop to run on the cloud can serve millions of users without even one of them having to figure out how to download and install anything. Your users just launch a browser and use your app, on any device, without even worrying about whether their device is powerful enough for the task they need to be done. + +The cloud just makes sense, for computation, for delivery, and even for marketing. The problem is, it doesn't make any sense for open source. And that's why the cloud is no longer enough. The cloud needs to be upgraded to an open hybrid cloud. + +### What is an open hybrid cloud? + +When people talked about "the cloud" many years ago, it referred to the network serving as the computer. It was even then an old idea, but it was only just being realized. But because the network was the computer, the natural and correct assumption was that most users wouldn't own the computer; they'd only log in with client machines. And that's exactly the form it has taken—you own a device that browses to a cloud owned by Google, Microsoft, or Amazon. + +This came to be known as the public cloud because the infrastructure running the cloud is available to the general public. You can buy time on several public clouds, interact with it through Kubernetes, and develop apps for Linux containers. + +It didn't take long for individual companies to build private clouds—an infrastructure available only to their employees and clients. This ensured that important data remained under their control, and it often cost less than buying time on someone else's infrastructure. + +A hybrid cloud combines these two concepts—you maintain a private cloud for your own use, and you use a public cloud to provide services you can't run only privately. An open hybrid cloud is a hybrid cloud built on open source, whether it's OKD, OpenShift, Kubernetes, RHEL, Debian, Alpine, Podman, Docker, Ansible, or custom scripts. + +### Getting an open hybrid cloud + +The cloud is powerful, so it stands to reason that it can actually help solve a little problem like ensuring user independence. It doesn't happen overnight, though, and the proprietary cloud is already entrenched in services used by millions. So, as an open source enthusiast, what can you do to promote the open hybrid cloud? + +### Don't settle for closed clouds + +If you're a developer, seek out an open hybrid cloud when you're looking for a platform to build upon. If you can't find one within your price range and you can't build a small one, then support open stacks. Look at the services your project relies upon and make sure you can reimplement the stack, should you need to. + +### Use open source online + +As a user, look for [federated systems][7] for social media, and look for open source platforms like WordPress, Drupal, Nextcloud, Etherpad, EtherCalc, and others, for online collaboration. You're not running the instance you're using, but at least you know that the code is auditable and that you're not supporting an environment that forces developers to contribute to proprietary software. + +### Data liberation + +Whether or not the environment is open source, ensure that important data is secure and can be exported. We're well into the 21st century, so there's no excuse for a website to gather data about without proper encryption and no excuse to withhold your data from you. You should be able to export anything you put _into_ a site for your own backups. + +### Be open + +In an open hybrid cloud, you own your development environment and your data, and you maintain your autonomy the same way you do with a laptop running [Linux][8] or [BSD][9]. Cloud computing is the future. Let's work together to make sure the future is open. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/keep-cloud-open + +作者:[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/bus-cloud.png?itok=vz0PIDDS (Sky with clouds and grass) +[2]: http://mattermost.com +[3]: http://matrix.org +[4]: http://etherpad.org +[5]: https://www.phacility.com/phabricator/ +[6]: https://opensource.com/alternatives/trello +[7]: https://opensource.com/article/17/4/guide-to-mastodon +[8]: https://opensource.com/resources/linux +[9]: https://opensource.com/article/20/5/furybsd-linux From 0f3ec29cc137c23f0387bf76f15004181bca236e Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:06:33 +0800 Subject: [PATCH 15/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201023=20Ne?= =?UTF-8?q?w=20open=20source=20project=20crowdsources=20internet=20securit?= =?UTF-8?q?y?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201023 New open source project crowdsources internet security.md --- ... project crowdsources internet security.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20201023 New open source project crowdsources internet security.md diff --git a/sources/tech/20201023 New open source project crowdsources internet security.md b/sources/tech/20201023 New open source project crowdsources internet security.md new file mode 100644 index 0000000000..ae1fad82ff --- /dev/null +++ b/sources/tech/20201023 New open source project crowdsources internet security.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (New open source project crowdsources internet security) +[#]: via: (https://opensource.com/article/20/10/crowdsec) +[#]: author: (Philippe Humeau https://opensource.com/users/philippe-humeau) + +New open source project crowdsources internet security +====== +CrowdSec aims to leverage the power of the crowd to create a very +accurate IP reputation database +![Lots of people in a crowd.][1] + +[CrowdSec][2] is a new security project designed to protect servers, services, containers, or virtual machines exposed on the internet with a server-side agent. It was inspired by [Fail2Ban][3] and aims to be a modernized, collaborative version of that intrusion-prevention framework. + +CrowdSec is free and open source (under an MIT License), with the source code available on [GitHub][4]. It is currently is available for Linux, with ports to macOS and Windows on the roadmap. + +### How CrowdSec works + +CrowdSec is written in Golang and was designed to run on modern, complex architectures such as clouds, lambdas, and containers. To achieve this, it's "decoupled," meaning you can "detect here" (e.g., in your database logs) and "remedy there" (e.g., in your firewall or rproxy). + +The tool uses [leaky buckets][5] internally to allow for tight event control. Scenarios are written in YAML to make them as simple and readable as possible without sacrificing granularity. The inference engine lets you get insights from chain buckets or meta-buckets, meaning if several buckets (e.g., web scan, port scan, and login attempt failed) overflow into a "meta-bucket," you can trigger a "targeted attack" remediation. + +Aggressive Internet Protocols (IPs) are dealt with using bouncers. The [CrowdSec Hub][6] offers ready-to-use data connectors, bouncers (e.g., Nginx, PHP, Cloudflare, Netfilter), and scenarios to deter various attack classes. Bouncers can remedy threats in various ways. + +It works on bouncers such as Captcha, limiting applicative rights, multi-factor authentication, throttling queries, or activating Cloudflare attack mode just when needed. You can get a sense of what's happening locally (and where it's occurring) with a lightweight visualization interface and strong [Prometheus][7] observability. + +![CrowdSec's operation][8] + +(CrowdSec, [CC BY-SA 4.0][9]) + +### Crowdsourcing security + +While the software currently looks like a spruced up Fail2Ban, the goal is to leverage the power of the crowd to create a very accurate IP reputation database. When CrowdSec bounces a specific IP, the triggered scenario and the timestamp are sent to our API to be checked and integrated into the global consensus of bad IPs. + +While we are already redistributing a blocklist to our community (you can see it by entering `cscli ban list --api` on the command line), we plan to really improve this part as soon as we have dealt with other prerequisite code lines. The network already has sightings of 100,000+ IPs (refreshed daily) and is able to redistribute ~10% (10,000) of those to our community members. The project has also been designed to be [GDPR][10] compliant and privacy respectful, both in technical and legal terms. + +Our vision is that once the CrowdSec community is large enough, we will all generate, in real time, the most accurate IP reputation database available. This global reputation engine, coupled with local behavior assessment and remediation, should allow many businesses to achieve tighter security at a very low cost. + +### Case studies + +Here are two examples of what CrowdSec does. + +> A company protecting its customers from DDoS attacks set up a DDoS mitigation strategy relying on Fail2Ban. When one of its customers was attacked by a 7,000-machine botnet, CrowdSec was able to ingest all the logs and successfully banned more than 95% of the botnet, efficiently mitigating the attack, in less than five minutes. For the sake of comparison, Fail2Ban would have needed to process several thousand logs per minute, which is quite challenging and would have taken nearly 50 minutes to deal with this attack. + +> An e-commerce business was going through a massive credit card stuffing attack. The attacker was spamming the payment gateway, testing thousands of different credit card details using a sole IP address. Instead of having to amend all of its apps to try to detect the attack, by installing CrowdSec, the company could scan all the logs and block the intrusion within minutes. + +### Business model + +A common stress in open source projects is setting up a viable monetization model. So, in full transparency, we'll offer premium subscriptions to businesses that want to leverage the IP reputation database without contributing to it or sharing their banned IP data. This will allow anyone to query the IP reputation database upon receiving the first packet from an unknown IP before accepting it. + +### Getting started and getting involved + +CrowdSec's setup is quick and easy (taking just five minutes, tops). It's heavily assisted by a wizard to allow as many people and organizations as possible to use it. The project is production-grade and already runs in many places, including hosting companies, although it's still in beta. + +Currently, our community members come from 28 countries across five different continents. We are looking for more users, contributors, and ambassadors to take the project to the next level. + +![User map][11] + +We would love to hear your feedback and engage in further discussions, so please don't hesitate to comment, reach out through our [website][2], [GitHub][4], or [Discourse][12], or give us a shout on [Gitter][13]. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/crowdsec + +作者:[Philippe Humeau][a] +选题:[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/philippe-humeau +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/BUSINESS_community_1.png?itok=rT7EdN2m (Lots of people in a crowd.) +[2]: https://crowdsec.net/ +[3]: https://www.fail2ban.org/ +[4]: https://github.com/CrowdSecurity/crowdsec +[5]: https://en.wikipedia.org/wiki/Leaky_bucket +[6]: https://hub.crowdsec.net/ +[7]: https://opensource.com/article/19/11/introduction-monitoring-prometheus +[8]: https://opensource.com/sites/default/files/uploads/crowdsec_operation.jpg (CrowdSec's operation) +[9]: https://creativecommons.org/licenses/by-sa/4.0/ +[10]: https://en.wikipedia.org/wiki/General_Data_Protection_Regulation +[11]: https://opensource.com/sites/default/files/cs_user_map.png (User map) +[12]: https://discourse.crowdsec.net/ +[13]: https://gitter.im/crowdsec-project/community From d667fda5ce9ea17e02a4e3decd19a41824bb134a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:06:45 +0800 Subject: [PATCH 16/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201022=20Ho?= =?UTF-8?q?w=20to=20influence=20people=20to=20join=20open=20source?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201022 How to influence people to join open source.md --- ...to influence people to join open source.md | 89 +++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100644 sources/tech/20201022 How to influence people to join open source.md diff --git a/sources/tech/20201022 How to influence people to join open source.md b/sources/tech/20201022 How to influence people to join open source.md new file mode 100644 index 0000000000..4aa7eb6031 --- /dev/null +++ b/sources/tech/20201022 How to influence people to join open source.md @@ -0,0 +1,89 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How to influence people to join open source) +[#]: via: (https://opensource.com/article/20/10/influence-open-source) +[#]: author: (Joshua Pearce https://opensource.com/users/jmpearce) + +How to influence people to join open source +====== +Giving people what they want is the most effective way to introduce +people to open source. +![pipe in a building][1] + +If you are reading Opensource.com, you might be able to code, and you are probably reading this on an open source browser on some elusive [Linux distro][2]. You probably have not seen a browser ad in years because you are running an [open source ad blocker][3]. You feel warm and fuzzy when you think about penguins. + +Simply, you know the power of the force of open source and have made it part of your life. Sadly, not everyone has found the open source way yet. Their computers are painfully slow; they see more ads than content when they surf the web; they spend their money on patented and copyrighted junk. Some of these people may even be related to you—take your nieces and nephews, for example. + +### Knowledge is wealth + +So, how do you introduce your nieces and nephews (and everyone else) to open source? + +I tried to answer this question and being a professor, a profession well known for being long-winded, I ended up with a book: [_Create, Share, and Save Money Using Open Source Projects_][4], published by McGraw-Hill + +The trick, I think, is finding something that your niece or nephew wants but doesn't have the money to buy, then showing them how open source knowledge can get them what they want. + +![Lift Standing Desk][5] + +[Lift Standing Desk][6] (Joni Steiner and Nick Ierodiaconou, [CC-BY-SA-NC][7]) + +Knowledge has a unique property among commodities. Unlike gold or wheat, it not only retains value when it is shared, but it can rapidly increase in value. The internet enables unlimited scaling of this process, as the price of information-sharing approaches zero. Everyone with internet access has historically unprecedented access to this wealth. For example, I provide [free links to repositories][4] with books, education, movies, how-tos, maps, music, photographs, art, software, and recipes. + +### Don't buy it, make it + +Free and open source is expanding further into the physical world, and we all have the opportunity to radically reduce the cost of just about everything you can buy at Walmart or Amazon, including [toys][8], [electronics][9], [household goods][10], and clothing. The combination of open source sharing and digital manufacturing—using 3D printers and similar tools—enables individuals to make their own complex, valuable products. + +![3D printed household items][11] + +[3D-printed household items][12] (Joshua M. Pearce, [CC BY-SA 3.0][13]) + +For years, scientists have been doing this [in their labs][14]. But now, anyone can easily customize products to fit their exact needs. There are already millions of free designs available. + +![Recyclebot][15] + +[Recyclebot][16] (Joshua M. Pearce, [GPLv3][17]) + +The way to really knock the bottom out of a product's price is to [source the raw materials from trash][18]. This is possible for a dizzying array of products because of recent improvements in small-scale recycling processes (like [Recyclebots][19], which I use in my lab) that enable people to make valuable products from waste. Best of all, anyone can get these green, custom creations for a small fraction of the cost of a proprietary system. We can normally produce a custom product for [less than the sales tax][20] on a conventional product—with the same functionality, a better, customized form, and almost no cost. + +### Learn more + +In _[Create, Share, and Save Money Using Open Source Projects][4],_ I share the potential in at-home manufacturing and recycling and even how to score free big-ticket items, including housing and electricity, with open source. You can also learn more about this on a webinar I recorded with Megan Krieger and Janet Callahan for Michigan Tech's [Husky Bites][21]. + +Hopefully, this knowledge is motivating enough to pull in a niece or nephew or two over to the open source way! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/influence-open-source + +作者:[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/open_pipe_red_hat_tower_building.png?itok=8ho3yi7L (pipe in a building) +[2]: https://distrowatch.com/ +[3]: https://opensource.com/article/20/4/ad-blockers +[4]: https://www.appropedia.org/Create,_Share,_and_Save_Money_Using_Open-Source_Projects +[5]: https://opensource.com/sites/default/files/uploads/opendesk_furniture_lift-standing-desk.jpg (Lift Standing Desk) +[6]: https://www.appropedia.org/File:Opendesk_furniture_lift-standing-desk.jpg +[7]: https://creativecommons.org/licenses/by-nc-sa/2.0/ +[8]: http://www.mdpi.com/2227-7080/5/3/45 +[9]: https://doi.org/10.3390/inventions3030064 +[10]: https://www.mdpi.com/2227-7080/5/1/7 +[11]: https://opensource.com/sites/default/files/uploads/3dprinted_household.jpg (3D printed household items) +[12]: https://www.appropedia.org/File:3dprinted_household.JPG +[13]: https://creativecommons.org/licenses/by-sa/3.0/ +[14]: https://opensource.com/article/20/10/open-source-hardware-savings +[15]: https://opensource.com/sites/default/files/uploads/recyclebotrep.png (Recyclebot) +[16]: https://www.appropedia.org/File:Recyclebotrep.png +[17]: https://www.gnu.org/licenses/gpl-3.0.html +[18]: https://www.academia.edu/34738483/Tightening_the_Loop_on_the_Circular_Economy_Coupled_Distributed_Recycling_and_Manufacturing_with_Recyclebot_and_RepRap_3-D_Printing +[19]: https://www.appropedia.org/Recyclebot +[20]: https://opensource.com/article/17/3/how-to-create-consumer-goods-open-hardware +[21]: https://www.facebook.com/Michigan-Tech-College-of-Engineering-109353424030003/videos/husky-bites-presents-special-guest-joshua-m-pearce/2669023713361207/ From 7ef382378fbbe7deb00607bf211ad81b396f1dd4 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:06:58 +0800 Subject: [PATCH 17/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201022=205?= =?UTF-8?q?=20steps=20to=20learn=20any=20programming=20language?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201022 5 steps to learn any programming language.md --- ...steps to learn any programming language.md | 199 ++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 sources/tech/20201022 5 steps to learn any programming language.md diff --git a/sources/tech/20201022 5 steps to learn any programming language.md b/sources/tech/20201022 5 steps to learn any programming language.md new file mode 100644 index 0000000000..d0df23d4c0 --- /dev/null +++ b/sources/tech/20201022 5 steps to learn any programming language.md @@ -0,0 +1,199 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 steps to learn any programming language) +[#]: via: (https://opensource.com/article/20/10/learn-any-programming-language) +[#]: author: (Seth Kenlon https://opensource.com/users/seth) + +5 steps to learn any programming language +====== +With just a little programming experience, you can learn a new language +in just a few days (sometimes less). +![Learning to program][1] + +Some people love learning new programming languages. Other people can't imagine having to learn even one. In this article, I'm going to show you how to think like a coder so that you can confidently learn any programming language you want. + +The truth is, once you've learned how to program, the language you use becomes less of a hurdle and more of a formality. In fact, that's just one of the many reasons educators say to [teach kids to code early][2]. Regardless of how simple their introductory language may be, the logic remains the same across everything else children (or adult learners) are likely to encounter later. + +With just a little programming experience, which you can gain from any one of several introductory articles here on Opensource.com, you can go on to learn _any_ programming language in just a few days (sometimes less). Now, this isn't magic, and you do have to put some effort into it. And admittedly, it takes a lot longer than just a few days to learn every library available to a language or to learn the nuances of packaging your code for delivery. But getting started is easier than you might think, and the rest comes naturally with practice. + +When experienced programmers sit down to learn a new language, they're looking for five things. Once you know those five things, you're ready to start coding. + +### 1\. Syntax + +![Syntax][3] + +(Seth Kenlon, [CC BY-SA 4.0][4]) + +The syntax of a language describes the structure of code. This encompasses both how the code is written on a line-by-line basis as well as the actual words used to construct code statements. + +[Python][5], for instance, is known for using indentation to indicate where one block ends and another one starts: + + +``` +while j < rows: +    while k < columns: +        tile = Tile(k * w) +        board.add(tile) +        k += 1 +    j += 1 +    k = 0 +``` + +[Lua][6] just uses the keyword `end`: + + +``` +for i,obj in ipairs(hit) do +  if obj.moving == 1 then +     obj.x,obj.y = v.mouse.getPosition() +  end +end +``` + +[Java][7], [C][8], C++, and similar languages use braces: + + +``` +while (std::getline(e,r)) { +  wc++; +  } +``` + +A language's syntax also involves things like including libraries, setting variables, and terminating lines. With practice, you'll learn to recognize syntactical requirements (and conventions) almost subliminally as you read sample code. + +#### Take action + +When learning a new programming language, strive to understand its syntax. You don't have to memorize it, just know where to look, should you forget. It also helps to use a good [IDE][9], because many of them alert you of syntax errors as they occur. + +### 2\. Built-ins and conditionals + +![built-in words][10] + +(Seth Kenlon, [CC BY-SA 4.0][4]) + +A programming language, just like a natural language, has a finite number of words it recognizes as valid. This vocabulary can be expanded with additional libraries, but the core language knows a specific set of keywords. Most languages don't have as many keywords as you probably think. Even in a very low-level language like C, there are only 32 words, such as `for`, `do`, `while`, `int`, `float`, `char`, `break`, and so on. + +Knowing these keywords gives you the ability to write basic expressions, the building blocks of a program. Many of the built-in words help you construct conditional statements, which influence the flow of your program. For instance, if you want to write a program that lets you click and drag an icon, then your code must detect when the user's mouse cursor is positioned over an icon. The code that causes the mouse to grab the icon must execute only _if_ the mouse cursor is within the same coordinates as the icon's outer edges. That's a classic if/then statement, but different languages can express that differently. + +Python uses a combination of `if`, `elif`, and `else` but doesn't explicitly close the statement: + + +``` +if var == 1: +    # action +elif var == 2: +    # some action +else: +    # some other action +``` + +[Bash][11] uses `if`, `elif`, `else`, and uses `fi` to end the statement: + + +``` +if [ "$var" = "foo" ]; then +   # action +elif [ "$var" = "bar" ]; then +   # some action +else +   # some other action +fi +``` + +C and Java, however, use `if`, `else`, and `else if`, enclosed by braces: + + +``` +if (boolean) { +   // action +} else if (boolean) { +   // some action +} else { +   // some other action +} +``` + +While there are small variations in word choice and syntax, the basics are always the same. Learn the ways to define conditions in the programming language you're learning, including `if/then`, `do...while`, and `case` statements. + +#### Take action + +Get familiar with the core set of keywords a programming language understands. In practice, your code will contain more than just a language's core words, because there are almost certainly libraries containing lots of simple functions to help you do things like print output to the screen or display a window. The logic that drives those libraries, however, starts with a language's built-in keywords. + +### 3\. Data types + +![Data types][12] + +(Seth Kenlon, [CC BY-SA 4.0][4]) + +Code deals with data, so you must learn how a programming language recognizes different kinds of data. All languages understand integers and most understand decimals and individual characters (a, b, c, and so on). These are often denoted as `int`, `float` and `double`, and `char`, but of course, the language's built-in vocabulary informs you of how to refer to these entities. + +Sometimes a language has extra data types built into it, and other times complex data types are enabled with libraries. For instance, Python recognizes a string of characters with the keyword `str`, but C code must include the `string.h` header file for string features. + +#### Take action + +Libraries can unlock all manner of data types for your code, but learning the basic ones included with a language is a sensible starting point. + +### 4\. Operators and parsers + +![Operators][13] + +(Seth Kenlon, [CC BY-SA 4.0][4]) + +Once you understand the types of data a programming language deals in, you can learn how to analyze that data. Luckily, the discipline of mathematics is pretty stable, so math operators are often the same (or at least very similar) across many languages. For instance, adding two integers is usually done with a `+` symbol, and testing whether one integer is greater than another is usually done with the `>` symbol. Testing for equality is usually done with `==` (yes, that's two equal symbols, because a single equal symbol is usually reserved to _set_ a value). + +There are notable exceptions to the obvious in languages like Lisp and Bash, but as with everything else, it's just a matter of mental transliteration. Once you know _how_ the expression is different, it's trivial for you to adapt. A quick review of a language's math operators is usually enough to get a feel for how math is done. + +You also need to know how to compare and operate on non-numerical data, such as characters and strings. These are often done with a language's core libraries. For instance, Python features the `split()` method, while C requires `string.h` to provide the `strtok()` function. + +#### Take action + +Learn the basic functions and keywords for manipulating basic data types, and look for core libraries that help you accomplish complex actions. + +### 5\. Functions + +![Class][14] + +(Seth Kenlon, [CC BY-SA 4.0][4]) + +Code usually isn't just a to-do list for a computer. Typically when you write code, you're looking to present a computer with a set of theoretical conditions and a set of instructions for actions that must be taken when each condition is met. While flow control with conditional statements and math and logic operators can do a lot, code is a lot more efficient once functions and classes are introduced because they let you define subroutines. For instance, should an application require a confirmation dialogue box very frequently, it's a lot easier to write that box _once_ as an instance of a class rather than re-writing it each time you need it to appear throughout your code. + +You need to learn how classes and functions are defined in the programming language you're learning. More precisely, first, you need to learn whether classes and functions are available in the programming language. Most modern languages do support functions, but classes are specialized constructs common to object-oriented languages. + +#### Take action + +Learn the constructs available in a language that help you write and use code efficiently. + +### You can learn anything + +Learning a programming language is, in itself, a sort of subroutine of the coding process. Once you understand the theory behind how code works, the language you use is just a medium for delivering logic. The process of learning a new language is almost always the same: learn syntax through simple exercises, learn vocabulary so you can build up to performing complex actions, and then practice, practice, practice. + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/learn-any-programming-language + +作者:[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/learn-programming-code-keyboard.png?itok=xaLyptT4 (Learning to program) +[2]: https://opensource.com/article/20/9/scratch +[3]: https://opensource.com/sites/default/files/uploads/syntax_0.png (Syntax) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/downloads/cheat-sheet-python-37-beginners +[6]: https://opensource.com/article/20/2/lua-cheat-sheet +[7]: https://opensource.com/downloads/java-cheat-sheet +[8]: https://opensource.com/downloads/c-programming-cheat-sheet +[9]: https://opensource.com/resources/what-ide +[10]: https://opensource.com/sites/default/files/uploads/builtin.png (built-in words) +[11]: https://opensource.com/downloads/bash-cheat-sheet +[12]: https://opensource.com/sites/default/files/uploads/type.png (Data types) +[13]: https://opensource.com/sites/default/files/uploads/operator.png (Operators) +[14]: https://opensource.com/sites/default/files/uploads/class.png (Class) From 36e0349d465a66d9eb28639a07d7bd4b0a39eda6 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:07:09 +0800 Subject: [PATCH 18/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201021=205?= =?UTF-8?q?=20open=20source=20tools=20I=20can't=20live=20without?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201021 5 open source tools I can-t live without.md --- ... open source tools I can-t live without.md | 104 ++++++++++++++++++ 1 file changed, 104 insertions(+) create mode 100644 sources/tech/20201021 5 open source tools I can-t live without.md diff --git a/sources/tech/20201021 5 open source tools I can-t live without.md b/sources/tech/20201021 5 open source tools I can-t live without.md new file mode 100644 index 0000000000..2d5220c471 --- /dev/null +++ b/sources/tech/20201021 5 open source tools I can-t live without.md @@ -0,0 +1,104 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (5 open source tools I can't live without) +[#]: via: (https://opensource.com/article/20/10/open-source-tools) +[#]: author: (Victoria Martinez de la Cruz https://opensource.com/users/vkmc) + +5 open source tools I can't live without +====== +Increase your productivity inside and outside the terminal by keeping +these tools in your own bag of tricks. +![woman on laptop sitting at the window][1] + +Some time ago, I engaged with a Twitter thread that went viral among techies. The challenge? Pick only five tools that you cannot live without. I started to think about this in relation to my everyday life, and picking just five tools was not easy. I use many tools that I consider essential, such as my [IRC][2] client to connect with my colleagues and friends (yes, I still use IRC), a good text editor to hack on things, a calendar app to keep organized, and a videoconferencing platform when more direct interaction is needed. + +So let me put a twist on this challenge: Pick just five open source tools that boost your productivity. Here's my list; please share yours in the comments. + +### tmate + +![tmate screenshot][3] + +(Victoria Marinez de la Cruz, [CC BY-SA 4.0][4]) + +Oh, I love this tool. tmate is a fork of the well-known [tmux][5] terminal multiplexer that allows you to start a tmux session and share it over SSH. You can use it for [pair programming][6] (which is my primary use case) or for remote control. + +If you collaborate often with your team members, and you want an easy, distro-agnostic, open source way to program with them (and sharing terminal access is enough for you), this is definitely a must-add to your list. + +Get more info on [tmate's website][7], or check out the code on [GitHub][8]. + +### ix + +ix is a command-line pastebin. You don't need to install anything; you can create new pastes just by `curl`ing to the [ix.io][9] site. For example, `echo Hello world. | curl -F 'f:1=<-' ix.io` will give you a link to ix.io where the message "Hello world" is pasted. This is very convenient when you want to share logs for debugging purposes or to save config files in servers where you don't have a desktop environment. + +One downside is that the source code is not yet published, even though it is intended to be free and open source. If you are the author and are reading this post, please post the code so that we can contribute to the polishing process. + +### asciinema + +Yes, this is another terminal tool. asciinema allows you to record your terminal. There are many ways to use it, but I generally use it to make demos for presentations. It's very easy to use, and there are packages available for many Linux distributions and other platforms. + +To see how it works, check out this [cool demo][10]. Isn't it great? + +Get more information on [asciinema's website][11] and access its source code on [GitHub][12]. + +### GNOME Pomodoro + +![pomodoro timer gnome][13] + +(Victoria Martinez de la Cruz, [CC BY-SA 4.0][4]) + +OK, that's enough with the terminal tools. Now I want to share this simple gem for getting and staying organized. Have you heard about the [Pomodoro Technique][14]? Pomodoro is basically a time-management tool. It uses a tomato-shaped timer that helps you split your time into work chunks and breaks (by default, 25 minutes of work followed by five-minute breaks). And, after every four pomodoros, you take a longer break (15 minutes by default). The idea is that you stay focused during the work time, and you stretch and relax on the breaks. + +This sounds very, very simple, and you might be hesitant to allow a tomato-shaped clock to control your life, but it definitely helped me get better organized and avoid exhaustion when trying to focus on many things at the same time. + +Whatever your role, I highly recommend this practice. And among the many different tools that implement it, I recommend the GNOME Pomodoro app. It's available for major GNU/Linux distros, so it requires that you use the GNOME desktop environment (this might be its downside). + +Check out more information on [GNOME Pomodoro's website][15], and access its [GitHub][16] repo to get the source code and learn how you can contribute. + +### Jitsi + +Last but not least is Jitsi. When you're working on a remote, globally distributed team, you need a way to connect with people. Instant messaging is good, but sometimes it's better to have a quick meeting to discuss things face to face (well, seeing each other faces). There are a lot of [videoconferencing tools][17] available, but I like Jitsi a lot. Not only because it's free and open source, but also because it provides a clean, functional interface. You can set up your own Jitsi server (for business purposes), but you can also try out a public Jitsi instance by going to the [Jitsi Meet][18] website. + +A good practice for setting up this kind of meeting: use it only when you have a clear agenda in mind. And always ask yourself, can this meeting be an email instead? Follow these guidelines and use Jitsi with caution, and your workday will be extremely productive! + +Learn more on [Jitsi's website][19] and start contributing by accessing its [GitHub][20] repository. + +* * * + +I hope my list helps you reach the next level in productivity. What are your five, can't-do-without-them, open source productivity tools? Let me know in the comments! + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/open-source-tools + +作者:[Victoria Martinez de la Cruz][a] +选题:[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/vkmc +[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://en.wikipedia.org/wiki/Internet_Relay_Chat +[3]: https://opensource.com/sites/default/files/pictures/tmate-opensource.jpg (tmate screenshot) +[4]: https://creativecommons.org/licenses/by-sa/4.0/ +[5]: https://opensource.com/article/20/7/tmux-cheat-sheet +[6]: https://en.wikipedia.org/wiki/Pair_programming +[7]: https://tmate.io/ +[8]: https://github.com/tmate-io/tmate +[9]: http://ix.io/ +[10]: https://asciinema.org/a/239367 +[11]: https://asciinema.org/ +[12]: https://github.com/asciinema/asciinema +[13]: https://opensource.com/sites/default/files/pictures/pomodoro_timer_gnome.jpg (pomodoro timer gnome) +[14]: https://en.wikipedia.org/wiki/Pomodoro_Technique +[15]: https://gnomepomodoro.org/ +[16]: https://github.com/codito/gnome-pomodoro +[17]: https://opensource.com/article/20/5/open-source-video-conferencing +[18]: https://meet.jit.si/ +[19]: https://jitsi.org/ +[20]: https://github.com/jitsi From ad412db9755aad9e6db67d98b5a8f50a0946c5da Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:07:21 +0800 Subject: [PATCH 19/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201021=20Ho?= =?UTF-8?q?w=20anyone=20can=20contribute=20to=20open=20source=20software?= =?UTF-8?q?=20in=20their=20job?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201021 How anyone can contribute to open source software in their job.md --- ...te to open source software in their job.md | 77 +++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 sources/tech/20201021 How anyone can contribute to open source software in their job.md diff --git a/sources/tech/20201021 How anyone can contribute to open source software in their job.md b/sources/tech/20201021 How anyone can contribute to open source software in their job.md new file mode 100644 index 0000000000..3ae4fbf8ca --- /dev/null +++ b/sources/tech/20201021 How anyone can contribute to open source software in their job.md @@ -0,0 +1,77 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (How anyone can contribute to open source software in their job) +[#]: via: (https://opensource.com/article/20/10/open-your-job) +[#]: author: (Catherine Robson https://opensource.com/users/crobson) + +How anyone can contribute to open source software in their job +====== +Open your job, and you'll open opportunities for software developers to +build applications that meet your needs. +![Active listening in a meeting is a skill][1] + +Imagine a world where your software works perfectly for you. It meets your needs, does things your way, and is the ideal tool to achieve great things toward your goals. + +Open source software stems from these roots. Many projects are built by engineers that have a problem and build a solution to solve it. Then they openly share their solution with others to use and improve. + +Unfortunately, building software is hard. Not everyone has the expertise to build software that works perfectly for their needs. And if the software developers building applications don't fully understand users' needs and how they do their job, the solutions they build may not meet the users' needs and may accidentally create a lot of gaps. + +I recently encountered an example of this at my dentist's office. As I was waiting in the chair, I couldn't help but notice how long the dental hygienist was taking to punch around in the software to get ready for the dentist's examination. So I asked her, "Do you feel like this software meets your needs?" She replied, "No! It's so complex, and what I actually need is never where I need it!" + +Part of the problem is that the people who built this software are probably not dentists, dental hygienists, or have any experience with a dentist other than as a patient in the chair. Many software companies have roles to help fill those gaps—product managers, product and market analysts, researchers, and others are meant to help gather requirements that tell development teams what to build. + +But we all know about learning a new domain. There's learning it from the outside, casually understanding it; then there's learning it from the inside, living it day-to-day, and really knowing it as an expert. The closer the development team can get to the real, "living it" experience, the better decisions they will make when they build software for specific users and domains. + +Open source has an ethos of sharing the work being done. Now I think it is time to evolve open source to the next level: sharing work that _needs to be_ done. Domain experts (i.e., the eventual users) need to share information about what they need to do their job so that open source developers can build software to meet their needs. + +This might sound overwhelming if you're not a software developer. Contributing to open source means that you need to write code, understand [Git][2], or cross other technical hurdles, right? Not necessarily; contributing your domain expertise is an important part of open source development. + +And you can use the tools you already have. You're already on social media. You probably have access to a word processor of some kind. And you have a work environment that can be shared openly (even in COVID times, thanks to technology). + +### Three steps to opening your job + +The following steps can help you open your job so software developers can learn your domain, understand your job and pain points, and build software that works better for you. + +#### 1\. Invite software builders into your work environment + +An ethnographic study is where parts of the software team shadow you in your job. You'll be asked to do everything you normally do on a workday, just as you always do it. Like a "fly on the wall," the software team is there to observe and understand how you do what you do. They might debrief with you throughout the day to get more insights into why you did certain things. Overall, this is meant to be non-invasive for you but very informative for the team. + +#### 2\. Share writeups about your job with software builders + +Far too often in the software industry, we focus on the software, not its use. As an example, a software requirement may come in as: "Show the history of dental work done to a tooth." This assumes that the software is required to do this job and that this history is useful no matter where it's shown in the software. + +Instead, developers need to back up and make sure they understand the job functions thoroughly. For example, a requirement could say: "A patient has a tooth with a cavity that was found during routine cleaning. While the patient is still there, the dentist needs to know what else has been done to the tooth to be able to prescribe a solution to the patient." By knowing the job that needs to be done, the software developer can build software that enables easy selection of the tooth in question, mid-exam, with gloves on. Therefore, this information should be available while in the "routine cleaning" view. + +Writing up your intent and context while you're using the software, rather than the tasks you do, can help software developers build to meet your true needs. + +If you want to go deeper, look at the [Jobs To Be Done][3] (JTBD) framework as a way to convey your expertise to software teams. + +#### 3\. Use social media to share videos, explanations, and more about your job + +Use the social media platform of your choice (e.g., YouTube, Reddit, etc.) to share information about your job. Recording and sharing a "day in the life" video openly could greatly help development teams really understand what you do and how you do it so that they can create software that serves your needs. + +### Open opportunities + +Open your job, and you'll open opportunities for software developers to build better software! Let's bring open source to the next level together by sharing more about what you need. + +You don't need to be a master coder to contribute to open source. Jade Wang shares 8 ways you can... + +-------------------------------------------------------------------------------- + +via: https://opensource.com/article/20/10/open-your-job + +作者:[Catherine Robson][a] +选题:[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/crobson +[b]: https://github.com/lujun9972 +[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/team-discussion-mac-laptop-stickers.png?itok=AThobsFH (Active listening in a meeting is a skill) +[2]: https://opensource.com/resources/what-is-git +[3]: https://www.google.com/books/edition/The_Jobs_To_Be_Done_Playbook/1vHRDwAAQBAJ?hl=en&gbpv=1&printsec=frontcover From 0691b1f914872bfdff6343cabc23a5209cf2ede5 Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:07:34 +0800 Subject: [PATCH 20/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201026=20ni?= =?UTF-8?q?nja:=20a=20simple=20way=20to=20do=20builds?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201026 ninja- a simple way to do builds.md --- ...201026 ninja- a simple way to do builds.md | 117 ++++++++++++++++++ 1 file changed, 117 insertions(+) create mode 100644 sources/tech/20201026 ninja- a simple way to do builds.md diff --git a/sources/tech/20201026 ninja- a simple way to do builds.md b/sources/tech/20201026 ninja- a simple way to do builds.md new file mode 100644 index 0000000000..2b2c3d8985 --- /dev/null +++ b/sources/tech/20201026 ninja- a simple way to do builds.md @@ -0,0 +1,117 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (ninja: a simple way to do builds) +[#]: via: (https://jvns.ca/blog/2020/10/26/ninja--a-simple-way-to-do-builds/) +[#]: author: (Julia Evans https://jvns.ca/) + +ninja: a simple way to do builds +====== + +Hello! Every so often I find a new piece of software I really like, and today I want to talk about one of my recent favourites: [ninja][1]! + +### incremental builds are useful + +I do a lot of small projects where I want to set up incremental builds – for example, right now I’m writing a zine about bash, and I have one `.svg` file for each page of the zine. I need to convert the SVGs to PDFs, and I’d been doing it something like this: + +``` +for i in *.svg +do + svg2pdf $i $i.pdf # or ${i/.svg/.pdf} if you want to get really fancy +done +``` + +This works fine, but my `svg2pdf` script is a little slow (it uses Inkscape), and it’s annoying to have to wait 90 seconds or whatever to rebuild all the PDFs when I’ve just updated 1 page. + +### build systems are confusing + +In the past I’ve been pretty put off by using a Build System like make or bazel for my small projects because bazel is this Big Complicated Thing and `make` feels a little arcane to me. I don’t really know how to use either of them. + +So for a long time I’ve just written a bash script or something for my builds and resigned myself to just waiting for a minute sometimes. + +### ninja is an EXTREMELY SIMPLE build system + +But ninja is not complicated! Here is literally everything I know about ninja build file syntax: how to create a `rule` and a `build`: + +a `rule` has a command and description (the description is just for humans to read so you can tell what it’s doing when it’s building your code) + +``` +rule svg2pdf + command = inkscape $in --export-text-to-path --export-pdf=$out + description = svg2pdf $in $out +``` + +the syntax for `build` is `build output_file: rule_name input_files`. Here’s one using the `svg2pdf` rule. The output goes in `$out` in the rule and the input goes in `$in`. + +``` +build pdfs/variables.pdf: svg2pdf variables.svg +``` + +That’s it! If you put those two things in a file called `build.ninja` and then run `ninja`, ninja will run `inkscape variables.svg --export-text-to-path --export-pdf=pdfs/variables.pdf`. And then if you run it again, it won’t run anything (because it can tell that you’ve already built `pdfs/variables.pdf` and you’re up to date) + +Ninja has a few more features than this (see [the manual][2]), but I haven’t used them yet. It was originally built [for Chromium][3], so even with a small feature set it can support large builds. + +### ninja files are usually automatically generated + +The magic of ninja is that instead of having to use some confusing Build Language that’s hard to remember because you use it so infrequently (like make), instead the ninja language is SUPER simple, and if you want to do something complicated then you just generate the build file you want using any programming language you want. + +I like to make a `build.py` file or that looks something like this, that creates the ninja build file and then runs `ninja`: + +``` +with open('build.ninja', 'w') as ninja_file: + # write some rules + ninja_file.write(""" +rule svg2pdf + command = inkscape $in --export-text-to-path --export-pdf=$out + description = svg2pdf $in $out +""") + + # some for loop with every file I need to build + for filename in things_to_convert: + ninja_file.write(f""" +build {filename.replace('svg', 'pdf')}: svg2pdf {filename} +""") + +# run ninja +import subprocess +subprocess.check_call(['ninja']) +``` + +I’m sure there are a bunch of ninja best practices, but I don’t know them and for my small projects I find this works well. + +### meson is a build system that generates ninja files + +I don’t know too much about [Meson][4] yet, but recently I was building a C program ([plocate][5], a faster alternative to `locate`) and I noticed that instead of the usual `./configure; make; make install`, there were different build instructions: + +``` +meson builddir +cd builddir +ninja +``` + +It seems like Meson is a build system for C/C++/Java/Rust/Fortran that can use ninja as a backend. + +### that’s all! + +I’ve been using ninja for a few months now. I really like it and it’s caused me approximately 0 build-related headaches which feels pretty magical to me. + +-------------------------------------------------------------------------------- + +via: https://jvns.ca/blog/2020/10/26/ninja--a-simple-way-to-do-builds/ + +作者:[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://ninja-build.org/ +[2]: https://ninja-build.org/manual.html +[3]: http://neugierig.org/software/chromium/notes/2011/02/ninja.html +[4]: https://mesonbuild.com/Tutorial.html +[5]: https://blog.sesse.net/blog/tech/2020-09-28-00-37_introducing_plocate From 4d4fb56c131292e820f6a37091b7f1cab1d7b36a Mon Sep 17 00:00:00 2001 From: DarkSun Date: Tue, 27 Oct 2020 05:07:51 +0800 Subject: [PATCH 21/26] =?UTF-8?q?=E9=80=89=E9=A2=98[tech]:=2020201026=20Pi?= =?UTF-8?q?=20from=20High=20School=20Maths?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit sources/tech/20201026 Pi from High School Maths.md --- .../20201026 Pi from High School Maths.md | 155 ++++++++++++++++++ 1 file changed, 155 insertions(+) create mode 100644 sources/tech/20201026 Pi from High School Maths.md diff --git a/sources/tech/20201026 Pi from High School Maths.md b/sources/tech/20201026 Pi from High School Maths.md new file mode 100644 index 0000000000..10e972ca01 --- /dev/null +++ b/sources/tech/20201026 Pi from High School Maths.md @@ -0,0 +1,155 @@ +[#]: collector: (lujun9972) +[#]: translator: ( ) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (Pi from High School Maths) +[#]: via: (https://theartofmachinery.com/2020/10/26/pi_from_high_school_maths.html) +[#]: author: (Simon Arneaud https://theartofmachinery.com) + +Pi from High School Maths +====== + +Warning: I don’t think the stuff in this post has any direct practical application by itself (unless you’re a nuclear war survivor and need to reconstruct maths from scratch or something). Sometimes I like to go back to basics, though. Here’s a look at (\pi) and areas of curved shapes without any calculus or transcendental functions. + +### A simple algorithm for calculating (\pi) + +This algorithm starts with simple number theoretic musing. Some whole numbers form neat Pythagorean triples ((x,y,z)) where (x^{2} + y^{2} = z^{2}). E.g., (3^{2} + 4^{2} = 5^{2}). It’s easy to find all the solutions to (x^{2} + y^{2} = 5^{2}) through brute-force search because we know that (x) and (y) can’t be bigger than (5). Here they are: + +[\begin{matrix} {0^{2} + 5^{2}} & {= 5^{2}} \ {3^{2} + 4^{2}} & {= 5^{2}} \ {4^{2} + 3^{2}} & {= 5^{2}} \ {5^{2} + 0^{2}} & {= 5^{2}} \ \end{matrix}] + +(Plus all the negative-number combinations, but let’s stick with non-negative integers and just count 4 solutions.) If we relax the equation, and count solutions to (x^{2} + y^{2} \leq 5^{2}), the answer turns out to be 26. Why care? Well, if (t) is the total number of solutions to (x^{2} + y^{2} \leq n^{2}), then + +[\lim\limits_{n\rightarrow\infty}\frac{4t}{(n + 1)^{2}} = \pi] + +Or, in code, here’s a simple program that estimates (\pi), getting more accurate for bigger values of the `n` variable: + +``` +import std; + +ulong sq(ulong x) pure +{ + return x * x; +} + +void main(string[] args) +{ + const n = args.length > 1 ? args[1].to!ulong : 20; + + ulong total; + foreach (x; 0..n+1) + { + foreach (y; 0..n+1) + { + if (sq(x) + sq(y) <= sq(n)) total++; + } + } + + /* + // Alternatively, for functional programming fans: + const total = + cartesianProduct(iota(n+1), iota(n+1)) + .filter!(p => sq(p[0]) + sq(p[1]) <= sq(n)) + .walkLength; + */ + + writef("%.12f\n", 4.0 * total / sq(n+1)); +} + +$ ./pi_calc +3.038548752834 +$ ./pi_calc 10000 +3.141362256135 +``` + +Okay, that’s a little bit more accurate than (\frac{22}{7}). Unlike most formulae for (\pi), though, there’s a simple diagram that shows how it works. Imagine we lay out the ((x,y)) integer pairs (where (x) and (y) range from (0) to (n)) on a 2D grid the obvious way. The figure below shows an example for (n = 10), with the arrow (r) pointing from the origin to ((6,8)). (r) and the (x) and (y) components make a right-angled triangle, so [Pythagoras’s theorem][1] says that (x^{2} + y^{2} = r^{2}). For ((6,8)), (r = 10 = n), so ((6,8)) is on the boundary as a solution to (x^{2} + y^{2} \leq 10^{2}). That boundary (the set of real-valued points a constant distance (n = 10) from the origin) makes a quarter circle. + +![][2] + +A circle is a simple, convex shape, and the grid points are evenly spaced, so the number of points inside the quarter circle will be roughly proportional to the area. More specifically, the fraction of all the grid points inside the quarter circle will be roughly the area of the quarter circle divided by the area of square around all points. The quarter circle area is (\pi r^{2} \div 4), inside the square of area (r^{2}) (remember, (n = r)), so (\frac{\pi}{4}) of all points represent solutions. The (x) and (y) values count from (0) to (n), so there are ((n + 1)^{2}) grid points. Rearrange the equations and you get a formula for estimating (\pi) from a solution count. The grid points keep drawing an arbitrarily more accurate circle as (n) gets bigger (just like a higher-resolution computer monitor does) so the estimate is exact in the limit. + +### A faster implementation + +The code above is simple but slow because it brute-force scans over all ((n + 1) \times (n + 1))possible (x) and (y) values. But we obviously don’t need to scan _all_ values. If we know that (x^{2} + y^{2} \leq n^{2}), then making (x) or (y) smaller will only give us another solution. We don’t need to keep testing smaller values after we find a solution. Ultimately, we only need to find the integral points around the boundary. Here’s a faster algorithm based on that idea. + +Imagine we scan along the integral (x) values and find the maximum integral (y) value that still gives us a solution. This gives us a border line marked in red in the figure below. If (y = 8) for a given (x) value, we instantly know there are (8 + 1 = 9) solutions with that given (x) value ((+ 1) to count the (y = 0) solution). + +![][3] + +Note that as (x) scans from (0) to (n), (y) starts at (n) and decreases to (0). Importantly, it _only_ decreases — it’s monotonic. So if we scan (x) from (0) to (n), we can find the next boundary (y) point by starting from the previous boundary point and searching downwards. Here’s some code: + +``` +ulong y = n, total; +foreach (x; 0..n+1) +{ + while (sq(x) + sq(y) > sq(n)) y--; + total += y + 1; +} +``` + +This version still has nested loops, so it might look like it’s still (O(n^{2})). However, the inner `while` loop executes a varying number of times for each (x) value. Often the `y--` doesn’t trigger at all. In fact, because `y` starts from `n` and monotonically decreases to 0, we know the `y--` will be executed exactly `n` times in total. There’s no instruction in that code that executes more than (O(n)) times, total, so the whole algorithm is (O(n)). + +With 64b `ulong` integers, the largest value of `n` that works before overflow is 4294967294: + +``` +$ ./pi_calc 4294967294 +3.141592653058 +``` + +There are ways to get faster convergence using numerical integration tricks, but I like the way this algorithm only uses integer arithmetic (up until the final division), and can be understood directly from simple diagrams. + +### Area of a circle without calculus + +Perhaps you feel a bit cheated because that algorithm assumes the (\pi r^{2}) formula for the area of a circle. Sure, that’s arguably included in “high school maths”, but it’s something students just get told to remember, unless they study integral calculus and derive it that way. But if we’re going to assume (\pi r^{2}), why not assume the theory of trigonometric functions as well, and just use (\pi = 4\operatorname{atan}(1))? + +The great ancient Greek mathematician Archimedes figured out the circle area over two thousand years ago without integral calculus (or trigonometric functions for that matter). He started with an elegant insight about regular (i.e., equal-sided) polygons. + +The famous [“half base times height” formula for the area of a triangle already had a well-known proof in the first book of Euclid’s Elements of Geometry][4] (easily derived from [a theorem about parallelograms][5]). Conveniently, any regular polygon can be split into equal triangles joined to the centre. For example, a regular hexagon splits into six triangles, as in the figure below. We can take any one of the triangles (they’re all the same) and call the “base” the side that’s also a side of the polygon. Then the “height” is the line from the centre of the base to the centre of the polygon. + +![][6] + +Now here’s Archimedes’s neat insight: The ratio of the triangle area to the base is (\frac{h}{2}). If you add up all the areas, you get the area of the polygon. Likewise, if you add up all the bases, you get the perimeter of the polygon. Because the triangle area/base ratio is a constant (\frac{h}{2}) for all triangles, the area/perimeter ratio for the whole polygon is the same (\frac{h}{2}). As a formula, the area of _any_ regular polygon is (P \times \frac{h}{2}) (where (P) is the perimeter). + +If you think of a circle as a regular polygon with infinitely many sides (so that (h) becomes the radius of the circle), and use the circle circumference ((2\pi r)) as your basic definition of (\pi), then that implies the area of a circle is (2\pi r \times \frac{r}{2} = \pi r^{2}). + +Of course, Archimedes was a respected mathematician who couldn’t get away with just assuming that anything true of a polygon is true of a circle (counterexample: all polygons have bumpy corners, but circles don’t). He used the kind of geometric proof by contradiction that was popular in his day. (He even took it further and analysed spheres, cylinders, parabolas and other curved objects, almost inventing something like modern real analysis a couple of millenia early.) Sadly, not all of his mathemetical work has survived, but [the key part of his Measurement of a Circle][7] has. + +Here’s the high-level version. Archimedes claimed that the area of a circle is (2\pi r \times \frac{r}{2}). Suppose you think his value is too small, and the circle is really bigger than (2\pi r \times \frac{r}{2}). That means there’s enough room inside the circle to fit a regular polygon that’s also bigger than (2\pi r \times \frac{r}{2}). But Archimedes said that’s contradictory because for any such polygon, (h < r), and (P < 2\pi r) (because each side of the polygon is a straight line that’s shorter than the circle arc that connects the same points), so the area (A = P \times \frac{h}{2} < 2\pi r \times \frac{r}{2}). The polygon’s area can’t be both bigger and smaller than (2\pi r \times \frac{r}{2}). + +![][8] + +Archimedes argued that there’s a similar contradiction if you think (2\pi r \times \frac{r}{2}) is too big, and the circle area is smaller than that. In that case he could make a polygon that’s also smaller than (2\pi r \times \frac{r}{2}), yet still wraps around the circle. For this polygon, (h = r), but he said the perimeter of the polygon must be greater than (2\pi r)[1][9], so that the polygon’s area must be bigger than (2\pi r \times \frac{r}{2}), even though it’s also meant to be smaller. + +![][10] + +If both of those cases lead to contradiction, we’re left with the only alternative that the circle area is (\pi r^{2}). + + 1. I don’t actually know how he argued this. [↩︎][11] + + + + +-------------------------------------------------------------------------------- + +via: https://theartofmachinery.com/2020/10/26/pi_from_high_school_maths.html + +作者:[Simon Arneaud][a] +选题:[lujun9972][b] +译者:[译者ID](https://github.com/译者ID) +校对:[校对者ID](https://github.com/校对者ID) + +本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 + +[a]: https://theartofmachinery.com +[b]: https://github.com/lujun9972 +[1]: https://www.cut-the-knot.org/pythagoras/ +[2]: https://theartofmachinery.com/images/pi_from_high_school_maths/pi_calc_grid.svg +[3]: https://theartofmachinery.com/images/pi_from_high_school_maths/pi_fast_calc_grid.svg +[4]: https://mathcs.clarku.edu/~djoyce/java/elements/bookI/propI37.html +[5]: https://mathcs.clarku.edu/~djoyce/java/elements/bookI/propI35.html +[6]: https://theartofmachinery.com/images/pi_from_high_school_maths/polygon.svg +[7]: https://flashman.neocities.org/ARCHCI1set.htm +[8]: https://theartofmachinery.com/images/pi_from_high_school_maths/polygon_inner.svg +[9]: tmp.gJlezpSbZb#fn:1 +[10]: https://theartofmachinery.com/images/pi_from_high_school_maths/polygon_outer.svg +[11]: tmp.gJlezpSbZb#fnref:1 From 55a3146d17592a2ec9d67ab134b37ce8e934f7ed Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 27 Oct 2020 08:45:09 +0800 Subject: [PATCH 22/26] translating --- ...nOffice and Support LibreOffice Instead.md | 81 ------------------- ...nOffice and Support LibreOffice Instead.md | 81 +++++++++++++++++++ 2 files changed, 81 insertions(+), 81 deletions(-) delete mode 100644 sources/tech/20201014 LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead.md create mode 100644 translated/tech/20201014 LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead.md diff --git a/sources/tech/20201014 LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead.md b/sources/tech/20201014 LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead.md deleted file mode 100644 index f7114ef6b3..0000000000 --- a/sources/tech/20201014 LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead.md +++ /dev/null @@ -1,81 +0,0 @@ -[#]: collector: (lujun9972) -[#]: translator: (geekpi) -[#]: reviewer: ( ) -[#]: publisher: ( ) -[#]: url: ( ) -[#]: subject: (LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead) -[#]: via: (https://itsfoss.com/libreoffice-letter-openoffice/) -[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) - -LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead -====== - -It is a no-brainer that Apache OpenOffice is still a relevant recommendation when we think about [open source alternatives to Microsoft Office][1] for Linux users. However, for the past several years, the development of OpenOffice is pretty much stale. - -Of course, it is not a shocker, considering Abhishek wrote about the [possibility of Apache OpenOffice shutting down][2] back in 2016. - -Now, in an [open letter from The Document Foundation][3], they appeal Apache OpenOffice to recommend users to start using better alternatives like LibreOffice. In this article, I shall mention some highlights from the blog post by The Document Foundation and what it means to Apache OpenOffice. - -![][4] - -### Apache OpenOffice is History, LibreOffice is the Future? - -Even though I didn’t use OpenOffice back in the day, it is safe to say that it is definitely not a modern open-source alternative to Microsoft Office. Not anymore, at least. - -Yes, Apache OpenOffice is still something important for legacy users and was a great alternative a few years back. - -Here’s the timeline of major releases for OpenOffice and LibreOffice: - -![][5] - -Now that there’s no significant development taking place for OpenOffice, what’s the future of Apache OpenOffice? A fairly active project with no major releases by the largest open source foundation? - -It does not sound promising and that is exactly what The Document Foundation highlights in their open letter: - -> OpenOffice(.org) – the “father project” of LibreOffice – was a great office suite, and changed the world. It has a fascinating history, but **since 2014, Apache OpenOffice (its current home) hasn’t had a single major release**. That’s right – no significant new features or major updates have arrived in over six years. Very few minor releases have been made, and there have been issues with timely security updates too. - -For an average user, if they don’t know about [LibreOffice][6], I would definitely want them to know. But, should the Apache Foundation suggest OpenOffice users to try LibreOffice to experience a better or advanced office suite? - -I don’t know, maybe yes, or no? - -> …many users don’t know that LibreOffice exists. The OpenOffice brand is still so strong, even though the software hasn’t had a significant release for over six years, and is barely being developed or supported - -As mentioned in the open letter, The Document Foundation highlights the advantages/improvements of LibreOffice over OpenOffice and appeals to Apache OpenOffice that they start recommending their users to try something better (i.e. LibreOffice): - -> We appeal to Apache OpenOffice to do the right thing. Our goal should be to **get powerful, up-to-date and well-maintained productivity tools into the hands of as many people as possible**. Let’s work together on that! - -### What Should Apache OpenOffice Do? - -If OpenOffice does the work, users may not need the effort to look for alternatives. So, is it a good idea to call out another project about their slow development and suggest them to embrace the future tools and recommend them instead? - -In an argument, one might say it is only fair to promote your competition if you’re done and have no interest in improving OpenOffice. And, there’s nothing wrong in that, the open-source community should always work together to ensure that new users get the best options available. - -On another side, one might say that The Document Foundation is frustrated about OpenOffice still being something relevant in 2020, even without any significant improvements. - -I won’t judge, but I think these conflicting thoughts come to my mind when I take a look at the open letter. - -### Do you think it is time to put OpenOffice to rest and rely on LibreOffice? - -Even though LibreOffice seems to be a superior choice and definitely deserves the limelight, what do you think should be done? Should Apache discontinue OpenOffice and redirect users to LibreOffice? - -Your opinion is welcome. - --------------------------------------------------------------------------------- - -via: https://itsfoss.com/libreoffice-letter-openoffice/ - -作者:[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-free-open-source-alternatives-microsoft-office/ -[2]: https://itsfoss.com/openoffice-shutdown/ -[3]: https://blog.documentfoundation.org/blog/2020/10/12/open-letter-to-apache-openoffice/ -[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/libre-office-open-office.png?resize=800%2C450&ssl=1 -[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/libre-office-open-office-derivatives.jpg?resize=800%2C166&ssl=1 -[6]: https://itsfoss.com/libreoffice-tips/ diff --git a/translated/tech/20201014 LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead.md b/translated/tech/20201014 LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead.md new file mode 100644 index 0000000000..5620f99321 --- /dev/null +++ b/translated/tech/20201014 LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead.md @@ -0,0 +1,81 @@ +[#]: collector: (lujun9972) +[#]: translator: (geekpi) +[#]: reviewer: ( ) +[#]: publisher: ( ) +[#]: url: ( ) +[#]: subject: (LibreOffice Wants Apache to Drop the Ailing OpenOffice and Support LibreOffice Instead) +[#]: via: (https://itsfoss.com/libreoffice-letter-openoffice/) +[#]: author: (Ankush Das https://itsfoss.com/author/ankush/) + +LibreOffice 希望 Apache 放弃陷入困境的 OpenOffice,转而支持 LibreOffice +====== + +对于 Linux 用户来说,当我们想到[微软 Office 的开源替代品][1]时,Apache OpenOffice 仍然是一个相关的推荐,这是不言而喻的。然而,在过去的几年里,OpenOffice 的发展几乎是停滞的。 + +当然,考虑到 Abhishek 早在 2016年 就写过 [Apache OpenOffice 关闭的可能性][2],这并不令人震惊。 + +现在,在[文档基金会的公开信][3]中,他们呼吁 Apache OpenOffice 推荐用户开始使用更好的替代品,比如 LibreOffice。在本文中,我将提到文档基金会的博文中的一些重点,以及它对 Apache OpenOffice 的意义。 + +![][4] + +### Apache OpenOffice 是历史,LibreOffice 是未来? + +尽管我当年没有使用过 OpenOffice,但可以肯定地说,它绝对不是微软 Office 的现代开源替代品。至少现在不是了。 + +是的,Apache OpenOffice 对于传统用户来说仍然是很重要的东西,在几年前是一个很好的替代品。 + +以下是 OpenOffice 和 LibreOffice 的主要发布时间线: + +![][5] + +现在 OpenOffice 已经没有重大的开发了,Apache OpenOffice 的未来是什么?最大开源基金会一个有些活跃的项目没有重大发布? + +这听起来并不乐观,而这正是文档基金会在他们的公开信中所强调的: + +> OpenOffice(.org),LibreOffice 的”父项目“,是一个伟大的办公套件,它改变了世界。它有着引人入胜的历史,但**自从 2014 年以来,Apache OpenOffice (它现在的家)还没有一个重大的版本**。没错,六年多来,没有重大的新功能或重大更新到来。很少有次要的发布,而且在及时的安全更新方面也存在问题。 + +对于一个普通用户来说,如果他们不知道 [LibreOffice][6],我肯定希望他们知道。但是,Apache 基金会是否应该建议 OpenOffice 用户尝试使用 LibreOffice 来体验更好或更高级的办公套件呢? + +我不知道,也许是,或者不是? + +> ...很多用户不知道 LibreOffice 的存在。OpenOffice 的品牌仍然如此强大,尽管该软件已经有六年多没有重大的版本发布,而且几乎没有人开发或支持它。 + +正如在公开信中提到的,文档基金会强调了 LibreOffice 相对于 OpenOffice的 优势/改进,并呼吁 Apache OpenOffice 开始推荐他们的用户尝试更好的东西(即 LibreOffice): + +> 我们呼吁 Apache OpenOffice 做正确的事情。我们的目标应该是**把强大的、最新的、维护良好的生产力工具送到尽可能多的人手中**。让我们一起努力吧! + +### Apache OpenOffice 应该做什么? + +如果 OpenOffice 能完成工作,用户可能不需要努力寻找替代品。那么,因为他们的缓慢开发而呼唤另一个项目,建议用户采用未来工具并推荐它是一个好主意么? + +在争论中,有人可能会说,如果你已经完成了,并且对改进 OpenOffice 没有兴趣,那么推广你的竞争对手才是公平的。而且,这并没有错,开源社区应该一直合作,以确保新用户得到最好的选择。 + +从另一个侧面来看,我们可以说,文档基金会对于 OpenOffice 在 2020 年即使没有任何重大改进却仍然有重要意义感到沮丧。 + +我不会去评判,但当我看了这封公开信时,这些矛盾的想法就浮现在我的脑海里。 + +### 你认为是时候把 OpenOffice 搁置起来,依靠 LibreOffice 了吗? + +即使 LibreOffice 似乎是一个更优越的选择,并且绝对值得关注,你认为应该怎么做?Apache 是否应该停止 OpenOffice,并将用户重定向到 LibreOffice? + +欢迎你的意见。 + +-------------------------------------------------------------------------------- + +via: https://itsfoss.com/libreoffice-letter-openoffice/ + +作者:[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-free-open-source-alternatives-microsoft-office/ +[2]: https://itsfoss.com/openoffice-shutdown/ +[3]: https://blog.documentfoundation.org/blog/2020/10/12/open-letter-to-apache-openoffice/ +[4]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/libre-office-open-office.png?resize=800%2C450&ssl=1 +[5]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/10/libre-office-open-office-derivatives.jpg?resize=800%2C166&ssl=1 +[6]: https://itsfoss.com/libreoffice-tips/ From 56a1c6c096bceaa7751c20573450a58d4c6b5d8f Mon Sep 17 00:00:00 2001 From: geekpi Date: Tue, 27 Oct 2020 08:55:20 +0800 Subject: [PATCH 23/26] translating --- .../20200909 How to Install Ubuntu Server on a Raspberry Pi.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sources/tech/20200909 How to Install Ubuntu Server on a Raspberry Pi.md b/sources/tech/20200909 How to Install Ubuntu Server on a Raspberry Pi.md index 075091a91b..ac2fa3d489 100644 --- a/sources/tech/20200909 How to Install Ubuntu Server on a Raspberry Pi.md +++ b/sources/tech/20200909 How to Install Ubuntu Server on a Raspberry Pi.md @@ -1,5 +1,5 @@ [#]: collector: (lujun9972) -[#]: translator: ( ) +[#]: translator: (geekpi) [#]: reviewer: ( ) [#]: publisher: ( ) [#]: url: ( ) From 28800baa87eb7ac96fdfd8075d2bc76e6f45ed2d Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Oct 2020 17:13:48 +0800 Subject: [PATCH 24/26] Rename sources/tech/20201021 How anyone can contribute to open source software in their job.md to sources/talk/20201021 How anyone can contribute to open source software in their job.md --- ... anyone can contribute to open source software in their job.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20201021 How anyone can contribute to open source software in their job.md (100%) diff --git a/sources/tech/20201021 How anyone can contribute to open source software in their job.md b/sources/talk/20201021 How anyone can contribute to open source software in their job.md similarity index 100% rename from sources/tech/20201021 How anyone can contribute to open source software in their job.md rename to sources/talk/20201021 How anyone can contribute to open source software in their job.md From 0459f9e11f9fed7fd6d12df34c8069b9830add8b Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Oct 2020 17:16:32 +0800 Subject: [PATCH 25/26] Rename sources/tech/20201022 How to influence people to join open source.md to sources/talk/20201022 How to influence people to join open source.md --- .../20201022 How to influence people to join open source.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20201022 How to influence people to join open source.md (100%) diff --git a/sources/tech/20201022 How to influence people to join open source.md b/sources/talk/20201022 How to influence people to join open source.md similarity index 100% rename from sources/tech/20201022 How to influence people to join open source.md rename to sources/talk/20201022 How to influence people to join open source.md From 293fcc85fb352b60ff54f3d72dea3e603a888c52 Mon Sep 17 00:00:00 2001 From: "Xingyu.Wang" Date: Tue, 27 Oct 2020 17:19:41 +0800 Subject: [PATCH 26/26] Rename sources/tech/20201023 Why it-s important to keep the cloud open.md to sources/talk/20201023 Why it-s important to keep the cloud open.md --- .../20201023 Why it-s important to keep the cloud open.md | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename sources/{tech => talk}/20201023 Why it-s important to keep the cloud open.md (100%) diff --git a/sources/tech/20201023 Why it-s important to keep the cloud open.md b/sources/talk/20201023 Why it-s important to keep the cloud open.md similarity index 100% rename from sources/tech/20201023 Why it-s important to keep the cloud open.md rename to sources/talk/20201023 Why it-s important to keep the cloud open.md