Merge pull request #2 from LCTT/master

up0427
This commit is contained in:
qfzy1233
2020-04-28 08:32:41 +08:00
committed by GitHub
83 changed files with 7712 additions and 3693 deletions

View File

@@ -0,0 +1,220 @@
[#]: collector: "lujun9972"
[#]: translator: "mr-ping"
[#]: reviewer: "wxy"
[#]: publisher: "wxy"
[#]: url: "https://linux.cn/article-12125-1.html"
[#]: subject: "Different Ways To Update Linux Kernel For Ubuntu"
[#]: via: "https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/"
[#]: author: "SK https://www.ostechnix.com/author/sk/"
升级 Ubuntu Linux 内核的几种不同方法
======
![](https://www.ostechnix.com/wp-content/uploads/2019/01/ubuntu-linux-kernel-720x340.png)
这个指南里介绍了 7 种为 Ubuntu 升级 Linux 内核的不同方法。这 7 种方法里,有 5 种需要重启系统来使新内核生效,其他两种则不用。升级之前,**强烈建议你将重要数据进行备份!** 这里提到的所有方法只在 Ubuntu 中测试过。我们并不确定这些方法是不是也能适用于其他 Ubuntu 的特色发行版(如: Xubuntu和衍生发行版Linux Mint
### 第一部分:需要重启的内核升级
以下方法需要你重启系统以便新的内核生效。以下所有方法都建议在个人系统或测试系统中进行。重要的事儿再说一遍,请备份好你 Ubuntu 中的重要数据、配置文件和其他重要的东西。
#### 方法 使用 dpkg 升级 Linux 内核(手动方式)
这个方法可以帮助你从 [kernel.ubuntu.com][1] 网站手动下载可用的最新 Linux 内核。如果你打算安装最新版(而不是稳定版或者正式发布版),那这种方法对你会很有用。从以上链接下载 Linux 内核版本。编写这个指南的时候,最新的可用版本是 **5.0-rc1**,最新的稳定版是 **v4.20**
![][3]
点击你所选择的 Linux 内核版本链接找到你对应的架构“Build for XXX”的那部分。然后下载符合以下格式的两个文件其中 X.Y.Z 是最高版本号):
1. linux-image-*X.Y.Z*-generic-*.deb
2. linux-modules-X.Y.Z*-generic-*.deb
在终端中改变到文件所在的目录,然后执行此命令手动安装内核:
```
$ sudo dpkg --install *.deb
```
重启系统,使用新内核:
```
$ sudo reboot
```
检查是否如你所愿:
```
$ uname -r
```
对于分步的说明,请查看下列链接中对应的部分。
+ [在基于 RPM 和 DEB 的系统中安装 Linux 内核 4.15](https://www.ostechnix.com/install-linux-kernel-4-15-rpm-deb-based-systems/)
以上的指南是针对的是 4.15 版本,不过安装最新版本的所有的步骤都是一样的。
**优势:** 不必联网(你可以从任何系统中下载 Linux 内核来使用)
**缺点:** 手动更新,需要重启系统。
#### 方法 2 - 用 apt-get 来升级 Linux 内核(推荐方法)
这是在类 Ubuntu 系统中升级 Linux 内核的推荐方法。不同于上一个方法,这种方法会从 Ubuntu 官方仓库下载、安装内核版本,而不是从 **kernel.ubuntu.com**网站。
要升级包括内核的整个系统,只需要执行:
```
$ sudo apt-get update
$ sudo apt-get upgrade
```
如果只希望升级内核,运行:
```
$ sudo apt-get upgrade linux-image-generic
```
**优势:** 简单。推荐方法。
**缺点:** 需要联网,需要重启。
从官方库中升级内核是最接近开箱即用的方法,并且不会出什么问题。如果是生产环境的系统,这是最为推荐的升级 Linux 内核的方法。
方法 1 和方法 2 都需要用户去介入到升级 Linux 内核的过程中。而下边的方法3、 4、 5则几乎是全自动的。
#### 方法 3 - 使用 Ukuu 升级 Linux 内核
**Ukuu**是一个 Gtk GUI 和命令行工具,它可以从 kernel.ubuntu.com 下载最新的 Linux 主线内核,并自动安装到你的 Ubuntu 桌面版和服务器版中。Ukku 不仅简化了手动下载和安装新内核的过程,同时也会帮助你安全地移除旧的和不再需要的内核。更多细节可以参照以下指南。
+ [Ukuu在 Ubuntu 系统中安装和升级 Linux 内核的简单方法](https://www.ostechnix.com/ukuu-an-easy-way-to-install-and-upgrade-linux-kernel-in-ubuntu-based-systems/)
**优势:** 易于安装使用。自动安装主线内核。
**缺点:** 需要联网,需要重启。
#### 方法 4 - 使用 UKTools 升级 Linux 内核
跟 Ukuu 差不多,**UKTools** 也会从 kernel.ubuntu.com 网站获取最新的稳定内核并且自动安装到 Ubuntu 以及类似于 Linux Mint 的延伸发行版中。关于UKTools的更多详情请参见下面的链接。
+ [UKTools升级Ubuntu及其衍生产品中的最新Linux内核](https://www.ostechnix.com/uktools-upgrade-latest-linux-kernel-in-ubuntu-and-derivatives/)
**优势:** 简单,自动。
**缺点:** 需要联网,需要重启。
#### 方法 5 - 使用 Linux 内核实用程序更新 Linux 内核
**Linux 内核实用程序**是目前另一个用于升级类 Ubuntu 系统 Linux 内核的程序。实质上,它是一个由一系列 Bash 脚本构成的合集,用于编译并且可以选择性地为 DebianLCTT 译注Ubuntu 的上游发行版)及其衍生发行版升级内核。它包含三个实用程序,一个用于手动编译、安装来自于 [http://www.kernel.org][4] 网站的源码内核,另一个用于安装来自 <https://kernel.ubuntu.com> 网站的预编译的内核,第三个脚本用于移除旧内核。更多细节请浏览以下链接。
+ [Linux 内核实用程序:编译和更新最新的 Linux 内核的脚本,适用于 Debian 及其衍生产品](https://www.ostechnix.com/linux-kernel-utilities-scripts-compile-update-latest-linux-kernel-debian-derivatives/)
**优势:** 简单,自动。
**缺点:** 需要联网,需要重启。
### 第二部分:无需重启的内核升级
我之前说过上边所有的方法都需要你重启服务器LCTT 译注:也可以是桌面版)来启用新内核。如果是个人系统或者测试系统,可以这么办。但对于无法停机的生产环境系统该怎么办呢?一点问题没有,这时候<ruby>实时补丁<rt>livepatching</rt></ruby>就派上用场了。
**实时补丁**(或者叫热补丁)允许你在不重启的情况下安装 Linux 更新或补丁,使你的服务器处于最新的安全级别。这对 web 主机、游戏服务器这类需要不间断在线的服务器来说是很有价值的。事实上,任何情况下,服务器都应该保持在不间断运行的状态下。由于 Linux 供应商只会在出于修复安全漏洞的目的下维护补丁,所以如果安全性是你最关注的问题时,这种方式再适合不过了。
以下两种方法不需要重启,对于生产环境和执行关键任务的 Ubuntu 服务器的 Linux 内核更新非常有用。
#### 方法 6 使用 Canonical 实时补丁服务来更新 Linux 内核
![][5]
[Canonical 实时补丁服务][6]可以在不需要重启 Ubuntu 系统的情况下自动应用内核更新、补丁和安全补丁。它可以减少Ubuntu系统的停机时间并保证系统的安全。Canonical 实时补丁服务可以在安装过程当中或安装之后进行设置。如果你使用的是 Ubuntu 桌面版,软件更新器会自动检查内核补丁的更新,并通知你。在基于控制台的系统中,则需要你定期运行 `apt-get update` 命令来进行升级。由于需要你手动运行 `apt-get upgrade` 命令它才会安装内核的安全补丁,所以算是半自动的。
实时补丁对三个及以下系统免费,如果多于三个,你需要升级成名为 **Ubuntu Advantage** 的企业支持方案套件。这个套件包括 **Kernel 实时补丁**及以下服务:
* 扩展安全维护 Ubuntu 生命周期后的重要安全更新
* Landscape 针对大规模使用 Ubuntu 的系统管理工具
* 知识库 由 Ubuntu 专家撰写的私人文章和教程
* 电话和网站支持
**价格**
Ubuntu Advantage 包含三种付费计划,即基本计划、标准计划和高级计划。最基础的计划(基本计划)从 **单物理节点 225 美元/年**和**单VPS 75美元/年**开始计价。对于 Ubuntu 服务器版和桌面版看上去没有按月订阅。你可以在[此处][7]浏览所有计划的细节信息。
**优势:** 简单。半自动化。无需重启。支持三个免费系统。
**缺点:** 个以上主机的话非常昂贵。没有补丁回滚。
##### 开启 Canonical 实时补丁
如果你想在安装后设置实时补丁服务,依照以下方法逐步执行:
从 [https://auth.livepatch.canonical.com/][8] 获取一个密钥。
```
$ sudo snap install canonical-livepatch
$ sudo canonical-livepatch enable your-key
```
#### 方法 - 使用 KernelCare 升级 Linux 内核
![][9]
[KernelCare][10] 是最新的实时补丁方案。它是 [CloudLinux][11] 推出的产品。KernelCare 可以运行在 Ubuntu 和其他的 Linux 发行版中。它每四个小时检查一遍补丁的发布,并在无需确认的情况下安装它们。如果更新后存在问题,可以将补丁进行回滚。
**价格**
费用,每台服务器:**4 美元/月****45 美元/年**。
跟 Ubuntu 实时补丁相比KernelCare 看起来非常便宜、实惠。好的方面在于**也可以按月订阅**。另一个前者不具备的功能是支持其他 Linux 发行版,如 Red Hat、CentOS、Debian、Oracle Linux、Amazon Linux 以及 OpenVZ、Proxmox 等虚拟化平台。
你可以在[此处][12]了解 KernelCare 的所有特性和简介,以及所有的付费计划的细节。
**优势:** 简单。全自动化。覆盖范围更广的操作系统。补丁回滚。无需重启。对非营利组织提供免费许可。价格低廉。
**缺点:** 不是免费的除了30天的试用期
##### 开启 KernelCare 服务
在 [https://cloudlinux.com/kernelcare-free-trial5][14] 获取一个 30 天免费试用密钥。
执行以下命令开启 KernelCare 并注册秘钥。
```
$ sudo wget -qq -O - https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash
$ sudo /usr/bin/kcarectl --register KEY
```
如果你正在寻找一种经济实惠且可靠的商业服务来保持 Linux 服务器上的 Linux 内核更新,那么 KernelCare 是个不错的选择。
*由来自 Cloud Linux 的技术撰稿人和内容作者 Paul A. Jacobs 提供。*
到此,希望这边文章能对你有所帮助。如果你觉得还有其他的工具和方法需要列在这里,可以在留言区给我们留言。我会根据反馈检查和更新这篇指南的。
接下来会有更多好东西给大家呈现,敬请期待。
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/
作者:[SK][a]
选题:[lujun9972][b]
译者:[mr-ping](https://github.com/mr-ping)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: http://kernel.ubuntu.com/~kernel-ppa/mainline/
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[3]: http://www.ostechnix.com/wp-content/uploads/2019/01/Ubuntu-mainline-kernel.png
[4]: http://www.kernel.org
[5]: http://www.ostechnix.com/wp-content/uploads/2019/01/Livepatch.png
[6]: https://www.ubuntu.com/livepatch
[7]: https://www.ubuntu.com/support/plans-and-pricing
[8]: https://auth.livepatch.canonical.com/
[9]: http://www.ostechnix.com/wp-content/uploads/2019/01/KernelCare.png
[10]: https://www.kernelcare.com/
[11]: https://www.cloudlinux.com/
[12]: https://www.kernelcare.com/update-kernel-linux/
[13]: https://www.kernelcare.com/pricing/
[14]: https://cloudlinux.com/kernelcare-free-trial5

View File

@@ -0,0 +1,98 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12153-1.html)
[#]: subject: (What is Silverblue?)
[#]: via: (https://fedoramagazine.org/what-is-silverblue/)
[#]: author: (Tomáš Popela https://fedoramagazine.org/author/tpopela/)
Silverblue 是什么?
======
![][1]
Fedora Silverblue 在 Fedora 世界内外越来越受欢迎。因此,根据社区的反馈,以下是关于这个项目的一些有趣问题的答案。如果你有任何其他与 Silverblue 相关的问题,请在评论区留言,我们会在未来的文章中回答。
### Silverblue 是什么?
Silverblue 是新一代桌面操作系统的代号,之前被称为 Atomic Workstation。该操作系统是通过利用 [rpm-ostree 项目][2]创建的映像来交付的。这种系统的主要优点是速度、安全性、原子更新和不变性。
### “Silverblue” 到底是什么意思?
“Team Silverblue” 或简称 “Silverblue”没有任何隐藏的含义。该项目以前被称为 Atomic Workstation大约两个月后更名时选中了这个名字。在这个过程中审查过 150 多个单词或单词组合。最终选择了 “Silverblue”因为它有一个可用的域名以及社交网络账号。人们可以把它看成是 Fedora 的蓝色品牌的一个新的品牌形象可以用在诸如“加油Silverblue 团队!”或“想加入该团队,改进 Silverblue 吗?”这样的短语中。
### 何谓 ostree
[OSTree或 libostree是一个项目][3],它结合了一个类似 Git 的提交和下载可引导文件系统树的模型以及用于部署它们和管理引导加载程序配置的层。OSTree 由 rpm-ostree 使用,这是 Silverblue 使用的一个基于包/镜像的混合系统。它原子化地复制了一个基础操作系统,并允许用户在需要时在基础操作系统之上“层叠”传统的 RPM。
### 为何使用 Silverblue
因为它可以让你专注于你的工作,而不是你正在运行的操作系统。因为系统的更新是原子式的,所以它更稳健。你唯一需要做的事情就是重新启动到新的镜像中。此外,如果当前启动的镜像有什么问题,你可以很容易地重启/回滚到之前可以工作的镜像,如果有的话。如果没有,你可以使用 `ostree` 命令下载并启动过去生成的任何其他镜像。
另一个好处是可以在不同的分支(或者用旧的语境说就是不同的 Fedora 风味版本)之间轻松切换。你可以轻松地尝试 [Rawhide][4] 或 [updates-testing][5] 分支,然后返回到包含当前稳定版本的分支。另外,如果你想尝试一些新奇的东西,也可以考虑试试 Silverblue。
### 不可变的操作系统有什么好处?
其中一个主要的好处是安全。基础操作系统是以只读的形式挂载的,因此不能被恶意软件修改。唯一可以改变系统的方法是通过 `rpm-ostree` 实用程序。
另一个好处是健壮性。普通用户几乎不可能在不小心或无意中删除了一些系统库后,导致操作系统回到不启动或无法正常工作的状态。试着想想你过去的这些经历,就可以明白 Silverblue 可以如何帮助你。
### 如何在 Silverblue 中管理应用程序和包?
对于图形化用户界面的应用程序,建议使用 [Flatpak][6] —— 如果应用程序是以 Flatpak 的形式提供的话。用户可以选择来自 Fedora 的 Flatpak和从 Fedora 包及 Fedora 自己的基础架构中构建的 Flatpak或者是目前有更广泛的交付品的 Flathub。用户可以通过已经支持 Fedora Silverblue 的 GNOME “软件”轻松安装它们。
用户首先发现的一件事就是操作系统中没有预装 `dnf`。主要原因是它不能在 Silverblue 上工作 —— 它的部分功能被 `rpm-ostree` 命令所取代。用户可以通过使用 `rpm-ostree install PACKAGE` 来层叠传统的软件包。但只有在没有其他方法的情况下,才应该使用这种方式。这是因为从存储库中提取新的系统镜像时,每次更改系统镜像时都必须重新构建系统镜像,以容纳层叠的包或从基础操作系统中删除及替换为其他版本的包。
Fedora Silverblue 自带的默认 GUI 应用程序集是基础操作系统的一部分。团队正在努力将它们移植到 Flatpak 上,这样它们就可以通过这种方式分发。其中一个好处是,基础操作系统将变得更小,更容易维护和测试,用户可以更容易修改他们的默认安装环境。如果你想看一下它是怎么做的,或者有什么帮助,可以看看官方的[文档][7]。
### 什么是 Toolbox
[Toolbox][8] 是一个让普通用户可以轻松使用容器的项目。它通过使用 podman 的无 root 容器环境来实现。Toolbox 可以让你在常规的 Fedora 环境中轻松、快速地创建一个容器,你可以在这个容器上折腾或开发,而与你的操作系统分离。
### Silverblue 有路线图吗?
形式上没有,因为我们正在关注在测试过程中发现的问题和社区的反馈。我们目前正在使用 Fedora 的 [Taiga][9] 来进行规划。
### Silverblue 的发布周期是多少?
它和普通的 Fedora Workstation 是一样的。每 6 个月发布一次新版本,支持期为 13 个月。团队计划每两周(或更长时间)发布一次更新,而不是像现在这样每天发布一次。这样一来,更新可以在发送给其他用户之前,由 QA 和社区志愿者进行更彻底的测试。
### 不可变操作系统的未来前景如何?
从我们的角度来看桌面的未来会走向到不可变的操作系统。这对用户来说是最安全的Android、ChromeOS、ChromeOS、最近的 macOS Catalina 全都在底层采用了这种方式。而对于 Linux 桌面来说一些第三方软件期望写到操作系统的问题还是存在的。HP 打印机驱动程序就是一个很好的例子。
另一个问题是系统中的部分软件如何分发和安装。字体就是一个很好的例子。目前在 Fedora 中,它们是以 RPM 包的形式分发的。如果你想使用它们,你必须层叠它们,然后重新启动到新创建的包含它们的镜像中。
### 标准版 Workstation 的前景如何?
Silverblue 有可能会取代普通的 Workstation 版本。但 Silverblue 要提供与 Workstation 版本相同的功能和用户体验还有很长的路要走。在此期间,这两款桌面产品将同时推出。
### Atomic Workstation 或 Fedora CoreOS 与这些有什么关系?
Atomic Workstation 是在更名为 Fedora Silverblue 之前的项目名称。
Fedora CoreOS 是一个不同但相似的项目。它与 Silverblue 共享一些基本技术,如 `rpm-ostree``toolbox` 等。尽管如此CoreOS 是一个更简约、专注于容器、自动更新的操作系统。
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/what-is-silverblue/
作者:[Tomáš Popela][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://fedoramagazine.org/author/tpopela/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/07/what-is-fedora-silverblue-816x345.jpg
[2]: https://rpm-ostree.readthedocs.io/en/latest/
[3]: https://ostree.readthedocs.io/en/latest/
[4]: https://fedoraproject.org/wiki/Releases/Rawhide
[5]: https://fedoraproject.org/wiki/QA:Updates_Testing
[6]: https://flatpak.org/
[7]: https://docs.fedoraproject.org/en-US/flatpak/tutorial/
[8]: https://github.com/debarshiray/toolbox
[9]: https://teams.fedoraproject.org/project/silverblue/

View File

@@ -0,0 +1,251 @@
[#]: collector: (lujun9972)
[#]: translator: (messon007)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12135-1.html)
[#]: subject: (9 open source cloud native projects to consider)
[#]: via: (https://opensource.com/article/19/8/cloud-native-projects)
[#]: author: (Bryant Son https://opensource.com/users/brsonhttps://opensource.com/users/marcobravo)
值得关注的 9 个开源云原生项目
======
> 工作中用了容器?熟悉这些出自云原生计算基金会的项目吗?
![](https://img.linux.net.cn/data/attachment/album/202004/21/222735oa1wib1wgypoiwpp.jpg)
随着用容器来开发应用的实践变得流行,[云原生应用][2]也在增长。云原生应用的定义为:
> “云原生技术用于开发使用打包在容器中的服务所构建的应用程序,以微服务的形式部署,并通过敏捷的 DevOps 流程和持续交付工作流在弹性基础设施上进行管理。”
这个定义提到了构成云原生应用的不可或缺的四个元素:
1. 容器
2. 微服务
3. DevOps
4. 持续集成和持续交付 (CI/CD)
尽管这些技术各有各自独特的历史,但它们之间却相辅相成,在短时间内实现了云原生应用和工具的惊人的指数级增长。这个[云原生计算基金会CNCF][4]信息图呈现了当今云原生应用生态的规模和广度。
![Cloud-Native Computing Foundation applications ecosystem][5]
*云原生计算基金会项目*
我想说,瞧着吧!这仅仅是一个开始。正如 NodeJS 的出现引发了无数的 JavaScript 工具的爆炸式增长一样,容器技术的普及也推动了云原生应用的指数增长。
好消息是,有几个组织负责监管并将这些技术连接在一起。 其中之一是 <ruby>[开放容器倡议][6]<rt>Open Containers Initiative</rt></ruby>OCI它是一个轻量级的、开放的治理机构或项目“它是在 Linux 基金会的支持下形成的,其明确目的是创建开放的行业标准的容器格式和运行时。” 另一个是 CNCF它是“一个致力于使云原生计算普及和可持续发展的开源软件基金会”。
通常除了围绕云原生应用建立社区之外CNCF 还帮助项目围绕其云原生应用建立结构化管理。CNCF 创建了成熟等级的概念(沙箱级、孵化级或毕业级),分别与下图中的“创新者”、“早期采用者”和“早期大量应用”相对应。
![CNCF project maturity levels][7]
*CNCF 项目成熟等级*
CNCF 为每个成熟等级制定了详细的[标准][8]为方便读者而列在下面。获得技术监督委员会TOC三分之二的同意才能转为孵化或毕业级。
**沙箱级**
> 要想成为沙箱级,一个项目必须至少有两个 TOC 赞助商。 有关详细过程请参见《CNCF 沙箱指南 v1.0》。
**孵化级**
> 注:孵化级是我们期望对项目进行全面的尽职调查的起点。
>
> 要进入孵化级,项目除了满足沙箱级的要求之外还要满足:
>
> * 证明至少有三个独立的最终用户已成功将其用于生产,且 TOC 判断这些最终用户具有足够的质量和范围。
> * 提交者的数量要合理。提交者定义为具有提交权的人,即可以接受部分或全部项目贡献的人。
> * 显示出有大量持续提交和合并贡献。
> * 由于这些指标可能会根据项目的类型、范围和大小而有很大差异,所以 TOC 有权决定是否满足这些标准的活动水平。
**毕业级**
> 要从沙箱或孵化级毕业,或者要使一个新项目作为已毕业项目加入,项目除了必须满足孵化级的标准外还要满足:
>
> * 至少有两个来自组织的提交者。
> * 已获得并保持了“核心基础设施计划最佳实践徽章”。
> * 已完成独立的第三方安全审核,并发布了具有与以下示例类似的范围和质量的结果(包括已解决的关键漏洞):<https://github.com/envoyproxy/envoy#security-audit>,并在毕业之前需要解决所有关键的漏洞。
> * 采用《CNCF 行为准则》。
> * 明确规定项目治理和提交流程。最好将其列在 `GOVERNANCE.md` 文件中,并引用显示当前提交者和荣誉提交者的 `OWNERS.md` 文件。
> * 至少有一个主仓的项目采用者的公开列表(例如,`ADOPTERS.md` 或项目网站上的徽标)。
> * 获得 TOC 的绝大多数票,进入毕业阶段。如果项目能够表现出足够的成熟度,则可以尝试直接从沙箱级过渡到毕业级。项目可以无限期保持孵化状态,但是通常预计它们会在两年内毕业。
### 值得关注的 9 个项目
本文不可能涵盖所有的 CNCF 项目,我将介绍最有趣的 9 个毕业和孵化的开源项目。
名称|授权类型|简要描述
---|---|---
[Kubernetes][9] | Apache 2.0 | 容器编排平台
[Prometheus][10] | Apache 2.0 | 系统和服务监控工具
[Envoy][11] | Apache 2.0 | 边缘和服务代理
[rkt][12] | Apache 2.0 | Pod 原生的容器引擎
[Jaeger][13] | Apache 2.0 | 分布式跟踪系统
[Linkerd][14] | Apache 2.0 | 透明服务网格
[Helm][15] | Apache 2.0 | Kubernetes 包管理器
[Etcd][16] | Apache 2.0 | 分布式键值存储
[CRI-O][17] | Apache 2.0 | 专门用于 Kubernetes 的轻量级运行时环境
我也创建了视频材料来介绍这些项目。
- [video](https://youtu.be/3cDxYO2GK4w)
### 毕业项目
毕业的项目被认为是成熟的,已被许多组织采用的,并且严格遵守了 CNCF 的准则。以下是三个最受欢迎的开源 CNCF 毕业项目。(请注意,其中一些描述来源于项目的网站并被做了改编。)
#### Kubernetes希腊语“舵手”
Kubernetes! 说起云原生应用,怎么能不提 Kubernetes 呢? Google 发明的 Kubernetes 无疑是最著名的基于容器的应用程序的容器编排平台,而且它还是一个开源工具。
什么是容器编排平台?通常,一个容器引擎本身可以管理几个容器。但是,当你谈论数千个容器和数百个服务时,管理这些容器变得非常复杂。这就是容器编排引擎的用武之地。容器编排引擎通过自动化容器的部署、管理、网络和可用性来帮助管理大量的容器。
Docker Swarm 和 Mesosphere Marathon 也是容器编排引擎但是可以肯定地说Kubernetes 已经赢得了这场比赛至少现在是这样。Kubernetes 还催生了像 [OKD][18] 这样的容器即服务CaaS平台它是 Kubernetes 的 Origin 社区发行版,并成了 [Red Hat OpenShift][19] 的一部分。
想开始学习,请访问 [Kubernetes GitHub 仓库][9],并从 [Kubernetes 文档][20]页面访问其文档和学习资源。
#### Prometheus普罗米修斯
Prometheus 是 2012 年在 SoundCloud 上构建的一个开源的系统监控和告警工具。之后,许多公司和组织都采用了 Prometheus并且该项目拥有非常活跃的开发者和用户群体。现在它已经成为一个独立的开源项目独立于公司之外进行维护。
![Prometheus architecture][21]
*Prometheus 的架构*
理解 Prometheus 的最简单方法是可视化一个生产系统,该系统需要 24小时x 365都可以正常运行。没有哪个系统是完美的也有减少故障的技术称为容错系统但是如果出现问题最重要的是尽快发现问题。这就是像 Prometheus 这样的监控工具的用武之地。Prometheus 不仅仅是一个容器监控工具,但它在云原生应用公司中最受欢迎。此外,其他开源监视工具,包括 [Grafana][22],都借助了 Prometheus。
开始使用 Prometheus 的最佳方法是下载其 [GitHub 仓库][10]。在本地运行 Prometheus 很容易,但是你需要安装一个容器引擎。你可以在 [Prometheus 网站][23]上查看详细的文档。
#### Envoy使者
Envoy或 Envoy 代理)是专为云原生应用设计的开源的边缘代理和服务代理。由 Lyft 创建的 Envoy 是为单一服务和应用而设计的高性能的 C++ 开发的分布式代理同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。Envoy 建立在 Nginx、HAProxy、硬件负载均衡器和云负载均衡器等解决方案的基础上Envoy 与每个应用相伴(并行)运行,并通过提供平台无关的方式提供通用特性来抽象网络。
当基础设施中的所有服务流量都经过 Envoy 网格时很容易就可以通过一致的可观测性来可视化问题域调整整体性能并在单个位置添加基础功能。基本上Envoy 代理是一个可帮助组织为生产环境构建容错系统的服务网格工具。
服务网格应用有很多替代方案,例如 Uber 的 [Linkerd][24](下面会讨论)和 [Istio][25]。Istio 通过将其部署为 [Sidecar][26] 并利用了 [Mixer][27] 的配置模型,实现了对 Envoy 的扩展。Envoy 的显著特性有:
* 包括所有的“<ruby>入场筹码<rt>table stakes</rt></ruby>LCTT 译注:引申为基础必备特性)”特性(与 Istio 这样的控制平面组合时)
* 带载运行时 99% 数据可达到低延时
* 可以作为核心的 L3/L4 过滤器,提供了开箱即用的 L7 过滤器
* 支持 gRPC 和 HTTP/2上行/下行)
* 由 API 驱动,并支持动态配置和热重载
* 重点关注指标收集、跟踪和整体可监测性
要想了解 Envoy证实其能力并实现其全部优势需要丰富的生产级环境运行的经验。你可以在其[详细文档][28]或访问其 [GitHub][11] 仓库了解更多信息。
### 孵化项目
下面是六个最流行的开源的 CNCF 孵化项目。
#### rkt火箭
rkt, 读作“rocket”是一个 Pod 原生的容器引擎。它有一个命令行接口用来在 Linux 上运行容器。从某种意义上讲,它和其他容器如 [Podman][29]、Docker 和 CRI-O 相似。
rkt 最初是由 CoreOS (后来被 Red Hat 收购)开发的,你可以在其网站上找到详细的[文档][30],以及在 [GitHub][12] 上访问其源代码。
#### Jaeger贼鸥
Jaeger 是一个开源的端到端的分布式追踪系统,适用于云端应用。在某种程度上,它是像 Prometheus 这样的监控解决方案。但它有所不同,因为其使用场景有所扩展:
* 分布式事务监控
* 性能和延时优化
* 根因分析
* 服务依赖性分析
* 分布式上下文传播
Jaeger 是一项 Uber 打造的开源技术。你可以在其网站上找到[详细文档][31],以及在 [GitHub][13] 上找到其源码。
#### Linkerd
像创建 Envoy 代理的 Lyft 一样Uber 开发了 Linkerd 开源解决方案用于生产级的服务维护。在某些方面Linkerd 就像 Envoy 一样,因为两者都是服务网格工具,旨在提供平台级的可观测性、可靠性和安全性,而无需进行配置或代码更改。
但是,两者之间存在一些细微的差异。 尽管 Envoy 和 Linkerd 充当代理并可以通过所连接的服务进行上报,但是 Envoy 并不像 Linkerd 那样被设计为 Kubernetes Ingress 控制器。Linkerd 的显著特点包括:
* 支持多种平台Docker、Kubernetes、DC/OS、Amazon ECS 或任何独立的机器)
* 内置服务发现抽象,可以将多个系统联合在一起
* 支持 gRPC、HTTP/2 和 HTTP/1.x请 求和所有的 TCP 流量
你可以在 [Linkerd 网站][32]上阅读有关它的更多信息,并在 [GitHub][14] 上访问其源码。
#### Helm舵轮
Helm 基本上就是 Kubernetes 的包管理器。如果你使用过 Apache Maven、Maven Nexus 或类似的服务,你就会理解 Helm 的作用。Helm 可帮助你管理 Kubernetes 应用程序。它使用“Helm Chart”来定义、安装和升级最复杂的 Kubernetes 应用程序。Helm 并不是实现此功能的唯一方法;另一个流行的概念是 [Kubernetes Operators][33],它被 Red Hat OpenShift 4 所使用。
你可以按照其文档中的[快速开始指南][34]或 [GitHub 指南][15]来试用 Helm。
#### Etcd
Etcd 是一个分布式的、可靠的键值存储,用于存储分布式系统中最关键的数据。其主要特性有:
* 定义明确的、面向用户的 APIgRPC
* 自动 TLS可选的客户端证书验证
* 速度(可达每秒 10,000 次写入)
* 可靠性(使用 Raft 实现分布式)
Etcd 是 Kubernetes 和许多其他技术的默认的内置数据存储方案。也就是说,它很少独立运行或作为单独的服务运行;相反,它以集成到 Kubernetes、OKD/OpenShift 或其他服务中的形式来运作。还有一个 [etcd Operator][35] 可以用来管理其生命周期并解锁其 API 管理功能:
你可以在 [etcd 文档][36]中了解更多信息,并在 [GitHub][16]上访问其源码。
#### CRI-O
CRI-O 是 Kubernetes 运行时接口的 OCI 兼容实现。CRI-O 用于各种功能,包括:
* 使用 runc或遵从 OCI 运行时规范的任何实现)和 OCI 运行时工具运行
* 使用容器/镜像进行镜像管理
* 使用容器/存储来存储和管理镜像层
* 通过容器网络接口CNI来提供网络支持
CRI-O 提供了大量的[文档][37],包括指南、教程、文章,甚至播客,你还可以访问其 [GitHub 页面][17]。
我错过了其他有趣且开源的云原生项目吗?请在评论中提醒我。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/8/cloud-native-projects
作者:[Bryant Son][a]
选题:[lujun9972][b]
译者:[messon007](https://github.com/messon007)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/brsonhttps://opensource.com/users/marcobravo
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e (clouds in the sky with blue pattern)
[2]: https://opensource.com/article/18/7/what-are-cloud-native-apps
[3]: https://thenewstack.io/10-key-attributes-of-cloud-native-applications/
[4]: https://www.cncf.io
[5]: https://opensource.com/sites/default/files/uploads/cncf_1.jpg (Cloud-Native Computing Foundation applications ecosystem)
[6]: https://www.opencontainers.org
[7]: https://opensource.com/sites/default/files/uploads/cncf_2.jpg (CNCF project maturity levels)
[8]: https://github.com/cncf/toc/blob/master/process/graduation_criteria.adoc
[9]: https://github.com/kubernetes/kubernetes
[10]: https://github.com/prometheus/prometheus
[11]: https://github.com/envoyproxy/envoy
[12]: https://github.com/rkt/rkt
[13]: https://github.com/jaegertracing/jaeger
[14]: https://github.com/linkerd/linkerd
[15]: https://github.com/helm/helm
[16]: https://github.com/etcd-io/etcd
[17]: https://github.com/cri-o/cri-o
[18]: https://www.okd.io/
[19]: https://www.openshift.com
[20]: https://kubernetes.io/docs/home
[21]: https://opensource.com/sites/default/files/uploads/cncf_3.jpg (Prometheus architecture)
[22]: https://grafana.com
[23]: https://prometheus.io/docs/introduction/overview
[24]: https://linkerd.io/
[25]: https://istio.io/
[26]: https://istio.io/docs/reference/config/networking/v1alpha3/sidecar
[27]: https://istio.io/docs/reference/config/policy-and-telemetry
[28]: https://www.envoyproxy.io/docs/envoy/latest
[29]: https://podman.io
[30]: https://coreos.com/rkt/docs/latest
[31]: https://www.jaegertracing.io/docs/1.13
[32]: https://linkerd.io/2/overview
[33]: https://coreos.com/operators
[34]: https://helm.sh/docs
[35]: https://github.com/coreos/etcd-operator
[36]: https://etcd.io/docs/v3.3.12
[37]: https://github.com/cri-o/cri-o/blob/master/awesome.md

View File

@@ -0,0 +1,155 @@
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12152-1.html)
[#]: subject: (How to make a Halloween lantern with Inkscape)
[#]: via: (https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape)
[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake)
如何使用 Inkscape 制作万圣节灯笼
======
> 使用开源软件为你最喜欢的万圣节鬼屋制作一个有趣和怪异的装饰品。
![万圣节 - 背光飞行的蝙蝠][1]
使用开源软件装饰一个独一无二的万圣节灯笼!
通常,灯笼的一部分结构体是不透明的,以阻挡内部的光线。灯笼之所以成为灯笼,是因为其去掉了一些东西 :从结构体上切开的窗口,这样光线就可以射出。虽然对于照明来说不实用,但是一个有着怪异形状窗口和隐藏暗色轮廓的灯笼却可以令人兴奋,并创造出很多乐趣。
这篇演示如何使用 [Inkscape][2] 创建你自己的灯笼。如果还没有 Inkscape ,在 Linux 上,你可以从软件库中安装它,在 MacOS 和 Windows 上,你可以从[Inkscape 网站][3] 上下载它.
### 使用材料
* 模板([A4][4] 或[信纸][5]大小)
* 卡片纸(黑色是传统色)
* 描图纸(可选)
* 裁纸刀、尺子、切割垫板(可使用工艺切割机/激光切割机代替)
* 工艺胶
* LED 茶灯"蜡烛"
安全注意事项:这个项目只使用电池操作的蜡烛。
### 理解模板
首先从上面的链接下载你所在区域A4 或信纸)的合适的模板,然后在 Inkscape 中打开它。
![灯笼模板荧光屏][6]
灰白色的棋盘格背景是透明的(从技术角度来说,它是 alpha 通道。)
黑色基板构成了灯笼。现在,没有窗口可以让光线穿过;灯笼有一个非镂空的黑色基板。你将在 Inkscape 中使用**并集**和**差集**选项来数字化的设计窗口。
蓝色虚线表示折线。橙色实线表示参考线。采光窗口不应该放在橙色盒子的外面。
模板的左侧是你可以在你设计中使用的一些预先制作好的对象。
### 创建一个窗口或形状
1. 创建一个看起来像你想要的窗口样式的对象。可以使用 Inkscape 左侧工具栏中的一些形状工具来创建对象。此外,你可以下载共创或公共领域的剪贴画,并导入 PNG 文件到你的项目中。
2. 当你对对象的形状满意时,在顶部菜单中选择“路径” -> “对象转化成路径” 将其转换为一个路径而不是一个形状Inkscape 视其为两种不同的对象)。
![对象到路径 菜单][7]
3. 在基板形状的上面放置对象。
4. 选择对象和黑色基板。通过先单击一个,并按住 `Shift` 按键,再选择另一个来完成。
5. 从顶部菜单选择“路径” -> “差集” 来从基板的对象中移除形状。这将创建灯笼中的一个窗口。
![路径 > 差集 菜单][8]
### 添加对象到窗口中
在制作了一个窗口后,你可以添加对象到其中来创建一个场景。
提示:
* 所有的对象,包括文本,必须连接到灯笼的基板,否则,在切割后会掉落下来,并留下一片空白。
* 避免小而复杂的细微之处。即使使用激光切割机或工艺切割机等机器,也很难切割这些细微之处。
1. 创建或导入一个对象。
2. 放置对象到窗口内,以便它至少接触基板的两侧。
3. 选择对象后,从顶部菜单选择“连接” -> “对象转化成路径”。
![对象到路径 菜单][9]
4. 选择对象和黑色基板,通过在按住 `Shift` 按键的同时单击每一个来完成。
5. 选择“路径” -> “并集”来使对象和基板合二为一。
### 添加文本
文本既可以从基板剪出文字来创建一个窗口(就像我对星星所做的那样),或者也可以添加到一个窗口上(它可以阻挡来自灯笼内部的光线)。如果你要创建一个窗口,只需要执行下面的步骤 1 和步骤 2然后使用“差集”来从基板移除文本。
1. 从左侧边栏中选择文本工具来创建文本。粗体字体效果最好。
![文本工具][10]
2. 选择你的文本,然后从顶部菜单选择“路径” -> “对象转化成路径”。这将转换文本对象为一个路径。注意,这个步骤意味着你将不能再编辑该文本,所以,*只有当*你确定你拥有想要的单词后,执行这个步骤。
3. 在你转换文本后,你可以按键盘上的 `F2` 来激活节点编辑器工具,当选择使用这个工具时,可以清楚地显示文本的节点。
![选中的文本使用节点编辑器][11]
4. 取消文本分组。
5. 调整每个字母,以便使其与相邻字母或基板稍微重叠。
![重叠文本][12]
6. 为将所有的字母彼此连接,并连接到基板,重新选择所有文本和基板,然后选择“路径” -> “并集”。
![使用 路径 > 并集 连接字母和基板][13]
### 准备打印
下面是手工切割灯笼的说明。如果使用激光切割机或工艺切割机,遵循硬件所需要的技巧来准备好你的文件。
1. 在“图层”面板中,单击“安全”图层旁边的“眼睛”图标来隐藏安全线。如果你看不到图层面板,通过顶部菜单选择“图层” -> “图层”来显示它。
2. 选择黑色基板。在“填充和笔划”面板中设置填充为“X”意味着*不填充*),设置“笔划”为纯黑色(对于喜欢十六进制的粉丝来说是 `#000000ff` )。
![设置填充和笔划][14]
3. 使用“文件” -> “打印”来打印你的图案。
4. 使用一把工艺刀和直尺,小心地绕着每一条黑线切割。在蓝色虚线上轻划,然后折叠。
![裁剪灯笼][15]
5. 要完成窗口的制作,剪切描图纸为每个窗口的大小,然后粘贴它到灯笼的内侧。
![添加描图纸][16]
6. 在折条处把灯笼的边粘在一起。
7. 接通电池供电的 LED 蜡烛,并放置它到你灯笼中。
![完成灯笼][17]
现在你的灯笼已经完成了,准备好点亮你的鬼屋了。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape
作者:[Jess Weichler][a]
选题:[lujun9972][b]
译者:[robsean](https://github.com/robsean)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/cyanide-cupcake
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/halloween_bag_bat_diy.jpg?itok=24M0lX25 (Halloween - backlit bat flying)
[2]: https://opensource.com/article/18/1/inkscape-absolute-beginners
[3]: http://inkscape.org
[4]: https://www.dropbox.com/s/75qzjilg5ak2oj1/papercraft_lantern_A4_template.svg?dl=0
[5]: https://www.dropbox.com/s/8fswdge49jwx91n/papercraft_lantern_letter_template%20.svg?dl=0
[6]: https://opensource.com/sites/default/files/uploads/lanterntemplate_screen.png (Lantern template screen)
[7]: https://opensource.com/sites/default/files/uploads/lantern1.png (Object to path menu)
[8]: https://opensource.com/sites/default/files/uploads/lantern2.png (Object > Difference menu)
[9]: https://opensource.com/sites/default/files/uploads/lantern3.png (Object to path menu)
[10]: https://opensource.com/sites/default/files/uploads/lantern4.png (Text tool)
[11]: https://opensource.com/sites/default/files/uploads/lantern5.png (Text selected with Node editor)
[12]: https://opensource.com/sites/default/files/uploads/lantern6.png (Overlapping the text)
[13]: https://opensource.com/sites/default/files/uploads/lantern7.png (Connecting letters and base with Path > Union)
[14]: https://opensource.com/sites/default/files/uploads/lantern8.png (Setting fill and stroke)
[15]: https://opensource.com/sites/default/files/uploads/lantern9.jpg (Cutting out the lantern)
[16]: https://opensource.com/sites/default/files/uploads/lantern10.jpg (Adding tracing paper)
[17]: https://opensource.com/sites/default/files/uploads/lantern11.jpg (Completed lantern)

View File

@@ -1,30 +1,30 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12123-1.html)
[#]: subject: (Relive Linux history with the ROX desktop)
[#]: via: (https://opensource.com/article/19/12/linux-rox-desktop)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
用 ROX 桌面重温 Linux 历史
用 ROX 桌面重温 Linux 历史
======
> 这篇文章是 Linux 桌面 24 天特别系列的一部分。如果你想来一次有趣的时光之旅ROX 桌面非常值得一试。
![Person typing on a 1980's computer][1]
![](https://img.linux.net.cn/data/attachment/album/202004/18/151533n196wag64gwhs0ga.jpg)
[ROX][2] 桌面已经不再积极开发,而它的遗留问题至今仍然存在,即使在它活跃开发的时候,它也是一个另类的 Linux 桌面。当其他的桌面感觉与旧的 Unix 或 Windows 界面大致相似时ROX 则属于 BeOS、AmigaOS 和 [RISC OS][3] 桌面阵营。
[ROX][2] 桌面已经不再积极开发,而它的遗留问题至今仍然存在,即使在它活跃开发的时候,它也是一个另类的 Linux 桌面。当其他的桌面感觉与旧的 Unix 或 Windows 界面大致相似时ROX 则属于 BeOS、AmigaOS 和 [RISC OS][3] 桌面阵营。
它专注于拖放式操作(这使得它的可访问性对某些用户来说并不理想)、点击式操作、弹出式上下文菜单,以及一个独特的应用程序目录系统,无需安装即可运行本地应用程序。
### 安装 ROX
如今ROX 基本上都被遗弃了,只剩下一点残渣碎片留给用户自己去收集整理。幸运的是,这个难题相对来说比较容易解决,但是当你在发行版的软件仓库中找到 ROX 桌面的碎片时,不要被迷惑了,因为那并不是 ROX 桌面所有的碎片。ROX 常用的部分 —— 文件管理器([ROX-Filer][4])和终端([ROXTerm][5] —— 似乎在大多数流行的发行版软件仓库中都有存在,你可以将它们作为独立的应用程序安装(使用)。然而,要运行 ROX 桌面,你必须同时安装 ROX-Session 和它所依赖的库。
如今ROX 基本上都被遗弃了,只剩下一点残渣碎片留给用户自己去收集整理。幸运的是,这个难题相对来说比较容易解决,但是当你在发行版的软件仓库中找到 ROX 桌面的碎片时,不要被迷惑了,因为那并不是 ROX 桌面全部的碎片。ROX 常用的部分 —— 文件管理器([ROX-Filer][4])和终端([ROXTerm][5] —— 似乎在大多数流行的发行版软件仓库中都有存在,你可以将它们作为独立的应用程序安装(使用)。然而,要运行 ROX 桌面,你必须同时安装 ROX-Session 和它所依赖的库。
我在 Slackware 14.2 上安装了 ROX但它应该可以在任何 Linux 或 BSD 系统上运行。
首先,你必须从其版本库中安装 [ROX-lib2][6]。按照它的理念,你要安装 ROX-lib2只需下载tarball、[解压][7],然后将 `ROX-lib` 目录移动到 `/usr/local/lib` 下。
首先,你必须从其版本库中安装 [ROX-lib2][6]。你要安装 ROX-lib2按照它的理念,只需下载tarball、[解压][7],然后将 `ROX-lib` 目录移动到 `/usr/local/lib`就行
接下来,你要安装 [ROX-Session][8]。这可能需要从源码中编译,因为它很可能不在你的软件仓库中。编译过程需要编译工具,这些工具在 Slackware 上是默认提供的,但在其他发行版中往往会被省略,以节省初始下载空间。根据你的发行版不同,你必须安装的包的名称也不同,所以请参考文档来了解具体内容。例如,在 Debian 发行版中,你可以在 [Debian 的 wiki][9] 中了解构建需求,而在 Fedora 发行版中,请参考 [Fedora 的文档][10]。安装了构建工具后,执行自定义的 ROX-Session 构建脚本。
@@ -36,7 +36,7 @@ $ ./AppRun
如果你还没有从你的软件库中安装 ROX-Filer请在继续之前安装。
这些组件共同组成了一个完整的 ROX 桌面。要登录到新桌面请从当前桌面会话中注销。默认情况下你的会话管理器KDM、GDM、LightDM 或 XDM视你的设置而定会继续登录到之前的桌面,所以在登录前必须覆盖。
这些组件共同组成了一个完整的 ROX 桌面。要登录到新桌面请从当前桌面会话中注销。默认情况下你的会话管理器KDM、GDM、LightDM 或 XDM视你的设置而定会继续登录到之前的桌面,所以在登录前必须覆盖。
使用 SDDM
@@ -46,9 +46,9 @@ $ ./AppRun
![][12]
### ROX桌面特性
### ROX 桌面特性
ROX 桌面默认情况下很简单,屏幕底部有一个面板,桌面上有一个通往主目录的快捷方式图标。面板中包含了一些常用位置的快捷方式。这就是 ROX 桌面的全部功能,至少在安装后就是这样。如果你想要时钟日历或系统托盘,你需要找到提供这些功能的应用程序。
ROX 桌面默认情况下很简单,屏幕底部有一个面板,桌面上有一个通往主目录的快捷方式图标。面板中包含了一些常用位置的快捷方式。这就是 ROX 桌面的全部功能,至少在安装后就是这样。如果你想要时钟日历或系统托盘,你需要找到提供这些功能的应用程序。
![Default ROX desktop][13]
@@ -56,7 +56,7 @@ ROX 桌面默认情况下很简单,屏幕底部有一个面板,桌面上有
面板也可以进行一些修改。你可以在其中放置不同的快捷方式,甚至可以创建自己的小程序。
没有应用菜单,也没有上下文菜单中的应用快捷方式。相反,你可以手动导航到 `/usr/share/applications`,或者你可以将你的应用目录或目录添加到 ROX 面板中。
没有应用菜单,也没有上下文菜单中的应用快捷方式。相反,你可以手动导航到 `/usr/share/applications`,或者你可以将你的应用目录或目录添加到 ROX 面板中。
![ROX desktop][14]
@@ -64,9 +64,9 @@ ROX 桌面的工作流程集中在鼠标驱动上,让人联想到 Mac OS 7.5
### 应用程序目录、AppRun 和 AppImage
ROX 桌面有一个优雅的惯例,在这个惯例,包含一个名为 `AppRun` 的脚本的目录就可以像一个应用程序一样被执行。这意味着,要制作一个 ROX 应用程序,你所要做的就是将代码编译到一个目录中,将一个名为`AppRun` 的脚本放在该目录的根目录下执行你所编译的二进制文件然后将该目录标记为可执行。ROX-Filer 会按照你设置的方式来显示一个目录并以特殊的图标和颜色显示一个目录。当你点击一个应用程序目录ROX-Filer 会自动运行里面的 `AppRun` 脚本。它的外观和行为就像一个已经安装好的应用程序,但它是在用户的主目录下的本地目录,不需要特殊的权限。
ROX 桌面有一个优雅的惯例,按照此惯例,包含一个名为 `AppRun` 的脚本的目录就可以像一个应用程序一样被执行。这意味着,要制作一个 ROX 应用程序,你所要做的就是将代码编译到一个目录中,将一个名为`AppRun` 的脚本放在该目录的根目录下,执行你所编译的二进制文件,然后将该目录标记为可执行即可。ROX-Filer 会按照你设置的方式来显示一个目录并以特殊的图标和颜色显示一个目录。当你点击一个应用程序目录ROX-Filer 会自动运行里面的 `AppRun` 脚本。它的外观和行为就像一个已经安装好的应用程序,但它是在用户的主目录下的本地目录,不需要特殊的权限。
这是一个方便的功能,但它是那些你使用时感觉很好的小功能之一,因为它很容易做到。它绝不是必要的,它只是比在本地建立一个应用程序,将目录隐藏在某个不显眼的地方,并建立一个快速的 `.desktop` 文件作为你的启动器,要领先了几步。然而,应用程序目录的概念已经当做灵感被 [AppImage][16] 打包系统所 [借鉴][15]
这是一个方便的功能,但它是那些你使用时感觉很好的小功能之一,因为它很容易做到。它绝不是必要的,它只是比在本地建立一个应用程序,将目录隐藏在某个不显眼的地方,并建立一个快速的 `.desktop` 文件作为你的启动器,要领先了几步。然而,应用程序目录的概念已经当做灵感被 [AppImage][16] 打包系统所 [借鉴][15]。
### 为什么应该试试 ROX 桌面
@@ -79,7 +79,7 @@ via: https://opensource.com/article/19/12/linux-rox-desktop
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12127-1.html)
[#]: subject: (Navigating man pages in Linux)
[#]: via: (https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
@@ -12,11 +12,11 @@
> Linux 系统上的手册页可以做的不仅仅是提供特定命令的信息。它们可以帮助你发现你没有意识到的命令。
[Hello I'm Nik][1] [(CC0)][2]
![Hello I'm Nik][1]
手册页提供了关于 Linux 命令的基本信息,很多用户经常参考它,但手册页的内容比我们很多人意识到的要多得多。
你总是可以输入一个像 `man who` 这样的命令,然后得到 `who` 命令的工作原理的漂亮描述,但是探索你可能不知道的命令可能会更有启发。例如,你可以使用 `man` 命令来帮助确定处理一些非常具有挑战性的任务的命令,或者显示一些选项,这些选项可以帮助你以新的更好的方式使用你已经知道的命令。
你总是可以输入一个像 `man who` 这样的命令,然后得到 `who` 命令的工作原理的漂亮描述,但是探索你可能不知道的命令可能会更有启发。例如,你可以使用 `man` 命令来帮助找到一些处理非常具有挑战性的任务的命令,或者显示一些选项,这些选项可以帮助你以新的更好的方式使用你已经知道的命令。
让我们来浏览一些选项,看看最终的结果是什么。
@@ -41,11 +41,11 @@ useradd (8) - create a new user or update default new user information
zshroadmap (1) - informal introduction to the zsh manual The Zsh Manual, …
```
需要说明的是,上面的第三项只是提到 “new users” 类似的内容,并不是设置、删除或配置用户账号的命令。`man` 命令只是在命令描述中匹配了一些词,作用很像 `apropos` 命令。注意上面列出的每个命令后面的括号中的数字。这些数字与包含这些命令的手册页的分有关。
需要说明的是,上面的第三项只是提到 “new users” 类似的内容,并不是设置、删除或配置用户账号的命令。`man` 命令只是在命令描述中匹配了一些词,作用很像 `apropos` 命令。注意上面列出的每个命令后面的括号中的数字。这些数字与包含这些命令的手册页的分有关。
### 确定手册页的
### 确定手册页的分
`man` 命令部分将命令划分为不同的类别。要列出这些类别,请键入 `man man`,并查看类似下面的描述。你的系统中很可能没有第 9 分的命令。
`man` 命令的分区将其内容划分为不同的类别。要列出这些类别,请键入 `man man`,并查看类似下面的描述。你的系统中很可能没有第 9 分的命令。
- `1`:可执行程序或 shell 命令
- `2`:系统调用(内核提供的函数)
@@ -59,7 +59,7 @@ zshroadmap (1) - informal introduction to the zsh manual The Zsh Manual,
手册页涵盖了比我们通常认为的“命令”更多的内容。从上面的描述中可以看到,它们涵盖了系统调用、库调用、特殊文件等等。
下面的列表显示了 Linux 系统中的手册页的实际存储位置。这些目录上的日期会有所不同,因为随着更新,其中一些分会有新的内容,而另一些则不会。
下面的列表显示了 Linux 系统中的手册页的实际存储位置。这些目录上的日期会有所不同,因为随着更新,其中一些分会有新的内容,而另一些则不会。
```
$ ls -ld /usr/share/man/man?
@@ -89,13 +89,13 @@ lrwxrwxrwx 1 root root 9 Sep 5 06:38 [.1.gz -> test.1.gz
-rw-r--r-- 1 root root 2378 Aug 23 2018 ac.1.gz
```
### 按分列出的手册页
### 按分列出的手册页
即使只看第 1 分的前 10 个手册页(如上所示),你也可能会看到一些新的命令 —— 也许是 `a2query``aaflip`(如上所示)。
即使只看第 1 分的前 10 个手册页(如上所示),你也可能会看到一些新的命令 —— 也许是 `a2query``aaflip`(如上所示)。
探索命令的更好策略是按列出命令,不查看文件本身,而是使用 `man` 命令向你显示命令并提供每个命令的简要说明。
探索命令的更好策略是按分区列出命令,不查看文件本身,而是使用 `man` 命令向你显示命令并提供每个命令的简要说明。
在下面的命令中,`-s 1` 指示 `man` 显示第 1 分中的命令信息。`-k .` 使该命令对所有命令都有效,而不是指定一个特定的关键字;如果没有这个,`man` 命令就会回过头来问:“你想要什么手册页?”所以,使用关键字来选择一组相关的命令,或者使用点来显示一个分中的所有命令。
在下面的命令中,`-s 1` 指示 `man` 显示第 1 分中的命令信息。`-k .` 使该命令对所有命令都有效,而不是指定一个特定的关键字;如果没有这个,`man` 命令就会回过头来问:“你想要什么手册页?”所以,使用关键字来选择一组相关的命令,或者使用点来显示一个分中的所有命令。
```
$ man -s 1 -k .
@@ -111,9 +111,9 @@ enchant (1) - a spellchecker
```
### 有几本手册页?
### 有多少手册页?
如果你对每个分中有多少手册页感到好奇,可以使用以下命令按分对它们进行计数:
如果你对每个分中有多少手册页感到好奇,可以使用以下命令按分对它们进行计数:
```
$ for num in {1..8}
@@ -158,13 +158,13 @@ via: https://www.networkworld.com/article/3519853/navigating-man-pages-in-linux.
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://unsplash.com/photos/YiRQIglwYig
[1]: https://images.idgesg.net/images/article/2019/10/field-note_play-book_playbook_map_navigation_journey_by-hello-i-m-nik-via-unsplash-100813507-large.jpg
[2]: https://creativecommons.org/publicdomain/zero/1.0/
[3]: https://www.networkworld.com/slideshow/153439/linux-best-desktop-distros-for-newbies.html#tk.nww-infsb
[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)

View File

@@ -0,0 +1,173 @@
[#]: collector: (lujun9972)
[#]: translator: (lxbwolf)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12156-1.html)
[#]: subject: (Manage complex Git workspaces with Great Teeming Workspaces)
[#]: via: (https://opensource.com/article/20/2/git-great-teeming-workspaces)
[#]: author: (Daniel Gryniewicz https://opensource.com/users/dang)
使用 GTWS 管理复杂的 Git 工作空间
======
> GTWS 是一系列脚本,它使我们在开发环境中管理不同的项目和项目的各个版本变得很容易。
![](https://img.linux.net.cn/data/attachment/album/202004/27/182149xh9s7kb5bkf5875b.jpg)
[Great Teeming Workspaces][2]GTWS是一个 Git 的复杂工作空间管理工具包,它使我们在开发环境中管理不同的项目和项目的各个版本变得很容易。
有点像 Python 的 [venv][3],但不是为 Python 语言准备的。GTWS 用来管理多个项目的多个版本的工作空间。你可以很容易地创建、更新、进入和离开工作空间,每个项目或版本的组合(最多)有一个本地的 origin用来与 upstream 同步 — 其余的所有工作空间都从本地的 origin 更新。
### 部署
```
${GTWS_ORIGIN}/<project>/<repo>[/<version>]
${GTWS_BASE_SRCDIR}/<project>/<version>/<workspacename>/{<repo>[,<repo>...]}
```
源代码目录的每一级(包括全局的家目录)可以包含一个 `.gtwsrc` 文件,这个文件中维护与当前级相关的设置和 bash 代码。每一级的配置会覆盖上一级。
### 安装
用下面的命令检出 GTWS
```
git clone https://github.com/dang/gtws.git
```
配置你的 `${HOME}/.gtwsrc`。它应该包含 `GTWS_ORIGIN`,也可以再包含 `GTWS_SETPROMPT`
把仓库目录加到环境变量中:
```
export PATH="${PATH}:/path/to/gtws
```
### 配置
通过级联 `.gtwsrc` 文件来进行配置。它从根目录向下遍历,会执行在每级目录中找到的 `.gtwsrc` 文件。下级目录的文件会覆盖上一级。
在你最上层的文件 `~/.gtws/.gtwsrc` 中进行如下设置:
* `GTWS_BASE_SRCDIR`:所有项目源文件目录树的基目录。默认为 `$HOME/src`
* `GTWS_ORIGIN` 指定 origin git 目录树的路径。默认为 `$HOME/origin`
* `GTWS_SETPROMPT` 可选配置。如果配置了这个参数shell 提示符会有工作空间的名字。
* `GTWS_DEFAULT_PROJECT` 不指定项目或项目未知时默认的项目名。如果不指定,使用命令行时必须指明项目。
* `GTWS_DEFAULT_PROJECT_VERSION` 检出的默认版本。默认为 `master`
在每个项目的根目录进行以下设置:
* `GTWS_PROJECT` 项目的名字(和基目录)。
* `gtws_project_clone` 这个函数用于克隆一个项目的指定版本。如果未定义,它会假定项目的 origin 对每一个版本都有一个单独的目录,这样会导致克隆一堆 Git 仓库。
* `gtws_project_setup` 在克隆完所有的仓库后,可以选择是否调用这个函数,调用后可以对项目进行必要的配置,如在 IDE 中配置工作空间。
在项目版本级进行以下设置:
* `GTWS_PROJECT_VERSION` 项目的版本。用于正确地从 origin 拉取代码。类似 Git 中的分支名字。
下面这些参数可以在目录树的任意地方进行配置,如果能生效,它们可以被重写多次:
* `GTWS_PATH_EXTRA` 这些是工作空间中加到路径后的额外的路径元素。
* `GTWS_FILES_EXTRA` 这些是不在版本控制内,但应该在工作空间中被检出的额外的文件。这些文件包括 `.git/info/exclude`,每个文件都与仓库的基目录相关联。
### origin 目录
`GTWS_ORIGIN` (大部分脚本中)指向拉取和推送的原始 Git 检出目录。
`${GTWS_ORIGIN}` 部署:
* `/<project>`
* 这是一个项目的仓库的基目录。
* 如果指定了 `gtws_project_clone`,你可以配置任意的部署路径。
* 如果没有指定 `gtws_project_clone`,这个路径下必须有个名为 `git` 的子目录,且 `git` 目录下有一系列用来克隆的裸 Git 仓库。
### 工作流示例
假设你有一个项目名为 `Foo`,它的 upstream 为 `github.com/foo/foo.git`。这个仓库有个名为 `bar` 的子模块,它的 upstream 是 `github.com/bar/bar.git`。Foo 项目在 master 分支开发,使用稳定版本的分支。
为了能在 Foo 中使用 GTWS你首先要配置目录结构。本例中假设你使用默认的目录结构。
* 配置你最上层的 `.gtwsrc`
* `cp ${GTWS_LOC}/examples/gtwsrc.top ~/.gtwsrc`
* 根据需要修改 `~/.gtwsrc`
* 创建顶级目录:
* `mkdir -p ~/origin ~/src`
* 创建并配置项目目录:
* `mkdir -p ~/src/foo`
`cp ${GTWS_LOC}/examples/gtwsrc.project ~/src/foo/.gtwsrc`
* 根据需要修改 `~/src/foo/.gtwsrc`
* 创建并配置 master 版本目录:
* `mkdir -p ~/src/foo/master`
`cp ${GTWS_LOC}/examples/gtwsrc.version ~/src/foo/master/.gtwsrc`
* 根据需要修改 `~/src/foo/master/.gtwsrc`
* 进入版本目录并创建一个临时工作空间来配置镜像:
* `mkdir -p ~/src/foo/master/tmp`
`cd ~/src/foo/master/tmp`
`git clone --recurse-submodules git://github.com/foo/foo.git`
`cd foo`
`gtws-mirror -o ~/origin -p foo`(译注:这个地方原文有误,不加 `-s` 参数会报错)
* 上面命令会创建 `~/origin/foo/git/foo.git``~/origin/foo/submodule/bar.git`
* 以后的克隆操作会从这些 origin 而不是 upstream 克隆。
* 现在可以删除工作空间了。
到现在为止Foo 的 master 分支的工作可以结束了。假设你现在想修复一个 bug名为 `bug1234`。你可以脱离你当前的工作空间为修复这个 bug 单独创建一个工作空间,之后在新创建的工作空间中开发。
* 进入版本目录,创建一个新的工作空间:
* `cd ~/src/foo/master`
`mkws bug1234`
* 上面的命令创建了 `bug1234/`,在这个目录下检出了 Foo和它的子模块 `bar`),并创建了 `build/foo` 来构建它。
* 有两种方式进入工作空间:
* `cd ~/src/foo/master/bug1234`
`startws`
或者
`cd ~/src/foo/master/`
`startws bug1234`
* 上面的命令在 `bug1234` 工作空间中开启了一个子 shell。这个 shell 有 GTWS 的环境和你在各级 `.gtwsrc` 文件中设置的环境。它也把你工作空间的基目录加入到了 CD因此你可以从 base 路径 `cd` 到相关的目录中。
* 现在你可以修复 `bug1234` 了,构建、测试、提交你的修改。当你可以把代码推送到 upstream 时,执行下面的命令:
`cd foo`
`wspush` 
* `wspush` 会把代码推送到与你工作空间相关的分支 — 先推送到本地的 origin再推送到 upstream。
* 当 upstream 有修改时,你可以用下面的命令同步到本地:
`git sync`
* 上面的命令调用了 GTWS 的 `git-sync` 脚本,会从本地 origin 更新代码。使用下面的命令来更新本地的 origin
`git sync -o` 
* 上面的命令会更新你本地的 origin 和子模块的镜像,然后用那些命令来更新你的检出仓库的代码。`git-sync` 也有一些其他的很好的工鞥。
* 当要结束工作空间中的工作时,直接退出 shell
`exit`
* 你可以在任何时间重复进入工作空间,也可以在同一时间在相同的工作空间中开多个 shell。
* 当你不需要某个工作空间时,你可以使用 `rmws` 来删除它,或者直接删除它的目录树。
* 还有一个脚本 `tmws` 使用 tmux 进入工作空间,能创建一系列的窗口/窗格,这完美契合我的工作流。你可以根据你自己的需求来修改它。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/git-great-teeming-workspaces
作者:[Daniel Gryniewicz][a]
选题:[lujun9972][b]
译者:[lxbwolf](https://github.com/lxbwolf)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/dang
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
[2]: https://github.com/dang/gtws
[3]: https://docs.python.org/3/library/venv.html

View File

@@ -0,0 +1,117 @@
[#]: collector: (lujun9972)
[#]: translator: (lxbwolf)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12130-1.html)
[#]: subject: (Getting started with Linux firewalls)
[#]: via: (https://opensource.com/article/20/2/firewall-cheat-sheet)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Linux 防火墙入门教程
======
> 防火墙是你的计算机防止网络入侵的第一道屏障。为确保你的安全,请下载我们的备忘单。
![](https://img.linux.net.cn/data/attachment/album/202004/20/104205paugcytauqctqw6c.jpg)
合理的防火墙是你的计算机防止网络入侵的第一道屏障。你在家里上网,通常互联网服务提供会在路由中搭建一层防火墙。当你离开家时,那么你计算机上的那层防火墙就是仅有的一层,所以配置和控制好你 Linux 电脑上的防火墙很重要。如果你维护一台 Linux 服务器,那么知道怎么去管理你的防火墙同样重要,只要掌握了这些知识你才能保护你的服务器免于本地或远程非法流量的入侵。
### 安装防火墙
很多 Linux 发行版本已经自带了防火墙,通常是 `iptables`。它很强大并可以自定义,但配置起来有点复杂。幸运的是,有开发者写出了一些前端程序来帮助用户控制防火墙,而不需要写冗长的 iptables 规则。
在 Fedora、CentOS、Red Hat 和一些类似的发行版本上,默认安装的防火墙软件是 `firewalld`,通过 `firewall-cmd` 命令来配置和控制。在 Debian 和大部分其他发行版上,可以从你的软件仓库安装 firewalld。Ubuntu 自带的是<ruby>简单防火墙<rt>Uncomplicated Firewall</rt></ruby>ufw所以要使用 firewalld你必须启用 `universe` 软件仓库:
```
$ sudo add-apt-repository universe
$ sudo apt install firewalld
```
你还需要停用 ufw
```
$ sudo systemctl disable ufw
```
没有理由*不用* ufw。它是一个强大的防火墙前端。然而本文重点讲 firewalld因为大部分发行版都支持它而且它集成到了 systemdsystemd 是几乎所有发行版都自带的。
不管你的发行版是哪个,都要先激活防火墙才能让它生效,而且需要在启动时加载:
```
$ sudo systemctl enable --now firewalld
```
### 理解防火墙的域
Firewalld 旨在让防火墙的配置工作尽可能简单。它通过建立<ruby>域<rt>zone</rt></ruby>来实现这个目标。一个域是一组的合理、通用的规则,这些规则适配大部分用户的日常需求。默认情况下有九个域。
* `trusted`:接受所有的连接。这是最不偏执的防火墙设置,只能用在一个完全信任的环境中,如测试实验室或网络中相互都认识的家庭网络中。
* `home``work``internal`:在这三个域中,接受大部分进来的连接。它们各自排除了预期不活跃的端口进来的流量。这三个都适合用于家庭环境中,因为在家庭环境中不会出现端口不确定的网络流量,在家庭网络中你一般可以信任其他的用户。
* `public`:用于公共区域内。这是个偏执的设置,当你不信任网络中的其他计算机时使用。只能接收选定的常见和最安全的进入连接。
* `dmz`DMZ 表示隔离区。这个域多用于可公开访问的、位于机构的外部网络、对内网访问受限的计算机。对于个人计算机,它没什么用,但是对某类服务器来说它是个很重要的选项。
* `external`:用于外部网络,会开启伪装(你的私有网络的地址被映射到一个外网 IP 地址,并隐藏起来)。跟 DMZ 类似,仅接受经过选择的传入连接,包括 SSH。
* `block`:仅接收在本系统中初始化的网络连接。接收到的任何网络连接都会被 `icmp-host-prohibited` 信息拒绝。这个一个极度偏执的设置,对于某类服务器或处于不信任或不安全的环境中的个人计算机来说很重要。
* `drop`:接收的所有网络包都被丢弃,没有任何回复。仅能有发送出去的网络连接。比这个设置更极端的办法,唯有关闭 WiFi 和拔掉网线。
你可以查看你发行版本的所有域,或通过配置文件 `/usr/lib/firewalld/zones` 来查看管理员设置。举个例子:下面是 Fefora 31 自带的 `FedoraWorkstation` 域:
```
$ cat /usr/lib/firewalld/zones/FedoraWorkstation.xml
<?xml version="1.0" encoding="utf-8"?>
<zone>
<short>Fedora Workstation</short>
<description>Unsolicited incoming network packets are rejected from port 1 to 1024, except for select network services. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed.</description>
<service name="dhcpv6-client"/>
<service name="ssh"/>
<service name="samba-client"/>
<port protocol="udp" port="1025-65535"/>
<port protocol="tcp" port="1025-65535"/>
</zone>
```
### 获取当前的域
任何时候你都可以通过 `--get-active-zones` 选项来查看你处于哪个域:
```
$ sudo firewall-cmd --get-active-zones
```
输出结果中,会有当前活跃的域的名字和分配给它的网络接口。笔记本电脑上,在默认域中通常意味着你有个 WiFi 卡:
```
FedoraWorkstation
  interfaces: wlp61s0
```
### 修改你当前的域
要更改你的域,请将网络接口重新分配到不同的域。例如,把例子中的 `wlp61s0` 卡修改为 public 域:
```
$ sudo firewall-cmd --change-interface=wlp61s0 --zone=public
```
你可以在任何时候、任何理由改变一个接口的活动域 —— 无论你是要去咖啡馆,觉得需要增加笔记本的安全策略,还是要去上班,需要打开一些端口进入内网,或者其他原因。在你凭记忆学会 `firewall-cmd` 命令之前,你只要记住了关键词 `change``zone`,就可以慢慢掌握,因为按下 `Tab` 时,它的选项会自动补全。
### 更多信息
你可以用你的防火墙干更多的事,比如自定义已存在的域,设置默认域,等等。你对防火墙越了解,你在网上的活动就越安全,所以我们创建了一个[备忘单][2]便于速查和参考。
- 下载你的 [防火墙备忘单][2]。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/firewall-cheat-sheet
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[lxbwolf](https://github.com/lxbwolf)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image)
[2]: https://opensource.com/downloads/firewall-cmd-cheat-sheet

View File

@@ -0,0 +1,227 @@
[#]: collector: (lujun9972)
[#]: translator: (cycoe)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12150-1.html)
[#]: subject: (What you need to know about variables in Emacs)
[#]: via: (https://opensource.com/article/20/3/variables-emacs)
[#]: author: (Clemens Radermacher https://opensource.com/users/clemera)
关于 Emacs 中的变量你需要知道的事情
======
> 学习 Elisp 是如何处理变量的,以及如何在你的脚本与配置中使用它们。
![](https://img.linux.net.cn/data/attachment/album/202004/25/190905pq1qfk1f8f9qs9v8.jpg)
GNU Emacs 是由 C 和 Emacs LispElispLisp 编程语言的一种方言)写成,它是一个编辑器的同时,又碰巧是 Elisp 的沙盒。因此,理解 Elisp 中的一些基本编程概念会对你有一些帮助。
如果你是 [Emacs][2] 新手,请先阅读 Sacha Chua 的《[给 Emacs 新手的资源][3]》精品帖。本篇文章假定你熟悉常见的 Emacs 术语,并且能够阅读并求值 Elisp 代码的简单片段。最好你也听说过变量作用域的概念,知道它在其它编程语言中的作用。本篇文章中的示例假定你使用的是相对较新的 Emacs 版本([v.25 之后的版本][4])。
[Elisp 手册][5] 包含了 Elisp 的方方面面,但它是写给那些有明确查找目标的人们的(它在这方面也做得相当棒)。但是很多人想要能够在更高的层次上解释 Elisp 概念的材料,同时将信息压缩成最精华的部分。本篇文章也正是我回应这种呼声的一次尝试,为读者描绘基础的大体轮廓。使他们能在配置中用上这些技巧,也让他们在手册中查询细节变得更容易。
### 全局变量
`defcustom` 定义的用户设置和用 `defvar``defconst` 定义的变量是全局的。使用 `defcustom``defvar` 声明变量的一个非常重要的原因是,当一个变量已经被<ruby>绑定<rt>bind</rt></ruby>,对它们进行重新求值不会覆盖掉已有的值。举个栗子,如果你在初始化文件中对 `my-var` 进行如下绑定:
```
(setq my-var nil)
```
对如下表达式求值不会将变量覆盖为 `t`
```
(defvar my-var t)
```
注意此处有*一个例外*:如果你用 `C-M-x` 快捷键对上述声明求值,它将调用 `eval-defun` 函数,并将变量覆盖为 `t`。通过此方式你可以按需将变量强制覆盖。这种行为是刻意而为之的你可能知道Emacs 中的许多特性是按需加载的,也可以称为自动加载。如果那些文件中的声明将变量覆盖为它们的默认值,那它也就覆盖了你初始化文件中的设置。
### 用户选项
用户选项就是使用 `defcustom` 声明的全局变量。与使用 `defvar` 声明的变量不同,这些变量可以用 `M-x customize` 界面来配置。据我所知,大部分人因为觉得它开销较大而不经常使用。一旦你知道如何在你的初始化文件中设置变量,也就没有理由一定要去使用它了。许多用户没有意识到的一个细节是,通过 `customize` 的方式设置用户选项能够执行代码,有的时间可用来运行一些附加的配置说明:
```
(defcustom my-option t
  "My user option."
  :set (lambda (sym val)
         (set-default sym val)
         (message "Set %s to %s" sym val)))
```
若你对这段代码求值,并键入 `M-x customize-option RET my-option RET` 运行 `customize` 界面lambda 匿名函数就会被调用,回显区域就会显示出该选项的符号名与值。
如果你在初始化文件中使用 `setq` 改变该选项的值,那么匿名函数不会运行。要想在 Elisp 中正确设置一个选项,你需要使用函数 `customize-set-variable`。或者,人们在他们的配置文件中使用了各种版本的 `csetq` 宏来自动处理(如你所愿,你可以通过 GitHub 的代码搜索发现更复杂的变体)。
```
(defmacro csetq (sym val)
  `(funcall (or (get ',sym 'custom-set) 'set-default) ',sym ,val))
```
若你正在使用 [use-package][6] 宏,`:custom` 关键字会替你处理好以上这些。
在你将以上代码放入到你的初始化文件中之后,你便可以使用 `csetq` 宏在设置变量的同时运行任何现存的 `setter` 函数。要证明这点,你可以使用此宏来改变上面定义的选项,并观察回显区域的消息输出。
```
(csetq my-option nil)
```
### 动态绑定与词法绑定
当你在使用其它编程语言时,你可能不会意识到动态绑定与词法绑定的区别。当今的大部分编程语言使用词法绑定,并且在学习变量作用域与变量查找时也没有必要去了解它们之间的区别。
如此看来Emacs Lisp 比较特殊因为动态绑定是默认选项,词法绑定需要显式启用。这里有一些历史遗留原因,但在实际使用中,你应该*时刻*启用词法绑定,因为它更快并且不容易出错。要启用词法绑定,只需将如下的注释行作为你的 Emacs Lisp 文件的第一行:
```
;;; -*- lexical-binding: t; -*-
```
另一种方式,你可以调用 `add-file-local-variable-prop-line`,在你选择将变量 `lexical-binding` 置为 `t` 后,会自动插入如上的注释行。
在加载包含如上特殊格式行的文件时Emacs 会相应地设置变量,这意味着该缓冲区中的代码加载时启用了词法绑定。若要采用交互式的方式,你可以调用 `M-x eval-buffer` 命令,它会将词法绑定考虑在内。
既然你已经知道了如何启用词法绑定,那么了解这些术语的含义就很明智了。对于动态绑定,在程序执行期间建立的最后一个绑定将用于变量查找。你可以通过将以下代码放入空缓冲区并执行 `M-x eval buffer`,以对此进行测试:
```
(defun a-exists-only-in-my-body (a)
  (other-function))
(defun other-function ()
  (message "I see `a', its value is %s" a))
(a-exists-only-in-my-body t)
```
你可能会很惊讶地发现,在 `other-function` 中查找变量 `a` 竟然成功了。
若你在顶部添加了特殊的词法绑定注释后,重新运行前面的示例,这段代码将抛出 `variable is void` 错误,因为 `other-functioin` 无法识别变量 `a`。如果你使用的是其它编程语言,这才是你所期望的行为。
启用词法绑定后,作用域会由周围的代码所定义。这并不单单是性能原因,时间也已经表明了词法绑定才是更受喜爱的。
### 特殊变量与动态绑定
如你所知,`let` 用于临时建立局部绑定:
```
(let ((a "I'm a")
      (b "I'm b"))
  (message "Hello, %s. Hello %s" a b))
```
接下来有趣的是——使用 `defcustom``defvar` 以及 `defconst` 定义的变量被称为*特殊变量*,不论词法绑定是否启用,它们都将使用动态绑定:
```
;;; -*- lexical-binding: t; -*-
(defun some-other-function ()
  (message "I see `c', its value is: %s" c))
(defvar c t)
(let ((a "I'm lexically bound")
      (c "I'm special and therefore dynamically bound"))
  (some-other-function)
  (message "I see `a', its values is: %s" a))
```
通过 `C-h e` 切换至 `Messages` 缓冲区,查看上述示例输出的消息。
使用 `let` 或者函数参数绑定的局部变量会遵循由 `lexical-binding` 变量定义的查找规则,但使用 `defvar``defconst``defcustom` 定义的全局变量,能够沿着调用栈在 `let` 表达式中被修改。
这种技巧允许方便地进行特殊定制,并且经常在 Emacs 中被使用。这并不奇怪,毕竟 Emacs Lisp 最开始只提供动态绑定作为唯一选择。下面是一个常见的示例,说明如何向只读缓冲区临时写入数据:
```
(let ((inhibit-read-only t))
  (insert ...))
```
这是另一个常见的示例,如何进行大小写敏感的搜索:
```
(let ((case-fold-search nil))
  (some-function-which-uses-search ...))
```
动态绑定允许你采用作者未曾预料的方式对函数进行修改。对于像 Emacs 这样设计使用的程序来说,这是个强大的工具与特性。
有一点需要注意:你可能会意外地使用局部变量名,该变量在其他地方被声明为特殊变量。防止这种冲突的一个技巧是避免在局部变量名中使用下划线。在我当前的 Emacs 会话中,以下代码只留下少数潜在冲突的候选:
```
(let ((vars ()))
(mapatoms
(lambda (cand)
(when (and (boundp cand)
(not (keywordp cand))
(special-variable-p cand)
(not (string-match "-"
(symbol-name cand))))
(push cand vars))))
vars) ;; => (t obarray noninteractive debugger nil)
```
### 缓冲区局部变量
每个缓冲区都能够拥有变量的一个局部绑定。这就意味着对于任何变量,都会首先在当前缓冲区中查找缓冲区局部变量取代默认值。局部变量是 Emacs 中一个非常重要的特性,比如它们被主模式用来建立缓冲区范围内的行为与设置。
事实上你已经在本文中见过*缓冲区局部变量*——也就是将 `lexical-binding` 在缓冲区范围内设置为 `t` 的特殊注释行。在 Emacs 中,在特殊注释行中定义的缓冲区局部变量也被称为*文件局部变量*。
任何的全局变量都可以用缓冲区局部变量来遮掩,比如上面定义的变量 `my-var`,你可用如下方式设置局部变量:
```
(setq-local my-var t)
;; or (set (make-local-variable 'my-var) t)
```
此时 `my-var` 对于你在对上述代码进行求值时对应的缓冲区来说就是局部变量。若你对它调用 `describe-variable`,文档会同时告诉你局部与全局的值。从编程的角度来讲,你可以分别用 `buffer-local-value` 获取局部值,用 `default-value` 获取全局值。若要移除局部值,你可以调用 `kill-local-variable`
另一个需要注意的重要性质就是,一旦一个变量成为缓冲区局部变量,后续在该缓冲区中使用的 `setq` 都将只能设置局部的值。要想设置默认值,你需要使用 `setq-default`
因为局部变量意味着对缓冲区的定制,它们也就经常被用于模式钩子中。一个典型的例子如下所示:
```
(add-hook 'go-mode-hook
          (defun go-setup+ ()
            (setq-local compile-command
              (if (string-suffix-p "_test.go" buffer-file-name)
                  "go test -v"
                (format "go run %s"
                        (shell-quote-argument
                         (file-name-nondirectory buffer-file-name)))))))
```
这将设置 `go-mode` 缓冲区中 `M-x compile` 使用的编译命令。
另一个重要的方面就是一些变量会*自动*成为缓冲区局部变量。这也就意味着当你使用 `setq` 设置这样一个变量时,它会针对当前缓冲区设置局部绑定。这个特性不应该被经常使用,因为这种隐式的行为并不好。不过如果你想的话,你可以使用如下方法创建自动局部变量:
```
(defvar-local my-automatical-local-var t)
;; or (make-variable-buffer-local 'my-automatical-local-var)
```
变量 `indent-tabs-mode` 就是 Emacs 内建的一个例子。如果你在初始化文件中使用 `setq` 改变变量的值,根本不会影响默认值。只有在你加载初始化文件时正处在当前的缓冲区的局部值会被改变。因此,你需要使用 `setq-default` 来改变 `indent-tabs-mode` 的默认值。
### 结语
Emacs 是一个强大的编辑器,并且随着你的定制它将变得更加强大。现在,你知道了 Elisp 是如何处理变量的,以及你应如何在你自己的脚本与配置中使用它们。
*本篇文章此前采用 CC BY-NC-SA 4.0 许可证发布在 [With-Emacs][7] 上,经过修改(带有合并请求)并在作者允许的情况下重新发布。*
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/variables-emacs
作者:[Clemens Radermacher][a]
选题:[lujun9972][b]
译者:[cycoe](https://github.com/cycoe)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/clemera
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.)
[2]: https://www.gnu.org/software/emacs/
[3]: http://sachachua.com/blog/p/27144
[4]: https://www.gnu.org/software/emacs/download.html
[5]: https://www.gnu.org/software/emacs/manual/html_node/elisp/
[6]: https://github.com/jwiegley/use-package#customizing-variables
[7]: https://with-emacs.com/posts/tutorials/almost-all-you-need-to-know-about-variables/

View File

@@ -0,0 +1,69 @@
[#]: collector: (lujun9972)
[#]: translator: (messon007)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12141-1.html)
[#]: subject: (What is the internet backbone and how it works)
[#]: via: (https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html)
[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/)
什么是互联网骨干网,它是怎样工作的
======
> 一级互联网服务提供商ISP将其高速光纤网络连接在一起形成互联网的骨干网实现在不同地理区域之间高效地传输流量。
![](https://images.idgesg.net/images/article/2018/04/global_network_connections_by_gerd_altmann_cc0_via_pixabay_1200x800-100754306-large.jpg)
互联网会产生大量的计算机到计算机的流量,要确保所有流量都可以在世界上任何地方之间传输,就需要大量汇聚的高速网络,这些网络统称为互联网骨干网,但是它是如何工作的呢?
### 互联网的骨干网是什么?
像任何其他网络一样,互联网由接入链路组成,这些接入链路将流量传输到高带宽路由器,路由器又将流量从源地址通过最佳可用路径传输到目的地址。其核心是由相互连接的、彼此对等的各个高速光纤网络而构成的互联网骨干网。
单个独立的核心网络由一级互联网服务提供商ISP所拥有。他们的网络连接在一起。这些提供商包括 AT&T、CenturyLink、Cogent Communications,、Deutsche Telekom、Global Telecom and Technology (GTT)、NTT Communications、Sprint、Tata Communications,、Telecom Italia Sparkle、Telia Carrier和 Verizon。
通过将这些长途网连接在一起,一级 ISP 们创建了一个他们可以访问整个路由表的单一的全球性网络,因此他们可以通过逐步层次化地增加本地 ISP 网络来有效地将流量传输到其目的地。
除了物理连接之外,这些骨干网提供商还通过一致的网络协议 TCP/IP 融合在一起,这实际上是两个协议,<ruby>传输控制协议<rt>transport control protocol</rt></ruby>和<ruby>互联网协议<rt>internet protocol</rt></ruby>,它们在计算机之间建立连接,以确保连接可靠,并将消息格式化为数据包。
### 互联网交接点IXP将骨干网连接在一起
骨干网 ISP 在中立位置的对等点通过高速交换机和路由器连接其网络。这些通常由第三方(有时是非营利组织)提供,以促进骨干网的统一。
参与的一级 ISP 会帮助资助 IXP但不向其他一级 ISP 收取流量传输费用,这种关系称为无结算对等。这种协议消除了可能导致互联网性能下降的潜在财务纠纷。
### 骨干网有多快?
互联网骨干网由最快的路由器组成,可以提供 100Gbps 的线路速度。这些路由器由包括 Cisco、Extreme、华为、Juniper 和 Nokia 在内的供应商制造使用边界网关协议BGP在彼此之间路由流量。
### 流量是如何进入骨干网的
在 1 级 ISP 之下是规模较小的 2 级和 3 级 ISP。
3 级 ISP 为企业和消费者提供了互联网接入服务。这些提供商自己没有接入互联网骨干网,因此,他们自己无法将其客户连接到数十亿台互联网上的计算机。
购买一级 ISP 提供商的接入非常昂贵。通常 3 级 ISP 与拥有自己网络的 2 级区域ISP 签订合同,利用 2 级 ISP 的网络将流量传输到有限的地理区域,但不能传输到所有互联网上的设备。
为此2 级 ISP 与 1 级 ISP 签约以访问全球骨干网,并以这种方式使客户可以访问整个互联网。
这种方式使得来自世界一侧的计算机的流量能够连接到另一侧的计算机。流量从源计算机流向 3 级 ISP再路由到 2 级 ISP再路由到 1 级骨干网提供商,再路由到正确的 2 级 ISP最后路由到提供该数据的 3 级接入提供商连接的目标计算机。
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html
作者:[Tim Greene][a]
选题:[lujun9972][b]
译者:[messon007](https://github.com/messon007)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Tim-Greene/
[b]: https://github.com/lujun9972
[1]: https://pixabay.com/en/social-media-digitization-faces-3271592/
[2]: https://creativecommons.org/publicdomain/zero/1.0/
[3]: https://www.networkworld.com/newsletters/signup.html
[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[5]: https://www.facebook.com/NetworkWorld/
[6]: https://www.linkedin.com/company/network-world

View File

@@ -1,31 +1,31 @@
[#]: collector: (lujun9972)
[#]: translator: (lxbwolf)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12120-1.html)
[#]: subject: (Build a private social network with a Raspberry Pi)
[#]: via: (https://opensource.com/article/20/3/raspberry-pi-open-source-social)
[#]: author: (Giuseppe Cassibba https://opensource.com/users/peppe8o)
用树莓派搭建一个私人社交网络
======
手把手教你怎样以低硬件成本和简易步骤搭建自己的社交网络。
> 手把手教你怎样以低成本的硬件和简易步骤搭建自己的社交网络。
![Team of people around the world][1]
近年来,社交网络已经革新了人们的生活习惯。为了维持与朋友和家人的联系,人们每天都会使用社交频道。但是涉及到隐私和数据安全时,仍有一些普遍问题。尽管社交网络创建了复杂的隐私策略来保护用户的信息,但如果你不想自己的信息被泄露,最好的办法还是把数据保存在自己的服务器上。
近年来,社交网络已经革新了人们的生活习惯。人们每天都会使用社交频道与朋友和家人联系。但是涉及到隐私和数据安全时,仍有一些共同的问题。尽管社交网络创建了复杂的隐私策略来保护用户的信息,但如果你不想自己的信息被泄露,最好的办法还是把数据保存在自己的服务器上。
一个树莓派 — 多才多艺的 Raspbian Lite 版本就可以让你搭建很多有用的家庭服务(参照我的文章[树莓派项目][2])。通过搜索开源软件你就可以实现一些令人痴迷的功能,你也可以用这个神奇的设备来感受那些功能。其中一个有趣的尝试就是在你的树莓派上安装 OSSN译注OpenSource Social Network
一个树莓派 — 多才多艺的 Raspbian Lite 版本就可以让你搭建很多有用的家庭服务(参照我的文章[树莓派项目][2])。通过搜索开源软件你就可以实现一些令人痴迷的功能,你也可以用这个神奇的设备来感受那些功能。其中一个有趣的尝试就是在你的树莓派上安装 OSSN。
### OSSN是什么
### OSSN 是什么?
[OSSN][3] 是用 PHP 写的一个快速开发社交网络软件让你可以搭建自己的社交网站。OSSN 可以用来搭建不同类型的社交应用,如:
<ruby>[开源社交网络][3]<rt>OpenSource Social Network</rt></ruby>OSSN是用 PHP 写的一个快速开发社交网络软件让你可以搭建自己的社交网站。OSSN 可以用来搭建不同类型的社交应用,如:
* 私人内部网
* 公用/公开网络
* 社区
OSSN 支持的功能:
* 照片
@@ -35,13 +35,11 @@ OSSN 支持的功能:
* 搜索
* 聊天
OSSN 运行在 LAMP 服务器上。硬件需求很简单,却能提供强大的用户界面,也友好支持移动端。
### 我们需要准备什么
这个项目很简单,而且由于我们只安装远程 web 服务,因此我们只需要一些便宜的零件就够了。我使用的是树莓派 3B+,但是用树莓派 3A+ 或其他更新的板应该也可以。
这个项目很简单,而且由于我们只安装远程 Web 服务,因此我们只需要一些便宜的零件就够了。我使用的是树莓派 3B+,但是用树莓派 3A+ 或其他更新的板应该也可以。
硬件:
@@ -49,76 +47,66 @@ OSSN 运行在 LAMP 服务器上。硬件需求很简单,却能提供强大的
* 一张 SD 卡(最好是性能好点的卡,至少 16 GB
* 一台有 SFTP 软件(如免费的 [Filezilla][4])的桌面 PC用来把安装包传到你的树莓派上
### 操作步骤
我们首先搭建一个传统的 LAMP 服务器,然后配置数据库用户和安装 OSSN。
#### 1\. 安装 Raspbian Buster Lite 操作系统
#### 1安装 Raspbian Buster Lite 操作系统
你可以直接参照我的文章[在你的树莓派上安装 Raspbian Buster Lite][5]。
为了确保你的系统是最新的ssh 登录到树莓派后在终端输入下面的命令:
```bash
sudo apt-get update
sudo apt-get upgrade
```
#### 2\. 安装 LAMP 服务
#### 2安装 LAMP 服务
LAMPLinuxApacheMysqlPhp服务通常与 MySQL 数据库配合。在我们的项目中,我们选择 MariaDB因为它更轻量完美支持树莓派。
#### 3\. 安装 Apache 服务:
安装 Apache 服务
```
`sudo apt-get install apache2 -y`
sudo apt-get install apache2 -y
```
你可以通过在浏览器输入 `http://<<YouRpiIPAddress>>` 来检查 Apache 是否安装正确:
![][6]
#### 4\. 安装 PHP:
安装 PHP
```
`sudo apt-get install php -y`
sudo apt-get install php -y
```
#### 5\. 安装 MariaDB 服务和 PHP connector:
安装 MariaDB 服务和 PHP connector
```
`sudo apt-get install mariadb-server php-mysql -y`
sudo apt-get install mariadb-server php-mysql -y
```
#### 6\. 安装 phpMyAdmin:
安装 phpMyAdmin
在 OSSN 中 phpMyAdmin 不是强制安装的,但我建议你安装,因为它可以简化数据库的管理。
```
`sudo apt-get install phpmyadmin`
sudo apt-get install phpmyadmin
```
在 phpMyAdmin 配置界面,执行以下步骤:
* 按下空格和 OK 选择 apache强制
* 在 dbconfig-common 选择,配置 phpMyAdmin 的数据库。
* 输入想设置的密码,按下 OK。
* 再次输入 phpMyAdmin 密码来确认,按下 OK。
* 按下空格和 OK 选择 apache强制
* 在 dbconfig-common 选择“Yes”,配置 phpMyAdmin 的数据库。
* 输入想设置的密码,按下 OK
* 再次输入 phpMyAdmin 密码来确认,按下 OK
#### 7\. 为 phpMyAdmin 用户添加数据库权限来管理数据库:
为 phpMyAdmin 用户添加数据库权限来管理数据库:
我们用 root 用户连接 MariaDB默认没有密码来设置权限。
```
sudo mysql -uroot -p
grant all privileges on *.* to 'phpmyadmin'@'localhost';
@@ -126,11 +114,10 @@ flush privileges;
quit
```
#### 8\. 最后,重启 Apache 服务:
最后,重启 Apache 服务
```
`sudo systemctl restart apache2.service`
sudo systemctl restart apache2.service
```
在浏览器输入 `http://<<YouRpiIPAddress>>/phpmyadmin/` 来检查 phpMyAdmin 是否正常:
@@ -139,52 +126,44 @@ quit
默认的 phpMyAdmin 登录凭证:
* 用户名phpmyadmin
* 用户名:`phpmyadmin`
* 密码:在 phpMyAdmin 安装步骤中你设置的密码
### 安装 OSSN 所需的其他包和配置 PHP
#### 3、安装 OSSN 所需的其他包和配置 PHP
在第一次配置 OSSN 前,我们还需要在系统上安装一些所需的包:
* PHP 版本 5.67.0 或 7.1
* PHP 版本 5.67.0 或 7.1
* MYSQL 5 及以上
* APACHE
* MOD_REWRITE
* 需要打开 PHP 扩展 cURL 和 Mcrypt
* PHP GD 扩展
* PHP ZIP 扩展
* 打开 PHP 设置 allow_url_fopen
* 打开 PHP 设置 `allow_url_fopen`
* PHP JSON 支持
* PHP XML 支持
* PHP OpenSSL
在终端输入以下命令来安装上述包:
```
`sudo apt-get install php7.3-curl php7.3-gd php7.3-zip php7.3-json php7.3-xml`
sudo apt-get install php7.3-curl php7.3-gd php7.3-zip php7.3-json php7.3-xml
```
#### 1\. 打开 MOD_REWRITE:
打开 mod_rewrite
```
`sudo a2enmod rewrite`
sudo a2enmod rewrite
```
#### 2\. 修改默认的 Apache 配置,使用 mod_rewrite:
修改默认的 Apache 配置,使用 mod_rewrite
```
`sudo nano /etc/apache2/sites-available/000-default.conf`
sudo nano /etc/apache2/sites-available/000-default.conf
```
#### 3\. 在 **000-default.conf** 文件中添加下面的内容:
`000-default.conf` 文件中添加下面的内容:
```ini
<VirtualHost *:80>
@@ -192,18 +171,17 @@ quit
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
# SECTION TO ADD --------------------------------
# 需要添加的部分开始 --------------------------------
<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
# END SECTION TO ADD --------------------------------
# 需要添加的部分结束 --------------------------------
</VirtualHost>
```
#### 4\. 安装 Mcrypt:
安装 Mcrypt
```bash
sudo apt install php-dev libmcrypt-dev php-pear
@@ -211,45 +189,42 @@ sudo pecl channel-update pecl.php.net
sudo pecl install mcrypt-1.0.2
```
#### 5\. 在 `/etc/php/7.3/apache2/php.ini` 文件中添加 `extension=mcrypt.so`(或取消注释)打开 Mcrypt 模块:
打开 Mcrypt 模块:
`/etc/php/7.3/apache2/php.ini` 文件中 `extension=mcrypt.so`(或取消注释):
```bash
sudo nano /etc/php/7.3/apache2/php.ini
```
**allow_url_fopen** 应该已经在 `/etc/php/7.3/apache2/php.ini` 文件中打开了。OpenSSL 应该在 php7.3 中安装了。
#### 6\. 我建议的另一个设置是把 PHP 最大上传文件数修改为 16 MB
`allow_url_fopen` 应该已经在 `/etc/php/7.3/apache2/php.ini` 文件中打开了。OpenSSL 应该在 php7.3 中安装了。
我建议的另一个设置是把 PHP 最大上传文件数修改为 16 MB
```
`sudo nano /etc/php/7.3/apache2/php.ini`
sudo nano /etc/php/7.3/apache2/php.ini
```
#### 7\. 搜索到 **upload_max_filesize** 所在的行,参照下面的设置:
搜索到 `upload_max_filesize` 所在的行,参照下面的设置:
```
`upload_max_filesize = 16M`
upload_max_filesize = 16M
```
#### 8\. 保存并退出,重启 Apache
保存并退出,重启 Apache
```
`sudo systemctl restart apache2.service`
sudo systemctl restart apache2.service
```
### 安装 OSSN
#### 4、安装 OSSN
#### 1\. 创建数据库,设置用户
##### 创建数据库,设置用户
回到 phpmyadmin web页面浏览器输入 `http://<<YouRpiIPAddress>>/phpmyadmin/`)并登录:
回到 phpmyadmin web 页面(浏览器输入 `http://<<YouRpiIPAddress>>/phpmyadmin/`)并登录:
用户名: phpmyadmin
密码:在 phpMyAdmin 安装步骤中你设置的密码
- 用户名: `phpmyadmin`
- 密码:在 phpMyAdmin 安装步骤中你设置的密码
点击数据库标签页:
@@ -261,13 +236,11 @@ sudo nano /etc/php/7.3/apache2/php.ini
现在为 OSSN 创建一个数据库用户,我使用下面的凭证:
用户名: ossn_db_user
密码: ossn_db_password
- 用户名: `ossn_db_user`
- 密码: `ossn_db_password`
在终端输入下面的命令如果你没有修改过密码root 密码应该仍然是空):
```bash
sudo mysql -uroot -p
CREATE USER 'ossn_db_user'@'localhost' IDENTIFIED BY 'ossn_db_password';
@@ -276,34 +249,30 @@ flush privileges;
quit
```
#### 2\. 安装 OSSN 软件:
##### 安装 OSSN 软件
在你 PC 上从 [OSSN 下载页面][10] 下载 OSSN 安装压缩文件,保存为文件 `ossn-v5.2-1577836800.zip`
使用你习惯的 SFTP 软件把整个压缩文件通过 SFTP 传到树莓派的新目录 `/home/pi/download` 下。常用的默认SFP 连接参数是:
* 主机:你树莓派的 IP 地址
* 用户名:pi
* 用户名:`pi`
* 密码raspberry如果没有修改过默认密码
* 端口: 22
在终端输入:
```bash
cd /home/pi/download/ #Enter directory where OSSN installation files have been transferred
unzip ossn-v5.2-1577836800.zip #Extracts all files from zip
cd /var/www/html/ #Enter Apache web directory
sudo rm index.html #Removes Apache default page - we'll use OSSN one
cd /home/pi/download/ # 进入上传的 OSSN 安装文件的目录。
unzip ossn-v5.2-1577836800.zip # 从压缩包中提取所有文件
cd /var/www/html/ # 进入 Apache Web 目录
sudo rm index.html # 删除 Apache 默认页面 - 我们将使用 OSSN
sudo cp -R /home/pi/download/ossn-v5.2-1577836800/* ./ #Copy installation files to web directory
sudo chown -R www-data:www-data ./
```
创建数据文件夹OSSN 需要一个文件夹来存放数据。出于安全目的OSSN 建议这个文件夹创建在公开文档根目录之外。所以,我们在 `/opt` 下创建。
```bash
sudo mkdir /opt/ossn_data
sudo chown -R www-data:www-data /opt/ossn_data/
@@ -337,7 +306,7 @@ sudo chown -R www-data:www-data /opt/ossn_data/
![][17]
*本文首发在 [peppe8o.com][18]。已获得转载授权。*
本文首发在 [peppe8o.com][18]。已获得转载授权。
--------------------------------------------------------------------------------
@@ -346,7 +315,7 @@ via: https://opensource.com/article/20/3/raspberry-pi-open-source-social
作者:[Giuseppe Cassibba][a]
选题:[lujun9972][b]
译者:[lxbwolf](https://github.com/lxbwolf)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -0,0 +1,121 @@
[#]: collector: (lujun9972)
[#]: translator: (qfzy1233)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12155-1.html)
[#]: subject: (Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux)
[#]: via: (https://itsfoss.com/bodhi-linux-review/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
Bodhi Linux 5.1 一览: 略有不同的轻量化 Linux
======
Bodhi Linux 是一个基于 Ubuntu 的[轻量级 Linux 发行版][1]。与其他大多数发行版不同Bodhi 使用自己的 Moksha 桌面,并专注于为你提供一个可以在旧计算机上运行的最简设置。
### 什么是 Bodhi Linux?
![](https://img.linux.net.cn/data/attachment/album/202004/27/093318yawppv07zqpva4j6.png)
[Bodhi Linux][3] 最早于 2011 年推出。它以“[简约、高效和用户自定义][4]”为设计理念。开发人员旨在提供一个“[实用但不臃肿的系统][5]”。因此,它使用轻量级的 Moksha 桌面,只预装了基本的应用程序。这一做法是为了给用户一个稳定的平台来构建他们想要的系统。它基于最新版的 Ubuntu 长期支持版本。
### Moksha 桌面
![Bodhi Desktop][6]
起初 Bodhi 是装载着 [Enlightenment 桌面环境][7]的。Bodhi Linux 一直被认为是“Enlightenment 系的” Linux 发行版。事实上“Bodhi”菩提这个词是基于梵文的“<ruby>开悟<rt> enlightenment</rt></ruby>”。
然而,当 Enlightenment 18 版本发布以后,这一切都改变了。该版本是如此的糟糕,以至于它并没有集成到 Bodhi 中。Enlightenment 19 发布后修复了一些问题,但仍然存在一些不足。
在尝试与 Enlightenment 开发团队合作却毫无进展之后Bodhi 开发者在 2015 年[复刻][8]了 Enlightenment 17。新的桌面环境被命名为 [Moksha][9],它是基于梵文单词“解脱、解放或释放”。你可以在 [GitHub][10] 上找到它的代码。
### 5.1.0 有什么新特性?
- [Bodhi Linux 5.1 Trailer](https://youtu.be/e8wcRL9F3p8)
[Bodhi 5.1.0][12] 是这两年内发布的第一个版本,也是基于 Ubuntu 18.04 的第二个版本。除了更新包,它还有新的默认图标和主题。该版本对默认应用程序做了几处更改。预装版 Leafpad 取代了 epad 并且 [GNOME Web][13](也被称为 Epiphany代替了 [Midori][14]。删除了 eepDater 系统更新器。
目前有[四个不同的版本][15]的 Bodhi5.1.0 可以[下载][16]: <ruby>标准版<rt>Standard</rt></ruby>、<ruby>硬件支持版<rt>Hwe</rt></ruby>、<ruby>兼容版<rt>Legacy</rt></ruby> 和<ruby>软件包版<rt>AppPack</rt></ruby>。
* 标准适用于过去十年内电脑配置。它不推送内核更新。
* 硬件支持版是 Bodhi 家族的新成员其设计用来包括对更新的硬件的支持并会接收到内核更新。5.1 版本的使用的是 5.3.0-42 内核。
* 兼容版是仅有的 32 位版本。它使用“较旧的 4.9.0-6-686 Linux 内核该内核针对旧的15 年以上)硬件进行了优化。这个内核也不包括许多老系统不支持的 PAE 扩展。”
* 软件包版是为那些想要一个开箱即用的全载系统的人准备的,并预装了许多应用程序。
### Bodhi Linux 的系统要求
最低系统要求:
* 500 MHz 处理器
* 256 MB 内存
* 5 GB 的硬盘存储空间
推荐系统要求:
* 1.0 GHz 处理器
* 512 MB 内存
* 10 GB 的硬盘存储空间
### 体验 Bodhi Linux
![Old Bodhi Linux][17]
由于它是基于 Ubuntu 的,所以安装 Bodhi 非常简单。当我登录到 Bodhi 后,新的主题和图标集让我大吃一惊。上次我安装 Bodhi包括几个月前的 5.0)时,我认为它需要换一个新的外观。之前的主题并没有什么问题,但看起来像是二十一世纪初的东西。新的主题使它看起来更具现代感。
![Bodhi Linux 5.1][18]
我也很高兴看到 Midori 浏览器被 GNOME Web 所取代。我不是 [Midori 浏览器][19]的粉丝。对我来说,它总是显得功能太少了。(不过,随着 [Midori Next][20] 的推出这种情况可能会改变。GNOME Web 更像是我需要的网页浏览器。最重要的是它带有 Firefox Sync这样我就可以同步我所有的书签和密码了。
与许多 Linux 发行版不同Bodhi 并没有一个独立的软件中心。相反,如果你点击 AppCenter 图标,它会打开浏览器,并导航到 Bodhi 网站的软件中心页面 [AppCenter 页面][21]。这里的应用程序是按类别排序的,它们中的大多数是[轻量级应用程序][22]。
![Bodhi Linux Appcenter][23]
如果你点击其中一个页面并点击“安装”在你输入密码之后Bodhi 就会安装它。这是通过一个名为 [apturl][24] 的小程序实现的,它是“是一个非常简单的从网页浏览器安装软件包的方法”。它非常灵巧,我希望更多基于 Ubuntu 的发行版使用它。
总的来说,我喜欢 Moksha 桌面。它坚持我们几十年来看到的桌面风格(这是我最喜欢的)。它不会影响你,却很容易改变和定制。我唯一怀念的是,当我按下超级键时,应用程序菜单不打开。但我猜你不可能拥有生活中的一切。
### 结语
我对最近发布的 Bodhi Linux 感到十分惊喜。过去,我经常折腾它。并且我一直很喜欢它,但最近的这个版本是迄今为止最好的。在某种程度上,他们打破了 Bodhi 只适合老系统的想法,加入了对较新内核的支持。
如果你想换换个环境,同时又想在 Ubuntu 的世界里寻找新的风景,那就试试[Bodhi Linux][3]吧。
你用过 Bodhi Linux 吗?你最喜欢的基于 Ubuntu 的发行版是什么?请在下面的评论中告诉我们。
--------------------------------------------------------------------------------
via: https://itsfoss.com/bodhi-linux-review/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[qfzy1233](https://github.com/qfzy1233)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/lightweight-linux-beginners/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi-start-page.png?resize=800%2C500&ssl=1
[3]: https://www.bodhilinux.com/
[4]: https://www.bodhilinux.com/w/wiki/
[5]: https://www.bodhilinux.com/w/what-is-bodhi-linux/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi-desktop.jpg?resize=800%2C500&ssl=1
[7]: https://www.enlightenment.org/start
[8]: https://www.bodhilinux.com/2015/04/28/introducing-the-moksha-desktop/
[9]: https://www.bodhilinux.com/moksha-desktop/
[10]: https://github.com/JeffHoogland/moksha
[11]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[12]: https://www.bodhilinux.com/2020/03/25/bodhi-linux-5-1-0-released/
[13]: https://wiki.gnome.org/Apps/Web/
[14]: https://en.wikipedia.org/wiki/Midori_(web_browser
[15]: https://www.bodhilinux.com/w/selecting-the-correct-iso-image/
[16]: https://www.bodhilinux.com/download/
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi.png?resize=800%2C400&ssl=1
[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bodhi-Linux-5-1-screenshot.jpg?ssl=1
[19]: https://itsfoss.com/midori-browser/
[20]: https://www.midori-browser.org/2020/01/15/midori-next-come-on-yarovi-we-can/
[21]: https://www.bodhilinux.com/a/
[22]: https://itsfoss.com/lightweight-alternative-applications-ubuntu/
[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Bodhi-Linux-AppCenter.png?resize=800%2C500&ssl=1
[24]: https://wiki.ubuntu.com/AptUrl
[25]: https://reddit.com/r/linuxusersgroup

View File

@@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12139-1.html)
[#]: subject: (Create web tutorials with Reveal.js and Git)
[#]: via: (https://opensource.com/article/20/4/create-web-tutorial-git)
[#]: author: (Eric D. Schabell https://opensource.com/users/eschabell)
@@ -10,9 +10,9 @@
使用 Reveal.js 和 Git 创建网页教程
======
> 通过这个简单的工作流程创建的研讨会幻灯片,可以在任何浏览器、设备和平台上一致查看。
> 通过这个简单的工作流程创建的研讨会幻灯片,可以在任何浏览器、设备和平台上获得一致查看效果
![Person reading a book and digital copy][1]
![](https://img.linux.net.cn/data/attachment/album/202004/23/094800ohkpbjd3zbj0dj0d.jpg)
无论你是学习者还是教师,你可能都会认识到采用幻灯片放映来传播知识的在线<ruby>研讨会<rt>workshop</rt></ruby>的价值。如果你曾经偶然看到过这样一个逐页、逐章设置的井井有条的教程,你可能会想知道创建这样的一个网站有多难。
@@ -20,9 +20,9 @@
### 介绍
当我开始将学习内容放到网上置时,体验并不是很好。我想要的是一种可重复的、一致的、易于维护的东西,因为我的内容会随着我教学技术而进步
当我开始将学习内容放到网上置时,体验并不是很好。我想要的是一种可重复的、一致的、易于维护的东西,因为我的内容会随着我教学技术发展而变化
我尝试了许多交付模型,从 [Asciidoctor][2] 这样的低级代码生成器到在单个 PDF 文件中放置教程。全都不能让我满意。当我举办现场的在座研讨会时,我喜欢使用幻灯片放映,因此我想知道我是否可以为自己的在线的,自定进度的研讨会体验做同样的事情。
我尝试了许多交付模型,从 [Asciidoctor][2] 这样的低级代码生成器到在单个 PDF 文件中放置教程。全都不能让我满意。当我举办现场的在座研讨会时,我喜欢使用幻灯片放映,因此我想知道我是否可以为自己的在线的,自定进度的研讨会体验做同样的事情。
经过一番挖掘我为创建无痛的研讨会网站打下了基础。当时我已经在使用一个演示文稿生成框架这对我来说是很有帮助的因为这个框架可以产生对网站友好的格式HTML
@@ -33,13 +33,13 @@
* 研讨会的想法(这是你的问题,我帮不了你)
* 用于研讨会幻灯片的 Reveal.js
* GitLab 项目仓库
* 你最喜欢的 HTML 代码编辑器
* 你常用的 HTML 代码编辑器
* Web 浏览器
* 在你的机器上安装好 Git
如果这个列表看起来令人望而生畏,那么有一个快速入门的方法,不需要把所有的东西一个个都拉到一起。你可以用我的模板项目来给你提供幻灯片和项目设置的入门教程。
本文假设你熟悉 Git 和托管在 Git 平台(如 GitLab项目。如果你需要指导或教程,请查看我们的[Git 入门系列][3]。
本文假设你熟悉 Git 和在 Git 平台(如 GitLab托管项目。如果你需要指导或教程,请查看我们的[Git 入门系列][3]。
首先,将模板项目克隆到本地机器上。
@@ -49,7 +49,7 @@ $ git clone https://gitlab.com/eschabell/beginners-guide-automated-workshops.git
为此设置一个新的 GitLab 项目,导入模板项目作为初始导入。
研讨会网站有一些重要的文件。在**根目录**下,你会发现一个名为 `.gitlab-ci.yml` 的文件,当你向主分支提交修改时(即合并拉取请求到 `master` 分支),这个文件会作为触发器。它可以触发将 `slides` 目录的全部内容复制到 GitLab 项目的 `website` 文件夹中。
研讨会网站有一些重要的文件。在**根目录**下,你会发现一个名为 `.gitlab-ci.yml` 的文件,当你向主分支提交修改时(即拉取请求合并`master` 分支),这个文件会作为触发器。它可以触发将 `slides` 目录的全部内容复制到 GitLab 项目的 `website` 文件夹中。
我把它托管在我的 GitLab 账户中,名为 `beginners-guide-automated-workshops`。当它部署完毕后,你可以在浏览器中通过导航到下列地址查看 `slides` 目录的内容:
@@ -79,7 +79,7 @@ https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME]
* `images` 目录
* `index.html`文件
在你喜欢的 HTML/CSS 编辑器中打开每一个文件,然后进行下面描述的修改。你用哪个编辑器并不重要,我更喜欢 [RubyMine IDE][5],因为它能在本地浏览器中提供页面预览。这对我在将内容推送到研讨会网站之前测试内容时很有帮助。
在你常用的 HTML/CSS 编辑器中打开每一个文件,然后进行下面描述的修改。你用哪个编辑器并不重要,我更喜欢 [RubyMine IDE][5],因为它能在本地浏览器中提供页面预览。这对我在将内容推送到研讨会网站之前测试内容时很有帮助。
#### default.css 文件
@@ -91,7 +91,7 @@ https://[YOUR_USERNAME].gitlab.io/[YOUR_PROJECT_NAME]
font-family: "Red Hat Display", "Overpass", san-serif;
```
如果你使用的是非标准字体类型,则必须在以下行中将其导入(Overpass 字体类型相同
如果你使用的是非标准字体类型则必须在以下行中将其导入Overpass 字体类型就是这样做的
```
@import url('SOME_URL');
@@ -105,7 +105,7 @@ background: url("…/…/images/backgrounds/basic.png")
要设置一个默认背景,只需将这一行指向你要使用的图片。
#### images 目录
#### images 目录
顾名思义,`images` 目录是用来存储你想在研讨会幻灯片上使用的图片。例如,我通常会把展示研讨会主题进展的截图放在我的个人幻灯片上。
@@ -131,7 +131,6 @@ background: url("…/…/images/backgrounds/basic.png")
现在继续到 `body` 部分。你会注意到它被分成了许多 `section` 标签。`body` 的开头包含了一个注释,说明你正在为每个标有 `section` 的打开和关闭的标签创建幻灯片。
```
<body>
<div class="reveal">
@@ -156,9 +155,9 @@ background: url("…/…/images/backgrounds/basic.png")
</section>
```
这张幻灯片有两个区域,用 `div` 标签分。用空格隔开了标题和作者。
这张幻灯片有两个区域,用 `div` 标签分。用空格隔开了标题和作者。
如果你有一定的 HTML 使用知识,可以尝试各种东西来开发你的研讨会。使用浏览器预览结果的时候真的很方便。有些 IDE 提供了本地查看修改,但你也可以打开 `index.html` 文件查看你的修改,然后再推送到资源库中。
如果你有一定的 HTML 使用知识,可以尝试各种东西来开发你的研讨会。使用浏览器预览结果的时候真的很方便。有些 IDE 提供了本地查看修改,但你也可以打开 `index.html` 文件查看你的修改,然后再推送到资源库中。
一旦你对你的研讨会感到满意,推送你的修改,然后等待它们通过持续集成管道。它们将像模板项目一样被托管在 <https://eschabell.gitlab.io/beginners-guide-automated-workshops>。
@@ -166,7 +165,7 @@ background: url("…/…/images/backgrounds/basic.png")
要了解更多关于这个工作流程可以做什么,请查看下面的示例研讨会和托管了研讨会集合的网站。所有这些都是基于本文中描述的工作流程。
研讨会例子:
研讨会例子:
* [Red Hat Process Automation Manage workshop][6]
* [JBoss Travel Agency BPM Suite online workshop][7]
@@ -177,7 +176,7 @@ background: url("…/…/images/backgrounds/basic.png")
* [Application development in the cloud workshop][9]
* [Portfolio architecture: Workshops for creating impactful architectural diagrams][10]
我希望这本新手指南和模板研讨会项目能让你看到,在开发和维护工作室网站的过程中,可以轻松、无痛地完成。我也希望这个工作流程能让你的研讨会受众几乎在任何设备上都能完全访问你的内容,这样他们就能从你分享的知识中学习到你的知识。
我希望这本新手指南和模板研讨会项目能让你看到,在开发和维护研讨会网站的过程中,可以轻松、无痛地完成。我也希望这个工作流程能让你的研讨会受众几乎在任何设备上都能完全访问你的内容,这样他们就能从你分享的知识中学习到你的知识。
--------------------------------------------------------------------------------
@@ -186,7 +185,7 @@ via: https://opensource.com/article/20/4/create-web-tutorial-git
作者:[Eric D. Schabell][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -1,26 +1,26 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12124-1.html)
[#]: subject: (Heres How to Find Out Which Desktop Environment You are Using)
[#]: via: (https://itsfoss.com/find-desktop-environment/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
这是找出你所使用的桌面环境的方法
如何找出你所使用的桌面环境
======
如果你是 Linux 新用户,并在一个 Linux 论坛中寻求帮助,那么你可能会被问以下问题:
_**“你使用的是哪个桌面环境?”**_
> “你使用的是哪个桌面环境?”
你知道什么是桌面环境,但你如何知道你使用的是哪一个?我会告诉你如何找到它。我将首先展示命令行方法,因为这适用于[各种 Linux 发行版][1]。我还将展示如何通过图形方式获得。
你知道什么是<ruby>桌面环境<rt>desktop environment</rt></ruby>DE,但你如何知道你使用的是哪一个?我会告诉你如何找到它。我将首先展示命令行方法,因为这适用于[各种 Linux 发行版][1]。我还将展示如何通过图形方式获得。
### 检查你使用的是哪个桌面环境
![][2]
你可以[在 Linux 中使用 echo 命令][3]在终端中显示 XDG_CURRENT_DESKTOP 变量的值。
你可以[在 Linux 中使用 echo 命令][3]在终端中显示 `XDG_CURRENT_DESKTOP` 变量的值。
打开终端并复制粘贴此命令:
@@ -37,15 +37,15 @@ ubuntu:GNOME
尽管此命令可以快速告诉你正在使用哪个桌面环境,但它不会提供任何其他信息。
在某些情况下,了解桌面环境版本(也称为 DE可能很重要。软件的每个新版本都会带来新功能或删除某些功能。[GNOME 3.36][6] 引入了“请勿打扰”选项,以关闭所有桌面通知。
在某些情况下,了解桌面环境版本可能很重要。软件的每个新版本都会带来新功能或删除某些功能。[GNOME 3.36][6] 引入了“请勿打扰”选项,以关闭所有桌面通知。
假设你了解了新的“请勿打扰”功能。你确认自己正在使用 GNOME但是在 GNOME 桌面上看不到此选项。如果你可以检查系统上已安装的 GNOME 桌面版本,那么这会很清楚。
假设你了解了这个新的“请勿打扰”功能。你确认自己正在使用 GNOME但是在 GNOME 桌面上看不到此选项。如果你可以检查系统上已安装的 GNOME 桌面版本,那么这会很清楚。
我将先向你展示命令检查桌面环境版本,因为你可以在任何运行桌面环境的 Linux 中使用它。
### 如何获取桌面环境版本
与获取桌面环境的名称不同。获取其版本号并不直接,因为它没有标准的命令或环境变量可以提供此信息。
与获取桌面环境的名称不同。获取其版本号的方法并不直接,因为它没有标准的命令或环境变量可以提供此信息。
在 Linux 中获取桌面环境信息的一种方法是使用 [Screenfetch][7] 之类的工具。此[命令行工具以 ascii 格式显示 Linux 发行版的 logo][8] 以及一些基本的系统信息。桌面环境版本就是其中之一。
@@ -57,7 +57,7 @@ sudo apt install screenfetch
对于其他 Linux 发行版,请使用系统的软件包管理器来安装此程序。
安装后,只需在终端中输入 screenfetch 即可,它应该显示桌面环境版本以及其他系统信息。
安装后,只需在终端中输入 `screenfetch` 即可,它应该显示桌面环境版本以及其他系统信息。
![Check Desktop Environment Version][10]
@@ -67,7 +67,7 @@ sudo apt install screenfetch
### 使用 GUI 检查桌面环境版本
几乎所有桌面环境在其 “Settings-About” 部分中都提供了基本的系统详细信息。
几乎所有桌面环境在其 “Settings”->“About” 部分中都提供了基本的系统详细信息。
一个主要问题是,大多数桌面环境看起来都不同,因此我无法展示每个桌面环境的确切步骤。我将展示 GNOME 的,让你在桌面上发现它。
@@ -90,7 +90,7 @@ via: https://itsfoss.com/find-desktop-environment/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -1,47 +1,46 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12131-1.html)
[#]: subject: (How I'm using AI to translate 'wash your hands' in 500 languages)
[#]: via: (https://opensource.com/article/20/4/ai-translation)
[#]: author: (Daniel Whitenack https://opensource.com/users/datadan)
我是如何用 AI 把 “请洗手”翻译成 500 种语言的?
我是如何用 AI 把“请洗手”翻译成 500 种语言的?
======
> 通过使用人类和机器生成的翻译,可以将关键的健康短语翻译成世界各地的当地语言。
![Two diverse hands holding a globe][1]
![](https://img.linux.net.cn/data/attachment/album/202004/20/184427f1a2t5z61m5xxo1t.jpg)
你可能不知道,目前世界上有 [7117 种语言][2],不是方言,而是在用的语言! 然而,世界上大部分的数字媒体只用几十种语言,而像谷歌翻译这样的翻译平台只支持 100 种左右的语言。这样的现实意味着由于缺乏及时获取信息的机会全世界有数十亿人被边缘化。当前的冠状病毒COVID-19大流行已经让人痛苦地意识到了这一点凸显了将健康相关的短语如“<ruby>请洗手<rt>wash your hands</rt></ruby>”或“保持距离”等)即时、快速翻译成小众语言的必要性。
你可能不知道,目前世界上有 [7117 种语言][2]在使用,不是方言,而是在用的语言! 然而,世界上许多数字媒体只能使用几十种语言,而像谷歌翻译这样的翻译平台只支持 100 种左右的语言。这样的现实意味着由于缺乏及时获取信息的机会全世界有数十亿人被边缘化。当前的冠状病毒COVID-19大流行已经让人痛苦地意识到了这一点凸显了将健康相关的短语如“<ruby>请洗手<rt>wash your hands</rt></ruby>”或“保持距离”等)即时、快速翻译成小众语言的必要性。
为此我应用了最先进的AI技术用 544 种语言构建出了与“请洗手”相近的短语并进行了统计(我的 GPU 还在运行)。<ruby>多语言无监督和监督嵌入<rt>Multilingual Unsupervised and Supervised Embeddings</rt></ruby>MUSE方法被用来训练这 544 种语言和英语之间的跨语言单词嵌入。然后,这些嵌入方法可以从现有文档中提取出与目标短语相似的短语。
为此,我应用了最先进的 AI 技术,用 544 种语言构建出了与“请洗手”相近的短语并进行了统计(我的 GPU 还在运行)。<ruby>多语言无监督和监督嵌入<rt>Multilingual Unsupervised and Supervised Embeddings</rt></ruby>MUSE方法被用来训练这 544 种语言和英语之间的跨语言单词嵌入。然后,这些嵌入方法可以从现有文档中提取出与目标短语相似的短语。
我与 SIL 国际公司的同事们合作完成了这项工作,他们收集了该短语的更多的人工翻译结果。这些人工翻译结果和我的一些机器翻译结果的组合可以在[这个民族语指南页面][3]上搜索到(机器生成的短语用一个小的机器人图标表示),更多的翻译将在生成/收集到的时候加入。
### 利用现有的语料库
SIL 国际公司已经完成了 2000 多种语言的语言工作,目前管理着 1600 多个语言项目。因此,当我解决这个特殊的问题时,我知道我们很可能已经多次将“请洗手”和/或类似的短语翻译成了数百种语言,而这一猜测得到了回报。我很快就从我们的档案库中收集到了超过 900 种语言的文(主要是完成的贝壳书模板、教材和圣经)。这些文中的每一份文件都有一个英文的对应,其中必然包括“请洗手”和/或类似“请洗脸”这样的短语。此外,这些文的质量都很高,并与当地语言社区合作进行了翻译和检查。
SIL 国际公司已经完成了 2000 多种语言的语言工作,目前管理着 1600 多个语言项目。因此,当我解决这个特殊的问题时,我知道我们很可能已经多次将“请洗手”和/或类似的短语翻译成了数百种语言,而这一猜测得到了回报。我很快就从我们的档案库中收集到了超过 900 种语言的文(主要是完成的贝壳书模板、教材和圣经)。这些文中的每一份都有一个英文的对应版本,其中必然包括“请洗手”和/或类似“请洗脸”这样的短语。此外,这些文的质量都很高,并与当地语言社区合作进行了翻译和检查。
这是相当多语言的数据集。然而,有两个问题需要克服。首先,这个数据包含了大多数语言的数千种样本,这与训练机器翻译模型所使用的数百万个样本形成了鲜明对比。其次,即使文档中包含目标语言中的“请洗手”这个短语,我们也不知道这个短语在周围文本中的确切位置。
我们当然可以利用[低资源语言的机器翻译][4]中的一些最新技巧,但要在每一对语言中快速调整翻译模型的自动化方法,还需要一些时间。此外,我们所针对的许多语言都没有现成的可以与之比较评估指标的基线,例如[BLEU 评分][5]。考虑到对冠状病毒大流行的迫切担忧,我们希望比这更快一点(尽管我们计划在将来再来解决这个问题)。
我们当然可以利用[低资源语言的机器翻译][4]中的一些最新技巧,但是需要花费一些时间来调整自动化方法,以快速适应每种语言对中的翻译模型。此外,我们所针对的许多语言都没有现成的的基线,可以用来比较评估指标例如 [BLEU 评分][5]。考虑到对冠状病毒大流行的迫切担忧,我们希望比这更快一点(尽管我们计划在将来再来解决这个问题)。
我选择通过在现有的文档中寻找短语本身或短语的组件(如“请洗”或“你的手”)来尝试构建“请洗手”这个短语。为了找到这些成分,我使用 Facebook Research 的 [多语言无监督和监督嵌入MUSE][6]对每个 {英语、目标语言} 对进行<ruby>跨语言<rt>cross-lingual</rt></ruby>嵌入训练。MUSE 以<ruby>单语言<rt>monolingual</rt></ruby>的单词嵌入作为输入(我使用 [fasttext][7] 来生成这些词),并使用对抗性方法学习从英语到目标嵌入空间的映射。这个过程的输出是<ruby>跨语言<rt>cross-lingual</rt></ruby>的单词嵌入。
我选择通过在现有的文档中寻找短语本身或短语的组件(如“请洗”或“你的手”)来尝试构建“请洗手”这个短语。为了找到这些成分,我使用 Facebook Research 的[多语言无监督和监督嵌入MUSE][6]对每个 {英语、目标语言} 对进行<ruby>跨语言<rt>cross-lingual</rt></ruby>嵌入训练。MUSE 以<ruby>单语言<rt>monolingual</rt></ruby>的单词嵌入作为输入(我使用 [fasttext][7] 来生成这些词),并使用对抗性方法学习从英语到目标嵌入空间的映射。这个过程的输出是<ruby>跨语言<rt>cross-lingual</rt></ruby>的单词嵌入。
![Using fasttext along with MUSE to perform cross-language embedding][8]
一旦产生了跨语言嵌入,我们就可以开始在目标语言文档中寻找短语成分。结果发现,整个文档中清楚地使用了“请洗脸”这个短语以及单独的“手”、“请洗”等词。对于每一种语言,我都通过 n-grams 搜索我预期该短语会出现的地方(根据其在英语平行语中的用法)。使用跨语言嵌入法对 n-grams 进行了矢量化,并使用各种距离指标与英语短语的矢量化版本进行了比较。在嵌入空间中,与英文短语“最接近”的 n-grams 被确定为目标语言匹配。
一旦产生了跨语言嵌入,我们就可以开始在目标语言文档中寻找短语组件。结果发现,整个文档中清楚地使用了“请洗脸”这个短语以及单独的“手”、“请洗”等词。对于每一种语言,我都通过 n-gram 搜索我预期该短语会出现的地方(根据其在英语的对应版本中的用法)。使用跨语言嵌入法对 n-gram 进行了矢量化处理,并使用各种距离指标与英语短语的矢量化版本进行了比较。在嵌入空间中,与英文短语“最接近”的 n-gram 被确定为目标语言匹配。
最后,将与英语对应的成分短语进行组合,生成目标语言中的“请洗手”短语。这种组合方式再次利用跨语言嵌入,确保组件短语的组合方式合适。例如,如果我们在目标语言中匹配“请洗脚”这个短语,就必须将“脚”对应的 n-gram 替换成“手”对应的 n-gram。下面是<ruby>伯利兹·克里奥尔<rt>Belize Kriol</rt></ruby>英语的一个例子:
最后,将与英语对应的成分短语进行组合,生成目标语言中的“请洗手”短语。这种组合方式再次利用跨语言嵌入,确保以合适方式组合组件。例如,如果我们在目标语言中匹配“请洗脚”这个短语,就必须将“脚”对应的 n-gram 替换成“手”对应的 n-gram。下面是<ruby>伯利兹·克里奥尔<rt>Belize Kriol</rt></ruby>英语的一个例子:
![][9]
当然,在这个匹配过程中,一些假设,这个过程完全有可能不能产生语法上正确的预测。例如,我假设在大多数语言中,“手”的单词和“脚”的单词都是一个字元长的(字元由空格和标点符号隔开)。当然,情况肯定不一定是这样。这可能会造成类似于“和洗和手你”或类似的不好的词条。希望我们可以克服其中的一些局限性,并在未来扩展这个系统,但是,现在,我们选择用图形来强化这个想法。
我们将世界卫生组织的洗手说明改编成了一个 PNG 图片模板。然后,我们把我们翻译和生成的短语,用 Bash 和 Go 脚本的组合将其渲染到洗手图像中。这样,在文字和图像中都强调了正确洗手的理念(只是为了防止我们生成的翻译有问题)。
当然,在这个匹配过程中,会做一些假设,这个过程完全有可能不能产生语法上正确的预测。例如,我假设在大多数语言中,“手”的单词和“脚”的单词都是一个<ruby>字元<rt>token</rt></ruby>长的(字元由空格和标点符号隔开)。当然并非总是如此。这可能会造成类似于“和洗和手你”或类似的瑕疵词条。希望我们可以克服其中的一些局限性,并在未来扩展这个系统,但是,现在,我们选择用图形来强化这个想法。
我们将世界卫生组织的洗手说明改编成了一个 PNG 图片模板。然后,我们把我们翻译和生成的短语,用 Bash 和 Go 脚本的组合将其渲染到洗手图像中。这样,在文字和图像中都强调了正确洗手的理念(以防万一我们生成的翻译很尴尬)。
![][10]
@@ -91,11 +90,11 @@ SIL 国际公司已经完成了 2000 多种语言的语言工作,目前管理
- 我们的系统yaakuuvaitana nnikiiyauvaa fini
- 谷歌翻译:不支持
的短语类似于参考翻译,或者似乎是“请洗手”的另一种说法。例如,在保加利亚语中,我预测为“умий ръцете”,而谷歌翻译预测为“Измий си ръцете”。然而,如果我用谷歌翻译回译我的预测,我还是会得到“请洗手”。有一些不确定的地方,我无法与参考译文(例如,所罗门群岛的 Pijin [pis]或人类注释的跨度进行比较但我仍然可以验证“洗”wasim和“手”han分别用在其他必定是谈论洗或手的参考文件中。大约有 15% 的译文可以用这个方法验证,我希望在收集参考文献字典的过程中,能验证更多的译文
的短语类似于参考翻译,或者似乎是“请洗手”的另一种说法。例如,在保加利亚语中,我预测为“умий ръцете”,而谷歌翻译预测为“Измий си ръцете”。 然而,如果我用谷歌翻译回译我的预测,我还是会得到“请洗手”。有一些不确定的地方,我无法与参考译文(例如,所罗门群岛的 Pijin [pis]或人类注释的跨度进行比较但我仍然可以验证“洗”wasim和“手”han分别用在其他必定是谈论洗或手的参考文件中。 大约有 15% 的译文可以用这个方法验证,我希望在收集参考文献字典的过程中能进行更多的验证
请注意,我最多使用了每种语言中大约 7000 个句子来得到上述译文,即使是意大利语这样的高资源语言也是如此。我也没有依赖语言对之间的对齐句子。尽管在这种数据非常稀缺、无监督的情况,但对于两个系统都支持的语言,我仍然能够获得类似于谷歌翻译的短语。这证明了这种“混合”方法(无监督的单词嵌入+基于规则的匹配)在将短语翻译成数据非常少的语言中的潜在用途。
请注意,我最多使用了每种语言中大约 7000 个句子来得到上述译文,即使是意大利语这样的高资源语言也是如此。我也依赖语言对之间的对齐句子。尽管在这种数据非常稀缺、无监督的情况,但对于两个系统都支持的语言,我仍然能够获得类似于谷歌翻译的短语。这证明了这种“混合”方法(无监督的单词嵌入+基于规则的匹配)在将短语翻译成数据非常少的语言中的潜在用途。
注意:我绝对不是说这是解决冠状病毒和其他健康相关的信息传播问题的解决方案。这里仍有很多东西需要探索和正式评估,我们正在为此努力。在很多情况下,这种方法无法帮助构建数百种语言的重要信息资料。但是,我认为,我们都应该尝试着为当前危机的相关问题制定创造性的解决方案。也许这只是一个非常大的拼图中的一块。
注意:我绝对不是说这是解决冠状病毒和其他健康相关的信息传播问题的解决方案。这里仍有很多东西需要探索和正式评估,我们正在为此努力。在很多情况下,这种方法无法帮助构建数百种语言的重要信息资料。但是,我认为,我们所有人都应该尝试着为当前危机的相关问题制定创造性的解决方案。也许这只是一个非常大的拼图中的一块。
你可以在[这个民族语言指南][3]上查看经过验证的译文加上人工翻译的完整列表。此外,我们即将以论文的形式对这一系统进行更深入的描述和分析。我们欢迎公众对翻译进行反馈,以帮助系统进行微调,最重要的是,确保将健康信息传递给世界各地的边缘化语言社区。
@@ -116,7 +115,7 @@ via: https://opensource.com/article/20/4/ai-translation
作者:[Daniel Whitenack][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -0,0 +1,77 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12136-1.html)
[#]: subject: (A handy utility for creating Raspberry Pi SD card images)
[#]: via: (https://opensource.com/article/20/4/raspberry-pi-imager-mac)
[#]: author: (James Farrell https://opensource.com/users/jamesf)
一个方便的用于创建树莓派 SD 卡镜像的程序
======
> 开始在 Mac 上使用 Raspberry Pi Imager。
![Raspberries with pi symbol overlay][1]
有多种购买树莓派的方法,根据你的购买渠道的不同,可能附带或不附带操作系统。要在树莓派上安装操作系统,只需将操作系统镜像 “闪存” 到 SD 卡即可。为了使之尽可能简单,[树莓派基金会][2]推出一个 Raspberry Pi Imager 实用程序,你可以在所有主流平台上下载它。下面就来简单介绍一下这个有用的新工具。
### 安装 Imager
你通常可以在[树莓派下载][3]页面上找到 Raspberry Pi Imager。它有 Mac、Ubuntu 和 Windows 版本。我将下载并演示 Mac 版本。
Mac 的安装包是常规的 DMG 镜像,它会挂载到你的桌面,然后经典的安装界面就会出现:
![Raspberry Pi Imager installer][4]
只需将可爱的树莓图标拖到“应用”文件夹,就可以完成。从启动台中调用它,你会看到一系列简单的按钮和菜单供你选择。真的不能比这更简单了:
![Raspberry Pi Imager home screen][5]
### 可用的镜像和选项
默认选项包含各种树莓派型号的镜像。Raspbian 是首选,它有两个可用的选项,较小的 “Lite” 版本和较大的 “Full” 版本。LibreELEC Kodi 娱乐系统有各种特定于型号的版本。Ubuntu 18 和 19 有适用于不同树莓派型号的 32 位和 64 位版本。有一个 RPi 4 EEPROM 恢复程序,以及使用 FAT32 格式化卡的功能。最后,有一个通用的镜像安装程序选项,稍后我将进行尝试。这个简单而紧凑的程序非常方便。
### 安装一些镜像
我决定使用 16g 的 micro SD 卡。我选择了默认的 Raspbian 镜像,选择已连接的 USB/SD 设备,然后按下 “WRITE” 按钮。这是一个简短的演示:
![Raspberry Pi Imager demo][6]
我没有在此处发布整个操作过程。我认为它是在写入的时候下载了镜像,对于我的无线连接这花费了几分钟。该过程在完成之前要先经过写入,然后经过验证环节。完成后,我弹出设备,并将卡插入到我的树莓派 3 中,然后按照通常的图形 Raspbian 安装向导和桌面环境进行设置。
这对我来说还不够。我每天都会下载许多 Linux今天我还在寻找更多。我回到了[树莓派下载][3]页面,并下载了 RISC OS 镜像。这个过程几乎一样容易。下载 RISCOSPi.5.24.zip 文件,将其解压缩,然后找到 ro524-1875M.img 文件。在 “Operating System” 按钮中,我选择了 “Use Custom” 并选择了所需的镜像文件。这个过程几乎是相同的。唯一真正的不同是我必须在下载目录中搜寻并选择一个镜像。文件写完后,回到树莓派 3RISC OS 可以使用了。
### 对 USB C 的抱怨
顺便说一句,如今有多少人对 USB C 带来的不便感到沮丧?我使用的是只有 USB C 口的 MacBook Pro我需要不断更换适配器才能完成工作。看看这个
![USB C adapter][7]
是的,那是一个 USB C 到 USB A 适配器,然后是一个 USB 到 SD 卡读卡器,以及一个 SD 到 micro SD 适配器。我可能可以在网上找到一些东西来简化此过程,但这些都是我手头有的部件,以支持我家五花八门的 Mac、Windows 和 Linux 主机。说到这里就不多说了,但我希望你能从这些疯狂的东西中得到一个笑点。
### 总结
新的 Raspberry Pi Imager 是一种简单有效的工具,可以快速烧录树莓派镜像。[BalenaEtcher][8] 是用于对可移动设备进行烧录的类似工具,但是新的 Raspberry Pi Imager 通过省去了获取那些常见镜像的步骤,使普通树莓派系统安装(如 Raspbian更加容易。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/raspberry-pi-imager-mac
作者:[James Farrell][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/jamesf
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay)
[2]: https://www.raspberrypi.org/
[3]: https://www.raspberrypi.org/downloads/
[4]: https://opensource.com/sites/default/files/uploads/install_1.png (Raspberry Pi Imager installer)
[5]: https://opensource.com/sites/default/files/uploads/screen_2_0.png (Raspberry Pi Imager home screen)
[6]: https://opensource.com/sites/default/files/uploads/demo_3.gif (Raspberry Pi Imager demo)
[7]: https://opensource.com/sites/default/files/uploads/adapter_4.png (USB C adapter)
[8]: https://www.balena.io/etcher/

View File

@@ -1,8 +1,8 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12121-1.html)
[#]: subject: (How to Add Multiple Time Zones in Ubuntu)
[#]: via: (https://itsfoss.com/add-multiple-time-zones-ubuntu/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
@@ -10,11 +10,13 @@
如何在 Ubuntu 中添加多个时区
======
_**此教程展示了使用 GNOME 桌面环境在 Ubuntu 和其他发行版中为多个时区添加其他时钟的步骤。**_
> 本快速教程介绍了在 Ubuntu 和其他发行版中使用 GNOME 桌面环境添加多时区时钟的步骤。
![](https://img.linux.net.cn/data/attachment/album/202004/18/142021jborblzkglbebrkk.jpg)
如果你的家人或同事在另一个国家,或者你居住在一个有多个时区的国家,那么了解时差就变得很重要。毕竟,你不想在凌晨 4 点打电话打扰别人。
一些 Linux 用户还会加一个 [UTC 时间][1]标签,因为大多数服务器都使用 UTC。
一些 Linux 用户还会记下 [UTC 时间][1],因为大多数服务器都使用 UTC。
如果你有多个时钟,那么可以更好地管理此类情况。你可以将一个时钟设置为本地时间,并将其他时钟同步到其他时区。这使得了解不同时间变得更加容易。
@@ -26,11 +28,11 @@ _**此教程展示了使用 GNOME 桌面环境在 Ubuntu 和其他发行版中
要添加其他时钟,可以使用一个叫 [GNOME Clocks][3] 的小程序。
GNOME Clocks 是一个简单的应用,它可以显示多个位置的时间和日期。你也可以使用它来设置闹钟或计时器还包括秒表功能。
GNOME Clocks 是一个简单的应用,它可以显示多个位置的时间和日期。你也可以使用它来设置闹钟或计时器,它还包括秒表功能。
GNOME Clocks 存在于 Ubuntu 的 Universe 仓库中。因此,请确保首先[启用 Universe 仓库][4]。
你可以在软件中心中搜索 GNOME Clocks 并从那里安装它。
你可以在软件中心中搜索 GNOME Clocks 并从那里安装它。
![Gnome Clocks Ubuntu Software Center][5]
@@ -42,13 +44,13 @@ sudo apt install gnome-clocks
如果你使用的是其他 Linux 发行版,那么请使用发行版的软件中心或软件包管理器来安装此程序。
安装后,请按 super 键Windows 键)并搜索 clocks
安装后,请按 `Super` 键( `Windows` 键)并搜索 clocks
![Gnome Clocks App Search Ubuntu][6]
启动程序,你应该会看到一个提供一些选项的界面,例如添加世界时钟、设置闹钟、使用秒表和计时器。
启动程序,你应该会看到一个界面,提供一些选项,例如添加世界时钟、设置闹钟、使用秒表和计时器。
单击左上角的 + 号,它将为你提供搜索地理位置的选项。搜索选择并添加。
单击左上角的 “+” 号,它将为你提供搜索地理位置的选项。搜索选择并添加。
![Adding additional clocks][7]
@@ -56,13 +58,13 @@ sudo apt install gnome-clocks
![Multiple clocks for multiple time zones][8]
你可以使用 Super + M 键快速打开消息托盘。你可以掌握这些[有用的 Ubuntu 快捷方式][9]来节省时间。
你可以使用 `Super + M` 键快速打开消息托盘。你可以掌握这些[有用的 Ubuntu 快捷方式][9]来节省时间。
如果要删除其他时钟,你可以从 GNOME Clocks 应用界面执行以下操作:
![Remove Additional Clocks][10]
你无法删除当前时区并设置为其他时区。有其他方法[更改 Linux 中的当前时区][11]。
你无法(在这里)删除当前时区并设置为其他时区。有其他方法[更改 Linux 中的当前时区][11]。
我希望你喜欢这个快速技巧。欢迎提出问题和建议。
@@ -73,7 +75,7 @@ via: https://itsfoss.com/add-multiple-time-zones-ubuntu/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出

View File

@@ -0,0 +1,149 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12132-1.html)
[#]: subject: (How to install Python on Linux)
[#]: via: (https://opensource.com/article/20/4/install-python-linux)
[#]: author: (Vijay Singh Khatri https://opensource.com/users/vijaytechnicalauthor)
如何在 Linux 上安装 Python
======
> 在 Linux 上安装最新 Python替代或与老版本并存的分步说明。
![](https://img.linux.net.cn/data/attachment/album/202004/21/094500u63lnlgukgnjb0t0.jpg)
[Python][2] 现在是[最流行][3]、最常用的编程语言。Python 的简单语法和较低的学习曲线使其成为初学者和专业开发人员的终极选择。Python 还是一种非常通用的编程语言。从 Web 开发到人工智能,它几乎在除了移动开发的所有地方都有使用。
如果你使用的是 Python那么你很有可能是一名开发人员或想成为一名开发人员而 Linux 是创建软件的绝佳平台。但是,当你每天使用 Python 时,有时你希望使用最新版本。你可能不想仅仅为了测试最新版本的系统而替换了默认的 Python 安装,因此本文说明了如何在 Linux 上安装最新版本的 Python 3而不替换发行版提供的版本。
使用 `python --version` 终端命令检查是否已安装 Python如果已安装那么检查是哪个版本。如果你的 Linux 系统上未安装 Python或者你想安装更新的版本请按照以下步骤操作。
### 分步安装说明
#### 步骤 1首先安装构建 Python 所需的开发包
在 Debian 上
```
$ sudo apt update
$ sudo apt install build-essential zlib1g-dev \
libncurses5-dev libgdbm-dev libnss3-dev \
libssl-dev libreadline-dev libffi-dev curl
```
在 Fedora 上:
```
$ sudo dnf groupinstall development
```
#### 步骤 2下载最新的稳定版本的 Python 3
访问[官方 Python 网站][4]并下载最新版本的 Python 3。下载完成后你会有一个 `.tar.xz` 归档文件“tarball”其中包含 Python 的源代码。
#### 步骤 3解压 tarball
下载完成后,使用解压程序或 [Linux 的 tar 命令][5]解压压缩包,例如:
```
$ tar -xf Python-3.?.?.tar.xz
```
#### 步骤 4配置脚本
解压 Python 压缩包后,进入 `configure` 脚本所在目录并在 Linux 终端中使用以下命令执行该脚本:
```
$ cd Python-3.*
./configure
```
配置可能需要一些时间。等待直到成功完成,然后再继续。
#### 步骤 5开始构建过程
如果你的系统上已经安装了某个版本的 Python并且希望同时安装新版本的 Python请使用以下命令
```
$ sudo make altinstall
```
构建过程可能需要一些时间。
如果要使用此版本替换当前版本的 Python那么应使用包管理器例如 `apt``dnf`)卸载当前的 Python 包,然后安装:
```
$ sudo make install
```
但是,通常最好以软件包的形式(例如 `.deb``.rpm` 文件)来安装软件,以便系统可以为你跟踪和更新它。因为本文假设尚未打包最新的 Python所以你可能没有这个选择。在这种情况下你可以按照建议使用 `altinstall` 来安装 Python或者使用最新的源代码重构现有的 Python 包。这是一个高级主题,并且特定于你的发行版,因此不在本文讨论范围之内。
#### 步骤 6验证安装
如果你没有遇到任何错误,那么现在你的 Linux 系统上已安装了最新的 Python。要进行验证请在终端中输入以下命令之一
```
python3 --version
```
或者
```
python --version
```
如果输出显示 `Python 3.x`,那么说明 Python 3 已成功安装。
### 创建虚拟环境(可选)
Python 提供了名为 `venv`(虚拟环境)的软件包,可帮助你将程序目录或软件包与其他目录或软件包隔离。
要创建虚拟环境,请在 Python 终端中输入以下内容(在此示例中,假定你安装的 Python 版本为 `3.8` 系列):
```
python3.8 -m venv example
```
该命令创建一个带有一些子目录的新目录(我将其命名为 `example`)。
要激活虚拟环境,请输入:
```
$ source example/bin/activate
(example) $
```
请注意,你的终端提示符(`$`)现在以环境名称开头。
要停用虚拟环境,请使用 `deactivate` 命令:
```
(example) $ deactivate
```
### 总结
Python 是一种有趣的语言,它的开发和改进非常频繁。一旦了解了如何安装最新版本而又不干扰发行版提供的稳定版本,熟悉新功能将很容易。
如果你有任何反馈或问题,请在评论中提出。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/install-python-linux
作者:[Vijay Singh Khatri][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/vijaytechnicalauthor
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM)
[2]: https://www.python.org/
[3]: http://pypl.github.io/PYPL.html
[4]: http://python.org
[5]: https://opensource.com/article/17/7/how-unzip-targz-file

View File

@@ -0,0 +1,82 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12128-1.html)
[#]: subject: (How to Open Files and Folders as Administrator in Nautilus File Manager in Linux)
[#]: via: (https://itsfoss.com/open-nautilus-as-administrator/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
如何在 Linux 的 Nautilus 文件管理器中以管理员身份打开文件和文件夹
======
> 了解如何在 Ubuntu 和其他 Linux 发行版的 Nautilus 文件管理器的右键菜单中添加“以管理员身份打开”选项。
![](https://img.linux.net.cn/data/attachment/album/202004/19/211224hurk01u0kuvqnpvn.jpg)
如果要以根用户身份打开或编辑文件,你总是可以在终端中执行此操作。但我知道有些人对命令行不适应。
桌面 Linux 通常为那些害怕终端的人提供方法避免命令行。
如果你必须以 root 用户身份访问文件夹或以 root 用户权限编辑文件,那你可以在 [Nautilus 文件管理器][1]中以图形方式进行操作。
一个小巧优雅的 Nautilus 技巧能让你以管理员(也就是 root打开文件和文件夹。让我向你展示如何做。
### 在 Nautilus 文件管理器的右键菜单中添加“以管理员身份打开”选项
> 警告!请不要以 root 用户身份打开和编辑随机文件,因为这样可能会弄乱文件并导致系统损坏。仅在需要时使用它。
我展示的是 Ubuntu 的步骤。你可以根据你的发行版的软件包管理器进行更改。
你必须使用终端(即使你不喜欢它)来安装 Nautilus 插件。请[确保已启用 Universe 仓库][4]
```
sudo apt install nautilus-admin
```
关闭并再次打开 Nautilus 文件管理器以查看更改生效。
![Right clock to see the “Open as Administrator” option][5]
你也可以用 root 用户身份编辑文件。只需选择文件,右键单击它,然后选择“以管理员身份编辑”选项。
![Edit Files As Root Ubuntu][6]
这两种情况下,系统都会提示你输入帐户密码:
![You need to enter your password, of course][7]
差不多了。你可以享受 GUI 的舒适了。
如果你不想再以 root 用户身份运行 Nautilus那么可以删除此插件。删除已安装但不再使用的其他东西总是没错的。
在终端中(没错,再一次在终端),使用以下命令删除 Nautilus 插件。
```
sudo apt remove nautilus-admin
```
顺便说一句,如果你在使用 [Ubuntu MATE][8],你可以使用 caja-admin 代替 nautilus-admin。其他文件管理器可能会或可能不会提供此类功能。
我希望这个快速技巧对你有所帮助。随时欢迎提出问题和建议。
--------------------------------------------------------------------------------
via: https://itsfoss.com/open-nautilus-as-administrator/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://wiki.gnome.org/Apps/Files
[3]: https://itsfoss.com/root-user-ubuntu/
[4]: https://itsfoss.com/ubuntu-repositories/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/open-folder-as-administrator-ubuntu.jpg?ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/edit-files-as-root-ubuntu.jpg?ssl=1
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/authentication-pop-up-ubuntu.png?ssl=1
[8]: https://ubuntu-mate.org/

View File

@@ -0,0 +1,169 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12143-1.html)
[#]: subject: (How to package Python applications for Linux)
[#]: via: (https://opensource.com/article/20/4/package-python-applications-linux)
[#]: author: (Moshe Zadka https://opensource.com/users/moshez)
如何为 Linux 打包 Python 应用
======
> 了解如何使用 dh_virtualenv 来让你的 Python 应用可作为 .deb 包安装。
![](https://img.linux.net.cn/data/attachment/album/202004/23/235547iztz5d955t9s9b5t.jpg)
在基于 Debian 的操作系统(例如 Debian 或 [Elementary OS][2])上安装 Python 应用的一种方法是使用 [dh_virtualenv][3] 工具。它可以构建一个 `.deb` 包,在应用之外封装了一个 Python 虚拟环境,并在安装时进行部署。
在本文中,我将以构建一个包含 [HTTPie][4] 工具的包为例来解释如何使用它,以便在无需激活虚拟环境的情况下从命令行测试 HTTP API。
### 使用 dh_virtualenv 打包
首先,你需要安装 `dh_virtualenv` 所需的工具。`dh_virtualenv` 的[文档][5]提供了所有安装选项。在基于 Debian 的系统上,我输入:
```
apt-get install dh-virtualenv devscripts
```
尽管不需要 [devscripts][6] 包,但它可以简化后续操作。
现在,创建一个目录来保存源码。由于这是一个本地的、非官方的 HTTPie 打包,因此我将其称为 `myhttp`。接下来,让我们在 `myhttp` 内创建一些文件,向 Debian 构建系统提供元数据。
首先,创建 `debian/control` 文件:
```
Source: myhttp
Section: python
Priority: extra
Maintainer: Jan Doe <jandoe@example.org>
Build-Depends: debhelper (>= 9), python3.7, dh-virtualenv (>= 0.8)
Standards-Version: 3.9.5
Package: myhttp
Architecture: any
Pre-Depends: dpkg (>= 1.16.1), python3.7, ${misc:Pre-Depends}
Depends: ${misc:Depends}
Description: http client
Useful for doing stuff
```
那么这些是什么信息呢?正如 [Debian 文档][8]指出的:
>“第 17 行是源码包的控制信息。第 913 行是二进制包的控制信息。”
以下是我使用的:
* `Section` 的值对于我们来说大多没有意义,但需要存在。它对给引导式 UI 安装程序提供信息是有意义的,但对于这个包来说,没有意义。
* `Priority` 对像这样的第三方包的正确值是 `extra`
* 强烈建议在 `Maintainer` 字段中填写正确的联系人信息。但不一定非得是你的个人电子邮件,如果包由团队维护,并且你希望将问题发送到团队的邮件别名,例如 `Infrastructure Team <infra-team-list@company.example.com>`
* `Build-Depends` 字段标识你需要 `debhelper``python``dh-virtualenv` 来构建包:包构建过程中将确保这些依赖项在包构建时已安装。
* `Standards-Version` 字段主要给人看。它表明你遵循的指南。本指南基于 `dh-virtualenv` 的官方文档,它是基于 Debian 的 3.9.5 指南。最好一直将源码包和二进制包命名相同。
* `Architecture` 字段应为 `Any`,因为除非虚拟环境可能包含一些特定于体系结构的文件。否则,最好选择该字段为 `any`
* 保持 `Pre-Depends` 列表不变:它是一种非常严格的依赖关系形式,你很少会需要比这里建议的最小依赖更多的依赖项。依赖项通常由构建系统准确计算,因此没有理由手动指定它们。
* 如果你的包主要用于内部,那么 `Description` 字段可能只需要最少的信息或者指向公司 wiki 的链接,不然更多的信息会更有用。
然后创建 `debian/compat` 文件,它[主要出于历史目的而存在][10]
```
$ echo "9" > debian/compat
```
接下来,创建更新日志以告知包用户自上次发布以来发生了什么变化。最简单的方法是使用 `dch --create` 创建模板,然后填写值。
填写后,它看起来像:
```
myhttp (2.0.0-1) stable; urgency=medium
* Initial release.
-- Jan Doe <jandoe@example.org> Fri, 27 Mar 2020 01:09:22 +0000
```
现在你需要告诉工具安装 HTTPie但是哪个版本
创建一个宽松版本的 `requirements.in` 文件:
```
httpie
```
通常,宽松的需求文件将仅包含项目的直接依赖项,并在需要时指定最低版本。不一定总是需要指定最低版本:这些工具通常偏向于将依赖关系转化为“可能的最新版本”。如果你的 Debian 包与一个内部 Python 包相对应,这是内部应用中的一种常见情况,那么宽松的需求文件看起来将很相似:仅包含包名的一行。
然后使用 `pip-compile`(可通过安装 PyPI 包 `pip-tools` 获得):
```
$ pip-compile requirements.in > requirements.txt
```
这会生成一个严格的依赖文件,名为 `requirements.txt`
```
#
# This file is autogenerated by pip-compile
# To update, run:
#
# pip-compile requirements.in
#
certifi==2019.11.28 # via requests
chardet==3.0.4 # via requests
httpie==2.0.0 # via -r requirements.in
idna==2.9 # via requests
pygments==2.6.1 # via httpie
requests==2.23.0 # via httpie
urllib3==1.25.8 # via requests
```
最后,写一个 `debian/rules` 文件来创建包。因为 `dh_virtualenv` 会处理所有困难的事,因此规则文件很简单:
```
#!/usr/bin/make -f
%:
dh $@ --with python-virtualenv --python /usr/bin/python3.7
```
确保指定 Python 解释器。默认它会使用 `/usr/bin/python`,这是 Python2但是你应该使用一个[受支持的 Python 版本][11]。
完成了,接下来就是构建包:
```
$ debuild -b -us -uc
```
这会在父目录生成一个类似 `myhttp_2.0.0-1_amd64.deb` 的文件。该文件可在任何兼容的系统上安装。
通常,最好在同一平台上构建用于特定平台(例如 Debian 10.0)的 Debian 包。
你可以将此 Debian 包保存在软件仓库中,并使用例如 [Ansible][12] 的工具将其安装在所有相关系统上。
### 总结
给基于 Debian 的系统的打包应用是一个有着多个步骤的过程。使用 `dh_virtualenv` 将使过程变得简单明了。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/package-python-applications-linux
作者:[Moshe Zadka][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/moshez
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-python.jpg?itok=F2PYP2wT (Python in a tree)
[2]: https://opensource.com/article/19/12/pantheon-linux-desktop
[3]: https://dh-virtualenv.readthedocs.io/en/latest/
[4]: https://opensource.com/article/19/8/getting-started-httpie
[5]: https://dh-virtualenv.readthedocs.io/en/1.1/tutorial.html
[6]: http://man.he.net/man1/devscripts
[7]: mailto:jandoe@example.org
[8]: https://www.debian.org/doc/manuals/maint-guide/dreq.en.html#control
[9]: mailto:infra-team-list@company.example.com
[10]: https://www.debian.org/doc/manuals/maint-guide/dother.en.html#compat
[11]: https://opensource.com/article/19/11/end-of-life-python-2
[12]: https://opensource.com/resources/what-ansible

View File

@@ -0,0 +1,329 @@
[#]: collector: (lujun9972)
[#]: translator: (Zioyi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12149-1.html)
[#]: subject: (12 Linux Commands to Have Some Fun in the Terminal)
[#]: via: (https://itsfoss.com/funny-linux-commands/)
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
12 个有趣的 Linux 终端命令
======
> 你觉得 Linux 终端里只有无趣的工作吗?那你一定不知道下面这些有趣的 Linux 命令吧。
Linux 终端是用来完成复杂的工作的,我们有很多有用的 [linux 命令奇技淫巧][1]来帮助你。
但是,你知道你还可以用终端来做很多有趣的事吗?如果你不知道,没关系,大多数 Linux 用户也都只把终端视为一个用来管理系统和开发工作的交互界面。
然而,如果你知道这里有些你可以在终端玩的[基于终端的游戏][2]和 [ASCII 码游戏][3],你一定会大吃一惊。
在这篇文章中,我将会探索一些有趣的、可笑的、荒谬的命令来让你可以在终端中找点乐子!
### 用这些命令在 Linux 终端中找点乐子
![][4]
你可能会觉得这些命令荒谬或没用,但是有一些还是可以被好好利用的。
我已经放上了 Ubuntu/Debian 的安装指令,如果你使用基于 Ubuntu 的发行版,请确保[启用 universe 仓库][5],因为大多数命令不在主仓库中。
如果你使用 Arch、Fedora、SUSE、Solus 或者其他非 Ubuntu 的发行版,请使用你的发行版包管理工具去安装这些有趣的 Linux 命令。
#### 1、在终端开一辆火车
让我们坐上火车,来一场说走就走的旅行的,没错,就是字面意思!
`sl` 命令可以让你在终端运行一辆火车。
![][6]
安装方法:
```
sudo apt install sl
```
完成后,你只要在终端输入下面的命令就可以开始:
```
sl
```
很精彩,对吧?但等等,我们还没结束!你还可以让你的火车飞起来,只要加上参数 `-F`,波特先生,请飞吧:
```
sl -F
```
这样会让火车长出翅膀飞出终端窗口!
#### 2、给你的 Linux 终端加上黑客帝国效果
还记得科幻电影[黑客帝国][7]吗?终端里掉落的绿色字符成为了黑客帝国的标志形象。
你也可以在你的 Linux 电脑里有这样的黑客帝国数字雨!你只需要安装 `cmatric` 然后在终端输入它就行。
![][8]
在 Debian/Ubuntu Linux 上安装 cmatrix:
```
sudo apt install cmatrix
```
现在,你要做的就是输入下面的命令,在终端就会有黑客帝国屏幕了:
```
cmatrix
```
按下 `Ctrl+C` 来停止它,黑客先生。
#### 3、燃起来
拿好灭火器,因为接下来你要在你的终端里点火了!
![][11]
想安装它,你要输入:
```
sudo apt install libaa-bin
```
完成后,你输入下面的命令,你的终端就会燃起一团火焰:
```
aafire
```
按下 `Ctrl+C` 来停止它。
#### 4、幸运饼干命令
想知道你的运气怎样但身边没有幸运饼干?
别担心,你只需在终端打出 `fortune` 然后按下回车。终端将会随机显示出一个幸运语,就像你从幸运饼干里得到的一样。
![][12]
安装它:
```
sudo apt install fortune
```
完成后,只要在命令行打出下面的内容,你就会知道你的运气怎样:
```
fortune
```
这是一个你可以实际使用的命令。你可以用它作为每日消息,这样在多用户环境下,每个用户登录后都会得到一个“幸运饼干”。
你也可以把它添加到 `bashrc` 文件,这样当你登进终端你就会看到了。
#### 5、宠物爱好者这是给你准备的
`oneko` 是一个有趣的命令,可以把你的光标变成一只老鼠,然后创造一只好奇的猫,一旦你移动光标,就会来追你。这不仅局限于终端。当猫追逐光标时,你可以继续工作。
如果你家里有孩子这一定很有趣。
![][13]
用下面的命令安装 `oneko`
```
sudo apt install oneko
```
用下面的命令运行它:
```
oneko
```
如果你不喜欢猫,喜欢狗,输入:
```
oneko -dog
```
它有很多种小宠物,你可以用 `oneko -help` 获取信息。按下 `Ctrl+C` 终止它。
#### 6、有个小兄弟在看着你
`xeyes` 是一个很小的 GUI 程序,它可以绘制出一双眼睛一直盯着你!它会不断跟随你的鼠标光标,运行命令自己看看!
![][14]
你可以用下面命令安装:
```
sudo apt install xeyes
```
然后这样用它:
```
xeyes
```
按下 `Ctrl+C` 终止它。
#### 7、让终端帮你讲话
打开你的扬声器,你来试试这个命令,[eSpeak][15] 是一个有趣的命令,它可以让你的终端说话。是的,你没听错。
先安装这个包:
```
sudo apt install espeak
```
接下来,你只需要输入在命令行中输入你想听到的话:
```
espeak "Type what your computer says"
```
无论你在双引号里面填什么,你的电脑都会复述出来!它就像[在 Linux 中的 echo 命令][16],但不是打印出来,而是说出来。
#### 8、Toilet但与洗手间无关
这听起来有点奇怪,是的。但是,这只是一个命令,用来将文本转换成大的 ASCII 字符。
![][17]
用这个命令安装 `toilet`
```
sudo apt install toilet
```
完成后,你只需输入:
```
toilet sample text you want
```
我也不知道为啥这个小程序叫 Toilet。
#### 9、那个牛说什么
`cowsay` 是一个在终端中用 ASCII 字符展示出一头牛的命令。通过这个命令,你可以控制牛说出你想说的话。
别纠结声音,它只展示文本(就是你看漫画书一样)。
![Cowsay Cowthink][18]
安装 `cowsay`
```
sudo apt install cowsay
```
安装完成后,你只要输入:
```
cowsay "your text"
```
无论你在双引号里填什么,你的牛都会说!我看到一些系统管理员用它来展示每天的消息。你也可以这样,你甚至可以把它和 `fortune` 命令结合。
#### 10、旗帜
`banner` 命令与 `toilet` 命令相似,但它限制最多只能打印 10 个字符。
![][19]
你可以这样安装 `banner` 命令:
```
sudo apt install sysvbanner
```
然后这样运行:
```
banner "Welcome"
```
替换双引号里的内容,你将会得到你想要的展示内容。
#### 11、Yes
![][20]
`yes` 命令帮助你在循环中自动响应直到终止命令。这个命令将会一直打印相同的内容。如果你想快速生成大量垃圾文本,那么此命令将像超级按钮一样工作。
你也可以使用它为命令提供 `yes` 应答(如果提示应答时)。例如,`apt upgrade` 命令会要求你确认,你可以像这样使用它:
```
yes | sudo apt upgrade
```
你不需要安装任何包,`yes` 命令已经存在了。
想要终止 `yes` 命令循环,只需按下 `CTRL+C`
#### 12、得到一个新的身份
要生成一个随机的假身份吗?我推荐你用 `rig` 命令。你在终端运行它,就会生成一个假的身份。
![][21]
用这个命令安装 `rig`
```
sudo apt install rig
```
只需像这样输入:
```
rig
```
它可能被用在脚本或者 web 应用中展示随机信息,但我自己还没做过什么。
### 结尾
我希望你会喜欢这个有趣的 Linux 命令列表。你最喜欢哪个命令呢?你还知道其他有趣的命令吗?请在评论部分与我们分享。
--------------------------------------------------------------------------------
via: https://itsfoss.com/funny-linux-commands/
作者:[Srimanta Koley][a]
选题:[lujun9972][b]
译者:[Zioyi](https://github.com/Zioyi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/linux-command-tricks/
[2]: https://itsfoss.com/best-command-line-games-linux/
[3]: https://itsfoss.com/best-ascii-games/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fun-linux-commands.png?ssl=1
[5]: https://itsfoss.com/ubuntu-repositories/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sl-command.jpg?ssl=1
[7]: https://en.wikipedia.org/wiki/The_Matrix
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/matrix-screen-command.png?ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png?fit=732%2C462&ssl=1
[10]: https://itsfoss.com/star-wars-linux/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fire-command.png?ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fortune-command.jpg?ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/oneko-command.jpg?ssl=1
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/xeyes-command.jpg?ssl=1
[15]: https://itsfoss.com/espeak-text-speech-linux/
[16]: https://linuxhandbook.com/echo-command/
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/toilet-command.jpg?ssl=1
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/cowsay-cowthink.jpg?ssl=1
[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/banner-command.jpg?ssl=1
[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/yes-yourtext.jpg?ssl=1
[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/rig-command.jpg?ssl=1
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/srimanta.jpg?ssl=1

View File

@@ -0,0 +1,51 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12138-1.html)
[#]: subject: (Ethernet consortium announces completion of 800GbE spec)
[#]: via: (https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html)
[#]: author: (Andy Patrizio https://www.networkworld.com/author/Andy-Patrizio/)
以太网技术联盟宣布完成 800Gb 以太网规范
======
> 800Gb 以太网规范使当前以太网标准的最高速度提高了一倍,但同时也对包括延迟在内的其他方面进行了调整。
![](https://images.techhive.com/images/article/2017/05/170522-networking-2-100723415-large.jpg)
由业界支持的<ruby>以太网技术联盟<rt>Ethernet Technology Consortium</rt></ruby>ETC已宣布完成 800Gb 以太网技术规范。
新规范基于当前高端 400Gb 以太网协议中使用的许多技术,新规范正式称为 800GBASE-R。设计它的联盟当时称为 25Gb 以太网联盟)在开发 25、50 和 100Gb 以太网协议方面也发挥了重要作用,其成员包括 博通、思科、谷歌和微软。
800Gb 以太网规范增加了新的<ruby>介质访问控制<rt>media access control</rt></ruby>MAC和<ruby>物理编码子层<rt>physical coding sublayer</rt></ruby>PCS方法新规范对这些功能进行了调整来使用 8 条 106.25Gbps 的物理通道分发数据。通道可以是铜双绞线也可以是光缆一束光纤或光波。800GBASE-R 规范建立在两个 400 GbE 2xClause PCS 之上,以创建一个以 800Gbps 的总速率运行的单个 MAC。
尽管主要是使用八条 106.25Gb 通道,但这并不是固定的。它可以以一半的速度 53.125Gbps 使用 16 条通道。
新标准提供了 400G 以太网规范的一半延迟,但是新规范也将运行在 50 Gbps、100 Gbps 和 200 Gbps 的网络上的<ruby>前向纠错<rt>forward error correction</rt></ruby>FEC开销减少了一半从而减少了网卡上的数据包处理负担。
通过降低延迟,这将满足对延迟敏感的应用(例如[高性能计算][2]和人工智能)中对速度的需求,在这些应用中,需要尽可能快地移动大量数据。
从 400G 增加到 800G 并不是太大的技术飞跃。它意味着在相同的传输速率下增加更多的通道,再做一些调整。但是,要想突破 Tb 级Cisco 和其他网络公司已经讨论了十年了,这将需要对技术进行重大修改,而且并非易事。
新技术可能也不便宜。800G 可与现有硬件一起使用,而 400Gb 以太网交换机价格不菲,高达六位数。对技术进行重大修改,越过 Tb 障碍,可能会变得更加昂贵。但是对于大客户和高性能计算客户而言,这也是情理之中的事。
ETC 并未透露何时会支持 800G 的新硬件,但考虑到它对现有规格的变化不大,它可能会在今年出现,前提是疫情引起的停滞不会影响它。
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3538529/ethernet-consortium-announces-completion-of-800gbe-spec.html
作者:[Andy Patrizio][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Andy-Patrizio/
[b]: https://github.com/lujun9972
[2]: https://www.networkworld.com/article/3444399/high-performance-computing-do-you-need-it.html
[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[4]: https://www.facebook.com/NetworkWorld/
[5]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,121 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12146-1.html)
[#]: subject: (Ubuntu 20.04 LTS Released. Download Now!)
[#]: via: (https://itsfoss.com/download-ubuntu-20-04/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
Ubuntu 20.04 LTS 下载及新特性
======
> Ubuntu 20.04 LTS Focal Fossa 终于发布了。以下是 Ubuntu 20.04 的新功能和下载链接以及Ubuntu 20.04的官方风味版。
等待终于结束了。Ubuntu 20.04 LTS 终于来了,可以下载了!
![][1]
如果你已经在使用 Ubuntu 19.10,你可能发现没有太多明显的差异 —— 但我所看到的改进清单确实令人印象深刻。
如果你想知道有什么新的东西,我将会提到这个版本的几个主要亮点。
### Ubuntu 20.04 有什么新特性?
与之前的 18.04 LTS 版本相比Ubuntu 20.04 LTS 有很多视觉上的改变,同时也包括了一些底层的改进。
当然,随着 [GNOME 3.36][2] 的加入,视觉上的重大升级和性能上的提升是相当明显的。以下是一段视频,重点介绍了 Ubuntu 20.04 中的新功能。
- [What's New in Ubuntu 20.04 Take a Look at the Top Features](https://youtu.be/9u5B0njRgOw)
如果你有兴趣的话,你也可以深入到我们的文章中去看看,重点介绍 [Ubuntu 20.04 的新功能][3]。
不管是哪种情况,让我来给你介绍一些亮点。
* GNOME 3.36 是默认的桌面系统
* 性能提高了很多
* 新的 Yaru 主题很华丽,也有黑暗模式。
* 你不会再看到亚马逊应用程序,它已经永远消失了!
* 改进的 [ZFS][4] 支持
* 你可以获得最新的 [Linux 内核 5.4][5]LTS
* 增加了对 exFAT 的支持
* 改进硬件和图形支持
* 更新软件 Python 3.8.2
* Wireguard 已被移植到 Linux 内核5.4,可以在 Ubuntu 20.04 上使用。
如果你想看详细的功能介绍,请观看这段视频,重点介绍 20.04 LTS 的最佳功能。
- [Top 7 Best Features You'll Love in Ubuntu 20.04](https://youtu.be/lpq8pm_xkSE)
如果你是 Ubuntu 的新手,对 Ubuntu 20.04 有疑问,我们也为你提供了一篇快速的 [Ubuntu 20.04 FAQ][7] 文章。
### 从 18.04 和 19.10 升级到 Ubuntu 20.04
如果你已经在使用 Ubuntu 18.04 或 19.10,你可以从系统中轻松升级到 Ubuntu 20.04。
这样一来,当你开始使用新版本的时候,你的文件和大部分的应用程序设置都会保持原样,而无需从 ISO 中重新安装。
你可以阅读此详细教程来学习[如何将 Ubuntu 升级到新版本][8]。
请注意,如果你使用的是 Lubuntu 18.04,请不要升级到 Lubuntu 20.04。Lubuntu 18.04 使用的是 Lxde 桌面,而后面的版本使用的是 LXQt 桌面。这样升级可能会导致冲突和系统崩溃。
### 下载 Ubuntu 20.04 LTS
你可以抓取 ISO 或 torrent 文件,这取决于你喜欢什么。
- [Ubuntu 20.04 LTS (ISO)][9]
- [Ubuntu 20.04 LTS (Torrent)][10]
请按照本教程学习[如何安装 Ubuntu][11]。
### 下载Ubuntu 20.04 LTS官方版下载
如果你想在不同的桌面环境下得到 Ubuntu 的官方版本,请按照下面的链接进行操作。
- [Ubuntu MATE 20.04 LTS][12]
- [Kubuntu 20.04 LTS][13]
- [Xubuntu 20.04 LTS][14]
- [Ubuntu Budgie 20.04 LTS][15]
- [Ubuntu Studio 20.04 LTS][16]
- [Lubuntu 20.04 LTS][17]
如果你没有在各自的官方网站上找到最新的 ISO/torrent 文件,只需前往 [cdimages.ubuntu.com][18] 找到所有的版本。
接下来,导航到“发行版名称” -> “releases” -> “20.04” -> “release”然后你应该可以找到列出的 ISO 和 torrent 文件的链接。
如果你有问题,请参考这篇文章,它回答了[关于 Ubuntu 20.04 的常见问题][7]。如果你要安装,请查看我们推荐的[安装 Ubuntu 20.04 之后要做的事情][19]。
享受 Ubuntu 20.04 LTS Focal Fossa
--------------------------------------------------------------------------------
via: https://itsfoss.com/download-ubuntu-20-04/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[wxy](https://github.com/wxy)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Ubuntu-20.04-LTS-released.png?ssl=1
[2]: https://itsfoss.com/gnome-3-36-release/
[3]: https://itsfoss.com/ubuntu-20-04-release-features/
[4]: https://itsfoss.com/what-is-zfs/
[5]: https://itsfoss.com/linux-kernel-5-4/
[6]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[7]: https://itsfoss.com/ubuntu-20-04-faq/
[8]: https://itsfoss.com/upgrade-ubuntu-version/
[9]: http://releases.ubuntu.com/focal/ubuntu-20.04-desktop-amd64.iso
[10]: http://releases.ubuntu.com/focal/ubuntu-20.04-desktop-amd64.iso.torrent
[11]: https://itsfoss.com/install-ubuntu/
[12]: https://ubuntu-mate.org/download/amd64/focal/
[13]: https://kubuntu.org/getkubuntu/
[14]: https://xubuntu.org/download/
[15]: https://ubuntubudgie.org/downloads/
[16]: https://ubuntustudio.org/
[17]: https://lubuntu.me/downloads/
[18]: http://cdimages.ubuntu.com/
[19]: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/

View File

@@ -0,0 +1,56 @@
[#]: collector: (lujun9972)
[#]: translator: (CrazyShipOne)
[#]: reviewer: (wxy)
[#]: publisher: (wxy)
[#]: url: (https://linux.cn/article-12157-1.html)
[#]: subject: (What you need to know about open source ad blockers)
[#]: via: (https://opensource.com/article/20/4/ad-blockers)
[#]: author: (Joshua Pearce https://opensource.com/users/jmpearce)
开源的广告拦截器不但节能,而且能拯救生命!
======
> 三个开源广告拦截器与“无广告拦截器”对照组进行了测试。
![](https://img.linux.net.cn/data/attachment/album/202004/27/220109b86sidn56sn6inoh.jpg)
一项旨在调查自由开源的广告拦截器节能的情况的[研究][2],意外地发现了互联网广告正在浪费你大量的时间。
更重要的是,研究结果表明了你可以挽救回这些失去的时间。这项研究评估发现,使用 [uBlock Origin][3](一个开源免费的广告拦截器)的情况下平均每个网民一年可以节约超过 100 个小时的时间。uBlock Origin 是测试中最有效的广告拦截器,不过其他的广告拦截器也为网民节省了时间、能源以及金钱。
![Ad blocker screen comparison][4]
在研究结果中,[AdBlock+][5] 减少了 11% 的页面加载时间,[Privacy Badger][6] 减少了 22%[uBlock Origin][3] 减少了 28%。对于单独一个页面来说这个时间並不算多,但是网民们一半以上的浏览时间都是在网站间快速跳转,通常在一个页面停留少于 15 秒。鉴于这种情况,加载广告的额外时间加起来就很多了。
发布于 Technologies 杂志上的《[用开源的广告拦截器节能][7]》一文最初旨在解决日益增长的能源消耗问题。随着全球网民每日上网时间超过 6.5 小时,与互联网相关的用电量正在快速地增加。以美国人为例,自 2000 年他们的上网时间已经增加了一倍,几乎达到每周 24 小时。开源广告拦截器通过消灭上网和观看视频时产生的广告,潜在地减少了时间,从而减少用电。
在研究过程中对三个开源广告拦截器与“无广告拦截器”对照组进行了测试。研究人员记录了浏览全球访问量最大的网站的页面加载时间其中包括网络搜索谷歌、雅虎、必应、信息Weather.com、维基百科和新闻网站CNN、福克斯、纽约时报。除此之外研究还分析了观看流行与非流行视频内容时广告所花费的时间。这部分研究由于缺乏 Youtube 上流行和非流行内容观看比例的数据而非常具有挑战性。每个视频浪费在广告观看上的时间可以从 0.06% 到惊人的 21% 不等。而且,这还只是浏览器上记录的加载广告而失去的时间。
总的来说研究结果表明加载广告所浪费的能源并不是是小事。由于运行电脑所使用的大量电力仍然来自于煤炭而煤炭会造成空气污染和过早死亡因此该研究分析了广告拦截器拯救美国人生命的潜力。LCTT 译注:由于这项研究是美国人完成的,所以这里仅提及了美国人,但是同理可推至全球。)结果是令人震惊的:如果美国人都使用开源广告拦截器,每年节约的能源将会拯救超过 36 个美国人的生命。
电能即金钱,所以削减广告也可以为消费者节约钱财。在美国,如果所有的网民都在他们的电脑上开启 [Privacy Badger][8],美国人每年可以节约超过 9100 万美元。在全球范围内调查研究的结果则更令人吃惊。uBlock Origin 每年可以为全球消费者节约 18 亿美元。
这项研究始于人们因为新冠肺炎大流行而被迫居家之前,因此所有的数据都可以被认为是保守的估算。整体来说,研究发现了开源广告拦截器是一项潜在的节能技术。
虽然自由开源的广告拦截器可以节约能源,对自然环境也有好处,但你可能主要是为了拦截恼人的广告和节省自己的时间而使用它们。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/ad-blockers
作者:[Joshua Pearce][a]
选题:[lujun9972][b]
译者:[CrazyShipOne](https://github.com/CrazyShipOne)
校对:[wxy](https://github.com/wxy)
本文由 [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/browser_desktop_website_checklist_metrics.png?itok=OKKbl1UR (Browser of things)
[2]: https://www.mdpi.com/2227-7080/8/2/18
[3]: https://github.com/gorhill/uBlock
[4]: https://opensource.com/sites/default/files/uploads/os_ad_blocker_story_.png (Ad blocker screen comparison)
[5]: https://adblockplus.org/
[6]: https://privacybadger.org/
[7]: https://www.academia.edu/42434401/Energy_Conservation_with_Open_Source_Ad_Blockers
[8]: https://privacybadger.org/

View File

@@ -1,65 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Ansible streaming video series, open source security tools, and more industry trends)
[#]: via: (https://opensource.com/article/20/4/ansible-security-more-industry-trends)
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
Ansible streaming video series, open source security tools, and more industry trends
======
A weekly look at open source community and industry trends.
![Person standing in front of a giant computer screen with numbers, data][1]
As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update.
## [Ansible 101 by Jeff Geerling: a YouTube streaming series][2]
> After the incredible response I got from [making my Ansible books free for the rest of March][3] to help people learn new automation skills, I tried to think of some other things I could do to help developers who may be experiencing hardship during the coronavirus pandemic and market upheaval.
**The impact**: Not everyone is a frontline worker in this crisis, but then not every problem it has created needs one. This is a great example of someone using their resources to help in a unique way.
## [Open source security tools for cloud and container applications][4]
> Open-source security tools play an important role in securing your container-based infrastructure. Tools such as Anchore can be used for strong governance capabilities, while on the other hand, Dagda can be used to perform static analysis of known vulnerabilities. Two other tools, OpenSCAP and Clair, also provide good capabilities for vulnerability scanning and compliance management. So, depending upon your business requirements and priorities, you can select the right tool to secure your container investments.
**The impact**: Containers are Linux, and container security is open source as well.
## [Cloud cover: Clearing up some misunderstandings about data centres][5]
> The [carbon footprint of data][6] is becoming more and more of a concern, but there appears to be little economic interest in decreasing the amount of data flowing around the world to mitigate this. In that scenario, finding the most energy-efficient and carbon-neutral ways to run purpose-built data centres could be the only answer.
**The impact**: I was talking to a colleague who manages a team of virtualization engineers about this very problem. He seemed optimistic about the amount of headway his team could make on improving the energy consumption of things like KVM at the kernel level; though at the moment customers aren't asking for it. I'd guess that if, for example, the price of carbon emissions were to go up for some reason, that situation would change pretty quickly.
## [Business culture is key in OpenStack network requirements][7]
> The main question is: What is your [culture][8]? Do you go to a vendor and say, 'Give me your design, tell me what to buy and how to support it'? Starting out, you evaluate systems. What are your options?
>
> If you have siloed folks that work on a particular model of equipment, then OpenStack is probably not for you. If you have people that function at a higher level with some fundamental understanding about the underlying architecture that makes things work, then OpenStack can be very useful for you, and you're much less restricted.
**The impact:** Not every organization can adopt a given technology. Certainly not without a willingness to change at a fundamental level.
_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/ansible-security-more-industry-trends
作者:[Tim Hildred][a]
选题:[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/thildred
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://www.jeffgeerling.com/blog/2020/ansible-101-jeff-geerling-youtube-streaming-series
[3]: https://www.jeffgeerling.com/blog/2020/you-can-get-my-devops-books-free-rest-month
[4]: http://techgenix.com/open-source-security-tools/
[5]: https://www.siliconrepublic.com/enterprise/data-centres-seamus-dunne-interxion
[6]: https://www.siliconrepublic.com/machines/data-carbon-footprint
[7]: https://searchnetworking.techtarget.com/feature/Business-culture-is-key-in-OpenStack-network-requirements
[8]: https://whatis.techtarget.com/definition/corporate-culture

View File

@@ -1,74 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (IBM taps new leaders for hybrid cloud battles ahead)
[#]: via: (https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html)
[#]: author: (Michael Cooney https://www.networkworld.com/author/Michael-Cooney/)
IBM taps new leaders for hybrid cloud battles ahead
======
IBM installs Arvind Krishna as CEO, and appoints Red Hat execs to round out new cloud-oriented team
Stephen Lawson/IDG
Amid the business chaos COVID-19 is causing, IBM has set its course by [installing][1] Arvind Krishna as CEO and Red Hat CEO Jim Whitehurst as IBM president.  The company also named Red Hat veteran Paul Cormier as CEO of Red Hat.
Krishna replaces long-time CEO Virginia Rometty, who will  retire at the end of the year, and the package of executive moves solidifies the team that will lead Big Blue into to [hybrid-cloud][2] world where it will battle Amazon, Google and Microsoft.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][3]
Right now, though, that team must also compete in the face the COVID-19 pandemic, an issue [Krishna][4] mentioned in a [letter he posted on LinkedIn][5] on his first day on the job, April 6.
“During this challenging time, we all need to have empathy, solidarity, and understanding for each other…If theres one thing that this public health crisis has brought to light it is the ever essential role of IBM in the world. We are the backbone of some of the most critical systems of the world. Our technologies and services help banks run credit-card transactions, businesses run supply chains, telcos connect customers, healthcare providers improve patient care, and companies and cities tackle cyberthreats,” Krishna wrote.
IBM has been part of the technology community that is helping address COVID-19.  For example, [IBM Research][6] has been developing cloud and AI-powered technologies that can help researchers battle against coronavirus, in part by accelerating COVID-19 drug discovery. 
IBM is also leading the [COVID-19 High Performance Computing Consortium][7] with AWS, Google, HPE, and Microsoft as well as US National Labs, NASA, and others to bring [high-performance computing][8] systems together to help researchers run massive modeling calculations.
While COVID-19 is a focus for now, the long term-goal is developing cloud technologies.
[][9]
“I believe we can make IBM the most trusted technology partner of the 21st century. For this to happen, we have to ensure that IBM continues to innovate and lead in the transformational journeys our clients are on. Hybrid cloud and AI are two dominant forces driving change for our clients and must have the maniacal focus of the entire company,” he stated.
### Linux, Kubernetes and containers
Krishna also wrote about IBMs strategic cloud directions going forward. “First, we have to deepen our understanding of IBMs two strategic battles: the journey to hybrid cloud and AI. We all need to understand and leverage IBMs sources of competitive advantage. Namely, our open source and security leadership, our deep expertise and trust, and the fact that we enable clients to build mission-critical applications once and run them anywhere,” Krishna stated.
IBM also has to win the battle for architecting the cloud. “Theres a unique window of opportunity for IBM and Red Hat to establish [Linux][10], containers and Kubernetes as the new standard. We can make Red Hat OpenShift the default choice for hybrid cloud in the same way that Red Hat Enterprise Linux is the default choice for the operating system,” Krishna stated.
When IBM closed its [acquisition][11] of Red Hat last July for $34 billion it was clear it would take on the hybrid-cloud market and now, especially with the current executive team in place, that path is set more solidly.
Krishna, 57, was a principal architect of IBMs $34 billion acquisition of Red Hat last year and was IBMs senior vice president of Cloud and Cognitive Software. Red Hat said Cormier drove more than 25 acquisitions at Red Hat and is credited with pioneering the subscription model that transformed Red Hat from an open-source disruptor to an enterprise-technology mainstay.
Also as part of the new team, IBM said it tapped Bank of America telecom and cloud-technology executive Howard Boville as senior vice president of cloud platform, overseeing the IBM Cloud.
Join the Network World communities on [Facebook][12] and [LinkedIn][13] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3536654/ibm-taps-new-leaders-for-hybrid-cloud-battles-ahead.html
作者:[Michael Cooney][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Michael-Cooney/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/article/3518795/ibms-ceo-virginia-rometty-to-be-replaced-by-its-cloud-red-hat-chiefs.html
[2]: https://www.networkworld.com/article/3233132/what-is-hybrid-cloud-computing.html
[3]: https://www.networkworld.com/newsletters/signup.html
[4]: https://www.cnbc.com/video/2020/04/06/watch-cnbcs-full-interview-with-new-ibm-ceo-arvind-krishna.html?linkId=85936703
[5]: https://www.linkedin.com/pulse/my-first-day-ceo-our-journey-together-arvind-krishna/?trackingId=SRWcJy7mSzagoHDTJX%2Br2Q%3D%3D
[6]: https://www.ibm.com/thought-leadership/covid19/
[7]: https://www.networkworld.com/article/3533426/covid-19-tech-giants-government-agencies-add-supercomputing-to-the-fight.html
[8]: https://www.networkworld.com/article/3534725/the-ins-and-outs-of-high-performance-computing-as-a-service.html
[9]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[10]: https://www.networkworld.com/article/3215226/what-is-linux-uses-featres-products-operating-systems.html
[11]: https://www.networkworld.com/article/3317517/the-ibm-red-hat-deal-what-it-means-for-enterprises.html
[12]: https://www.facebook.com/NetworkWorld/
[13]: https://www.linkedin.com/company/network-world

View File

@@ -1,73 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news)
[#]: via: (https://opensource.com/article/20/4/news-april-11)
[#]: author: (Ben Cotton https://opensource.com/users/bcotton)
New Linux integrity checker from Microsoft, Raspberry Pi smart TV replacement from KDE, and more open source news
======
Catch up on the biggest open source headlines from the past two weeks.
![][1]
In this edition of our open source news roundup, we take a look at GNOME Foundation's new contributor program, a new Linux integrity checker from Microsoft, a free software alternative to smart TVs, and more!
### GNOME Foundation launches a new contributor program
A key part of keeping open source communities vibrant and healthy is bringing in new contributors. To help promote this, the GNOME Foundation and Endless teamed up to launch the inaugural [Community Engagement Challenge][2]. Phase one launched this week by opening the call for submitting project applications. Candidate projects should be aimed at bringing beginners into open source and encouraging ongoing participation in open source communities. Projects dont have to be coding, they can also be games, videos, written materials, and so on.
A panel of judges will select 20 projects to participate in phase two, where ideas will be turned into proofs of concept. At each phase, cash prizes will be awarded. [Proposals][3] are due July 1, 2020.
### Microsoft announces code integrity checker for Linux
When you run a program, you want it to be the one you think youre running. This week, Microsoft announced [Integrity Policy Enforcement][4] (IPE), a Linux Security Model released under the GPLv2.
IPE is targeted toward specific-purpose devices like network firewalls, not for general-purpose computing. It provides runtime verification that the code being executed matches the desired version. This allows administrators to detect and block altered binaries.
IPE is currently in the Request for Comments stage on the [linux-security-module][5] mailing list.
### KDE announces Plasma Bigscreen
I recently bought a new TV and, if you havent been in the market lately, its hard to find “dumb” televisions. I didnt want a smart TV because I worry about the manufacturer abandoning the software and what the device might do with my data. So KDEs recent [Plasma Bigscreen][6] announcement caught my eye.
Plasma Bigscreen takes the KDE Plasma interface I use every day and combines it with [Mycroft AI][7] to turn single-board computers into a smart TV. The beta, released last month, includes support for the Raspberry Pi 4 (Model B).
### In other news
* [IVPN for Android is now available on F-Droid][8]
* [IBM gives Outreachy $50,000 grant][9]
* [Warren For President Tech Team open source many of their projects][10]
* [Firefox 75.0 is released with a redesigned address bar and distribution via Flatpak][11]
* [LineageOS releases version 17.1 based on Android 10][12]
* [Linux kernel 5.6 released][13]
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/news-april-11
作者:[Ben Cotton][a]
选题:[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/bcotton
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd
[2]: https://www.gnome.org/challenge
[3]: https://surveys.gnome.org/index.php/986379?lang=en
[4]: https://microsoft.github.io/ipe/
[5]: https://lore.kernel.org/linux-security-module/20200406181045.1024164-1-deven.desai@linux.microsoft.com/T/#m297116cd00666428c2ae3e627ff39653ebb691fb
[6]: https://dot.kde.org/2020/03/26/plasma-tv-presenting-plasma-bigscreen
[7]: https://mycroft.ai/
[8]: https://www.ivpn.net/blog/ivpn-for-android-is-now-available-on-f-droid
[9]: https://developer.ibm.com/blogs/ibm-second-open-source-community-grant-outreachy/
[10]: https://medium.com/@teamwarren/open-source-tools-from-the-warren-for-president-tech-team-f1f27d2c7551
[11]: https://www.mozilla.org/en-US/firefox/75.0/releasenotes/
[12]: https://lineageos.org/Changelog-24/
[13]: https://lore.kernel.org/lkml/CAHk-=wi9ZT7Stg-uSpX0UWQzam6OP9Jzz6Xu1CkYu1cicpD5OA@mail.gmail.com/

View File

@@ -0,0 +1,53 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (State of software engineering, JavaScript is the future, and more industry trends)
[#]: via: (https://opensource.com/article/20/4/state-software-engineering-javascript-and-more-industry-trends)
[#]: author: (Tim Hildred https://opensource.com/users/thildred)
State of software engineering, JavaScript is the future, and more industry trends
======
A weekly look at open source community and industry trends.
![Person standing in front of a giant computer screen with numbers, data][1]
As part of my role as a senior product marketing manager at an enterprise software company with an open source development model, I publish a regular update about open source community, market, and industry trends for product marketers, managers, and other influencers. Here are five of my and their favorite articles from that update.
## [State of Software Engineering in 2020][2]
> Software is moving fast, and it is fusing into all other areas of industry. As it is a growing field, learning to program and improving your skills in software engineering can have get you great returns in the future. Moreover, identifying the fastest growing areas of software and investing your time into them can get you to even better places. Keep learning and try to find opportunities that you can capitalize on or products that can serve a niche in a growing field of software. When that niche becomes mainstream, you can end up with a successful product in your hands, which can become your future success. If it fails, it will be an immense experience on the path to becoming a product person.
**The impact**: Learn COBOL, see the world!
## [Why JavaScript is the programming language of the future][3]
> JavaScript has one of the most mature if not THE most mature ecosystems a programming language could ever have. The community for JavaScript is vast, and the entry barrier is extremely low.
**The impact**: The only knowledge I have of the veracity of this statement comes from the JavaScript people I follow on Twitter. If you can indeed extrapolate from them, then JavaScript has a pretty good shot.
## [Why Linux containers are a CIO's best friend][4]
> "A big take-away for CIOs is that fit enterprises increasingly view IT as a point of leverage for the business. Having a clear and consistent overall business strategy ranks as one of the most distinctive traits of fit enterprises," said Gartner VP and Distinguished Analyst Andy Roswell-Jones, in Gartner's report on the survey. "In such organizations, digital technology will drive that strategy."
**The impact**: Point of leverage meaning that if the IT an organization is selected in reference to and in support of that organization's overall strategy there will be an outsized lift on execution against that strategy. The corollary is that without a clear and consistent business strategy no technology can save your enterprise.
_I hope you enjoyed this list and come back next week for more open source community, market, and industry trends._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/state-software-engineering-javascript-and-more-industry-trends
作者:[Tim Hildred][a]
选题:[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/thildred
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/data_metrics_analytics_desktop_laptop.png?itok=9QXd7AUr (Person standing in front of a giant computer screen with numbers, data)
[2]: https://quanticdev.com/articles/software-engineering-in-2020/
[3]: https://www.freecodecamp.org/news/future-of-javascript/
[4]: https://www.ciodive.com/news/linux-containers-kubernetes/575506/

View File

@@ -0,0 +1,78 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news)
[#]: via: (https://opensource.com/article/20/4/news-march-25)
[#]: author: (Scott Nesbitt https://opensource.com/users/scottnesbitt)
The rebirth of Mapzen, new projects bolster PyTorch, faster AI object detection, and other open source news
======
Catch up on the biggest open source headlines from the past two weeks.
![][1]
In this edition of our open source news roundup, we take a look at the rebirth of Mapzen, two new projects to bolster PyTorch, new open source object detection software, and more!
### Mapzen makes a comeback
While its technology is used by open source projects like OpenStreetMap and by firms like Foursquare, open source mapping company Mapzen couldn't sustain itself as a business.  Mapzen initially closed its doors in 2018, but it has [a new lease on life][2] with the support of the Linux Foundation.
As a project under the Urban Computing Foundation (UCF), Mapzen "encompasses six independent projects and communities involved in developing a truly open platform for mapping, search, navigation and transit data." Being under the UCF's umbrella enables Mapzen's developers to "collaborate on and build a common set of open-source tools connecting cities, autonomous vehicles, and smart infrastructure." They can also tap such UCF members as Google, IBM, and the University of California San Diego for support. Mapzen projects are available under their [GitHub organization][3].
### New open source projects to bolster PyTorch
PyTorch, the open source machine learning framework originating out of Facebook, has been getting a lot of love lately from both its creator and from AWS. The two firms have [released open source projects to bolster PyTorch][4].
Facebook is sharing TorchServe, "a model-serving framework for PyTorch that will make it easier for developers to put their models into production." AWS's contribution is TorchElastic, "a library that makes it easier for developers to build fault-tolerant training jobs on Kubernetes clusters." PyTorch's product manager Joe Spisak [told VentureBeat][5] that by using the two projects developers can run "training over a number of nodes without the training job actually failing; it will just continue gracefully, and once those nodes come back online, it can basically restart the training."
You can find the code for [TorchServe][6] and [TorchElastic][7] on GitHub.
### Microsoft and Huazhong University release object detection AI
One of the more difficult tasks facing artificial intelligence systems is to accurately detect and identify objects in photos and videos. Researchers from Microsoft and China's Huazhong University have [released an open source tool][8] that does the job quickly and efficiently.
Called Fair Multi-Object Tracking (FairMOT for short), the tool "outperforms state-of-the-art models on public data sets at 30 frames per second" (almost normal video speed). It took researches about 30 hours to train the software using data from the MOT Challenge, which is "a framework for validating people-tracking algorithms." The team behind FairMOT believe that the tool can be used in "industries ranging from elder care to security, and perhaps be used to track the spread of illnesses like COVID-19."
You can view the source code and training models for FairMOT in [this GitHub repository][9].
#### In other news
* [Will a small open-source effort from Japan disrupt the autonomous space?][10]
* [Google open-sources data set to train and benchmark AI sound separation models][11]
* [Docker builds open source community around Compose Specification][12]
* [Sophos Sandboxie is now available as an open-source tool][13]
* [PyCon has moved to an online-only event and is available now][14]
Thanks, as always, to Opensource.com staff members and [Correspondents][15] for their help this week.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/news-march-25
作者:[Scott Nesbitt][a]
选题:[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/scottnesbitt
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/weekly_news_roundup_tv.png?itok=tibLvjBd
[2]: https://www.zdnet.com/article/mapzen-open-source-mapping-project-revived-under-the-urban-computing-foundation/
[3]: https://github.com/mapzen/
[4]: https://techcrunch.com/2020/04/21/aws-and-facebook-launch-an-open-source-model-server-for-pytorch/
[5]: https://venturebeat.com/2020/04/21/facebook-partners-with-aws-on-pytorch-1-5-upgrades-like-torchserve-for-model-serving/
[6]: https://github.com/pytorch/serve
[7]: https://github.com/pytorch/elastic
[8]: https://venturebeat.com/2020/04/08/researchers-open-source-state-of-the-art-object-tracking-ai/
[9]: https://github.com/ifzhang/FairMOT
[10]: https://www.forbes.com/sites/rahulrazdan/2020/04/04/will-a-small-open-source-effort-from-japan-disrupt-the--autonomous-space-/#6e6819f01cc5
[11]: https://venturebeat.com/2020/04/09/google-open-sources-data-set-to-train-and-benchmark-ai-sound-separation-models/
[12]: https://sdtimes.com/softwaredev/docker-builds-open-source-community-around-compose-specification/
[13]: https://securityaffairs.co/wordpress/101397/malware/sandboxie-sandbox-open-source.html
[14]: https://us.pycon.org/2020/online/
[15]: https://opensource.com/correspondent-program

View File

@@ -1,73 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What is the internet backbone and how it works)
[#]: via: (https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html)
[#]: author: (Tim Greene https://www.networkworld.com/author/Tim-Greene/)
What is the internet backbone and how it works
======
Tier 1 internet service providers (ISP) mesh their high-speed fiber-optic networks together to create the internet backbone, which moves traffic efficiently among geographic regions.
[Gerd Altmann][1] [(CC0)][2]
The internet generates massive amounts of computer-to-computer traffic, and insuring all that traffic can be delivered anywhere in the world requires the aggregation of a vast array of high-speed networks collectively known as the internet backbone, but how does that work?
### What is the internet backbone?
Like any other network, the internet consists of access links that move traffic to high-bandwidth routers that move traffic from its source over the best available path toward its destination. This core is made up of individual high-speed fiber-optic networks that peer with each other to create the internet backbone.
The individual core networks are privately owned by Tier 1 internet service providers (ISP), giant carriers whose networks are tied together. These providers include AT&amp;T, CenturyLink, Cogent Communications, Deutsche Telekom, Global Telecom and Technology (GTT), NTT Communications, Sprint, Tata Communications, Telecom Italia Sparkle, Telia Carrier, and Verizon.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][3]
By joining these long-haul networks together, Tier 1 ISPs create a single worldwide network that gives all of them access to the entire internet routing table so they can efficiently deliver traffic to its destination through a hierarchy of progressively more local ISPs.
In addition to being physically connected, these backbone providers are held together by a shared network protocol, TCP/IP. They are actually two protocols, transport control protocol and internet protocol that set up connections between computers, insuring that the connections are reliable and formating messages into packets.
### Internet exchange points (IXP) tie the backbone together
Backbone ISPs connect their networks at peering points, neutrally owned locations with high-speed switches and routers that move traffic among the peers. These are often owned by third parties, sometimes non-profits, that facilitate unifying the backbone.
Participating Tier 1 ISPs help fund the IXPs, but dont charge each other for transporting traffic from the other Tier 1 ISPs in a relationship known as settlement-free peering. Such agreements eliminate potential financial disputes that might have the result of slowing down internet performance.
[][4]
### How fast is the backbone?
The internet backbone is made up of the fastest routers, which can deliver 100Gbps trunk speeds. These routers are made by vendors including Cisco, Extreme, Huawei, Juniper, and Nokia, and use the border gateway protocol (BGP) to route traffic among themselves.
### How traffic gets on the backbone
Below the Tier 1 ISPs are smaller Tier 2 and Tier 3 ISPs.
Tier 3 providers provide businesses and consumers with access to the internet. These providers have no access of their own to the internet backbone, so on their own would not be able to connect their customers to all of the billions of internet-attached computers.
Buying access to Tier 1 providers is expensive. So often Tier 3 ISPs contract with Tier 2 (regional) ISPs that have their own networks that can deliver traffic to a limited geographic area but not to all internet-attached devices.
In order to do that, Tier 2 ISPs contract with Tier 1 ISPs for access to the global backbone, and in that way make the entire internet accesssible to their customers.
This arrangment makes it possible for traffic from a computer on one side of the world to connect to one on the other side. That traffic goes from a source computer to a Tier 3 ISP that routes it to a Tier 2 ISP that routes it to a Tier 1 backbone provider that routes it to the appropriate Tier 2 ISP that routes it to a Tier 3 access provider that delivers it to the destination computer.
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3532318/what-is-the-internet-backbone-and-how-it-works.html
作者:[Tim Greene][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Tim-Greene/
[b]: https://github.com/lujun9972
[1]: https://pixabay.com/en/social-media-digitization-faces-3271592/
[2]: https://creativecommons.org/publicdomain/zero/1.0/
[3]: https://www.networkworld.com/newsletters/signup.html
[4]: https://www.networkworld.com/article/3440100/take-the-intelligent-route-with-consumption-based-storage.html?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE21620&utm_content=sidebar ( Take the Intelligent Route with Consumption-Based Storage)
[5]: https://www.facebook.com/NetworkWorld/
[6]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,55 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Contact tracing via Bluetooth could help track COVID-19 transmission)
[#]: via: (https://www.networkworld.com/article/3538333/contact-tracing-via-bluetooth-could-help-track-covid-19-transmission.html)
[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/)
Contact tracing via Bluetooth could help track COVID-19 transmission
======
Thinkstock
[[Get regularly scheduled insights by signing up for Network World newsletters.]][1]
A team of researchers from MIT has developed a novel method of tracking COVID-19 transmission among the population, using Bluetooth “chirps” that could automatically trace COVID-positive contacts and warn those who have potentially become infected, without violating their privacy.
The system is called PACT, or Private Automated Contact Tracing. It works by sending random strings of numbers via low-power Bluetooth from a users smartphone to other nearby devices using the system, creating a coded list of smartphones that a given user has been close to in the past 14 days.
If the user subsequently tests positive for COVID, he or she can upload that list of “chirps” to the database, so that other users can run a check to determine whether they might have exposed.
MIT said that the system uses advanced privacy protection methods to ensure the privacy of both COVID sufferers and those checking to see whether theyve been exposed. People would need to opt in, and researchers specifically highlighted that PACT does not use any GPS, wireless location or phone ID information.
“For these broadcasts, were using cryptographic techniques to generate random, rotating numbers that are not just anonymous, but pseudonymous, constantly changing their ID, and that cant be traced back to an individual,” said MIT institute professor Ron Rivest, who led the project. (Rivest knows a  thing or two about cryptography: hes the R in RSA, the first publicly available public-key cryptosystem.)
The idea behind PACT is to make sure that the system isnt tracking any individuals specifically. Rather, its meant to be a yes/no resource for those wondering whether they may have been in proximity to someone with COVID. Its currently at the proof-of-concept stage the team recently overcame the hurdle of getting Androids and iPhones to speak to each other and overtures have been made to smartphone makers, Apple, Google and Microsoft to try and get the system into the publics hands as quickly as possible.
“The aim of the prototype is to prove to these developers that this is feasible for them to implement,” said Rivest.
**[ [Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][2] ]**
The team hopes that if PACT comes into widespread use it would enable a much more selective approach to quarantine and give communities the ability to return to normalcy more quickly. Tracking the spread of a disease like COVID with more speed and precision could let public health authorities suggest testing to specific groups of people if they notice a pattern emerging.
MIT also said that the team has demonstrated PACT to various government agencies, and coordinating similar efforts elsewhere in the U.S., as well as in Europe.
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3538333/contact-tracing-via-bluetooth-could-help-track-covid-19-transmission.html
作者:[Jon Gold][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Jon-Gold/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/newsletters/signup.html
[2]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture
[3]: https://www.facebook.com/NetworkWorld/
[4]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,66 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Harvesting ambient energy will power IoT, scientists say)
[#]: via: (https://www.networkworld.com/article/3536697/harvesting-ambient-energy-will-power-iot-scientists-say.html)
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
Harvesting ambient energy will power IoT, scientists say
======
Magnetic fields found naturally around electrical devices could be diverted and converted into electricity to power the IoT.
Thinkstock
Stray, ambient magnetic fields that are naturally created from electricity usage should be captured, diverted, and converted into power for Internet of Things sensors, researchers say.
"Just like sunlight is a free source of energy we try to harvest, so are magnetic fields," said Shashank Priya, professor of materials science and engineering and associate vice president for research at Penn State, in a statement published [on the university's web site][1]. "We have this ubiquitous energy present in our homes, office spaces, work spaces and cars. It's everywhere, and we have an opportunity to harvest this background noise and convert it to useable electricity."
Electricity produces tiny magnetic fields around common power cables, computers and lighting found in factories, homes and offices. That energy, if harnessed, could power sensors and small data-sending radios, the academics think. Penn State is attempting to design ambient power receptors for IoT.
### Materials science
The group at Penn State has been having some success getting it to work. Experimental devices that are thin and about 1.5 inches long are being tested. Placing the capture-device around or on common appliances does produce electricity, the researchers claim. The key is to put the device where the magnetic field is the strongest. In one experiment, the researchers were able to generate enough power to run 180 LED lighting arrays with a device placed about 4 inches from a space heater. At 8 inches, the device produced enough electricity to operate a clock.
"These results provide significant advancements toward sustainable power for integrated sensors and wireless communication systems," said Min Gyu Kang, an assistant research professor at Penn State and joint lead author of the study.
Electricity and magnetism have always gone hand in hand. Magnetism is created by a moving electric charge. It's that movement which creates the magnetic field. That's why low-level magnetism is manifested in electrical wires generally, for example—the electricity is moving along the cable.
In this case, the scientists are converting the magnetic field, which is caused by the moving electricity, into a separate electrical current. They're doing it with materials science by combining two materials. One of the materials is a magnetostrictor it converts the magnetic field into stress-generating vibrations. The another material is piezoelectric, which grabs the vibrations and translates that energy into electricity.
[][2]
### How to power sensors
Producing usable power from stray magnetic fields is just one stab at powering the IoT. Just how one goes about producing power for the millions, and possibly billions, of environmental, factory process and other sensors that are expected to come on stream as IoT takes off is up for grabs.
Batteries have limitations—they need to be changed or charged, for example. Ambient humidity is one possibility I [wrote about recently][3]. In that case, bio-electronics have been proven to capture half-a-volt from ambient air, scientists claim. That's enough to operate rudimentary sensors. Waste heat, too, is another possible source: Researchers are [exploring ways to convert excess heat][4], such as is found in data centers, into light, and then turn that light into electricity.
Other angles include simply reducing energy consumption through more efficient chips or streamlined wireless communications hardware. Other parasitic techniques are being tried. They include [turning existing wireless noise into a data carrier][5]. It's efficient because one doesn't have to make so much power for radio transceivers—the carrier already exists.
In the case of the Penn State work, less obvious benefits might exist, too.
"In buildings, it's known that if you automate a lot of functions, you could actually improve the energy efficiency very significantly," Priya said. “Buildings are one of the largest consumers of electricity in the United States. So even a few percent drop in energy consumption could represent or translate into megawatts of savings. Sensors are what will make it possible to automate these controls, and this technology is a realistic way to power those sensors."
Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3536697/harvesting-ambient-energy-will-power-iot-scientists-say.html
作者:[Patrick Nelson][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Patrick-Nelson/
[b]: https://github.com/lujun9972
[1]: https://news.psu.edu/story/613154/2020/03/31/research/scientists-tap-unused-energy-source-power-smart-sensor-networks
[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[3]: https://www.networkworld.com/article/3529893/seawater-humidity-inspire-new-ways-to-generate-power.html
[4]: https://www.networkworld.com/article/3410578/data-centers-may-soon-recycle-heat-into-electricity.html
[5]: https://www.networkworld.com/article/3449819/wireless-noise-protocol-can-extend-iot-range.html
[6]: https://www.facebook.com/NetworkWorld/
[7]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,86 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How I've adjusted my work-from-home habits)
[#]: via: (https://opensource.com/article/20/4/healthy-remote-work-habits)
[#]: author: (Will Kelly https://opensource.com/users/willkelly)
How I've adjusted my work-from-home habits
======
WFH newbs and veterans alike have to adjust to self-quarantine; here's
how to maintain some balance.
![Oatmeal and a laptop.][1]
I've been a remote worker during various chapters in my career, and have tried to carry those lessons into each new remote work experience. At the end of last year, I switched to a job that lets me work from home. Fast forward to the COVID-19 outbreak; even though I was no WFH novice, I found myself having to adapt just like the many other workers who've been suddenly thrust into remote work.
In hopes of easing that transition, here are some healthy remote work habits to adapt during a pandemic.
### Keep exercising even if your gym is closed
I watched the crowd in my gym dwindle the week before my state government issued its stay at home orders. Whether I've been working in an office or at home, going to the gym helps me vent stress, plus it acts as a logical break in my daily routine because I put down my phone and keyboard to clear my head.
Fortunately, my gym put some training activities online that I plan to use. I already have a stability ball and Bosu ball in my home office that I began using on day three after the pandemic closed all the offices, schools, and later gyms in my local area. As I write this article, I'm entering week 4 of COVID-19-mandated remote work, and I'm still trying to get back to the exercise dedication and momentum I had before this all happened.
### Dress (and groom) yourself for work
I've worked from home on and off during my career. When I started my new job, I decided not to repeat some mistakes I made during the last time I worked from home. One mistake I made was not shaving every day. I also stopped getting dressed for work.
When you dress and groom yourself for work every day, it can help put you in focus for work. You don't have to be too strict; it is a pandemic after all. I'm still debating on sweatpants Fridays during this crisis.
### Eat meals away from your desk
It's too easy to just eat meals at your desk when you work at home. Many even do it at the office. I recommend as you get through your COVID-19-enforced remote working that you use eating as a natural break in the ebbs and flows of your day. For example, unless a deadline was calling, I would go out to lunch to break up my remote working days. These days I get up from my desk, walk outside to get a breath of fresh air and have lunch in my living room.
### Keep a schedule and track your progress
It's easy to sleep in when you don't have to go to the office. I recommend trying to keep to your regular schedule as much as possible. It's admittedly easy for me to say that because I live alone. If you're home with children, work with your employer to time-shift your schedule to accommodate the added responsibilities and other challenges you're facing right now. It may take a few iterations to get the right schedule, but you'll appreciate the consistency.
Another word about keeping a schedule—you might add important work meetings to your personal calendar or as reminders on your mobile device, so you have another reminder as you adjust to the new normal of COVID-19.
The open source community has a lot of great scheduling and project management tools that you can use to track your own time and progress. There are [project management tools][2] for agile development teams. You can also find open source alternatives to [Googl][3][e Calendar][3] available on Android.
### Put backup communications channels in place
Even companies with robust telework programs may see some communications outages. It may not even be their CIO's fault, such as the Microsoft Teams outage that happened in Europe early on during the COVID-19 pandemic.
Having problems dialing into a conference bridge or your employer's group chat having sporadic issues will surprise nobody right now; most understand that workers are in a period of transition, and not everything will run smoothly. However, you still need to have backup channels in place to make that communication happen, even if it's just coworkers exchanging cell numbers so they can text or call each other as needed.
There are some fully-featured open source [Slack alternatives][4] available that are worth exploring if your organization is lacking in chat applications or if you want to give your team a backup channel to your official corporate application. (Whether you do it with the approval of your corporate IT department is up to you).
You should also consider installing implementing [MediaWiki][5] or [Twiki][6] to improve collaboration or to give your team an accessible document repository.
### Pivot on communications when needed
Every company where I've been an employee or contractor has had its own communications style. Remote working at scale during the COVID-19 epidemic will challenge those communication styles.
Be prepared to shake up your communication style, whether you're a newb or long term remote worker. That could mean writing more detailed emails instead of the terse ones you normally send to becoming more of a power user with your company's group chat tool. There are also the open source wikis I mentioned earlier that can provide you a centralized platform for any long-form writing you need to do to help communicate project requirements and changes.
I also extend this advice to your personal communications during the workday. For example, a friend and I video conference during the day. We never did that pre-COVID-19.
### Final thoughts
Lots of people will evolve and rethink their remote work habits. It's only healthy that you prepare yourself for adjusting your own remote working habits. What worked for me pre-COVID-19 doesn't necessarily work right now, so I'm adjusting my remote work habits weekly as I see fit so I can maximize my productivity during the current crisis.
How are you adjusting your remote work habits during self-quarantine?
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/healthy-remote-work-habits
作者:[Will Kelly][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/willkelly
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/oatmeal-and-fedora.jpg?itok=NBFUH9eF (Oatmeal and a laptop.)
[2]: https://opensource.com/article/18/2/agile-project-management-tools
[3]: https://www.androidpolice.com/2019/12/30/the-best-free-and-open-source-alternatives-to-google-calendar-on-android/
[4]: https://opensource.com/alternatives/slack
[5]: http://www.mediawiki.org/
[6]: http://www.twiki.org/

View File

@@ -0,0 +1,58 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Face-to-face collaboration for community to become more impactful Chip Childers)
[#]: via: (https://www.linux.com/articles/face-to-face-collaboration-for-community-to-become-more-impactful-chip-childers/)
[#]: author: (Swapnil Bhartiya https://www.linux.com/author/swapnil/)
Face-to-face collaboration for community to become more impactful Chip Childers
======
“Anytime theres a crisis, theres also an opportunity for open source communities to find ways to be helpful,” affirms Chip Childers, the Executive Director of Cloud Foundry Foundation. He believes the remarkable work the Cloud Foundry community has done over the years to enhance enterprise developer productivity will now help those who have adopted the platform to combat COVID-19.;
“It (the platform) allows them to move quickly to respond to changing conditions, whether those are market conditions, or in this case, a global pandemic. Were actually pretty proud of a lot of the end-users and how theyre able to use the software more efficiently now,” he says.
Prior to becoming the Executive Director, Childers served as the CTO for a little over five years. He feels “its a very exciting time to be stepping into the role,” and has already chalked out a robust strategy to take the Foundation to the next level.
For starters, Google has upped its membership of Cloud Foundry and is now at the technical tier. “We were quite happy to have them decide to upgrade and we appreciate their support on that,” says Childers.
He is also happy with how Kubernetes and Cloud Foundry are coming together.
“Cloud Foundry and Kubernetes are now becoming complementary. The Cloud Foundry developer platform should run on the Kube infrastructure platform. Both communities have reached the point where theyre ready to see this get blended,” says Childers.
**Unswerving Support**
VMware ranks among the largest contributors to communities. Last year, it acquired Pivotal, which is one of the biggest stakeholders in the Cloud Foundry project. So, what are the implications on Cloud Foundry of a player that has stakes in both Kubernetes and Cloud Foundry?
“Its a clear indication the teams that used to work for Pivotal are being intermixed with the teams that were at VMware, and through some of their other acquisitions like Heptio, theyre all working together on the shared vision of creating the Tanzu platform. This happens to align well with the vision that other Cloud Foundry distributions have — like the way SUSE builds Kubernetes-based infrastructure layers Cloud Foundry on top for developer productivity,” explains Childers.
Childers believes Paul Fazzones promotion to Chairman of the Board will provide an additional boost to Cloud Foundry.
“Paul heads R&amp;D for VMwares modern applications business unit. Hes been on our board for a long time. So its great that were going to continue to see the investment in the open source community not just at the business level from VMware, but also in terms of supporting the contributors, be it developers, product managers, project management support, or marketing support. Theyre not wavering in their commitment to open source across the board and Cloud Foundry is one of those communities that will benefit from that,” he states.
**A Three-Pronged Strategy**
The core mission of the Foundation is to bring a world-class enterprise developer experience to as many enterprise developers as possible. Childers, therefore, considers “enterprise developer productivity for Kubernetes infrastructure our new north star” and has devised a three-pronged strategy to align with it.
“The first thing is that we will focus on working with the contributing community — the Foundation staff, key member contacts and participants — to improve their experience.
Next is to build upon the inclusivity and diversity work that the Foundation has done over the years. “Weve always had a number of different audiences to whom weve tried to describe the work of the project: line of business leaders, CIOs, IT operations, and enterprise developers. It is important to make a little bit of a dent in the broader technology industry,” avers Childers.
The third and final prong of Childers strategy is to encourage developers or companies participating in Cloud Foundry efforts to also participate in Istio (an open platform that connects, manages, and secures microservices), Kubernetes, and the various scenes within the community.
“Theres a massive overlap, which I think will be very beneficial to everyone. The learnings that developers helping to code Kubernetes or Istio learn during that process should flow in such a way that the CF community builds the developer experience on top of those systems. From this perspective, cross-pollination is really, really important,” says Childers.
Childers is also planning a tectonic shift in the way Foundation contributors work. “While now its going to become a little bit harder as we deal with some of the challenges around the pandemic, Im very excited about spending a lot of our effort focused on increasing the impact of the face-to-face collaboration time that were able to create for the community,” adds Childers.
--------------------------------------------------------------------------------
via: https://www.linux.com/articles/face-to-face-collaboration-for-community-to-become-more-impactful-chip-childers/
作者:[Swapnil Bhartiya][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.linux.com/author/swapnil/
[b]: https://github.com/lujun9972

View File

@@ -0,0 +1,116 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (My 10 guiding principles for open source community management)
[#]: via: (https://opensource.com/article/20/4/open-source-community-management)
[#]: author: (Florian Effenberger https://opensource.com/users/floeff)
My 10 guiding principles for open source community management
======
It's not just about subject matter expertise; leadership in the open
source world requires special skills and processes.
![community team brainstorming ideas][1]
Many activities these days, be they sports, social work, arts or free and open source software, are organized in some sort of community. If backed by a respective legal entity, this not only helps with getting donations and entering contracts but also puts statutes and rules in place that establish the values and ideals all contributors share and abide by.
Inside these communities, there can be various roles. Some of them have formal requirements and annual or biannual elections, e.g., the board of directors or the supervisory board; others exist ad hoc within dynamically grown groups and can change frequently. Either of those are ideally composed of experienced and enthusiastic community members who take leadership and responsibility.
Many regular contributors will, therefore, eventually face the question of whether to accept a certain role. Based on my experience with being a board member of the former German associations [OpenOffice.org][2] Deutschland e.V. and Freies Office Deutschland e.V., previous chairman and current executive director of [The Document Foundation][3] and founding member of the Munich [Open-Source-Treffen e.V.][4], I would like to share some personal insights on the topic.
These views are purely my own, and your mileage might vary. It is likely that others had both similar and different experiences, so I'm looking forward to any feedback and thoughts you might have.
### 1\. Cooperation
A community is all about cooperation. Boards, groups, and bodies are no different in this regard. Usually, you don't know who will co-serve on an elected committee with you until shortly before you start your duty. Therefore, it is important to cooperate openly with your new colleagues in a transparent, trustworthy, and effective way, within the committee as well as the larger community.
Sharing a common understanding of responsibilities and duties, and even more importantly, of your goals, visions, and plans can help a lot. It's not necessary for these to all be totally aligned in the first place, as long as there are consensus and compromise to help you identify goals that benefit the community and their objectives at large. In a vivid and diverse community, several goals can often be pursued at once, as most won't be mutually exclusive or otherwise prohibitive.
And then let's not forget one thing: the fun! Be proud that you have been entrusted by your peers to drive the community and its projects toward a bright future. Be proud that you can help steer the ship and shape the soul of something that is important to you. As is often the case in life, cooperating and working together with others is key to success. Joining forces is not only easier but also much more fun than working alone.
### 2\. Commitment
Taking over a role is something that can and should make you proud. See this as something you have been entrusted with for a certain amount of time because your contributions have been recognized by the community as extraordinary and remarkable. You acted in a visible and trustworthy fashion, and people credit you with leadership skills.
Depending on the role you take, the honor often comes with a fair amount of new responsibility beyond what you already do, and it might involve subjects yet unknown to you. In other words: Be ready to put in some time and effort.
How much time such a commitment takes obviously depends on multiple factors: what specific role you take, how many contributors you have to coordinate with, how large your organization is, and of course, what kind of projects you run. [In one of its annual reports][5], board members of The Document Foundation explained that every year "they each donate 15 to 20 days of activity to TDF for Board duties in addition to other volunteering" and the members of its membership committee donate "between 10 and 15 days of activity."
### 3\. Variety
Should you be elected into an organizations' formal body, you will see yourself responsible for representing the entity from a marketing perspective, but also from a legal and organizational point of view. Other than the more glamorous parts, these duties often also entail regular meetings, annual budget planning and reserve building, tax filings and annual activity reports, team management, trademark and copyright handling, planning and overseeing tenders, and all sorts of expected and unexpected legal matters and fostering liaisons with other entities, all of which are rather unglamorous tasks rarely seen by the general public.
That requires the willingness to learn in a variety of areas and for having a rather high tolerance for frustration. Luckily, most of the groups I know are composed of members with different skills, so it's likely someone is either already experienced in or willing to learn one or more of the respective areas. Looking at The Document Foundation's [rules of procedure][6] for the board, a total of 13 different areas of oversight can be identified, each one staffed with one or more volunteers, matched to their area of interest.
### 4\. Delegation
Handling all the work alone as a pure volunteer will sooner or later become an impossible task and, unless you have magical superpowers, it's strongly advisable to share these with other seat holders, volunteers, and, if they exist, staff and external professionals. Often, growing organizational demands luckily come together with the financial growth of the entity, which makes paying professionals for certain tasks quite feasible and sensible. Accounting, administration, and legal advice are prime examples of things to outsource (unless that's the service you already provide, of course).
If you oversee a large part of the organization, you primarily need to focus on strategy and the mission at large, so it is advisable to delegate many tasks to others. Remember, the community has entrusted you to steer the ship, to oversee the big picture; don't bother yourself with every little detail and micromanagement, but get enough insight to oversee those you task and trust that they do a good job.
### 5\. Responsibility
In the end, however, it still is the ultimate and shared responsibility of all representatives to oversee and coordinate the work, ensure all duties are fulfilled, and, especially for board members, take care that all legal obligations are met. Remember, donors trust you to make good use of their money, so you have a huge responsibility.
In nearly all legislations, there exist numerous rules and regulations you are bound by, and the unfortunate tendency is often to make things more complicated instead of relaxing them.
In case something goes wrong, those most exposed are first in line to be confronted with that, both from a social and legal point of view.
### 6\. Social
Depending on the size of the organization and your role, you might not only have responsibility for tasks and projects, but also for a paid team. Keep in mind that, for many, their economic situation depends on the success of your organization. Job security and a positive work environment are important factors to keep a happy and dedicated team.
Gaining the skills and finding the time as a pure volunteer to oversee a large full-time team is demanding. Interacting by talking, listening, and being open helps a lot for both your team and the organization. In many organizations, the paid team is there to serve your community, to drive forward the success of the project, to take away annoying administrative tasks from you, and to work on tasks that support and enable your contributors.
Working at charities can be a bit different from companies. Given most of your income consists of donor's money, you have less monetary flexibility than commercial employers. However, you provide a far superior experience than many traditional businesses. Use that as your advantage—your team does something for the good cause, can work with people around the world, can really make a difference, and at the same time make a living out of what they love. Communicate frequently, and don't forget to laud people if they do a good job, especially in remote working environments.
### 7\. Diversity
Crucial and essential is that representatives reflect the diversity of the community—different genders, religions, languages, cultures, backgrounds, and experiences add an incredibly exciting variety that you should aim hard to achieve in any board, committee, and group. While this can turn out to be challenging in the beginning, it for sure will enrich your community in ways you never dared to dream of before.
This diversity is one of the most important and exciting assets a larger community offers; you'll soon learn how it widens the view, helps you to question your own thoughts and positions, and contributes greatly to your overall efforts. If you run an open source community, do exactly as the name suggests—be open, be passionate, and try to get to the bottom of things!
### 8\. Coordination
Having members from around the globe can make you face some practical problems though—most notably, languages and time zones. While English as a common denominator is spoken widely in Europe, it might be different for other countries, and including those who don't speak English as their mother tongue is key if you have a large community. You risk losing vital insight into what your worldwide community does if you don't manage to connect to them.
Something the law of physics at least currently doesn't allow is overcoming the different time zones. Finding suitable meeting slots for participants on different continents, matching everyone's working schedule, and providing a work-life balance aren't trivial requirements, especially when you want to include a paid team. As you end your workday, colleagues from a different continent are just about to start theirs. While the volunteers need meeting times after office hours, your staff would probably rather not stay in the office until late or during the weekends.
Likely there isn't an ideal meeting time, but you will end up finding a compromise that works for most people, possibly including alternate meeting times. A word to the wise: use calendar invites and meeting planners with time zones to avoid confusion, especially during times of daylight savings changes.
The choice of medium is important as well—all stakeholders need to be aware of and included in important discussions. Some of these are thus better done in email; others are easier to handle on the phone. You might also find it convenient to prepare initial discussions via emails and have the final vote on the phone.
Properly prefixing email subjects with votes and discussions can likewise be helpful to handle the influx of messages and catch people's attention. The same is true for meeting intervals, agendas, deadlines, quorum requirements, and sunset periods—these need to reflect everyone's needs, factoring in availabilities, vacations, and absences. The rationale behind this is that taking a role requires continuous, active participation in many communities, to keep up with what's going on, and that is much easier when the rules are clear.
Depending on your setup and the jurisdiction you're in, votes and meetings also have formal requirements you have to stick to.
### 9\. Trust
Trustworthiness is probably one of the most important characteristics for anyone who fills a leadership role. Email conversations lack tone and gestures, making it harder to understand moods, emotions, and intentions. Thus it's even more important to assume best intentions on each side, trying to avoid what is known as confirmation bias, i.e., interpreting actions and words in a way that seems to confirm your existing negative assumptions.
Trust especially comes into play when the entity is located in a country whose language you don't speak or whose legal system you are not familiar with—you will have to rely on translation services and people acting as gateways, be they volunteers or paid professionals.
### 10\. Reward
Filling a community role usually means plenty of hard work on top of your existing duties, but there are plenty of rewards for all that work. It is a very honorable and truly exciting opportunity that will not only enrich your professional life (and makes a good item on a CV) but beyond that, enriches your personality, your skills, and your point of view. If you're passionate about what you do, if you're open to new things, if you want to shape the future of what you love—then you indeed might be a great candidate to serve the community and lead by example.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/open-source-community-management
作者:[Florian Effenberger][a]
选题:[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/floeff
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/meeting_discussion_brainstorm.png?itok=7_m4CC8S (community team brainstorming ideas)
[2]: http://OpenOffice.org
[3]: https://www.documentfoundation.org/
[4]: https://www.opensourcetreffen.de/
[5]: https://wiki.documentfoundation.org/File:AnnualReport2016LR.pdf
[6]: https://wiki.documentfoundation.org/TDF/BoD_rules

View File

@@ -0,0 +1,102 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Why I use open source technology for web development)
[#]: via: (https://opensource.com/article/20/4/open-source-web-development)
[#]: author: (Jimmy McArthur https://opensource.com/users/jimmymcarthur)
Why I use open source technology for web development
======
Micro-frontends with an API-driven approach power the OpenStack
Foundation's platforms.
![Text editor on a browser, in blue][1]
Every day, millions of people all over the world access the [OpenStack Foundation][2]'s (OSF) web properties to learn about open infrastructure. This level of usage requires a platform and toolsets that are fast, flexible, and affordable—and this is where open source comes in. Not only that, but given that we work for an open source software foundation, we naturally incorporate open source technologies into everything we do, including web development.
### Considerations for web development
When thinking about web development technologies, we must consider how we manage our software lifecycles. All software development includes some sort of [lifecycle management][3] with the opportunity to plan, analyze, design, and implement the code. Our web development team usually works on the fly, often under tight deadlines, and with other departments. That means our requirements and workflow must be flexible enough to allow for quick iterations, updates, and corrections. I'd rather push out something quickly and, if needed, go back in and make things pixel perfect after the fact.
Our team also has to consider all the stakeholders involved in the website, including our talented marketing teams who aren't familiar with Git workflows. That led us, like many others, to utilize a content management system (CMS), so those professionals can make updates without having to use Git.
### Building a CMS-agnostic web architecture
In order to uphold this need for flexibility, traditionally, we relied on an open source CMS, [SilverStripe][4]. However, our requirements quickly outgrew the system. So, we built a standalone API and use static micro-sites with [React][5] JavaScript components to pull data into custom-designed presentation layers. We use this system in everything from mobile apps to websites to digital signs. This has become known as a [Jamstack][6] architecture. We found this model was extensible enough that it allowed us to move our data anywhere while being CMS-agnostic.
When adopting this API-driven workflow, we realized that our data was used in many different places and presented in many different ways. Across our seven web properties, we share everything from graphics to dynamic content. A standard CMS won't do this without a lot of custom development work along with either cron jobs or costly database queries.
When things are API-driven, you can access all these different datasets across a variety of platforms while largely protecting your infrastructure from major traffic spikes. For example, the OSF collaborated with [Tipit][7], the OSF's digital design and development partner, to develop a completely open source end-to-end event management software. Our event-schedule data is presented on web pages, mobile apps, and digital signage. It's the same data, managed from a single place, but with different presentation layers, formats, and platforms.
### Open source identity access management
A cornerstone of moving to a decentralized Jamstack architecture is the need to establish identity and access rights. When using JavaScript to call for things in an API, we may need to require authentication and authorization. Therefore, we had to separate the identity provider from any individual implementation. There are two concepts to this: identity (authN) and identity access management (authZ). The identity provider confirms who you are, while access management confirms what roles and permissions you have to do different things. One of the first requirements when developing the event-management software was to establish a standalone identity provider.
Enter [OpenStackID][8], which is an [OpenID Connect][9] with oAuth2 SSO solution. OpenStackID started out as a more secure way for users to log into [Openstack.org][10] and manage their profiles. Even as the number of websites and event apps we manage grows, this creates a seamless authentication experience for users. The access-management portion allows us to build standalone React-based apps that use the identity provider to determine if a particular user has the rights to do the things they want to do in that specific application.
One thing that runs through everyone's mind—especially in a global open source community—is privacy. It's a large factor in creating our web and event properties. With OpenStackID, users can log into their [OpenStackID account][11] and set application permissions using the OAuth 2 console. If they decide they no longer want their app associated with their OpenStackID, they can simply remove permissions.
For example, we have users for our events that do not want their personal information to be associated with their presence at our conferences. The way the platforms are set up, all personally identifiable data is managed securely on the OpenID server, and it's not shared between applications unless the user strictly enables it. Beyond that, we never share things like the events a user attends or pieces of their user profile unless it's completely anonymized, or they specifically allow it in order to remain aligned with the [Four Opens][12] or our community philosophy.
### Better web infrastructure using open source
Taking our considerations and shifting toward a more flexible implementation of a CMS has helped our teams collaborate more effectively. Most importantly, we continue to follow our community values by providing great privacy and security options thanks to open source technology.
If you're interested in our approach, check out the OSF Foundation website's [source code][13]. You can also access the following source code repos to see the approach in action:
* [Zuul website][14]
* [Airship website][15]
* [StarlingX website][16]
* [Kata Containers website][17]
* [MOC and Open Infra Labs website][18]
* [Open Stack Foundation website][19]
* [Open Infrastructure Summit admin][20]
* [Open Infrastructure Summit CFP][21]
* [Open Infrastructure Summit Signage][22]
* [OpenStack Survey GraphQL API to access survey data and reports][23]
* [OpenStack Survey Graphene API to feed summit reports][24]
* [OpenStackID authentication system][25]
* [OpenStackID resource server][26]
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/open-source-web-development
作者:[Jimmy McArthur][a]
选题:[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/jimmymcarthur
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/browser_blue_text_editor_web.png?itok=lcf-m6N7 (Text editor on a browser, in blue)
[2]: https://osf.dev/
[3]: https://en.wikipedia.org/wiki/Systems_development_life_cycle
[4]: https://www.silverstripe.org/
[5]: https://reactjs.org/
[6]: https://jamstack.org/
[7]: https://www.tipit.net/
[8]: https://opendev.org/explore/repos?q=openstackid&tab=&sort=recentupdate
[9]: https://openid.net/connect/
[10]: http://Openstack.org
[11]: https://openstackid.org/
[12]: https://osf.dev/about/four-opens/
[13]: https://github.com/OpenStackweb/openstack-org
[14]: https://opendev.org/zuul/zuul-website
[15]: https://github.com/AirshipWeb/airship-website
[16]: https://github.com/StarlingXWeb/starlingx-website
[17]: https://github.com/kata-containers/www.katacontainers.io
[18]: https://github.com/OpenStackweb/openinfralabs-website
[19]: https://github.com/OpenStackweb/osf-website
[20]: https://github.com/OpenStackweb/summit-admin
[21]: https://github.com/OpenStackweb/call-for-presentations
[22]: https://github.com/OpenStackweb/openstacksignage
[23]: https://github.com/OpenStackweb/openstack-survey-api
[24]: https://github.com/OpenStackweb/summit-reports-api
[25]: https://opendev.org/osf/openstackid
[26]: https://opendev.org/osf/openstackid-resources

View File

@@ -0,0 +1,61 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How underwater Internet of Things will work)
[#]: via: (https://www.networkworld.com/article/3538393/how-underwater-internet-of-things-will-work.html)
[#]: author: (Patrick Nelson https://www.networkworld.com/author/Patrick-Nelson/)
How underwater Internet of Things will work
======
Lasers will be used to power underwater devices and transmit data below the ocean's surface.
North Sea Port
More than two-thirds of the world's surface is covered by water. It plays an important role in our economic existence, including in major verticals such as oil and gas, shipping and tourism.
As the Internet of Things proliferates, questions arise as to how IoT will manifest itself underwater given that radio waves degrade over distance in seawater, and underwater acoustic communication (which does actually work okay) is easily eavesdropped on and isn't stealthy.
To make the underwater Internet of Things happen, light is the answer, some say. Researchers at King Abdullah University of Science and Technology (KAUST) in Thuwal, Saudi Arabia, are proposing underwater optical communications. They're investigating simultaneous lightwave information and power transfer (SLIPT) configurations, which they're using to transmit energy and data to underwater electronic devices. Recently, the researchers announced a breakthrough experiment in which they were able to achieve an underwater, two-way transmission of data and power over 1.5 yards between a solar panel-equipped sensor and a receiver.
The SLIPT system will be more usable than wires strung. And in the case of human underwater equipment inspections, for example, SLIPT will be less prone to error than hand signals and less prone to audible confusion than ultrasound voice-based communicators. Remarkably, to this day, hand signals are still a common form of communication between divers.
"SLIPT can help charge devices in inaccessible locations where continuous powering is costly or not possible," said Jose Filho, a PhD student at KAUST, [in an article][1] on the school's web site.
Filho, who has been involved in developing the laser project, envisages ships or boats on the water's surface beaming optical communications to underwater vehicles or IoT sensors on the ocean floor. The lasers would simultaneously communicate with and power underwater robots and devices. Return data is relayed to the surface vessel, which then communicates to land bases or data centers via RF (radio).
Surface buoys or even unmanned aerial vehicles (drones) flying well above turbulent waves could be used to inject power down to the seabed surface and, at the same time, receive data, researchers believe.
[][2]
The school explains that there's still much development that needs to be performed before SLIPT is operational, but it sees potential. "Underwater optical communication provides an enormous bandwidth and is useful for reliably transmitting information over several meters," co-first author Abderrahmen Trichili said in the article.
KAUST, located on the Red Sea coast, has been involved in this area of technical exploration for some years. It was involved in developing some early, record-breaking underwater data communications. In 2015 it ran a 4.8 gigabit per second, 16-QAM-OFDM transmission with a 450-nanometer laser. OFDM, or Orthogonal Frequency Division Multiplexing, splits single data streams into multiple channels to reduce interference.
Interestingly, seas and oceans are becoming increasingly important to data centers. Large swaths of the world's population are found on or near coasts, rather than inland, and we're seeing a shift towards edge-style computing that positions resources closer to sources of data. There's also a need for compute cooling, which ocean water can provide. Even wave energy as a method of powering servers means sea and data are becoming intertwined.
Microsoft launched an [undersea water-cooling data center][3] 117 feet below the water surface in 2018. Additionally, garden-hose-sized cables carry almost all global, public Internet traffic [underwater, across oceans and between continents][4]. It's not done through satellite, as many imagine.
So, this is not a brand-new synergy. Apart from the eco-monitoring drivers, one of the likeliest and most important reasons that ocean-based computing is being explored keenly is that there isn't any rent payable or jurisdictional ownership on the high seas.
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3538393/how-underwater-internet-of-things-will-work.html
作者:[Patrick Nelson][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Patrick-Nelson/
[b]: https://github.com/lujun9972
[1]: https://discovery.kaust.edu.sa/en/article/952/the-power-of-light-for-internet-of-underwater-things
[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[3]: https://www.networkworld.com/article/3283332/microsoft-launches-undersea-free-cooling-data-center.html
[4]: https://www.networkworld.com/article/3004465/how-vulnerable-are-the-internets-undersea-cables.html
[5]: https://www.facebook.com/NetworkWorld/
[6]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,54 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (IoT offers a way to track COVID-19 via connected thermometers)
[#]: via: (https://www.networkworld.com/article/3539058/iot-offers-a-way-to-track-covid-19-via-connected-thermometers.html)
[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/)
IoT offers a way to track COVID-19 via connected thermometers
======
The COVID-19 pandemic has catapulted one manufacturer of connected thermometers to national prominence, as Kinsa provides a possible window into the spread of the disease.
[Kinsa / Leaflet / OpenStreetMap / CARTO][1]
A company called Kinsa is leveraging [IoT][2] tech to create a network of connected thermometers, collecting a huge amount of anonymous health data that could offer insights into the current and future pandemics.
The companys founder and CEO, Inder Singh, said that the ability to track fever levels across the U.S. in close to real time could be a crucial piece of information for both the public at large and for decision-makers in the healthcare sector and government.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][3]
The systems networking technology is relatively straightforward the thermometer connects via Bluetooth to an app on the users phone, which reports anonymized data back to Kinsas cloud over the Internet. Singh emphasizes that the company only organizes data down to the county level, and asserts that identifying individuals through Kinsas data is more or less impossible.
“Were not providing PII, were not providing identified data,” he said. “The app just guides you to the care and services you need.”
Armed with the temperature reading and some basic demographic information about the person whose temperature was taken and their other symptoms, the app can offer rudimentary guidance about whether a visit to the doctor is needed or not, and whether the users area is seeing unusual levels of fever.
However, the real value is in the aggregated data that Kinsa analyzes and breaks out on its [U.S. Health Weather Map][1], gleaned from the million-plus thermometers in the companys ecosystem. The idea, according to Singh, is to provide the public with a way to make more informed decisions about their health.
“Its very participatory,” he said. “Everyone gets the data, and everyone can respond.”
Kinsa still sells its thermometers directly to consumers, but plans are afoot for the company to collaborate more closely with local governments, health authorities and even school districts Singh said that Kinsa is already partnering with two U.S. states (which he declined to name), and several city governments, including St. Augustine, Florida.
“Our hope is that we can figure out how to build a scalable model were never gonna scale globally by just selling $20 thermometers,” he said. The goal is to become widespread enough that the product can act as a meaningful early warning system for the healthcare sector.
Join the Network World communities on [Facebook][4] and [LinkedIn][5] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3539058/iot-offers-a-way-to-track-covid-19-via-connected-thermometers.html
作者:[Jon Gold][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Jon-Gold/
[b]: https://github.com/lujun9972
[1]: https://healthweather.us/?mode=Atypical
[2]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html
[3]: https://www.networkworld.com/newsletters/signup.html
[4]: https://www.facebook.com/NetworkWorld/
[5]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,72 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting to know our new, virtual world)
[#]: via: (https://opensource.com/article/20/4/virtual-community-management)
[#]: author: (Patricia Dugan https://opensource.com/users/patricia-dugan)
Getting to know our new, virtual world
======
Our current forced physical separation could generate innovations that
actually bring our communities closer together.
![Women in computing and open source v5][1]
Witnessing the ongoing global impact of COVID-19 is a profoundly affecting experience that continues to humble us all in ways we couldn't have anticipated. Technology organizations are quickly evolving within this new reality, in which all of our human interactions are virtual until further notice.
### Virtual open source community management
When it comes to nurturing cultures designed to promote and reward open source innovation—as well as communities' economic, technological, and physical wellbeing—I can best speak to those I help build and manage. I believe communities should be built by weaving a tapestry of demographics and ranges of expertise. They should do this in a way that facilitates rich communication and empowers those building open source software to share knowledge with each other.
The move to virtual connection and digitalized events only makes these methods more crucial.
I'll share an example. Recently, I was speaking with a pillar of the Traefik open source community, known as a [Traefik Ambassador][2], based in Turkey, over video conference about a potential webinar. He suggested that, instead, we expand the speaker set to include other community members. Soon, we'd invited other contributors from Poland and Switzerland. We met online, and out of that conversation, the webinar has evolved into a collaborative series with community members taking turns presenting insights and melding different types of software together. What struck me was that if we'd had this conversation just one month ago, it would have simply focused on the creation of an asset. Now, contributors are bonding over a purpose-driven creation, with greater intention around facilitating innovation and excitement.
Based on my experience building and growing open source communities, I believe that this new era of virtual connection offers an unprecedented opportunity for innovation and growth—as long as it is managed with equal focus on the people creating it. Below are five observations on how the world of open source can positively shape the future of innovation in a virtual and seemingly uncertain world.
### The virtual world is flat.
Open source communities, teams, and backing companies provide an exceptional model of how to accelerate innovation. That's especially true in these extraordinary times. At its core, open source democratizes the development process, something we see replicated more widely in our new virtual ecosystems. As the opportunity for input becomes more inclusive, organizations are seeing a flattening in infrastructure, both in communications and in operations. Existing hierarchical power structures are weakening as more voices are heard, and the best ideas are given the chance to rise to the top through greater exposure.
As social distancing makes backchannel and handshake agreements much more complicated to execute, I predict that the traditional dance required to access and take positions in leadership will be replaced by flatter, more open methods that ultimately produce fresher—and better—perspectives. Online communication has a way of laying bare the real substance of interactions and ideas, bolstering meritocracy that's central to the strength of open source.
### The virtual world is fast.
This "flattening" structural shift has the potential to increase the pace and quality of innovation, as virtual events and communications widen the spotlight to now shine a light on previously unseen contributors. Creative minds among engineers, developers, and others outside of traditional leadership positions will leverage their comfort with the web and virtual channels to find each other and collaborate faster. This is nothing new for those in open source, and I expect organizations still clinging to legacy approaches will find themselves investing in learning how to implement flatter, virtual communications structures, and beginning to build them into traditional operational models. This means doubling down on efficiency and being willing to let go of the ["it's always been done this way"][3] mentality.
### The virtual world needs community.
Developers can conserve energy attending virtual events: there's no commute, nor other distractions from the work at hand. Working remotely and connecting only via virtual mediums enables open source contributors to create, share, and use code just about as fast as their brains allow, empowering rapid code contributions, collaborations, and new solutions produced with velocity.
While this shift may result in productivity gains, organizations must be careful of creating the impression that a team member's most important asset is their brain. When open source developers were asked what the best part of their job was, [62% claimed it was their "personal passion."][4] Recognizing individuals as unique contributors to open source communities is necessary and essential to development—both technical and human. During this period, when we're hitting the pause button on in-person interaction, remote interactions via chats, video conferences, and phone calls will enable the human moments necessary for growth and connection. Those in open source rely on the power of community, and this extraordinary time will require the continuous and earnest commitment to it.
### The virtual world is composed of individuals.
The potential for greater innovation and meritocracy through virtual-only channels will only be realized if communities, organizations, and individuals also pursue and achieve wellness. It's crucial for the interpersonal bonds that maintain our energy and psychological health—traditionally forged through real-life, face-to-face contact—to continue to exist as part of the way we now work. If that disappears, there's the risk that our industry and communities become purely transactional, lacking the joy and drive that carries work forward, much less great work and innovation. Developers are especially rooted in a sense of purpose, with [only 3% reporting that money and perks were the best part of their job.][4]
Overall wellness and support to prevent burnout should already have been central considerations for modern organizations, but they are even more important now. Virtual connectivity may set us up to work fast, but that can backfire if we're not also set up to be well.
### The virtual world needs kindness.
I also predict that virtual-only communication will close the distance between our online avatars and ourselves as real people. The impact of "toxic" individuals, hidden behind a computer, with little to no consequence for being a "bad actor," will be reduced and less acceptable. A growing presence of new voices will set the tone, adhering to well thought out codes of conduct, making poor behavior explicitly unwelcome. As much of our connection moves online, the norms that guide our offline behavior will become increasingly important. We'll transition to a less individualistic paradigm, and open source's long history of considering what defines good citizenship will offer insight to those looking to integrate a sense of shared responsibility into organizations.
I feel extremely grateful to be in technology, particularly in the open source world, given it's an industry built upon the promise of innovation. At least for the moment, we as an industry can serve as a lighthouse for connection in difficult times, and as a model for collaboration and intention for those not as familiar with how to be highly productive in a virtual world. For the open source community and beyond, there is a great opportunity to lean into creating as much beneficial virtual culture as we can. Through this experience, we'll all learn new ways of interacting, which will serve us well in the future.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/virtual-community-management
作者:[Patricia Dugan][a]
选题:[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/patricia-dugan
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/OSDC_women_computing_5.png?itok=YHpNs_ss (Women in computing and open source v5)
[2]: https://info.containo.us/traefik-ambassador-program
[3]: https://goleansixsigma.com/the-most-dangerous-phrase/
[4]: https://www.linuxfoundation.org/wp-content/uploads/2019/10/osjobsreport_2018.pdf

View File

@@ -0,0 +1,72 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (FCC boosts Wi-Fi 6 spectrum five-fold)
[#]: via: (https://www.networkworld.com/article/3540288/fcc-boosts-wi-fi-6-spectrum-five-fold.html)
[#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/)
FCC boosts Wi-Fi 6 spectrum five-fold
======
The Federal Communications Commission has approved a chunk of wireless spectrum called the 6GHz band for unlicensed use by Wi-Fi 6, and gear that supports it could be available by the end of the year.
[tejasp][1] [(CC0)][2]
The Federal Communications commission has opened up a wide swath of wireless spectrum for unlicensed use by Wi-Fi devices, which will lead to Wi-Fi access points that have greatly expanded capacity.
Its a huge victory for the Wi-Fi industry, as the ruling means that the amount of spectrum available for Wi-Fi just about quintupled in an instant. That means big, spacious channels and a lot more channels overall that can handle a lot more data and a lot more connections at the same time, according to Aruba vice president of wireless strategy and standards Chuck Lukaszewski.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][3]
“Overnight, youre going to see an additional gigabit per second or more of potential throughput,” he said.
Thats a major upside, certainly, even if “overnight” might be a slightly optimistic view of when [Wi-Fi 6E][4] the trade name for the new version of Wi-Fi that will take advantage of the new spectrum hits the market. While some of the necessary standards havent yet been finalized by the IEEE, the basic ability to use 6GHz frequencies is already written into the existing Wi-Fi 6 specification.
Broadcom director of product marketing and government affairs Chris Szymanski said that the main technical hurdle to implementing Wi-Fi 6E will be new radios, but that his company is among those that has already been designing and building compatible silicon.
“I expect that the FCC will provide guidance on how to certify devices in the next few months,” he said. “I expect product available in the US in the late fall before the holidays.”
Enterprise uptake will likely have to wait until compatible smartphones, laptops and the like are on shelves because existing Wi-Fi 6 cliets wont be able to take advantage of the new 6Ghz spectrum.
**[ [Take this mobile device management course from PluralSight and learn how to secure devices in your company without degrading the user experience.][5] ]**
New access points are likely to have three radios in them, as opposed to the usual two, noted senior vice president of Ruckus Wireless and cloud at Commscope Bart Giordano. One each for the existing 2.4GHz and 5GHz bands, and a third for 6Ghz.
“Antennas will be very similar because these spectrums sit next to one another,” he said, “but theres specific tunings you have to do.”
The driving force behind the spectrum expansion is the bottomless demand for capacity caused by the increasing use of wireless just about everywhere. The FCCs announcement cites projections from Cisco that say about 60% of worldwide data traffic will move across Wi-Fi links within the next two years.
Incumbent licensed users of parts of the 6GHz spectrum which are mostly businesses using microwave links for wireless backhaul and public safety services are far less pleased by the FCCs decision. The Utilities Technology Council is one of several groups critical of earlier proposals to open the 6GHz band to broad-based unlicensed use, saying earlier that assurances that existing users would be protected from interference are unconvincing.
“We have and will continue to provide the FCC with technical detail demonstrating the very real interference potential from unlicensed use across all parts of the band and the need for thoroughly tested automated frequency coordination (AFC) to protect incumbent users,” the group said in a statement. “While we appreciate the FCC proposing to require AFC for the standard-power access points, these measures must also be applied to all unlicensed devices in the band to prevent interference to mission-critical utility communications systems.”
Farpoint Group principal and Network World contributor Craig Mathias said that its not going to be a smooth process, but argues that the opening of 6GHz spectrum was too great an opportunity to ignore.
“Yes, its a mess spectral re-allocations always are,” he said. “[But] I don't see any issues here that can't be addressed, and more unlicensed spectrum is of course always desirable.”
Incumbent users of the 6GHz spectrum are unlikely to see the type of interference theyre particularly worried about, he added, given the nature of the connections currently in use and the safeguards in the new rule that are designed to protect existing networks.
“Point-to-point microwave links operate at fairly high power and use both directional antennas and error-checking protocols to ensure reliability and otherwise deal with typical radio issues beyond interference, like the various forms of fading,” said Mathias. “A nearby Wi-Fi transmitter will be operating at much lower power and use its own signal-integrity-management techniques as well. So likely no issues in the vast majority of cases, especially if history is any guide.”
Join the Network World communities on [Facebook][6] and [LinkedIn][7] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3540288/fcc-boosts-wi-fi-6-spectrum-five-fold.html
作者:[Jon Gold][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Jon-Gold/
[b]: https://github.com/lujun9972
[1]: https://pixabay.com/en/wifi-wireless-device-wi-fi-1371030/
[2]: https://creativecommons.org/publicdomain/zero/1.0/
[3]: https://www.networkworld.com/newsletters/signup.html
[4]: https://www.networkworld.com/article/3238664/80211-wi-fi-standards-and-speeds-explained.html
[5]: https://pluralsight.pxf.io/c/321564/424552/7490?u=https%3A%2F%2Fwww.pluralsight.com%2Fcourses%2Fmobile-device-management-big-picture
[6]: https://www.facebook.com/NetworkWorld/
[7]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,89 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Red Hat Enterprise Linux 8.2 Hits the stage)
[#]: via: (https://www.networkworld.com/article/3540189/red-hat-enterprise-linux-82-hits-the-stage.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
Red Hat Enterprise Linux 8.2 Hits the stage
======
RHEL 8.2 has new capabilities for management of hybrid-cloud environments and container tools to help fuel cloud-native development.
Stephen Lawson/IDG
Red Hat Enterprise Linux (RHEL) 8.2 brings new features that include expanded monitoring capabilities in Red Hat Insights for and new container tools, including containerized versions of Skopeo and Buildah.
Red Hat says RHEL 8.2 is arriving at a time when, because of the Covid-19 pandemic, a growing percentage of IT staffers are working remotely. Their ability to support the management and monitoring of operations and their ability to detect and address problems has never been more critical, and upgrades to Red Hat Insights are designed to help.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][1]
### Red Hat Insights
[Red Hat Insights][2], is Red Hats operations and security-risk-management offering and helps detect, diagnose and remediate potential problems before they affect production systems or end users. It was included in RHEL in May 2019.
The latest updates include:
* Improved visibility and  security for managing large, complex environments
* Policy and patch services to help determine which product advisories apply and guidance for problem remediation
* A "drift service" to make it easier to compare baselines, shape strategies that reduce complexity, and make troubleshooting easier
### Monitoring and performance updates
RHEL 8.2 brings some performance upgrades includeing:
* Improved resource management with Control Groups (cgroup) v2, which is designed to reserve and set limits on memory usage to help prevent processes from overconsuming memory and causing system failures or slowdowns.
* Optimizing performance-sensitive workloads via NUMA and sub-NUMA service policies.
* Performance Co-Pilot (PCP) 5.0.2 which adds collection agents for Microsoft SQL Server 2019 to gather and analyze SQL Server metrics to draw a clearer picture of database and operating-system performance.
* Red Hat subscription watch,a service for viewing and managing RHEL and Red Hat OpenShift Container Platform subscriptions.
### Evolving container tools
RHEL 8.2 includes new container tools that are supported for 24 months as part of Red Hat's Tech Preview, which provides early access to new products. The tools include Buildah for building and Skopeo for transferring container images.
The new relase also introduces Udica, a policy tool for containerized SELinux that can make it less likely that processes will break out of containers and cause problems to other containers or the host.
[][3]
Red Hat Enterprise Linux 8.2 also introduces enhancements to the Red Hat Universal Base Image, including:
* OpenJDK and .NET 3.0 for developing  certification-ready cloud-native Red Hat applications
* **Improved access to source code associated with a given image through a single command**, making it easier for Red Hat partners to meet source code requirements for open source licensing needs.
### Ease of use
Other new features are meant to make it easier to manage RHEL:
* RHEL subscription registration as part of the installation process, making it easier to on-board new installations.
* Enabling Red Hat Insights during installation to simplify the launch of Insights for Red Hat Enterprise Linux deployments.
* Refinement and control of the Red Hat Enterprise Linux life cycle with testing for in-place upgrades, Red Hat Insights rules to help with upgrades, and the [Convert2 RHEL][4] tool that can help shift workloads from unsupported clones like CentOS to RHEL.
Join the Network World communities on [Facebook][5] and [LinkedIn][6] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3540189/red-hat-enterprise-linux-82-hits-the-stage.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/newsletters/signup.html
[2]: https://www.redhat.com/en/blog/expanding-management-operational-and-security-risks-new-red-hat-insights
[3]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[4]: https://www.redhat.com/en/blog/convert2rhel-how-update-rhel-systems-place-subscribe-rhel
[5]: https://www.facebook.com/NetworkWorld/
[6]: https://www.linkedin.com/company/network-world

View File

@@ -1,3 +1,4 @@
//messon007 translating
Systemd Services: Reacting to Change
======

View File

@@ -1,3 +1,4 @@
//translating by messon007
Systemd Services: Monitoring Files and Directories
======

View File

@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (Zioyi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@@ -1,98 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What is Silverblue?)
[#]: via: (https://fedoramagazine.org/what-is-silverblue/)
[#]: author: (Tomáš Popela https://fedoramagazine.org/author/tpopela/)
What is Silverblue?
======
![][1]
Fedora Silverblue is becoming more and more popular inside and outside the Fedora world. So based on feedback from the community, here are answers to some interesting questions about the project. If you do have any other Silverblue related questions, please leave it in the comments section and we will try to answer them in a future article.
### What is Silverblue?
Silverblue is a codename for the new generation of the desktop operating system, previously known as Atomic Workstation. The operating system is delivered in images that are created by utilizing the _[rpm-ostree][2]_ [project][2]. The main benefits of the system are speed, security, atomic updates and immutability.
### What does “Silverblue” actually mean?
“Team Silverblue” or “Silverblue” in short doesnt have any hidden meaning. It was chosen after roughly two months when the project, previously known as Atomic Workstation was rebranded. There were over 150 words or word combinations reviewed in the process. In the end _Silverblue_ was chosen because it had an available domain as well as the social network accounts. One could think of it as a new take on Fedoras blue branding, and could be used in phrases like “Go, Team Silverblue!” or “Want to join the team and improve Silverblue?”.
### What is ostree?
[OSTree or libostree is a project][3] that combines a “git-like” model for committing and downloading bootable filesystem trees, together with a layer to deploy them and manage the bootloader configuration. OSTree is used by rpm-ostree, a hybrid package/image based system that Silverblue uses. It atomically replicates a base OS and allows the user to “layer” the traditional RPM on top of the base OS if needed.
### Why use Silverblue?
Because it allows you to concentrate on your work and not on the operating system youre running. Its more robust as the updates of the system are atomic. The only thing you need to do is to restart into the new image. Also, if theres anything wrong with the currently booted image, you can easily reboot/rollback to the previous working one, if available. If it isnt, you can download and boot any other image that was generated in the past, using the _ostree_ command.
Another advantage is the possibility of an easy switch between branches (or, in an old context, Fedora releases). You can easily try the _[Rawhide][4]_ or _[updates-testing][5]_ branch and then return back to the one that contains the current stable release. Also, you should consider Silverblue if you want to try something new and unusual.
### What are the benefits of an immutable OS?
One of the main benefits is security. The base operating system is mounted as read-only, and thus cannot be modified by malicious software. The only way to alter the system is through the _rpm-ostree_ utility.
Another benefit is robustness. Its nearly impossible for a regular user to get the OS to the state when it doesnt boot or doesnt work properly after accidentally or unintentionally removing some system library. Try to think about these kind of experiences from your past, and imagine how Silverblue could help you there.
### How does one manage applications and packages in Silverblue?
For graphical user interface applications, [Flatpak][6] is recommended, if the application is available as a flatpak. Users can choose between Flatpaks from either Fedora and built from Fedora packages and in Fedora-owned infrastructure, or Flathub that currently has a wider offering. Users can install them easily through GNOME Software, which already supports Fedora Silverblue.
One of the first things users find out is there is no _dnf_ preinstalled in the OS. The main reason is that it wouldnt work on Silverblue — and part of its functionality was replaced by the _rpm-ostree_ command. Users can overlay the traditional packages by using the _rpm-ostree install PACKAGE_. But it should only be used when there is no other way. This is because when the new system images are pulled from the repository, the system image must be rebuilt every time it is altered to accommodate the layered packages, or packages that were removed from the base OS or replaced with a different version.
Fedora Silverblue comes with the default set of GUI applications that are part of the base OS. The team is working on porting them to Flatpaks so they can be distributed that way. As a benefit, the base OS will become smaller and easier to maintain and test, and users can modify their default installation more easily. If you want to look at how its done or help, take a look at the official [documentation][7].
### What is Toolbox?
[_Toolbox_][8] is a project to make containers easily consumable for regular users. It does that by using _podman_s rootless containers. _Toolbox_ lets you easily and quickly create a container with a regular Fedora installation that you can play with or develop on, separated from your OS.
### Is there any Silverblue roadmap?
Formally there isnt any, as were focusing on problems we discover during our testing and from community feedback. Were currently using Fedoras [Taiga][9] to do our planning.
### Whats the release life cycle of the Silverblue?
Its the same as regular Fedora Workstation. A new release comes every 6 months and is supported for 13 months. The team plans to release updates for the OS bi-weekly (or longer) instead of daily as they currently do. That way the updates can be more thoroughly tested by QA and community volunteers before they are sent to the rest of the users.
### What is the future of the immutable OS?
From our point of view the future of the desktop involves the immutable OS. Its safest for the user, and Android, ChromeOS, and the last macOS Catalina all use this method under the hood. For the Linux desktop there are still problems with some third party software that expects to write to the OS. HP printer drivers are a good example.
Another issue is how parts of the system are distributed and installed. Fonts are a good example. Currently in Fedora theyre distributed in RPM packages. If you want to use them, you have to overlay them and then restart to the newly created image that contains them.
### What is the future of standard Workstation?
There is a possibility that the Silverblue will replace the regular Workstation. But theres still a long way to go for Silverblue to provide the same functionality and user experience as the Workstation. In the meantime both desktop offerings will be delivered at the same time.
### How does Atomic Workstation or Fedora CoreOS relate to any of this?
Atomic Workstation was the name of the project before it was renamed to Fedora Silverblue.
Fedora CoreOS is a different, but similar project. It shares some fundamental technologies with Silverblue, such as _rpm-ostree_, _toolbox_ and others. Nevertheless, CoreOS is a more minimal, container-focused and automatically updating OS.
--------------------------------------------------------------------------------
via: https://fedoramagazine.org/what-is-silverblue/
作者:[Tomáš Popela][a]
选题:[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/tpopela/
[b]: https://github.com/lujun9972
[1]: https://fedoramagazine.org/wp-content/uploads/2019/07/what-is-fedora-silverblue-816x345.jpg
[2]: https://rpm-ostree.readthedocs.io/en/latest/
[3]: https://ostree.readthedocs.io/en/latest/
[4]: https://fedoraproject.org/wiki/Releases/Rawhide
[5]: https://fedoraproject.org/wiki/QA:Updates_Testing
[6]: https://flatpak.org/
[7]: https://docs.fedoraproject.org/en-US/flatpak/tutorial/
[8]: https://github.com/debarshiray/toolbox
[9]: https://teams.fedoraproject.org/project/silverblue/

View File

@@ -0,0 +1,307 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (20 Linux Command Tips and Tricks That Will Save You A Lot of Time)
[#]: via: (https://itsfoss.com/linux-command-tricks/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
20 Linux Command Tips and Tricks That Will Save You A Lot of Time
======
_**Brief**: Here are some tiny but useful Linux commands, terminal tricks and shortcuts that will save you a lot of time while working with Linux command line._
Have you ever encountered a moment when you see your colleague using some simple Linux commands for tasks that took you several keystrokes? And when you saw that you were like, “Wow! I didnt know it could have been done that easily”.
In this article, Ill show you some pro Linux command tricks that will save you a lot of time and in some cases, from plenty of frustration. Not only your friends or colleagues will wow at you, it will also help you increase your productivity as you will need fewer keystrokes and even fewer mouse clicks.
Its not that these are Linux tips for beginners only. Chances are that even experienced Linux users will find some hidden gems that they were not aware despite using Linux for all these years.
In any case, you [learn Linux][1] by experience, be it your own or someone elses :)
### Cool Linux terminal tricks to save time and increase productivity
![][2]
You might already know a few of these Linux command tips or perhaps all of it. In either case, you are welcome to share your favorite tricks in the comment section.
Some of these tips also depend on how the shell is configured. Lets begin!
#### 0\. Using tab for autocompletion
Ill start with something really obvious and yet really important: tab completion.
When you are starting to type something in Linux terminal, you can hit the tab key and it will suggest all the possible options that start with string you have typed so far.
For example, if you are trying to copy a file named my_best_file_1.txt, you can just type cp m and hit tab to see the possible options.
![Use tab for auto-completion][3]
You can use tab in completing commands as well.
[irp posts=”16244″ name=”Difference Between apt and apt-get Explained”]
#### 1\. Switch back to the last working directory
Suppose you end up in a long directory path and then you move to another directory in a totally different path. And then you realize that you have to go back to the previous directory you were in. In this case, all you need to do is to type this command:
```
cd -
```
This will put you back in the last working directory. You dont need to type the long directory path or copy paste it anymore.
![Easily switch between directories][4]
#### 2\. Go back to home directory
This is way too obvious. You can use the command below to move to your home directory from anywhere in Linux command-line:
```
cd ~
```
However, you can also use just cd to go back to home directory:
```
cd
```
Most modern Linux distributions have the shell pre-configured for this command. Saves you at least two keystrokes here.
![Move to Home as quickly as possible][5]
#### 3\. List the contents of a directory
You must be guessing whats the trick in the command for listing the contents of a directory. Everyone knows to use the ls -l for this purpose.
And thats the thing. Most people use ls -l to list the contents of the directory, whereas the same can be done with the following command:
```
ll
```
Again, this depends on the Linux distributions and shell configuration, but chances are that youll be able to use it in most Linux distributions.
![Using ll instead of ls -l][6]
#### 4\. Running multiple commands in one single command
Suppose, you have to run several commands one after another. Do you wait for the first command to finish running and then execute the next one?
You can use the ; separator for this purpose. This way, you can run a number of commands in one line. No need to wait for the previous commands to finish their business.
```
command_1; command_2; command_3
```
#### 5\. Running multiple commands in one single command only if the previous command was successful
In the previous command, you saw how to run several commands in one single command to save time. But what if you have to make sure that commands dont fail?
Imagine a situation where you want to build a code and then if the build was successful, run the make?
You can use &amp;&amp; separator for this case. &amp;&amp; makes sure that the next command will only run when the previous command was successful.
```
command_1 && command_2
```
A good example of this command is when you use sudo apt update &amp;&amp; sudo apt upgrade to upgrade your system.
#### 6\. Easily search and use the commands that you had used in the past
Imagine a situation where you used a long command couple of minutes/hours ago and you have to use it again. Problem is that you cannot remember the exact command anymore.
Reverse search is your savior here. You can search for the command in the history using a search term.
Just use the keys ctrl+r to initiate reverse search and type some part of the command. It will look up into the history and will show you the commands that matches the search term.
```
ctrl+r search_term
```
By default, it will show just one result. To see more results matching your search term, you will have to use ctrl+r again and again. To quit reverse search, just use Ctrl+C.
![Reverse search in command history][7]
Note that in some Bash shells, you can also use Page Up and Down key with your search term and it will autocomplete the command.
#### 7\. Unfreeze your Linux terminal from accidental Ctrl+S
You probably are habitual of using Ctrl+S for saving. But if you use that in Linux terminal, youll have a frozen terminal.
Dont worry, you dont have to close the terminal, not anymore. Just use Ctrl+Q and you can use the terminal again.
```
ctrl+Q
```
#### 8\. Move to beginning or end of line
Suppose you are typing a long command and midway you realize that you had to change something at the beginning. You would use several left arrow keystrokes to move to the start of the line. And similarly for going to the end of the line.
You can use Home and End keys here of course but alternatively, you can use Ctrl+A to go to the beginning of the line and Ctrl+E to go to the end.
![Move to the beginning or end of the line][8]
I find it more convenient than using the home and end keys, especially on my laptop.
#### 9\. Reading a log file in real time
In situations where you need to analyze the logs while the application is running, you can use the tail command with -f option.
```
tail -f path_to_Log
```
You can also use the regular grep options to display only those lines that are meaningful to you:
```
tail -f path_to_log | grep search_term
```
You can also use the option F here. This will keep the tail running even if the log file is deleted. So if the log file is created again, tail will continue logging.
#### 10\. Reading compressed logs without extracting
Server logs are usually gzip compressed to save disk space. It creates an issue for the developer or sysadmin analyzing the logs. You might have to [scp][9] it to your local and then extract it to access the files because, at times, you dont have write permission to extract the logs.
Thankfully, z commands save you in such situations. z commands provide alternatives of the regular commands that you use to deal with log files such as less, cat, grep etc.
So you get zless, zcat, zgrep etc and you dont even have to explicitly extract the compressed files. Please refer to my earlier article about [using z commands to real compressed logs][10] in detail.
This was one of the secret finds that won me a coffee from my colleague.
#### 11\. Use less to read files
To see the contents of a file, cat is not the best option especially if it is a big file. cat command will display the entire file on your screen.
You can use Vi, Vim or other terminal based text editors but if you just want to read a file, less command is a far better choice.
```
less path_to_file
```
You can search for terms inside less, move by page, display with line numbers etc.
#### 12\. Reuse the last item from the previous command with !$
Using the argument of the previous command comes handy in many situations.
Say you have to create a directory and then go into the newly created directory. There you can use the !$ options.
![Use !$ to use the argument of last command][11]
A better way to do the same is to use alt+. . You can use . a number times to shuffle between the options of the last commands.
#### 13\. Reuse the previous command in present command with !!
You can call the entire previous command with !!. This comes particularly useful when you have to run a command and realize that it needs root privileges.
A quick sudo !! saves plenty of keystrokes here.
![Use !! to use last command as an argument][12]
#### 14\. Using alias to fix typos
You probably already know what is an alias command in Linux. What you can do is, to use them to fix typos.
For example, you might often mistype grep as gerp. If you put an alias in your bashrc in this fashion:
```
alias gerp=grep
```
This way you wont have to retype the command again.
#### 15\. Copy Paste in Linux terminal
This one is slightly ambiguous because it depends on Linux distributions and terminal applications. But in general, you should be able to copy paste commands with these shortcuts:
* Select the text for copying and right click for paste (works in Putty and other Windows SSH clients)
* Select the text for copying and middle click (scroll button on the mouse) for paste
* Ctrl+Shift+C for copy and Ctrl+Shift+V for paste
#### 16\. Kill a running command/process
This one is perhaps way too obvious. If there is a command running in the foreground and you want to exit it, you can press Ctrl+C to stop that running command.
#### 17\. Using yes command for commands or scripts that need interactive response
If there are some commands or scripts that need user interaction and you know that you have to enter Y each time it requires an input, you can use Yes command.
Just use it in the below fashion:
```
yes | command_or_script
```
#### 18\. Empty a file without deleting it
If you just want to empty the contents of a text file without deleting the file itself, you can use a command similar to this:
```
> filename
```
#### 19\. Find if there are files containing a particular text
There are multiple ways to search and find in Linux command line. But in the case when you just want to see if there are files that contain a particular text, you can use this command:
```
grep -Pri Search_Term path_to_directory
```
I highly advise mastering find command though.
#### 20\. Using help with any command
Ill conclude this article with one more obvious and yet very important trick, using help with a command or a command line tool.
Almost all command and command line tool come with a help page that shows how to use the command. Often using help will tell you the basic usage of the tool/command.
Just use it in this fashion:
```
command_tool --help
```
#### Your favorite Linux command line tricks?
I have deliberately not included commands like [fuck][13] because those are not standard commands that youll find everywhere. The tricks discussed here should be usable almost in all Linux distributions and shell without the need of installing a new tool.
I would also suggest [using alias command in Linux][14] to replace complicated commands with a simple. Saves a lot of time.
I know that there are more Linux command tricks to save time in the terminal. Why not share some of your experiences with Linux and do share your best trick with rest of the community here? The comment section below is at your disposal.
--------------------------------------------------------------------------------
via: https://itsfoss.com/linux-command-tricks/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/learn-linux-for-free/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-Tricks-Save-Time.jpeg?resize=800%2C450&ssl=1
[3]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-8.png?ssl=1
[4]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-1.png?ssl=1
[5]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-2.png?ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-3.png?ssl=1
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-4.png?ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-5.png?ssl=1
[9]: http://www.hypexr.org/linux_scp_help.php
[10]: https://itsfoss.com/read-compressed-log-files-linux/
[11]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-6.png?ssl=1
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2017/08/Linux-Command-tricks-to-save-time-7.png?ssl=1
[13]: https://github.com/nvbn/thefuck
[14]: https://linuxhandbook.com/linux-alias-command/

View File

@@ -1,188 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (robsean)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to make a Halloween lantern with Inkscape)
[#]: via: (https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape)
[#]: author: (Jess Weichler https://opensource.com/users/cyanide-cupcake)
How to make a Halloween lantern with Inkscape
======
Use open source tools to make a spooky and fun decoration for your
favorite Halloween haunt.
![Halloween - backlit bat flying][1]
The spooky season is almost here! This year, decorate your haunt with a unique Halloween lantern made with open source!
Typically, a portion of a lantern's structure is opaque to block the light from within. What makes a lantern a lantern are the parts that are missing: windows cut from the structure so that light can escape. While it's impractical for lighting, a lantern with windows in spooky shapes and lurking silhouettes can be atmospheric and a lot of fun to create.
This article demonstrates how to create your own lantern using [Inkscape][2]. If you don't have Inkscape, you can install it from your software repository on Linux or download it from the [Inkscape website][3] on MacOS and Windows.
### Supplies
* Template ([A4][4] or [Letter][5] size)
* Cardstock (black is traditional)
* Tracing paper (optional)
* Craft knife, ruler, and cutting mat (a craft cutting machine/laser cutter can be used instead)
* Craft glue
* LED tea-light "candle"
_Safety note:_ Only use battery-operated candles for this project.
### Understanding the template
To begin, download the correct template for your region (A4 or Letter) from the links above and open it in Inkscape.
* * *
* * *
* * *
**![Lantern template screen][6]**
The gray-and-white checkerboard background is see-through (in technical terms, it's an _alpha channel_.)
The black base forms the lantern. Right now, there are no windows for light to shine through; the lantern is a solid black base. You will use the **Union** and **Difference** options in Inkscape to design the windows digitally.
The dotted blue lines represent fold scorelines. The solid orange lines represent guides. Windows for light should not be placed outside the orange boxes.
To the left of the template are a few pre-made objects you can use in your design.
### To create a window or shape
1. Create an object that looks like the window style you want. Objects can be created using any of the shape tools in Inkscape's left toolbar. Alternately, you can download Creative Commons- or Public Domain-licensed clipart and import the PNG file into your project.
2. When you are happy with the shape of the object, turn it into a **Path** (rather than a **Shape**, which Inkscape sees as two different kinds of objects) by selecting **Object &gt; Object to Path** in the top menu.
![Object to path menu][7]
3. Place the object on top of the base shape.
4. Select both the object and the black base by clicking one, pressing and holding the Shift key, then selecting the other.
5. Select **Object &gt; Difference** from the top menu to remove the shape of the object from the base. This creates what will become a window in your lantern.
![Object > Difference menu][8]
### To add an object to a window
After making a window, you can add objects to it to create a scene.
**Tips:**
* All objects, including text, must be connected to the base of the lantern. If not, they will fall out after cutting and leave a blank space.
* Avoid small, intricate details. These are difficult to cut, even when using a machine like a laser cutter or a craft plotter.
1. Create or import an object.
2. Place the object inside the window so that it is touching at least two sides of the base.
3. With the object selected, choose **Object &gt; Object to Path** from the top menu.
![Object to path menu][9]
4. Select the object and the black base by clicking on each one while holding the Shift key).
5. Select **Object &gt; Union** to join the object and the base.
### Add text
Text can either be cut out from the base to create a window (as I did with the stars) or added to a window (which blocks the light from within the lantern). If you're creating a window, only follow steps 1 and 2 below, then use **Difference** to remove the text from the base layer.
1. Select the Text tool from the left sidebar to create text. Thick, bold fonts work best.
![Text tool][10]
2. Select your text, then choose **Path &gt; Object to Path** from the top menu. This converts the text object to a path. Note that this step means you can no longer edit the text, so perform this step _only after_ you're sure you have the word or words you want.
3. After you have converted the text, you can press **F2** on your keyboard to activate the **Node Editor** tool to clearly show the nodes of the text when it is selected with this tool.
![Text selected with Node editor][11]
4. Ungroup the text.
5. Adjust each letter so that it slightly overlaps its neighboring letter or the base.
![Overlapping the text][12]
6. To connect all of the letters to one another and to the base, re-select all the text and the base, then select **Path &gt; Union**.
![Connecting letters and base with Path > Union][13]
### Prepare for printing
The following instructions are for hand-cutting your lantern. If you're using a laser cutter or craft plotter, follow the techniques required by your hardware to prepare your files.
1. In the **Layer** panel, click the **Eye** icon beside the **Safety** layer to hide the safety lines. If you don't see the Layer panel, reveal it by selecting **Layer &gt; Layers** from the top menu.
2. Select the black base. In the **Fill and Stroke** panel, set the fill to **X** (meaning _no fill_) and the **Stroke** to solid black (that's #000000ff to fans of hexes).
![Setting fill and stroke][14]
3. Print your pattern with **File &gt; Print**.
4. Using a craft knife and ruler, carefully cut around each black line. Lightly score the dotted blue lines, then fold.
![Cutting out the lantern][15]
5. To finish off the windows, cut tracing paper to the size of each window and glue it to the inside of the lantern.
![Adding tracing paper][16]
6. Glue the lantern together at the tabs.
7. Turn on a battery-powered LED candle and place it inside your lantern.
![Completed lantern][17]
Now your lantern is complete and ready to light up your haunt. Happy Halloween!
How to make Halloween bottle labels with Inkscape, GIMP, and items around the house.
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/10/how-make-halloween-lantern-inkscape
作者:[Jess Weichler][a]
选题:[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/cyanide-cupcake
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/halloween_bag_bat_diy.jpg?itok=24M0lX25 (Halloween - backlit bat flying)
[2]: https://opensource.com/article/18/1/inkscape-absolute-beginners
[3]: http://inkscape.org
[4]: https://www.dropbox.com/s/75qzjilg5ak2oj1/papercraft_lantern_A4_template.svg?dl=0
[5]: https://www.dropbox.com/s/8fswdge49jwx91n/papercraft_lantern_letter_template%20.svg?dl=0
[6]: https://opensource.com/sites/default/files/uploads/lanterntemplate_screen.png (Lantern template screen)
[7]: https://opensource.com/sites/default/files/uploads/lantern1.png (Object to path menu)
[8]: https://opensource.com/sites/default/files/uploads/lantern2.png (Object > Difference menu)
[9]: https://opensource.com/sites/default/files/uploads/lantern3.png (Object to path menu)
[10]: https://opensource.com/sites/default/files/uploads/lantern4.png (Text tool)
[11]: https://opensource.com/sites/default/files/uploads/lantern5.png (Text selected with Node editor)
[12]: https://opensource.com/sites/default/files/uploads/lantern6.png (Overlapping the text)
[13]: https://opensource.com/sites/default/files/uploads/lantern7.png (Connecting letters and base with Path > Union)
[14]: https://opensource.com/sites/default/files/uploads/lantern8.png (Setting fill and stroke)
[15]: https://opensource.com/sites/default/files/uploads/lantern9.jpg (Cutting out the lantern)
[16]: https://opensource.com/sites/default/files/uploads/lantern10.jpg (Adding tracing paper)
[17]: https://opensource.com/sites/default/files/uploads/lantern11.jpg (Completed lantern)

View File

@@ -1,128 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting started with Linux firewalls)
[#]: via: (https://opensource.com/article/20/2/firewall-cheat-sheet)
[#]: author: (Seth Kenlon https://opensource.com/users/seth)
Getting started with Linux firewalls
======
A firewall is your computer's first line of defense against network
intrusion. Download our cheat sheet to make sure you're secure.
![Cheat Sheet cover image][1]
A sensible firewall is your computer's first line of defense against network intrusion. When you're at home, you're probably behind a firewall built into the router supplied by your internet service provider. When you're away from home, though, the only firewall you have is the one running on your computer, so it's important to configure and control the firewall on your Linux computer. If you run a Linux server, it's just as important to know how to manage your firewall so that you can protect it from unwanted traffic both locally and remotely.
### Install a firewall
Many Linux distributions ship with a firewall already installed, and traditionally that was **iptables**. It is extremely effective and customizable, but it can be complex to configure. Luckily, developers have produced several frontends to help users control their firewall without writing lengthy iptables rules.
On Fedora, CentOS, Red Hat, and similar distributions, the firewall software installed by default is **firewalld**, which is configured and controlled with the **firewall-cmd** command. On Debian and most other distributions, firewalld is available to install from your software repository. Ubuntu ships with the Uncomplicated Firewall (ufw), so to use firewalld, you must enable the **universe** repository:
```
$ sudo add-apt-repository universe
$ sudo apt install firewalld
```
You must also deactivate ufw:
```
`$ sudo systemctl disable ufw`
```
There's no reason _not_ to use ufw. It's an excellent firewall frontend. However, this article focuses on firewalld because of its wide availability and integration into systemd, which is shipped with nearly every distribution.
Regardless of your distribution, for a firewall to be effective, it must be active, and it should be loaded at boot time:
```
`$ sudo systemctl enable --now firewalld`
```
### Understanding firewall zones
Firewalld aims to make firewall configuration as simple as possible. It does this by establishing _zones_. A zone is a set of sensible, common rules that suit the everyday needs of most users. There are nine by default:
* **trusted:** All network connections are accepted. This is the least paranoid firewall setting and should only be used in a trusted environment, such as a test lab or in a family home where everyone on the local network is known to be friendly.
* **home, work, internal:** In these three zones, most incoming connections are accepted. They each exclude traffic on ports that usually expect no activity. Any of them is a reasonable setting for use in a home setting where there is no reason to expect network traffic to obscure ports, and you generally trust the other users on the network.
* **public:** For use in public areas. This is a paranoid setting, intended for times when you do not trust other computers on the network. Only selected common and mostly safe incoming connections are accepted.
* **dmz:** DMZ stands for demilitarized zone. This zone is intended for computers that are publically accessible, located on an organization's external network with limited access to the internal network. For personal computers, this is usually not a useful zone, but it is an important option for certain types of servers.
* **external:** For use on external networks with masquerading enabled (meaning the addresses of your private network are mapped to and hidden behind a public IP address). Similar to the dmz zone, only selected incoming connections are accepted, including SSH.
* **block:** Only network connections initiated within this system are possible, and all incoming network connections are rejected with an **icmp-host-prohibited** message. This is an extremely paranoid setting and is an important option for certain types of servers or personal computers in an untrusted or hostile environment.
* **drop:** Any and all incoming network packets are dropped with no reply. Only outgoing network connections are possible. The only setting more paranoid than this one is turning off your WiFi and unplugging your Ethernet cable.
You can read about each zone and any other zones defined by your distribution or sysadmin by looking at the configuration files in **/usr/lib/firewalld/zones**. For instance, here's the FedoraWorkstation zone that ships with Fedora 31:
```
$ cat /usr/lib/firewalld/zones/FedoraWorkstation.xml
&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;zone&gt;
  &lt;short&gt;Fedora Workstation&lt;/short&gt;
  &lt;description&gt;Unsolicited incoming network packets are rejected from port 1 to 1024, except for select network services. Incoming packets that are related to outgoing network connections are accepted. Outgoing network connections are allowed.&lt;/description&gt;
  &lt;service name="dhcpv6-client"/&gt;
  &lt;service name="ssh"/&gt;
  &lt;service name="samba-client"/&gt;
  &lt;port protocol="udp" port="1025-65535"/&gt;
  &lt;port protocol="tcp" port="1025-65535"/&gt;
&lt;/zone&gt;
```
### Getting your current zone
You can see what zone you're in at any time with the **\--get-active-zones** option:
```
`$ sudo firewall-cmd --get-active-zones`
```
In response, you receive the name of the active zone along with the network interface assigned to it. On a laptop, that usually means you have a WiFi card in the default zone:
```
FedoraWorkstation
  interfaces: wlp61s0
```
### Change your current zone
To change your zone, reassign your network interface to a different zone. For instance, to change the example **wlp61s0** card to the public zone:
```
$ sudo firewall-cmd --change-interface=wlp61s0 \
\--zone=public
```
You can change the active zone for an interface any time you please and for any reason—whether you're going out to a café and feel the need to increase your laptop's security policy, or you're going to work and need to open up some ports to get on the intranet, or for any other reason. The options for **firewall-cmd** auto-complete when you press the **Tab** key, so as long as you remember the keywords "change" and "zone," you can stumble through the command until you learn it by memory.
### Learn more
There's a lot more you can do with your firewall, including customizing existing zones, setting a default zone, and more. The more comfortable with firewalls you get, the more secure your online activities are, so we've created a [cheat sheet][2] for quick and easy reference.
### Download your [firewall cheat sheet][2]
David Both shares how he replaced his dedicated network firewall computer with a Raspberry Pi 2.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/2/firewall-cheat-sheet
作者:[Seth Kenlon][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/seth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/coverimage_cheat_sheet.png?itok=lYkNKieP (Cheat Sheet cover image)
[2]: https://opensource.com/downloads/firewall-cmd-cheat-sheet

View File

@@ -1,243 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (cycoe)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What you need to know about variables in Emacs)
[#]: via: (https://opensource.com/article/20/3/variables-emacs)
[#]: author: (Clemens Radermacher https://opensource.com/users/clemera)
What you need to know about variables in Emacs
======
Learn how Elisp deals with variables and to use them in your scripts and
configurations.
![Programming keyboard.][1]
GNU Emacs is written in C and Emacs Lisp (Elisp), a dialect of the Lisp programming language. Because it's a text editor that happens to be an Elisp sandbox, it is helpful to understand how basic programming concepts work in Elisp.
If you're new to [Emacs][2], visit Sacha Chua's excellent list of [resources for Emacs beginners][3]. This article assumes you're familiar with common Emacs terminology and that you know how to read and evaluate basic snippets of Elisp code. Ideally, you should also have heard of variable scope and how it works in another programming language. The examples also assume you use a fairly recent Emacs version ([v.25 or later][4]).
The [Elisp manual][5] includes everything there is to know, but it is written for people who already know what they are looking for (and it is really great for that). But many people want resources that explain Elisp concepts at a higher level and reduce the amount of information to the most useful bits. This article is my attempt to respond to that—to give readers a good grasp of the basics so they can use them for their configuration and make it easier for people to look up some detail in the manual.
### Global variables
User options defined with **defcustom** and variables defined with **defvar** or **defconst** are global. One important aspect of variables declared by **defcustom** or **defvar** is that reevaluating them won't reset a variable if it is already bound. For example, if you establish a binding for **my-var** in your init file like this:
```
`(setq my-var nil)`
```
evaluating the following form won't reset the variable to **t**:
```
`(defvar my-var t)`
```
Note that there is _one exception_: If you evaluate the declaration above with **C-M-x** that calls **eval-defun**, the value will be reset to **t**. This way, you can enforce setting the value if you need to. This behavior is intentional: As you might know, many features in Emacs load only on demand (i.e., they are autoloaded). If the declarations in those files reset variables to their default value, this would override any settings in your init.
### User options
A user option is simply a global variable that is declared with **defcustom**. Unlike variables declared with **defvar**, such a variable is configurable with the  **M-x customize** interface. As far as I know, most people don't use it much because it feels clunky. Once you know how to set variables in your init file, there's no compelling reason to use it. One detail many users aren't aware of is that setting user options with **customize** might execute code, and this is sometimes used to run additional setup instructions:
```
(defcustom my-option t
  "My user option."
  :set (lambda (sym val)
         (set-default sym val)
         (message "Set %s to %s" sym val)))
```
If you evaluate this code and change the value using the **customize** interface with **M-x customize-option RET my-option RET **the lambda will be called, and the message in the echo area will tell you the symbol and value of the option.
If you use **setq** in your init file, to change the value of such an option, the setter function will _not_ run. To set such an option correctly with Elisp, you need to use the function **customize-set-variable**. Alternatively, people use various versions of **csetq** macros in their configs to automatically take care of this (you can use GitHub code search to discover more sophisticated variants if you like):
```
(defmacro csetq (sym val)
  `(funcall (or (get ',sym 'custom-set) 'set-default) ',sym ,val))
```
If you are using the [use-package][6] macro, the **:custom** keyword will handle this for you.
After putting the code above into your init file, you can use **csetq** to set variables in a way that respects any existing setter functions. You can prove this by watching the message in the echo area when using this macro to change the option defined above:
```
`(csetq my-option nil)`
```
### Dynamic binding and lexical binding
If you use other programming languages, you may not be aware of the differences between dynamic and lexical binding. Most programming languages today use lexical binding, and there is no need to know the difference when you learn about variable scope/lookup.
Emacs Lisp is special in this regard because dynamic binding is the default, and lexical binding must be enabled explicitly. There are historical reasons for this, and in practice, you should _always_ enable lexical binding because it is faster and less error-prone. To enable it, simply put the following comment line as the first line in your Emacs Lisp file:
```
`;;; -*- lexical-binding: t; -*-`
```
Alternatively, you can call M-x **add-file-local-variable-prop-line**, which will insert the comment line above when you choose the variable **lexical-binding** with value **t**.
When a file with such a specially formatted line is loaded, Emacs sets the variable accordingly, which means the code in that buffer is loaded with lexical binding enabled. Interactively, you can use **M-x eval-buffer**, which takes the lexical binding setting into account.
Now that you know how to enable lexical binding, it's smart to learn what the terms mean. With dynamic binding, the last binding established during program execution is used for variable lookup. You can test this by putting the following code in an empty buffer and executing **M-x eval-buffer**:
```
(defun a-exists-only-in-my-body (a)
  (other-function))
(defun other-function ()
  (message "I see `a', its value is %s" a))
(a-exists-only-in-my-body t)
```
You may be surprised to see that the lookup of variable **a** in the **other-function** is successful.
If you retry the preceding example with the special lexical-binding comment at the top, the code will throw a "variable is void" error because **other-function** does not know about the **a** variable. If you're coming from another programming language, this is the behavior you would expect.
With lexical binding, the scope is defined by the surrounding source code. This is not only for performance reasons—experience and time have shown that this behavior is preferred.
### Special variables and dynamic binding
As you may know, **let** is used to temporary establish local bindings:
```
(let ((a "I'm a")
      (b "I'm b"))
  (message "Hello, %s. Hello %s" a b))
```
Here is the thing: Variables declared with **defcustom**, **defvar**, or **defconst** are called _special variables_, and they continue to use dynamic binding regardless of whether lexical binding is enabled:
```
;;; -*- lexical-binding: t; -*-
(defun some-other-function ()
  (message "I see `c', its value is: %s" c))
(defvar c t)
(let ((a "I'm lexically bound")
      (c "I'm special and therefore dynamically bound"))
  (some-other-function)
  (message "I see `a', its values is: %s" a))
```
To see both messages in the example above, switch to the ***Messages*** buffer using **C-h e**.
Local variables bound with **let** or function arguments follow the lookup rules defined by the **lexical-binding** variable, but global variables defined with **defvar**, **defconst**, or **defcustom** can be changed deep down in the call stack for the duration of the **let** body.
This behavior allows for convenient ad-hoc customizations and is often used in Emacs, which isn't surprising given that Emacs Lisp started out with dynamic binding being the only option. Here is a common example showing how you can temporarily write to a read-only buffer:
```
(let ((inhibit-read-only t))
  (insert ...))
```
Here is another often-seen example for performing case-sensitive searches:
```
(let ((case-fold-search nil))
  (some-function-which-uses-search ...))
```
Dynamic binding allows you to change the behavior of functions in ways the authors of those functions may have never anticipated. It's a powerful tool and a great feature for a program that is designed and used like Emacs.
There is one caveat to be aware of: You might accidentally use a local variable name that is declared as a special variable elsewhere. One trick to prevent such conflicts is to avoid dashes in local variables' names. In my current Emacs session, this leaves only a handful of potential conflicting candidates:
```
(let ((vars ()))
  (mapatoms
   (lambda (cand)
     (when (and (boundp cand)
                (not (keywordp cand))
                (special-variable-p cand)
                (not (string-match "-"
                                   (symbol-name cand))))
       (push cand vars))))
  vars) ;; =&gt; (t obarray noninteractive debugger nil)
```
### Buffer-local variables
Each buffer can have a local binding for a variable. This means any variable lookup made while this buffer is current will reveal the buffer's local value of that variable instead of the default value. Local variables are an important feature in Emacs; for example, they are used by major modes to establish their buffer-local behavior and settings.
You have already seen a buffer-local variable in this article: the special comment line for **lexical-binding** that binds the buffer locally to **t**. In Emacs, such buffer-local variables defined in special comment lines are also called _file-local variables_.
Any global variable can be shadowed by a buffer-local variable. Take, for example, the **my-var** variable defined above, which you can set locally like this:
```
(setq-local my-var t)
;; or (set (make-local-variable 'my-var) t)
```
**my-var** is local to the buffer, which is current when you evaluate the code above. If you call **describe-variable** on it, the documentation tells you both the local value and the global one. Programmatically, you can check the local value using **buffer-local-value** and the default value with **default-value**. To remove the local version, you could invoke  **M-x kill-local-variable**.
Another important property to be aware of is that once a variable is buffer-local, any further use of **setq** (while this buffer is current) will continue to set the local value. To set the default value, you would need to use **setq-default**.
Because local variables are meant for buffer customization, they're used most often in mode hooks. A typical example would be something like this:
```
(add-hook 'go-mode-hook
          (defun go-setup+ ()
            (setq-local compile-command
              (if (string-suffix-p "_test.go" buffer-file-name)
                  "go test -v"
                (format "go run %s"
                        (shell-quote-argument
                         (file-name-nondirectory buffer-file-name)))))))
```
This sets the compile command used by **M-x compile** for go-mode buffers.
Another important aspect is that some variables are _automatically_ buffer-local. This means as soon as you **setq** such a variable, it sets a local binding for the current buffer. This feature shouldn't be used often (because this implicit behavior isn't nice), but if you want, you can create such automatically local variables like this:
```
(defvar-local my-automatical-local-var t)
;; or (make-variable-buffer-local 'my-automatical-local-var)
```
The variable **indent-tabs-mode** is a built-in example of this. If you use **setq** in your init file to change the value of this variable, it won't affect the default value at all. Only the value for the buffer that is current while loading your init file will be changed. Therefore, you need to use **setq-default** to change the default value of **indent-tabs-mode**.
### Closing words
Emacs is a powerful editor, and it only gets more powerful the more you change it to suit your needs. Now you know how Elisp deals with variables and how you can use them in your own scripts and configurations.
* * *
_This previously appeared on [With-Emacs][7] under a CC BY-NC-SA 4.0 license and has been adapted (with a merge request) and republished with the author's permission._
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/3/variables-emacs
作者:[Clemens Radermacher][a]
选题:[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/clemera
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/programming_keyboard_coding.png?itok=E0Vvam7A (Programming keyboard.)
[2]: https://www.gnu.org/software/emacs/
[3]: http://sachachua.com/blog/p/27144
[4]: https://www.gnu.org/software/emacs/download.html
[5]: https://www.gnu.org/software/emacs/manual/html_node/elisp/
[6]: https://github.com/jwiegley/use-package#customizing-variables
[7]: https://with-emacs.com/posts/tutorials/almost-all-you-need-to-know-about-variables/

View File

@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@@ -1,107 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube)
[#]: via: (https://itsfoss.com/lbry/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
Meet LBRY, A Blockchain-based Decentralized Alternative to YouTube
======
_**LBRY is a new Blockchain-based, open source platform for sharing digital content. It is gaining popularity as a decentralized alternative to YouTube but LBRY is more than just a video sharing service.**_
### LBRY is an open source blockchain based platform for content sharing
At the core of it, [LBRY][1] is a new protocol which is a peer to peer, decentralized file sharing and payment network secured by [blockchain][2] technology. Anyone can build apps on top of LBRY protocol that interact with digital content on the LBRY network. But these technical stuff is for developers.
As a user you can use [LBRY platform][3] for watching videos, listening to music and reading eBooks.
As a content creator, you can use LBRY to share your digital content like video, music, images, podcasts, eBooks etc.
Unlike YouTube, your activities are not tracked to serve you ads. In fact, LBRY is ad free. If you are logged into the network, you wont see any ads anywhere on its website.
### No ads, and you may even earn cryptocurrency for viewing videos on LBRY
The LBRY is governed by its own cryptocurrency called LBC (LBRY Credits).
Like any other cryptocurrency, you can mine it, buy it or get it from someone else. Content creators can set a price in LBC for streaming their content or they can provide it for free and get tipped in LBC by the viewers.
Dont worry, you dont necessarily need to buy LBC. Since its new, youll get LBC as rewards for doing simple tasks as viewing videos, exploring LBRY, following channels etc. In fact, youll get a few LBC simply for creating an account at LBRY and setting up your profile.
![LBRY Rewards Sample][4]
Youll also get LBC in rewards for inviting other users to LBRY platform. For example, if you join [LBRY from Its FOSS invite link][5], both you and I get LBC as reward.
The LBRY reward system will change once the platform grows. Remember initially Bitcoins were also readily available and now it values thousands of dollars.
### Open source, peer to peer, blockchain: LBRY ticks all the right blocks for a privacy-aware user
![LBRY interface][6]
While the cyptocurrency is essential to create a fair and open marketplace in LBRY, its main feature is the peer to peer, decentralized network using blockchain. LBRY puts emphasis on treating you as user, not a product.
Everything built to power LBRY is open source. You can find the entire source code on its GitHub repository.
[LBRY on GitHub][7]
The [LBRY FAQ page][8] is a good resource to know more about LBRY and how it works.
### Using LBRY
![][9]
If you want to give LBRY a try, you can check out its [video sharing platform][3]. If you are logged in or using its app, you wont see any ads.
Creating an account on LBRY will also let you get the LBRY rewards (i.e. the LBC cryptocurrency). You can watch the videos on LBRY web site or on its application.
I have noticed that video streaming is slightly faster when you use the app instead of web browser. [LBRY app is available][10] for Linux, Windows, macOS, iOS and Android.
As a web publisher, Its FOSS is on all major social media channels. We appreciate and respect such decentralized services and try to make a presence on such offbeat platform. You can [find us on Mastodon][11], a [decentralized alternative to Twitter][12]. You can also find Its FOSS on LBRY.
While we will be putting our video content primarily on YouTube and Vimeo (for ad-free experience), our YouTube content will be automatically available on LBRY as well.
So if you are going to use LBRY, you can follow us there to watch all our videos on LBRY.
[Join LBRY and follow Its FOSS][5]
### Conclusion
There may not be a lot of content on LBRY right now. LBRY is trying to encourage and reward creators who publish on LBRY first instead of YouTube.
LBRY is in early stages but its team is working hard to become a viable alternative to YouTube. It has an open road map where they have shared an insight into all their future plans. You may [check it out yourself][13].
By the way, LBRY is not the only platform of this kind. [PeerTube][14] is a similar service that provides a peer to peer video sharing platform.
_**If you are someone who doesnt like tech giants like Google, Microsoft, Huawei spying on your data, keeping a profile of you to serve you targeted ads, you may try platforms like PeerTube and LBRY.**_
What do you think of LBRY? Are you already using something like LBRY or PeerTube? If not, are you willing to give it a try? Whats your overall feeling about P2P platforms like LBRY? Do share your views in the comment section.
--------------------------------------------------------------------------------
via: https://itsfoss.com/lbry/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://lbry.com/
[2]: https://en.wikipedia.org/wiki/Blockchain
[3]: https://lbry.tv/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-rewards-sample.png?ssl=1
[5]: https://lbry.tv/$/invite/@itsfoss:0
[6]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry.png?ssl=1
[7]: https://github.com/lbryio/
[8]: https://lbry.com/faq
[9]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/lbry-interface.jpg?ssl=1
[10]: https://lbry.com/get
[11]: https://mastodon.social/@itsfoss
[12]: https://itsfoss.com/mastodon-open-source-alternative-twitter/
[13]: https://lbry.com/roadmap
[14]: https://joinpeertube.org/

View File

@@ -1,75 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (A handy utility for creating Raspberry Pi SD card images)
[#]: via: (https://opensource.com/article/20/4/raspberry-pi-imager-mac)
[#]: author: (James Farrell https://opensource.com/users/jamesf)
A handy utility for creating Raspberry Pi SD card images
======
Getting started with Raspberry Pi Imager on a Mac.
![Raspberries with pi symbol overlay][1]
There are many ways to buy a Raspberry Pi, and depending on who you buy it from, it may or may not come with an operating system already installed on it. Getting an OS onto a Raspberry Pi is a matter of "flashing" an SD card with an OS image. To make this as easy as possible, the [Raspberry Pi Foundation][2] has introduced a Raspberry Pi Imager application, and you can download it for all major platforms. Here's a quick intro to this helpful new utility.
### Install the Imager
You can find the Raspberry Pi Imager over at the usual [Raspberry Pi Downloads][3] page. Versions exist for Mac, Ubuntu, and Windows. I will download and demonstrate the Mac version.
Installation on Mac consists of the usual DMG image that mounts to your desktop, and then a typical installer window appears:
![Raspberry Pi Imager installer][4]
Simply drag the cute raspberry icon to the Application folder, and you are done. Invoke that from Launchpad, and you are presented with a series of simple buttons and menus to choose from. It really cannot be simpler than this:
![Raspberry Pi Imager home screen][5]
### Images and options available
The default options contain a variety of images for various Raspberry Pi models. Raspbian is the top choice with two available options for smaller "Lite" and fatter "Full" versions available. The LibreELEC Kodi entertainment system is available in various model-specific builds. Ubuntu 18 and 19 have 32-bit and 64-bit builds available for different Pi models. There is an RPi 4 EEPROM recovery utility and a function to format your card using FAT32. Finally, a generic image installer option is available that I will try out a little later. Pretty handy for a simple and compact utility.
### Install some images
I had a 16g micro SD card that I decided to play with. I selected the default Raspbian image, chose my attached USB/SD device, and pressed WRITE. Here is a brief demo:
![Raspberry Pi Imager demo][6]
I didn't post the entire sequence there. I believe it downloaded the image as it was writing and took a few minutes on my wireless connection to finish. The process goes through a write and then a verify cycle before it is finished. When it was done, I ejected the device, popped the card into my RPi 3, and was treated to the usual graphical Raspbian setup wizard and desktop environment.
That wasn't quite enough for me; I get plenty of Linux on a daily basis and was looking for a little more today. I went back to the [Raspberry Pi Downloads][3] page and pulled down the RISC OS image. This process was nearly as easy. Download the RISCOSPi.5.24.zip file, extract it, and find the ro524-1875M.img file. From the Operating System button, I selected the Use Custom option and selected the desired image file. The process was pretty much the same; the only real difference being I had to hunt around my Downloads directory and select an image. Once the file was finished writing, back into the Pi 3, and RISC OS was ready to go.
### Gripes on USB C
This is just a silly aside, but how many of you are a bit frustrated with the total inconvenience of USB C these days? I'm using a MacBook Pro, which only has USB C ports, and I am subject to a never-ending swap of adapters to get things done. Take a look at this:
![USB C adapter][7]
Yes, that is a USB C to USB A adapter, then a USB to SD card reader, and an SD to micro SD adapter inside. I probably could have found something online to simplify this, but these are the parts I had on hand to support my family's myriad Mac, Windows, and Linux hosts. Enough about that, but I hope you got a chuckle from that insanity.
### Summary
The new Raspberry Pi Imager is a simple and effective tool for getting off the ground quickly with Raspberry Pi images. [BalenaEtcher][8] is a similar tool for imaging your removable devices, but this new Raspberry Pi Imager makes the process of common RPi OS installations (like Raspbian) a bit easier by eliminating the steps to fetch those common images.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/raspberry-pi-imager-mac
作者:[James Farrell][a]
选题:[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/jamesf
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/life-raspberrypi_0.png?itok=Kczz87J2 (Raspberries with pi symbol overlay)
[2]: https://www.raspberrypi.org/
[3]: https://www.raspberrypi.org/downloads/
[4]: https://opensource.com/sites/default/files/uploads/install_1.png (Raspberry Pi Imager installer)
[5]: https://opensource.com/sites/default/files/uploads/screen_2_0.png (Raspberry Pi Imager home screen)
[6]: https://opensource.com/sites/default/files/uploads/demo_3.gif (Raspberry Pi Imager demo)
[7]: https://opensource.com/sites/default/files/uploads/adapter_4.png (USB C adapter)
[8]: https://www.balena.io/etcher/

View File

@@ -1,159 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to install Python on Linux)
[#]: via: (https://opensource.com/article/20/4/install-python-linux)
[#]: author: (Vijay Singh Khatri https://opensource.com/users/vijaytechnicalauthor)
How to install Python on Linux
======
Step-by-step instructions for installing the latest Python instead of
(or alongside) an older version on Linux.
![OpenStack source code \(Python\) in VIM][1]
[Python][2] is now the [most popular][3], most used programming language. Python's simple syntax and low learning curve make it the ultimate choice for beginners as well as professional developers. Python is also a very versatile programming language. It's used nearly everywhere—from web development to artificial intelligence—really anywhere other than mobile development.
If you're using Python, there's a good chance you're a developer (or want to become one), and Linux is a great platform for creating software. But when you're working with Python every day, you sometimes want to stay up to date with the very latest version. You may not want to replace the default install of Python on your system just to test drive the latest one, so this article explains how to install the latest version of Python 3 on Linux without replacing the version provided by your distribution.
Use the **python --version terminal** command to check whether Python is already installed and, if so, which version you have. If Python is not installed on your Linux system, or you want to install an updated version, follow the steps below.
### Step-by-step installation instructions
#### **Step 1:** First, install development packages required to build Python.
#### On Debian:
```
$ sudo apt update
$ sudo apt install build-essential zlib1g-dev \
libncurses5-dev libgdbm-dev libnss3-dev \
libssl-dev libreadline-dev libffi-dev curl
```
#### On Fedora:
```
`$ sudo dnf groupinstall development`
```
#### Step 2: Download the stable latest release of Python 3
Visit the [official Python website][4] and download the latest version of Python 3. After the download is complete, you hav a **.tar.xz** archive file (a "tarball") containing the source code of Python.
#### Step 3: Extract the tarball
Once the download is complete, extract the tarball by either using the extractor application of your choice or the [Linux **tar** command][5], for example:
```
`$ tar -xf Python-3.?.?.tar.xz`
```
#### Step 4: Configure the script
Once the Python tarball has been extracted, navigate to the configure script and execute it in your Linux terminal with:
```
$ cd Python-3.*
./configure
```
The configuration may take some time. Wait until it is successfully finishes before proceeding.
#### Step 5: Start the build process
If you already have a version of Python installed on your system and you want to install the new version alongside it, use this command:
```
`$ sudo make altinstall`
```
The build process may take some time.
If you want to replace your current version of Python with this new version, you should uninstall your current Python package using your package manager (such as **apt** or **dnf**) and then install:
```
`$ sudo make install`
```
However, it's generally preferable to install software as a package (such as a **.deb** or **.rpm** file) so your system can track and update it for you. Because this article assumes the latest Python isn't yet packaged yet, though, you probably don't have that option. In that case, you can either install Python with **altinstall** as suggested, or rebuild an existing Python package using the latest source code. That's an advanced topic and specific to your distribution, so it's out of scope for this article.
#### Step 6: Verify the installation
If you haven't encountered any errors, the latest Python is now installed on your Linux system. To verify it, write one of these commands in your terminal:
```
`python3 --version`
```
or
```
`python --version`
```
If the output says **Python 3.x**, Python 3 has been successfully installed.
### Create a virtual environment (optional)
Python provides a package known as **venv** (virtual environment), which helps you isolate a program directory or package from other ones.
To create a virtual environment, enter the following in the Python terminal (in this example, assume the version of Python you've installed is in the **3.8** series):
```
`python3.8 -m venv example`
```
This command creates a new directory (which I've named **example**), with some subdirectories.
To activate the virtual environment, enter:
```
$ source example/bin/activate
(example) $
```
Notice that your terminal prompt (**$**) is now preceeded by an environment name.
To deactivate the virtual environment, use the **deactivate** command:
```
`(example) $ deactivate`
```
### Conclusion
Python is a fun language that's developed and improved frequently. Getting familiar with new features is easy, once you understand how to install the latest release without interfering with the stable version provided from your distribution.
If you have any feedback or questions, please leave them in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/install-python-linux
作者:[Vijay Singh Khatri][a]
选题:[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/vijaytechnicalauthor
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/openstack_python_vim_1.jpg?itok=lHQK5zpm (OpenStack source code (Python) in VIM)
[2]: https://www.python.org/
[3]: http://pypl.github.io/PYPL.html
[4]: http://python.org
[5]: https://opensource.com/article/17/7/how-unzip-targz-file

View File

@@ -1,5 +1,5 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: translator: (LazyWolfLin)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )

View File

@@ -1,89 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Open Files and Folders as Administrator in Nautilus File Manager in Linux)
[#]: via: (https://itsfoss.com/open-nautilus-as-administrator/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
How to Open Files and Folders as Administrator in Nautilus File Manager in Linux
======
_**Learn to add an “Open as Administrator” option in the right click context menu in Nautilus file manager in Ubuntu and other Linux distributions.**_
If you want to open or edit a file as root, you can always do that in the terminal. I know a few people dont feel too comfortable with the command line.
The desktop Linux often provides ways to avoid the command line for terminal-fearing people.
If you are in a situation where you have to access a folder as root or edit a file with root privilege, you can do that graphically in [Nautilus file manager][1].
A neat Nautilus hack allows you to open a files and folders as administrator i.e. root. Let me show you how.
**Recommended Read:**
![][2]
#### [Root User in Ubuntu: Important Things You Should Know][3]
Root user is essential to any Linux distribution. Learn why Ubuntu locks the root user and how can you use it in this Ubuntu beginner series.
### Add open as administrator option in right click context menu in Nautilus file manager
_**A word of warning! Please dont go around opening and editing random files as root as you might mess up with wrong files and end up with a broken system. Use it only in the cases where it is required.**_
I am showing the installation steps for Ubuntu. You can change it as per your distributions package manager.
Youll have to use terminal (even if you dont like it) for installing the Nautilus plugin. Please [make sure that you have the universe repository enabled][4]:
```
sudo apt install nautilus-admin
```
Close and open Nautilus file manager again to see the changes in effect.
![Right clock to see the “Open as Administrator” option][5]
You can also edit files as root the same way. Just select the file, right click on it and choose the “Edit as Administrator” option.
![Edit Files As Root Ubuntu][6]
In both cases, youll be prompted to enter your accounts password:
![You need to enter your password, of course][7]
Thats pretty much it. You can enjoy the comfort of GUI.
In case you dont want to run Nautilus as root anymore, you can remove this plugin. Its always good to remove additional things you installed but you dont use anymore.
In the terminal (yes, again), use the following command to remove the Nautilus plugin.
```
sudo apt remove nautilus-admin
```
By the way, if you are using [Ubuntu MATE][8], you can use caja-admin, instead of nautilus-admin. Other file managers may or may not provide such a feature.
I hope you find this quick tip helpful. Questions and suggestions are always welcome.
--------------------------------------------------------------------------------
via: https://itsfoss.com/open-nautilus-as-administrator/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://wiki.gnome.org/Apps/Files
[2]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/01/root_user_ubuntu.png?fit=800%2C450&ssl=1
[3]: https://itsfoss.com/root-user-ubuntu/
[4]: https://itsfoss.com/ubuntu-repositories/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/open-folder-as-administrator-ubuntu.jpg?ssl=1
[6]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/edit-files-as-root-ubuntu.jpg?ssl=1
[7]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/authentication-pop-up-ubuntu.png?ssl=1
[8]: https://ubuntu-mate.org/

View File

@@ -0,0 +1,328 @@
[#]: collector: (lujun9972)
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Learning to love systemd)
[#]: via: (https://opensource.com/article/20/4/systemd)
[#]: author: (David Both https://opensource.com/users/dboth)
Learning to love systemd
======
systemd is the mother of all processes, responsible for bringing the
Linux host up to a state where productive work can be done.
![Penguin driving a car with a yellow background][1]
systemd—yes, all lower-case, even at the beginning of a sentence—is the modern replacement for init and SystemV init scripts. It is also much more.
Like most sysadmins, when I think of the init program and SystemV, I think of Linux startup and shutdown and not really much else, like managing services once they are up and running. Like init, systemd is the mother of all processes, and it is responsible for bringing the Linux host up to a state in which productive work can be done. Some of the functions assumed by systemd, which is far more extensive than the old init program, are to manage many aspects of a running Linux host, including mounting filesystems, managing hardware, handling timers, and starting and managing the system services that are required to have a productive Linux host.
This series of articles, which is based in part on excerpts from my three-volume Linux training course, [_Using and administering Linux: zero to sysadmin_][2], explores systemd's functions both at startup and beginning after startup finishes.
### Linux boot
The complete process that takes a Linux host from an off state to a running state is complex, but it is open and knowable. Before getting into the details, I'll give a quick overview from when the host hardware is turned on until the system is ready for a user to log in. Most of the time, "the boot process" is discussed as a single entity, but that is not accurate. There are, in fact, three major parts to the full boot and startup process:
* **Hardware boot:** Initializes the system hardware
* **Linux boot:** Loads the Linux kernel and then systemd
* **Linux startup:** Where systemd prepares the host for productive work
The Linux startup sequence begins after the kernel has loaded either init or systemd, depending upon whether the distribution uses the old or new startup, respectively. The init and systemd programs start and manage all the other processes and are both known as the "mother of all processes" on their respective systems.
It is important to separate the hardware boot from the Linux boot from the Linux startup and to explicitly define the demarcation points between them. Understanding these differences and what part each plays in getting a Linux system to a state where it can be productive makes it possible to manage these processes and better determine where a problem is occurring during what most people refer to as "boot."
The startup process follows the three-step boot process and brings the Linux computer up to an operational state in which it is usable for productive work. The startup process begins when the kernel transfers control of the host to systemd.
### systemd controversy
systemd can evoke a wide range of reactions from sysadmins and others responsible for keeping Linux systems up and running. The fact that systemd is taking over so many tasks in many Linux systems has engendered pushback and discord among certain groups of developers and sysadmins.
SystemV and systemd are two different methods of performing the Linux startup sequence. SystemV start scripts and the init program are the old methods, and systemd using targets is the new method. Although most modern Linux distributions use the newer systemd for startup, shutdown, and process management, there are still some that do not. One reason is that some distribution maintainers and some sysadmins prefer the older SystemV method over the newer systemd.
I think both have advantages.
#### Why I prefer SystemV
I prefer SystemV because it is more open. Startup is accomplished using Bash scripts. After the kernel starts the init program, which is a compiled binary, init launches the **rc.sysinit** script, which performs many system initialization tasks. After **rc.sysinit** completes, init launches the **/etc/rc.d/rc** script, which in turn starts the various services defined by the SystemV start scripts in the **/etc/rc.d/rcX.d**, where "X" is the number of the runlevel being started.
Except for the init program itself, all these programs are open and easily knowable scripts. It is possible to read through these scripts and learn exactly what is taking place during the entire startup process, but I don't think many sysadmins actually do that. Each start script is numbered so that it starts its intended service in a specific sequence. Services are started serially, and only one service starts at a time.
systemd, developed by Red Hat's Lennart Poettering and Kay Sievers, is a complex system of large, compiled binary executables that are not understandable without access to the source code. It is open source, so "access to the source code" isn't hard, just less convenient. systemd appears to represent a significant refutation of multiple tenets of the Linux philosophy. As a binary, systemd is not directly open for the sysadmin to view or make easy changes. systemd tries to do everything, such as managing running services, while providing significantly more status information than SystemV. It also manages hardware, processes, and groups of processes, filesystem mounts, and much more. systemd is present in almost every aspect of the modern Linux host, making it the one-stop tool for system management. All of this is a clear violation of the tenets that programs should be small and that each program should do one thing and do it well.
#### Why I prefer systemd
I prefer systemd as my startup mechanism because it starts as many services as possible in parallel, depending upon the current stage in the startup process. This speeds the overall startup and gets the host system to a login screen faster than SystemV.
systemd manages almost every aspect of a running Linux system. It can manage running services while providing significantly more status information than SystemV. It also manages hardware, processes and groups of processes, filesystem mounts, and much more. systemd is present in almost every aspect of the modern Linux operating system, making it the one-stop tool for system management. (Does this sound familiar?)
The systemd tools are compiled binaries, but the tool suite is open because all the configuration files are ASCII text files. Startup configuration can be modified through various GUI and command-line tools, as well as adding or modifying various configuration files to suit the needs of the specific local computing environment.
#### The real issue
Did you think I could not like both startup systems? I do, and I can work with either one.
In my opinion, the real issue and the root cause of most of the controversy between SystemV and systemd is that there is [no choice][3] on the sysadmin level. The choice of whether to use SystemV or systemd has already been made by the developers, maintainers, and packagers of the various distributions—but with good reason. Scooping out and replacing an init system, by its extreme, invasive nature, has a lot of consequences that would be hard to tackle outside the distribution design process.
Despite the fact that this choice is made for me, my Linux hosts boot up and work, which is what I usually care the most about. As an end user and even as a sysadmin, my primary concern is whether I can get my work done, work such as writing my books and this article, installing updates, and writing scripts to automate everything. So long as I can do my work, I don't really care about the start sequence used on my distro.
I do care when there is a problem during startup or service management. Regardless of which startup system is used on a host, I know enough to follow the sequence of events to find the failure and fix it.
#### Replacing SystemV
There have been previous attempts at replacing SystemV with something a bit more modern. For about two releases, Fedora used a thing called Upstart to replace the aging SystemV, but it did not replace init and provided no changes that I noticed. Because Upstart provided no significant changes to the issues surrounding SystemV, efforts in this direction were quickly dropped in favor of systemd.
Despite the fact that most Linux developers agree that replacing the old SystemV startup is a good idea, many developers and sysadmins dislike systemd for that. Rather than rehash all the so-called issues that people have—or had—with systemd, I will refer you to two good, if somewhat old, articles that should cover most everything. Linus Torvalds, the creator of the Linux kernel, seems disinterested. In a 2014 ZDNet article, _[Linus Torvalds and others on Linux's systemd][4]_, Linus is clear about his feelings.
> "I don't actually have any particularly strong opinions on systemd itself. I've had issues with some of the core developers that I think are much too cavalier about bugs and compatibility, and I think some of the design details are insane (I dislike the binary logs, for example), but those are details, not big issues."
In case you don't know much about Linus, I can tell you that if he does not like something, he is very outspoken, explicit, and quite clear about that dislike. He has become more socially acceptable in his manner of addressing his dislike about things.
In 2013, Poettering wrote a long blog post in which he debunks the [myths about systemd][5] while providing insight into some of the reasons for creating it. This is a very good read, and I highly recommend it.
### systemd tasks
Depending upon the options used during the compile process (which are not considered in this series), systemd can have as many as 69 binary executables that perform the following tasks, among others:
* The systemd program runs as PID 1 and provides system startup of as many services in parallel as possible, which, as a side effect, speeds overall startup times. It also manages the shutdown sequence.
* The systemctl program provides a user interface for service management.
* Support for SystemV and LSB start scripts is offered for backward compatibility.
* Service management and reporting provide more service status data than SystemV.
* It includes tools for basic system configuration, such as hostname, date, locale, lists of logged-in users, running containers and virtual machines, system accounts, runtime directories and settings, daemons to manage simple network configuration, network time synchronization, log forwarding, and name resolution.
* It offers socket management.
* systemd timers provide advanced cron-like capabilities to include running a script at times relative to system boot, systemd startup, the last time the timer was started, and more.
* It provides a tool to analyze dates and times used in timer specifications.
* Mounting and unmounting of filesystems with hierarchical awareness allows safer cascading of mounted filesystems.
* It enables the positive creation and management of temporary files, including deletion.
* An interface to D-Bus provides the ability to run scripts when devices are plugged in or removed. This allows all devices, whether pluggable or not, to be treated as plug-and-play, which considerably simplifies device handling.
* Its tool to analyze the startup sequence can be used to locate the services that take the most time.
* It includes journals for storing system log messages and tools for managing the journals.
### Architecture
Those tasks and more are supported by a number of daemons, control programs, and configuration files. Figure 1 shows many of the components that belong to systemd. This is a simplified diagram designed to provide a high-level overview, so it does not include all of the individual programs or files. Nor does it provide any insight into data flow, which is so complex that it would be a useless exercise in the context of this series of articles.
![systemd architecture][6]
A full exposition of systemd would take a book on its own. You do not need to understand the details of how the systemd components in Figure 1 fit together; it's enough to know about the programs and components that enable managing various Linux services and deal with log files and journals. But it's clear that systemd is not the monolithic monstrosity it is purported to be by some of its critics.
### systemd as PID 1
systemd is PID 1. Some of its functions, which are far more extensive than the old SystemV3 init program, are to manage many aspects of a running Linux host, including mounting filesystems and starting and managing system services required to have a productive Linux host. Any of systemd's tasks that are not related to the startup sequence are outside the scope of this article (but some will be explored later in this series).
First, systemd mounts the filesystems defined by **/etc/fstab**, including any swap files or partitions. At this point, it can access the configuration files located in **/etc**, including its own. It uses its configuration link, **/etc/systemd/system/default.target**, to determine which state or target it should boot the host into. The **default.target** file is a symbolic link to the true target file. For a desktop workstation, this is typically going to be the **graphical.target**, which is equivalent to runlevel 5 in SystemV. For a server, the default is more likely to be the **multi-user.target**, which is like runlevel 3 in SystemV. The **emergency.target** is similar to single-user mode. Targets and services are systemd units.
The table below (Figure 2) compares the systemd targets with the old SystemV startup runlevels. systemd provides the systemd target aliases for backward compatibility. The target aliases allow scripts—and many sysadmins—to use SystemV commands like **init 3** to change runlevels. Of course, the SystemV commands are forwarded to systemd for interpretation and execution.
**systemd targets** | **SystemV runlevel** | **target aliases** | **Description**
---|---|---|---
default.target | | | This target is always aliased with a symbolic link to either **multi-user.target** or **graphical.target**. systemd always uses the **default.target** to start the system. The **default.target** should never be aliased to **halt.target**, **poweroff.target**, or **reboot.target**.
graphical.target | 5 | runlevel5.target | **Multi-user.target** with a GUI
| 4 | runlevel4.target | Unused. Runlevel 4 was identical to runlevel 3 in the SystemV world. This target could be created and customized to start local services without changing the default **multi-user.target**.
multi-user.target | 3 | runlevel3.target | All services running, but command-line interface (CLI) only
| 2 | runlevel2.target | Multi-user, without NFS, but all other non-GUI services running
rescue.target | 1 | runlevel1.target | A basic system, including mounting the filesystems with only the most basic services running and a rescue shell on the main console
emergency.target | S | | Single-user mode—no services are running; filesystems are not mounted. This is the most basic level of operation with only an emergency shell running on the main console for the user to interact with the system.
halt.target | | | Halts the system without powering it down
reboot.target | 6 | runlevel6.target | Reboot
poweroff.target | 0 | runlevel0.target | Halts the system and turns the power off
Each target has a set of dependencies described in its configuration file. systemd starts the required dependencies, which are the services required to run the Linux host at a specific level of functionality. When all the dependencies listed in the target configuration files are loaded and running, the system is running at that target level. In Figure 2, the targets with the most functionality are at the top of the table, with functionality declining towards the bottom of the table.
systemd also looks at the legacy SystemV init directories to see if any startup files exist there. If so, systemd uses them as configuration files to start the services described by the files. The deprecated network service is a good example of one that still uses SystemV startup files in Fedora.
Figure 3 (below) is copied directly from the bootup man page. It shows a map of the general sequence of events during systemd startup and the basic ordering requirements to ensure a successful startup.
```
                                         cryptsetup-pre.target
                                                   |
 (various low-level                                v
     API VFS mounts:                 (various cryptsetup devices...)
  mqueue, configfs,                                |    |
  debugfs, ...)                                    v    |
  |                                  cryptsetup.target  |
  |  (various swap                                 |    |    remote-fs-pre.target
  |   devices...)                                  |    |     |        |
  |    |                                           |    |     |        v
  |    v                       local-fs-pre.target |    |     |  (network file systems)
  |  swap.target                       |           |    v     v                 |
  |    |                               v           |  remote-cryptsetup.target  |
  |    |  (various low-level  (various mounts and  |             |              |
  |    |   services: udevd,    fsck services...)   |             |    remote-fs.target
  |    |   tmpfiles, random            |           |             |             /
  |    |   seed, sysctl, ...)          v           |             |            /
  |    |      |                 local-fs.target    |             |           /
  |    |      |                        |           |             |          /
  \\____|______|_______________   ______|___________/             |         /
                              \ /                                |        /
                               v                                 |       /
                        sysinit.target                           |      /
                               |                                 |     /
        ______________________/|\\_____________________           |    /
       /              |        |      |               \          |   /
       |              |        |      |               |          |  /
       v              v        |      v               |          | /
  (various       (various      |  (various            |          |/
   timers...)      paths...)   |   sockets...)        |          |
       |              |        |      |               |          |
       v              v        |      v               |          |
 timers.target  paths.target   |  sockets.target      |          |
       |              |        |      |               v          |
       v              \\_______ | _____/         rescue.service   |
                              \|/                     |          |
                               v                      v          |
                           basic.target         rescue.target    |
                               |                                 |
                       ________v____________________             |
                      /              |              \            |
                      |              |              |            |
                      v              v              v            |
                  display-    (various system   (various system  |
              manager.service     services        services)      |
                      |         required for        |            |
                      |        graphical UIs)       v            v
                      |              |            multi-user.target
 emergency.service    |              |              |
         |            \\_____________ | _____________/
         v                          \|/
 emergency.target                    v
                              graphical.target
```
The **sysinit.target** and **basic.target** targets can be considered checkpoints in the startup process. Although one of systemd's design goals is to start system services in parallel, certain services and functional targets must be started before other services and targets can start. These checkpoints cannot be passed until all of the services and targets required by that checkpoint are fulfilled.
The **sysinit.target** is reached when all of the units it depends on are completed. All of those units, mounting filesystems, setting up swap files, starting udev, setting the random generator seed, initiating low-level services, and setting up cryptographic services (if one or more filesystems are encrypted), must be completed but, within the **sysinit.target**, those tasks can be performed in parallel.
The **sysinit.target** starts up all of the low-level services and units required for the system to be marginally functional and that are required to enable moving onto the **basic.target**.
After the **sysinit.target** is fulfilled, systemd then starts all the units required to fulfill the next target. The basic target provides some additional functionality by starting units that are required for all of the next targets. These include setting up things like paths to various executable directories, communication sockets, and timers.
Finally, the user-level targets, **multi-user.target** or **graphical.target**, can be initialized. The **multi-user.target** must be reached before the graphical target dependencies can be met. The underlined targets in Figure 3 are the usual startup targets. When one of these targets is reached, startup has completed. If the **multi-user.target** is the default, then you should see a text-mode login on the console. If **graphical.target** is the default, then you should see a graphical login; the specific GUI login screen you see depends on your default display manager.
The bootup man page also describes and provides maps of the boot into the initial RAM disk and the systemd shutdown process.
systemd also provides a tool that lists dependencies of a complete startup or for a specified unit. A unit is a controllable systemd resource entity that can range from a specific service, such as httpd or sshd, to timers, mounts, sockets, and more. Try the following command and scroll through the results.
```
`systemctl list-dependencies graphical.target`
```
Notice that this fully expands the top-level target units list required to bring the system up to the graphical target run mode. Use the **\--all** option to expand all of the other units as well.
```
`systemctl list-dependencies --all graphical.target`
```
You can search for strings such as "target," "slice," and "socket" using the search tools of the **less** command.
So now, try the following.
```
`systemctl list-dependencies multi-user.target`
```
and
```
`systemctl list-dependencies rescue.target`
```
and
```
`systemctl list-dependencies local-fs.target`
```
and
```
`systemctl list-dependencies dbus.service`
```
This tool helps me visualize the specifics of the startup dependencies for the host I am working on. Go ahead and spend some time exploring the startup tree for one or more of your Linux hosts. But be careful because the systemctl man page contains this note:
> _"Note that this command only lists units currently loaded into memory by the service manager. In particular, this command is not suitable to get a comprehensive list at all reverse dependencies on a specific unit, as it won't list the dependencies declared by units currently not loaded."_
### Final thoughts
Even before getting very deep into systemd, it's obvious that it is both powerful and complex. It is also apparent that systemd is not a single, huge, monolithic, and unknowable binary file. Rather, it is composed of a number of smaller components and subcommands that are designed to perform specific tasks.
The next article in this series will explore systemd startup in more detail, as well as systemd configuration files, changing the default target, and how to create a simple service unit.
### Resources
There is a great deal of information about systemd available on the internet, but much is terse, obtuse, or even misleading. In addition to the resources mentioned in this article, the following webpages offer more detailed and reliable information about systemd startup.
* The Fedora Project has a good, practical [guide][7] [to systemd][7]. It has pretty much everything you need to know in order to configure, manage, and maintain a Fedora computer using systemd.
* The Fedora Project also has a good [cheat sheet][8] that cross-references the old SystemV commands to comparable systemd ones.
* For detailed technical information about systemd and the reasons for creating it, check out [Freedesktop.org][9]'s [description of systemd][10].
* [Linux.com][11]'s "More systemd fun" offers more advanced systemd [information and tips][12].
There is also a series of deeply technical articles for Linux sysadmins by Lennart Poettering, the designer and primary developer of systemd. These articles were written between April 2010 and September 2011, but they are just as relevant now as they were then. Much of everything else good that has been written about systemd and its ecosystem is based on these papers.
* [Rethinking PID 1][13]
* [systemd for Administrators, Part I][14]
* [systemd for Administrators, Part II][15]
* [systemd for Administrators, Part III][16]
* [systemd for Administrators, Part IV][17]
* [systemd for Administrators, Part V][18]
* [systemd for Administrators, Part VI][19]
* [systemd for Administrators, Part VII][20]
* [systemd for Administrators, Part VIII][21]
* [systemd for Administrators, Part IX][22]
* [systemd for Administrators, Part X][23]
* [systemd for Administrators, Part XI][24]
Alison Chiaken, a Linux kernel and systems programmer at Mentor Graphics, offers a preview of her...
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/systemd
作者:[David Both][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/dboth
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/car-penguin-drive-linux-yellow.png?itok=twWGlYAc (Penguin driving a car with a yellow background)
[2]: http://www.both.org/?page_id=1183
[3]: http://www.osnews.com/story/28026/Editorial_Thoughts_on_Systemd_and_the_Freedom_to_Choose
[4]: https://www.zdnet.com/article/linus-torvalds-and-others-on-linuxs-systemd/
[5]: http://0pointer.de/blog/projects/the-biggest-myths.html
[6]: https://opensource.com/sites/default/files/uploads/systemd-architecture.png (systemd architecture)
[7]: https://docs.fedoraproject.org/en-US/quick-docs/understanding-and-administering-systemd/index.html
[8]: https://fedoraproject.org/wiki/SysVinit_to_Systemd_Cheatsheet
[9]: http://Freedesktop.org
[10]: http://www.freedesktop.org/wiki/Software/systemd
[11]: http://Linux.com
[12]: https://www.linux.com/training-tutorials/more-systemd-fun-blame-game-and-stopping-services-prejudice/
[13]: http://0pointer.de/blog/projects/systemd.html
[14]: http://0pointer.de/blog/projects/systemd-for-admins-1.html
[15]: http://0pointer.de/blog/projects/systemd-for-admins-2.html
[16]: http://0pointer.de/blog/projects/systemd-for-admins-3.html
[17]: http://0pointer.de/blog/projects/systemd-for-admins-4.html
[18]: http://0pointer.de/blog/projects/three-levels-of-off.html
[19]: http://0pointer.de/blog/projects/changing-roots
[20]: http://0pointer.de/blog/projects/blame-game.html
[21]: http://0pointer.de/blog/projects/the-new-configuration-files.html
[22]: http://0pointer.de/blog/projects/on-etc-sysinit.html
[23]: http://0pointer.de/blog/projects/instances.html
[24]: http://0pointer.de/blog/projects/inetd.html

View File

@@ -1,343 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (12 Linux Commands to Have Some Fun in the Terminal)
[#]: via: (https://itsfoss.com/funny-linux-commands/)
[#]: author: (Community https://itsfoss.com/author/itsfoss/)
12 Linux Commands to Have Some Fun in the Terminal
======
_**So, you think Linux terminal is all work and no fun? These funny Linux commands will prove you wrong.**_
The Linux terminal is the place to get serious work done. We have plenty of useful [linux command tips and tricks][1] to help you with that.
But, did you know that you can have a lot of fun using the terminal? Well, if you did not, then you are not alone. Most Linux users see the terminal as an interface that is designed and built for system management and development tasks.
However, you will be surprised to know that there are tons of [terminal based games][2] and [ASCII games][3] that you can play in the terminal.
And, in this article, Im going to explore some interesting, some funny and some ridiculous commands that you can type into the terminal on Linux and have fun!
### Have some fun in Linux terminal with these commands
![][4]
Youll find a lot of these commands ridiculous or useless but some of them could actually be put to some good use.
I have added installation instructions for Ubuntu/Debian. If you are using Ubuntu-based distribution, please make sure to [enable universe repository][5] as most of these commands are not in the main repository.
If you are using Arch, Fedora, SUSE, Solus or any other non-Ubuntu distributions, please use your distributions package manager to install these funny Linux commands.
#### 1\. Run a train in the terminal
Lets take a ride in the locomotive and begin our auspicious journey. And I mean it literally!
The sl command allows you to run a train in your terminal.
![][6]
Heres how to install the command:
```
sudo apt install sl
```
Once done, you can simply type in the following in the terminal to get started:
```
sl
```
Impressive, isnt it? But, hold on. We are not done yet! Apparently, you can fly your locomotive. Just add the option -F, Mr. Potter:
```
sl -F
```
****This should make the locomotive get wings to fly off from the terminal window!
#### 2\. Add the Matrix effect to your Linux terminal
Remember the iconic sci-fi movie [The Matrix][7]? The green text falling down on the terminal became an identity of Matrix.
You can have this Matrix digital rain on your Linux box as well! You just need to install **cmatrix** and type it in the terminal.
![][8]
Installing cmatrix on Debian/Ubuntu Linux:
```
sudo apt install cmatrix
```
Now, all you have to do is type the following to get the matrix screen on terminal:
```
cmatrix
```
Press Ctrl+C to stop it, Mr. Anderson.
**Recommended Read:**
![][9]
#### [Watch Star Wars In Linux Terminal via Telnet][10]
Watch Star Wars in ASCII art Linux terminal.
#### 3\. Let there be fire
Keep your fire extinguisher handy because now you are going to start a fire in your terminal!
![][11]
To get it installed, heres what you have to type:
```
sudo apt install libaa-bin
```
Once done start a fire in your terminal by entering:
```
aafire
```
Press Ctrl+C to stop it.
#### 4\. Fortune ~~Cookie~~ Command
Want to know your fortune but there are no fortune cookies around you?
Not to worry, you just need to type “fortune” on your terminal and press enter. The terminal will display a random sentence just like you usually get in fortune cookies.
![][12]
Install it with:
```
sudo apt install fortune
```
Once done, simply type in the command below to know your fortune:
```
fortune
```
Now this is one of the commands here that you could actually use. You can use it as message of the day so that in a multi-user environment, all the users will see a random fortune cookie when they login.
You may also add it to your bashrc file so that it shows you a random message as soon as you log in to the terminal.
#### 5\. Pet lover? This is for you
Oneko is a little fun command that will change your regular cursor into a mouse and creates a curious little cat who will chase your cursor once you move it. Its not limited to just the terminal. You can keep on working while the cat chases the cursor.
Now, thats something fun to do specially if you have kids at home.
![][13]
Install Oneko with this command:
```
sudo apt install oneko
```
Run it with this command:
```
oneko
```
In case you want a dog instead of a cat, type:
```
oneko -dog
```
There are a few more types of cats available. You can get that information by using oneko help. To stop it, use Ctrl+C.
#### 6\. Little brother is watching you
Xeyes is a tiny gui program that let the user draws a pair of ever watching eyes! It will follow your mouse cursor constantly. Run the command and see it yourself!
![][14]
You can install it using this command:
```
sudo apt install xeyes
```
And then use it with this:
```
xeyes
```
Press Ctrl+C to stop it.
#### Let the terminal speak for you
To try out this command, make sure you have turned on your speakers. [eSpeak][15] is a fun command that gives your terminal a voice. Yes, you heard that right.
Install the package first:
```
sudo apt install espeak
```
Next, you need to simply type in the command along with a text that you want to listen as audio:
```
espeak "Type what your computer says"
```
Whatever you place in the double quotes, your computer is obligated to say! Its like [echo command in Linux][16]. But instead of printing, it speaks.
#### Toilet (but it has nothing to do with a washroom)
This sounds weird, yes. But, its just a command that transforms a text into large ASCII characters.
![][17]
Install toilet with this command:
```
sudo apt install toilet
```
Once done, you just need to type in:
```
toilet sample text you want
```
I dont know why this little program is called toilet.
#### What does the ~~fox~~ cow say?
Cowsay is a command that displays a cow using ASCII characters in the terminal. And by using this command you can instruct the cow to say anything you want.
Not to be confused with any audio it will just display a text (like you usually see in a comic book).
![Cowsay Cowthink][18]
Install ****cowsay:
```
sudo apt install cowsay
```
Once you have it installed, you just need to type in:
```
cowsay "your text"
```
Whatever you place in the double quotes, your cow is obligated to say! I have seen a few sysadmins using it to display the message of the day. Maybe you can do the same. You may even combine it with fortune command.
#### Banner Command
The banner command works just like the toilet command but it is limited to print only 10 characters at most.
![][19]
You can install banner command like this:
```
sudo apt install sysvbanner
```
Then use it in the following way:
```
banner "Welcome"
```
Replace content in the double quotes and you shall have your desired text displayed.
#### Yes command
![][20]
The “yes” command helps you to loop an automated response until you terminate the command. This command will print the exact same thing indefinitely. If you want to produce huge amounts of junk text fast, then this command will work like a charm.
You may also use it to provide a yes to a command (if it prompts for it). For example, the apt upgrade command asks for your confirmation, you can use it like this:
```
yes | sudo apt upgrade
```
You dont need to install any package for it. Yes command is already available.
Terminate the yes command loop, simply press **CTRL + C**.
#### Get a new identity, well, sort of
Want to generate a random fake identity? I give you the command “rig”. Once you place this in the terminal, it will generate a fake identity.
![][21]
Install rig with this command:
```
sudo apt install rig
```
Then simply type this:
```
rig
```
It may be used in scripts or web-apps that displays random information but I havent done anything of that sort on my own.
**Wrapping Up**
I hope you liked this list of fun Linux commands. Which command do you like the most here? Do you know some other such amusing commands? Do share it with us in the comment section.
![][22]
### Srimanta Koley
A passionate writer, a distrohopper and an open source enthusiast, Srimanta is extremely fond of everything related to technology. He loves to read books and has an unhealthy addiction to the 90s!
--------------------------------------------------------------------------------
via: https://itsfoss.com/funny-linux-commands/
作者:[Community][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/itsfoss/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/linux-command-tricks/
[2]: https://itsfoss.com/best-command-line-games-linux/
[3]: https://itsfoss.com/best-ascii-games/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fun-linux-commands.png?ssl=1
[5]: https://itsfoss.com/ubuntu-repositories/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sl-command.jpg?ssl=1
[7]: https://en.wikipedia.org/wiki/The_Matrix
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/matrix-screen-command.png?ssl=1
[9]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2015/12/Star-Wars-Linux-Terminal-2.png?fit=732%2C462&ssl=1
[10]: https://itsfoss.com/star-wars-linux/
[11]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fire-command.png?ssl=1
[12]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/fortune-command.jpg?ssl=1
[13]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/oneko-command.jpg?ssl=1
[14]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/xeyes-command.jpg?ssl=1
[15]: https://itsfoss.com/espeak-text-speech-linux/
[16]: https://linuxhandbook.com/echo-command/
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/toilet-command.jpg?ssl=1
[18]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/cowsay-cowthink.jpg?ssl=1
[19]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/banner-command.jpg?ssl=1
[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/yes-yourtext.jpg?ssl=1
[21]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/rig-command.jpg?ssl=1
[22]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/srimanta.jpg?ssl=1

View File

@@ -0,0 +1,194 @@
[#]: collector: (lujun9972)
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Create a SDN on Linux with open source)
[#]: via: (https://opensource.com/article/20/4/quagga-linux)
[#]: author: (M Umer https://opensource.com/users/noisybotnet)
Create a SDN on Linux with open source
======
Make your Linux system act like a router with the open source routing
stack Quagga.
![Coding on a computer][1]
Network routing protocols fall into two main categories: interior gateway protocols and exterior gateway protocols. Interior gateway protocols are used by routers to share information within a single autonomous system. If you are running Linux, you can make your system behave as a router through the open source (GPLv2) routing stack [Quagga][2].
### What is Quagga?
Quagga is a [routing software suite][3] and a fork of [GNU Zebra][4]. It provides implementations of all major routing protocols such as Open Shortest Path First (OSPF), Routing Information Protocol (RIP), Border Gateway Protocol (BGP), and Intermediate System to Intermediate System (IS-IS) for Unix-like platforms.
Although Quagga implements the routing protocols for both IPv4 and IPv6, it doesn't act as a complete router. A true router not only implements all the routing protocols but also has the ability to forward network traffic. Quagga only implements the routing stack, and the job of forwarding network traffic is handled by the Linux kernel.
### Architecture
Quagga implements the different routing protocols through protocol-specific daemons. The daemon name is the same as the routing protocol followed by the letter "d." Zebra is the core and a protocol-independent daemon that provides an [abstraction layer][5] to the kernel and presents the Zserv API over TCP sockets to Quagga clients. Each protocol-specific daemon is responsible for running the relevant protocol and building the routing table based on the information exchanged.
![Quagga architecture][6]
### Setup
This tutorial implements the OSPF protocol to configure dynamic routing using Quagga. The setup includes two CentOS 7.7 hosts, named Alpha and Beta. Both hosts share access to the **192.168.122.0/24** network.
**Host Alpha:**
IP: 192.168.122.100/24
Gateway: 192.168.122.1
**Host Beta:**
IP: 192.168.122.50/24
Gateway: 192.168.122.1
### Install the package
First, install the Quagga package on both hosts. It is available in the CentOS base repo:
```
`yum install quagga -y`
```
### Enable IP forwarding
Next, enable IP forwarding on both hosts since that will performed by the Linux kernel:
```
sysctl -w net.ipv4.ip_forward = 1
sysctl -p
```
### Configuration
Now, go into the **/etc/quagga** directory and create the configuration files for your setup. You need three files:
* **zebra.conf**: Quagga's daemon configuration file, which is where you'll define the interfaces and their IP addresses and IP forwarding
* **ospfd.conf**: The protocol configuration file, which is where you'll define the networks that will be offered through the OSPF protocol
* **daemons**: Where you'll specify the relevant protocol daemons that are required to run
On host Alpha,
```
 [root@alpha]# cat /etc/quagga/zebra.conf
interface eth0
 ip address 192.168.122.100/24
 ipv6 nd suppress-ra
interface eth1
 ip address 10.12.13.1/24
 ipv6 nd suppress-ra
interface lo
ip forwarding
line vty
[root@alpha]# cat /etc/quagga/ospfd.conf
interface eth0
interface eth1
interface lo
router ospf
 network 192.168.122.0/24 area 0.0.0.0
 network 10.12.13.0/24 area 0.0.0.0
line vty
[root@alphaa ~]# cat /etc/quagga/daemons
zebra=yes
ospfd=yes
```
On host Beta,
```
[root@beta quagga]# cat zebra.conf
interface eth0
 ip address 192.168.122.50/24
 ipv6 nd suppress-ra
interface eth1
 ip address 10.10.10.1/24
 ipv6 nd suppress-ra
interface lo
ip forwarding
line vty
[root@beta quagga]# cat ospfd.conf
interface eth0
interface eth1
interface lo
router ospf
 network 192.168.122.0/24 area 0.0.0.0
 network 10.10.10.0/24 area 0.0.0.0
line vty
[root@beta ~]# cat /etc/quagga/daemons
zebra=yes
ospfd=yes
```
### Configure the firewall
To use the OSPF protocol, you must allow it in the firewall:
```
firewall-cmd --add-protocol=ospf permanent
firewall-cmd reload
```
Now, start the zebra and ospfd daemons.
```
# systemctl start zebra
# systemctl start ospfd
```
Look at the route table on both hosts using:
```
[root@alpha ~]# ip route show  
default via 192.168.122.1 dev eth0 proto static metric 100
10.10.10.0/24 via 192.168.122.50 dev eth0 proto zebra metric 20
10.12.13.0/24 dev eth1 proto kernel scope link src 10.12.13.1
192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.100 metric 100
```
You can see that the routing table on Alpha contains an entry of **10.10.10.0/24** via **192.168.122.50** offered through protocol **zebra**. Similarly, on host Beta, the table contains an entry of network **10.12.13.0/24** via **192.168.122.100**.
```
[root@beta ~]# ip route show
default via 192.168.122.1 dev eth0 proto static metric 100
10.10.10.0/24 dev eth1 proto kernel scope link src 10.10.10.1
10.12.13.0/24 via 192.168.122.100 dev eth0 proto zebra metric 20
192.168.122.0/24 dev eth0 proto kernel scope link src 192.168.122.50 metric 100
```
### Conclusion
As you can see, the setup and configuration are relatively simple. To add complexity, you can add more network interfaces to the router to provide routing for more networks. You can also implement BGP and RIP protocols using the same method.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/quagga-linux
作者:[M Umer][a]
选题:[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/noisybotnet
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_laptop_hack_work.png?itok=aSpcWkcl (Coding on a computer)
[2]: https://www.quagga.net/
[3]: https://en.wikipedia.org/wiki/Quagga_(software)
[4]: https://www.gnu.org/software/zebra/
[5]: https://en.wikipedia.org/wiki/Abstraction_layer
[6]: https://opensource.com/sites/default/files/uploads/quagga_arch.png (Quagga architecture)

View File

@@ -0,0 +1,207 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to compress files on Linux 5 ways)
[#]: via: (https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
How to compress files on Linux 5 ways
======
There are a number of tools that you use to compress files on Linux systems, but they don't all behave the same way or yield the same level of compression. In this post, we compare five of them.
Getty Images
There are quite a few commands on Linux for compressing files. One of the newest and most effective is **xz**, but they all have advantages for both saving disk space and preserving files for later use. In this post, we compare the compression commands and point out the significant differences.
### tar
The tar command is not specifically a compression command. Its generally used to pull a number of files into a single file for easy transport to another system or to back the files up as a related group. It also provides compression as a feature, which makes a lot of sense, and the addition of the **z** compression option is available to make this happen.
When compression is added to a **tar** command with the **z** option, tar uses **gzip** to do the compressing.
You can use **tar** to compress a single file as easily as a group though this offers no particular advantage over using **gzip** directly. To use **tar** for this, just identify the file as you would a group of files with a “tar cfz newtarfile filename” command like this:
```
$ tar cfz bigfile.tgz bigfile
^ ^
| |
+- new file +- file to be compressed
$ ls -l bigfile*
-rw-rw-r-- 1 shs shs 103270400 Apr 16 16:09 bigfile
-rw-rw-r-- 1 shs shs 21608325 Apr 16 16:08 bigfile.tgz
```
Note the significant reduction in the file size.
If you prefer, you can use the **tar.gz** extension which might make the character of the file a bit more obvious, but most Linux users will probably recognize **tgz** as meaning the same thing the combination of **tar** and **gz** to indicate that the file is a compressed tar file. You will be left with both the original file and the compressed file once the compression is complete.
To collect a number of files together and compress the resultant “tar ball” in one command, use the same basic syntax, but specify the files to be included as a group in place of the single file. Heres an example:
[][1]
```
$ tar cfz bin.tgz bin/*
^ ^
| +-- files to include
+ new file
```
### zip
The **zip** command creates a compressed file while leaving the original file intact. The syntax is straightforward except that, as with **tar**, you have to remember that your original file should be the last argument on the command line.
```
$ zip ./bigfile.zip bigfile
updating: bigfile (deflated 79%)
$ ls -l bigfile bigfile.zip
-rw-rw-r-- 1 shs shs 103270400 Apr 16 11:18 bigfile
-rw-rw-r-- 1 shs shs 21606889 Apr 16 11:19 bigfile.zip
```
### gzip
The **gzip** command is very simple to use. You just type "gzip" followed by the name of the file you want to compress. Unlike the commands described above, **gzip** will encrypt the files "in place". In other words, the original file will be replaced by the encrypted file.
```
$ gzip bigfile
$ ls -l bigfile*
-rw-rw-r-- 1 shs shs 21606751 Apr 15 17:57 bigfile.gz
```
### bzip2
As with the **gzip** command, **bzip2** will compress the file that you select "in place", leaving only the original file.
```
$ bzip bigfile
$ ls -l bigfile*
-rw-rw-r-- 1 shs shs 18115234 Apr 15 17:57 bigfile.bz2
```
### xz
A relative newcomer to the compression command team, **xz** is a front runner in terms of how well it compresses files. Like the two previous commands, you only need to supply the file name to the command. Again, the original file is compressed in place.
```
$ xz bigfile
$ ls -l bigfile*
-rw-rw-r-- 1 shs shs 13427236 Apr 15 17:30 bigfile.xz
```
For large files, you are likely to notice that **xz** takes longer to run than other compression commands, but the compression results are very impressive.
### Comparisons to consider
Most people have heard it said that "size isn't everything". So, let's compare file size as well as some other issues to be considered when you make plans for how you want to compress your files.
The stats shown below all relate to compressing the single file  bigfile  used in the example commands shown above. This file is a large and fairly random text file. Compression rates will depend to some extent on the content of the files.
#### Size reduction
When compared, the various compression commands shown above yielded the following results. The percentages represent how the compressed files compare with the original file.
```
-rw-rw-r-- 1 shs shs 103270400 Apr 16 14:01 bigfile
------------------------------------------------------
-rw-rw-r-- 1 shs shs 18115234 Apr 16 13:59 bigfile.bz2 ~17%
-rw-rw-r-- 1 shs shs 21606751 Apr 16 14:00 bigfile.gz ~21%
-rw-rw-r-- 1 shs shs 21608322 Apr 16 13:59 bigfile.tgz ~21%
-rw-rw-r-- 1 shs shs 13427236 Apr 16 14:00 bigfile.xz ~13%
-rw-rw-r-- 1 shs shs 21606889 Apr 16 13:59 bigfile.zip ~21%
```
The **xz** commands wins, ending up at only 13% the size of the original file, but all of these compression commands reduced the original file size quite significantly.
#### Whether the original files are replaced
The **bzip2**, **gzip** and **xz** commands all replace the original files with compressed versions. The **tar** and **zip** commands to not.
#### Run time
The **xz** command seems to take more time than the other commands to encrypt the files. For bigfile, the approximate times were:
```
command run-time
tar 4.9 seconds
zip 5.2 seconds
bzip2 22.8 seconds
gzip 4.8 seconds
xz 50.4 seconds
```
Decompression times are likely to be considerably smaller than compression times.
#### File permissions
Regardless of what permissions you have set on your original file, permissions for the compressed file will be based on your **umask** setting, except for **bzip2** which retains the original file's permissions.
#### Compatibility with Windows
The **zip** command creates a file which can be used (i.e., decompressed) on Windows systems as well as Linux and other Unix systems without having to install other tools which may or may not be available.
### Decompressing files
The commands for decompressing files are similar to those used to compress the files. These commands would work for decompressing bigfile after the compression commands shown above were run.
* tar: **tar xf bigfile.tgz**
* zip: **unzip bigfile.zip**
* gzip: **gunzip bigfile.gz**
* bzip2: **bunzip2 bigfile.gz2**
* xz: **xz -d bigfile.xz** or **unxz bigfile.xz**
### Running your own compression comparisons
If you'd like to run some tests on your own, grab a large but replaceable file and compress it using each of the commands shown above  preferably using a new subdirectory. You might have to first install **xz** if you want to include it in the tests.This script can make the comparison easier, but will likely take a few minutes to complete.
```
#!/bin/bash
# ask user for filename
echo -n "filename> "
read filename
# you need this because some commands will replace the original file
cp $filename $filename-2
# clean up first (in case previous results are still available)
rm $filename.*
tar cvfz ./$filename.tgz $filename > /dev/null
zip $filename.zip $filename > /dev/null
bzip2 $filename
# recover original file
cp $filename-2 $filename
gzip $filename
# recover original file
cp $filename-2 $filename
xz $filename
# show results
ls -l $filename.*
# replace the original file
mv $filename-2 $filename
```
Join the Network World communities on [Facebook][2] and [LinkedIn][3] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3538471/how-to-compress-files-on-linux-5-ways.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[2]: https://www.facebook.com/NetworkWorld/
[3]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,164 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to set up and run WordPress for your classroom)
[#]: via: (https://opensource.com/article/20/4/wordpress-virtual-machine)
[#]: author: (Don Watkins https://opensource.com/users/don-watkins)
How to set up and run WordPress for your classroom
======
Follow these simple steps to customize WordPress for use in the
classroom using free open source software.
![Painting art on a computer screen][1]
There are many good reasons to set up WordPress for your classroom. As more schools switch to online classes, WordPress can become the go-to content management system. Teachers using WordPress can provide a number of different educational choices to differentiate instruction for their students. Blogging is an accessible way to create content that energizes student learning. Teachers can write short stories, poems, and provide picture galleries that function as story starters. Students can comment and those comments can be moderated by their teacher.
There are free options like [WordPress.com][2] and [Edublogs][3]. However, these free versions are limited, and you may want to explore all your options. You can install [Virtualbox][4] on any Windows, macOS, or Linux computer. You can use your own computer or an extra you happen to have access to in a virtual environment.
On Linux, you can install Virtualbox from your package manager. For instance, on Debian, Elementary OS, or Ubuntu:
```
`$ sudo apt install virtualbox`
```
On Fedora:
```
`$ sudo dnf install virtualbox`
```
### Download a Wordpress image
Wordpress is easy to install, but server configuration and management can be difficult for the uninitiated. That's why there's [Turnkey Linux][5], a project dedicated to creating virtual machine images and containers of popular server software, preconfigured and ready to run. With Turnkey Linux, you just download a disk image containing the operating system and the software you want to run, and then import that image into Virtualbox.
To get started with Wordpress, download the **VM** virtual machine image from [turnkeylinux.org/wordpress][6] (in the **Builds** section). Make sure you download the image labeled **VM**, because that's the only format meant for Virtualbox.
### Import the image into Virtualbox
After installing Virtualbox, launch the application and import the virtual machine image into Virtualbox.
![][7]
Networking on the imported image is set to NAT by default. You will want to change the network settings to "bridged."
![Virtualbox menu][8]
After restarting the virtual machine, you are prompted to add passwords for MySQL, Adminer, and the WordPress **admin** user.
Then you see the network configuration console for the installation. Launch a web browser and navigate to the **web** address provided (in this example, it's 192.168.86.149).
![Console][9]
In a web browser, you see a login screen for your Wordpress installation. Click on the **Login** link.
![Wordpress welcome][10]
Enter **admin** as the username, followed by the password you created earlier. Click the **Login** link. On this first login as **admin**, you can choose a new password. Be sure to remember it!
![Login screen][11]
After logging in, you're presented with the WordPress Dashboard. The software will likely notify you, in the upper left corner of the window, that a new version of Wordpress exists. Update to the latest versions as prompted so your site is secure.
It's important to note that your Wordpress blog isn't visible by anyone on the Internet yet. It only exists in your local network: only people in your building who are connected to the same router or wifi access point as you can see your Wordpress site right now. The worldwide Internet can't get to it because you're behind a firewall (embedded in your router, and possible also in your computer).
![Wordpress dashboard][12]
Following the upgrade, the application restarts, and you're ready to begin configuring WordPress to your liking.
![Wordpress configuration][13]
On the far left, there is a button to **Customize Your Site**.
There, you can choose the name of your site. You can accept the default theme, which is "Twenty Nineteen," or choose another. My favorite is "Twenty Ten," but browse through the themes available to find your personal favorite. WordPress comes with five free themes installed. You can download other free themes from the [WordPress][14][.org][15] site or choose to purchase a premium theme.
When you click the **Customize Your Site** button, you're presented with new menu options. Select **Site Identity** and change the name of your site. You might use the name of your school or classroom. There's also room to choose a byline (the credit given to the author of a blog post). You can choose the colors for your site and where you will place menus and widgets. WordPress widgets and content and features to the sidebars for your site. Homepage settings are important, as they allow you to choose between a static page that might have a description of your school or classroom or having your blog entries displayed prominently. You can add additional CSS.
![Turnkey theme][16]
You can edit your front page, add additional pages like "About," or add a blog post. You can also manage widgets, manage menus, turn comments on or off, or add a link to learn more about WordPress.
Customizing your site allows you to configure a number of options quickly and easily.
WordPress has dozens of widgets that you can place in different areas of your page. Widgets are independent sections of content that can be placed into specific areas provided by your theme. These areas are called sidebars.
### Adding content
After you have WordPress configured to your liking, you probably want to get busy creating content. The best way to do that is to head back to the WordPress Dashboard.
On the left side, near the top of the page, you see **Posts**. Select that link and a dropdown appears. Choose **Add New** to create your very first blog post.
![Add post dropdown][17]
Fill in your title in the top block and then move down to the body. It's like using a word processor. WordPress has all the tools you need to write. You can set the font size from _small_ to _huge_. You can start a paragraph with dropped capitals. The text and background color can be changed. Your posts can include quote blocks and embedded content. A wide variety of embedded content is supported so you can make your posts a dynamic multimedia experience.
![Wordpress classroom blog][18]
### Going online
So far, your Wordpress blog only exists on your local network. Anyone using the same router as you (your housemates or classroom) can see your Wordpress site by navigating to 192.168.86.149, but once you're away from that router, the site becomes inaccessible.
If you want to go online with your custom Wordpress site, you have to allow traffic through your router, and then direct that traffic to the computer running Virtualbox. If you've installed Virtualbox on a laptop, then your website would disappear any time you closed your laptop, which is why servers that never get shutdown exist. But if this is just a fun lesson on how to run a Wordpress site, then having a website that's only available during class hours is fine.
If you have access to your router, then you can log into it and make the adjustments yourself. If you don't own or control your router, then you must talk to your systems administrator for access.
A _router_ is the box you got from your internet service provider. You might also call it your _modem_.
Every device is different, so there's no way for me to definitively tell you what you need to click on to adjust your settings. Generally, you access your home router through a web browser. Your router's address is often printed on the bottom of the router and begins with either 192.168 or 10.
Navigate to the router address and log in with the credentials you were provided when you got your internet service. It's often as simple as `admin` with a numeric password (sometimes this password is printed on the router, too). If you don't know the login, call your internet provider and ask for details.
Different routers use different terms for the same thing; keywords to look for are **Port forwarding**, **Virtual server**, and **Firewall**. Whatever your router calls it, you want to accept traffic coming to port 80 of your router and forward that traffic to the same port of your virtual machines's IP address (in this example, that is 192.168.86.149, but it could be different for you).
![Example router setting screen][19]
Now you're allowing traffic through the web port of your router's firewall. To view your Wordpress site over the Internet, get your worldwide IP address. You can get your global IP by going to the site [icanhazip.com][20]. Then go to a different computer, open a browser, and navigate to that IP address. As long as Virtualbox is running, you'll see your Wordpress site on the Internet. You can do this from anywhere in the world, because your site is on the Internet now.
Most websites use a domain name so you don't have to remember global IP addresses. You can purchase a domain name from services like [webhosting.coop][21] or [gandi.net][22], or a temporary one from [freenom.com][23]. Mapping that to your Wordpress site, however, is out of scope for this article.
### Wordpress for everyone
[WordPress][24] is open source and is licensed under the [GNU Public License][25]. You are welcome to contribute to WordPress as either a [developer][26] or enthusiast. WordPress is committed to being inclusive and accessible as possible.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/wordpress-virtual-machine
作者:[Don Watkins][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/don-watkins
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/painting_computer_screen_art_design_creative.png?itok=LVAeQx3_ (Painting art on a computer screen)
[2]: https://wordpress.com/
[3]: https://edublogs.org/
[4]: https://www.virtualbox.org/
[5]: https://www.turnkeylinux.org
[6]: https://www.turnkeylinux.org/wordpress
[7]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_1.png
[8]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_2.png (Virtualbox menu)
[9]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_3.png (Console)
[10]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_4.png (Wordpress welcome)
[11]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_5.png (Login screen)
[12]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_6.png (Wordpress dashboard)
[13]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_7.png (Wordpress configuration)
[14]: http://Wordpress.org
[15]: http://WordPress.org
[16]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_8.png (Turnkey theme)
[17]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_12.png (Add post dropdown)
[18]: https://opensource.com/sites/default/files/uploads/how_to_get_started_with_wp_in_the_classroom_13.png (Wordpress classroom blog)
[19]: https://opensource.com/sites/default/files/router-web.jpg (Example router setting screen)
[20]: http://icanhazip.com/
[21]: https://webhosting.coop/domain-names
[22]: https://www.gandi.net
[23]: http://freenom.com/
[24]: https://wordpress.org/
[25]: https://github.com/WordPress/WordPress/blob/master/license.txt
[26]: https://wordpress.org/five-for-the-future/

View File

@@ -0,0 +1,174 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Is reporting 100% of code coverage reasonable?)
[#]: via: (https://opensource.com/article/20/4/testing-code-coverage)
[#]: author: (Eric Herman https://opensource.com/users/ericherman)
Is reporting 100% of code coverage reasonable?
======
The time required to reach reporting 100% of code coverage is
considerably less than what I would have estimated before this
exploration.
![Code going into a computer.][1]
The [Foundation for Public Code][2] works to enable open and collaborative public-purpose software for public organizations (like local governments) internationally. We do this by supporting software at the codebase level through codebase stewardship. We also publish the [Standard for Public Code][3] (draft version 0.1.4 at the time of this writing), which helps open source codebase communities build solutions that can be reused successfully by other organizations. It includes guidance for policymakers, managers, developers, designers, and vendors.
Among other things, the standard addresses [code coverage][4], or how much of the code is executed when an automated test suite runs. It's one way to measure the likelihood that the code contains undetected software bugs. In the standard's ["Use continuous integration" requirements][5], it says, "source code test and documentation coverage **should** be monitored." Additionally, the [guidance to check][6] this requirement states, "code coverage tools check whether coverage is at 100% of the code."
Over my software development career, which spans more than two decades, I have worked on codebases large and small and some with very high percentages of code coverage. Yet none of the non-trivial codebases I have contributed to have reported 100% test coverage. This made me question whether the "_check whether coverage is at 100%_" guidance would be followed.
When I think about the nature of the test coverage gaps in the codebases I have worked on, they typically have been around system states that are very difficult (and in some cases, impossible) to create. For instance, in earlier versions of Java, I recall we were required to write catch blocks for exceptions that could never be thrown.
Previously, I reasoned that 100% test coverage is something to aspire to, but it is probably not worth the cost on most codebases and may not be realistic in a few.
Coverage tools have been getting smarter and more tunable over time. Languages have been getting lighter, and libraries have been getting easier to mock and test. So how unreasonable is 100% coverage of functionality today?
### Resource exhaustion
The high-quality but low test-coverage codebases I contribute to happen to be written in C or C++. A quick glance at these codebases shows that there is a class of common low-coverage situations that I'll lump together under the umbrella of resource exhaustion: out of memory, out of disk space, etc.
Here is a simple example of code that does not check for resource exhaustion; in this case, memory allocation failure:
```
char *buf = malloc(80);
sprintf(buf, "hello, world");
```
This example code needs to allocate a small buffer, so it calls **malloc(80)**, and **malloc** usually returns a pointer to 80 bytes of memory … but that can fail. In the (unlikely) case that **malloc** returns **NULL**, the code above will proceed to call **sprintf** with a **NULL** pointer which causes a crash. It is typical in C code to do something more like this:
```
char *buf = malloc(80);
if (buf == NULL) {
    fprintf(stderr, "malloc returned NULL for 80 bytes?\n");
    return NULL;
}
sprintf(buf, "hello, world");
```
This code guards against **malloc** returning **NULL**, which is better. However, creating tests for correct behavior in the face of this kind of resource exhaustion can be really hard. It's not impossible, of course, and there are multiple approaches. Many approaches result in fragile tests, which require a lot of maintenance over time, and these tests can be very time-consuming to build in the first place.
### Exploration
Pondering this, I decided to run a little experiment to see if I could learn something about the costs and consequences of this strict, 100% criterion.
Since I do some embedded-systems development, I have a few C libraries that I've developed and reused over the years in my embedded projects. I decided to look at some of these libraries and see just how hard it would be to bring them up to 100% code coverage. In the process, I paid attention to the impact on code clarity, code structure, and performance.
#### A library with preexisting dependency injection
Step one is measuring by adding code coverage to a codebase. Since this is C, **gcc** provides quite a lot by default with the **\--coverage** option, and **lcov** (with **genhtml**) does a good job of making reports; thus, this step was easy. I expected the starting coverage to be pretty good—it was, but it had a few untested branches, as well as the predicted gaps around error conditions and error reporting.
I made error reporting pluggable, so it was easier to capture and make assertions around error messages in previously untested branches.
Since this code already allowed for pluggable implementations of **malloc** and **free**, it was straightforward to write little malloc and free wrappers that I could inject memory allocation failures into. Within an hour or two, that was covered.
In the process, I realized that there was one condition where, from the perspective of the calling client code, it was impossible to distinguish between the situation where an error occurs and one where **NULL** is a valid return value. For you C programmers, it was essentially similar to the following:
```
/* stashes a copy of the value
 * returns the previously stashed value */
char *foo_stash(foo_s *context,
                char *stash_me,
                size_t stash_me_len)
{
    char *copy = malloc(stash_me_len);
    if (copy == NULL) {
        return NULL;
    }
    memcpy(copy, stash_me, stash_me_len);
    char *previous = context-&gt;stash;
    context-&gt;stash = copy;
    /* previous may be NULL */
    return previous;
}
```
I adjusted the API to allow the error information to be explicitly available. If you are a C developer, you know there are various ways this can be accomplished. I chose an approach similar to this:
```
/* stashes a copy of the value
 * returns the previously stashed value
 * on error, the 'err' pointer is set to 1 */
char *foo_stash2(foo_s *context,
                char *stash_me,
                size_t stash_me_len,
                int *err)
{
    char *copy = malloc(stash_me_len);
    if (copy == NULL) {
        *err = 1;
        return NULL;
    }
    memcpy(copy, stash_me, stash_me_len);
    char *previous = context-&gt;stash;
    context-&gt;stash = copy;
    /* previous may be NULL */
    return previous;
}
```
Without testing for resource exhaustion, it may have taken a long time for me to notice this (now obvious) shortcoming of the API.
To get **lcov** to report 100% test coverage, I had to tell the compiler to [not inline any code][7], something I learned it does even at optimization level zero.
When embedded in actual firmware, the compiler optimized away the unused indirection; therefore, the added indirection in the source code imposed no real-world performance penalty in the compiled firmware.
Of course, this was the easy library.
#### A more typical library
Once I established a method of injecting memory allocation failures in tests, I decided to move onto another library, but one for which malloc and free were not already pluggable. I had questions. How invasive will this be to the codebase? Will it clutter the code, making it less clear? How time-consuming will it be?
While I don't always record coverage metrics, I am a big believer in testing: more than 20 years ago, I learned that my code improves if I write the tests and client code [before][8] the implementation code, and I have worked that way ever since. (In [_Test-Driven Development: By Example_][9], you can find my name in the acknowledgments.) Yet, when I added code coverage reporting to the second library, I was surprised to see that (at some point in the past) I had added a pair of functions to the library without adding tests for them. The other untested areas were, unsurprisingly, code to handle memory-allocation failure.
Writing tests for the pair of untested functions was, of course, quick and easy. The coverage tools also revealed that I had a function with an untested code branch that, given only a quick glance, contained a bug. The fix was trivial, yet I was surprised to find a bug, given the different projects where I use this library. Nonetheless, there it was, a humbling reminder that, all too often, bugs lurk in untested code.
Next up was the more challenging stuff: testing for resource exhaustion. I started by introducing some global variables for the malloc/free function pointers, as well as a variable to hold a memory-tracking object. Once that was working, I moved those variables from global scope into a context argument that was already present. Refactoring the code to allow for the necessary indirection took only a couple of hours (less time than I expected), and the complexity added was negligible.
### Reflections
My conclusion from the first library was that it was well worth the time. The code is now more flexible, the API is now more complete for the caller, and writing the failure injection harness was pretty easy.
From the second library, I was reminded that even less-pluggable code could be made testable without adding undue levels of complexity. The code improved, I fixed a bug, and I can be more confident in the code. Also, the additional modularity of being able to plug in an alternative memory allocator is a feature that may prove more valuable in the future.
Exclusion comments are a feature of **lcov** to cause coverage reporting to ignore a block of code. Interestingly, I didn't feel the need to use exclusion comments in either library.
I am more certain than ever that even very good code is improved by investing in test coverage.
Both of these codebases are small, had some modularity already, began from a point of good testing, are single-threaded, and contain no graphical UI code. If I were to try to tackle this on one of the larger, more monolithic codebases I contribute to, it would be harder and require a larger time investment. There would likely be some sections of code where I might still conclude that the best thing to do would be to "cheat" by tuning the tooling to not report on some section of code.
That said, I estimate that the time required to reach reporting 100% of code coverage is considerably less than what I would have estimated before this exploration.
If you happen to be a C coder and want to see a running example of this, including **gcov** / **lcov** usage, I extracted the out-of-memory injecting code and put it in an [example repository][10].
Have you pushed a codebase to 100% coverage by tests, or tried to? What was your experience? Please share it in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/testing-code-coverage
作者:[Eric Herman][a]
选题:[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/ericherman
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/code_computer_development_programming.png?itok=4OM29-82 (Code going into a computer.)
[2]: https://publiccode.net/
[3]: https://standard.publiccode.net
[4]: https://en.wikipedia.org/wiki/Code_coverage
[5]: https://standard.publiccode.net/criteria/continuous-integration.html#requirements
[6]: https://standard.publiccode.net/criteria/continuous-integration.html#how-to-test
[7]: https://twitter.com/Eric_Herman/status/1224983465784938496
[8]: https://opensource.com/article/20/2/automate-unit-tests
[9]: https://www.oreilly.com/library/view/test-driven-development/0321146530/
[10]: https://github.com/ericherman/context-alloc

View File

@@ -0,0 +1,116 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (A stress-free guide to keeping WordPress sites updated)
[#]: via: (https://opensource.com/article/20/4/updating-wordpress)
[#]: author: (Sara Kelly https://opensource.com/users/sarapk)
A stress-free guide to keeping WordPress sites updated
======
This practical guide to a necessary task will show you how to maximize
site performance and avoid bugs and other issues with regular updates.
![Working from home at a laptop][1]
We all know how important it is to keep WordPress sites updated. New updates provide the latest bug and security fixes against any nasties lurking on the web. But, more critically, an outdated site can also lead to poor performance, such as slow loading speed or an outdated look and feel.
Unfortunately, keeping your WordPress site up-to-date is not as easy as clicking a button. There are several components to consider, from theme to plugins to PHP. Even worse, updating too quickly can wreak another kind of havoc. Have you ever experienced the dreaded, "There has been a critical error on your website" warning after an innocent little update? I know I have, many times!
Here is a practical guide on what to look out for, as well as when and what to update, to ensure your WordPress site works well.
### Updating WordPress
Let's start with the basics. Check your WordPress version is up-to-date by visiting Dashboard &gt; Updates.
![WordPress update screen][2]
### Choosing a WordPress theme
Before we deep dive into updating themes, I'd like to take a few steps back. Choose an up-to-date theme from the get-go and do your homework before installing it! There is nothing worse than pouring your heart and soul into customizing a new theme, only to discover it is buggy.
Questions to ask when choosing a theme include:
* When was it first created?
* What is the current version available?
* Does the theme provider still maintain an active demo site and helpdesk?
* What do recent reviews say about the theme?
If the theme provider is no longer maintaining the theme, save yourself the trouble and move on. Also, don't assume that just because you paid for a theme, that is necessarily maintained. I recently fell into this trap when I purchased [Pinable][3]. I loved the Pinterest look and feel. However, soon after installation, I noticed the lack of customization within the theme settings, major compatibility issues arose with my plugins, and the customer service was nonexistent. I should have known better. The theme was created in 2013 and selling for a bargain.
If you already have a theme, then pay attention to how frequently updates become available. If there are never any updates, the theme provider may have closed up shop. It is only a matter of time before the impact of an outdated theme will cause problems.
A quick aside while we are on the topic—up-to-date themes also give access to the two new alignment options in the WordPress block editor, which enable wide-width and full-width images. These help your blog posts look more professional. While there are a number of [tutorials][4] on the web that show you how to manually update your functions, PHP file, and CSS to enable the new alignment blocks, the code does not always work on older themes (especially masonry themes).
![Wordpress theme][5]
### Updating themes
To check the current version of your theme, go to Appearance &gt; Themes and click on the active theme to see the current version. If an upgrade is available, there will be an alert banner. Click on "update now" to initiate the update. You can also check for updates by going to Dashboard &gt; Updates.
![Themify screenshot][6]
If you purchased a theme from a marketplace such as [Envato][7] or [Themify][8], check the theme documentation to learn what is required to initiate updates, as it will not show up automatically in the dashboard. In most cases, you will be required to download and install a specific plugin or manually upload new versions when they become available. In the latter case, you will need to delete or rename the old theme file via your cPanel before you can install the new one. A guide to installing themes via cPanel is available [here][9].
If you plan to customize your theme extensively and are worried about the impact of this when upgrading, consider creating a child theme first. A child theme lets you make changes without touching the original theme's code. You can then update your site without losing any customizations you've made. Read more about child themes [here][10].
As I said before, the source of most issues tends to be the theme. Learn what is required to keep your theme up to date, and do so regularly. If your theme provider is no longer creating updates, then find a new theme.
### Easy does it for plugins
If you manage multiple plugins, then you will be used to the frequent dashboard reminders to update! Before we get onto that, though, let's touch on some basics.
As a general rule, you don't want to have too many plugins. They slow down the speed of your site by creating more code that the browser has to load. Always delete any inactive plugins. I prefer to manage plugins on the Plugins tab. Here you can see all active and inactive plugins, the current version, and whether an update is available. To update the plugin, simply click "update."
![Plugin update page][11]
Nonetheless, I implore you to wait a week or two before installing new updates. Updating my plugins too quickly has caused me no end of grievances. To begin with, updates are prone to human error. Don't be the guinea pig that tests out the latest version. Sometimes, the newest version of a plugin is not compatible with an older version of WordPress or your theme. Check these are up-to-date first.
### Website down after updating plugins?
If your site has stopped working or performance has dropped noticeably after updating your plugins, then all is not lost. Forget about those newfangled plugins that promise to test speed and identify buggy plugins (the last thing you want is more plugins)! Disable all your plugins, then activate one at a time while you test the speed and performance of your site on a website such as [Pingdom][12]. This is a great exercise to perform periodically, even if your website has not crashed. Once you identify the plugin causing the problem, delete it.
In the event you cannot access WordPress because there is a critical error, then you will need to access your files via cPanel and delete all the plugin folders from there ([full instructions here][13]). Don't worry; doing this will not impact your website's content. You can then proceed to reinstall and activate the plugins one-by-one via WordPress.
Cache plugins tend to be the biggest culprit in my experience. Issues with cache plugins can be minimized by clearing the cache frequently. Do not install multiple cache plugins that perform the same function, as they will only serve to slow down your site. The only way to truly get around cache plugin issues is to either not use them, use a plugin recommended by your hosting provider, or become an expert on cache. [This blog][14] on common cache issues in WordPress is a good place to start.
### Back up before updating PHP
If you are concerned about your website speed and have spent enough time browsing Google for answers, then you likely have seen the advice, "You gotta update your PHP!" Please tread carefully with manual PHP updates, though! If you have a good hosting provider, you should never need to do this. Rather, select the option for automatic PHP version management with your host. Newer versions of PHP may not be stable or compatible with the version of WordPress you are running. Let your hosting provider be the one to determine when updates are ready.
However, if you are adamant that an old version of PHP is causing your website to be slow, take care to follow these steps before initiating an update. First, back up your site. Investing in a premium version of [Jetpack][15] is worth its weight in gold. Jetpack can perform real-time as well as daily backups, depending on your plan. Not to mention, their customer service and troubleshooting support are excellent. Secondly, inform your hosting provider that you plan to update the PHP and seek their advice first. If your host is unable to advise or wants to charge you for the privilege, you should probably think about changing hosts.
You can update PHP either via cPanel or via your hosting platform under Devs &gt; PHP Manager. After that, you are on your own, as that is where my expertise on PHP ends.
If you have any other tips or pitfalls regarding updating WordPress, drop them in the comments box below.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/updating-wordpress
作者:[Sara Kelly][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/sarapk
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/wfh_work_home_laptop_work.png?itok=VFwToeMy (Working from home at a laptop)
[2]: https://opensource.com/sites/default/files/uploads/wp_update_1.png (Wordpress update screen)
[3]: https://www.theme-junkie.com/themes/pinable/
[4]: https://www.billerickson.net/full-and-wide-alignment-in-gutenberg/
[5]: https://opensource.com/sites/default/files/uploads/wp_theme_2.png (Wordpress theme)
[6]: https://opensource.com/sites/default/files/uploads/themify_3.png (Themify screenshot)
[7]: https://elements.envato.com/
[8]: https://themify.me/
[9]: https://hostadvice.com/how-to/how-to-install-a-wordpress-theme-using-cpanel/
[10]: https://developer.wordpress.org/themes/advanced-topics/child-themes/
[11]: https://opensource.com/sites/default/files/uploads/plugins_4.png (Plugin update page)
[12]: https://tools.pingdom.com/
[13]: https://www.wpbeginner.com/plugins/how-to-deactivate-all-plugins-when-not-able-to-access-wp-admin/
[14]: https://mhthemes.com/support/knb/solving-common-cache-issues-on-wordpress-websites/
[15]: https://jetpack.com/upgrade/backup/?utm_source=google&utm_campaign=google_jetpack_search_brand_desktop_sg_en&utm_medium=paid_search&utm_term=%2Bwordpress%20%2Bjetpack%20%2Bbackup&creative=379260213317&campaignid=2061290863&utm_content=77066462603&matchtype=b&device=c&network=g&gclid=Cj0KCQjwu6fzBRC6ARIsAJUwa2RuPx5Dzr72eBEtZegsf11MmOBgLiwLX2HcEUXVaULIgv1MdZqGmeAaArmFEALw_wcB&gclsrc=aw.ds

View File

@@ -0,0 +1,250 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Getting Started With Pacman Commands in Arch-based Linux Distributions)
[#]: via: (https://itsfoss.com/pacman-command/)
[#]: author: (Dimitrios Savvopoulos https://itsfoss.com/author/dimitrios/)
Getting Started With Pacman Commands in Arch-based Linux Distributions
======
_**Brief: This beginners guide shows you what you can do with pacmancommands in Linux, how to use them to find new packages, install and upgrade new packages, and clean your system.**_
The [pacman][1] package manager is one of the main difference between [Arch Linux][2] and other major distributions like Red Hat and Ubuntu/Debian. It combines a simple binary package format with an easy-to-use [build system][3]. The aim of pacman is to easily manage packages, either from the [official repositories][4] or the users own builds.
If you ever used Ubuntu or Debian-based distributions, you might have used the apt-get or apt commands. Pacman is the equivalent in Arch Linux. If you [just installed Arch Linux][5], one of the first few [things to do after installing Arch Linux][6] is to learn to use pacman commands.
In this beginners guide, Ill explain some of the essential usage of the pacmand command that you should know for managing your Arch-based system.
### Essential pacman commands Arch Linux users should know
![][7]
Like other package managers, pacman can synchronize package lists with the software repositories to allow the user to download and install packages with a simple command by solving all required dependencies.
#### Install packages with pacman
You can install a single package or multiple packages using pacman command in this fashion:
```
pacman -S _package_name1_ _package_name2_ ...
```
![Installing a package][8]
The -S stands for synchronization. It means that pacman first synchronizes
The pacman database categorises the installed packages in two groups according to the reason why they were installed:
* **explicitly-installed**: the packages that were installed by a generic pacman -S or -U command
* **dependencies**: the packages that were implicitly installed because [required][9] by another package that was explicitly installed.
#### Remove an installed package
To remove a single package, leaving all of its dependencies installed:
```
pacman -R package_name_
```
![Removing a package][10]
To remove a package and its dependencies which are not required by any other installed package:
```
pacman -Rs _package_name_
```
To remove dependencies that are no longer needed. For example, the package which needed the dependencies was removed.
```
pacman -Qdtq | pacman -Rs -
```
#### Upgrading packages
Pacman provides an easy way to [update Arch Linux][11]. You can update all installed packages with just one command. This could take a while depending on how up-to-date the system is.
The following command synchronizes the repository databases _and_ updates the systems packages, excluding “local” packages that are not in the configured repositories:
```
pacman -Syu
```
* S stands for sync
* y is for refresh (local
* u is for system update
Basically it is saying that sync to central repository (master package database), refresh the local copy of the master package database and then perform the system update (by updating all packages that have a newer version available).
![System update][12]
Attention!
If you are an Arch Linux user before upgrading, it is advised to visit the [Arch Linux home page][2] to check the latest news for out-of-the-ordinary updates. If manual intervention is needed an appropriate news post will be made. Alternatively you can subscribe to the [RSS feed][13] or the [arch-announce mailing list][14].
Be also mindful to look over the appropriate [forum][15] before upgrading fundamental software (such as the kernel, xorg, systemd, or glibc), for any reported problems.
**Partial upgrades are unsupported** at a rolling release distribution such as Arch and Manjaro. That means when new library versions are pushed to the repositories, all the packages in the repositories need to be rebuilt against the libraries. For example, if two packages depend on the same library, upgrading only one package, might break the other package which depends on an older version of the library.
#### Use pacman to search for packages
Pacman queries the local package database with the -Q flag, the sync database with the -S flag and the files database with the -F flag.
Pacman can search for packages in the database, both in packages names and descriptions:
```
pacman -Ss _string1_ _string2_ ...
```
![Searching for a package][16]
To search for already installed packages:
```
pacman -Qs _string1_ _string2_ ...
```
To search for package file names in remote packages:
```
pacman -F _string1_ _string2_ ...
```
To view the dependency tree of a package:
```
pactree _package_naenter code hereme_
```
#### Cleaning the package cache
Pacman stores its downloaded packages in /var/cache/pacman/pkg/ and does not remove the old or uninstalled versions automatically. This has some advantages:
1. It allows to [downgrade][17] a package without the need to retrieve the previous version through other sources.
2. A package that has been uninstalled can easily be reinstalled directly from the cache folder.
However, it is necessary to clean up the cache periodically to prevent the folder to grow in size.
The [paccache(8)][18] script, provided within the [pacman-contrib][19] package, deletes all cached versions of installed and uninstalled packages, except for the most recent 3, by default:
```
paccache -r
```
![Clear cache][20]
To remove all the cached packages that are not currently installed, and the unused sync database, execute:
```
pacman -Sc
```
To remove all files from the cache, use the clean switch twice, this is the most aggressive approach and will leave nothing in the cache folder:
```
pacman -Scc
```
#### Installing local or third-party packages
Install a local package that is not from a remote repository:
```
pacman -U _/path/to/package/package_name-version.pkg.tar.xz_
```
Install a remote package, not contained in an official repository:
```
pacman -U http://www.example.com/repo/example.pkg.tar.xz
```
### Bonus: Troubleshooting common errors with pacman
Here are some common errors you may encounter while managing packages with pacman.
#### Failed to commit transaction (conflicting files)
If you see the following error:
```
error: could not prepare transaction
error: failed to commit transaction (conflicting files)
package: /path/to/file exists in filesystem
Errors occurred, no packages were upgraded.
```
This is happening because pacman has detected a file conflict and will not overwrite files for you.
A safe way to solve this is to first check if another package owns the file (pacman -Qo _/path/to/file_). If the file is owned by another package, file a bug report. If the file is not owned by another package, rename the file which exists in filesystem and re-issue the update command. If all goes well, the file may then be removed.
Instead of manually renaming and later removing all the files that belong to the package in question, you may explicitly run _**pacman -S overwrite glob package**_ to force pacman to overwrite files that match _glob_.
#### Failed to commit transaction (invalid or corrupted package)
Look for .part files (partially downloaded packages) in /var/cache/pacman/pkg/ and remove them. It is often caused by usage of a custom XferCommand in pacman.conf.
#### Failed to init transaction (unable to lock database)
When pacman is about to alter the package database, for example installing a package, it creates a lock file at /var/lib/pacman/db.lck. This prevents another instance of pacman from trying to alter the package database at the same time.
If pacman is interrupted while changing the database, this stale lock file can remain. If you are certain that no instances of pacman are running then delete the lock file.
Check if a process is holding the lock file:
```
lsof /var/lib/pacman/db.lck
```
If the above command doesnt return anything, you can remove the lock file:
```
rm /var/lib/pacman/db.lck
```
If you find the PID of the process holding the lock file with lsof command output, kill it first and then remove the lock file.
I hope you like my humble effort in explaining the basic pacman commands. Please leave your comments below and dont forget to subscribe on our social media. Stay safe!
--------------------------------------------------------------------------------
via: https://itsfoss.com/pacman-command/
作者:[Dimitrios Savvopoulos][a]
选题:[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/dimitrios/
[b]: https://github.com/lujun9972
[1]: https://www.archlinux.org/pacman/
[2]: https://www.archlinux.org/
[3]: https://wiki.archlinux.org/index.php/Arch_Build_System
[4]: https://wiki.archlinux.org/index.php/Official_repositories
[5]: https://itsfoss.com/install-arch-linux/
[6]: https://itsfoss.com/things-to-do-after-installing-arch-linux/
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/essential-pacman-commands.jpg?ssl=1
[8]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-S.png?ssl=1
[9]: https://wiki.archlinux.org/index.php/Dependency
[10]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-R.png?ssl=1
[11]: https://itsfoss.com/update-arch-linux/
[12]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-Syu.png?ssl=1
[13]: https://www.archlinux.org/feeds/news/
[14]: https://mailman.archlinux.org/mailman/listinfo/arch-announce/
[15]: https://bbs.archlinux.org/
[16]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-pacman-Ss.png?ssl=1
[17]: https://wiki.archlinux.org/index.php/Downgrade
[18]: https://jlk.fjfi.cvut.cz/arch/manpages/man/paccache.8
[19]: https://www.archlinux.org/packages/?name=pacman-contrib
[20]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/sudo-paccache-r.png?ssl=1

View File

@@ -0,0 +1,99 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (New open source GIS projects for Kubernetes applications)
[#]: via: (https://opensource.com/article/20/4/gis-kubernetes)
[#]: author: (Adam Timm https://opensource.com/users/timmam)
New open source GIS projects for Kubernetes applications
======
pg_tileserv and pg_featureserv make it easier for developers to add
location services to Kubernetes applications.
![A map with a route highlighted][1]
Spatial data from geographic information systems (GIS) is all around us. From smartphones that make our lives better and more convenient to precision agriculture that is increasing the amount of food farmers can produce while reducing the cost, whether or not we realize it, almost every part of our lives is touched by spatial data.
This increase of spatial data is simultaneously bringing an increase of open spatial datasets that people can consume and use to build all sorts of new applications. However, these types of datasets have not always been easy to work with. Also, due to the size of some of the geographic data, they can be difficult to bring to modern application deployment frameworks such as Kubernetes.
To help with these issues, [Crunchy Data][2] recently announced two new open source projects, [pg_tileserv][3] and [pg_featureserv][4], to make it easier to develop cloud-native spatial applications. These projects, part of open source [Crunchy Spatial][5], help developers leverage the robust [PostGIS][6] geospatial database extension to [PostgreSQL][7] without having to write complex SQL statements.
So what are pg_tileserv and pg_featuresev, how do they make it easier for developers to add location services to their Kubernetes applications, and what does this mean for the future of spatial applications?
### Traditional GIS vs. modern spatial microservices
Traditionally, when an organization or individual works with spatial data, they start with a product that grew up as a GIS. There are many high-quality open source GIS products ([QGIS][8], [GeoServer][9], [GeoNode][10], etc.), but they may not align with modern, cloud-native approaches to software design.
The popularity of Kubernetes creates challenges for these legacy applications around automation and deployment, as they require a lot of manual configuration, for example, when data sources are added and modified. In many setups, these spatial applications must exist outside Kubernetes and cannot leverage many of the conveniences it provides.
In contrast, modern spatial services should be driven by the spatial data that they are processing and serving out. They should align with modern software development practices and scale efficiently and integrate easily with developer workflows.
Applications that are spatially aware also need to ensure they can handle the unique characteristics of spatial data (e.g., geometries, projections, etc.). To do all of this in independent microservices can be challenging unless you have a highly capable database to do the majority of the work for you. This is where pg_tileserv and pg_featureserv help, as both projects leverage the power of PostGIS, an open source geospatial extension to PostgreSQL, to provide advanced spatial capabilities from a simple REST framework
### Generate map vector tiles with pg_tileserv
![pg_tileserv][11]
pg_tileserv is a lightweight vector tile server written in Go that enables you to generate [vector tiles][12] directly from PostGIS. It does this by implementing the **ST_AsMVT()** function in a best-practice method that translates an HTTP request to the database. It includes common defaults that allow you to pass a database connection URL to the server and be up and running in no time. There's no heavyweight software to install and configure, and it's designed for cloud-native GIS applications.
For specific examples on how to use it, check out our blog posts on [tile serving][13] and [spatial tile serving with PostgreSQL functions][14].
### Annotate your maps with pg_featureserv
![pg_featureserv][15]
pg_featureserv is a lightweight service written in Go that enables you to serve features directly out of PostGIS. It implements the [OGC API][16] for features and provides a standard REST endpoint for your spatial data and functions contained in PostGIS. Just like pg_tileserv, there's no heavyweight software to install; just pass a database connection URL to your PostGIS database, and you're off to the races. For a specific example of how to use it, check out our post on [querying spatial features][17].
### Focus on spatial data, not GIS
With our deep background in developing PostGIS and building PostGIS-backed applications, we wanted to help developers unlock all the value of spatial data in a way that is easy to deploy, scale, and maintain. As the source code of pg_tileserv and pg_featureserv show, we are just leveraging functions already in PostGIS. This allows developers to quickly add spatial data to their applications and data scientists to focus on the data.
![GIS architecture][18]
The benefits of this approach are:
* Faster performance because PostgreSQL and PostGIS are doing the work for you
* Less configuration to maintain because the database structure is the configuration
* By design, it runs in the cloud at enterprise scale from the start
* Shorter times to update customer-facing applications—when you update your data in the database, your application is updated instantly
* Ability to focus more on maintaining your data and delivering value to your users and less on wrangling software
Also, since these services respond to the configuration of your database, they also expose functions contained in the database. Rather than developing their data functions to incorporate them into software later, data scientists can create functions in the database that are immediately made available via a REST API. The software begins to fade into the background so an organization can focus on the data.
Suffice it to say, we're pretty excited about these new geospatial services, and we definitely want your feedback on them. Feel free to check out [pg_tileserve][3] and [pg_featureserv][4], try deploying them alongside your PostGIS databases with the [PostgreSQL Operator][19], and share your feedback in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/gis-kubernetes
作者:[Adam Timm][a]
选题:[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/timmam
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/map_route_location_gps_path.png?itok=RwtS4DsU (A map with a route highlighted)
[2]: https://www.crunchydata.com/
[3]: https://github.com/CrunchyData/pg_tileserv
[4]: https://github.com/CrunchyData/pg_featureserv
[5]: https://www.crunchydata.com/products/crunchy-spatial/
[6]: https://postgis.net/
[7]: https://www.postgresql.org
[8]: https://www.qgis.org/en/site/
[9]: http://geoserver.org/
[10]: http://geonode.org/
[11]: https://opensource.com/sites/default/files/pg_tileserv.jpg (pg_tileserv)
[12]: https://info.crunchydata.com/blog/dynamic-vector-tiles-from-postgis
[13]: https://info.crunchydata.com/blog/crunchy-spatial-tile-serving
[14]: https://info.crunchydata.com/blog/crunchy-spatial-tile-serving-with-postgresql-functions
[15]: https://opensource.com/sites/default/files/pg_featureserv.jpg (pg_featureserv)
[16]: http://www.ogcapi.org/
[17]: https://info.crunchydata.com/blog/crunchy-spatial-querying-spatial-features-with-pg_featureserv
[18]: https://opensource.com/sites/default/files/uploads/architecture_0.png (GIS architecture)
[19]: https://github.com/CrunchyData/postgres-operator

View File

@@ -0,0 +1,99 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How I use Hugo for my classroom's open source CMS)
[#]: via: (https://opensource.com/article/20/4/hugo-classroom)
[#]: author: (Peter Cheer https://opensource.com/users/petercheer)
How I use Hugo for my classroom's open source CMS
======
This open source software streamlines text editing while leaving room
for customization.
![Digital hand surrounding by objects, bike, light bulb, graphs][1]
People love Markdown text with good reason—it is easy to write, easy to read, easy to edit, and it can be converted to a wide range of other text mark up formats. While Markdown text is very good for content creation and manipulation, it imposes limitations on the options for content display.
If we could combine the virtues of Markdown with the power and flexibility of Cascading Style Sheets, HTML5, and JavaScript, that would be something special. One of the programs trying to do this is [Hugo][2]. Hugo was created in 2013 by Steve Francia; it is cross-platform and open source under an Apache 2.0 license with an active developer community and a growing user base.
The basic concept is that pieces of content, such as web pages or blog posts, written in Markdown and associated with metadata, are converted into HTML and combined with templates and themes to produce a complete web site. The power and flexibility come through these themes and templates or changing the default behaviors of Hugo. This power comes with a degree of unavoidable complexity, but there are lots of [pre-built templates][3] available if you lack the time or inclination to make your own.
Installing Hugo on my Linux machine was quick and easy. Starting a new project is as simple as typing **hugo new site quickstart** at the command line which creates a new project with this folder structure:
* **archetypes**: Content template files that contain preconfigured front matter metadata (date, title, draft). You can create new archetypes with custom front matter fields.
* **assets**: Stores all the files, which are processed by Hugo Pipes (e.g., CSS/Sass files). This directory is not created by default.
* **config.toml**: The default site config file.
* **content**: Where all the content Markdown files live.
* **data**: Used to store configuration files that can be used by Hugo when generating your website.
* **layouts**: Stores templates as .html files.
* **static**: Stores all the static content—images, CSS, JavaScript, etc.
* **themes**: For the Hugo theme of your choice.
The Markdown files in the content folder can be created manually or by Hugo and edited with any text editor or your Markdown creation tool of choice. If created manually, you will need to add any metadata that is needed. I prefer to use [Ghostwriter][4] for writing Markdown. Images are usually kept in a sub-folder in the static folder. Site development can proceed quickly, as Hugo includes a web server for testing and pre-viewing.
To check your work, type **hugo server** at the command line to start the server. By default, Hugo will not publish:
* Content with a future **publishdate** value.
* Content with **draft: true** status.
* Content with a past **expirydate** value.
Adding **hugo server -D** will include draft articles, and Hugo can be configured to mark all new articles as draft. After starting the web server, you can see your work in a web browser at localhost:1313. Once the server is started by default, it will automatically reload the browser window when it detects a change to one of your files.
There are tasks Markdown cannot do that need some HTML code. Hugo recognizes this but believes in keeping Markdown code as clean, simple, and uncluttered as possible. Hugo does this with shortcodes such as **{{&lt; youtube id= "w7Ft2ymGmfc" autoplay= "true"&gt;}}**, which will embed the YouTube video with id. w7Ft2ymGmfc. There are quite a few pre-built shortcodes for common tasks, but it is also possible to create your own for particular jobs.
I work in education quite a lot and wanted to include some interactive puzzles and questions on my Hugo-generated website. To get the output looking like this:
![JClic shortcode][5]
I created the activities with an open source Java program called [JClic][6], exported them as HTML5, put that into static/activities/excel, and displayed it in an iframe.
The HTML code, which would spoil the nice clean Markdown content, looks like this:
```
    &lt;[iframe][7]
       src="/activity/excel/index.html"
       title="Activity"
       height="400"
       frameborder="0"
       marginwidth="0"
       marginheight="0"
       scrolling="no"
       style="border: 1px solid #CCC; border-width: 1px; margin-bottom: 20px; width: 100%;"
       allowfullscreen="true"&gt;
    &lt;/[iframe][7]&gt;
```
The code is saved in layouts/shortcodes as **activity.html**
This makes the shortcode placed inside my Markdown file **{{&lt;activity&gt;}}**, which is much neater.
When your project is ready, you can build it with the **hugo** command; this will create a public folder and generate the website in it. Hugo has a number of built-in deployment options for different hosting providers—basically, you deploy your site by copying the public folder to your production web server. There is a lot more to Hugo that I haven't even gotten to yet, including configuration options, importing content from other static site generators and Wordpress, display data from JSON files, syntax highlighting of source code, and the fact that it is very fast (an advantage when working with large sites).
In many software tools, ease-of-use comes at the expense of flexibility, or vice-versa; Hugo makes a largely successful attempt at including both. For basic use with Markdown content and a pre-built theme, Hugo is easy to use and produces rapid results. Alternatively, if you have the need to alter the configuration settings or dive in and create your own themes, shortcodes, templates, or metadata schemes, that choice is open to you.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/hugo-classroom
作者:[Peter Cheer][a]
选题:[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/petercheer
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003588_01_rd3os.combacktoschoolseriesk12_rh_021x_0.png?itok=fvorN0e- (Digital hand surrounding by objects, bike, light bulb, graphs)
[2]: https://gohugo.io/
[3]: https://themes.gohugo.io/
[4]: http://github.com/wereturtle/ghostwriter
[5]: https://opensource.com/sites/default/files/uploads/jclic_shortcode.png (JClic shortcode)
[6]: https://clic.xtec.cat/legacy/en/index.html
[7]: http://december.com/html/4/element/iframe.html

View File

@@ -0,0 +1,170 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How I use Python to map the global spread of COVID-19)
[#]: via: (https://opensource.com/article/20/4/python-map-covid-19)
[#]: author: (AnuragGupta https://opensource.com/users/999anuraggupta)
How I use Python to map the global spread of COVID-19
======
Create a color coded geographic map of the potential spread of the virus
using these open source scripts.
![Globe up in the clouds][1]
The spread of disease is a real concern for a world in which global travel is commonplace. A few organizations track significant epidemics (and any pandemic), and fortunately, they publish their work as open data. The raw data can be difficult for humans to process, though, and that's why data science is so vital. For instance, it could be useful to visualize the worldwide spread of COVID-19 with Python and Pandas.
It can be hard to know where to start when you're faced with large amounts of raw data. The more you do it, however, the more patterns begin to emerge. Here's a common scenario, applied to COVID-19 data:
1. Download COVID-19 country spread daily data into a Pandas DataFrame object from GitHub. For this, you need the Python Pandas library.
2. Process and clean the downloaded data and make it suitable for visualizing. The downloaded data (as you will see for yourself) is in quite good condition. The one problem with this data is that it uses the names of countries, but it's better to use three-digit ISO 3 codes. To generate the three-digit ISO 3 codes, use a small Python library called pycountry. Having generated these codes, you can add an extra column to our DataFrame and populate it with these codes.
3. Finally, for the visualization, use the **express** module of a library called Plotly. This article uses what are called choropleth maps (available in Plotly) to visualize the worldwide spread of the disease.
### Step 1: Corona data
We will download the latest corona data from:
<https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv>
We will load the data directly into a Pandas DataFrame. Pandas provides a function, **read_csv()**, which can take a URL and return a DataFrame object as shown below:
```
import pycountry
import plotly.express as px
import pandas as pd
URL_DATASET = r'<https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv>'
df1 = pd.read_csv(URL_DATASET)
print(df1.head(3))  # Get first 3 entries in the dataframe
print(df1.tail(3))  # Get last 3 entries in the dataframe
```
The screenshot of output (on Jupyter) is:
![Jupyter screenshot][2]
From output, you can see that the DataFrame (df1) has the following columns:
1. Date
2. Country
3. Confirmed
4. Recovered
5. Dead
Further, you can see that the **Date** column has entries starting from January 22 to March 31. This database is updated daily, so you will get the current values.
### Step 2: Cleaning and modifying the data frame
We need to add another column to this DataFrame, which has the three-letter ISO alpha-3 codes. To do this, I followed these steps:
1. Create a list of all countries in the database. This was required because in the **df**, in the column **Country**, each country was figuring for each date. So in effect, the **Country** column had multiple entries for each country. To do this, I used the **unique().tolist()** functions.
2. Then I took a dictionary **d_country_code** (initially empty) and populated it with keys consisting of country names and values consisting of their three-letter ISO codes.
3. To generate the three-letter ISO code for a country, I used the function **pycountry.countries.search_fuzzy(country)**. You need to understand that the return value of this function is a "list of **Country** objects." I passed the return value of this function to a name country_data. Further, in this list of objects, the first object i.e., at index 0, is the best fit. Further, this **\** object has an attribute **alpha_3**. So, I can "access" the 3 letter ISO code by using **country_data[0].alpha_3**. However, it is possible that some country names in the DataFrame may not have a corresponding ISO code (For example, disputed territories). So, for such countries, I gave an ISO code of "i.e. a blank string. Further, you need to wrap this code in a try-except block. The statement: **print(_could not add ISO 3 code for -&gt;'_, country)** will give a printout of those countries for which the ISO 3 codes could not be found. In fact, you will find such countries as shown with white color in the final output.
4. Having got the three-letter ISO code for each country (or an empty string for some), I added the country name (as key) and its corresponding ISO code (as value) to the dictionary **d_country_code**. For adding these, I used the **update()** method of the Python dictionary object.
5. Having created a dictionary of country names and their codes, I added them to the DataFrame using a simple for loop.
### Step 3: Visualizing the spread using Plotly
A choropleth map is a map composed of colored polygons. It is used to represent spatial variations of a quantity. We will use the express module of Plotly conventionally called **px**. Here we show you how to create a choropleth map using the function: **px.choropleth**.
The signature of this function is:
```
`plotly.express.choropleth(data_frame=None, lat=None, lon=None, locations=None, locationmode=None, geojson=None, featureidkey=None, color=None, hover_name=None, hover_data=None, custom_data=None, animation_frame=None, animation_group=None, category_orders={}, labels={}, color_discrete_sequence=None, color_discrete_map={}, color_continuous_scale=None, range_color=None, color_continuous_midpoint=None, projection=None, scope=None, center=None, title=None, template=None, width=None, height=None)`
```
The noteworthy points are that the **choropleth()** function needs the following things:
1. A geometry in the form of a **geojson** object. This is where things are a bit confusing and not clearly mentioned in its documentation. You may or may not provide a **geojson** object. If you provide a **geojson** object, then that object will be used to plot the earth features, but if you don't provide a **geojson** object, then the function will, by default, use one of the built-in geometries. (In our example here, we will use a built-in geometry, so we won't provide any value for the **geojson** argument)
2. A pandas DataFrame object for the attribute **data_frame**. Here we provide our DataFrame ie **df1** we created earlier.
3. We will use the data of **Confirmed** column to decide the color of each country polygon.
4. Further, we will use the **Date** column to create the **animation_frame**. Thus as we slide across the dates, the colors of the countries will change as per the values in the **Confirmed** column.
The complete code is given below:
```
import pycountry
import plotly.express as px
import pandas as pd
# ----------- Step 1 ------------
URL_DATASET = r'<https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv>'
df1 = pd.read_csv(URL_DATASET)
# print(df1.head) # Uncomment to see what the dataframe is like
# ----------- Step 2 ------------
list_countries = df1['Country'].unique().tolist()
# print(list_countries) # Uncomment to see list of countries
d_country_code = {}  # To hold the country names and their ISO
for country in list_countries:
    try:
        country_data = pycountry.countries.search_fuzzy(country)
        # country_data is a list of objects of class pycountry.db.Country
        # The first item  ie at index 0 of list is best fit
        # object of class Country have an alpha_3 attribute
        country_code = country_data[0].alpha_3
        d_country_code.update({country: country_code})
    except:
        print('could not add ISO 3 code for -&gt;', country)
        # If could not find country, make ISO code ' '
        d_country_code.update({country: ' '})
# print(d_country_code) # Uncomment to check dictionary  
# create a new column iso_alpha in the df
# and fill it with appropriate iso 3 code
for k, v in d_country_code.items():
    df1.loc[(df1.Country == k), 'iso_alpha'] = v
# print(df1.head)  # Uncomment to confirm that ISO codes added
# ----------- Step 3 ------------
fig = px.choropleth(data_frame = df1,
                    locations= "iso_alpha",
                    color= "Confirmed",  # value in column 'Confirmed' determines color
                    hover_name= "Country",
                    color_continuous_scale= 'RdYlGn',  #  color scale red, yellow green
                    animation_frame= "Date")
fig.show()
```
The output is something like the following:
![Map][3]
You can download and run the [complete code][4].
To wrap up, here are some excellent resources on choropleth in Plotly:
* <https://github.com/plotly/plotly.py/blob/master/doc/python/choropleth-maps.md>
* [https://plotly.com/python/reference/#choropleth][5]
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/python-map-covid-19
作者:[AnuragGupta][a]
选题:[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/999anuraggupta
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/cloud-globe.png?itok=_drXt4Tn (Globe up in the clouds)
[2]: https://opensource.com/sites/default/files/uploads/jupyter_screenshot.png (Jupyter screenshot)
[3]: https://opensource.com/sites/default/files/uploads/map_2.png (Map)
[4]: https://github.com/ag999git/jupyter_notebooks/blob/master/corona_spread_visualization
[5]: tmp.azs72dmHFd#choropleth

View File

@@ -0,0 +1,273 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to take advantage of Linux's extensive vocabulary)
[#]: via: (https://www.networkworld.com/article/3539011/how-to-takke-advantage-of-linuxs-extensive-vocabulary.html)
[#]: author: (Sandra Henry-Stocker https://www.networkworld.com/author/Sandra-Henry_Stocker/)
How to take advantage of Linux's extensive vocabulary
======
Linux systems don't only know a lot of words, it has commands that can help you use them by finding words that are on the tip of your tongue or fixing your typos.
Sandra Henry-Stocker
While you might not think of Linux as a writing tutor, it does have some commendable language skills at least when it comes to English. While the average American probably has a vocabulary between 20,000 and 50,000 words, Linux can claim over 100,000 words (spellings, not definitions). And you can easily put this vocabulary to work for you in a number of ways. Lets look at how Linux can help with your word challenges.
### Help with finding words
First, lets focus on finding words.If you use the **wc** command to count the number of words in the **/usr/share/dict/words** file on your system, you should see something like this:
```
$ wc -l /usr/share/dict/words
102402 /usr/share/dict/words
```
As you can see, the **words** file on this system contains 102,402 words. So, when youre trying to nail down just the right word and are having trouble, you stand a good chance of finding it on your system by remembering (or guessing at) some part of it. But you'll need a little help narrowing down those 102,402 words to a group worth your time to review. In this command, were looking for words that start with the letters “revi”.
[[Get regularly scheduled insights by signing up for Network World newsletters.]][1]
```
$ grep ^reviv /usr/share/dict/words
revival
revival's
revivalist
revivalist's
revivalists
revivals
revive
revived
revives
revivification
revivification's
revivified
revivifies
revivify
revivifying
reviving
```
Thats sixteen words that start with the string “revi”. The **^** character represents the beginning of the word and, as you might have suspected, each word in the file is on a line by itself.
A good number of the words in the **/usr/share/dict/words** file are names. If you want to  find words regardless of whether they're capitalized, add the **-i** (ignore case) option to your **grep** command.
```
$ grep -i ^wool /usr/share/dict/words
Woolf
Woolf's
Woolite
Woolite's
Woolongong
Woolongong's
Woolworth
Woolworth's
wool
...
```
You can also look for words that end in or contain a certain string of letters. In this next command, we look for words that contain the string “nativ” at any location.
```
$ grep 'nativ' /usr/share/dict/words
alternative
alternative's
alternatively
alternatives
imaginative
imaginatively
native
native's
natives
nativities
nativity
nativity's
nominative
nominative's
nominatives
unimaginative
```
In this next command, we look for words that end in “emblance”, the **$** character representing the end of the line. Only two words in the **words** file fit the bill.
[][2]
```
$ grep 'emblance$' /usr/share/dict/words
resemblance
semblance
```
If we, for some reason, want to find words with exactly 21 letters, we could use this command:
```
$ grep '^.....................$' /usr/share/dict/words
counterintelligence's
electroencephalograms
electroencephalograph
```
On the other hand, making sure we've typed the correct number of dots can be tedious. This next command is little easier to manage:
```
$ grep -E '^[[:alpha:]]{21}$' /usr/share/dict/words
electroencephalograms
electroencephalograph
```
This command does the same thing:
```
$ grep -E '^\w{21}$' /usr/share/dict/words
electroencephalograms
electroencephalograph
```
The one important difference between these commands is that the one with the dots matches any string of 21 characters. The two specifying "alpha" or "\w" only match letters, so they find only two matching words.
Now lets look for words that contain 20 letters (or more) in a row.
```
$ grep -E '(\w{20})' /usr/share/dict/words
Andrianampoinimerina
Andrianampoinimerina's
counterrevolutionaries
counterrevolutionary
counterrevolutionary's
electroencephalogram
electroencephalogram's
electroencephalograms
electroencephalograph
electroencephalograph's
electroencephalographs
uncharacteristically
```
That command returns words with apostrophes because they contain 20 letters in a row before they get to that point.
Next, well check out words with 21 or more characters. The 1 and 20 in combination with the **v** (invert) option in this command cause **grep** to skip over words with anywhere from 1 to 20 characters.
```
$ grep -vwE '\w{1,20}' /usr/share/dict/words
counterrevolutionaries
electroencephalograms
electroencephalograph
electroencephalographs
```
In this next command, we look for words that start with “ex” and have four additional letters.
```
$ grep '^ex.\{4\}$' /usr/share/dict/words
exacts
exalts
exam's
exceed
excels
except
excess
excise
excite
excuse
```
In case you're curious, the **words** file on this system contains 43 such words:
```
$ grep '^ex.\{4\}$' /usr/share/dict/words | wc -l
43
```
To get help with spelling, you should try **aspell**. It can help you with individual words or run a spell check scan through an entire text file. In this first example, we ask **aspell** to help with a single word. It finds the word were after along with a couple other possibilities.
### Checking a word
```
$ aspell -a
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.7)
prolifferate <== entered word
& prolifferate 3 0: proliferate, proliferated, proliferates <== replacement options
```
If **aspell** doesnt provide a list of words, that means that the spelling you offered was correct. Here's an example:
```
$ aspell -a
@(#) International Ispell Version 3.1.20 (but really Aspell 0.60.7)
proliferate <== entered text
* <== no suggestions
```
Typing **^C** (control-c) exits **aspell**.
### Checking a file
When checking a file with **aspell**, you get suggestions for each misspelled word. When **aspell** spots typos, it highlights the misspelled words one at a time and gives you a chance to choose from a list of properly spelled words that are similar enough to the misspelled words to be good candidates for replacing them.
To start checking a file, type **aspell -c** followed by the file name.
```
$ aspell -c thesis
```
You'll see something like this:
```
This thesis focusses on …
1) focuses 6) Fosse's
2) focused 7) flosses
3) cusses 8) courses
4) fusses 9) focus
5) focus's 0) fuses
i) Ignore I) Ignore all
r) Replace R) Replace all
a) Add l) Add Lower
b) Abort x) Exit
```
Make your selection by pressing the key listed next to the word you want (1, 2, etc.) and **aspell** will replace the misspelled word in the file and move on to the next one if there are others. Notice that you also have options to replace the word by typing another one. Press "x" when you're done.
### Help with crossword puzzles
If youre working on a crossword puzzle and need to find a five-letter word that starts with a “d” and has a “u” as its fourth letter, you can use a command like this:
```
$ grep -i '^d..u.$' /usr/share/dict/words
datum
debug
debut
demur
donut
```
### Help with word scrambles
If youre working on a puzzle that requires you to de-scramble the letters in a string until you've found a proper word, you can offer the list of letters to grep like this example in which **grep** turns the letters "yxusonlia" into the word “anxiously”.
```
$ grep -P '^(?:([yxusonlia])(?!.*?\1)){9}$' /usr/share/dict/words
anxiously
```
Linuxs word skills are impressive and sometimes even fun. Whether you're hoping to find words you can't quite call to mind or get a little help cheating on word puzzles, Linux offers some clever options.
Join the Network World communities on [Facebook][3] and [LinkedIn][4] to comment on topics that are top of mind.
--------------------------------------------------------------------------------
via: https://www.networkworld.com/article/3539011/how-to-takke-advantage-of-linuxs-extensive-vocabulary.html
作者:[Sandra Henry-Stocker][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.networkworld.com/author/Sandra-Henry_Stocker/
[b]: https://github.com/lujun9972
[1]: https://www.networkworld.com/newsletters/signup.html
[2]: https://www.networkworld.com/blog/itaas-and-the-corporate-storage-technology/?utm_source=IDG&utm_medium=promotions&utm_campaign=HPE22140&utm_content=sidebar (ITAAS and Corporate Storage Strategy)
[3]: https://www.facebook.com/NetworkWorld/
[4]: https://www.linkedin.com/company/network-world

View File

@@ -0,0 +1,255 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Using Python to visualize COVID-19 projections)
[#]: via: (https://opensource.com/article/20/4/python-data-covid-19)
[#]: author: (AnuragGupta https://opensource.com/users/999anuraggupta)
Using Python to visualize COVID-19 projections
======
I'll demonstrate how to create two visualizations of the spread of a
virus across the globe, provided open data and using open source
libraries.
![Colorful sound wave graph][1]
Using [Python][2] and some graphing libraries, you can project the total number of confirmed cases of COVID-19, and also display the total number of deaths for a country (this article uses India as an example) on a given date. Humans sometimes need help interpreting and processing the meaning of data, so this article also demonstrates how to create an animated horizontal bar graph for five countries, showing the variation of cases by date.
### Projecting confirmed cases and deaths for India
This is done in three steps.
#### 1\. Download data
Scientific data isn't always open, but fortunately, many modern science and healthcare organizations are eager to share information with each other and the public. Data about COVID-19 cases is available online, and it's updated frequently.
To parse the data, you first must download it: <https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv>
Load the data directly into a Pandas DataFrame. Pandas provides a function, **read_csv()**, which can take a URL and give back a DataFrame object, as shown below:
```
import pycountry
import plotly.express as px
import pandas as pd
URL_DATASET = r'<https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv>'
df1 = pd.read_csv(URL_DATASET)
print(df1.head(3))  # Get first 3 entries in the dataframe
print(df1.tail(3))  # Get last 3 entries in the dataframe
```
The top row of the data set contains column names:
1. Date
2. Country
3. Confirmed
4. Recovered
5. Deaths
The output of the **head** query includes a unique identifier (not listed as a column) plus an entry for each column:
```
0 2020-01-22 Afghanistan 0 0 0
1 2020-01-22 Albania 0 0 0
1 2020-01-22 Algeria 0 0 0
```
The output of the **tail** query is similar but contains the tail end of the data set:
```
12597 2020-03-31 West Bank and Gaza 119 18 1
12598 2020-03-31 Zambia 35 0 0
12599 2020-03-31 Zimbabwe 8 0 1
```
From the output, you can see that the DataFrame (**df1**) has the following columns:
1. Date
2. Country
3. Confirmed
4. Recovered
5. Dead
Further, you can see that the **Date** column has entries starting from January 22 to March 31. This database is updated daily, so you will have current values.
#### 2\. Select data for India
In this step, we will select only those rows in the DataFrame that include India. This is shown in the script below:
```
#### ----- Step 2 (Select data for India)----
df_india = df1[df1['Country'] == 'India']
print(df_india.head(3))
```
#### 3\. Plot data
Here we create a bar chart. We will put the dates on the X-axis and the number of confirmed cases and the number of deaths on the Y-axis. There are a few noteworthy things about this part of the script which are as follows:
* The line of code: **plt.rcParams["_figure.figsize"_]=20,20** is meant only for Jupyter. So remove it if you are using some other IDE.
* Notice the line of code: **ax1 = plt.gca()**. To ensure that both the plots i.e. for confirmed cases as well as for deaths are plotted on the same graph, we need to give to the second graph the **ax** object of the plot. So we use **gca()** to do this. (By the way, 'gca' stands for 'get current axis').
The complete script is given below:
```
#  Author:- Anurag Gupta # email:- [999.anuraggupta@gmail.com][3]
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
#### ----- Step 1 (Download data)----
URL_DATASET = r'<https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv>'
df1 = pd.read_csv(URL_DATASET)
# print(df1.head(3))  # Uncomment to see the dataframe
#### ----- Step 2 (Select data for India)----
df_india = df1[df1['Country'] == 'India']
print(df_india.head(3))
#### ----- Step 3 (Plot data)----
# Increase size of plot
plt.rcParams["figure.figsize"]=20,20  # Remove if not on Jupyter
# Plot column 'Confirmed'
df_india.plot(kind = 'bar', x = 'Date', y = 'Confirmed', color = 'blue')
ax1 = plt.gca()
df_india.plot(kind = 'bar', x = 'Date', y = 'Deaths', color = 'red', ax = ax1)
plt.show()
```
The entire script is [available on GitHub][4].
### Creating an animated horizontal bar graph for five countries
Note for Jupyter: To run this in Jupyter as a dynamic animation rather than as a static png, you need to add a magic command at the beginning of your cell, namely: **%matplotlib notebook**. This will keep the figure alive instead of displaying a static png file and can hence also show animations. If you are on another IDE, remove this line.
#### 1\. Download the data
This step is exactly the same as in the previous script, and therefore, it need not be repeated.
#### 2\. Create a list of all dates
If you examine the data you downloaded, you notice that it has a column **Date**. Now, this column has a date value for each country. So the same date is occurring a number of times. We need to create a list of dates with only unique values. This will be used on the X-axis of our bar charts. We have a line of code like: **list_dates = df[_Date_].unique()**. The **unique()** method will pick up only the unique values for each date.
#### 3\. Pick five countries and create an **ax** object
Take a list of five countries. (You can choose whatever countries you prefer, or even increase or decrease the number of countries). I have also taken a list of five colors for the bars of each country. (You can change this too if you like). One important line of code here is: **fig, ax = plt.subplots(figsize=(15, 8))**. This is needed to create an **ax** object.
#### 4\. Write the call back function
If you want to do animation in Matplotlib, you need to create an object of a class called **matplotlib.animation.FuncAnimation**. The signature of this class is available online. The constructor of this class, apart from other parameters, also takes a parameter called **func**, and you have to give this parameter a callback function. So in this step, we will write the callback function, which is repeatedly called in order to render the animation.
#### 5\. Create **FuncAnimation** object
This step has partly been explained in the previous step.
Our code to create an object of this class is:
```
my_anim = animation.FuncAnimation(fig = fig, func = plot_bar,
                    frames= list_dates, blit=True,
                    interval=20)
```
The three important parameters to be given are:
* **fig**, which must be given a fig object, which we created earlier.
* **func**, which must be the call back function.
* **frames**, which must contain the variable on which the animation is to be done. Here in our case, it will be the list of dates we created earlier.
#### 6\. Save the animation to an mp4 file
You can save the animation created into an mp4 file. But for this you need **ffmpeg**. You can download this using pip by **pip install ffmpeg-python**, or using conda (on Jupyter) **install -c conda-forge ffmpeg**.
And finally, you can run the animation using **plt.show()**. Please note that on many platforms, the **ffmpeg** may not work properly and may require further "tweaking."
```
%matplotlib notebook
#  Author:- Anurag Gupta # email:- [999.anuraggupta@gmail.com][3]
import pandas as pd
import matplotlib.pyplot as plt
import matplotlib.animation as animation
from time import sleep
#### ---- Step 1:- Download data
URL_DATASET = r'<https://raw.githubusercontent.com/datasets/covid-19/master/data/countries-aggregated.csv>'
df = pd.read_csv(URL_DATASET, usecols = ['Date', 'Country', 'Confirmed'])
# print(df.head(3)) # uncomment this to see output
#### ---- Step 2:- Create list of all dates
list_dates = df['Date'].unique()
# print(list_dates) # Uncomment to see the dates
#### --- Step 3:- Pick 5 countries. Also create ax object
fig, ax = plt.subplots(figsize=(15, 8))
# We will animate for these 5 countries only
list_countries = ['India', 'China', 'US', 'Italy', 'Spain']
# colors for the 5 horizontal bars
list_colors = ['black', 'red', 'green', 'blue', 'yellow']
### --- Step 4:- Write the call back function
# plot_bar() is the call back function used in FuncAnimation class object
def plot_bar(some_date):
    df2 = df[df['Date'].eq(some_date)]
    ax.clear()
    # Only take Confirmed column in descending order
    df3 = df2.sort_values(by = 'Confirmed', ascending = False)
    # Select the top 5 Confirmed countries
    df4 = df3[df3['Country'].isin(list_countries)]
    # print(df4)  # Uncomment to see that dat is only for 5 countries
    sleep(0.2)  # To slow down the animation
    # ax.barh() makes a horizontal bar plot.
    return ax.barh(df4['Country'], df4['Confirmed'], color= list_colors)
###----Step 5:- Create FuncAnimation object---------
my_anim = animation.FuncAnimation(fig = fig, func = plot_bar,
                    frames= list_dates, blit=True,
                    interval=20)
### --- Step 6:- Save the animation to an mp4
# Place where to save the mp4. Give your file path instead
path_mp4 = r'C:\Python-articles\population_covid2.mp4'  
# my_anim.save(path_mp4, fps=30, extra_args=['-vcodec', 'libx264'])
my_anim.save(filename = path_mp4, writer = 'ffmpeg',
             fps=30,
             extra_args= ['-vcodec', 'libx264', '-pix_fmt', 'yuv420p'])
plt.show()
```
The complete script is [available on GitHub][5].
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/python-data-covid-19
作者:[AnuragGupta][a]
选题:[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/999anuraggupta
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/colorful_sound_wave.png?itok=jlUJG0bM (Colorful sound wave graph)
[2]: https://opensource.com/resources/python
[3]: mailto:999.anuraggupta@gmail.com
[4]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_india
[5]: https://raw.githubusercontent.com/ag999git/jupyter_notebooks/master/corona_bar_animated

View File

@@ -0,0 +1,139 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (4 open source chat applications you should use right now)
[#]: via: (https://opensource.com/article/20/4/open-source-chat)
[#]: author: (Sudeshna Sur https://opensource.com/users/sudeshna-sur)
4 open source chat applications you should use right now
======
Collaborating remotely is an essential capability now, making open
source real-time chat an essential piece of your toolbox.
![Chat bubbles][1]
The first thing we usually do after waking up in the morning is to check our cellphone to see if there are important messages from our colleagues and friends. Whether or not it's a good idea, this behavior has become part of our daily lifestyle.
> _"Man is a rational animal. He can think up a reason for anything he wants to believe."_
> _ Anatole France_
No matter the soundness of the reason, we all have a suite of communication tools—email, phone calls, web-conferencing tools, or social networking—we use on a daily basis. Even before COVID-19, working from home already made these communication tools an essential part of our world. And as the pandemic has made working from home the new normal, we're facing unprecedented changes to how we communicate, which makes these tools not merely essential but now required.
### Why chat?
When working remotely as a part of a globally distributed team, we must have a collaborative environment. Chat applications play a vital role in helping us stay connected. In contrast to email, chat applications provide fast, real-time communications with colleagues around the globe.
There are a lot of factors involved in choosing a chat application. To help you pick the right one for you, in this article, I'll explore four open source chat applications and one open source video-communication tool (for when you need to be "face-to-face" with your colleagues), then outline some of the features you should look for in an effective communication application.
### 4 open source chat apps
#### Rocket.Chat
![Rocket.Chat][2]
[Rocket.Chat][3] is a comprehensive communication platform that classifies channels as public (open to anyone who joins) or private (invitation-only) rooms. You can also send direct messages to people who are logged in; share documents, links, photos, videos, and GIFs; make video calls; and send audio messages without leaving the platform.
Rocket.Chat is free and open source, but what makes it unique is its self-hosted chat system. You can download it onto your server, whether it's an on-premises server or a virtual private server on a public cloud.
Rocket.Chat is completely free, and its [source code][4] is available on GitHub. Many open source projects use Rocket.Chat as their official communication platform. It is constantly evolving with new features and improvements.
The things I like the most about Rocket.Chat are its ability to be customized according to user requirements and that it uses machine learning to do automatic, real-time message translation between users. You can also download Rocket.Chat for your mobile device and use it on the go.
#### IRC
![IRC on WeeChat 0.3.5][5]
[Internet Relay Chat (IRC)][6] is a real-time, text-based form of communication. Although it's one of the oldest forms of electronic communication, it remains popular among many well-known software projects.
IRC channels are discrete chat rooms. It allows you to have conversations with multiple people in an open channel or chat with someone privately one-on-one. If a channel name starts with a #, you can assume it to be official, whereas chat rooms that begin with ## are unofficial and usually casual.
[Getting started with IRC][7] is easy. Your IRC handle or nickname is what allows people to find you, so it must be unique. But your choice of IRC client is completely your decision. If you want a more feature-rich application than a standard IRC client, you can connect to IRC with [Riot.im][8].
Given its age, why should you still be on IRC? For one reason, it remains the home for many of the free and open source projects we depend on. If you want to participate in open source software and communities, IRC is the option to get started.
#### Zulip
![Zulip][9]
[Zulip][10] is a popular group-chat application that follows the topic-based threading model. In Zulip, you subscribe to streams, just like in IRC channels or Rocket.Chat. But each Zulip stream opens a topic that is unique, which helps you track conversations later, thus making it more organized.
Like other platforms, it supports emojis, inline images, video, and tweet previews. It also supports LaTeX for sharing math formulas or equations and Markdown and syntax highlighting for sharing code.
Zulip is cross-platform and offers APIs for building your own integrations. Something I especially like about Zulip is its integration feature with GitHub: if I'm working on an issue, I can use Zulip's marker to link back to the pull request ID.
Zulip is open source (you can access its [source code][11] on GitHub) and free to use, but it has paid offerings for on-premises support, [LDAP][12] integration, and more storage.
#### Let's Chat
![Let's Chat][13]
[Let's Chat][14] is a self-hosted chat solution for small teams. It runs on Node.js and MongoDB and can be deployed to local servers or hosted services with a few clicks. It's free and open source, with the [source code][15] available on GitHub.
What differentiates Let's Chat from other open source chat tools is its enterprise features: it supports LDAP and [Kerberos][16] authentication. It also has all the features a new user would want: you can search message history in the archives and tag people with mentions like @username.
What I like about Let's Chat is that it has private and password-protected rooms, image embeds, GIPHY support, and code pasting. It is constantly evolving and adding more features to its bucket.
### Bonus: Open source video chat with Jitsi
![Jitsi][17]
Sometimes text chat isn't enough, and you need to talk to someone face-to-face. In times like these, when in-person meetings aren't an option, video chat is the best alternative. [Jitsi][18] is a complete, open source, multi-platform, and WebRTC-compliant videoconferencing tool.
Jitsi began with Jitsi Desktop and has evolved into multiple [projects][19], including Jitsi Meet, Jitsi Videobridge, jibri, and libjitsi, with [source code][20] published for each on GitHub.
Jitsi is secure and scalable and supports advanced video-routing concepts such as simulcast and bandwidth estimation, as well as typical capabilities like audio, recording, screen-sharing, and dial-in features. You can set a password to secure your video-chat room and protect it against intruders, and it also supports live-streaming over YouTube. You can also build your own Jitsi server and host it on-premises or on a virtual private server, such as a Digital Ocean Droplet.
What I like most about Jitsi is that it is free and frictionless; anyone can start a meeting in no time by visiting [meet.jit.si][21], and users are good to go with no need for registration or installation. (However, registration gives you calendar integrations.) This low-barrier-to-entry alternative to popular videoconferencing services is helping Jitsi's popularity spread rapidly.
### Tips for choosing a chat application
The variety of open source chat applications can make it hard to pick one. The following are some general guidelines for choosing a chat app.
* Tools that have an interactive interface and simple navigation are ideal.
* It's better to look for a tool that has great features and allows people to use it in various ways.
* Integrations with tools you use can play an important role in your decision. Some tools have great and seamless integrations with GitHub, GitLab, and certain applications, which is a useful feature.
* It's convenient to use tools that have a pathway to hosting on cloud-based services.
* The security of the chat service should be taken into account. The ability to host services on a private server is necessary for many organizations and individuals.
* It's best to select communication tools that have rich privacy settings and allow for both private and public chat rooms.
Since people are more dependent than ever on online services, it is smart to have a backup communication platform available. For example, if a project is using Rocket.Chat, it should also have the option to hop into IRC, if necessary. Since these services are continuously updating, you may find yourself connected to multiple channels, and this is where integration becomes so valuable.
Of the different open source chat services available, which ones do you like and use? How do these tools help you work remotely? Please share your thoughts in the comments.
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/open-source-chat
作者:[Sudeshna Sur][a]
选题:[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/sudeshna-sur
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/talk_chat_communication_team.png?itok=CYfZ_gE7 (Chat bubbles)
[2]: https://opensource.com/sites/default/files/uploads/rocketchat.png (Rocket.Chat)
[3]: https://rocket.chat/
[4]: https://github.com/RocketChat/Rocket.Chat
[5]: https://opensource.com/sites/default/files/uploads/irc.png (IRC on WeeChat 0.3.5)
[6]: https://en.wikipedia.org/wiki/Internet_Relay_Chat
[7]: https://opensource.com/article/16/6/getting-started-irc
[8]: https://opensource.com/article/17/5/introducing-riot-IRC
[9]: https://opensource.com/sites/default/files/uploads/zulip.png (Zulip)
[10]: https://zulipchat.com/
[11]: https://github.com/zulip/zulip
[12]: https://en.wikipedia.org/wiki/Lightweight_Directory_Access_Protocol
[13]: https://opensource.com/sites/default/files/uploads/lets-chat.png (Let's Chat)
[14]: https://sdelements.github.io/lets-chat/
[15]: https://github.com/sdelements/lets-chat
[16]: https://en.wikipedia.org/wiki/Kerberos_(protocol)
[17]: https://opensource.com/sites/default/files/uploads/jitsi_0_0.jpg (Jitsi)
[18]: https://jitsi.org/
[19]: https://jitsi.org/projects/
[20]: https://github.com/jitsi
[21]: http://meet.jit.si

View File

@@ -0,0 +1,283 @@
[#]: collector: (lujun9972)
[#]: translator: ( )
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (16 Things to do After Installing Ubuntu 20.04)
[#]: via: (https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
16 Things to do After Installing Ubuntu 20.04
======
_**Here is a list of tweaks and things to do after installing Ubuntu 20.04, to get a smoother and better desktop Linux experience.**_
[Ubuntu 20.04 LTS brings plenty of new features][1] and visual changes. If you choose to install Ubuntu 20.04, let me show you a few recommended steps that you can follow to get started with it.
### 16 Things to do after installing Ubuntu 20.04 LTS “Focal Fossa”
![][2]
The steps I am going to mention here are my recommendation. You may ignore a few customization or tweaks if they dont suit your need and interest.
Similarly, some steps may seem too simple but essential for someone completely new to Ubuntu.
A number of suggestions here are suited for the default Ubuntu 20.04 with GNOME desktop. So please check [which Ubuntu version][3] and [which desktop environment][4] you are using.
Lets get started with the list of things to do after installing Ubuntu 20.04 LTS codenamed Focal Fossa.
#### 1\. Get your system ready by updating and enabling additional repos
The first thing you should do after installing Ubuntu or any other Linux distribution is to update it. Linux works on a local database of available packages. And this cache needs to be synced in order for you to be able to install any software.
It is very easy to update Ubuntu. You can run the software updater from the menu (press Windows key and search for software updater):
![Software Updater in Ubuntu 20.04][5]
You may also use the following command in the terminal to update your system:
```
sudo apt update && sudo apt upgrade
```
Next, you should make sure that you have [universe and multiverse repositories enabled][6]. Youll have access to a lot more software with these repositories. I also recommend reading about [Ubuntu repositories][6] to learn the basic concept behind it.
Search for Software &amp; Updates in the menu:
![Software & Updates Settings][7]
Make sure to check the boxes in front of the repositories:
![Enable additional repositories][8]
#### 2\. Install media codecs to play MP3, MPEG4 and other media files
If you want to play media files like MP3, MPEG4, AVI etc, youll need to install media codecs. Ubuntu doesnt install it by default because of copyright issues in various countries.
As an individual, you can install these media codecs easily [using the Ubuntu Restricted Extra package][9]. This will install media codecs, Adobe Flash player and [Microsoft True Type Fonts in your Ubuntu system][10].
You can install it by [clicking this link][11] (it will asked to be open in software center) or use this command:
```
sudo apt install ubuntu-restricted-extras
```
If you encounter the EULA or the license screen, remember to use the tab key to select between the options and then hit enter to confirm your choice.
![Press tab to select OK and press enter][12]
#### 3\. Install software from the software center or the web
Now that you have set up the repositories and updated the package cache, you should start installing software that you need.
There are several ways of [installing applications in Ubuntu][13]. The easiest and the official way is to use the Software Center.
![Ubuntu Software Center][14]
If you want some recommendation about software, please refer to this extensive [list of Ubuntu applications for different purposes][15].
Some software vendors provide .deb files to easily install their application. You may get the deb files from their website. For example, to [install Google Chrome on Ubuntu][16], you can get the deb file from its website and double click on it to start the installation.
#### 4\. Enjoy gaming with Steam Proton and GameMode
[Gaming on Linux][17] has come a long way. You are not restricted to a handful of games included by default. You can [install Steam on Ubuntu][18] and enjoy a good number of games.
[Steams new P][19][r][19][oton project][19] enables you to play a number of Windows-only games on Linux. In addition to that, Ubuntu 20.04 comes with [Feral Interactives GameMode][20] installed by default.
The GameMode automatically adjust Linux system performance to give more priority to games than other background processes.
This means some games that support the GameMode (like [Rise of Tomb Raiders][21]) should have improved performance on Ubuntu.
#### 5\. Manage auto-updates (for intermediate and experts)
Recently, Ubuntu has started to automatically download and install security updates that are essential to your system. This is a security feature as a regular user, you should leave it as it is,
But if you like to do everything on your own and this auto-update is frequently leading you to [“Unable to lock the administration directory” error][22], maybe you can change the auto updates behavior.
You can opt for the Show immediately so that it notifies you of security updates as soon as they are available instead of automatically installing.
![Control the auto updates settings][23]
#### 6\. Control automatic suspend and screenlock for laptops
If you are using Ubuntu 20.04 on a laptop then you may want to pay attention to a few power and screenlock settings.
If your laptop is on battery mode, Ubuntu will suspend the system after 20 minutes of inactivity. This is done to save battery power. Personally, I dont like it and thus I disable it.
Similarly, if you leave your system for a few minutes, it automatically locks the screen. I dont like this behavior as well so I prefer disabling it.
![Power Settings in Ubuntu 20.04][24]
#### 7\. Enjoy dark mode
One of the [most talked about features of Ubuntu 20.04][25] is the dark mode. You can enable the dark mode by going into Settings and selecting it under Appearance section.
![Enable Dark Theme Ubuntu][26]
You may have to do some [additional tweaking to get full dark mode in Ubuntu 20.04][27].
#### 8\. Control desktop icons and launcher
If you want a minimal looking desktop, you can disable the icons on the desktop. You can also disable the launcher from the left side and the appindicators in the top panel.
All this can be controlled via the new GNOME Extensions that is already available by default.
![][28]
By the way, you can also change the position of the launcher to the bottom or to the right by going to the Settings-&gt;Appearance.
#### 9\. Use emojis (smileys) and special characters or disable it from the search
Ubuntu provides an easy way to use smiley or the emoticons. There is a dedicated application called Characters installed by default. It basically gives you [Unicode][29] of the emojis.
Not only emojis, you can use it to get the unicode for French, German, Russian and Latin characters. Clicking on the symbol gives you the opportunity to copy the unicode and when you paste this code, your chosen symbol should be typed.
![Emoji Ubuntu][30]
Youll find these special characters and emoticons appearing in the desktop search as well. You can copy them from the search results as well.
![Emojis appear in desktop search][31]
If you dont want to see them in search results, you should disable their access to the search feature. The next section discuss how to do that.
#### 10\. Master the desktop search
The GNOME desktop has a powerful search feature. Most people use it for searching installed applications but it is more than just that.
Press the super key (Windows key) and search for something. It will show any applications that matches that search term, followed by system settings and matching applications available in the software center.
![Desktop search][32]
Not only that, the search can also find text inside files. If you are using the calendar, it can also find your meetings and reminders. You can even do quick calculations in the search and copy its result.
![Quick Calculations Ubuntu Search][33]
You can control what can be searched and in which order by going into Settings.
![][34]
#### 11\. Use nightlight feature to reduce eye strain at night
If you use your computer or smartphone at night, you should use the night light feature to reduce eye strain. I feel that it helps a lot.
The night light feature adds a yellow tint to the screen which is less pinching than the white light.
You can enable night light in the Settings -&gt; Displays and switching to Night Light tab. You can set the yellowness as per your liking.
![Nightlight feature][35]
#### 12\. Got a 2K/4K screen? Use fractional scaling to get bigger icons and fonts
If you feel that the icons, fonts, folders everything looks too small on your HiDPI screen, you can take advantage of the fractional scaling.
Enabling fractional scaling gives you more options to increase the size between 100% to 200%. You can choose the scaling size that suits your preference.
![Enable fractional scaling from Settings -> Displays][36]
#### 13\. Explore GNOME Extensions to extend the usability of GNOME desktop
The GNOME desktop has tiny plugins or add-ons called Extensions. You should [learn to use GNOME extensions][37] to extend the usability of your system.
As you can see in the image below, the weather extension shows the weather information in the top panel. A tiny but useful thing. You may also take a look at some of [best GNOME extensions][38] here. Dont install all of them, use only those that are useful to you.
![Weather Extension][39]
#### 14\. Enable do not disturb mode and focus on work
If you want to concentrate on work, disabling desktop notifications would come handy. You can easily enable do not disturb mode and mute all notifications.
![Enable Do Not Disturb to get rid of desktop notifications][40]
These notifications will still be in the message tray so that you can read them later but they wont pop up on the desktop anymore.
#### 15\. Clean your system
This is something you dont need to do right after installing Ubuntu. But keeping it in mind will help you.
Over the time, your system will have significant amount of packages that wont be needed anymore. You can remove them all in one go with this command:
```
sudo apt autoremove
```
There are other [ways to clean Ubuntu to free disk space][41] but this is the easiest and safest.
#### 16\. Tweak and customize the GNOME desktop to your liking
I highly recommend [installing GNOME Tweaks tool][42]. This will give you access to a few additional settings to tweak.
![Gnome Tweaks Tool][43]
For example, you can [display battery percentage][44], [fix right click in touchpad issue][45], change shell theme, change mouse pointer speed, display date and week numbers, change application window behavior etc.
There is no end to customization and I cannot probably most of them here. This is why I recommend [reading these articles][42] about [customizing GNOME desktop][46].
You can also [install new themes in Ubuntu][47] though personally, I like the default theme in this release. This is the first time that I have stuck with the default icons and theme in an Ubuntu release.
#### What do you do after installing Ubuntu?
If you are an Ubuntu beginner, I recommend [going through this collection of Ubuntu tutorials][48] to get started with it.
So these were my recommendations. What are the steps you follow after installing Ubuntu? Share your favorite things and I might update this article with your suggestions.
--------------------------------------------------------------------------------
via: https://itsfoss.com/things-to-do-after-installing-ubuntu-20-04/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/ubuntu-20-04-release-features/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/things-to-do-after-installing-ubuntu-20-04.jpg?ssl=1
[3]: https://itsfoss.com/how-to-know-ubuntu-unity-version/
[4]: https://itsfoss.com/find-desktop-environment/
[5]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updater-ubuntu-20-04.jpg?ssl=1
[6]: https://itsfoss.com/ubuntu-repositories/
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-updates-settings-ubuntu-20-04.jpg?ssl=1
[8]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/extra-repositories-ubuntu-20.jpg?ssl=1
[9]: https://itsfoss.com/install-media-codecs-ubuntu/
[10]: https://itsfoss.com/install-microsoft-fonts-ubuntu/
[11]: https://ubuntu-restricted-extras/
[12]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/02/installing_ubuntu_restricted_extras.jpg?ssl=1
[13]: https://itsfoss.com/remove-install-software-ubuntu/
[14]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/software-center-ubuntu-20.png?resize=800%2C509&ssl=1
[15]: https://itsfoss.com/best-ubuntu-apps/
[16]: https://itsfoss.com/install-chrome-ubuntu/
[17]: https://itsfoss.com/linux-gaming-guide/
[18]: https://itsfoss.com/install-steam-ubuntu-linux/
[19]: https://itsfoss.com/steam-play/
[20]: https://github.com/FeralInteractive/gamemode
[21]: https://en.wikipedia.org/wiki/Rise_of_the_Tomb_Raider
[22]: https://itsfoss.com/could-not-get-lock-error/
[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/auto-updates-ubuntu.png?resize=800%2C361&ssl=1
[24]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/power-settings-ubuntu-20-04.png?fit=800%2C591&ssl=1
[25]: https://www.youtube.com/watch?v=lpq8pm_xkSE
[26]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/enable-dark-theme-ubuntu.png?ssl=1
[27]: https://itsfoss.com/dark-mode-ubuntu/
[28]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/disable-dock-ubuntu-20-04.png?ssl=1
[29]: https://en.wikipedia.org/wiki/List_of_Unicode_characters
[30]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/emoji-ubuntu.jpg?ssl=1
[31]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/emojis-desktop-search-ubuntu.jpg?ssl=1
[32]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-desktop-search-1.jpg?ssl=1
[33]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/quick-calculations-ubuntu-search.jpg?ssl=1
[34]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/search-settings-control-ubuntu.png?resize=800%2C534&ssl=1
[35]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/nightlight-ubuntu-20-04.png?ssl=1
[36]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/fractional-scaling-ubuntu.jpg?ssl=1
[37]: https://itsfoss.com/gnome-shell-extensions/
[38]: https://itsfoss.com/best-gnome-extensions/
[39]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/weather-extension-ubuntu.jpg?ssl=1
[40]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/03/do-not-distrub-option-ubuntu-20-04.png?ssl=1
[41]: https://itsfoss.com/free-up-space-ubuntu-linux/
[42]: https://itsfoss.com/gnome-tweak-tool/
[43]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/gnome-tweaks-tool-ubuntu-20-04.png?fit=800%2C551&ssl=1
[44]: https://itsfoss.com/display-battery-ubuntu/
[45]: https://itsfoss.com/fix-right-click-touchpad-ubuntu/
[46]: https://itsfoss.com/gnome-tricks-ubuntu/
[47]: https://itsfoss.com/install-themes-ubuntu/
[48]: https://itsfoss.com/getting-started-with-ubuntu/

View File

@@ -0,0 +1,215 @@
[#]: collector: (lujun9972)
[#]: translator: (lxbwolf)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Inlining optimisations in Go)
[#]: via: (https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go)
[#]: author: (Dave Cheney https://dave.cheney.net/author/davecheney)
Inlining optimisations in Go
======
This is a post about how the Go compiler implements inlining and how this optimisation affects your Go code.
_n.b._ This article focuses on _gc_, the de facto Go compiler from [golang.org][1]. The concepts discussed apply broadly to other Go compilers like gccgo and llgo but may differ in implementation and efficacy.
### What is inlining?
Inlining is the act of combining smaller functions into their respective callers. In the early days of computing this optimisation was typically performed by hand. Nowadays inlining is one of a class of fundamental optimisations performed automatically during the compilation process.
### Why is inlining important?
Inlining is important for two reasons. The first is it removes the overhead of the function call itself. The second is it permits the compiler to more effectively apply other optimisation strategies.
#### Function call overhead
Calling a function[1][2] in any language carries a cost. There are the overheads of marshalling parameters into registers or onto the stack (depending on the ABI) and reversing the process on return. Invoking a function call involves jumping the program counter from one point in the instruction stream to another which can cause a pipeline stall. Once inside the function there is usually some preamble required to prepare a new stack frame for the function to execute and a similar epilogue needed to retire the frame before returning to the caller.
In Go a function call carries additional costs to support dynamic stack growth. On entry the amount of stack space available to the goroutine is compared to the amount required for the function. If insufficient stack space is available, the preamble jumps into the runtime logic that grows the stack by copying it to a new, larger, location. Once this is done the runtime jumps back to the start of the original function, the stack check is performed again, which now passes, and the call continues. In this way goroutines can start with a small stack allocation which grows only when needed.[2][3]
This check is cheaponly a few instructionsand because goroutine stacks grows geometrically the check rarely fails. Thus, the branch prediction unit inside a modern processor can hide the cost of the stack check by assuming it will always be successful. In the case where the processor mis-predicts the stack check and has to discard the work done while it was executing speculatively, the cost of the pipeline stall is relatively small compared to the cost of the work needed for the runtime to grow a goroutines stack.
While the overhead of the generic and Go specific components of each function call are well optimised by modern processors using speculative execution techniques, those overheads cannot be entirely eliminated, thus each function call carries with it a performance cost over and above the time it takes to perform useful work. As a function calls overhead is fixed, smaller functions pay a larger cost relative to larger ones because they tend to do less useful work per invocation.
The solution to eliminating these overheads must therefore be to eliminate the function call itself, which the Go compiler does, under certain conditions, by replacing the call to a function with the contents of the function. This is known as _inlining_ because it brings the body of the function in line with its caller.
#### Improved optimisation opportunities
Dr. Cliff Click describes inlining as _the_ optimisation performed by modern compilers as it forms the basis for optimisations like constant proportion and dead code elimination. In effect, inlining allows the compiler to _see_ _furthe_r, allowing it to observe, in the context that a particular function is being called, logic that can be further simplified or eliminated entirely. As inlining can be applied recursively optimisation decisions can be made not only in the context of each individual function, but also applied to the chain of functions in a call path.
### Inlining in action
The effects of inlining can be demonstrated with this small example
```
package main
import "testing"
//go:noinline
func max(a, b int) int {
if a > b {
return a
}
return b
}
var Result int
func BenchmarkMax(b *testing.B) {
var r int
for i := 0; i < b.N; i++ {
r = max(-1, i)
}
Result = r
}
```
Running this benchmark gives the following result:[3][4]
```
% go test -bench=. 
BenchmarkMax-4   530687617         2.24 ns/op
```
The cost of `max(-1, i)` is around 2.24 nanoseconds on my 2015 MacBook Air. Now lets remove the `//go:noinline` pragma and see the result:
```
% go test -bench=. 
BenchmarkMax-4   1000000000         0.514 ns/op
```
From 2.24 ns to 0.51 ns, or according to `benchstat`, a 78% improvement.
```
% benchstat {old,new}.txt
name   old time/op  new time/op  delta
Max-4  2.21ns ± 1%  0.49ns ± 6%  -77.96%  (p=0.000 n=18+19)
```
Where did these improvements come from?
First, the removal of the function call and associated preamble[4][5] was a major contributor. Pulling the contents of `max` into its caller reduced the number of instructions executed by the processor and eliminated several branches.
Now the contents of `max` are visible to the compiler as it optimises `BenchmarkMax` it can make some additional improvements. Consider that once `max` is inlined, this is what the body of `BenchmarkMax` looks like to the compiler:
```
func BenchmarkMax(b *testing.B) {
var r int
for i := 0; i < b.N; i++ {
if -1 > i {
r = -1
} else {
r = i
}
}
Result = r
}
```
Running the benchmark again we see our manually inlined version performs as well as the version inlined by the compiler
```
% benchstat {old,new}.txt
name   old time/op  new time/op  delta
Max-4  2.21ns ± 1%  0.48ns ± 3%  -78.14%  (p=0.000 n=18+18)
```
Now the compiler has access to the result of inlining `max` into `BenchmarkMax` it can apply optimisation passes which were not possible before. For example, the compiler has noted that `i` is initialised to `0` and only incremented so any comparison with `i` can assume `i` will never be negative. Thus, the condition `-1 > i` will never be true.[5][6]
Having proved that `-1 > i` will never be true, the compiler can simplify the code to
```
func BenchmarkMax(b *testing.B) {
var r int
for i := 0; i < b.N; i++ {
if false {
r = -1
} else {
r = i
}
}
Result = r
}
```
and because the branch is now a constant, the compiler can eliminate the unreachable path leaving it with
```
func BenchmarkMax(b *testing.B) {
var r int
for i := 0; i < b.N; i++ {
r = i
}
Result = r
}
```
Thus, through inlining and the optimisations it unlocks, the compiler has reduced the expression `r = max(-1, i)` to simply `r = i`.
### The limits of inlining
In this article Ive discussed, so called, _leaf_ inlining; the act of inlining a function at the bottom of a call stack into its direct caller. Inlining is a recursive process, once a function has been inlined into its caller, the compiler may inline the resulting code into _its_ caller, as so on. For example, this code
```
func BenchmarkMaxMaxMax(b *testing.B) {
var r int
for i := 0; i < b.N; i++ {
r = max(max(-1, i), max(0, i))
}
Result = r
}
```
runs as fast as the previous example as the compiler is able to repeatedly apply the optimisations outlined above to reduce the code to the same `r = i` expression.
In the next article Ill discuss an alternative inlining strategy when the Go compiler wishes to inline a function in the middle of a call stack. Finally Ill discuss the limits that the compiler is prepared to go to to inline code, and which Go constructs are currently beyond its capability.
1. In Go, a method is just a function with a predefined formal parameter, the receiver. The relative costs of calling a free function vs a invoking a method, assuming that method is not called through an interface, are the same.[][7]
2. Up until Go 1.14 the stack check preamble was also used by the garbage collector to stop the world by setting all active goroutines stacks to zero, forcing them to trap into the runtime the next time they made a function call. This system was [recently replaced][8] with a mechanism which allowed the runtime to pause an goroutine without waiting for it to make a function call.[][9]
3. Im using the `//go:noinline` pragma to prevent the compiler from inlining `max`. This is because I want to isolate the effects of inlining on `max` rather than disabling optimisations globally with `-gcflags='-l -N'`. I go into detail about the `//go:` comments in [this presentation][10].[][11]
4. You can check this for yourself by comparing the output of `go test -bench=. -gcflags=-S` with and without the `//go:noinline` annotation.[][12]
5. You can check this yourself with the `-gcflags=-d=ssa/prove/debug=on` flag.[][13]
#### Related posts:
1. [Five things that make Go fast][14]
2. [Why is a Goroutines stack infinite ?][15]
3. [How to write benchmarks in Go][16]
4. [Gos hidden #pragmas][17]
--------------------------------------------------------------------------------
via: https://dave.cheney.net/2020/04/25/inlining-optimisations-in-go
作者:[Dave Cheney][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://dave.cheney.net/author/davecheney
[b]: https://github.com/lujun9972
[1]: https://github.com/golang/go
[2]: tmp.gBQ2tEtMHc#easy-footnote-bottom-1-4053 (In Go, a method is just a function with a predefined formal parameter, the receiver. The relative costs of calling a free function vs a invoking a method, assuming that method is not called through an interface, are the same.)
[3]: tmp.gBQ2tEtMHc#easy-footnote-bottom-2-4053 (Up until Go 1.14 the stack check preamble was also used by the garbage collector to stop the world by setting all active goroutines stacks to zero, forcing them to trap into the runtime the next time they made a function call. This system was <a href="https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md">recently replaced</a> with a mechanism which allowed the runtime to pause an goroutine without waiting for it to make a function call.)
[4]: tmp.gBQ2tEtMHc#easy-footnote-bottom-3-4053 (Im using the <code>//go:noinline</code> pragma to prevent the compiler from inlining <code>max</code>. This is because I want to isolate the effects of inlining on <code>max</code> rather than disabling optimisations globally with <code>-gcflags='-l -N'</code>. I go into detail about the <code>//go:</code> comments in <a href="https://dave.cheney.net/2018/01/08/gos-hidden-pragmas">this presentation</a>.)
[5]: tmp.gBQ2tEtMHc#easy-footnote-bottom-4-4053 (You can check this for yourself by comparing the output of <code>go test -bench=. -gcflags=-S</code> with and without the <code>//go:noinline</code> annotation.)
[6]: tmp.gBQ2tEtMHc#easy-footnote-bottom-5-4053 (You can check this yourself with the <code>-gcflags=-d=ssa/prove/debug=on</code> flag.)
[7]: tmp.gBQ2tEtMHc#easy-footnote-1-4053
[8]: https://github.com/golang/proposal/blob/master/design/24543-non-cooperative-preemption.md
[9]: tmp.gBQ2tEtMHc#easy-footnote-2-4053
[10]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas
[11]: tmp.gBQ2tEtMHc#easy-footnote-3-4053
[12]: tmp.gBQ2tEtMHc#easy-footnote-4-4053
[13]: tmp.gBQ2tEtMHc#easy-footnote-5-4053
[14]: https://dave.cheney.net/2014/06/07/five-things-that-make-go-fast (Five things that make Go fast)
[15]: https://dave.cheney.net/2013/06/02/why-is-a-goroutines-stack-infinite (Why is a Goroutines stack infinite ?)
[16]: https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go (How to write benchmarks in Go)
[17]: https://dave.cheney.net/2018/01/08/gos-hidden-pragmas (Gos hidden #pragmas)

View File

@@ -0,0 +1,76 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5?)
[#]: via: (https://itsfoss.com/what-happened-to-ipv5/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
What Happened to IPv5? Why there is IPv4, IPv6 but no IPv5?
======
If you have spent any amount of time in the world of the internet, you should have heard about the IPv4 and IPv6 protocols that our computers use every day.
One question that you might be asking is: Why there is no IPv5? Why IPv6 came after IPv4 and not IPv5? Was there ever a IPv5 and if yes, whatever happened to IPv5?
The answer is yes, there was an IPv5…sort of. Let me quickly explain a few things around it.
### The early history of the internet
![ARPA Logical Map in 1977 | Image courtesy: Wikipedia][1]
In the late 1960s, the US Department of Defenses [Advanced Research Projects Agency][2] (ARPA) started a [project][3] to link computers across the country. The initial goal was to create a networked system of all of the ARPA-funded computers across the country.
Since this was the first time a network of this scale was put together, they were also creating the technology and hardware as they went. One of the first things they worked was an internet protocol (IP) named [Transmission Control Protocol][4] (TCP). This protocol “reliable, ordered, and error-checked delivery of a stream of octets (bytes) between applications running on hosts communicating via an IP network”. Basically, it made sure data got where it needed to go safely.
Originally, TCP was designed to be [“a host-level, end-to-end protocol and a packaging and routing protocol”][5]. However, they realized that they needed to split the protocol to make it more manageable. It was decided that IP would handle packaging and routing.
By this time TCP had gone through three versions, so the new protocol became known as IPv4.
### The birth of IPv5
IPv5 started life under a different name: Internet Stream Protocol (or ST). It was created to experiment with streaming voice and video [“by Apple, NeXT, and Sun Microsystems”][6].
This new protocol was capable of “transferring data packets on specific frequencies while maintaining communication”.
### So what happened to IPv5?
![][7]
IPv5 was never accepted as an official internet protocol. This was mainly due to the 32-bit limitation.
IPV5 used the same addressing system as IPv4. Each address was made up of four sets of numbers between 0 and 255. This limited the number of possible addresses to [4.3 billion][6].
In the early 1970s, that might have seemed like more than the world would ever need. However, the explosive growth of the Internet proved that idea wrong. In 2011, the world officially ran out of the IPv4 addresses.
In the 1990s, a new project was started to work on the next generation of internet protocol (IPng). This led to the 128-bit IPv6. An IPv6 address contains a [“series of eight 4-character hexadecimal numbers”][6] that can contain numbers from 0 to 9 and letters from A to F. Unlike IPv4, IPv6 had trillions of possible addresses, so we should be safe for a while.
Meanwhile, IPv5 laid the groundwork for the voice-over-IP technology that we use to communicate all over the world today. **So, I guess in some small way, you could say that IPv5 still survives to this day**.
I hope you liked this anecdote about internet history. You may read some other [trivia article about Linux and tech in general][8].
If you found this article interesting, please take a minute to share it on social media, Hacker News or [Reddit][9].
--------------------------------------------------------------------------------
via: https://itsfoss.com/what-happened-to-ipv5/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/Arpa_internet.png?fit=800%2C573&ssl=1
[2]: https://en.wikipedia.org/wiki/DARPA
[3]: https://en.wikipedia.org/wiki/ARPANET
[4]: https://en.wikipedia.org/wiki/Transmission_Control_Protocol
[5]: https://fcw.com/articles/2006/07/31/what-ever-happened-to-ipv5.aspx
[6]: https://www.lifewire.com/what-happened-to-ipv5-3971327
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/what-happened-to-ipv5.png?ssl=1
[8]: https://itsfoss.com/category/story/
[9]: https://reddit.com/r/linuxusersgroup

View File

@@ -1,229 +0,0 @@
[#]: collector: "lujun9972"
[#]: translator: "mr-ping"
[#]: reviewer: " "
[#]: publisher: " "
[#]: url: " "
[#]: subject: "Different Ways To Update Linux Kernel For Ubuntu"
[#]: via: "https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/"
[#]: author: "SK https://www.ostechnix.com/author/sk/"
升级Ubuntu Linux核心的几种不同方法
======
![](https://www.ostechnix.com/wp-content/uploads/2019/01/ubuntu-linux-kernel-720x340.png)
这个指南里介绍了7种为Ubuntu升级Linux核心的不同方法。这7种方法里有5种需要重启系统来使新核心生效其他两种则不用。升级之前**强烈建议您将重要数据进行备份!** 这里提到的所有方法只在Ubuntu中测试过。我们并不确定这些方法是不是也能适用于其他Ubuntu的特色发行版Xubuntu和衍生发行版Linux Mint
### 第一部分: 需要重启的核心升级
以下方法需要您重启系统以便新的核心生效。所有方法都建议在个人系统或测试系统中进行。重要的事儿再说一遍请备份好您Ubuntu中的重要数据、配置文件和其他重要的东西。
### 方法  使用dpkg升级Linux核心(手动方式)
这个方法里会帮助你手动从**[kernel.ubuntu.com][1]**网站下载可用的最新Linux核心。如果你打算安装最新版而不是稳定版或者正式发布版那这种方法对你会很有用。从以上链接下载Linux核心版本。编写这个指南的时候最新的可用版本是**5.0-rc1**,最新的稳定版是**v4.20**.
![][3]
基于你的选择点击相应的Linux核心版本链接找到你对应的架构Build for XXX的那部分。然后下载符合以下格式的两个文件(其中 X.Y.Z 是最高版本号)
1. linux-image-*X.Y.Z*-generic-*.deb
2. linux-modules-X.Y.Z*-generic-*.deb
在终端中修改文件所在的目录,然后执行命令,手动安装核心:
```
$ sudo dpkg --install *.deb
```
重启系统,使用新核心:
```
$ sudo reboot
```
检查是否如你所愿:
```
$ uname -r
```
对于分步的说明请查看以下名为“Install Linux Kernel 4.15 LTS On DEB based systems”的文章。
+ [Install Linux Kernel 4.15 In RPM And DEB Based Systems](https://www.ostechnix.com/install-linux-kernel-4-15-rpm-deb-based-systems/)
以上的指南是针对的是4.15版本,不过安装最新版本的所有的步骤都是一样的。
**优势:** 不必联网你可以从任何系统中下载Linux核心来使用
**缺点:** 手动更新,需要重启系统。
#### 方法2 - 用apt-get来升级Linux核心推荐方法
这是在类Ubuntu系统中升级Linux核心的推荐方法。不同于上一个方法这种方法会从Ubuntu官方仓库下载、安装核心版本而不是从 **kernel.ubuntu.com**网站。
要升级包括核心的整个系统,只需要执行:
```
$ sudo apt-get update
$ sudo apt-get upgrade
```
如果只希望升级核心,运行:
```
$ sudo apt-get upgrade linux-image-generic
```
**优势:** 简单。推荐方法。
**缺点:** 需要联网,需要重启。
从官方库中升级核心是最接近开箱即用的方法并且不会出什么问题。如果是生产环境的系统这是最为推荐的升级Linux核心的方法。
方法1和方法2都需要用户去介入到升级Linux核心的过程中。而下边的方法3、 4、 5则几乎是全自动的。
#### 方法3 - 使用Ukuu升级Linux核心
**Ukuu**是一个用于从**kernel.ubuntu.com**下载Linux核心并且将其自动安装到Ubuntu桌面系统和服务器系统中的Gtk图形化界面和命令行工具。Ukku并不是单单简化了手动下载、安装新核心的过程同时也会帮助你移除旧的和不再需要的核心。更多细节可以参照以下指南。
+ [Ukuu An Easy Way To Install And Upgrade Linux Kernel In Ubuntu-based Systems](https://www.ostechnix.com/ukuu-an-easy-way-to-install-and-upgrade-linux-kernel-in-ubuntu-based-systems/)
**优势:** 易于安装使用。自动安装主线核心。
**缺点:** 需要联网,需要重启。
#### 方法4 - 使用UKTools升级Linux核心
跟Ukuu差不多**UKTools**也会从**kernel.ubuntu.com**网站获取最新的核心并且自动安装到Ubuntu以及类似于Linux Mint的延伸发行版中。
+ [UKTools Upgrade Latest Linux Kernel In Ubuntu And Derivatives](https://www.ostechnix.com/uktools-upgrade-latest-linux-kernel-in-ubuntu-and-derivatives/)
**优势:** 简单,自动
**缺点:** 需要联网,需要重启。
#### 方法5 - 使用Linux核心工具集(Linux Kernel Utilities)安装Linux核心
**Linux Kernel Utilities**是目前另一个用于升级类Ubuntu系统Linux核心的程序。实质上它是一个由一系列Bash脚本构成的合集用于编译并且可以选择性地为Debian译者注Ubuntu的上游发行版及其衍生发行版升级核心。它包含三个工具集一个用于手动编译、安装来自于 [**http://www.kernel.org**][4] 网站的源码核心,另一个用于安装来自**<https://kernel.ubuntu.com>**网站的事先编译好的核心,第三个脚本用于移除旧核心。更多细节请浏览以下链接。
+ [Linux Kernel Utilities Scripts To Compile And Update Latest Linux Kernel For Debian And Derivatives](https://www.ostechnix.com/linux-kernel-utilities-scripts-compile-update-latest-linux-kernel-debian-derivatives/)
**优势:** 简单,自动
**缺点:** 需要联网,需要重启。
### 第二部分 Kernel Updates without reboot
我之前说过,上边所有的方法都需要你去重启服务器(译者注:也可以是桌面版)来启用新核心。如果是个人系统或者测试系统,可以这么办。但对于无法停机的生产环境系统该怎么办呢?一点问题没有,这时候**实时补丁(livepatching)**就派上用场了。
**实时补丁**(或者叫热补丁)允许你在不需要重启的情况下安装Linux升级或补丁来保证你的服务器处于最新的安全等级之下。这对web主机、游戏服务器这类需要不间断在线的服务器来说是很有价值的。事实上任何情况下服务器都应该保持在不间断运行的状态下。由于Linux供应商只会在出于修复安全漏洞的目的下维护补丁所以如果安全性是你的点这种方式再适合不过了。
以下两种方法可以在不需要重启的情况下为生产环境和执行关键任务的Ubuntu服务器更新Linux核心。
#### 方法6 使用Canonical实时补丁服务Canonical Livepatch Service来更新Linux核心
![][5]
[**Canonical Livepatch Service**][6] 可以在不需要重启Ubuntu系统的情况下执行核心升级、补丁和安全的热修复等操作在减少服务器宕机的情况下保障其安全。Canonical Livepatch Service 可以在安装过程当中或安装之后尽心设置. 如果你使用的是Ubuntu桌面版软件更新器会自动检查核心补丁的更新并且通知你。在基于控制台的系统中则需要你主动运行apt-get update命令来进行升级。由于需要你手动运行“apt-get upgrade”命令它才会安装核心的安全补丁所以算是半自动的。
Livepatch对三个及以下系统免费如果多于三个你需要升级成名为**Ubuntu Advantage**的企业支持方案套件。这个套件包括**Kernel Livepatching**及以下服务:
* Extended Security Maintenance Ubuntu生命周期后的重要安全更新
* Landscape 针对大规模使用Ubuntu的系统管理工具
* Knowledge Base 由Ubuntu专家撰写的私人文章和教程
* 电话和网站支持
**价格**
Ubuntu Advantage包含三种付费计划 必备Essential, 标准Standard 高级Advanced.最基础的计划Essential 计划)从 **单物理节点 225 美元/年**和**单VPS 75美元/年**开始计价。看上去应该不支持针对Ubuntu服务器版和桌面版的按月订阅。你可以在 [**此处**][7]浏览所有计划的细节信息。
**优势:** 简单。半自动化。无需重启。支持三个免费系统。
**缺点:** 4个以上主机的话非常昂贵. 没有补丁回滚。
**开启 Canonical Livepatch Service**
如果你想在安装后设置实时补丁服务,依照以下方法逐步执行:
从 [**https://auth.livepatch.canonical.com/**][8] 获取一个秘钥.
```
$ sudo snap install canonical-livepatch
$ sudo canonical-livepatch enable your-key
```
#### 方法 使用KernelCare升级Linux内核
![][9]
[**KernelCare**][10] 是所有实时补丁方案中最新的一个. 它是 [CloudLinux][11]推出的产品. KernelCare 可以运行在Ubuntu和其他的Linux特殊发行版中. 它每四个小时检查一遍补丁的发布,并在无需确认的情况下安装它们. 如果更新后存在问题,可以将补丁进行回滚。
**价格**
费用,每台服务器:**4 美元/月** , **45 美元/年**.
跟Ubuntu Livepatch相比kernelCare看起来非常便宜、实惠。好的方面在于**也可以按月订阅**。另一个前者不具备的功能是支持如Red Hat, CentOS, Debian, Oracle Linux, Amazon Linux 以及 OpenVZ, Proxmox 这种虚拟平台等等的其他Linux发行版。
你可以在 [**此处**][12] 了解KernelCare的所有特性和简介以及所有的付费计划的细节。
**优势:** 简单。全自动化。范围更广的操作系统覆盖。补丁回滚。无需重启。对非盈利组织提供免费许可。价格低廉。
**缺点:** 除了30天试用外无免费计划。
**开启 KernelCare Service**
此处 [**https://cloudlinux.com/kernelcare-free-trial5**][14] 获取30天免费试用秘钥。
执行以下命令开启KernelCare并注册秘钥。
```
$ sudo wget -qq -O - https://repo.cloudlinux.com/kernelcare/kernelcare_install.sh | bash
$ sudo /usr/bin/kcarectl --register KEY
```
如果你的目标是价格实惠并且通过可靠的社区服务来保障你的Linux服务器核心的更新那KernelCare是个不错的选择。
*由来自Cloud Linux的技术撰稿人和内容作者**Paul A. Jacobs**撰写。*
**推荐阅读:**
到此,希望这边文章能对你有所帮助。如果你觉得还有其他的工具和方法需要列在这里,可以在留言区给我们留言。我会根据反馈检查和更新这篇指南的。
接下来会有更多好东西给大家呈现,敬请期待。
Cheers!
--------------------------------------------------------------------------------
via: https://www.ostechnix.com/different-ways-to-update-linux-kernel-for-ubuntu/
作者:[SK][a]
选题:[lujun9972][b]
译者:[mr-ping](https://github.com/mr-ping)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.ostechnix.com/author/sk/
[b]: https://github.com/lujun9972
[1]: http://kernel.ubuntu.com/~kernel-ppa/mainline/
[2]: data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7
[3]: http://www.ostechnix.com/wp-content/uploads/2019/01/Ubuntu-mainline-kernel.png
[4]: http://www.kernel.org
[5]: http://www.ostechnix.com/wp-content/uploads/2019/01/Livepatch.png
[6]: https://www.ubuntu.com/livepatch
[7]: https://www.ubuntu.com/support/plans-and-pricing
[8]: https://auth.livepatch.canonical.com/
[9]: http://www.ostechnix.com/wp-content/uploads/2019/01/KernelCare.png
[10]: https://www.kernelcare.com/
[11]: https://www.cloudlinux.com/
[12]: https://www.kernelcare.com/update-kernel-linux/
[13]: https://www.kernelcare.com/pricing/
[14]: https://cloudlinux.com/kernelcare-free-trial5

View File

@@ -1,255 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (messon007)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (9 open source cloud native projects to consider)
[#]: via: (https://opensource.com/article/19/8/cloud-native-projects)
[#]: author: (Bryant Son https://opensource.com/users/brsonhttps://opensource.com/users/marcobravo)
值得考虑的9个开源的云原生项目
======
工作中用了容器?熟悉这些出自云原生计算基金会的项目?
![clouds in the sky with blue pattern][1]
随着用容器来开发应用的实践变得流行,[云原生应用][2]也在增长。云原生应用的定义为:
> "云原生技术被用于开发应用程序这些应用通过将服务打包在容器中来完成构建被部署为微服务并通过敏捷的DevOps流程和持续集成工作流在弹性基础设施上管理。"
这个定义提到了构成云原生应用的4个元素
1. 容器
2. 微服务
3. DevOps
4. 持续集成和持续交付 (CI/CD)
尽管这些技术各有各自独特的历史,但它们相互补充,共同导致了云原生应用和工具在短时间内惊人的指数级增长。这个[云原生计算基金会][4]信息图呈现了当今云原生应用生态的规模和广度。
![Cloud-Native Computing Foundation applications ecosystem][5]
云原生计算基金会项目
我想说瞧着吧这仅仅是一个开始。正如NodeJS的出现引发了无休止的JavaScript工具的爆炸式增长一样容器技术的普及也推动了云原生应用的指数增长。
好消息是,有几个组织负责监管这些技术并将它们融合在一起。 其中之一是[**Open Containers InitiativeOCI)**][6]它是一个轻量级的开放的治理机构或项目“它是在Linux基金会的主持下形成的其明确目的是创建开放的行业标准的容器格式和运行时。” 另一个是** CNCF **,“它是一个致力于使云原生计算具有通用性和可持续性的开源软件基金会”。
除了常见的围绕云原生应用建立社区之外CNCF还帮助项目基于其云原生应用建立结构化的管理。CNCF创建了成熟等级的概念沙箱级孵化级或毕业级分别与下图中的“创新者”“早期采用者”和“早期大量应用”相对应。
![CNCF project maturity levels][7]
CNCF项目成熟等级
CNCF为每个成熟等级制定了详细的[标准][8](为方便读者而列在下面)。 获得技术监督委员会TOC三分之二的同意才能转为孵化或毕业级。
### 沙箱级
> 要想成为沙箱级一个项目必须至少有两个TOC赞助商。 有关详细过程,请参见《 CNCF沙箱指南v1.0》。
### 孵化级
>注意:孵化级是我们期望对项目进行全面尽职调查的起点。
>
>要进入孵化阶段,项目除了满足沙箱阶段的要求之外还要满足:
>
> *证明至少有三个独立的最终用户已成功将其用于生产且TOC判断这些最终用户具有足够的质量和范围。
> *合入者的数量要合理。合入者定义为具有合入权的人。即可以接受对部分或全部项目贡献的人。
> *演示有大量正在进行的提交和合并的贡献。
> *由于这些指标可能会根据项目的类型范围和大小而有很大差异因此TOC对足以满足这些标准的活动级别拥有最终决策权
### 毕业级
>要从沙箱或孵化级毕业,或者要使一个新项目作为已毕业项目加入,项目除了必须满足孵化级的标准外还要满足:
>
> *至少有两个组织的提交者。
> *已获得并维护了“核心基础设施计划最佳实践徽章”。
> *已完成独立和第三方安全审核,并发布了具有与以下示例类似的范围和质量的结果(包括已解决的关键漏洞):<https://github.com/envoyproxy/envoy#security-audit>和所有关键毕业之前需要解决漏洞。
> *采用CNCF行为准则。
> *明确定义项目治理和提交流程。最好将其排布在GOVERNANCE.md文件中并引用显示当前提交者和荣誉提交者的OWNERS.md文件。
> *至少有主仓的项目采用者的公开列表例如ADOPTERS.md或项目网站上的徽标
> *获得TOC的多数票进入毕业阶段。如果项目能够证明足够的成熟度则可以尝试直接从沙箱过渡到毕业。项目可以无限期保持孵化状态但是通常预计它们会在两年内毕业。
## 值得考虑的9个项目
本文不可能涵盖所有的CNCF项目我将介绍最有趣的9个“已毕业和孵化中”的开源项目。
名称|授权类型|简要描述
---|---|---
[Kubernetes][9] | Apache 2.0 | 容器编排平台
[Prometheus][10] | Apache 2.0 | 系统和服务监控工具
[Envoy][11] | Apache 2.0 | 边缘和服务代理
[rkt][12] | Apache 2.0 | Pod原生的容器引擎
[Jaeger][13] | Apache 2.0 | 分布式跟踪系统
[Linkerd][14] | Apache 2.0 | 无感服务网格
[Helm][15] | Apache 2.0 | Kubernetes包管理器
[Etcd][16] | Apache 2.0 | 分布式键值存储
[CRI-O][17] | Apache 2.0 | 专门用于Kubernetes的轻量级运行时环境
我也创建了视频材料来介绍这些项目。
## 毕业项目
已毕业的项目被认为是成熟的已被许多组织采用的并且严格遵守了CNCF的准则。 以下是三个最受欢迎的开源CNCF毕业项目。 (请注意,其中一些描述来源于项目的网站并被做了改编。)
### Kubernetes
Kubernetes! 我们如何在不提及Kubernetes的情况下谈论云原生应用程序 Google发明的Kubernetes无疑是最著名的基于容器的应用程序的容器编排平台而且它还是一个开源工具。
什么是容器编排平台? 通常,一个容器引擎本身可以管理几个容器。 但是,当您谈论数千个容器和数百个服务时,管理这些容器变得非常复杂。 这就是容器编排引擎的用武之地。容器编排引擎通过自动化容器的部署,管理,网络和可用性来帮助管理大量的容器。
Docker Swarm和Mesosphere Marathon也是容器编排引擎但是可以肯定地说Kubernetes在竞争中胜出至少现在是这样。Kubernetes还诞生了容器即服务CaaS平台如[OKD][18]它是Origin社区针对Kubernetes的发行版并成了[Red Hat OpenShift][19]的一部分。
想开始学习请访问[Kubernetes GitHub仓库][9],并从[Kubernetes文档][20]页面访问其文档和学习资源。
### Prometheus
Prometheus是2012年在SoundCloud上构建的一个开源系统监控和告警工具。之后许多公司和组织都使用了Prometheus并且该项目拥有非常活跃的开发者和用户群体。 现在,它是一个独立于公司的独立维护的开源项目。
![Prometheus architecture][21]
Prometheus的架构
理解Prometheus的最简单方法是可视化一个生产系统该系统需要24(小时)x365天都可以正常运行。 没有哪个系统是完美的,也有减少故障的技术(称为容错系统)。 但是,如果出现问题,最重要的是尽快识别它。 这就是像Prometheus这样的监控工具的用武之地。Prometheus不仅是容器监控工具它在云原生应用公司中也最受欢迎。 此外,其他开源监视工具,包括[Grafana][22]都借鉴了Prometheus。
开始使用Prometheus的最佳方法是下载其[GitHub仓库][10]。 在本地运行Prometheus很容易但是您需要安装一个容器引擎。 您可以在[Prometheus网站][23]上查看详细的文档。
### Envoy
Envoy或Envoy代理是专为云原生应用设计的开源的边缘代理和服务代理。 由Lyft创建的Envoy是为单一服务和应用而设计的高性能的C++分布式代理,同时也是为由大量微服务组成的服务网格架构而设计的通信总线和通用数据平面。 基于对NginxHAProxy硬件负载均衡器和云负载均衡器等方案了解的基础上Envoy与每个应用相伴(并行)运行,并对网络进行了高度抽象,最终以平台无关的方式来提供通用功能。
当基础设施中的所有服务流量都经过一个Envoy网格时很容易就可以通过连贯的监测来可视化问题域调整整体性能并在单个位置添加基础功能。基本上Envoy代理是一个可帮助组织为生产环境构建容错系统的服务网格工具。
服务网格应用有很多替代方案例如Uber的[Linkerd][24](下面会讨论)和[Istio][25]。 Istio通过将其部署为[Sidecar][26]并利用了[Mixer][27]的配置模型实现了对Envoy的扩展。 Envoy的显著特性有
*所有的“table stakes(入场筹码,引申为基础必备特性)”特性与控制平面例如Istio组合时
*带载运行时99%数据可达到低延时
*将L3/L4过滤器作为核心支持额外的L7过滤器
*支持gRPC和HTTP / 2上行/下行)
   *由API驱动并支持动态配置和热重载
*重点关注指标收集,跟踪和整体可监测性
要想了解Envoy证实其能力并意识到其全部优势需要丰富的在生产级环境运行的经验。 您可以在[详细文档][28]或访问其[GitHub][11]仓库了解更多信息。
## 孵化项目
下面是最流行的开源的CNCF孵化项目中的六个。
### rkt
rkt, 拼为"rocket", 是一个pod原生的容器引擎。它有一个命令行接口用来在Linux上运行容器。从某种意义上讲它和其他容器如[Podman][29], Docker和CRI-O相似。
rkt最初由CoreOS开发后来被Red Hat收购您可以在其网站上找到详细的[文档][30],以及在[GitHub][12]上访问其源代码。
### Jaeger
Jaeger是面向云原生应用的开源的端到端的分布式跟踪系统。 在某种程度上它是像Prometheus这样的监控解决方案。但它有所不同因为其使用场景有所扩展
* 分布式事务监控
* 性能和延时优化
* 根因分析
* 服务的依赖分析
* 分布式上下文传播
Jaeger是Uber建立的开源的技术。 您可以在其网站上找到[详细文档][31]以及在GitHub上找到其[源码][13]。
### Linkerd
像创建Envoy代理的Lyft一样Uber开发了Linkerd开源解决方案用于生产级的服务维护。在某些方面Linkerd就像Envoy一样因为两者都是服务网格工具旨在提供平台级的可观测性可靠性和安全性而无需进行配置或代码更改。
但是,两者之间存在一些细微的差异。 尽管Envoy和Linkerd充当代理并可以通过所连接的服务进行上报但是Envoy并不像Linkerd那样被设计为Kubernetes Ingress控制器。 Linkerd的显著功能包括
*支持多种平台DockerKubernetesDC / OSAmazon ECS或单机
*内置服务发现抽象将多个系统集成在一起
*支持gRPCHTTP / 2和HTTP / 1.x请求和所有的TCP流量
您可以在[Linkerd网站][32]上阅读有关它的更多信息,并在[GitHub][14]上访问其源码。
### Helm
Helm基本上是Kubernetes的软件包管理器。 如果您使用过Apache MavenMaven Nexus或类似的服务您就会理解Helm的作用。 Helm可帮助您管理Kubernetes应用程序。 它使用“Helm图”来定义安装和升级最复杂的Kubernetes应用程序。 Helm并不是实现此功能的唯一方法 另一个流行的概念是[Kubernetes Operators][33]它被Red Hat OpenShift 4所使用。
您可以按照其文档中的[快速开始指南][34]或[GitHub指南][15]来试用Helm。
### Etcd
Etcd是用于分布式系统中最关键数据的分布式的可靠的键值存储。 其主要特性有:
*定义明确的面向用户的APIgRPC
*客户端证书验证可选的自动TLS
*速度可达每秒10,000次写入
*可靠性使用Raft实现分布式
Etcd是Kubernetes和许多其他技术的默认的内置数据存储方案。也就是说它很少独立运行或作为单独的服务运行 相反它利用了集成到KubernetesOKD / OpenShift或其他服务中的一个。 还有[etcd Operator][35]来管理其生命周期并解锁其API管理功能
您可以在[etcd文档][36]中了解更多信息并在GitHub上访问其[源码][16]。
### CRI-O
CRI-O是Kubernetes运行时接口的OCI兼容实现。CRI-O用于各种功能包括
*使用runc或遵从OCI运行时规范的任何实现和OCI运行时工具运行
*使用容器/镜像进行镜像管理
*使用容器/存储来存储和管理镜像层
*通过容器网络接口CNI来提供网络支持
CRI-O提供了大量的[文档][37],包括指南,教程,文章,甚至播客,您还可以访问其[GitHub页面][17]。
* * *
我错过了其他有趣且开源的云原生项目吗? 请在评论中提醒我。
--------------------------------------------------------------------------------
via: https://opensource.com/article/19/8/cloud-native-projects
作者:[Bryant Son][a]
选题:[lujun9972][b]
译者:[messon007](https://github.com/messon007)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/brsonhttps://opensource.com/users/marcobravo
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/rh_003601_05_mech_osyearbook2016_cloud_cc.png?itok=XSV7yR9e (clouds in the sky with blue pattern)
[2]: https://opensource.com/article/18/7/what-are-cloud-native-apps
[3]: https://thenewstack.io/10-key-attributes-of-cloud-native-applications/
[4]: https://www.cncf.io
[5]: https://opensource.com/sites/default/files/uploads/cncf_1.jpg (Cloud-Native Computing Foundation applications ecosystem)
[6]: https://www.opencontainers.org
[7]: https://opensource.com/sites/default/files/uploads/cncf_2.jpg (CNCF project maturity levels)
[8]: https://github.com/cncf/toc/blob/master/process/graduation_criteria.adoc
[9]: https://github.com/kubernetes/kubernetes
[10]: https://github.com/prometheus/prometheus
[11]: https://github.com/envoyproxy/envoy
[12]: https://github.com/rkt/rkt
[13]: https://github.com/jaegertracing/jaeger
[14]: https://github.com/linkerd/linkerd
[15]: https://github.com/helm/helm
[16]: https://github.com/etcd-io/etcd
[17]: https://github.com/cri-o/cri-o
[18]: https://www.okd.io/
[19]: https://www.openshift.com
[20]: https://kubernetes.io/docs/home
[21]: https://opensource.com/sites/default/files/uploads/cncf_3.jpg (Prometheus architecture)
[22]: https://grafana.com
[23]: https://prometheus.io/docs/introduction/overview
[24]: https://linkerd.io/
[25]: https://istio.io/
[26]: https://istio.io/docs/reference/config/networking/v1alpha3/sidecar
[27]: https://istio.io/docs/reference/config/policy-and-telemetry
[28]: https://www.envoyproxy.io/docs/envoy/latest
[29]: https://podman.io
[30]: https://coreos.com/rkt/docs/latest
[31]: https://www.jaegertracing.io/docs/1.13
[32]: https://linkerd.io/2/overview
[33]: https://coreos.com/operators
[34]: https://helm.sh/docs
[35]: https://github.com/coreos/etcd-operator
[36]: https://etcd.io/docs/v3.3.12
[37]: https://github.com/cri-o/cri-o/blob/master/awesome.md

View File

@@ -0,0 +1,66 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (The Difference Between DNF and YUM, Why is Yum Replaced by DNF?)
[#]: via: (https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
DNF 和 YUM 的区别,为什么 YUM 会被 DNF 取代?
======
由于 Yum 中许多长期存在的问题仍未得到解决,因此 [Yum 包管理器][1]已被 [DNF 包管理器][2]取代。这些问题包括性能差、内存占用过多、依赖解析速度变慢等。
DNF 使用 `libsolv` 进行依赖解析,由 SUSE 开发和维护旨在提高性能。DNF 主要是用 Python 编写的,它有自己的应对依赖解析的方法。
Yum 是 RPM 的前端工具,它管理依赖关系和资源库,然后使用 RPM 来安装、下载和删除包。它的 API 没有完整的文档,它的扩展系统只允许 Python 插件。
为什么他们要建立一个新的工具,而不是修复现有的问题呢?
Ales Kozamblak 解释说,这个修复在技术上是不可行的,而且 Yum 团队还没有准备好立即接受修改。
另外最大的挑战是Yum 有 56000 行代码,但 DNF 只有 29000 行代码。
所以除了分叉,没有办法解决。
不过 Yum 的运行情况还算可以。
编号 | DNFDandified YUM | YUMYellowdog Updater, Modified
---|---|---
1 | DNF 使用 libsolv 来解析依赖关系,由 SUSE 开发和维护 | YUM 使用公开的 API 来解析依赖关系
2 | API 有完整的文档 | API 没有完整的文档
3 | 由 C、C++、Python 编写的 | 只用 Python 编写
4 | DNF 目前在 Fedora、RHEL 8、CentOS 8、OEL 8 和 Mageia 6/7 中使用 | YUM 目前在 RHEL 6/7、CentOS 6/7、OEL 6/7 中使用
5 | DNf 支持各种扩展 | Yum 只支持基于 Python 的扩展
6 | API 有良好的文档,因此很容易创建新的功能 | 因为 API 没有正确的文档化,所以创建新功能非常困难
7 | DNF 在同步存储库的元数据时,使用的内存较少 | 在同步存储库的元数据时YUM 使用了过多的内存
8 | DNF 使用满足性算法来解决依赖关系解析(它是用字典的方法来存储和检索包和依赖信息)| 由于使用公开 API 的原因Yum 依赖性解析变得迟钝
9 | 从内存使用量和版本库元数据的依赖性解析来看,性能都不错 | 总的来说,在很多因素的影响下,表现不佳
10 | DNF 更新:在 DNF 更新过程中,如果包中包含不相关的依赖,则不会更新 | YUM 将在没有验证的情况下更新软件包
11 | 如果启用的存储库没有响应DNF 将跳过它,并继续使用可用的存储库出来事务 | 如果有存储库不可用YUM 会立即停止
12 | `dnf update``dnf upgrade` 是等价的 | 在 Yum 中则不同
13 | 安装包的依赖关系不更新 | Yum 为这种行为提供了一个选项
14 | 清理删除的包当删除一个包时DNF 会自动删除任何没有被用户明确安装的依赖包 | Yum 不会这样做
15 | 存储库缓存更新计划:默认情况下,系统启动后 10 分钟后DNF 每小时检查一次对配置的存储库的更新。这个动作由系统定时器单元 `/usr/lib/systemd/system/system/dnf-makecache.timer` 控制 | Yum 也会这样做
16 | 内核包不受 DNF 保护。不像 Yum你可以删除所有的内核包包括运行中的内核包 | Yum 不允许你删除运行中的内核
17 | libsolv用于解包和读取资源库。hawkey: 为 libsolv 提供简化的 C 和 Python API 库。librepo: 提供 C 和 Python类似 libcURLAPI 的库,用于下载 Linux 存储库元数据和软件包。libcomps: 是 yum.comps 库的替代品。它是用纯 C 语言编写的库,有 Python 2 和 Python 3 的绑定。| Yum 不使用单独的库来执行这些功能
18 | DNF 包含 29000 行代码 | Yum 包含 56000 行代码
19 | DNF 由 Ales Kozumplik 开发 | YUM 由 Zdenek Pavlas、Jan Silhan 和团队成员开发
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/yum-command-examples-manage-packages-rhel-centos-systems/
[2]: https://www.2daygeek.com/linux-dnf-command-examples-manage-packages-fedora-centos-rhel-systems/

View File

@@ -1,129 +0,0 @@
[#]: collector: (lujun9972)
[#]: translator: (qfzy1233)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Bodhi Linux 5.1 Review: Slightly Different Lightweight Linux)
[#]: via: (https://itsfoss.com/bodhi-linux-review/)
[#]: author: (John Paul https://itsfoss.com/author/john/)
Bodhi Linux 5.1 一览: 略有不同的轻量化 Linux
======
Bodhi Linux 是一个基于 Ubuntu 的[轻量级Linux发行版][1]。与其他大多数发行版不同Bodhi 使用自己的 Moksha 桌面,并专注于为你提供在旧计算机上运行的最简设置。
### 什么是 Bodhi Linux?
![Bodhi Start Page][2]
[Bodhi Linux][3] 最早于2011年推出。它以“[简约、高效和用户自定义][4]”为设计理念。开发人员旨在提供一个“[功能正常但不臃肿的系统][5]”。因此它使用轻量级的Moksha 桌面,只预装了基本的应用程序。这一做法是为了给用户一个稳定的平台来构建他们想要的系统。它基于最新版的 Ubuntu 长期支持版本。
### Moksha 桌面
![Bodhi Desktop][6]
起初菩提是随着[ Enlightenment 桌面环境][7]一起发布的。Bodhi Linux 一直被认为是“开明的”Linux发行版。事实上“Bodhi”这个词是基于梵文的“开悟”。
然而,当 Enlightenment 18版本发布以后这一切都改变了。该版本是如此的糟糕它并没有集成 Bodhi 。Enlightenment 19 被发布并修复了一些问题,但仍然存在一些问题。
在尝试与 Enlightenment 开发团队合作却毫无进展之后Bodhi 开发者在2015年复刻了[8]Enlightenment 17。新的桌面环境被命名为[Moksha][9],它是基于梵文单词“解脱、解放或释放”。你可以在[GitHub][10]上找到它的代码。
### 5.1.0有什么新特性?
[订阅我们的YouTube频道来观看更多的Linux视频][11]
[Bodhi 5.1.0][12] 是两年内的第一个版本,也是基于 Ubuntu 18.04 的第二个版本。除了更新包,它还有新的默认图标和主题。该版本对默认应用程序做了几处更改。预装版 Leafpad 取代了 epad 并且 [GNOME Web][13] (也被称为Epiphany)代替了[Midori][14])。删除了eepDater系统更新器。
目前有[四个不同的版本][15]的菩提5.1.0提供[下载][16]: 标准版Standard,硬件支持版Hwe, 兼容版Legacy, 和软件包版AppPack.
* 标准适用于过去十年内电脑配置。它不推送内核更新。
* 硬件支持版Hwe (Hardware Enablement)是 Bodhi 新的家族设计包括支持更新的硬件和将收到内核更新。5.1版本的使用的是5.3.0-42内核。
* 兼容版是唯一的32位版本。它使用“较旧的4.9.0-6-686 Linux内核该内核针对旧的(15年以上)硬件进行了优化”。这个内核也不包括PAE扩展这是许多老系统不支持的。”
* 软件包版是为那些想要一个开箱即用并预装了许多应用程序的全负载系统的人准备的。
### Bodhi Linux 的系统要求
最低系统要求
* 500 MHz 处理器
* 256 MB 内存
* 5 GB 的硬盘存储空间
推荐系统要求
* 1.0 GHz 处理器
* 512 MB 内存
* 10 GB 的硬盘存储空间
### Bodhi Linux 的体验
![Old Bodhi Linux][17]
由于它是基于 Ubuntu 的,安装 Bodhi 非常简单。当我登录到 Bodhi 后,我对新的主题和图标设置感到惊讶。上次我安装 Bodhi (包括几个月前的5.0)时我认为它需要一个新的外观。之前的主题并没有什么问题但看起来像是2000年初的东西。新的主题使它看起来更具现代感。
![Bodhi Linux 5.1][18]
我也很高兴看到 Midori 浏览器被 GNOME Web 所取代。我不是[Midori 浏览器][19]的粉丝。对我来说,它总是显得功能太少了。(不过,随着[Midori Next][20]的推出,这种情况可能会改变。)Web更像是我需要的Web浏览器。最重要的是它带有Firefox同步功能这样我就可以同步我所有的书签和密码了。
与许多 Linux 发行版不同Bodhi 并没有一个独立的软件中心。相反,如果你点击 AppCenter 图标,它会打开浏览器,并导航到 Bodhi 网站的软件中心页面[AppCenter page][21]。这里的应用程序是按类别排序的。它们中的大多数是[轻量级应用程序][22]。
![Bodhi Linux Appcenter][23]
如果你点击其中一个页面并点击“安装”Bodhi 会开始它的安装(在你输入密码之后)。这是通过一个名为[apturl][24]的小程序实现的它是“源自web浏览器安装软件包的一种非常简单的方法”。它非常灵巧我希望更多基于ubuntu的发行版使用它。
总的来说,我喜欢 Moksha 桌面。它坚持我们几十年来看到的桌面风格(这是我最喜欢的)。它不干涉你,却很容易改变和定制。我唯一怀念的是,当我点击超级键时,应用程序菜单不打开。但我猜你不可能拥有生活中的一切。
### 结语
我对最近发布的 Bodhi Linux 感到十分惊喜。过去我经常折腾它。并且我一直很喜欢它但最近的这个版本是迄今为止最好的。在某种程度上他们通过增加对新内核的支持打破了Bodhi只适用于旧系统的想法。
如果你想在拥有 Ubuntu 体验的同时改善一下视觉体验,那就试试[Bodhi Linux][3]吧。
你用过 Bodhi Linux 吗?你最喜欢的基于ubuntu的发行版是什么?请在下面的评论中告诉我们。
如果你觉得这篇文章很有趣请花点时间在社交媒体、Hacker News或其他网站上分享 [Reddit][25].
--------------------------------------------------------------------------------
via: https://itsfoss.com/bodhi-linux-review/
作者:[John Paul][a]
选题:[lujun9972][b]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/john/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/lightweight-linux-beginners/
[2]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi-start-page.png?resize=800%2C500&ssl=1
[3]: https://www.bodhilinux.com/
[4]: https://www.bodhilinux.com/w/wiki/
[5]: https://www.bodhilinux.com/w/what-is-bodhi-linux/
[6]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi-desktop.jpg?resize=800%2C500&ssl=1
[7]: https://www.enlightenment.org/start
[8]: https://www.bodhilinux.com/2015/04/28/introducing-the-moksha-desktop/
[9]: https://www.bodhilinux.com/moksha-desktop/
[10]: https://github.com/JeffHoogland/moksha
[11]: https://www.youtube.com/c/itsfoss?sub_confirmation=1
[12]: https://www.bodhilinux.com/2020/03/25/bodhi-linux-5-1-0-released/
[13]: https://wiki.gnome.org/Apps/Web/
[14]: https://en.wikipedia.org/wiki/Midori_(web_browser
[15]: https://www.bodhilinux.com/w/selecting-the-correct-iso-image/
[16]: https://www.bodhilinux.com/download/
[17]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/bodhi.png?resize=800%2C400&ssl=1
[18]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/bodhi-Linux-5-1-screenshot.jpg?ssl=1
[19]: https://itsfoss.com/midori-browser/
[20]: https://www.midori-browser.org/2020/01/15/midori-next-come-on-yarovi-we-can/
[21]: https://www.bodhilinux.com/a/
[22]: https://itsfoss.com/lightweight-alternative-applications-ubuntu/
[23]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/Bodhi-Linux-AppCenter.png?resize=800%2C500&ssl=1
[24]: https://wiki.ubuntu.com/AptUrl
[25]: https://reddit.com/r/linuxusersgroup

View File

@@ -0,0 +1,192 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (4 Git scripts I can't live without)
[#]: via: (https://opensource.com/article/20/4/git-extras)
[#]: author: (Vince Power https://opensource.com/users/vincepower)
4 个不可或缺的 Git 脚本
======
> Git Extras 版本库包含了 60 多个脚本,它们是 Git 基本功能的补充。以下是如何安装、使用和贡献的方法。
![Person using a laptop][1]
2005 年,[Linus Torvalds][2] 创建了 [Git][3],以取代他之前用于维护 Linux 内核的专有的分布式源码控制管理解决方案。从那时起Git 已经成为开源和云原生开发团队的主流版本控制解决方案。
但即使是像 Git 这样功能丰富的应用程序,也没有人们想要或需要的每个功能,所以人们会花大力气去创建这些功能。就 Git 而言,这个人就是 [TJ Holowaychuk][4]。他的 [Git Extras][5] 项目承载了 60 多个“附加功能”,这些功能扩展了 Git 的基本功能。
### 使用 Git 附加功能
下面介绍一下如何使用四种最受欢迎的 Git 附加功能。
#### git-ignore
`git ignore` 是一个方便的附加功能,它可以让你手动添加文件类型和注释到 `.git-ignore` 文件中,而不需要打开文本编辑器。它可以操作你的个人用户帐户的全局忽略文件和单独用于你正在工作的版本库的忽略文件。
在没有参数的情况下执行 `git ignore` 会先列出全局忽略文件,然后是本地的忽略文件。
```
$ git ignore
Global gitignore: /home/alice/.gitignore
# Numerous always-ignore extensions
*.diff
*.err
*.orig
*.rej
*.swo
*.swp
*.vi
*~
*.sass-cache
# OS or Editor folders
Thumbs.db
---------------------------------
Local gitignore: .gitignore
nbproject
```
#### git-info
`git info` 可以检索你所需要的所有信息,以获取你正在使用的版本库的上下文信息。它包括远程 URL、远程分支、本地分支、配置信息和最后一次的提交信息。
```
$ git info
## Remote URLs:
origin git@github.com:sampleAuthor/git-extras.git (fetch)
origin git@github.com:sampleAuthor/git-extras.git (push)
## Remote Branches:
origin/HEAD -> origin/master
origin/myBranch
## Local Branches:
myBranch
* master
## Most Recent Commit:
commit e3952df2c172c6f3eb533d8d0b1a6c77250769a7
Author: Sample Author <sampleAuthor@gmail.com>
Added git-info command.
Type ´git log´ for more commits, or ´git show <commit id>´ for full commit details.
## Configuration (.git/config):
color.diff=auto
color.status=auto
color.branch=auto
user.name=Sample Author
user.email=sampleAuthor@gmail.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=git@github.com:mub/git-extras.git
branch.master.remote=origin
branch.master.merge=refs/heads/master
```
#### git-mr 和 git-pr
这些附加功能的作用类似,工作方式也基本相同。
* `git mr` 检出来自 GitLab 的合并请求。
* `git pr` 检出来自 GitHub 的拉取请求。
无论是哪种情况,你只需要合并请求号、拉取请求号或完整的 URL它就会抓取远程引用检出分支并调整配置这样 Git 就知道要替换哪个分支了。
```
$ git mr 51
From gitlab.com:owner/repository
* [new ref] refs/merge-requests/51/head -> mr/51
Switched to branch 'mr/51'
```
#### git-release
通过将 `commit``tag``push` 合并到一个命令中,`git release` 可以节省大量的按键来执行这三个命令,而这三个命令往往是依次运行的。
要用特定的 `<tagname>` 和自定义消息提交:
```
$ git release 0.1.0 -m <+ powerful feature added>
```
#### 其他附加功能
这只是该版本库中 60 多个 Git 附加功能中的四个命令。要访问 Git Extras 中的全部命令,请查看该源代码库中的 [Commands.md][8] 文件,或者在安装 Git Extras 后运行以下命令。
```
$ git extras --help
```
### 安装 Git 附加功能
使用 Git 附加功能的主要前提是安装了 Git 的命令行版本。如果你打算从源码中构建,还需要有额外的工具(例如:`make`)。
如果你使用的是最新版本的 macOS那么 Git 附加功能的安装最好使用 [Homebrew][9](和大多数开源工具一样)。
```
$ brew install git-extras
```
在 Linux 上,每个平台的原生包管理器中都有 Git Extras。有时你需要启用一个额外的仓库比如在 CentOS 上的 [EPEL][10],然后运行一条命令。
```
$ sudo yum install git-extras
```
其他 Linux 发行版、BSD 和其他平台的完整安装说明可以在该版本库的 [Installation.md][11] 文件中找到。
### 贡献
你是否你认为 Git 中有缺少的功能,并且已经构建了一个脚本来处理它?为什么不把它作为 Git Extras 发布版的一部分,与全世界分享呢?
要做到这一点,请将该功能贡献到 Git Extras 仓库中。更多具体细节请参见仓库中的 [CONTRIBUTING.md][12] 文件,但基本的操作方法很简单。
1. 创建一个处理该功能的 Bash 脚本。
2. 创建一个基本的 man 文件,让大家知道如何使用它。
3. 更新命令列表和补完脚本,让人们知道这个功能的存在。
4. 运行完整性检查,确保你没有破坏任何东西。
5. 为你的功能创建一个拉取请求。
向 Git Extras 贡献贡献,会让你的 Git 用户的生活更轻松一些。你可以在项目的 [README][13] 中了解更多。
--------------------------------------------------------------------------------
via: https://opensource.com/article/20/4/git-extras
作者:[Vince Power][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://opensource.com/users/vincepower
[b]: https://github.com/lujun9972
[1]: https://opensource.com/sites/default/files/styles/image-full-size/public/lead-images/laptop_screen_desk_work_chat_text.png?itok=UXqIDRDD (Person using a laptop)
[2]: https://en.wikipedia.org/wiki/Linus_Torvalds
[3]: https://git-scm.com/
[4]: https://github.com/tj
[5]: https://github.com/tj/git-extras
[6]: mailto:git@github.com
[7]: mailto:sampleAuthor@gmail.com
[8]: https://github.com/tj/git-extras/blob/master/Commands.md
[9]: https://brew.sh/
[10]: https://fedoraproject.org/wiki/EPEL
[11]: https://github.com/tj/git-extras/blob/master/Installation.md
[12]: https://github.com/tj/git-extras/blob/master/CONTRIBUTING.md
[13]: https://github.com/tj/git-extras/blob/master/Readme.md

View File

@@ -0,0 +1,91 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (MystiQ: A Free and Open Source Audio/Video Converter)
[#]: via: (https://itsfoss.com/mystiq/)
[#]: author: (Ankush Das https://itsfoss.com/author/ankush/)
MystiQ一个免费开源音频/视频转换器
======
_**简述MystiQ 是可用于 Linux 和 Windows 的新开源视频转换器工具。它的底层使用 FFMPEG并为你提供基于 Qt 的整洁干净的图形界面。**_
### MystiQ一个基于 QT 的 FFmpeg GUI 前端
![][1]
一个音频/视频转换工具可为跨多个平台的每位计算机用户提供方便。
出于同样的原因,我着重介绍 [MystiQ][2] 是个好主意,这是一个相对较新的视频/音频转换器工具,可用于 Linux 和 Windows。截至目前它还不支持 macOS但可能会在不久的将来出现。
MystiQ 是基于 [Qt 5 界面][4]的 [FFmpeg][3] 图形前端。 现在,你可以随时[在 Linux 命令行中安装并使用 ffmpeg][5],但这不是很舒服,是吗? 这就是为什么 [Handbrake][6] 和 MystiQ 之类的工具可以使我们的生活更轻松的原因。
由于 MystiQ 基于 FFmpeg因此你可以将其用于一些基本的视频编辑例如修剪、旋转等。
让我们来看看它的功能。
### MystiQ 视频转换器的功能
![][7]
即使 MystiQ 目前还算是一个新事物,但它也包含了一组很好的基本功能。以下它提供的:
* 视频转换
* 音频转换(也可从视频中提取音频)
* 支持格式MP4、WEBM、MKV、MP3、MOV、OGG、WAV、ASF、FLV、3GP、M4A 等。
* 跨平台Windows 和 Linux
* 适用于 32 位和 64 位系统的安装包
* 能够调整音频质量(采样率、比特率等)进行转换
* **基本视频编辑功能**(剪辑视频、插入字幕、旋转视频、缩放视频等)
* 将彩色视频转换为黑白
* 可轻松转换视频的多个预设以获得最佳质量或获得最佳压缩效果。
#### [在 Linux 中使用 SoundConverter 轻松转换音频文件格式][9]
如果你想将音频文件格式转换为 wav、mp3、ogg 或任何其他格式SoundConverter 是你在 Linux 中所需的工具。
### 安装 MystiQ
你可能没有在软件中心中找到它,但将它安装在 Linux 发行版上非常容易。
它提供了 **.AppImage** 文件和 **.deb/.rpm** 文件32 位和 64 位软件包)。如果你好奇想使用的话,可以阅读[如何使用 AppImage 文件][10]。
如果你想帮助他们测试软件进行改进,你还可以找到他们的 [GitHub 页面][11],并查看源码或任何近期的预发布软件包。
你可以在其官方网站下载适用于 Linux 和 Windows 的安装程序文件。
[下载 MystiQ][2]
**总结**
在本文中,我使用 [Pop!\_OS][12] 20.04 测试了 MytiQ 转换器,并且在转换视频和音频时没遇到问题。而且,对于像我这样的普通用户来说,它的转换速度足够快。
请尝试一下,让我知道你对它的想法!另外,如果你在 Linux 上一直使用其他工具转换视频和音频,那它是什么?
--------------------------------------------------------------------------------
via: https://itsfoss.com/mystiq/
作者:[Ankush Das][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/ankush/
[b]: https://github.com/lujun9972
[1]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/mystiq-converter-ft.jpg?ssl=1
[2]: https://mystiqapp.com/
[3]: https://www.ffmpeg.org/
[4]: https://www.qt.io/
[5]: https://itsfoss.com/ffmpeg/
[6]: https://itsfoss.com/handbrake/
[7]: https://i2.wp.com/itsfoss.com/wp-content/uploads/2020/04/mystiq-options.jpg?ssl=1
[9]: https://itsfoss.com/sound-converter-linux/
[10]: https://itsfoss.com/use-appimage-linux/
[11]: https://github.com/swl-x/MystiQ/
[12]: https://system76.com/pop

View File

@@ -0,0 +1,202 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (How to Check the Available Network Interfaces, Associated IP Addresses, MAC Addresses, and Interface Speed on Linux)
[#]: via: (https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-speed-ip-mac-address/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
如何在 Linux 上检查可用的网络接口、关联的 IP 地址、MAC 地址和接口速度
======
默认在设置服务器时,你将配置主网络接口。
这是每个人所做的构建工作的一部分。
有时出于各种原因,你可能需要配置额外的网络接口。
这可以是网络绑定/团队合作或高可用性,也可以是用于应用需求或备份的单独接口。
为此,你需要知道计算机有多少接口以及它们的配置速度。
有许多命令可检查可用的网络接口,但是我们仅使用 IP 命令。
稍后,我们将使用所有这些工具编写单独的文章。
在本教程中我们将向你显示可用网络网卡NIC信息例如接口名称、关联的 IP 地址、MAC 地址和接口速度。
### 什么是 IP 命令
**[IP 命令][1]**类似于 ifconfig, 用于分配静态 IP 地址、路由和默认网关等。
```
# ip a
1: lo: mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether fa:16:3e:a0:7d:5a brd ff:ff:ff:ff:ff:ff
inet 192.168.1.101/24 brd 192.168.1.101 scope global eth0
inet6 fe80::f816:3eff:fea0:7d5a/64 scope link
valid_lft forever preferred_lft forever
```
### 什么是 ethtool 命令
ethtool 用于查询或控制网络驱动或硬件设置。
```
# ethtool eth0
```
### 1如何在 Linux 上使用 IP 命令检查可用的网络接口
在不带任何参数的情况下运行 IP 命令时,它会提供大量信息,但是,如果仅需要可用的网络接口,请使用以下定制的 IP 命令。
```
# ip a |awk '/state UP/{print $2}'
eth0:
eth1:
```
### 2如何在 Linux 上使用 IP 命令检查网络接口的 IP 地址
如果只想查看 IP 地址分配给了哪个接口,请使用以下定制的 IP 命令。
```
# ip -o a show | cut -d ' ' -f 2,7
or
ip a |grep -i inet | awk '{print $7, $2}'
lo 127.0.0.1/8
192.168.1.101/24
192.168.1.102/24
```
### 3如何在 Linux 上使用 IP 命令检查网卡的 MAC 地址
如果只想查看网络接口名称和相应的 MAC 地址,请使用以下格式。
检查特定的网络接口的 MAC 地址。
```
# ip link show dev eth0 |awk '/link/{print $2}'
00:00:00:55:43:5c
```
检查所有网络接口的 MAC 地址。
```
# vi /opt/scripts/mac-addresses.sh
#!/bin/sh
ip a |awk '/state UP/{print $2}' | sed 's/://' | while read output;
do
echo $output:
ethtool -P $output
done
```
运行下面的 shell 脚本获取多个网络接口的 MAC 地址。
```
# sh /opt/scripts/mac-addresses.sh
eth0:
Permanent address: 00:00:00:55:43:5c
eth1:
Permanent address: 00:00:00:55:43:5d
```
### 4如何在 Linux 上使用 ethtool 命令检查网络接口速度
如果要在 Linux 上检查网络接口速度,请使用 ethtool 命令。
检查特定网络接口的速度。
```
# ethtool eth0 |grep "Speed:"
Speed: 10000Mb/s
```
检查所有网络接口速度。
```
# vi /opt/scripts/port-speed.sh
#!/bin/sh
ip a |awk '/state UP/{print $2}' | sed 's/://' | while read output;
do
echo $output:
ethtool $output |grep "Speed:"
done
```
运行以下 shell 脚本获取多个网络接口速度。
```
# sh /opt/scripts/port-speed.sh
eth0:
Speed: 10000Mb/s
eth1:
Speed: 10000Mb/s
```
### 5验证网卡信息的 Shell 脚本
通过此 **[shell 脚本][2]**,你可以收集上述所有信息,例如网络接口名称、网络接口的 IP 地址,网络接口的 MAC 地址以及网络接口的速度。
```
# vi /opt/scripts/nic-info.sh
#!/bin/sh
hostname
echo "-------------"
for iname in $(ip a |awk '/state UP/{print $2}')
do
echo "$iname"
ip a | grep -A2 $iname | awk '/inet/{print $2}'
ip a | grep -A2 $iname | awk '/link/{print $2}'
ethtool $iname |grep "Speed:"
done
```
运行以下 shell 脚本检查网卡信息。
```
# sh /opt/scripts/nic-info.sh
vps.2daygeek.com
----------------
eth0:
192.168.1.101/24
00:00:00:55:43:5c
Speed: 10000Mb/s
eth1:
192.168.1.102/24
00:00:00:55:43:5d
Speed: 10000Mb/s
```
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/linux-unix-check-network-interfaces-names-nic-speed-ip-mac-address/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/ip-command-configure-network-interface-usage-linux/
[2]: https://www.2daygeek.com/category/shell-script/

View File

@@ -0,0 +1,129 @@
[#]: collector: (lujun9972)
[#]: translator: (geekpi)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Things You Should Know About Ubuntu 20.04)
[#]: via: (https://itsfoss.com/ubuntu-20-04-faq/)
[#]: author: (Abhishek Prakash https://itsfoss.com/author/abhishek/)
关于 Ubuntu 20.04 你应该了解的事情
======
[Ubuntu 20.04][1] 即将发布,你可能对升级、安装等有一些问题和疑问。
我在各种社交媒体渠道上主持了一些问答环节,回答像你这样的读者的疑虑。
我将列出这些关于Ubuntu 20.04的常见问题,并给出答案。我希望它能帮助你消除你的疑虑。如果你仍有问题,请随时在下面的评论栏提问。
### Ubuntu 20.04 已回复的问题
![][2]
为了澄清一下,这里的一些答案也许受我个人意见的影响。如果你是一个有经验的 Ubuntu 用户,有些问题听起来可能有点愚蠢,但它对 Ubuntu 新用户不是这样。
#### Ubuntu 20.04 何时发布?
Ubuntu 20.04 LTS 于 2020 年 4 月 23 日发布。所有变种,如 Kubuntu、Lubuntu,、Xubuntu、Budgie、MATE 都将和 20.04 同一天发布。
#### Ubuntu 20.04 的系统要求是什么?
对于默认的 GNOME 版本,应至少具有 4GB 的内存、2 GHz 双核处理器和至少 25GB 的磁盘空间。
其他 [Ubuntu 变种][3]可能有不同的系统要求。
#### 我可以在 32 位系统上使用 Ubuntu 20.04 吗?
完全不行。你不能在 32 位系统上使用 Ubuntu 20.04。即使你使用的是 32 位 Ubuntu 18.04,也不能升级到 Ubuntu 20.04。过去几年有 32 位的系统 ISO。
![Error while upgrading 32-bit Ubuntu 18.04 to Ubuntu 20.04][4]
#### 我可以在Ubuntu 20.04上使用 Wine 吗?
是的,你仍然可以在 Ubuntu 20.04 上使用 Wine因为仍然有 32 位库,来用于 Wine 和 [Steam Play][5] 所需的软件包。
#### 我需要购买 Ubuntu 20.04 或许可证?
Ubuntu 是完全免费使用的。你不必像在 Windows 中那样购买许可证密钥或激活 Ubuntu。
Ubuntu 的下载页会请求你捐赠一些资金,如果你想捐赠一些钱来帮助开发这个系统,这完全取决于你。
#### GNOME 版本是什么?
Ubuntu 20.04 有 GNOME 3.36。
#### Ubuntu 20.04 的性能是否优于 Ubuntu 18.04
是的在几个方面。Ubuntu 20.04 安装速度更快,甚至加速更快。我在 4:40 的视频中展示了性能比较。
在 GNOME 3.36 中,滚动、窗口动画和其他 UI 元素更加流畅,并提供了更流畅的体验。
#### Ubuntu 20.04 将支持多长时间?
它是一个长期支持 LTS 版本,与任何 LTS 版本一样,它将在五年内得到支持。这意味着 Ubuntu 20.04 将在 2025 年 4 月之前获得安全和维护更新。
#### 升级到 Ubuntu 20.04 时,是否会丢失数据?
你可以从 Ubuntu 19.10 或 Ubuntu 18.04 升级到 Ubuntu 20.04。你无需创建 live USB 并从中安装。你所需要的是一个良好的互联网连接来下载约1.5GB 的数据。
从现有系统升级不会破坏你的文件。你应该会有所有文件,并且大多数现有软件应具有相同的版本或升级后的版本。
如果你使用了某些第三方工具或[其他 PPA][6],升级过程将禁用它们。如果 Ubuntu 20.04 适合这些其他存储库,那么可以再次启用它们。
升级大约需要一个小时,重启后,你将登录到新版本。
虽然你的数据不会被触碰,并且不会丢失系统文件和配置,但最好在外部设备备份重要数据。
#### 何时可以升级到 Ubuntu 20.04
![][7]
如果你正在使用 Ubuntu 19.10 并有正确的更新设置(如前面部分所述),那么应在 Ubuntu 18.04 后的几天内通知你升级到 Ubuntu 20.04。
对于 Ubuntu 18.04 用户,可能需要几周时间才能正式通知他们 Ubuntu 18.04 可用。可能,你可能会在第一个点版本 Ubuntu 20.04.1 后获得提示。
#### 如果我升级到 Ubuntu 20.04,我可以降级到 19.10 或 18.04 吗?
不行。虽然升级到新版本很容易,但无法选择降级。 如果你想回到 Ubuntu 18.04,你将重新[安装 Ubuntu18.04][8]。
#### 我使用的是 Ubuntu 18.04 LTS。我应该升级到 Ubuntu 20.04 LTS 吗?
这取决于你。如果你对 Ubuntu 20.04 中的新功能印象深刻,并希望上手尝试,那么你应该升级。
如果你想要一个更稳定的系统,我建议等待第一个点版本 Ubuntu 20.04.1,新版本将有 bug 修复。20.04.1 通常在 Ubuntu 20.04 发布后大约两个月到来。
其他情况下,我建议尽早升级到 Ubuntu 20.04。Ubuntu 20.04 具有更新的内核、性能改进,尤其是仓库中有更新版本的软件。
在外部磁盘上进行备份,并且有良好的互联网连接,升级不应成为问题。
#### 我应该重新安装 Ubuntu 20.04 还是从 18.04/19.10 升级到 Ubuntu
如果你可以选择,请备份数据,并重新安装 Ubuntu 20.04。
从现有版本升级到 20.04 是一个方便的选择。然而,在我看来,它仍然保留有一些旧版本的痕迹/包。全新安装更加干净。
#### 关于 Ubuntu 20.04 的任何其他问题?
如果你对 Ubuntu 20.04 有任何疑问,请随时在下面发表评论。如果你认为应该将其他信息添加到列表中,请让我知道。
--------------------------------------------------------------------------------
via: https://itsfoss.com/ubuntu-20-04-faq/
作者:[Abhishek Prakash][a]
选题:[lujun9972][b]
译者:[geekpi](https://github.com/geekpi)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://itsfoss.com/author/abhishek/
[b]: https://github.com/lujun9972
[1]: https://itsfoss.com/ubuntu-20-04-release-features/
[2]: https://i1.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu_20_04_faq.jpg?ssl=1
[3]: https://itsfoss.com/which-ubuntu-install/
[4]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/04/ubuntu-32-bit.jpg?ssl=1
[5]: https://itsfoss.com/steam-play/
[6]: https://itsfoss.com/ppa-guide/
[7]: https://i0.wp.com/itsfoss.com/wp-content/uploads/2020/03/upgrade-ubuntu-20-04.jpg?ssl=1
[8]: https://itsfoss.com/install-ubuntu/

View File

@@ -0,0 +1,89 @@
[#]: collector: (lujun9972)
[#]: translator: (wxy)
[#]: reviewer: ( )
[#]: publisher: ( )
[#]: url: ( )
[#]: subject: (Difference Between YUM and RPM Package Manager)
[#]: via: (https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/)
[#]: author: (Magesh Maruthamuthu https://www.2daygeek.com/author/magesh/)
YUM 和 RPM 包管理器的不同之处
======
软件包管理器在 Linux 系统中扮演着重要的角色。它允许你安装、更新、查看、搜索和删除软件包,以满足你的需求。
每个发行版都有自己的一套包管理器,依据你的 Linux 发行版来分别使用它们。
RPM 是最古老的传统软件包管理器之一,它是为基于 Red Hat 的系统设计的,如 Red Hat Enterprise LinuxRHEL、CentOS、Fedora 和 openSUSE它基于 suse Enterprise Linux等系统。但在依赖解析和包更新全系统更新/升级方面RPM 包管理器有一个突出的限制。
> 如果你想知道 [YUM 和 DNF 包管理器的区别][1]请参考该文章。
这意味着 yum 可以自动下载并安装所有需要的依赖项,但 rpm 会告诉你安装一个依赖项列表,然后你必须手动安装。
当你想用 [rpm 命令][2] 安装一组包时,这实际上是不可能的,而且很费时间。
这时,[YUM 包管理器][3] 就派上了用场,解决了这两个问题。
### 什么是 RPM
RPM 指的是 RPM Package Manager原名 Red Hat Package Manager是一个功能强大的命令行包管理工具是为 Red Hat 操作系统开发的。
它现在被用作许多 Linux 发行版的核心组件,如 Centos、Fedora、Oracle Linux、openSUSE 和 Mageia 等。
RPM 软件包管理器允许你在基于 RPM 的 Linux 系统上安装、升级、删除、查询和验证软件包。
RPM 文件的扩展名为 `.rpm`。RPM 包由一个存档文件组成,其中包含了一个特定包的库和依赖关系,这些库和依赖关系与系统上安装的其他包不冲突。
在 Linux 上有很多前端工具可以用来安装 RPM 包,与 RPM 工具相比,这些工具可以使安装过程更加高效,尤其是在处理依赖关系方面。
如果你想了解更多关于 Linux 发行版的前端包管理器的信息,请到下面的链接。
* [Linux 命令行包管理器列表][4]
如果你想了解 Linux 的 GUI 包管理器,请到下面的链接。
* [Linux GUI 包管理器列表][5]
### 什么是 YUM
Yum 是一个 Linux 操作系统上的自由开源的命令行包管理程序,它使用 RPM 包管理器。Yum 是一个 RPM 的前端工具,可以自动解决软件包的依赖关系。它可以从发行版官方仓库和其他第三方仓库中安装 RPM 软件包。
Yum 允许你在系统中安装、更新、搜索和删除软件包。如果你想让你的系统保持更新,你可以通过 yum-cron 启用自动更新。
此外,如果你需要的话,它还允许你在 `yum update` 中排除一个或多个软件包。
Yum 是默认安装的,你不需要安装它。
编号 | RPM | YUM
--- | --- | ---
1 | 红帽在 1997 年引入了 RPM | Yellowdog UPdaterYUP开发于 1999-2001 年YUM 于 2003 年取代了原来的 YUP 工具
2 | RPM 代表 RPM Package manager原名 Red Hat package manager | YUM 代表 Yellowdog Updater Modified
3 | RPM 文件的命名规则如下,`httpd-2.4.6-92.el7.x86_64.rpm``httpd` - 实际的包名;`2.4.6` - 包发布版本号;`92` - 包发布子版本号;`el7` - Red Hat 版本;`x86_64` - 硬件架构;`rpm` - 文件扩展名 | 后台使用 rpm 数据库
4 | 不解析依赖关系,你必须手动安装依赖 | 可以自动解析依赖关系并同时安装它们(任何包都会和它的依赖关系一起安装)
5 | 允许你同时安装多个版本的软件包 | 不允许,并显示该软件包已经安装
6 | 当使用 RPM 命令安装一个软件包时,你必须提供 `.rpm` 软件包的确切位置 | 你可以安装仓库中的任何软件包,而你只需要知道软件包的名称就可以了
7 | RPM 不依赖于 YUM | 它是一个前端工具,在后台使用 RPM 包管理器来管理包
8 | RPM 在安装包的管理方面比较难 | YUM 是最简单的管理 RPM 包的方法
9 | RPM 不能让你将整个系统升级到最新的版本 | YUM 可以让你将系统升级到最新的版本(例如 7.0 到 7.x 的小版本升级)
10 | RPM 不能让你自动更新/升级安装在系统上的软件包 | YUM 可以让你自动更新/升级系统上的更新
11 | 不使用在线仓库来执行任何操作 | 完全依赖在线仓库来完成所有的工作
12 | RPM 是一种包格式,它也是一个底层的包管理器,只做基本的事情 | 这是一个上层的包管理器前端,它可以完成你所需要的一切工作
--------------------------------------------------------------------------------
via: https://www.2daygeek.com/comparison-difference-between-yum-vs-rpm/
作者:[Magesh Maruthamuthu][a]
选题:[lujun9972][b]
译者:[wxy](https://github.com/wxy)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出
[a]: https://www.2daygeek.com/author/magesh/
[b]: https://github.com/lujun9972
[1]: https://www.2daygeek.com/comparison-difference-between-dnf-vs-yum/
[2]: https://www.2daygeek.com/linux-rpm-command-examples-manage-packages-fedora-centos-rhel-systems/
[3]: https://www.2daygeek.com/linux-yum-command-examples-manage-packages-rhel-centos-systems/
[4]: https://www.2daygeek.com/list-of-command-line-package-manager-for-linux/
[5]: https://www.2daygeek.com/list-of-graphical-frontend-tool-for-linux-package-manager/